@imgly/plugin-ai-video-generation-web 1.74.0-rc.0 → 1.74.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var qt=class{constructor(e,t=[],r){this.id=e,this.translateLabel=r?.translateLabel,this.assets=t.map(i=>{if(typeof i.label=="string"&&!(i.label&&typeof i.label=="object")){let n=i;return{id:n.id,label:{en:n.label},meta:n.thumbUri?{...n.meta??{},thumbUri:n.thumbUri}:n.meta}}return i}),this.activeAssetIds=new Set,this.assets.length>0&&this.activeAssetIds.add(this.assets[0].id)}async findAssets(e){let{page:t,perPage:r,locale:i="en",sortActiveFirst:n,query:o,tags:a,groups:s,excludeGroups:u,sortingOrder:d,sortKey:l}=e,c=[...this.assets];if(s&&s.length>0&&(c=c.filter(p=>p.groups&&s.some(f=>p.groups?.includes(f)))),u&&u.length>0&&(c=c.filter(p=>!p.groups||!u.some(f=>p.groups?.includes(f)))),o){let p=o.toLowerCase();c=c.filter(f=>{let h=f.label?.[i]?.toLowerCase(),I=f.tags?.[i]||[];return h&&h.includes(p)||I.some(Ht=>Ht.toLowerCase().includes(p))})}if(a&&a.length>0){let p=Array.isArray(a)?a:[a];c=c.filter(f=>{let h=f.tags?.[i]||[];return p.some(I=>h.includes(I))})}n&&c.sort((p,f)=>{let h=this.activeAssetIds.has(p.id),I=this.activeAssetIds.has(f.id);return h&&!I?-1:!h&&I?1:0}),l&&l!=="id"?c.sort((p,f)=>{let h=p.meta?.[l],I=f.meta?.[l];return h===void 0?1:I===void 0?-1:typeof h=="string"&&typeof I=="string"?d==="Descending"?I.localeCompare(h):h.localeCompare(I):typeof h=="number"&&typeof I=="number"?d==="Descending"?I-h:h-I:0}):l==="id"&&c.sort((p,f)=>d==="Descending"?f.id.localeCompare(p.id):p.id.localeCompare(f.id));let w=c.length,x=t*r,j=x+r,S=c.slice(x,j).map(p=>{let f=p.label?.[i]||"",h=this.translateLabel?this.translateLabel(p.id,f,i):f;return{id:p.id,groups:p.groups,meta:p.meta,payload:p.payload,locale:i,label:h,tags:p.tags?.[i],active:this.activeAssetIds.has(p.id)}}),re=j<w?t+1:void 0;return{assets:S,currentPage:t,nextPage:re,total:w}}updateLabel(e,t,r){this.assets.forEach(i=>{i.id===e&&(i.label=i.label||{},i.label[r]=t)})}getAssetSelectValue(e){let t=this.assets.find(({id:r})=>r===e);if(t){let r=this.translateLabel?this.translateLabel(t.id,t.label?.en||"",""):t.label?.en||"";return{id:t.id,label:r,thumbUri:t.meta?.thumbUri}}}getActiveSelectValue(){let e=this.getActiveAssetIds();if(e.length>0){let t=this.assets.find(({id:r})=>r===e[0]);if(t){let r=this.translateLabel?this.translateLabel(t.id,t.label?.en||"",""):t.label?.en||"";return{id:t.id,label:r,thumbUri:t.meta?.thumbUri}}}}getTranslatedLabel(e){let t=this.assets.find(({id:r})=>r===e);if(t)return this.translateLabel?this.translateLabel(t.id,t.label?.en||"",""):t.label?.en||""}getAsset(e){return this.assets.find(t=>t.id===e)}setAssetActive(e){this.activeAssetIds.add(e)}getActiveAssetIds(){return Array.from(this.activeAssetIds)}setAssetsActive(e){e.forEach(t=>this.activeAssetIds.add(t))}setAssetInactive(e){this.activeAssetIds.delete(e)}clearActiveAssets(){this.activeAssetIds.clear()}isAssetActive(e){return this.activeAssetIds.has(e)}addAsset(e){let t=this.assets.findIndex(r=>r.id===e.id);t>=0?this.assets[t]=e:this.assets.push(e)}removeAsset(e){let t=this.assets.findIndex(r=>r.id===e);t!==-1&&(this.assets.splice(t,1),this.activeAssetIds.delete(e))}async getGroups(){let e=new Set;return this.assets.forEach(t=>{t.groups&&t.groups.forEach(r=>e.add(r))}),Array.from(e)}getSupportedMimeTypes(){return["image/jpeg","image/png","image/svg+xml","image/webp","video/mp4","audio/mpeg"]}};var Kt=typeof global=="object"&&global&&global.Object===Object&&global,Ue=Kt,Zt=typeof self=="object"&&self&&self.Object===Object&&self,Qt=Ue||Zt||Function("return this")(),C=Qt,Yt=C.Symbol,L=Yt,Be=Object.prototype,Wt=Be.hasOwnProperty,Jt=Be.toString,G=L?L.toStringTag:void 0;function Xt(e){var t=Wt.call(e,G),r=e[G];try{e[G]=void 0;var i=!0}catch{}var n=Jt.call(e);return i&&(t?e[G]=r:delete e[G]),n}var er=Xt,tr=Object.prototype,rr=tr.toString;function ir(e){return rr.call(e)}var nr=ir,or="[object Null]",ar="[object Undefined]",Ee=L?L.toStringTag:void 0;function sr(e){return e==null?e===void 0?ar:or:Ee&&Ee in Object(e)?er(e):nr(e)}var Z=sr;function lr(e){return e!=null&&typeof e=="object"}var be=lr,Ml=Array.isArray;function ur(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ge=ur,dr="[object AsyncFunction]",cr="[object Function]",pr="[object GeneratorFunction]",gr="[object Proxy]";function mr(e){if(!Ge(e))return!1;var t=Z(e);return t==cr||t==pr||t==dr||t==gr}var fr=mr,hr=C["__core-js_shared__"],ue=hr,Pe=function(){var e=/[^.]+$/.exec(ue&&ue.keys&&ue.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function yr(e){return!!Pe&&Pe in e}var br=yr,vr=Function.prototype,wr=vr.toString;function xr(e){if(e!=null){try{return wr.call(e)}catch{}try{return e+""}catch{}}return""}var M=xr,Ir=/[\\^$.*+?()[\]{}|]/g,kr=/^\[object .+?Constructor\]$/,Sr=Function.prototype,Ar=Object.prototype,Cr=Sr.toString,Er=Ar.hasOwnProperty,Pr=RegExp("^"+Cr.call(Er).replace(Ir,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Mr(e){if(!Ge(e)||br(e))return!1;var t=fr(e)?Pr:kr;return t.test(M(e))}var Tr=Mr;function jr(e,t){return e?.[t]}var _r=jr;function Lr(e,t){var r=_r(e,t);return Tr(r)?r:void 0}var V=Lr,Vr=V(C,"WeakMap"),pe=Vr;function $r(e,t){return e===t||e!==e&&t!==t}var Dr=$r,Or=9007199254740991;function Rr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Or}var Fr=Rr,Tl=Object.prototype,Nr="[object Arguments]";function zr(e){return be(e)&&Z(e)==Nr}var Me=zr,He=Object.prototype,Ur=He.hasOwnProperty,Br=He.propertyIsEnumerable,jl=Me(function(){return arguments}())?Me:function(e){return be(e)&&Ur.call(e,"callee")&&!Br.call(e,"callee")},qe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Te=qe&&typeof module=="object"&&module&&!module.nodeType&&module,Gr=Te&&Te.exports===qe,je=Gr?C.Buffer:void 0,_l=je?je.isBuffer:void 0,Hr="[object Arguments]",qr="[object Array]",Kr="[object Boolean]",Zr="[object Date]",Qr="[object Error]",Yr="[object Function]",Wr="[object Map]",Jr="[object Number]",Xr="[object Object]",ei="[object RegExp]",ti="[object Set]",ri="[object String]",ii="[object WeakMap]",ni="[object ArrayBuffer]",oi="[object DataView]",ai="[object Float32Array]",si="[object Float64Array]",li="[object Int8Array]",ui="[object Int16Array]",di="[object Int32Array]",ci="[object Uint8Array]",pi="[object Uint8ClampedArray]",gi="[object Uint16Array]",mi="[object Uint32Array]",g={};g[ai]=g[si]=g[li]=g[ui]=g[di]=g[ci]=g[pi]=g[gi]=g[mi]=!0;g[Hr]=g[qr]=g[ni]=g[Kr]=g[oi]=g[Zr]=g[Qr]=g[Yr]=g[Wr]=g[Jr]=g[Xr]=g[ei]=g[ti]=g[ri]=g[ii]=!1;function fi(e){return be(e)&&Fr(e.length)&&!!g[Z(e)]}var hi=fi;function yi(e){return function(t){return e(t)}}var bi=yi,Ke=typeof exports=="object"&&exports&&!exports.nodeType&&exports,H=Ke&&typeof module=="object"&&module&&!module.nodeType&&module,vi=H&&H.exports===Ke,de=vi&&Ue.process,wi=function(){try{var e=H&&H.require&&H.require("util").types;return e||de&&de.binding&&de.binding("util")}catch{}}(),_e=wi,Le=_e&&_e.isTypedArray,Ll=Le?bi(Le):hi,xi=Object.prototype,Vl=xi.hasOwnProperty;function Ii(e,t){return function(r){return e(t(r))}}var ki=Ii,$l=ki(Object.keys,Object),Si=Object.prototype,Dl=Si.hasOwnProperty,Ai=V(Object,"create"),q=Ai;function Ci(){this.__data__=q?q(null):{},this.size=0}var Ei=Ci;function Pi(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Mi=Pi,Ti="__lodash_hash_undefined__",ji=Object.prototype,_i=ji.hasOwnProperty;function Li(e){var t=this.__data__;if(q){var r=t[e];return r===Ti?void 0:r}return _i.call(t,e)?t[e]:void 0}var Vi=Li,$i=Object.prototype,Di=$i.hasOwnProperty;function Oi(e){var t=this.__data__;return q?t[e]!==void 0:Di.call(t,e)}var Ri=Oi,Fi="__lodash_hash_undefined__";function Ni(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=q&&t===void 0?Fi:t,this}var zi=Ni;function $(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}$.prototype.clear=Ei;$.prototype.delete=Mi;$.prototype.get=Vi;$.prototype.has=Ri;$.prototype.set=zi;var Ve=$;function Ui(){this.__data__=[],this.size=0}var Bi=Ui;function Gi(e,t){for(var r=e.length;r--;)if(Dr(e[r][0],t))return r;return-1}var ie=Gi,Hi=Array.prototype,qi=Hi.splice;function Ki(e){var t=this.__data__,r=ie(t,e);if(r<0)return!1;var i=t.length-1;return r==i?t.pop():qi.call(t,r,1),--this.size,!0}var Zi=Ki;function Qi(e){var t=this.__data__,r=ie(t,e);return r<0?void 0:t[r][1]}var Yi=Qi;function Wi(e){return ie(this.__data__,e)>-1}var Ji=Wi;function Xi(e,t){var r=this.__data__,i=ie(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}var en=Xi;function D(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}D.prototype.clear=Bi;D.prototype.delete=Zi;D.prototype.get=Yi;D.prototype.has=Ji;D.prototype.set=en;var ne=D,tn=V(C,"Map"),K=tn;function rn(){this.size=0,this.__data__={hash:new Ve,map:new(K||ne),string:new Ve}}var nn=rn;function on(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var an=on;function sn(e,t){var r=e.__data__;return an(t)?r[typeof t=="string"?"string":"hash"]:r.map}var oe=sn;function ln(e){var t=oe(this,e).delete(e);return this.size-=t?1:0,t}var un=ln;function dn(e){return oe(this,e).get(e)}var cn=dn;function pn(e){return oe(this,e).has(e)}var gn=pn;function mn(e,t){var r=oe(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}var fn=mn;function O(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}O.prototype.clear=nn;O.prototype.delete=un;O.prototype.get=cn;O.prototype.has=gn;O.prototype.set=fn;var Ze=O;function hn(){this.__data__=new ne,this.size=0}var yn=hn;function bn(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var vn=bn;function wn(e){return this.__data__.get(e)}var xn=wn;function In(e){return this.__data__.has(e)}var kn=In,Sn=200;function An(e,t){var r=this.__data__;if(r instanceof ne){var i=r.__data__;if(!K||i.length<Sn-1)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new Ze(i)}return r.set(e,t),this.size=r.size,this}var Cn=An;function Q(e){var t=this.__data__=new ne(e);this.size=t.size}Q.prototype.clear=yn;Q.prototype.delete=vn;Q.prototype.get=xn;Q.prototype.has=kn;Q.prototype.set=Cn;var En=Object.prototype,Ol=En.propertyIsEnumerable,Pn=V(C,"DataView"),ge=Pn,Mn=V(C,"Promise"),me=Mn,Tn=V(C,"Set"),fe=Tn,$e="[object Map]",jn="[object Object]",De="[object Promise]",Oe="[object Set]",Re="[object WeakMap]",Fe="[object DataView]",_n=M(ge),Ln=M(K),Vn=M(me),$n=M(fe),Dn=M(pe),_=Z;(ge&&_(new ge(new ArrayBuffer(1)))!=Fe||K&&_(new K)!=$e||me&&_(me.resolve())!=De||fe&&_(new fe)!=Oe||pe&&_(new pe)!=Re)&&(_=function(e){var t=Z(e),r=t==jn?e.constructor:void 0,i=r?M(r):"";if(i)switch(i){case _n:return Fe;case Ln:return $e;case Vn:return De;case $n:return Oe;case Dn:return Re}return t});var Rl=C.Uint8Array,On="__lodash_hash_undefined__";function Rn(e){return this.__data__.set(e,On),this}var Fn=Rn;function Nn(e){return this.__data__.has(e)}var zn=Nn;function he(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Ze;++t<r;)this.add(e[t])}he.prototype.add=he.prototype.push=Fn;he.prototype.has=zn;var Ne=L?L.prototype:void 0,Fl=Ne?Ne.valueOf:void 0,Un=Object.prototype,Nl=Un.hasOwnProperty,Bn=Object.prototype,zl=Bn.hasOwnProperty,Ul=new RegExp(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,"i"),Bl=new RegExp(/[A-Fa-f0-9]{1}/,"g"),Gl=new RegExp(/[A-Fa-f0-9]{2}/,"g");function Gn(e){return e!==void 0}var Hn=Gn;function qn(e){return e?.version?e.version.localeCompare("1.59.0",void 0,{numeric:!0,sensitivity:"base"})>=0&&typeof e.i18n?.translate=="function":!1}function Kn(e){return typeof e?.translate=="function"}function ze(e,t,r){return e&&qn(e)&&Kn(e.i18n)?e.i18n.translate(t):r}function A(e,t){if(typeof e.i18n?.getTranslations!="function"){e.i18n.setTranslations(t);return}let r=Object.keys(t),i=e.i18n.getTranslations(r),n={};for(let o of r){let a=t[o];if(!a)continue;let s=i[o]??{},u={};for(let[d,l]of Object.entries(a))!(d in s)&&l!==void 0&&(u[d]=l);Object.keys(u).length>0&&(n[o]=u)}Object.keys(n).length>0&&e.i18n.setTranslations(n)}function Zn(e,t){let{cesdk:r}=t,i=t.propertyKey??"image_url",n=ye(e);return A(r,{en:{[`panel.${n}`]:"Select Image To Change","ly.img.ai.imageSelection.selectImage.label":"Select Image","ly.img.ai.imageSelection.error.svg":"SVG images are not supported. Please choose a different image.","ly.img.ai.imageSelection.error.invalidType":"Only images are supported. Found '{mimeType}'. Please choose a different image."}}),Qn(e,r),{[i]:(o,a)=>{let{builder:s,experimental:{global:u},payload:d}=o,l,c=o.providerConfig,w=o.config,x=c?.properties?.[a.id]??w?.properties?.[a.id];x?.default&&(typeof x.default=="function"?l=x.default({}):l=x.default);let j=l??d?.url??t.defaultUrl,S=u(`${e}.${a.id}`,j);return s.MediaPreview(a.id,{preview:{type:"image",uri:S.value},action:{label:"ly.img.ai.imageSelection.selectImage.label",onClick:()=>{r?.ui.openPanel(n,{payload:{onSelect:re=>{re.meta?.uri!=null&&S.setValue(re.meta?.uri)}}})}}}),()=>({id:a.id,type:"string",value:S.value})}}}function Qn(e,t){t?.ui.registerPanel(ye(e),({builder:r,payload:i})=>{r.Library(`${e}.library.image`,{entries:["ly.img.image"],onSelect:async n=>{let o=n?.meta?.uri;if(o==null)return;let a=await t.engine.editor.getMimeType(o);a==="image/svg+xml"?t.ui.showNotification({type:"warning",message:"ly.img.ai.imageSelection.error.svg"}):a.startsWith("image/")?(i?.onSelect(n),t?.ui.closePanel(ye(e))):t.ui.showNotification({type:"warning",message:"ly.img.ai.imageSelection.error.invalidType"})}})})}function ye(e){return`ly.img.ai.${e}.imageSelection`}var Yn=Zn;function Wn(e,t){let{cesdk:r}=t;if(r==null)return{};let i=t.propertyKey??"style",n=Xn(e);A(r,{en:{[`panel.${n}`]:"Select Style",[`${e}.${i}`]:"Style","ly.img.ai.styleTransfer.none":"None","ly.img.ai.styleTransfer.anime":"Anime","ly.img.ai.styleTransfer.cyberpunk":"Cyberpunk","ly.img.ai.styleTransfer.kodak400":"Kodak 400","ly.img.ai.styleTransfer.watercolor":"Watercolor","ly.img.ai.styleTransfer.darkFantasy":"Dark Fantasy","ly.img.ai.styleTransfer.vaporwave":"Vaporwave","ly.img.ai.styleTransfer.vectorFlat":"Vector Flat","ly.img.ai.styleTransfer.3dAnimation":"3D Animation","ly.img.ai.styleTransfer.ukiyoe":"Ukiyo\u2011e","ly.img.ai.styleTransfer.surreal":"Surreal","ly.img.ai.styleTransfer.steampunk":"Steampunk","ly.img.ai.styleTransfer.nightBokeh":"Night Bokeh","ly.img.ai.styleTransfer.popArt":"Pop Art"}});let o=to({baseURL:t.baseURL??"https://cdn.img.ly/assets/plugins/plugin-ai-image-generation-web/v1/gpt-image-1/",includeNone:!0,cesdk:r}),a=o;t.styles!=null&&(Array.isArray(t.styles)?a=t.styles:typeof t.styles=="function"&&(a=t.styles(o)));let s=ro({cesdk:r,providerId:e,styles:a}),u=s.id;return io(s,{cesdk:r}),Jn({providerId:e,cesdk:r,panelId:n,entryId:u}),{[t.propertyKeyForPrompt??"prompt"]:(d,l)=>{let c=d.state("prompt","");return d.builder.TextArea(`${l.id}`,{inputLabel:t.i18n?.prompt?.inputLabel??t.propertyKeyForPrompt??"prompt",placeholder:t.i18n?.prompt?.placeholder,...c}),()=>{let[w]=s.getActiveAssetIds(),x=s.getAsset(w);return{id:l.id,type:"string",value:x?.meta?.prompt==null?c.value:`${c.value}; ${x.meta.prompt}`}}},[i]:(d,l)=>{let{builder:c,state:w}=d;if(a.length>0){let x=w("style",a[0]);return c.Button(`${l.id}`,{inputLabel:`${e}.${l.id}`,icon:"@imgly/Appearance",isDisabled:a.length===0,trailingIcon:"@imgly/ChevronRight",label:x.value.label,labelAlignment:"left",onClick:()=>{let j={onSelect:async S=>{s.clearActiveAssets(),s.setAssetActive(S.id),x.setValue({id:S.id,label:S.label??S.id}),r.ui.closePanel(n)}};r.ui.openPanel(n,{payload:j})}}),()=>({id:l.id,type:"string",value:x.value.id})}return()=>({id:l.id,type:"string",value:"none"})}}}function Jn(e){let{providerId:t,cesdk:r,panelId:i,entryId:n}=e;r?.ui.registerPanel(i,({builder:o,payload:a})=>{a?.onSelect==null&&o.Section(`${t}.error`,{children:()=>{o.Text("error",{content:"No onSelect function provided for the style selection panel."})}}),o.Library(`${t}.library.image`,{entries:[n],onSelect:async s=>{a?.onSelect?.(s)}})})}function Xn(e){return`ly.img.ai.${e}.styleSelection`}var eo=[{id:"none",labelKey:"ly.img.ai.styleTransfer.none",prompt:""},{id:"anime-celshaded",labelKey:"ly.img.ai.styleTransfer.anime",prompt:"anime cel\u2011shaded, bright pastel palette, expressive eyes, clean line art "},{id:"cyberpunk-neon",labelKey:"ly.img.ai.styleTransfer.cyberpunk",prompt:"cyberpunk cityscape, glowing neon signage, reflective puddles, dark atmosphere"},{id:"kodak-portra-400",labelKey:"ly.img.ai.styleTransfer.kodak400",prompt:"shot on Kodak Portra 400, soft grain, golden\u2011hour warmth, 35 mm photo"},{id:"watercolor-storybook",labelKey:"ly.img.ai.styleTransfer.watercolor",prompt:"loose watercolor washes, gentle gradients, dreamy storybook feel"},{id:"dark-fantasy-realism",labelKey:"ly.img.ai.styleTransfer.darkFantasy",prompt:"dark fantasy realm, moody chiaroscuro lighting, hyper\u2011real textures"},{id:"vaporwave-retrofuturism",labelKey:"ly.img.ai.styleTransfer.vaporwave",prompt:"retro\u2011futuristic vaporwave, pastel sunset gradient, chrome text, VHS scanlines"},{id:"minimal-vector-flat",labelKey:"ly.img.ai.styleTransfer.vectorFlat",prompt:"minimalist flat vector illustration, bold geometry, two\u2011tone palette"},{id:"pixarstyle-3d-render",labelKey:"ly.img.ai.styleTransfer.3dAnimation",prompt:"Pixar\u2011style 3D render, oversized eyes, subtle subsurface scattering, cinematic lighting"},{id:"ukiyoe-woodblock",labelKey:"ly.img.ai.styleTransfer.ukiyoe",prompt:"ukiyo\u2011e woodblock print, Edo\u2011period style, visible washi texture, limited color ink"},{id:"surreal-dreamscape",labelKey:"ly.img.ai.styleTransfer.surreal",prompt:"surreal dreamscape, floating objects, impossible architecture, vivid clouds"},{id:"steampunk-victorian",labelKey:"ly.img.ai.styleTransfer.steampunk",prompt:"Victorian steampunk world, ornate brass gears, leather attire, atmospheric fog"},{id:"nightstreet-photo-bokeh",labelKey:"ly.img.ai.styleTransfer.nightBokeh",prompt:"night\u2011time street shot, large aperture bokeh lights, candid urban mood"},{id:"comicbook-pop-art",labelKey:"ly.img.ai.styleTransfer.popArt",prompt:"classic comic\u2011book panel, halftone shading, exaggerated action lines, CMYK pop colors"}];function to(e){return eo.map(t=>t.id==="none"?e.includeNone?{id:t.id,label:ze(e.cesdk,t.labelKey,t.labelKey),prompt:t.prompt,thumbUri:`${e.baseURL}thumbnails/None.svg`}:void 0:{id:t.id,label:ze(e.cesdk,t.labelKey,t.labelKey),prompt:t.prompt,thumbUri:`${e.baseURL}thumbnails/${t.id}.jpeg`}).filter(Hn)}var ro=e=>{let t=e.styles.map(a=>({...a,meta:{prompt:a.prompt}})),r=e.cesdk.engine.asset.findAllSources(),i=`${e.providerId}/styles`;for(;r.includes(i);)i+=`-${Math.random().toString(36).substring(2,5)}`;let n=new qt(i,t),o=e.styles[0];return n.setAssetActive(o.id),n},io=(e,t)=>{t.cesdk.engine.asset.addSource(e),t.cesdk.ui.addAssetLibraryEntry({id:e.id,sourceIds:[e.id],gridItemHeight:"square",gridBackgroundType:"cover",cardLabel:({label:r})=>r,cardLabelPosition:()=>"below"})},no=Wn;var oo="ly.img.ai";function k(e){return`${oo}.${e}`}function y(e,t,r){let i=`${t}.iconSetAdded`;e.ui.experimental.hasGlobalStateValue(i)||(e.ui.addIconSet(t,r),e.ui.experimental.setGlobalStateValue(i,!0))}function Qe(e,t){let r={...e};if(!t)return r;for(let[i,n]of Object.entries(t))n===!1||n===null||n===void 0?delete r[i]:n===!0?i in e||(r[i]=!0):r[i]=n;return r}var ce="@imgly/plugin-ai-generation",Hl=`
1
+ var qt=class{constructor(e,t=[],r){this.id=e,this.translateLabel=r?.translateLabel,this.assets=t.map(i=>{if(typeof i.label=="string"&&!(i.label&&typeof i.label=="object")){let n=i;return{id:n.id,label:{en:n.label},meta:n.thumbUri?{...n.meta??{},thumbUri:n.thumbUri}:n.meta}}return i}),this.activeAssetIds=new Set,this.assets.length>0&&this.activeAssetIds.add(this.assets[0].id)}async findAssets(e){let{page:t,perPage:r,locale:i="en",sortActiveFirst:n,query:o,tags:a,groups:s,excludeGroups:u,sortingOrder:d,sortKey:l}=e,c=[...this.assets];if(s&&s.length>0&&(c=c.filter(p=>p.groups&&s.some(f=>p.groups?.includes(f)))),u&&u.length>0&&(c=c.filter(p=>!p.groups||!u.some(f=>p.groups?.includes(f)))),o){let p=o.toLowerCase();c=c.filter(f=>{let h=f.label?.[i]?.toLowerCase(),I=f.tags?.[i]||[];return h&&h.includes(p)||I.some(Ht=>Ht.toLowerCase().includes(p))})}if(a&&a.length>0){let p=Array.isArray(a)?a:[a];c=c.filter(f=>{let h=f.tags?.[i]||[];return p.some(I=>h.includes(I))})}n&&c.sort((p,f)=>{let h=this.activeAssetIds.has(p.id),I=this.activeAssetIds.has(f.id);return h&&!I?-1:!h&&I?1:0}),l&&l!=="id"?c.sort((p,f)=>{let h=p.meta?.[l],I=f.meta?.[l];return h===void 0?1:I===void 0?-1:typeof h=="string"&&typeof I=="string"?d==="Descending"?I.localeCompare(h):h.localeCompare(I):typeof h=="number"&&typeof I=="number"?d==="Descending"?I-h:h-I:0}):l==="id"&&c.sort((p,f)=>d==="Descending"?f.id.localeCompare(p.id):p.id.localeCompare(f.id));let w=c.length,x=t*r,j=x+r,S=c.slice(x,j).map(p=>{let f=p.label?.[i]||"",h=this.translateLabel?this.translateLabel(p.id,f,i):f;return{id:p.id,groups:p.groups,meta:p.meta,payload:p.payload,locale:i,label:h,tags:p.tags?.[i],active:this.activeAssetIds.has(p.id)}}),re=j<w?t+1:void 0;return{assets:S,currentPage:t,nextPage:re,total:w}}updateLabel(e,t,r){this.assets.forEach(i=>{i.id===e&&(i.label=i.label||{},i.label[r]=t)})}getAssetSelectValue(e){let t=this.assets.find(({id:r})=>r===e);if(t){let r=this.translateLabel?this.translateLabel(t.id,t.label?.en||"",""):t.label?.en||"";return{id:t.id,label:r,thumbUri:t.meta?.thumbUri}}}getActiveSelectValue(){let e=this.getActiveAssetIds();if(e.length>0){let t=this.assets.find(({id:r})=>r===e[0]);if(t){let r=this.translateLabel?this.translateLabel(t.id,t.label?.en||"",""):t.label?.en||"";return{id:t.id,label:r,thumbUri:t.meta?.thumbUri}}}}getTranslatedLabel(e){let t=this.assets.find(({id:r})=>r===e);if(t)return this.translateLabel?this.translateLabel(t.id,t.label?.en||"",""):t.label?.en||""}getAsset(e){return this.assets.find(t=>t.id===e)}setAssetActive(e){this.activeAssetIds.add(e)}getActiveAssetIds(){return Array.from(this.activeAssetIds)}setAssetsActive(e){e.forEach(t=>this.activeAssetIds.add(t))}setAssetInactive(e){this.activeAssetIds.delete(e)}clearActiveAssets(){this.activeAssetIds.clear()}isAssetActive(e){return this.activeAssetIds.has(e)}addAsset(e){let t=this.assets.findIndex(r=>r.id===e.id);t>=0?this.assets[t]=e:this.assets.push(e)}removeAsset(e){let t=this.assets.findIndex(r=>r.id===e);t!==-1&&(this.assets.splice(t,1),this.activeAssetIds.delete(e))}async getGroups(){let e=new Set;return this.assets.forEach(t=>{t.groups&&t.groups.forEach(r=>e.add(r))}),Array.from(e)}getSupportedMimeTypes(){return["image/jpeg","image/png","image/svg+xml","image/webp","video/mp4","audio/mpeg"]}};var Kt=typeof global=="object"&&global&&global.Object===Object&&global,Ue=Kt,Qt=typeof self=="object"&&self&&self.Object===Object&&self,Zt=Ue||Qt||Function("return this")(),C=Zt,Yt=C.Symbol,L=Yt,Be=Object.prototype,Wt=Be.hasOwnProperty,Jt=Be.toString,G=L?L.toStringTag:void 0;function Xt(e){var t=Wt.call(e,G),r=e[G];try{e[G]=void 0;var i=!0}catch{}var n=Jt.call(e);return i&&(t?e[G]=r:delete e[G]),n}var er=Xt,tr=Object.prototype,rr=tr.toString;function ir(e){return rr.call(e)}var nr=ir,or="[object Null]",ar="[object Undefined]",Ee=L?L.toStringTag:void 0;function sr(e){return e==null?e===void 0?ar:or:Ee&&Ee in Object(e)?er(e):nr(e)}var Q=sr;function lr(e){return e!=null&&typeof e=="object"}var be=lr,Ml=Array.isArray;function ur(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ge=ur,dr="[object AsyncFunction]",cr="[object Function]",pr="[object GeneratorFunction]",gr="[object Proxy]";function mr(e){if(!Ge(e))return!1;var t=Q(e);return t==cr||t==pr||t==dr||t==gr}var fr=mr,hr=C["__core-js_shared__"],ue=hr,Pe=function(){var e=/[^.]+$/.exec(ue&&ue.keys&&ue.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function yr(e){return!!Pe&&Pe in e}var br=yr,vr=Function.prototype,wr=vr.toString;function xr(e){if(e!=null){try{return wr.call(e)}catch{}try{return e+""}catch{}}return""}var M=xr,Ir=/[\\^$.*+?()[\]{}|]/g,kr=/^\[object .+?Constructor\]$/,Sr=Function.prototype,Ar=Object.prototype,Cr=Sr.toString,Er=Ar.hasOwnProperty,Pr=RegExp("^"+Cr.call(Er).replace(Ir,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Mr(e){if(!Ge(e)||br(e))return!1;var t=fr(e)?Pr:kr;return t.test(M(e))}var Tr=Mr;function jr(e,t){return e?.[t]}var _r=jr;function Lr(e,t){var r=_r(e,t);return Tr(r)?r:void 0}var V=Lr,Vr=V(C,"WeakMap"),pe=Vr;function $r(e,t){return e===t||e!==e&&t!==t}var Dr=$r,Or=9007199254740991;function Rr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Or}var Fr=Rr,Tl=Object.prototype,Nr="[object Arguments]";function zr(e){return be(e)&&Q(e)==Nr}var Me=zr,He=Object.prototype,Ur=He.hasOwnProperty,Br=He.propertyIsEnumerable,jl=Me(function(){return arguments}())?Me:function(e){return be(e)&&Ur.call(e,"callee")&&!Br.call(e,"callee")},qe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Te=qe&&typeof module=="object"&&module&&!module.nodeType&&module,Gr=Te&&Te.exports===qe,je=Gr?C.Buffer:void 0,_l=je?je.isBuffer:void 0,Hr="[object Arguments]",qr="[object Array]",Kr="[object Boolean]",Qr="[object Date]",Zr="[object Error]",Yr="[object Function]",Wr="[object Map]",Jr="[object Number]",Xr="[object Object]",ei="[object RegExp]",ti="[object Set]",ri="[object String]",ii="[object WeakMap]",ni="[object ArrayBuffer]",oi="[object DataView]",ai="[object Float32Array]",si="[object Float64Array]",li="[object Int8Array]",ui="[object Int16Array]",di="[object Int32Array]",ci="[object Uint8Array]",pi="[object Uint8ClampedArray]",gi="[object Uint16Array]",mi="[object Uint32Array]",g={};g[ai]=g[si]=g[li]=g[ui]=g[di]=g[ci]=g[pi]=g[gi]=g[mi]=!0;g[Hr]=g[qr]=g[ni]=g[Kr]=g[oi]=g[Qr]=g[Zr]=g[Yr]=g[Wr]=g[Jr]=g[Xr]=g[ei]=g[ti]=g[ri]=g[ii]=!1;function fi(e){return be(e)&&Fr(e.length)&&!!g[Q(e)]}var hi=fi;function yi(e){return function(t){return e(t)}}var bi=yi,Ke=typeof exports=="object"&&exports&&!exports.nodeType&&exports,H=Ke&&typeof module=="object"&&module&&!module.nodeType&&module,vi=H&&H.exports===Ke,de=vi&&Ue.process,wi=function(){try{var e=H&&H.require&&H.require("util").types;return e||de&&de.binding&&de.binding("util")}catch{}}(),_e=wi,Le=_e&&_e.isTypedArray,Ll=Le?bi(Le):hi,xi=Object.prototype,Vl=xi.hasOwnProperty;function Ii(e,t){return function(r){return e(t(r))}}var ki=Ii,$l=ki(Object.keys,Object),Si=Object.prototype,Dl=Si.hasOwnProperty,Ai=V(Object,"create"),q=Ai;function Ci(){this.__data__=q?q(null):{},this.size=0}var Ei=Ci;function Pi(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Mi=Pi,Ti="__lodash_hash_undefined__",ji=Object.prototype,_i=ji.hasOwnProperty;function Li(e){var t=this.__data__;if(q){var r=t[e];return r===Ti?void 0:r}return _i.call(t,e)?t[e]:void 0}var Vi=Li,$i=Object.prototype,Di=$i.hasOwnProperty;function Oi(e){var t=this.__data__;return q?t[e]!==void 0:Di.call(t,e)}var Ri=Oi,Fi="__lodash_hash_undefined__";function Ni(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=q&&t===void 0?Fi:t,this}var zi=Ni;function $(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}$.prototype.clear=Ei;$.prototype.delete=Mi;$.prototype.get=Vi;$.prototype.has=Ri;$.prototype.set=zi;var Ve=$;function Ui(){this.__data__=[],this.size=0}var Bi=Ui;function Gi(e,t){for(var r=e.length;r--;)if(Dr(e[r][0],t))return r;return-1}var ie=Gi,Hi=Array.prototype,qi=Hi.splice;function Ki(e){var t=this.__data__,r=ie(t,e);if(r<0)return!1;var i=t.length-1;return r==i?t.pop():qi.call(t,r,1),--this.size,!0}var Qi=Ki;function Zi(e){var t=this.__data__,r=ie(t,e);return r<0?void 0:t[r][1]}var Yi=Zi;function Wi(e){return ie(this.__data__,e)>-1}var Ji=Wi;function Xi(e,t){var r=this.__data__,i=ie(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}var en=Xi;function D(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}D.prototype.clear=Bi;D.prototype.delete=Qi;D.prototype.get=Yi;D.prototype.has=Ji;D.prototype.set=en;var ne=D,tn=V(C,"Map"),K=tn;function rn(){this.size=0,this.__data__={hash:new Ve,map:new(K||ne),string:new Ve}}var nn=rn;function on(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var an=on;function sn(e,t){var r=e.__data__;return an(t)?r[typeof t=="string"?"string":"hash"]:r.map}var oe=sn;function ln(e){var t=oe(this,e).delete(e);return this.size-=t?1:0,t}var un=ln;function dn(e){return oe(this,e).get(e)}var cn=dn;function pn(e){return oe(this,e).has(e)}var gn=pn;function mn(e,t){var r=oe(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}var fn=mn;function O(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}O.prototype.clear=nn;O.prototype.delete=un;O.prototype.get=cn;O.prototype.has=gn;O.prototype.set=fn;var Qe=O;function hn(){this.__data__=new ne,this.size=0}var yn=hn;function bn(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var vn=bn;function wn(e){return this.__data__.get(e)}var xn=wn;function In(e){return this.__data__.has(e)}var kn=In,Sn=200;function An(e,t){var r=this.__data__;if(r instanceof ne){var i=r.__data__;if(!K||i.length<Sn-1)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new Qe(i)}return r.set(e,t),this.size=r.size,this}var Cn=An;function Z(e){var t=this.__data__=new ne(e);this.size=t.size}Z.prototype.clear=yn;Z.prototype.delete=vn;Z.prototype.get=xn;Z.prototype.has=kn;Z.prototype.set=Cn;var En=Object.prototype,Ol=En.propertyIsEnumerable,Pn=V(C,"DataView"),ge=Pn,Mn=V(C,"Promise"),me=Mn,Tn=V(C,"Set"),fe=Tn,$e="[object Map]",jn="[object Object]",De="[object Promise]",Oe="[object Set]",Re="[object WeakMap]",Fe="[object DataView]",_n=M(ge),Ln=M(K),Vn=M(me),$n=M(fe),Dn=M(pe),_=Q;(ge&&_(new ge(new ArrayBuffer(1)))!=Fe||K&&_(new K)!=$e||me&&_(me.resolve())!=De||fe&&_(new fe)!=Oe||pe&&_(new pe)!=Re)&&(_=function(e){var t=Q(e),r=t==jn?e.constructor:void 0,i=r?M(r):"";if(i)switch(i){case _n:return Fe;case Ln:return $e;case Vn:return De;case $n:return Oe;case Dn:return Re}return t});var Rl=C.Uint8Array,On="__lodash_hash_undefined__";function Rn(e){return this.__data__.set(e,On),this}var Fn=Rn;function Nn(e){return this.__data__.has(e)}var zn=Nn;function he(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Qe;++t<r;)this.add(e[t])}he.prototype.add=he.prototype.push=Fn;he.prototype.has=zn;var Ne=L?L.prototype:void 0,Fl=Ne?Ne.valueOf:void 0,Un=Object.prototype,Nl=Un.hasOwnProperty,Bn=Object.prototype,zl=Bn.hasOwnProperty,Ul=new RegExp(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,"i"),Bl=new RegExp(/[A-Fa-f0-9]{1}/,"g"),Gl=new RegExp(/[A-Fa-f0-9]{2}/,"g");function Gn(e){return e!==void 0}var Hn=Gn;function qn(e){return e?.version?e.version.localeCompare("1.59.0",void 0,{numeric:!0,sensitivity:"base"})>=0&&typeof e.i18n?.translate=="function":!1}function Kn(e){return typeof e?.translate=="function"}function ze(e,t,r){return e&&qn(e)&&Kn(e.i18n)?e.i18n.translate(t):r}function A(e,t){if(typeof e.i18n?.getTranslations!="function"){e.i18n.setTranslations(t);return}let r=Object.keys(t),i=e.i18n.getTranslations(r),n={};for(let o of r){let a=t[o];if(!a)continue;let s=i[o]??{},u={};for(let[d,l]of Object.entries(a))!(d in s)&&l!==void 0&&(u[d]=l);Object.keys(u).length>0&&(n[o]=u)}Object.keys(n).length>0&&e.i18n.setTranslations(n)}function Qn(e,t){let{cesdk:r}=t,i=t.propertyKey??"image_url",n=ye(e);return A(r,{en:{[`panel.${n}`]:"Select Image To Change","ly.img.ai.imageSelection.selectImage.label":"Select Image","ly.img.ai.imageSelection.error.svg":"SVG images are not supported. Please choose a different image.","ly.img.ai.imageSelection.error.invalidType":"Only images are supported. Found '{mimeType}'. Please choose a different image."}}),Zn(e,r),{[i]:(o,a)=>{let{builder:s,experimental:{global:u},payload:d}=o,l,c=o.providerConfig,w=o.config,x=c?.properties?.[a.id]??w?.properties?.[a.id];x?.default&&(typeof x.default=="function"?l=x.default({}):l=x.default);let j=l??d?.url??t.defaultUrl,S=u(`${e}.${a.id}`,j);return s.MediaPreview(a.id,{preview:{type:"image",uri:S.value},action:{label:"ly.img.ai.imageSelection.selectImage.label",onClick:()=>{r?.ui.openPanel(n,{payload:{onSelect:re=>{re.meta?.uri!=null&&S.setValue(re.meta?.uri)}}})}}}),()=>({id:a.id,type:"string",value:S.value})}}}function Zn(e,t){t?.ui.registerPanel(ye(e),({builder:r,payload:i})=>{r.Library(`${e}.library.image`,{entries:["ly.img.image"],onSelect:async n=>{let o=n?.meta?.uri;if(o==null)return;let a=await t.engine.editor.getMimeType(o);a==="image/svg+xml"?t.ui.showNotification({type:"warning",message:"ly.img.ai.imageSelection.error.svg"}):a.startsWith("image/")?(i?.onSelect(n),t?.ui.closePanel(ye(e))):t.ui.showNotification({type:"warning",message:"ly.img.ai.imageSelection.error.invalidType"})}})})}function ye(e){return`ly.img.ai.${e}.imageSelection`}var Yn=Qn;function Wn(e,t){let{cesdk:r}=t;if(r==null)return{};let i=t.propertyKey??"style",n=Xn(e);A(r,{en:{[`panel.${n}`]:"Select Style",[`${e}.${i}`]:"Style","ly.img.ai.styleTransfer.none":"None","ly.img.ai.styleTransfer.anime":"Anime","ly.img.ai.styleTransfer.cyberpunk":"Cyberpunk","ly.img.ai.styleTransfer.kodak400":"Kodak 400","ly.img.ai.styleTransfer.watercolor":"Watercolor","ly.img.ai.styleTransfer.darkFantasy":"Dark Fantasy","ly.img.ai.styleTransfer.vaporwave":"Vaporwave","ly.img.ai.styleTransfer.vectorFlat":"Vector Flat","ly.img.ai.styleTransfer.3dAnimation":"3D Animation","ly.img.ai.styleTransfer.ukiyoe":"Ukiyo\u2011e","ly.img.ai.styleTransfer.surreal":"Surreal","ly.img.ai.styleTransfer.steampunk":"Steampunk","ly.img.ai.styleTransfer.nightBokeh":"Night Bokeh","ly.img.ai.styleTransfer.popArt":"Pop Art"}});let o=to({baseURL:t.baseURL??"https://cdn.img.ly/assets/plugins/plugin-ai-image-generation-web/v1/gpt-image-1/",includeNone:!0,cesdk:r}),a=o;t.styles!=null&&(Array.isArray(t.styles)?a=t.styles:typeof t.styles=="function"&&(a=t.styles(o)));let s=ro({cesdk:r,providerId:e,styles:a}),u=s.id;return io(s,{cesdk:r}),Jn({providerId:e,cesdk:r,panelId:n,entryId:u}),{[t.propertyKeyForPrompt??"prompt"]:(d,l)=>{let c=d.state("prompt","");return d.builder.TextArea(`${l.id}`,{inputLabel:t.i18n?.prompt?.inputLabel??t.propertyKeyForPrompt??"prompt",placeholder:t.i18n?.prompt?.placeholder,...c}),()=>{let[w]=s.getActiveAssetIds(),x=s.getAsset(w);return{id:l.id,type:"string",value:x?.meta?.prompt==null?c.value:`${c.value}; ${x.meta.prompt}`}}},[i]:(d,l)=>{let{builder:c,state:w}=d;if(a.length>0){let x=w("style",a[0]);return c.Button(`${l.id}`,{inputLabel:`${e}.${l.id}`,icon:"@imgly/Appearance",isDisabled:a.length===0,trailingIcon:"@imgly/ChevronRight",label:x.value.label,labelAlignment:"left",onClick:()=>{let j={onSelect:async S=>{s.clearActiveAssets(),s.setAssetActive(S.id),x.setValue({id:S.id,label:S.label??S.id}),r.ui.closePanel(n)}};r.ui.openPanel(n,{payload:j})}}),()=>({id:l.id,type:"string",value:x.value.id})}return()=>({id:l.id,type:"string",value:"none"})}}}function Jn(e){let{providerId:t,cesdk:r,panelId:i,entryId:n}=e;r?.ui.registerPanel(i,({builder:o,payload:a})=>{a?.onSelect==null&&o.Section(`${t}.error`,{children:()=>{o.Text("error",{content:"No onSelect function provided for the style selection panel."})}}),o.Library(`${t}.library.image`,{entries:[n],onSelect:async s=>{a?.onSelect?.(s)}})})}function Xn(e){return`ly.img.ai.${e}.styleSelection`}var eo=[{id:"none",labelKey:"ly.img.ai.styleTransfer.none",prompt:""},{id:"anime-celshaded",labelKey:"ly.img.ai.styleTransfer.anime",prompt:"anime cel\u2011shaded, bright pastel palette, expressive eyes, clean line art "},{id:"cyberpunk-neon",labelKey:"ly.img.ai.styleTransfer.cyberpunk",prompt:"cyberpunk cityscape, glowing neon signage, reflective puddles, dark atmosphere"},{id:"kodak-portra-400",labelKey:"ly.img.ai.styleTransfer.kodak400",prompt:"shot on Kodak Portra 400, soft grain, golden\u2011hour warmth, 35 mm photo"},{id:"watercolor-storybook",labelKey:"ly.img.ai.styleTransfer.watercolor",prompt:"loose watercolor washes, gentle gradients, dreamy storybook feel"},{id:"dark-fantasy-realism",labelKey:"ly.img.ai.styleTransfer.darkFantasy",prompt:"dark fantasy realm, moody chiaroscuro lighting, hyper\u2011real textures"},{id:"vaporwave-retrofuturism",labelKey:"ly.img.ai.styleTransfer.vaporwave",prompt:"retro\u2011futuristic vaporwave, pastel sunset gradient, chrome text, VHS scanlines"},{id:"minimal-vector-flat",labelKey:"ly.img.ai.styleTransfer.vectorFlat",prompt:"minimalist flat vector illustration, bold geometry, two\u2011tone palette"},{id:"pixarstyle-3d-render",labelKey:"ly.img.ai.styleTransfer.3dAnimation",prompt:"Pixar\u2011style 3D render, oversized eyes, subtle subsurface scattering, cinematic lighting"},{id:"ukiyoe-woodblock",labelKey:"ly.img.ai.styleTransfer.ukiyoe",prompt:"ukiyo\u2011e woodblock print, Edo\u2011period style, visible washi texture, limited color ink"},{id:"surreal-dreamscape",labelKey:"ly.img.ai.styleTransfer.surreal",prompt:"surreal dreamscape, floating objects, impossible architecture, vivid clouds"},{id:"steampunk-victorian",labelKey:"ly.img.ai.styleTransfer.steampunk",prompt:"Victorian steampunk world, ornate brass gears, leather attire, atmospheric fog"},{id:"nightstreet-photo-bokeh",labelKey:"ly.img.ai.styleTransfer.nightBokeh",prompt:"night\u2011time street shot, large aperture bokeh lights, candid urban mood"},{id:"comicbook-pop-art",labelKey:"ly.img.ai.styleTransfer.popArt",prompt:"classic comic\u2011book panel, halftone shading, exaggerated action lines, CMYK pop colors"}];function to(e){return eo.map(t=>t.id==="none"?e.includeNone?{id:t.id,label:ze(e.cesdk,t.labelKey,t.labelKey),prompt:t.prompt,thumbUri:`${e.baseURL}thumbnails/None.svg`}:void 0:{id:t.id,label:ze(e.cesdk,t.labelKey,t.labelKey),prompt:t.prompt,thumbUri:`${e.baseURL}thumbnails/${t.id}.jpeg`}).filter(Hn)}var ro=e=>{let t=e.styles.map(a=>({...a,meta:{prompt:a.prompt}})),r=e.cesdk.engine.asset.findAllSources(),i=`${e.providerId}/styles`;for(;r.includes(i);)i+=`-${Math.random().toString(36).substring(2,5)}`;let n=new qt(i,t),o=e.styles[0];return n.setAssetActive(o.id),n},io=(e,t)=>{t.cesdk.engine.asset.addSource(e),t.cesdk.ui.addAssetLibraryEntry({id:e.id,sourceIds:[e.id],gridItemHeight:"square",gridBackgroundType:"cover",cardLabel:({label:r})=>r,cardLabelPosition:()=>"below"})},no=Wn;var oo="ly.img.ai";function k(e){return`${oo}.${e}`}function y(e,t,r){let i=`${t}.iconSetAdded`;e.ui.experimental.hasGlobalStateValue(i)||(e.ui.addIconSet(t,r),e.ui.experimental.setGlobalStateValue(i,!0))}function Ze(e,t){let r={...e};if(!t)return r;for(let[i,n]of Object.entries(t))n===!1||n===null||n===void 0?delete r[i]:n===!0?i in e||(r[i]=!0):r[i]=n;return r}var ce="@imgly/plugin-ai-generation",Hl=`
2
2
  <svg>
3
3
  <symbol
4
4
  fill="none"
@@ -125,7 +125,7 @@ var qt=class{constructor(e,t=[],r){this.id=e,this.translateLabel=r?.translateLab
125
125
  <path fill-rule="evenodd" clip-rule="evenodd" d="M7 4C5.34315 4 4 5.34315 4 7V17C4 18.6569 5.34315 20 7 20H17C18.6569 20 20 18.6569 20 17V7C20 5.34315 18.6569 4 17 4H7ZM6 7C6 6.44772 6.44772 6 7 6H17C17.5523 6 18 6.44772 18 7V17C18 17.5523 17.5523 18 17 18H7C6.44772 18 6 17.5523 6 17V7Z" fill="currentColor"/>
126
126
  </symbol>
127
127
  </svg>
128
- `;var so=typeof global=="object"&&global&&global.Object===Object&&global,ct=so,lo=typeof self=="object"&&self&&self.Object===Object&&self,uo=ct||lo||Function("return this")(),E=uo,co=E.Symbol,F=co,pt=Object.prototype,po=pt.hasOwnProperty,go=pt.toString,Y=F?F.toStringTag:void 0;function mo(e){var t=po.call(e,Y),r=e[Y];try{e[Y]=void 0;var i=!0}catch{}var n=go.call(e);return i&&(t?e[Y]=r:delete e[Y]),n}var fo=mo,ho=Object.prototype,yo=ho.toString;function bo(e){return yo.call(e)}var vo=bo,wo="[object Null]",xo="[object Undefined]",We=F?F.toStringTag:void 0;function Io(e){return e==null?e===void 0?xo:wo:We&&We in Object(e)?fo(e):vo(e)}var ee=Io;function ko(e){return e!=null&&typeof e=="object"}var Ce=ko,Zl=Array.isArray;function So(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var gt=So,Ao="[object AsyncFunction]",Co="[object Function]",Eo="[object GeneratorFunction]",Po="[object Proxy]";function Mo(e){if(!gt(e))return!1;var t=ee(e);return t==Co||t==Eo||t==Ao||t==Po}var To=Mo,jo=E["__core-js_shared__"],ve=jo,Je=function(){var e=/[^.]+$/.exec(ve&&ve.keys&&ve.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function _o(e){return!!Je&&Je in e}var Lo=_o,Vo=Function.prototype,$o=Vo.toString;function Do(e){if(e!=null){try{return $o.call(e)}catch{}try{return e+""}catch{}}return""}var T=Do,Oo=/[\\^$.*+?()[\]{}|]/g,Ro=/^\[object .+?Constructor\]$/,Fo=Function.prototype,No=Object.prototype,zo=Fo.toString,Uo=No.hasOwnProperty,Bo=RegExp("^"+zo.call(Uo).replace(Oo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Go(e){if(!gt(e)||Lo(e))return!1;var t=To(e)?Bo:Ro;return t.test(T(e))}var Ho=Go;function qo(e,t){return e?.[t]}var Ko=qo;function Zo(e,t){var r=Ko(e,t);return Ho(r)?r:void 0}var N=Zo,Qo=N(E,"WeakMap"),xe=Qo;function Yo(e,t){return e===t||e!==e&&t!==t}var Wo=Yo,Jo=9007199254740991;function Xo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Jo}var ea=Xo;var Ql=Object.prototype;var ta="[object Arguments]";function ra(e){return Ce(e)&&ee(e)==ta}var Xe=ra,mt=Object.prototype,ia=mt.hasOwnProperty,na=mt.propertyIsEnumerable,Yl=Xe(function(){return arguments}())?Xe:function(e){return Ce(e)&&ia.call(e,"callee")&&!na.call(e,"callee")};var ft=typeof exports=="object"&&exports&&!exports.nodeType&&exports,et=ft&&typeof module=="object"&&module&&!module.nodeType&&module,oa=et&&et.exports===ft,tt=oa?E.Buffer:void 0,Wl=tt?tt.isBuffer:void 0;var aa="[object Arguments]",sa="[object Array]",la="[object Boolean]",ua="[object Date]",da="[object Error]",ca="[object Function]",pa="[object Map]",ga="[object Number]",ma="[object Object]",fa="[object RegExp]",ha="[object Set]",ya="[object String]",ba="[object WeakMap]",va="[object ArrayBuffer]",wa="[object DataView]",xa="[object Float32Array]",Ia="[object Float64Array]",ka="[object Int8Array]",Sa="[object Int16Array]",Aa="[object Int32Array]",Ca="[object Uint8Array]",Ea="[object Uint8ClampedArray]",Pa="[object Uint16Array]",Ma="[object Uint32Array]",m={};m[xa]=m[Ia]=m[ka]=m[Sa]=m[Aa]=m[Ca]=m[Ea]=m[Pa]=m[Ma]=!0;m[aa]=m[sa]=m[va]=m[la]=m[wa]=m[ua]=m[da]=m[ca]=m[pa]=m[ga]=m[ma]=m[fa]=m[ha]=m[ya]=m[ba]=!1;function Ta(e){return Ce(e)&&ea(e.length)&&!!m[ee(e)]}var ja=Ta;function _a(e){return function(t){return e(t)}}var La=_a,ht=typeof exports=="object"&&exports&&!exports.nodeType&&exports,W=ht&&typeof module=="object"&&module&&!module.nodeType&&module,Va=W&&W.exports===ht,we=Va&&ct.process,$a=function(){try{var e=W&&W.require&&W.require("util").types;return e||we&&we.binding&&we.binding("util")}catch{}}(),rt=$a,it=rt&&rt.isTypedArray,Jl=it?La(it):ja;var Da=Object.prototype,Xl=Da.hasOwnProperty;function Oa(e,t){return function(r){return e(t(r))}}var Ra=Oa,eu=Ra(Object.keys,Object);var Fa=Object.prototype,tu=Fa.hasOwnProperty;var Na=N(Object,"create"),J=Na;function za(){this.__data__=J?J(null):{},this.size=0}var Ua=za;function Ba(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ga=Ba,Ha="__lodash_hash_undefined__",qa=Object.prototype,Ka=qa.hasOwnProperty;function Za(e){var t=this.__data__;if(J){var r=t[e];return r===Ha?void 0:r}return Ka.call(t,e)?t[e]:void 0}var Qa=Za,Ya=Object.prototype,Wa=Ya.hasOwnProperty;function Ja(e){var t=this.__data__;return J?t[e]!==void 0:Wa.call(t,e)}var Xa=Ja,es="__lodash_hash_undefined__";function ts(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=J&&t===void 0?es:t,this}var rs=ts;function z(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}z.prototype.clear=Ua;z.prototype.delete=Ga;z.prototype.get=Qa;z.prototype.has=Xa;z.prototype.set=rs;var nt=z;function is(){this.__data__=[],this.size=0}var ns=is;function os(e,t){for(var r=e.length;r--;)if(Wo(e[r][0],t))return r;return-1}var ae=os,as=Array.prototype,ss=as.splice;function ls(e){var t=this.__data__,r=ae(t,e);if(r<0)return!1;var i=t.length-1;return r==i?t.pop():ss.call(t,r,1),--this.size,!0}var us=ls;function ds(e){var t=this.__data__,r=ae(t,e);return r<0?void 0:t[r][1]}var cs=ds;function ps(e){return ae(this.__data__,e)>-1}var gs=ps;function ms(e,t){var r=this.__data__,i=ae(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}var fs=ms;function U(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}U.prototype.clear=ns;U.prototype.delete=us;U.prototype.get=cs;U.prototype.has=gs;U.prototype.set=fs;var se=U,hs=N(E,"Map"),X=hs;function ys(){this.size=0,this.__data__={hash:new nt,map:new(X||se),string:new nt}}var bs=ys;function vs(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var ws=vs;function xs(e,t){var r=e.__data__;return ws(t)?r[typeof t=="string"?"string":"hash"]:r.map}var le=xs;function Is(e){var t=le(this,e).delete(e);return this.size-=t?1:0,t}var ks=Is;function Ss(e){return le(this,e).get(e)}var As=Ss;function Cs(e){return le(this,e).has(e)}var Es=Cs;function Ps(e,t){var r=le(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}var Ms=Ps;function B(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}B.prototype.clear=bs;B.prototype.delete=ks;B.prototype.get=As;B.prototype.has=Es;B.prototype.set=Ms;var yt=B;function Ts(){this.__data__=new se,this.size=0}var js=Ts;function _s(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Ls=_s;function Vs(e){return this.__data__.get(e)}var $s=Vs;function Ds(e){return this.__data__.has(e)}var Os=Ds,Rs=200;function Fs(e,t){var r=this.__data__;if(r instanceof se){var i=r.__data__;if(!X||i.length<Rs-1)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new yt(i)}return r.set(e,t),this.size=r.size,this}var Ns=Fs;function te(e){var t=this.__data__=new se(e);this.size=t.size}te.prototype.clear=js;te.prototype.delete=Ls;te.prototype.get=$s;te.prototype.has=Os;te.prototype.set=Ns;var zs=Object.prototype,ru=zs.propertyIsEnumerable;var Us=N(E,"DataView"),Ie=Us,Bs=N(E,"Promise"),ke=Bs,Gs=N(E,"Set"),Se=Gs,ot="[object Map]",Hs="[object Object]",at="[object Promise]",st="[object Set]",lt="[object WeakMap]",ut="[object DataView]",qs=T(Ie),Ks=T(X),Zs=T(ke),Qs=T(Se),Ys=T(xe),R=ee;(Ie&&R(new Ie(new ArrayBuffer(1)))!=ut||X&&R(new X)!=ot||ke&&R(ke.resolve())!=at||Se&&R(new Se)!=st||xe&&R(new xe)!=lt)&&(R=function(e){var t=ee(e),r=t==Hs?e.constructor:void 0,i=r?T(r):"";if(i)switch(i){case qs:return ut;case Ks:return ot;case Zs:return at;case Qs:return st;case Ys:return lt}return t});var iu=E.Uint8Array;var Ws="__lodash_hash_undefined__";function Js(e){return this.__data__.set(e,Ws),this}var Xs=Js;function el(e){return this.__data__.has(e)}var tl=el;function Ae(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new yt;++t<r;)this.add(e[t])}Ae.prototype.add=Ae.prototype.push=Xs;Ae.prototype.has=tl;var dt=F?F.prototype:void 0,nu=dt?dt.valueOf:void 0;var rl=Object.prototype,ou=rl.hasOwnProperty;var il=Object.prototype,au=il.hasOwnProperty;var su=new RegExp(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,"i"),lu=new RegExp(/[A-Fa-f0-9]{1}/,"g"),uu=new RegExp(/[A-Fa-f0-9]{2}/,"g");async function nl(e,t){if(e.startsWith("buffer:")){let r=await t.editor.getMimeType(e),i=t.editor.getBufferLength(e),n=t.editor.getBufferData(e,0,i),o=new Uint8Array(n),a=new Blob([o],{type:r});return URL.createObjectURL(a)}else return e}async function P(e,t){let r=await nl(e,t);return new Promise((i,n)=>{let o=new Image;o.onload=()=>{i({width:o.width,height:o.height})},o.onerror=n,o.src=r})}var b={Formats:ao};var bt={openapi:"3.0.0",info:{title:"Veo 3.1 API",version:"1.0.0",description:"Google Veo 3.1 video generation via Runware"},components:{schemas:{Veo31Text2VideoInput:{title:"Veo31Text2VideoInput",type:"object",properties:{prompt:{title:"Prompt",type:"string",description:"Text description for video generation",minLength:2,maxLength:3e3,"x-imgly-builder":{component:"TextArea"}},format:{title:"Format",type:"string",enum:["1280x720","720x1280","1920x1080","1080x1920"],default:"1280x720",description:"Output resolution and aspect ratio","x-imgly-enum-labels":{"1280x720":"Landscape HD (1280\xD7720)","720x1280":"Portrait HD (720\xD71280)","1920x1080":"Landscape Full HD (1920\xD71080)","1080x1920":"Portrait Full HD (1080\xD71920)"},"x-imgly-enum-icons":{"1280x720":"@imgly/plugin/formats/ratio16by9","720x1280":"@imgly/plugin/formats/ratio9by16","1920x1080":"@imgly/plugin/formats/ratio16by9","1080x1920":"@imgly/plugin/formats/ratio9by16"}},generate_audio:{title:"Generate Audio",type:"boolean",default:!0,description:"Generate native audio with the video"}},"x-fal-order-properties":["prompt","format","generate_audio"],required:["prompt"]}}},paths:{}};function al(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.floor(Math.random()*16);return(e==="x"?t:t&3|8).toString(16)})}function sl(e){return new Promise(t=>{setTimeout(t,e)})}function vt(e,t){async function r(i,n){let o=Date.now();for(;Date.now()-o<6e5;){if(n?.aborted)throw new Error("Video generation aborted");let a=[{taskType:"getResponse",taskUUID:i}],s=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...t},body:JSON.stringify(a),signal:n});if(!s.ok){let l=await s.text();throw new Error(`Runware API polling error: ${s.status} - ${l}`)}let u=await s.json();if(u.errors!=null&&u.errors.length>0){let l=u.errors[0];throw new Error(`Runware API error: ${l.errorMessage}`)}if(u.error!=null)throw new Error(`Runware API error: ${u.error.errorMessage??u.error}`);let d=u.data;if(d!=null&&Array.isArray(d)&&d.length>0){let l=d.find(c=>c.taskType==="videoInference"&&c.taskUUID===i);if(l!=null){if(l.status==="success"&&l.videoURL)return l;if(l.status==="failed")throw new Error(l.errorMessage??"Video generation failed")}}await sl(3e3)}throw new Error("Video generation timed out")}return{videoInference:async(i,n)=>{let o=al(),a=[{taskType:"videoInference",taskUUID:o,model:i.model,deliveryMethod:"async",...i.positivePrompt!=null&&{positivePrompt:i.positivePrompt},...i.width!=null&&{width:i.width},...i.height!=null&&{height:i.height},outputType:i.outputType??"URL",outputFormat:i.outputFormat??"MP4",numberResults:i.numberResults??1,...i.negativePrompt!=null&&{negativePrompt:i.negativePrompt},...i.duration!=null&&{duration:i.duration},...i.fps!=null&&{fps:i.fps},...i.seed!=null&&{seed:i.seed},...i.frameImages!=null&&{frameImages:i.frameImages},...i.providerSettings!=null&&{providerSettings:i.providerSettings}}],s=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...t},body:JSON.stringify(a),signal:n});if(!s.ok){let w=await s.text();throw new Error(`Runware API error: ${s.status} - ${w}`)}let u=await s.json();if(u.errors!=null&&u.errors.length>0){let w=u.errors[0];throw new Error(`Runware API error: ${w.errorMessage}`)}if(u.error!=null)throw new Error(`Runware API error: ${u.error.errorMessage??u.error}`);let d=u.data;if(d==null||!Array.isArray(d))throw new Error("Invalid response from Runware API: missing data array");if(d.find(w=>w.taskType==="videoInference"&&w.taskUUID===o)==null)throw new Error("Video generation task was not acknowledged");return[await r(o,n)]}}}async function xt(e,t){if(e!=null){if(e.startsWith("blob:")){let i=await(await fetch(e)).blob();return wt(i)}if(t!=null&&e.startsWith("buffer:")){let r=await t.engine.editor.getMimeType(e),i=t.engine.editor.getBufferLength(e),n=t.engine.editor.getBufferData(e,0,i),o=new Uint8Array(n),a=new Blob([o],{type:r});return wt(a)}return e}}function wt(e){return new Promise((t,r)=>{let i=new FileReader;i.onloadend=()=>t(i.result),i.onerror=r,i.readAsDataURL(e)})}function ll(e,t){let r=e.middleware??t.middlewares??t.middleware??[],i=null,n={id:e.providerId,kind:"video",name:e.name,configuration:t,initialize:async o=>{i=vt(t.proxyUrl,e.headers),e.initialize?.(o)},input:{quickActions:{supported:Qe(e.supportedQuickActions??{},t.supportedQuickActions)},panel:{type:"schema",document:e.schema,inputReference:e.inputReference,includeHistoryLibrary:!0,orderExtensionKeyword:"x-fal-order-properties",renderCustomProperty:{...e.cesdk!=null?Ye.ImageUrl(e.providerId,{cesdk:e.cesdk}):{},...e.renderCustomProperty},getBlockInput:e.getBlockInput,userFlow:e.useFlow??"placeholder"}},output:{abortable:!0,history:t.history??"@imgly/indexedDB",middleware:r,generate:async(o,{abortSignal:a})=>{if(!i)throw new Error("Provider not initialized");let s=o;if(o.image_url!=null){let l=await xt(o.image_url,e.cesdk);s={...o,image_url:l}}let u=e.mapInput(s),d=await i.videoInference({model:e.modelId,outputType:"URL",outputFormat:"MP4",numberResults:1,...u},a);if(d!=null&&Array.isArray(d)&&d.length>0){let c=d[0]?.videoURL;if(c!=null)return{kind:"video",url:c}}throw console.error("Cannot extract generated video from response:",d),new Error("Cannot find generated video")},generationHintText:"ly.img.ai.video.generation.hint"}};return t.debug&&console.log("Created Provider:",n),n}var v=ll;var ul={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280},"1920x1080":{width:1920,height:1080},"1080x1920":{width:1080,height:1920}};function It(e){return ul[e]??{width:1280,height:720}}function kt(e){return async({cesdk:t})=>(y(t,"@imgly/plugin/formats",b.Formats),v({modelId:"google:3@2",providerId:"runware/google/veo-3.1",name:"Veo 3.1",schema:bt,inputReference:"#/components/schemas/Veo31Text2VideoInput",cesdk:t,middleware:e.middlewares??[],getBlockInput:async r=>{let i=It(r.format??"1280x720");return{video:{width:i.width,height:i.height,duration:8}}},mapInput:r=>{let i=It(r.format??"1280x720");return{positivePrompt:r.prompt,width:i.width,height:i.height,duration:8,fps:24,providerSettings:{google:{generateAudio:r.generate_audio??!0}}}}},e))}var St={openapi:"3.0.0",info:{title:"Veo 3.1 Image-to-Video API",version:"1.0.0",description:"Google Veo 3.1 image-to-video generation via Runware"},components:{schemas:{Veo31Image2VideoInput:{title:"Veo31Image2VideoInput",type:"object",properties:{image_url:{title:"Source Image",type:"string",description:"First frame image to animate","x-imgly-builder":{component:"ImageUrl"}},prompt:{title:"Prompt",type:"string",description:"Describe the motion and action for the video",minLength:2,maxLength:3e3,"x-imgly-builder":{component:"TextArea"}},format:{title:"Format",type:"string",enum:["1280x720","720x1280","1920x1080","1080x1920"],default:"1280x720",description:"Output resolution and aspect ratio","x-imgly-enum-labels":{"1280x720":"Landscape HD (1280\xD7720)","720x1280":"Portrait HD (720\xD71280)","1920x1080":"Landscape Full HD (1920\xD71080)","1080x1920":"Portrait Full HD (1080\xD71920)"},"x-imgly-enum-icons":{"1280x720":"@imgly/plugin/formats/ratio16by9","720x1280":"@imgly/plugin/formats/ratio9by16","1920x1080":"@imgly/plugin/formats/ratio16by9","1080x1920":"@imgly/plugin/formats/ratio9by16"}},generate_audio:{title:"Generate Audio",type:"boolean",default:!0,description:"Generate native audio with the video"}},"x-fal-order-properties":["image_url","prompt","format","generate_audio"],required:["image_url"]}}},paths:{}};var cl={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280},"1920x1080":{width:1920,height:1080},"1080x1920":{width:1080,height:1920}};function At(e){return cl[e]??{width:1280,height:720}}function pl(e,t){return e>=t?"1280x720":"720x1280"}function Ct(e){return async({cesdk:t})=>{let r="runware/google/veo-3.1/image2video";return y(t,"@imgly/plugin/formats",b.Formats),A(t,{en:{[`panel.${k(r)}.imageSelection`]:"Select Image To Animate",[`libraries.${k(r)}.history.label`]:"Generated From Image"}}),v({modelId:"google:3@2",providerId:r,name:"Veo 3.1",schema:St,inputReference:"#/components/schemas/Veo31Image2VideoInput",cesdk:t,middleware:e.middlewares??[],supportedQuickActions:{"ly.img.createVideo":{mapInput:i=>({image_url:i.uri,prompt:i.prompt??""})}},getBlockInput:async i=>{let{width:n,height:o}=await P(i.image_url,t.engine),a=i.format??pl(n,o),s=At(a);return{video:{width:s.width,height:s.height,duration:8}}},mapInput:i=>{let n=At(i.format??"1280x720");return{positivePrompt:i.prompt??"",width:n.width,height:n.height,frameImages:[{inputImage:i.image_url,frame:"first"}],duration:8,fps:24,providerSettings:{google:{generateAudio:i.generate_audio??!0}}}}},e)}}var Et={openapi:"3.0.0",info:{title:"Veo 3.1 Fast API",version:"1.0.0",description:"Google Veo 3.1 Fast video generation via Runware"},components:{schemas:{Veo31FastText2VideoInput:{title:"Veo31FastText2VideoInput",type:"object",properties:{prompt:{title:"Prompt",type:"string",description:"Text description for video generation",minLength:2,maxLength:3e3,"x-imgly-builder":{component:"TextArea"}},format:{title:"Format",type:"string",enum:["1280x720","720x1280","1920x1080","1080x1920"],default:"1280x720",description:"Output resolution and aspect ratio","x-imgly-enum-labels":{"1280x720":"Landscape HD (1280\xD7720)","720x1280":"Portrait HD (720\xD71280)","1920x1080":"Landscape Full HD (1920\xD71080)","1080x1920":"Portrait Full HD (1080\xD71920)"},"x-imgly-enum-icons":{"1280x720":"@imgly/plugin/formats/ratio16by9","720x1280":"@imgly/plugin/formats/ratio9by16","1920x1080":"@imgly/plugin/formats/ratio16by9","1080x1920":"@imgly/plugin/formats/ratio9by16"}},generate_audio:{title:"Generate Audio",type:"boolean",default:!0,description:"Generate native audio with the video"}},"x-fal-order-properties":["prompt","format","generate_audio"],required:["prompt"]}}},paths:{}};var ml={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280},"1920x1080":{width:1920,height:1080},"1080x1920":{width:1080,height:1920}};function Pt(e){return ml[e]??{width:1280,height:720}}function Mt(e){return async({cesdk:t})=>(y(t,"@imgly/plugin/formats",b.Formats),v({modelId:"google:3@3",providerId:"runware/google/veo-3.1-fast",name:"Veo 3.1 Fast",schema:Et,inputReference:"#/components/schemas/Veo31FastText2VideoInput",cesdk:t,middleware:e.middlewares??[],getBlockInput:async r=>{let i=Pt(r.format??"1280x720");return{video:{width:i.width,height:i.height,duration:8}}},mapInput:r=>{let i=Pt(r.format??"1280x720");return{positivePrompt:r.prompt,width:i.width,height:i.height,duration:8,fps:24,providerSettings:{google:{generateAudio:r.generate_audio??!0}}}}},e))}var Tt={openapi:"3.0.0",info:{title:"Veo 3.1 Fast Image-to-Video API",version:"1.0.0",description:"Google Veo 3.1 Fast image-to-video generation via Runware"},components:{schemas:{Veo31FastImage2VideoInput:{title:"Veo31FastImage2VideoInput",type:"object",properties:{image_url:{title:"Source Image",type:"string",description:"First frame image to animate","x-imgly-builder":{component:"ImageUrl"}},prompt:{title:"Prompt",type:"string",description:"Describe the motion and action for the video",minLength:2,maxLength:3e3,"x-imgly-builder":{component:"TextArea"}},format:{title:"Format",type:"string",enum:["1280x720","720x1280","1920x1080","1080x1920"],default:"1280x720",description:"Output resolution and aspect ratio","x-imgly-enum-labels":{"1280x720":"Landscape HD (1280\xD7720)","720x1280":"Portrait HD (720\xD71280)","1920x1080":"Landscape Full HD (1920\xD71080)","1080x1920":"Portrait Full HD (1080\xD71920)"},"x-imgly-enum-icons":{"1280x720":"@imgly/plugin/formats/ratio16by9","720x1280":"@imgly/plugin/formats/ratio9by16","1920x1080":"@imgly/plugin/formats/ratio16by9","1080x1920":"@imgly/plugin/formats/ratio9by16"}},generate_audio:{title:"Generate Audio",type:"boolean",default:!0,description:"Generate native audio with the video"}},"x-fal-order-properties":["image_url","prompt","format","generate_audio"],required:["image_url"]}}},paths:{}};var hl={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280},"1920x1080":{width:1920,height:1080},"1080x1920":{width:1080,height:1920}};function jt(e){return hl[e]??{width:1280,height:720}}function yl(e,t){return e>=t?"1280x720":"720x1280"}function _t(e){return async({cesdk:t})=>{let r="runware/google/veo-3.1-fast/image2video";return y(t,"@imgly/plugin/formats",b.Formats),A(t,{en:{[`panel.${k(r)}.imageSelection`]:"Select Image To Animate",[`libraries.${k(r)}.history.label`]:"Generated From Image"}}),v({modelId:"google:3@3",providerId:r,name:"Veo 3.1 Fast",schema:Tt,inputReference:"#/components/schemas/Veo31FastImage2VideoInput",cesdk:t,middleware:e.middlewares??[],supportedQuickActions:{"ly.img.createVideo":{mapInput:i=>({image_url:i.uri,prompt:i.prompt??""})}},getBlockInput:async i=>{let{width:n,height:o}=await P(i.image_url,t.engine),a=i.format??yl(n,o),s=jt(a);return{video:{width:s.width,height:s.height,duration:8}}},mapInput:i=>{let n=jt(i.format??"1280x720");return{positivePrompt:i.prompt??"",width:n.width,height:n.height,frameImages:[{inputImage:i.image_url,frame:"first"}],duration:8,fps:24,providerSettings:{google:{generateAudio:i.generate_audio??!0}}}}},e)}}var Lt={openapi:"3.0.0",info:{title:"Sora 2 API",version:"1.0.0",description:"OpenAI Sora 2 video generation via Runware"},components:{schemas:{Sora2Text2VideoInput:{title:"Sora2Text2VideoInput",type:"object",properties:{prompt:{title:"Prompt",type:"string",description:"Text description for video generation",minLength:1,maxLength:4e3,"x-imgly-builder":{component:"TextArea"}},format:{title:"Format",type:"string",enum:["1280x720","720x1280"],default:"1280x720",description:"Output resolution and aspect ratio","x-imgly-enum-labels":{"1280x720":"Landscape HD (1280\xD7720)","720x1280":"Portrait HD (720\xD71280)"},"x-imgly-enum-icons":{"1280x720":"@imgly/plugin/formats/ratio16by9","720x1280":"@imgly/plugin/formats/ratio9by16"}},duration:{title:"Duration",type:"string",enum:["4","8","12"],default:"8",description:"Video duration in seconds","x-imgly-enum-labels":{"4":"4 seconds","8":"8 seconds","12":"12 seconds"}}},"x-fal-order-properties":["prompt","format","duration"],required:["prompt"]}}},paths:{}};var vl={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280}};function Vt(e){return vl[e]??{width:1280,height:720}}function $t(e){return async({cesdk:t})=>(y(t,"@imgly/plugin/formats",b.Formats),v({modelId:"openai:3@1",providerId:"runware/openai/sora-2",name:"Sora 2",schema:Lt,inputReference:"#/components/schemas/Sora2Text2VideoInput",cesdk:t,middleware:e.middlewares??[],getBlockInput:async r=>{let i=Vt(r.format??"1280x720"),n=parseInt(r.duration??"8",10);return{video:{width:i.width,height:i.height,duration:n}}},mapInput:r=>{let i=Vt(r.format??"1280x720"),n=parseInt(r.duration??"8",10);return{positivePrompt:r.prompt,width:i.width,height:i.height,duration:n}}},e))}var Dt={openapi:"3.0.0",info:{title:"Sora 2 Image-to-Video API",version:"1.0.0",description:"OpenAI Sora 2 image-to-video generation via Runware"},components:{schemas:{Sora2Image2VideoInput:{title:"Sora2Image2VideoInput",type:"object",properties:{image_url:{title:"Source Image",type:"string",description:"First frame image to animate","x-imgly-builder":{component:"ImageUrl"}},prompt:{title:"Prompt",type:"string",description:"Describe the motion and action for the video",minLength:1,maxLength:4e3,"x-imgly-builder":{component:"TextArea"}},format:{title:"Format",type:"string",enum:["1280x720","720x1280"],default:"1280x720",description:"Output resolution and aspect ratio","x-imgly-enum-labels":{"1280x720":"Landscape HD (1280\xD7720)","720x1280":"Portrait HD (720\xD71280)"},"x-imgly-enum-icons":{"1280x720":"@imgly/plugin/formats/ratio16by9","720x1280":"@imgly/plugin/formats/ratio9by16"}},duration:{title:"Duration",type:"string",enum:["4","8","12"],default:"8",description:"Video duration in seconds","x-imgly-enum-labels":{"4":"4 seconds","8":"8 seconds","12":"12 seconds"}}},"x-fal-order-properties":["image_url","prompt","format","duration"],required:["image_url"]}}},paths:{}};var xl={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280}};function Ot(e){return xl[e]??{width:1280,height:720}}function Il(e,t){return e>=t?"1280x720":"720x1280"}function Rt(e){return async({cesdk:t})=>{let r="runware/openai/sora-2/image2video";return y(t,"@imgly/plugin/formats",b.Formats),A(t,{en:{[`panel.${k(r)}.imageSelection`]:"Select Image To Animate",[`libraries.${k(r)}.history.label`]:"Generated From Image"}}),v({modelId:"openai:3@1",providerId:r,name:"Sora 2",schema:Dt,inputReference:"#/components/schemas/Sora2Image2VideoInput",cesdk:t,middleware:e.middlewares??[],supportedQuickActions:{"ly.img.createVideo":{mapInput:i=>({image_url:i.uri,prompt:i.prompt??""})}},getBlockInput:async i=>{let{width:n,height:o}=await P(i.image_url,t.engine),a=i.format??Il(n,o),s=Ot(a),u=parseInt(i.duration??"8",10);return{video:{width:s.width,height:s.height,duration:u}}},mapInput:i=>{let n=Ot(i.format??"1280x720"),o=parseInt(i.duration??"8",10);return{positivePrompt:i.prompt??"",width:n.width,height:n.height,frameImages:[{inputImage:i.image_url,frame:"first"}],duration:o}}},e)}}var Ft={openapi:"3.0.0",info:{title:"Sora 2 Pro API",version:"1.0.0",description:"OpenAI Sora 2 Pro video generation via Runware"},components:{schemas:{Sora2ProText2VideoInput:{title:"Sora2ProText2VideoInput",type:"object",properties:{prompt:{title:"Prompt",type:"string",description:"Text description for video generation",minLength:1,maxLength:4e3,"x-imgly-builder":{component:"TextArea"}},format:{title:"Format",type:"string",enum:["1280x720","720x1280","1792x1024","1024x1792"],default:"1280x720",description:"Output resolution and aspect ratio","x-imgly-enum-labels":{"1280x720":"Landscape HD (1280\xD7720)","720x1280":"Portrait HD (720\xD71280)","1792x1024":"Landscape Wide (1792\xD71024)","1024x1792":"Portrait Tall (1024\xD71792)"},"x-imgly-enum-icons":{"1280x720":"@imgly/plugin/formats/ratio16by9","720x1280":"@imgly/plugin/formats/ratio9by16","1792x1024":"@imgly/plugin/formats/ratio16by9","1024x1792":"@imgly/plugin/formats/ratio9by16"}},duration:{title:"Duration",type:"string",enum:["4","8","12"],default:"8",description:"Video duration in seconds","x-imgly-enum-labels":{"4":"4 seconds","8":"8 seconds","12":"12 seconds"}}},"x-fal-order-properties":["prompt","format","duration"],required:["prompt"]}}},paths:{}};var Sl={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280},"1792x1024":{width:1792,height:1024},"1024x1792":{width:1024,height:1792}};function Nt(e){return Sl[e]??{width:1280,height:720}}function zt(e){return async({cesdk:t})=>(y(t,"@imgly/plugin/formats",b.Formats),v({modelId:"openai:3@2",providerId:"runware/openai/sora-2-pro",name:"Sora 2 Pro",schema:Ft,inputReference:"#/components/schemas/Sora2ProText2VideoInput",cesdk:t,middleware:e.middlewares??[],getBlockInput:async r=>{let i=Nt(r.format??"1280x720"),n=parseInt(r.duration??"8",10);return{video:{width:i.width,height:i.height,duration:n}}},mapInput:r=>{let i=Nt(r.format??"1280x720"),n=parseInt(r.duration??"8",10);return{positivePrompt:r.prompt,width:i.width,height:i.height,duration:n}}},e))}var Ut={openapi:"3.0.0",info:{title:"Sora 2 Pro Image-to-Video API",version:"1.0.0",description:"OpenAI Sora 2 Pro image-to-video generation via Runware"},components:{schemas:{Sora2ProImage2VideoInput:{title:"Sora2ProImage2VideoInput",type:"object",properties:{image_url:{title:"Source Image",type:"string",description:"First frame image to animate","x-imgly-builder":{component:"ImageUrl"}},prompt:{title:"Prompt",type:"string",description:"Describe the motion and action for the video",minLength:1,maxLength:4e3,"x-imgly-builder":{component:"TextArea"}},format:{title:"Format",type:"string",enum:["1280x720","720x1280","1792x1024","1024x1792"],default:"1280x720",description:"Output resolution and aspect ratio","x-imgly-enum-labels":{"1280x720":"Landscape HD (1280\xD7720)","720x1280":"Portrait HD (720\xD71280)","1792x1024":"Landscape Wide (1792\xD71024)","1024x1792":"Portrait Tall (1024\xD71792)"},"x-imgly-enum-icons":{"1280x720":"@imgly/plugin/formats/ratio16by9","720x1280":"@imgly/plugin/formats/ratio9by16","1792x1024":"@imgly/plugin/formats/ratio16by9","1024x1792":"@imgly/plugin/formats/ratio9by16"}},duration:{title:"Duration",type:"string",enum:["4","8","12"],default:"8",description:"Video duration in seconds","x-imgly-enum-labels":{"4":"4 seconds","8":"8 seconds","12":"12 seconds"}}},"x-fal-order-properties":["image_url","prompt","format","duration"],required:["image_url"]}}},paths:{}};var Cl={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280},"1792x1024":{width:1792,height:1024},"1024x1792":{width:1024,height:1792}};function Bt(e){return Cl[e]??{width:1280,height:720}}function El(e,t){return e>=t?"1280x720":"720x1280"}function Gt(e){return async({cesdk:t})=>{let r="runware/openai/sora-2-pro/image2video";return y(t,"@imgly/plugin/formats",b.Formats),A(t,{en:{[`panel.${k(r)}.imageSelection`]:"Select Image To Animate",[`libraries.${k(r)}.history.label`]:"Generated From Image"}}),v({modelId:"openai:3@2",providerId:r,name:"Sora 2 Pro",schema:Ut,inputReference:"#/components/schemas/Sora2ProImage2VideoInput",cesdk:t,middleware:e.middlewares??[],supportedQuickActions:{"ly.img.createVideo":{mapInput:i=>({image_url:i.uri,prompt:i.prompt??""})}},getBlockInput:async i=>{let{width:n,height:o}=await P(i.image_url,t.engine),a=i.format??El(n,o),s=Bt(a),u=parseInt(i.duration??"8",10);return{video:{width:s.width,height:s.height,duration:u}}},mapInput:i=>{let n=Bt(i.format??"1280x720"),o=parseInt(i.duration??"8",10);return{positivePrompt:i.prompt??"",width:n.width,height:n.height,frameImages:[{inputImage:i.image_url,frame:"first"}],duration:o}}},e)}}var Pl={Veo31:{Text2Video:kt,Image2Video:Ct},Veo31Fast:{Text2Video:Mt,Image2Video:_t},Sora2:{Text2Video:$t,Image2Video:Rt},Sora2Pro:{Text2Video:zt,Image2Video:Gt}},Ad=Pl;export{Ad as default};
128
+ `;var so=typeof global=="object"&&global&&global.Object===Object&&global,ct=so,lo=typeof self=="object"&&self&&self.Object===Object&&self,uo=ct||lo||Function("return this")(),E=uo,co=E.Symbol,F=co,pt=Object.prototype,po=pt.hasOwnProperty,go=pt.toString,Y=F?F.toStringTag:void 0;function mo(e){var t=po.call(e,Y),r=e[Y];try{e[Y]=void 0;var i=!0}catch{}var n=go.call(e);return i&&(t?e[Y]=r:delete e[Y]),n}var fo=mo,ho=Object.prototype,yo=ho.toString;function bo(e){return yo.call(e)}var vo=bo,wo="[object Null]",xo="[object Undefined]",We=F?F.toStringTag:void 0;function Io(e){return e==null?e===void 0?xo:wo:We&&We in Object(e)?fo(e):vo(e)}var ee=Io;function ko(e){return e!=null&&typeof e=="object"}var Ce=ko,Ql=Array.isArray;function So(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var gt=So,Ao="[object AsyncFunction]",Co="[object Function]",Eo="[object GeneratorFunction]",Po="[object Proxy]";function Mo(e){if(!gt(e))return!1;var t=ee(e);return t==Co||t==Eo||t==Ao||t==Po}var To=Mo,jo=E["__core-js_shared__"],ve=jo,Je=function(){var e=/[^.]+$/.exec(ve&&ve.keys&&ve.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function _o(e){return!!Je&&Je in e}var Lo=_o,Vo=Function.prototype,$o=Vo.toString;function Do(e){if(e!=null){try{return $o.call(e)}catch{}try{return e+""}catch{}}return""}var T=Do,Oo=/[\\^$.*+?()[\]{}|]/g,Ro=/^\[object .+?Constructor\]$/,Fo=Function.prototype,No=Object.prototype,zo=Fo.toString,Uo=No.hasOwnProperty,Bo=RegExp("^"+zo.call(Uo).replace(Oo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Go(e){if(!gt(e)||Lo(e))return!1;var t=To(e)?Bo:Ro;return t.test(T(e))}var Ho=Go;function qo(e,t){return e?.[t]}var Ko=qo;function Qo(e,t){var r=Ko(e,t);return Ho(r)?r:void 0}var N=Qo,Zo=N(E,"WeakMap"),xe=Zo;function Yo(e,t){return e===t||e!==e&&t!==t}var Wo=Yo,Jo=9007199254740991;function Xo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Jo}var ea=Xo;var Zl=Object.prototype;var ta="[object Arguments]";function ra(e){return Ce(e)&&ee(e)==ta}var Xe=ra,mt=Object.prototype,ia=mt.hasOwnProperty,na=mt.propertyIsEnumerable,Yl=Xe(function(){return arguments}())?Xe:function(e){return Ce(e)&&ia.call(e,"callee")&&!na.call(e,"callee")};var ft=typeof exports=="object"&&exports&&!exports.nodeType&&exports,et=ft&&typeof module=="object"&&module&&!module.nodeType&&module,oa=et&&et.exports===ft,tt=oa?E.Buffer:void 0,Wl=tt?tt.isBuffer:void 0;var aa="[object Arguments]",sa="[object Array]",la="[object Boolean]",ua="[object Date]",da="[object Error]",ca="[object Function]",pa="[object Map]",ga="[object Number]",ma="[object Object]",fa="[object RegExp]",ha="[object Set]",ya="[object String]",ba="[object WeakMap]",va="[object ArrayBuffer]",wa="[object DataView]",xa="[object Float32Array]",Ia="[object Float64Array]",ka="[object Int8Array]",Sa="[object Int16Array]",Aa="[object Int32Array]",Ca="[object Uint8Array]",Ea="[object Uint8ClampedArray]",Pa="[object Uint16Array]",Ma="[object Uint32Array]",m={};m[xa]=m[Ia]=m[ka]=m[Sa]=m[Aa]=m[Ca]=m[Ea]=m[Pa]=m[Ma]=!0;m[aa]=m[sa]=m[va]=m[la]=m[wa]=m[ua]=m[da]=m[ca]=m[pa]=m[ga]=m[ma]=m[fa]=m[ha]=m[ya]=m[ba]=!1;function Ta(e){return Ce(e)&&ea(e.length)&&!!m[ee(e)]}var ja=Ta;function _a(e){return function(t){return e(t)}}var La=_a,ht=typeof exports=="object"&&exports&&!exports.nodeType&&exports,W=ht&&typeof module=="object"&&module&&!module.nodeType&&module,Va=W&&W.exports===ht,we=Va&&ct.process,$a=function(){try{var e=W&&W.require&&W.require("util").types;return e||we&&we.binding&&we.binding("util")}catch{}}(),rt=$a,it=rt&&rt.isTypedArray,Jl=it?La(it):ja;var Da=Object.prototype,Xl=Da.hasOwnProperty;function Oa(e,t){return function(r){return e(t(r))}}var Ra=Oa,eu=Ra(Object.keys,Object);var Fa=Object.prototype,tu=Fa.hasOwnProperty;var Na=N(Object,"create"),J=Na;function za(){this.__data__=J?J(null):{},this.size=0}var Ua=za;function Ba(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ga=Ba,Ha="__lodash_hash_undefined__",qa=Object.prototype,Ka=qa.hasOwnProperty;function Qa(e){var t=this.__data__;if(J){var r=t[e];return r===Ha?void 0:r}return Ka.call(t,e)?t[e]:void 0}var Za=Qa,Ya=Object.prototype,Wa=Ya.hasOwnProperty;function Ja(e){var t=this.__data__;return J?t[e]!==void 0:Wa.call(t,e)}var Xa=Ja,es="__lodash_hash_undefined__";function ts(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=J&&t===void 0?es:t,this}var rs=ts;function z(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}z.prototype.clear=Ua;z.prototype.delete=Ga;z.prototype.get=Za;z.prototype.has=Xa;z.prototype.set=rs;var nt=z;function is(){this.__data__=[],this.size=0}var ns=is;function os(e,t){for(var r=e.length;r--;)if(Wo(e[r][0],t))return r;return-1}var ae=os,as=Array.prototype,ss=as.splice;function ls(e){var t=this.__data__,r=ae(t,e);if(r<0)return!1;var i=t.length-1;return r==i?t.pop():ss.call(t,r,1),--this.size,!0}var us=ls;function ds(e){var t=this.__data__,r=ae(t,e);return r<0?void 0:t[r][1]}var cs=ds;function ps(e){return ae(this.__data__,e)>-1}var gs=ps;function ms(e,t){var r=this.__data__,i=ae(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}var fs=ms;function U(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}U.prototype.clear=ns;U.prototype.delete=us;U.prototype.get=cs;U.prototype.has=gs;U.prototype.set=fs;var se=U,hs=N(E,"Map"),X=hs;function ys(){this.size=0,this.__data__={hash:new nt,map:new(X||se),string:new nt}}var bs=ys;function vs(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var ws=vs;function xs(e,t){var r=e.__data__;return ws(t)?r[typeof t=="string"?"string":"hash"]:r.map}var le=xs;function Is(e){var t=le(this,e).delete(e);return this.size-=t?1:0,t}var ks=Is;function Ss(e){return le(this,e).get(e)}var As=Ss;function Cs(e){return le(this,e).has(e)}var Es=Cs;function Ps(e,t){var r=le(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}var Ms=Ps;function B(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}B.prototype.clear=bs;B.prototype.delete=ks;B.prototype.get=As;B.prototype.has=Es;B.prototype.set=Ms;var yt=B;function Ts(){this.__data__=new se,this.size=0}var js=Ts;function _s(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Ls=_s;function Vs(e){return this.__data__.get(e)}var $s=Vs;function Ds(e){return this.__data__.has(e)}var Os=Ds,Rs=200;function Fs(e,t){var r=this.__data__;if(r instanceof se){var i=r.__data__;if(!X||i.length<Rs-1)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new yt(i)}return r.set(e,t),this.size=r.size,this}var Ns=Fs;function te(e){var t=this.__data__=new se(e);this.size=t.size}te.prototype.clear=js;te.prototype.delete=Ls;te.prototype.get=$s;te.prototype.has=Os;te.prototype.set=Ns;var zs=Object.prototype,ru=zs.propertyIsEnumerable;var Us=N(E,"DataView"),Ie=Us,Bs=N(E,"Promise"),ke=Bs,Gs=N(E,"Set"),Se=Gs,ot="[object Map]",Hs="[object Object]",at="[object Promise]",st="[object Set]",lt="[object WeakMap]",ut="[object DataView]",qs=T(Ie),Ks=T(X),Qs=T(ke),Zs=T(Se),Ys=T(xe),R=ee;(Ie&&R(new Ie(new ArrayBuffer(1)))!=ut||X&&R(new X)!=ot||ke&&R(ke.resolve())!=at||Se&&R(new Se)!=st||xe&&R(new xe)!=lt)&&(R=function(e){var t=ee(e),r=t==Hs?e.constructor:void 0,i=r?T(r):"";if(i)switch(i){case qs:return ut;case Ks:return ot;case Qs:return at;case Zs:return st;case Ys:return lt}return t});var iu=E.Uint8Array;var Ws="__lodash_hash_undefined__";function Js(e){return this.__data__.set(e,Ws),this}var Xs=Js;function el(e){return this.__data__.has(e)}var tl=el;function Ae(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new yt;++t<r;)this.add(e[t])}Ae.prototype.add=Ae.prototype.push=Xs;Ae.prototype.has=tl;var dt=F?F.prototype:void 0,nu=dt?dt.valueOf:void 0;var rl=Object.prototype,ou=rl.hasOwnProperty;var il=Object.prototype,au=il.hasOwnProperty;var su=new RegExp(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,"i"),lu=new RegExp(/[A-Fa-f0-9]{1}/,"g"),uu=new RegExp(/[A-Fa-f0-9]{2}/,"g");async function nl(e,t){if(e.startsWith("buffer:")){let r=await t.editor.getMimeType(e),i=t.editor.getBufferLength(e),n=t.editor.getBufferData(e,0,i),o=new Uint8Array(n),a=new Blob([o],{type:r});return URL.createObjectURL(a)}else return e}async function P(e,t){let r=await nl(e,t);return new Promise((i,n)=>{let o=new Image;o.onload=()=>{i({width:o.width,height:o.height})},o.onerror=n,o.src=r})}var b={Formats:ao};var bt={openapi:"3.0.0",info:{title:"Veo 3.1 API",version:"1.0.0",description:"Google Veo 3.1 video generation via Runware"},components:{schemas:{Veo31Text2VideoInput:{title:"Veo31Text2VideoInput",type:"object",properties:{prompt:{title:"Prompt",type:"string",description:"Text description for video generation",minLength:2,maxLength:3e3,"x-imgly-builder":{component:"TextArea"}},format:{title:"Format",type:"string",enum:["1280x720","720x1280","1920x1080","1080x1920"],default:"1280x720",description:"Output resolution and aspect ratio","x-imgly-enum-labels":{"1280x720":"Landscape HD (1280\xD7720)","720x1280":"Portrait HD (720\xD71280)","1920x1080":"Landscape Full HD (1920\xD71080)","1080x1920":"Portrait Full HD (1080\xD71920)"},"x-imgly-enum-icons":{"1280x720":"@imgly/plugin/formats/ratio16by9","720x1280":"@imgly/plugin/formats/ratio9by16","1920x1080":"@imgly/plugin/formats/ratio16by9","1080x1920":"@imgly/plugin/formats/ratio9by16"}},generate_audio:{title:"Generate Audio",type:"boolean",default:!0,description:"Generate native audio with the video"}},"x-fal-order-properties":["prompt","format","generate_audio"],required:["prompt"]}}},paths:{}};function al(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.floor(Math.random()*16);return(e==="x"?t:t&3|8).toString(16)})}function sl(e){return new Promise(t=>{setTimeout(t,e)})}function vt(e,t){async function r(i,n){let o=Date.now();for(;Date.now()-o<6e5;){if(n?.aborted)throw new Error("Video generation aborted");let a=[{taskType:"getResponse",taskUUID:i}],s=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...t},body:JSON.stringify(a),signal:n});if(!s.ok){let l=await s.text();throw new Error(`Runware API polling error: ${s.status} - ${l}`)}let u=await s.json();if(u.errors!=null&&u.errors.length>0){let l=u.errors[0];throw new Error(`Runware API error: ${l.errorMessage}`)}if(u.error!=null)throw new Error(`Runware API error: ${u.error.errorMessage??u.error}`);let d=u.data;if(d!=null&&Array.isArray(d)&&d.length>0){let l=d.find(c=>c.taskType==="videoInference"&&c.taskUUID===i);if(l!=null){if(l.status==="success"&&l.videoURL)return l;if(l.status==="failed")throw new Error(l.errorMessage??"Video generation failed")}}await sl(3e3)}throw new Error("Video generation timed out")}return{videoInference:async(i,n)=>{let o=al(),a=[{taskType:"videoInference",taskUUID:o,model:i.model,deliveryMethod:"async",...i.positivePrompt!=null&&{positivePrompt:i.positivePrompt},...i.width!=null&&{width:i.width},...i.height!=null&&{height:i.height},outputType:i.outputType??"URL",outputFormat:i.outputFormat??"MP4",numberResults:i.numberResults??1,...i.negativePrompt!=null&&{negativePrompt:i.negativePrompt},...i.duration!=null&&{duration:i.duration},...i.fps!=null&&{fps:i.fps},...i.seed!=null&&{seed:i.seed},...i.frameImages!=null&&{frameImages:i.frameImages},...i.providerSettings!=null&&{providerSettings:i.providerSettings}}],s=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...t},body:JSON.stringify(a),signal:n});if(!s.ok){let w=await s.text();throw new Error(`Runware API error: ${s.status} - ${w}`)}let u=await s.json();if(u.errors!=null&&u.errors.length>0){let w=u.errors[0];throw new Error(`Runware API error: ${w.errorMessage}`)}if(u.error!=null)throw new Error(`Runware API error: ${u.error.errorMessage??u.error}`);let d=u.data;if(d==null||!Array.isArray(d))throw new Error("Invalid response from Runware API: missing data array");if(d.find(w=>w.taskType==="videoInference"&&w.taskUUID===o)==null)throw new Error("Video generation task was not acknowledged");return[await r(o,n)]}}}async function xt(e,t){if(e!=null){if(e.startsWith("blob:")){let i=await(await fetch(e)).blob();return wt(i)}if(t!=null&&e.startsWith("buffer:")){let r=await t.engine.editor.getMimeType(e),i=t.engine.editor.getBufferLength(e),n=t.engine.editor.getBufferData(e,0,i),o=new Uint8Array(n),a=new Blob([o],{type:r});return wt(a)}return e}}function wt(e){return new Promise((t,r)=>{let i=new FileReader;i.onloadend=()=>t(i.result),i.onerror=r,i.readAsDataURL(e)})}function ll(e,t){let r=e.middleware??t.middlewares??t.middleware??[],i=null,n={id:e.providerId,kind:"video",name:e.name,configuration:t,initialize:async o=>{i=vt(t.proxyUrl,e.headers),e.initialize?.(o)},input:{quickActions:{supported:Ze(e.supportedQuickActions??{},t.supportedQuickActions)},panel:{type:"schema",document:e.schema,inputReference:e.inputReference,includeHistoryLibrary:!0,orderExtensionKeyword:"x-fal-order-properties",renderCustomProperty:{...e.cesdk!=null?Ye.ImageUrl(e.providerId,{cesdk:e.cesdk}):{},...e.renderCustomProperty},getBlockInput:e.getBlockInput,userFlow:e.useFlow??"placeholder"}},output:{abortable:!0,history:t.history??"@imgly/indexedDB",middleware:r,generate:async(o,{abortSignal:a})=>{if(!i)throw new Error("Provider not initialized");let s=o;if(o.image_url!=null){let l=await xt(o.image_url,e.cesdk);s={...o,image_url:l}}let u=e.mapInput(s),d=await i.videoInference({model:e.modelId,outputType:"URL",outputFormat:"MP4",numberResults:1,...u},a);if(d!=null&&Array.isArray(d)&&d.length>0){let c=d[0]?.videoURL;if(c!=null)return{kind:"video",url:c}}throw console.error("Cannot extract generated video from response:",d),new Error("Cannot find generated video")},generationHintText:"ly.img.ai.video.generation.hint"}};return t.debug&&console.log("Created Provider:",n),n}var v=ll;var ul={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280},"1920x1080":{width:1920,height:1080},"1080x1920":{width:1080,height:1920}};function It(e){return ul[e]??{width:1280,height:720}}function kt(e){return async({cesdk:t})=>(y(t,"@imgly/plugin/formats",b.Formats),v({modelId:"google:3@2",providerId:"runware/google/veo-3.1",name:"Veo 3.1",schema:bt,inputReference:"#/components/schemas/Veo31Text2VideoInput",cesdk:t,middleware:e.middlewares??[],getBlockInput:async r=>{let i=It(r.format??"1280x720");return{video:{width:i.width,height:i.height,duration:8}}},mapInput:r=>{let i=It(r.format??"1280x720");return{positivePrompt:r.prompt,width:i.width,height:i.height,duration:8,fps:24,providerSettings:{google:{generateAudio:r.generate_audio??!0}}}}},e))}var St={openapi:"3.0.0",info:{title:"Veo 3.1 Image-to-Video API",version:"1.0.0",description:"Google Veo 3.1 image-to-video generation via Runware"},components:{schemas:{Veo31Image2VideoInput:{title:"Veo31Image2VideoInput",type:"object",properties:{image_url:{title:"Source Image",type:"string",description:"First frame image to animate","x-imgly-builder":{component:"ImageUrl"}},prompt:{title:"Prompt",type:"string",description:"Describe the motion and action for the video",minLength:2,maxLength:3e3,"x-imgly-builder":{component:"TextArea"}},format:{title:"Format",type:"string",enum:["1280x720","720x1280","1920x1080","1080x1920"],default:"1280x720",description:"Output resolution and aspect ratio","x-imgly-enum-labels":{"1280x720":"Landscape HD (1280\xD7720)","720x1280":"Portrait HD (720\xD71280)","1920x1080":"Landscape Full HD (1920\xD71080)","1080x1920":"Portrait Full HD (1080\xD71920)"},"x-imgly-enum-icons":{"1280x720":"@imgly/plugin/formats/ratio16by9","720x1280":"@imgly/plugin/formats/ratio9by16","1920x1080":"@imgly/plugin/formats/ratio16by9","1080x1920":"@imgly/plugin/formats/ratio9by16"}},generate_audio:{title:"Generate Audio",type:"boolean",default:!0,description:"Generate native audio with the video"}},"x-fal-order-properties":["image_url","prompt","format","generate_audio"],required:["image_url"]}}},paths:{}};var cl={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280},"1920x1080":{width:1920,height:1080},"1080x1920":{width:1080,height:1920}};function At(e){return cl[e]??{width:1280,height:720}}function pl(e,t){return e>=t?"1280x720":"720x1280"}function Ct(e){return async({cesdk:t})=>{let r="runware/google/veo-3.1/image2video";return y(t,"@imgly/plugin/formats",b.Formats),A(t,{en:{[`panel.${k(r)}.imageSelection`]:"Select Image To Animate",[`libraries.${k(r)}.history.label`]:"Generated From Image"}}),v({modelId:"google:3@2",providerId:r,name:"Veo 3.1",schema:St,inputReference:"#/components/schemas/Veo31Image2VideoInput",cesdk:t,middleware:e.middlewares??[],supportedQuickActions:{"ly.img.createVideo":{mapInput:i=>({image_url:i.uri,prompt:i.prompt??""})}},getBlockInput:async i=>{let{width:n,height:o}=await P(i.image_url,t.engine),a=i.format??pl(n,o),s=At(a);return{video:{width:s.width,height:s.height,duration:8}}},mapInput:i=>{let n=At(i.format??"1280x720");return{positivePrompt:i.prompt??"",width:n.width,height:n.height,frameImages:[{inputImage:i.image_url,frame:"first"}],duration:8,fps:24,providerSettings:{google:{generateAudio:i.generate_audio??!0}}}}},e)}}var Et={openapi:"3.0.0",info:{title:"Veo 3.1 Fast API",version:"1.0.0",description:"Google Veo 3.1 Fast video generation via Runware"},components:{schemas:{Veo31FastText2VideoInput:{title:"Veo31FastText2VideoInput",type:"object",properties:{prompt:{title:"Prompt",type:"string",description:"Text description for video generation",minLength:2,maxLength:3e3,"x-imgly-builder":{component:"TextArea"}},format:{title:"Format",type:"string",enum:["1280x720","720x1280","1920x1080","1080x1920"],default:"1280x720",description:"Output resolution and aspect ratio","x-imgly-enum-labels":{"1280x720":"Landscape HD (1280\xD7720)","720x1280":"Portrait HD (720\xD71280)","1920x1080":"Landscape Full HD (1920\xD71080)","1080x1920":"Portrait Full HD (1080\xD71920)"},"x-imgly-enum-icons":{"1280x720":"@imgly/plugin/formats/ratio16by9","720x1280":"@imgly/plugin/formats/ratio9by16","1920x1080":"@imgly/plugin/formats/ratio16by9","1080x1920":"@imgly/plugin/formats/ratio9by16"}},generate_audio:{title:"Generate Audio",type:"boolean",default:!0,description:"Generate native audio with the video"}},"x-fal-order-properties":["prompt","format","generate_audio"],required:["prompt"]}}},paths:{}};var ml={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280},"1920x1080":{width:1920,height:1080},"1080x1920":{width:1080,height:1920}};function Pt(e){return ml[e]??{width:1280,height:720}}function Mt(e){return async({cesdk:t})=>(y(t,"@imgly/plugin/formats",b.Formats),v({modelId:"google:3@3",providerId:"runware/google/veo-3.1-fast",name:"Veo 3.1 Fast",schema:Et,inputReference:"#/components/schemas/Veo31FastText2VideoInput",cesdk:t,middleware:e.middlewares??[],getBlockInput:async r=>{let i=Pt(r.format??"1280x720");return{video:{width:i.width,height:i.height,duration:8}}},mapInput:r=>{let i=Pt(r.format??"1280x720");return{positivePrompt:r.prompt,width:i.width,height:i.height,duration:8,fps:24,providerSettings:{google:{generateAudio:r.generate_audio??!0}}}}},e))}var Tt={openapi:"3.0.0",info:{title:"Veo 3.1 Fast Image-to-Video API",version:"1.0.0",description:"Google Veo 3.1 Fast image-to-video generation via Runware"},components:{schemas:{Veo31FastImage2VideoInput:{title:"Veo31FastImage2VideoInput",type:"object",properties:{image_url:{title:"Source Image",type:"string",description:"First frame image to animate","x-imgly-builder":{component:"ImageUrl"}},prompt:{title:"Prompt",type:"string",description:"Describe the motion and action for the video",minLength:2,maxLength:3e3,"x-imgly-builder":{component:"TextArea"}},format:{title:"Format",type:"string",enum:["1280x720","720x1280","1920x1080","1080x1920"],default:"1280x720",description:"Output resolution and aspect ratio","x-imgly-enum-labels":{"1280x720":"Landscape HD (1280\xD7720)","720x1280":"Portrait HD (720\xD71280)","1920x1080":"Landscape Full HD (1920\xD71080)","1080x1920":"Portrait Full HD (1080\xD71920)"},"x-imgly-enum-icons":{"1280x720":"@imgly/plugin/formats/ratio16by9","720x1280":"@imgly/plugin/formats/ratio9by16","1920x1080":"@imgly/plugin/formats/ratio16by9","1080x1920":"@imgly/plugin/formats/ratio9by16"}},generate_audio:{title:"Generate Audio",type:"boolean",default:!0,description:"Generate native audio with the video"}},"x-fal-order-properties":["image_url","prompt","format","generate_audio"],required:["image_url"]}}},paths:{}};var hl={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280},"1920x1080":{width:1920,height:1080},"1080x1920":{width:1080,height:1920}};function jt(e){return hl[e]??{width:1280,height:720}}function yl(e,t){return e>=t?"1280x720":"720x1280"}function _t(e){return async({cesdk:t})=>{let r="runware/google/veo-3.1-fast/image2video";return y(t,"@imgly/plugin/formats",b.Formats),A(t,{en:{[`panel.${k(r)}.imageSelection`]:"Select Image To Animate",[`libraries.${k(r)}.history.label`]:"Generated From Image"}}),v({modelId:"google:3@3",providerId:r,name:"Veo 3.1 Fast",schema:Tt,inputReference:"#/components/schemas/Veo31FastImage2VideoInput",cesdk:t,middleware:e.middlewares??[],supportedQuickActions:{"ly.img.createVideo":{mapInput:i=>({image_url:i.uri,prompt:i.prompt??""})}},getBlockInput:async i=>{let{width:n,height:o}=await P(i.image_url,t.engine),a=i.format??yl(n,o),s=jt(a);return{video:{width:s.width,height:s.height,duration:8}}},mapInput:i=>{let n=jt(i.format??"1280x720");return{positivePrompt:i.prompt??"",width:n.width,height:n.height,frameImages:[{inputImage:i.image_url,frame:"first"}],duration:8,fps:24,providerSettings:{google:{generateAudio:i.generate_audio??!0}}}}},e)}}var Lt={openapi:"3.0.0",info:{title:"Sora 2 API",version:"1.0.0",description:"OpenAI Sora 2 video generation via Runware"},components:{schemas:{Sora2Text2VideoInput:{title:"Sora2Text2VideoInput",type:"object",properties:{prompt:{title:"Prompt",type:"string",description:"Text description for video generation",minLength:1,maxLength:4e3,"x-imgly-builder":{component:"TextArea"}},format:{title:"Format",type:"string",enum:["1280x720","720x1280"],default:"1280x720",description:"Output resolution and aspect ratio","x-imgly-enum-labels":{"1280x720":"Landscape HD (1280\xD7720)","720x1280":"Portrait HD (720\xD71280)"},"x-imgly-enum-icons":{"1280x720":"@imgly/plugin/formats/ratio16by9","720x1280":"@imgly/plugin/formats/ratio9by16"}},duration:{title:"Duration",type:"string",enum:["4","8","12"],default:"8",description:"Video duration in seconds","x-imgly-enum-labels":{"4":"4 seconds","8":"8 seconds","12":"12 seconds"}}},"x-fal-order-properties":["prompt","format","duration"],required:["prompt"]}}},paths:{}};var vl={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280}};function Vt(e){return vl[e]??{width:1280,height:720}}function $t(e){return async({cesdk:t})=>(y(t,"@imgly/plugin/formats",b.Formats),v({modelId:"openai:3@1",providerId:"runware/openai/sora-2",name:"Sora 2",schema:Lt,inputReference:"#/components/schemas/Sora2Text2VideoInput",cesdk:t,middleware:e.middlewares??[],getBlockInput:async r=>{let i=Vt(r.format??"1280x720"),n=parseInt(r.duration??"8",10);return{video:{width:i.width,height:i.height,duration:n}}},mapInput:r=>{let i=Vt(r.format??"1280x720"),n=parseInt(r.duration??"8",10);return{positivePrompt:r.prompt,width:i.width,height:i.height,duration:n}}},e))}var Dt={openapi:"3.0.0",info:{title:"Sora 2 Image-to-Video API",version:"1.0.0",description:"OpenAI Sora 2 image-to-video generation via Runware"},components:{schemas:{Sora2Image2VideoInput:{title:"Sora2Image2VideoInput",type:"object",properties:{image_url:{title:"Source Image",type:"string",description:"First frame image to animate","x-imgly-builder":{component:"ImageUrl"}},prompt:{title:"Prompt",type:"string",description:"Describe the motion and action for the video",minLength:1,maxLength:4e3,"x-imgly-builder":{component:"TextArea"}},format:{title:"Format",type:"string",enum:["1280x720","720x1280"],default:"1280x720",description:"Output resolution and aspect ratio","x-imgly-enum-labels":{"1280x720":"Landscape HD (1280\xD7720)","720x1280":"Portrait HD (720\xD71280)"},"x-imgly-enum-icons":{"1280x720":"@imgly/plugin/formats/ratio16by9","720x1280":"@imgly/plugin/formats/ratio9by16"}},duration:{title:"Duration",type:"string",enum:["4","8","12"],default:"8",description:"Video duration in seconds","x-imgly-enum-labels":{"4":"4 seconds","8":"8 seconds","12":"12 seconds"}}},"x-fal-order-properties":["image_url","prompt","format","duration"],required:["image_url"]}}},paths:{}};var xl={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280}};function Ot(e){return xl[e]??{width:1280,height:720}}function Il(e,t){return e>=t?"1280x720":"720x1280"}function Rt(e){return async({cesdk:t})=>{let r="runware/openai/sora-2/image2video";return y(t,"@imgly/plugin/formats",b.Formats),A(t,{en:{[`panel.${k(r)}.imageSelection`]:"Select Image To Animate",[`libraries.${k(r)}.history.label`]:"Generated From Image"}}),v({modelId:"openai:3@1",providerId:r,name:"Sora 2",schema:Dt,inputReference:"#/components/schemas/Sora2Image2VideoInput",cesdk:t,middleware:e.middlewares??[],supportedQuickActions:{"ly.img.createVideo":{mapInput:i=>({image_url:i.uri,prompt:i.prompt??""})}},getBlockInput:async i=>{let{width:n,height:o}=await P(i.image_url,t.engine),a=i.format??Il(n,o),s=Ot(a),u=parseInt(i.duration??"8",10);return{video:{width:s.width,height:s.height,duration:u}}},mapInput:i=>{let n=Ot(i.format??"1280x720"),o=parseInt(i.duration??"8",10);return{positivePrompt:i.prompt??"",width:n.width,height:n.height,frameImages:[{inputImage:i.image_url,frame:"first"}],duration:o}}},e)}}var Ft={openapi:"3.0.0",info:{title:"Sora 2 Pro API",version:"1.0.0",description:"OpenAI Sora 2 Pro video generation via Runware"},components:{schemas:{Sora2ProText2VideoInput:{title:"Sora2ProText2VideoInput",type:"object",properties:{prompt:{title:"Prompt",type:"string",description:"Text description for video generation",minLength:1,maxLength:4e3,"x-imgly-builder":{component:"TextArea"}},format:{title:"Format",type:"string",enum:["1280x720","720x1280","1792x1024","1024x1792"],default:"1280x720",description:"Output resolution and aspect ratio","x-imgly-enum-labels":{"1280x720":"Landscape HD (1280\xD7720)","720x1280":"Portrait HD (720\xD71280)","1792x1024":"Landscape Wide (1792\xD71024)","1024x1792":"Portrait Tall (1024\xD71792)"},"x-imgly-enum-icons":{"1280x720":"@imgly/plugin/formats/ratio16by9","720x1280":"@imgly/plugin/formats/ratio9by16","1792x1024":"@imgly/plugin/formats/ratio16by9","1024x1792":"@imgly/plugin/formats/ratio9by16"}},duration:{title:"Duration",type:"string",enum:["4","8","12"],default:"8",description:"Video duration in seconds","x-imgly-enum-labels":{"4":"4 seconds","8":"8 seconds","12":"12 seconds"}}},"x-fal-order-properties":["prompt","format","duration"],required:["prompt"]}}},paths:{}};var Sl={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280},"1792x1024":{width:1792,height:1024},"1024x1792":{width:1024,height:1792}};function Nt(e){return Sl[e]??{width:1280,height:720}}function zt(e){return async({cesdk:t})=>(y(t,"@imgly/plugin/formats",b.Formats),v({modelId:"openai:3@2",providerId:"runware/openai/sora-2-pro",name:"Sora 2 Pro",schema:Ft,inputReference:"#/components/schemas/Sora2ProText2VideoInput",cesdk:t,middleware:e.middlewares??[],getBlockInput:async r=>{let i=Nt(r.format??"1280x720"),n=parseInt(r.duration??"8",10);return{video:{width:i.width,height:i.height,duration:n}}},mapInput:r=>{let i=Nt(r.format??"1280x720"),n=parseInt(r.duration??"8",10);return{positivePrompt:r.prompt,width:i.width,height:i.height,duration:n}}},e))}var Ut={openapi:"3.0.0",info:{title:"Sora 2 Pro Image-to-Video API",version:"1.0.0",description:"OpenAI Sora 2 Pro image-to-video generation via Runware"},components:{schemas:{Sora2ProImage2VideoInput:{title:"Sora2ProImage2VideoInput",type:"object",properties:{image_url:{title:"Source Image",type:"string",description:"First frame image to animate","x-imgly-builder":{component:"ImageUrl"}},prompt:{title:"Prompt",type:"string",description:"Describe the motion and action for the video",minLength:1,maxLength:4e3,"x-imgly-builder":{component:"TextArea"}},format:{title:"Format",type:"string",enum:["1280x720","720x1280","1792x1024","1024x1792"],default:"1280x720",description:"Output resolution and aspect ratio","x-imgly-enum-labels":{"1280x720":"Landscape HD (1280\xD7720)","720x1280":"Portrait HD (720\xD71280)","1792x1024":"Landscape Wide (1792\xD71024)","1024x1792":"Portrait Tall (1024\xD71792)"},"x-imgly-enum-icons":{"1280x720":"@imgly/plugin/formats/ratio16by9","720x1280":"@imgly/plugin/formats/ratio9by16","1792x1024":"@imgly/plugin/formats/ratio16by9","1024x1792":"@imgly/plugin/formats/ratio9by16"}},duration:{title:"Duration",type:"string",enum:["4","8","12"],default:"8",description:"Video duration in seconds","x-imgly-enum-labels":{"4":"4 seconds","8":"8 seconds","12":"12 seconds"}}},"x-fal-order-properties":["image_url","prompt","format","duration"],required:["image_url"]}}},paths:{}};var Cl={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280},"1792x1024":{width:1792,height:1024},"1024x1792":{width:1024,height:1792}};function Bt(e){return Cl[e]??{width:1280,height:720}}function El(e,t){return e>=t?"1280x720":"720x1280"}function Gt(e){return async({cesdk:t})=>{let r="runware/openai/sora-2-pro/image2video";return y(t,"@imgly/plugin/formats",b.Formats),A(t,{en:{[`panel.${k(r)}.imageSelection`]:"Select Image To Animate",[`libraries.${k(r)}.history.label`]:"Generated From Image"}}),v({modelId:"openai:3@2",providerId:r,name:"Sora 2 Pro",schema:Ut,inputReference:"#/components/schemas/Sora2ProImage2VideoInput",cesdk:t,middleware:e.middlewares??[],supportedQuickActions:{"ly.img.createVideo":{mapInput:i=>({image_url:i.uri,prompt:i.prompt??""})}},getBlockInput:async i=>{let{width:n,height:o}=await P(i.image_url,t.engine),a=i.format??El(n,o),s=Bt(a),u=parseInt(i.duration??"8",10);return{video:{width:s.width,height:s.height,duration:u}}},mapInput:i=>{let n=Bt(i.format??"1280x720"),o=parseInt(i.duration??"8",10);return{positivePrompt:i.prompt??"",width:n.width,height:n.height,frameImages:[{inputImage:i.image_url,frame:"first"}],duration:o}}},e)}}var Pl={Veo31:{Text2Video:kt,Image2Video:Ct},Veo31Fast:{Text2Video:Mt,Image2Video:_t},Sora2:{Text2Video:$t,Image2Video:Rt},Sora2Pro:{Text2Video:zt,Image2Video:Gt}},Ad=Pl;export{Ad as default};
129
129
  /*! Bundled license information:
130
130
 
131
131
  lodash-es/lodash.js: