var instafeedApp = (function instafeedLoad(){/*! * Copyright (c) 2023 Mintt Studio * All rights reserved. * * This code is proprietary and protected under international copyright laws. * Redistribution, use, modification, or sublicensing without explicit written permission from * Mintt Studio is prohibited. * * License inquiries or unauthorized use reports should be directed to: * legal@minttstudio.com. */ const e="nfcube.com",t="instafeed.nfcube.com",i="cdn.nfcube.com",s="12.0.1",n="feed",o="insta-feed",a=".instafeed-lightbox",r="instafeed",d=!1,l=3;window.instafeedEvents=window.instafeedEvents||[];class p{constructor(){this.listeners=window.instafeedEvents=window.instafeedEvents||[],this.debugMode=!1}addListener(e,t,i,s={}){this.listeners.some((i=>i.element===e&&i.event===t&&"swiped"===t))?this.debugMode&&console.log(`Listener for ${t} on the specified element already exists.`):(e.addEventListener(t,i,s),this.listeners.push({element:e,event:t,handler:i}),this.debugMode&&(console.log(`Added listener for ${t}`),console.log("Listeners",this.listeners)))}removeListener(e,t,i){e.removeEventListener(t,i),this.listeners=this.listeners.filter((s=>!(s.element===e&&s.event===t&&s.handler===i))),this.debugMode&&(console.log(`Removed listener for ${t}`),console.log("Listeners",this.listeners))}clearAllListeners(){this.listeners.forEach((({element:e,event:t,handler:i})=>{e.removeEventListener(t,i)})),this.listeners=[],this.debugMode&&console.log("All listeners have been removed")}}const c=new p;var Instafeed=function(){function Instafeed(e){this.translations={en:{SHOP_NOW:"Shop now",TAG_PRODUCTS:"Tag products",TAGGED_BY:"Tagged by {username}",VIEW_ON_INSTAGRAM:"View on Instagram",REVIEWS:"{number} reviews",HANG_ON:"Please hang on while we process your feed. This may take a few minutes.",DELETE:"Delete"},"pt-PT":{SHOP_NOW:"Comprar agora",TAG_PRODUCTS:"Identificar produtos",TAGGED_BY:"Marcado por {username}",VIEW_ON_INSTAGRAM:"Ver no Instagram",REVIEWS:"{number} avaliações",HANG_ON:"Aguarde um momento, estamos a processar o seu feed, isto pode demorar alguns minutos ☕",DELETE:"Apagar"},"pt-BR":{SHOP_NOW:"Comprar agora",TAG_PRODUCTS:"Marcar produtos",TAGGED_BY:"Marcado por {username}",VIEW_ON_INSTAGRAM:"Ver no Instagram",REVIEWS:"{number} avaliações",HANG_ON:"Aguarde um momento, estamos processando seu feed, isso pode levar alguns minutos ☕",DELETE:"Delete"},es:{SHOP_NOW:"Comprar ahora",TAG_PRODUCTS:"Etiquetar productos",TAGGED_BY:"Etiquetado por {username}",VIEW_ON_INSTAGRAM:"Ver en Instagram",REVIEWS:"{number} reseñas",HANG_ON:"Espera un momento, estamos procesando tu feed, esto podría tardar unos minutos ☕",DELETE:"Eliminar"},"ja-JP":{SHOP_NOW:"今すぐ購入",TAG_PRODUCTS:"商品にタグを付ける",TAGGED_BY:"{username}によってタグ付けされました",VIEW_ON_INSTAGRAM:"Instagramで見る",REVIEWS:"{number} レビュー",HANG_ON:"少々お待ちください、フィードを処理中です。これには数分かかる場合があります ☕",DELETE:"削除"},fr:{SHOP_NOW:"Acheter",TAG_PRODUCTS:"Étiqueter les produits",TAGGED_BY:"Tagué par {username}",VIEW_ON_INSTAGRAM:"Afficher sur Instagram",REVIEWS:"{number} avis",HANG_ON:"Patientez, nous traitons votre flux, cela pourrait prendre quelques minutes ☕",DELETE:"Supprimer"},de:{SHOP_NOW:"Jetzt shoppen",TAG_PRODUCTS:"Produkte taggen",TAGGED_BY:"Getaggt von {username}",VIEW_ON_INSTAGRAM:"Auf Instagram ansehen",REVIEWS:"{number} Bewertungen",HANG_ON:"Einen Moment bitte, wir verarbeiten deinen Feed, das könnte einige Minuten dauern ☕",DELETE:"Löschen"},sv:{SHOP_NOW:"Handla nu",TAG_PRODUCTS:"Tagga produkter",TAGGED_BY:"Taggad av {username}",VIEW_ON_INSTAGRAM:"Visa på Instagram",REVIEWS:"{number} recensioner",HANG_ON:"Vänta, vi behandlar ditt flöde, detta kan ta några minuter ☕",DELETE:"Radera"},it:{SHOP_NOW:"Acquista ora",TAG_PRODUCTS:"Tagga prodotti",TAGGED_BY:"Taggato da {username}",VIEW_ON_INSTAGRAM:"Visualizza su Instagram",REVIEWS:"{number} recensioni",HANG_ON:"Aspetta, stiamo elaborando il tuo feed, potrebbe richiedere qualche minuto ☕",DELETE:"Elimina"},da:{SHOP_NOW:"Shop nu",TAG_PRODUCTS:"Tag produkter",TAGGED_BY:"Tagget af {username}",VIEW_ON_INSTAGRAM:"Se på Instagram",REVIEWS:"{number} anmeldelser",HANG_ON:"Vent venligst, vi behandler dit feed, det kan tage et par minutter ☕",DELETE:"Slet"},nb:{SHOP_NOW:"Handle nå",TAG_PRODUCTS:"Tagge produkter",TAGGED_BY:"Taggede av {username}",VIEW_ON_INSTAGRAM:"Vis på Instagram",REVIEWS:"{number} anmeldelser",HANG_ON:"Vent litt, vi behandler din feed, dette kan ta noen minutter ☕",DELETE:"Slett"},nl:{SHOP_NOW:"Nu winkelen",TAG_PRODUCTS:"Producten taggen",TAGGED_BY:"Getagd door {username}",VIEW_ON_INSTAGRAM:"Bekijk op Instagram",REVIEWS:"{number} beoordelingen",HANG_ON:"Even geduld alstublieft, we verwerken je feed, dit kan een paar minuten duren ☕",DELETE:"Verwijderen"}},this.availableLanguages=["en","es","de","fr","sv","da","it","nl","nb","ja-JP","pt-PT","pt-BR"],this.options={target:o,language:"en",locale:"en-US",showLoading:!0,forceUpdate:!1,viewsAndClicks:!1,key:"",overrides:"",picturesLoaded:0,picturesNeeded:0,admin:window.location.hostname===t},"undefined"!=typeof Shopify&&Shopify.locale&&(this.options.locale=Shopify.locale,this.availableLanguages.includes(Shopify.locale)&&(this.options.language=Shopify.locale)),Object.assign(this.options,e),this.options.admin||this._loadCss();document.querySelectorAll(a).forEach((e=>{e.parentNode.removeChild(e)}))}return Instafeed.prototype.translate=function(e){return this.translations[this.options.language]&&this.translations[this.options.language][e]?this.translations[this.options.language][e]:e},Instafeed.prototype.run=function(){var e=document.getElementById(this.options.target);if(0===e.clientWidth&&parseInt(this.options.autoLayout)>0)return this._checkClientWidth(this,e),!1;this.options.corners=4===parseInt(this.options.format)?"50%":this.options.corners+"px",instafeedSettings.analyticsViewsClicks=Boolean(this.options.viewsAndClicks),!this._validateCharge(this.options.charge)&&parseInt(this.options.rows)>parseInt(this.options.rowsLimit)&&(this.options.rows=this.options.rowsLimit),parseInt(this.options.autoLayout)>0?(this.options.picturesNeeded=this.options.rows*this._getAutoColumns(e.clientWidth),this._isMobileDevice()&&this._validateCharge(this.options.charge)&&(this.options.picturesNeeded=this.options.rowsMobile*this._getAutoColumns(e.clientWidth))):this._isMobileDevice()&&this._validateCharge(this.options.charge)?this.options.picturesNeeded=this.options.rowsMobile*this.options.columnsMobile:this.options.picturesNeeded=this.options.rows*this.options.columns,this.options.admin&&this.options.showLoading&&(e.innerHTML='
'+this.translate("HANG_ON")+"
"),!this.options.admin&&parseInt(this.options.loadingAnimation)>0&&(e.innerHTML='
');const t=this;Date.now();return fetch(this._buildUrl()).then((e=>{if(!e.ok)throw new Error(`${e.status} ${e.statusText}`);return e.json()})).then((e=>{try{t.parse(e)}catch(e){console.error("Parse function error:",e.message)}})).catch((e=>{if(console.log("Fetch error:",e.message),this.options.admin){this.options.error.call(this,{meta:{code:204,username:"",error_message:"Taking a bit longer to fetch your feed, please refresh this page in a couple of minutes."}})}})).finally((()=>{Date.now()})),!0},Instafeed.prototype.parse=function(e){const i=document.getElementById(this.options.target);if(!i)return!1;if("object"!=typeof e)throw new Error("Invalid JSON response");const{meta:{code:s,error_message:n}}=e,o=parseInt(s,10);if(i.innerHTML="",200!==o)return this.options.admin&&"function"==typeof this.options.error&&this.options.error.call(this,e),!1;"function"==typeof this.options.success&&this.options.success.call(this,e);var a=e.data,d=0,l="";for(d=0,len=a.length;d1?"display:none;":"";var f="instafeed-simple-popup"===i?"instafeed-tagged-buy-button-simple-popup":"tagged-buy-button",m=this._geModalTemplate(i,s);if(this.options.picturesLoaded++,parseInt(this.options.openIg)>1){parseInt(this.options.showProducts)<2&&p.hasOwnProperty("tagged_products")&&p.tagged_products.length>0&&this._validateCharge(this.options.charge)&&p.tagged_products.forEach((e=>{let s="";parseInt(e.variant)>0&&(s="?variant="+parseInt(e.variant));let n="undefined"!=typeof Shopify&&Shopify.locale?Shopify.locale:this.options.language;var o,a;e.translations&&n in e.translations&&"title"in e.translations[n]&&""!==e.translations[n].title.trim()&&(e.title=e.translations[n].title);let d=parseInt(this.options.showPrices)>0?this._generatePriceHTML(e.price):"",l=parseInt(this.options.showReviews)>0&&e.rating_count>0?this._generateReviewsHTML(e.rating,e.rating_count):"";this.options.admin?(o="
"+e.title+"
"+l+d+"
",a=""+e.title+""):(o="
"+e.title+"
"+l+d+"
",a=""+e.title+""),g+="
"+a+"
"+o+"
"}));var v="",y="",w="",b="";if(p.carousel){const e=this.options.feedId;instafeedSettings.carousels[e]||(instafeedSettings.carousels[e]={}),instafeedSettings.carousels[e][d]=p.carousel.map((e=>e.thumbnail_url?e.thumbnail_url:e.media_url));let t="";p.carousel.forEach(((i,s)=>{t+=``})),b=`\n \n \n \n `}if("video"===p.type&&p.hasOwnProperty("videos")){v=r+"-video",y="
",w="
",imageFullHtml=b+"
'}else imageFullHtml=b+"Instagram post with the caption: "+this._escapeHtml(this._getObjectProperty(p,"caption.text").substring(0,64))+"...";var I=1===this.options.picturesLoaded?Math.min(this.options.picturesNeeded,a.length):this.options.picturesLoaded-1,S=this.options.picturesLoaded===this.options.picturesNeeded||this.options.picturesLoaded===a.length?1:this.options.picturesLoaded+1;imageFullHtml="
"+w+y+imageFullHtml,l+=this._makeTemplate(m,{model:p,id:this.options.picturesLoaded,fullId:p.id,minusId:I,plusId:S,link:p.link,image:h.url,video:v,tagged_username:p.user.username.length>0?"
"+this.translate("TAGGED_BY").replace("{username}","@"+p.user.username+"
"):"",username:e.meta.username,fullName:e.meta.full_name,userPicture:5===this.options.apiVersion&&parseInt(this.options.charge)>0?u:"https://"+t+"/assets/img/logo-instagram-transparent.png",imageFullHtml:imageFullHtml,taggedProduct:g,date:this._timeConverter(p.created_time),caption:this._escapeHtml(this._getObjectProperty(p,"caption.text")),likes:p.likes.count>0?" "+this._shortenLargeNumber(p.likes.count,1)+" \x3c!--❞ {{comments}}--\x3e":"",comments:this._shortenLargeNumber(p.comments.count,1),location:this._getObjectProperty(p,"location.name")})}if(this.options.picturesLoaded>=this.options.picturesNeeded||e.data.length===this.options.picturesLoaded)break}clearInterval(instafeedScrollIntervals[this.options.feedId]),this._appendHtmlToParent(l);var _=0;_=parseInt(this.options.autoLayout)>0?parseFloat(100/this._getAutoColumns(i.clientWidth)).toFixed(3):this._isMobileDevice()&&this._validateCharge(this.options.charge)?parseFloat(100/this.options.columnsMobile).toFixed(3):parseFloat(100/this.options.columns).toFixed(3),instafeedSettings.sliderNumVisibleImages[this.options.feedId]=parseInt(Math.round(100/_)),instafeedSettings.totalImages[this.options.feedId]=this.options.picturesLoaded,i.innerHTML+=this._generateLayoutHTML(a,this._escapeHtml),this._adjustLayoutHTML(),this._setFeedHeader(c,u),this._changeMobileDOM(),this._enableLazyLoading(),this._observeAndPlayVideos(),parseInt(this.options.openIg,10)>1&&this._popupsPreloadTrigger(),2===parseInt(this.options.openIg,10)&&this._isMobileDevice()&&this._addSwipePopupEvents();const E=new CustomEvent("instafeedAppLoaded");return document.dispatchEvent(E),instafeedFeedsLoaded.push(this.options.feedId),!0},Instafeed.prototype._geModalTemplate=function(e,i){let s="";var n=this._validateCharge(this.options.charge)&&parseInt(this.options.likes)>0&&4!==parseInt(this.options.apiVersion)?n="{{likes}}":"",o=1===parseInt(this.options.taggedPosts)||4===parseInt(this.options.taggedPosts)?"{{tagged_username}}":"",a=this.options.admin?"
":"";s="
";var d="";"instafeed-simple-popup"===e&&(d=a+"
{{taggedProduct}}
"),s+="
",s},Instafeed.prototype._changeMobileDOM=function(){if(this._isMobileDevice(!0)){document.querySelectorAll("."+r+"-post-image").forEach((e=>{const t=e.nextElementSibling,i=t?t.querySelector("."+r+"-header"):null;i&&e.parentNode.insertBefore(i,e)}))}},Instafeed.prototype._setFeedHeader=function(e,t){const i=document.getElementById(this.options.target),s=this._validateCharge(this.options.charge)&&5===parseInt(this.options.apiVersion)&&(1===parseInt(this.options.showFollowers)||3===parseInt(this.options.showFollowers)),n=this._validateCharge(this.options.charge)&&5===parseInt(this.options.apiVersion)&&parseInt(this.options.showFollowers)>1,o=s?`

${this._shortenLargeNumber(e)} followers

`:"",a=0===parseInt(this.options.feedId)?"undefined"!=typeof instafeedLocalTitle&&instafeedLocalTitle.length>0:void 0!==window["instafeed"+this.options.feedId+"Title"]&&window["instafeed"+this.options.feedId+"Title"].length>0,d=a&&0===parseInt(this.options.feedId)?instafeedLocalTitle:window["instafeed"+this.options.feedId+"Title"],l=this.options.title.length>0||a;let p="";if(n&&(p+=``),l){p+=`

${a?d:this.options.title}

`}s&&(p+=o),(l||s)&&this._appendHtmlToParent(p,i,i.firstChild)},Instafeed.prototype._adjustLayoutHTML=function(){const e=document.getElementById(this.options.target),t=document.querySelector(`.${r}-new-layout-container[data-feed-id="${this.options.feedId}"]`),i=document.querySelector(`.${r}-new-layout-wrapper[data-feed-id="${this.options.feedId}"]`),s=parseFloat(e.offsetWidth.toFixed(3)),n=parseFloat((s/instafeedSettings.sliderNumVisibleImages[this.options.feedId]*(parseInt(this.options.space)/100)).toFixed(3)),o=parseInt(instafeedSettings.sliderNumVisibleImages[this.options.feedId]-1),a=parseFloat((o*n).toFixed(3)),d=parseFloat((s-a).toFixed(3)),l=parseFloat((d/instafeedSettings.sliderNumVisibleImages[this.options.feedId]).toFixed(3)),p=1===parseInt(this.options.format)?parseFloat((l*(16/9)).toFixed(3)):2===parseInt(this.options.format)?parseFloat((l*(5/4)).toFixed(3)):3===parseInt(this.options.format)?parseFloat((l*(3/4)).toFixed(3)):parseFloat(l.toFixed(3));if(document.querySelectorAll(`.${r}-new-layout-item[data-feed-id="${this.options.feedId}"]`).forEach((e=>{e.style.width=`${l}px`,e.style.height=`${p}px`})),1===parseInt(this.options.showProducts,10)&&this._validateCharge(this.options.charge)&&p>=300){document.querySelectorAll(`.${r}-new-layout-item[data-feed-id="${this.options.feedId}"] .instafeed-product-item img`).forEach((e=>{e.style.display="block",e.style.height=Math.min(parseFloat((.15*p).toFixed(3)),60)+"px",e.style.width=Math.min(parseFloat((.15*p).toFixed(3)),60)+"px"}));document.querySelectorAll(`.${r}-new-layout-item[data-feed-id="${this.options.feedId}"] .instafeed-tagged-buy-button-simple-popup`).forEach((e=>{e.style.display="block"}))}t.style.width=`${s}px`,t.style.height=`${p}px`,i.style.gap=`${n}px`,instafeedSettings.sliderStepSize[this.options.feedId]=0===this.options.sliderBehavior||2===this.options.sliderBehavior?s+n:l+n,instafeedSettings.sliderRowSize[this.options.feedId]=s+n,instafeedSettings.totalImages[this.options.feedId]=instafeedSettings.sliderNumVisibleImages[this.options.feedId]&&(i.style.display="grid",t.style.height="unset",i.style.gridTemplateColumns="repeat("+instafeedSettings.sliderNumVisibleImages[this.options.feedId]+", 1fr)"),7===parseInt(this.options.layout)&&instafeedSettings.totalImages[this.options.feedId]>=instafeedSettings.sliderNumVisibleImages[this.options.feedId]&&(this._isMobileDevice()&&(c.addListener(e,"swiped-left",(e=>{instafeedSliderMove(1,this.options.feedId)})),c.addListener(e,"swiped-right",(e=>{instafeedSliderMove(-1,this.options.feedId)}))),instafeedSettings.sliderState={},this.options.sliderBehavior>1&&(instafeedScrollIntervals[this.options.feedId]=setInterval((()=>{instafeedSliderMove(1,this.options.feedId)}),instafeedSlideSpeed)))},Instafeed.prototype._generatePriceHTML=function(e){if(this.options.admin&&""!==e)return`
${e}
`;if(!((e=Number(e))>0))return"";let t=e.toFixed(2);if("undefined"!=typeof Shopify){const i=Shopify.currency?.active||"USD";e*=Shopify.currency?.rate||1,t=new Intl.NumberFormat(void 0,{style:"currency",currency:i}).format(e)}return`
${t}
`},Instafeed.prototype._generateReviewsHTML=function(e,t){let i='
';const s=Math.floor(e),n=e%1!=0;for(let e=0;e<5;e++)i+=e
':e===s&&n?'
':'
';return i+=`
${t>1?" | "+this.translate("REVIEWS").replace("{number}",t):"("+t+")"}`,i},Instafeed.prototype._generateLayoutHTML=function(e){let t="",i=0;for(let s of e)if(i++,t+=this._imageTemplate(s,i),i>=this.options.picturesNeeded||e.length===i)break;let s="";return i>instafeedSettings.sliderNumVisibleImages[this.options.feedId]&&this.options.sliderBehavior<=1&&7===parseInt(this.options.layout)&&(s=`\n \n \n `),`\n
\n
\n ${t}\n
\n ${s}\n
`},Instafeed.prototype._imageTemplate=function(e,i){const s=parseInt(this.options.openIg,10),n=parseInt(this.options.showProducts,10);let o=e.images.standard_resolution,a=this._escapeHtml(e.caption.text).substring(0,64),d=1===n&&4!==parseInt(this.options.format)&&e.hasOwnProperty("tagged_products")&&e.tagged_products.length>0&&this._validateCharge(this.options.charge)?this._generateProductBox(e.tagged_products):"",l=d.length>0?"inline-product":"",p="video"===e.type&&parseInt(this.options.autoplay,10)>0&&this._validateCharge(this.options.charge)?``:`Instagram post with the caption: '${a}...'`,c="inline-product"===l?`
${d}
`:`
${this._generateIcon(e)}
`,u=s>0?"role='link' tabindex='0'":"",h=s>1?"aria-haspopup='true' aria-label='open post'":"",g=0!==s?`
${c}
`:"";p+=`\n
\n ${g}\n
`;const f=this._generatePostUrl(p,e,i);return`
${f}
`},Instafeed.prototype._generatePostUrl=function(e,t,i){return 1===parseInt(this.options.openIg,10)?`${e}`:e},Instafeed.prototype._generateProductBox=function(e){let t=this.translate("SHOP_NOW"),i=this.options.admin?this.options.shopOrigin:window.location.hostname,s=this.options.admin?"/":Shopify.routes.root,n=this.options.admin?"":'style="pointer-events:all;"';return(e=e.slice(0,1)).map((e=>{let o=parseInt(e.variant)>0?"?variant="+parseInt(e.variant):"";return`\n `})).join("")},Instafeed.prototype._generateIcon=function(e){if(this._validateCharge(this.options.charge)&&parseInt(this.options.likes)>0&&5===parseInt(this.options.apiVersion))return`\n ${this._shortenLargeNumber(e.likes.count,1)}`;{const i="video"===e.type?"video-icon-v3.png":"instagram-icon-v2.svg";return``}},Instafeed.prototype._appendHtmlToParent=function(e,t=document.body,i=null){const s=document.createElement("template");for(s.innerHTML=e;s.content.firstChild;)t.insertBefore(s.content.firstChild,i)},Instafeed.prototype._addSwipePopupEvents=function(){c.addListener(document,"swiped",(function(e){if((window.lastSwipeEventInstafeed||{}).target!==e.target){var t=document.getElementById(instafeedSettings.modalOpen);if(t&&e.target.className.includes("instafeed-simple-popup")){var i="";if("up"===e.detail.dir?i=`.${r}-new-arrow.next`:"down"===e.detail.dir&&(i=`.${r}-new-arrow.prev`),i){var s=t.querySelector(i);s&&s.click()}window.lastSwipeEventInstafeed=e}}}))},Instafeed.prototype._buildUrl=function(){const e=window.location.pathname.includes("/products/")?window.location.pathname.split("/products/")[1]:"",i=e&&e.length>0?`&handle=${e}`:"",s=this.options.overrides.length>0?`&overrides=${this.options.overrides}`:"",o=this.options.forceUpdate?1:0;return`https://${t}/${n}/v${this.options.apiVersion}?limit=${this.options.picturesNeeded}&account=${this.options.shopOrigin}&fu=${o}&fid=${this.options.feedId}&hash=${this.options.hash}&locale=${this.options.locale}${i}${s}`},Instafeed.prototype._makeTemplate=function(e,t){return e.replace(/{{([\w[\].]+)}}/g,((e,i)=>{const s=this._getObjectProperty(t,i);return null!==s?s:""}))},Instafeed.prototype._getObjectProperty=function(e,t){const i=(t=t.replace(/\[(\w+)\]/g,".$1")).split(".");for(const t of i){if(null===e||!(t in e))return null;e=e[t]}return e},Instafeed.prototype._validateCharge=function(e){return parseInt(e)>0},Instafeed.prototype._getAutoColumns=function(e){return e<480?2:e<768?3:e<1024?4:e<=1200?5:6},Instafeed.prototype._escapeHtml=function(e){return e&&(e=e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")),e},Instafeed.prototype._shortenLargeNumber=function(e,t){const i=["k","M","G","T","P","E","Z","Y"];for(let s=i.length-1;s>=0;s--){const n=Math.pow(1e3,s+1);if(e<=-n||e>=n)return+(e/n).toFixed(t)+i[s]}return e},Instafeed.prototype._timeConverter=function(e){return new Date(1e3*e).toLocaleDateString(navigator.language,{month:"long",day:"numeric"})},Instafeed.prototype._isMobileDevice=function(e=!1){return!(!this.options.admin||this.options.desktopPreview||!1!==e)||(!this.options.admin||!this.options.desktopPreview||!1!==e)&&window.matchMedia("only screen and (max-width: 768px)").matches},Instafeed.prototype._checkClientWidth=function(e,t){0===t.clientWidth?setTimeout((()=>{e._checkClientWidth(e,t)}),100):e.run()},Instafeed.prototype._loadCss=function(){if(document.currentScript&&!document.currentScript.src.includes(e))return!1;const i=document.createElement("link");i.href=`https://${t}/cdn/${r}-${s}.css`,i.type="text/css",i.rel="stylesheet",i.media="screen,print",document.head.appendChild(i)},Instafeed.prototype._popupsPreloadTrigger=function(){if(instafeedPopupsPreloaded)return!1;instafeedPopupsPreloaded=!0;const e=new IntersectionObserver(((e,t)=>{e.forEach((e=>{e.isIntersecting&&(this._popupsPreload(),t.unobserve(e.target))}))}),{threshold:.1}),t=document.querySelector("#insta-feed, .instafeed-shopify");t&&e.observe(t)},Instafeed.prototype._popupsPreload=function(){const e=document.querySelectorAll("div.lightbox-instagram");let t=0;e.forEach((e=>{let i=0;e.querySelectorAll("video, img").forEach(((e,s)=>{setTimeout((()=>{if("VIDEO"===e.tagName)e.setAttribute("preload","auto"),e.load();else{const t=e.getAttribute("data-instafeed-src");t&&(e.setAttribute("src",t),e.classList.add(r+"-lazy-image--handled"))}}),t),t+=200+i,i+=50}))}))},Instafeed.prototype._enableLazyLoading=function(){const e=document.querySelectorAll("."+r+"-lazy-image");if(!e.length||!("IntersectionObserver"in window))return void e.forEach((e=>this.preloadImage(e)));const t=new IntersectionObserver(((e,t)=>{e.forEach((e=>{e.isIntersecting&&(this._tagView(),t.unobserve(e.target),this.preloadImage(e.target))}))}),{rootMargin:"100px 0px",threshold:.01});e.forEach((e=>{e.classList.contains(r+"-lazy-image--handled")||t.observe(e)}))},Instafeed.prototype.preloadImage=function(e){const t=e.dataset.instafeedSrc;e.classList.contains(r+"-lazy-image--handled")||(e.classList.add(r+"-lazy-image--handled"),e.onerror=()=>{e.classList.remove(r+"-lazy-image--handled")},e.src=t)},Instafeed.prototype._observeAndPlayVideos=function(){const e=parseInt(this.options.autoplay);this._addOnplayListener();const t=e=>e?.play(),i=e=>document.getElementById(`inline-video-${e}-${this.options.target}`),s={threshold:.01},n=document.querySelectorAll("video[data-poster]");let o=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){this._tagView();let t=e.target,i=t.getAttribute("data-poster");t.setAttribute("poster",i),o.unobserve(t)}}))}),s);if(n.forEach((e=>{o.observe(e)})),1===e&&this._validateCharge(this.options.charge)){const e=document.querySelectorAll('.auto-loop-videos[data-feed-id="'+this.options.feedId+'"]'),i=new IntersectionObserver(((e,i)=>{e.forEach((e=>{e.isIntersecting&&(t(e.target),i.unobserve(e.target))}))}),s);e.forEach((e=>i.observe(e)))}if(2===e&&this._validateCharge(this.options.charge)){const e=document.querySelectorAll(`.${r}-hover-layer[data-feed-id='${this.options.feedId}-video'], .${r}-overlay[data-feed-id='${this.options.feedId}-video']`);e.forEach((e=>{e.style.opacity="1",e.style.background="transparent"})),e.forEach((e=>{const s=s=>{const n=e.getAttribute(`data-${r}-open-id`).split("-")[0],o=i(n);var a;s?(t(o),e.style.opacity=0):(a=o,a?.pause(),e.style.opacity=1)};c.addListener(e,"mouseover",(()=>s(!0))),c.addListener(e,"mouseout",(()=>s(!1))),c.addListener(e,"touchstart",(()=>s(!0))),c.addListener(e,"touchend",(()=>s(!1)))}))}},Instafeed.prototype._addOnplayListener=function(){Array.from(document.querySelectorAll('video[id^="video-"]')).filter((e=>e.id.includes(this.options.target))).forEach((e=>{e.onplay=()=>{e.muted=!instafeedSettings.sound;e.id.split("-").pop();null===instafeedSettings.modalOpen&&e.pause()}}))},Instafeed.prototype._tagView=function(){if(instafeedSettings.feedViewed?.[this.options.feedId])return!1;instafeedSettings.feedViewed[this.options.feedId]=!0,instafeedEventTag("feed_view",this.options.feedId)},Instafeed}();!function(){var e;function t(t,i=!1){const s=document.getElementById(t);if(s){let t=document.getElementById("video-"+e);t&&t.pause(),s.style.setProperty("display","none","important"),s.style.opacity=0,i||document.body.classList.remove("instafeed-body-no-scroll"),instafeedSettings.modalOpen=null,c.removeListener(window,"keydown",instafeedTrapFocusHandler,!1),c.removeListener(document.body,"touchmove",instafeedTouchScrollListener,{passive:!1})}}c.addListener(document,"click",(function(i){if(!i.target||!i.target.hasAttribute(`data-${r}-open-id`)&&!i.target.hasAttribute(`data-${r}-close-id`))return!1;var s=i.target.hasAttribute(`data-${r}-open-id`)?i.target.getAttribute(`data-${r}-open-id`):i.target.getAttribute(`data-${r}-close-id`),n=document.getElementById("video-"+s);if(i.target.hasAttribute(`data-${r}-open-id`)){const e=document.getElementById(s);if(instafeedSettings.previouslyFocusedElement=document.activeElement,e){let i=!1;instafeedSettings.modalOpen&&(i=!0,t(instafeedSettings.modalOpen,i)),instafeedSettings.modalOpen=s,e.style.setProperty("display","flex","important"),i?e.style.opacity=1:requestAnimationFrame((()=>{e.style.opacity=1})),document.body.classList.add("instafeed-body-no-scroll");if(e.querySelector(".instafeed-simple-popup")&&c.addListener(document.body,"touchmove",instafeedTouchScrollListener,{passive:!1}),n){d;const e=document.getElementById("video-spinner-"+s);e.style.display="block",n.play().then((()=>{e.style.display="none"}))}!function(e){const t=`.${r}-new-arrow`,{firstFocusableElement:i,lastFocusableElement:s}=function(e,t){const i=e.querySelectorAll(t),s=i[0],n=i[i.length-1];return{firstFocusableElement:s,lastFocusableElement:n}}(e,t);instafeedTrapFocusHandler=e=>{!function(e,t,i){d;let s="Tab"===e.key||9===e.keyCode;if(!s)return;e.shiftKey?e.target===t&&(i.focus(),e.preventDefault()):e.target===i&&(t.focus(),e.preventDefault())}(e,i,s)},c.addListener(window,"keydown",instafeedTrapFocusHandler,!1),e.focus()}(e),instafeedEventTag("modal_open",0)}}i.target.hasAttribute(`data-${r}-close-id`)&&(instafeedSettings.previouslyFocusedElement&&instafeedSettings.previouslyFocusedElement.focus(),t(s)),e=s})),c.addListener(window,"keydown",(e=>{const{key:i}=e;if(!document.getElementById("video-"+instafeedSettings.modalOpen)||" "!==i&&"Spacebar"!==i&&"Space"!==e.code||"INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName||(e.preventDefault(),instafeedTogglePlay()),"Escape"===i)instafeedSettings.modalOpen&&t(instafeedSettings.modalOpen);else if("Enter"===e.key){const e=document.activeElement;("true"===e.getAttribute("aria-haspopup")||e.classList.contains(`${r}-close-button`)||e.classList.contains(`${r}-carousel-arrow`)||e.classList.contains(`${r}-new-arrow`))&&e.click()}var s=document.getElementById(instafeedSettings.modalOpen);if(s){var n="";if("ArrowLeft"===i?n=`.${r}-new-arrow.prev`:"ArrowRight"===i&&(n=`.${r}-new-arrow.next`),n){var o=s.querySelector(n);o&&o.click()}}}))}(),window.instafeedEventTag=function(e,t){if("undefined"==typeof Shopify||!1===instafeedSettings.analyticsViewsClicks)return;const i={event:e,fid:t,shop:Shopify.shop,appVersion:s};fetch("https://tr.nfcube.com/index/v1",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}).catch((e=>console.error("Error:",e)))},window.instafeedToggleSound=e=>{var t=e.getAttribute("data-video-id"),i=document.getElementById(t);i.muted=!i.muted,instafeedSettings.sound=!i.muted,document.querySelectorAll(".instafeed-sound-button").forEach((function(e){e.classList.toggle("sound-on")}))},window.instafeedTogglePlay=()=>{const e="video-"+instafeedSettings.modalOpen,t=document.getElementById(e),i=document.querySelector(`.instafeed-video-control[data-video-id="${e}"]`);t.paused?(t.play(),i.classList.remove("paused")):(t.pause(),i.classList.add("paused"))},window.instafeedCarouselArrow=function(e,t,i,s){const n=instafeedSettings.carousels[t][i],o=n.length,a=e.closest("div.instafeed-post-image");if(a){const e=a.querySelector("img");if(e&&o>0){const a=e.src;let r=n.indexOf(a);-1===r&&(r=0),r="left"===s?0===r?o-1:r-1:r===o-1?0:r+1,document.getElementById(`instafeed-carousel-dots-${t}-${i}`)?.querySelector(".instafeed-carousel-dot.active")?.classList.remove("active"),document.getElementById(`instafeed-carousel-dot-${t}-${i}-${r}`)?.classList.add("active"),e.src=n[r]}}},function(){window.instafeedSliderMove=(e,t=0)=>{instafeedSettings.sliderState[t]||(instafeedSettings.sliderState[t]={currentTransform:0,minTransform:0});const i=instafeedSettings.sliderState[t],s=Math.ceil(instafeedSettings.totalImages[t]/instafeedSettings.sliderNumVisibleImages[t])-1,n=parseFloat(instafeedSettings.sliderRowSize[t]*s).toFixed(3);i.currentTransform+=e*-instafeedSettings.sliderStepSize[t],i.currentTransform=parseFloat(i.currentTransform.toFixed(3)),i.currentTransform<-n&&(i.currentTransform=i.minTransform),i.currentTransform>i.minTransform&&(i.currentTransform=-n);const o=document.querySelector(`.${r}-new-layout-wrapper[data-feed-id="${t}"]`);let a=i.currentTransform;"rtl"===document.documentElement.dir&&"81c182-2.myshopify.com"!==this.options.shopOrigin&&(a=Math.abs(i.currentTransform)),o&&(o.style.transform=`translateX(${a}px)`)}}(),window.instafeedSettings={},instafeedSettings.version=s,instafeedSettings.sound=!1,instafeedSettings.analyticsViewsClicks=!1,instafeedSettings.modalOpen=null,instafeedSettings.feedViewed={},instafeedSettings.previouslyFocusedElement=null,instafeedSettings.carousels={},instafeedSettings.sliderRowSize={},instafeedSettings.sliderStepSize={},instafeedSettings.sliderNumVisibleImages={},instafeedSettings.sliderState={},instafeedSettings.totalImages={},window.instafeedFeedsLoaded=window.instafeedFeedsLoaded||[],window.instafeedScrollIntervals=window.instafeedScrollIntervals||{},window.instafeedSlideSpeed=window.instafeedSlideSpeed||6e3,window.instafeedPopupsPreloaded=window.instafeedPopupsPreloaded||!1,window.instafeedTrapFocusHandler=window.instafeedTrapFocusHandler||!1,window.instafeedTouchScrollListener=window.instafeedTouchScrollListener||function(e){e.preventDefault()},function(e,t){"use strict";"function"!=typeof e.CustomEvent&&(e.CustomEvent=function(e,i){i=i||{bubbles:!1,cancelable:!1,detail:void 0};var s=t.createEvent("CustomEvent");return s.initCustomEvent(e,i.bubbles,i.cancelable,i.detail),s},e.CustomEvent.prototype=e.Event.prototype),t.addEventListener("touchstart",(function(e){"true"!==e.target.getAttribute("data-swipe-ignore")&&(r=e.target,a=Date.now(),i=e.touches[0].clientX,s=e.touches[0].clientY,n=0,o=0,d=e.touches.length)}),!1),t.addEventListener("touchmove",(function(e){if(i&&s){var t=e.touches[0].clientX,a=e.touches[0].clientY;n=i-t,o=s-a}}),!1),t.addEventListener("touchend",(function(e){if(r===e.target){var p=parseInt(l(r,"data-swipe-threshold","20"),10),c=l(r,"data-swipe-unit","px"),u=parseInt(l(r,"data-swipe-timeout","500"),10),h=Date.now()-a,g="",f=e.changedTouches||e.touches||[];if("vh"===c&&(p=Math.round(p/100*t.documentElement.clientHeight)),"vw"===c&&(p=Math.round(p/100*t.documentElement.clientWidth)),Math.abs(n)>Math.abs(o)?Math.abs(n)>p&&h0?"swiped-left":"swiped-right"):Math.abs(o)>p&&h0?"swiped-up":"swiped-down"),""!==g){var m={dir:g.replace(/swiped-/,""),touchType:(f[0]||{}).touchType||"direct",fingers:d,xStart:parseInt(i,10),xEnd:parseInt((f[0]||{}).clientX||-1,10),yStart:parseInt(s,10),yEnd:parseInt((f[0]||{}).clientY||-1,10)};r.dispatchEvent(new CustomEvent("swiped",{bubbles:!0,cancelable:!0,detail:m})),r.dispatchEvent(new CustomEvent(g,{bubbles:!0,cancelable:!0,detail:m}))}i=null,s=null,a=null}}),!1);var i=null,s=null,n=null,o=null,a=null,r=null,d=0;function l(e,i,s){for(;e&&e!==t.documentElement;){var n=e.getAttribute(i);if(n)return n;e=e.parentNode}return s}}(window,document);if (document.getElementById('insta-feed') !== null) { var feed = new Instafeed({"account":"","hash":"1f43f8aa1a04a05e754e6eb1579ba989","key":"instafeed-9dc894cff78586f9dcba92310d921312","apiVersion":6,"shopOrigin":"my-better-batch.myshopify.com","title":"","openIg":3,"space":0,"corners":0,"likes":0,"showFollowers":0,"showProducts":0,"layout":7,"format":0,"sliderBehavior":0,"instagramLinks":0,"loadingAnimation":0,"showPrices":0,"showReviews":0,"viewsAndClicks":0,"filter":"","taggedPosts":0,"columns":4,"columnsMobile":4,"rows":5,"rowsMobile":5,"autoplay":0,"autoLayout":1,"rowsLimit":4,"abTest":1,"feedId":0,"charge":0}); feed.run(); }return instafeedLoad;})();window.addEventListener('resize',(a=>{let b;return()=>{clearTimeout(b),b=setTimeout(()=>{window.innerWidth!==a&&(a=window.innerWidth,instafeedApp())},100)}})(window.innerWidth));document.addEventListener('shopify:section:load',()=>{instafeedApp()});