1(function($2,window2,document2){"use strict";var TIMEZONE="America/New_York",CUTOFF_HOUR=15,DELIVERY_DAYS=[2,3,4,5],MAX_LOOK_AHEAD=60,TIMER_INTERVAL=60*1e3;$2.shippingDateChecker=function(options){var settings=$2.extend({blockedDates:[],noticeSuffix:" or checkout other possible delivery dates in the shopping cart."},options),_timerHandle=null;function getNowInET(){var now=new Date,fmt=new Intl.DateTimeFormat("en-US",{timeZone:TIMEZONE,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),parts={};return fmt.formatToParts(now).forEach(function(item){parts[item.type]=item.value}),new Date(parseInt(parts.year,10),parseInt(parts.month,10)-1,parseInt(parts.day,10),parseInt(parts.hour,10),parseInt(parts.minute,10),parseInt(parts.second,10))}function toISODateString(date){var y=date.getFullYear(),m=String(date.getMonth()+1).padStart(2,"0"),d=String(date.getDate()).padStart(2,"0");return y+"-"+m+"-"+d}function buildBlockedSet(){var blocked=new Set;return settings.blockedDates.forEach(function(iso){if(!/^\d{4}-\d{2}-\d{2}
1$/.test(iso)){console.warn("[shippingDateChecker] Invalid date skipped: "+iso);return}var parts=iso.split("-").map(Number),base=new Date(parts[0],parts[1]-1,parts[2]);if(isNaN(base.getTime())){console.warn("[shippingDateChecker] Unparseable date skipped: "+iso);return}blocked.add(toISODateString(base));var dayAfter=new Date(base);dayAfter.setDate(dayAfter.getDate()+1),blocked.add(toISODateString(dayAfter))}),blocked}function advanceOneDay(date){date.setDate(date.getDate()+1)}function isAvailable(date,blockedSet){return DELIVERY_DAYS.includes(date.getDay())?!blockedSet.has(toISODateString(date)):!1}function formatDate(date){return date.toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}function formatWeekday(date){return date.toLocaleDateString("en-US",{weekday:"long"})}function calcCutoffCountdown(now){var cutoff=new Date(now.getFullYear(),now.getMonth(),now.getDate(),CUTOFF_HOUR,0,0,0),pastTodayCutoff=now>=cutoff;pastTodayCutoff&&cutoff.setDate(cutoff.getDate()+1);var diffMs=cutoff-now,totalMins=Math.max(0,Math.floor(diffMs/6e4)),hrs=Math.floor(totalMins/60),mins=totalMins%60;return{totalMins:totalMins,hrs:hrs,mins:mins,pastTodayCutoff:pastTodayCutoff}}function formatCountdown(countdown){if(countdown.hrs>0){var hrLabel=countdown.hrs===1?"hr":"hrs";return countdown.hrs+hrLabel+" "+countdown.mins+"mins"}return countdown.mins+"mins"}function buildNoticeMessage(now,deliveryDate){var countdown=calcCutoffCountdown(now),countdownStr=formatCountdown(countdown),dayLabel=countdown.pastTodayCutoff?"THIS "+formatWeekday(deliveryDate).toUpperCase():"TOMORROW";return"GET IT "+dayLabel+" if you order in the next "+countdownStr+settings.noticeSuffix}return{getNextShippingDate:function(){var now=getNowInET(),blockedSet=buildBlockedSet(),candidate=new Date(now.getFullYear(),now.getMonth(),now.getDate());advanceOneDay(candidate);for(var i=0;i<MAX_LOOK_AHEAD;i++){if(isAvailable(candidate,blockedSet)){var candidateISO=toISODateString(candidate),countdown=calcCutoffCountdown(now);return{date:new Date(candidate.getTime()),iso:candidateISO,formatted:formatDate(candidate),cutoffCountdown:countdown,noticeMessage:buildNoticeMessage(now,candidate)}}advanceOneDay(candidate)}return console.error("[shippingDateChecker] No available date found within "+MAX_LOOK_AHEAD+" days."),null},startNoticeTimer:function(selector,opts){var timerOpts=$2.extend({loadingText:"Checking delivery dates..."},opts),$el=$2(selector);if(!$el.length){console.warn("[shippingDateChecker] startNoticeTimer: element not found: "+selector);return}this.stopNoticeTimer(),$el.text(timerOpts.loadingText);var self=this;function render(){var result=self.getNextShippingDate();result?$el.text(result.noticeMessage):($el.text("Delivery dates currently unavailable. Please contact us."),self.stopNoticeTimer())}render(),_timerHandle=setInterval(render,TIMER_INTERVAL)},stopNoticeTimer:function(){_timerHandle!==null&&(clearInterval(_timerHandle),_timerHandle=null)},isPastCutoff:function(){return getNowInET().getHours()>=CUTOFF_HOUR},getCurrentETTime:function(){return getNowInET()},getBlockedDates:function(){return buildBlockedSet()}}}})(jQuery,window,document),$(function(){var checker=$.shippingDateChecker({blockedDates:["2026-07-04","2026-09-08","2026-11-26","2026-12-25"]}),result=checker.getNextShippingDate();result?(console.log("Next shipping date : "+result.formatted),console.log("ISO : "+result.iso),console.log("Past 3PM cutoff? : "+result.cutoffCountdown.pastTodayCutoff),console.log("Countdown : "+result.cutoffCountdown.hrs+"h "+result.cutoffCountdown.mins+"m"),console.log("Notice message : "+result.noticeMessage)):console.error("[shippingDateChecker] No shipping date available."),checker.startNoticeTimer("#shipping-notice")}); 2//# sourceMappingURL=/cdn/shop/t/55/assets/_custom-shipping-checks.js.map?v=63087376293117315931791197368
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.