PageSourceSearch

https://adflex.ai/_next/static/chunks/54902.5238a314ec0172b4.js

js adflex.ai collected 2026-10-05 11:50:09 UTC 36,206 bytes, 8 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="16bc23d2-9d0c-44f7-ab01-3cd474d98261",e._sentryDebugIdIdentifier="sentry-dbid-16bc23d2-9d0c-44f7-ab01-3cd474d98261")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[54902],{3407:(e,t,a)=>{a.d(t,{E:()=>s,p:()=>l});var r=a(95155),n=a(64269);let o="repeating-conic-gradient(var(--color-border-default) 0% 25%, var(--color-surface-deep) 0% 50%) 0 0 / 20px 20px",i="repeating-conic-gradient(var(--cal-slot-past-bg) 0% 25%, var(--color-surface-deep) 0% 50%) 0 0 / 20px 20px";function s({className:e}){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{"aria-hidden":!0,className:(0,n.cn)("pointer-events-none absolute inset-0",e),style:{background:o}}),(0,r.jsx)("div",{"aria-hidden":!0,className:(0,n.cn)("pointer-events-none absolute inset-0 hidden dark:block",e),style:{background:i}})]})}function l({children:e,className:t}){return(0,r.jsxs)("div",{className:(0,n.cn)("relative h-full w-full overflow-hidden rounded-[12px]",t),style:{background:o},children:[(0,r.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 hidden dark:block",style:{background:i}}),(0,r.jsx)("div",{className:"relative h-full w-full",children:e})]})}},34768:(e,t,a)=>{a.d(t,{hr:()=>l,xO:()=>d});var r=a(12115),n=a(1213),o=a(71802),i=a(80900);function s(e,t,a,n){let o=(0,r.useRef)(!1);(0,r.useEffect)(()=>{e&&t&&!a&&!o.current&&(o.current=!0,n())},[e,t,a,n])}let l=(e={autoFetch:!0})=>{let t=(0,o.jL)(),a=(0,n.d4)(e=>e.aiModels.imageModels),l=(0,n.d4)(e=>e.aiModels.loadingStates.imageModels),d=(0,n.d4)(e=>e.aiModels.error),c=(0,n.d4)(e=>e.aiModels.lastFetched.imageModels),u=(0,r.useCallback)(()=>{t((0,i.iv)())},[t]);return s(!!e.autoFetch,!c,l,u),{textToImage:a.text_to_image,imageToImage:a.image_to_image,imagesToImage:a.images_to_image,upscaleImage:a.upscale_image,loading:l,error:d,refetch:()=>{t((0,i.iv)({force:!0}))}}},d=(e={autoFetch:!0})=>{let t=(0,o.jL)(),a=(0,n.d4)(e=>e.aiModels.videoModels),l=(0,n.d4)(e=>e.aiModels.loadingStates.videoModels),d=(0,n.d4)(e=>e.aiModels.error),c=(0,n.d4)(e=>e.aiModels.lastFetched.videoModels),u=(0,r.useCallback)(()=>{t((0,i.QD)())},[t]);return s(!!e.autoFetch,!c,l,u),{textToVideo:a.text_to_video,imageToVideo:a.image_to_video,videoToVideo:a.video_to_video,upscaleVideo:a.upscale_video,characterPerformance:a.character_performance,loading:l,error:d,refetch:()=>{t((0,i.QD)({force:!0}))}}}},44466:(e,t,a)=>{a.d(t,{CH:()=>P,Dq:()=>N,Lo:()=>k,PF:()=>V,PW:()=>f,Uc:()=>M,fr:()=>j,qJ:()=>_,sw:()=>I,w5:()=>w});var r=a(78162),n=a(53434);let o=e=>"string"==typeof e&&e.trim().length>0,i=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),s=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l=e=>"number"==typeof e&&Number.isFinite(e),d=e=>l(e)&&Number.isInteger(e)&&e>=0,c=(e,t)=>!s(e,t)||"string"==typeof e[t],u=(e,t)=>!s(e,t)||"string"==typeof e[t]&&!Number.isNaN(new Date(e[t]).getTime()),m=(e,t)=>!s(e,t)||d(e[t]),p=(e,t)=>"string"==typeof e&&t.includes(e);function f(e,t){var a;let r,n;if(!i(e)||!s(e,"board"))throw Error("Invalid Brand Scan response envelope");let f=e.board;if(null===f){if(!t.allowNull||t.requirePositiveRevision||t.requireReused)throw Error("Invalid empty Brand Scan board");return{board:null}}if(!(i(f)&&o(f.businessId)&&"string"==typeof f.requestedUrl&&"string"==typeof f.url&&"string"==typeof f.businessName&&"string"==typeof f.description&&(e=>{if(!i(e)||s(e,"processingTime")&&(!l(e.processingTime)||e.processingTime<0)||!u(e,"scanDate")||!c(e,"source")||!c(e,"language")||s(e,"socialRoot")&&"boolean"!=typeof e.socialRoot||s(e,"rootProvider")&&null!==e.rootProvider&&"string"!=typeof e.rootProvider||s(e,"coreSources")&&(!i(e.coreSources)||!c(e.coreSources,"businessName")||!c(e.coreSources,"description")||!c(e.coreSources,"language")))return!1;if(s(e,"industrySuggestion")){let t=e.industrySuggestion;if(!i(t)||"string"!=typeof t.value||"string"!=typeof t.source||"string"!=typeof t.confidence||!Array.isArray(t.evidenceHints)||!t.evidenceHints.every(e=>"string"==typeof e))return!1}return!0})(f.metadata)&&(e=>{if(!i(e)||!Array.isArray(e.logos)||!Array.isArray(e.colors)||!Array.isArray(e.fonts))return!1;let t=e=>i(e)&&"string"==typeof e.sourceUrl&&l(e.confidence)&&e.confidence>=0&&e.confidence<=1&&"string"==typeof e.evidenceLabel;return e.logos.every(e=>t(e)&&"string"==typeof e.url&&(!s(e,"kind")||p(e.kind,["logo","avatar"])))&&e.colors.every(e=>t(e)&&"string"==typeof e.value)&&e.fonts.every(e=>t(e)&&"string"==typeof e.family)})(f.visualCandidates)&&(e=>{if(!Array.isArray(e))return!1;let t=new Set;return e.every(e=>{let a;return!(!i(e)||!p(e.provider,["facebook","instagram","linkedin","snapchat","tiktok","x","youtube"])||!(e=>{if("string"!=typeof e)return!1;try{let t=new URL(e).protocol;return"http:"===t||"https:"===t}catch{return!1}})(e.profileUrl)||"string"!=typeof e.handle||!o(e.accountIdentity)||t.has(e.accountIdentity))&&"string"==typeof e.sourceUrl&&!!l(e.confidence)&&!(e.confidence<0)&&!(e.confidence>1)&&"string"==typeof e.evidenceLabel&&!!p(e.decision,["proposed","dismissed"])&&!!(i(a=e.connection)&&p(a.state,["connected","not_connected","unsupported"])&&(!s(a,"connectionState")||p(a.connectionState,["connected","needs_attention","disconnected","unknown"]))&&c(a,"accountName")&&c(a,"platform")&&m(a,"otherBrandsCount"))&&(t.add(e.accountIdentity),!0)})})(f.socialCandidates)&&(e=>{if(!Array.isArray(e))return!1;let t=new Set;return e.every(e=>!(!i(e)||!p(e.field,["name","description","language","website"])||t.has(e.f
1ield))&&(null===e.proposedValue||"string"==typeof e.proposedValue)&&"string"==typeof e.currentValueAtScan&&(null===e.provenance||"string"==typeof e.provenance)&&!!p(e.decision,["proposed","applied","dismissed"])&&!!c(e,"appliedValue")&&!!u(e,"decidedAt")&&(t.add(e.field),!0))})(f.fields)&&d(f.scanRevision)&&d(f.boardRevision)&&p(f.lastScanStatus,["scanning","ready","failed"])&&c(f,"lastScanErrorCode")&&u(f,"lastScanFailedAt")&&u(f,"scannedAt")&&u(f,"lastAppliedAt")&&"boolean"==typeof f.scanInProgress&&(null===(a=f.enrichment)||i(a)&&p(a.status,["queued","running","done","cancelled","failed"])&&l(r=a.scanRevision)&&Number.isInteger(r)&&r>=1&&"string"==typeof(n=a.runToken)&&/^[a-f0-9]{32}$/.test(n)&&"boolean"==typeof a.stale&&u(a,"queuedAt")&&u(a,"startedAt")&&u(a,"finishedAt")&&m(a,"pagesFetched")&&m(a,"findingsExtracted")&&m(a,"candidatesRecorded")&&c(a,"stopReason")&&c(a,"errorCode")))||f.businessId!==t.expectedBusinessId||t.requirePositiveRevision&&f.scanRevision<1)throw Error("Invalid Brand Scan board payload");if(t.requireReused){if("boolean"!=typeof e.reused)throw Error("Invalid Brand Scan reuse marker");return{board:f,reused:e.reused}}return{board:f}}let g="brand_scan_transport_unreachable",b=new Set(["ECONNABORTED","ECONNRESET","ERR_NETWORK","ETIMEDOUT"]),x=new Set(["ERR_CANCELED"]),h=new Set(["AbortError","CanceledError"]),v=e=>"object"!=typeof e||null===e?null:e,y=e=>{let t=v(e);if(!t)return!1;let a="string"==typeof t.code?t.code:"",r="string"==typeof t.name?t.name:"";return x.has(a)||h.has(r)};function w(e){let t=(0,n.P)((e=>{if("object"==typeof e&&null!==e&&"response"in e)return e.response?.data})(e));if(t)return{message:t,reportUnexpected:!1};if((e=>{let t=v(e);if(!t||y(e)||t.response)return!1;let a="string"==typeof t.code?t.code:"";return b.has(a)||!0===t.isAxiosError&&!!t.request})(e))return{message:g,reportUnexpected:!1};let a=v(e),r=!!a?.response,o=(e=>{let t=v(e),a=t?.response;if("object"!=typeof a||null===a)return null;let r=a.status;return"number"==typeof r&&Number.isInteger(r)&&r>=100&&r<=599?r:null})(e);return{message:"Failed to scan website",reportUnexpected:!(y(e)||r&&null!==o&&o<500)}}function _(e){if(!(e instanceof Error))return Error("Unexpected brand website scan failure");let t=Error(e.message||"Brand website scan failed");return t.name=e.name||"BrandWebsiteScanError",e.stack&&(t.stack=e.stack),t}function j(e){if(!o(e))return!1;let t=e.trim().toLowerCase();return!["could not fully scan website","failed to scan website","unable to scan website","error scanning website"].some(e=>
1t.startsWith(e))}function N(e){let t=e.trim().replace(/^@+/,"");if(!t||/\s/.test(t))return null;let a=/^https?:\/\//i.test(t)?t:`https://${t}`;try{let e=new URL(a),t=e.hostname.replace(/^\[|\]$/g,""),r=t.includes(":")||t.split(".").length>=2&&t.split(".").every(e=>/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(e));if(!e.hostname||!["http:","https:"].includes(e.protocol)||e.username||e.password||e.hostname.includes("%")||!r)return null;return e.toString()}catch{return null}}function k(e){if(N(e))return null;let t=e.trim();return t.startsWith("@")?"handle":!t||/\s/.test(t)||/^[a-z][a-z0-9+.-]*:/i.test(t)||t.includes(".")?"invalid":"handle"}let T={rate_limited:"brand_center.scan_rate_limited",not_webpage:"brand_center.scan_not_webpage",invalid_url:"brand_center.scan_invalid_url",blocked_url:"brand_center.scan_unsafe_url",unreachable:"brand_center.scan_unreachable",timeout:"brand_center.scan_unreachable",social_root_unreadable:"brand_center.scan_social_root_unreadable",scan_failed:"brand_center.scan_failed"},C=e=>"string"==typeof e&&Object.prototype.hasOwnProperty.call(T,e);function I(e){if("string"==typeof e)return C(e)?e:null;if("object"!=typeof e||null===e)return null;let t=e.errorCode;return C(t)?t:null}function V(e){let t=I(e);if(t)return T[t];let a=("string"==typeof e?e:e instanceof Error?e.message:"").toLowerCase();return a.includes("too many requests")||a.includes("rate limit")||/\b429\b/.test(a)?"brand_center.scan_rate_limited":a.includes("unsupported content-type")?"brand_center.scan_not_webpage":a.includes("private ip")||a.includes("blocked for security")||a.includes("access to port")||a.includes("embedded credentials")||a.includes("suspicious hostname")||a.includes("unsupported protocol")?"brand_center.scan_unsafe_url":a.includes(g)||a.includes("dns")||a.includes("enotfound")||a.includes("getaddrinfo")||a.includes("timeout")||a.includes("timed out")?"brand_center.scan_unreachable":"brand_center.scan_failed"}function P(e){return(0,r.TK)(e)}function M(e){return!(!e||!e.metadata||!o(e.url)||!N(e.url)||!o(e.metadata.source)||!o(e.metadata.scanDate)||Number.isNaN(new Date(e.metadata.scanDate).getTime()))}},57536:(e,t,a)=>{a.d(t,{v:()=>s});var r=a(12115),n=a(71802),o=a(18984);let i=[],s=(e,t)=>{let{t:a}=(0,o.Bd)(),s=(0,r.useMemo)(()=>({textToImage:a("imagePrompt.textToImage.toolName"),imageToImage:a("imagePrompt.imageToImage.toolName"),imagesToImage:a("imagePrompt.imagesToImage.toolName"),imageToVideo:a("imagePrompt.imageToVideo.toolName"),textToVideo:a("imagePrompt.textToVideo.toolName"),videoToVideo:a("imagePrompt.videoToVideo.toolName"),upscaleVideo:a("imagePrompt.upscaleVideo.toolName"),characterPerformance:a("imagePrompt.characterPerformance.toolName")}),[a]);return(0,n.GV)(a=>{if(!e){let e=t??a.aiContent.selectedAiModel?.type;return"image_to_video"===e||"text_to_video"===e||"video_to_video"===e||"upscale_video"===e||"character_performance"===e?a.aiContent.imageToVideoGeneratedVideos:"text_to_image"===e?a.aiContent.textToImageGeneratedImages:"image_to_image"===e?a.aiContent.imageToImageGeneratedImages:"images_to_image"===e?a.aiContent.imagesToImageGeneratedImages:"upscale_image"===e?a.aiContent.upscaleImageGeneratedImages:i}return e.toolName===s.textToImage?a.aiContent.textToImageGeneratedImages:e.toolName===s.imageToImage?a.aiContent.imageToImageGeneratedImages:e.toolName===s.imagesToImage?a.aiContent.imagesToImageGeneratedImages:e.toolName===s.imageToVideo||e.toolName===s.textToVideo||e.toolName===s.videoToVideo||e.toolName===s.upscaleVideo||e.toolName===s.characterPerformance?a.aiContent.imageToVideoGeneratedVideos:i})}},59346:(e,t,a)=>{a.d(t,{c:()=>g});var r=a(12115),n=a(18984),o=a(20063),i=a(71048),s=a(8293),l=a(71802),d=a(27783),c=a(96498),u=a(62621),m=a(278),p=a(58565),f=a(2345);function g({selectedUrl:e,allUrls:t,isVideo:a,onEdit:g}){let b=(0,s.j)(),x=(0,r.useRef)(b);x.current=b;let h=(0,l.jL)(),v=(0,o.useRouter)(),{t:y}=(0,n.Bd)(),w=(0,r.useRef)(!1),[_,j]=(0,r.useState)(!1),N=(0,l.GV)(e=>e.language.lang),k=(0,r.useCallback)(async()=>{if(!e||w.current)return;w.current=!0,j(!0);let t=a?"video":"image";i.Q3.trackImageDownload(x.current),(0,f.Sg)("requested",t);try{let a=await (0,m.Vr)(e,(0,m.tN)(e),t);(0,f.Sg)("ready",t,a??void 0)}catch{(0,f.Sg)("failed",t),h((0,p.c3)({title:y("error"),description:y("media_download_retry")}))}finally{w.current=!1,j(!1)}},[h,a,e,y]),T=(0,r.useCallback)(()=>{e&&h((0,c.qf)({media:t.length>0?[...t]:[e]}))},[t,h,e]);return{animate:(0,r.useCallback)(()=>
1{if(!e||a)return;h((0,u.aE)({imageToVideoFirstImage:e}));let t=d.default.getState().aiModels.videoModels.image_to_video?.[0];t&&h((0,u.MX)(t)),v.push(`/${N}/user/ai-video?animate=i2v`)},[N,h,a,v,e]),download:k,edit:(0,r.useCallback)(()=>{e&&g&&g(e)},[g,e]),post:T,isDownloading:_}}},65905:(e,t,a)=>{a.d(t,{b:()=>u,n:()=>m});var r=a(95155),n=a(12115),o=a(67909),i=a(71802);let s=()=>Promise.all([a.e(73038),a.e(58224),a.e(22195),a.e(55579),a.e(34020),a.e(8980),a.e(53257),a.e(31741),a.e(90085)]).then(a.bind(a,62564)),l=(0,o.default)(s,{ssr:!1}),d=(0,n.createContext)(!1);function c(){let e=(0,i.GV)(e=>!!(e.metaPostModal?.showModal||e.metaPostModal?.connectPromptPath)),[t,a]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{e&&a(!0)},[e]),(0,n.useEffect)(()=>{let e=window.setTimeout(()=>void s(),3e3);return()=>window.clearTimeout(e)},[]),t?(0,r.jsx)(l,{}):null}function u({children:e}){return(0,r.jsxs)(d.Provider,{value:!0,children:[e,(0,r.jsx)(c,{})]})}function m(){return(0,n.useContext)(d)?null:(0,r.jsx)(c,{})}},66143:(e,t,a)=>{a.d(t,{AG:()=>u,E4:()=>m,WG:()=>g,Wn:()=>c,ZM:()=>x,gf:()=>p,l6:()=>b,o0:()=>f});var r=a(64766),n=a(13809),o=a(44466),i=a(26286),s=a(53434);let l=new Map,d=(e,t)=>(0,s.P)((e=>{if("object"==typeof e&&null!==e&&"response"in e)return e.response?.data})(e))||t;function c(e){e?l.delete(e):l.clear()}let u=(0,i.zD)("brandBook/fetchBrandBooks",async(e,{rejectWithValue:t})=>{let a=l.get(e);if(a&&Date.now()-a.timestamp<3e5)return a.data;try{let t=await (0,n.z5)(),{brandBook:a}=(await r.default.get(`/users/businesses/${e}`,t)).data,o={brandBook:{logos:a?.logos??[],colors:a?.colors??[],fonts:a?.fonts??[],patterns:a?.patterns??[],voice:a?.voice,...a?.fontFamilies!==void 0?{fontFamilies:a.fontFamilies}:{}}};return l.set(e,{data:o,timestamp:Date.now()}),o}catch(e){return t(d(e,"Failed to fetch brand books"))}}),m=(0,i.zD)("brandBook/addNewBrandBook",async({businessId:e,type:t,name:a,value:o,file:i},{rejectWithValue:s})=>{try{let s=await (0,n.z5)(),l=new FormData;l.append("name",a),i&&l.append("file",i),"string"==typeof o&&"patterns"!==t&&l.append("value",o);let d=await r.default.post(`/users/businesses/${e}/brandbook/${t}`,"patterns"===t?{name:a,value:o}:l,{...s,headers:{...s.headers,"Content-Type":"multipart/form-data"}});return c(e),{file:d.data.file,type:t,name:d.data.name,value:o}}catch(e){return s(d(e,"Failed to add brand book"))}}),p=(0,i.zD)("brandBook/updateBrandBook",async({businessId:e,type:t,itemId:a,value:o,file:i},{rejectWithValue:s})=>{try{let s=await (0,n.z5)(),l=new FormData;return i&&l.append("file",i),o&&l.append("value",o),await r.default.put(`/users/businesses/${e}/brandbook/${t}/${a}`,l,{...s,headers:{...s.headers,"Content-Type":"multipart/form-data"}}),c(e),{type:t,_id:a,name:o,value:o,file:i}}catch(e){return s(d(e,"Failed to update brand book"))}}),f=(0,i.zD)("brandBook/deleteBrandBook",async({businessId:e,type:t,itemId:a},{rejectWithValue:o})=>{try{let o=await (0,n.z5)();return await r.default.delete(`/users/businesses/${e}/brandbook/${t}/${a}`,o),c(e),{_id:a,type:t}}catch(e){return o(d(e,"Failed to delete brand book"))}}),g=(0,i.zD)("brandBook/updateColors",async({businessId:e,colors:t},{rejectWithValue:a})=>{try{let a=await (0,n.z5)(),o=await r.default.post("/v2/brandbooks/colors",{businessId:e,colors:t},a);return c(e),o.data?.brandBook}catch(e){return a(d(e,"Failed to update colors"))}}),b=(0,i.zD)("brandBook/scanWebsite",async({websiteUrl:e},{rejectWithValue:t,signal:i})=>{try{let t=await (0,n.z5)();return(await r.default.get("/brand/scan",{...t,params:{url:e},signal:i,timeout:55e3})).data}catch(r){let e=(0,o.w5)(r);return e.reportUnexpected&&Promise.all([a.e(5449),a.e(29793),a.e(67902)]).then(a.bind(a,22123)).then(({captureException:e})=>{e((0,o.qJ)(r),{tags:{feature:"brand_website_scan",kind:"unexpected"}})}).catch(()=>{}),t(e.message)}}),x=(0,i.zD)("business/updatePalleteColors",async({businessId:e,value:t,paletteId:a},{rejectWithValue:o})=>{try{let o=await (0,n.z5)(),i={value:{background:t.background,header:t.header,text:t.text,uiElements:t.uiElements}},s=await r.default.put(`/users/businesses/${e}/brandbook/patterns/palettes/${a}`,i,o);return c(e),s.data.palette}catch(e){return o(d(e,"Failed to update palette colors"))}})},71007:(e,t,a)=>{a.d(t,{CJ:()=>u,Mm:()=>c,SV:()=>d,iT:()=>m,pZ:()=>l.p,wA:()=>p});var r=a(95155);a(12115);var n=a(35299),o=a(39867),i=a(64269),s=a(278),l=a(3407);function d({children:e,className:t}){return(0,r.jsxs)("div",{className:(0,i.cn)("relative w-full overflow-hidden rounded-[20px] border border-black/[0.08] bg-white dark:border-white/5 dark:bg-[#13151c]",t),children:[(0,r.jsxs)("div",{className:"pointer-events-none absolute inset-0 z-0","aria-hidden":!0,
1children:[(0,r.jsx)("div",{className:"absolute -top-[103px] -left-[245px] h-[278px] w-[489px] rounded-full bg-[#9848fe0d] blur-[85px]"}),(0,r.jsx)("div",{className:"absolute -bottom-[149px] -right-[199px] h-[278px] w-[489px] rounded-full bg-[#9848fe0d] blur-[85px]"})]}),e]})}function c({prefix:e,accent:t,subtitle:a}){return(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsxs)("h1",{className:"flex flex-wrap items-center gap-2 text-[24px] font-bold leading-[1.2] md:text-[36px] rtl:font-ibmPlexSans",children:[(0,r.jsx)("span",{className:"text-fg-primary",children:e}),(0,r.jsx)("span",{className:"bg-clip-text font-extrabold text-transparent",style:{backgroundImage:"linear-gradient(90deg, rgb(152,72,254) 0%, rgb(232,184,75) 100%)"},children:t})]}),(0,r.jsx)("p",{className:"text-xs text-fg-secondary md:text-[14px] md:leading-[20px] rtl:font-ibmPlexSans",children:a})]})}function u({loading:e,disabled:t,onClick:a,label:o,generatingLabel:i}){return e?(0,r.jsxs)("button",{disabled:!0,className:"flex h-[42px] w-full items-center justify-center gap-[10px] rounded-[8px] border border-white/[0.08] bg-[#15161e] px-3 py-2",children:[(0,r.jsx)(n.A,{size:16,className:"animate-spin text-white"}),(0,r.jsx)("span",{className:"text-[14px] font-semibold capitalize text-white",children:i})]}):(0,r.jsx)("button",{type:"button",onClick:a,disabled:t,className:"flex h-[42px] w-full items-center justify-center rounded-[8px] px-3 py-2 transition-opacity hover:opacity-90 disabled:opacity-50",style:{backgroundImage:"linear-gradient(109.877deg, rgb(126,24,255) 2.9%, rgb(105,20,214) 38.65%, rgb(75,15,153) 100%)"},children:(0,r.jsx)("span",{className:"text-[14px] font-semibold capitalize text-white",children:o})})}function m({sourceSrc:e,sourceType:t="image",generatingLabel:a}){return(0,r.jsxs)("div",{className:"relative h-full w-full overflow-hidden",children:["video"===t?(0,r.jsx)("video",{src:e,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,className:"h-full w-full scale-110 object-cover blur-[6px]"}):(0,r.jsx)("img",{src:e,alt:"",className:"h-full w-full scale-110 object-cover blur-[6px]"}),(0,r.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-2.5",children:[(0,r.jsx)("div",{className:"h-[3px] w-[56px] overflow-hidden rounded-full bg-white/50 shadow-sm",children:(0,r.jsx)("div",{className:"animate-app-loader-pingpong h-full w-[24px] rounded-full bg-brand-500",style:{boxShadow:"0 0 10px rgba(156, 71, 255, 0.65)"}})}),(0,r.jsxs)("p",{className:"text-[14px] font-medium capitalize text-white drop-shadow-md",children:[a,(0,r.jsxs)("span",{"aria-hidden":!0,children:[(0,r.jsx)("span",{className:"animate-app-loader-dot-1",children:"."}),(0,r.jsx)("span",{className:"animate-app-loader-dot-2",children:"."}),(0,r.jsx)("span",{className:"animate-app-loader-dot-3",children:"."})]})]})]})]})}function p({src:e,slug:t,label:a}){return(0,r.jsxs)("button",{type:"button",onClick:()=>(0,s.Vr)(e,(0,s.tN)(e,t)),className:"flex items-center gap-2 rounded-full border border-white/10 bg-black/55 px-3.5 py-1.5 text-[13px] font-medium text-white backdrop-blur-md transition-colors hover:bg-black/75",children:[(0,r.jsx)(o.A,{size:15}),a]})}},77614:(e,t,a)=>{function r(e){return(e||"").toLowerCase().replace(/[^a-z0-9]+/g," ").trim().split(" ").filter(e=>e&&"0"!==e)}function n(e,t){let a=r(t);if(0===a.length)return null;let n=Math.max(1,a.length-1),o=null,i=-1;for(let[t,s]of Object.entries(e))for(let e of s){let s=[r(e.name),r(e.api),r(e.id)].map(e=>e.join(" ")).join(" "),l=a.filter(e=>s.includes(e)).length;l>i&&l>=n&&(i=l,o={model:e,type:t})}return o}function o(e,t){let a=e[0],r=1/0;for(let n of e){let[e,o]=n.split(":").map(Number);if(!e||!o)continue;let i=Math.abs(e/o-t);i<r&&(r=i,a=n)}return a}a.d(t,{P:()=>n,m:()=>o})},86062:(e,t,a)=>{a.r(t),a.d(t,{default:()=>D});var r=a(95155);a(27603),a(30710);var n=a(67909),o=a(12115),i=a(15239),s=a(18984),l=a(65905),d=a(59346),c=a(55702),u=a(39867),m=a(18514),p=a(89559),f=a(17181),g=a(7596),b=a(3407);let x=o.memo(function({images:e=[],currentCardName:t,onEdit:a,canEdit:n=!0,onRecreate:x,fitContainer:h=!1,transparentBackgroun
1d:v=!1,mediaKind:y}){let[w,_]=(0,o.useState)(e[0]||null),[j,N]=(0,o.useState)(!1),{t:k}=(0,s.Bd)(),[T,C]=(0,o.useState)(!0),I=(0,o.useCallback)(({src:e})=>`${e}`,[]);(0,o.useEffect)(()=>{e.length>0&&e[0]!==w&&_(e[0])},[e]);let V=(0,o.useRef)(null),[P,M]=(0,o.useState)(!1),[S,A]=(0,o.useState)(0),[E,$]=(0,o.useState)(0),R=(0,o.useMemo)(()=>t===k("imagePrompt.imageToVideo.toolName")||t===k("imagePrompt.textToVideo.toolName")||t===k("imagePrompt.videoToVideo.toolName")||t===k("imagePrompt.upscaleVideo.toolName")||t===k("imagePrompt.characterPerformance.toolName"),[t,k]),L=(0,o.useMemo)(()=>y?"video"===y:R||e.some(e=>"video"===(0,c.Ff)(e)),[R,e,y]);(0,o.useEffect)(()=>{if(!w)return void C(!1);if(C(!0),L)return;let e=new window.Image;if(e.src=w,e.complete&&e.naturalWidth>0)return void C(!1);let t=()=>C(!1);return e.onload=t,e.onerror=t,()=>{e.onload=null,e.onerror=null}},[L,w]);let B=(0,o.useCallback)(e=>{V.current&&(M(!0),A(e.clientX),$(V.current.scrollLeft))},[]),D=(0,o.useCallback)(e=>{if(!P||!V.current)return;e.preventDefault();let t=e.clientX-S;requestAnimationFrame(()=>{V.current&&(V.current.scrollLeft=E-t)})},[P,S,E]),F=(0,o.useCallback)(()=>{M(!1)},[]),z=(0,o.useCallback)(()=>{M(!1)},[]),G=(0,o.useCallback)(e=>{V.current&&(M(!0),A(e.touches[0].clientX),$(V.current.scrollLeft))},[]),O=(0,o.useCallback)(e=>{if(!P||!V.current)return;let t=e.touches[0].clientX-S;requestAnimationFrame(()=>{V.current&&(V.current.scrollLeft=E-t)})},[P,S,E]),U=(0,o.useCallback)(e=>{w!==e&&(N(!0),setTimeout(()=>{_(e),N(!1)},200))},[w]),{animate:q,download:W,edit:J,post:X}=(0,d.c)({selectedUrl:w,allUrls:e,isVideo:L,onEdit:a}),Q=!w,H="flex flex-row gap-1.5 items-center justify-center min-h-[44px] min-w-[44px] px-3 py-2 sm:justify-start sm:min-h-0 sm:min-w-0 rounded-lg transition-all duration-200 text-fg-body dark:text-fg-secondary hover:text-brand-500 dark:hover:text-brand-500 hover:bg-[#9C47FF0D] disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-fg-body dark:disabled:hover:text-fg-secondary",K=h?"max-h-full":"max-h-[80vh]";return(0,r.jsxs)("div",{className:`group flex h-full w-full flex-col${h?" min-h-0":""}`,children:[(0,r.jsxs)("div",{className:`flex flex-col flex-1 justify-center items-center w-full h-full rounded-lg transition-opacity duration-100${h?" min-h-0":""}`,children:[w&&(0,r.jsx)("div",{className:`h-full w-full flex justify-center items-center bg-transparent${h?" min-h-0":""}`,children:(0,r.jsxs)("div",{className:`flex w-full h-full justify-center p-4 lg:flex-row flex-col-reverse${h?" min-h-0 flex-1 items-stretch":" items-center"}`,children:[e.length>1&&(0,r.jsx)("div",{className:`flex justify-between items-center space-y-2 lg:h-[calc(100%-100px)] max-lg:w-[calc(100%-10px)] max-lg:h-fit lg:px-2 py-4${h?" lg:min-h-0 lg:max-h-full":""}`,children:(0,r.jsx)("div",{className:"relative flex w-full lg:max-h-[calc(100%-50px)] max-lg:max-w-[calc(100%-10px)]",children:(0,r.jsx)("div",{ref:V,className:`flex lg:flex-col space-y-2 overflow-y-auto lg:px-2 max-lg:py-3 scrollbar cursor-grab
2                      ${P?"cursor-grabbing select-none":""}`,onMouseDown:B,onMouseMove:D,onMouseUp:F,onMouseLeave:z,onTouchStart:G,onTouchMove:O,onTouchEnd:F,children:e.map((e,t)=>(0,r.jsxs)("button",{type:"button","aria-label":(y?"video"===y:R||"video"===(0,c.Ff)(e))?k("preview_video_number",{count:t+1}):k("preview_image_number",{count:t+1}),onClick:()=>!P&&U(e),className:`flex-shrink-0 border-[3px] max-lg:mx-1 shadow-lg transition-opacity duration-200 relative
3                            overflow-hidden hover:opacity-100
4                            ${w===e?"border-brand-500 opacity-100":"border-transparent"}
5                            rounded-lg`,children:[v&&(0,r.jsx)(b.E,{className:"rounded-lg"}),(y?"video"===y:R||"video"===(0,c.Ff)(e))?(0,r.jsx)("video",{src:e,muted:!0,preload:"metadata","aria-hidden":"true",className:"w-28 h-28 object-cover pointer-events-none"}):(0,r.jsx)("div",{className:"relative",children:(0,r.jsx)(i.default,{src:e,loader:I,alt:`Thumbnail ${t+1}`,width:96,height:96,loading:"lazy",className:`relative w-28 h-28 ${v?"object-contain":"object-cover"}`,draggable:!1})}),(0,r.jsx)("div",{style:{display:w===e?"none":"block"},className:"bg-black w-28 h-28 absolute z-50 opacity-40 top-0 left-0"})]},t))})})}),(0,r.jsxs)("div",{className:`${h?"min-h-0 flex-1 flex items-center justify-center":"h-fit min-h-[200px] flex items-center justify-center"}
6                  ${L?"rounded-[10px]":"rounded-2xl"}
7                  border-[3px] overflow-hidden relative
8                  ${v&&!L?"border-stroke-default dark:border-stroke-subtle":"dark:border-surface-base border-white"}`,children:[v&&!L&&(0,r.jsx)(b.E,{className:"rounded-2xl"}),T&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:(0,r.jsx)("div",{className:"w-8 h-8 border-3 border-brand-500 border-t-transparent roun
8ded-full animate-spin"})}),!L&&(0,r.jsx)("div",{className:"relative",children:(0,r.jsx)(i.default,{id:w,loader:I,src:w,alt:"AI",width:100,height:100,sizes:"fill",loading:"lazy",className:`relative object-contain ${K} w-fit transition-opacity duration-300 ${T?"opacity-0":"opacity-100"}`,onLoad:()=>C(!1),onLoadingComplete:()=>C(!1)})}),L&&(0,r.jsx)("video",{src:w,width:100,height:100,controls:!0,"aria-label":k("video_preview_dialog"),playsInline:!0,loop:!0,preload:"metadata",className:`object-contain ${K} w-fit transition-opacity duration-300 ${T?"opacity-0":"opacity-100"}`,onLoadedData:()=>C(!1),onError:()=>C(!1)})]})]})}),(0,r.jsx)(l.n,{})]}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center justify-center gap-1 sm:gap-2 px-2 py-2",children:[(0,r.jsxs)("button",{onClick:W,disabled:Q,className:H,title:k("download"),children:[(0,r.jsx)(u.A,{className:"w-4 h-4 shrink-0"}),(0,r.jsx)("span",{className:"hidden sm:inline text-xs sm:text-sm",children:k("download")})]}),!L&&a&&(0,r.jsxs)("button",{onClick:J,disabled:Q||!n,className:H,title:n?k("edit")||"Edit":k("select_supporting_model")||"Select a model that supports image input",children:[(0,r.jsx)(m.A,{className:"w-4 h-4 shrink-0"}),(0,r.jsx)("span",{className:"hidden sm:inline text-xs sm:text-sm",children:k("edit")||"Edit"})]}),x&&(0,r.jsxs)("button",{onClick:x,disabled:Q,className:H,title:k("recreate")||"Recreate",children:[(0,r.jsx)(p.A,{className:"w-4 h-4 shrink-0"}),(0,r.jsx)("span",{className:"hidden sm:inline text-xs sm:text-sm",children:k("recreate")||"Recreate"})]}),(0,r.jsxs)("button",{onClick:X,disabled:Q,className:H,title:k("post"),children:[(0,r.jsx)(f.A,{className:"w-4 h-4 shrink-0"}),(0,r.jsx)("span",{className:"hidden sm:inline text-xs sm:text-sm",children:k("post")})]}),!L&&(0,r.jsxs)("button",{onClick:q,disabled:Q,className:H,title:k("animate")||"Animate",children:[(0,r.jsx)(g.A,{className:"w-4 h-4 shrink-0"}),(0,r.jsx)("span",{className:"hidden sm:inline text-xs sm:text-sm",children:k("animate")||"Animate"})]})]})]})});x.displayName="ImageGallery";var h=a(64269),v=a(69687),y=a(71007),w=a(8293),_=a(10901),j=a(71802),N=a(62621),k=a(71022),T=a(57536),C=a(45933),I=a(34768),V=a(57116),P=a(77614),M=a(33482);let S=new Set(["audio_file","timed_segments"]),A={id:"sync_3",api:"sync:3@0",name:"sync-3",image:"/images/aicontent/aimodels/sync_3.webp",description:"lip sync",acceptAspectRatio:!1,type:"video_to_video",types:["video_to_video"],lipSync:!0,features:["lip_sync"],maxPromptLength:5e3,minimumPrice:105,inputVideoDurationRange:{min:1,max:300},videoCredits:{audio:{standard:{1:105},high:{1:105}},noAudio:{standard:{1:105},high:{1:105}}},videoOperations:{schemaVersion:1,operations:[{id:"lip_sync",durationMode:"source_inherited",geometryMode:"source_inherited",controls:[],inputProfiles:[{id:"audio_file",constraints:{prompt:"unused",slots:[{id:"source_video",media:"video",min:1,max:1},{id:"speech_audio",media:"audio",min:1,max:1}]},transport:{strategy:"fixed",legacyType:"video_to_video"}},{id:"timed_segments",constraints:{prompt:"unused",slots:[{id:"source_video",media:"video",min:1,max:1},{id:"timed_segments",media:"segments",min:1}]},transport:{strategy:"fixed",legacyType:"video_to_video"}}]}]}},E="lapsing",$=(0,n.default)(()=>Promise.all([a.e(74716),a.e(28312),a.e(8440)]).then(a.bind(a,28312)),{loadableGenerated:{webpack:()=>[28312]},ssr:!1}),R=(0,n.default)(()=>Promise.all([a.e(47971),a.e(92650),a.e(37518),a.e(87254),a.e(39003)]).then(a.bind(a,87254)),{loadableGenerated:{webpack:()=>[87254]},ssr:!1});function L({media:e,alt:t}){return"video"===e.type?(0,r.jsx)("video",{src:e.src,poster:e.posterImage,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,className:"h-full w-full object-cover"}):(0,r.jsx)("img",{src:e.src,alt:t,className:"h-full w-full object-cover"})}let B=()=>void 0;function D(){let e=function(){let{t:e}=(0,s.Bd)(),t=`apps.${E.replace(/-/g,"_")}`,a=(0,j.jL)(),r=(0,o.useRef)(null),n=(0,o.useRef)(null),i=(0,V._u)(E)?.integrated,{UpgradePlan:l,setShowUpgradePlan:d}=(0,C.M)(),{error:c,setError:u,seed:m,setSeed:p,handleCancelImageGeneration:f,handleGenerateImageToVideo:g,handleGenerateTextToVideo:b,handleGenerateVideoToVideo:x,handleGenerateUpscaleVideo:h,handleGenerateCharacterPerformance:v,setImg2imgSource:y}=(0,k.d)({setShowUpgradePlan:d}),$=(0,T.v)(null,"video_to_video"),R=(0,j.GV)(e=>e.aiContent),L=(0,j.GV)(e=>e.business.selectedBusiness?._id??null),{loadingVideoToVideo:B,selectedImages:D}=R,F=R.selectedVideoOperationId,z=R.selectedVideoInputProfileId,G=(0,o.useRef)((0,N.JI)(R)),O=(0,o.useRef)(L),U=(0,o.useRef)(L);U.current=L;let{isAuthenticated:q}=(0,w.j)(),{openLogin:W}=(0,_.G)(),J=(0,j.GV)(e=>e.language.lang)||"en",{videoToVideo:X,loading:Q,error:H,refetch:K}=(0,I.xO)(),Y=(0,o.useRef)(K);Y.current=K;let Z=(0,o.useRef)(q),[ee,et]=(0,o.useState)(!1),[ea,er]=(0,o.useState)(!0),en=(0,o.useMemo)(()=>i?(0,P.P)({video_to_video:X},i.model):null,[i,X]),eo=(0,o.useRef)(!1);(Q||H||X.length>0)&&(eo.current=!0);let ei=eo.current,es=en?.model?en.model:!Q&&H?A:null,el=(0,o.useMemo)(()=>(function(e,t){if(!e)return null;if(!(0,M.kY)(e))return{};let a=S.has(t)?t:void 0,r=(0,M.Yx)({model:e,operationId:"lip_sync",profileId:a}),n=(0,M.TU)(e,r);return r&&n?{semanticIntent:r,semanticOperation:n.operation,semanticProfile:n.profile}:null})(es,"lip_sync"===F?z:null),[es,z,F]),ed=null===el?null:es;(0,o.useEffect)(()=>{let e=!Z.current&&q;Z.current=q,e&&H&&Y.current()},[q,H]),(0,o.useEffect)(()=>{a((0,N.FC)("")),a((0,N.kK)("")),a((0,N.cQ)("")),a((0,N.JX)("")),a((0,N.aE)({videoToVideo:null,videoToVideoReferenceImages:[],videoToVideoReferenceVideos:[],videoToVideoReferenceVideoPick:null,videoToVideoAudio:null,videoReferenceAudios:[],videoReferenceMediaOrder:[],videoToVideoImageUrl1:null,videoToVideoImageUrl2:null}));let e=G.current,t=O.current;return()=>{U.current===t&&a((0,N.JA)(e))}},[a]),(0,o.useEffect)(()=>{B?(er(!1),et(!1)):et(!0)},[B]);let ec=$.map(e=>e.url),eu=ec.length>0,em=D.videoToVideo||i?.exampleMedia.src||"",ep=D.videoToVideo||i?.exampleMedia.type==="video"?"video":"image";return{t:e,tk:t,config:i,model:ed,semanticIntent:el?.semanticIntent,semanticOperation:el?.semanticOperation,semanticProfile:el?.semanticProfile,modelsLoading:Q,catalogReady:ei,ready:!Q&&!!ed,error:c,setError:u,seed:m,setSeed:p,generatedImages:$,imageUrls:ec,hasResult:eu,isLoading:B,loaderSourceSrc:em,loader
8SourceType:ep,imageReady:ee,finishLoading:ea,setFinishLoading:er,scrollableDivRef:r,UpgradePlan:l,handleCancelImageGeneration:f,handleGenerateImageToVideo:g,handleGenerateTextToVideo:b,handleGenerateVideoToVideo:x,handleGenerateUpscaleVideo:h,handleGenerateCharacterPerformance:v,setImg2imgSource:y,registerSubmit:function(e){n.current=e},handleGenerate:function(){if(!q)return void W(`/${J}/apps/${E}`);n.current?.()}}}(),{t}=(0,s.Bd)(),a=`apps.${"lapsing".replace(/-/g,"_")}`;return e.config?!e.catalogReady||e.modelsLoading?(0,r.jsx)(v.A,{}):e.model?(0,r.jsxs)(y.SV,{children:[(0,r.jsx)(e.UpgradePlan,{}),(0,r.jsx)($,{}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-6 p-8 lg:grid-cols-2 lg:gap-16",children:[(0,r.jsxs)("div",{className:"flex w-full max-w-full flex-col gap-4 lg:max-w-[457px]",children:[(0,r.jsx)(y.Mm,{prefix:e.t(`${e.tk}.title_prefix`),accent:e.t(`${e.tk}.title_accent`),subtitle:e.t(`${e.tk}.subtitle`)}),(0,r.jsx)(R,{error:e.error,setError:e.setError,handleGenerateVideoToVideo:e.handleGenerateVideoToVideo,onRegisterSubmit:e.registerSubmit,audioPreference:"auto",onAudioPreferenceChange:B,selectedAiModelOverride:e.model,semanticIntent:e.semanticIntent,semanticOperation:e.semanticOperation,semanticProfile:e.semanticProfile}),e.error?(0,r.jsx)("p",{className:"text-sm font-medium text-danger",children:e.error}):null,(0,r.jsx)(y.CJ,{loading:e.isLoading,disabled:e.isLoading,onClick:e.handleGenerate,label:e.t(`${e.tk}.generate_cta`),generatingLabel:e.t(`${e.tk}.generating`)})]}),(0,r.jsx)("div",{className:(0,h.cn)("mx-auto w-full max-w-full overflow-hidden rounded-[12px] bg-surface-raised dark:bg-transparent lg:max-w-[460px]","aspect-[3/4]"),children:e.isLoading?(0,r.jsx)(y.iT,{sourceSrc:e.loaderSourceSrc,sourceType:"video",generatingLabel:t(`${a}.generating`)}):e.hasResult?(0,r.jsx)("div",{className:"flex h-full w-full items-start justify-start",children:(0,r.jsx)(x,{currentCardName:e.t("imagePrompt.videoToVideo.toolName"),images:e.imageUrls,fitContainer:!0})}):(0,r.jsx)(L,{media:e.config.exampleMedia,alt:e.t(`${e.tk}.example_label`)})})]})]}):(0,r.jsx)(y.SV,{children:(0,r.jsxs)("div",{className:"p-8",children:[(0,r.jsx)(y.Mm,{prefix:e.t(`${e.tk}.title_prefix`),accent:e.t(`${e.tk}.title_accent`),subtitle:e.t(`${e.tk}.subtitle`)}),(0,r.jsx)("p",{role:"alert",className:"mt-6 text-sm font-medium text-danger",children:e.t(`${e.tk}.model_unavailable`)})]})}):null}},93858:(e,t,a)=>{a.d(t,{A:()=>n});var r=a(95155);function n({size:e=16,strokeWidth:t=1.33333,...a}){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a,children:(0,r.jsx)("path",{d:"M1.33325 1.33337L6.66658 6.66671M14.6666 1.33337L9.33325 6.66671M14.6666 6.00004C14.6666 7.84099 11.6818 9.33337 7.99992 9.33337M14.6666 6.00004C14.6666 4.15909 11.6818 2.66671 7.99992 2.66671C4.31802 2.66671 1.33325 4.15909 1.33325 6.00004M14.6666 6.00004V11.3334C14.6666 12.2174 13.9642 13.0653 12.714 13.6904C11.4637 14.3155 9.76803 14.6667 7.99992 14.6667M7.99992 9.33337C4.31802 9.33337 1.33325 7.84099 1.33325 6.00004M7.99992 9.33337V14.6667M1.33325 6.00004V11.3334C1.33325 12.2174 2.03563 13.0653 3.28587 13.6904C4.53612 14.3155 6.23181 14.6667 7.99992 14.6667M4.66659 8.93337V14.2M11.3333 8.93337V14.2"})})}}}]);

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.