@givefreely/adunit 1.17.4-dev.0 → 1.17.5-dev.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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e={equals:(e,t)=>e===t};let t=S;const n=1,r=2,o={owned:null,cleanups:null,context:null,owner:null};var i=null;let s=null,a=null,l=null,c=null,g=0;function u(t,n){const r={value:t,observers:null,observerSlots:null,comparator:(n=n?Object.assign({},e,n):e).equals||void 0};return[b.bind(r),e=>("function"==typeof e&&(e=e(r.value)),y(r,e))]}function d(e,t,r){w(C(e,t,!1,n))}function p(e,r,o){t=T;const i=C(e,r,!1,n);i.user=!0,c?c.push(i):w(i)}function m(t,n,r){r=r?Object.assign({},e,r):e;const o=C(t,n,!0,0);return o.observers=null,o.observerSlots=null,o.comparator=r.equals||void 0,w(o),b.bind(o)}function h(e){if(null===a)return e();const t=a;a=null;try{return e()}finally{a=t}}function f(e){p((()=>h(e)))}function A(e){return null===i||(null===i.cleanups?i.cleanups=[e]:i.cleanups.push(e)),e}function v(e){let t;return i&&i.context&&void 0!==(t=i.context[e.id])?t:e.defaultValue}function x(e){const t=m(e),n=m((()=>M(t())));return n.toArray=()=>{const e=n();return Array.isArray(e)?e:null!=e?[e]:[]},n}function b(){if(this.sources&&this.state)if(this.state===n)w(this);else{const e=l;l=null,P((()=>E(this)),!1),l=e}if(a){const e=this.observers?this.observers.length:0;a.sources?(a.sources.push(this),a.sourceSlots.push(e)):(a.sources=[this],a.sourceSlots=[e]),this.observers?(this.observers.push(a),this.observerSlots.push(a.sources.length-1)):(this.observers=[a],this.observerSlots=[a.sources.length-1])}return this.value}function y(e,t,r){let o=e.value;return e.comparator&&e.comparator(o,t)||(e.value=t,e.observers&&e.observers.length&&P((()=>{for(let t=0;t<e.observers.length;t+=1){const r=e.observers[t],o=s&&s.running;o&&s.disposed.has(r),(o?r.tState:r.state)||(r.pure?l.push(r):c.push(r),r.observers&&L(r)),o||(r.state=n)}if(l.length>1e6)throw l=[],new Error}),!1)),t}function w(e){if(!e.fn)return;D(e);const t=g;!function(e,t,r){let o;const s=i,l=a;a=i=e;try{o=e.fn(t)}catch(t){return e.pure&&(e.state=n,e.owned&&e.owned.forEach(D),e.owned=null),e.updatedAt=r+1,I(t)}finally{a=l,i=s}(!e.updatedAt||e.updatedAt<=r)&&(null!=e.updatedAt&&"observers"in e?y(e,o):e.value=o,e.updatedAt=r)}(e,e.value,t)}function C(e,t,r,s=n,a){const l={fn:e,state:s,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:i,context:i?i.context:null,pure:r};return null===i||i!==o&&(i.owned?i.owned.push(l):i.owned=[l]),l}function k(e){if(0===e.state)return;if(e.state===r)return E(e);if(e.suspense&&h(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<g);)e.state&&t.push(e);for(let o=t.length-1;o>=0;o--)if((e=t[o]).state===n)w(e);else if(e.state===r){const n=l;l=null,P((()=>E(e,t[0])),!1),l=n}}function P(e,n){if(l)return e();let r=!1;n||(l=[]),c?r=!0:c=[],g++;try{const n=e();return function(e){if(l&&(S(l),l=null),e)return;const n=c;c=null,n.length&&P((()=>t(n)),!1)}(r),n}catch(e){r||(c=null),l=null,I(e)}}function S(e){for(let t=0;t<e.length;t++)k(e[t])}function T(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:k(r)}for(t=0;t<n;t++)k(e[t])}function E(e,t){e.state=0;for(let o=0;o<e.sources.length;o+=1){const i=e.sources[o];if(i.sources){const e=i.state;e===n?i!==t&&(!i.updatedAt||i.updatedAt<g)&&k(i):e===r&&E(i,t)}}}function L(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=r,n.pure?l.push(n):c.push(n),n.observers&&L(n))}}function D(e){let t;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){const e=r.pop(),o=t.observerSlots.pop();n<r.length&&(e.sourceSlots[o]=n,r[n]=e,t.observerSlots[n]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)D(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)D(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function I(e,t=i){const n=function(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}(e);throw n}function M(e){if("function"==typeof e&&!e.length)return M(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=M(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function O(e,t){return function(t){let n;return d((()=>n=h((()=>(i.context={...i.context,[e]:t.value},x((()=>t.children)))))),void 0),n}}function N(e,t){return h((()=>e(t||{})))}function R(e){const t=e.keyed,n=m((()=>e.when),void 0,{equals:(e,n)=>t?e===n:!e==!n});return m((()=>{const r=n();if(r){const o=e.children;return"function"==typeof o&&o.length>0?h((()=>o(t?r:()=>{if(!h(n))throw"Stale read from <Show>.";return e.when}))):o}return e.fallback}),void 0,void 0)}const $="_$DX_DELEGATE";function H(e,t,n){let r;const o=()=>(r||(r=(()=>{const t=document.createElement("template");return t.innerHTML=e,t.content.firstChild})())).cloneNode(!0);return o.cloneNode=o,o}function _(e,t=window.document){const n=t[$]||(t[$]=new Set);for(let r=0,o=e.length;r<o;r++){const o=e[r];n.has(o)||(n.add(o),t.addEventListener(o,j))}}function U(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)}function F(e,t,n){if(!t)return n?U(e,"style"):t;const r=e.style;if("string"==typeof t)return r.cssText=t;let o,i;for(i in"string"==typeof n&&(r.cssText=n=void 0),n||(n={}),t||(t={}),n)null==t[i]&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function B(e,t,n){return h((()=>e(t,n)))}function G(e,t,n,r){if(void 0===n||r||(r=[]),"function"!=typeof t)return W(e,t,r,n);d((r=>W(e,t(),r,n)),r)}function j(e){let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),s=()=>{const r=t[n];if(r&&!t.disabled){const o=t[`${n}Data`];if(void 0!==o?r.call(t,o,e):r.call(t,e),e.cancelBubble)return}return t.host&&"string"!=typeof t.host&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>t||document}),e.composedPath){const n=e.composedPath();i(n[0]);for(let e=0;e<n.length-2&&(t=n[e],s());e++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function W(e,t,n,r,o){for(;"function"==typeof n;)n=n();if(t===n)return n;const i=typeof t,s=void 0!==r;if(e=s&&n[0]&&n[0].parentNode||e,"string"===i||"number"===i){if("number"===i&&(t=t.toString())===n)return n;if(s){let o=n[0];o&&3===o.nodeType?o.data!==t&&(o.data=t):o=document.createTextNode(t),n=z(e,n,r,o)}else n=""!==n&&"string"==typeof n?e.firstChild.data=t:e.textContent=t}else if(null==t||"boolean"===i)n=z(e,n,r);else{if("function"===i)return d((()=>{let o=t();for(;"function"==typeof o;)o=o();n=W(e,o,n,r)})),()=>n;if(Array.isArray(t)){const i=[],a=n&&Array.isArray(n);if(K(i,t,n,o))return d((()=>n=W(e,i,n,r,!0))),()=>n;if(0===i.length){if(n=z(e,n,r),s)return n}else a?0===n.length?q(e,i,r):function(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;)if(t[s]!==n[a]){for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const t=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],t)}else if(i===a)for(;s<o;)c&&c.has(t[s])||t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const r=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],r),t[o]=n[i]}else{if(!c){c=new Map;let e=a;for(;e<i;)c.set(n[e],e++)}const r=c.get(t[s]);if(null!=r)if(a<r&&r<i){let l,g=s,u=1;for(;++g<o&&g<i&&null!=(l=c.get(t[g]))&&l===r+u;)u++;if(u>r-a){const o=t[s];for(;a<r;)e.insertBefore(n[a++],o)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}else s++,a++}(e,n,i):(n&&z(e),q(e,i));n=i}else if(t.nodeType){if(Array.isArray(n)){if(s)return n=z(e,n,r,t);z(e,n,null,t)}else null!=n&&""!==n&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);n=t}}return n}function K(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let s,a=t[i],l=n&&n[e.length];if(null==a||!0===a||!1===a);else if("object"==(s=typeof a)&&a.nodeType)e.push(a);else if(Array.isArray(a))o=K(e,a,l)||o;else if("function"===s)if(r){for(;"function"==typeof a;)a=a();o=K(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const t=String(a);l&&3===l.nodeType&&l.data===t?e.push(l):e.push(document.createTextNode(t))}}return o}function q(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function z(e,t,n,r){if(void 0===n)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let r=!1;for(let i=t.length-1;i>=0;i--){const s=t[i];if(o!==s){const t=s.parentNode===e;r||i?t&&s.remove():t?e.replaceChild(o,s):e.insertBefore(o,n)}else r=!0}}else e.insertBefore(o,n);return[o]}const V={top:"50px",left:"calc(100% - 700px)",margin:"0",width:"640px","max-height":"80vh",padding:"2px 5px 10px 5px","background-color":"white",border:"none","border-radius":"24px","box-shadow":"0px 4px 44px rgba(0, 0, 0, 0.25)","font-family":"Arial","line-height":"1","vertical-align":"baseline","box-sizing":"border-box",color:"rgb(34, 34, 34)","@media (max-width: 600px), (max-height: 480px)":{display:"none !important"}},Y={height:"100%","overflow-x":"hidden","overlfow-y":"auto",position:"relative",padding:"0px 15px"},X={},Z={display:"flex","flex-direction":"column-reverse","align-items":"center","margin-bottom":"10px"},J={flex:"1","font-size":"24px","font-weight":"700","margin-top":"5px","margin-bottom":"0px"},Q={background:"none",border:"none",padding:"4px 8px",color:"#666464","font-size":"38px",cursor:"pointer","line-height":"1"},ee={color:"#707070","align-self":"flex-end","margin-top":"5px","max-width":"40%"},te={color:"#707070",cursor:"default","pointer-events":"none","text-decoration":"none"},ne={"font-size":"18px","font-weight":"400","margin-top":"0px","margin-bottom":"0px"},re={display:"flex",gap:"10px",width:"100%","margin-top":"20px","margin-bottom":"20px","flex-wrap":"wrap","justify-content":"space-between"},oe={width:"30%",position:"relative",display:"flex","flex-direction":"column","align-items":"center",background:"none",border:"1px solid #ccc","border-radius":"5px",padding:"5px",gap:"5px","text-align":"center","font-size":"14px",cursor:"pointer",transition:"background-color 0.2s ease"},ie={color:"white","background-color":"lightgray",cursor:"default","pointer-events":"none"},se={"max-width":"120px","max-height":"70px","margin-bottom":"5px","object-fit":"contain"},ae={"background-color":"#0052FF",cursor:"pointer","border-radius":"32px",padding:"8px",color:"white","min-width":"100px",border:"0","font-weight":"600",width:"120px"},le={display:"flex","flex-direction":"column",gap:"10px",width:"100%","color-scheme":"light"},ce={display:"flex","align-items":"center",gap:"5px",border:"1px solid #ddd",padding:"15px","border-radius":"5px","font-weight":"600",cursor:"pointer","margin-bottom":"8px"},ge={"text-align":"right"},ue={background:"none",border:"none",color:"blue","text-decoration":"underline",padding:"0",cursor:"pointer","margin-bottom":"15px"},de={display:"flex","justify-content":"space-between",margin:"20px 0px 10px 0px","font-size":"14px"},pe={margin:"5px 0px 5px 0px","font-size":"14px","text-align":"center"},me={color:"#666464","text-decoration":"underline"},he={color:"rgb(102, 100, 100)","text-decoration":"underline",margin:"0",cursor:"pointer"},fe={width:"100%","background-color":"#f2f2f2",border:"1px solid black","border-radius":"10px","border-top":"1px solid #bbb7b7","margin-top":"10px","margin-bottom":"20px","box-sizing":"border-box"},Ae={padding:"0 5px 0 10px",width:"100%","font-size":"12px","box-sizing":"border-box"},ve={display:"grid","grid-template-columns":"4fr 1fr","padding-right":"15px","padding-bottom":"5px"},xe={color:"#000","margin-bottom":"4px"},be={"font-size":"14px",color:"#555","text-align":"right"},ye=(e,t)=>{let n=parseFloat(t);return"FLAT"===e&&(n*=.75),((e,t)=>{let n=parseFloat(t);return n<1&&(n=1),n=Math.floor(n),"PERCENTAGE"===e?`${n}%`:`$${n}`})(e,n.toString())};var we=H("<span>");function Ce(e){return t=we(),d((()=>{return t.innerHTML=(n=e.title,r=e.activeDomain,n.replace("{0}",ye(r.Merchant.MaxRate?.Kind,r.Merchant.MaxRate?.Amount??"0")));var n,r})),t;var t}const ke=function(){const e=Symbol("context");return{id:e,Provider:O(e),defaultValue:()=>({translate:e=>"",getAllCharities:()=>[]})}}(),Pe=ke,Se=()=>{const e=v(Pe)();if(!e)throw new Error("Content provider context is undefined");return t=>e.translate(t)};class Te{static formatMessage(e,...t){return e.replace(/{(\d+)}/g,((e,n)=>{const r=Number(n);return void 0!==t[r]?String(t[r]):`{${r}}`}))}}var Ee=H("<div>"),Le=H("<div><div class=gf-offer-details><p><span></span></p><p><span></span></p><p><span></span></p><p><span></span></p><p><span></span></p><p><a target=_blank rel=noreferrer><span>"),De=H("<div class=gf-offer-details-rate-item><div></div><div>");const Ie=e=>{const t=Se();return n=Le(),o=(r=n.firstChild).firstChild,i=o.firstChild,s=o.nextSibling,a=s.firstChild,l=s.nextSibling,c=l.firstChild,g=l.nextSibling,u=g.firstChild,p=g.nextSibling,m=p.firstChild,h=p.nextSibling.firstChild,f=h.firstChild,G(r,N(R,{get when(){return!!e.merchantRateDetail?.length},get children(){var t=Ee();return G(t,(()=>e.merchantRateDetail?.map((e=>{return t=De(),n=t.firstChild,r=n.nextSibling,G(n,(()=>e.Name||"")),G(r,(()=>((e,t=1,n=1)=>{const r=e.BoostedOffer??null;let o=parseFloat(e?.Amount??"");if(r?.EndDate&&new Date(r.EndDate)<new Date&&(o=parseFloat(r.OriginalMaxRate)),Number.isNaN(o))return"";const i=o*t;return"PERCENTAGE"===e?.Kind?`${i.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:n})}%`:"FLAT"===e?.Kind?i.toLocaleString("en-US",{style:"currency",currency:e.Currency}):""})(e))),d((e=>{var o=ve,i=xe,s=be;return e.e=F(t,o,e.e),e.t=F(n,i,e.t),e.a=F(r,s,e.a),e}),{e:void 0,t:void 0,a:void 0}),t;var t,n,r})))),t}}),g),d((o=>{var s=fe,l=Ae,g=t("offerDetails.intro"),d=t("offerDetails.eligible"),p=e.parsedMaxRate?Te.formatMessage(t("offerDetails.donationRatesWithValue"),e.parsedMaxRate):Te.formatMessage(t("offerDetails.donationRates")),A=t("offerDetails.donationAmounts"),v=t("offerDetails.donationTiming"),x=me,b=e.termsUrl,y=t("offerDetails.termsAndConditions");return o.e=F(n,s,o.e),o.t=F(r,l,o.t),g!==o.a&&(i.innerHTML=o.a=g),d!==o.o&&(a.innerHTML=o.o=d),p!==o.i&&(c.innerHTML=o.i=p),A!==o.n&&(u.innerHTML=o.n=A),v!==o.s&&(m.innerHTML=o.s=v),o.h=F(h,x,o.h),b!==o.r&&U(h,"href",o.r=b),y!==o.d&&(f.innerHTML=o.d=y),o}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),n;var n,r,o,i,s,a,l,c,g,u,p,m,h,f};function Me(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Oe={exports:{}};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,function(e){if(!(globalThis.chrome&&globalThis.chrome.runtime&&globalThis.chrome.runtime.id))throw new Error("This script should only be loaded in a browser extension.");if(globalThis.browser&&globalThis.browser.runtime&&globalThis.browser.runtime.id)e.exports=globalThis.browser;else{const t="The message port closed before a response was received.",n=e=>{const n={alarms:{clear:{minArgs:0,maxArgs:1},clearAll:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getAll:{minArgs:0,maxArgs:0}},bookmarks:{create:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},getChildren:{minArgs:1,maxArgs:1},getRecent:{minArgs:1,maxArgs:1},getSubTree:{minArgs:1,maxArgs:1},getTree:{minArgs:0,maxArgs:0},move:{minArgs:2,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeTree:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}},browserAction:{disable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},enable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},getBadgeBackgroundColor:{minArgs:1,maxArgs:1},getBadgeText:{minArgs:1,maxArgs:1},getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},openPopup:{minArgs:0,maxArgs:0},setBadgeBackgroundColor:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setBadgeText:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},browsingData:{remove:{minArgs:2,maxArgs:2},removeCache:{minArgs:1,maxArgs:1},removeCookies:{minArgs:1,maxArgs:1},removeDownloads:{minArgs:1,maxArgs:1},removeFormData:{minArgs:1,maxArgs:1},removeHistory:{minArgs:1,maxArgs:1},removeLocalStorage:{minArgs:1,maxArgs:1},removePasswords:{minArgs:1,maxArgs:1},removePluginData:{minArgs:1,maxArgs:1},settings:{minArgs:0,maxArgs:0}},commands:{getAll:{minArgs:0,maxArgs:0}},contextMenus:{remove:{minArgs:1,maxArgs:1},removeAll:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},cookies:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:1,maxArgs:1},getAllCookieStores:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},devtools:{inspectedWindow:{eval:{minArgs:1,maxArgs:2,singleCallbackArg:!1}},panels:{create:{minArgs:3,maxArgs:3,singleCallbackArg:!0},elements:{createSidebarPane:{minArgs:1,maxArgs:1}}}},downloads:{cancel:{minArgs:1,maxArgs:1},download:{minArgs:1,maxArgs:1},erase:{minArgs:1,maxArgs:1},getFileIcon:{minArgs:1,maxArgs:2},open:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},pause:{minArgs:1,maxArgs:1},removeFile:{minArgs:1,maxArgs:1},resume:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},extension:{isAllowedFileSchemeAccess:{minArgs:0,maxArgs:0},isAllowedIncognitoAccess:{minArgs:0,maxArgs:0}},history:{addUrl:{minArgs:1,maxArgs:1},deleteAll:{minArgs:0,maxArgs:0},deleteRange:{minArgs:1,maxArgs:1},deleteUrl:{minArgs:1,maxArgs:1},getVisits:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1}},i18n:{detectLanguage:{minArgs:1,maxArgs:1},getAcceptLanguages:{minArgs:0,maxArgs:0}},identity:{launchWebAuthFlow:{minArgs:1,maxArgs:1}},idle:{queryState:{minArgs:1,maxArgs:1}},management:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},getSelf:{minArgs:0,maxArgs:0},setEnabled:{minArgs:2,maxArgs:2},uninstallSelf:{minArgs:0,maxArgs:1}},notifications:{clear:{minArgs:1,maxArgs:1},create:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:0},getPermissionLevel:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},pageAction:{getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},hide:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},permissions:{contains:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},request:{minArgs:1,maxArgs:1}},runtime:{getBackgroundPage:{minArgs:0,maxArgs:0},getPlatformInfo:{minArgs:0,maxArgs:0},openOptionsPage:{minArgs:0,maxArgs:0},requestUpdateCheck:{minArgs:0,maxArgs:0},sendMessage:{minArgs:1,maxArgs:3},sendNativeMessage:{minArgs:2,maxArgs:2},setUninstallURL:{minArgs:1,maxArgs:1}},sessions:{getDevices:{minArgs:0,maxArgs:1},getRecentlyClosed:{minArgs:0,maxArgs:1},restore:{minArgs:0,maxArgs:1}},storage:{local:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},managed:{get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1}},sync:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}}},tabs:{captureVisibleTab:{minArgs:0,maxArgs:2},create:{minArgs:1,maxArgs:1},detectLanguage:{minArgs:0,maxArgs:1},discard:{minArgs:0,maxArgs:1},duplicate:{minArgs:1,maxArgs:1},executeScript:{minArgs:1,maxArgs:2},get:{minArgs:1,maxArgs:1},getCurrent:{minArgs:0,maxArgs:0},getZoom:{minArgs:0,maxArgs:1},getZoomSettings:{minArgs:0,maxArgs:1},goBack:{minArgs:0,maxArgs:1},goForward:{minArgs:0,maxArgs:1},highlight:{minArgs:1,maxArgs:1},insertCSS:{minArgs:1,maxArgs:2},move:{minArgs:2,maxArgs:2},query:{minArgs:1,maxArgs:1},reload:{minArgs:0,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeCSS:{minArgs:1,maxArgs:2},sendMessage:{minArgs:2,maxArgs:3},setZoom:{minArgs:1,maxArgs:2},setZoomSettings:{minArgs:1,maxArgs:2},update:{minArgs:1,maxArgs:2}},topSites:{get:{minArgs:0,maxArgs:0}},webNavigation:{getAllFrames:{minArgs:1,maxArgs:1},getFrame:{minArgs:1,maxArgs:1}},webRequest:{handlerBehaviorChanged:{minArgs:0,maxArgs:0}},windows:{create:{minArgs:0,maxArgs:1},get:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:1},getCurrent:{minArgs:0,maxArgs:1},getLastFocused:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}}};if(0===Object.keys(n).length)throw new Error("api-metadata.json has not been included in browser-polyfill");class r extends WeakMap{constructor(e,t=void 0){super(t),this.createItem=e}get(e){return this.has(e)||this.set(e,this.createItem(e)),super.get(e)}}const o=(t,n)=>(...r)=>{e.runtime.lastError?t.reject(new Error(e.runtime.lastError.message)):n.singleCallbackArg||r.length<=1&&!1!==n.singleCallbackArg?t.resolve(r[0]):t.resolve(r)},i=e=>1==e?"argument":"arguments",s=(e,t,n)=>new Proxy(t,{apply:(t,r,o)=>n.call(r,e,...o)});let a=Function.call.bind(Object.prototype.hasOwnProperty);const l=(e,t={},n={})=>{let r=Object.create(null),c={has:(t,n)=>n in e||n in r,get(c,g,u){if(g in r)return r[g];if(!(g in e))return;let d=e[g];if("function"==typeof d)if("function"==typeof t[g])d=s(e,e[g],t[g]);else if(a(n,g)){let t=((e,t)=>function(n,...r){if(r.length<t.minArgs)throw new Error(`Expected at least ${t.minArgs} ${i(t.minArgs)} for ${e}(), got ${r.length}`);if(r.length>t.maxArgs)throw new Error(`Expected at most ${t.maxArgs} ${i(t.maxArgs)} for ${e}(), got ${r.length}`);return new Promise(((i,s)=>{if(t.fallbackToNoCallback)try{n[e](...r,o({resolve:i,reject:s},t))}catch(o){console.warn(`${e} API method doesn't seem to support the callback parameter, falling back to call it without a callback: `,o),n[e](...r),t.fallbackToNoCallback=!1,t.noCallback=!0,i()}else t.noCallback?(n[e](...r),i()):n[e](...r,o({resolve:i,reject:s},t))}))})(g,n[g]);d=s(e,e[g],t)}else d=d.bind(e);else if("object"==typeof d&&null!==d&&(a(t,g)||a(n,g)))d=l(d,t[g],n[g]);else{if(!a(n,"*"))return Object.defineProperty(r,g,{configurable:!0,enumerable:!0,get:()=>e[g],set(t){e[g]=t}}),d;d=l(d,t[g],n["*"])}return r[g]=d,d},set:(t,n,o,i)=>(n in r?r[n]=o:e[n]=o,!0),defineProperty:(e,t,n)=>Reflect.defineProperty(r,t,n),deleteProperty:(e,t)=>Reflect.deleteProperty(r,t)},g=Object.create(e);return new Proxy(g,c)},c=e=>({addListener(t,n,...r){t.addListener(e.get(n),...r)},hasListener:(t,n)=>t.hasListener(e.get(n)),removeListener(t,n){t.removeListener(e.get(n))}}),g=new r((e=>"function"!=typeof e?e:function(t){const n=l(t,{},{getContent:{minArgs:0,maxArgs:0}});e(n)})),u=new r((e=>"function"!=typeof e?e:function(t,n,r){let o,i,s=!1,a=new Promise((e=>{o=function(t){s=!0,e(t)}}));try{i=e(t,n,o)}catch(e){i=Promise.reject(e)}const l=!0!==i&&((c=i)&&"object"==typeof c&&"function"==typeof c.then);var c;if(!0!==i&&!l&&!s)return!1;return(l?i:a).then((e=>{r(e)}),(e=>{let t;t=e&&(e instanceof Error||"string"==typeof e.message)?e.message:"An unexpected error occurred",r({__mozWebExtensionPolyfillReject__:!0,message:t})})).catch((e=>{console.error("Failed to send onMessage rejected reply",e)})),!0})),d=({reject:n,resolve:r},o)=>{e.runtime.lastError?e.runtime.lastError.message===t?r():n(new Error(e.runtime.lastError.message)):o&&o.__mozWebExtensionPolyfillReject__?n(new Error(o.message)):r(o)},p=(e,t,n,...r)=>{if(r.length<t.minArgs)throw new Error(`Expected at least ${t.minArgs} ${i(t.minArgs)} for ${e}(), got ${r.length}`);if(r.length>t.maxArgs)throw new Error(`Expected at most ${t.maxArgs} ${i(t.maxArgs)} for ${e}(), got ${r.length}`);return new Promise(((e,t)=>{const o=d.bind(null,{resolve:e,reject:t});r.push(o),n.sendMessage(...r)}))},m={devtools:{network:{onRequestFinished:c(g)}},runtime:{onMessage:c(u),onMessageExternal:c(u),sendMessage:p.bind(null,"sendMessage",{minArgs:1,maxArgs:3})},tabs:{sendMessage:p.bind(null,"sendMessage",{minArgs:2,maxArgs:3})}},h={clear:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}};return n.privacy={network:{"*":h},services:{"*":h},websites:{"*":h}},l(e,m,n)};e.exports=n(chrome)}}(Oe);var Ne,Re,browser=Me(Oe.exports);class $e{constructor(){this.isLocal=!0}log({level:e,message:t,timestamp:n,data:r,title:o}){let i;switch(e){case"debug":default:i="log";break;case"info":i="info";break;case"warn":i="warn";break;case"error":case"critical":case"fatal":i="error"}const s=o?`[${o}]`:"";void 0!==r?console[i](`[${n}] - ${$e.LOGGER_PREFIX} ${s} ${t}`,r):console[i](`[${n}] - ${$e.LOGGER_PREFIX} ${s} ${t}`)}}$e.LOGGER_PREFIX="[GFAdUnit] -",function(e){e.checkoutPopupShown="CHECKOUT-POPUP-SHOWN",e.checkoutPopupNotShown="CHECKOUT-POPUP-NOT-SHOWN",e.checkoutPopupSupressed="CHECKOUT-POPUP-SUPRESSED",e.checkoutPopupDonation="CHECKOUT-POPUP-DONATION",e.checkoutPopupFailedActivation="CHECKOUT-POPUP-FAILED-ACTIVATION",e.checkoutPopupPurchaseConfirmed="CHECKOUT-POPUP-PURCHASE-CONFIRMED",e.checkoutPopupHealthCheck="CHECKOUT-POPUP-HEALTH-CHECK",e.checkouPopupActivationFailed="CHECKOUT-POPUP-ACTIVATION-FAILED",e.checkoutPopupOfferDetailsClicked="CHECKOUT-POPUP-OFFER-DETAILS-CLICKED",e.checkoutPopupWhyAmISeeingThisClicked="CHECKOUT-POPUP-WHY-AM-I-SEEING-THIS-CLICKED",e.checkoutPopupLooserExtension="CHECKOUT-POPUP-LOOSER-EXTENSION",e.checkoutPopupActiveDomain="CHECKOUT-POPUP-ACTIVE-DOMAIN",e.checkoutPopupSiteMatches="CHECKOUT-POPUP-SITE-MATCHES",e.checkoutPopupMerchantInResultsFound="CHECKOUT-MERCHANT-IN-RESULTS-FOUND"}(Ne||(Ne={})),function(e){e.adUnitLog="ADUNIT-LOG"}(Re||(Re={}));const He=["debug","info","warn","error","critical","fatal"];class _e{constructor(e){this.config={minLevel:e?.minLevel??"debug",enabled:e?.enabled??!1,transports:e?.transports??[new $e],title:e?.title??""}}static getInstance(e){return _e.instance||(_e.instance=new _e(e)),_e.instance}configure(e){this.config={...this.config,...e}}shouldLog(e){return!!this.config.enabled&&He.indexOf(e)>=He.indexOf(this.config.minLevel)}createLogMessage(e,t,n){return{level:e,version:"1.17.3",message:t,timestamp:(new Date).toISOString(),data:n,title:this.config.title}}log(e,t,n,r){if(!this.shouldLog(e))return;const o=this.createLogMessage(e,t,r);this.config.transports.filter((e=>!n||e.isLocal)).forEach((e=>e.log(o)))}debug(e,t,n=!1){this.log("debug",e,n,t)}info(e,t,n=!1){this.log("info",e,n,t)}warn(e,t,n=!1){this.log("warn",e,n,t)}error(e,t,n=!1){this.log("error",e,n,t)}critical(e,t,n=!1){this.log("critical",e,n,t)}fatal(e,t,n=!1){this.log("fatal",e,n,t)}addTransport(e){this.config.transports.push(e)}clearTransports(){this.config.transports=[]}disable(){this.config.enabled=!1}enable(){this.config.enabled=!0}}const Ue=3,Fe=e=>1e3*e,Be=browser;async function Ge(e,t){return await Be.runtime.sendMessage(e)}async function je(e,t,n){return async function(e,t={}){const{maxAttempts:n=Ue,delayFn:r=Fe}=t;let o=null;for(let t=1;t<=n;t+=1)try{return await e()}catch(e){o=e,t<n&&await new Promise((e=>{setTimeout(e,r(t))}))}throw o&&t.logger&&t.operationName&&t.logger.error(`Operation ${t.operationName} failed after ${n} attempts.`,o,!0),o||new Error("Operation failed after multiple attempts")}((()=>Ge(e)),{maxAttempts:Ue,delayFn:Fe})}const We="GF_TRACK_EVENT",Ke="GF_HIDE_POPUP",qe="GF_GET_POPUP_CONFIG",ze="GF_IS_ACTIVE_DOMAIN",Ve="GF_LOG_MERCHANTS_IN_SEARCH_RESULTS",Ye="GF_SHOULD_STAND_DOWN",Xe="GF_ACTIVATE_OFFER",Ze="GF_STORE_SHOPIFY_SHOP_ID",Je="GF_GET_DOMAIN_BY_SHOP_ID",Qe="GF_GET_LANGUAGE_CONTENT",et="countryCode",tt="gf_ad_event_history",nt={ein:"0",tpi:"0"},rt="GIVE_FREELY_",ot={async get(e){const t=`${rt}${e}`;return(await browser.storage.local.get(t))[t]||null},async set(e,t){const n=`${rt}${e}`;await browser.storage.local.set({[n]:t})},async remove(e){const t=Array.isArray(e)?e.map((e=>`${rt}${e}`)):`${rt}${e}`;await browser.storage.local.remove(t)}},it=()=>String("1.17.3");class st{constructor(e,t,n,r=60){this.track=async(e,t,n,r=!1,o=!1)=>{const i={partner:`adUnit_${this._partnerApiKey}`,eventType:e,eventData:{userId:r?void 0:this._userService?.user?.id,libVersion:it(),wfDeviceId:t,...n}};try{const e=JSON.stringify(i,((e,t)=>t instanceof Error?{name:t.name,message:t.message,stack:t.stack}:t)),t=await this.getEventsUrl();return t?await this.BroadcastEvent(t,e,i,o):(this._logger.info("Cant broadcast event. eventsUrl cant be retrieved from config",i,!0),!1)}catch(e){return this._logger.error("Something unexpected happened when dispatching a gf event",{error:e,event:i},!0),!1}},this.getEventsHistory=async()=>{const e=await ot.get(tt),t=(e=>{const t=new Date;return t.setTime(t.getTime()+60*e*1e3),t.getTime()})(-this._debounceWindowInMinutes),n=(e||[]).filter((e=>e.createdAt>t));return await ot.set(tt,n),n},this.shouldBroadcastEvent=async(e,t)=>!!t||!(await this.getEventsHistory()).some((t=>t.payload===e)),this.pushEventToHistory=async e=>{const t=await this.getEventsHistory();t.push({createdAt:Date.now(),payload:e}),await ot.set(tt,t)},this._partnerApiKey=e,this._userService=t,this._debounceWindowInMinutes=r,this._logger=_e.getInstance({title:"Analytics"}),this._configService=n}async BroadcastEvent(e,t,n,r){if(await this.shouldBroadcastEvent(t,r)){const r=await fetch(e,{headers:{"Content-Type":"application/json"},method:"POST",body:t,cache:"no-store"});return r.ok?(await this.pushEventToHistory(t),!0):(this._logger.error("Something unexpected happened when dispatching an event",{status:r.status,statusText:r.statusText,event:n},!0),!1)}return this._logger.info("This event has already been broadcasted during the past hour",n,!0),!1}async getEventsUrl(){const e=await this._configService.getCachedConfig();return e?.eventsUrl}}function at(e,t,n){return e?{...t,...n}:t}st.trackEvent=async(e,t,n=!1,r=!1)=>{await Ge({type:We,payload:{eventType:e,eventData:t,anonymous:n,skipThrottling:r}})};var lt=H("<a href=#!>"),ct=H("<button class=give-freely-close-button aria-label=Close>×"),gt=H('<div><div><div></div></div><div></div><div><div><div><span></span></div><button aria-label="Don\'t show again"><span></span></button></div></div><div><p><span></span></p><a class=give-freely-footer-link target=_blank rel="noopener noreferrer"><span>'),ut=H("<div><div><img><span></span></div><button><span>"),dt=H("<div>"),pt=H("<div><span>");const mt=e=>({hasBackdrop:!!e.containerStyle?.backdropColor||!!e.containerStyle?.showAsModal,clickAction:e.containerStyle?.clickAction??"hide-opacity"});function ht(e){const[t,n]=u(!1),[r,o]=u(null),i=t=>{const{hasBackdrop:n,clickAction:r}=mt(e.checkoutPopupConf);n&&"donate"===r&&t.stopPropagation()},s=()=>{const{hasBackdrop:t,clickAction:n}=mt(e.checkoutPopupConf);t&&"ignore"!==n&&("donate"===n?c(nt,!0):e.setBackdropHidden(!0))};p((()=>{window.addEventListener("click",s),e.mainContainerRef?.addEventListener("click",i),A((()=>{setTimeout((()=>{window.removeEventListener("click",s),e.mainContainerRef?.removeEventListener("click",i)}),500)}))}));const a=Se(),l=(()=>{const e=v(ke)();if(!e)throw new Error("Content provider context is undefined");return()=>e.getAllCharities()})();p((()=>{t()&&e.dialogRef&&e.dialogRef.scroll({top:e.dialogRef.offsetHeight,behavior:"smooth"})})),p((()=>{const t=r();t&&e.onCharitySelect(t.charity,t.closeOnDonation?e.checkoutPopupConf.checkoutPopupActivateAndCloseSkipSuccess:void 0)}));const c=(e,t)=>o({charity:e,closeOnDonation:t}),g=()=>!!r()?.charity;return[(f=gt(),x=f.firstChild,b=x.firstChild,y=x.nextSibling,w=y.nextSibling,C=w.firstChild,k=C.firstChild,P=k.firstChild,S=k.nextSibling,T=S.firstChild,E=w.nextSibling,L=E.firstChild,D=L.firstChild,I=L.nextSibling,M=I.firstChild,G(x,N(R,{get when(){return e.checkoutPopupConf.checkoutPopupActivateAndClose},get children(){var e=lt();return e.$$click=()=>c(nt,!0),d((t=>{var n=at(g(),ee,te),r=a("main.activateAndClose.v2");return t.e=F(e,n,t.e),r!==t.t&&(e.innerHTML=t.t=r),t}),{e:void 0,t:void 0}),e}}),null),G(x,N(R,{get when(){return e.checkoutPopupConf.checkoutPopupMainCloseButtonVisible&&!e.checkoutPopupConf.checkoutPopupActivateAndClose},get children(){var t=ct();return t.$$click=()=>e.onClose(),d((e=>F(t,Q,e))),t}}),null),G(y,N(Ce,{get title(){return a("main.subTitle.v2")},get activeDomain(){return e.activeDomain}})),G(w,(()=>l().reduce(((t,n)=>{var r,o,i,s,l,u,p;return n?.title&&""!==n?.title?t.push((i=(o=ut()).firstChild,s=i.firstChild,l=s.nextSibling,u=i.nextSibling,p=u.firstChild,o.$$click=()=>!g()&&c(n),G(o,(r=m((()=>!!(n.decorator&&n.decoratorLeftStyle&&n.decoratorRightStyle))),()=>{return r()&&[(t=dt(),d((e=>{var r=n.decoratorLeftStyle,o=n.decorator;return e.e=F(t,r,e.e),o!==e.t&&(t.innerHTML=e.t=o),e}),{e:void 0,t:void 0}),t),(e=dt(),d((t=>{var r=n.decoratorRightStyle,o=n.decorator;return t.e=F(e,r,t.e),o!==t.t&&(e.innerHTML=t.t=o),t}),{e:void 0,t:void 0}),e)];var e,t}),i),i.style.setProperty("height","100px"),i.style.setProperty("text-align","center"),i.style.setProperty("display","flex"),i.style.setProperty("flex-direction","column"),i.style.setProperty("align-items","center"),i.style.setProperty("gap","7px"),d((t=>{var r=at(g(),oe,{cursor:"default"}),i=n.logo,c=se,d=n.title,m=n.title,h=at(g(),{...ae,"background-color":e.checkoutPopupConf?.checkoutPopupSelectCharityButtonBgColor||"#0052FF"},ie),f=g(),A=`Select charity: ${n.title}`,v=a("main.charitySelect");return t.e=F(o,r,t.e),i!==t.t&&U(s,"src",t.t=i),t.a=F(s,c,t.a),d!==t.o&&U(s,"alt",t.o=d),m!==t.i&&(l.innerHTML=t.i=m),t.n=F(u,h,t.n),f!==t.s&&(u.disabled=t.s=f),A!==t.h&&U(u,"aria-label",t.h=A),v!==t.r&&(p.innerHTML=t.r=v),t}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),o)):e.logger.error(`Translation was not found for EIN ${n?.ein}`),t}),[])),C),C.$$click=()=>!g()&&e.onSuppress(),k.style.setProperty("height","100px"),k.style.setProperty("text-align","center"),k.style.setProperty("display","flex"),k.style.setProperty("align-items","center"),L.$$click=()=>{e.onOfferDetailsClick(!t()),n(!t())},I.$$click=()=>{st.trackEvent(Ne.checkoutPopupWhyAmISeeingThisClicked,{domain:globalThis.window.location.hostname})},G(f,(h=m((()=>!!e.checkoutPopupConf.checkoutPopupDisplayNameInFooter)),()=>{return h()&&(e=pt(),t=e.firstChild,d((n=>{var r=pe,o=a("main.footer");return n.e=F(e,r,n.e),o!==n.t&&(t.innerHTML=n.t=o),n}),{e:void 0,t:void 0}),e);var e,t}),null),d((t=>{var n=X,r=Z,o={...J,"font-weight":800},i=a("main.title.v2"),s=ne,l=re,c=at(g(),oe,{cursor:"default"}),u=a("main.sixthBox"),d=at(g(),{...ae,"background-color":e.checkoutPopupConf.checkoutPopupSelectCharityButtonBgColor||"#0052FF"},ie),p=g(),m=a("main.settings.v2"),h=de,A=he,v=a("main.offerDetails"),k=me,O=e.checkoutPopupConf.externalUrls.giveFreelyWhyAmISeeingThis,N=a("main.whyAmISeeingThis");return t.e=F(f,n,t.e),t.t=F(x,r,t.t),t.a=F(b,o,t.a),i!==t.o&&(b.innerHTML=t.o=i),t.i=F(y,s,t.i),t.n=F(w,l,t.n),t.s=F(C,c,t.s),u!==t.h&&(P.innerHTML=t.h=u),t.r=F(S,d,t.r),p!==t.d&&(S.disabled=t.d=p),m!==t.l&&(T.innerHTML=t.l=m),t.u=F(E,h,t.u),t.c=F(L,A,t.c),v!==t.w&&(D.innerHTML=t.w=v),t.m=F(I,k,t.m),O!==t.f&&U(I,"href",t.f=O),N!==t.y&&(M.innerHTML=t.y=N),t}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0}),f),N(R,{get when(){return t()},get children(){return N(Ie,{get merchantName(){return e.activeDomain.Merchant.Name},get extensionName(){return e.checkoutPopupConf.displayName},get termsUrl(){return e.checkoutPopupConf.externalUrls.giveFreelyTermsAndConditions},get parsedMaxRate(){return m((()=>!!e.activeDomain.Merchant.MaxRate))()?ye(e.activeDomain.Merchant.MaxRate.Kind,e.activeDomain.Merchant.MaxRate?.Amount):null},get merchantRateDetail(){return e.merchantRates},onClose:()=>n(!1)})}})];var h,f,x,b,y,w,C,k,P,S,T,E,L,D,I,M}_(["click"]);var ft=H("<button class=give-freely-close-button aria-label=Close>×"),At=H("<label class=give-freely-radio-option><input type=radio name=gf-rad-goodbye value=18250><span>"),vt=H('<div><div><div><span></span></div></div><button class=give-freely-back-button aria-label="Back to charity selection"><span></span></button><hr><div id=give-freely-goodbye-screen-options><label class=give-freely-radio-option><input type=radio name=gf-rad-goodbye value=1><span></span></label><label class=give-freely-radio-option><input type=radio name=gf-rad-goodbye value=7><span></span></label><label class=give-freely-radio-option><input type=radio name=gf-rad-goodbye value=30><span></span></label><label class=give-freely-radio-option><input type=radio name=gf-rad-goodbye value=90><span></span></label></div><button class=give-freely-submit-button><span>');function xt(e){const[t,n]=u(0),r=Se();return o=vt(),i=o.firstChild,s=i.firstChild,a=s.firstChild,l=i.nextSibling,c=l.firstChild,g=l.nextSibling.nextSibling,m=(p=g.firstChild).firstChild,h=m.nextSibling,A=(f=p.nextSibling).firstChild,v=A.nextSibling,b=(x=f.nextSibling).firstChild,y=b.nextSibling,C=(w=x.nextSibling).firstChild,k=C.nextSibling,P=g.nextSibling,S=P.firstChild,o.style.setProperty("font-size","14px"),G(i,N(R,{get when(){return e.checkoutPopupConf.checkoutPopupSupressCloseButtonVisible},get children(){var t=ft();return t.$$click=()=>e.onGoodbye(0),d((e=>F(t,Q,e))),t}}),null),l.$$click=()=>e.onBack(),m.addEventListener("change",(()=>n(1))),A.addEventListener("change",(()=>n(7))),b.addEventListener("change",(()=>n(30))),C.addEventListener("change",(()=>n(90))),G(g,N(R,{get when(){return e.checkoutPopupConf.checkoutPopupNeverSuppressionAllowed},get children(){var e=At(),t=e.firstChild,o=t.nextSibling;return t.addEventListener("change",(()=>n(18250))),d((t=>{var n=ce,i=r("suppress.suppressionPeriodNever");return t.e=F(e,n,t.e),i!==t.t&&(o.innerHTML=t.t=i),t}),{e:void 0,t:void 0}),e}}),null),P.$$click=()=>{const n=t();n&&(e.onGoodbye(n),e.setScreen("main"))},d((t=>{var n={...Z,"flex-direction":"row"},o={...J,"margin-top":"20px"},u=r("suppress.title"),d=ue,m=r("suppress.backButton"),A=le,b=ce,C=r("suppress.suppressionPeriod").replace("{0}","1"),T=ce,E=r("suppress.suppressionPeriodPlural").replace("{0}","7"),L=ce,D=r("suppress.suppressionPeriodPlural").replace("{0}","30"),I=ce,M=r("suppress.suppressionPeriodPlural").replace("{0}","90"),O={...ae,"font-weight":"700","margin-top":"10px","margin-bottom":"0px","background-color":e.checkoutPopupConf.checkoutPopupSelectCharityButtonBgColor||"#0052FF",width:"100px"},N=r("suppress.submitButton");return t.e=F(i,n,t.e),t.t=F(s,o,t.t),u!==t.a&&(a.innerHTML=t.a=u),t.o=F(l,d,t.o),m!==t.i&&(c.innerHTML=t.i=m),t.n=F(g,A,t.n),t.s=F(p,b,t.s),C!==t.h&&(h.innerHTML=t.h=C),t.r=F(f,T,t.r),E!==t.d&&(v.innerHTML=t.d=E),t.l=F(x,L,t.l),D!==t.u&&(y.innerHTML=t.u=D),t.c=F(w,I,t.c),M!==t.w&&(k.innerHTML=t.w=M),t.m=F(P,O,t.m),N!==t.f&&(S.innerHTML=t.f=N),t}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0}),o;var o,i,s,a,l,c,g,p,m,h,f,A,v,x,b,y,w,C,k,P,S}_(["click"]);var bt=H("<div><p><span>"),yt=H("<div><div><div><span></span></div><button class=give-freely-close-button aria-label=Close>×</button></div><hr><div><span>");function wt(e){const[t,n]=u(null),r=Se();let o;return A((()=>clearInterval(o))),f((()=>{e.failedDonation||(()=>{const t=e.checkoutPopupConf.checkoutPopupDonationSuccessAutoCloseInSeconds??3;n(t),o=setInterval((()=>{n((t=>null===t||t<=1?(clearInterval(o),e.onClose(),0):t-1))}),1e3)})()})),i=yt(),s=i.firstChild,a=s.firstChild,l=a.firstChild,c=a.nextSibling,g=s.nextSibling.nextSibling,p=g.firstChild,i.style.setProperty("font-size","14px"),c.$$click=()=>e.onClose(),g.style.setProperty("padding","30px"),g.style.setProperty("height","150px"),g.style.setProperty("font-size","14px"),G(i,N(R,{get when(){return!e.failedDonation},get children(){var e=bt(),n=e.firstChild,o=n.firstChild;return d((e=>{var i=ge,s=Te.formatMessage(r("donate.autoClosing"),t()??0);return e.e=F(n,i,e.e),s!==e.t&&(o.innerHTML=e.t=s),e}),{e:void 0,t:void 0}),e}}),null),d((t=>{var n={...Z,"flex-direction":"row"},o={...J,"margin-top":"20px"},i=e.failedDonation?r("donate.failTitle"):r("donate.title"),g=Q,u=e.failedDonation?r("donate.failContent"):r("donate.content");return t.e=F(s,n,t.e),t.t=F(a,o,t.t),i!==t.a&&(l.innerHTML=t.a=i),t.o=F(c,g,t.o),u!==t.i&&(p.innerHTML=t.i=u),t}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),i;var i,s,a,l,c,g,p}_(["click"]);var Ct=H("<dialog popover=manual><div>");function kt(e){const[t,n]=u("main"),[r,o]=u(),[i,s]=u(!1),[a,l]=u(!1);let c;p((()=>{c&&(e.checkoutPopupConf.containerStyle?.showAsModal?c.showModal():c.showPopover(),c.focus(),c.blur())}));const g=()=>{e.logger.debug("Close button clicked"),e.onClose()},m=async(t,r=!1)=>{r&&e.onClose(),e.logger.info("Charity selected",{charity:t,domain:e.activeDomain.Domain}),o(t);const i=await e.onDonate(t,e.activeDomain);r?e.onClose():(s(!i),n("donate"))},h=()=>{e.logger.debug("Suppress button clicked"),n("goodbye")},f=()=>{e.logger.debug("Navigating back to main screen"),n("main")},A=t=>{e.logger.info("User chose to hide popup",{days:t}),e.onClose(t)};let v;return x=Ct(),b=x.firstChild,"function"==typeof c?B(c,x):c=x,"function"==typeof v?B(v,b):v=b,G(b,N(R,{get when(){return"main"===t()},get children(){return N(ht,{setBackdropHidden:l,mainContainerRef:v,dialogRef:c,get checkoutPopupConf(){return e.checkoutPopupConf},get activeDomain(){return e.activeDomain},get merchantRates(){return e.merchantRates},onClose:g,onCharitySelect:m,onSuppress:h,get onOfferDetailsClick(){return e.onOfferDetailsClick},get logger(){return e.logger}})}}),null),G(b,N(R,{get when(){return"goodbye"===t()},get children(){return N(xt,{get checkoutPopupConf(){return e.checkoutPopupConf},onClose:()=>e.onClose(),onBack:f,onGoodbye:A,setScreen:n})}}),null),G(b,N(R,{get when(){return"donate"===t()},get children(){return N(wt,{get checkoutPopupConf(){return e.checkoutPopupConf},get selectedCharity(){return r()},onClose:()=>e.onClose(),get failedDonation(){return i()},setScreen:n})}}),null),d((t=>{var n,r,o=a()?"backdrop-hidden":"",i={...V,...e.checkoutPopupConf.containerStyle?.customStyle??{}},s=e.elementId,l=Y;return o!==t.e&&(n=x,null==(r=t.e=o)?n.removeAttribute("class"):n.className=r),t.t=F(x,i,t.t),s!==t.a&&U(x,"id",t.a=s),t.o=F(b,l,t.o),t}),{e:void 0,t:void 0,a:void 0,o:void 0}),x;var x,b}function Pt(e){const t=["",".asp",".aspx",".php",".js",".htm",".html"],n=["cart","checkout","shopping-bag","shopping-basket","shopping-cart","basket"].flatMap((e=>t.map((t=>e+t)))).filter((e=>"basket"!==e)),r=["tote-cart","tote.cart"],o=e,i=n.filter((e=>o.includes(e))),s=o.split("/");return!s.some((e=>r.some((t=>e.includes(t)))))&&(s.some((e=>n.some((t=>e.startsWith(t)||e.endsWith(t)))))||"basket"===s[s.length-1].toLowerCase()||i.length>1||1===i.length&&o.includes("shopping"))}function St(e,t){const n=["book"];return e.split("/").some((e=>n.some((t=>e.startsWith(t)||e.endsWith(t)))))&&null!=t.evaluate("//*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6][contains(., 'Your Reservation') or contains(., 'Your reservation')]",t,null,XPathResult.ANY_TYPE,null)?.iterateNext()}async function Tt(e){try{const t=await Ge({type:Je,payload:{shopId:e}});return t.payload.found&&t.payload.domain?t.payload.domain:null}catch{return null}}function Et(e){try{const e=Array.from(document.querySelectorAll("script"));for(const t of e){if(t.dataset?.shopId&&(t.dataset?.shopId?.startsWith("gid")||t.src.includes("shopify"))){const e=parseInt(t.dataset.shopId.replace("gid://shopify/Shop/",""));if(!Number.isNaN(e)&&e>0)return e}const e=t.textContent||"";if(e.includes("ShopifyAnalytics")&&e.includes("shopId")){const t=e.match(/shopId['"]*:\s*['"]*(\d+)['"]*[,}]/);if(t&&t[1]){const e=parseInt(t[1]);if(!Number.isNaN(e)&&e>0)return e}}}const t=document.querySelector("[data-shop-id]");if(t instanceof HTMLElement){const{shopId:e}=t.dataset;if(e){const t=parseInt(e);if(!Number.isNaN(t)&&t>0)return t}}const n=window?.ShopifyAnalytics?.lib?.trekkie?.defaultAttributes?.shopId;return n&&parseInt(n)||0}catch(t){return e.error("Error accessing ShopifyAnalytics:",t),0}}function Lt(){try{if(!window.location.href.startsWith("https://shop.app"))return 0;const e=document?.head?.querySelector('meta[name="store"][content]');if(!e)return 0;try{const t=JSON.parse(e.content);return t?.id||0}catch{return 0}}catch{return 0}}const Dt=_e.getInstance();function It(e,t,n){try{Dt.debug("Checking merchant regex rules",{currentUrl:t});const r=e.merchantPopupRules.filter((e=>n===e.domain||n.endsWith(`.${e.domain}`)));if(0===r.length)return Dt.debug("No matching merchant rules found for domain",{currentUrl:t}),!1;for(const e of r)for(const n of e.rules)try{if(new RegExp(n.rule).test(t))return Dt.debug("Merchant regex rule matched",{merchant:e.name,rule:n.rule,currentUrl:t}),!0}catch(t){Dt.error("Invalid regex in merchant rule",{merchant:e.name,rule:n.rule,error:t})}return Dt.debug("No matching regex rules found",{currentUrl:t}),!1}catch(e){return Dt.error("Error in merchantRegexRule",e),!1}}function Mt(e){if(e?.customLanguageDetection&&e.customLanguageDetection.length>0){const t=window.location.href,n=document.body.textContent?.toLowerCase()||"";for(const r of e.customLanguageDetection)try{if(new RegExp(r.urlPattern).test(t))for(const[e,t]of Object.entries(r.keywords))if(n.includes(e.toLowerCase()))return t}catch(e){_e.getInstance().warn(`Invalid regex pattern in customLanguageDetection: ${r.urlPattern}`,e)}}const t=document.documentElement.lang,n=document.querySelector('meta[http-equiv="Content-Language"]')?.content,r=document.querySelector('link[rel="alternate"][hreflang]')?.getAttribute("hreflang"),o=navigator.language,i=t||n||r||o||"en";return"string"==typeof i?i.split("-")[0]:"en"}function Ot(e){return!0!==e.checkoutPopupOnlyShowLanguageMatch||"en"===Mt(e)}const Nt=(e,t=!1)=>e.length<2&&t?null:Array.from(e).filter((e=>!t||e.dataset.extensionId!==browser.runtime.id)).map((e=>e.dataset.extensionName)).join(",");const Rt=e=>{const t=m((()=>({translate:e.translate()||(e=>""),getAllCharities:e.charities()||(()=>[])})));return N(ke.Provider,{value:t,get children(){return e.children}})},$t=_e.getInstance();var Ht=H("<div class=gf-app>");function _t(e){const[t,n]=u(void 0),[r,o]=u(!1),[i,s]=u([]),[a,l]=u(),[c,g]=u({});let d;f((async()=>{e.logger.info("Mounting GfApp component");try{!function(e){if(!e?.shouldCheckSiteMatches)return;let t;(e?.siteMatchesRegex??[]).some((e=>{var n;return n=window.location.href,!(!new RegExp(e).test(n)||(t=e,0))}))&&t&&st.trackEvent(Ne.checkoutPopupSiteMatches,{url:window.location.href,matchedRule:t,uts:Date.now()},!0)}(e.popupConfig);const r=Mt(e.popupConfig);x(r);const i=it();if(e.popupConfig.minVersion&&((e,t)=>{if(e===t)return!1;const n=e.split(".").map((e=>parseInt(e,10))),r=t.split(".").map((e=>parseInt(e,10)));for(let e=0;e<n.length;e++){if(n[e]<r[e])return!0;if(n[e]>r[e])return!1}return!1})(i,e.popupConfig.minVersion))return void e.logger.debug(`Current version: ${i}. Minimum version ${e.popupConfig.minVersion} not met`);const a=await(async()=>await ot.get(et)||(async()=>{$t.debug("detecting country");const e={method:"GET",headers:{"Content-Type":"application/json",Authorization:"Basic OTEzOTkxOnFlYmpaWF9DOGNRY0lxSHA4WTVjNGxzU1pRSlM2VW9MMExzTF9tbWs="}};try{const t=await fetch("https://geoip.maxmind.com/geoip/v2.1/country/me",e);if($t.debug("Received geolocation response",{status:t.status}),!t.ok)return void $t.error("Failed to get geolocation data",{status:t.status,statusText:t.statusText});const n=await t.json();if(!n)throw new Error("There was an error fetching geoip look up");return await ot.set(et,n.country.iso_code),n.country.iso_code}catch(e){return void $t.error("Failed to get geolocation data",{error:e},!0)}})())()??"us",l=e.popupConfig.charities[a.toLowerCase()]??e.popupConfig.charities.us;if(g(l||{}),e.logger.debug("Charities for current country",{currentCountry:a,charities:l}),!1===e.popupConfig.checkoutPopupMasterSwitch)return void e.logger.debug("Checkout popup master switch is disabled");const c=document.getElementsByClassName("give-freely-root");let u=!1;c.length>1&&(e.logger.debug("There is more than one gf extension installed"),c.item(0).dataset.extensionId!==browser.runtime.id&&(e.logger.debug("Giving preference to the first gf extension injected in the DOM"),u=!0),e.logger.debug("Providing this extension preference over the other installed extensions"));const{domain:p,rates:m}=await(async e=>{const{hostname:t}=window.location;e.debug("Checking if domain is active",{hostname:t});const n=await Ge({type:ze,payload:{hostname:t}});return n.payload.isActive?(e.debug("Active domain",{domain:n.payload.domain}),e.debug("Merchant rates",{rates:n.payload.rates}),e.info("Domain and rates ({})ed successfully."),{isActive:!0,domain:n.payload.domain,rates:n.payload.rates}):{isActive:!1,domain:void 0,rates:[]}})(e.logger);if(s(m),n(p),p)await function(e,t){const n=Et(t)||Lt();return n>0&&function(e,t,n){if(e&&!(e<=0))try{Ge({type:Ze,payload:{shopId:e,domain:t}}).catch((e=>{n.error("Error sending shop ID to background:",e)}))}catch(e){n.error("Error sending Shopify shop ID:",e)}}(n,e,t),n}(p,e.logger);else{if("shop.app"!==window.location.hostname&&!window.location.hostname.endsWith(".shop.app"))return void o(!1);const t=window.location.pathname.split("/")[2];if(!t)return e.logger.error("Shop ID not found"),void o(!1);const r=await Tt(parseInt(t));if(!r)return e.logger.error("Shop domain not found"),void o(!1);e.logger.debug("Shop domain found",{shopDomain:r}),n(r)}const h=await(async e=>{const t=await ot.get("popup_hide");if(!t)return e.debug("No expiry found in storage"),!1;const{popupHide:n}=t,r=!!n&&Date.now()<n;return e.debug("Is AdUnit Muted?",{isMuted:r,expiry:n}),r})(e.logger);if(h)return;if(!t())return void o(!1);const f=await(async(e,t)=>{const{Domain:n}=t,r=window.location.href,{payload:o}=await Ge({type:Ye,payload:{activeDomain:n,url:r}});return!!o.result&&(e.info("Stand Down detected"),!0)})(e.logger,t());if(f)return void o(!1);const A=e.popupConfig?.anonymousActiveDomainLogging??!1,v=t()??void 0;v&&A&&!function(e){const t=`gfhv-${e}`;return!!sessionStorage.getItem(t)||(sessionStorage.setItem(t,"true"),!1)}(v.Domain)&&st.trackEvent(Ne.checkoutPopupActiveDomain,{url:v.Domain}),d=window.setInterval((async()=>{e.logger.debug("Checking checkout rules");const t=await(async e=>{const t=_e.getInstance();t.configure({enabled:!0,title:"Content - checkoutRulesTest"});const n=new URL(globalThis.location.href),r=n.href,{hostname:o}=n;t.debug("Checking if popup should be shown",{currentUrl:r});const i=await async function(e){const t=Et(e)||Lt();return!("shop.app"!==window.location.hostname&&!window.location.hostname.endsWith(".shop.app")||!(t>0)||!await Tt(t))}(t),s=Ot(e)&&(Pt(n.pathname.toLowerCase())||St(r,document)||It(e,r,o)||i);return t.debug("Popup show decision based on rules",{shouldShow:s,matchesCartRule:Pt(n.pathname.toLowerCase()),matchesBookingRule:St(r,document),matchesShopPayRule:i,matchesMerchantRegexRule:It(e,r,o),matchesLanguageRule:Ot(e)}),s})(e.popupConfig);if(t&&u)return st.trackEvent(Ne.checkoutPopupLooserExtension,{url:globalThis.window.location.href,winner:c.item(0).dataset.extensionName}),e.logger.debug("Standing down because, another ad-unit extension will pop"),void clearInterval(d);o(t),t&&(e.logger.debug("Should show popup based on checkout rules",{shouldShowResult:t}),st.trackEvent(Ne.checkoutPopupShown,{url:globalThis.window.location.href,pageLanguage:r,merchantId:v?.Merchant?.ID,looserCompetingExtensions:Nt(c,!0)}))}),2e3)}catch(t){o(!1),e.logger.error("An error occurred in GfApp",{error:t})}})),A((()=>{d&&window.clearInterval(d)}));const p=async(t,n)=>{e.logger.info("Processing donation",{charity:t,domain:n.Domain});const r=await(async(e,t,n,r)=>{e.debug("Activating offer",{activeDomain:t,selectedCharity:r});const o=await je({type:Xe,payload:{activeDomain:t,originalUrl:n,selectedCharity:r}});return e.debug("Activate offer response",{response:o}),o})(e.logger,n,window.location.href,{ein:t.ein,thirdPartyId:t.tpi});return e.logger.debug("Activate offer response",{activationResponse:r}),st.trackEvent(r.payload.response?Ne.checkoutPopupDonation:Ne.checkoutPopupFailedActivation,{activeDomain:n.Domain,url:globalThis.window.location.href,merchantId:n?.Merchant?.ID,charity:{ein:t.ein,tpi:t.tpi},rate:n.Merchant.MaxRate}),r.payload.response},h=async t=>{o(await(async(e,t)=>{try{e.info("Hiding ad",{days:t});const n=await je({type:Ke,payload:{days:t??0}});return void 0!==t&&st.trackEvent(Ne.checkoutPopupSupressed,{url:globalThis.window.location.href,days:t}),e.info("Hiding ad response",{hideResponse:n}),n.payload.ack?(e.debug("Ad hidden successfully"),!1):(e.warn("Failed to hide ad"),!0)}catch{return!1}})(e.logger,t)),d&&window.clearInterval(d)},v=async e=>{st.trackEvent(Ne.checkoutPopupOfferDetailsClicked,{action:e?"opened":"closed"})},x=async t=>{e.logger.debug("Getting translation provider",{currentLanguage:t});const{translations:n,charities:r}=await async function(e,t){try{t&&t.debug("Getting language content",{languageCode:e});const n=await Ge({type:Qe,payload:{lang:e}});return{translations:n.payload.translations,charities:n.payload.charities}}catch(n){return t&&t.error("Error getting language content",{error:n,languageCode:e}),{translations:null,charities:null}}}(t,e.logger),o={translate:e=>n&&n[e]?n[e]:"",getAllCharities:()=>{const e=c();return Object.entries(e).map((([e,t])=>{const{ein:n}=t;try{const o=r?.[n];if(!o)throw new Error(`Failed to find charity metadata for ein ${n}`);return{ein:n,tpi:o.tpi,title:o.title,order:parseInt(e,10),logo:o.logo,decorator:t.decorator,decoratorLeftStyle:t.decoratorLeftStyle,decoratorRightStyle:t.decoratorRightStyle}}catch{return{ein:n,tpi:"",title:"",order:9,logo:""}}}))}};e.logger.debug("Setting content provider with translations and charity functions"),l((()=>o))};return N(Rt,{translate:()=>a()?.translate,charities:()=>a()?.getAllCharities,get children(){var n,o=Ht();return G(o,(n=m((()=>!(!t()||!r()))),()=>n()&&N(kt,{get checkoutPopupConf(){return e.popupConfig},elementId:"give-freely-checkout-popup",get activeDomain(){return t()},get merchantRates(){return i()},onClose:h,onDonate:p,onOfferDetailsClick:v,get logger(){return e.logger}}))),o}})}async function Ut(){const e=`give-freely-root-${browser.runtime.id}`;if(document.getElementById(e))return;const t=document.createElement("div");t.id=e,t.className="give-freely-root",t.style.display="block",t.dataset.extensionId=browser.runtime.id,t.dataset.extensionName=browser.runtime.getManifest().name||browser.runtime.id,document.body.appendChild(t);const n=t.attachShadow({mode:"open"}),r=document.createElement("div"),s=_e.getInstance(),l=await(async()=>{const e=await Ge({type:qe,payload:{}});if(!e.payload.config)throw new Error("No checkout popup config found");return e.payload.config})();if(!l)return void s.error("No ad unit config found");s.configure({enabled:l.checkoutPopupLoggerEnabled??!0,title:"Content - GfAdUnit",minLevel:l.checkoutPopupMinLogLevel??"error"});const c=(g=l.containerStyle?.backdropColor,`\n :host {\n all: initial;\n }\n\n .gf-scroll-remove::-webkit-scrollbar {\n border-radius-bottom-right: 15px;\n }\n\n button {\n cursor: pointer;\n transition: transform 0.1s ease;\n }\n\n button:active {\n transform: scale(0.98);\n }\n\n .give-freely-close-button:hover {\n opacity: 0.7;\n }\n\n input[type="radio"] {\n margin-right: 8px;\n }\n\n hr {\n border: none;\n border-top: 1px solid #e5e5e5;\n margin: 1em 0;\n }\n\n @media (max-width: 600px), (max-height: 480px) {\n #give-freely-checkout-popup {\n display: none !important;\n }\n }\n\n dialog::backdrop {\n background-color: ${g||"revert"};\n }\n\n dialog.backdrop-hidden::backdrop {\n background-color: transparent;\n }\n`);var g;const u=document.createElement("style");u.textContent=c,n.appendChild(u),n.appendChild(r),l.countAppearances&&async function(e){try{const t=globalThis.window.location.href,n=/^https?:\/\/(?:www\.)?google\.[a-z]{2,}(\.[a-z]{2})?\/search\?(?:.*&)?q=[^&]+(?:&.*)?$/.test(t);if(e.debug("Is a Google search result page?",n),!n)return!1;const r=(()=>{const e=globalThis.window.document.querySelectorAll("#rso > div, #tads > div"),t=[];return e.forEach((e=>{const n=(e=>{const t=null!==e.querySelector('[data-text-ad="1"]'),n=e.querySelector('span:not(.a-no-hover-link):is(:where(*, [role="text"]))'),r=n&&(n.textContent?.includes("Sponsored")||n.textContent?.includes("Ad"));return t||(r??!1)})(e),r=e.querySelector('.yuRUbf a, .MjjYud a, a[jsname="UWckNb"], a[data-pcu]');if(r){let e=r.href;if(e&&e.includes("/url?q="))try{const t=new URLSearchParams(new URL(e).search).get("q");t&&(e=t)}catch{}e&&e.startsWith("http")&&t.push({url:e,isSponsored:n??!1})}})),t})();if(e.info("The following search results were identified",r),!r||0===r.length)return!1;const o=await Ge({type:Ve,payload:{currentUrl:t,searchResults:r,source:"google"}});return o?.payload?.result??!1}catch(t){return e.error("Error while identifying search results",t),!1}}(s),function(e,t,n,r={}){let s;(function(e,t){const n=a,r=i,s=0===e.length,l=void 0===t?r:t,c=s?o:{owned:null,cleanups:null,context:l?l.context:null,owner:l},g=s?e:()=>e((()=>h((()=>D(c)))));i=c,a=null;try{return P(g,!0)}finally{a=n,i=r}})((r=>{s=r,t===document?e():G(t,e(),t.firstChild?null:void 0,n)}),r.owner)}((()=>N(_t,{popupConfig:l,logger:s})),r)}export{browser,Ut as initializeAdUnit};
|
|
1
|
+
const e={equals:(e,t)=>e===t};let t=S;const n=1,r=2,o={owned:null,cleanups:null,context:null,owner:null};var i=null;let s=null,a=null,l=null,c=null,g=0;function u(t,n){const r={value:t,observers:null,observerSlots:null,comparator:(n=n?Object.assign({},e,n):e).equals||void 0};return[b.bind(r),e=>("function"==typeof e&&(e=e(r.value)),y(r,e))]}function d(e,t,r){w(C(e,t,!1,n))}function p(e,r,o){t=T;const i=C(e,r,!1,n);i.user=!0,c?c.push(i):w(i)}function m(t,n,r){r=r?Object.assign({},e,r):e;const o=C(t,n,!0,0);return o.observers=null,o.observerSlots=null,o.comparator=r.equals||void 0,w(o),b.bind(o)}function h(e){if(null===a)return e();const t=a;a=null;try{return e()}finally{a=t}}function f(e){p((()=>h(e)))}function A(e){return null===i||(null===i.cleanups?i.cleanups=[e]:i.cleanups.push(e)),e}function v(e){let t;return i&&i.context&&void 0!==(t=i.context[e.id])?t:e.defaultValue}function x(e){const t=m(e),n=m((()=>M(t())));return n.toArray=()=>{const e=n();return Array.isArray(e)?e:null!=e?[e]:[]},n}function b(){if(this.sources&&this.state)if(this.state===n)w(this);else{const e=l;l=null,P((()=>E(this)),!1),l=e}if(a){const e=this.observers?this.observers.length:0;a.sources?(a.sources.push(this),a.sourceSlots.push(e)):(a.sources=[this],a.sourceSlots=[e]),this.observers?(this.observers.push(a),this.observerSlots.push(a.sources.length-1)):(this.observers=[a],this.observerSlots=[a.sources.length-1])}return this.value}function y(e,t,r){let o=e.value;return e.comparator&&e.comparator(o,t)||(e.value=t,e.observers&&e.observers.length&&P((()=>{for(let t=0;t<e.observers.length;t+=1){const r=e.observers[t],o=s&&s.running;o&&s.disposed.has(r),(o?r.tState:r.state)||(r.pure?l.push(r):c.push(r),r.observers&&L(r)),o||(r.state=n)}if(l.length>1e6)throw l=[],new Error}),!1)),t}function w(e){if(!e.fn)return;D(e);const t=g;!function(e,t,r){let o;const s=i,l=a;a=i=e;try{o=e.fn(t)}catch(t){return e.pure&&(e.state=n,e.owned&&e.owned.forEach(D),e.owned=null),e.updatedAt=r+1,I(t)}finally{a=l,i=s}(!e.updatedAt||e.updatedAt<=r)&&(null!=e.updatedAt&&"observers"in e?y(e,o):e.value=o,e.updatedAt=r)}(e,e.value,t)}function C(e,t,r,s=n,a){const l={fn:e,state:s,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:i,context:i?i.context:null,pure:r};return null===i||i!==o&&(i.owned?i.owned.push(l):i.owned=[l]),l}function k(e){if(0===e.state)return;if(e.state===r)return E(e);if(e.suspense&&h(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<g);)e.state&&t.push(e);for(let o=t.length-1;o>=0;o--)if((e=t[o]).state===n)w(e);else if(e.state===r){const n=l;l=null,P((()=>E(e,t[0])),!1),l=n}}function P(e,n){if(l)return e();let r=!1;n||(l=[]),c?r=!0:c=[],g++;try{const n=e();return function(e){if(l&&(S(l),l=null),e)return;const n=c;c=null,n.length&&P((()=>t(n)),!1)}(r),n}catch(e){r||(c=null),l=null,I(e)}}function S(e){for(let t=0;t<e.length;t++)k(e[t])}function T(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:k(r)}for(t=0;t<n;t++)k(e[t])}function E(e,t){e.state=0;for(let o=0;o<e.sources.length;o+=1){const i=e.sources[o];if(i.sources){const e=i.state;e===n?i!==t&&(!i.updatedAt||i.updatedAt<g)&&k(i):e===r&&E(i,t)}}}function L(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=r,n.pure?l.push(n):c.push(n),n.observers&&L(n))}}function D(e){let t;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){const e=r.pop(),o=t.observerSlots.pop();n<r.length&&(e.sourceSlots[o]=n,r[n]=e,t.observerSlots[n]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)D(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)D(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function I(e,t=i){const n=function(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}(e);throw n}function M(e){if("function"==typeof e&&!e.length)return M(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=M(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function O(e,t){return function(t){let n;return d((()=>n=h((()=>(i.context={...i.context,[e]:t.value},x((()=>t.children)))))),void 0),n}}function N(e,t){return h((()=>e(t||{})))}function R(e){const t=e.keyed,n=m((()=>e.when),void 0,{equals:(e,n)=>t?e===n:!e==!n});return m((()=>{const r=n();if(r){const o=e.children;return"function"==typeof o&&o.length>0?h((()=>o(t?r:()=>{if(!h(n))throw"Stale read from <Show>.";return e.when}))):o}return e.fallback}),void 0,void 0)}const $="_$DX_DELEGATE";function H(e,t,n){let r;const o=()=>(r||(r=(()=>{const t=document.createElement("template");return t.innerHTML=e,t.content.firstChild})())).cloneNode(!0);return o.cloneNode=o,o}function _(e,t=window.document){const n=t[$]||(t[$]=new Set);for(let r=0,o=e.length;r<o;r++){const o=e[r];n.has(o)||(n.add(o),t.addEventListener(o,j))}}function U(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)}function F(e,t,n){if(!t)return n?U(e,"style"):t;const r=e.style;if("string"==typeof t)return r.cssText=t;let o,i;for(i in"string"==typeof n&&(r.cssText=n=void 0),n||(n={}),t||(t={}),n)null==t[i]&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function B(e,t,n){return h((()=>e(t,n)))}function G(e,t,n,r){if(void 0===n||r||(r=[]),"function"!=typeof t)return W(e,t,r,n);d((r=>W(e,t(),r,n)),r)}function j(e){let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),s=()=>{const r=t[n];if(r&&!t.disabled){const o=t[`${n}Data`];if(void 0!==o?r.call(t,o,e):r.call(t,e),e.cancelBubble)return}return t.host&&"string"!=typeof t.host&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>t||document}),e.composedPath){const n=e.composedPath();i(n[0]);for(let e=0;e<n.length-2&&(t=n[e],s());e++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function W(e,t,n,r,o){for(;"function"==typeof n;)n=n();if(t===n)return n;const i=typeof t,s=void 0!==r;if(e=s&&n[0]&&n[0].parentNode||e,"string"===i||"number"===i){if("number"===i&&(t=t.toString())===n)return n;if(s){let o=n[0];o&&3===o.nodeType?o.data!==t&&(o.data=t):o=document.createTextNode(t),n=z(e,n,r,o)}else n=""!==n&&"string"==typeof n?e.firstChild.data=t:e.textContent=t}else if(null==t||"boolean"===i)n=z(e,n,r);else{if("function"===i)return d((()=>{let o=t();for(;"function"==typeof o;)o=o();n=W(e,o,n,r)})),()=>n;if(Array.isArray(t)){const i=[],a=n&&Array.isArray(n);if(K(i,t,n,o))return d((()=>n=W(e,i,n,r,!0))),()=>n;if(0===i.length){if(n=z(e,n,r),s)return n}else a?0===n.length?q(e,i,r):function(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;)if(t[s]!==n[a]){for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const t=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],t)}else if(i===a)for(;s<o;)c&&c.has(t[s])||t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const r=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],r),t[o]=n[i]}else{if(!c){c=new Map;let e=a;for(;e<i;)c.set(n[e],e++)}const r=c.get(t[s]);if(null!=r)if(a<r&&r<i){let l,g=s,u=1;for(;++g<o&&g<i&&null!=(l=c.get(t[g]))&&l===r+u;)u++;if(u>r-a){const o=t[s];for(;a<r;)e.insertBefore(n[a++],o)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}else s++,a++}(e,n,i):(n&&z(e),q(e,i));n=i}else if(t.nodeType){if(Array.isArray(n)){if(s)return n=z(e,n,r,t);z(e,n,null,t)}else null!=n&&""!==n&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);n=t}}return n}function K(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let s,a=t[i],l=n&&n[e.length];if(null==a||!0===a||!1===a);else if("object"==(s=typeof a)&&a.nodeType)e.push(a);else if(Array.isArray(a))o=K(e,a,l)||o;else if("function"===s)if(r){for(;"function"==typeof a;)a=a();o=K(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const t=String(a);l&&3===l.nodeType&&l.data===t?e.push(l):e.push(document.createTextNode(t))}}return o}function q(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function z(e,t,n,r){if(void 0===n)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let r=!1;for(let i=t.length-1;i>=0;i--){const s=t[i];if(o!==s){const t=s.parentNode===e;r||i?t&&s.remove():t?e.replaceChild(o,s):e.insertBefore(o,n)}else r=!0}}else e.insertBefore(o,n);return[o]}const V={top:"50px",left:"calc(100% - 700px)",margin:"0",width:"640px","max-height":"80vh",padding:"2px 5px 10px 5px","background-color":"white",border:"none","border-radius":"24px","box-shadow":"0px 4px 44px rgba(0, 0, 0, 0.25)","font-family":"Arial","line-height":"1","vertical-align":"baseline","box-sizing":"border-box",color:"rgb(34, 34, 34)","@media (max-width: 600px), (max-height: 480px)":{display:"none !important"}},Y={height:"100%","overflow-x":"hidden","overlfow-y":"auto",position:"relative",padding:"0px 15px"},X={},Z={display:"flex","flex-direction":"column-reverse","align-items":"center","margin-bottom":"10px"},J={flex:"1","font-size":"24px","font-weight":"700","margin-top":"5px","margin-bottom":"0px"},Q={background:"none",border:"none",padding:"4px 8px",color:"#666464","font-size":"38px",cursor:"pointer","line-height":"1"},ee={color:"#707070","align-self":"flex-end","margin-top":"5px","max-width":"40%"},te={color:"#707070",cursor:"default","pointer-events":"none","text-decoration":"none"},ne={"font-size":"18px","font-weight":"400","margin-top":"0px","margin-bottom":"0px"},re={display:"flex",gap:"10px",width:"100%","margin-top":"20px","margin-bottom":"20px","flex-wrap":"wrap","justify-content":"space-between"},oe={width:"30%",position:"relative",display:"flex","flex-direction":"column","align-items":"center",background:"none",border:"1px solid #ccc","border-radius":"5px",padding:"5px",gap:"5px","text-align":"center","font-size":"14px",cursor:"pointer",transition:"background-color 0.2s ease"},ie={color:"white","background-color":"lightgray",cursor:"default","pointer-events":"none"},se={"max-width":"120px","max-height":"70px","margin-bottom":"5px","object-fit":"contain"},ae={"background-color":"#0052FF",cursor:"pointer","border-radius":"32px",padding:"8px",color:"white","min-width":"100px",border:"0","font-weight":"600",width:"120px"},le={display:"flex","flex-direction":"column",gap:"10px",width:"100%","color-scheme":"light"},ce={display:"flex","align-items":"center",gap:"5px",border:"1px solid #ddd",padding:"15px","border-radius":"5px","font-weight":"600",cursor:"pointer","margin-bottom":"8px"},ge={"text-align":"right"},ue={background:"none",border:"none",color:"blue","text-decoration":"underline",padding:"0",cursor:"pointer","margin-bottom":"15px"},de={display:"flex","justify-content":"space-between",margin:"20px 0px 10px 0px","font-size":"14px"},pe={margin:"5px 0px 5px 0px","font-size":"14px","text-align":"center"},me={color:"#666464","text-decoration":"underline"},he={color:"rgb(102, 100, 100)","text-decoration":"underline",margin:"0",cursor:"pointer"},fe={width:"100%","background-color":"#f2f2f2",border:"1px solid black","border-radius":"10px","border-top":"1px solid #bbb7b7","margin-top":"10px","margin-bottom":"20px","box-sizing":"border-box"},Ae={padding:"0 5px 0 10px",width:"100%","font-size":"12px","box-sizing":"border-box"},ve={display:"grid","grid-template-columns":"4fr 1fr","padding-right":"15px","padding-bottom":"5px"},xe={color:"#000","margin-bottom":"4px"},be={"font-size":"14px",color:"#555","text-align":"right"},ye=(e,t)=>{let n=parseFloat(t);return"FLAT"===e&&(n*=.75),((e,t)=>{let n=parseFloat(t);return n<1&&(n=1),n=Math.floor(n),"PERCENTAGE"===e?`${n}%`:`$${n}`})(e,n.toString())};var we=H("<span>");function Ce(e){return t=we(),d((()=>{return t.innerHTML=(n=e.title,r=e.activeDomain,n.replace("{0}",ye(r.Merchant.MaxRate?.Kind,r.Merchant.MaxRate?.Amount??"0")));var n,r})),t;var t}const ke=function(){const e=Symbol("context");return{id:e,Provider:O(e),defaultValue:()=>({translate:e=>"",getAllCharities:()=>[]})}}(),Pe=ke,Se=()=>{const e=v(Pe)();if(!e)throw new Error("Content provider context is undefined");return t=>e.translate(t)};class Te{static formatMessage(e,...t){return e.replace(/{(\d+)}/g,((e,n)=>{const r=Number(n);return void 0!==t[r]?String(t[r]):`{${r}}`}))}}var Ee=H("<div>"),Le=H("<div><div class=gf-offer-details><p><span></span></p><p><span></span></p><p><span></span></p><p><span></span></p><p><span></span></p><p><a target=_blank rel=noreferrer><span>"),De=H("<div class=gf-offer-details-rate-item><div></div><div>");const Ie=e=>{const t=Se();return n=Le(),o=(r=n.firstChild).firstChild,i=o.firstChild,s=o.nextSibling,a=s.firstChild,l=s.nextSibling,c=l.firstChild,g=l.nextSibling,u=g.firstChild,p=g.nextSibling,m=p.firstChild,h=p.nextSibling.firstChild,f=h.firstChild,G(r,N(R,{get when(){return!!e.merchantRateDetail?.length},get children(){var t=Ee();return G(t,(()=>e.merchantRateDetail?.map((e=>{return t=De(),n=t.firstChild,r=n.nextSibling,G(n,(()=>e.Name||"")),G(r,(()=>((e,t=1,n=1)=>{const r=e.BoostedOffer??null;let o=parseFloat(e?.Amount??"");if(r?.EndDate&&new Date(r.EndDate)<new Date&&(o=parseFloat(r.OriginalMaxRate)),Number.isNaN(o))return"";const i=o*t;return"PERCENTAGE"===e?.Kind?`${i.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:n})}%`:"FLAT"===e?.Kind?i.toLocaleString("en-US",{style:"currency",currency:e.Currency}):""})(e))),d((e=>{var o=ve,i=xe,s=be;return e.e=F(t,o,e.e),e.t=F(n,i,e.t),e.a=F(r,s,e.a),e}),{e:void 0,t:void 0,a:void 0}),t;var t,n,r})))),t}}),g),d((o=>{var s=fe,l=Ae,g=t("offerDetails.intro"),d=t("offerDetails.eligible"),p=e.parsedMaxRate?Te.formatMessage(t("offerDetails.donationRatesWithValue"),e.parsedMaxRate):Te.formatMessage(t("offerDetails.donationRates")),A=t("offerDetails.donationAmounts"),v=t("offerDetails.donationTiming"),x=me,b=e.termsUrl,y=t("offerDetails.termsAndConditions");return o.e=F(n,s,o.e),o.t=F(r,l,o.t),g!==o.a&&(i.innerHTML=o.a=g),d!==o.o&&(a.innerHTML=o.o=d),p!==o.i&&(c.innerHTML=o.i=p),A!==o.n&&(u.innerHTML=o.n=A),v!==o.s&&(m.innerHTML=o.s=v),o.h=F(h,x,o.h),b!==o.r&&U(h,"href",o.r=b),y!==o.d&&(f.innerHTML=o.d=y),o}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),n;var n,r,o,i,s,a,l,c,g,u,p,m,h,f};function Me(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Oe={exports:{}};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,function(e){if(!(globalThis.chrome&&globalThis.chrome.runtime&&globalThis.chrome.runtime.id))throw new Error("This script should only be loaded in a browser extension.");if(globalThis.browser&&globalThis.browser.runtime&&globalThis.browser.runtime.id)e.exports=globalThis.browser;else{const t="The message port closed before a response was received.",n=e=>{const n={alarms:{clear:{minArgs:0,maxArgs:1},clearAll:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getAll:{minArgs:0,maxArgs:0}},bookmarks:{create:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},getChildren:{minArgs:1,maxArgs:1},getRecent:{minArgs:1,maxArgs:1},getSubTree:{minArgs:1,maxArgs:1},getTree:{minArgs:0,maxArgs:0},move:{minArgs:2,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeTree:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}},browserAction:{disable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},enable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},getBadgeBackgroundColor:{minArgs:1,maxArgs:1},getBadgeText:{minArgs:1,maxArgs:1},getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},openPopup:{minArgs:0,maxArgs:0},setBadgeBackgroundColor:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setBadgeText:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},browsingData:{remove:{minArgs:2,maxArgs:2},removeCache:{minArgs:1,maxArgs:1},removeCookies:{minArgs:1,maxArgs:1},removeDownloads:{minArgs:1,maxArgs:1},removeFormData:{minArgs:1,maxArgs:1},removeHistory:{minArgs:1,maxArgs:1},removeLocalStorage:{minArgs:1,maxArgs:1},removePasswords:{minArgs:1,maxArgs:1},removePluginData:{minArgs:1,maxArgs:1},settings:{minArgs:0,maxArgs:0}},commands:{getAll:{minArgs:0,maxArgs:0}},contextMenus:{remove:{minArgs:1,maxArgs:1},removeAll:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},cookies:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:1,maxArgs:1},getAllCookieStores:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},devtools:{inspectedWindow:{eval:{minArgs:1,maxArgs:2,singleCallbackArg:!1}},panels:{create:{minArgs:3,maxArgs:3,singleCallbackArg:!0},elements:{createSidebarPane:{minArgs:1,maxArgs:1}}}},downloads:{cancel:{minArgs:1,maxArgs:1},download:{minArgs:1,maxArgs:1},erase:{minArgs:1,maxArgs:1},getFileIcon:{minArgs:1,maxArgs:2},open:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},pause:{minArgs:1,maxArgs:1},removeFile:{minArgs:1,maxArgs:1},resume:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},extension:{isAllowedFileSchemeAccess:{minArgs:0,maxArgs:0},isAllowedIncognitoAccess:{minArgs:0,maxArgs:0}},history:{addUrl:{minArgs:1,maxArgs:1},deleteAll:{minArgs:0,maxArgs:0},deleteRange:{minArgs:1,maxArgs:1},deleteUrl:{minArgs:1,maxArgs:1},getVisits:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1}},i18n:{detectLanguage:{minArgs:1,maxArgs:1},getAcceptLanguages:{minArgs:0,maxArgs:0}},identity:{launchWebAuthFlow:{minArgs:1,maxArgs:1}},idle:{queryState:{minArgs:1,maxArgs:1}},management:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},getSelf:{minArgs:0,maxArgs:0},setEnabled:{minArgs:2,maxArgs:2},uninstallSelf:{minArgs:0,maxArgs:1}},notifications:{clear:{minArgs:1,maxArgs:1},create:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:0},getPermissionLevel:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},pageAction:{getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},hide:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},permissions:{contains:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},request:{minArgs:1,maxArgs:1}},runtime:{getBackgroundPage:{minArgs:0,maxArgs:0},getPlatformInfo:{minArgs:0,maxArgs:0},openOptionsPage:{minArgs:0,maxArgs:0},requestUpdateCheck:{minArgs:0,maxArgs:0},sendMessage:{minArgs:1,maxArgs:3},sendNativeMessage:{minArgs:2,maxArgs:2},setUninstallURL:{minArgs:1,maxArgs:1}},sessions:{getDevices:{minArgs:0,maxArgs:1},getRecentlyClosed:{minArgs:0,maxArgs:1},restore:{minArgs:0,maxArgs:1}},storage:{local:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},managed:{get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1}},sync:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}}},tabs:{captureVisibleTab:{minArgs:0,maxArgs:2},create:{minArgs:1,maxArgs:1},detectLanguage:{minArgs:0,maxArgs:1},discard:{minArgs:0,maxArgs:1},duplicate:{minArgs:1,maxArgs:1},executeScript:{minArgs:1,maxArgs:2},get:{minArgs:1,maxArgs:1},getCurrent:{minArgs:0,maxArgs:0},getZoom:{minArgs:0,maxArgs:1},getZoomSettings:{minArgs:0,maxArgs:1},goBack:{minArgs:0,maxArgs:1},goForward:{minArgs:0,maxArgs:1},highlight:{minArgs:1,maxArgs:1},insertCSS:{minArgs:1,maxArgs:2},move:{minArgs:2,maxArgs:2},query:{minArgs:1,maxArgs:1},reload:{minArgs:0,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeCSS:{minArgs:1,maxArgs:2},sendMessage:{minArgs:2,maxArgs:3},setZoom:{minArgs:1,maxArgs:2},setZoomSettings:{minArgs:1,maxArgs:2},update:{minArgs:1,maxArgs:2}},topSites:{get:{minArgs:0,maxArgs:0}},webNavigation:{getAllFrames:{minArgs:1,maxArgs:1},getFrame:{minArgs:1,maxArgs:1}},webRequest:{handlerBehaviorChanged:{minArgs:0,maxArgs:0}},windows:{create:{minArgs:0,maxArgs:1},get:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:1},getCurrent:{minArgs:0,maxArgs:1},getLastFocused:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}}};if(0===Object.keys(n).length)throw new Error("api-metadata.json has not been included in browser-polyfill");class r extends WeakMap{constructor(e,t=void 0){super(t),this.createItem=e}get(e){return this.has(e)||this.set(e,this.createItem(e)),super.get(e)}}const o=(t,n)=>(...r)=>{e.runtime.lastError?t.reject(new Error(e.runtime.lastError.message)):n.singleCallbackArg||r.length<=1&&!1!==n.singleCallbackArg?t.resolve(r[0]):t.resolve(r)},i=e=>1==e?"argument":"arguments",s=(e,t,n)=>new Proxy(t,{apply:(t,r,o)=>n.call(r,e,...o)});let a=Function.call.bind(Object.prototype.hasOwnProperty);const l=(e,t={},n={})=>{let r=Object.create(null),c={has:(t,n)=>n in e||n in r,get(c,g,u){if(g in r)return r[g];if(!(g in e))return;let d=e[g];if("function"==typeof d)if("function"==typeof t[g])d=s(e,e[g],t[g]);else if(a(n,g)){let t=((e,t)=>function(n,...r){if(r.length<t.minArgs)throw new Error(`Expected at least ${t.minArgs} ${i(t.minArgs)} for ${e}(), got ${r.length}`);if(r.length>t.maxArgs)throw new Error(`Expected at most ${t.maxArgs} ${i(t.maxArgs)} for ${e}(), got ${r.length}`);return new Promise(((i,s)=>{if(t.fallbackToNoCallback)try{n[e](...r,o({resolve:i,reject:s},t))}catch(o){console.warn(`${e} API method doesn't seem to support the callback parameter, falling back to call it without a callback: `,o),n[e](...r),t.fallbackToNoCallback=!1,t.noCallback=!0,i()}else t.noCallback?(n[e](...r),i()):n[e](...r,o({resolve:i,reject:s},t))}))})(g,n[g]);d=s(e,e[g],t)}else d=d.bind(e);else if("object"==typeof d&&null!==d&&(a(t,g)||a(n,g)))d=l(d,t[g],n[g]);else{if(!a(n,"*"))return Object.defineProperty(r,g,{configurable:!0,enumerable:!0,get:()=>e[g],set(t){e[g]=t}}),d;d=l(d,t[g],n["*"])}return r[g]=d,d},set:(t,n,o,i)=>(n in r?r[n]=o:e[n]=o,!0),defineProperty:(e,t,n)=>Reflect.defineProperty(r,t,n),deleteProperty:(e,t)=>Reflect.deleteProperty(r,t)},g=Object.create(e);return new Proxy(g,c)},c=e=>({addListener(t,n,...r){t.addListener(e.get(n),...r)},hasListener:(t,n)=>t.hasListener(e.get(n)),removeListener(t,n){t.removeListener(e.get(n))}}),g=new r((e=>"function"!=typeof e?e:function(t){const n=l(t,{},{getContent:{minArgs:0,maxArgs:0}});e(n)})),u=new r((e=>"function"!=typeof e?e:function(t,n,r){let o,i,s=!1,a=new Promise((e=>{o=function(t){s=!0,e(t)}}));try{i=e(t,n,o)}catch(e){i=Promise.reject(e)}const l=!0!==i&&((c=i)&&"object"==typeof c&&"function"==typeof c.then);var c;if(!0!==i&&!l&&!s)return!1;return(l?i:a).then((e=>{r(e)}),(e=>{let t;t=e&&(e instanceof Error||"string"==typeof e.message)?e.message:"An unexpected error occurred",r({__mozWebExtensionPolyfillReject__:!0,message:t})})).catch((e=>{console.error("Failed to send onMessage rejected reply",e)})),!0})),d=({reject:n,resolve:r},o)=>{e.runtime.lastError?e.runtime.lastError.message===t?r():n(new Error(e.runtime.lastError.message)):o&&o.__mozWebExtensionPolyfillReject__?n(new Error(o.message)):r(o)},p=(e,t,n,...r)=>{if(r.length<t.minArgs)throw new Error(`Expected at least ${t.minArgs} ${i(t.minArgs)} for ${e}(), got ${r.length}`);if(r.length>t.maxArgs)throw new Error(`Expected at most ${t.maxArgs} ${i(t.maxArgs)} for ${e}(), got ${r.length}`);return new Promise(((e,t)=>{const o=d.bind(null,{resolve:e,reject:t});r.push(o),n.sendMessage(...r)}))},m={devtools:{network:{onRequestFinished:c(g)}},runtime:{onMessage:c(u),onMessageExternal:c(u),sendMessage:p.bind(null,"sendMessage",{minArgs:1,maxArgs:3})},tabs:{sendMessage:p.bind(null,"sendMessage",{minArgs:2,maxArgs:3})}},h={clear:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}};return n.privacy={network:{"*":h},services:{"*":h},websites:{"*":h}},l(e,m,n)};e.exports=n(chrome)}}(Oe);var Ne,Re,browser=Me(Oe.exports);class $e{constructor(){this.isLocal=!0}log({level:e,message:t,timestamp:n,data:r,title:o}){let i;switch(e){case"debug":default:i="log";break;case"info":i="info";break;case"warn":i="warn";break;case"error":case"critical":case"fatal":i="error"}const s=o?`[${o}]`:"";void 0!==r?console[i](`[${n}] - ${$e.LOGGER_PREFIX} ${s} ${t}`,r):console[i](`[${n}] - ${$e.LOGGER_PREFIX} ${s} ${t}`)}}$e.LOGGER_PREFIX="[GFAdUnit] -",function(e){e.checkoutPopupShown="CHECKOUT-POPUP-SHOWN",e.checkoutPopupNotShown="CHECKOUT-POPUP-NOT-SHOWN",e.checkoutPopupSupressed="CHECKOUT-POPUP-SUPRESSED",e.checkoutPopupDonation="CHECKOUT-POPUP-DONATION",e.checkoutPopupFailedActivation="CHECKOUT-POPUP-FAILED-ACTIVATION",e.checkoutPopupPurchaseConfirmed="CHECKOUT-POPUP-PURCHASE-CONFIRMED",e.checkoutPopupHealthCheck="CHECKOUT-POPUP-HEALTH-CHECK",e.checkouPopupActivationFailed="CHECKOUT-POPUP-ACTIVATION-FAILED",e.checkoutPopupOfferDetailsClicked="CHECKOUT-POPUP-OFFER-DETAILS-CLICKED",e.checkoutPopupWhyAmISeeingThisClicked="CHECKOUT-POPUP-WHY-AM-I-SEEING-THIS-CLICKED",e.checkoutPopupLooserExtension="CHECKOUT-POPUP-LOOSER-EXTENSION",e.checkoutPopupActiveDomain="CHECKOUT-POPUP-ACTIVE-DOMAIN",e.checkoutPopupSiteMatches="CHECKOUT-POPUP-SITE-MATCHES",e.checkoutPopupMerchantInResultsFound="CHECKOUT-MERCHANT-IN-RESULTS-FOUND"}(Ne||(Ne={})),function(e){e.adUnitLog="ADUNIT-LOG"}(Re||(Re={}));const He=["debug","info","warn","error","critical","fatal"];class _e{constructor(e){this.config={minLevel:e?.minLevel??"debug",enabled:e?.enabled??!1,transports:e?.transports??[new $e],title:e?.title??""}}static getInstance(e){return _e.instance||(_e.instance=new _e(e)),_e.instance}configure(e){this.config={...this.config,...e}}shouldLog(e){return!!this.config.enabled&&He.indexOf(e)>=He.indexOf(this.config.minLevel)}createLogMessage(e,t,n){return{level:e,version:"1.17.4",message:t,timestamp:(new Date).toISOString(),data:n,title:this.config.title}}log(e,t,n,r){if(!this.shouldLog(e))return;const o=this.createLogMessage(e,t,r);this.config.transports.filter((e=>!n||e.isLocal)).forEach((e=>e.log(o)))}debug(e,t,n=!1){this.log("debug",e,n,t)}info(e,t,n=!1){this.log("info",e,n,t)}warn(e,t,n=!1){this.log("warn",e,n,t)}error(e,t,n=!1){this.log("error",e,n,t)}critical(e,t,n=!1){this.log("critical",e,n,t)}fatal(e,t,n=!1){this.log("fatal",e,n,t)}addTransport(e){this.config.transports.push(e)}clearTransports(){this.config.transports=[]}disable(){this.config.enabled=!1}enable(){this.config.enabled=!0}}const Ue=3,Fe=e=>1e3*e,Be=browser;async function Ge(e,t){return await Be.runtime.sendMessage(e)}async function je(e,t,n){return async function(e,t={}){const{maxAttempts:n=Ue,delayFn:r=Fe}=t;let o=null;for(let t=1;t<=n;t+=1)try{return await e()}catch(e){o=e,t<n&&await new Promise((e=>{setTimeout(e,r(t))}))}throw o&&t.logger&&t.operationName&&t.logger.error(`Operation ${t.operationName} failed after ${n} attempts.`,o,!0),o||new Error("Operation failed after multiple attempts")}((()=>Ge(e)),{maxAttempts:Ue,delayFn:Fe})}const We="GF_TRACK_EVENT",Ke="GF_HIDE_POPUP",qe="GF_GET_POPUP_CONFIG",ze="GF_IS_ACTIVE_DOMAIN",Ve="GF_LOG_MERCHANTS_IN_SEARCH_RESULTS",Ye="GF_SHOULD_STAND_DOWN",Xe="GF_ACTIVATE_OFFER",Ze="GF_STORE_SHOPIFY_SHOP_ID",Je="GF_GET_DOMAIN_BY_SHOP_ID",Qe="GF_GET_LANGUAGE_CONTENT",et="countryCode",tt="gf_ad_event_history",nt={ein:"0",tpi:"0"},rt="GIVE_FREELY_",ot={async get(e){const t=`${rt}${e}`;return(await browser.storage.local.get(t))[t]||null},async set(e,t){const n=`${rt}${e}`;await browser.storage.local.set({[n]:t})},async remove(e){const t=Array.isArray(e)?e.map((e=>`${rt}${e}`)):`${rt}${e}`;await browser.storage.local.remove(t)}},it=()=>String("1.17.4");class st{constructor(e,t,n,r=60){this.track=async(e,t,n,r=!1,o=!1)=>{const i={partner:`adUnit_${this._partnerApiKey}`,eventType:e,eventData:{userId:r?void 0:this._userService?.user?.id,libVersion:it(),wfDeviceId:t,...n}};try{const e=JSON.stringify(i,((e,t)=>t instanceof Error?{name:t.name,message:t.message,stack:t.stack}:t)),t=await this.getEventsUrl();return t?await this.BroadcastEvent(t,e,i,o):(this._logger.info("Cant broadcast event. eventsUrl cant be retrieved from config",i,!0),!1)}catch(e){return this._logger.error("Something unexpected happened when dispatching a gf event",{error:e,event:i},!0),!1}},this.getEventsHistory=async()=>{const e=await ot.get(tt),t=(e=>{const t=new Date;return t.setTime(t.getTime()+60*e*1e3),t.getTime()})(-this._debounceWindowInMinutes),n=(e||[]).filter((e=>e.createdAt>t));return await ot.set(tt,n),n},this.shouldBroadcastEvent=async(e,t)=>!!t||!(await this.getEventsHistory()).some((t=>t.payload===e)),this.pushEventToHistory=async e=>{const t=await this.getEventsHistory();t.push({createdAt:Date.now(),payload:e}),await ot.set(tt,t)},this._partnerApiKey=e,this._userService=t,this._debounceWindowInMinutes=r,this._logger=_e.getInstance({title:"Analytics"}),this._configService=n}async BroadcastEvent(e,t,n,r){if(await this.shouldBroadcastEvent(t,r)){const r=await fetch(e,{headers:{"Content-Type":"application/json"},method:"POST",body:t,cache:"no-store"});return r.ok?(await this.pushEventToHistory(t),!0):(this._logger.error("Something unexpected happened when dispatching an event",{status:r.status,statusText:r.statusText,event:n},!0),!1)}return this._logger.info("This event has already been broadcasted during the past hour",n,!0),!1}async getEventsUrl(){const e=await this._configService.getCachedConfig();return e?.eventsUrl}}function at(e,t,n){return e?{...t,...n}:t}st.trackEvent=async(e,t,n=!1,r=!1)=>{await Ge({type:We,payload:{eventType:e,eventData:t,anonymous:n,skipThrottling:r}})};var lt=H("<a href=#!>"),ct=H("<button class=give-freely-close-button aria-label=Close>×"),gt=H('<div><div><div></div></div><div></div><div><div><div><span></span></div><button aria-label="Don\'t show again"><span></span></button></div></div><div><p><span></span></p><a class=give-freely-footer-link target=_blank rel="noopener noreferrer"><span>'),ut=H("<div><div><img><span></span></div><button><span>"),dt=H("<div>"),pt=H("<div><span>");const mt=e=>({hasBackdrop:!!e.containerStyle?.backdropColor||!!e.containerStyle?.showAsModal,clickAction:e.containerStyle?.clickAction??"hide-opacity"});function ht(e){const[t,n]=u(!1),[r,o]=u(null),i=t=>{const{hasBackdrop:n,clickAction:r}=mt(e.checkoutPopupConf);n&&"donate"===r&&t.stopPropagation()},s=()=>{const{hasBackdrop:t,clickAction:n}=mt(e.checkoutPopupConf);t&&"ignore"!==n&&("donate"===n?c(nt,!0):e.setBackdropHidden(!0))};p((()=>{window.addEventListener("click",s),e.mainContainerRef?.addEventListener("click",i),A((()=>{setTimeout((()=>{window.removeEventListener("click",s),e.mainContainerRef?.removeEventListener("click",i)}),500)}))}));const a=Se(),l=(()=>{const e=v(ke)();if(!e)throw new Error("Content provider context is undefined");return()=>e.getAllCharities()})();p((()=>{t()&&e.dialogRef&&e.dialogRef.scroll({top:e.dialogRef.offsetHeight,behavior:"smooth"})})),p((()=>{const t=r();t&&e.onCharitySelect(t.charity,t.closeOnDonation?e.checkoutPopupConf.checkoutPopupActivateAndCloseSkipSuccess:void 0)}));const c=(e,t)=>o({charity:e,closeOnDonation:t}),g=()=>!!r()?.charity;return[(f=gt(),x=f.firstChild,b=x.firstChild,y=x.nextSibling,w=y.nextSibling,C=w.firstChild,k=C.firstChild,P=k.firstChild,S=k.nextSibling,T=S.firstChild,E=w.nextSibling,L=E.firstChild,D=L.firstChild,I=L.nextSibling,M=I.firstChild,G(x,N(R,{get when(){return e.checkoutPopupConf.checkoutPopupActivateAndClose},get children(){var e=lt();return e.$$click=()=>c(nt,!0),d((t=>{var n=at(g(),ee,te),r=a("main.activateAndClose.v2");return t.e=F(e,n,t.e),r!==t.t&&(e.innerHTML=t.t=r),t}),{e:void 0,t:void 0}),e}}),null),G(x,N(R,{get when(){return e.checkoutPopupConf.checkoutPopupMainCloseButtonVisible&&!e.checkoutPopupConf.checkoutPopupActivateAndClose},get children(){var t=ct();return t.$$click=()=>e.onClose(),d((e=>F(t,Q,e))),t}}),null),G(y,N(Ce,{get title(){return a("main.subTitle.v2")},get activeDomain(){return e.activeDomain}})),G(w,(()=>l().reduce(((t,n)=>{var r,o,i,s,l,u,p;return n?.title&&""!==n?.title?t.push((i=(o=ut()).firstChild,s=i.firstChild,l=s.nextSibling,u=i.nextSibling,p=u.firstChild,o.$$click=()=>!g()&&c(n),G(o,(r=m((()=>!!(n.decorator&&n.decoratorLeftStyle&&n.decoratorRightStyle))),()=>{return r()&&[(t=dt(),d((e=>{var r=n.decoratorLeftStyle,o=n.decorator;return e.e=F(t,r,e.e),o!==e.t&&(t.innerHTML=e.t=o),e}),{e:void 0,t:void 0}),t),(e=dt(),d((t=>{var r=n.decoratorRightStyle,o=n.decorator;return t.e=F(e,r,t.e),o!==t.t&&(e.innerHTML=t.t=o),t}),{e:void 0,t:void 0}),e)];var e,t}),i),i.style.setProperty("text-align","center"),i.style.setProperty("display","flex"),i.style.setProperty("flex-direction","column"),i.style.setProperty("align-items","center"),i.style.setProperty("gap","7px"),d((t=>{var r=at(g(),oe,{cursor:"default"}),i=n.logo,c=se,d=n.title,m=n.title,h=at(g(),{...ae,"background-color":e.checkoutPopupConf?.checkoutPopupSelectCharityButtonBgColor||"#0052FF"},ie),f=g(),A=`Select charity: ${n.title}`,v=a("main.charitySelect");return t.e=F(o,r,t.e),i!==t.t&&U(s,"src",t.t=i),t.a=F(s,c,t.a),d!==t.o&&U(s,"alt",t.o=d),m!==t.i&&(l.innerHTML=t.i=m),t.n=F(u,h,t.n),f!==t.s&&(u.disabled=t.s=f),A!==t.h&&U(u,"aria-label",t.h=A),v!==t.r&&(p.innerHTML=t.r=v),t}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),o)):e.logger.error(`Translation was not found for EIN ${n?.ein}`),t}),[])),C),C.$$click=()=>!g()&&e.onSuppress(),k.style.setProperty("text-align","center"),k.style.setProperty("display","flex"),k.style.setProperty("align-items","center"),L.$$click=()=>{e.onOfferDetailsClick(!t()),n(!t())},I.$$click=()=>{st.trackEvent(Ne.checkoutPopupWhyAmISeeingThisClicked,{domain:globalThis.window.location.hostname})},G(f,(h=m((()=>!!e.checkoutPopupConf.checkoutPopupDisplayNameInFooter)),()=>{return h()&&(e=pt(),t=e.firstChild,d((n=>{var r=pe,o=a("main.footer");return n.e=F(e,r,n.e),o!==n.t&&(t.innerHTML=n.t=o),n}),{e:void 0,t:void 0}),e);var e,t}),null),d((t=>{var n=X,r=Z,o={...J,"font-weight":800},i=a("main.title.v2"),s=ne,l=re,c=at(g(),oe,{cursor:"default"}),u=a("main.sixthBox"),d=at(g(),{...ae,"background-color":e.checkoutPopupConf.checkoutPopupSelectCharityButtonBgColor||"#0052FF"},ie),p=g(),m=a("main.settings.v2"),h=de,A=he,v=a("main.offerDetails"),k=me,O=e.checkoutPopupConf.externalUrls.giveFreelyWhyAmISeeingThis,N=a("main.whyAmISeeingThis");return t.e=F(f,n,t.e),t.t=F(x,r,t.t),t.a=F(b,o,t.a),i!==t.o&&(b.innerHTML=t.o=i),t.i=F(y,s,t.i),t.n=F(w,l,t.n),t.s=F(C,c,t.s),u!==t.h&&(P.innerHTML=t.h=u),t.r=F(S,d,t.r),p!==t.d&&(S.disabled=t.d=p),m!==t.l&&(T.innerHTML=t.l=m),t.u=F(E,h,t.u),t.c=F(L,A,t.c),v!==t.w&&(D.innerHTML=t.w=v),t.m=F(I,k,t.m),O!==t.f&&U(I,"href",t.f=O),N!==t.y&&(M.innerHTML=t.y=N),t}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0}),f),N(R,{get when(){return t()},get children(){return N(Ie,{get merchantName(){return e.activeDomain.Merchant.Name},get extensionName(){return e.checkoutPopupConf.displayName},get termsUrl(){return e.checkoutPopupConf.externalUrls.giveFreelyTermsAndConditions},get parsedMaxRate(){return m((()=>!!e.activeDomain.Merchant.MaxRate))()?ye(e.activeDomain.Merchant.MaxRate.Kind,e.activeDomain.Merchant.MaxRate?.Amount):null},get merchantRateDetail(){return e.merchantRates},onClose:()=>n(!1)})}})];var h,f,x,b,y,w,C,k,P,S,T,E,L,D,I,M}_(["click"]);var ft=H("<button class=give-freely-close-button aria-label=Close>×"),At=H("<label class=give-freely-radio-option><input type=radio name=gf-rad-goodbye value=18250><span>"),vt=H('<div><div><div><span></span></div></div><button class=give-freely-back-button aria-label="Back to charity selection"><span></span></button><hr><div id=give-freely-goodbye-screen-options><label class=give-freely-radio-option><input type=radio name=gf-rad-goodbye value=1><span></span></label><label class=give-freely-radio-option><input type=radio name=gf-rad-goodbye value=7><span></span></label><label class=give-freely-radio-option><input type=radio name=gf-rad-goodbye value=30><span></span></label><label class=give-freely-radio-option><input type=radio name=gf-rad-goodbye value=90><span></span></label></div><button class=give-freely-submit-button><span>');function xt(e){const[t,n]=u(0),r=Se();return o=vt(),i=o.firstChild,s=i.firstChild,a=s.firstChild,l=i.nextSibling,c=l.firstChild,g=l.nextSibling.nextSibling,m=(p=g.firstChild).firstChild,h=m.nextSibling,A=(f=p.nextSibling).firstChild,v=A.nextSibling,b=(x=f.nextSibling).firstChild,y=b.nextSibling,C=(w=x.nextSibling).firstChild,k=C.nextSibling,P=g.nextSibling,S=P.firstChild,o.style.setProperty("font-size","14px"),G(i,N(R,{get when(){return e.checkoutPopupConf.checkoutPopupSupressCloseButtonVisible},get children(){var t=ft();return t.$$click=()=>e.onGoodbye(0),d((e=>F(t,Q,e))),t}}),null),l.$$click=()=>e.onBack(),m.addEventListener("change",(()=>n(1))),A.addEventListener("change",(()=>n(7))),b.addEventListener("change",(()=>n(30))),C.addEventListener("change",(()=>n(90))),G(g,N(R,{get when(){return e.checkoutPopupConf.checkoutPopupNeverSuppressionAllowed},get children(){var e=At(),t=e.firstChild,o=t.nextSibling;return t.addEventListener("change",(()=>n(18250))),d((t=>{var n=ce,i=r("suppress.suppressionPeriodNever");return t.e=F(e,n,t.e),i!==t.t&&(o.innerHTML=t.t=i),t}),{e:void 0,t:void 0}),e}}),null),P.$$click=()=>{const n=t();n&&(e.onGoodbye(n),e.setScreen("main"))},d((t=>{var n={...Z,"flex-direction":"row"},o={...J,"margin-top":"20px"},u=r("suppress.title"),d=ue,m=r("suppress.backButton"),A=le,b=ce,C=r("suppress.suppressionPeriod").replace("{0}","1"),T=ce,E=r("suppress.suppressionPeriodPlural").replace("{0}","7"),L=ce,D=r("suppress.suppressionPeriodPlural").replace("{0}","30"),I=ce,M=r("suppress.suppressionPeriodPlural").replace("{0}","90"),O={...ae,"font-weight":"700","margin-top":"10px","margin-bottom":"0px","background-color":e.checkoutPopupConf.checkoutPopupSelectCharityButtonBgColor||"#0052FF",width:"100px"},N=r("suppress.submitButton");return t.e=F(i,n,t.e),t.t=F(s,o,t.t),u!==t.a&&(a.innerHTML=t.a=u),t.o=F(l,d,t.o),m!==t.i&&(c.innerHTML=t.i=m),t.n=F(g,A,t.n),t.s=F(p,b,t.s),C!==t.h&&(h.innerHTML=t.h=C),t.r=F(f,T,t.r),E!==t.d&&(v.innerHTML=t.d=E),t.l=F(x,L,t.l),D!==t.u&&(y.innerHTML=t.u=D),t.c=F(w,I,t.c),M!==t.w&&(k.innerHTML=t.w=M),t.m=F(P,O,t.m),N!==t.f&&(S.innerHTML=t.f=N),t}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0}),o;var o,i,s,a,l,c,g,p,m,h,f,A,v,x,b,y,w,C,k,P,S}_(["click"]);var bt=H("<div><p><span>"),yt=H("<div><div><div><span></span></div><button class=give-freely-close-button aria-label=Close>×</button></div><hr><div><span>");function wt(e){const[t,n]=u(null),r=Se();let o;return A((()=>clearInterval(o))),f((()=>{e.failedDonation||(()=>{const t=e.checkoutPopupConf.checkoutPopupDonationSuccessAutoCloseInSeconds??3;n(t),o=setInterval((()=>{n((t=>null===t||t<=1?(clearInterval(o),e.onClose(),0):t-1))}),1e3)})()})),i=yt(),s=i.firstChild,a=s.firstChild,l=a.firstChild,c=a.nextSibling,g=s.nextSibling.nextSibling,p=g.firstChild,i.style.setProperty("font-size","14px"),c.$$click=()=>e.onClose(),g.style.setProperty("padding","30px"),g.style.setProperty("height","150px"),g.style.setProperty("font-size","14px"),G(i,N(R,{get when(){return!e.failedDonation},get children(){var e=bt(),n=e.firstChild,o=n.firstChild;return d((e=>{var i=ge,s=Te.formatMessage(r("donate.autoClosing"),t()??0);return e.e=F(n,i,e.e),s!==e.t&&(o.innerHTML=e.t=s),e}),{e:void 0,t:void 0}),e}}),null),d((t=>{var n={...Z,"flex-direction":"row"},o={...J,"margin-top":"20px"},i=e.failedDonation?r("donate.failTitle"):r("donate.title"),g=Q,u=e.failedDonation?r("donate.failContent"):r("donate.content");return t.e=F(s,n,t.e),t.t=F(a,o,t.t),i!==t.a&&(l.innerHTML=t.a=i),t.o=F(c,g,t.o),u!==t.i&&(p.innerHTML=t.i=u),t}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),i;var i,s,a,l,c,g,p}_(["click"]);var Ct=H("<dialog popover=manual><div>");function kt(e){const[t,n]=u("main"),[r,o]=u(),[i,s]=u(!1),[a,l]=u(!1);let c;p((()=>{c&&(e.checkoutPopupConf.containerStyle?.showAsModal?c.showModal():c.showPopover(),c.focus(),c.blur())}));const g=()=>{e.logger.debug("Close button clicked"),e.onClose()},m=async(t,r=!1)=>{r&&e.onClose(),e.logger.info("Charity selected",{charity:t,domain:e.activeDomain.Domain}),o(t);const i=await e.onDonate(t,e.activeDomain);r?e.onClose():(s(!i),n("donate"))},h=()=>{e.logger.debug("Suppress button clicked"),n("goodbye")},f=()=>{e.logger.debug("Navigating back to main screen"),n("main")},A=t=>{e.logger.info("User chose to hide popup",{days:t}),e.onClose(t)};let v;return x=Ct(),b=x.firstChild,"function"==typeof c?B(c,x):c=x,"function"==typeof v?B(v,b):v=b,G(b,N(R,{get when(){return"main"===t()},get children(){return N(ht,{setBackdropHidden:l,mainContainerRef:v,dialogRef:c,get checkoutPopupConf(){return e.checkoutPopupConf},get activeDomain(){return e.activeDomain},get merchantRates(){return e.merchantRates},onClose:g,onCharitySelect:m,onSuppress:h,get onOfferDetailsClick(){return e.onOfferDetailsClick},get logger(){return e.logger}})}}),null),G(b,N(R,{get when(){return"goodbye"===t()},get children(){return N(xt,{get checkoutPopupConf(){return e.checkoutPopupConf},onClose:()=>e.onClose(),onBack:f,onGoodbye:A,setScreen:n})}}),null),G(b,N(R,{get when(){return"donate"===t()},get children(){return N(wt,{get checkoutPopupConf(){return e.checkoutPopupConf},get selectedCharity(){return r()},onClose:()=>e.onClose(),get failedDonation(){return i()},setScreen:n})}}),null),d((t=>{var n,r,o=a()?"backdrop-hidden":"",i={...V,...e.checkoutPopupConf.containerStyle?.customStyle??{}},s=e.elementId,l=Y;return o!==t.e&&(n=x,null==(r=t.e=o)?n.removeAttribute("class"):n.className=r),t.t=F(x,i,t.t),s!==t.a&&U(x,"id",t.a=s),t.o=F(b,l,t.o),t}),{e:void 0,t:void 0,a:void 0,o:void 0}),x;var x,b}function Pt(e){const t=["",".asp",".aspx",".php",".js",".htm",".html"],n=["cart","checkout","shopping-bag","shopping-basket","shopping-cart","basket"].flatMap((e=>t.map((t=>e+t)))).filter((e=>"basket"!==e)),r=["tote-cart","tote.cart"],o=e,i=n.filter((e=>o.includes(e))),s=o.split("/");return!s.some((e=>r.some((t=>e.includes(t)))))&&(s.some((e=>n.some((t=>e.startsWith(t)||e.endsWith(t)))))||"basket"===s[s.length-1].toLowerCase()||i.length>1||1===i.length&&o.includes("shopping"))}function St(e,t){const n=["book"];return e.split("/").some((e=>n.some((t=>e.startsWith(t)||e.endsWith(t)))))&&null!=t.evaluate("//*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6][contains(., 'Your Reservation') or contains(., 'Your reservation')]",t,null,XPathResult.ANY_TYPE,null)?.iterateNext()}async function Tt(e){try{const t=await Ge({type:Je,payload:{shopId:e}});return t.payload.found&&t.payload.domain?t.payload.domain:null}catch{return null}}function Et(e){try{const e=Array.from(document.querySelectorAll("script"));for(const t of e){if(t.dataset?.shopId&&(t.dataset?.shopId?.startsWith("gid")||t.src.includes("shopify"))){const e=parseInt(t.dataset.shopId.replace("gid://shopify/Shop/",""));if(!Number.isNaN(e)&&e>0)return e}const e=t.textContent||"";if(e.includes("ShopifyAnalytics")&&e.includes("shopId")){const t=e.match(/shopId['"]*:\s*['"]*(\d+)['"]*[,}]/);if(t&&t[1]){const e=parseInt(t[1]);if(!Number.isNaN(e)&&e>0)return e}}}const t=document.querySelector("[data-shop-id]");if(t instanceof HTMLElement){const{shopId:e}=t.dataset;if(e){const t=parseInt(e);if(!Number.isNaN(t)&&t>0)return t}}const n=window?.ShopifyAnalytics?.lib?.trekkie?.defaultAttributes?.shopId;return n&&parseInt(n)||0}catch(t){return e.error("Error accessing ShopifyAnalytics:",t),0}}function Lt(){try{if(!window.location.href.startsWith("https://shop.app"))return 0;const e=document?.head?.querySelector('meta[name="store"][content]');if(!e)return 0;try{const t=JSON.parse(e.content);return t?.id||0}catch{return 0}}catch{return 0}}const Dt=_e.getInstance();function It(e,t,n){try{Dt.debug("Checking merchant regex rules",{currentUrl:t});const r=e.merchantPopupRules.filter((e=>n===e.domain||n.endsWith(`.${e.domain}`)));if(0===r.length)return Dt.debug("No matching merchant rules found for domain",{currentUrl:t}),!1;for(const e of r)for(const n of e.rules)try{if(new RegExp(n.rule).test(t))return Dt.debug("Merchant regex rule matched",{merchant:e.name,rule:n.rule,currentUrl:t}),!0}catch(t){Dt.error("Invalid regex in merchant rule",{merchant:e.name,rule:n.rule,error:t})}return Dt.debug("No matching regex rules found",{currentUrl:t}),!1}catch(e){return Dt.error("Error in merchantRegexRule",e),!1}}function Mt(e){if(e?.customLanguageDetection&&e.customLanguageDetection.length>0){const t=window.location.href,n=document.body.textContent?.toLowerCase()||"";for(const r of e.customLanguageDetection)try{if(new RegExp(r.urlPattern).test(t))for(const[e,t]of Object.entries(r.keywords))if(n.includes(e.toLowerCase()))return t}catch(e){_e.getInstance().warn(`Invalid regex pattern in customLanguageDetection: ${r.urlPattern}`,e)}}const t=document.documentElement.lang,n=document.querySelector('meta[http-equiv="Content-Language"]')?.content,r=document.querySelector('link[rel="alternate"][hreflang]')?.getAttribute("hreflang"),o=navigator.language,i=t||n||r||o||"en";return"string"==typeof i?i.split("-")[0]:"en"}function Ot(e){return!0!==e.checkoutPopupOnlyShowLanguageMatch||"en"===Mt(e)}const Nt=(e,t=!1)=>e.length<2&&t?null:Array.from(e).filter((e=>!t||e.dataset.extensionId!==browser.runtime.id)).map((e=>e.dataset.extensionName)).join(",");const Rt=e=>{const t=m((()=>({translate:e.translate()||(e=>""),getAllCharities:e.charities()||(()=>[])})));return N(ke.Provider,{value:t,get children(){return e.children}})},$t=_e.getInstance();var Ht=H("<div class=gf-app>");function _t(e){const[t,n]=u(void 0),[r,o]=u(!1),[i,s]=u([]),[a,l]=u(),[c,g]=u({});let d;f((async()=>{e.logger.info("Mounting GfApp component");try{!function(e){if(!e?.shouldCheckSiteMatches)return;let t;(e?.siteMatchesRegex??[]).some((e=>{var n;return n=window.location.href,!(!new RegExp(e).test(n)||(t=e,0))}))&&t&&st.trackEvent(Ne.checkoutPopupSiteMatches,{url:window.location.href,matchedRule:t,uts:Date.now()},!0)}(e.popupConfig);const r=Mt(e.popupConfig);x(r);const i=it();if(e.popupConfig.minVersion&&((e,t)=>{if(e===t)return!1;const n=e.split(".").map((e=>parseInt(e,10))),r=t.split(".").map((e=>parseInt(e,10)));for(let e=0;e<n.length;e++){if(n[e]<r[e])return!0;if(n[e]>r[e])return!1}return!1})(i,e.popupConfig.minVersion))return void e.logger.debug(`Current version: ${i}. Minimum version ${e.popupConfig.minVersion} not met`);const a=await(async()=>await ot.get(et)||(async()=>{$t.debug("detecting country");const e={method:"GET",headers:{"Content-Type":"application/json",Authorization:"Basic OTEzOTkxOnFlYmpaWF9DOGNRY0lxSHA4WTVjNGxzU1pRSlM2VW9MMExzTF9tbWs="}};try{const t=await fetch("https://geoip.maxmind.com/geoip/v2.1/country/me",e);if($t.debug("Received geolocation response",{status:t.status}),!t.ok)return void $t.error("Failed to get geolocation data",{status:t.status,statusText:t.statusText});const n=await t.json();if(!n)throw new Error("There was an error fetching geoip look up");return await ot.set(et,n.country.iso_code),n.country.iso_code}catch(e){return void $t.error("Failed to get geolocation data",{error:e},!0)}})())()??"us",l=e.popupConfig.charities[a.toLowerCase()]??e.popupConfig.charities.us;if(g(l||{}),e.logger.debug("Charities for current country",{currentCountry:a,charities:l}),!1===e.popupConfig.checkoutPopupMasterSwitch)return void e.logger.debug("Checkout popup master switch is disabled");const c=document.getElementsByClassName("give-freely-root");let u=!1;c.length>1&&(e.logger.debug("There is more than one gf extension installed"),c.item(0).dataset.extensionId!==browser.runtime.id&&(e.logger.debug("Giving preference to the first gf extension injected in the DOM"),u=!0),e.logger.debug("Providing this extension preference over the other installed extensions"));const{domain:p,rates:m}=await(async e=>{const{hostname:t}=window.location;e.debug("Checking if domain is active",{hostname:t});const n=await Ge({type:ze,payload:{hostname:t}});return n.payload.isActive?(e.debug("Active domain",{domain:n.payload.domain}),e.debug("Merchant rates",{rates:n.payload.rates}),e.info("Domain and rates ({})ed successfully."),{isActive:!0,domain:n.payload.domain,rates:n.payload.rates}):{isActive:!1,domain:void 0,rates:[]}})(e.logger);if(s(m),n(p),p)await function(e,t){const n=Et(t)||Lt();return n>0&&function(e,t,n){if(e&&!(e<=0))try{Ge({type:Ze,payload:{shopId:e,domain:t}}).catch((e=>{n.error("Error sending shop ID to background:",e)}))}catch(e){n.error("Error sending Shopify shop ID:",e)}}(n,e,t),n}(p,e.logger);else{if("shop.app"!==window.location.hostname&&!window.location.hostname.endsWith(".shop.app"))return void o(!1);const t=window.location.pathname.split("/")[2];if(!t)return e.logger.error("Shop ID not found"),void o(!1);const r=await Tt(parseInt(t));if(!r)return e.logger.error("Shop domain not found"),void o(!1);e.logger.debug("Shop domain found",{shopDomain:r}),n(r)}const h=await(async e=>{const t=await ot.get("popup_hide");if(!t)return e.debug("No expiry found in storage"),!1;const{popupHide:n}=t,r=!!n&&Date.now()<n;return e.debug("Is AdUnit Muted?",{isMuted:r,expiry:n}),r})(e.logger);if(h)return;if(!t())return void o(!1);const f=await(async(e,t)=>{const{Domain:n}=t,r=window.location.href,{payload:o}=await Ge({type:Ye,payload:{activeDomain:n,url:r}});return!!o.result&&(e.info("Stand Down detected"),!0)})(e.logger,t());if(f)return void o(!1);const A=e.popupConfig?.anonymousActiveDomainLogging??!1,v=t()??void 0;v&&A&&!function(e){const t=`gfhv-${e}`;return!!sessionStorage.getItem(t)||(sessionStorage.setItem(t,"true"),!1)}(v.Domain)&&st.trackEvent(Ne.checkoutPopupActiveDomain,{url:v.Domain}),d=window.setInterval((async()=>{e.logger.debug("Checking checkout rules");const t=await(async e=>{const t=_e.getInstance();t.configure({enabled:!0,title:"Content - checkoutRulesTest"});const n=new URL(globalThis.location.href),r=n.href,{hostname:o}=n;t.debug("Checking if popup should be shown",{currentUrl:r});const i=await async function(e){const t=Et(e)||Lt();return!("shop.app"!==window.location.hostname&&!window.location.hostname.endsWith(".shop.app")||!(t>0)||!await Tt(t))}(t),s=Ot(e)&&(Pt(n.pathname.toLowerCase())||St(r,document)||It(e,r,o)||i);return t.debug("Popup show decision based on rules",{shouldShow:s,matchesCartRule:Pt(n.pathname.toLowerCase()),matchesBookingRule:St(r,document),matchesShopPayRule:i,matchesMerchantRegexRule:It(e,r,o),matchesLanguageRule:Ot(e)}),s})(e.popupConfig);if(t&&u)return st.trackEvent(Ne.checkoutPopupLooserExtension,{url:globalThis.window.location.href,winner:c.item(0).dataset.extensionName}),e.logger.debug("Standing down because, another ad-unit extension will pop"),void clearInterval(d);o(t),t&&(e.logger.debug("Should show popup based on checkout rules",{shouldShowResult:t}),st.trackEvent(Ne.checkoutPopupShown,{url:globalThis.window.location.href,pageLanguage:r,merchantId:v?.Merchant?.ID,looserCompetingExtensions:Nt(c,!0)}))}),2e3)}catch(t){o(!1),e.logger.error("An error occurred in GfApp",{error:t})}})),A((()=>{d&&window.clearInterval(d)}));const p=async(t,n)=>{e.logger.info("Processing donation",{charity:t,domain:n.Domain});const r=await(async(e,t,n,r)=>{e.debug("Activating offer",{activeDomain:t,selectedCharity:r});const o=await je({type:Xe,payload:{activeDomain:t,originalUrl:n,selectedCharity:r}});return e.debug("Activate offer response",{response:o}),o})(e.logger,n,window.location.href,{ein:t.ein,thirdPartyId:t.tpi});return e.logger.debug("Activate offer response",{activationResponse:r}),st.trackEvent(r.payload.response?Ne.checkoutPopupDonation:Ne.checkoutPopupFailedActivation,{activeDomain:n.Domain,url:globalThis.window.location.href,merchantId:n?.Merchant?.ID,charity:{ein:t.ein,tpi:t.tpi},rate:n.Merchant.MaxRate}),r.payload.response},h=async t=>{o(await(async(e,t)=>{try{e.info("Hiding ad",{days:t});const n=await je({type:Ke,payload:{days:t??0}});return void 0!==t&&st.trackEvent(Ne.checkoutPopupSupressed,{url:globalThis.window.location.href,days:t}),e.info("Hiding ad response",{hideResponse:n}),n.payload.ack?(e.debug("Ad hidden successfully"),!1):(e.warn("Failed to hide ad"),!0)}catch{return!1}})(e.logger,t)),d&&window.clearInterval(d)},v=async e=>{st.trackEvent(Ne.checkoutPopupOfferDetailsClicked,{action:e?"opened":"closed"})},x=async t=>{e.logger.debug("Getting translation provider",{currentLanguage:t});const{translations:n,charities:r}=await async function(e,t){try{t&&t.debug("Getting language content",{languageCode:e});const n=await Ge({type:Qe,payload:{lang:e}});return{translations:n.payload.translations,charities:n.payload.charities}}catch(n){return t&&t.error("Error getting language content",{error:n,languageCode:e}),{translations:null,charities:null}}}(t,e.logger),o={translate:e=>n&&n[e]?n[e]:"",getAllCharities:()=>{const e=c();return Object.entries(e).map((([e,t])=>{const{ein:n}=t;try{const o=r?.[n];if(!o)throw new Error(`Failed to find charity metadata for ein ${n}`);return{ein:n,tpi:o.tpi,title:o.title,order:parseInt(e,10),logo:o.logo,decorator:t.decorator,decoratorLeftStyle:t.decoratorLeftStyle,decoratorRightStyle:t.decoratorRightStyle}}catch{return{ein:n,tpi:"",title:"",order:9,logo:""}}}))}};e.logger.debug("Setting content provider with translations and charity functions"),l((()=>o))};return N(Rt,{translate:()=>a()?.translate,charities:()=>a()?.getAllCharities,get children(){var n,o=Ht();return G(o,(n=m((()=>!(!t()||!r()))),()=>n()&&N(kt,{get checkoutPopupConf(){return e.popupConfig},elementId:"give-freely-checkout-popup",get activeDomain(){return t()},get merchantRates(){return i()},onClose:h,onDonate:p,onOfferDetailsClick:v,get logger(){return e.logger}}))),o}})}async function Ut(){const e=`give-freely-root-${browser.runtime.id}`;if(document.getElementById(e))return;const t=document.createElement("div");t.id=e,t.className="give-freely-root",t.style.display="block",t.dataset.extensionId=browser.runtime.id,t.dataset.extensionName=browser.runtime.getManifest().name||browser.runtime.id,document.body.appendChild(t);const n=t.attachShadow({mode:"open"}),r=document.createElement("div"),s=_e.getInstance(),l=await(async()=>{const e=await Ge({type:qe,payload:{}});if(!e.payload.config)throw new Error("No checkout popup config found");return e.payload.config})();if(!l)return void s.error("No ad unit config found");s.configure({enabled:l.checkoutPopupLoggerEnabled??!0,title:"Content - GfAdUnit",minLevel:l.checkoutPopupMinLogLevel??"error"});const c=(g=l.containerStyle?.backdropColor,`\n :host {\n all: initial;\n }\n\n .gf-scroll-remove::-webkit-scrollbar {\n border-radius-bottom-right: 15px;\n }\n\n button {\n cursor: pointer;\n transition: transform 0.1s ease;\n }\n\n button:active {\n transform: scale(0.98);\n }\n\n .give-freely-close-button:hover {\n opacity: 0.7;\n }\n\n input[type="radio"] {\n margin-right: 8px;\n }\n\n hr {\n border: none;\n border-top: 1px solid #e5e5e5;\n margin: 1em 0;\n }\n\n @media (max-width: 600px), (max-height: 480px) {\n #give-freely-checkout-popup {\n display: none !important;\n }\n }\n\n dialog::backdrop {\n background-color: ${g||"revert"};\n }\n\n dialog.backdrop-hidden::backdrop {\n background-color: transparent;\n }\n`);var g;const u=document.createElement("style");u.textContent=c,n.appendChild(u),n.appendChild(r),l.countAppearances&&async function(e){try{const t=globalThis.window.location.href,n=/^https?:\/\/(?:www\.)?google\.[a-z]{2,}(\.[a-z]{2})?\/search\?(?:.*&)?q=[^&]+(?:&.*)?$/.test(t);if(e.debug("Is a Google search result page?",n),!n)return!1;const r=(()=>{const e=globalThis.window.document.querySelectorAll("#rso > div, #tads > div"),t=[];return e.forEach((e=>{const n=(e=>{const t=null!==e.querySelector('[data-text-ad="1"]'),n=e.querySelector('span:not(.a-no-hover-link):is(:where(*, [role="text"]))'),r=n&&(n.textContent?.includes("Sponsored")||n.textContent?.includes("Ad"));return t||(r??!1)})(e),r=e.querySelector('.yuRUbf a, .MjjYud a, a[jsname="UWckNb"], a[data-pcu]');if(r){let e=r.href;if(e&&e.includes("/url?q="))try{const t=new URLSearchParams(new URL(e).search).get("q");t&&(e=t)}catch{}e&&e.startsWith("http")&&t.push({url:e,isSponsored:n??!1})}})),t})();if(e.info("The following search results were identified",r),!r||0===r.length)return!1;const o=await Ge({type:Ve,payload:{currentUrl:t,searchResults:r,source:"google"}});return o?.payload?.result??!1}catch(t){return e.error("Error while identifying search results",t),!1}}(s),function(e,t,n,r={}){let s;(function(e,t){const n=a,r=i,s=0===e.length,l=void 0===t?r:t,c=s?o:{owned:null,cleanups:null,context:l?l.context:null,owner:l},g=s?e:()=>e((()=>h((()=>D(c)))));i=c,a=null;try{return P(g,!0)}finally{a=n,i=r}})((r=>{s=r,t===document?e():G(t,e(),t.firstChild?null:void 0,n)}),r.owner)}((()=>N(_t,{popupConfig:l,logger:s})),r)}export{browser,Ut as initializeAdUnit};
|
|
2
2
|
//# sourceMappingURL=GiveFreely-content.esm.js.map
|