PageSourceSearch

https://www.countdown-timer.app/_next/static/chunks/206.c7110d9edbe68d70.js

js countdown-timer.app collected 2026-10-06 08:03:36 UTC 7,582 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[206],{40206:function(e,t,n){n.r(t),n.d(t,{default:function(){return p}});var o=n(85893),a=n(67294),r=n(14186),s=n(7732),l=n(11163);var i=e=>{let{templates:t,onSelect:n,selectedTemplateId:r}=e;const s=(0,a.useRef)(null),[l,i]=(0,a.useState)(!1),[c,d]=(0,a.useState)(!0);(0,a.useEffect)((()=>{const e=()=>{if(!s.current)return;const{scrollLeft:e,scrollWidth:t,clientWidth:n}=s.current;i(e>0),d(e+n<t-10)},t=s.current;if(t)return t.addEventListener("scroll",e),e(),()=>t.removeEventListener("scroll",e)}),[t]);const u=e=>{if(!s.current)return;const t=s.current.scrollLeft;s.current.scrollTo({left:"left"===e?t-250:t+250,behavior:"smooth"})};return(0,o.jsxs)("div",{className:"w-full bg-white rounded-lg shadow-sm p-2 mb-3 relative",children:[(0,o.jsx)("h3",{className:"text-sm font-medium mb-2 text-gray-700",children:"Templates"}),(0,o.jsxs)("div",{className:"relative",children:[l&&(0,o.jsx)("button",{onClick:()=>u("left"),className:"absolute -left-1 top-1/2 -translate-y-1/2 z-10 bg-white/95 shadow-md rounded-full p-1 flex items-center justify-center hover:bg-gray-50 transition-all","aria-label":"Scroll left",children:(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,o.jsx)("path",{d:"M15 18l-6-6 6-6"})})}),c&&(0,o.jsx)("button",{onClick:()=>u("right"),className:"absolute -right-1 top-1/2 -translate-y-1/2 z-10 bg-white/95 shadow-md rounded-full p-1 flex items-center justify-center hover:bg-gray-50 transition-all","aria-label":"Scroll right",children:(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,o.jsx)("path",{d:"M9 18l6-6-6-6"})})}),(0,o.jsx)("div",{ref:s,className:"flex gap-3 overflow-x-auto scrollbar-hide py-1 px-2",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t.map((e=>(0,o.jsxs)("div",{className:"flex-shrink-0 cursor-pointer transition-all duration-200 flex flex-col items-center",onClick:()=>n(e),children:[(0,o.jsx)("div",{className:`w-28 h-28 rounded-md bg-gray-100 bg-contain bg-center bg-no-repeat transition-all duration-200\n                  ${r===e.templateId?"ring-2 ring-indigo-500 ring-offset-1":"border border-gray-200 hover:border-gray-300 hover:shadow-sm"}\n                `,style:{backgroundImage:`url('/assets/images/templates/${e.templateId}.webp')`}}),(0,o.jsx)("p",{className:"mt-1 text-xs text-center font-medium text-gray-700 truncate max-w-[7rem]",children:e.name})]},e.templateId)))})]})]})},c=n(58760),d=n(11927),u=n(36785),f=n(14132),m=n(69864);const g="unauthenticated_countdown_config",h={templateId:"9",primaryColor:"#FFFFFF",orientation:"landscape",backgroundGradient:{from:"#0f0c29",to:"#302b63"},countdown:{interval:"15-minute",displayLabels:!0,daysLabel:"DAYS",hoursLabel:"HOURS",minutesLabel:"MINS",endDate:new Date(Date.now()+54e6)},text1:"YOUR EVENT NAME",text2:"YOU CAN PUT SOME DESCRIPTIVE TEXT HERE",fontFamily:"Familjen Grotesk",backgroundImageOverlay:!1};var p=()=>{const e=(0,l.useRouter)(),[t,n]=(0,a.useState)(h),[p,x]=(0,a.useState)(!1),b=(0,a.useMemo)((()=>c),[]),[w,v]=(0,a.useState)(""),[y,N]=(0,a.useState)(!1);(0,a.useEffect)((()=>{N(!0)}),[]),(0,a.useEffect)((()=>{try{const e=localStorage.getItem(g);if(e){const t=JSON.parse(e);t.countdown&&t.countdown.endDate&&(t.countdown.endDate=new Date(t.countdown.endDate)),n(t)}else{const e=b.find((e=>"9"===e.templateId));e&&S(e)}}catch(e){console.error("Failed to load saved configuration:",e)}}),[y,b]),(0,a.useEffect)((()=>{try{localStorage.setItem(g,JSON.stringify(t))}catch(e){console.error("Failed to save configuration to localStorage:",e)}}),[t]);const S=(0,a.useCallback)((e=>{n((t=>{let n={...t,...e.config,countdown:{...t.countdown,...e.config.countdown,endDate:"3"===e.templateId?new Date(Date.now()+828e5):t.countdown.endDate},templateId:e.templateId};return e.config.backgroundGradient&&!e.config.backgroundImage&&(n.backgroundImage=void 0),n}))}),[]),I=(0,a.useCallback)((()=>{const e={...t,publicationDescription:w};localStorage.setItem(g,JSON.stringify(e)),x(!0)}),[t,w]),j=(0,a.useCallback)((()=>{const n={...t,publicationDescription:w};localStorage.setItem(g,JSON.stringify(n)),localStorage.setItem("should_load_countdown_from_storage","true"),console.log("Debug - Saved config to localStorage before redirecting to sign in"),console.log("Debug - Set should_load_countdown_from_storage flag to true"),x(!1),e.push({pathname:"/auth/sign-in",query:{returnUrl:"/editor?source=unauthenticated"}})}),[e,t,w]),[k,E]=(0,a.useState)(d.default.ORIENTATION_DIMENSIONS.landscape.width),[C,O]=(0,a.useState)(d.default.ORIENTATION_DIMENSIONS.landscape.height);(0,a.useEffect)((()=>{const{width:e,height:n}=d.default.ORIENTATION_DIMENSIONS[t.orientation];E(e),O(n)}),[t.orientation]);
1const{scaleFactor:D,containerRef:_}=((e,t,n,o)=>{const r=(0,a.useRef)(null),[s,l]=(0,a.useState)(1),i=(0,a.useCallback)((()=>{const n=r.current?.offsetWidth||e,o=r.current?.offsetHeight||t,a=n/e,s=o/t,i=Math.min(a,s);l(i)}),[e,t]);return(0,a.useEffect)((()=>(window.addEventListener("resize",i),i(),()=>{window.removeEventListener("resize",i)})),[i]),{scaleFactor:s,containerRef:r}})(k,C,t.templateId,t.orientation),T=(0,a.useMemo)((()=>({aspectRatio:"square"===t.orientation?"1/1":"1.905/1",backgroundColor:t.backgroundColor,width:`${k}px`,height:`${C}px`,transform:`scale(${D})`,fontFamily:t.fontFamily})),[t,k,C,D]);return(0,o.jsxs)("div",{className:"w-full flex flex-col p-0 mb-8 md:mb-0 md:pb-4 md:p-4",style:{background:"radial-gradient(rgb(221 232 243) 12.75%, transparent 0px) 2px 2px / 10px 10px rgb(250 252 254)"},children:[(0,o.jsx)(i,{templates:b,onSelect:S,selectedTemplateId:t.templateId}),(0,o.jsx)("div",{className:"flex justify-start mb-3 border border-primary shadow-lg rounded-lg p-2 bg-white",children:(0,o.jsxs)(u.Z,{onClick:I,className:"space-x-2 bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 text-white shadow-md",children:[(0,o.jsx)(m.Z,{className:"h-5 w-5 inline-block"}),(0,o.jsx)("span",{children:"Publish Countdown"})]})}),(0,o.jsxs)("div",{className:"flex-grow flex md:space-x-4 p-0 h-full items-start justify-start md:flex-row flex-col-reverse",children:[(0,o.jsx)(s.Z,{config:t,setConfig:n,templateConfig:b.find((e=>e.templateId===t.templateId)),isPublicEditor:!0}),(0,o.jsx)("div",{ref:_,className:("landscape"===t.orientation?"w-full":"w-auto max-w-full")+" md:w-auto mb-4 md:mb-0 flex max-h-[550px] relative overflow-hidden shadow-lg rounded-lg self-center md:self-start",style:{aspectRatio:T.aspectRatio},children:(0,o.jsx)(r.default,{canvasStyle:T,config:t,isPublicEditor:!0})})]}),(0,o.jsx)(f.Z,{isOpen:p,setIsOpen:x,heading:"Sign in to publish your countdown",children:(0,o.jsxs)("div",{className:"space-y-4 p-2",children:[(0,o.jsx)("p",{className:"text-sm text-gray-600",children:"Your countdown configuration has been saved locally. To publish it, you need to sign in or create an account."}),(0,o.jsx)("p",{className:"text-sm text-gray-600",children:"After signing in, you'll be redirected back to the editor with your configuration intact."}),(0,o.jsxs)("div",{className:"flex justify-end space-x-2 pt-3",children:[(0,o.jsx)(u.Z,{variant:"outline",onClick:()=>x(!1),children:"Cancel"}),(0,o.jsx)(u.Z,{onClick:j,className:"bg-blue-600 hover:bg-blue-700",children:"Sign in to continue"})]})]})})]})}}}]);

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.