https://assets.nomi.ai/_next/static/chunks/pages/nomis/[nomiId]/me…/create-video-350040f137c34e3d.js
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]="c66b9984-b065-4874-a249-4c7d6b71a941",e._sentryDebugIdIdentifier="sentry-dbid-c66b9984-b065-4874-a249-4c7d6b71a941")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7421],{3844:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(20648).A)("outline","photo","Photo",[["path",{d:"M15 8h.01",key:"svg-0"}],["path",{d:"M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12",key:"svg-1"}],["path",{d:"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5",key:"svg-2"}],["path",{d:"M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3",key:"svg-3"}]])},13658:(e,t,r)=>{"use strict";r.d(t,{$:()=>s});var n=r(86695),i=r(95515),a=r(61632),o=r(26514);let s=(0,i.P9)(e=>{let{w:t,h:r,miw:i,mih:s,...l}=(0,n.Y)("Space",null,e);return(0,o.jsx)(a.a,{...l,w:t,miw:i??t,h:r,mih:s??r})});s.displayName="@mantine/core/Space"},16871:(e,t,r)=>{"use strict";r.d(t,{v:()=>a});var n=r(46225),i=r(75834);function a(e){var t=(0,n.useRouter)();return(0,i.useCallback)(function(){if(window.history.length>1)return void t.back();t.replace(e)},[e,t])}},22035:(e,t,r)=>{"use strict";r.d(t,{C:()=>v});var n=r(34850),i=r(57715),a=r(11107),o=r(79303),s=r(35527),l=r(21923),d=r(86695),u=r(31372),c=r(95515),h=r(61632),m={root:"m_e5262200",indicator:"m_760d1fb1",processing:"m_885901b1"},p=r(26514);let g={position:"top-end",offset:0,showZero:!0},f=(0,a.V)((e,{color:t,position:r,offset:a,size:d,radius:u,zIndex:c,autoContrast:h})=>({root:{"--indicator-color":t?(0,o.r)(t,e):void 0,"--indicator-text-color":(0,l.v)(h,e)?(0,s.w5)({color:t,theme:e,autoContrast:h}):void 0,"--indicator-size":(0,n.D)(d),"--indicator-radius":void 0===u?void 0:(0,i.nJ)(u),"--indicator-z-index":c?.toString(),...function(e="top-end",t=0){let r={"--indicator-top":void 0,"--indicator-bottom":void 0,"--indicator-left":void 0,"--indicator-right":void 0,"--indicator-translate-x":void 0,"--indicator-translate-y":void 0},i="number"==typeof t?t:t.x,a="number"==typeof t?t:t.y,o=(0,n.D)(i),s=(0,n.D)(a),[l,d]=e.split("-");return"top"===l&&(r["--indicator-top"]=s,r["--indicator-translate-y"]="-50%"),"middle"===l&&(r["--indicator-top"]="50%",r["--indicator-translate-y"]="-50%"),"bottom"===l&&(r["--indicator-bottom"]=s,r["--indicator-translate-y"]="50%"),"start"===d&&(r["--indicator-left"]=o,r["--indicator-translate-x"]="-50%"),"center"===d&&(r["--indicator-left"]="50%",r["--indicator-translate-x"]="-50%"),"end"===d&&(r["--indicator-right"]=o,r["--indicator-translate-x"]="50%"),r}(r,a)}})),v=(0,c.P9)(e=>{let t=(0,d.Y)("Indicator",g,e),{classNames:r,className:n,style:i,styles:a,unstyled:o,vars:s,children:l,position:c,offset:v,inline:y,label:b,radius:w,color:Y,withBorder:k,disabled:E,processing:P,zIndex:I,autoContrast:x,maxValue:D,showZero:C,mod:F,attributes:_,...A}=t,S=(0,u.I)({name:"Indicator",classes:m,props:t,className:n,style:i,classNames:r,styles:a,unstyled:o,attributes:_,vars:s,varsResolver:f}),T=!C&&(0===b||"0"===b),q=void 0!==D&&"number"==typeof b&&b>D?`${D}+`:b;return(0,p.jsxs)(h.a,{...S("root"),mod:[{inline:y},F],...A,children:[!E&&!T&&(0,p.jsx)(h.a,{mod:{"with-label":!!b,"with-border":k,processing:P},...S("indicator"),children:q}),l]})});v.classes=m,v.varsResolver=f,v.displayName="@mantine/core/Indicator"},22338:(e,t,r)=>{"use strict";r.d(t,{A:()=>g});var n=r(26811),i=r(5567),a=r(38117),o=r(17384),s=r(24322),l=r.n(s),d=r(96456),u=r.n(d),c=r(53690),h=r(74913),m=r.n(h),p=r(16871);let g=function(e){var t=e.header,r=e.children,s=e.title,d=e.chatName,h=e.backHref,g=e.backBehavior,f=e.nomi,v=e.user,y=e.audioElementRef,b=e.footer,w=e.bodyElemRef,Y=(0,p.v)(h);return(0,n.FD)("div",{className:m().root,children:[(0,n.Y)(l(),{children:(0,n.Y)("title",{children:"".concat(s," | ").concat(d," | Nomi.ai")})}),(0,n.FD)("header",{className:m().header,children:["history"===(void 0===g?"link":g)?(0,n.Y)(i.M,{color:"bright",variant:"transparent","aria-label":"Go back",onClick:Y,children:(0,n.Y)(o.A,{size:24})}):(0,n.Y)(i.M,{color:"bright",variant:"transparent",component:u(),"aria-label":"Go back",href:h,children:(0,n.Y)(o.A,{size:24})}),t,f&&v&&y&&(0,n.Y)(a.s,{align:"center",display:{base:"block",md:"none"},children:(0,n.Y)(c.A,{nomi:f,user:v,audioElementRef:y})})]}),(0,n.Y)("main",{ref:w,className:m().body,children:r}),b&&(0,n.Y)("footer",{className:m().footer,children:b})]})}},24204:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(20648).A)("outline","phone-call","PhoneCall",[["path",{d:"M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5l1.5 -2.5l5 2v4a2 2 0 0 1 -2 2a16 16 0 0 1 -15 -15a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M15 7a2 2 0 0 1 2 2",key:"svg-1"}],["path",{d:"M15 3a6 6 0 0 1 6 6",key:"svg-2"}]])},25407:(e,t,r)=>{"use strict";r.d(t,{S:()=>o});var n=r(17862),i=r(75834),a=r(84526);function o(e){var t=(0,n._)((0,i.useState)(e?{status:"loading"}:{status:"idle"}),2),r=t[0],o=t[1];return(0,i.useEffect)(function(){if(!e)return void o({status:"idle"});var t=!1,r=function(){t||o({status:"loaded",src:e})};if(o({status:"loading"}),(0,a.un)())return void r();if("mp4"===e.slice(-3)){var n=document.createElement("video");return n.oncanplaythrough=function(){r()},n.onerror=function(){t||o({status:"error",error:Error("Failed to load video media: ".concat(e))})},n.src=e,function(){t=!0,n.oncanplaythrough=null,n.onerror=null,n.src=""}}var i=new Image;return i.onload=function(){r()},i.onerror=function(){t||o({status:"error",error:Error("Failed to load image media: ".concat(e))})},i.src=e,function(){t=!0,i.onload=null,i.onerror=null,i.src=""}},[e]),r}},36888:(e,t,r)=>{"use strict";function n(e,t){return t?"".concat(e,' Blocked term: "').concat(t,'".'):e}r.d(t,{M:()=>n})},41148:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>em});var n=r(26811),i=r(76547),a=r(11488),o=r(38117),s=r(86861),l=r(23575),d=r(33989),u=r(5499),c=r(96456),h=r.n(c),m=r(46225),p=r(39128),g=r(98398),f=r(24742),v=r(99742),y=r(22338),b=r(36185),w=r(40869),Y=r(2530),k=r(99059),E=r(17862),P=r(70324),I=r(61632),x=r(46878),D=r(85361),C=r(35362),F=r(76301),_=r(96953),A=r(85398),S=r(14063),T=r(75834),q=r(96675),M=r(54585),V=r(70645),B=r(36888),j=r(35269),R=r(76315),z=r(25407),N=r(20787),U=r(45531),K=r(79470),H=r(6917),Q=r(92036),L=[{title:"High-five",prompt:"The woman leaps upward with a burst of joy, her arms extending naturally as she rises, then she brings one hand down in a swift, energetic high-five toward the camera, her face bright with a wide, genuine smile and eyes crinkling. The motion is quick and lively, matching the celebratory mood. The camera remains still, capturing the full, upbeat movement in real time."},{title:"Basketball",prompt:"The man smirks, his eyes crinkling as he takes off his jacket and lets it drop. Then he bends to pick up the basketball and starts dribbling it quickly and smoothly. The camera holds still, capturing the continuous action in real time."},{title:"Race car",prompt:"The race car speeds down the bridge, surging forward as the engine revs up, then maintains a fast, steady speed before surg
1ing again. The camera tracks the carâs movement at first, keeping pace then letting it speed past, the shot holding steady as the car speeds past the frame."},{title:"Boardwalk",prompt:"The woman jumps onto the man's back, and he catches her legs to support her. He then carries her happily down the boardwalk, his steps brisk and steady as she holds on. A slow tracking shot follows them from the side as they move forward together."},{title:"Flame",prompt:"The man cups his hands together, and flames ignite in his palms, then he shapes the fire into a dragon that coils briefly before morphing into a sword of pure flame. He grips the fiery blade and begins deliberate, flowing sword practice, moving through controlled arcs and thrusts until he settles into a poised stance, the fire sword still blazing."}];let W=function(e){var t=e.setPrompt,r=e.promptElem,a=(0,E._)((0,T.useState)(null),2),o=a[0],d=a[1];return(0,n.FD)(N.B,{gap:"xs",children:[(0,n.Y)(i.h,{order:4,children:"Instructions"}),(0,n.FD)(s.E,{children:[(0,n.Y)("b",{children:"Not sure where to start?"})," Describe the subjectâs main action(s) and vibe, optionally adding camera movement or speed. Then use the wand to expand your ideas into a video prompt."]}),(0,n.FD)(s.E,{children:["When writing your own prompts, use clear, natural-language instructions following this flow: ",(0,n.Y)("br",{}),(0,n.Y)("b",{children:"Subject(s) â action sequence â ending state â emotion/mood â camera movement"})]}),(0,n.Y)(s.E,{children:"See best practices for more detailed instructions."}),(0,n.FD)(U.Y,{grow:!0,wrap:"nowrap",gap:"sm",children:[(0,n.Y)(l.$,{size:"xs",variant:"bestPractices"===o?"filled":"outline",color:"bestPractices"===o?"purple":void 0,"aria-expanded":"bestPractices"===o,onClick:function(){return d(function(e){return"bestPractices"===e?null:"bestPractices"})},children:"bestPractices"===o?"Close Best Practices":"See Best Practices"}),(0,n.Y)(l.$,{size:"xs",variant:"examples"===o?"filled":"outline",color:"examples"===o?"purple":void 0,"aria-expanded":"examples"===o,onClick:function(){return d(function(e){return"examples"===e?null:"examples"})},children:"examples"===o?"Close Prompt Examples":"See Prompt Examples"})]}),(0,n.Y)(K.S,{expanded:"bestPractices"===o,children:(0,n.FD)(N.B,{gap:"xs",children:[(0,n.Y)(i.h,{order:5,children:"Best Practices"}),(0,n.Y)(s.E,{children:"For best results, your prompt should include the following components:"}),(0,n.FD)(s.E,{children:[(0,n.Y)("strong",{children:"Action and motion"})," - Describe who or what moves and how the action starts, develops, and ends. Include the speed when helpful: slow, brisk, energetic, rapid, or real-time."]}),(0,n.FD)(s.E,{children:[(0,n.Y)("strong",{children:"Emotion and atmosphere"})," - Describe visible cues such as a warm smile, tense gaze, or playful energy to convey the mood."]}),(0,n.FD)(s.E,{children:[(0,n.Y)("strong",{children:"Camera movement"})," - Describe whether the camera stays still, pushes in, pulls out, tracks, pans, tilts, or arcs around the subject."]}),(0,n.Y)(s.E,{fw:700,children:"Tips"}),(0,n.FD)(H.B,{spacing:"xs",size:"sm",children:[(0,n.FD)(H.B.Item,{children:[(0,n.Y)("strong",{children:"Start from the reference image"})," - The reference image is your videoâs first frame. Describe actions that begin from that view and move forward cohesively."]}),(0,n.FD)(H.B.Item,{children:[(0,n.Y)("strong",{children:"Use positive instructions"})," - Describe what you want to see instead of saying âno talking,â âdonât move,â or âno camera shake.â"]}
1),(0,n.FD)(H.B.Item,{children:[(0,n.Y)("strong",{children:"Match the action to the video length"})," - Include enough movement to fill the video naturally. Too many actions, camera moves, or redundant details can reduce quality and fidelity; too little movement may result in slow motion."]})]})]})}),(0,n.Y)(K.S,{expanded:"examples"===o,children:(0,n.FD)(N.B,{gap:"sm",children:[(0,n.Y)(i.h,{order:5,children:"Prompt Examples"}),L.map(function(e){return(0,n.FD)(N.B,{gap:"xs",children:[(0,n.FD)(U.Y,{gap:"sm",children:[(0,n.Y)(s.E,{fw:700,children:e.title}),(0,n.Y)(Q.A,{setPrompt:t,promptElem:r,newPrompt:e.prompt})]}),(0,n.Y)(s.E,{size:"sm",c:"dimmed",children:e.prompt})]},e.title)})]})})]})};var $=r(50930),O=r(95338),G=r(5567),Z=r(50600),J=r(95148),X=r(83847),ee=r(77406),et=r(92978),er=r(81638),en=r(94049);function ei(e){var t,r,a,o,u,c,h,m,p,g,f=e.nomiId,v=e.sourceMediaItemUuid,y=e.prompt,b=e.onChange,w=e.maxPromptLength,P=e.error,I=e.disabled,x=e.onBusyChange,C=e.inputRef,F=(0,T.useRef)(null),_=(0,Z.pc)(F,C),M=(0,d.I)({queryKey:["dailyUsage"],queryFn:function(){return X.Ay.fetchDailyUsageCounts()}}),V=(r=(t=(0,E._)((0,T.useState)({status:"idle",error:""}),2))[0],a=t[1],o=(0,A.jE)(),u=(0,S.n)({mutationFn:ee.Ay.expand}).mutate,c=(0,T.useRef)(null),h=(0,T.useCallback)(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Discarded";"preview"===r.status&&c.current===r.jobId&&en.A.videoPromptEnhancementDecision(e,r.jobId,r.nomiId,r.prompt.length,r.expandedPrompt.length),c.current=null,a({status:"idle",error:""})},[r]),(0,T.useEffect)(function(){return c.current=null,a({status:"idle",error:""}),function(){c.current=null}},[f,v]),(0,T.useEffect)(function(){"idle"===r.status?c.current=null:r.prompt!==y.trim()&&h()},[r,y,h]),m="loading"===r.status?r.jobId:null,(0,T.useEffect)(function(){if(null!==m){var e=window.setTimeout(function(){c.current===m&&(a(function(e){return"loading"===e.status&&e.jobId===m?{status:"idle",error:"Your enhancement timed out. Please try again."}:e}),o.invalidateQueries({queryKey:["dailyUsage"]}))},12e4);return function(){return window.clearTimeout(e)}}},[m,o]),(0,er._P)((0,T.useCallback)(function(e){("VideoPromptEnhancementCompleted"===e.type||"VideoPromptEnhancementFailed"===e.type)&&e.payload.jobId===c.current&&(a(function(t){return"loading"!==t.status||t.jobId!==e.payload.jobId?t:"VideoPromptEnhancementCompleted"===e.type?(0,k._)((0,Y._)({},t),{status:"preview",expandedPrompt:e.payload.expandedPrompt}):{status:"idle",error:"PromptVerificationError"===e.payload.error?"We can't enhance that prompt. Please edit it and try again.":"Something went wrong enhancing your prompt. Please try again."}}),o.invalidateQueries({queryKey:["dailyUsage"]}))},[o])),{state:r,enhance:function(){if(null===c.current&&"idle"===r.status){var e={jobId:(0,et.A)(),nomiId:f,prompt:y.trim()};c.current=e.jobId,a((0,k._)((0,Y._)({},e),{status:"loading"})),u(e,{onSuccess:function(){o.invalidateQueries({queryKey:["dailyUsage"]})},onError:function(t){(0,j.A)(t,{message:"Error requesting video prompt enhancement"}),c.current===e.jobId&&(a(function(r){return"loading"===r.status&&r.jobId===e.jobId?{status:"idle",error:(0,q.Dx)(t)&&"ExceedDailyLimit"===t.response.data.error.type?"You have used the expander ".concat(ee.K," times today. Please try again tomorrow."):"Couldn't enhance your prompt. Please try again."}:r}),o.invalidateQueries({queryKey:["dailyUsage"]}))}})}},reset:h}),B=V.state,R=V.enhance,z=V.reset,K=B.status,H="preview"===B.status?B.expandedPrompt:"",Q="idle"===B.status?B.error:"";(0,T.useEffect)(function(){return x("idle"!==K),function(){return x(!1)}},[K,x]),(0,T.useEffect)(function(){if("idle"!==K){var e=function(e){e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",e),function(){return window.removeEventListener("beforeunload",e)}}},[K]);var L=(null!=(g=null==(p=M.data)?void 0:p.videoPromptEnhancementUsages)?g:0)>=ee.K,W=I?"Please wait for your video request.":"idle"!==K?"Use or cancel the current enhancement first.":y.trim().length<10?"Enter at least 10 characters to enhance your prompt.":y.length>w?"Trim your prompt before enhancing it.":M.isError?"Couldn't check your daily allowance. Try again shortly.":M.data?L?"You have used the exp
1ander ".concat(ee.K," times today. Please try again tomorrow."):null:"Checking your daily allowance...";return(0,n.FD)(N.B,{gap:"sm",children:["loading"===K&&(0,n.FD)(U.Y,{justify:"space-between",role:"status",children:[(0,n.Y)(s.E,{size:"sm",c:"dimmed",children:"Enhancing your video prompt..."}),(0,n.Y)(l.$,{size:"xs",variant:"default",onClick:function(){return z()},children:"Cancel"})]}),"preview"===K&&(0,n.Y)(D.t,{withBorder:!0,radius:"md",p:"md",children:(0,n.FD)(N.B,{gap:"sm",children:[(0,n.FD)("div",{children:[(0,n.Y)(s.E,{fw:600,children:"Enhanced Prompt"}),(0,n.Y)(s.E,{size:"sm",c:"dimmed",children:'Here is your new prompt draft. You can manually copy parts you like into your original prompt below or press "Use This" to replace it and make any final edits before submitting.'})]}),(0,n.Y)($.T,{"aria-label":"Enhanced video prompt",value:H,readOnly:!0,autosize:!0,minRows:4,maxRows:10,size:"md"}),H.length>w&&(0,n.FD)(s.E,{size:"sm",c:"dimmed",children:["This draft exceeds ",w,' characters. Shorten it after choosing "Use This" before creating your video.']}),(0,n.FD)(U.Y,{justify:"flex-end",children:[(0,n.Y)(l.$,{size:"xs",variant:"default",onClick:function(){return z()},children:"Cancel"}),(0,n.Y)(l.$,{size:"xs",color:"purple",onClick:function(){var e;b(H),z("Accepted"),null==(e=F.current)||e.focus()},children:"Use This"})]})]})}),Q&&(0,n.Y)(s.E,{size:"sm",c:"red",role:"alert",children:Q}),(0,n.FD)("div",{children:[(0,n.Y)($.T,{label:(0,n.Y)(i.h,{order:4,component:"span",children:"Video Prompt"}),labelProps:{mb:"xs"},size:"md",placeholder:"The woman leaps upward with a burst of joy, her arms extending naturally as she rises, then she brings one hand down in a swift, energetic high-five toward the camera, her face bright with a wide, genuine smile and eyes crinkling. The motion is quick and lively, matching the celebratory mood. The camera remains still, capturing the full, upbeat movement in real time.",mb:4,rows:8,"aria-label":"Video prompt",ref:_,value:y,error:P,disabled:I,onChange:function(e){z(),b(e.currentTarget.value)},rightSection:(0,n.Y)(O.m,{label:null!=W?W:"Use the wand to enhance your video prompt.",children:(0,n.Y)(G.M,{variant:"transparent","aria-label":"Enhance video prompt",onClick:function(){W||R()},disabled:null!==W,children:(0,n.Y)(J.A,{})})}),rightSectionProps:{style:{display:"flex",alignItems:"flex-end",justifyContent:"flex-start",paddingBottom:6}}}),(0,n.FD)(s.E,{size:"sm",ml:4,ta:"right",c:P?"red":"dimmed","aria-live":"polite",children:[w-y.length," / ",w," characters left"]})]})]})}var ea=r(43728),eo=r(41348),es=r(15631),el=r(95814),ed=r(8425),eu={sd:{5:3,10:5,15:8},hd:{5:5,10:8,15:10}};let ec=function(e){var t,r,i,a,l=e.user,d=e.nomi,u=e.sourceMediaItem,c=(0,E._)((0,T.useState)(!1),2),h=c[0],m=c[1],p=(0,E._)((0,T.useState)(null),2),f=p[0],v=p[1],y=(0,A.jE)(),N=(0,eo.A)(),U=(0,ea.lB)(d.id),K=g.Ay.getImageUrl(u.uuid,"webp"),H=g.Ay.getImageUrl(u.uuid,"nl.webp"),Q=(0,z.S)(K),L=(t=(0,z.S)(H),"loaded"===t.status?t.src:"loaded"===Q.status?Q.src:null),$=L||"error"!==Q.status?null:Q.error,O=(0,_.m)({initialValues:{prompt:"",durationSeconds:5},validateInputOnChange:!0,validate:{prompt:function(e){if(e.length<1)return"Please enter a prompt.";if(e.length>V.Vh)return"You'll need to trim some of your prompt before submitting";var t=(0,E._)(e.split("///",2),2),r=t[0],n=t[1];return(null==r?void 0:r.trim())||(null==n?void 0:n.trim())?null:"Invalid prompt."}}}),G=(0,S.n)({mutationFn:function(e){return M.A.updateVideoResolution(d.id,e)},onSuccess:function(e,t){return(0,b._)(function(){return(0,P.YH)(this,function(e){switch(e.label){case 0:return[4,y.cancelQueries({queryKey:(0,ea.uP)(d.id).queryKey})];case 1:return e.sent(),[4,y.cancelQueries({queryKey:(0,ea.ZB)().queryKey})];case 2:return e.sent(),y.setQueryData((0,ea.uP)(d.id).queryKey,function(e){return e?(0,k._)((0,Y._)({},e),{settings:(0,k._)((0,Y._)({},e.settings),{videoResolution:t})}):e}),y.setQueryData((0,ea.ZB)().queryKey,function(e){return e?e.map(function(e){return e.id===d.id?(0,k._)((0,Y._)({},e),{settings:(0,k._)((0,Y._)({},e.settings),{videoResolution:t})}):e}):e}),[2]}})})()},onError:function(e){(0,R.A)({message:"We couldn't save your preferred video resolution. Please try again.",autoClose:!1,color:R.v.error}),(0,j.A)(e,{message:"Error updating Nomi video resolution",nomiId:d.id})}}),Z=null!=(a=null!=(i=G.isPending?G.variables:null==(r=U.data)?void 0:r.settings.videoRes
1olution)?i:d.settings.videoResolution)?a:"sd",J=(0,S.n)({mutationFn:function(e){var t=e.prompt,r=e.resolution,n=e.durationSeconds;return V.Ay.createFromMediaItem({sourceMediaItemUuid:u.uuid,prompt:t,nomiId:d.id,resolution:r,durationSeconds:n})},onSettled:function(){return(0,b._)(function(){return(0,P.YH)(this,function(e){switch(e.label){case 0:return[4,y.invalidateQueries({queryKey:["nomis"]})];case 1:return e.sent(),[4,y.invalidateQueries({queryKey:["activeVideoRequest","nomis",d.id]})];case 2:return e.sent(),[2]}})})()},onSuccess:function(e,t){return(0,b._)(function(){var r;return(0,P.YH)(this,function(n){switch(n.label){case 0:return y.setQueryData(["activeVideoRequest","nomis",d.id,!0],e),[4,y.invalidateQueries({queryKey:["me","credit-balance"]})];case 1:n.sent(),localStorage.setItem("videoRequestToast",JSON.stringify({message:"We are making your Nomi Video! Creation will take ~".concat(eu[t.resolution][t.durationSeconds]," minutes on average but wait times may be longer as usage increases."),groupChatId:null,nomiId:d.id})),n.label=2;case 2:return n.trys.push([2,4,,5]),[4,N.push("/nomis/".concat(d.id))];case 3:return n.sent(),[3,5];case 4:if(r=n.sent(),(0,w._)(r,ed.eM))return[2];throw r;case 5:return[2]}})})()},onError:function(e){var t,r,i,a;if(!(0,q.Dx)(e))return void(0,j.A)(e,{message:"Error creating video from a media item",sourceMediaItemUuid:u.uuid,nomiId:d.id});switch(null==(i=e.response)||null==(r=i.data)||null==(t=r.error)?void 0:t.type){case"LimitExceeded":(0,R.A)({message:"You are running out of daily requests and credits. Please upgrade your account or purchase more credits. Thanks!",autoClose:!1,color:R.v.error});return;case"PlanNotAllowed":(0,R.A)({message:"Your plan is not allowed to use this feature. If you think this is an error, please contact support. Thanks!",autoClose:!1,color:R.v.error});return;case"ConcurrencyNotAllowed":(0,R.A)({message:"You can only create one video per Nomi at a time. Please wait for your current video to finish.",autoClose:!1,color:R.v.error});return;case"PromptContainsForbiddenTerm":O.setFieldError("prompt",(a=e.response.data.error.firstBlockTerm,(0,n.FD)(n.FK,{children:[(0,n.Y)("strong",{children:"Error: "}),(0,B.M)("This prompt contains a forbidden term, please edit your prompt and submit again.",a)]})));return;case"InvalidPrompt":(0,R.A)({message:"Invalid Prompt",autoClose:!1,color:R.v.error});return;default:(0,R.A)({message:"We encountered an unexpected error when submitting your video request. Please try again or contact support.",autoClose:!1,color:R.v.error}),(0,j.A)(e,{sourceMediaItemUuid:u.uuid,nomiId:d.id})}}}),X=O.reset,ee=J.reset;(0,T.useEffect)(function(){X(),ee()},[d.id,u.uuid,X,ee]);var et=O.values.durationSeconds,er=(0,es.A)({user:l,requestType:"Video",videoResolution:Z,videoDurationSeconds:et}),en=er.UsageLimitElement,ec=er.ActionButton,eh=(0,V.eD)(Z,et);return(0,n.FD)(I.a,{w:"100%",maw:680,m:"auto",pb:48,pt:{base:24,md:0},px:{base:"lg",md:0},children:[(0,n.Y)(s.E,{size:"lg",fw:500,mb:"xs",children:"Your imagination is the limit! Create a short video based on the image you selected. For best results, make sure the starting image fits the intent of the video you're creating."}),(0,n.FD)(o.s,{direction:"column",gap:20,w:"100%",children:[L&&(0,n.Y)(x._,{mx:"auto",maw:380,src:L,alt:"Source image",radius:"md"}),$&&(0,n.Y)(D.t,{withBorder:!0,radius:"md",p:"lg",role:"alert",children:(0,n.Y)(s.E,{ta:"center",children:"We couldn't load the source image. Please go back and try again."})}),(0,n.Y)(W,{setPrompt:function(e){return O.setFieldValue("prompt",e)},promptElem:f}),(0,n.Y)(ei,{sourceMediaItemUuid:u.uuid,nomiId:d.id,prompt:O.values.prompt,onChange:function(e){return O.setFieldValue("prompt",e)},maxPromptLength:V.Vh,error:O.errors.prompt,disabled:J.isPending,onBusyChange:m,inputRef:v}),(0,n.Y)(C.c,{}),(0,n.FD)(o.s,{gap:"xs",align:"center",wrap:"wrap",children:[(0,n.Y)(F.I,{"aria-label":"Video length",color:"purple",value:String(O.values.durationSeconds),onChange:function(e){return O.setFieldValue("durationSeconds",V.FI.parse(Number(e)))},disabled:J.isPending,data:[5,10,15].map(function(e){return{value:String(e),label:(0,n.FD)(n.FK,{children:[e," ",(0,n.Y)(I.a,{component:"span",hiddenFrom:"sm",children:"sec"}
1),(0,n.Y)(I.a,{component:"span",visibleFrom:"sm",children:"seconds"})]})}})}),(0,n.Y)(F.I,{"aria-label":"Video quality",color:"purple",value:Z,disabled:J.isPending,onChange:function(e){var t=V.ip.parse(e);t!==Z&&G.mutate(t)},data:[{label:"SD",value:"sd"},{label:"HD",value:"hd"}]}),(0,n.Y)(el.A,{triggerLabel:"Video Quality Tooltip",children:"HD generates high-quality (720p) video but takes longer. SD generates standard quality (480p) and is faster."})]}),(0,n.FD)(s.E,{fw:500,"aria-live":"polite","aria-atomic":"true",children:[et," Sec -"," ","sd"===Z?"Standard Definition":"High Definition",": ",eh," credits"]}),(0,n.Y)(C.c,{}),(0,n.FD)("div",{children:[ec&&(0,n.Y)(ec,{fullWidth:!0,radius:"xl",loading:J.isPending,disabled:h,requestText:"Create Video",size:"lg",variant:"round",onRequest:function(){h||O.validate().hasErrors||J.mutate({prompt:O.getValues().prompt,resolution:Z,durationSeconds:et})},onRedirectSubscription:function(){N.push("/profile/subscription?source=VideoRequest")},onRedirectCredit:function(){N.push("/profile/credit?source=VideoRequest")}}),(0,n.Y)(o.s,{justify:"center",align:"center",gap:4,mt:"sm",children:en&&(0,n.Y)(en,{size:"sm",align:"center"})})]}),(0,n.Y)(ed.Ay,{title:"Your video hasn't been submitted!",unsavedChanges:h||O.isDirty()&&(J.isIdle||J.isError),children:"If you leave without submitting your video, your changes will be lost."})]})]})};var eh=function(e){var t=e.user,r=(0,m.useRouter)(),c=(0,ea.CV)(),v=p.nH().safeParse(r.query.mediaItemUuid),b=(0,d.I)({queryKey:["mediaItem",v.data],queryFn:v.success?function(){return g.Ay.fetch(v.data)}:u.hT});if(!r.isReady||!c||v.success&&b.isPending)return(0,n.Y)(f.A,{});var w=b.data,Y=w&&"Video"!==w.type;return(0,n.Y)(y.A,{title:"Create a Nomi Video",header:(0,n.FD)(i.h,{order:3,children:[c.name," - Create AI Video (V3)"]}),chatName:c.name,backHref:"/nomis/".concat(c.id),backBehavior:"history",children:v.success&&!b.isError&&Y?(0,n.Y)(ec,{user:t,nomi:c,sourceMediaItem:w}):(0,n.Y)(a.o,{flex:1,px:"md",children:(0,n.FD)(o.s,{direction:"column",align:"center",gap:"sm",children:[(0,n.Y)(s.E,{ta:"center",c:"dimmed",children:(null==w?void 0:w.type)==="Video"?"Videos can't be used as the source for another video.":"We couldn't load that image."}),(0,n.Y)(l.$,{component:h(),href:"/nomis/".concat(c.id,"/photo-album"),variant:"light",children:"Open Photo Album"})]})})})};eh.getLayout=v.A.layoutBuilder;let em=eh},41781:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(20648).A)("outline","video","Video",[["path",{d:"M15 10l4.553 -2.276a1 1 0 0 1 1.447 .894v6.764a1 1 0 0 1 -1.447 .894l-4.553 -2.276v-4",key:"svg-0"}],["path",{d:"M3 8a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2l0 -8",key:"svg-1"}]])},48649:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(20648).A)("outline","palette","Palette",[["path",{d:"M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25",key:"svg-0"}],["path",{d:"M7.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M11.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M15.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}]])},59787:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(20648).A)("outline","bulb","Bulb",[["path",{d:"M3 12h1m8 -9v1m8 8h1m-15.4 -6.4l.7 .7m12.1 -.7l-.7 .7",key:"svg-0"}],["path",{d:"M9 16a5 5 0 1 1 6 0a3.5 3.5 0 0 0 -1 3a2 2 0 0 1 -4 0a3.5 3.5 0 0 0 -1 -3",key:"svg-1"}],["path",{d:"M9.7 17l4.6 0",key:"svg-2"}]])},74913:e=>{e.exports={root:"ChatSubPage_root__mNlGz",header:"ChatSubPage_header__fGTaa",body:"ChatSubPage_body__HEknn",footer
1:"ChatSubPage_footer__25kxr"}},92036:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(26811),i=r(39894);let a=function(e){var t=e.newPrompt,r=e.setPrompt,a=e.promptElem,o=function(){if(r(t),a){var e="current"in a?a.current:a;null==e||e.scrollIntoView({behavior:"smooth"}),null==e||e.focus()}};return(0,n.Y)(i.M,{size:"sm",onClick:function(){return o()},children:"Use this"})}},92282:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/nomis/[nomiId]/media-items/[mediaItemUuid]/create-video",function(){return r(41148)}])},95148:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(20648).A)("outline","wand","Wand",[["path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3",key:"svg-0"}],["path",{d:"M15 6l3 3",key:"svg-1"}],["path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2",key:"svg-2"}],["path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2",key:"svg-3"}]])}},e=>{e.O(0,[7737,7353,7948,3690,9742,636,6593,8792],()=>e(e.s=92282)),_N_E=e.O()}]);
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.