@ohbug/extension-feedback 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +19 -19
  2. package/dist/index.mjs +406 -420
  3. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,34 +1,34 @@
1
- "use strict";const S={};function Le(e){S.context=e}const ze=(e,t)=>e===t,z=Symbol("solid-proxy"),He=Symbol("solid-track"),W={equals:ze};let be=me;const H={},O=1,X=2,pe={owned:null,cleanups:null,context:null,owner:null};var y=null;let G=null,b=null,B=null,$=null,E=null,le=0;function je(e,t){const n=b,o=y,l=e.length===0,s=l?pe:{owned:null,cleanups:null,context:null,owner:t||o},i=l?e:()=>e(()=>ue(s));y=s,b=null;try{return ce(i,!0)}finally{b=n,y=o}}function F(e,t){t=t?Object.assign({},W,t):W;const n={value:e,observers:null,observerSlots:null,pending:H,comparator:t.equals||void 0},o=l=>(typeof l=="function"&&(l=l(n.pending!==H?n.pending:n.value)),ie(n,l));return[ve.bind(n),o]}function j(e,t,n){const o=re(e,t,!1,O);I(o)}function we(e,t,n){be=Fe;const o=re(e,t,!1,O);o.user=!0,E?E.push(o):I(o)}function de(e,t,n){n=n?Object.assign({},W,n):W;const o=re(e,t,!0,0);return o.pending=H,o.observers=null,o.observerSlots=null,o.comparator=n.equals||void 0,I(o),ve.bind(o)}function ye(e){if(B)return e();let t;const n=B=[];try{t=e()}finally{B=null}return ce(()=>{for(let o=0;o<n.length;o+=1){const l=n[o];if(l.pending!==H){const s=l.pending;l.pending=H,ie(l,s)}}},!1),t}function se(e){let t,n=b;return b=null,t=e(),b=n,t}function Me(e){return y===null||(y.cleanups===null?y.cleanups=[e]:y.cleanups.push(e)),e}function $e(){return b}function ve(){const e=G;if(this.sources&&(this.state||e)){const t=$;$=null,this.state===O||e?I(this):Y(this),$=t}if(b){const t=this.observers?this.observers.length:0;b.sources?(b.sources.push(this),b.sourceSlots.push(t)):(b.sources=[this],b.sourceSlots=[t]),this.observers?(this.observers.push(b),this.observerSlots.push(b.sources.length-1)):(this.observers=[b],this.observerSlots=[b.sources.length-1])}return this.value}function ie(e,t,n){if(B)return e.pending===H&&B.push(e),e.pending=t,t;if(e.comparator&&e.comparator(e.value,t))return t;let o=!1;return e.value=t,e.observers&&e.observers.length&&ce(()=>{for(let l=0;l<e.observers.length;l+=1){const s=e.observers[l];o&&G.disposed.has(s),(o&&!s.tState||!o&&!s.state)&&(s.pure?$.push(s):E.push(s),s.observers&&xe(s)),o||(s.state=O)}if($.length>1e6)throw $=[],new Error},!1),t}function I(e){if(!e.fn)return;ue(e);const t=y,n=b,o=le;b=y=e,De(e,e.value,o),b=n,y=t}function De(e,t,n){let o;try{o=e.fn(t)}catch(l){Ee(l)}(!e.updatedAt||e.updatedAt<=n)&&(e.observers&&e.observers.length?ie(e,o):e.value=o,e.updatedAt=n)}function re(e,t,n,o=O,l){const s={fn:e,state:o,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:y,context:null,pure:n};return y===null||y!==pe&&(y.owned?y.owned.push(s):y.owned=[s]),s}function R(e){const t=G;if(e.state===0||t)return;if(e.state===X||t)return Y(e);if(e.suspense&&se(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<le);)(e.state||t)&&n.push(e);for(let o=n.length-1;o>=0;o--)if(e=n[o],e.state===O||t)I(e);else if(e.state===X||t){const l=$;$=null,Y(e,n[0]),$=l}}function ce(e,t){if($)return e();let n=!1;t||($=[]),E?n=!0:E=[],le++;try{const o=e();return Be(n),o}catch(o){$||(E=null),Ee(o)}}function Be(e){$&&(me($),$=null),!e&&(E.length?ye(()=>{be(E),E=null}):E=null)}function me(e){for(let t=0;t<e.length;t++)R(e[t])}function Fe(e){let t,n=0;for(t=0;t<e.length;t++){const l=e[t];l.user?e[n++]=l:R(l)}S.context&&Le();const o=e.length;for(t=0;t<n;t++)R(e[t]);for(t=o;t<e.length;t++)R(e[t])}function Y(e,t){const n=G;e.state=0;for(let o=0;o<e.sources.length;o+=1){const l=e.sources[o];l.sources&&(l.state===O||n?l!==t&&R(l):(l.state===X||n)&&Y(l,t))}}function xe(e){const t=G;for(let n=0;n<e.observers.length;n+=1){const o=e.observers[n];(!o.state||t)&&(o.state=X,o.pure?$.push(o):E.push(o),o.observers&&xe(o))}}function ue(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),o=e.sourceSlots.pop(),l=n.observers;if(l&&l.length){const s=l.pop(),i=n.observerSlots.pop();o<l.length&&(s.sourceSlots[i]=o,l[o]=s,n.observerSlots[o]=i)}}if(e.owned){for(t=0;t<e.owned.length;t++)ue(e.owned[t]);e.owned=null}if(e.cleanups){for(t=0;t<e.cleanups.length;t++)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function Ee(e){throw e}function x(e,t){return se(()=>e(t||{}))}function V(e){let t=!1;const n=de(()=>e.when,void 0,{equals:(o,l)=>t?o===l:!o==!l});return de(()=>{const o=n();if(o){const l=e.children;return(t=typeof l=="function"&&l.length>0)?se(()=>l(o)):l}return e.fallback})}function Re(e,t,n){let o=n.length,l=t.length,s=o,i=0,r=0,c=t[l-1].nextSibling,f=null;for(;i<l||r<s;){if(t[i]===n[r]){i++,r++;continue}for(;t[l-1]===n[s-1];)l--,s--;if(l===i){const a=s<o?r?n[r-1].nextSibling:n[s-r]:c;for(;r<s;)e.insertBefore(n[r++],a)}else if(s===r)for(;i<l;)(!f||!f.has(t[i]))&&t[i].remove(),i++;else if(t[i]===n[s-1]&&n[r]===t[l-1]){const a=t[--l].nextSibling;e.insertBefore(n[r++],t[i++].nextSibling),e.insertBefore(n[--s],a),t[l]=n[s]}else{if(!f){f=new Map;let h=r;for(;h<s;)f.set(n[h],h++)}const a=f.get(t[i]);if(a!=null)if(r<a&&a<s){let h=i,v=1,_;for(;++h<l&&h<s&&!((_=f.get(t[h]))==null||_!==a+v);)v++;if(v>a-r){const C=t[i];for(;r<a;)e.insertBefore(n[r++],C)}else e.replaceChild(n[r++],t[i++])}else i++;else t[i++].remove()}}}const he="_$DX_DELEGATE";function Ve(e,t,n){let o;return je(l=>{o=l,t===document?e():m(t,e(),t.firstChild?null:void 0,n)}),()=>{o(),t.textContent=""}}function N(e,t,n){const o=document.createElement("template");o.innerHTML=e;let l=o.content.firstChild;return n&&(l=l.firstChild),l}function Se(e,t=window.document){const n=t[he]||(t[he]=new Set);for(let o=0,l=e.length;o<l;o++){const s=e[o];n.has(s)||(n.add(s),t.addEventListener(s,Ue))}}function m(e,t,n,o){if(n!==void 0&&!o&&(o=[]),typeof t!="function")return J(e,t,o,n);j(l=>J(e,t(),l,n),o)}function Ue(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),S.registry&&!S.done&&(S.done=!0,document.querySelectorAll("[id^=pl-]").forEach(o=>o.remove()));n!==null;){const o=n[t];if(o&&!n.disabled){const l=n[`${t}Data`];if(l!==void 0?o.call(n,l,e):o.call(n,e),e.cancelBubble)return}n=n.host&&n.host!==n&&n.host instanceof Node?n.host:n.parentNode}}function J(e,t,n,o,l){for(S.context&&!n&&(n=[...e.childNodes]);typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,i=o!==void 0;if(e=i&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(S.context)return n;if(s==="number"&&(t=t.toString()),i){let r=n[0];r&&r.nodeType===3?r.data=t:r=document.createTextNode(t),n=P(e,n,o,r)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||s==="boolean"){if(S.context)return n;n=P(e,n,o)}else{if(s==="function")return j(()=>{let r=t();for(;typeof r=="function";)r=r();n=J(e,r,n,o)}),()=>n;if(Array.isArray(t)){const r=[],c=n&&Array.isArray(n);if(te(r,t,n,l))return j(()=>n=J(e,r,n,o,!0)),()=>n;if(S.context){for(let f=0;f<r.length;f++)if(r[f].parentNode)return n=r}if(r.length===0){if(n=P(e,n,o),i)return n}else c?n.length===0?ge(e,r,o):Re(e,n,r):(n&&P(e),ge(e,r));n=r}else if(t instanceof Node){if(S.context&&t.parentNode)return n=i?[t]:t;if(Array.isArray(n)){if(i)return n=P(e,n,o,t);P(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function te(e,t,n,o){let l=!1;for(let s=0,i=t.length;s<i;s++){let r=t[s],c=n&&n[s];if(r instanceof Node)e.push(r);else if(!(r==null||r===!0||r===!1))if(Array.isArray(r))l=te(e,r,c)||l;else if(typeof r=="function")if(o){for(;typeof r=="function";)r=r();l=te(e,Array.isArray(r)?r:[r],c)||l}else e.push(r),l=!0;else{const f=String(r);c&&c.nodeType===3&&c.data===f?e.push(c):e.push(document.createTextNode(f))}}return l}function ge(e,t,n){for(let o=0,l=t.length;o<l;o++)e.insertBefore(t[o],n)}function P(e,t,n,o){if(n===void 0)return e.textContent="";const l=o||document.createTextNode("");if(t.length){let s=!1;for(let i=t.length-1;i>=0;i--){const r=t[i];if(l!==r){const c=r.parentNode===e;!s&&!i?c?e.replaceChild(l,r):e.insertBefore(l,n):c&&r.remove()}else s=!0}}else e.insertBefore(l,n);return[l]}function Ge(e,t,...n){if(t===void 0)throw new Error("`Ohbug warning(condition, format, ...args)` requires a warning message argument");if(!e){let o=0;const l=t.replace(/%s/g,()=>n[o++]);throw new Error(`Ohbug ${l}`)}}var Ie={};function qe(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Ie}function Ke(){const e=qe();return Ge(Boolean(e.__OHBUG__),"Failed to get `OhbugObject`, please confirm if `Ohbug.setup`"),e.__OHBUG__}function _e(e,t){e.parentNode&&(t.push(e.parentNode),_e(e.parentNode,t))}function We(e){const t=[];return t.push(e),_e(e,t),t}var Xe=e=>{const t=e.target||e.srcElement;let n=e.target||e.srcElement;const o=[];for(let i=0;n&&n.nodeType===Node.ELEMENT_NODE&&n.nodeType!==Node.DOCUMENT_TYPE_NODE;n=n.previousSibling)i&&o.push(n),i+=1;const l=typeof e.path>"u"?We(e.target):e.path,{outerHTML:s}=t;return l.reverse().map(i=>(i.localName||"")+(i.id?`#${i.id}`:"")+(i.className?`.${i.className}`:"")+(i.outerHTML===s?`:nth-child(${o.length})`:"")).filter(i=>Boolean(i)).join(" > ")};const Ae=Symbol("store-raw"),Q=Symbol("store-node"),Ye=Symbol("store-name");function Ne(e,t){let n=e[z];if(!n){Object.defineProperty(e,z,{value:n=new Proxy(e,Ze)});const o=Object.keys(e),l=Object.getOwnPropertyDescriptors(e);for(let s=0,i=o.length;s<i;s++){const r=o[s];if(l[r].get){const c=l[r].get.bind(n);Object.defineProperty(e,r,{get:c})}}}return n}function Z(e){let t;return e!=null&&typeof e=="object"&&(e[z]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function U(e,t=new Set){let n,o,l,s;if(n=e!=null&&e[Ae])return n;if(!Z(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let i=0,r=e.length;i<r;i++)l=e[i],(o=U(l,t))!==l&&(e[i]=o)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const i=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let c=0,f=i.length;c<f;c++)s=i[c],!r[s].get&&(l=e[s],(o=U(l,t))!==l&&(e[s]=o))}return e}function fe(e){let t=e[Q];return t||Object.defineProperty(e,Q,{value:t={}}),t}function ne(e,t,n){return e[t]||(e[t]=Oe(n,!0))}function Je(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===z||t===Q||t===Ye||(delete n.value,delete n.writable,n.get=()=>e[z][t]),n}function ke(e){if($e()){const t=fe(e);(t._||(t._=Oe()))()}}function Qe(e){return ke(e),Reflect.ownKeys(e)}function Oe(e,t){const[n,o]=F(e,t?{internal:!0}:{equals:!1,internal:!0});return n.$=o,n}const Ze={get(e,t,n){if(t===Ae)return e;if(t===z)return n;if(t===He)return ke(e);const o=fe(e),l=o[t];let s=l?o[t]():e[t];if(t===Q||t==="__proto__")return s;if(!l){const i=Object.getOwnPropertyDescriptor(e,t);$e()&&(typeof s!="function"||e.hasOwnProperty(t))&&!(i&&i.get)&&(s=ne(o,t,s)())}return Z(s)?Ne(s):s},set(){return!0},deleteProperty(){return!0},ownKeys:Qe,getOwnPropertyDescriptor:Je};function ee(e,t,n){if(e[t]===n)return;const o=e[t],l=e.length;n===void 0?delete e[t]:e[t]=n;let s=fe(e),i;(i=ne(s,t,o))&&i.$(()=>n),Array.isArray(e)&&e.length!==l&&(i=ne(s,"length",l))&&i.$(e.length),(i=s._)&&i.$()}function Ce(e,t){const n=Object.keys(t);for(let o=0;o<n.length;o+=1){const l=n[o];ee(e,l,t[l])}}function et(e,t){if(typeof t=="function"&&(t=t(e)),t=U(t),Array.isArray(t)){if(e===t)return;let n=0,o=t.length;for(;n<o;n++){const l=t[n];e[n]!==l&&ee(e,n,l)}ee(e,"length",o)}else Ce(e,t)}function D(e,t,n=[]){let o,l=e;if(t.length>1){o=t.shift();const i=typeof o,r=Array.isArray(e);if(Array.isArray(o)){for(let c=0;c<o.length;c++)D(e,[o[c]].concat(t),n);return}else if(r&&i==="function"){for(let c=0;c<e.length;c++)o(e[c],c)&&D(e,[c].concat(t),n);return}else if(r&&i==="object"){const{from:c=0,to:f=e.length-1,by:a=1}=o;for(let h=c;h<=f;h+=a)D(e,[h].concat(t),n);return}else if(t.length>1){D(e[o],t,[o].concat(n));return}l=e[o],n=[o].concat(n)}let s=t[0];typeof s=="function"&&(s=s(l,n),s===l)||o===void 0&&s==null||(s=U(s),o===void 0||Z(l)&&Z(s)&&!Array.isArray(s)?Ce(l,s):ee(e,o,s))}function tt(...[e,t]){const n=U(e||{}),o=Array.isArray(n),l=Ne(n);function s(...i){ye(()=>{o&&i.length===1?et(n,i[0]):D(n,i)})}return[l,s]}const[p,L]=tt({working:!1,selectedElement:null}),nt=N('<svg data-ohbug-selector height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" data-ohbug-selector fill="none"></path><path d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z" data-ohbug-selector fill="rgba(255,255,255,1)"></path></svg>'),ot=N('<svg data-ohbug-selector height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" data-ohbug-selector fill="none"></path><path d="M3 3h2v2H3V3zm4 0h2v2H7V3zm4 0h2v2h-2V3zm4 0h2v2h-2V3zm4 0h2v2h-2V3zm0 4h2v2h-2V7zM3 19h2v2H3v-2zm0-4h2v2H3v-2zm0-4h2v2H3v-2zm0-4h2v2H3V7zm7.667 4l1.036-1.555A1 1 0 0 1 12.535 9h2.93a1 1 0 0 1 .832.445L17.333 11H20a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1h2.667zM9 19h10v-6h-2.737l-1.333-2h-1.86l-1.333 2H9v6zm5-1a2 2 0 1 1 0-4 2 2 0 0 1 0 4z" data-ohbug-selector></path></svg>'),oe=()=>nt.cloneNode(!0),lt=()=>(()=>{const e=ot.cloneNode(!0);return e.firstChild.nextSibling.style.setProperty("fill","var(--color)"),e})();const st=N('<div class="bg-none border-solid border-4 border-blue-500 transition top-0 right-0 bottom-0 left-0 z-10 fixed pointer-events-none" data-ohbug-selector><div class="tips" data-ohbug-selector>Select element on the page<button class="stop-btn" type="button"></button></div></div>'),it=N('<button class="rounded-full cursor-pointer flex bg-red-500 h-6 -top-3 -right-3 w-6 z-10 items-center justify-center absolute pointer-events-auto" data-ohbug-selector type="button"></button>'),rt=N('<button class="border-solid cursor-pointer font-semibold bg-red-500 border-4 border-red-500 -bottom-full text-white right-0 absolute pointer-events-auto" data-ohbug-selector type="button">Change</button>'),ct=N('<div class="-z-1 fixed" data-ohbug-selector><div class="bg-black bg-opacity-40 transition -z-1 fixed pointer-events-none" data-ohbug-selector></div><div class="bg-black bg-opacity-40 transition -z-1 fixed pointer-events-none" data-ohbug-selector></div><div class="bg-black bg-opacity-40 transition -z-1 fixed pointer-events-none" data-ohbug-selector></div><div class="bg-black bg-opacity-40 transition -z-1 fixed pointer-events-none" data-ohbug-selector></div><div data-ohbug-selector></div></div>'),ut=()=>{const[e,t]=F();let n,o,l,s,i;const r=2;function c(u){if(!u||u.tagName==="HTML")return;const{width:g,height:w,top:A,right:T,bottom:M,left:d}=u.getBoundingClientRect();i==null||i.setAttribute("style",`
2
- width: ${g+r*2}px;
3
- height: ${w+r*2}px;
4
- top: ${A-r}px;
5
- left: ${d-r}px;
1
+ "use strict";const _={};function Te(e){_.context=e}const Pe=(e,t)=>e===t,T=Symbol("solid-proxy"),fe=Symbol("solid-track"),K={equals:Pe};let ge=ve;const N=1,W=2,be={owned:null,cleanups:null,context:null,owner:null};var y=null;let C=null,b=null,$=null,A=null,ie=0;function Le(e,t){const n=b,o=y,s=e.length===0,l=s?be:{owned:null,cleanups:null,context:null,owner:t||o},r=s?e:()=>e(()=>te(()=>ce(l)));y=l,b=null;try{return M(r,!0)}finally{b=n,y=o}}function F(e,t){t=t?Object.assign({},K,t):K;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},o=s=>(typeof s=="function"&&(s=s(n.value)),$e(n,s));return[ye.bind(n),o]}function j(e,t,n){const o=re(e,t,!1,N);G(o)}function pe(e,t,n){ge=De;const o=re(e,t,!1,N);o.user=!0,A?A.push(o):G(o)}function ae(e,t,n){n=n?Object.assign({},K,n):K;const o=re(e,t,!0,0);return o.observers=null,o.observerSlots=null,o.comparator=n.equals||void 0,G(o),ye.bind(o)}function ze(e){return M(e,!1)}function te(e){let t,n=b;return b=null,t=e(),b=n,t}function He(e){return y===null||(y.cleanups===null?y.cleanups=[e]:y.cleanups.push(e)),e}function we(){return b}function ye(){const e=C;if(this.sources&&(this.state||e))if(this.state===N||e)G(this);else{const t=$;$=null,M(()=>Y(this),!1),$=t}if(b){const t=this.observers?this.observers.length:0;b.sources?(b.sources.push(this),b.sourceSlots.push(t)):(b.sources=[this],b.sourceSlots=[t]),this.observers?(this.observers.push(b),this.observerSlots.push(b.sources.length-1)):(this.observers=[b],this.observerSlots=[b.sources.length-1])}return this.value}function $e(e,t,n){let o=e.value;return(!e.comparator||!e.comparator(o,t))&&(e.value=t,e.observers&&e.observers.length&&M(()=>{for(let s=0;s<e.observers.length;s+=1){const l=e.observers[s],r=C&&C.running;r&&C.disposed.has(l),(r&&!l.tState||!r&&!l.state)&&(l.pure?$.push(l):A.push(l),l.observers&&me(l)),r||(l.state=N)}if($.length>1e6)throw $=[],new Error},!1)),t}function G(e){if(!e.fn)return;ce(e);const t=y,n=b,o=ie;b=y=e,je(e,e.value,o),b=n,y=t}function je(e,t,n){let o;try{o=e.fn(t)}catch(s){e.pure&&(e.state=N),xe(s)}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?$e(e,o):e.value=o,e.updatedAt=n)}function re(e,t,n,o=N,s){const l={fn:e,state:o,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:y,context:null,pure:n};return y===null||y!==be&&(y.owned?y.owned.push(l):y.owned=[l]),l}function X(e){const t=C;if(e.state===0||t)return;if(e.state===W||t)return Y(e);if(e.suspense&&te(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<ie);)(e.state||t)&&n.push(e);for(let o=n.length-1;o>=0;o--)if(e=n[o],e.state===N||t)G(e);else if(e.state===W||t){const s=$;$=null,M(()=>Y(e,n[0]),!1),$=s}}function M(e,t){if($)return e();let n=!1;t||($=[]),A?n=!0:A=[],ie++;try{const o=e();return Me(n),o}catch(o){$||(A=null),xe(o)}}function Me(e){if($&&(ve($),$=null),e)return;const t=A;A=null,t.length&&M(()=>ge(t),!1)}function ve(e){for(let t=0;t<e.length;t++)X(e[t])}function De(e){let t,n=0;for(t=0;t<e.length;t++){const o=e[t];o.user?e[n++]=o:X(o)}for(_.context&&Te(),t=0;t<n;t++)X(e[t])}function Y(e,t){const n=C;e.state=0;for(let o=0;o<e.sources.length;o+=1){const s=e.sources[o];s.sources&&(s.state===N||n?s!==t&&X(s):(s.state===W||n)&&Y(s,t))}}function me(e){const t=C;for(let n=0;n<e.observers.length;n+=1){const o=e.observers[n];(!o.state||t)&&(o.state=W,o.pure?$.push(o):A.push(o),o.observers&&me(o))}}function ce(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),o=e.sourceSlots.pop(),s=n.observers;if(s&&s.length){const l=s.pop(),r=n.observerSlots.pop();o<s.length&&(l.sourceSlots[r]=o,s[o]=l,n.observerSlots[o]=r)}}if(e.owned){for(t=0;t<e.owned.length;t++)ce(e.owned[t]);e.owned=null}if(e.cleanups){for(t=0;t<e.cleanups.length;t++)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function Be(e){return e instanceof Error||typeof e=="string"?e:new Error("Unknown error")}function xe(e){throw e=Be(e),e}function x(e,t){return te(()=>e(t||{}))}function R(e){let t=!1;const n=e.keyed,o=ae(()=>e.when,void 0,{equals:(s,l)=>t?s===l:!s==!l});return ae(()=>{const s=o();if(s){const l=e.children,r=typeof l=="function"&&l.length>0;return t=n||r,r?te(()=>l(s)):l}return e.fallback})}function Fe(e,t,n){let o=n.length,s=t.length,l=o,r=0,i=0,c=t[s-1].nextSibling,f=null;for(;r<s||i<l;){if(t[r]===n[i]){r++,i++;continue}for(;t[s-1]===n[l-1];)s--,l--;if(s===r){const a=l<o?i?n[i-1].nextSibling:n[l-i]:c;for(;i<l;)e.insertBefore(n[i++],a)}else if(l===i)for(;r<s;)(!f||!f.has(t[r]))&&t[r].remove(),r++;else if(t[r]===n[l-1]&&n[i]===t[s-1]){const a=t[--s].nextSibling;e.insertBefore(n[i++],t[r++].nextSibling),e.insertBefore(n[--l],a),t[s]=n[l]}else{if(!f){f=new Map;let h=i;for(;h<l;)f.set(n[h],h++)}const a=f.get(t[r]);if(a!=null)if(i<a&&a<l){let h=r,v=1,E;for(;++h<s&&h<l&&!((E=f.get(t[h]))==null||E!==a+v);)v++;if(v>a-i){const P=t[r];for(;i<a;)e.insertBefore(n[i++],P)}else e.replaceChild(n[i++],t[r++])}else r++;else t[r++].remove()}}}const de="_$DX_DELEGATE";function Re(e,t,n){let o;return Le(s=>{o=s,t===document?e():m(t,e(),t.firstChild?null:void 0,n)}),()=>{o(),t.textContent=""}}function k(e,t,n){const o=document.createElement("template");o.innerHTML=e;let s=o.content.firstChild;return n&&(s=s.firstChild),s}function _e(e,t=window.document){const n=t[de]||(t[de]=new Set);for(let o=0,s=e.length;o<s;o++){const l=e[o];n.has(l)||(n.add(l),t.addEventListener(l,Ue))}}function m(e,t,n,o){if(n!==void 0&&!o&&(o=[]),typeof t!="function")return J(e,t,o,n);j(s=>J(e,t(),s,n),o)}function Ue(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),_.registry&&!_.done&&(_.done=!0,document.querySelectorAll("[id^=pl-]").forEach(o=>o.remove()));n!==null;){const o=n[t];if(o&&!n.disabled){const s=n[`${t}Data`];if(s!==void 0?o.call(n,s,e):o.call(n,e),e.cancelBubble)return}n=n.host&&n.host!==n&&n.host instanceof Node?n.host:n.parentNode}}function J(e,t,n,o,s){for(_.context&&!n&&(n=[...e.childNodes]);typeof n=="function";)n=n();if(t===n)return n;const l=typeof t,r=o!==void 0;if(e=r&&n[0]&&n[0].parentNode||e,l==="string"||l==="number"){if(_.context)return n;if(l==="number"&&(t=t.toString()),r){let i=n[0];i&&i.nodeType===3?i.data=t:i=document.createTextNode(t),n=z(e,n,o,i)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||l==="boolean"){if(_.context)return n;n=z(e,n,o)}else{if(l==="function")return j(()=>{let i=t();for(;typeof i=="function";)i=i();n=J(e,i,n,o)}),()=>n;if(Array.isArray(t)){const i=[],c=n&&Array.isArray(n);if(ne(i,t,n,s))return j(()=>n=J(e,i,n,o,!0)),()=>n;if(_.context){if(!i.length)return n;for(let f=0;f<i.length;f++)if(i[f].parentNode)return n=i}if(i.length===0){if(n=z(e,n,o),r)return n}else c?n.length===0?he(e,i,o):Fe(e,n,i):(n&&z(e),he(e,i));n=i}else if(t instanceof Node){if(_.context&&t.parentNode)return n=r?[t]:t;if(Array.isArray(n)){if(r)return n=z(e,n,o,t);z(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function ne(e,t,n,o){let s=!1;for(let l=0,r=t.length;l<r;l++){let i=t[l],c=n&&n[l];if(i instanceof Node)e.push(i);else if(!(i==null||i===!0||i===!1))if(Array.isArray(i))s=ne(e,i,c)||s;else if(typeof i=="function")if(o){for(;typeof i=="function";)i=i();s=ne(e,Array.isArray(i)?i:[i],Array.isArray(c)?c:[c])||s}else e.push(i),s=!0;else{const f=String(i);c&&c.nodeType===3&&c.data===f?e.push(c):e.push(document.createTextNode(f))}}return s}function he(e,t,n){for(let o=0,s=t.length;o<s;o++)e.insertBefore(t[o],n)}function z(e,t,n,o){if(n===void 0)return e.textContent="";const s=o||document.createTextNode("");if(t.length){let l=!1;for(let r=t.length-1;r>=0;r--){const i=t[r];if(s!==i){const c=i.parentNode===e;!l&&!r?c?e.replaceChild(s,i):e.insertBefore(s,n):c&&i.remove()}else l=!0}}else e.insertBefore(s,n);return[s]}function Ve(e,t,...n){if(t===void 0)throw new Error("`Ohbug warning(condition, format, ...args)` requires a warning message argument");if(!e){let o=0;const s=t.replace(/%s/g,()=>n[o++]);throw new Error(`Ohbug ${s}`)}}var Ge={};function qe(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Ge}function Ie(){const e=qe();return Ve(Boolean(e.__OHBUG__),"Failed to get `OhbugObject`, please confirm if `Ohbug.setup`"),e.__OHBUG__}function Ee(e,t){e.parentNode&&(t.push(e.parentNode),Ee(e.parentNode,t))}function Ke(e){const t=[];return t.push(e),Ee(e,t),t}var We=e=>{const t=e.target||e.srcElement;let n=e.target||e.srcElement;const o=[];for(let r=0;n&&n.nodeType===Node.ELEMENT_NODE&&n.nodeType!==Node.DOCUMENT_TYPE_NODE;n=n.previousSibling)r&&o.push(n),r+=1;const s=typeof e.path>"u"?Ke(e.target):e.path,{outerHTML:l}=t;return s.reverse().map(r=>(r.localName||"")+(r.id?`#${r.id}`:"")+(r.className?`.${r.className}`:"")+(r.outerHTML===l?`:nth-child(${o.length})`:"")).filter(r=>Boolean(r)).join(" > ")};const oe=Symbol("store-raw"),U=Symbol("store-node"),Xe=Symbol("store-name");function Se(e,t){let n=e[T];if(!n&&(Object.defineProperty(e,T,{value:n=new Proxy(e,Qe)}),!Array.isArray(e))){const o=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let l=0,r=o.length;l<r;l++){const i=o[l];if(s[i].get){const c=s[i].get.bind(n);Object.defineProperty(e,i,{get:c})}}}return n}function Q(e){let t;return e!=null&&typeof e=="object"&&(e[T]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function V(e,t=new Set){let n,o,s,l;if(n=e!=null&&e[oe])return n;if(!Q(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let r=0,i=e.length;r<i;r++)s=e[r],(o=V(s,t))!==s&&(e[r]=o)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const r=Object.keys(e),i=Object.getOwnPropertyDescriptors(e);for(let c=0,f=r.length;c<f;c++)l=r[c],!i[l].get&&(s=e[l],(o=V(s,t))!==s&&(e[l]=o))}return e}function Z(e){let t=e[U];return t||Object.defineProperty(e,U,{value:t={}}),t}function se(e,t,n){return e[t]||(e[t]=ke(n))}function Ye(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===T||t===U||t===Xe||(delete n.value,delete n.writable,n.get=()=>e[T][t]),n}function Ae(e){if(we()){const t=Z(e);(t._||(t._=ke()))()}}function Je(e){return Ae(e),Reflect.ownKeys(e)}function ke(e){const[t,n]=F(e,{equals:!1,internal:!0});return t.$=n,t}const Qe={get(e,t,n){if(t===oe)return e;if(t===T)return n;if(t===fe)return Ae(e),n;const o=Z(e),s=o.hasOwnProperty(t);let l=s?o[t]():e[t];if(t===U||t==="__proto__")return l;if(!s){const r=Object.getOwnPropertyDescriptor(e,t);we()&&(typeof l!="function"||e.hasOwnProperty(t))&&!(r&&r.get)&&(l=se(o,t,l)())}return Q(l)?Se(l):l},has(e,t){if(t===oe||t===T||t===fe||t===U||t==="__proto__")return!0;const n=Z(e)[t];return n&&n(),t in e},set(){return!0},deleteProperty(){return!0},ownKeys:Je,getOwnPropertyDescriptor:Ye};function ee(e,t,n,o=!1){if(!o&&e[t]===n)return;const s=e[t],l=e.length;n===void 0?delete e[t]:e[t]=n;let r=Z(e),i;(i=se(r,t,s))&&i.$(()=>n),Array.isArray(e)&&e.length!==l&&(i=se(r,"length",l))&&i.$(e.length),(i=r._)&&i.$()}function Ne(e,t){const n=Object.keys(t);for(let o=0;o<n.length;o+=1){const s=n[o];ee(e,s,t[s])}}function Ze(e,t){if(typeof t=="function"&&(t=t(e)),t=V(t),Array.isArray(t)){if(e===t)return;let n=0,o=t.length;for(;n<o;n++){const s=t[n];e[n]!==s&&ee(e,n,s)}ee(e,"length",o)}else Ne(e,t)}function B(e,t,n=[]){let o,s=e;if(t.length>1){o=t.shift();const r=typeof o,i=Array.isArray(e);if(Array.isArray(o)){for(let c=0;c<o.length;c++)B(e,[o[c]].concat(t),n);return}else if(i&&r==="function"){for(let c=0;c<e.length;c++)o(e[c],c)&&B(e,[c].concat(t),n);return}else if(i&&r==="object"){const{from:c=0,to:f=e.length-1,by:a=1}=o;for(let h=c;h<=f;h+=a)B(e,[h].concat(t),n);return}else if(t.length>1){B(e[o],t,[o].concat(n));return}s=e[o],n=[o].concat(n)}let l=t[0];typeof l=="function"&&(l=l(s,n),l===s)||o===void 0&&l==null||(l=V(l),o===void 0||Q(s)&&Q(l)&&!Array.isArray(l)?Ne(s,l):ee(e,o,l))}function et(...[e,t]){const n=V(e||{}),o=Array.isArray(n),s=Se(n);function l(...r){ze(()=>{o&&r.length===1?Ze(n,r[0]):B(n,r)})}return[s,l]}const[p,H]=et({working:!1,selectedElement:null}),tt=k('<svg data-ohbug-selector height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" data-ohbug-selector fill="none"></path><path d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z" data-ohbug-selector fill="rgba(255,255,255,1)"></path></svg>'),nt=k('<svg data-ohbug-selector height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" data-ohbug-selector fill="none"></path><path d="M3 3h2v2H3V3zm4 0h2v2H7V3zm4 0h2v2h-2V3zm4 0h2v2h-2V3zm4 0h2v2h-2V3zm0 4h2v2h-2V7zM3 19h2v2H3v-2zm0-4h2v2H3v-2zm0-4h2v2H3v-2zm0-4h2v2H3V7zm7.667 4l1.036-1.555A1 1 0 0 1 12.535 9h2.93a1 1 0 0 1 .832.445L17.333 11H20a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1h2.667zM9 19h10v-6h-2.737l-1.333-2h-1.86l-1.333 2H9v6zm5-1a2 2 0 1 1 0-4 2 2 0 0 1 0 4z" data-ohbug-selector></path></svg>'),le=()=>tt.cloneNode(!0),ot=()=>(()=>{const e=nt.cloneNode(!0);return e.firstChild.nextSibling.style.setProperty("fill","var(--color)"),e})();const st=k('<div class="bg-none border-solid border-4 border-blue-500 transition top-0 right-0 bottom-0 left-0 z-10 fixed pointer-events-none" data-ohbug-selector><div class="tips" data-ohbug-selector>Select element on the page<button class="stop-btn" type="button"></button></div></div>'),lt=k('<button class="rounded-full cursor-pointer flex bg-red-500 h-6 -top-3 -right-3 w-6 z-10 items-center justify-center absolute pointer-events-auto" data-ohbug-selector type="button"></button>'),it=k('<button class="border-solid cursor-pointer font-semibold bg-red-500 border-4 border-red-500 -bottom-full text-white right-0 absolute pointer-events-auto" data-ohbug-selector type="button">Change</button>'),rt=k('<div class="-z-1 fixed" data-ohbug-selector><div class="bg-black bg-opacity-40 transition -z-1 fixed pointer-events-none" data-ohbug-selector></div><div class="bg-black bg-opacity-40 transition -z-1 fixed pointer-events-none" data-ohbug-selector></div><div class="bg-black bg-opacity-40 transition -z-1 fixed pointer-events-none" data-ohbug-selector></div><div class="bg-black bg-opacity-40 transition -z-1 fixed pointer-events-none" data-ohbug-selector></div><div data-ohbug-selector></div></div>'),ct=()=>{const[e,t]=F();let n,o,s,l,r;const i=2;function c(u){if(!u||u.tagName==="HTML")return;const{width:g,height:w,top:S,right:L,bottom:D,left:d}=u.getBoundingClientRect();r==null||r.setAttribute("style",`
2
+ width: ${g+i*2}px;
3
+ height: ${w+i*2}px;
4
+ top: ${S-i}px;
5
+ left: ${d-i}px;
6
6
  `),n==null||n.setAttribute("style",`
7
- height: ${A}px;
7
+ height: ${S}px;
8
8
  top: 0;
9
9
  right: 0;
10
10
  left: 0;
11
11
  `),o==null||o.setAttribute("style",`
12
- top: ${A}px;
12
+ top: ${S}px;
13
13
  right: 0;
14
14
  bottom: 0;
15
- left: ${T}px;
16
- `),l==null||l.setAttribute("style",`
15
+ left: ${L}px;
16
+ `),s==null||s.setAttribute("style",`
17
17
  width: ${g+d}px;
18
- top: ${M}px;
18
+ top: ${D}px;
19
19
  bottom: 0;
20
20
  left: 0;
21
- `),s==null||s.setAttribute("style",`
21
+ `),l==null||l.setAttribute("style",`
22
22
  width: ${d}px;
23
23
  height: ${w}px;
24
- top: ${A}px;
24
+ top: ${S}px;
25
25
  left: 0;
26
- `)}function f(u){if(!u||u.tagName==="HTML")return;const{width:g,height:w,top:A,left:T}=u.getBoundingClientRect();L({selectedElement:u}),i==null||i.setAttribute("style",`
27
- width: ${g+r*2}px;
28
- height: ${w+r*2}px;
29
- top: ${A-r}px;
30
- left: ${T-r}px;
31
- `)}function a(u){var w;L({working:!0});const g=document.elementFromPoint(u.clientX,u.clientY);if(((w=g==null?void 0:g.dataset)==null?void 0:w.ohbugSelector)!==void 0||g.tagName==="HTML")return!1;c(g)}function h(){document.addEventListener("mousemove",a)}function v(){document.removeEventListener("mousemove",a)}function _(u){var w;const g=document.elementFromPoint(u.clientX,u.clientY);if(((w=g==null?void 0:g.dataset)==null?void 0:w.ohbugSelector)!==void 0||g.tagName==="HTML"||p.selectedElement&&p.working)return!1;t(g),f(e()),v()}function C(){document.addEventListener("mousedown",_)}function q(){document.removeEventListener("mousedown",_)}function k(){t(null),v(),q(),L({working:!1,selectedElement:null})}function K(){L({working:!0,selectedElement:null}),t(null),h()}return we(()=>{p.working?(h(),C()):(v(),q())}),Me(k),(()=>{const u=ct.cloneNode(!0),g=u.firstChild,w=g.nextSibling,A=w.nextSibling,T=A.nextSibling,M=T.nextSibling;return m(u,x(V,{get when(){return!p.selectedElement&&p.working},get children(){const d=st.cloneNode(!0),Te=d.firstChild,Pe=Te.firstChild,ae=Pe.nextSibling;return ae.$$click=k,m(ae,x(oe,{})),d}}),g),(d=>{n=d})(g),(d=>{o=d})(w),(d=>{l=d})(A),(d=>{s=d})(T),(d=>{i=d})(M),m(M,x(V,{get when(){return p.selectedElement&&p.working},get children(){return[(()=>{const d=it.cloneNode(!0);return d.$$click=k,m(d,x(oe,{})),d})(),(()=>{const d=rt.cloneNode(!0);return d.$$click=K,d.style.setProperty("transform","translate(4px, -8px)"),d})()]}})),j(()=>M.className=`fixed -z-1 bg-black bg-opacity-20 border-4 rounded-sm transition cursor-pointer box-border pointer-events-none ${e()?"border-red-500 border-solid":"border-blue-500 border-dashed"}`),u})()};Se(["click"]);const ft=N('<button class="main-btn" data-ohbug-selector type="button"></button>'),at=N('<div class="bg-white flex flex-col h-60 shadow z-max right-8 bottom-20 w-80 fixed" data-ohbug-selector><div class="bg-gray-300 p-4" data-ohbug-selector><textarea autofocus class="bg-transparent outline-none w-full resize-none" data-ohbug-selector maxlength="1000" placeholder="Tell me how you feel..." rows="4"></textarea><button class="cursor-pointer" data-ohbug-selector type="button"></button></div><div class="flex flex-1 p-4 justify-between items-center" data-ohbug-selector><span class="text-sm" data-ohbug-selector>Try<a class="ml-1 underline" data-ohbug-selector href="https://ohbug.net" rel="noreferrer" target="_blank">Ohbug</a>?</span><button class="send-btn" data-ohbug-selector type="button"></button></div><button class="rounded-full cursor-pointer flex bg-blue-500 h-6 -top-2 -right-2 w-6 z-10 items-center justify-center absolute" data-ohbug-selector type="button"></button></div>'),dt=N('<div class="z-max relative" data-ohbug-selector><div></div></div>'),ht=()=>{const[e,t]=F(!1),[n,o]=F("");function l(){L({working:!0})}const[s,i]=F(!1);async function r(){i(!0);let c,f;const a=Ke().client;if(p.selectedElement){const h={target:p.selectedElement};c=Xe(h),f=p.selectedElement.outerHTML;const v=a.createEvent({category:"feedback",type:"feedback",detail:{selector:c,outerHTML:f,feedback:n()}});await a.notify(v)}else{const h=a.createEvent({category:"feedback",type:"feedback",detail:{feedback:n()}});await a.notify(h)}t(!1),o(""),L({working:!1,selectedElement:null}),i(!1)}return we(()=>{p.working===!1&&p.selectedElement===null||p.working&&!p.selectedElement?t(!1):t(!0)}),(()=>{const c=dt.cloneNode(!0),f=c.firstChild;return m(c,x(V,{get when(){return p.working},get children(){return x(ut,{})}}),f),m(f,x(V,{get when(){return!(p.working&&!p.selectedElement)},get children(){const a=ft.cloneNode(!0);return a.$$click=()=>t(h=>!h),m(a,()=>e()?"\u{1F606}":"\u{1F642}"),a}}),null),m(f,x(V,{get when(){return e()},get children(){const a=at.cloneNode(!0),h=a.firstChild,v=h.firstChild,_=v.nextSibling,C=h.nextSibling,q=C.firstChild,k=q.nextSibling,K=C.nextSibling;return v.$$input=u=>o(u.currentTarget.value),_.$$click=l,m(_,x(lt,{})),k.$$click=r,m(k,()=>s()?"Sending...":"Send"),K.$$click=()=>t(u=>!u),m(K,x(oe,{})),j(u=>{const g=p.selectedElement?"blue":"gray",w=!n()||s();return g!==u._v$&&_.style.setProperty("--color",u._v$=g),w!==u._v$2&&(k.disabled=u._v$2=w),u},{_v$:void 0,_v$2:void 0}),j(()=>v.value=n()),a}}),null),c})()};Se(["click","input"]);const gt={name:"OhbugExtensionFeedback",onSetup:()=>{const e=document.createElement("div");e.id="OhbugExtensionFeedback-ROOT",document.body.appendChild(e),Ve(()=>x(ht,{}),e)}};function styleInject(css,ref){if(ref===void 0){ref={}}var insertAt=ref.insertAt;if(!css||typeof document==="undefined"){return}var head=document.head||document.getElementsByTagName("head")[0];var style=document.createElement("style");style.type="text/css";if(insertAt==="top"){if(head.firstChild){head.insertBefore(style,head.firstChild)}else{head.appendChild(style)}}else{head.appendChild(style)}if(style.styleSheet){style.styleSheet.cssText=css}else{style.appendChild(document.createTextNode(css))}};styleInject(`.main-btn {
26
+ `)}function f(u){if(!u||u.tagName==="HTML")return;const{width:g,height:w,top:S,left:L}=u.getBoundingClientRect();H({selectedElement:u}),r==null||r.setAttribute("style",`
27
+ width: ${g+i*2}px;
28
+ height: ${w+i*2}px;
29
+ top: ${S-i}px;
30
+ left: ${L-i}px;
31
+ `)}function a(u){var w;H({working:!0});const g=document.elementFromPoint(u.clientX,u.clientY);if(((w=g==null?void 0:g.dataset)==null?void 0:w.ohbugSelector)!==void 0||g.tagName==="HTML")return!1;c(g)}function h(){document.addEventListener("mousemove",a)}function v(){document.removeEventListener("mousemove",a)}function E(u){var w;const g=document.elementFromPoint(u.clientX,u.clientY);if(((w=g==null?void 0:g.dataset)==null?void 0:w.ohbugSelector)!==void 0||g.tagName==="HTML"||p.selectedElement&&p.working)return!1;t(g),f(e()),v()}function P(){document.addEventListener("mousedown",E)}function q(){document.removeEventListener("mousedown",E)}function O(){t(null),v(),q(),H({working:!1,selectedElement:null})}function I(){H({working:!0,selectedElement:null}),t(null),h()}return pe(()=>{p.working?(h(),P()):(v(),q())}),He(O),(()=>{const u=rt.cloneNode(!0),g=u.firstChild,w=g.nextSibling,S=w.nextSibling,L=S.nextSibling,D=L.nextSibling;return m(u,x(R,{get when(){return!p.selectedElement&&p.working},get children(){const d=st.cloneNode(!0),Oe=d.firstChild,Ce=Oe.firstChild,ue=Ce.nextSibling;return ue.$$click=O,m(ue,x(le,{})),d}}),g),(d=>{n=d})(g),(d=>{o=d})(w),(d=>{s=d})(S),(d=>{l=d})(L),(d=>{r=d})(D),m(D,x(R,{get when(){return p.selectedElement&&p.working},get children(){return[(()=>{const d=lt.cloneNode(!0);return d.$$click=O,m(d,x(le,{})),d})(),(()=>{const d=it.cloneNode(!0);return d.$$click=I,d.style.setProperty("transform","translate(4px, -8px)"),d})()]}})),j(()=>D.className=`fixed -z-1 bg-black bg-opacity-20 border-4 rounded-sm transition cursor-pointer box-border pointer-events-none ${e()?"border-red-500 border-solid":"border-blue-500 border-dashed"}`),u})()};_e(["click"]);const ut=k('<button class="main-btn" data-ohbug-selector type="button"></button>'),ft=k('<div class="bg-white flex flex-col h-60 shadow z-max right-8 bottom-20 w-80 fixed" data-ohbug-selector><div class="bg-gray-300 p-4" data-ohbug-selector><textarea autofocus class="bg-transparent outline-none w-full resize-none" data-ohbug-selector maxlength="1000" placeholder="Tell me how you feel..." rows="4"></textarea><button class="cursor-pointer" data-ohbug-selector type="button"></button></div><div class="flex flex-1 p-4 justify-between items-center" data-ohbug-selector><span class="text-sm" data-ohbug-selector>Try<a class="ml-1 underline" data-ohbug-selector href="https://ohbug.net" rel="noreferrer" target="_blank">Ohbug</a>?</span><button class="send-btn" data-ohbug-selector type="button"></button></div><button class="rounded-full cursor-pointer flex bg-blue-500 h-6 -top-2 -right-2 w-6 z-10 items-center justify-center absolute" data-ohbug-selector type="button"></button></div>'),at=k('<div class="z-max relative" data-ohbug-selector><div></div></div>'),dt=()=>{const[e,t]=F(!1),[n,o]=F("");function s(){H({working:!0})}const[l,r]=F(!1);async function i(){r(!0);let c,f;const a=Ie().client;if(p.selectedElement){const h={target:p.selectedElement};c=We(h),f=p.selectedElement.outerHTML;const v=a.createEvent({category:"feedback",type:"feedback",detail:{selector:c,outerHTML:f,feedback:n()}});await a.notify(v)}else{const h=a.createEvent({category:"feedback",type:"feedback",detail:{feedback:n()}});await a.notify(h)}t(!1),o(""),H({working:!1,selectedElement:null}),r(!1)}return pe(()=>{p.working===!1&&p.selectedElement===null||p.working&&!p.selectedElement?t(!1):t(!0)}),(()=>{const c=at.cloneNode(!0),f=c.firstChild;return m(c,x(R,{get when(){return p.working},get children(){return x(ct,{})}}),f),m(f,x(R,{get when(){return!(p.working&&!p.selectedElement)},get children(){const a=ut.cloneNode(!0);return a.$$click=()=>t(h=>!h),m(a,()=>e()?"\u{1F606}":"\u{1F642}"),a}}),null),m(f,x(R,{get when(){return e()},get children(){const a=ft.cloneNode(!0),h=a.firstChild,v=h.firstChild,E=v.nextSibling,P=h.nextSibling,q=P.firstChild,O=q.nextSibling,I=P.nextSibling;return v.$$input=u=>o(u.currentTarget.value),E.$$click=s,m(E,x(ot,{})),O.$$click=i,m(O,()=>l()?"Sending...":"Send"),I.$$click=()=>t(u=>!u),m(I,x(le,{})),j(u=>{const g=p.selectedElement?"blue":"gray",w=!n()||l();return g!==u._v$&&E.style.setProperty("--color",u._v$=g),w!==u._v$2&&(O.disabled=u._v$2=w),u},{_v$:void 0,_v$2:void 0}),j(()=>v.value=n()),a}}),null),c})()};_e(["click","input"]);const ht={name:"OhbugExtensionFeedback",onSetup:()=>{const e=document.createElement("div");e.id="OhbugExtensionFeedback-ROOT",document.body.appendChild(e),Re(()=>x(dt,{}),e)}};function styleInject(css,ref){if(ref===void 0){ref={}}var insertAt=ref.insertAt;if(!css||typeof document==="undefined"){return}var head=document.head||document.getElementsByTagName("head")[0];var style=document.createElement("style");style.type="text/css";if(insertAt==="top"){if(head.firstChild){head.insertBefore(style,head.firstChild)}else{head.appendChild(style)}}else{head.appendChild(style)}if(style.styleSheet){style.styleSheet.cssText=css}else{style.appendChild(document.createTextNode(css))}};styleInject(`.main-btn {
32
32
  --tw-bg-opacity: 1;
33
33
  background-color: rgba(59, 130, 246, var(--tw-bg-opacity));
34
34
  border-radius: 0.25rem;
@@ -495,4 +495,4 @@ textarea::-ms-input-placeholder {
495
495
  -webkit-transition-duration: 150ms;
496
496
  -o-transition-duration: 150ms;
497
497
  transition-duration: 150ms;
498
- }`);module.exports=gt;
498
+ }`);module.exports=ht;