PageSourceSearch

https://app.simplified.com/static/js/5063.e586f9f6.chunk.js

js simplified.com collected 2026-10-01 11:36:12 UTC 30,681 bytes, 5 lines download raw bytes

1"use strict";(self.webpackChunksimplified_web=self.webpackChunksimplified_web||[]).push([[5063],{876120:(e,t,l)=>{l.d(t,{tD:()=>n,vK:()=>s});var o=l(313773),i=l(104399),a=l(501271);const n=()=>async(e,t)=>{const l=t();let n=null===l||void 0===l?void 0:l.apps;try{var s,d,r,c,u,p,v,m,h,g,w,_;!n&&null!==l&&void 0!==l&&l.auth&&(n=await e((x=null===(s=l.auth)||void 0===s||null===(d=s.payload)||void 0===d||null===(r=d.user)||void 0===r?void 0:r.pk,async e=>{try{const e=await(0,o.rnV)({fields:"",expand:"features,t_plan,extra,android",pagination:"false",omit:"t_plan.feature_list",user:x});if(e.data.length>0){let t={};return e.data.forEach(e=>{e.t_plan&&(t[e.t_plan.product_env]={...e})}),t}}catch(t){e((0,a.iM)(t))}})));const t=(null===l||void 0===l||null===(c=l.auth)||void 0===c||null===(u=c.payload)||void 0===u||null===(p=u.user)||void 0===p||null===(v=p.context)||void 0===v||null===(m=v.ui_state)||void 0===m?void 0:m.selected_product)||i.ENVIRONMENT_ROOT.design,T=(null===(h=n)||void 0===h?void 0:h[t])||(null===(g=n)||void 0===g?void 0:g[i.PRODUCTS.ALL])||(null===(w=n)||void 0===w?void 0:w[i.PRODUCTS.FREE_TOOLS]),f=(0,i.hasPaidSubscription)(n);return{isAuthenticated:null===l||void 0===l||null===(_=l.auth)||void 0===_?void 0:_.isAuthenticated,isFreePlan:!f,selectedApp:t,selectedAppSubscription:T}}catch(T){console.error(T)}var x},s=e=>{var t;return(null===e||void 0===e?void 0:e.image)||(null===e||void 0===e||null===(t=e.thumbnails)||void 0===t?void 0:t[0])}},439420:(e,t,l)=>{l.d(t,{Z:()=>T,g:()=>x});var o=l(683017),i=l(351839),a=l(349798),n=l(298249),s=l(270858),d=l(741065),r=l(408499),c=l(104399),u=l(764293),p=l(943658),v=l(308686),m=l(514077),h=l(593329),g=l(659840),w=l(228993);const _=e=>{var t;let{item:l,isCreating:s,onClickHandler:d}=e;const{t:v}=(0,r.$)(["common","workspace","planner","accounts"]),{checkFeatureAvailability:h}=(0,p.Z)(),[g]=(0,c.useLocalStorage)(c.LAST_SELECTED_SECTION_KEY),_=(0,u.v9)(e=>{var t,l,o,i;return null===(t=e.auth.payload)||void 0===t||null===(l=t.user)||void 0===l||null===(o=l.context)||void 0===o||null===(i=o.ui_state)||void 0===i?void 0:i.selected_product})||g,x=(0,o.useMemo)(()=>h(null===l||void 0===l?void 0:l.featureCode),[null===l||void 0===l?void 0:l.featureCode,h]);return(0,w.jsxs)(i.k,{pos:"relative",children:[(0,w.jsx)(a.z,{variant:null!==(t=null===l||void 0===l?void 0:l.btnVariant)&&void 0!==t?t:"secondary",isLoading:s===l.key,onClick:()=>{d(l),(0,c.analyticsTrackEvent)(l.trackEvent,{env:_})},leftIcon:(0,w.jsx)(n.J,{color:"solid"!==(null===l||void 0===l?void 0:l.btnVariant)?null===l||void 0===l?void 0:l.sectionColor:void 0,as:null===l||void 0===l?void 0:l.icon}),children:l.title||v(l.key,{ns:l.translation})}),(null===l||void 0===l?void 0:l.featureCode)&&!x&&(0,w.jsx)(m.lBU,{sx:{fontSize:"md",position:"absolute",top:-1,left:-1}}),(null===l||void 0===l?void 0:l.badge)&&(0,w.jsx)(m.spe,{containerProps:{position:"absolute",right:-1,top:-1}})]})},x=e=>{let{title:t,showHeader:l=!0,headerProps:o,innerProps:a,containerProps:n,children:r,actions:c=null}=e;return(0,w.jsxs)(s.x,{pb:4,position:"relative",...n,children:[l&&(0,w.jsxs)(i.k,{w:"full",gap:"2",align:"center",justify:"space-between",minH:"9",mb:[2,2,2,3],...o,children:[(0,w.jsx)(i.k,{direction:"column",gap:1,children:t&&(0,w.jsx)(d.x,{as:"h1",color:"content_inactive",fontSize:["xl","xl","xl","3xl"],fontWeight:"medium",children:t})}),c]}),r&&(0,w.jsx)(i.k,{mb:[2,2,2,3],...a,children:r})]})},T=e=>{var t;let{customTitle:l,list:a,onClick:n,isCreating:s,showTitle:d=!0,cardStyle:p,containerStyle:m,headerProps:T,withAnimations:f=!1,selectedProduct:b}=e;const{t:S}=(0,r.$)(["common","navbar"]),P=(0,g.k6)(),{workspacePermissions:E}=(0,u.v9)(e=>{var t,l,o;return{workspacePermissions:null===(t=e.auth.payload)||void 0===t||null===(l=t.user)||void 0===l||null===(o=l.workspace_role)||void 0===o?void 0:o.permissions}}),C=(0,o.useCallback)(e=>null===E||void 0===E?void 0:E.includes(e),[E])(c.BETA_ACCESS_PERMISSION),y=(0,o.useMemo)(()=>{var e;return c.GENERATE_WITH_AI_CATEGORIES[b]?null===(e=Object.keys(c.GENERATE_WITH_AI_CATEGORIES[b]))||void 0===e?void 0:e.map(e=>({value:e,label:S(`generate_with_ai_section_categories.${e}`,{ns:"common"})})):[]},[b]),M=e=>{e.onClick?e.onClick():e.path!==c.CREATE_NEW?(0,c.handleToolsPathRedirection)(e,P):n(e)};return(0,w.jsx)(x,{title:l||void 0,showHeader:d,containerProps:m,headerProps:T,innerProps:f?{as:v.E.div,variants:{visible:{opacity:1,transition:{duration:.1,staggerChildren:.08,when:"beforeChildren"}},initial:{opacity:0,transition:{when:"afterChildren"}}},animate:"visible",initial:"initial"}:{},children:(0,w.jsx)(i.k,{direction:"column",gap:4,w:"full",align:"flex-start",children:(null===y||void 0===y?void 0:y.length)>0&&(0,w.jsx)(h.f,{activeSection:b,toolsListWrapperProps:{overflow:"hidden",overflowX:"auto",gap:"20px",pt:1,w:"full",align:"center",justify:"flex-start"},cardWrapperProps:{h:"180px",borderRadius:"20px"},cardImageWrapperProps:{h:"110px",minH:void 0},onCardSelectHandler:e=>{},actions:(0,w.jsx)(i.k,{direction:"row",gap:2,children:null===a||void 0===a||null===(t=a.filter(e=>!(null!==e&&void 0!==e&&e.isBeta)||(null===e||void 0===e?void 0:e.isBeta)&&C))||void 0===t?void 0:t.map(e=>(0,w.jsx)(_,{item:e,isCreating:s,onClickHandler:M},e.key))})})})})}},849921:(e,t,l)=>{l.d(t,{c:()=>s});var o=l(692877),i=l(351839),a=l(514077),n=l(228993);const s=()=>{const e=(0,o.S)({base:!0,md:!1}),t=(0,o.S)({base:!0,md:!0,lg:!1});return(0,n.jsx)(i.k,{my:3,pos:"relative",zIndex:0,children:(0,n.jsx)(a.giQ,{layout:"flex",skeletonHeight:"258px",skeletonWidth:"full",wrap:"nowrap",length:e?2:t?3:5})})}},427876:(e,t,l)=>{l.d(t,{Z:()=>h});var o=l(683017),i=l(351839),a=l(379274),n=l(408499),s=l(135642),d=l(104399),r=l(514
1077),c=l(764293),u=l(310853),p=l(659840),v=l(228993);const m={slidesPerView:2,lazy:!0,mousewheel:!1,containerModifierClass:"recent-template-swiper-",breakpoints:{1800:{slidesPerView:7.5,spaceBetween:20},1600:{slidesPerView:6.5,spaceBetween:20},1440:{slidesPerView:6,spaceBetween:20},1200:{slidesPerView:5,spaceBetween:20},1024:{slidesPerView:4,spaceBetween:20},768:{slidesPerView:3,spaceBetween:10},640:{slidesPerView:3,spaceBetween:10},500:{slidesPerView:2.5,spaceBetween:10},380:{slidesPerView:2,spaceBetween:10}}},h=e=>{let{selectedProduct:t,showViewAll:l=!0,mode:h="regular",containerProps:g,swiperParams:w=m}=e;const _=(0,p.k6)(),{t:x}=(0,n.$)(["common","similar-tools","navbar"]),T=(0,a.TH)(),f=(0,c.I0)(),b=(0,o.useMemo)(()=>(0,d.isMobileApp)(),[]),S=(0,o.useMemo)(()=>d.QUICK_TOOLS_LIST.filter(e=>!(null!==e&&void 0!==e&&e.hideFromSwiper)),[]),P=(0,o.useMemo)(()=>t?S.filter(e=>x(e.env,{ns:"navbar"})===x(`main_menu.${t}`,{ns:"navbar"})):S,[t,x,S]);return(0,v.jsxs)(i.k,{direction:"column",gap:2,mb:8,...g,children:[(0,v.jsx)(r.M4A,{title:x("intro_page.quick_tools"),viewAllHandler:()=>{b?f((0,u.of)({show:!0,filter:t})):_.replace({pathname:T.pathname,search:`open=${d.MODAL_ALL_QUICK_TOOLS}`,state:{from:d.MODAL_OPEN_FROM_STATE,filter:null!==t&&void 0!==t?t:null}})},showToggleSwitch:l,translations:{viewAll:x("view_all"),forYou:x("for_you"),showAll:x("show_all")}}),(0,v.jsx)(s.Z,{swiperParams:w,children:P.slice(0,8).map((e,t)=>(0,v.jsx)(r.dYE,{t:x,tool:e,onClick:()=>{(0,d.analyticsTrackEvent)(e.trackEvent),d.SSR_ROUTES.includes(e.path)?window.location.href=e.path:_.push(e.path)},onSwiper:!0,titleSize:"sm",mode:h},t))})]})}},166926:(e,t,l)=>{l.d(t,{Z:()=>h});var o=l(576654),i=l(135642),a=l(105029),n=l(926592),s=l(764293),d=l(408499),r=l(270858),c=l(791048),u=l(311685),p=l(514077),v=l(228993);let m={slidesPerView:"auto",mousewheel:!1,breakpoints:{1800:{slidesPerView:8,spaceBetween:20},1600:{slidesPerView:7.5,spaceBetween:20},1440:{slidesPerView:6.5,spaceBetween:20},1200:{slidesPerView:5.5,spaceBetween:20},1024:{slidesPerView:4.5,spaceBetween:20},768:{slidesPerView:4,spaceBetween:20},500:{slidesPerView:3.5,spaceBetween:10},320:{spaceBetween:10}}};const h=e=>{var t,l,h;const{url:g,toggleTemplatePreviewModal:w}=e,{t:_}=(0,d.$)(["common"]),x=(0,s.v9)(e=>e.stories),T=(0,u.Z)();let f=[];null!==x&&void 0!==x&&x.payload&&(null===(t=x.payload)||void 0===t?void 0:t.length)>0&&(f=x.payload.map((e,t)=>{const{id:l,image_height:i,image_width:s}=e;return(0,v.jsx)(o.Sp,{location:"template-marketplace",height:i,width:s,children:(0,v.jsx)(a.Z,{story:e,tab:n.gAK,showHoverOverlay:!0,toggleTemplatePreviewModal:w,hasPremiumAccess:!T})},l||t)}));let b=4,S=1;if((null===x||void 0===x||null===(l=x.payload)||void 0===l?void 0:l.length)>0){var P,E;S=(null===x||void 0===x||null===(P=x.payload[0])||void 0===P?void 0:P.image_width)/(null===x||void 0===x||null===(E=x.payload[0])||void 0===E?void 0:E.image_height);const e=6;b=(S>=6?4.5:S>=2?3.5:1===S?5.5:S>=1?e/S:S<.3?12:S<.9&&S>.8?8:e*(S+.4))||"auto"}return(0,v.jsx)(v.Fragment,{children:f.length>0&&(null===x||void 0===x||null===(h=x.payload)||void 0===h?void 0:h.length)>0&&(0,v.jsxs)(r.x,{mb:8,w:"full",children:[(0,v.jsx)(p.M4A,{title:_("featured_templates.explore"),viewAllHandler:()=>{window.location.href=encodeURI(g)},translations:{viewAll:_("view_all"),forYou:_("for_you"),showAll:_("show_all")}}),(0,v.jsx)(i.Z,{swiperParams:{...m,containerModifierClass:"featured-template-swiper-",slidesPerView:(0,c.isNumber)(b)?b.toFixed(1):b,breakpoints:{...m.breakpoints,480:{slidesPerView:S>1.5?3:2},320:{...m.breakpoints[320],slidesPerView:S>1.5?2:3}}},children:f})]})})}},632080:(e,t,l)=>{l.d(t,{Z:()=>L});var o=l(587383),i=l(691275),a=l(351839),n=l(270858),s=l(11254),d=l(295903),r=l(179822),c=l(129944),u=l(298249),p=l(880745),v=l(741065),m=l(692877),h=l(878818),g=l(828865),w=l(524943),_=l(807523),x=l(53004),T=l(177612),f=l(677360),b=l(921902),S=l(683017),P=l(408499),E=l(778145),C=l(193691),y=l(135642),M=l(104399),A=l(514077),j=l(228993);const k={slidesPerView:3,freeMode:!0,mousewheel:!1,containerModifierClass:"tutorial-video-swiper-",breakpoints:{1800:{slidesPerView:7.5,spaceBetween:20},1600:{slidesPerView:6.5,spaceBetween:20},1440:{slidesPerView:6,spaceBetween:20},1200:{slidesPerView:5,spaceBetween:20},1024:{slidesPerView:4,spaceBetween:20},768:{slidesPerView:3,spaceBetween:10},640:{slidesPerView:3,spaceBetween:10},500:{slidesPerView:2.5,spaceBetween:10},380:{slidesPerView:2,spaceBetween:10}}},O=e=>{let{video:t,onLoad:l,onClick:m,isLoaded:h}=e;const[g,w]=(0,o.k)(),_=(0,i.ff)("base_level_3","base_level_2");return(0,j.jsxs)(a.k,{direction:"column",w:"full",h:"full",_hover:{cursor:"pointer",border:"1px solid",borderColor:"content_alpha_400"},onClick:m,borderRadius:"lg",border:"1px solid",borderColor:"content_alpha_100",onMouseEnter:w.on,onMouseLeave:w.off,pos:"relative",children:[(0,j.jsxs)(n.x,{pos:"relative",_before:g?{content:"''",position:"absolute",width:"100%",height:"100%",top:0,left:0,background:"rgba(0,0,0,0.3)",zIndex:1}:{},children:[(0,j.jsx)(s.o,{ratio:16/9,overflow:"hidden",borderTopRadius:"lg",children:(0,j.jsx)(d.O,{isLoaded:h,borderTopRadius:"lg",children:(0,j.jsx)(r.E,{src:t.thumbUrl,alt:t.title,objectFit:"cover !important",onLoad:l})})}),(0,j.jsx)(c.M,{position:"absolute",inset:"0",zIndex:1,children:(0,j.jsx)(d.O,{isLoaded:h,borderRadius:"lg",children:(0,j.jsx)(n.x,{px:["2","2","3","4"],py:["1","1","2","2"],borderRadius:"lg",bgColor:"blackAlpha.800",children:(0,j.jsx)(u.J,{as:E.FaPlay,fontSize:["xs","sm","lg","xl"],color:"white"})})})})]}),(0,j.jsx)(n.x,{borderTop:"1px solid",borderColor:"content_alpha_100",bgColor:_,borderBottomRadius:"lg",p:2,h:"full",children:(0,j.jsx)(p.N,{isLoaded:h,noOfLines:2,children:(0,j.jsx)(v.x,{fontSize:"sm",color:"content_inactive",noOfLines:2,children:t.title})})})]})};const L=function(e){let{videoList:t,containerProps:l={},swiperParams:i=k}=e;const{t:s}=(0,P.$)(["common"]),[r,c]=(0,S.useState)(null),u=(0,m.S)({base:!0,md:!1}),[p,E]=(0,o.k)(!1),L=t.map(e=>(0,j.jsx)(O,{video:e,isLoaded:p,onLoad:E.on,onClick:()=>c(e)},e.url));return(0,j.jsxs)(n.x,{mb:4,...l,children:[(0,j.jsxs)(a.k,{w:"full",gap:"2",alignItems:"center",minH:"9",mb:"2",children:[(0,j.jsx)(n.x,{children:(0,j.jsxs)(d.O,{isLoaded:p,children:[(0,j.jsx)(v.x,{display:["none","none","none","block"],color:"content_details",fontSize:"xs",children:s("featured_templates.learn_heading")}),(0,j.jsx)(v.x,{fontSize:u?"md":"xl",fontWeight:"medium",color:"content_inactive",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",maxW:["280px","280px","450px","600px"],children:s("tutorials.title")})]})}),(0,j.jsx)(h.u,{label:s("tutorials.go_to_academy"),placement:"top",hasArrow:!0,children:(0,j.jsx)(d.O,{isLoaded:p,borderRadius:"full",children:(0,j.jsx)(g.h,{onClick:()=>(0,M.openUrl)(M.ACADEMY_LINK,"_blank"),icon:(0,j.jsx)(C.D3e,{}),alignItems:"center",size:"sm",cursor:"pointer",color:"content_inactive",rounded:"full","aria-label":"view all"})})})]}),(0,j.jsx)(y.Z,{swiperParams:i,children:L}
1),r?(0,j.jsxs)(w.u_,{autoFocus:!1,returnFocusOnClose:!1,isOpen:!0,onClose:()=>c(null),size:"2xl",children:[(0,j.jsx)(_.Z,{}),(0,j.jsxs)(x.h,{children:[(0,j.jsx)(T.x,{children:r.title}),(0,j.jsx)(f.f,{pb:"6",children:(0,j.jsx)(A.HeH,{title:r.title,embedId:r.url,autoPlay:!0})}),(0,j.jsx)(b.o,{})]})]}):null]})}},105029:(e,t,l)=>{l.d(t,{Z:()=>Z});var o=l(683017),i=l(764293),a=l(317772),n=l(499228),s=l(664991),d=l(480050),r=l.n(d);const c=l(607881).ZP.div`
2  overflow-y: auto;
3  height: calc(100% - 36px); // 36px is height of search box
4`;var u=l(231705),p=l(143925),v=l(476549),m=l.n(v),h=l(919941),g=l(146238),w=l(76721),_=l(524943),x=l(807523),T=l(53004),f=l(177612),b=l(921902),S=l(902352),P=l(677360),E=l(270858),C=l(357023),y=l(773414),M=l(349798),A=l(408499),j=l(104399),k=l(228993);const O=function(e){const{t:t}=(0,A.$)(["common"]);let l=r().CancelToken.source();const[i,a]=(0,o.useState)({edges:[],pageInfo:{}}),[s,d]=(0,o.useState)({}),[v,O]=(0,o.useState)(!1),[L,I]=(0,o.useState)(!1),[D,R]=(0,o.useState)(!0);function V(e,t){R(!0),r().post(u.MSI,{cursor:e,query:t},{cancelToken:l.cancelToken}).then(e=>{R(!1);var t={...i,edges:i.edges.concat(e.data.data.products.edges),pageInfo:e.data.data.products.pageInfo};a(t)}).catch(e=>{R(!1),e.response.status===j.HTTP_STATUS_NOT_FOUND_404&&I(!0)})}(0,o.useEffect)(()=>(V(null,null),()=>{l.cancel("The user aborted a request.")}),[]);const B=i&&i.edges&&i.edges.map((e,t)=>{const l={mime:"image",payload:{},content:{meta:(0,h.r3)(w.PJw.SHOPIFY,e)}};return(0,k.jsx)(k.Fragment,{children:(0,k.jsxs)("div",{className:"item-product-div",children:[(0,k.jsx)("div",{className:void 0!==s[e.node.id]?"item-product active":"item-product",onClick:()=>{return t=e,void d({...s,[t.node.id]:t});var t},"data-grid-groupkey":e.groupKey,children:e.node.featuredImage&&(0,k.jsx)(n.mR,{data:l,url:e.node.featuredImage.originalSrc,alt:e.alt_description,width:100,height:100,source:w.rRR.SHOPIFY,showOverlayInfo:!0},`${e.id}_${Date.now()}`)},`${e.id}_${t}`),(0,k.jsx)("div",{className:"title",children:e.node.title})]},t)})});return(0,k.jsxs)(_.u_,{isOpen:!0,onClose:e.onHide,size:"3xl",isCentered:!0,children:[(0,k.jsx)(x.Z,{}),(0,k.jsxs)(T.h,{children:[(0,k.jsx)(f.x,{children:t("select_products")}),(0,k.jsx)(b.o,{}),(0,k.jsx)(S.i,{my:"1"}),(0,k.jsx)(P.f,{children:L?t("connect_with_shopify"):i.edges.length>0?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(p.Z,{onSearch:function(e){a({edges:[],pageInfo:{}}),V(null,e)},placeholder:t("search.search_products"),width:"250px"}),i.edges.length>0?(0,k.jsx)(E.x,{as:c,mt:4,id:"shopifyProductList",overflowY:"auto",children:(0,k.jsx)(g.Z,{className:"guided-infinite-scroll",hasMore:i.pageInfo.hasNextPage,loadMoreData:function(){V(i.edges[i.edges.length-1].cursor,null)},loaded:!1,scrollableTarget:"shopifyProductList",children:B})}):(0,k.jsx)(E.x,{mt:4,mb:4,textAlign:"center",children:t("search.no_products")})]}):(0,k.jsx)(n.Lk,{})}),(0,k.jsx)(S.i,{my:"1"}),(0,k.jsx)(C.m,{children:(0,k.jsxs)(y.h,{children:[(0,k.jsx)(M.z,{onClick:t=>{t.stopPropagation(),e.onHide()},variant:"outline",disabled:!1,children:t("cancel")}),L?(0,k.jsx)(M.z,{onClick:function(){window.location=j.MY_APPS},variant:"solid",children:t("go_to_settings")}):(0,k.jsxs)(M.z,{onClick:function(){O(!0);let t=[];for(const[e]of Object.entries(s))t.push((0,h.$c)(e));r().post(m()(u.G9W,e.templateId),t,{cancelToken:l.cancelToken}).then(t=>{O(!1),e.onComplete(t)}).catch(e=>{O(!1)})},variant:"solid",disabled:v||0===Object.entries(s).length,isLoading:v,children:[t("generate_assets"),"("+Object.entries(s).length+")"]})]})})]})]})};var L=l(700382),I=l(369843),D=l(791048),R=l(224562),V=l(514077),B=l(313773),N=l(501271),U=l(778145),H=l(659840);class F extends o.Component{constructor(e){super(e),this.signal=r().CancelToken.source(),this.abortController=new AbortController,this.onClick=e=>{const{toggleTemplatePreviewModal:t}=this.props;t(e,this.onUseTemplate)},this.fetchTemplatePageIds=e=>{(0,B.BEf)(e).then(e=>{var t,l;return this.setState({pageIds:null===(t=e.data)||void 0===t||null===(l=t.payload)||void 0===l?void 0:l.pages})}).catch(e=>{(0,N.iM)(e)})},this.handleCloneTemplate=async e=>{var t,l,o,i,a;const{story:n}=this.props;this.setState({isContextSelectionOpen:!1,inProgress:!0,showCloneModal:!0});let s=[];if((null===(t=n.thumbnails)||void 0===t?void 0:t.length)>1)try{var d,c;s=null===(d=(await(0,B.BEf)(n.id)).data)||void 0===d||null===(c=d.payload)||void 0===c?void 0:c.pages}catch(v){(0,N.iM)(v)}const u={artboards:s.length>1?[s[0].id]:[],target:null!==(l=null===e||void 0===e?void 0:e.spaceId)&&void 0!==l?l:null===e||void 0===e?void 0:e.workspaceId}
4,p=null===(o=JSON.parse(localStorage.getItem(j.STORE_LOCAL_STORAGE_KEY)).auth)||void 0===o||null===(i=o.payload)||void 0===i?void 0:i.selectedOrg;if((null===(a=r().defaults.headers.common)||void 0===a?void 0:a.Organization)!==p){const e=(0,j.getAuthToken)();(0,j.setAxiosAuthHeaders)(e,p)}this.props.cloneTemplate(n.id,u,this.props,this.abortController.signal,!0).finally(()=>{this.setState({inProgress:!1,showCloneModal:!1})}),(0,j.analyticsTrackEvent)("cloneTemplate",{template:n.id,is_premium:n.is_premium,template_category:n.category,template_category_id:n.category_id,template_format_id:n.format_id,template_format_title:n.format_title,template_format_category:n.format_category})},this.onUseTemplate=(0,D.debounce)(()=>{const{auth:e,story:t,spacePermissionChecks:l,t:o}=this.props,{canCreateStory:i}=l;if(!i)return void(0,V.CFj)({description:I.VW,title:o("limited_access",{ns:"common"}),status:"info"});if(t.tags.includes("shopify"))this.setState({startGuidedTour:!0});else{var a,n,s,d,r,c;if((null===e||void 0===e||null===(a=e.payload)||void 0===a||null===(n=a.orgs)||void 0===n?void 0:n.length)>1||1===(null===(s=e.payload)||void 0===s||null===(d=s.orgs)||void 0===d?void 0:d.length)&&(null===(r=e.payload)||void 0===r||null===(c=r.spaces)||void 0===c?void 0:c.length)>0)return void this.setState({isContextSelectionOpen:!0});this.handleCloneTemplate()}},I.$V),this.state={inProgress:!1,showCloneModal:!1,startGuidedTour:!1,pageIds:[],isContextSelectionOpen:!1}}componentWillUnmount(){this.signal.cancel("The user aborted a request."),this.abortController.abort()}render(){var e,t,l,o,i,s,d,r,c,u,p,v,m;const{inProgress:h,showCloneModal:g,startGuidedTour:w,isContextSelectionOpen:_}=this.state,{story:x,t:T,hasPremiumAccess:f,auth:b}=this.props;return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(a.b,{children:[(0,k.jsx)(V.woN,{template:x,usedInSSR:!1,onClick:()=>this.onClick(x),t:T,hasPremiumAccess:f}),(0,k.jsx)(n.MS,{inProgress:h,show:g,onHide:()=>{this.setState({...this.state,showCloneModal:!1})},onYes:()=>{this.setState({inProgress:!0})}}),w&&(0,k.jsx)(O,{onComplete:e=>{this.setState({...this.state,startGuidedTour:!1},()=>{var t,l;this.props.redirect((0,j.generateStoryPath)(null===(t=e.data)||void 0===t?void 0:t.story_type,{org:(null===(l=e.data)||void 0===l?void 0:l.space)||e.data.organization,designId:e.data.id,name:(0,j.slugify)(e.data.title)}),this.props)})},onHide:()=>{this.setState({...this.state,startGuidedTour:!1})},templateId:this.props.story.id})]}),_&&(0,k.jsx)(V.qvm,{isOpen:_,onClose:()=>{this.setState({isContextSelectionOpen:!1})},isLoading:h,onCtaClick:this.handleCloneTemplate,ctaIcon:U.FaClone,translations:{loadingText:`${T("loading")}...`,modalHeading:T("clone_template.heading.template",{ns:"common"}),modalDescription:T("clone_template.description.template",{ns:"common"}),ctaLabel:T("clone",{ns:"common"}),cancelLabel:T("cancel",{ns:"common"}),workspaceSelectLabel:T("select_workspace",{ns:"common"}),teamspaceSelectLabel:T("select_space",{ns:"common"})},currentContext:{currentWorkspace:null!==(e=null===b||void 0===b||null===(t=b.payload)||void 0===t||null===(l=t.user)||void 0===l||null===(o=l.context)||void 0===o||null===(i=o.ui_state)||void 0===i?void 0:i.workspace)&&void 0!==e?e:null===b||void 0===b||null===(s=b.payload)||void 0===s?void 0:s.selectedOrg,currentTeamspace:null!==(d=null!==(r=null===b||void 0===b||null===(c=b.payload)||void 0===c||null===(u=c.user)||void 0===u||null===(p=u.context)||void 0===p||null===(v=p.ui_state)||void 0===v?void 0:v.space)&&void 0!==r?r:null===b||void 0===b||null===(m=b.payload)||void 0===m?void 0:m.selectedSpace)&&void 0!==d?d:null}})]})}}const Z=(0,R.Z)(["studio","templates"])((0,i.$j)(e=>({errors:e.errors,spacePermissionChecks:e.permissions.spacePermissionChecks,auth:e.auth}),e=>({cloneTemplate:(t,l,o,i,a)=>e((0,s.jC)(t,l,o,i,a)),redirect:(t,l)=>e((0,L.uX)(t,l))}))((0,H.EN)(F)))},685063:(e,t,l)=>{l.r(t),l.d(t,{default:()=>B});var o=l(683017),i=l(764293),a=l(408499),n=l(480050),s=l.n(n),d=l(104399),r=l(514077),c=l(569416),u=l(562258),p=l(664991),v=l(3292),m=l(166926),h=l(66134),g=l(632080),w=l(313773),_=l(692877),x=l(587383),T=l(904728),f=l(576654),b=l(105029),S=l(926592),P=l(499228),E=l(379274),C=l(791048),y=l(849921),M=l(501271),A=l(439420),j=l(709108),k=l(427876),O=l(311685),L=l(370336),I=l(46750),D=l(876120),R=l(659840),V=l(228993);const B=(0,u.Z)(()=>{var e,t,l,n,u,B,N,U,H,F,Z,$,W,z,G,K,Y;const{t:q}=(0,a.$)(["common","navbar","folders","studio","tools","ai","accounts","billing","templates"]),J=(0,i.I0)(),X=s().CancelToken.source(),Q=(0,_.S)({base:!0,md:!1},"lg"),{pathname:ee}=(0,E.TH)(),te=(0,R.k6)(),le=(0,O.Z)(),oe=(0,L.Z)(),ie=[{title:q("learn_section.animated_design.video_title_1",{ns:"common"}),thumbUrl:"https://i.ytimg.com/vi_webp/d7C0RE1YcDc/hqdefault.webp",url:"https://www.youtube.com/embed/d7C0RE1YcDc"},{title:q("learn_section.animated_design.video_title_2",{ns:"common"}),thumbUrl:"https://i.ytimg.com/vi_webp/xxPbS3WXgL4/hqdefault.webp",url:"https://www.youtube.com/embed/xxPbS3WXgL4"},{title:q("learn_section.animated_design.video_title_3",{ns:"common"}),thumbUrl:"https://i.ytimg.com/vi_webp/Z19BMerKgSU/hqdefault.webp",url:"https://www.youtube.com/embed/Z19BMerKgSU"},{title:q("learn_section.animated_design.video_title_4",{ns:"common"}),thumbUrl:"https://i.ytimg.com/vi_webp/osGfTBKlELk/hqdefault.webp",url:"https://www.youtube.com/embed/osGfTBKlELk"}],[ae,ne]=(0,o.useState)([]),[se,de]=(0,x.k)(!0),[re,ce]=(0,o.useState)({showTemplateModal:!1,templateModalDetail
4:{},onUseTemplate:null}),[ue,pe]=(0,x.k)();let ve=[];var me;(null===ae||void 0===ae||null===(e=ae.results)||void 0===e?void 0:e.length)>0&&(ve=null===ae||void 0===ae||null===(me=ae.results)||void 0===me?void 0:me.slice(0,d.RECENT_PROJECT_TO_SHOW));const he=(0,o.useCallback)((e,t)=>{ce({showTemplateModal:!re.showTemplateModal,templateModalDetail:e,onUseTemplate:t})},[ce,re]),ge=(0,o.useCallback)(()=>{de.on(),(0,w.dp)(d.ANIMATED_STORY,X.token).then(e=>{ne(e.data)}).catch(e=>{(0,M.iM)(e)}).finally(()=>de.off())},[]),we=(0,o.useCallback)(e=>{J((0,p.t)()),J((0,p.ax)("",e,null,1,{},X.token))},[]);(0,o.useEffect)(()=>{let e=!0;return de.on(),(0,w.dp)(d.ANIMATED_STORY,X.token).then(t=>{e&&ne(t.data)}).catch(e=>{(0,M.iM)(e)}).finally(()=>{e&&de.off()}),we("instagram-reels"),J((0,v.pE)("",X.token)),()=>{e=!1,X.cancel("The user aborted a request.")}},[]);const[_e,xe]=(0,o.useState)(d.INITIAL_SIMILAR_TEMPLATES),Te=()=>{(e=>{var t,l,o;(0,w.kHe)(null===re||void 0===re||null===(t=re.templateModalDetail)||void 0===t?void 0:t.tags,e,null===re||void 0===re||null===(l=re.templateModalDetail)||void 0===l?void 0:l.format_title,null===re||void 0===re||null===(o=re.templateModalDetail)||void 0===o?void 0:o.story_type).then(e=>{xe(t=>{var l,o;return{...t,hasMore:null!==(null===e||void 0===e||null===(l=e.data)||void 0===l?void 0:l.next),results:[..._e.results,...e.data.results],page:null!==(null===e||void 0===e||null===(o=e.data)||void 0===o?void 0:o.next)?_e.page+1:_e.page,isLoading:!1}})}).catch(e=>(0,M.iM)(e))})(_e.page)},fe=(e,t)=>{var l;null===(l=document)||void 0===l||l.getElementById("preview-modal-header").scrollIntoView({behavior:"smooth"}),ce({showTemplateModal:!0,templateModalDetail:e,onUseTemplate:t})},be=ee,Se=(0,o.useCallback)(()=>{be&&!(0,d.checkIfURLReplaceState)()&&window.history.replaceState(null,"",be)},[be]),Pe=window.location.hostname,Ee=(0,o.useCallback)(()=>{d.ALLOWED_HOST_TO_REPLACE_URL.includes(Pe)&&(0,d.replaceWindowURLState)(d.VIDEO_TEMPLATES,null===re||void 0===re?void 0:re.templateModalDetail)},[null===re||void 0===re?void 0:re.templateModalDetail,Pe]),[Ce,ye]=(0,o.useState)(void 0),Me=(0,o.useCallback)(()=>{if((0,d.analyticsTrackEvent)("editTemplateUsingAI"),le)return void pe.on();const e=(0,D.vK)(null===re||void 0===re?void 0:re.templateModalDetail);e&&ye(e)},[re,le,pe]),Ae=(0,o.useCallback)(async e=>{let{data:t,name:l}=e;(0,d.downloadFile)(t,l||"edited-image.png"),ye(void 0)},[ye]);(0,o.useEffect)(()=>{var e,t;(null===re||void 0===re||null===(e=re.templateModalDetail)||void 0===e||null===(t=e.tags)||void 0===t?void 0:t.length)>0&&null!==re&&void 0!==re&&re.showTemplateModal&&(Ee(),Te())},[null===re||void 0===re||null===(t=re.templateModalDetail)||void 0===t?void 0:t.tags,null===re||void 0===re?void 0:re.showTemplateModal]);const je=_e.results&&Array.isArray(_e.results)?null===(l=(0,C.uniqBy)(null===_e||void 0===_e?void 0:_e.results,"id"))||void 0===l?void 0:l.slice(0,d.SIMILAR_TEMPLATES_TO_SHOW).map(e=>(0,V.jsx)(f.Sp,{height:e.image_height,width:e.image_width,location:"template-marketplace-view-all",children:(0,V.jsx)(b.Z,{story:e,tab:S.gAK,showHoverOverlay:!0,isUsedInSwiper:!1,toggleTemplatePreviewModal:null!==re&&void 0!==re&&re.showTemplateModal?fe:he,hasPremiumAccess:!le})},e.id)):[],ke=(0,V.jsx)(f.Do,{children:!_e.isLoading&&(null===(n=_e.results)||void 0===n?void 0:n.length)>0?(0,V.jsx)(T.r,{gridGap:"20px",templateColumns:`repeat(${Q?2:5},1fr)`,children:je}):_e.isLoading||0!==_e.results.length?(0,V.jsx)(P.Lk,{}):null}),Oe=(null===re||void 0===re||null===(u=re.templateModalDetail)||void 0===u||null===(B=u.tags)||void 0===B?void 0:B.length)>0?(0,V.jsx)(r.VnB,{t:q,isLoading:null===_e||void 0===_e?void 0:_e.isLoading,hasMore:!1,templates:null===_e||void 0===_e?void 0:_e.results,infiniteSimilarGrid:ke,format_title:null===re||void 0===re||null===(N=re.templateModalDetail)||void 0===N?void 0:N.format_title,category:null!==(U=null===re||void 0===re||null===(H=re.templateModalDetail)||void 0===H?void 0:H.category[0])&&void 0!==U?U:"",height:null===re||void 0===re||null===(F=re.templateModalDetail)||void 0===F?void 0:F.image_height,width:null===re||void 0===re||null===(Z=re.templateModalDetail)||void 0===Z?void 0:Z.image_width,path:(null===re||void 0===re||null===($=re.templateModalDetail)||void 0===$?void 0:$.story_type)===d.StoryTypes.ANIMATED?d.VIDEO_TEMPLATES:d.GRAPHIC_TEMPLATES}):null,Le=(0,o.useMemo)(()=>(0,d.isMobileApp)(),[]),Ie=(0,o.useCallback)(e=>{switch(e.modal){case d.MODAL_DESIGN:return te.replace({pathname:ee,search:`open=${d.MODAL_CREATE}`,state:{from:d.MODAL_OPEN_FROM_STATE}}),!0;case d.MODAL_AI:return te.replace({pathname:ee,search:`open=${d.GENERATE_AI}`,state:{from:d.MODAL_OPEN_FROM_STATE}}),!0;case d.MODAL_CREATE_FROM_CAPTIONS_TEMPLATE:return te.replace({pathname:ee,search:`open=${d.MODAL_CREATE_FROM_CAPTIONS_TEMPLATE}`,state:{from:d.MODAL_OPEN_FROM_STATE}}),J((0,j.Qq)({isOpen:!0,initialTemplate:null})),!0;default:return(0,d.handleToolsPathRedirection)(e,te),!0}},[te]);(0,i.v9)(e=>e.auth);return(0,V.jsxs)(c.A,{pageId:"video",containerProps:{p:Q?2:5},bgColor:"base_level_2",children:[(0,V.jsxs)(r.w0m,{variant:"lines",children:[!Le&&!Q&&(0,V.jsx)(A.Z,{list:null===d.CREATE_VIDEOS||void 0===d.CREATE_VIDEOS?void 0:d.CREATE_VIDEOS.filter(e=>(null===e||void 0===e?void 0:e.modal)===d.MODAL_DESIGN),onClick:Ie,selectedProduct:d.PRODUCTS.VIDEO,withAnimations:!0,showTitle:!1}),(0,V.jsx)(k.Z,{selectedProduct:d.PRODUCTS.VIDEO,showViewAll:!1,mode:"compact"}),0===(null===(W=ve)||void 0===W?void 0:W.length)&&se?(0,V.jsx)(y.c,{}):(null===(z=ve)||void 0===z?void 0:z.length)>0&&(0,V.jsx)(h.Z,{recentProjects:ve,fetchData:ge,product:d.PRODUCTS.VIDEO})]}),(0,V.jsx)(m.Z,{url:d.VIDEO_TEMPLATES,toggleTemplatePreviewModal:null!==re&&void 0!==re&&re.showTemplateModal?fe:he}),(0,V.jsx)(g.Z,{videoList:ie}),ue&&(0,V.jsx)(r.XLS,{t:q,title:q((null===re||void 0===re||null===(G=re.templateModalDetail)||void 0===G?void 0:G.story_type)===d.StoryTypes.ANIMATED?"premium_video_template_modal.title":"premium_template_modal.title",{ns:"billing"}),subtitle:q((null===re||void 0===re||null===(K=re.templateModalDetail)||void 0===K?void 0:K.story_type)===d.StoryTypes.ANIMATED?"premium_video_template_modal.subtitle":"premium_template_modal.subtitle",{ns:"billing"}),featureList:((null===re||void 0===re||null===(Y=re.templateModalDetail)||void 0===Y?void 0:Y.story_type)===d.StoryTypes.ANIMATED?d.premiumVideoTemplateFeatures:d.premiumTemplateFeatures).map(e=>({...e,title:q(e.title,{ns:e.translation}),info:q(e.info,{ns:e.translation})})),show:ue,onHide:()=>{pe.off(),Ee()},image:d.PREMIUM_TEMPLATE_IMAGE_DARK_URL,imageTextPrimary:q("modal.premium",{ns:"common"}),imageTextSecondary:q("modal.template",{ns:"common"}),onViewPlansHandler:()=>{var e,t;const l={action:d.PostLoginAction.CLONE_TEMPLATE,id:null===(e=re.templateModalDetail)||void 0===e?void 0:e.id,template:null===(t=re.templateModalDetail)||void 0===t?void 0:t.template},o=new URLSearchParams(l);oe({action:d.PostLoginAction.CLONE_TEMPLATE,from:te.location.pathname,redirect:`${origin}/login?${o.toString()}`})}}),(null===re||void 0===re?void 0:re.showTemplateModal)&&(0,V.jsx)(r.bqF,{onClose:()=>{ce(e=>({...e,showTemplateModal:!1})),xe(d.INITIAL_SIMILAR_TEMPLATES),Se()},details:null===re||void 0===re?void 0:re.templateModalDetail,onUseTemplate:()=>{var e;if(le&&null!==(e=re.templateModalDetail)&&void 0!==e&&e.is_premium)return Se(),(0,d.analyticsTrackEvent)("showUpgradeForPremiumTemplate",{product:d.PRODUCTS.VIDEO}),void pe.on();null===re||void 0===re||re.onUseTemplate()}
4,t:q,showBackgroundImage:!0,similarTemplatesComponent:Oe,showMobileBottomBar:!0,onEditUsingAI:Me}),!!Ce&&(0,V.jsx)(I.Z,{defaultFile:Ce,showDownload:!1,saveWithoutChanges:!0,onSave:Ae,onCancel:()=>ye(void 0),saveLabel:q("download",{ns:"common"})})]})})}}]);
5//# sourceMappingURL=5063.e586f9f6.chunk.js.map

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.