S12941 - IMB Photos
");vwo_$('head').append(_vwo_sel);return vwo_$('head')[0] && vwo_$('head')[0].lastChild;})("HEAD")}}, R_766555_68_1_3_0:{ fn:function(log,nonce=''){return (function(x) {
if(!vwo_$.fn.vwoRevertHtml){
return;
};
var ctx=vwo_$(x),el;
/*vwo_debug log("Revert","content",""); vwo_debug*/;
el=vwo_$('[vwo-element-id="1732561117269"]');
el.revertContentOp().remove();})("HEAD")}}, C_766555_68_1_3_1:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x);
/*vwo_debug log("addElement","body"); vwo_debug*/!(el=vwo_$("body")).find('[vwo-op-1732561116039=""]').length&&el.vwoElement({html:'',position:"append"});})("body")}}, R_766555_68_1_3_1:{ fn:function(log,nonce=''){return (function(x) {
if(!vwo_$.fn.vwoRevertHtml){
return;
};
var el,ctx=vwo_$(x);
/*vwo_debug log("Revert","addElement","body"); vwo_debug*/(el=vwo_$('[vwo-element-id="1732561115996"]')).remove();})("body")}}, C_766555_68_1_3_2:{ fn:function(log,nonce=''){return (function(x) {})(".popup,.popup::backdrop,body[dialog-open=\"true\"],.popup h3,.popup .wrapper,.popup .wrapper > div,.flex-y,.flex-x,.popup .flex-x,.popup .btn-cta,.popup .btn-cta.btn-cta-no,.popup > button.btn-dismiss[data-action=\"dismiss\"],.popup > button.btn-dismiss")}}, R_766555_68_1_3_2:{ fn:function(log,nonce=''){return (function(x) {
if(!vwo_$.fn.vwoRevertHtml){
return;
};
})(".popup,.popup::backdrop,body[dialog-open=\"true\"],.popup h3,.popup .wrapper,.popup .wrapper > div,.flex-y,.flex-x,.popup .flex-x,.popup .btn-cta,.popup .btn-cta.btn-cta-no,.popup > button.btn-dismiss[data-action=\"dismiss\"],.popup > button.btn-dismiss")}}, C_766555_87_1_2_0:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x);
/*vwo_debug log("content",".wp-bootstrap-blocks-row > div:nth-of-type(1) > p:nth-of-type(6)"); vwo_debug*/el=vwo_$(".wp-bootstrap-blocks-row > div:nth-of-type(1) > p:nth-of-type(6)"),vwo_$(".wp-bootstrap-blocks-row > div:nth-of-type(1) > p:nth-of-type(6)").each((function(){this.__vwoControlOuterHTML=this.__vwoControlOuterHTML||this.outerHTML,vwo_$(this).nonEmptyContents().eq(0).replaceWith2(document.createTextNode("Your gift goes directly to the mission field, freeing missionaries from fundraising burdens and allowing them to concentrate on building relationships with people who need Jesus. Your gift provides encouragement and strength to missionaries who are steadfast in shining the light of Christ in a lost world."))})),el=vwo_$(".wp-bootstrap-blocks-row > div:nth-of-type(1) > p:nth-of-type(6)");})(".wp-bootstrap-blocks-row > div:nth-of-type(1) > p:nth-of-type(6)")}}, R_766555_87_1_2_0:{ fn:function(log,nonce=''){return (function(x) {
if(!vwo_$.fn.vwoRevertHtml){
return;
};
var el,ctx=vwo_$(x);
/*vwo_debug log("Revert","content",".wp-bootstrap-blocks-row > div:nth-of-type(1) > p:nth-of-type(6)"); vwo_debug*/(el=vwo_$(".wp-bootstrap-blocks-row > div:nth-of-type(1) > p:nth-of-type(6)")).revertContentOp(),el=vwo_$(".wp-bootstrap-blocks-row > div:nth-of-type(1) > p:nth-of-type(6)");})(".wp-bootstrap-blocks-row > div:nth-of-type(1) > p:nth-of-type(6)")}}, R_766555_88_1_3_0:{ fn:function(log,nonce=''){return (function(x) {
try{
var ctx=vwo_$(x),el;
/*vwo_debug log("Revert","content",""); vwo_debug*/;
el=vwo_$('[vwo-element-id="1732564619212"]');
el.revertContentOp().remove();
} catch(e) {console.error(e)}
try{
var el,ctx=vwo_$(x);
/*vwo_debug log("Revert","addElement","body"); vwo_debug*/(el=vwo_$('[vwo-element-id="1732564619216"]')).remove();
} catch(e) {console.error(e)}
return vwo_$('head')[0] && vwo_$('head')[0].lastChild;})("head")}}, C_766555_88_1_3_0:{ fn:function(log,nonce=''){return (function(x) {
try{
var _vwo_sel = vwo_$("`);
!vwo_$("head").find('#1732564619212').length && vwo_$('head').append(_vwo_sel);}catch(e) {console.error(e)}
try{;
/*vwo_debug log("addElement","body"); vwo_debug*/;
el=vwo_$("body")
;
!el.find('[vwo-op-1732564619217=""]').length && el.vwoElement({"position":"append","html":"
\n \n \n
\n
\n \n
\n \n
\n Will you help IMB missionaries share the love of Jesus today? Please make a gift of any amount through the Lottie Moon Christmas Offering® by December 31 to help missionaries shine the light of the gospel in 2025.\n
"});}catch(e) {console.error(e)}
try{const SLIDEUP_DELAY_SECONDS = 2;
const HREF = "https://www.imb.org/generosity/cye-2024/?utm_campaign=cye";
const HREF_SRC_VALUE = "cyestickybar2"; // ex: src=slideup
const TOKEN_NAME = "NA__IMB-Slideup-Nov2024";
const isBeforeDate=(e,n=new Date)=>(e=typeof e!=typeof new Date?new Date(e):e)-(n=typeof n!=typeof new Date?new Date(n):n)>0;
const isAfterDate=(...args)=>!isBeforeDate(...args);
const isBetweenDates=(date1,date2)=>(isAfterDate(date1)&&isBeforeDate(date2));
const getCurrentDate = (d = new Date()) => d.toISOString().split('T')[0];
const useStorageApi = localStorage;
const getToken = (t) => JSON.parse(useStorageApi.getItem(t)) || null;
const setToken = (t, v) => useStorageApi.setItem(t, JSON.stringify(v));
const updateTokenProperty = (t, p, v) => {
let state = getToken(t) || {};
state[p] = v;
setToken(t, state);
return (getToken(t) || {})[p] || undefined;
};
// const onScrollDepth = (callback, depthPercent = 0.5, once = true) => {
// if (depthPercent < 0 || depthPercent > 1) throw new Error("depthPercent must be a percent represented as a decimal from 0 to 1.");
// const callbackIf = (e) => { // the provided callback needs to be wrapped in another function that checks the condition
// let scrollTop = window.scrollY,
// docHeight = document.body.offsetHeight,
// winHeight = window.innerHeight,
// scrollPercent = scrollTop / (docHeight - winHeight),
// scrollPercentRounded = Math.round(scrollPercent * 100);
// if (scrollPercent >= depthPercent) {
// callback(e);
// once && document.removeEventListener('scroll', callbackIf);
// }
// };
// return document.addEventListener('scroll', callbackIf);
// };
function handleSlideupDonateButtonClick (e) {
updateTokenProperty(TOKEN_NAME, "status", "converted"); // mark as converted; both links and buttons will do this
if (e.target.tagName.toLowerCase() != 'a') { // buttons (not links) will need to generate a URL based on the buttons data attributes that are set
const REDIRECT_URL = HREF;
const value = parseFloat(e.target.getAttribute("data-value"));
const frequency = parseInt(e.target.getAttribute("data-recurring")) === 1 ? "monthly" : "one-time";
const params = {
"src": HREF_SRC_VALUE,
"amount": value,
"frequency": frequency,
};
let paramString = Object.entries(params).reduce((str, [key, value]) => str + (str && '&') + [key, value].join('='), '');
let url = REDIRECT_URL + (REDIRECT_URL.includes('?') ? '&' : '?') + paramString;
window.location.assign(url);
}
}
function main (slideup) {
const backdrop = slideup.previousElementSibling?.classList.contains('slideup-backdrop') ? slideup.previousElementSibling : document.querySelector('.slideup-backdrop');
const gridButtons = Array.from(document.querySelectorAll('[data-action="slideup-donate"]'));
const showSlideup = (slideup) => {
//if (slideup.classList.contains("hidden")) slideup.classList.remove("hidden");
//if (!slideup.classList.contains("show")) slideup.classList.add("show");
//!backdrop.classList.contains("active") && backdrop.classList.add("active");
updateTokenProperty(TOKEN_NAME, "status", "shown");
};
const hideSlideup = (slideup) => {
//if (slideup.classList.contains("show")) slideup.classList.remove("show");
//if (!slideup.classList.contains("hide")) slideup.classList.add("hide");
//backdrop.classList.contains("active") && backdrop.classList.remove("active");
updateTokenProperty(TOKEN_NAME, "status", "dismissed");
updateTokenProperty(TOKEN_NAME, "lastDismissedDate", getCurrentDate());
slideup.dispatchEvent(new Event('resize'));
};
const lastDismissedWithin7Days = () => {
const state = getToken(TOKEN_NAME) || {};
if (state && state.hasOwnProperty("status") && state.status === "dismissed") {
if (state.hasOwnProperty("lastDismissedDate")) {
let deltaDays = ((new Date(getCurrentDate())) - (new Date(state.lastDismissedDate))) / (1000 * 60 * 60 * 24);
return deltaDays < 7 ? true : false;
} else { return false }
} else { return false }
};
slideup.querySelector('.dismiss-btn')?.addEventListener('click', (e) => hideSlideup(slideup))
backdrop.addEventListener('click', (e) => hideSlideup(slideup));
const otherLink = slideup.querySelector('.other-link');
const links = [ ...gridButtons ];
otherLink && links.push(otherLink);
links.forEach((gridButtonOrLink) => {
gridButtonOrLink?.addEventListener('click', handleSlideupDonateButtonClick);
});
/*const INITIAL_STATE = {
lastShownDate: getCurrentDate(),
lastDismissedDate: null,
status: "shown",
};
let state = getToken(TOKEN_NAME) || {};
if ( !state && !state.hasOwnProperty("lastShownDate") ) { // first time; not seen yet
console.warn("Not seen yet. Showing slideup.");
setToken(TOKEN_NAME, INITIAL_STATE);
state = getToken(TOKEN_NAME);
}
else if (false && state.status == "converted") { // if the user clicked a CTA link then don't show again
return console.warn("Already converted. Not showing slideup."), slideup.style.setProperty("display", "none", "important"), null;
}
else if (false && state.status == "dismissed" && lastDismissedWithin7Days()) { // if already been dismissed AND was dismissed within the last 7 days, then don't show again
return console.warn("Dismissed within last 7 days. Not showing slideup."), slideup.style.setProperty("display", "none", "important"), null;
}
// else if (state.status == "dismissed" && state.lastDismissedDate == getCurrentDate()) { // subsequent times; if already seen AND dismissed then don't show again
// return console.warn("Already converted. Not showing slideup."), slideup.style.setProperty("display", "none", "important"), null;
// }
else { // subsequent times; already seen BUT NOT dismissed or converted (or dimissed date passed 7 days)
console.warn("Seen but not dismissed or last dismissed more than 7 days ago. Showing slideup.");
updateTokenProperty(TOKEN_NAME, "lastShownDate", getCurrentDate());
state = getToken(TOKEN_NAME);
}*/
// setTimeout(() => {
showSlideup(slideup);
// }, (SLIDEUP_DELAY_SECONDS * 1000) + (SLIDEUP_DELAY_SECONDS * 50));
}
(function(){
const asyncWaitForElement=async function(e,r=100,t=1e4){r=Number.isInteger(r)&&r>0&&r<=100?r:parseInt(r);let n="Array";if("NaN"==r)return console.error("Invalid refresh interval:",r);Array.isArray(e)||"string"!=typeof e||(n="string",e=[e]);let l=e=>document.querySelector(e),i=e=>e.every(e=>!!l(e));return new Promise((R,a)=>{let m=(e,r=null)=>(r&&clearInterval(r),R("Array"==n||e.length>1?e.map(e=>l(e)):l(e[0]))),o=n=>{console.error(`${n.name}: ${n.message}`);let l=()=>asyncWaitForElement(e,r=100,t=1e4);return a(n,l)};try{if(i(e))return m(e);let s=setInterval(()=>{if(i(e))return m(e,s)},1e3/r);setTimeout(()=>{try{if(!i(e)){clearInterval(s);let r=Error(`Failed to find matching elements within ${t}ms`);throw r.name="Timed Out",r}}catch(n){return o(n)}},t)}catch(u){return o(u)}})};
asyncWaitForElement([ "#site-header", "#imb-cye-slideup.stickybar" ]).then(([ header, stickybar ]) => {
if (isBeforeDate(new Date("2024-12-31T23:59:59"))) {
function handleStickybarResize (entries, observer = undefined) {
const elementToOffset = document.getElementById("panel-content");
if (Array.isArray(entries)) {
for (const entry of entries) {
let stickybarHeight = entry.contentRect.height;
if (!stickybarHeight || stickybarHeight <= 0 || window.getComputedStyle(stickybar)?.display == "none") {
elementToOffset?.style.removeProperty("margin-top");
} else {
elementToOffset?.style.setProperty("margin-top", `${stickybarHeight}px`);
}
}
} else if (entries.hasOwnProperty("type") && entries.type == "resize") {
const event = entries;
const { target } = event;
let stickybarHeight = target.getBoundingClientRect().height;
if (!stickybarHeight || stickybarHeight <= 0 || window.getComputedStyle(stickybar)?.display == "none") {
elementToOffset?.style.removeProperty("margin-top");
} else {
elementToOffset?.style.setProperty("margin-top", `${stickybarHeight}px`);
}
} else {
const target = entries;
let stickybarHeight = target.getBoundingClientRect().height;
if (!stickybarHeight || stickybarHeight <= 0 || window.getComputedStyle(stickybar)?.display == "none") {
elementToOffset?.style.removeProperty("margin-top");
} else {
elementToOffset?.style.setProperty("margin-top", `${stickybarHeight}px`);
}
}
}
const stickybarResizeObserver = new ResizeObserver(handleStickybarResize);
stickybarResizeObserver.observe(stickybar);
//
header.insertAdjacentElement('afterbegin', stickybar);
main(stickybar);
handleStickybarResize(stickybar);
} else {
return console.warn("Invalid time. Never showing stickybar."), slideup.style.setProperty("display", "none", "important"), null;
}
});
// asyncWaitForElement("#imb-cye-slideup").then((slideup) => {
// if (isBeforeDate(new Date("2024-12-31T23:59:59"))) {
// main(slideup);
// } else {
// return console.warn("Invalid time. Never showing slideup."), slideup.style.setProperty("display", "none", "important"), null;
// }
// });
})();
}catch(e) {console.error(e)}
return vwo_$('head')[0] && vwo_$('head')[0].lastChild;})("head")}}, R_766555_88_1_2_0:{ fn:function(log,nonce=''){return (function(x) {
try{
var ctx=vwo_$(x),el;
/*vwo_debug log("Revert","content",""); vwo_debug*/;
el=vwo_$('[vwo-element-id="1732564619206"]');
el.revertContentOp().remove();
} catch(e) {console.error(e)}
try{
var el,ctx=vwo_$(x);
/*vwo_debug log("Revert","addElement","body"); vwo_debug*/(el=vwo_$('[vwo-element-id="1732564619208"]')).remove();
} catch(e) {console.error(e)}
return vwo_$('head')[0] && vwo_$('head')[0].lastChild;})("head")}}, C_766555_88_1_2_0:{ fn:function(log,nonce=''){return (function(x) {
try{
var _vwo_sel = vwo_$("`);
!vwo_$("head").find('#1732564619206').length && vwo_$('head').append(_vwo_sel);}catch(e) {console.error(e)}
try{;
/*vwo_debug log("addElement","body"); vwo_debug*/;
el=vwo_$("body")
;
!el.find('[vwo-op-1732564619209=""]').length && el.vwoElement({"position":"append","html":"
\n
\n
\n
\n \n
\n Will you help IMB missionaries share the love of Jesus today? Please make a gift of any amount through the Lottie Moon Christmas Offering® by December 31 to help missionaries shine the light of the gospel in 2025.\n
Will you help IMB missionaries share the love of Jesus today? Please make a gift of any amount through the Lottie Moon Christmas Offering® by December 31 to help missionaries shine the light of the gospel in 2025.