PageSourceSearch

https://store.rabbitroom.com/cdn/shop/t/19/assets/free-shipping-message.js?v=167170793572605558811715298043

js rabbitroom.com collected 2026-09-24 08:48:25 UTC 2,854 bytes, 4 lines download raw bytes

1const formatMoney=(cents,format)=>{typeof cents=="string"&&(cents=cents.replace(".",""));var value="",placeholderRegex=/\{\{\s*(\w+)\s*\}\}/,formatString=format;function defaultOption(opt,def){return typeof opt>"u"?def:opt}function formatWithDelimiters(number,precision,thousands,decimal){if(precision=defaultOption(precision,2),thousands=defaultOption(thousands,","),decimal=defaultOption(decimal,"."),isNaN(number)||number==null)return 0;number=(number/100).toFixed(precision);var parts=number.split("."),dollars=parts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+thousands),cents2=parts[1]?decimal+parts[1]:"";return dollars+cents2}switch(formatString.match(placeholderRegex)[1]){case"amount":value=formatWithDelimiters(cents,2);break;case"amount_no_decimals":value=formatWithDelimiters(cents,0);break;case"amount_with_comma_separator":value=formatWithDelimiters(cents,2,".",",");break;case"amount_no_decimals_with_comma_separator":value=formatWithDelimiters(cents,0,".",",");break}return formatString.replace(placeholderRegex,value)};class FreeShippingMessage extends HTMLElement{constructor(){super()}get threshold(){return parseInt(this.getAttribute("threshold"))*100}get cartTotal(){return parseInt(this.getAttribute("carttotal"))}get emptyMessage(){return this.getAttribute("emptymessage")}get upsellMessage(){return this.getAttribute("upsellmessage")}get achievedMessage(){return this.getAttribute("achievedmessage")}get preorderNoticeMessage(){return this.getAttribute("preordernoticemessage")}get preorderNoticeEnabled(){return this.getAttribute("preordernoticeenabled")==="true"}get preorderedItemTotal(){return this.getAttribute("preordereditemtotal")||0}connectedCallback(){let template;const cartTotalThatAppliesTowardThreshold=this.cartTotal-this.preorderedItemTotal;cartTotalThatAppliesTowardThreshold>0&&cartTotalThatAppliesTowardThreshold<this.threshold?(template=`<p>
2        ${formatMoney(this.threshold-cartTotalThatAppliesTowardThreshold,"${{amount}}")}&nbsp;${this.upsellMessage.trim()}${this.preorderedItemTotal>0&&this.preorderNoticeEnabled?"<sup>*</sup>":""}
3      <p>`,this.preorderedItemTotal>0&&this.preorderNoticeEnabled&&(template=`${template}<p class="free-shipping-message-preorder-notice"><sup>*</sup>${this.preorderNoticeMessage}</p>`)):cartTotalThatAppliesTowardThreshold>=this.threshold?template=`<p>${this.achievedMessage}</p>`:(template=`<p>${this.emptyMessage}${this.preorderedItemTotal>0&&this.preorderNoticeEnabled?"<sup>*</sup>":""}</p>`,this.preorderedItemTotal>0&&this.preorderNoticeEnabled&&(template=`${template}<p class="free-shipping-message-preorder-notice"><sup>*</sup>${this.preorderNoticeMessage}</p>`)),this.innerHTML=template}}customElements.define("free-shipping-message",FreeShippingMessage);
4//# sourceMappingURL=/cdn/shop/t/19/assets/free-shipping-message.js.map?v=167170793572605558811715298043

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.