react-linear-feedback 0.1.1 → 0.3.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,127 @@
1
+ "use strict";var LinearFeedback=(()=>{var Re=Object.defineProperty;var Mn=Object.getOwnPropertyDescriptor;var Ln=Object.getOwnPropertyNames;var Un=Object.prototype.hasOwnProperty;var On=(e,t)=>{for(var n in t)Re(e,n,{get:t[n],enumerable:!0})},$n=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ln(t))!Un.call(e,a)&&a!==n&&Re(e,a,{get:()=>t[a],enumerable:!(r=Mn(t,a))||r.enumerable});return e};var Wn=e=>$n(Re({},"__esModule",{value:!0}),e);var Fo={};On(Fo,{destroy:()=>Ge,init:()=>Ce});var me,w,st,Hn,W,rt,lt,ct,Ae,ue,Z,ut,Ie,Fe,Pe,Bn,de={},pe=[],zn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Q=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 ee(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?me.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 fe(e,s,r,a,null)}function fe(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??++st,__i:-1,__u:0};return a==null&&w.vnode!=null&&w.vnode(o),o}function A(e){return e.children}function M(e,t){this.props=e,this.context=t}function j(e,t){if(t==null)return e.__?j(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"?j(e):null}function Vn(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??j(t),!!(32&t.__u),a),o.__v=t.__v,o.__.__k[o.__i]=o,_t(r,o,a),t.__e=t.__=null,o.__e!=n&&ft(o)}}function ft(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}),ft(e)}function ot(e){(!e.__d&&(e.__d=!0)&&W.push(e)&&!_e.__r++||rt!=w.debounceRendering)&&((rt=w.debounceRendering)||lt)(_e)}function _e(){try{for(var e,t=1;W.length;)W.length>t&&W.sort(ct),e=W.shift(),t=W.length,Vn(e)}finally{W.length=_e.__r=0}}function dt(e,t,n,r,a,o,s,i,f,u,c){var l,p,d,b,m,g,h,y=r&&r.__k||pe,x=t.length;for(f=jn(n,t,y,f,x),l=0;l<x;l++)(d=n.__k[l])!=null&&(p=d.__i!=-1&&y[d.__i]||de,d.__i=l,g=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=pt(d,f,e,h),h&&p.__e&&(p.__e=null)):typeof d.type=="function"&&g!==void 0?f=g:b&&(f=b.nextSibling),d.__u&=-7);return n.__e=m,f}function jn(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]=fe(null,s,null,null,null):Q(s)?s=e.__k[o]=fe(A,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[o]=fe(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=qn(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=j(i)),ht(i,i));return r}function pt(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=pt(a[o],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=j(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function te(e,t){return t=t||[],e==null||typeof e=="boolean"||(Q(e)?e.some(function(n){te(n,t)}):t.push(e)),t}function qn(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 at(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||zn.test(t)?n:n+"px"}function ce(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||at(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||at(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(ut,"$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[Z]=r[Z]:(n[Z]=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 it(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[ue]==null)t[ue]=Ie++;else if(t[ue]<n[Z])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,g,h,y,x,k,T,N,P,O,R=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 R=="function")try{if(h=t.props,y=R.prototype&&R.prototype.render,x=(c=R.contextType)&&r[c.__c],k=c?x?x.props.value:c.__:r,n.__c?g=(l=t.__c=n.__c).__=l.__E:(y?t.__c=l=new R(h,k):(t.__c=l=new M(h,k),l.constructor=R,l.render=Yn),x&&x.sub(l),l.state||(l.state={}),l.__n=r,p=l.__d=!0,l.__h=[],l._sb=[]),y&&l.__s==null&&(l.__s=l.state),y&&R.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=$({},l.__s)),$(l.__s,R.getDerivedStateFromProps(h,l.__s))),d=l.props,b=l.state,l.__v=t,p)y&&R.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),y&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(y&&R.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(I){I&&(I.__=t)}),pe.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),y&&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,T=w.__r,N=0,y)l.state=l.__s,l.__d=!1,T&&T(t),c=l.render(l.props,l.state,l.context),pe.push.apply(l.__h,l._sb),l._sb=[];else do l.__d=!1,T&&T(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())),y&&!p&&l.getSnapshotBeforeUpdate!=null&&(m=l.getSnapshotBeforeUpdate(d,b)),P=c!=null&&c.type===A&&c.key==null?mt(c.props.children):c,i=dt(e,Q(P)?P:[P],t,n,r,a,o,s,i,f,u),l.base=t.__e,t.__u&=-161,l.__h.length&&s.push(l),g&&(l.__E=l.__=null)}catch(I){if(t.__v=null,f||o!=null)if(I.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,I.then||De(t);w.__e(I,t,n)}else o==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):i=t.__e=Xn(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 _t(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 mt(e){return typeof e!="object"||e==null||e.__b>0?e:Q(e)?e.map(mt):e.constructor!==void 0?null:$({},e)}function Xn(e,t,n,r,a,o,s,i,f){var u,c,l,p,d,b,m,g=n.props||de,h=t.props,y=t.type;if(y=="svg"?a="http://www.w3.org/2000/svg":y=="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==!!y&&(y?d.localName==y:d.nodeType==3)){e=d,o[u]=null;break}}if(e==null){if(y==null)return document.createTextNode(h);e=document.createElementNS(a,y,h.is&&h),i&&(w.__m&&w.__m(t,o),i=!1),o=null}if(y==null)g===h||i&&e.data==h||(e.data=h);else{if(o=y=="textarea"&&h.defaultValue!=null?null:o&&me.call(e.childNodes),!i&&o!=null)for(g={},u=0;u<e.attributes.length;u++)g[(d=e.attributes[u]).name]=d.value;for(u in g)d=g[u],u=="dangerouslySetInnerHTML"?l=d:u=="children"||u in h||u=="value"&&"defaultValue"in h||u=="checked"&&"defaultChecked"in h||ce(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"||g[u]===d||ce(e,u,d,g[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=""),dt(t.type=="template"?e.content:e,Q(p)?p:[p],t,n,r,y=="foreignObject"?"http://www.w3.org/1999/xhtml":a,o,s,o?o[0]:n.__k&&j(n,0),i,f),o!=null)for(u=o.length;u--;)Me(o[u]);i&&y!="textarea"||(u="value",y=="progress"&&b==null?e.removeAttribute("value"):b!=null&&(b!==e[u]||y=="progress"&&!b||y=="option"&&b!=g[u])&&ce(e,u,b,g[u],a),u="checked",m!=null&&m!=e[u]&&ce(e,u,m,g[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 ht(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]&&ht(r[a],t,n||typeof e.type!="function");n||Me(e.__e),e.__c=e.__=e.__e=void 0}function Yn(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=ee(A,null,[e]),a||de,de,t.namespaceURI,!r&&n?[n]:a?null:t.firstChild?me.call(t.childNodes):null,o,!r&&n?n:a?a.__e:t.firstChild,r,s),_t(o,e,s)}me=pe.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}},st=0,Hn=function(e){return e!=null&&e.constructor===void 0},M.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),ot(this))},M.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ot(this))},M.prototype.render=A,W=[],lt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ct=function(e,t){return e.__v.__b-t.__v.__b},_e.__r=0,Ae=Math.random().toString(8),ue="__d"+Ae,Z="__a"+Ae,ut=/(PointerCapture)$|Capture$/i,Ie=0,Fe=it(!1),Pe=it(!0),Bn=0;var ne,E,$e,bt,be=0,Et=[],C=w,gt=C.__b,yt=C.__r,vt=C.diffed,wt=C.__c,xt=C.unmount,kt=C.__;function He(e,t){C.__h&&C.__h(E,e,be||t),be=0;var n=E.__H||(E.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function F(e){return be=1,Ct(Rt,e)}function Ct(e,t,n){var r=He(ne++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Rt(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 z(e,t){var n=He(ne++,3);!C.__s&&Tt(n.__H,t)&&(n.__=e,n.u=t,E.__H.__h.push(n))}function ge(e){return be=5,Nt(function(){return{current:e}},[])}function Nt(e,t){var n=He(ne++,7);return Tt(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Gn(){for(var e;e=Et.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(he),t.__h.some(We),t.__h=[]}catch(n){t.__h=[],C.__e(n,e.__v)}}}C.__b=function(e){E=null,gt&&gt(e)},C.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),kt&&kt(e,t)},C.__r=function(e){yt&&yt(e),ne=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(he),t.__h.some(We),t.__h=[],ne=0)),$e=E},C.diffed=function(e){vt&&vt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Et.push(t)!==1&&bt===C.requestAnimationFrame||((bt=C.requestAnimationFrame)||Kn)(Gn)),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(he),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)}}),wt&&wt(e,t)},C.unmount=function(e){xt&&xt(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{he(r)}catch(a){t=a}}),n.__H=void 0,t&&C.__e(t,n.__v))};var St=typeof requestAnimationFrame=="function";function Kn(e){var t,n=function(){clearTimeout(r),St&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);St&&(t=requestAnimationFrame(n))}function he(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 Tt(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Rt(e,t){return typeof t=="function"?t(e):t}function Qn(e,t){for(var n in t)e[n]=t[n];return e}function At(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 Ft(e,t){this.props=e,this.context=t}(Ft.prototype=new M).isPureReactComponent=!0,Ft.prototype.shouldComponentUpdate=function(e,t){return At(this.props,e)||At(this.state,t)};var Pt=w.__b;w.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Pt&&Pt(e)};var qo=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var er=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)}er(e,t,n,r)};var Dt=w.unmount;function $t(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=Qn({},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 $t(r,t,n)})),e}function Wt(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Wt(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 Ht(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),Dt&&Dt(e)},(Be.prototype=new M).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var a=Ht(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]=Wt(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]=$t(this.__b,n,r.__O=r.__P)}this.__b=null}var a=t.__a&&ee(A,null,e.fallback);return a&&(a.__u&=-33),[ee(A,null,t.__a?null:e.children),a]};var It=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 M).__a=function(e){var t=this,n=Ht(t.__v),r=t.l.get(e);return r[0]++,function(a){var o=function(){t.props.revealOrder?(r.push(a),It(t,e,r)):a()};n?n(o):o()}},ye.prototype.render=function(e){this.i=null,this.l=new Map;var t=te(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){It(e,n,t)})};var tr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,nr=/^(?: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]/,rr=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,or=/[A-Z0-9]/g,ar=typeof document<"u",ir=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Bt(e,t,n){return t.__k==null&&(t.textContent=""),Oe(e,t),typeof n=="function"&&n(),e?e.__c:null}M.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(M.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Mt=w.event;w.event=function(e){return Mt&&(e=Mt(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var zt,sr={configurable:!0,get:function(){return this.class}},Lt=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||ar&&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"||ir(n.type)?f==="onfocus"?s="onfocusin":f==="onblur"?s="onfocusout":rr.test(s)&&(s=f):f=s="oninput":o&&nr.test(s)?s=s.replace(or,"-$&").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=te(n.children).forEach(function(u){u.props.selected=a.value.indexOf(u.props.value)!=-1})),a.defaultValue!=null&&(a.value=te(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",sr)):n.className&&(a.class=a.className=n.className),t.props=a})(e),e.$$typeof=tr,Lt&&Lt(e)};var Ut=w.__r;w.__r=function(e){Ut&&Ut(e),zt=e.__c};var Ot=w.diffed;w.diffed=function(e){Ot&&Ot(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),zt=null};function Vt(e){return!!e.__k&&(Oe(null,e),!0)}function jt(e){return{render:function(t){Bt(t,e)},unmount:function(){Vt(e)}}}var Xt="data-feedback-overlay";function qt(e){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):e.replace(/[^\w-]/g,t=>`\\${t}`)}function lr(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="${qt(a)}"]`),n.join(" > ");if(r.id)return n.unshift(`#${qt(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 cr(e,t){return document.elementsFromPoint(e,t).find(r=>!r.closest(`[${Xt}]`))??null}function Yt(e,t){let n=cr(e,t);return n&&lr(n)||null}var ze=Xt;var tn="[modern-screenshot]",H=typeof window<"u",ur=H&&"Worker"in window,ea=H&&"atob"in window,ta=H&&"btoa"in window,qe=H?window.navigator?.userAgent:"",nn=qe.includes("Chrome"),ve=qe.includes("AppleWebKit")&&!nn,Xe=qe.includes("Firefox"),fr=e=>e&&"__CONTEXT__"in e,dr=e=>e.constructor.name==="CSSFontFaceRule",pr=e=>e.constructor.name==="CSSImportRule",_r=e=>e.constructor.name==="CSSLayerBlockRule",U=e=>e.nodeType===1,ie=e=>typeof e.className=="object",rn=e=>e.tagName==="image",mr=e=>e.tagName==="use",re=e=>U(e)&&typeof e.style<"u"&&!ie(e),hr=e=>e.nodeType===8,br=e=>e.nodeType===3,X=e=>e.tagName==="IMG",we=e=>e.tagName==="VIDEO",gr=e=>e.tagName==="CANVAS",yr=e=>e.tagName==="TEXTAREA",vr=e=>e.tagName==="INPUT",wr=e=>e.tagName==="STYLE",xr=e=>e.tagName==="SCRIPT",kr=e=>e.tagName==="SELECT",Sr=e=>e.tagName==="SLOT",Er=e=>e.tagName==="IFRAME",Cr=(...e)=>console.warn(tn,...e);function Nr(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 on(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(H&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!H)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 Tr(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 Rr(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 Ar(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 Fr=e=>Ar(e,"dataUrl");function q(e,t){let n=xe(t).createElement("img");return n.decoding="sync",n.loading="eager",n.src=e,n}function oe(e,t){return new Promise(n=>{let{timeout:r,ownerDocument:a,onError:o,onWarn:s}=t??{},i=typeof e=="string"?q(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?oe(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=rn(i)?i.href.baseVal:i.currentSrc||i.src;if(!l)return c();let p=async()=>{if(X(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(X(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 Pr(e,t){re(e)&&(X(e)||we(e)?await oe(e,t):await Promise.all(["img","video"].flatMap(n=>Array.from(e.querySelectorAll(n)).map(r=>oe(r,t)))))}var an=(function(){let t=0,n=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${n()}${t}`)})();function sn(e){return e?.split(",").map(t=>t.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}var Gt=0;function Dr(e){let t=`${tn}[#${Gt}]`;return Gt++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...n)=>e&&Cr(...n)}}function Ir(e){return{cache:e?"no-cache":"force-cache"}}async function ln(e,t){return fr(e)?e:Mr(e,{...t,autoDestruct:!0})}async function Mr(e,t){let{scale:n=1,workerUrl:r,workerNumber:a=1}=t||{},o=!!t?.debug,s=t?.features??!0,i=e.ownerDocument??(H?window.document:void 0),f=e.ownerDocument?.defaultView??(H?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:Ir(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:Dr(o),node:e,ownerDocument:i,ownerWindow:f,dpi:n===1?null:96*n,svgStyleElement:cn(i),svgDefsElement:i?.createElementNS(ke,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:ur&&r&&a?a:0})].map(()=>{try{let d=new Worker(r);return d.onmessage=async b=>{let{url:m,result:g}=b.data;g?u.get(m)?.resolve?.(g):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:`${[Nr(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 Pr(e,{timeout:c.timeout,onWarn:c.log.warn}),c.log.timeEnd("wait until load");let{width:l,height:p}=Lr(e,c);return c.width=l,c.height=p,c}function cn(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 Lr(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 Ur(e,t){let{log:n,timeout:r,drawImageCount:a,drawImageInterval:o}=t;n.time("image to canvas");let s=await oe(e,{timeout:r,onWarn:t.log.warn}),{canvas:i,context2d:f}=Or(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 Or(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 un(e,t){if(e.ownerDocument)try{let o=e.toDataURL();if(o!=="data:,")return q(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 $r(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 Wr(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 Hr(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return q(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 oe(n,{onError:()=>a=!1,onWarn:t.log.warn}),!a)return e.poster?q(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?q(e.poster,e.ownerDocument):n}return un(o,t)}return n}function Br(e,t){return gr(e)?un(e,t):Er(e)?$r(e,t):X(e)?Wr(e):we(e)?Hr(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__${an()}`,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 Vr=["width","height","-webkit-text-fill-color"],jr=["stroke","fill"];function fn(e,t,n){let{defaultComputedStyles:r}=n,a=e.nodeName.toLowerCase(),o=ie(e)&&a!=="svg",s=o?jr.map(m=>[m,e.getAttribute(m)]).filter(([,m])=>m!==null):[],i=[o&&"svg",a,s.map((m,g)=>`${m}=${g}`).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,g])=>{p.setAttributeNS(null,m,g)}),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,g=0;g<m;g++){let h=d.item(g);Vr.includes(h)||b.set(h,d.getPropertyValue(h))}return c.body.removeChild(l),r.set(i,b),b}function dn(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 qr(e,t,n,r){let{ownerWindow:a,includeStyleProperties:o,currentParentNodeStyle:s}=r,i=t.style,f=a.getComputedStyle(e),u=fn(e,null,r);s?.forEach((l,p)=>{u.delete(p)});let c=dn(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"),nn&&(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 Xr(e,t){(yr(e)||vr(e)||kr(e))&&t.setAttribute("value",e.value)}var Yr=["::before","::after"],Gr=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];function Kr(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=[an()],b=fn(e,c,r);f?.forEach((x,k)=>{b.delete(k)});let m=dn(l,b,r.includeStyleProperties);m.delete("content"),m.delete("-webkit-locale"),m.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text");let g=[`content: '${p}';`];if(m.forEach(([x,k],T)=>{g.push(`${T}: ${x}${k?" !important":""};`)}),g.length===1)return;try{t.className=[t.className,...d].join(" ")}catch(x){r.log.warn("Failed to copyPseudoClass",x);return}let h=g.join(`
7
+ `),y=i.get(h);y||(y=[],i.set(h,y)),y.push(`.${d[0]}${c}`)}Yr.forEach(u),n&&Gr.forEach(u)}var Kt=new Set(["symbol"]);async function Jt(e,t,n,r,a){if(U(n)&&(wr(n)||xr(n))||r.filter&&!r.filter(n))return;Kt.has(t.nodeName)||Kt.has(n.nodeName)?r.currentParentNodeStyle=void 0:r.currentParentNodeStyle=r.currentNodeStyle;let o=await Ye(n,r,!1,a);r.isEnable("restoreScrollPosition")&&Jr(e,o),t.appendChild(o)}async function Zt(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(!hr(o))if(U(o)&&Sr(o)&&typeof o.assignedNodes=="function"){let s=o.assignedNodes();for(let i=0;i<s.length;i++)await Jt(e,t,s[i],n,r)}else await Jt(e,t,o,n,r)}function Jr(e,t){if(!re(e)||!re(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 Zr(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 Qr=/^[\w-:]+$/;async function Ye(e,t,n=!1,r){let{ownerDocument:a,ownerWindow:o,fontFamilies:s,onCloneEachNode:i}=t;if(a&&br(e))return r&&/\S/.test(e.data)&&r(e.data),a.createTextNode(e.data);if(a&&o&&U(e)&&(re(e)||ie(e))){let u=await Br(e,t);if(t.isEnable("removeAbnormalAttributes")){let m=u.getAttributeNames();for(let g=m.length,h=0;h<g;h++){let y=m[h];Qr.test(y)||u.removeAttribute(y)}}let c=t.currentNodeStyle=qr(e,u,n,t);n&&Zr(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=sn(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(g=>{let h=s.get(g);h||s.set(g,h=new Set),m.split("").forEach(y=>h.add(y))})}:void 0;return Kr(e,u,l,t,b),Xr(e,u),we(e)||await Zt(e,u,t,b),await i?.(u),u}let f=e.cloneNode(!1);return await Zt(e,f,t),await i?.(f),f}function eo(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 to(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(Fr);default:return i.text()}}).finally(()=>clearTimeout(s))}function ae(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:g}=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 y=r.startsWith("font")&&b&&b.minify,x=new Set;y&&r.split(";")[1].split(",").forEach(P=>{g.has(P)&&g.get(P).forEach(O=>x.add(O))});let k=y&&x.size,T={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,P)=>{m[u.size&m.length-1].postMessage({rawUrl:n,...T}),h.resolve=N,h.reject=P}):to(T)})().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 pn(e,t,n,r){if(!_n(e))return e;for(let[a,o]of no(e,t))try{let s=await ae(n,{url:o,requestType:r?"image":"text",responseType:"dataUrl"});e=e.replace(ro(a),`$1${s}$3`)}catch(s){n.log.warn("Failed to fetch css data url",a,s)}return e}function _n(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}var mn=/url\((['"]?)([^'"]+?)\1\)/g;function no(e,t){let n=[];return e.replace(mn,(r,a,o)=>(n.push([o,on(o,t)]),r)),n.filter(([r])=>!Ve(r))}function ro(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}var oo=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function ao(e,t){return oo.map(n=>{let r=e.getPropertyValue(n);return!r||r==="none"?null:((ve||Xe)&&t.drawImageCount++,pn(r,null,t,!0).then(a=>{!a||r===a||e.setProperty(n,a,e.getPropertyPriority(n))}))}).filter(Boolean)}function io(e,t){if(X(e)){let n=e.currentSrc||e.src;if(!Ve(n))return[ae(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(ie(e)&&!Ve(e.href.baseVal)){let n=e.href.baseVal;return[ae(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(r=>{r&&(e.dataset.originalSrc=n,e.href.baseVal=r||"")})]}return[]}function so(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[ae(t,{url:o,responseType:"text"}).then(u=>{r?.insertAdjacentHTML("beforeend",u)})]}return[]}function hn(e,t){let{tasks:n}=t;U(e)&&((X(e)||rn(e))&&n.push(...io(e,t)),mr(e)&&n.push(...so(e,t))),re(e)&&n.push(...ao(e.style,t)),e.childNodes.forEach(r=>{hn(r,t)})}async function lo(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=en(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(pr(b)){let m=b.href,g="";try{g=await ae(t,{url:m,requestType:"text",responseType:"text"})}catch(y){t.log.warn(`Error fetch remote css import from ${m}`,y)}let h=g.replace(mn,(y,x,k)=>y.replace(k,on(k,m)));for(let y of uo(h))try{l.insertRule(y,l.cssRules.length)}catch(x){t.log.warn("Error inserting rule from remote css import",{rule:y,error:x})}}}))),l.cssRules.length&&f.push(l);let p=[];f.forEach(d=>{je(d.cssRules,p)}),p.filter(d=>dr(d)&&_n(d.style.getPropertyValue("src"))&&sn(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(pn(b.cssText,b.parentStyleSheet?b.parentStyleSheet.href:null,t).then(g=>{g=en(g,t),o.set(b.cssText,g),r.appendChild(n.createTextNode(`${g}
10
+ `))}))})}}var co=/(\/\*[\s\S]*?\*\/)/g,Qt=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;function uo(e){if(e==null)return[];let t=[],n=e.replace(co,"");for(;;){let o=Qt.exec(n);if(!o)break;t.push(o[0])}n=n.replace(Qt,"");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 fo=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,po=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function en(e,t){let{font:n}=t,r=n?n?.preferredFormat:void 0;return r?e.replace(po,a=>{for(;;){let[o,,s]=fo.exec(a)||[];if(!s)return"";if(s===r)return`src: ${o};`}}):e}function je(e,t=[]){for(let n of Array.from(e))_r(n)?t.push(...je(n.cssRules)):"cssRules"in n?je(n.cssRules,t):t.push(n);return t}var _o=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;function mo(e){return _o.test(e.innerHTML)}async function ho(e,t){let n=await ln(e,t);if(U(n.node)&&ie(n.node)&&!mo(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((T,N)=>{k+=`${T.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 lo(m,n),a.timeEnd("embed web font")),a.time("embed node"),hn(m,n);let g=o.length,h=0,y=async()=>{for(;;){let k=o.pop();if(!k)break;try{await k}catch(T){n.log.warn("Failed to run task",T)}c?.(++h,g)}};c?.(h,g),await Promise.all([...Array.from({length:4})].map(y)),a.timeEnd("embed node"),await d?.(m);let x=bo(m,n);return i&&x.insertBefore(i,x.children[0]),s&&x.insertBefore(s,x.children[0]),l&&eo(n),await b?.(x),x}function bo(e,t){let{width:n,height:r}=t,a=Tr(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 bn(e,t){let n=await ln(e,t),r=await ho(n),a=Rr(r,n.isEnable("removeControlCharacter"));n.autoDestruct||(n.svgStyleElement=cn(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(ke,"defs"),n.svgStyles.clear());let o=q(a,r.ownerDocument);return await Ur(o,n)}var go=1600;async function gn(e,t={}){let n=t.endpoint??"/api/feedback",r=vo(e),a=await yo(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 yo(e){try{let t=document.documentElement,n=t.scrollWidth,r=t.scrollHeight,a=window.innerWidth,o=window.innerHeight,s=Math.min(1,go/Math.max(a,o)),i=await bn(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,g=(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(g,h,b*f,m*u),l.strokeRect(g,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 vo(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:Yt(t,n),timestamp:new Date().toISOString()}}var wo=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:--wo,__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 V({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 yn=e=>_(V,{...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"})}),se=e=>_(V,{...e,children:_("path",{d:"M18 6 6 18M6 6l12 12"})}),vn=e=>_(V,{...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"})]}),wn=e=>_(V,{...e,children:[_("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),_("path",{d:"M22 4 12 14.01l-3-3"})]}),xo=e=>_(V,{...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"})]}),ko=e=>_(V,{...e,children:_("path",{d:"M12 19V5M5 12l7-7 7 7"})}),So=e=>_(V,{...e,strokeWidth:0,children:_("circle",{cx:"12",cy:"12",r:"6",fill:"currentColor"})}),xn={bug:xo,improvement:ko,dot:So};var kn="lfb-styles",Eo=`
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-anchor { position: absolute; pointer-events: auto; }
42
+
43
+ .lfb-card {
44
+ background: var(--lfb-surface);
45
+ color: var(--lfb-fg);
46
+ border: 1px solid var(--lfb-border);
47
+ border-radius: var(--lfb-radius);
48
+ box-shadow: 0 12px 32px rgba(0,0,0,0.16), 0 2px 6px rgba(0,0,0,0.08);
49
+ padding: 12px;
50
+ font-family: var(--lfb-font);
51
+ font-size: 14px;
52
+ line-height: 1.4;
53
+ }
54
+ .lfb-composer { position: absolute; top: 100%; left: 0; margin-top: 8px; width: 320px; max-width: calc(100vw - 32px); }
55
+
56
+ .lfb-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
57
+ .lfb-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--lfb-fg-tertiary); }
58
+ .lfb-sub { margin: 4px 0 0; font-size: 12px; color: var(--lfb-fg-tertiary); }
59
+
60
+ .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; }
61
+ .lfb-iconbtn:hover { background: var(--lfb-surface-hover); color: var(--lfb-fg); }
62
+
63
+ .lfb-field-label { font-size: 12px; font-weight: 500; color: var(--lfb-fg-secondary); }
64
+ .lfb-types { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
65
+ .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; }
66
+ .lfb-type:hover { background: var(--lfb-surface-hover); }
67
+ .lfb-type[aria-pressed="true"] { color: var(--lfb-fg); border-color: var(--lfb-brand); box-shadow: inset 0 0 0 1px var(--lfb-brand); }
68
+ .lfb-swatch { width: 20px; height: 20px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
69
+
70
+ .lfb-textarea, .lfb-input {
71
+ width: 100%; margin-top: 12px; border-radius: 8px; background: var(--lfb-surface); color: var(--lfb-fg);
72
+ border: 1px solid var(--lfb-border); padding: 8px 10px; font-size: 14px; font-family: inherit; outline: none;
73
+ }
74
+ .lfb-textarea { resize: none; }
75
+ .lfb-input { margin-top: 8px; font-size: 13px; }
76
+ .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); }
77
+ .lfb-textarea::placeholder, .lfb-input::placeholder { color: var(--lfb-fg-tertiary); }
78
+ .lfb-textarea:disabled { opacity: 0.5; }
79
+
80
+ .lfb-namerow { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--lfb-fg-tertiary); }
81
+ .lfb-name { color: var(--lfb-fg-secondary); font-weight: 600; }
82
+ .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; }
83
+ .lfb-link:hover { background: var(--lfb-surface-hover); }
84
+
85
+ .lfb-error { margin-top: 8px; font-size: 12px; color: #d92d20; }
86
+ .lfb-actions { margin-top: 12px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
87
+ .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; }
88
+ .lfb-btn:disabled { opacity: 0.5; cursor: not-allowed; }
89
+ .lfb-btn-ghost { background: none; color: var(--lfb-fg-secondary); }
90
+ .lfb-btn-ghost:hover:not(:disabled) { background: var(--lfb-surface-hover); }
91
+ .lfb-btn-primary { background: var(--lfb-brand); color: #fff; }
92
+ .lfb-btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--lfb-brand) 88%, black); }
93
+
94
+ .lfb-draw { position: absolute; inset: 0; pointer-events: auto; cursor: crosshair; background: rgba(0,0,0,0.04); user-select: none; }
95
+ .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; }
96
+
97
+ .lfb-stack { position: absolute; bottom: 16px; right: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
98
+ .lfb-stack > * { pointer-events: auto; }
99
+ .lfb-stack--bottom-left { right: auto; left: 16px; align-items: flex-start; }
100
+ .lfb-stack--top-right { bottom: auto; top: 16px; }
101
+ .lfb-stack--top-left { bottom: auto; top: 16px; right: auto; left: 16px; align-items: flex-start; }
102
+ /* Edge tabs: anchored flush to a side, vertically centered. */
103
+ .lfb-stack--right { top: 50%; bottom: auto; right: 0; transform: translateY(-50%); align-items: flex-end; }
104
+ .lfb-stack--left { top: 50%; bottom: auto; left: 0; right: auto; transform: translateY(-50%); align-items: flex-start; }
105
+ /* Keep the transient name-prompt / sent-toast cards off the viewport edge (the tab stays flush). */
106
+ .lfb-stack--right > .lfb-card { margin-right: 12px; }
107
+ .lfb-stack--left > .lfb-card { margin-left: 12px; }
108
+
109
+ .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; }
110
+ .lfb-fab:hover { transform: scale(1.05); background: color-mix(in srgb, var(--lfb-brand) 88%, black); }
111
+ .lfb-fab--active { background: var(--lfb-surface); color: var(--lfb-fg); border: 1px solid var(--lfb-border); }
112
+ .lfb-fab--active:hover { background: var(--lfb-surface-hover); }
113
+
114
+ /* Edge-tab launcher: compact, icon-only, rounded on the inner side only, flush to the viewport edge. */
115
+ .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); }
116
+ .lfb-fab--tab:hover { transform: translateX(-2px); }
117
+ .lfb-stack--left .lfb-fab--tab { border-radius: 0 12px 12px 0; box-shadow: 6px 0 20px rgba(0,0,0,0.18); }
118
+ .lfb-stack--left .lfb-fab--tab:hover { transform: translateX(2px); }
119
+
120
+ .lfb-toast { display: flex; align-items: flex-start; gap: 10px; width: 300px; max-width: calc(100vw - 32px); }
121
+ .lfb-toast-icon { color: #17b26a; flex-shrink: 0; margin-top: 1px; }
122
+ .lfb-toast-body { min-width: 0; flex: 1; }
123
+ .lfb-toast-title { font-size: 14px; font-weight: 600; color: var(--lfb-fg); }
124
+ .lfb-toast-text { margin-top: 2px; font-size: 12px; color: var(--lfb-fg-tertiary); }
125
+ .lfb-toast-link { color: var(--lfb-brand); font-weight: 500; text-decoration: none; }
126
+ .lfb-toast-link:hover { text-decoration: underline; }
127
+ `;function Sn(){if(typeof document>"u"||document.getElementById(kn))return;let e=document.createElement("style");e.id=kn,e.textContent=Eo,document.head.appendChild(e)}var En=12,Cn={width:220,height:130},Co=[{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=Co,nameRequired:a=!0,nameStorageKey:o="wh_feedback_name",fabLabel:s="Give feedback",zIndex:i,requestHeaders:f}){let u=n==="right"||n==="left",[c,l]=F({kind:"idle"}),[p,d]=F(""),[b,m]=F(""),[g,h]=F(!1),[y,x]=F(""),[k,T]=F(r[0]?.id??"bug"),[N,P]=F(!1),[O,R]=F(null),[I,Ne]=F(null),[D,G]=F(null),Je=ge(null),Ze=ge(null);z(()=>{Sn();try{let v=window.localStorage.getItem(o);v&&d(v)}catch{}},[o]),z(()=>{if(c.kind!=="drawing"&&c.kind!=="naming")return;let v=S=>{S.key==="Escape"&&(l({kind:"idle"}),G(null))};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[c.kind]),z(()=>{if(c.kind==="composing"){let v=window.setTimeout(()=>Je.current?.focus(),0);return()=>window.clearTimeout(v)}if(c.kind==="naming"){let v=window.setTimeout(()=>Ze.current?.focus(),0);return()=>window.clearTimeout(v)}},[c.kind]);let Te=v=>{try{window.localStorage.setItem(o,v)}catch{}},Tn=()=>{if(c.kind==="drawing"||c.kind==="naming"){l({kind:"idle"}),G(null);return}Ne(null),a&&!p.trim()?(m(""),l({kind:"naming"})):l({kind:"drawing"})},Rn=v=>{v.preventDefault();let S=b.trim();S&&(d(S),Te(S),l({kind:"drawing"}))},An=v=>{if(c.kind!=="drawing")return;v.preventDefault();let S={x:v.clientX,y:v.clientY};G({start:S,current:S})},Fn=v=>{c.kind!=="drawing"||!D||G(S=>S&&{...S,current:{x:v.clientX,y:v.clientY}})},Pn=v=>{if(c.kind!=="drawing"||!D)return;let S=D.start,L={x:v.clientX,y:v.clientY},le=Math.min(S.x,L.x),K=Math.min(S.y,L.y),B=Math.abs(L.x-S.x),J=Math.abs(L.y-S.y);(B<En||J<En)&&(B=Math.max(B,Cn.width),J=Math.max(J,Cn.height),le=L.x-B/2,K=L.y-J/2);let In={x:Math.max(0,le+window.scrollX),y:Math.max(0,K+window.scrollY),width:B,height:J};G(null),x(""),T(r[0]?.id??"bug"),R(null),h(!1),l({kind:"composing",rect:In})},Qe=()=>{l({kind:"idle"}),x(""),R(null),h(!1),P(!1)},et=async v=>{if(v.preventDefault(),c.kind!=="composing"||N)return;let S=y.trim();if(!S)return;let L=p.trim(),le=r.find(B=>B.id===k);P(!0),R(null),L&&Te(L);let K=await gn({rect:c.rect,note:S,type:k,typeLabel:le?.label,name:L||void 0},{endpoint:e,headers:f});P(!1),K?(Ne(K),x(""),h(!1),l({kind:"idle"})):R("Couldn't send \u2014 please try again.")},Dn={display:"contents",...t?{"--lfb-brand":t}:{},...i!=null?{"--lfb-z":String(i)}:{}},tt={[ze]:""},nt=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:Dn,children:[_("div",{...tt,className:"lfb-doc-layer",children:c.kind==="composing"&&_(A,{children:[_("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.rect.x,top:c.rect.y+c.rect.height},children:_("form",{className:"lfb-card lfb-composer",onSubmit:et,children:[_("div",{className:"lfb-row",children:[_("span",{className:"lfb-eyebrow",children:"New feedback"}),_("button",{type:"button",className:"lfb-iconbtn","aria-label":"Cancel",onClick:Qe,children:_(se,{})})]}),_("div",{style:{marginTop:12},children:[_("span",{className:"lfb-field-label",children:"Issue type"}),_("div",{className:"lfb-types",children:r.map(v=>{let S=xn[v.icon??"dot"];return _("button",{type:"button",className:"lfb-type","aria-pressed":k===v.id,onClick:()=>T(v.id),children:[_("span",{className:"lfb-swatch",style:{background:v.color},children:_(S,{size:14})}),v.label]},v.id)})})]}),_("textarea",{ref:Je,className:"lfb-textarea",placeholder:"What's on your mind?",value:y,onChange:v=>x(v.target.value),maxLength:5e3,required:!0,disabled:N,rows:3,onKeyDown:v=>{v.key==="Enter"&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),et(v))}}),g?_("input",{className:"lfb-input",type:"text",value:p,autoFocus:!0,maxLength:80,onChange:v=>d(v.target.value),onBlur:()=>{let v=p.trim();v&&Te(v),h(!1)},onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),v.target.blur()),v.key==="Escape"&&(v.preventDefault(),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:[_(vn,{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:Qe,disabled:N,children:"Cancel"}),_("button",{type:"submit",className:"lfb-btn lfb-btn-primary",disabled:N||!y.trim(),children:N?"Sending\u2026":"Send to Linear"})]})]})})]})}),_("div",{...tt,className:"lfb-fixed-layer",children:[c.kind==="drawing"&&_("div",{className:"lfb-draw",role:"presentation",onMouseDown:An,onMouseMove:Fn,onMouseUp:Pn,children:[_("div",{className:"lfb-hint",children:"Drag to select an area \xB7 Esc to cancel"}),nt&&_("div",{className:"lfb-rect",style:nt})]}),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:Rn,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:_(se,{})})]}),_("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:v=>m(v.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"})]})]}),I&&c.kind==="idle"&&_("div",{className:"lfb-card lfb-toast",children:[_("span",{className:"lfb-toast-icon",children:_(wn,{size:20})}),_("div",{className:"lfb-toast-body",children:[_("div",{className:"lfb-toast-title",children:"Feedback sent"}),_("div",{className:"lfb-toast-text",children:["Created ",I.identifier??"an issue",".",I.url&&_(A,{children:[" ",_("a",{className:"lfb-toast-link",href:I.url,target:"_blank",rel:"noopener noreferrer",children:"View in Linear"})]})]})]}),_("button",{type:"button",className:"lfb-iconbtn","aria-label":"Dismiss",onClick:()=>Ne(null),children:_(se,{})})]}),_("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:Tn,children:[c.kind==="idle"?_(yn,{size:u?22:18}):_(se,{size:u?22:18}),!u&&_("span",{children:c.kind==="idle"?s:"Cancel"})]})]})]})]})}var No=3600*24*90;function To(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 Ro(e,t){return typeof document>"u"?!1:document.cookie.split(";").map(n=>n.trim()).some(n=>n===`${e}=${t}`)}function Nn({urlParam:e="feedback",cookieName:t="wh_feedback",cookieValue:n="1",cookieMaxAgeSeconds:r=No,...a}){let[o,s]=F(!1);return z(()=>{if(typeof window>"u")return;let i=new URLSearchParams(window.location.search),f=i.get(e);if(f!=null){let u=f!=="0";To(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(Ro(t,n))},[e,t,n,r]),o?_(Se,{...a}):null}var Ee=null,Y=null;function Ce(e={}){Ge(),Y=document.createElement("div"),Y.setAttribute("data-lfb-embed",""),document.body.appendChild(Y),Ee=jt(Y);let{mode:t,token:n,...r}=e,a={...r,requestHeaders:n?{"x-feedback-token":n,...r.requestHeaders}:r.requestHeaders};Ee.render(t==="gated"?_(Nn,{...a}):_(Se,{...a}))}function Ge(){Ee?.unmount(),Y?.remove(),Ee=null,Y=null}function Ao(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={...Ao(Ke),...window.lfbConfig??{}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Ce(e),{once:!0}):Ce(e)}return Wn(Fo);})();
@@ -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) {
@@ -169,7 +169,13 @@ var TYPE_ICONS = {
169
169
  // src/react/styles.ts
170
170
  var STYLE_ID = "lfb-styles";
171
171
  var CSS2 = `
172
- .lfb-doc-layer, .lfb-fixed-layer {
172
+ /*
173
+ * Defaults live on .lfb-root (the element that also receives the inline brandColor
174
+ * override) \u2014 NOT on the layers. The layers/FAB inherit from here. If the defaults
175
+ * sat on .lfb-doc-layer/.lfb-fixed-layer, a direct rule on those elements would beat
176
+ * the brandColor inherited from .lfb-root, so the \`brandColor\` prop would never apply.
177
+ */
178
+ .lfb-root {
173
179
  --lfb-brand: #6366f1;
174
180
  --lfb-fg: #181d27;
175
181
  --lfb-fg-secondary: #414651;
@@ -250,12 +256,24 @@ var CSS2 = `
250
256
  .lfb-stack--bottom-left { right: auto; left: 16px; align-items: flex-start; }
251
257
  .lfb-stack--top-right { bottom: auto; top: 16px; }
252
258
  .lfb-stack--top-left { bottom: auto; top: 16px; right: auto; left: 16px; align-items: flex-start; }
259
+ /* Edge tabs: anchored flush to a side, vertically centered. */
260
+ .lfb-stack--right { top: 50%; bottom: auto; right: 0; transform: translateY(-50%); align-items: flex-end; }
261
+ .lfb-stack--left { top: 50%; bottom: auto; left: 0; right: auto; transform: translateY(-50%); align-items: flex-start; }
262
+ /* Keep the transient name-prompt / sent-toast cards off the viewport edge (the tab stays flush). */
263
+ .lfb-stack--right > .lfb-card { margin-right: 12px; }
264
+ .lfb-stack--left > .lfb-card { margin-left: 12px; }
253
265
 
254
266
  .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; }
255
267
  .lfb-fab:hover { transform: scale(1.05); background: color-mix(in srgb, var(--lfb-brand) 88%, black); }
256
268
  .lfb-fab--active { background: var(--lfb-surface); color: var(--lfb-fg); border: 1px solid var(--lfb-border); }
257
269
  .lfb-fab--active:hover { background: var(--lfb-surface-hover); }
258
270
 
271
+ /* Edge-tab launcher: compact, icon-only, rounded on the inner side only, flush to the viewport edge. */
272
+ .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); }
273
+ .lfb-fab--tab:hover { transform: translateX(-2px); }
274
+ .lfb-stack--left .lfb-fab--tab { border-radius: 0 12px 12px 0; box-shadow: 6px 0 20px rgba(0,0,0,0.18); }
275
+ .lfb-stack--left .lfb-fab--tab:hover { transform: translateX(2px); }
276
+
259
277
  .lfb-toast { display: flex; align-items: flex-start; gap: 10px; width: 300px; max-width: calc(100vw - 32px); }
260
278
  .lfb-toast-icon { color: #17b26a; flex-shrink: 0; margin-top: 1px; }
261
279
  .lfb-toast-body { min-width: 0; flex: 1; }
@@ -285,8 +303,11 @@ function FeedbackWidget({
285
303
  types = DEFAULT_TYPES,
286
304
  nameRequired = true,
287
305
  nameStorageKey = "wh_feedback_name",
288
- fabLabel = "Give feedback"
306
+ fabLabel = "Give feedback",
307
+ zIndex,
308
+ requestHeaders
289
309
  }) {
310
+ const isEdge = position === "right" || position === "left";
290
311
  const [mode, setMode] = react.useState({ kind: "idle" });
291
312
  const [name, setName] = react.useState("");
292
313
  const [nameDraft, setNameDraft] = react.useState("");
@@ -407,7 +428,7 @@ function FeedbackWidget({
407
428
  if (trimmedName) persistName(trimmedName);
408
429
  const res = await submitFeedback(
409
430
  { rect: mode.rect, note: trimmedNote, type: issueType, typeLabel: selected?.label, name: trimmedName || void 0 },
410
- { endpoint }
431
+ { endpoint, headers: requestHeaders }
411
432
  );
412
433
  setSubmitting(false);
413
434
  if (res) {
@@ -419,7 +440,11 @@ function FeedbackWidget({
419
440
  setError("Couldn't send \u2014 please try again.");
420
441
  }
421
442
  };
422
- const rootStyle = { display: "contents", ...brandColor ? { "--lfb-brand": brandColor } : {} };
443
+ const rootStyle = {
444
+ display: "contents",
445
+ ...brandColor ? { "--lfb-brand": brandColor } : {},
446
+ ...zIndex != null ? { "--lfb-z": String(zIndex) } : {}
447
+ };
423
448
  const overlayProps = { [FEEDBACK_OVERLAY_ATTR]: "" };
424
449
  const live = drag ? {
425
450
  left: Math.min(drag.start.x, drag.current.x),
@@ -563,21 +588,18 @@ function FeedbackWidget({
563
588
  ] }),
564
589
  /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "lfb-iconbtn", "aria-label": "Dismiss", onClick: () => setResult(null), children: /* @__PURE__ */ jsxRuntime.jsx(XIcon, {}) })
565
590
  ] }),
566
- /* @__PURE__ */ jsxRuntime.jsx(
591
+ /* @__PURE__ */ jsxRuntime.jsxs(
567
592
  "button",
568
593
  {
569
594
  type: "button",
570
- className: `lfb-fab${mode.kind === "idle" ? "" : " lfb-fab--active"}`,
595
+ className: `lfb-fab${isEdge ? " lfb-fab--tab" : ""}${mode.kind === "idle" ? "" : " lfb-fab--active"}`,
571
596
  "aria-label": mode.kind === "idle" ? fabLabel : "Cancel feedback",
597
+ title: isEdge ? mode.kind === "idle" ? fabLabel : "Cancel feedback" : void 0,
572
598
  onClick: startFlow,
573
- children: mode.kind === "idle" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
574
- /* @__PURE__ */ jsxRuntime.jsx(MessageIcon, { size: 18 }),
575
- " ",
576
- fabLabel
577
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
578
- /* @__PURE__ */ jsxRuntime.jsx(XIcon, { size: 18 }),
579
- " Cancel"
580
- ] })
599
+ children: [
600
+ mode.kind === "idle" ? /* @__PURE__ */ jsxRuntime.jsx(MessageIcon, { size: isEdge ? 22 : 18 }) : /* @__PURE__ */ jsxRuntime.jsx(XIcon, { size: isEdge ? 22 : 18 }),
601
+ !isEdge && /* @__PURE__ */ jsxRuntime.jsx("span", { children: mode.kind === "idle" ? fabLabel : "Cancel" })
602
+ ]
581
603
  }
582
604
  )
583
605
  ] })
@@ -66,7 +66,9 @@ type FeedbackResult = {
66
66
  };
67
67
 
68
68
  declare const DEFAULT_TYPES: FeedbackTypeOption[];
69
- type FeedbackPosition = "bottom-right" | "bottom-left" | "top-right" | "top-left";
69
+ type FeedbackPosition = "bottom-right" | "bottom-left" | "top-right" | "top-left"
70
+ /** Edge tabs: compact, icon-only launcher flush to the side, vertically centered. */
71
+ | "right" | "left";
70
72
  type FeedbackWidgetProps = {
71
73
  /** Endpoint that runs the server handler (default "/api/feedback"). */
72
74
  endpoint?: string;
@@ -82,8 +84,12 @@ type FeedbackWidgetProps = {
82
84
  nameStorageKey?: string;
83
85
  /** Label on the floating button (default "Give feedback"). */
84
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>;
85
91
  };
86
- 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;
87
93
 
88
94
  type FeedbackGateProps = FeedbackWidgetProps & {
89
95
  /** URL param that toggles the tool: `?feedback` / `?feedback=1` on, `?feedback=0` off. */
@@ -103,6 +109,8 @@ declare function FeedbackGate({ urlParam, cookieName, cookieValue, cookieMaxAgeS
103
109
  type SubmitOptions = {
104
110
  /** Endpoint that runs the server handler (default "/api/feedback"). */
105
111
  endpoint?: string;
112
+ /** Extra request headers (e.g. the embed's x-feedback-token for `headerGate`). */
113
+ headers?: Record<string, string>;
106
114
  };
107
115
  declare function submitFeedback(annotation: FeedbackAnnotation, opts?: SubmitOptions): Promise<FeedbackResult | null>;
108
116
 
@@ -66,7 +66,9 @@ type FeedbackResult = {
66
66
  };
67
67
 
68
68
  declare const DEFAULT_TYPES: FeedbackTypeOption[];
69
- type FeedbackPosition = "bottom-right" | "bottom-left" | "top-right" | "top-left";
69
+ type FeedbackPosition = "bottom-right" | "bottom-left" | "top-right" | "top-left"
70
+ /** Edge tabs: compact, icon-only launcher flush to the side, vertically centered. */
71
+ | "right" | "left";
70
72
  type FeedbackWidgetProps = {
71
73
  /** Endpoint that runs the server handler (default "/api/feedback"). */
72
74
  endpoint?: string;
@@ -82,8 +84,12 @@ type FeedbackWidgetProps = {
82
84
  nameStorageKey?: string;
83
85
  /** Label on the floating button (default "Give feedback"). */
84
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>;
85
91
  };
86
- 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;
87
93
 
88
94
  type FeedbackGateProps = FeedbackWidgetProps & {
89
95
  /** URL param that toggles the tool: `?feedback` / `?feedback=1` on, `?feedback=0` off. */
@@ -103,6 +109,8 @@ declare function FeedbackGate({ urlParam, cookieName, cookieValue, cookieMaxAgeS
103
109
  type SubmitOptions = {
104
110
  /** Endpoint that runs the server handler (default "/api/feedback"). */
105
111
  endpoint?: string;
112
+ /** Extra request headers (e.g. the embed's x-feedback-token for `headerGate`). */
113
+ headers?: Record<string, string>;
106
114
  };
107
115
  declare function submitFeedback(annotation: FeedbackAnnotation, opts?: SubmitOptions): Promise<FeedbackResult | null>;
108
116
 
@@ -57,7 +57,7 @@ async function submitFeedback(annotation, opts = {}) {
57
57
  try {
58
58
  const res = await fetch(endpoint, {
59
59
  method: "POST",
60
- headers: { "Content-Type": "application/json" },
60
+ headers: { "Content-Type": "application/json", ...opts.headers },
61
61
  body: JSON.stringify(payload)
62
62
  });
63
63
  if (!res.ok) {
@@ -167,7 +167,13 @@ var TYPE_ICONS = {
167
167
  // src/react/styles.ts
168
168
  var STYLE_ID = "lfb-styles";
169
169
  var CSS2 = `
170
- .lfb-doc-layer, .lfb-fixed-layer {
170
+ /*
171
+ * Defaults live on .lfb-root (the element that also receives the inline brandColor
172
+ * override) \u2014 NOT on the layers. The layers/FAB inherit from here. If the defaults
173
+ * sat on .lfb-doc-layer/.lfb-fixed-layer, a direct rule on those elements would beat
174
+ * the brandColor inherited from .lfb-root, so the \`brandColor\` prop would never apply.
175
+ */
176
+ .lfb-root {
171
177
  --lfb-brand: #6366f1;
172
178
  --lfb-fg: #181d27;
173
179
  --lfb-fg-secondary: #414651;
@@ -248,12 +254,24 @@ var CSS2 = `
248
254
  .lfb-stack--bottom-left { right: auto; left: 16px; align-items: flex-start; }
249
255
  .lfb-stack--top-right { bottom: auto; top: 16px; }
250
256
  .lfb-stack--top-left { bottom: auto; top: 16px; right: auto; left: 16px; align-items: flex-start; }
257
+ /* Edge tabs: anchored flush to a side, vertically centered. */
258
+ .lfb-stack--right { top: 50%; bottom: auto; right: 0; transform: translateY(-50%); align-items: flex-end; }
259
+ .lfb-stack--left { top: 50%; bottom: auto; left: 0; right: auto; transform: translateY(-50%); align-items: flex-start; }
260
+ /* Keep the transient name-prompt / sent-toast cards off the viewport edge (the tab stays flush). */
261
+ .lfb-stack--right > .lfb-card { margin-right: 12px; }
262
+ .lfb-stack--left > .lfb-card { margin-left: 12px; }
251
263
 
252
264
  .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; }
253
265
  .lfb-fab:hover { transform: scale(1.05); background: color-mix(in srgb, var(--lfb-brand) 88%, black); }
254
266
  .lfb-fab--active { background: var(--lfb-surface); color: var(--lfb-fg); border: 1px solid var(--lfb-border); }
255
267
  .lfb-fab--active:hover { background: var(--lfb-surface-hover); }
256
268
 
269
+ /* Edge-tab launcher: compact, icon-only, rounded on the inner side only, flush to the viewport edge. */
270
+ .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); }
271
+ .lfb-fab--tab:hover { transform: translateX(-2px); }
272
+ .lfb-stack--left .lfb-fab--tab { border-radius: 0 12px 12px 0; box-shadow: 6px 0 20px rgba(0,0,0,0.18); }
273
+ .lfb-stack--left .lfb-fab--tab:hover { transform: translateX(2px); }
274
+
257
275
  .lfb-toast { display: flex; align-items: flex-start; gap: 10px; width: 300px; max-width: calc(100vw - 32px); }
258
276
  .lfb-toast-icon { color: #17b26a; flex-shrink: 0; margin-top: 1px; }
259
277
  .lfb-toast-body { min-width: 0; flex: 1; }
@@ -283,8 +301,11 @@ function FeedbackWidget({
283
301
  types = DEFAULT_TYPES,
284
302
  nameRequired = true,
285
303
  nameStorageKey = "wh_feedback_name",
286
- fabLabel = "Give feedback"
304
+ fabLabel = "Give feedback",
305
+ zIndex,
306
+ requestHeaders
287
307
  }) {
308
+ const isEdge = position === "right" || position === "left";
288
309
  const [mode, setMode] = useState({ kind: "idle" });
289
310
  const [name, setName] = useState("");
290
311
  const [nameDraft, setNameDraft] = useState("");
@@ -405,7 +426,7 @@ function FeedbackWidget({
405
426
  if (trimmedName) persistName(trimmedName);
406
427
  const res = await submitFeedback(
407
428
  { rect: mode.rect, note: trimmedNote, type: issueType, typeLabel: selected?.label, name: trimmedName || void 0 },
408
- { endpoint }
429
+ { endpoint, headers: requestHeaders }
409
430
  );
410
431
  setSubmitting(false);
411
432
  if (res) {
@@ -417,7 +438,11 @@ function FeedbackWidget({
417
438
  setError("Couldn't send \u2014 please try again.");
418
439
  }
419
440
  };
420
- const rootStyle = { display: "contents", ...brandColor ? { "--lfb-brand": brandColor } : {} };
441
+ const rootStyle = {
442
+ display: "contents",
443
+ ...brandColor ? { "--lfb-brand": brandColor } : {},
444
+ ...zIndex != null ? { "--lfb-z": String(zIndex) } : {}
445
+ };
421
446
  const overlayProps = { [FEEDBACK_OVERLAY_ATTR]: "" };
422
447
  const live = drag ? {
423
448
  left: Math.min(drag.start.x, drag.current.x),
@@ -561,21 +586,18 @@ function FeedbackWidget({
561
586
  ] }),
562
587
  /* @__PURE__ */ jsx("button", { type: "button", className: "lfb-iconbtn", "aria-label": "Dismiss", onClick: () => setResult(null), children: /* @__PURE__ */ jsx(XIcon, {}) })
563
588
  ] }),
564
- /* @__PURE__ */ jsx(
589
+ /* @__PURE__ */ jsxs(
565
590
  "button",
566
591
  {
567
592
  type: "button",
568
- className: `lfb-fab${mode.kind === "idle" ? "" : " lfb-fab--active"}`,
593
+ className: `lfb-fab${isEdge ? " lfb-fab--tab" : ""}${mode.kind === "idle" ? "" : " lfb-fab--active"}`,
569
594
  "aria-label": mode.kind === "idle" ? fabLabel : "Cancel feedback",
595
+ title: isEdge ? mode.kind === "idle" ? fabLabel : "Cancel feedback" : void 0,
570
596
  onClick: startFlow,
571
- children: mode.kind === "idle" ? /* @__PURE__ */ jsxs(Fragment, { children: [
572
- /* @__PURE__ */ jsx(MessageIcon, { size: 18 }),
573
- " ",
574
- fabLabel
575
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
576
- /* @__PURE__ */ jsx(XIcon, { size: 18 }),
577
- " Cancel"
578
- ] })
597
+ children: [
598
+ mode.kind === "idle" ? /* @__PURE__ */ jsx(MessageIcon, { size: isEdge ? 22 : 18 }) : /* @__PURE__ */ jsx(XIcon, { size: isEdge ? 22 : 18 }),
599
+ !isEdge && /* @__PURE__ */ jsx("span", { children: mode.kind === "idle" ? fabLabel : "Cancel" })
600
+ ]
579
601
  }
580
602
  )
581
603
  ] })