react-linear-feedback 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,130 @@
1
+ "use strict";var LinearFeedback=(()=>{var Te=Object.defineProperty;var Vn=Object.getOwnPropertyDescriptor;var jn=Object.getOwnPropertyNames;var qn=Object.prototype.hasOwnProperty;var Xn=(e,t)=>{for(var n in t)Te(e,n,{get:t[n],enumerable:!0})},Yn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of jn(t))!qn.call(e,a)&&a!==n&&Te(e,a,{get:()=>t[a],enumerable:!(r=Vn(t,a))||r.enumerable});return e};var Gn=e=>Yn(Te({},"__esModule",{value:!0}),e);var Ho={};Xn(Ho,{destroy:()=>Ge,init:()=>Ce});var he,w,ft,Kn,H,st,dt,pt,Ae,fe,ee,_t,Ie,Fe,Pe,Jn,pe={},_e=[],Zn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,te=Array.isArray;function $(e,t){for(var n in t)e[n]=t[n];return e}function Me(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ne(e,t,n){var r,a,o,s={};for(o in t)o=="key"?r=t[o]:o=="ref"?a=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?he.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)s[o]===void 0&&(s[o]=e.defaultProps[o]);return de(e,s,r,a,null)}function de(e,t,n,r,a){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++ft,__i:-1,__u:0};return a==null&&w.vnode!=null&&w.vnode(o),o}function F(e){return e.children}function L(e,t){this.props=e,this.context=t}function G(e,t){if(t==null)return e.__?G(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?G(e):null}function Qn(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],a=[],o=$({},t);o.__v=t.__v+1,w.vnode&&w.vnode(o),Le(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??G(t),!!(32&t.__u),a),o.__v=t.__v,o.__.__k[o.__i]=o,gt(r,o,a),t.__e=t.__=null,o.__e!=n&&mt(o)}}function mt(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),mt(e)}function lt(e){(!e.__d&&(e.__d=!0)&&H.push(e)&&!me.__r++||st!=w.debounceRendering)&&((st=w.debounceRendering)||dt)(me)}function me(){try{for(var e,t=1;H.length;)H.length>t&&H.sort(pt),e=H.shift(),t=H.length,Qn(e)}finally{H.length=me.__r=0}}function ht(e,t,n,r,a,o,s,i,f,u,c){var l,p,d,b,m,y,h,v=r&&r.__k||_e,x=t.length;for(f=er(n,t,v,f,x),l=0;l<x;l++)(d=n.__k[l])!=null&&(p=d.__i!=-1&&v[d.__i]||pe,d.__i=l,y=Le(e,d,p,a,o,s,i,f,u,c),b=d.__e,d.ref&&p.ref!=d.ref&&(p.ref&&Ue(p.ref,null,d),c.push(d.ref,d.__c||b,d)),m==null&&b!=null&&(m=b),(h=!!(4&d.__u))||p.__k===d.__k?(f=bt(d,f,e,h),h&&p.__e&&(p.__e=null)):typeof d.type=="function"&&y!==void 0?f=y:b&&(f=b.nextSibling),d.__u&=-7);return n.__e=m,f}function er(e,t,n,r,a){var o,s,i,f,u,c=n.length,l=c,p=0;for(e.__k=new Array(a),o=0;o<a;o++)(s=t[o])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[o]=de(null,s,null,null,null):te(s)?s=e.__k[o]=de(F,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[o]=de(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[o]=s,f=o+p,s.__=e,s.__b=e.__b+1,i=null,(u=s.__i=tr(s,n,f,l))!=-1&&(l--,(i=n[u])&&(i.__u|=2)),i==null||i.__v==null?(u==-1&&(a>c?p--:a<c&&p++),typeof s.type!="function"&&(s.__u|=4)):u!=f&&(u==f-1?p--:u==f+1?p++:(u>f?p--:p++,s.__u|=4))):e.__k[o]=null;if(l)for(o=0;o<c;o++)(i=n[o])!=null&&(2&i.__u)==0&&(i.__e==r&&(r=G(i)),vt(i,i));return r}function bt(e,t,n,r){var a,o;if(typeof e.type=="function"){for(a=e.__k,o=0;a&&o<a.length;o++)a[o]&&(a[o].__=e,t=bt(a[o],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=G(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function re(e,t){return t=t||[],e==null||typeof e=="boolean"||(te(e)?e.some(function(n){re(n,t)}):t.push(e)),t}function tr(e,t,n,r){var a,o,s,i=e.key,f=e.type,u=t[n],c=u!=null&&(2&u.__u)==0;if(u===null&&i==null||c&&i==u.key&&f==u.type)return n;if(r>(c?1:0)){for(a=n-1,o=n+1;a>=0||o<t.length;)if((u=t[s=a>=0?a--:o++])!=null&&(2&u.__u)==0&&i==u.key&&f==u.type)return s}return-1}function ct(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Zn.test(t)?n:n+"px"}function ue(e,t,n,r,a){var o,s;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||ct(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||ct(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(_t,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n[ee]=r[ee]:(n[ee]=Ie,e.addEventListener(t,o?Pe:Fe,o)):e.removeEventListener(t,o?Pe:Fe,o);else{if(a=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function ut(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[fe]==null)t[fe]=Ie++;else if(t[fe]<n[ee])return;return n(w.event?w.event(t):t)}}}function Le(e,t,n,r,a,o,s,i,f,u){var c,l,p,d,b,m,y,h,v,x,k,R,N,A,O,T=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(f=!!(32&n.__u),o=[i=t.__e=n.__e]),(c=w.__b)&&c(t);e:if(typeof T=="function")try{if(h=t.props,v=T.prototype&&T.prototype.render,x=(c=T.contextType)&&r[c.__c],k=c?x?x.props.value:c.__:r,n.__c?y=(l=t.__c=n.__c).__=l.__E:(v?t.__c=l=new T(h,k):(t.__c=l=new L(h,k),l.constructor=T,l.render=rr),x&&x.sub(l),l.state||(l.state={}),l.__n=r,p=l.__d=!0,l.__h=[],l._sb=[]),v&&l.__s==null&&(l.__s=l.state),v&&T.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=$({},l.__s)),$(l.__s,T.getDerivedStateFromProps(h,l.__s))),d=l.props,b=l.state,l.__v=t,p)v&&T.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),v&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(v&&T.getDerivedStateFromProps==null&&h!==d&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(h,k),t.__v==n.__v||!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(h,l.__s,k)===!1){t.__v!=n.__v&&(l.props=h,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(M){M&&(M.__=t)}),_e.push.apply(l.__h,l._sb),l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(h,l.__s,k),v&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(d,b,m)})}if(l.context=k,l.props=h,l.__P=e,l.__e=!1,R=w.__r,N=0,v)l.state=l.__s,l.__d=!1,R&&R(t),c=l.render(l.props,l.state,l.context),_e.push.apply(l.__h,l._sb),l._sb=[];else do l.__d=!1,R&&R(t),c=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++N<25);l.state=l.__s,l.getChildContext!=null&&(r=$($({},r),l.getChildContext())),v&&!p&&l.getSnapshotBeforeUpdate!=null&&(m=l.getSnapshotBeforeUpdate(d,b)),A=c!=null&&c.type===F&&c.key==null?yt(c.props.children):c,i=ht(e,te(A)?A:[A],t,n,r,a,o,s,i,f,u),l.base=t.__e,t.__u&=-161,l.__h.length&&s.push(l),y&&(l.__E=l.__=null)}catch(M){if(t.__v=null,f||o!=null)if(M.then){for(t.__u|=f?160:128;i&&i.nodeType==8&&i.nextSibling;)i=i.nextSibling;o[o.indexOf(i)]=null,t.__e=i}else{for(O=o.length;O--;)Me(o[O]);De(t)}else t.__e=n.__e,t.__k=n.__k,M.then||De(t);w.__e(M,t,n)}else o==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):i=t.__e=nr(n.__e,t,n,r,a,o,s,f,u);return(c=w.diffed)&&c(t),128&t.__u?void 0:i}function De(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(De))}function gt(e,t,n){for(var r=0;r<n.length;r++)Ue(n[r],n[++r],n[++r]);w.__c&&w.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(o){o.call(a)})}catch(o){w.__e(o,a.__v)}})}function yt(e){return typeof e!="object"||e==null||e.__b>0?e:te(e)?e.map(yt):e.constructor!==void 0?null:$({},e)}function nr(e,t,n,r,a,o,s,i,f){var u,c,l,p,d,b,m,y=n.props||pe,h=t.props,v=t.type;if(v=="svg"?a="http://www.w3.org/2000/svg":v=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),o!=null){for(u=0;u<o.length;u++)if((d=o[u])&&"setAttribute"in d==!!v&&(v?d.localName==v:d.nodeType==3)){e=d,o[u]=null;break}}if(e==null){if(v==null)return document.createTextNode(h);e=document.createElementNS(a,v,h.is&&h),i&&(w.__m&&w.__m(t,o),i=!1),o=null}if(v==null)y===h||i&&e.data==h||(e.data=h);else{if(o=v=="textarea"&&h.defaultValue!=null?null:o&&he.call(e.childNodes),!i&&o!=null)for(y={},u=0;u<e.attributes.length;u++)y[(d=e.attributes[u]).name]=d.value;for(u in y)d=y[u],u=="dangerouslySetInnerHTML"?l=d:u=="children"||u in h||u=="value"&&"defaultValue"in h||u=="checked"&&"defaultChecked"in h||ue(e,u,null,d,a);for(u in h)d=h[u],u=="children"?p=d:u=="dangerouslySetInnerHTML"?c=d:u=="value"?b=d:u=="checked"?m=d:i&&typeof d!="function"||y[u]===d||ue(e,u,d,y[u],a);if(c)i||l&&(c.__html==l.__html||c.__html==e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(l&&(e.innerHTML=""),ht(t.type=="template"?e.content:e,te(p)?p:[p],t,n,r,v=="foreignObject"?"http://www.w3.org/1999/xhtml":a,o,s,o?o[0]:n.__k&&G(n,0),i,f),o!=null)for(u=o.length;u--;)Me(o[u]);i&&v!="textarea"||(u="value",v=="progress"&&b==null?e.removeAttribute("value"):b!=null&&(b!==e[u]||v=="progress"&&!b||v=="option"&&b!=y[u])&&ue(e,u,b,y[u],a),u="checked",m!=null&&m!=e[u]&&ue(e,u,m,y[u],a))}return e}function Ue(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(a){w.__e(a,n)}}function vt(e,t,n){var r,a;if(w.unmount&&w.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Ue(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){w.__e(o,t)}r.base=r.__P=null}if(r=e.__k)for(a=0;a<r.length;a++)r[a]&&vt(r[a],t,n||typeof e.type!="function");n||Me(e.__e),e.__c=e.__=e.__e=void 0}function rr(e,t,n){return this.constructor(e,n)}function Oe(e,t,n){var r,a,o,s;t==document&&(t=document.documentElement),w.__&&w.__(e,t),a=(r=typeof n=="function")?null:n&&n.__k||t.__k,o=[],s=[],Le(t,e=(!r&&n||t).__k=ne(F,null,[e]),a||pe,pe,t.namespaceURI,!r&&n?[n]:a?null:t.firstChild?he.call(t.childNodes):null,o,!r&&n?n:a?a.__e:t.firstChild,r,s),gt(o,e,s)}he=_e.slice,w={__e:function(e,t,n,r){for(var a,o,s;t=t.__;)if((a=t.__c)&&!a.__)try{if((o=a.constructor)&&o.getDerivedStateFromError!=null&&(a.setState(o.getDerivedStateFromError(e)),s=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,r||{}),s=a.__d),s)return a.__E=a}catch(i){e=i}throw e}},ft=0,Kn=function(e){return e!=null&&e.constructor===void 0},L.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=$({},this.state),typeof e=="function"&&(e=e($({},n),this.props)),e&&$(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),lt(this))},L.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),lt(this))},L.prototype.render=F,H=[],dt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,pt=function(e,t){return e.__v.__b-t.__v.__b},me.__r=0,Ae=Math.random().toString(8),fe="__d"+Ae,ee="__a"+Ae,_t=/(PointerCapture)$|Capture$/i,Ie=0,Fe=ut(!1),Pe=ut(!0),Jn=0;var oe,E,$e,wt,ge=0,Tt=[],C=w,xt=C.__b,kt=C.__r,St=C.diffed,Et=C.__c,Ct=C.unmount,Nt=C.__;function He(e,t){C.__h&&C.__h(E,e,ge||t),ge=0;var n=E.__H||(E.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function P(e){return ge=1,At(Dt,e)}function At(e,t,n){var r=He(oe++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Dt(void 0,t),function(i){var f=r.__N?r.__N[0]:r.__[0],u=r.t(f,i);f!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=E,!E.__f)){var a=function(i,f,u){if(!r.__c.__H)return!0;var c=r.__c.__H.__.filter(function(p){return p.__c});if(c.every(function(p){return!p.__N}))return!o||o.call(this,i,f,u);var l=r.__c.props!==i;return c.some(function(p){if(p.__N){var d=p.__[0];p.__=p.__N,p.__N=void 0,d!==p.__[0]&&(l=!0)}}),o&&o.call(this,i,f,u)||l};E.__f=!0;var o=E.shouldComponentUpdate,s=E.componentWillUpdate;E.componentWillUpdate=function(i,f,u){if(this.__e){var c=o;o=void 0,a(i,f,u),o=c}s&&s.call(this,i,f,u)},E.shouldComponentUpdate=a}return r.__N||r.__}function W(e,t){var n=He(oe++,3);!C.__s&&Pt(n.__H,t)&&(n.__=e,n.u=t,E.__H.__h.push(n))}function q(e){return ge=5,Ft(function(){return{current:e}},[])}function Ft(e,t){var n=He(oe++,7);return Pt(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function or(){for(var e;e=Tt.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(be),t.__h.some(We),t.__h=[]}catch(n){t.__h=[],C.__e(n,e.__v)}}}C.__b=function(e){E=null,xt&&xt(e)},C.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Nt&&Nt(e,t)},C.__r=function(e){kt&&kt(e),oe=0;var t=(E=e.__c).__H;t&&($e===E?(t.__h=[],E.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(be),t.__h.some(We),t.__h=[],oe=0)),$e=E},C.diffed=function(e){St&&St(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Tt.push(t)!==1&&wt===C.requestAnimationFrame||((wt=C.requestAnimationFrame)||ar)(or)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),$e=E=null},C.__c=function(e,t){t.some(function(n){try{n.__h.some(be),n.__h=n.__h.filter(function(r){return!r.__||We(r)})}catch(r){t.some(function(a){a.__h&&(a.__h=[])}),t=[],C.__e(r,n.__v)}}),Et&&Et(e,t)},C.unmount=function(e){Ct&&Ct(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{be(r)}catch(a){t=a}}),n.__H=void 0,t&&C.__e(t,n.__v))};var Rt=typeof requestAnimationFrame=="function";function ar(e){var t,n=function(){clearTimeout(r),Rt&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Rt&&(t=requestAnimationFrame(n))}function be(e){var t=E,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),E=t}function We(e){var t=E;e.__c=e.__(),E=t}function Pt(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Dt(e,t){return typeof t=="function"?t(e):t}function lr(e,t){for(var n in t)e[n]=t[n];return e}function It(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function Mt(e,t){this.props=e,this.context=t}(Mt.prototype=new L).isPureReactComponent=!0,Mt.prototype.shouldComponentUpdate=function(e,t){return It(this.props,e)||It(this.state,t)};var Lt=w.__b;w.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Lt&&Lt(e)};var na=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var cr=w.__e;w.__e=function(e,t,n,r){if(e.then){for(var a,o=t;o=o.__;)if((a=o.__c)&&a.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),a.__c(e,t)}cr(e,t,n,r)};var Ut=w.unmount;function zt(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=lr({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return zt(r,t,n)})),e}function Vt(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Vt(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Be(){this.__u=0,this.o=null,this.__b=null}function jt(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function ye(){this.i=null,this.l=null}w.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Ut&&Ut(e)},(Be.prototype=new L).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var a=jt(r.__v),o=!1,s=function(){o||r.__z||(o=!0,n.__R=null,a?a(f):f())};n.__R=s;var i=n.__P;n.__P=null;var f=function(){if(!--r.__u){if(r.state.__a){var u=r.state.__a;r.__v.__k[0]=Vt(u,u.__c.__P,u.__c.__O)}var c;for(r.setState({__a:r.__b=null});c=r.o.pop();)c.__P=i,c.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},Be.prototype.componentWillUnmount=function(){this.o=[]},Be.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=zt(this.__b,n,r.__O=r.__P)}this.__b=null}var a=t.__a&&ne(F,null,e.fallback);return a&&(a.__u&=-33),[ne(F,null,t.__a?null:e.children),a]};var Ot=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(ye.prototype=new L).__a=function(e){var t=this,n=jt(t.__v),r=t.l.get(e);return r[0]++,function(a){var o=function(){t.props.revealOrder?(r.push(a),Ot(t,e,r)):a()};n?n(o):o()}},ye.prototype.render=function(e){this.i=null,this.l=new Map;var t=re(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},ye.prototype.componentDidUpdate=ye.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Ot(e,n,t)})};var ur=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,fr=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,dr=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,pr=/[A-Z0-9]/g,_r=typeof document<"u",mr=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function qt(e,t,n){return t.__k==null&&(t.textContent=""),Oe(e,t),typeof n=="function"&&n(),e?e.__c:null}L.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(L.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var $t=w.event;w.event=function(e){return $t&&(e=$t(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Xt,hr={configurable:!0,get:function(){return this.class}},Wt=w.vnode;w.vnode=function(e){typeof e.type=="string"&&(function(t){var n=t.props,r=t.type,a={},o=r.indexOf("-")==-1;for(var s in n){var i=n[s];if(!(s==="value"&&"defaultValue"in n&&i==null||_r&&s==="children"&&r==="noscript"||s==="class"||s==="className")){var f=s.toLowerCase();s==="defaultValue"&&"value"in n&&n.value==null?s="value":s==="download"&&i===!0?i="":f==="translate"&&i==="no"?i=!1:f[0]==="o"&&f[1]==="n"?f==="ondoubleclick"?s="ondblclick":f!=="onchange"||r!=="input"&&r!=="textarea"||mr(n.type)?f==="onfocus"?s="onfocusin":f==="onblur"?s="onfocusout":dr.test(s)&&(s=f):f=s="oninput":o&&fr.test(s)?s=s.replace(pr,"-$&").toLowerCase():i===null&&(i=void 0),f==="oninput"&&a[s=f]&&(s="oninputCapture"),a[s]=i}}r=="select"&&(a.multiple&&Array.isArray(a.value)&&(a.value=re(n.children).forEach(function(u){u.props.selected=a.value.indexOf(u.props.value)!=-1})),a.defaultValue!=null&&(a.value=re(n.children).forEach(function(u){u.props.selected=a.multiple?a.defaultValue.indexOf(u.props.value)!=-1:a.defaultValue==u.props.value}))),n.class&&!n.className?(a.class=n.class,Object.defineProperty(a,"className",hr)):n.className&&(a.class=a.className=n.className),t.props=a})(e),e.$$typeof=ur,Wt&&Wt(e)};var Ht=w.__r;w.__r=function(e){Ht&&Ht(e),Xt=e.__c};var Bt=w.diffed;w.diffed=function(e){Bt&&Bt(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),Xt=null};function Yt(e){return!!e.__k&&(Oe(null,e),!0)}function Gt(e){return{render:function(t){qt(t,e)},unmount:function(){Yt(e)}}}var Jt="data-feedback-overlay";function Kt(e){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):e.replace(/[^\w-]/g,t=>`\\${t}`)}function br(e,t=5){let n=[],r=e;for(;r&&n.length<t&&r!==document.body&&r!==document.documentElement;){let a=r.getAttribute("data-testid");if(a)return n.unshift(`[data-testid="${Kt(a)}"]`),n.join(" > ");if(r.id)return n.unshift(`#${Kt(r.id)}`),n.join(" > ");let o=r.tagName.toLowerCase(),s=r.parentElement;if(s){let i=Array.from(s.children).filter(f=>f.tagName===r.tagName);i.length>1&&(o+=`:nth-of-type(${i.indexOf(r)+1})`)}n.unshift(o),r=s}return n.join(" > ")}function gr(e,t){return document.elementsFromPoint(e,t).find(r=>!r.closest(`[${Jt}]`))??null}function Zt(e,t){let n=gr(e,t);return n&&br(n)||null}var ze=Jt;var an="[modern-screenshot]",B=typeof window<"u",yr=B&&"Worker"in window,ua=B&&"atob"in window,fa=B&&"btoa"in window,qe=B?window.navigator?.userAgent:"",sn=qe.includes("Chrome"),ve=qe.includes("AppleWebKit")&&!sn,Xe=qe.includes("Firefox"),vr=e=>e&&"__CONTEXT__"in e,wr=e=>e.constructor.name==="CSSFontFaceRule",xr=e=>e.constructor.name==="CSSImportRule",kr=e=>e.constructor.name==="CSSLayerBlockRule",U=e=>e.nodeType===1,le=e=>typeof e.className=="object",ln=e=>e.tagName==="image",Sr=e=>e.tagName==="use",ae=e=>U(e)&&typeof e.style<"u"&&!le(e),Er=e=>e.nodeType===8,Cr=e=>e.nodeType===3,J=e=>e.tagName==="IMG",we=e=>e.tagName==="VIDEO",Nr=e=>e.tagName==="CANVAS",Rr=e=>e.tagName==="TEXTAREA",Tr=e=>e.tagName==="INPUT",Ar=e=>e.tagName==="STYLE",Fr=e=>e.tagName==="SCRIPT",Pr=e=>e.tagName==="SELECT",Dr=e=>e.tagName==="SLOT",Ir=e=>e.tagName==="IFRAME",Mr=(...e)=>console.warn(an,...e);function Lr(e){let t=e?.createElement?.("canvas");return t&&(t.height=t.width=1),!!t&&"toDataURL"in t&&!!t.toDataURL("image/webp").includes("image/webp")}var Ve=e=>e.startsWith("data:");function cn(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(B&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!B)return e;let n=xe().implementation.createHTMLDocument(),r=n.createElement("base"),a=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(a),t&&(r.href=t),a.href=e,a.href}function xe(e){return(e&&U(e)?e?.ownerDocument:e)??window.document}var ke="http://www.w3.org/2000/svg";function Ur(e,t,n){let r=xe(n).createElementNS(ke,"svg");return r.setAttributeNS(null,"width",e.toString()),r.setAttributeNS(null,"height",t.toString()),r.setAttributeNS(null,"viewBox",`0 0 ${e} ${t}`),r}function Or(e,t){let n=new XMLSerializer().serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}function $r(e,t){return new Promise((n,r)=>{let a=new FileReader;a.onload=()=>n(a.result),a.onerror=()=>r(a.error),a.onabort=()=>r(new Error(`Failed read blob to ${t}`)),t==="dataUrl"?a.readAsDataURL(e):t==="arrayBuffer"&&a.readAsArrayBuffer(e)})}var Wr=e=>$r(e,"dataUrl");function K(e,t){let n=xe(t).createElement("img");return n.decoding="sync",n.loading="eager",n.src=e,n}function ie(e,t){return new Promise(n=>{let{timeout:r,ownerDocument:a,onError:o,onWarn:s}=t??{},i=typeof e=="string"?K(e,xe(a)):e,f=null,u=null;function c(){n(i),f&&clearTimeout(f),u?.()}if(r&&(f=setTimeout(c,r)),we(i)){let l=i.currentSrc||i.src;if(!l)return i.poster?ie(i.poster,t).then(n):c();if(i.readyState>=2)return c();let p=c,d=b=>{s?.("Failed video load",l,b),o?.(b),c()};u=()=>{i.removeEventListener("loadeddata",p),i.removeEventListener("error",d)},i.addEventListener("loadeddata",p,{once:!0}),i.addEventListener("error",d,{once:!0})}else{let l=ln(i)?i.href.baseVal:i.currentSrc||i.src;if(!l)return c();let p=async()=>{if(J(i)&&"decode"in i)try{await i.decode()}catch(b){s?.("Failed to decode image, trying to render anyway",i.dataset.originalSrc||l,b)}c()},d=b=>{s?.("Failed image load",i.dataset.originalSrc||l,b),c()};if(J(i)&&i.complete)return p();u=()=>{i.removeEventListener("load",p),i.removeEventListener("error",d)},i.addEventListener("load",p,{once:!0}),i.addEventListener("error",d,{once:!0})}})}async function Hr(e,t){ae(e)&&(J(e)||we(e)?await ie(e,t):await Promise.all(["img","video"].flatMap(n=>Array.from(e.querySelectorAll(n)).map(r=>ie(r,t)))))}var un=(function(){let t=0,n=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${n()}${t}`)})();function fn(e){return e?.split(",").map(t=>t.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}var Qt=0;function Br(e){let t=`${an}[#${Qt}]`;return Qt++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...n)=>e&&Mr(...n)}}function zr(e){return{cache:e?"no-cache":"force-cache"}}async function dn(e,t){return vr(e)?e:Vr(e,{...t,autoDestruct:!0})}async function Vr(e,t){let{scale:n=1,workerUrl:r,workerNumber:a=1}=t||{},o=!!t?.debug,s=t?.features??!0,i=e.ownerDocument??(B?window.document:void 0),f=e.ownerDocument?.defaultView??(B?window:void 0),u=new Map,c={width:0,height:0,quality:1,type:"image/png",scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:o,fetch:{requestInit:zr(t?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:a,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:Br(o),node:e,ownerDocument:i,ownerWindow:f,dpi:n===1?null:96*n,svgStyleElement:pn(i),svgDefsElement:i?.createElementNS(ke,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:yr&&r&&a?a:0})].map(()=>{try{let d=new Worker(r);return d.onmessage=async b=>{let{url:m,result:y}=b.data;y?u.get(m)?.resolve?.(y):u.get(m)?.reject?.(new Error(`Error receiving message from worker: ${m}`))},d.onmessageerror=b=>{let{url:m}=b.data;u.get(m)?.reject?.(new Error(`Error receiving message from worker: ${m}`))},d}catch(d){return c.log.warn("Failed to new Worker",d),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[Lr(i)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:u,drawImageCount:0,tasks:[],features:s,isEnable:d=>d==="restoreScrollPosition"?typeof s=="boolean"?!1:s[d]??!1:typeof s=="boolean"?s:s[d]??!0,shadowRoots:[]};c.log.time("wait until load"),await Hr(e,{timeout:c.timeout,onWarn:c.log.warn}),c.log.timeEnd("wait until load");let{width:l,height:p}=jr(e,c);return c.width=l,c.height=p,c}function pn(e){if(!e)return;let t=e.createElement("style"),n=t.ownerDocument.createTextNode(`
2
+ .______background-clip--text {
3
+ background-clip: text;
4
+ -webkit-background-clip: text;
5
+ }
6
+ `);return t.appendChild(n),t}function jr(e,t){let{width:n,height:r}=t;if(U(e)&&(!n||!r)){let a=e.getBoundingClientRect();n=n||a.width||Number(e.getAttribute("width"))||0,r=r||a.height||Number(e.getAttribute("height"))||0}return{width:n,height:r}}async function qr(e,t){let{log:n,timeout:r,drawImageCount:a,drawImageInterval:o}=t;n.time("image to canvas");let s=await ie(e,{timeout:r,onWarn:t.log.warn}),{canvas:i,context2d:f}=Xr(e.ownerDocument,t),u=()=>{try{f?.drawImage(s,0,0,i.width,i.height)}catch(c){t.log.warn("Failed to drawImage",c)}};if(u(),t.isEnable("fixSvgXmlDecode"))for(let c=0;c<a;c++)await new Promise(l=>{setTimeout(()=>{f?.clearRect(0,0,i.width,i.height),u(),l()},c+o)});return t.drawImageCount=0,n.timeEnd("image to canvas"),i}function Xr(e,t){let{width:n,height:r,scale:a,backgroundColor:o,maximumCanvasSize:s}=t,i=e.createElement("canvas");i.width=Math.floor(n*a),i.height=Math.floor(r*a),i.style.width=`${n}px`,i.style.height=`${r}px`,s&&(i.width>s||i.height>s)&&(i.width>s&&i.height>s?i.width>i.height?(i.height*=s/i.width,i.width=s):(i.width*=s/i.height,i.height=s):i.width>s?(i.height*=s/i.width,i.width=s):(i.width*=s/i.height,i.height=s));let f=i.getContext("2d");return f&&o&&(f.fillStyle=o,f.fillRect(0,0,i.width,i.height)),{canvas:i,context2d:f}}function _n(e,t){if(e.ownerDocument)try{let o=e.toDataURL();if(o!=="data:,")return K(o,e.ownerDocument)}catch(o){t.log.warn("Failed to clone canvas",o)}let n=e.cloneNode(!1),r=e.getContext("2d"),a=n.getContext("2d");try{return r&&a&&a.putImageData(r.getImageData(0,0,e.width,e.height),0,0),n}catch(o){t.log.warn("Failed to clone canvas",o)}return n}function Yr(e,t){try{if(e?.contentDocument?.documentElement)return Ye(e.contentDocument.documentElement,t)}catch(n){t.log.warn("Failed to clone iframe",n)}return e.cloneNode(!1)}function Gr(e){let t=e.cloneNode(!1);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager"),t}async function Kr(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return K(e.poster,e.ownerDocument);let n=e.cloneNode(!1);n.crossOrigin="anonymous",e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc);let r=n.ownerDocument;if(r){let a=!0;if(await ie(n,{onError:()=>a=!1,onWarn:t.log.warn}),!a)return e.poster?K(e.poster,e.ownerDocument):n;n.currentTime=e.currentTime,await new Promise(s=>{n.addEventListener("seeked",s,{once:!0})});let o=r.createElement("canvas");o.width=e.offsetWidth,o.height=e.offsetHeight;try{let s=o.getContext("2d");s&&s.drawImage(n,0,0,o.width,o.height)}catch(s){return t.log.warn("Failed to clone video",s),e.poster?K(e.poster,e.ownerDocument):n}return _n(o,t)}return n}function Jr(e,t){return Nr(e)?_n(e,t):Ir(e)?Yr(e,t):J(e)?Gr(e):we(e)?Kr(e,t):e.cloneNode(!1)}function Zr(e){let t=e.sandbox;if(!t){let{ownerDocument:n}=e;try{n&&(t=n.createElement("iframe"),t.id=`__SANDBOX__${un()}`,t.width="0",t.height="0",t.style.visibility="hidden",t.style.position="fixed",n.body.appendChild(t),t.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',e.sandbox=t)}catch(r){e.log.warn("Failed to getSandBox",r)}}return t}var Qr=["width","height","-webkit-text-fill-color"],eo=["stroke","fill"];function mn(e,t,n){let{defaultComputedStyles:r}=n,a=e.nodeName.toLowerCase(),o=le(e)&&a!=="svg",s=o?eo.map(m=>[m,e.getAttribute(m)]).filter(([,m])=>m!==null):[],i=[o&&"svg",a,s.map((m,y)=>`${m}=${y}`).join(","),t].filter(Boolean).join(":");if(r.has(i))return r.get(i);let u=Zr(n)?.contentWindow;if(!u)return new Map;let c=u?.document,l,p;o?(l=c.createElementNS(ke,"svg"),p=l.ownerDocument.createElementNS(l.namespaceURI,a),s.forEach(([m,y])=>{p.setAttributeNS(null,m,y)}),l.appendChild(p)):l=p=c.createElement(a),p.textContent=" ",c.body.appendChild(l);let d=u.getComputedStyle(p,t),b=new Map;for(let m=d.length,y=0;y<m;y++){let h=d.item(y);Qr.includes(h)||b.set(h,d.getPropertyValue(h))}return c.body.removeChild(l),r.set(i,b),b}function hn(e,t,n){let r=new Map,a=[],o=new Map;if(n)for(let i of n)s(i);else for(let i=e.length,f=0;f<i;f++){let u=e.item(f);s(u)}for(let i=a.length,f=0;f<i;f++)o.get(a[f])?.forEach((u,c)=>r.set(c,u));function s(i){let f=e.getPropertyValue(i),u=e.getPropertyPriority(i),c=i.lastIndexOf("-"),l=c>-1?i.substring(0,c):void 0;if(l){let p=o.get(l);p||(p=new Map,o.set(l,p)),p.set(i,[f,u])}t.get(i)===f&&!u||(l?a.push(l):r.set(i,[f,u]))}return r}function to(e,t,n,r){let{ownerWindow:a,includeStyleProperties:o,currentParentNodeStyle:s}=r,i=t.style,f=a.getComputedStyle(e),u=mn(e,null,r);s?.forEach((l,p)=>{u.delete(p)});let c=hn(f,u,o);c.delete("transition-property"),c.delete("all"),c.delete("d"),c.delete("content"),n&&(c.delete("position"),c.delete("margin-top"),c.delete("margin-right"),c.delete("margin-bottom"),c.delete("margin-left"),c.delete("margin-block-start"),c.delete("margin-block-end"),c.delete("margin-inline-start"),c.delete("margin-inline-end"),c.set("box-sizing",["border-box",""])),c.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text"),sn&&(c.has("font-kerning")||c.set("font-kerning",["normal",""]),(c.get("overflow-x")?.[0]==="hidden"||c.get("overflow-y")?.[0]==="hidden")&&c.get("text-overflow")?.[0]==="ellipsis"&&e.scrollWidth===e.clientWidth&&c.set("text-overflow",["clip",""]));for(let l=i.length,p=0;p<l;p++)i.removeProperty(i.item(p));return c.forEach(([l,p],d)=>{i.setProperty(d,l,p)}),c}function no(e,t){(Rr(e)||Tr(e)||Pr(e))&&t.setAttribute("value",e.value)}var ro=["::before","::after"],oo=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];function ao(e,t,n,r,a){let{ownerWindow:o,svgStyleElement:s,svgStyles:i,currentNodeStyle:f}=r;if(!s||!o)return;function u(c){let l=o.getComputedStyle(e,c),p=l.getPropertyValue("content");if(!p||p==="none")return;a?.(p),p=p.replace(/(')|(")|(counter\(.+\))/g,"");let d=[un()],b=mn(e,c,r);f?.forEach((x,k)=>{b.delete(k)});let m=hn(l,b,r.includeStyleProperties);m.delete("content"),m.delete("-webkit-locale"),m.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text");let y=[`content: '${p}';`];if(m.forEach(([x,k],R)=>{y.push(`${R}: ${x}${k?" !important":""};`)}),y.length===1)return;try{t.className=[t.className,...d].join(" ")}catch(x){r.log.warn("Failed to copyPseudoClass",x);return}let h=y.join(`
7
+ `),v=i.get(h);v||(v=[],i.set(h,v)),v.push(`.${d[0]}${c}`)}ro.forEach(u),n&&oo.forEach(u)}var en=new Set(["symbol"]);async function tn(e,t,n,r,a){if(U(n)&&(Ar(n)||Fr(n))||r.filter&&!r.filter(n))return;en.has(t.nodeName)||en.has(n.nodeName)?r.currentParentNodeStyle=void 0:r.currentParentNodeStyle=r.currentNodeStyle;let o=await Ye(n,r,!1,a);r.isEnable("restoreScrollPosition")&&io(e,o),t.appendChild(o)}async function nn(e,t,n,r){let a=e.firstChild;U(e)&&e.shadowRoot&&(a=e.shadowRoot?.firstChild,n.shadowRoots.push(e.shadowRoot));for(let o=a;o;o=o.nextSibling)if(!Er(o))if(U(o)&&Dr(o)&&typeof o.assignedNodes=="function"){let s=o.assignedNodes();for(let i=0;i<s.length;i++)await tn(e,t,s[i],n,r)}else await tn(e,t,o,n,r)}function io(e,t){if(!ae(e)||!ae(t))return;let{scrollTop:n,scrollLeft:r}=e;if(!n&&!r)return;let{transform:a}=t.style,o=new DOMMatrix(a),{a:s,b:i,c:f,d:u}=o;o.a=1,o.b=0,o.c=0,o.d=1,o.translateSelf(-r,-n),o.a=s,o.b=i,o.c=f,o.d=u,t.style.transform=o.toString()}function so(e,t){let{backgroundColor:n,width:r,height:a,style:o}=t,s=e.style;if(n&&s.setProperty("background-color",n,"important"),r&&s.setProperty("width",`${r}px`,"important"),a&&s.setProperty("height",`${a}px`,"important"),o)for(let i in o)s[i]=o[i]}var lo=/^[\w-:]+$/;async function Ye(e,t,n=!1,r){let{ownerDocument:a,ownerWindow:o,fontFamilies:s,onCloneEachNode:i}=t;if(a&&Cr(e))return r&&/\S/.test(e.data)&&r(e.data),a.createTextNode(e.data);if(a&&o&&U(e)&&(ae(e)||le(e))){let u=await Jr(e,t);if(t.isEnable("removeAbnormalAttributes")){let m=u.getAttributeNames();for(let y=m.length,h=0;h<y;h++){let v=m[h];lo.test(v)||u.removeAttribute(v)}}let c=t.currentNodeStyle=to(e,u,n,t);n&&so(u,t);let l=!1;if(t.isEnable("copyScrollbar")){let m=[c.get("overflow-x")?.[0],c.get("overflow-y")?.[0]];l=m.includes("scroll")||(m.includes("auto")||m.includes("overlay"))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}let p=c.get("text-transform")?.[0],d=fn(c.get("font-family")?.[0]),b=d?m=>{p==="uppercase"?m=m.toUpperCase():p==="lowercase"?m=m.toLowerCase():p==="capitalize"&&(m=m[0].toUpperCase()+m.substring(1)),d.forEach(y=>{let h=s.get(y);h||s.set(y,h=new Set),m.split("").forEach(v=>h.add(v))})}:void 0;return ao(e,u,l,t,b),no(e,u),we(e)||await nn(e,u,t,b),await i?.(u),u}let f=e.cloneNode(!1);return await nn(e,f,t),await i?.(f),f}function co(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove()}catch(t){e.log.warn("Failed to destroyContext",t)}e.sandbox=void 0}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[]}function uo(e){let{url:t,timeout:n,responseType:r,...a}=e,o=new AbortController,s=n?setTimeout(()=>o.abort(),n):void 0;return fetch(t,{signal:o.signal,...a}).then(i=>{if(!i.ok)throw new Error("Failed fetch, not 2xx response",{cause:i});switch(r){case"arrayBuffer":return i.arrayBuffer();case"dataUrl":return i.blob().then(Wr);default:return i.text()}}).finally(()=>clearTimeout(s))}function se(e,t){let{url:n,requestType:r="text",responseType:a="text",imageDom:o}=t,s=n,{timeout:i,acceptOfImage:f,requests:u,fetchFn:c,fetch:{requestInit:l,bypassingCache:p,placeholderImage:d},font:b,workers:m,fontFamilies:y}=e;r==="image"&&(ve||Xe)&&e.drawImageCount++;let h=u.get(n);if(!h){p&&p instanceof RegExp&&p.test(s)&&(s+=(/\?/.test(s)?"&":"?")+new Date().getTime());let v=r.startsWith("font")&&b&&b.minify,x=new Set;v&&r.split(";")[1].split(",").forEach(A=>{y.has(A)&&y.get(A).forEach(O=>x.add(O))});let k=v&&x.size,R={url:s,timeout:i,responseType:k?"arrayBuffer":a,headers:r==="image"?{accept:f}:void 0,...l};h={type:r,resolve:void 0,reject:void 0,response:null},h.response=(async()=>{if(c&&r==="image"){let N=await c(n);if(N)return N}return!ve&&n.startsWith("http")&&m.length?new Promise((N,A)=>{m[u.size&m.length-1].postMessage({rawUrl:n,...R}),h.resolve=N,h.reject=A}):uo(R)})().catch(N=>{if(u.delete(n),r==="image"&&d)return e.log.warn("Failed to fetch image base64, trying to use placeholder image",s),typeof d=="string"?d:d(o);throw N}),u.set(n,h)}return h.response}async function bn(e,t,n,r){if(!gn(e))return e;for(let[a,o]of fo(e,t))try{let s=await se(n,{url:o,requestType:r?"image":"text",responseType:"dataUrl"});e=e.replace(po(a),`$1${s}$3`)}catch(s){n.log.warn("Failed to fetch css data url",a,s)}return e}function gn(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}var yn=/url\((['"]?)([^'"]+?)\1\)/g;function fo(e,t){let n=[];return e.replace(yn,(r,a,o)=>(n.push([o,cn(o,t)]),r)),n.filter(([r])=>!Ve(r))}function po(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}var _o=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function mo(e,t){return _o.map(n=>{let r=e.getPropertyValue(n);return!r||r==="none"?null:((ve||Xe)&&t.drawImageCount++,bn(r,null,t,!0).then(a=>{!a||r===a||e.setProperty(n,a,e.getPropertyPriority(n))}))}).filter(Boolean)}function ho(e,t){if(J(e)){let n=e.currentSrc||e.src;if(!Ve(n))return[se(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(r=>{r&&(e.srcset="",e.dataset.originalSrc=n,e.src=r||"")})];(ve||Xe)&&t.drawImageCount++}else if(le(e)&&!Ve(e.href.baseVal)){let n=e.href.baseVal;return[se(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(r=>{r&&(e.dataset.originalSrc=n,e.href.baseVal=r||"")})]}return[]}function bo(e,t){let{ownerDocument:n,svgDefsElement:r}=t,a=e.getAttribute("href")??e.getAttribute("xlink:href");if(!a)return[];let[o,s]=a.split("#");if(s){let i=`#${s}`,f=t.shadowRoots.reduce((u,c)=>u??c.querySelector(`svg ${i}`),n?.querySelector(`svg ${i}`));if(o&&e.setAttribute("href",i),r?.querySelector(i))return[];if(f)return r?.appendChild(f.cloneNode(!0)),[];if(o)return[se(t,{url:o,responseType:"text"}).then(u=>{r?.insertAdjacentHTML("beforeend",u)})]}return[]}function vn(e,t){let{tasks:n}=t;U(e)&&((J(e)||ln(e))&&n.push(...ho(e,t)),Sr(e)&&n.push(...bo(e,t))),ae(e)&&n.push(...mo(e.style,t)),e.childNodes.forEach(r=>{vn(r,t)})}async function go(e,t){let{ownerDocument:n,svgStyleElement:r,fontFamilies:a,fontCssTexts:o,tasks:s,font:i}=t;if(!(!n||!r||!a.size))if(i&&i.cssText){let f=on(i.cssText,t);r.appendChild(n.createTextNode(`${f}
8
+ `))}else{let f=Array.from(n.styleSheets).filter(d=>{try{return"cssRules"in d&&!!d.cssRules.length}catch(b){return t.log.warn(`Error while reading CSS rules from ${d.href}`,b),!1}}),u=n.implementation.createHTMLDocument(""),c=u.createElement("style");u.head.appendChild(c);let l=c.sheet;await Promise.all(f.flatMap(d=>Array.from(d.cssRules).map(async b=>{if(xr(b)){let m=b.href,y="";try{y=await se(t,{url:m,requestType:"text",responseType:"text"})}catch(v){t.log.warn(`Error fetch remote css import from ${m}`,v)}let h=y.replace(yn,(v,x,k)=>v.replace(k,cn(k,m)));for(let v of vo(h))try{l.insertRule(v,l.cssRules.length)}catch(x){t.log.warn("Error inserting rule from remote css import",{rule:v,error:x})}}}))),l.cssRules.length&&f.push(l);let p=[];f.forEach(d=>{je(d.cssRules,p)}),p.filter(d=>wr(d)&&gn(d.style.getPropertyValue("src"))&&fn(d.style.getPropertyValue("font-family"))?.some(b=>a.has(b))).forEach(d=>{let b=d,m=o.get(b.cssText);m?r.appendChild(n.createTextNode(`${m}
9
+ `)):s.push(bn(b.cssText,b.parentStyleSheet?b.parentStyleSheet.href:null,t).then(y=>{y=on(y,t),o.set(b.cssText,y),r.appendChild(n.createTextNode(`${y}
10
+ `))}))})}}var yo=/(\/\*[\s\S]*?\*\/)/g,rn=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;function vo(e){if(e==null)return[];let t=[],n=e.replace(yo,"");for(;;){let o=rn.exec(n);if(!o)break;t.push(o[0])}n=n.replace(rn,"");let r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let o=r.exec(n);if(o)a.lastIndex=r.lastIndex;else if(o=a.exec(n),o)r.lastIndex=a.lastIndex;else break;t.push(o[0])}return t}var wo=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,xo=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function on(e,t){let{font:n}=t,r=n?n?.preferredFormat:void 0;return r?e.replace(xo,a=>{for(;;){let[o,,s]=wo.exec(a)||[];if(!s)return"";if(s===r)return`src: ${o};`}}):e}function je(e,t=[]){for(let n of Array.from(e))kr(n)?t.push(...je(n.cssRules)):"cssRules"in n?je(n.cssRules,t):t.push(n);return t}var ko=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;function So(e){return ko.test(e.innerHTML)}async function Eo(e,t){let n=await dn(e,t);if(U(n.node)&&le(n.node)&&!So(n.node))return n.node;let{ownerDocument:r,log:a,tasks:o,svgStyleElement:s,svgDefsElement:i,svgStyles:f,font:u,progress:c,autoDestruct:l,onCloneNode:p,onEmbedNode:d,onCreateForeignObjectSvg:b}=n;a.time("clone node");let m=await Ye(n.node,n,!0);if(s&&r){let k="";f.forEach((R,N)=>{k+=`${R.join(`,
11
+ `)} {
12
+ ${N}
13
+ }
14
+ `}),s.appendChild(r.createTextNode(k))}a.timeEnd("clone node"),await p?.(m),u!==!1&&U(m)&&(a.time("embed web font"),await go(m,n),a.timeEnd("embed web font")),a.time("embed node"),vn(m,n);let y=o.length,h=0,v=async()=>{for(;;){let k=o.pop();if(!k)break;try{await k}catch(R){n.log.warn("Failed to run task",R)}c?.(++h,y)}};c?.(h,y),await Promise.all([...Array.from({length:4})].map(v)),a.timeEnd("embed node"),await d?.(m);let x=Co(m,n);return i&&x.insertBefore(i,x.children[0]),s&&x.insertBefore(s,x.children[0]),l&&co(n),await b?.(x),x}function Co(e,t){let{width:n,height:r}=t,a=Ur(n,r,e.ownerDocument),o=a.ownerDocument.createElementNS(a.namespaceURI,"foreignObject");return o.setAttributeNS(null,"x","0%"),o.setAttributeNS(null,"y","0%"),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.append(e),a.appendChild(o),a}async function wn(e,t){let n=await dn(e,t),r=await Eo(n),a=Or(r,n.isEnable("removeControlCharacter"));n.autoDestruct||(n.svgStyleElement=pn(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(ke,"defs"),n.svgStyles.clear());let o=K(a,r.ownerDocument);return await qr(o,n)}var No=1600;async function xn(e,t={}){let n=t.endpoint??"/api/feedback",r=To(e),a=await Ro(e),o={annotation:e,context:r,screenshot:a};try{let s=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",...t.headers},body:JSON.stringify(o)});if(!s.ok){let i=await s.text().catch(()=>"");return console.error("[feedback] submit failed",s.status,i),null}return await s.json()}catch(s){return console.error("[feedback] submit error",s),null}}async function Ro(e){try{let t=document.documentElement,n=t.scrollWidth,r=t.scrollHeight,a=window.innerWidth,o=window.innerHeight,s=Math.min(1,No/Math.max(a,o)),i=await wn(document.body,{scale:s,backgroundColor:"#ffffff",filter:p=>!(p instanceof HTMLElement&&p.dataset.feedbackOverlay!==void 0)}),f=i.width/n,u=i.height/r,c=document.createElement("canvas");c.width=Math.max(1,Math.round(a*f)),c.height=Math.max(1,Math.round(o*u));let l=c.getContext("2d");if(l){l.drawImage(i,window.scrollX*f,window.scrollY*u,a*f,o*u,0,0,c.width,c.height);let{x:p,y:d,width:b,height:m}=e.rect,y=(p-window.scrollX)*f,h=(d-window.scrollY)*u;l.lineWidth=Math.max(2,3*f),l.strokeStyle="#ff0055",l.fillStyle="rgba(255, 0, 85, 0.12)",l.fillRect(y,h,b*f,m*u),l.strokeRect(y,h,b*f,m*u)}return c.toDataURL("image/jpeg",.85)}catch(t){return console.warn("[feedback] screenshot capture failed, sending without image",t),null}}function To(e){let t=e.rect.x+e.rect.width/2-window.scrollX,n=e.rect.y+e.rect.height/2-window.scrollY;return{url:window.location.href,pathname:window.location.pathname,title:document.title,viewport:{width:window.innerWidth,height:window.innerHeight,dpr:window.devicePixelRatio},scroll:{x:window.scrollX,y:window.scrollY},userAgent:navigator.userAgent,referrer:document.referrer,elementHint:Zt(t,n),timestamp:new Date().toISOString()}}var Ao=0;function _(e,t,n,r,a,o){t||(t={});var s,i,f=t;if("ref"in f)for(i in f={},t)i=="ref"?s=t[i]:f[i]=t[i];var u={type:e,props:f,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ao,__i:-1,__u:0,__source:a,__self:o};if(typeof e=="function"&&(s=e.defaultProps))for(i in s)f[i]===void 0&&(f[i]=s[i]);return w.vnode&&w.vnode(u),u}function X({size:e=16,children:t,...n}){return _("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n,children:t})}var kn=e=>_(X,{...e,children:_("path",{d:"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8z"})}),ce=e=>_(X,{...e,children:_("path",{d:"M18 6 6 18M6 6l12 12"})}),Sn=e=>_(X,{...e,children:[_("path",{d:"M12 20h9"}),_("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"})]}),En=e=>_(X,{...e,children:[_("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),_("path",{d:"M22 4 12 14.01l-3-3"})]}),Fo=e=>_(X,{...e,children:[_("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),_("path",{d:"M12 9v4"}),_("path",{d:"M12 17h.01"})]}),Po=e=>_(X,{...e,children:_("path",{d:"M12 19V5M5 12l7-7 7 7"})}),Do=e=>_(X,{...e,strokeWidth:0,children:_("circle",{cx:"12",cy:"12",r:"6",fill:"currentColor"})}),Cn={bug:Fo,improvement:Po,dot:Do};var Nn="lfb-styles",Io=`
15
+ /*
16
+ * Defaults live on .lfb-root (the element that also receives the inline brandColor
17
+ * override) \u2014 NOT on the layers. The layers/FAB inherit from here. If the defaults
18
+ * sat on .lfb-doc-layer/.lfb-fixed-layer, a direct rule on those elements would beat
19
+ * the brandColor inherited from .lfb-root, so the \`brandColor\` prop would never apply.
20
+ */
21
+ .lfb-root {
22
+ --lfb-brand: #6366f1;
23
+ --lfb-fg: #181d27;
24
+ --lfb-fg-secondary: #414651;
25
+ --lfb-fg-tertiary: #717680;
26
+ --lfb-surface: #ffffff;
27
+ --lfb-surface-hover: #f5f5f5;
28
+ --lfb-border: #e9eaeb;
29
+ --lfb-radius: 12px;
30
+ --lfb-rect: #ff0055;
31
+ --lfb-z: 2147483640;
32
+ --lfb-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
33
+ }
34
+ .lfb-doc-layer, .lfb-doc-layer *, .lfb-fixed-layer, .lfb-fixed-layer * { box-sizing: border-box; }
35
+
36
+ .lfb-doc-layer { position: absolute; inset-inline: 0; top: 0; pointer-events: none; z-index: var(--lfb-z); }
37
+ .lfb-fixed-layer { position: fixed; inset: 0; pointer-events: none; z-index: calc(var(--lfb-z) + 1); }
38
+
39
+ .lfb-rect { position: absolute; border: 2px solid var(--lfb-rect); background: rgba(255,0,85,0.12); border-radius: 3px; pointer-events: none; }
40
+
41
+ .lfb-shield { position: fixed; inset: 0; pointer-events: auto; cursor: default; }
42
+
43
+ .lfb-anchor { position: absolute; pointer-events: auto; }
44
+
45
+ .lfb-card {
46
+ background: var(--lfb-surface);
47
+ color: var(--lfb-fg);
48
+ border: 1px solid var(--lfb-border);
49
+ border-radius: var(--lfb-radius);
50
+ box-shadow: 0 12px 32px rgba(0,0,0,0.16), 0 2px 6px rgba(0,0,0,0.08);
51
+ padding: 12px;
52
+ font-family: var(--lfb-font);
53
+ font-size: 14px;
54
+ line-height: 1.4;
55
+ }
56
+ .lfb-composer { position: absolute; top: 100%; left: 0; margin-top: 8px; width: 320px; max-width: calc(100vw - 32px); }
57
+ .lfb-composer--above { top: auto; bottom: 100%; margin-top: 0; margin-bottom: 8px; }
58
+
59
+ .lfb-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
60
+ .lfb-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--lfb-fg-tertiary); }
61
+ .lfb-sub { margin: 4px 0 0; font-size: 12px; color: var(--lfb-fg-tertiary); }
62
+
63
+ .lfb-iconbtn { display: inline-flex; align-items: center; justify-content: center; padding: 4px; margin: -4px; border: 0; background: none; color: var(--lfb-fg-tertiary); border-radius: 6px; cursor: pointer; }
64
+ .lfb-iconbtn:hover { background: var(--lfb-surface-hover); color: var(--lfb-fg); }
65
+
66
+ .lfb-field-label { font-size: 12px; font-weight: 500; color: var(--lfb-fg-secondary); }
67
+ .lfb-types { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
68
+ .lfb-type { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; font-family: inherit; background: var(--lfb-surface); color: var(--lfb-fg-secondary); border: 1px solid var(--lfb-border); cursor: pointer; transition: background 0.1s, box-shadow 0.1s, border-color 0.1s; }
69
+ .lfb-type:hover { background: var(--lfb-surface-hover); }
70
+ .lfb-type[aria-pressed="true"] { color: var(--lfb-fg); border-color: var(--lfb-brand); box-shadow: inset 0 0 0 1px var(--lfb-brand); }
71
+ .lfb-swatch { width: 20px; height: 20px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
72
+
73
+ .lfb-textarea, .lfb-input {
74
+ width: 100%; margin-top: 12px; border-radius: 8px; background: var(--lfb-surface); color: var(--lfb-fg);
75
+ border: 1px solid var(--lfb-border); padding: 8px 10px; font-size: 14px; font-family: inherit; outline: none;
76
+ }
77
+ .lfb-textarea { resize: none; }
78
+ .lfb-input { margin-top: 8px; font-size: 13px; }
79
+ .lfb-textarea:focus, .lfb-input:focus { border-color: var(--lfb-brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--lfb-brand) 30%, transparent); }
80
+ .lfb-textarea::placeholder, .lfb-input::placeholder { color: var(--lfb-fg-tertiary); }
81
+ .lfb-textarea:disabled { opacity: 0.5; }
82
+
83
+ .lfb-namerow { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--lfb-fg-tertiary); }
84
+ .lfb-name { color: var(--lfb-fg-secondary); font-weight: 600; }
85
+ .lfb-link { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border: 0; background: none; color: var(--lfb-brand); font-weight: 500; font-size: 12px; font-family: inherit; cursor: pointer; border-radius: 4px; }
86
+ .lfb-link:hover { background: var(--lfb-surface-hover); }
87
+
88
+ .lfb-error { margin-top: 8px; font-size: 12px; color: #d92d20; }
89
+ .lfb-actions { margin-top: 12px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
90
+ .lfb-btn { padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; border: 0; transition: background 0.1s; }
91
+ .lfb-btn:disabled { opacity: 0.5; cursor: not-allowed; }
92
+ .lfb-btn-ghost { background: none; color: var(--lfb-fg-secondary); }
93
+ .lfb-btn-ghost:hover:not(:disabled) { background: var(--lfb-surface-hover); }
94
+ .lfb-btn-primary { background: var(--lfb-brand); color: #fff; }
95
+ .lfb-btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--lfb-brand) 88%, black); }
96
+
97
+ .lfb-draw { position: absolute; inset: 0; pointer-events: auto; cursor: crosshair; background: rgba(0,0,0,0.04); user-select: none; }
98
+ .lfb-hint { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); background: #181d27; color: #fff; padding: 8px 16px; border-radius: 9999px; font-size: 12px; font-weight: 500; font-family: var(--lfb-font); box-shadow: 0 8px 20px rgba(0,0,0,0.25); white-space: nowrap; }
99
+
100
+ .lfb-stack { position: absolute; bottom: 16px; right: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
101
+ .lfb-stack > * { pointer-events: auto; }
102
+ .lfb-stack--bottom-left { right: auto; left: 16px; align-items: flex-start; }
103
+ .lfb-stack--top-right { bottom: auto; top: 16px; }
104
+ .lfb-stack--top-left { bottom: auto; top: 16px; right: auto; left: 16px; align-items: flex-start; }
105
+ /* Edge tabs: anchored flush to a side, vertically centered. */
106
+ .lfb-stack--right { top: 50%; bottom: auto; right: 0; transform: translateY(-50%); align-items: flex-end; }
107
+ .lfb-stack--left { top: 50%; bottom: auto; left: 0; right: auto; transform: translateY(-50%); align-items: flex-start; }
108
+ /* Keep the transient name-prompt / sent-toast cards off the viewport edge (the tab stays flush). */
109
+ .lfb-stack--right > .lfb-card { margin-right: 12px; }
110
+ .lfb-stack--left > .lfb-card { margin-left: 12px; }
111
+
112
+ .lfb-fab { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 9999px; padding: 12px 16px; font-size: 14px; font-weight: 600; font-family: var(--lfb-font); cursor: pointer; background: var(--lfb-brand); color: #fff; box-shadow: 0 10px 25px rgba(0,0,0,0.18); transition: transform 0.1s, background 0.1s; }
113
+ .lfb-fab:hover { transform: scale(1.05); background: color-mix(in srgb, var(--lfb-brand) 88%, black); }
114
+ .lfb-fab--active { background: var(--lfb-surface); color: var(--lfb-fg); border: 1px solid var(--lfb-border); }
115
+ .lfb-fab--active:hover { background: var(--lfb-surface-hover); }
116
+
117
+ /* Edge-tab launcher: compact, icon-only, rounded on the inner side only, flush to the viewport edge. */
118
+ .lfb-fab--tab { gap: 0; padding: 14px 12px; border-radius: 12px 0 0 12px; box-shadow: -6px 0 20px rgba(0,0,0,0.18); }
119
+ .lfb-fab--tab:hover { transform: translateX(-2px); }
120
+ .lfb-stack--left .lfb-fab--tab { border-radius: 0 12px 12px 0; box-shadow: 6px 0 20px rgba(0,0,0,0.18); }
121
+ .lfb-stack--left .lfb-fab--tab:hover { transform: translateX(2px); }
122
+
123
+ .lfb-toast { display: flex; align-items: flex-start; gap: 10px; width: 300px; max-width: calc(100vw - 32px); }
124
+ .lfb-toast-icon { color: #17b26a; flex-shrink: 0; margin-top: 1px; }
125
+ .lfb-toast-body { min-width: 0; flex: 1; }
126
+ .lfb-toast-title { font-size: 14px; font-weight: 600; color: var(--lfb-fg); }
127
+ .lfb-toast-text { margin-top: 2px; font-size: 12px; color: var(--lfb-fg-tertiary); }
128
+ .lfb-toast-link { color: var(--lfb-brand); font-weight: 500; text-decoration: none; }
129
+ .lfb-toast-link:hover { text-decoration: underline; }
130
+ `;function Rn(){if(typeof document>"u"||document.getElementById(Nn))return;let e=document.createElement("style");e.id=Nn,e.textContent=Io,document.head.appendChild(e)}var Tn=12,An={width:220,height:130},Mo=320,Fn=320,Lo=[{id:"bug",label:"Bug",color:"#ef4444",icon:"bug"},{id:"improvement",label:"Improvement",color:"#22c55e",icon:"improvement"}];function Se({endpoint:e,brandColor:t,position:n="bottom-right",types:r=Lo,nameRequired:a=!0,nameStorageKey:o="wh_feedback_name",fabLabel:s="Give feedback",zIndex:i,requestHeaders:f}){let u=n==="right"||n==="left",[c,l]=P({kind:"idle"}),[p,d]=P(""),[b,m]=P(""),[y,h]=P(!1),[v,x]=P(""),[k,R]=P(r[0]?.id??"bug"),[N,A]=P(!1),[O,T]=P(null),[M,Ne]=P(null),[D,Q]=P(null),Je=q(null),Ze=q(null),Qe=q(null),et=q(!1);et.current=N;let tt=q(!1);tt.current=y,W(()=>{Rn();try{let g=window.localStorage.getItem(o);g&&d(g)}catch{}},[o]),W(()=>{if(c.kind==="idle")return;let g=S=>{if(!(S.key!=="Escape"||et.current)){if(tt.current){h(!1);return}l({kind:"idle"}),Q(null),x(""),T(null),A(!1),h(!1)}};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[c.kind]),W(()=>{if(c.kind==="composing"){let g=window.setTimeout(()=>Je.current?.focus(),0);return()=>window.clearTimeout(g)}if(c.kind==="naming"){let g=window.setTimeout(()=>Ze.current?.focus(),0);return()=>window.clearTimeout(g)}},[c.kind]),W(()=>{y&&Qe.current?.focus()},[y]),W(()=>{if(c.kind!=="drawing"&&c.kind!=="composing")return;let g=document.documentElement,S=g.style.overflow,I=g.style.paddingRight,z=window.innerWidth-g.clientWidth;return g.style.overflow="hidden",z>0&&(g.style.paddingRight=`${z}px`),()=>{g.style.overflow=S,g.style.paddingRight=I}},[c.kind]);let Re=g=>{try{window.localStorage.setItem(o,g)}catch{}},Dn=()=>{if(c.kind==="drawing"||c.kind==="naming"){l({kind:"idle"}),Q(null);return}Ne(null),a&&!p.trim()?(m(""),l({kind:"naming"})):l({kind:"drawing"})},In=g=>{g.preventDefault();let S=b.trim();S&&(d(S),Re(S),l({kind:"drawing"}))},Mn=g=>{if(c.kind!=="drawing")return;g.preventDefault();let S={x:g.clientX,y:g.clientY};Q({start:S,current:S})},Ln=g=>{c.kind!=="drawing"||!D||Q(S=>S&&{...S,current:{x:g.clientX,y:g.clientY}})},Un=g=>{if(c.kind!=="drawing"||!D)return;let S=D.start,I={x:g.clientX,y:g.clientY},z=Math.min(S.x,I.x),V=Math.min(S.y,I.y),j=Math.abs(I.x-S.x),Y=Math.abs(I.y-S.y);(j<Tn||Y<Tn)&&(j=Math.max(j,An.width),Y=Math.max(Y,An.height),z=I.x-j/2,V=I.y-Y/2);let it={x:Math.max(0,z+window.scrollX),y:Math.max(0,V+window.scrollY),width:j,height:Y},$n=V+Y+Fn<=window.innerHeight,Wn=V>=Fn,Hn=!$n&&Wn?"above":"below",Bn=window.scrollX+Math.max(16,window.innerWidth-Mo-16),zn=Math.min(it.x,Bn);Q(null),x(""),R(r[0]?.id??"bug"),T(null),h(!1),l({kind:"composing",rect:it,placement:Hn,anchorX:zn})},nt=()=>{l({kind:"idle"}),x(""),T(null),h(!1),A(!1)},rt=async g=>{if(g.preventDefault(),c.kind!=="composing"||N)return;let S=v.trim();if(!S)return;let I=p.trim(),z=r.find(j=>j.id===k);A(!0),T(null),I&&Re(I);let V=await xn({rect:c.rect,note:S,type:k,typeLabel:z?.label,name:I||void 0},{endpoint:e,headers:f});A(!1),V?(Ne(V),x(""),h(!1),l({kind:"idle"})):T("Couldn't send \u2014 please try again.")},On={display:"contents",...t?{"--lfb-brand":t}:{},...i!=null?{"--lfb-z":String(i)}:{}},ot={[ze]:""},at=D?{left:Math.min(D.start.x,D.current.x),top:Math.min(D.start.y,D.current.y),width:Math.abs(D.current.x-D.start.x),height:Math.abs(D.current.y-D.start.y)}:null;return _("div",{className:"lfb-root",style:On,children:[_("div",{...ot,className:"lfb-doc-layer",children:c.kind==="composing"&&_(F,{children:[_("div",{className:"lfb-shield","aria-hidden":"true"}),_("div",{className:"lfb-rect",style:{left:c.rect.x,top:c.rect.y,width:c.rect.width,height:c.rect.height}}),_("div",{className:"lfb-anchor",style:{left:c.anchorX,top:c.placement==="below"?c.rect.y+c.rect.height:c.rect.y},children:_("form",{className:`lfb-card lfb-composer${c.placement==="above"?" lfb-composer--above":""}`,onSubmit:rt,children:[_("div",{className:"lfb-row",children:[_("span",{className:"lfb-eyebrow",children:"New feedback"}),_("button",{type:"button",className:"lfb-iconbtn","aria-label":"Cancel",onClick:nt,children:_(ce,{})})]}),_("div",{style:{marginTop:12},children:[_("span",{className:"lfb-field-label",children:"Issue type"}),_("div",{className:"lfb-types",children:r.map(g=>{let S=Cn[g.icon??"dot"];return _("button",{type:"button",className:"lfb-type","aria-pressed":k===g.id,onClick:()=>R(g.id),children:[_("span",{className:"lfb-swatch",style:{background:g.color},children:_(S,{size:14})}),g.label]},g.id)})})]}),_("textarea",{ref:Je,className:"lfb-textarea",placeholder:"What's on your mind?",value:v,onChange:g=>x(g.target.value),maxLength:5e3,required:!0,disabled:N,rows:3,onKeyDown:g=>{g.key==="Enter"&&(g.metaKey||g.ctrlKey)&&(g.preventDefault(),rt(g))}}),y?_("input",{ref:Qe,className:"lfb-input",type:"text",value:p,maxLength:80,onChange:g=>d(g.target.value),onBlur:()=>{let g=p.trim();g&&Re(g),h(!1)},onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),g.target.blur()),g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),h(!1))}}):_("div",{className:"lfb-namerow",children:[_("span",{children:["Posting as ",_("span",{className:"lfb-name",children:p||"anonymous"})]}),_("button",{type:"button",className:"lfb-link",onClick:()=>h(!0),children:[_(Sn,{size:12}),"change"]})]}),O&&_("p",{className:"lfb-error",children:O}),_("div",{className:"lfb-actions",children:[_("button",{type:"button",className:"lfb-btn lfb-btn-ghost",onClick:nt,disabled:N,children:"Cancel"}),_("button",{type:"submit",className:"lfb-btn lfb-btn-primary",disabled:N||!v.trim(),children:N?"Sending\u2026":"Send to Linear"})]})]})})]})}),_("div",{...ot,className:"lfb-fixed-layer",children:[c.kind==="drawing"&&_("div",{className:"lfb-draw",role:"presentation",onMouseDown:Mn,onMouseMove:Ln,onMouseUp:Un,children:[_("div",{className:"lfb-hint",children:"Drag to select an area \xB7 Esc to cancel"}),at&&_("div",{className:"lfb-rect",style:at})]}),c.kind!=="composing"&&_("div",{className:`lfb-stack${n==="bottom-right"?"":` lfb-stack--${n}`}`,children:[c.kind==="naming"&&_("form",{className:"lfb-card",style:{width:288,maxWidth:"calc(100vw - 32px)"},onSubmit:In,children:[_("div",{className:"lfb-row",children:[_("span",{className:"lfb-eyebrow",children:"What's your name?"}),_("button",{type:"button",className:"lfb-iconbtn","aria-label":"Cancel",onClick:()=>l({kind:"idle"}),children:_(ce,{})})]}),_("p",{className:"lfb-sub",children:"Saved locally so you don't have to type it again."}),_("input",{ref:Ze,className:"lfb-input",type:"text",placeholder:"Olivia Rhye",value:b,maxLength:80,required:!0,onChange:g=>m(g.target.value)}),_("div",{className:"lfb-actions",children:[_("button",{type:"button",className:"lfb-btn lfb-btn-ghost",onClick:()=>l({kind:"idle"}),children:"Cancel"}),_("button",{type:"submit",className:"lfb-btn lfb-btn-primary",disabled:!b.trim(),children:"Continue"})]})]}),M&&c.kind==="idle"&&_("div",{className:"lfb-card lfb-toast",children:[_("span",{className:"lfb-toast-icon",children:_(En,{size:20})}),_("div",{className:"lfb-toast-body",children:[_("div",{className:"lfb-toast-title",children:"Feedback sent"}),_("div",{className:"lfb-toast-text",children:["Created ",M.identifier??"an issue",".",M.url&&_(F,{children:[" ",_("a",{className:"lfb-toast-link",href:M.url,target:"_blank",rel:"noopener noreferrer",children:"View in Linear"})]})]})]}),_("button",{type:"button",className:"lfb-iconbtn","aria-label":"Dismiss",onClick:()=>Ne(null),children:_(ce,{})})]}),_("button",{type:"button",className:`lfb-fab${u?" lfb-fab--tab":""}${c.kind==="idle"?"":" lfb-fab--active"}`,"aria-label":c.kind==="idle"?s:"Cancel feedback",title:u?c.kind==="idle"?s:"Cancel feedback":void 0,onClick:Dn,children:[c.kind==="idle"?_(kn,{size:u?22:18}):_(ce,{size:u?22:18}),!u&&_("span",{children:c.kind==="idle"?s:"Cancel"})]})]})]})]})}var Uo=3600*24*90;function Oo(e,t,n,r){typeof document>"u"||(document.cookie=n?`${e}=${t}; path=/; max-age=${r}; SameSite=Lax`:`${e}=; path=/; max-age=0; SameSite=Lax`)}function $o(e,t){return typeof document>"u"?!1:document.cookie.split(";").map(n=>n.trim()).some(n=>n===`${e}=${t}`)}function Pn({urlParam:e="feedback",cookieName:t="wh_feedback",cookieValue:n="1",cookieMaxAgeSeconds:r=Uo,...a}){let[o,s]=P(!1);return W(()=>{if(typeof window>"u")return;let i=new URLSearchParams(window.location.search),f=i.get(e);if(f!=null){let u=f!=="0";Oo(t,n,u,r),s(u),i.delete(e);let c=i.toString(),l=window.location.pathname+(c?`?${c}`:"")+window.location.hash;window.history.replaceState(null,"",l);return}s($o(t,n))},[e,t,n,r]),o?_(Se,{...a}):null}var Ee=null,Z=null;function Ce(e={}){Ge(),Z=document.createElement("div"),Z.setAttribute("data-lfb-embed",""),document.body.appendChild(Z),Ee=Gt(Z);let{mode:t,token:n,...r}=e,a={...r,requestHeaders:n?{"x-feedback-token":n,...r.requestHeaders}:r.requestHeaders};Ee.render(t==="gated"?_(Pn,{...a}):_(Se,{...a}))}function Ge(){Ee?.unmount(),Z?.remove(),Ee=null,Z=null}function Wo(e){let t=e.dataset;return{...t.endpoint?{endpoint:t.endpoint}:{},...t.brandColor?{brandColor:t.brandColor}:{},...t.position?{position:t.position}:{},...t.fabLabel?{fabLabel:t.fabLabel}:{},...t.mode?{mode:t.mode}:{},...t.token?{token:t.token}:{},...t.zIndex?{zIndex:Number(t.zIndex)}:{},...t.nameRequired?{nameRequired:t.nameRequired!=="false"}:{}}}var Ke=document.currentScript;if(Ke&&Ke.dataset.manual!=="true"){let e={...Wo(Ke),...window.lfbConfig??{}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Ce(e),{once:!0}):Ce(e)}return Gn(Ho);})();
@@ -59,7 +59,7 @@ async function submitFeedback(annotation, opts = {}) {
59
59
  try {
60
60
  const res = await fetch(endpoint, {
61
61
  method: "POST",
62
- headers: { "Content-Type": "application/json" },
62
+ headers: { "Content-Type": "application/json", ...opts.headers },
63
63
  body: JSON.stringify(payload)
64
64
  });
65
65
  if (!res.ok) {
@@ -195,6 +195,8 @@ var CSS2 = `
195
195
 
196
196
  .lfb-rect { position: absolute; border: 2px solid var(--lfb-rect); background: rgba(255,0,85,0.12); border-radius: 3px; pointer-events: none; }
197
197
 
198
+ .lfb-shield { position: fixed; inset: 0; pointer-events: auto; cursor: default; }
199
+
198
200
  .lfb-anchor { position: absolute; pointer-events: auto; }
199
201
 
200
202
  .lfb-card {
@@ -209,6 +211,7 @@ var CSS2 = `
209
211
  line-height: 1.4;
210
212
  }
211
213
  .lfb-composer { position: absolute; top: 100%; left: 0; margin-top: 8px; width: 320px; max-width: calc(100vw - 32px); }
214
+ .lfb-composer--above { top: auto; bottom: 100%; margin-top: 0; margin-bottom: 8px; }
212
215
 
213
216
  .lfb-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
214
217
  .lfb-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--lfb-fg-tertiary); }
@@ -292,6 +295,8 @@ function ensureStyles() {
292
295
  }
293
296
  var MIN_DRAG = 12;
294
297
  var DEFAULT_BOX = { width: 220, height: 130 };
298
+ var COMPOSER_WIDTH = 320;
299
+ var COMPOSER_EST_HEIGHT = 320;
295
300
  var DEFAULT_TYPES = [
296
301
  { id: "bug", label: "Bug", color: "#ef4444", icon: "bug" },
297
302
  { id: "improvement", label: "Improvement", color: "#22c55e", icon: "improvement" }
@@ -303,7 +308,9 @@ function FeedbackWidget({
303
308
  types = DEFAULT_TYPES,
304
309
  nameRequired = true,
305
310
  nameStorageKey = "wh_feedback_name",
306
- fabLabel = "Give feedback"
311
+ fabLabel = "Give feedback",
312
+ zIndex,
313
+ requestHeaders
307
314
  }) {
308
315
  const isEdge = position === "right" || position === "left";
309
316
  const [mode, setMode] = react.useState({ kind: "idle" });
@@ -318,6 +325,11 @@ function FeedbackWidget({
318
325
  const [drag, setDrag] = react.useState(null);
319
326
  const textareaRef = react.useRef(null);
320
327
  const nameInputRef = react.useRef(null);
328
+ const nameEditRef = react.useRef(null);
329
+ const submittingRef = react.useRef(false);
330
+ submittingRef.current = submitting;
331
+ const editingNameRef = react.useRef(false);
332
+ editingNameRef.current = editingName;
321
333
  react.useEffect(() => {
322
334
  ensureStyles();
323
335
  try {
@@ -327,12 +339,19 @@ function FeedbackWidget({
327
339
  }
328
340
  }, [nameStorageKey]);
329
341
  react.useEffect(() => {
330
- if (mode.kind !== "drawing" && mode.kind !== "naming") return;
342
+ if (mode.kind === "idle") return;
331
343
  const onKey = (e) => {
332
- if (e.key === "Escape") {
333
- setMode({ kind: "idle" });
334
- setDrag(null);
344
+ if (e.key !== "Escape" || submittingRef.current) return;
345
+ if (editingNameRef.current) {
346
+ setEditingName(false);
347
+ return;
335
348
  }
349
+ setMode({ kind: "idle" });
350
+ setDrag(null);
351
+ setText("");
352
+ setError(null);
353
+ setSubmitting(false);
354
+ setEditingName(false);
336
355
  };
337
356
  document.addEventListener("keydown", onKey);
338
357
  return () => document.removeEventListener("keydown", onKey);
@@ -347,6 +366,22 @@ function FeedbackWidget({
347
366
  return () => window.clearTimeout(t);
348
367
  }
349
368
  }, [mode.kind]);
369
+ react.useEffect(() => {
370
+ if (editingName) nameEditRef.current?.focus();
371
+ }, [editingName]);
372
+ react.useEffect(() => {
373
+ if (mode.kind !== "drawing" && mode.kind !== "composing") return;
374
+ const el = document.documentElement;
375
+ const prevOverflow = el.style.overflow;
376
+ const prevPaddingRight = el.style.paddingRight;
377
+ const scrollbar = window.innerWidth - el.clientWidth;
378
+ el.style.overflow = "hidden";
379
+ if (scrollbar > 0) el.style.paddingRight = `${scrollbar}px`;
380
+ return () => {
381
+ el.style.overflow = prevOverflow;
382
+ el.style.paddingRight = prevPaddingRight;
383
+ };
384
+ }, [mode.kind]);
350
385
  const persistName = (value) => {
351
386
  try {
352
387
  window.localStorage.setItem(nameStorageKey, value);
@@ -400,12 +435,17 @@ function FeedbackWidget({
400
435
  vy = end.y - vh / 2;
401
436
  }
402
437
  const rect = { x: Math.max(0, vx + window.scrollX), y: Math.max(0, vy + window.scrollY), width: vw, height: vh };
438
+ const fitsBelow = vy + vh + COMPOSER_EST_HEIGHT <= window.innerHeight;
439
+ const fitsAbove = vy >= COMPOSER_EST_HEIGHT;
440
+ const placement = !fitsBelow && fitsAbove ? "above" : "below";
441
+ const maxAnchorX = window.scrollX + Math.max(16, window.innerWidth - COMPOSER_WIDTH - 16);
442
+ const anchorX = Math.min(rect.x, maxAnchorX);
403
443
  setDrag(null);
404
444
  setText("");
405
445
  setIssueType(types[0]?.id ?? "bug");
406
446
  setError(null);
407
447
  setEditingName(false);
408
- setMode({ kind: "composing", rect });
448
+ setMode({ kind: "composing", rect, placement, anchorX });
409
449
  };
410
450
  const cancelComposer = () => {
411
451
  setMode({ kind: "idle" });
@@ -426,7 +466,7 @@ function FeedbackWidget({
426
466
  if (trimmedName) persistName(trimmedName);
427
467
  const res = await submitFeedback(
428
468
  { rect: mode.rect, note: trimmedNote, type: issueType, typeLabel: selected?.label, name: trimmedName || void 0 },
429
- { endpoint }
469
+ { endpoint, headers: requestHeaders }
430
470
  );
431
471
  setSubmitting(false);
432
472
  if (res) {
@@ -438,7 +478,11 @@ function FeedbackWidget({
438
478
  setError("Couldn't send \u2014 please try again.");
439
479
  }
440
480
  };
441
- const rootStyle = { display: "contents", ...brandColor ? { "--lfb-brand": brandColor } : {} };
481
+ const rootStyle = {
482
+ display: "contents",
483
+ ...brandColor ? { "--lfb-brand": brandColor } : {},
484
+ ...zIndex != null ? { "--lfb-z": String(zIndex) } : {}
485
+ };
442
486
  const overlayProps = { [FEEDBACK_OVERLAY_ATTR]: "" };
443
487
  const live = drag ? {
444
488
  left: Math.min(drag.start.x, drag.current.x),
@@ -448,93 +492,102 @@ function FeedbackWidget({
448
492
  } : null;
449
493
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lfb-root", style: rootStyle, children: [
450
494
  /* @__PURE__ */ jsxRuntime.jsx("div", { ...overlayProps, className: "lfb-doc-layer", children: mode.kind === "composing" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
495
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lfb-shield", "aria-hidden": "true" }),
451
496
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lfb-rect", style: { left: mode.rect.x, top: mode.rect.y, width: mode.rect.width, height: mode.rect.height } }),
452
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lfb-anchor", style: { left: mode.rect.x, top: mode.rect.y + mode.rect.height }, children: /* @__PURE__ */ jsxRuntime.jsxs("form", { className: "lfb-card lfb-composer", onSubmit: handleSubmit, children: [
453
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lfb-row", children: [
454
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lfb-eyebrow", children: "New feedback" }),
455
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "lfb-iconbtn", "aria-label": "Cancel", onClick: cancelComposer, children: /* @__PURE__ */ jsxRuntime.jsx(XIcon, {}) })
456
- ] }),
457
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginTop: 12 }, children: [
458
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lfb-field-label", children: "Issue type" }),
459
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lfb-types", children: types.map((t) => {
460
- const Icon = TYPE_ICONS[t.icon ?? "dot"];
461
- return /* @__PURE__ */ jsxRuntime.jsxs(
462
- "button",
497
+ /* @__PURE__ */ jsxRuntime.jsx(
498
+ "div",
499
+ {
500
+ className: "lfb-anchor",
501
+ style: { left: mode.anchorX, top: mode.placement === "below" ? mode.rect.y + mode.rect.height : mode.rect.y },
502
+ children: /* @__PURE__ */ jsxRuntime.jsxs("form", { className: `lfb-card lfb-composer${mode.placement === "above" ? " lfb-composer--above" : ""}`, onSubmit: handleSubmit, children: [
503
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lfb-row", children: [
504
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lfb-eyebrow", children: "New feedback" }),
505
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "lfb-iconbtn", "aria-label": "Cancel", onClick: cancelComposer, children: /* @__PURE__ */ jsxRuntime.jsx(XIcon, {}) })
506
+ ] }),
507
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginTop: 12 }, children: [
508
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lfb-field-label", children: "Issue type" }),
509
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lfb-types", children: types.map((t) => {
510
+ const Icon = TYPE_ICONS[t.icon ?? "dot"];
511
+ return /* @__PURE__ */ jsxRuntime.jsxs(
512
+ "button",
513
+ {
514
+ type: "button",
515
+ className: "lfb-type",
516
+ "aria-pressed": issueType === t.id,
517
+ onClick: () => setIssueType(t.id),
518
+ children: [
519
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lfb-swatch", style: { background: t.color }, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: 14 }) }),
520
+ t.label
521
+ ]
522
+ },
523
+ t.id
524
+ );
525
+ }) })
526
+ ] }),
527
+ /* @__PURE__ */ jsxRuntime.jsx(
528
+ "textarea",
463
529
  {
464
- type: "button",
465
- className: "lfb-type",
466
- "aria-pressed": issueType === t.id,
467
- onClick: () => setIssueType(t.id),
468
- children: [
469
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lfb-swatch", style: { background: t.color }, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: 14 }) }),
470
- t.label
471
- ]
472
- },
473
- t.id
474
- );
475
- }) })
476
- ] }),
477
- /* @__PURE__ */ jsxRuntime.jsx(
478
- "textarea",
479
- {
480
- ref: textareaRef,
481
- className: "lfb-textarea",
482
- placeholder: "What's on your mind?",
483
- value: text,
484
- onChange: (e) => setText(e.target.value),
485
- maxLength: 5e3,
486
- required: true,
487
- disabled: submitting,
488
- rows: 3,
489
- onKeyDown: (e) => {
490
- if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
491
- e.preventDefault();
492
- handleSubmit(e);
493
- }
494
- }
495
- }
496
- ),
497
- editingName ? /* @__PURE__ */ jsxRuntime.jsx(
498
- "input",
499
- {
500
- className: "lfb-input",
501
- type: "text",
502
- value: name,
503
- autoFocus: true,
504
- maxLength: 80,
505
- onChange: (e) => setName(e.target.value),
506
- onBlur: () => {
507
- const t = name.trim();
508
- if (t) persistName(t);
509
- setEditingName(false);
510
- },
511
- onKeyDown: (e) => {
512
- if (e.key === "Enter") {
513
- e.preventDefault();
514
- e.target.blur();
530
+ ref: textareaRef,
531
+ className: "lfb-textarea",
532
+ placeholder: "What's on your mind?",
533
+ value: text,
534
+ onChange: (e) => setText(e.target.value),
535
+ maxLength: 5e3,
536
+ required: true,
537
+ disabled: submitting,
538
+ rows: 3,
539
+ onKeyDown: (e) => {
540
+ if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
541
+ e.preventDefault();
542
+ handleSubmit(e);
543
+ }
544
+ }
515
545
  }
516
- if (e.key === "Escape") {
517
- e.preventDefault();
518
- setEditingName(false);
546
+ ),
547
+ editingName ? /* @__PURE__ */ jsxRuntime.jsx(
548
+ "input",
549
+ {
550
+ ref: nameEditRef,
551
+ className: "lfb-input",
552
+ type: "text",
553
+ value: name,
554
+ maxLength: 80,
555
+ onChange: (e) => setName(e.target.value),
556
+ onBlur: () => {
557
+ const t = name.trim();
558
+ if (t) persistName(t);
559
+ setEditingName(false);
560
+ },
561
+ onKeyDown: (e) => {
562
+ if (e.key === "Enter") {
563
+ e.preventDefault();
564
+ e.target.blur();
565
+ }
566
+ if (e.key === "Escape") {
567
+ e.preventDefault();
568
+ e.stopPropagation();
569
+ setEditingName(false);
570
+ }
571
+ }
519
572
  }
520
- }
521
- }
522
- ) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lfb-namerow", children: [
523
- /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
524
- "Posting as ",
525
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lfb-name", children: name || "anonymous" })
526
- ] }),
527
- /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "lfb-link", onClick: () => setEditingName(true), children: [
528
- /* @__PURE__ */ jsxRuntime.jsx(EditIcon, { size: 12 }),
529
- "change"
573
+ ) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lfb-namerow", children: [
574
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
575
+ "Posting as ",
576
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lfb-name", children: name || "anonymous" })
577
+ ] }),
578
+ /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "lfb-link", onClick: () => setEditingName(true), children: [
579
+ /* @__PURE__ */ jsxRuntime.jsx(EditIcon, { size: 12 }),
580
+ "change"
581
+ ] })
582
+ ] }),
583
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "lfb-error", children: error }),
584
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lfb-actions", children: [
585
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "lfb-btn lfb-btn-ghost", onClick: cancelComposer, disabled: submitting, children: "Cancel" }),
586
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "submit", className: "lfb-btn lfb-btn-primary", disabled: submitting || !text.trim(), children: submitting ? "Sending\u2026" : "Send to Linear" })
587
+ ] })
530
588
  ] })
531
- ] }),
532
- error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "lfb-error", children: error }),
533
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lfb-actions", children: [
534
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "lfb-btn lfb-btn-ghost", onClick: cancelComposer, disabled: submitting, children: "Cancel" }),
535
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "submit", className: "lfb-btn lfb-btn-primary", disabled: submitting || !text.trim(), children: submitting ? "Sending\u2026" : "Send to Linear" })
536
- ] })
537
- ] }) })
589
+ }
590
+ )
538
591
  ] }) }),
539
592
  /* @__PURE__ */ jsxRuntime.jsxs("div", { ...overlayProps, className: "lfb-fixed-layer", children: [
540
593
  mode.kind === "drawing" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lfb-draw", role: "presentation", onMouseDown: onDrawMouseDown, onMouseMove: onDrawMouseMove, onMouseUp: onDrawMouseUp, children: [
@@ -84,8 +84,12 @@ type FeedbackWidgetProps = {
84
84
  nameStorageKey?: string;
85
85
  /** Label on the floating button (default "Give feedback"). */
86
86
  fabLabel?: string;
87
+ /** Stacking context for the widget's layers — sugar for the `--lfb-z` CSS variable. */
88
+ zIndex?: number;
89
+ /** Extra headers sent with the submission (e.g. x-feedback-token for `headerGate`). */
90
+ requestHeaders?: Record<string, string>;
87
91
  };
88
- declare function FeedbackWidget({ endpoint, brandColor, position, types, nameRequired, nameStorageKey, fabLabel, }: FeedbackWidgetProps): react.JSX.Element;
92
+ declare function FeedbackWidget({ endpoint, brandColor, position, types, nameRequired, nameStorageKey, fabLabel, zIndex, requestHeaders, }: FeedbackWidgetProps): react.JSX.Element;
89
93
 
90
94
  type FeedbackGateProps = FeedbackWidgetProps & {
91
95
  /** URL param that toggles the tool: `?feedback` / `?feedback=1` on, `?feedback=0` off. */
@@ -105,6 +109,8 @@ declare function FeedbackGate({ urlParam, cookieName, cookieValue, cookieMaxAgeS
105
109
  type SubmitOptions = {
106
110
  /** Endpoint that runs the server handler (default "/api/feedback"). */
107
111
  endpoint?: string;
112
+ /** Extra request headers (e.g. the embed's x-feedback-token for `headerGate`). */
113
+ headers?: Record<string, string>;
108
114
  };
109
115
  declare function submitFeedback(annotation: FeedbackAnnotation, opts?: SubmitOptions): Promise<FeedbackResult | null>;
110
116