PageSourceSearch

https://app.simplified.com/static/js/380.ed5a2d3a.chunk.js

js simplified.com collected 2026-09-24 09:26:51 UTC 75,127 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunksimplified_web=self.webpackChunksimplified_web||[]).push([[380],{850774:(e,t,n)=>{n.d(t,{Z:()=>x});var i=n(683017),o=n(408499),a=n(559222),s=n(351839),l=n(298249),r=n(720637),d=n(532003),c=n(314134),u=n(759823),m=n(270858),h=n(741065),p=n(68530),v=n(349798),g=n(193691),_=n(90583),f=n(228993);const x=e=>{let{currentRating:t,allowRateChange:n=!0,onRate:x,isDisabled:b,wrapperStyles:j,...y}=e;const{t:k}=(0,o.$)(["common"]),[C,w]=(0,i.useState)(!1),S=(0,i.useRef)(null),{isOpen:T,onOpen:I,onClose:A}=(0,a.q)(),E=null!==t&&void 0!==t,P=1===t,R=-1===t,D=E&&!n,z=(0,i.useCallback)(async(e,t)=>{if(!D&&!C){w(!0);try{await x({...y,rating:e,comment:t}),(0,_.j9B)({description:k("ai_feedback.toast_title"),status:"success"})}finally{w(!1)}}},[D,C,x,y,k]),M=(0,i.useCallback)(()=>{z(1)},[z]),O=(0,i.useCallback)(()=>{-1===t||D||C||I()},[t,D,C,I]),F=(0,i.useCallback)(()=>{var e,t;const n=(null===(e=S.current)||void 0===e||null===(t=e.value)||void 0===t?void 0:t.trim())||"";A(),z(-1,n)},[z,A]);return(0,f.jsxs)(s.k,{gap:1,align:"center",sx:j,onClick:e=>e.stopPropagation(),pointerEvents:b?"none":void 0,"data-fct":y.contentType,"data-fcid":y.contentId,children:[(0,f.jsx)(_.Ddz,{"aria-label":"thumbs up",tooltipLabel:D?void 0:k("ai_feedback.rate_positive"),icon:(0,f.jsx)(l.J,{as:g.Oxm}),size:"xs",variant:"ghost",isDisabled:b||C,opacity:P?.6:E?.3:1,color:P?"common.positive_dark":void 0,onClick:M,pointerEvents:P||D?"none":void 0,cursor:P||D?"default":"pointer",_hover:P||D?{}:void 0}),(0,f.jsxs)(r.J,{isOpen:T,onClose:A,placement:"bottom",isLazy:!0,children:[(0,f.jsx)(d.x,{children:(0,f.jsx)(_.Ddz,{"aria-label":"thumbs down",tooltipLabel:D?void 0:k("ai_feedback.rate_negative"),icon:(0,f.jsx)(l.J,{as:g.w2X}),size:"xs",variant:"ghost",isDisabled:b||C,opacity:R?.6:E?.3:1,color:R?"common.negative":void 0,onClick:O,pointerEvents:R||D?"none":void 0,cursor:R||D?"default":"pointer",_hover:R||D?{}:void 0})}),(0,f.jsxs)(_.sP4,{w:280,children:[(0,f.jsx)(c.Q,{}),(0,f.jsx)(u.b,{children:(0,f.jsxs)(m.x,{children:[(0,f.jsx)(h.x,{fontSize:"xs",color:"content_inactive",mb:1,children:k("ai_feedback.comment_label")}),(0,f.jsx)(p.g,{ref:S,placeholder:k("ai_feedback.comment_placeholder"),size:"sm",rows:3,mb:2,autoFocus:!0}),(0,f.jsxs)(s.k,{justify:"flex-end",gap:2,children:[(0,f.jsx)(v.z,{size:"xs",variant:"ghost",onClick:A,children:k("cancel")}),(0,f.jsx)(v.z,{size:"xs",variant:"solid",onClick:F,isLoading:C,children:k("submit")})]})]})})]})]})]})}},35276:(e,t,n)=>{n.d(t,{I:()=>i,v:()=>o});let i=function(e){return e.Draft="draft",e.AdImage="ad_image",e.UgcVideo="ugc_video",e.Asset="asset",e.File="file",e}({}),o=function(e){return e.AiPostsGenerator="ai_posts_generator",e.AiLinkedinPostGenerator="ai_linkedin_post_generator",e.AiInstagramPostGenerator="ai_instagram_post_generator",e.AiTiktokPostGenerator="ai_tiktok_post_generator",e.AiFacebookPostGenerator="ai_facebook_post_generator",e.AiAdGenerator="ai_ad_generator",e.AiUgcGenerator="ai_ugc_generator",e.AiThumbnailGenerator="ai_thumbnail_generator",e.AiSocialMediaQuotesGenerator="ai_social_media_quotes_generator",e.AiAvatarGenerator="ai_avatar_generator",e.AiTextToImageGenerator="ai_text_to_image_generator",e.AiTextToVideoGenerator="ai_text_to_video_generator",e}({})},876410:(e,t,n)=>{n.d(t,{J:()=>s});var i=n(683017),o=n(313773),a=n(291508);const s=e=>{let{allowRateChange:t=!0,contentType:n,sourceType:s,sourcePath:l}=e;const[r,d]=(0,i.useState)({}),[c,u]=(0,i.useState)(!1),m=(0,i.useRef)(!1),h=(0,i.useRef)(n);h.current=n;const p=(0,i.useRef)(s);p.current=s;const v=(0,i.useRef)(l);v.current=l;const g=(0,i.useCallback)(async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e.length&&h.current&&!m.current){m.current=!0,u(!0);try{const n=await(0,o.l41)({content_type:h.current,content_ids:e});d(e=>t?n.data:{...e,...n.data})}catch{}finally{m.current=!1,u(!1)}}},[]),_=(0,i.useCallback)(async e=>{const n=e.contentType||h.current;if(n&&e.contentId)try{var i;await(0,o.mvv)({rating:e.rating,content_type:n,content_id:e.contentId,source_type:e.sourceType||p.current,source_url:e.sourcePath||v.current||`${window.location.pathname}${window.location.search}`,comment:e.comment||""},null!==(i=e.allowRateChange)&&void 0!==i?i:t),d(t=>({...t,[e.contentId]:e.rating}))}catch(s){throw(0,a.S3)(s),s}},[t]),f=(0,i.useCallback)((e,t)=>{d(n=>({...n,[e]:t}))},[]),x=(0,i.useCallback)(e=>{d(t=>{const n={...t};return delete n[e],n})},[]);return{allowRateChange:t,ratings:r,isLoading:c,fetchRatings:g,submitRating:_,setRating:f,removeRating:x}}}
1,673174:(e,t,n)=>{n.d(t,{Z:()=>g});var i=n(683017),o=n(764293),a=n(408499),s=n(270858),l=n(162210),r=n(295903),d=n(429466),c=n(90583),u=n(104399),m=n(393190),h=n(501271),p=n(193691),v=n(228993);const g=e=>{let{value:t,autoSelect:n,isDisabled:g,isClearable:_,size:f,onChange:x,onFetchBrandkitsSuccess:b,brandkitGridColumns:j=[1,2,2,3,3],brandkitGridProps:y}=e;const{t:k}=(0,a.$)(["brandbooks"]),C=(0,o.I0)(),[w,S]=(0,i.useState)([]),[T,I]=(0,i.useState)(!0),A=(0,o.v9)(e=>e.permissions.spacePermissionChecks),E=(0,i.useMemo)(()=>w.find(e=>e.value===t),[w,t]),P=(0,i.useCallback)(async()=>{try{const e=await C((0,d.QX)()),i=e.map(e=>({data:e,value:e.id,label:e.title}));null===b||void 0===b||b(e),S(i),n&&!t&&i.length&&x(i[0])}catch(e){C((0,h.iM)(e))}finally{I(!1)}},[n,C,x,t]),R=(0,i.useCallback)(e=>{x(e)},[x]);return(0,i.useEffect)(()=>{P()},[]),(0,v.jsxs)(v.Fragment,{children:[!T&&!w.length&&(0,v.jsx)(s.x,{padding:4,background:"base_level_1",borderRadius:"lg",children:(0,v.jsx)(m.GW,{videoLink:u.VIEW_BRANDKIT_IN_ACTION_VIDEO_LINK,icon:p.DP0,title:k("setup"),description:k("text"),buttonText:k("add"),buttonLink:u.BRANDKITS,videoText:k("not_sure_yet",{ns:"common"}),videoLinkPlaceholder:k("here",{ns:"common"})})}),(0,v.jsx)(v.Fragment,{children:(0,v.jsxs)(l.M,{columns:j,spacing:[3,2,3,2,3],w:"full",mb:4,...y,children:[T&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(r.O,{w:"full",h:"200px",borderRadius:"lg"}),(0,v.jsx)(r.O,{w:"full",h:"200px",borderRadius:"lg"})]}),w.map(e=>(0,v.jsx)(s.x,{w:"full",flex:1,children:(0,v.jsx)(c.PVF,{isSelectable:!0,brandbook:e.data,spacePermissionChecks:A,onClick:()=>{g||R(_&&(null===E||void 0===E?void 0:E.value)===e.value?void 0:e)},onTitleSubmit:()=>{},onDelete:()=>{},isSelected:(null===E||void 0===E?void 0:E.value)===e.value,isDisabled:g})},e.value))]})})]})}},492736:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(295903),o=n(228993);const a=e=>{let{width:t="full",height:n="full"}=e;return(0,o.jsx)(i.O,{width:t,height:n})}},29352:(e,t,n)=>{n.d(t,{U:()=>w});var i=n(270858),o=n(351839),a=n(691275),s=n(524943),l=n(807523),r=n(53004),d=n(677360),c=n(77456),u=n(741065),m=n(349798),h=n(308686),p=n(408499),v=n(346491),g=n(193691),_=n(817745),f=n(104399),x=n(228993);const b=(0,h.E)(i.x),j=(0,h.E)(o.k),y={initial:{},animate:{transition:{staggerChildren:.07,delayChildren:.1}}},k={initial:{opacity:0,y:8},animate:{opacity:1,y:0,transition:{duration:.35,ease:"easeOut"}}},C=["bullet_1","bullet_2","bullet_3"],w=e=>{let{isOpen:t,onClose:n,config:h}=e;const{t:w}=(0,p.$)(["ai"]),S=(0,a.ff)("common.primary_50","common.primary_200"),T=w(h.contentTypeKey,{ns:"ai"});return(0,x.jsxs)(s.u_,{isOpen:t,onClose:n,isCentered:!0,closeOnOverlayClick:!1,closeOnEsc:!1,children:[(0,x.jsx)(l.Z,{backdropFilter:"blur(4px)",zIndex:1500}),(0,x.jsx)(r.h,{borderRadius:"2xl",p:6,maxW:"400px",mx:4,containerProps:{zIndex:1500},children:(0,x.jsx)(d.f,{p:0,children:(0,x.jsxs)(j,{variants:y,direction:"column",initial:"initial",animate:"animate",gap:5,align:"center",children:[(0,x.jsx)(b,{variants:k,children:(0,x.jsx)(c.q,{name:"Riley",size:"md",bg:"common.primary_400",color:"content_inverse",boxShadow:"amber"})}),(0,x.jsxs)(o.k,{direction:"column",align:"center",w:"full",gap:2,mb:3,children:[(0,x.jsx)(b,{variants:k,textAlign:"center",children:(0,x.jsx)(u.x,{fontSize:"2xl",fontWeight:"bold",lineHeight:"short",children:w("riley_promo_modal.title",{ns:"ai",contentType:T})})}),(0,x.jsx)(b,{variants:k,textAlign:"center",children:(0,x.jsx)(u.x,{color:"content_inactive",fontSize:"sm",children:w("riley_promo_modal.subtitle",{ns:"ai",contentType:T})})})]}),(0,x.jsx)(i.x,{w:"full",children:C.map((e,t)=>(0,x.jsxs)(j,{variants:k,align:"center",gap:3,mb:t<C.length-1?3:0,children:[(0,x.jsx)(o.k,{w:5,h:5,borderRadius:"full",bg:S,color:"common.primary_800",align:"center",justify:"center",flexShrink:0,children:(0,x.jsx)(g.Nhk,{size:12})}),(0,x.jsx)(u.x,{fontSize:"sm",children:(0,x.jsx)(v.c,{i18nKey:`riley_promo_modal.${e}`,ns:"ai",components:{1:(0,x.jsx)("strong",{})}})})]},e))}),(0,x.jsxs)(o.k,{direction:"column",align:"center",w:"full",gap:3,mt:3,children:[(0,x.jsx)(b,{variants:k,w:"full",children:(0,x.jsx)(m.z,{as:_.rU,to:`${f.NEXUS_PATH}?autoPrompt=${h.autoPrompt}`,w:"full",variant:"solid",children:w("riley_promo_modal.cta_primary",{ns:"ai"})})}),(0,x.jsx)(b,{variants:k,children:(0,x.jsx)(m.z,{variant:"link",size:"sm",fontWeight:"normal",onClick:n,children:w("riley_promo_modal.cta_secondary",{ns:"ai"})})})]})]})})})]})}},557470:(e,t,n)=>{n.d(t,{D:()=>i});const i={ads:{contentTypeKey:"riley_promo_modal.content_types.ads",autoPrompt:"Create+an+ad+for+my+brand"},presentations:{contentTypeKey:"riley_promo_modal.content_types.presentations",autoPrompt:"Create+a+presentation+for+my+brand"},carousels:{contentTypeKey:"riley_promo_modal.content_types.carousels",autoPrompt:"Create+a+carousel+for+my+brand"},thumbnails:{contentTypeKey:"riley_promo_modal.content_types.thumbnails",autoPrompt:"Design+a+YouTube+thumbnail"},quotes:{contentTypeKey:"riley_promo_modal.content_types.quotes",autoPrompt:"Create+social+media+quotes+for+my+brand"},memes:{contentTypeKey:"riley_promo_modal.content_types.memes",autoPrompt:"Generate+a+meme+for+my+brand"},facebook_posts:{contentTypeKey:"riley_promo_modal.content_types.facebook_posts",autoPrompt:"Create+a+Facebook+post+for+my+brand"},instagram_posts:{contentTypeKey:"riley_promo_modal.content_types.instagram_posts",autoPrompt:"Create+an+Instagram+post+for+my+brand"},linkedin_posts:{contentTypeKey:"riley_promo_modal.content_types.linkedin_posts",autoPrompt:"Create+a+LinkedIn+post+for+my+brand"},tiktok_posts:{contentTypeKey:"riley_promo_modal.content_types.tiktok_posts",autoPrompt:"Create+a+TikTok+post+for+my+brand"},blog:{contentTypeKey:"riley_promo_modal.content_types.blog",autoPrompt:"Write+a+blog+post+for+my+brand"},essay:{contentTypeKey:"riley_promo_modal.content_types.essay",autoPrompt:"Write+an+essay+for+my+brand"},article:{contentTypeKey:"riley_promo_modal.content_types.article",autoPrompt:"Write+an+article+for+my+brand"},email_sequences:{contentTypeKey:"riley_promo_modal.content_types.email_sequences",autoPrompt:"Create+an+email+sequence+for+my+brand"},ai_chat:{contentTypeKey:"riley_promo_modal.content_types.ai_chat",autoPrompt:"Help+me+with+my+brand"}}},165980:(e,t,n)=>{n.d(t,{Q:()=>l});var i=n(559222),o=n(683017);const a="riley_promo_dismissed",s=e=>{try{var t;return!!JSON.parse(null!==(t=sessionStorage.getItem(a))&&void 0!==t?t:"{}")[e]}catch{return!1}},l=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{isOpen:n,onClose:l}=(0,i.q)({defaultIsOpen:t&&!s(e)});return{isOpen:n,onClose:(0,o.useCallback)(()=>{(e=>{try{var t;const n=JSON.parse(null!==(t=sessionStorage.getItem(a))&&void 0!==t?t:"{}");sessionStorage.setItem(a,JSON.stringify({...n,[e]:!0}))}catch{sessionStorage.setItem(a,JSON.stringify({[e]:!0}))}})(e),l()},[e,l])}}},975834:(e,t,n)=>{n.d(t,{Z:()=>T});var i=n(692877),o=n(587383),a=n(270858),s=n(179822),l=n(298249),r=n(773320),d=n(282887),c=n(553218),u=n(741065),m=n(773414),h=n(349798),p=n(902352),v=n(351839),g=n(129944),_=n(683017),f=n(408499),x=n(778145),b=n(104399),j=n(249426),y=n(492736),k=n(90583),C=n(228993);const w={position:"absolute",zIndex:0,overflow:"hidden",_before:{position:"absolute",inset:0,zIndex:-1,
1content:'""',background:"base_level_3"}},S=e=>{let{item:t,fileName:n,onRemove:r,onMoveLeft:d,onMoveRight:c}=e;const{t:u}=(0,f.$)(["common"]),m=(0,i.S)({base:!0,md:!1}),[h,p]=(0,o.k)(),[v,g]=(0,_.useState)(null),b=m||h;return(0,C.jsxs)(a.x,{position:"relative",width:"128px",minWidth:"128px",height:"128px",borderRadius:"base",backgroundColor:"content_alpha_300",onMouseEnter:p.on,onMouseOver:p.on,onMouseLeave:p.off,children:[(0,C.jsx)(a.x,{width:"full",height:"full",overflow:"hidden",borderRadius:"inherit",children:(0,C.jsx)(s.E,{src:t,fallback:!1===v?(0,C.jsx)(j.Z,{text:n}):(0,C.jsx)(y.Z,{}),onLoadStart:()=>g(null),onLoad:()=>g(!0),onError:()=>g(!1),width:"full",height:"full",objectFit:"cover"})}),b&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(k.Ddz,{tooltipLabel:u("media_picker.actions.remove"),tooltipPosition:"top",icon:(0,C.jsx)(l.J,{as:x.FaTrash}),size:"sm",sx:{...w,top:1,right:1},isDisabled:!r,onClick:r}),(0,C.jsx)(k.Ddz,{tooltipLabel:u("media_picker.actions.move_left"),tooltipPosition:"top",icon:(0,C.jsx)(l.J,{as:x.FaChevronLeft}),size:"sm",sx:{...w,bottom:1,left:1},isDisabled:!d,onClick:d}),(0,C.jsx)(k.Ddz,{tooltipLabel:u("media_picker.actions.move_right"),tooltipPosition:"top",icon:(0,C.jsx)(l.J,{as:x.FaChevronRight}),size:"sm",sx:{...w,bottom:1,right:1},isDisabled:!c,onClick:c})]})]})},T=e=>{let{maxItems:t,items:n=[],addComponent:i=_.Fragment,containerProps:o={},getThumb:s=e=>e,onChange:j}=e;const{t:y}=(0,f.$)(["ai"]),k=(0,_.useRef)(null),w=(0,r.D)(n),T=(0,_.useCallback)(()=>{var e;null===(e=k.current)||void 0===e||e.scrollTo({left:99999})},[]),I=(0,_.useCallback)(e=>
1{j(n.filter((t,n)=>n!==e))},[n,j]),A=(0,_.useCallback)(e=>{const t=[...n];[t[e-1],t[e]]=[t[e],t[e-1]],j(t)},[n,j]),E=(0,_.useCallback)(e=>{const t=[...n];[t[e+1],t[e]]=[t[e],t[e+1]],j(t)},[n,j]),P=(0,_.useCallback)(()=>{j([])},[j]);return(0,b.useHorizontalScroll)(k),(0,_.useEffect)(()=>{(null===n||void 0===n?void 0:n.length)>0&&(null===n||void 0===n?void 0:n.length)>(null===w||void 0===w?void 0:w.length)&&k.current&&T()},[null===n||void 0===n?void 0:n.length,null===w||void 0===w?void 0:w.length]),(0,C.jsx)(a.x,{width:"full",borderRadius:"lg",bgColor:"base_level_2",border:"1px solid",borderColor:"content_alpha_200",padding:3,...o,children:(0,C.jsxs)(d.g,{children:[(0,C.jsxs)(c.U,{w:"full",align:"center",justify:"space-between",minHeight:6,children:[(0,C.jsxs)(u.x,{color:"content_inactive",fontSize:"sm",children:[y("selected_media",{ns:"ai"})," ",t?`(${n.length} / ${t})`:null]}),n.length>0&&(0,C.jsx)(m.h,{size:"xs",variant:"ghost",children:(0,C.jsx)(h.z,{leftIcon:(0,C.jsx)(x.FaTrash,{}),onClick:P,children:y("delete_all",{ns:"ai"})})})]}),(0,C.jsx)(p.i,{my:2}),(0,C.jsxs)(v.k,{w:"full",align:"flex-start",gap:1,overflowY:"hidden",overflowX:"auto",ref:k,children:[n.map((e,t)=>{const i=0===t,o=t===n.length-1;return(0,C.jsx)(S,{item:e,fileName:(0,b.getFileName)(e),onRemove:()=>I(t),onMoveLeft:i?void 0:()=>A(t),onMoveRight:o?void 0:()=>E(t)},`${e}-${t}`)}),(!t||n.length<t)&&(0,C.jsx)(i,{children:(0,C.jsxs)(g.M,{borderRadius:"base",border:"1px dashed",borderColor:"content_alpha_400",background:"base_alpha_300",color:"content_inactive",flexDirection:"column",width:"128px",height:"128px",children:[(0,C.jsx)(l.J,{as:x.FaPlus}),y("add_media",{ns:"common"})]})})]})]})})}},203873:(e,t,n)=>{n.d(t,{A:()=>l});var i=n(270858),o=n(408499),a=n(90583),s=n(228993);const l=e=>{var t;let{name:n,icon:l,description:r,errors:d,isRequired:c,isDisabled:u,variant:m,children:h,showTitle:p=!0,showTip:v,title:g="",helpText:_="",...f}=e;const{t:x}=(0,o.$)(["ai"]),b=null===d||void 0===d||null===(t=d[n])||void 0===t?void 0:t.message;return(0,s.jsxs)(a.vXb.BaseFormControl,{icon:l,title:p?g:void 0,description:r,error:b?x(b):void 0,isRequired:c,isDisabled:u,variant:m,...f,children:[h,v&&(0,s.jsx)(i.x,{mt:2,children:(0,s.jsx)(a.AFT,{description:_})})]})}},147568:(e,t,n)=>{n.d(t,{e:()=>h});var i=n(683017),o=n(845458),a=n(270858),s=n(351839),l=n(800410),r=n(828865),d=n(741065),c=n(298249),u=n(193691),m=n(228993);const h=e=>{let{value:t,onSave:n,placeholder:h="Click to edit",maxLength:p=100,showIcon:v=!1,isDisabled:g=!1,fontSize:_="sm",fontWeight:f="normal",color:x="content_inactive",noOfLines:b=1,previewStyles:j={},inputStyles:y={},wrapperStyles:k={},isCompact:C=!1,startWithEditView:w=!1,onEditStart:S,onEditEnd:T}=e;const[I,A]=(0,i.useState)(t),[E,P]=(0,i.useState)(w),R=(0,i.useRef)(null),D=(0,i.useRef)(null);(0,i.useEffect)(()=>{E||A(t)},[t,E]),(0,i.useEffect)(()=>{w&&P(!0)},[w]),(0,i.useEffect)(()=>{if(E&&D.current){const e=setTimeout(()=>{var e,t;null===(e=D.current)||void 0===e||e.focus(),null===(t=D.current)||void 0===t||t.select()},50);return()=>clearTimeout(e)}},[E]);const z=(0,i.useCallback)(e=>{A(e.target.value)},[]),M=(0,i.useCallback)(()=>{const e=I.trim();e.length>0&&e!==t?n(e):A(t),P(!1),null===T||void 0===T||T()},[I,t,n,T]),O=(0,i.useCallback)(()=>{A(t),P(!1),null===T||void 0===T||T()},[t,T]),F=(0,i.useCallback)(()=>{g||(P(!0),null===S||void 0===S||S())},[g,S]),L=(0,i.useCallback)(e=>{"Enter"===e.key?(e.preventDefault(),M()):"Escape"===e.key&&(e.preventDefault(),O())},[M,O]);return(0,o.O)({ref:R,handler:()=>{E&&M()}}),(0,m.jsx)(a.x,{ref:R,w:"full",sx:k,children:(0,m.jsx)(s.k,{align:"center",w:"full",gap:1,children:E?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(l.I,{ref:D,value:I,onChange:z,onKeyDown:L,size:"sm",py:1,px:2,flex:"1",minW:0,fontSize:_,fontWeight:f,color:"content_active",bg:"base_level_3",borderRadius:"md",border:"1px solid",borderColor:"primary",_focus:{boxShadow:"0 0 0 1px var(--chakra-colors-primary)",outline:"none"},maxLength:p,...y}),!C&&(0,m.jsxs)(s.k,{gap:1,flexShrink:0,children:[(0,m.jsx)(r.h,{"aria-label":"Save",icon:(0,m.jsx)(u.Nhk,{}),size:"xs",variant:"ghost",color:"common.positive_dark",onClick:M}),(0,m.jsx)(r.h,{"aria-label":"Cancel",icon:(0,m.jsx)(u.APH,{}),size:"xs",variant:"ghost",color:"common.negative",onClick:O})]})]}):(0,m.jsxs)(s.k,{align:"center",flex:"1",minW:0,onClick:F,cursor:g?"default":"text",py:1,px:2,borderRadius:"md",_hover:g?{}:{bg:"base_alpha_200"},transition:"background 0.2s",...j,children:[(0,m.jsx)(d.x,{flex:"1",minW:0,noOfLines:b,fontSize:_,fontWeight:f,color:I?g?"content_note":x:"content_note",children:I||h}),v&&!g&&(0,m.jsx)(c.J,{as:u.r3Y,ml:2,w:3,h:3,color:"content_inactive",flexShrink:0})]})})})}},90380:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ze});var i=n(692877),o=n(683017),a=n(408499),s=n(193691),l=n(976166),r=n(379274),d=n(412997),c=n(313773),u=n(104399),m=n(90583),h=n(581283),p=n(291508),v=n(465521),g=n(35276),_=n(542179),f=n(576212),x=n(125316),b=n(764293),j=n(282542),y=n(559443),k=n(919941),C=n(831672),w=n(883883);let S=function(e){return e.Projects="projects",e}({}),T=function(e){return e.Basic="basic",e.Personalize="personalize",e.Enhance="enhance",e.Generate="generate",e}({});const I=[{value:"1",label:"1"},{value:"2",label:"2"},{value:"3",label:"3"},{value:"5",label:"5"},{value:"8",label:"8"},{value:"10",label:"10"}];let A=function(e){return e.ShortsThumbnail="9:16",e.Square="1:1",e.RectangleVertical="3:4",e.RectangleHorizontal="4:3",e}({});const E=[{value:A.Square,label:"square",data:{width:1080,height:1080}},{value:A.RectangleVertical,label:"rect-vertical",data:{width:1080,height:1440}},{value:A.RectangleHorizontal,label:"rect-horizontal",data:{width:1440,height:1080}},{value:A.ShortsThumbnail,label:"reel",data:{width:1080,height:1920}}],P=[".gif",".png",".jpg",".jpeg",".webp"],R=["ai_sm_quotes_maker.loading.message2","ai_sm_quotes_maker.loading.message3","ai_sm_quotes_maker.loading.message4","ai_sm_quotes_maker.loading.message5"];var D=n(684561),z=n(488632),M=n(992504),O=n(587383),F=n(351839),L=n(800410),q=n(902352),G=n(270858),$=n(129944),N=n(274774),U=n.n(N),B=n(747676),H=n(955646),J=n(203873),W=n(927024),K=n(52154),Z=n(679107),V=n(245395),Q=n(844460),X=n(975834),Y=n(31665),ee=n(808602),te=n(271636),ne=n(228993);const ie=e=>{let{value:t,onChange:n,isDisabled:i,brandbookId:o}=e;const{setValue:a,watch:s}=(0,x.Gc)(),l=s("reference_image_type");return(0,ne.jsxs)(G.x,{children:[(0,ne.jsx)(te.Z,{availableTypes:[ee.C.CUSTOM,ee.C.AI_TEMPLATE_IMAGES],brandbookId:o,value:l,messageEnabled:!1,onChange:e=>{a("reference_image_type",e),n(void 0)},aiTemplateValue:l===ee.C.AI_TEMPLATE_IMAGES&&t?{url:t,strict:!1}:void 0,onAiTemplateChange:e=>{n((null===e||void 0===e?void 0:e.url)||"")},isDisabled:i,aiTemplateCategorySlug:"memes-quotes"}
1),(0,ne.jsx)(G.x,{display:l===ee.C.CUSTOM?"block":"none",mt:3,children:(0,ne.jsx)(X.Z,{maxItems:1,items:t?[t]:[],addComponent:e=>{let{children:t}=e;return(0,ne.jsx)(Y.Z,{type:"image",onSelect:e=>{let{url:t}=e;return n(t)},children:t,uppyRestrictions:{allowedFileTypes:P,customMaxSizeByType:{image:10485760},maxNumberOfFiles:1}})},onChange:e=>{Array.isArray(e)&&0===e.length?n(void 0):n(e[0])}})})]})};var oe=n(659840);const ae={[T.Basic]:e=>{let{isDisabled:t}=e;const{t:n}=(0,a.$)(["ai"]),i=(0,b.I0)(),{control:s,formState:{errors:l},setValue:r}=(0,x.Gc)(),c=(0,b.v9)(e=>{var t;return null===(t=e.apps.common)||void 0===t?void 0:t.features}),h=(0,o.useMemo)(()=>(0,k.lL)(c,u.FeatureCodes.PREMIUM),[c]),[p,v]=(0,O.k)(!1),g=(0,o.useCallback)(async e=>{var t,n,i;const o=null===e||void 0===e||null===(t=e.data)||void 0===t||null===(n=t.voices)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.output_language;o&&r("output_language",o)},[r]),_=(0,o.useCallback)(()=>{i((0,j.$$)({product:u.PRODUCTS.DESIGN}))},[i]);return(0,ne.jsxs)(ne.Fragment,{children:[p&&(0,ne.jsx)(H.E,{}),(0,ne.jsx)(J.A,{name:"brand_id",icon:d.TCW,errors:l,isRequired:re("brand_id"),title:n("ai_sm_quotes_maker.fields.brand_id"),isDisabled:t,children:(0,ne.jsx)(x.Qr,{name:"brand_id",control:s,render:e=>{let{field:{onChange:i,value:o}}=e;return(0,ne.jsx)(W.d,{onChange:i,value:o,isDisabled:t,updateOtherFieldsBasedOnBrandbook:g,handleFetchBrandkitsSuccess:e=>{0===(null===e||void 0===e?void 0:e.length)&&v.on()},handleFeatureUnavailability:_,customTabView:(0,ne.jsx)(m.vXb.FormGrid,{children:(0,ne.jsx)(J.A,{name:"output_language",icon:d.TCW,errors:l,isRequired:re("output_language"),title:n("ai_sm_quotes_maker.fields.output_language"),isDisabled:t,children:(0,ne.jsx)(x.Qr,{name:"output_language",control:s,render:e=>{let{field:{onChange:n,value:i}}=e;return(0,ne.jsx)(Z.Z,{value:i,isDisabled:t,onChange:e=>{h||!e?n(e):_()}})}})})})})}})})]})},[T.Personalize]:e=>{let{isDisabled:t}=e;const{t:n}=(0,a.$)(["ai"]),{control:i,formState:{errors:o},watch:s}=(0,x.Gc)(),l=s("brand_id");return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(J.A,{name:"topic",errors:o,isRequired:re("topic"),title:n("ai_sm_quotes_maker.fields.topic"),isDisabled:t,children:(0,ne.jsx)(x.Qr,{name:"topic",control:i,render:e=>{let{field:i}=e;return(0,ne.jsxs)(F.k,{flexDirection:"column",gap:1,children:[(0,ne.jsx)(L.I,{...i,placeholder:n("ai_sm_quotes_maker.field_placeholders.topic"),isDisabled:t}),(0,ne.jsx)(K.Z,{brandbookId:l,contentType:"social media quotes",onChange:i.onChange})]})}})}),(0,ne.jsx)(q.i,{}),(0,ne.jsx)(J.A,{name:"no_of_quotes",errors:o,isRequired:re("no_of_quotes"),title:n("ai_sm_quotes_maker.fields.no_of_quotes"),isDisabled:t,children:(0,ne.jsx)(x.Qr,{name:"no_of_quotes",control:i,render:e=>{let{field:{value:n,onChange:i}}=e;return(0,ne.jsx)(G.x,{maxW:"16rem",children:(0,ne.jsx)(V.d,{value:n,onChange:i,isDisabled:t,items:I})})}})}),(0,ne.jsx)(q.i,{}),(0,ne.jsx)(J.A,{name:"image_size",errors:o,isRequired:re("image_size"),title:n("ai_sm_quotes_maker.fields.image_size"),isDisabled:t,children:(0,ne.jsx)(x.Qr,{name:"image_size",control:i,render:e=>{let{field:{value:n,onChange:i}}=e;return(0,ne.jsx)(Q.k,{items:E,value:n,onChange:i,isDisabled:t})}})})]})},[T.Enhance]:e=>{let{isDisabled:t}=e;const{t:n}=(0,a.$)(["ai"]),{control:i,formState:{errors:o},watch:s}=(0,x.Gc)(),l=s("brand_id");return(0,ne.jsx)(ne.Fragment,{children:(0,ne.jsx)(J.A,{name:"reference_image_url",errors:o,isRequired:re("reference_image_url"),title:n("ai_sm_quotes_maker.fields.reference_image_url"),isDisabled:t,children:(0,ne.jsx)(x.Qr,{name:"reference_image_url",control:i,render:e=>{let{field:{value:n,onChange:i}}=e;return(0,ne.jsx)(ie,{value:n,onChange:i,isDisabled:t,brandbookId:l})}})})})},[T.Generate]:e=>{var t;let{onBack:n}=e;const{t:i}=(0,a.$)(["ai","loading-messages","common"]),s=(0,oe.k6)(),r=(0,b.I0)(),{getValues:d}=(0,x.Gc)(),h=(0,o.useRef)(new AbortController),{handleExecutionFailureAndError:v}=(0,p.UQ)(),g=(0,b.v9)(e=>{var t,n;return null===(t=e.apps.common)||void 0===t||null===(n=t.features)||void 0===n?void 0:n.find(e=>e.feature_code===u.FeatureCodes.COIN)}),_=U()(null!==(t=(null===g||void 0===g?void 0:g.usage_limit)-(null===g||void 0===g?void 0:g.current_usage))&&void 0!==t?t:0,2),[f,y]=(0,o.useState)(i("ai_sm_quotes_maker.loading.message1",{ns:"loading-messages"})),k=(0,o.useCallback)(()=>{r((0,j.HJ)({product:u.PRODUCTS.DESIGN,addonCategory:u.AddonCategories.COIN,addonType:u.ONE_TIME_ADDON,hideToggleSwitch:!0}))},[r]),C=(0,o.useCallback)(async e=>{var t,n,o,a;const r=await(0,c.eQd)(u.AI_SOCIAL_MEDIA_QUOTES_MAKER_WORKFLOW_SLUG,{input:e},{expand:"token"});let d=0;const m=await(0,c.T42)({workflowId:u.AI_SOCIAL_MEDIA_QUOTES_MAKER_WORKFLOW_SLUG,taskId:null===(t=r.data)||void 0===t?void 0:t.workflow_id,timeout:2e3,signal:null===(n=h.current)||void 0===n?void 0:n.signal,updateCallback:async t=>{if([c.v1F.IN_PROGRESS,c.v1F.RUNNING].includes(t.data.status)&&(y(i(R[d],{ns:"loading-messages"})),d=Math.min(d+1,R.length-1),t.data.variables.project_id))return await(0,c.qzL)({id:t.data.variables.project_id,data:{...e,executions:[{id:r.data.workflow_id,token:r.data.token}]}}),void s.push((0,l.Gn)(u.AI_SOCIAL_MEDIA_QUOTES_MAKER_PATH,{view:S.Projects,projectId:t.data.variables.project_id}),{no_of_quotes:e.no_of_quotes})},token:null===(o=r.data)||void 0===o?void 0:o.token,params:{expand:"creator",fields:"status,output,id,workflow_id,workflow_version,create_time,update_time,start_time,end_time,creator,tasks,reason_for_incompletion,variables"}});if(!r.data.token||!r.data.workflow_id)throw new Error(i("ai_sm_quotes_maker.workflow_failed_to_start"));var p;if((null===(a=m.data)||void 0===a?void 0:a.status)===c.v1F.COMPLETED)return null===m||void 0===m||null===(p=m.data)||void 0===p?void 0:p.output;if(m.data.status===c.v1F.FAILED)throw new Error(m.data.reason_for_incompletion);throw new Error("Failed to generate ideas")},[i,s]),w=(0,o.useCallback)(async()=>{try{if(_<=0)return(0,m.CFj)({title:i("modal.credits_exhausted",{ns:"common"}),description:i("modal.time_to_refill",{ns:"common"}),status:"warning"}),k(),void(null===n||void 0===n||n());const e=d();await C(e),r((0,B.oJ)(u.FeatureCodes.COIN))}catch(e){if(((null===e||void 0===e?void 0:e.message)||"").toLowerCase().includes("aborterror"))return;v(e,{product:u.PRODUCTS.DESIGN,addonCategory:u.AddonCategories.COIN,addonType:u.ONE_TIME_ADDON,hideToggleSwitch:!0}),null===n||void 0===n||n()}},[r,C,n,d,i,_,k,v]);return(0,o.useEffect)(()=>(w(),()=>{var e;null===(e=h.current)||void 0===e||e.abort()}),[]),(0,ne.jsx)($.M,{width:"full",height:"full",children:(0,ne.jsx)(m.jni,{loadingStatus:f,t:i})})}},se=z.Ry({brand_id:z.Z_().default(""),topic:z.Z_().default("").required("ai_sm_quotes_maker.errors.topic_required"),no_of_quotes:z.Z_().default("3"),output_language:z.Z_().default(u.DEFAULT_AI_DOCUMENT_LANGUAGE),reference_image_url:z.Z_().url().required("ai_sm_quotes_maker.errors.reference_image_url_required"),reference_image_type:z.Z_().default(""),platform:z.Z_().default(""),image_size:z.Z_().default("1:1").required("ai_ads.errors.ratio_required")}),le=[{id:T.Basic,title:"ai_sm_quotes_maker.steps.choose_brandbook.title",icon:d.qKD,content:{heading:"ai_sm_quotes_maker.steps.choose_brandbook.heading",description:"ai_sm_quotes_maker.steps.choose_brandbook.description"},fields:["brand_id","output_language"],component:ae[T.Basic]},{id:T.Personalize,title:"ai_sm_quotes_maker.steps.personalize.title",icon:s.y2q,content:{heading:"ai_sm_quotes_maker.steps.personalize.heading",description:"ai_sm_quotes_maker.steps.personalize.description"},fields:["topic","no_of_quotes","platform","image_size"],component:ae[T.Personalize]},{id:T.Enhance,title:"ai_sm_quotes_maker.steps.enhance.title",icon:s.hgp,content:{heading:"ai_sm_quotes_maker.steps.enhance.heading",description:"ai_sm_quotes_maker.steps.enhance.description"},fields:["reference_image_url"],component:ae[T.Enhance]},{id:T.Generate,title:"ai_sm_quotes_maker.steps.generate.title",icon:d.T$Z,content:{heading:"ai_sm_quotes_maker.steps.generate.heading",description:"ai_sm_quotes_maker.steps.generate.description"},component:ae[T.Generate]}],re=e=>(0,M.Eo)(se,e),de=e=>({...se.getDefault(),no_of_quotes:"3",platform:"",image_size:"1:1",output_language:u.DEFAULT_AI_DOCUMENT_LANGUAGE,...e}),ce=()=>(0,x.cI)({defaultValues:de(),resolver:(0,D.X)(se)}),ue=e=>{let{initialValues:t,onClose:n}=e;const{t:i}=(0,a.$)(["common","ai"]),s=(0,b.I0)(),l=ce(),{trigger:r,getValues:d}=l,{checkFeatureAvailability:c}
1=(0,C.Z)(),h=(0,b.v9)(e=>{var t;return null===(t=e.apps.common)||void 0===t?void 0:t.features}),p=(0,o.useMemo)(()=>(0,k.lL)(h,u.FeatureCodes.PREMIUM),[h]);(0,o.useEffect)(()=>{l.reset(de({...t}))},[]);const v=(0,o.useCallback)(()=>{s((0,j.$$)({product:u.PRODUCTS.DESIGN}))},[s]),g=(0,o.useCallback)((e,t)=>{const{output_language:n,brand_id:o,reference_image_type:a}=d();if(t===T.Generate){const e=u.AI_LANGUAGES.find(e=>e.value===n);if(o&&!c(u.FeatureCodes.BRANDKIT))return(0,m.CFj)({title:i("chosen_premium_feature.title"),description:i("chosen_premium_feature.description",{name:`${i("ai.fields.brandbookId",{ns:"planner"})}`}),status:"error"}),v(),!1;if(null!==e&&void 0!==e&&e.isPremium&&!p)return(0,m.CFj)({title:i("chosen_premium_feature.title"),description:i("chosen_premium_feature.description",{name:`${i("ai.fields.language",{ns:"planner"})}: ${null===e||void 0===e?void 0:e.plainLabel}`}),status:"error"}),v(),!1}if(t===T.Generate&&!p){const e=y.Wf.find(e=>e.value===a);if(null!==e&&void 0!==e&&e.isPremium)return(0,m.CFj)({title:i("chosen_premium_feature.title"),description:i("chosen_premium_feature.description",{name:i(`tts_media_source_types.${null===e||void 0===e?void 0:e.label}`,{ns:"ai"})}),status:"error"}),v(),!1}return!0},[c,d,v,p,i]);return(0,ne.jsx)(x.RV,{...l,children:(0,ne.jsx)(w.Z,{steps:le,areFieldsValid:async e=>await r(e,{shouldFocus:!0}),onBack:n,onStepNext:e=>{(0,u.analyticsTrackEvent)(`designSocialMediaQuotesMakerStep.${e}`)},onBeforeStepNext:g,translationNs:"ai"})})};var me=n(880745),he=n(179822),pe=n(298249),ve=n(878818),ge=n(77456),_e=n(741065),fe=n(39821),xe=n(170882),be=n(828865),je=n(366354),ye=n(138342),ke=n(480050),Ce=n.n(ke),we=n(778145),Se=n(817745);const Te=()=>(0,ne.jsxs)(G.x,{borderRadius:"md",background:"base_level_1",padding:2,marginBottom:2,height:"12.5rem",children:[(0,ne.jsx)(F.k,{alignItems:"center",children:(0,ne.jsx)(me.N,{noOfLines:1,skeletonHeight:4,w:"80%",mt:1,mb:1})}),(0,ne.jsx)(F.k,{alignItems:"center",marginTop:3,children:(0,ne.jsx)(me.N,{fontSize:"xs",noOfLines:1,skeletonHeight:3,width:"50%",marginTop:.5,marginBottom:1})})]}),Ie=e=>{let{path:t,title:n,date:i,thumbnail:o,user:l,onReuse:r,onDelete:d}=e;const{t:c}=(0,a.$)(["planner","common"]);return(0,ne.jsxs)(G.x,{position:"relative",borderRadius:"lg",zIndex:0,children:[(0,ne.jsxs)(F.k,{position:"relative",flexDirection:"column",borderRadius:"lg",border:"1px solid",borderColor:"content_alpha_100",height:"12.5rem",w:"full",overflow:"hidden",cursor:"pointer",tabIndex:0,as:Se.rU,to:t,_hover:{boxShadow:"card","img:first-of-type":{transform:"scale(1.05)"},"img:last-of-type":{transform:"scale(0.96)"}},_focus:{boxShadow:"card","img:first-of-type":{transform:"scale(1.05)"},"img:last-of-type":{transform:"scale(0.96)"}},children:[(0,ne.jsx)(F.k,{flex:1,flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,position:"relative",overflow:"hidden",bg:"base_level_2",children:o?(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(he.E,{position:"absolute",top:0,left:0,w:"full",h:"full",objectFit:"contain",src:o,transition:"transform 0.2s ease-out",zIndex:1}),(0,ne.jsx)(he.E,{position:"absolute",top:0,left:0,w:"full",h:"full",objectFit:"cover",transition:"transform 0.2s ease-out",src:o,filter:"blur(14px) brightness(0.8)"})]}):(0,ne.jsx)(pe.J,{as:s.heq,fontSize:"2xl",color:"content_note"})}),(0,ne.jsx)(F.k,{paddingX:2,pt:2,pb:1,gap:.5,flexDirection:"column",bg:"base_level_3",borderTop:"1px solid",borderTopColor:"content_alpha_100",children:(0,ne.jsxs)(F.k,{gap:2,children:[l&&(0,ne.jsx)(ve.u,{hasArrow:!0,placement:"top",label:`${c("created_by",{ns:"common"})}: ${l.name||l.email}`,children:(0,ne.jsx)(ge.q,{src:l.image,name:l.name||l.email,size:"sm",showBorder:!0,borderWidth:"2px",borderColor:"base_level_3"})}),(0,ne.jsxs)(G.x,{w:"full",children:[(0,ne.jsx)(_e.x,{as:"span",noOfLines:1,fontSize:"sm",color:"content_inactive",lineHeight:1,mb:1,children:n}),(0,ne.jsx)(F.k,{alignItems:"center",w:"full",justifyContent:"space-between",children:(0,ne.jsx)(h.Z,{date:i,fontSize:"xs",color:"content_note",noOfLines:1,wordBreak:"keep-all"})})]})]})})]}),(0,ne.jsxs)(fe.v,{isLazy:!0,autoSelect:!1,placement:"bottom-end",size:"sm",children:[(0,ne.jsx)(xe.j,{as:be.h,size:"sm",variant:"ghost",icon:(0,ne.jsx)(s.Og$,{}),"aria-label":"Options",top:2,position:"absolute",right:2,zIndex:2,_after:{position:"absolute",inset:0,zIndex:-1,
1content:'""',background:"base_level_3",borderRadius:"inherit"},onClick:e=>e.stopPropagation()}),(0,ne.jsxs)(je.q,{minWidth:0,onClick:e=>e.stopPropagation(),children:[(0,ne.jsx)(ye.s,{icon:(0,ne.jsx)(s.Lr9,{}),as:Se.rU,to:t,children:c("open",{ns:"common"})}),r&&(0,ne.jsx)(ye.s,{icon:(0,ne.jsx)(we.FaReply,{}),onClick:r,children:c("ai_thumbnail_maker.reuse")}),(0,ne.jsx)(ye.s,{icon:(0,ne.jsx)(s.KGR,{}),color:"common.negative",onClick:d,children:c("delete",{ns:"common"})})]})]})]})},Ae=e=>{var t;let{analyticsPrefix:n}=e;const i=(0,r.TH)(),s=parseInt((null===(t=i.state)||void 0===t?void 0:t.no_of_quotes)||"3",10),{t:d}=(0,a.$)(["ai","common"]),[h,v]=(0,O.k)(!0),[g,f]=(0,o.useState)(),[x,b]=(0,o.useState)(),j=(0,o.useCallback)(async()=>{if(null!==x&&void 0!==x&&x.next)try{const e=await Ce().get(x.next);b({...e.data,list:[...null===x||void 0===x?void 0:x.list,...e.data.results]})}catch(e){(0,p.S3)(e)}finally{v.off()}},[b,v,x]),y=(0,o.useCallback)(async e=>{(0,u.analyticsTrackEvent)(`${n}.delete`);try{await(0,c.rUk)(e),b(t=>t?{...t,list:t.list.filter(t=>t.id!==e)}:t),(0,m.j9B)({description:d("ai_thumbnail_maker.thumbnail_project_deleted"),status:"success"})}catch(t){(0,p.S3)(t)}},[n,d]);return(0,o.useEffect)(()=>{(async()=>{v.on();try{const e=await(0,c.sfh)({page_size:20,primary_type:u.CREATIVE_ITEM_PRIMARY_TYPE.smQuotes,expand:"creator"});b({list:e.data.results||[],next:e.data.next})}catch(e){b(void 0),(0,p.S3)(e)}finally{v.off()}})()},[]),(0,ne.jsxs)(ne.Fragment,{children:[h?(0,ne.jsx)(_.iw,{noOfSkeletons:s,loader:(0,ne.jsx)(Te,{})}):(0,ne.jsx)(_.XO,{items:(null===x||void 0===x?void 0:x.list)||[],emptyView:(0,ne.jsx)(_.ui,{title:d("ai_thumbnail_maker.projects.empty_screen_title"),description:d("ai_thumbnail_maker.projects.empty_screen_desc"),buttonLabel:d("ai_thumbnail_maker.start_generate"),buttonHref:(0,l.Gn)(u.AI_SOCIAL_MEDIA_QUOTES_MAKER_PATH)}),hasMore:!(null===x||void 0===x||!x.next),onFetchNext:j,getKey:e=>e.id,renderItem:e=>{var t;return(0,ne.jsx)(Ie,{path:(0,l.Gn)(u.AI_SOCIAL_MEDIA_QUOTES_MAKER_PATH,{view:S.Projects,projectId:e.id}),thumbnail:null===(t=e.thumbnail)||void 0===t?void 0:t.url,title:e.title,date:e.modified,user:e.creator,onDelete:()=>f({id:e.id})})}}),(0,ne.jsx)(m.sm4,{loading:!(null===g||void 0===g||!g.inProgress),isOpen:!(null===g||void 0===g||!g.id),title:d("are_you_sure",{ns:"common"}),message:d("delete_confirm",{ns:"common"}),cancelButtonText:d("cancel",{ns:"common"}),confirmButtonText:d("delete",{ns:"common"}),confirmButtonVariant:"danger",onConfirm:async()=>{g&&(f(e=>({...e,inProgress:!0})),await y(g.id),f(void 0))},onClose:()=>f(void 0)})]})};var Ee=n(29352),Pe=n(557470),Re=n(165980);const De=[{id:"generator",icon:d.T$Z,url:(0,l.Gn)(u.AI_SOCIAL_MEDIA_QUOTES_MAKER_PATH)},{id:"projects",icon:s.rnQ,url:(0,l.Gn)(u.AI_SOCIAL_MEDIA_QUOTES_MAKER_PATH,{view:S.Projects})}],ze=()=>{const{t:e}=(0,a.$)(["ai","common"]),t=(0,i.S)({base:!0,md:!1}),{view:n,projectId:s,itemId:x}=(0,r.UO)(),b=(0,oe.k6)(),{isOpen:j,onClose:y}=(0,Re.Q)("quotes"),k=(0,o.useCallback)(()=>{n&&s?b.replace((0,l.Gn)(u.AI_SOCIAL_MEDIA_QUOTES_MAKER_PATH,{view:n})):b.replace((0,l.Gn)(u.DESIGN_DASHBOARD))},[b,s,n]),C=(0,o.useCallback)(()=>{b.replace((0,l.Gn)(u.DESIGN_DASHBOARD))},[b]),w=(0,o.useCallback)(async e=>{if(s)try{await(0,c.qzL)({id:s,title:e})}catch(t){(0,p.S3)(t.response)}},[s]);return n===S.Projects&&s?(0,ne.jsx)(_.GA,{executionWorkflowSlug:u.AI_SOCIAL_MEDIA_QUOTES_MAKER_WORKFLOW_SLUG,analyticsPrefix:"imageSMQuotesProject",wrapper:e=>{let{data:t,isLoading:n,children:i}=e;return(0,ne.jsx)(m.vXb.Layout,{title:(null===t||void 0===t?void 0:t.title)||"",subtitle:null!==t&&void 0!==t&&t.modified?(0,ne.jsx)(h.Z,{date:t.modified,asText:!0}):"",icon:d.IEj,isLoading:n,onBack:k,onClose:C,onRename:w,children:i})},projectId:s,itemId:x,getKey:e=>e.id,renderItem:e=>(0,ne.jsx)(f.L,{...e,onClick:()=>{b.push((0,l.Gn)(u.AI_SOCIAL_MEDIA_QUOTES_MAKER_PATH,{view:"projects",projectId:s,itemId:e.item.id}))},translationPrefix:"ai_sm_quotes_maker"}),onPreviewClose:()=>{b.push((0,l.Gn)(u.AI_SOCIAL_MEDIA_QUOTES_MAKER_PATH,{view:"projects",projectId:s}))},onPreviewNavigate:(e,t)=>
1{b.push((0,l.Gn)(u.AI_SOCIAL_MEDIA_QUOTES_MAKER_PATH,{view:"projects",projectId:e,itemId:t}))},translationPrefix:"ai_sm_quotes_maker",contentType:g.I.AiImage,sourceType:g.v.AiSocialMediaQuotesGenerator}):(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(Ee.U,{isOpen:j,onClose:y,config:Pe.D.quotes}),(0,ne.jsxs)(m.vXb.Layout,{title:e("generate_with_ai_section.ai_sm_quotes_maker",{ns:"common"}),subtitle:e("generate_with_ai_section.ai_sm_quotes_maker_description",{ns:"common"}),icon:d.IEj,headerCenter:(0,ne.jsx)(m.vXb.LayoutHeaderTabs,{activeItemId:n===S.Projects?De[1].id:De[0].id,items:De.map(t=>({...t,label:e(`ai_sm_quotes_maker.view.${t.id}`)})),hideLabels:t}),onBack:k,onClose:C,isScrollable:n===S.Projects,headerRight:(0,ne.jsx)(v.Z,{}),shouldShowWaveBg:!0,children:[!n&&(0,ne.jsx)(ue,{onClose:C}),n===S.Projects&&(0,ne.jsx)(Ae,{analyticsPrefix:"designAiSocialMediaQuotesProjects"})]})]})}},927024:(e,t,n)=>{n.d(t,{d:()=>u});var i=n(692877),o=n(683017),a=n(408499),s=n(104399),l=n(90583),r=n(673174),d=n(831672),c=n(228993);const u=e=>{let{value:t,onChange:n,isDisabled:u,updateOtherFieldsBasedOnBrandbook:m,handleFeatureUnavailability:h,handleFetchBrandkitsSuccess:p,customTabView:v}=e;const{t:g}=(0,a.$)(["common","ai"]),_=(0,i.S)({base:!0,md:!1}),{checkFeatureAvailability:f}=(0,d.Z)(),[x,b]=(0,o.useState)(s.AdvancedSettingsTabsTypes.brandbook),j=(0,o.useCallback)(e=>{b(e.value)},[]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(l.ZhN,{onSwitchChange:j,styles:{fontWeight:"medium",fontSize:"sm",h:"40px",flexShrink:0,width:_?"full":"fit-content",bgColor:"input_normal",mb:2.5},options:s.advancedSettingsTabOptions,selectedOption:s.advancedSettingsTabOptions.find(e=>x===e.value),getOptionLabel:e=>g(null===e||void 0===e?void 0:e.label,{ns:"common"})}),x===s.AdvancedSettingsTabsTypes.brandbook&&(0,c.jsx)(r.Z,{value:t,isDisabled:u,onChange:e=>{null!==e&&void 0!==e&&e.value?f(s.FeatureCodes.BRANDKIT)?(n(null===e||void 0===e?void 0:e.value),m&&m(e)):h():n("")},isClearable:!0,showAppPromoBanner:!0,brandkitGridProps:{mb:0},onFetchBrandkitsSuccess:p}),x===s.AdvancedSettingsTabsTypes.default&&(0,c.jsx)(c.Fragment,{children:v})]})}},52154:(e,t,n)=>{n.d(t,{Z:()=>m});var i=n(587383),o=n(351839),a=n(741065),s=n(683017),l=n(408499),r=n(313773),d=n(90583),c=n(291508),u=n(228993);const m=e=>{let{brandbookId:t,contentType:n,onChange:m}=e;const{t:h}=(0,l.$)(["common"]),[p,v]=(0,i.k)(),[g,_]=(0,s.useState)([]),f=(0,s.useCallback)(async()=>{v.on();try{var e;const i=await(0,r.mQ_)({payload:{brand_id:t,content_type:n}});_((null===(e=i.data.output)||void 0===e?void 0:e.suggested_topics)||[])}catch(i){(0,c.S3)(i)}finally{v.off()}},[t,n,v]);return(0,s.useEffect)(()=>{f()},[]),p||g.length?(0,u.jsx)(o.k,{flexDirection:"column",gap:2,padding:3,background:"base_alpha_200",borderRadius:"lg",children:p?(0,u.jsx)(d.mj6,{}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(a.x,{fontSize:"sm",color:"content_inactive",fontWeight:"medium",children:[h("suggestions"),":"]}),(0,u.jsx)(d.W1P,{list:g,onChange:m})]})}):null}},883883:(e,t,n)=>{n.d(t,{Z:()=>r});var i=n(683017),o=n(692877),a=n(408499),s=n(90583),l=n(228993);const r=e=>{var t,n,r,d;let{steps:c,areFieldsValid:u,onBack:m,onBeforeStepNext:h,onStepNext:p,translationNs:v="ai",slug:g,shouldResetOnSlugChange:_=!1,insufficientCredits:f=!1,onBuyCredits:x,minimumCreditsRequired:b}=e;const{t:j}=(0,a.$)(["planner","common","ai"]),y=(0,o.S)({base:!0,md:!1}),{activeStep:k,activeStepIndex:C,nextStep:w,previousStep:S,setStep:T,isStepActive:I,isStepCompleted:A,isStepClickable:E}=(0,s.lGy)({steps:c.map(e=>e.id),defaultStep:c[0].id});(0,i.useEffect)(()=>{_&&T(c[0].id)},[g,_]);const P=(0,i.useCallback)(async()=>{var e,t,n;if(null!==(e=c[C])&&void 0!==e&&null!==(t=e.fields)&&void 0!==t&&t.length){if(!await u(c[C].fields||[]))return void(0,s.j9B)({description:j("ai.check_errors"),status:"error"})}if("function"===typeof h&&!h(k,null===(n=c[C+1])||void 0===n?void 0:n.id))return;const i=w();i!==k&&(null===p||void 0===p||p(i))},[c,C,h,k,w,u,j,p]);return(0,l.jsxs)(s.vXb.WizardLayout,{children:[!y&&(0,l.jsx)(s.vXb.WizardAside,{children:(0,l.jsx)(s.vXb.WizardSteps,{children:c.map((e,t)=>(0,l.jsx)(s.vXb.WizardStep,{no:t+1,title:j(e.title,{ns:v}),icon:e.icon,isActive:I(e.id),isCompleted:A(e.id),onClick:E(e.id)?()=>{T(e.id)}:void 0},e.id))})}),(0,l.jsx)(s.vXb.WizardContent,{activeStepIndex:C,title:j(null===(t=c[C])||void 0===t||null===(n=t.content)||void 0===n?void 0:n.heading,{ns:v}),description:j(null===(r=c[C])||void 0===r||null===(d=r.content)||void 0===d?void 0:d.description,{ns:v}),footer:C<c.length-1&&(0,l.jsx)(s.vXb.WizardNavigation,{onBack:C>0?S:m,isGenerate:C+1===c.length-1,insufficientCredits:f,onBuyCredits:x,minimumCreditsRequired:b}),onSubmit:()=>{P()},children:(()=>{var e;const t=null===(e=c[C])||void 0===e?void 0:e.component;return t?(0,l.jsx)(t,{onBack:()=>S()}):null})()})]})}},679107:(e,t,n)=>{n.d(t,{Z:()=>s});var i=n(104399),o=n(365377),a=n(228993);const s=e=>{let{value:t,isDisabled:n,onChange:s}=e;return(0,a.jsx)(o.G,{outputLanguage:i.AI_LANGUAGES.find(e=>e.value===t),onOutputLanguageSelectHandler:e=>{s((null===e||void 0===e?void 0:e.value)||i.DEFAULT_AI_DOCUMENT_LANGUAGE)},isDisabled:n})}},271636:(e,t,n)=>{n.d(t,{Z:()=>l});var i=n(408499),o=n(699489),a=n(808602),s=n(228993);const l=e=>{let{availableTypes:t,value:n,aiStyleValue:l="none",aiTemplateValue:r,aiTemplateDefaultFormat:d,aiTemplateFormatOptions:c,brandbookId:u,isDisabled:m,onChange:h,onBeforeChange:p=()=>
1!0,onAiStyleChange:v,onAiTemplateChange:g,onYoutubeThumbnailChange:_,mediaCustomComponent:f,messageEnabled:x=!0,showTemplateCategories:b=!0,aiTemplateCategorySlug:j}=e;const{t:y}=(0,i.$)(["planner","ai"]);return(0,s.jsx)(o.D,{hideTitle:!0,brandbookId:u,selectedMediaSourceType:n,onChangeMediaSource:e=>{m||h(null===e||void 0===e?void 0:e.value,{isPremium:e.isPremium})},onBeforeChangeMediaSource:e=>p(null===e||void 0===e?void 0:e.value,{isPremium:e.isPremium}),selectedAiStyle:l,onChangeAiStyle:m?void 0:v,aiTemplateDefaultFormat:d,aiTemplateFormatOptions:c,selectedAiTemplate:r,onChangeAiTemplate:m?void 0:g,mediaSourceTypes:t,mediaCustomComponent:f,onChangeYoutubeThumbnail:_,message:x?n===a.C.AI_IMAGES?y("ai.info.ai_image_take_more_time"):n===a.C.AI_TEMPLATE_IMAGES?y("ai.info.ai_template_image_take_more_time"):void 0:void 0,showTemplateCategories:b,aiTemplateCategorySlug:j})}},245395:(e,t,n)=>{n.d(t,{d:()=>u});var i=n(351839),o=n(741065),a=n(298249),s=n(499454),l=n(778145),r=n(90583),d=n(228993);const c={Option:e=>{var t;let{children:n,...r}=e;return(0,d.jsx)(s.chakraComponents.Option,{...r,children:(0,d.jsxs)(i.k,{width:"full",gap:2,align:"center",children:[(0,d.jsx)(o.x,{children:n}),(null===(t=r.data)||void 0===t?void 0:t.isPremium)&&(0,d.jsx)(a.J,{as:l.FaCrown,color:"common.primary_400"})]})})}};function u(e){let{items:t,value:n,isDisabled:i,onChange:o}=e;return(0,d.jsx)(r.v1X,{options:t,onChange:e=>{e&&o(e.value,{isPremium:null===e||void 0===e?void 0:e.isPremium})},value:t.find(e=>e.value===n),components:c,isMulti:!1,isSearchable:!1,isDisabled:i})}},542179:(e,t,n)=>{n.d(t,{ui:()=>u,GA:()=>ae,XO:()=>v,iw:()=>g});var i=n(351839),o=n(270858),a=n(741065),s=n(90678),l=n(349798),r=n(817745),d=n(412997),c=n(228993);const u=e=>{let{title:t,description:n,buttonLabel:u,buttonHref:m}=e;return(0,c.jsxs)(i.k,{direction:"column",align:"center",bgColor:"base_alpha_100",border:"1px solid",borderColor:"content_alpha_200",borderRadius:"lg",px:4,py:8,children:[(0,c.jsxs)(o.x,{textAlign:"center",maxW:"container.lg",mb:4,children:[(0,c.jsx)(a.x,{as:"span",fontSize:"2xl",role:"presentation",children:"\ud83d\udcab"}),(0,c.jsx)(s.X,{fontSize:"2xl",mb:3,fontWeight:"medium",children:t}),!!n&&(0,c.jsx)(a.x,{fontSize:"sm",color:"content_details",mb:4,children:n})]}),(0,c.jsx)(l.z,{as:r.rU,to:m,variant:"ai",leftIcon:(0,c.jsx)(d.T$Z,{}),children:u})]})};var m=n(295903),h=n(162210),p=n(90583);function v(e){let{items:t,renderItem:n,onFetchNext:i,hasMore:a,getKey:s,emptyView:l}=e;return 0===t.length&&l?(0,c.jsx)(o.x,{children:l}):(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(p.v_Y,{next:i,hasMore:a,loader:(0,c.jsx)(m.O,{position:"relative",height:14,w:"full",borderRadius:"lg"}),children:(0,c.jsx)(h.M,{spacing:4,gridTemplateColumns:"repeat(auto-fill, minmax(260px, 1fr))",children:t.map((e,t)=>(0,c.jsx)(o.x,{children:n(e,t)},s?s(e,t):t))})})})}const g=e=>{let{noOfSkeletons:t,loader:n}=e;return(0,c.jsx)(h.M,{spacing:4,gridTemplateColumns:"repeat(auto-fill, minmax(260px, 1fr))",children:Array.from({length:t}).map((e,t)=>(0,c.jsx)(o.x,{children:n||(0,c.jsx)(m.O,{position:"relative",height:14,w:"full",borderRadius:"lg"})},t))})};var _=n(692877),f=n(587383),x=n(559222),b=n(101313),j=n(878818),y=n(500981),k=n(773414),C=n(39821),w=n(170882),S=n(828865),T=n(298249),I=n(366354),A=n(138342),E=n(902352),P=n(945249),R=n(135201),D=n(308686),z=n(162620),M=n.n(z),O=n(683017),F=n(408499),L=n(193691),q=n(764293),G=n(313773),$=n(104399),N=n(747676),U=n(137413),B=n(39579),H=n(558505),J=n(727298),W=n(321427),K=n(291508),Z=n(395392),V=n(850774),Q=n(876410),X=n(46750),Y=n(524943),ee=n(53004),te=n(177612),ne=n(677360),ie=n(179822);const oe=e=>{var t,n,o,a;let{isOpen:s,onClose:r,selectedItemIndex:u,itemsData:h,id:v,onDownload:g,onEditImage:_,onShare:x,onPreviewNavigate:b,translationPrefix:j,isSharing:y}=e;const{t:E}=(0,F.$)(["ai","common"]),[P,R]=(0,f.k)(!0),[D,z]=(0,O.useState)(),M=(0,O.useMemo)(()=>h.results[u],[h,u]),q=(0,O.useCallback)(()=>{if(void 0===u)return;const e=u===h.results.length-1?0:u+1,t=h.results[e];null===b||void 0===b||b(t.id)},[u,null===h||void 0===h?void 0:h.results,b]),$=(0,O.useCallback)(()=>
1{if(void 0===u)return;const e=0===u?h.results.length-1:u-1,t=h.results[e];null===b||void 0===b||b(t.id)},[u,null===h||void 0===h?void 0:h.results,b]);(0,O.useEffect)(()=>{const e=e=>{var t;if(!s||(null===h||void 0===h||null===(t=h.results)||void 0===t?void 0:t.length)<=1)return;const n=document.activeElement;n&&("INPUT"===n.tagName||"TEXTAREA"===n.tagName||n.isContentEditable)||("ArrowRight"===e.key?q():"ArrowLeft"===e.key&&$())};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[s,null===h||void 0===h||null===(t=h.results)||void 0===t?void 0:t.length,q,$]);const N=null===M||void 0===M?void 0:M.id,U=null===M||void 0===M||null===(n=M.data)||void 0===n||null===(o=n.assets)||void 0===o?void 0:o[0],B=null===M||void 0===M||null===(a=M.images)||void 0===a?void 0:a[0];return(0,O.useEffect)(()=>{if(!N)return z(void 0),void R.off();R.on(),U?(0,G.uIq)(U).then(e=>{let{data:t}=e;z(t.thumbnail)}).catch(e=>{console.error("Failed to fetch asset details",e),z(B)}).finally(()=>{R.off()}):(z(B),R.off())},[U,B,N,R]),(0,O.useEffect)(()=>{R.on(),z("")},[v,R]),(0,c.jsx)(Y.u_,{isOpen:s,onClose:r,size:"full",isCentered:!0,children:(0,c.jsxs)(ee.h,{position:"relative",my:0,children:[(0,c.jsxs)(te.x,{display:"flex",alignItems:"center",paddingY:2,borderBottom:"1px solid",borderColor:"content_alpha_200",children:[E(`${j}.thumbnail`,{ns:"ai"})," #",u+1,(0,c.jsxs)(i.k,{ml:"auto",gap:1.5,children:[_&&(0,c.jsx)(l.z,{onClick:e=>{e.stopPropagation(),_()},leftIcon:(0,c.jsx)(T.J,{as:d.T$Z}),size:"sm",variant:"ai",children:E(`${j}.edit_image`,{ns:"ai"})}),(0,c.jsxs)(k.h,{isAttached:!0,variant:"solid",size:"sm",children:[x&&(0,c.jsx)(l.z,{onClick:()=>x(null===M||void 0===M?void 0:M.id),leftIcon:(0,c.jsx)(L.lzh,{}),isLoading:y,children:E("publish",{ns:"common"})}),g&&(0,c.jsxs)(C.v,{isLazy:!0,placement:"top-end",children:[(0,c.jsx)(w.j,{as:S.h,icon:(0,c.jsx)(T.J,{as:L.gPZ}),isDisabled:y}),(0,c.jsx)(I.q,{children:(0,c.jsx)(A.s,{onClick:g,icon:(0,c.jsx)(L.$0x,{}),children:E("download",{ns:"common"})})})]})]}),(0,c.jsx)(p.Ddz,{icon:(0,c.jsx)(L.APH,{}),onClick:e=>{e.stopPropagation(),r()},variant:"ghost",size:"sm",zIndex:"modal"})]})]}),(0,c.jsx)(ne.f,{bg:"base_level_2",minH:"calc(100vh - 48px)",maxH:"calc(100vh - 48px)",overflowY:"auto",display:"flex",alignItems:"center",justifyContent:"center",pl:h.results.length>1?12:void 0,pr:h.results.length>1?12:void 0,children:(0,c.jsx)(m.O,{isLoaded:!P,maxH:"calc(100vh - 48px)",h:"full",w:"full",children:(0,c.jsx)(ie.E,{objectFit:"contain",src:D,maxW:"full",w:"auto",maxH:"calc(100vh - 48px)",h:"auto",m:"auto"})})}),h.results.length>1&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(S.h,{"aria-label":E("previous",{ns:"common"}),icon:(0,c.jsx)(L.XWG,{}),borderRadius:"full",onClick:$,variant:"ghost",position:"absolute",left:2,top:"50%",transform:"translateY(-50%)",zIndex:1}),(0,c.jsx)(S.h,{"aria-label":E("next",{ns:"common"}),icon:(0,c.jsx)(L.sFD,{}),borderRadius:"full",onClick:q,variant:"ghost",position:"absolute",right:2,top:"50%",transform:"translateY(-50%)",zIndex:1})]})]})})},ae=e=>{var t,n,a,s,r;let{executionWorkflowSlug:d,analyticsPrefix:u,wrapper:m=e=>{let{children:t}=e;return(0,c.jsx)(c.Fragment,{children:t})},itemId:v,projectId:g,getKey:z,renderItem:Y,renderLoadingItem:ee,itemsGridProps:te,onPreviewClose:ne,onPreviewNavigate:ie,translationPrefix:ae,contentType:se,sourceType:le,refreshIntervalMs:re,settledRefreshIntervalMs:de,refreshOnWindowFocus:ce=!1,isRefreshComplete:ue,isItemPreviewReady:me,fetchAllItems:he=!1}=e;const{t:pe}=(0,F.$)(["ai","common"]),ve=(0,q.I0)(),ge=(0,_.S)({base:!0,md:!1}),_e=(0,O.useRef)(null),fe=(0,O.useRef)(new AbortController),xe=(0,O.useRef)(new AbortController),be=(0,O.useRef)(new AbortController),je=(0,O.useRef)(null),ye=(0,O.useRef)(0),ke=(0,O.useRef)(0),[Ce,we]=(0,f.k)(!0),[Se,Te]=(0,f.k)(),[Ie,Ae]=(0,f.k)(),[Ee,Pe]=(0,f.k)(),[Re,De]=(0,O.useState)(),[ze,Me]=(0,O.useState)(),[Oe,Fe]=(0,O.useState)([]),[Le,qe]=(0,O.useState)(),[Ge,$e]=(0,O.useState)(),[Ne,Ue]=(0,O.useState)([]),[Be,He]=(0,O.useState)(void 0),{isOpen:Je,onOpen:We,onClose:Ke}=(0,x.q)(),{uppy:Ze}=(0,Z.Z)({id:"creative-project",restrictions:{allowedFileTypes:(0,$.getImageAllowedFileTypes)(),maxNumberOfFiles:1}}),{attachedFiles:Ve,setAttachedFiles:Qe,isAttachingFiles:Xe,handleAttachmentClick:Ye,attachmentModal:et,mediaSidebarPanel:tt}=(0,H.V)({extractFileUrl:e=>{var t,n;return(null===e||void 0===e||null===(t=e.meta)||void 0===t?void 0:t.thumbnail_cover_image)||(null===e||void 0===e||null===(n=e.meta)||void 0===n?void 0:n.thumbnail)||(null===e||void 0===e?void 0:e.url)},extractFileType:e=>{var t;return(null===e||void 0===e||null===(t=e.meta)||void 0===t?void 0:t.asset_type)||"image"},extractFileName:e=>{var t;return(null===e||void 0===e||null===(t=e.meta)||void 0===t?void 0:t.asset_name)||"Selected asset"},initialAttachedFiles:[],uppyId:"image-editor-attachment",maxNumberOfFiles:4,allowedFileExtensions:(0,$.getImageAllowedFileTypes)(),mediaPanelAllowedFileTypes:[$.AssetTypes.IMAGE]}),{ratings:nt,isLoading:it,fetchRatings:ot,submitRating:at}=(0,Q.J)({contentType:se||"",sourceType:le||""}),{selectedItem:st,selectedItemIndex:lt}=(0,O.useMemo)(()=>
1{if(!v||null===Le||void 0===Le||!Le.results)return{selectedItem:void 0};const e=Le.results.findIndex(e=>e.id===v);return-1===e?{selectedItem:void 0}:{selectedItem:Le.results[e],selectedItemIndex:e}},[Le,v]),rt=(0,O.useCallback)(async e=>{let{item:t,assetId:n,thumbnailUrl:i,imageUrl:o}=e;try{const e=await(0,G.gVZ)({projectId:g,itemId:t.id,data:{...null===t||void 0===t?void 0:t.data,assets:[n]}});return qe(e=>({...e,results:e.results.map(e=>e.id===t.id?{...e,data:{...e.data,assets:[n]},images:[o],thumbnail:{url:i}}:e)})),e.data}catch(a){console.error(a),(0,K.S3)(a)}finally{je.current&&(je.current(),je.current=null)}},[g]);(0,O.useEffect)(()=>{const e=(e,t)=>{rt({item:null===Be||void 0===Be?void 0:Be.item,assetId:t.id,thumbnailUrl:t.thumbnail_cover_image,imageUrl:t.thumbnail}),Ze.cancelAll()};return Ze.on("saveToAssets:upload-success",e),()=>{Ze.off("saveToAssets:upload-success",e)}},[Ze,null===Be||void 0===Be?void 0:Be.item]),(0,O.useEffect)(()=>{st&&!Je?We():!st&&Je&&Ke()},[st,Je,We,Ke]);const dt=(0,O.useMemo)(()=>Ne.filter(e=>!e.started),[Ne]),ct=(0,O.useMemo)(()=>Ne.filter(e=>!!e.finished),[Ne]),ut=(0,O.useMemo)(()=>{var e;return null===Le||void 0===Le||null===(e=Le.results)||void 0===e?void 0:e.filter(e=>{var t,n;return(null===(t=e.data)||void 0===t?void 0:t.asset_generating)||(null===(n=e.data)||void 0===n?void 0:n.copy_generating)})},[Le]),mt=(0,$.useDebounce)(ct,1e3),ht=(0,O.useCallback)(async()=>{const e=xe.current.signal,t=he?await(0,G.FgJ)(g,{ordering:"created"},e):(await(0,G._pM)(g,{ordering:"created"},e)).data.results;qe({results:t})},[he,g,qe]),pt=(0,O.useCallback)(async()=>{try{var e,t,n;const i=await(0,G.E8z)(g,null===(e=fe.current)||void 0===e?void 0:e.signal);Me(i.data),Ue(((null===(t=i.data)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.executions)||[]).map(e=>({...e,started:!1,finished:!1}))),await ht()}catch(i){if("Aborted"===i.name)return;qe(void 0),Ue([]),(0,K.S3)(i)}},[g,ht,Me]);(0,O.useEffect)(()=>{if(!ze||!ue)return;const e=ue(ze,(null===Le||void 0===Le?void 0:Le.results)||[])?de:re;if(!e)return;const t=window.setInterval(()=>{"hidden"!==document.visibilityState&&pt()},e);return()=>window.clearInterval(t)},[pt,ue,null===Le||void 0===Le?void 0:Le.results,ze,re,de]),(0,O.useEffect)(()=>{if(!ce)return;const e=()=>{if("hidden"===document.visibilityState)return;const e=Date.now();e-ke.current<1e3||(ke.current=e,pt())};return window.addEventListener("focus",e),document.addEventListener("visibilitychange",e),()=>{window.removeEventListener("focus",e),document.removeEventListener("visibilitychange",e)}},[pt,ce]);const vt=(0,O.useCallback)(()=>{ve((0,N.oJ)($.FeatureCodes.COIN))},[ve]),gt=(0,O.useCallback)(async e=>{const t=Ne.find(t=>t.id===e);if(t&&!t.started)try{var n,i,o,a,s,l,r;const c=await(0,G.T42)({workflowId:d,taskId:t.id,timeout:4e3,token:t.token,useSlimStatus:!0,signal:null===(n=be.current)||void 0===n?void 0:n.signal,updateCallback:()=>{ht()}});![G.v1F.RUNNING,G.v1F.SCHEDULED,G.v1F.IN_PROGRESS].includes(null===(i=c.data)||void 0===i?void 0:i.status)&&null!==ze&&void 0!==ze&&null!==(o=ze.data)&&void 0!==o&&null!==(a=o.executions)&&void 0!==a&&a.length&&await(0,G.qzL)({id:ze.id,data:{...ze.data,executions:ze.data.executions.filter(t=>t.id!==e)}}),(null===(s=c.data)||void 0===s?void 0:s.status)===G.v1F.RUNNING?Ue(e=>e.map(e=>e.id===t.id?{...e,started:!0,finished:!1}:e)):(null===(l=c.data)||void 0===l?void 0:l.status)===G.v1F.FAILED?(De(pe("creative_project.errors.generation_failed",{ns:"common"})),ht()):(null===(r=c.data)||void 0===r?void 0:r.status)===G.v1F.TERMINATED?(De(pe("creative_project.errors.generation_terminated",{ns:"common"})),ht()):(Ue(e=>e.map(e=>e.id===t.id?{...e,started:!0,finished:!0}:e)),ht())}catch(c){if("Aborted"===c.message)return;(0,K.S3)(c)}},[d,Ne,ht,pe,ze]),_t=(0,O.useCallback)(async()=>{we.on();try{await pt()}catch{}we.off()},[pt,we]),ft=(0,O.useCallback)(async e=>{try{var t,n;const i=null===(t=e.data)||void 0===t||null===(n=t.assets)||void 0===n?void 0:n[0],o=await(0,G.uIq)(i);if(!o.data.thumbnail)throw new Error("Image not available.");He({originalUrl:o.data.thumbnail,item:e}
1),(0,$.analyticsTrackEvent)(`${u}.editPhotoTool`)}catch(i){(0,K.S3)(i)}},[u]),xt=(0,O.useCallback)(async e=>{let{name:t,data:n}=e;try{const e=(0,$.dataUrlToFile)(n,t),i=new Promise(e=>{je.current=e});Ze.addFile({name:e.name,type:e.type,data:e,source:"Local"}),await i,He(void 0),(0,p.j9B)({description:pe("ai_thumbnail_maker.thumbnail_updated"),status:"success"})}catch(i){(0,K.S3)(i)}},[Ze,pe]),bt=(0,O.useCallback)((e,t)=>{Fe(n=>t?n.includes(e.id)?n:[...n,e.id]:n.filter(t=>t!==e.id))},[Fe]),jt=(0,O.useCallback)(async e=>{try{await(0,G.Ubj)({projectId:g,item:e,title:`${e.title} (${pe("copy",{ns:"common"})})`}),await ht(),(0,p.j9B)({title:pe("duplicate",{ns:"common"}),description:e.title,status:"success"}),(0,$.analyticsTrackEvent)(`${u}.duplicate`)}catch(t){(0,K.S3)(t)}},[u,ht,g,pe]),yt=(0,O.useCallback)(async(e,t)=>{try{await(0,G.gVZ)({projectId:g,itemId:e.id,title:t}),await ht(),(0,$.analyticsTrackEvent)(`${u}.rename`)}catch(n){(0,K.S3)(n)}},[u,ht,g]),kt=(0,O.useCallback)(async()=>{try{$e(e=>({...e,inProgress:!0})),we.on(),await(0,G.L0U)({projectId:g,ids:null===Ge||void 0===Ge?void 0:Ge.ids}),await pt(),(0,p.j9B)({description:pe(`${u}.deleted`,{count:null===Ge||void 0===Ge?void 0:Ge.ids.length}),status:"success"}),(0,$.analyticsTrackEvent)(`${u}.delete`),Fe([]),v&&ne()}catch(e){(0,K.S3)(e)}finally{$e(void 0),we.off()}},[g,u,Ge,pt,v,$e,Fe,we,pe,ne]),Ct=(0,O.useCallback)(async e=>{let t,n;try{var i,o;const a=null===(i=e.data)||void 0===i||null===(o=i.assets)||void 0===o?void 0:o[0];t=(await(0,G.uIq)(a)).data.thumbnail;const s=(0,$.getFileExtension)(t);n=`thumbnail_${(0,$.slugify)(e.title)}.${s}`;const l=await fetch(t),r=await l.blob();(0,R.saveAs)(r,n)}catch(a){try{const e=await fetch(`${G.XzF}${encodeURIComponent(t)}`),i=await e.blob();(0,R.saveAs)(i,n)}catch(a){(0,p.CFj)({description:pe("image_download_went_Wrong",{ns:"common"}),title:pe("error",{ns:"common"}),status:"error"})}}(0,$.analyticsTrackEvent)(`${u}.download`)},[u,pe]),wt=(0,O.useCallback)(async()=>{var e,t;const n=null!==(e=null===Le||void 0===Le||null===(t=Le.results)||void 0===t?void 0:t.filter(e=>Oe.includes(e.id)))&&void 0!==e?e:[],i=new(M());let o,a;try{Ae.on();for(const r of n){var s,l;const e=null===(s=r.data)||void 0===s||null===(l=s.assets)||void 0===l?void 0:l[0];o=(await(0,G.uIq)(e)).data.thumbnail;const t=(0,$.getFileExtension)(o);a=`thumbnail_${(0,$.slugify)(r.title)}.${t}`;const n=await fetch(o),d=await n.blob();i.file(a,d)}const e=await i.generateAsync({type:"blob"}),t=null!==ze&&void 0!==ze&&ze.title?(0,$.slugify)(ze.title):`${(0,$.slugify)(ae)}_project`;(0,R.saveAs)(e,`${t}.zip`)}catch(r){(0,p.CFj)({description:pe("image_download_went_Wrong",{ns:"common"}),title:pe("error",{ns:"common"}),status:"error"})}finally{Ae.off()}(0,$.analyticsTrackEvent)(`${u}.bulk_download`)},[Le,Oe,ze,ae,u,pe,Ae]),St=(0,O.useCallback)(async e=>{var t,n;const i=null!==(t=null===Le||void 0===Le||null===(n=Le.results)||void 0===n?void 0:n.filter(t=>null!==e&&void 0!==e&&e.ids.length?e.ids.includes(t.id):Oe.includes(t.id)))&&void 0!==t?t:[];try{Te.on();const e=await Promise.all(i.map(async e=>{var t,n,i,o;const a=null===(t=e.data)||void 0===t||null===(n=t.assets)||void 0===n?void 0:n[0],s=await(0,G.uIq)(a);return{url:null===(i=s.data)||void 0===i?void 0:i.thumbnail,thumbUrl:null===(o=s.data)||void 0===o?void 0:o.thumbnail_cover_image}})).catch(e=>{throw e});ve((0,U.VN)({mode:J.JV,postData:{},addPostMedia:e.map(e=>({url:e.url,thumbUrl:e.thumbUrl,mimeType:"image/png",external:!0,credits:""}))}))}catch(o){(0,K.S3)(o)}finally{Te.off()}},[Le,Oe,ve,Te]);(0,O.useEffect)(()=>{dt.forEach(e=>{gt(e.id)})},[dt,gt]),(0,O.useEffect)(()=>{mt.length&&vt()},[mt,vt]),(0,O.useEffect)(()=>(_t(),()=>{var e,t,n;null===(e=be.current)||void 0===e||e.abort("Aborted"),null===(t=fe.current)||void 0===t||t.abort("Aborted"),null===(n=xe.current)||void 0===n||n.abort("Aborted")}),[g,_t]),(0,O.useEffect)(()=>{if(Ce||null===Le||void 0===Le||!Le.results)return void(ye.current=0);if(Le.results.every(e=>{var t,n,i;return me?me(e):Boolean((null===(t=e.thumbnail)||void 0===t?void 0:t.url)||(null===(n=e.data)||void 0===n||null===(i=n.posts)||void 0===i?void 0:i.length))})||ye.current>=5)return void(ye.current=0);const e=setTimeout(()=>{ye.current++,ht()},3e3);return()=>clearTimeout(e)},[Le,Ce,ht,me]),(0,O.useEffect)(()=>{const e=setTimeout(()=>{Pe.on()},2e4);return()=>{clearTimeout(e)}},[g,_t,Pe]);const Tt=(0,O.useMemo)(()=>((null===Le||void 0===Le?void 0:Le.results)||[]).map(e=>e.id).join(","),[null===Le||void 0===Le?void 0:Le.results]);(0,O.useEffect)(()=>{se&&le&&Tt&&ot(Tt.split(","),!0)},[Tt,se,le]);const It=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(i.k,{flexDirection:"column",gap:3,minHeight:"full",children:[Re&&(0,c.jsx)(o.x,{children:(0,c.jsx)(p.bZj,{cursor:"default",status:"error",showIcon:!0,borderRadius:"xl",children:(0,c.jsx)(b.X,{children:Re})})}),(0,c.jsxs)(h.M,{spacing:4,gridTemplateColumns:"repeat(auto-fill, minmax(min(280px, 100%), 1fr))",marginBottom:"auto",pb:4,ref:_e,...te,children:[null!==Le&&void 0!==Le&&null!==(t=Le.results)&&void 0!==t&&t.length?null===Le||void 0===Le||null===(n=Le.results)||void 0===n?void 0:n.map((e,t)=>{var n;return(0,c.jsx)(o.x,{children:Y({item:e,date:(0,P.default)(new Date(e.modified||e.created),"yyyy-MM-dd h:mm a"),thumbnail:null===(n=e.thumbnail)||void 0===n?void 0:n.url,isAssetGenerating:!Re&&e.data.asset_generating,isCopyGenerating:!Re&&e.data.copy_generating,images:(null===e||void 0===e?void 0:e.images)||[],isSelected:Oe.includes(e.id),onEditImage:()=>ft(e),onDelete:()=>
1$e({ids:[e.id]}),onDuplicate:()=>jt(e),onRename:t=>yt(e,t),onSelectToggle:t=>bt(e,t),onDownload:()=>Ct(e),onShare:()=>St({ids:[e.id]}),isSharing:Se,feedback:se&&le?(0,c.jsx)(V.Z,{contentId:e.id,currentRating:nt[e.id],onRate:at,isDisabled:it,wrapperStyles:{marginLeft:2}}):void 0})},z?z(e,t):t)}):null,Ce&&ee?Array.from({length:3}).map((e,t)=>(0,c.jsx)(o.x,{children:ee(t)},`loading-item-${t}`)):null]}),Oe.length>0&&(0,c.jsxs)(i.k,{alignItems:"center",justifyContent:"space-between",padding:3,gap:2,background:"base_level_3",borderRadius:"lg",border:"1px solid",borderColor:"content_alpha_100",boxShadow:"float",position:"sticky",bottom:4,zIndex:"dropdown",marginTop:4,as:D.E.div,initial:{y:100,opacity:0},animate:{y:0,opacity:1,transition:{type:"spring",bounce:.2,duration:.6}},exit:{y:100,opacity:0},children:[(0,c.jsx)(i.k,{flex:1,gap:2,alignItems:"center",children:(0,c.jsx)(B.Z,{padding:2,background:"content_alpha_100",borderRadius:"md",label:ge?void 0:pe("select_all",{ns:"common"}),isChecked:Oe.length===Le.results.filter(e=>Re||!e.data.asset_generating&&!e.data.copy_generating).length,onChange:e=>{var t;e.target.checked?Fe(null===Le||void 0===Le||null===(t=Le.results)||void 0===t?void 0:t.map(e=>e.id&&(Re||!e.data.asset_generating&&!e.data.copy_generating))):Fe([]);
1(0,$.analyticsTrackEvent)(`${u}.selectAllToggle`)}})}),(0,c.jsxs)(i.k,{flex:1,gap:2,alignItems:"center",justifyContent:"flex-end",children:[(0,c.jsx)(j.u,{placement:"top",label:pe("items_selected",{ns:"common",count:Oe.length||0}),hasArrow:!0,children:(0,c.jsx)(y.C,{variant:"secondary",children:Oe.length||0})}),(0,c.jsxs)(k.h,{isAttached:!0,variant:"solid",isDisabled:Ce||!Oe.length,children:[(0,c.jsx)(l.z,{onClick:()=>St(),leftIcon:(0,c.jsx)(L.lzh,{}),isLoading:Se,children:pe("publish",{ns:"common"})}),(0,c.jsxs)(C.v,{isLazy:!0,placement:"top-end",children:[(0,c.jsx)(w.j,{as:S.h,icon:(0,c.jsx)(T.J,{as:L.gPZ}),isDisabled:Se}),(0,c.jsxs)(I.q,{children:[(0,c.jsx)(A.s,{onClick:wt,icon:(0,c.jsx)(L.$0x,{}),children:pe("download",{ns:"common"})}),(0,c.jsx)(E.i,{}),(0,c.jsx)(A.s,{color:"common.negative",onClick:()=>$e({ids:Oe}),icon:(0,c.jsx)(L.KGR,{}),children:pe("delete",{ns:"common"})})]})]})]}),!ge&&Ee&&Ne.filter(e=>!e.finished).length>0&&(0,c.jsxs)(i.k,{as:D.E.div,animate:{opacity:1},initial:{opacity:0},position:"absolute",bottom:"calc(100% + 8px)",left:0,right:0,alignItems:"center",padding:2,background:"common.ai",color:"dark.content_active",borderRadius:"md",fontSize:"sm",children:[pe("long_generation_info",{ns:"ai"}),(0,c.jsx)(p.Ddz,{tooltipLabel:pe("close",{ns:"common"}),icon:(0,c.jsx)(L.APH,{}),variant:"ghost",size:"xs",marginLeft:"auto",onClick:Pe.off})]})]})]}),!ge&&Ee&&(null===ut||void 0===ut?void 0:ut.length)>0&&!Oe.length&&(0,c.jsxs)(i.k,{as:D.E.div,animate:{opacity:1},initial:{opacity:0}
1,position:"fixed",bottom:4,left:4,right:4,alignItems:"center",padding:2,background:"common.ai",color:"dark.content_active",borderRadius:"md",fontSize:"sm",children:[pe("long_generation_info",{ns:"ai"}),(0,c.jsx)(p.Ddz,{tooltipLabel:pe("close",{ns:"common"}),icon:(0,c.jsx)(L.APH,{}),variant:"ghost",size:"xs",marginLeft:"auto",onClick:Pe.off})]})]}),!!Be&&(0,c.jsx)(X.Z,{defaultFile:Be.originalUrl,onSave:xt,onCancel:()=>He(void 0),isAttachingFiles:Xe,onAttachFiles:Ye,attachedFiles:Ve,onRemoveAttachedFile:e=>Qe(t=>t.filter(t=>t.id!==e)),onRemoveAllAttachedFiles:()=>Qe([]),attachmentModalComponent:et,mediaSidebarPanel:tt}),Ie&&(0,c.jsx)(o.x,{position:"fixed",inset:0,zIndex:"overlay",children:(0,c.jsx)(p.GtR,{children:(0,c.jsx)(p.p9A,{})})}),(0,c.jsx)(p.sm4,{loading:!(null===Ge||void 0===Ge||!Ge.inProgress),isOpen:!(null===Ge||void 0===Ge||null===(a=Ge.ids)||void 0===a||!a.length),title:pe("are_you_sure",{ns:"common"}),message:pe("ai_thumbnail_maker.delete_confirm",{count:null===Ge||void 0===Ge||null===(s=Ge.ids)||void 0===s?void 0:s.length}),cancelButtonText:pe("cancel",{ns:"common"}),confirmButtonText:pe("delete",{ns:"common"}),confirmButtonVariant:"danger",onConfirm:kt,onClose:()=>$e(void 0)}),st&&(0,c.jsx)(oe,{isOpen:Je,onClose:ne,selectedItemIndex:lt,id:g,itemsData:Le,onEditImage:()=>ft(st),onDownload:()=>Ct(st),onShare:e=>St({ids:[e]}),onPreviewNavigate:e=>null===ie||void 0===ie?void 0:ie(g,e),translationPrefix:ae,isSharing:Se}),(0,c.jsx)(W.Z,{})]});return m({data:ze,isLoading:Ce,children:It,itemCount:null===Le||void 0===Le||null===(r=Le.results)||void 0===r?void 0:r.length,items:null===Le||void 0===Le?void 0:Le.results})}},576212:(e,t,n)=>{n.d(t,{L:()=>w});var i=n(351839),o=n(270858),a=n(329060),s=n(741065),l=n(39821),r=n(170882),d=n(828865),c=n(366354),u=n(138342),m=n(902352),h=n(295903),p=n(878237),v=n(179822),g=n(880745),_=n(308686),f=n(683017),x=n(408499),b=n(193691),j=n(412997),y=n(90583),k=n(147568),C=n(228993);const w=e=>{let{date:t,hideDate:n,thumbnail:w,isSelected:S,isAssetGenerating:T,isCopyGenerating:I,title:A,onDelete:E,onDuplicate:P,onRename:R,onClick:D,onDownload:z,onEditImage:M,onSelectToggle:O,translationPrefix:F,onShare:L,isSharing:q,feedback:G}=e;const{t:$}=(0,x.$)(["planner","common","automation","ai"]),[N,U]=(0,f.useState)(!1),B=(0,f.useMemo)(()=>T||I||q,[T,I,q]);return(0,C.jsxs)(i.k,{as:_.E.div,animate:{opacity:1},initial:{opacity:0}
1,direction:"column",maxW:"100%",background:"base_level_2",borderRadius:"lg",boxShadow:S?"highlight":"",gap:2,py:2,px:3,mb:3,onClick:B||!D?void 0:()=>D(),cursor:B||!D?"default":"pointer",children:[(0,C.jsxs)(i.k,{gap:2,align:"center",children:[O&&(0,C.jsx)(o.x,{mt:1,onClick:e=>{e.stopPropagation()},children:(0,C.jsx)(a.X,{isChecked:S,isDisabled:B,onChange:e=>{O(e.target.checked)}})}),A?(0,C.jsx)(o.x,{flex:1,minW:0,onClick:e=>e.stopPropagation(),children:(0,C.jsx)(k.e,{value:A,onSave:e=>null===R||void 0===R?void 0:R(e),isDisabled:!R,startWithEditView:N,onEditEnd:()=>U(!1),fontWeight:"medium",color:"content_inactive",previewStyles:{px:0}})}):(0,C.jsx)(s.x,{flex:1,fontSize:"sm",fontWeight:500,children:$(`${F}.thumbnail`,{ns:"ai"})}),G,(0,C.jsxs)(i.k,{children:[M&&(0,C.jsx)(y.Ddz,{tooltipLabel:$(`${F}.edit_image`,{ns:"ai"}),variant:"ghost",size:"sm",icon:(0,C.jsx)(j.FBZ,{}),isDisabled:B,onClick:e=>{e.stopPropagation(),M()}}),L&&(0,C.jsx)(y.Ddz,{tooltipLabel:$("share_on_social",{ns:"common"}),variant:"ghost",size:"sm",icon:(0,C.jsx)(b.lzh,{}),isDisabled:B,onClick:e=>{e.stopPropagation(),L()}}),(0,C.jsxs)(l.v,{isLazy:!0,autoSelect:!1,placement:"bottom-end",children:[(0,C.jsx)(r.j,{as:d.h,size:"sm",variant:"ghost",icon:(0,C.jsx)(b.D4X,{}),"aria-label":$("options",{ns:"common"}),isDisabled:B,onClick:e=>e.stopPropagation()}),(0,C.jsxs)(c.q,{minWidth:0,onClick:e=>e.stopPropagation(),children:[R&&(0,C.jsx)(u.s,{icon:(0,C.jsx)(b.r3Y,{}),onClick:()=>U(!0),children:$("rename",{ns:"common"})}),P&&(0,C.jsx)(u.s,{icon:(0,C.jsx)(b.gy$,{}),onClick:P,children:$("duplicate",{ns:"common"})}),z&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(u.s,{icon:(0,C.jsx)(b.$0x,{}),onClick:z,children:$("download",{ns:"common"})}),(0,C.jsx)(m.i,{})]}),(0,C.jsx)(u.s,{icon:(0,C.jsx)(b.KGR,{}),color:"common.danger",onClick:E,children:$("delete",{ns:"common"})})]})]})]})]}),(0,C.jsx)(i.k,{align:"center",h:"10rem",w:"full",position:"relative",bg:"base_level_1",borderRadius:"lg",overflow:"hidden",children:T?(0,C.jsxs)(i.k,{direction:"column",gap:2,align:"center",justify:"center",w:"full",h:"full",children:[(0,C.jsx)(h.O,{position:"absolute",bottom:0,left:0,borderRadius:"xl",w:"full",h:"full"}),(0,C.jsx)(p.$,{size:"xs",color:"content_note"}),(0,C.jsx)(y.AHo,{containerProps:{fontSize:"xs"},duration:1.2,children:$(`${F}.asset_generating`,{ns:"ai"})})]}):w?(0,C.jsx)(v.E,{position:"absolute",top:0,left:0,w:"full",h:"full",borderRadius:"lg",objectFit:"contain",src:w}):(0,C.jsxs)(i.k,{direction:"column",gap:2,align:"center",justify:"center",w:"full",h:"full",children:[(0,C.jsx)(h.O,{position:"absolute",bottom:0,left:0,borderRadius:"xl",w:"full",h:"full"}),(0,C.jsx)(p.$,{size:"xs",color:"content_note"})]})}),!n&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(m.i,{width:"auto",marginX:-3}),(0,C.jsx)(i.k,{alignItems:"center",gap:2,children:(0,C.jsx)(i.k,{alignItems:"center",gap:2,paddingY:1,fontSize:"xs",color:"content_note",children:t?(0,C.jsx)(s.x,{lineHeight:1.2,noOfLines:1,minHeight:"1.2em",children:t}):(0,C.jsx)(g.N,{skeletonHeight:"1em",noOfLines:1})})})]})]})}},844460:(e,t,n)=>{n.d(t,{k:()=>p});var i=n(689100),o=n(206782),a=n(413541),s=n(351839),l=n(129944),r=n(298249),d=n(741065),c=n(193691),u=n(408499),m=n(228993);const h=40,p=e=>{let{items:t,value:n,onChange:p,isDisabled:v}=e;const{t:g}=(0,u.$)(["ai"]),_=(0,i.mq)("RadioGroup",{variant:"card"});return(0,m.jsx)(o.E,{onChange:p,value:n,size:"sm",variant:"card",__css:_,children:t.map(e=>{const t=e.data?(e=>{const{width:t,height:n}=e;if(!t||!n)return{width:h,height:h};if(t===n)return{width:h,height:h};if(t>n){const e=Math.max(n/t*h,16);return{width:h,height:e}}return{width:Math.max(t/n*h,16),height:h}})(e.data):null;return(0,m.jsx)(a.Y,{value:e.value,isDisabled:v||e.isComingSoon,children:(0,m.jsxs)(s.k,{flexDirection:"column",gap:2,width:32,height:"110px",padding:2,alignItems:"center",justifyContent:"center",children:[t&&(0,m.jsx)(l.M,{height:"full",width:"full",children:(0,m.jsx)(l.M,{height:`${t.height}px`,width:`${t.width}px`,border:"1.5px solid",borderColor:"content_inactive",borderRadius:"base",background:"base_level_3",children:(0,m.jsx)(r.J,{as:c.heq,color:"content_inactive"})})}),(0,m.jsxs)(s.k,{flexDirection:"column",gap:1,alignItems:"center",children:[(0,m.jsx)(d.x,{fontSize:"sm",fontWeight:"medium",color:"content_active",children:g(`aspect_ratios.${e.label}.title`)}),e.data&&(0,m.jsxs)(d.x,{fontSize:"xs",lineHeight:"shorter",color:"content_details",children:["(",e.data.width,"x",e.data.height,")"]})]})]})},e.value)})})}},866919:(e,t,n)=>{n.d(t,{$h:()=>s,HT:()=>a,JM:()=>o,bW:()=>i});let i=function(e){return e.History="h",e}({}),o=function(e){return e.Text="text",e.Photo="photo",e.Video="video",e.Carousel="
1carousel",e}({}),a=function(e){return e.Post="post",e.Reel="reel",e.Story="story",e}({}),s=function(e){return e.Intro="intro",e.Basic="basic",e.Personalize="personalize",e.Enhance="enhance",e.Generate="generate",e.ChooseBrandbook="chooseBrandbook",e.AdvancedCustomization="advancedCustomization",e.CustomizeContent="customizeContent",e.ChooseActor="chooseActor",e.ChooseProduct="chooseProduct",e.Scenarios="scenarios",e}({})},992504:(e,t,n)=>{n.d(t,{Aq:()=>c,Di:()=>p,Eo:()=>u,JQ:()=>d,R4:()=>m,pz:()=>h});var i=n(412997),o=n(104399),a=n(957392),s=n(866919);const l={[a.FACEBOOK]:[{value:s.HT.Post,postTypes:[{value:s.JM.Text,thumb:i.XPI},{value:s.JM.Photo,thumb:i.CQ2},{value:s.JM.Video,thumb:i.hn4,isComingSoon:!0}]},{value:s.HT.Story,postTypes:[{value:s.JM.Photo,thumb:i.LWi},{value:s.JM.Video,thumb:i.ZXu,isComingSoon:!0}]},{value:s.HT.Reel,isComingSoon:!0,postTypes:[{value:s.JM.Video,thumb:i.ZXu,isComingSoon:!0}]}],[a.INSTAGRAM]:[{value:s.HT.Post,postTypes:[{value:s.JM.Photo,thumb:i.CQ2},{value:s.JM.Carousel,thumb:i.z50,isBeta:!0,isPremium:!0},{value:s.JM.Video,thumb:i.hn4,isComingSoon:!0}]},{value:s.HT.Story,postTypes:[{value:s.JM.Photo,thumb:i.LWi},{value:s.JM.Video,thumb:i.ZXu,isComingSoon:!0}]},{value:s.HT.Reel,isComingSoon:!0,postTypes:[{value:s.JM.Video,thumb:i.ZXu,isComingSoon:!0}]}],[a.TIKTOK]:[{value:s.HT.Post,postTypes:[{value:s.JM.Photo,thumb:i.CQ2},{value:s.JM.Video,thumb:i.hn4,isComingSoon:!0}]}],[a.TIKTOK_BUSINESS]:[{value:s.HT.Post,postTypes:[{value:s.JM.Photo,thumb:i.CQ2},{value:s.JM.Video,thumb:i.hn4,isComingSoon:!0}]}],[a.TWITTER]:[{value:s.HT.Post,postTypes:[{value:s.JM.Text,thumb:i.XPI},{value:s.JM.Photo,thumb:i.CQ2},{value:s.JM.Video,thumb:i.hn4,isComingSoon:!0}]}],[a.THREADS]:[{value:s.HT.Post,postTypes:[{value:s.JM.Text,thumb:i.XPI},{value:s.JM.Photo,thumb:i.CQ2},{value:s.JM.Video,thumb:i.hn4,isComingSoon:!0}]}],[a.BLUESKY]:[{value:s.HT.Post,postTypes:[{value:s.JM.Text,thumb:i.XPI},{value:s.JM.Photo,thumb:i.CQ2},{value:s.JM.Video,thumb:i.hn4,isComingSoon:!0}]}],[a.GOOGLE]:[{value:s.HT.Post,postTypes:[{value:s.JM.Text,thumb:i.XPI},{value:s.JM.Photo,thumb:i.CQ2}]}],[a.YOUTUBE]:[{value:s.HT.Post,postTypes:[{value:s.JM.Video,thumb:i.hn4,isComingSoon:!0}]}],[a.LINKEDIN]:[{value:s.HT.Post,postTypes:[{value:s.JM.Text,thumb:i.XPI},{value:s.JM.Photo,thumb:i.CQ2},{value:s.JM.Video,thumb:i.hn4,isComingSoon:!0}]}],[a.PINTEREST]:[{value:s.HT.Post,postTypes:[{value:s.JM.Photo,thumb:i.CQ2},{value:s.JM.Video,thumb:i.hn4,isComingSoon:!0}]}]},r=e=>(l[e]||[]).map(t=>{let{postTypes:n,...i}=t;return{...i,provider:e}}
1),d=e=>0===e.length?[]:e.map(r).reduce((e,t)=>e.filter(e=>t.find(t=>t.value===e.value))),c=(e,t)=>0===e.length?[]:e.map(e=>((e,t)=>{var n;return(null===(n=(l[e]||[]).find(e=>e.value===t))||void 0===n?void 0:n.postTypes)||[]})(e,t)).reduce((e,t)=>e.filter(e=>t.find(t=>t.value===e.value))),u=(e,t)=>{var n,i;const{fields:o}=e.describe();return!!o[t]&&(!("array"===o[t].type||null===(n=o[t].tests)||void 0===n||!n.some(e=>"required"===e.name))||!("array"!==o[t].type||null===(i=o[t].tests)||void 0===i||!i.some(e=>"min"===e.name)))},m=e=>""===e?o.AdvancedSettingsTabsTypes.default:o.AdvancedSettingsTabsTypes.brandbook,h=e=>new Promise((t,n)=>{const i=new window.Image;i.onload=()=>{t({width:i.naturalWidth,height:i.naturalHeight})},i.onerror=n,i.src=e}),p=async(e,t,n)=>{try{const i=await h(e),o=t.reduce((e,t)=>(e[t.value]=t.data.width/t.data.height,e),{});return((e,t,n,i)=>{if(!e||!t||0===t)return i;const o=e/t;let a=i,s=1/0;for(const[l,r]of Object.entries(n)){const e=Math.abs(o-r);e<s&&(s=e,a=l)}return a})(i.width,i.height,o,n)}catch{return n}}}}]);
2//# sourceMappingURL=380.ed5a2d3a.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.