PageSourceSearch

https://sats4ai.com/_next/static/chunks/9893.732e47125464e2e6.js

js sats4ai.com collected 2026-10-07 17:13:55 UTC 5,602 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9893],{24323:(e,t,n)=>{n.d(t,{d:()=>h,S:()=>m});var r=n(22663),a=n(22398),o=n(90056),i=n(93137),l=n(95155),d=n(52619),c=n.n(d);let s="/docs#".concat("wallet-spending-limit");async function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4e3;if("undefined"==typeof document)return;let t=Date.now()+e;for(;document.querySelector("bc-modal")&&Date.now()<t;)await new Promise(e=>setTimeout(e,150))}async function h(e){let{paymentId:t,invoice:o,onPaid:l,onCancelled:d,logPrefix:c="[QR]"}=e;await u();let{launchPaymentModal:s,closeModal:h}=await Promise.all([n.e(9862),n.e(6365),n.e(6902)]).then(n.bind(n,69557)),{setPaid:m}=s({invoice:o,onPaid:()=>null==l?void 0:l(),onCancelled:()=>{(0,i.f)(null),(async()=>{if(!await (0,a.oy)(t)){(0,r.default)("Checking whether your payment went through…"),console.warn("".concat(c," dismissed but the invoice may have settled — leaving the poll armed"));return}null==d||d()})()}});return(0,i.f)(()=>{try{m({})}catch(e){}setTimeout(()=>{try{h()}catch(e){}},1200)}),{setPaid:m}}async function m(e){let{provider:t,paymentId:n,invoice:i,onCancelled:d,onPaid:u}=e;try{return await (0,o.rN)(t.sendPayment(i)),{qrOpened:!1}}catch(t){if(console.warn("[WebLN] sendPayment rejected:",(null==t?void 0:t.message)||t),!await (0,a.oy)(n))return(0,r.default)("Your wallet did not confirm. Checking whether the payment went through…"),console.warn("[WebLN] sendPayment rejected but the invoice may have settled — continuing to delivery"),{qrOpened:!1};let e=(0,o.CS)(t);(0,o.DO)(n,e),"wallet_limit"===e&&(0,r.default)(e=>(0,l.jsxs)("div",{className:"text-sm leading-snug",children:[(0,l.jsx)("p",{className:"font-medium",children:"Your wallet's spending limit blocked this payment."}),(0,l.jsxs)("p",{className:"mt-1 text-gray-600 dark:text-gray-300",children:[(0,l.jsx)("strong",{children:"Scan the QR code below to pay now"})," — it works with any wallet, including the one you just connected."]}),(0,l.jsxs)("p",{className:"mt-1 text-gray-600 dark:text-gray-300",children:["To fix the connection instead: in your wallet, raise the connection's budget ",(0,l.jsx)("em",{children:"and"})," set its renewal period to ",(0,l.jsx)("strong",{children:"monthly"}),". A budget set to renew ",(0,l.jsx)("strong",{children:"never"})," is spent for good after the first payment, however large you make it. If the change does not take, click the blue ",(0,l.jsx)("strong",{children:"Connected"})," button at the top of the page, choose ",(0,l.jsx)("strong",{children:"Disconnect"}),", and pair it again."]}),(0,l.jsxs)("p",{className:"mt-2 flex gap-3",children:[(0,l.jsx)(c(),{href:s,className:"underline",onClick:()=>r.default.dismiss(e.id),children:"What is this?"}),(0,l.jsx)("button",{type:"button",className:"underline text-gray-500",onClick:()=>r.default.dismiss(e.id),children:"Dismiss"})]})]}),{duration:15e3,id:"wallet-limit"});try{let{setPaid:e}=await h({paymentId:n,invoice:i,onPaid:u,onCancelled:d,logPrefix:"[QR fallback]"});return{qrOpened:!0,setPaid:e}}catch(e){return console.warn("[WebLN] QR fallback could not open:",e),{qrOpened:!1,walletError:t}}}}},59893:(e,t,n)=>{n.d(t,{generateShotVideo:()=>s});var r=n(3369),a=n(59072),o=n(22398),i=n(90056),l=n(24323);let d=null;async function c(){return d||(d=r.A.get("/api/models",{params:{type:a.AiModelTypes.Video},timeout:1e4}).then(e=>{var t,n;let r=null==(n=e.data)||null==(t=n[0])?void 0:t.db_id;if(!r)throw Error("no video model is available right now");return String(r)}).catch(e=>{throw d=null,e})),d}async function s(e){let{prompt:t,seconds:r,resolution:d,referenceAudio:s,referenceImages:u,onRendering:h}=e,m=s?"".concat(t.trim(),". The performance is synced to Audio 1."):t.trim(),p=await c(),w=null;try{let e=await Promise.all([n.e(9862),n.e(6365),n.e(6902)]).then(n.bind(n,69557));w=e.requestProvider?await e.requestProvider().catch(()=>null):null}catch(e){}let f=w?"WebLN":"QR",{paymentId:y,lightning_pay:g}=await (0,o.Tn)(a.AiModelTypes.Video,p,r,"Sats4AI - Music Video Shot - MiniMax H3 - ".concat(r,"s ").concat(d," - ").concat(f),void 0,void 0,"Video",{resolution:d,duration:r});await new Promise((e,t)=>
1{let r=!1,a=()=>{r||(r=!0,e())},d=e=>{r||(r=!0,t(e instanceof Error?e:Error(String(e))))};w?(0,l.S)({provider:w,paymentId:y,invoice:g,onCancelled:()=>d(Error("payment cancelled")),onPaid:a}).then(e=>{if(!e.qrOpened&&e.walletError)return void d(Error("wallet rejected the payment"));(0,o.BC)(y,g,1e3,a,0,()=>d(Error("payment timed out")))}).catch(d):Promise.all([n.e(9862),n.e(6365),n.e(6902)]).then(n.bind(n,69557)).then(e=>{let{launchPaymentModal:t}=e,{setPaid:n}=t({invoice:g,onPaid:a,onCancelled:()=>{(0,i.DO)(y,"modal_cancelled"),d(Error("payment cancelled"))}});(0,o.LM)(y,g,2e3,()=>{n({}),a()},0,()=>d(Error("payment timed out")))}).catch(d)}),null==h||h();let v=new FormData;for(let e of(v.append("paymentId",String(y)),v.append("model_Id",p),v.append("prompt",m),v.append("duration",String(r)),v.append("resolution",d),v.append("reference_audio",s),u))v.append("reference_image",e);let b=await fetch("/api/models/video",{method:"POST",body:v});return function(e,t,n){let r=null;try{r=JSON.parse(n)}catch(e){}if(!e){var a;let e=Error((null==r?void 0:r.error)||(null==r?void 0:r.message)||n.slice(0,200)||"render failed (".concat(t,")"));throw(null==r||null==(a=r.refund)?void 0:a.refund_secret)&&(e.refund=r.refund),e}let o=(null==r?void 0:r.videoUrl)||(null==r?void 0:r.video_url)||(null==r?void 0:r.url);if(!o)throw Error("the render came back with no video");return o}(b.ok,b.status,await b.text())}}}]);

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.