"use strict";(self.webpackChunk_brizy_builder_free=self.webpackChunk_brizy_builder_free||[]).push([["736"],{1515(e,t,n){n.r(t),n.d(t,{default:()=>a});var r=n(1669),o=n.n(r),u=n(2540);let i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"d/m/Y";if(isNaN(Date.parse(e=new Date(e))))return e;let n=e.getFullYear(),r=e.getMonth()+1,o=e.getDate(),u=e.getHours(),i=e.getMinutes(),a=e.getSeconds();return t.replace("Y",n).replace("m",r).replace("d",o).replace("H",u).replace("i",i).replace("s",a)};function a(e){e.find(".brz-countdown2").each(function(){var e=o()(this),t=e.find(".brz-countdown2__days > .brz-countdown2__number"),n=e.find(".brz-countdown2__hours > .brz-countdown2__number"),r=e.find(".brz-countdown2__minutes > .brz-countdown2__number"),a=e.find(".brz-countdown2__seconds > .brz-countdown2__number"),c=e.find(".brz-countdown2-message");let d=e.attr((0,u.uo)("end")),s=e.attr((0,u.uo)("hours")),l=e.attr((0,u.uo)("minutes")),f=d.split("/"),w=function(e,t,n){let[r,o]=t.split(" "),u=6e4*new Date().getTimezoneOffset();return!function(e){let t=/^(\d{1,2})[-\/](\d{1,2})[-\/](\d{4})$/.exec(e);if(null===t)return!1;let n=t[2],r=t[1]-1,o=t[3],u=new Date(o,r,n);return u.getDate()==n&&u.getMonth()==r&&u.getFullYear()==o}(e)?new Date(0).getTime():new Date(`${e} ${r}:${n} ${o}`).getTime()-u}(i(`${f[1]}/${f[0]}/${f[2]}`,"m/d/Y"),s,l);var _=e.attr((0,u.uo)("timezone")),b=e.attr((0,u.uo)("link-type")),m=e.attr((0,u.uo)("redirect")),h=e.attr((0,u.uo)("action")),g=function(e){return e>=0&&e<=9?"0"+e:e};e.countdown2({now:Date.now(),endDate:w,timeZoneOffset:6e4*_,tickInterval:1e3,onTick:function(o){t.text(g(o.days)),n.text(g(o.hours)),r.text(g(o.minutes)),a.text(g(o.seconds)),Object.values(o).every(e=>0===e)&&("redirect"===b?window.location.href=m:"showMessage"===h?c.show():"linkAction"===b&&"none"===h?e.removeAttr((0,u.uo)("message")).removeAttr((0,u.uo)("redirect")).removeAttr((0,u.uo)("hide")):"linkAction"===b&&"hide"===h&&e.hide())}})})}}}]);