@imgly/plugin-ai-video-generation-web 0.2.14 → 0.2.16

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
- function Ht(e,t){let{cesdk:r}=t,i=t.propertyKey??"image_url",n=ce(e);return r.i18n.setTranslations({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."}}),qt(e,r),{[i]:(o,a)=>{let{builder:s,experimental:{global:u},payload:p}=o,l,d=o.providerConfig,w=o.config,x=d?.properties?.[a.id]??w?.properties?.[a.id];x?.default&&(typeof x.default=="function"?l=x.default({}):l=x.default);let T=l??p?.url??t.defaultUrl,S=u(`${e}.${a.id}`,T);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:te=>{te.meta?.uri!=null&&S.setValue(te.meta?.uri)}}})}}}),()=>({id:a.id,type:"string",value:S.value})}}}function qt(e,t){t?.ui.registerPanel(ce(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(ce(e))):t.ui.showNotification({type:"warning",message:"ly.img.ai.imageSelection.error.invalidType"})}})})}function ce(e){return`ly.img.ai.${e}.imageSelection`}var Kt=Ht,Zt=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:p,sortKey:l}=e,d=[...this.assets];if(s&&s.length>0&&(d=d.filter(c=>c.groups&&s.some(f=>c.groups?.includes(f)))),u&&u.length>0&&(d=d.filter(c=>!c.groups||!u.some(f=>c.groups?.includes(f)))),o){let c=o.toLowerCase();d=d.filter(f=>{let h=f.label?.[i]?.toLowerCase(),I=f.tags?.[i]||[];return h&&h.includes(c)||I.some(Gt=>Gt.toLowerCase().includes(c))})}if(a&&a.length>0){let c=Array.isArray(a)?a:[a];d=d.filter(f=>{let h=f.tags?.[i]||[];return c.some(I=>h.includes(I))})}n&&d.sort((c,f)=>{let h=this.activeAssetIds.has(c.id),I=this.activeAssetIds.has(f.id);return h&&!I?-1:!h&&I?1:0}),l&&l!=="id"?d.sort((c,f)=>{let h=c.meta?.[l],I=f.meta?.[l];return h===void 0?1:I===void 0?-1:typeof h=="string"&&typeof I=="string"?p==="Descending"?I.localeCompare(h):h.localeCompare(I):typeof h=="number"&&typeof I=="number"?p==="Descending"?I-h:h-I:0}):l==="id"&&d.sort((c,f)=>p==="Descending"?f.id.localeCompare(c.id):c.id.localeCompare(f.id));let w=d.length,x=t*r,T=x+r,S=d.slice(x,T).map(c=>{let f=c.label?.[i]||"",h=this.translateLabel?this.translateLabel(c.id,f,i):f;return{id:c.id,groups:c.groups,meta:c.meta,payload:c.payload,locale:i,label:h,tags:c.tags?.[i],active:this.activeAssetIds.has(c.id)}}),te=T<w?t+1:void 0;return{assets:S,currentPage:t,nextPage:te,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 Qt=typeof global=="object"&&global&&global.Object===Object&&global,ze=Qt,Yt=typeof self=="object"&&self&&self.Object===Object&&self,Wt=ze||Yt||Function("return this")(),A=Wt,Jt=A.Symbol,_=Jt,Ue=Object.prototype,Xt=Ue.hasOwnProperty,er=Ue.toString,B=_?_.toStringTag:void 0;function tr(e){var t=Xt.call(e,B),r=e[B];try{e[B]=void 0;var i=!0}catch{}var n=er.call(e);return i&&(t?e[B]=r:delete e[B]),n}var rr=tr,ir=Object.prototype,nr=ir.toString;function or(e){return nr.call(e)}var ar=or,sr="[object Null]",lr="[object Undefined]",Ce=_?_.toStringTag:void 0;function ur(e){return e==null?e===void 0?lr:sr:Ce&&Ce in Object(e)?rr(e):ar(e)}var K=ur;function dr(e){return e!=null&&typeof e=="object"}var ye=dr,El=Array.isArray;function cr(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Be=cr,pr="[object AsyncFunction]",gr="[object Function]",mr="[object GeneratorFunction]",fr="[object Proxy]";function hr(e){if(!Be(e))return!1;var t=K(e);return t==gr||t==mr||t==pr||t==fr}var yr=hr,br=A["__core-js_shared__"],le=br,Pe=function(){var e=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function vr(e){return!!Pe&&Pe in e}var wr=vr,xr=Function.prototype,Ir=xr.toString;function kr(e){if(e!=null){try{return Ir.call(e)}catch{}try{return e+""}catch{}}return""}var E=kr,Sr=/[\\^$.*+?()[\]{}|]/g,Ar=/^\[object .+?Constructor\]$/,Cr=Function.prototype,Pr=Object.prototype,Er=Cr.toString,Mr=Pr.hasOwnProperty,Tr=RegExp("^"+Er.call(Mr).replace(Sr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function jr(e){if(!Be(e)||wr(e))return!1;var t=yr(e)?Tr:Ar;return t.test(E(e))}var _r=jr;function Lr(e,t){return e?.[t]}var Vr=Lr;function Dr(e,t){var r=Vr(e,t);return _r(r)?r:void 0}var L=Dr,$r=L(A,"WeakMap"),pe=$r;function Rr(e,t){return e===t||e!==e&&t!==t}var Or=Rr,Fr=9007199254740991;function Nr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Fr}var zr=Nr,Ml=Object.prototype,Ur="[object Arguments]";function Br(e){return ye(e)&&K(e)==Ur}var Ee=Br,Ge=Object.prototype,Gr=Ge.hasOwnProperty,Hr=Ge.propertyIsEnumerable,Tl=Ee(function(){return arguments}())?Ee:function(e){return ye(e)&&Gr.call(e,"callee")&&!Hr.call(e,"callee")},He=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Me=He&&typeof module=="object"&&module&&!module.nodeType&&module,qr=Me&&Me.exports===He,Te=qr?A.Buffer:void 0,jl=Te?Te.isBuffer:void 0,Kr="[object Arguments]",Zr="[object Array]",Qr="[object Boolean]",Yr="[object Date]",Wr="[object Error]",Jr="[object Function]",Xr="[object Map]",ei="[object Number]",ti="[object Object]",ri="[object RegExp]",ii="[object Set]",ni="[object String]",oi="[object WeakMap]",ai="[object ArrayBuffer]",si="[object DataView]",li="[object Float32Array]",ui="[object Float64Array]",di="[object Int8Array]",ci="[object Int16Array]",pi="[object Int32Array]",gi="[object Uint8Array]",mi="[object Uint8ClampedArray]",fi="[object Uint16Array]",hi="[object Uint32Array]",g={};g[li]=g[ui]=g[di]=g[ci]=g[pi]=g[gi]=g[mi]=g[fi]=g[hi]=!0;g[Kr]=g[Zr]=g[ai]=g[Qr]=g[si]=g[Yr]=g[Wr]=g[Jr]=g[Xr]=g[ei]=g[ti]=g[ri]=g[ii]=g[ni]=g[oi]=!1;function yi(e){return ye(e)&&zr(e.length)&&!!g[K(e)]}var bi=yi;function vi(e){return function(t){return e(t)}}var wi=vi,qe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,G=qe&&typeof module=="object"&&module&&!module.nodeType&&module,xi=G&&G.exports===qe,ue=xi&&ze.process,Ii=function(){try{var e=G&&G.require&&G.require("util").types;return e||ue&&ue.binding&&ue.binding("util")}catch{}}(),je=Ii,_e=je&&je.isTypedArray,_l=_e?wi(_e):bi,ki=Object.prototype,Ll=ki.hasOwnProperty;function Si(e,t){return function(r){return e(t(r))}}var Ai=Si,Vl=Ai(Object.keys,Object),Ci=Object.prototype,Dl=Ci.hasOwnProperty,Pi=L(Object,"create"),H=Pi;function Ei(){this.__data__=H?H(null):{},this.size=0}var Mi=Ei;function Ti(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var ji=Ti,_i="__lodash_hash_undefined__",Li=Object.prototype,Vi=Li.hasOwnProperty;function Di(e){var t=this.__data__;if(H){var r=t[e];return r===_i?void 0:r}return Vi.call(t,e)?t[e]:void 0}var $i=Di,Ri=Object.prototype,Oi=Ri.hasOwnProperty;function Fi(e){var t=this.__data__;return H?t[e]!==void 0:Oi.call(t,e)}var Ni=Fi,zi="__lodash_hash_undefined__";function Ui(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=H&&t===void 0?zi:t,this}var Bi=Ui;function V(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])}}V.prototype.clear=Mi;V.prototype.delete=ji;V.prototype.get=$i;V.prototype.has=Ni;V.prototype.set=Bi;var Le=V;function Gi(){this.__data__=[],this.size=0}var Hi=Gi;function qi(e,t){for(var r=e.length;r--;)if(Or(e[r][0],t))return r;return-1}var re=qi,Ki=Array.prototype,Zi=Ki.splice;function Qi(e){var t=this.__data__,r=re(t,e);if(r<0)return!1;var i=t.length-1;return r==i?t.pop():Zi.call(t,r,1),--this.size,!0}var Yi=Qi;function Wi(e){var t=this.__data__,r=re(t,e);return r<0?void 0:t[r][1]}var Ji=Wi;function Xi(e){return re(this.__data__,e)>-1}var en=Xi;function tn(e,t){var r=this.__data__,i=re(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}var rn=tn;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=Hi;D.prototype.delete=Yi;D.prototype.get=Ji;D.prototype.has=en;D.prototype.set=rn;var ie=D,nn=L(A,"Map"),q=nn;function on(){this.size=0,this.__data__={hash:new Le,map:new(q||ie),string:new Le}}var an=on;function sn(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var ln=sn;function un(e,t){var r=e.__data__;return ln(t)?r[typeof t=="string"?"string":"hash"]:r.map}var ne=un;function dn(e){var t=ne(this,e).delete(e);return this.size-=t?1:0,t}var cn=dn;function pn(e){return ne(this,e).get(e)}var gn=pn;function mn(e){return ne(this,e).has(e)}var fn=mn;function hn(e,t){var r=ne(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}var yn=hn;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=an;$.prototype.delete=cn;$.prototype.get=gn;$.prototype.has=fn;$.prototype.set=yn;var Ke=$;function bn(){this.__data__=new ie,this.size=0}var vn=bn;function wn(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var xn=wn;function In(e){return this.__data__.get(e)}var kn=In;function Sn(e){return this.__data__.has(e)}var An=Sn,Cn=200;function Pn(e,t){var r=this.__data__;if(r instanceof ie){var i=r.__data__;if(!q||i.length<Cn-1)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new Ke(i)}return r.set(e,t),this.size=r.size,this}var En=Pn;function Z(e){var t=this.__data__=new ie(e);this.size=t.size}Z.prototype.clear=vn;Z.prototype.delete=xn;Z.prototype.get=kn;Z.prototype.has=An;Z.prototype.set=En;var Mn=Object.prototype,$l=Mn.propertyIsEnumerable,Tn=L(A,"DataView"),ge=Tn,jn=L(A,"Promise"),me=jn,_n=L(A,"Set"),fe=_n,Ve="[object Map]",Ln="[object Object]",De="[object Promise]",$e="[object Set]",Re="[object WeakMap]",Oe="[object DataView]",Vn=E(ge),Dn=E(q),$n=E(me),Rn=E(fe),On=E(pe),j=K;(ge&&j(new ge(new ArrayBuffer(1)))!=Oe||q&&j(new q)!=Ve||me&&j(me.resolve())!=De||fe&&j(new fe)!=$e||pe&&j(new pe)!=Re)&&(j=function(e){var t=K(e),r=t==Ln?e.constructor:void 0,i=r?E(r):"";if(i)switch(i){case Vn:return Oe;case Dn:return Ve;case $n:return De;case Rn:return $e;case On:return Re}return t});var Rl=A.Uint8Array,Fn="__lodash_hash_undefined__";function Nn(e){return this.__data__.set(e,Fn),this}var zn=Nn;function Un(e){return this.__data__.has(e)}var Bn=Un;function he(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Ke;++t<r;)this.add(e[t])}he.prototype.add=he.prototype.push=zn;he.prototype.has=Bn;var Fe=_?_.prototype:void 0,Ol=Fe?Fe.valueOf:void 0,Gn=Object.prototype,Fl=Gn.hasOwnProperty,Hn=Object.prototype,Nl=Hn.hasOwnProperty,zl=new RegExp(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,"i"),Ul=new RegExp(/[A-Fa-f0-9]{1}/,"g"),Bl=new RegExp(/[A-Fa-f0-9]{2}/,"g");function qn(e){return e!==void 0}var Kn=qn;function Zn(e){return e?.version?e.version.localeCompare("1.59.0",void 0,{numeric:!0,sensitivity:"base"})>=0&&typeof e.i18n?.translate=="function":!1}function Qn(e){return typeof e?.translate=="function"}function Ne(e,t,r){return e&&Zn(e)&&Qn(e.i18n)?e.i18n.translate(t):r}function Yn(e,t){let{cesdk:r}=t;if(r==null)return{};let i=t.propertyKey??"style",n=Jn(e);r.i18n.setTranslations({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=eo({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=to({cesdk:r,providerId:e,styles:a}),u=s.id;return ro(s,{cesdk:r}),Wn({providerId:e,cesdk:r,panelId:n,entryId:u}),{[t.propertyKeyForPrompt??"prompt"]:(p,l)=>{let d=p.state("prompt","");return p.builder.TextArea(`${l.id}`,{inputLabel:t.i18n?.prompt?.inputLabel??t.propertyKeyForPrompt??"prompt",placeholder:t.i18n?.prompt?.placeholder,...d}),()=>{let[w]=s.getActiveAssetIds(),x=s.getAsset(w);return{id:l.id,type:"string",value:x?.meta?.prompt==null?d.value:`${d.value}; ${x.meta.prompt}`}}},[i]:(p,l)=>{let{builder:d,state:w}=p;if(a.length>0){let x=w("style",a[0]);return d.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 T={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:T})}}),()=>({id:l.id,type:"string",value:x.value.id})}return()=>({id:l.id,type:"string",value:"none"})}}}function Wn(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 Jn(e){return`ly.img.ai.${e}.styleSelection`}var Xn=[{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 eo(e){return Xn.map(t=>t.id==="none"?e.includeNone?{id:t.id,label:Ne(e.cesdk,t.labelKey,t.labelKey),prompt:t.prompt,thumbUri:`${e.baseURL}/thumbnails/None.svg`}:void 0:{id:t.id,label:Ne(e.cesdk,t.labelKey,t.labelKey),prompt:t.prompt,thumbUri:`${e.baseURL}/thumbnails/${t.id}.jpeg`}).filter(Kn)}var to=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 Zt(i,t),o=e.styles[0];return n.setAssetActive(o.id),n},ro=(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"})},io=Yn;var no="ly.img.ai";function k(e){return`${no}.${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 de="@imgly/plugin-ai-generation",Gl=`
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]",Pe=L?L.toStringTag:void 0;function sr(e){return e==null?e===void 0?ar:or:Pe&&Pe 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,Ee=function(){var e=/[^.]+$/.exec(ue&&ue.keys&&ue.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function yr(e){return!!Ee&&Ee 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,Pr=Ar.hasOwnProperty,Er=RegExp("^"+Cr.call(Pr).replace(Ir,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Mr(e){if(!Ge(e)||br(e))return!1;var t=fr(e)?Er: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 Or(e,t){return e===t||e!==e&&t!==t}var Dr=Or,$r=9007199254740991;function Rr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=$r}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,Ol=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 Pi=Ci;function Ei(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Mi=Ei,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,Oi=Object.prototype,Di=Oi.hasOwnProperty;function $i(e){var t=this.__data__;return q?t[e]!==void 0:Di.call(t,e)}var Ri=$i,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 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=Pi;O.prototype.delete=Mi;O.prototype.get=Vi;O.prototype.has=Ri;O.prototype.set=zi;var Ve=O;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 $(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=nn;$.prototype.delete=un;$.prototype.get=cn;$.prototype.has=gn;$.prototype.set=fn;var Ze=$;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 Pn=Object.prototype,$l=Pn.propertyIsEnumerable,En=V(C,"DataView"),ge=En,Mn=V(C,"Promise"),me=Mn,Tn=V(C,"Set"),fe=Tn,Oe="[object Map]",jn="[object Object]",De="[object Promise]",$e="[object Set]",Re="[object WeakMap]",Fe="[object DataView]",_n=M(ge),Ln=M(K),Vn=M(me),On=M(fe),Dn=M(pe),_=Z;(ge&&_(new ge(new ArrayBuffer(1)))!=Fe||K&&_(new K)!=Oe||me&&_(me.resolve())!=De||fe&&_(new fe)!=$e||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 Oe;case Vn:return De;case On:return $e;case Dn:return Re}return t});var Rl=C.Uint8Array,$n="__lodash_hash_undefined__";function Rn(e){return this.__data__.set(e,$n),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=`
2
2
  <svg>
3
3
  <symbol
4
4
  fill="none"
@@ -16,7 +16,7 @@ function Ht(e,t){let{cesdk:r}=t,i=t.propertyKey??"image_url",n=ce(e);return r.i1
16
16
  fill="none"
17
17
  xmlns="http://www.w3.org/2000/svg"
18
18
  viewBox="0 0 24 24"
19
- id="${de}/image"
19
+ id="${ce}/image"
20
20
  >
21
21
  <path d="M3 16.5V18C3 19.6569 4.34315 21 6 21H18C19.6569 21 21 19.6569 21 18V6C21 4.34315 19.6569 3 18 3L17.999 5C18.5513 5 19 5.44772 19 6V18C19 18.5523 18.5523 19 18 19H6C5.44772 19 5 18.5523 5 18V16.5H3Z" fill="currentColor"/>
22
22
  <path d="M13.0982 0.884877C12.9734 0.568323 12.5254 0.568322 12.4005 0.884876L11.7485 2.53819C11.7104 2.63483 11.6339 2.71134 11.5372 2.74945L9.8839 3.40151C9.56735 3.52636 9.56734 3.97436 9.8839 4.09921L11.5372 4.75126C11.6339 4.78938 11.7104 4.86588 11.7485 4.96253L12.4005 6.61584C12.5254 6.93239 12.9734 6.9324 13.0982 6.61584L13.7503 4.96253C13.7884 4.86588 13.8649 4.78938 13.9616 4.75126L15.6149 4.09921C15.9314 3.97436 15.9314 3.52636 15.6149 3.40151L13.9616 2.74945C13.8649 2.71134 13.7884 2.63483 13.7503 2.53819L13.0982 0.884877Z" fill="currentColor"/>
@@ -28,7 +28,7 @@ function Ht(e,t){let{cesdk:r}=t,i=t.propertyKey??"image_url",n=ce(e);return r.i1
28
28
  fill="none"
29
29
  xmlns="http://www.w3.org/2000/svg"
30
30
  viewBox="0 0 24 24"
31
- id="${de}/video"
31
+ id="${ce}/video"
32
32
  >
33
33
  <path d="M6 3C4.34315 3 3 4.34315 3 6V18C3 19.6569 4.34315 21 6 21H18C19.6569 21 21 19.6569 21 18V16.5H19V18C19 18.5523 18.5523 19 18 19H6C5.44772 19 5 18.5523 5 18V6C5 5.44772 5.44772 5 6 5V3Z" fill="currentColor"/>
34
34
  <path d="M10.9025 0.8839C11.0273 0.567345 11.4753 0.567346 11.6002 0.883901L12.2522 2.53721C12.2904 2.63386 12.3669 2.71036 12.4635 2.74848L14.1168 3.40053C14.4334 3.52538 14.4334 3.97338 14.1168 4.09823L12.4635 4.75029C12.3669 4.7884 12.2904 4.86491 12.2522 4.96155L11.6002 6.61486C11.4753 6.93142 11.0273 6.93142 10.9025 6.61486L10.2504 4.96155C10.2123 4.86491 10.1358 4.7884 10.0392 4.75029L8.38585 4.09823C8.0693 3.97338 8.0693 3.52538 8.38585 3.40053L10.0392 2.74848C10.1358 2.71036 10.2123 2.63386 10.2504 2.53721L10.9025 0.8839Z" fill="currentColor"/>
@@ -39,7 +39,7 @@ function Ht(e,t){let{cesdk:r}=t,i=t.propertyKey??"image_url",n=ce(e);return r.i1
39
39
  fill="none"
40
40
  xmlns="http://www.w3.org/2000/svg"
41
41
  viewBox="0 0 24 24"
42
- id="${de}/audio"
42
+ id="${ce}/audio"
43
43
  >
44
44
  <path d="M6 3.80273C4.2066 4.84016 3 6.77919 3 9.00004V12.8153C3 15.931 5.39501 18.4873 8.44444 18.7436V20.9645C8.44444 22.2198 9.89427 22.9198 10.8773 22.1392L15.1265 18.7647H15.5C17.8285 18.7647 19.8472 17.4384 20.8417 15.5H18.4187C17.6889 16.2784 16.6512 16.7647 15.5 16.7647H14.9522C14.6134 16.7647 14.2846 16.8794 14.0193 17.0901L10.4444 19.929V18.2597C10.4444 17.4341 9.77513 16.7647 8.9495 16.7647C7.80494 16.7647 6.77409 16.2779 6.05276 15.5H6V15.4419C5.37798 14.7439 5 13.8237 5 12.8153V9.00004C5 7.98559 5.37764 7.05935 6 6.35422V3.80273Z" fill="currentColor"/>
45
45
  <path d="M11.6002 1.8839C11.4753 1.56735 11.0273 1.56735 10.9025 1.8839L10.2504 3.53721C10.2123 3.63386 10.1358 3.71036 10.0392 3.74848L8.38585 4.40053C8.0693 4.52538 8.0693 4.97338 8.38585 5.09823L10.0392 5.75029C10.1358 5.7884 10.2123 5.86491 10.2504 5.96155L10.9025 7.61486C11.0273 7.93142 11.4753 7.93142 11.6002 7.61486L12.2522 5.96155C12.2904 5.86491 12.3669 5.7884 12.4635 5.75029L14.1168 5.09823C14.4334 4.97338 14.4334 4.52538 14.1168 4.40053L12.4635 3.74848C12.3669 3.71036 12.2904 3.63386 12.2522 3.53721L11.6002 1.8839Z" fill="currentColor"/>
@@ -59,7 +59,7 @@ function Ht(e,t){let{cesdk:r}=t,i=t.propertyKey??"image_url",n=ce(e);return r.i1
59
59
 
60
60
  </symbol>
61
61
  </svg>
62
- `;var Qe={ImageUrl:Kt,StyleTransfer:io};var oo=`
62
+ `;var Ye={ImageUrl:Yn,StyleTransfer:no};var ao=`
63
63
  <svg>
64
64
  <symbol
65
65
  fill="none"
@@ -125,7 +125,7 @@ function Ht(e,t){let{cesdk:r}=t,i=t.propertyKey??"image_url",n=ce(e);return r.i1
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 ao=typeof global=="object"&&global&&global.Object===Object&&global,dt=ao,so=typeof self=="object"&&self&&self.Object===Object&&self,lo=dt||so||Function("return this")(),C=lo,uo=C.Symbol,O=uo,ct=Object.prototype,co=ct.hasOwnProperty,po=ct.toString,Q=O?O.toStringTag:void 0;function go(e){var t=co.call(e,Q),r=e[Q];try{e[Q]=void 0;var i=!0}catch{}var n=po.call(e);return i&&(t?e[Q]=r:delete e[Q]),n}var mo=go,fo=Object.prototype,ho=fo.toString;function yo(e){return ho.call(e)}var bo=yo,vo="[object Null]",wo="[object Undefined]",Ye=O?O.toStringTag:void 0;function xo(e){return e==null?e===void 0?wo:vo:Ye&&Ye in Object(e)?mo(e):bo(e)}var X=xo;function Io(e){return e!=null&&typeof e=="object"}var Ae=Io,Kl=Array.isArray;function ko(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var pt=ko,So="[object AsyncFunction]",Ao="[object Function]",Co="[object GeneratorFunction]",Po="[object Proxy]";function Eo(e){if(!pt(e))return!1;var t=X(e);return t==Ao||t==Co||t==So||t==Po}var Mo=Eo,To=C["__core-js_shared__"],be=To,We=function(){var e=/[^.]+$/.exec(be&&be.keys&&be.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function jo(e){return!!We&&We in e}var _o=jo,Lo=Function.prototype,Vo=Lo.toString;function Do(e){if(e!=null){try{return Vo.call(e)}catch{}try{return e+""}catch{}}return""}var M=Do,$o=/[\\^$.*+?()[\]{}|]/g,Ro=/^\[object .+?Constructor\]$/,Oo=Function.prototype,Fo=Object.prototype,No=Oo.toString,zo=Fo.hasOwnProperty,Uo=RegExp("^"+No.call(zo).replace($o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Bo(e){if(!pt(e)||_o(e))return!1;var t=Mo(e)?Uo:Ro;return t.test(M(e))}var Go=Bo;function Ho(e,t){return e?.[t]}var qo=Ho;function Ko(e,t){var r=qo(e,t);return Go(r)?r:void 0}var F=Ko,Zo=F(C,"WeakMap"),we=Zo;function Qo(e,t){return e===t||e!==e&&t!==t}var Yo=Qo,Wo=9007199254740991;function Jo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Wo}var Xo=Jo;var Zl=Object.prototype;var ea="[object Arguments]";function ta(e){return Ae(e)&&X(e)==ea}var Je=ta,gt=Object.prototype,ra=gt.hasOwnProperty,ia=gt.propertyIsEnumerable,Ql=Je(function(){return arguments}())?Je:function(e){return Ae(e)&&ra.call(e,"callee")&&!ia.call(e,"callee")};var mt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Xe=mt&&typeof module=="object"&&module&&!module.nodeType&&module,na=Xe&&Xe.exports===mt,et=na?C.Buffer:void 0,Yl=et?et.isBuffer:void 0;var oa="[object Arguments]",aa="[object Array]",sa="[object Boolean]",la="[object Date]",ua="[object Error]",da="[object Function]",ca="[object Map]",pa="[object Number]",ga="[object Object]",ma="[object RegExp]",fa="[object Set]",ha="[object String]",ya="[object WeakMap]",ba="[object ArrayBuffer]",va="[object DataView]",wa="[object Float32Array]",xa="[object Float64Array]",Ia="[object Int8Array]",ka="[object Int16Array]",Sa="[object Int32Array]",Aa="[object Uint8Array]",Ca="[object Uint8ClampedArray]",Pa="[object Uint16Array]",Ea="[object Uint32Array]",m={};m[wa]=m[xa]=m[Ia]=m[ka]=m[Sa]=m[Aa]=m[Ca]=m[Pa]=m[Ea]=!0;m[oa]=m[aa]=m[ba]=m[sa]=m[va]=m[la]=m[ua]=m[da]=m[ca]=m[pa]=m[ga]=m[ma]=m[fa]=m[ha]=m[ya]=!1;function Ma(e){return Ae(e)&&Xo(e.length)&&!!m[X(e)]}var Ta=Ma;function ja(e){return function(t){return e(t)}}var _a=ja,ft=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Y=ft&&typeof module=="object"&&module&&!module.nodeType&&module,La=Y&&Y.exports===ft,ve=La&&dt.process,Va=function(){try{var e=Y&&Y.require&&Y.require("util").types;return e||ve&&ve.binding&&ve.binding("util")}catch{}}(),tt=Va,rt=tt&&tt.isTypedArray,Wl=rt?_a(rt):Ta;var Da=Object.prototype,Jl=Da.hasOwnProperty;function $a(e,t){return function(r){return e(t(r))}}var Ra=$a,Xl=Ra(Object.keys,Object);var Oa=Object.prototype,eu=Oa.hasOwnProperty;var Fa=F(Object,"create"),W=Fa;function Na(){this.__data__=W?W(null):{},this.size=0}var za=Na;function Ua(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ba=Ua,Ga="__lodash_hash_undefined__",Ha=Object.prototype,qa=Ha.hasOwnProperty;function Ka(e){var t=this.__data__;if(W){var r=t[e];return r===Ga?void 0:r}return qa.call(t,e)?t[e]:void 0}var Za=Ka,Qa=Object.prototype,Ya=Qa.hasOwnProperty;function Wa(e){var t=this.__data__;return W?t[e]!==void 0:Ya.call(t,e)}var Ja=Wa,Xa="__lodash_hash_undefined__";function es(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=W&&t===void 0?Xa:t,this}var ts=es;function N(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])}}N.prototype.clear=za;N.prototype.delete=Ba;N.prototype.get=Za;N.prototype.has=Ja;N.prototype.set=ts;var it=N;function rs(){this.__data__=[],this.size=0}var is=rs;function ns(e,t){for(var r=e.length;r--;)if(Yo(e[r][0],t))return r;return-1}var oe=ns,os=Array.prototype,as=os.splice;function ss(e){var t=this.__data__,r=oe(t,e);if(r<0)return!1;var i=t.length-1;return r==i?t.pop():as.call(t,r,1),--this.size,!0}var ls=ss;function us(e){var t=this.__data__,r=oe(t,e);return r<0?void 0:t[r][1]}var ds=us;function cs(e){return oe(this.__data__,e)>-1}var ps=cs;function gs(e,t){var r=this.__data__,i=oe(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}var ms=gs;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=is;z.prototype.delete=ls;z.prototype.get=ds;z.prototype.has=ps;z.prototype.set=ms;var ae=z,fs=F(C,"Map"),J=fs;function hs(){this.size=0,this.__data__={hash:new it,map:new(J||ae),string:new it}}var ys=hs;function bs(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var vs=bs;function ws(e,t){var r=e.__data__;return vs(t)?r[typeof t=="string"?"string":"hash"]:r.map}var se=ws;function xs(e){var t=se(this,e).delete(e);return this.size-=t?1:0,t}var Is=xs;function ks(e){return se(this,e).get(e)}var Ss=ks;function As(e){return se(this,e).has(e)}var Cs=As;function Ps(e,t){var r=se(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}var Es=Ps;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=ys;U.prototype.delete=Is;U.prototype.get=Ss;U.prototype.has=Cs;U.prototype.set=Es;var ht=U;function Ms(){this.__data__=new ae,this.size=0}var Ts=Ms;function js(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var _s=js;function Ls(e){return this.__data__.get(e)}var Vs=Ls;function Ds(e){return this.__data__.has(e)}var $s=Ds,Rs=200;function Os(e,t){var r=this.__data__;if(r instanceof ae){var i=r.__data__;if(!J||i.length<Rs-1)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new ht(i)}return r.set(e,t),this.size=r.size,this}var Fs=Os;function ee(e){var t=this.__data__=new ae(e);this.size=t.size}ee.prototype.clear=Ts;ee.prototype.delete=_s;ee.prototype.get=Vs;ee.prototype.has=$s;ee.prototype.set=Fs;var Ns=Object.prototype,tu=Ns.propertyIsEnumerable;var zs=F(C,"DataView"),xe=zs,Us=F(C,"Promise"),Ie=Us,Bs=F(C,"Set"),ke=Bs,nt="[object Map]",Gs="[object Object]",ot="[object Promise]",at="[object Set]",st="[object WeakMap]",lt="[object DataView]",Hs=M(xe),qs=M(J),Ks=M(Ie),Zs=M(ke),Qs=M(we),R=X;(xe&&R(new xe(new ArrayBuffer(1)))!=lt||J&&R(new J)!=nt||Ie&&R(Ie.resolve())!=ot||ke&&R(new ke)!=at||we&&R(new we)!=st)&&(R=function(e){var t=X(e),r=t==Gs?e.constructor:void 0,i=r?M(r):"";if(i)switch(i){case Hs:return lt;case qs:return nt;case Ks:return ot;case Zs:return at;case Qs:return st}return t});var ru=C.Uint8Array;var Ys="__lodash_hash_undefined__";function Ws(e){return this.__data__.set(e,Ys),this}var Js=Ws;function Xs(e){return this.__data__.has(e)}var el=Xs;function Se(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new ht;++t<r;)this.add(e[t])}Se.prototype.add=Se.prototype.push=Js;Se.prototype.has=el;var ut=O?O.prototype:void 0,iu=ut?ut.valueOf:void 0;var tl=Object.prototype,nu=tl.hasOwnProperty;var rl=Object.prototype,ou=rl.hasOwnProperty;var au=new RegExp(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,"i"),su=new RegExp(/[A-Fa-f0-9]{1}/,"g"),lu=new RegExp(/[A-Fa-f0-9]{2}/,"g");async function il(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 il(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:oo};var yt={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 ol(){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 al(e){return new Promise(t=>{setTimeout(t,e)})}function bt(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 p=u.data;if(p!=null&&Array.isArray(p)&&p.length>0){let l=p.find(d=>d.taskType==="videoInference"&&d.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 al(3e3)}throw new Error("Video generation timed out")}return{videoInference:async(i,n)=>{let o=ol(),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 p=u.data;if(p==null||!Array.isArray(p))throw new Error("Invalid response from Runware API: missing data array");if(p.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 wt(e,t){if(e!=null){if(e.startsWith("blob:")){let i=await(await fetch(e)).blob();return vt(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 vt(a)}return e}}function vt(e){return new Promise((t,r)=>{let i=new FileReader;i.onloadend=()=>t(i.result),i.onerror=r,i.readAsDataURL(e)})}function sl(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=bt(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?Qe.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 wt(o.image_url,e.cesdk);s={...o,image_url:l}}let u=e.mapInput(s),p=await i.videoInference({model:e.modelId,outputType:"URL",outputFormat:"MP4",numberResults:1,...u},a);if(p!=null&&Array.isArray(p)&&p.length>0){let d=p[0]?.videoURL;if(d!=null)return{kind:"video",url:d}}throw console.error("Cannot extract generated video from response:",p),new Error("Cannot find generated video")},generationHintText:"ly.img.ai.video.generation.hint"}};return t.debug&&console.log("Created Provider:",n),n}var v=sl;var ll={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280},"1920x1080":{width:1920,height:1080},"1080x1920":{width:1080,height:1920}};function xt(e){return ll[e]??{width:1280,height:720}}function It(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:yt,inputReference:"#/components/schemas/Veo31Text2VideoInput",cesdk:t,middleware:e.middlewares??[],getBlockInput:async r=>{let i=xt(r.format??"1280x720");return{video:{width:i.width,height:i.height,duration:8}}},mapInput:r=>{let i=xt(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 kt={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 dl={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280},"1920x1080":{width:1920,height:1080},"1080x1920":{width:1080,height:1920}};function St(e){return dl[e]??{width:1280,height:720}}function cl(e,t){return e>=t?"1280x720":"720x1280"}function At(e){return async({cesdk:t})=>{let r="runware/google/veo-3.1/image2video";return y(t,"@imgly/plugin/formats",b.Formats),t.i18n.setTranslations({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:kt,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??cl(n,o),s=St(a);return{video:{width:s.width,height:s.height,duration:8}}},mapInput:i=>{let n=St(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 Ct={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 gl={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280},"1920x1080":{width:1920,height:1080},"1080x1920":{width:1080,height:1920}};function Pt(e){return gl[e]??{width:1280,height:720}}function Et(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:Ct,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 Mt={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 fl={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280},"1920x1080":{width:1920,height:1080},"1080x1920":{width:1080,height:1920}};function Tt(e){return fl[e]??{width:1280,height:720}}function hl(e,t){return e>=t?"1280x720":"720x1280"}function jt(e){return async({cesdk:t})=>{let r="runware/google/veo-3.1-fast/image2video";return y(t,"@imgly/plugin/formats",b.Formats),t.i18n.setTranslations({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:Mt,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??hl(n,o),s=Tt(a);return{video:{width:s.width,height:s.height,duration:8}}},mapInput:i=>{let n=Tt(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 _t={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 bl={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280}};function Lt(e){return bl[e]??{width:1280,height:720}}function Vt(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:_t,inputReference:"#/components/schemas/Sora2Text2VideoInput",cesdk:t,middleware:e.middlewares??[],getBlockInput:async r=>{let i=Lt(r.format??"1280x720"),n=parseInt(r.duration??"8",10);return{video:{width:i.width,height:i.height,duration:n}}},mapInput:r=>{let i=Lt(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 wl={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280}};function $t(e){return wl[e]??{width:1280,height:720}}function xl(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),t.i18n.setTranslations({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??xl(n,o),s=$t(a),u=parseInt(i.duration??"8",10);return{video:{width:s.width,height:s.height,duration:u}}},mapInput:i=>{let n=$t(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 Ot={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 kl={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280},"1792x1024":{width:1792,height:1024},"1024x1792":{width:1024,height:1792}};function Ft(e){return kl[e]??{width:1280,height:720}}function Nt(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:Ot,inputReference:"#/components/schemas/Sora2ProText2VideoInput",cesdk:t,middleware:e.middlewares??[],getBlockInput:async r=>{let i=Ft(r.format??"1280x720"),n=parseInt(r.duration??"8",10);return{video:{width:i.width,height:i.height,duration:n}}},mapInput:r=>{let i=Ft(r.format??"1280x720"),n=parseInt(r.duration??"8",10);return{positivePrompt:r.prompt,width:i.width,height:i.height,duration:n}}},e))}var zt={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 Al={"1280x720":{width:1280,height:720},"720x1280":{width:720,height:1280},"1792x1024":{width:1792,height:1024},"1024x1792":{width:1024,height:1792}};function Ut(e){return Al[e]??{width:1280,height:720}}function Cl(e,t){return e>=t?"1280x720":"720x1280"}function Bt(e){return async({cesdk:t})=>{let r="runware/openai/sora-2-pro/image2video";return y(t,"@imgly/plugin/formats",b.Formats),t.i18n.setTranslations({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:zt,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??Cl(n,o),s=Ut(a),u=parseInt(i.duration??"8",10);return{video:{width:s.width,height:s.height,duration:u}}},mapInput:i=>{let n=Ut(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:It,Image2Video:At},Veo31Fast:{Text2Video:Et,Image2Video:jt},Sora2:{Text2Video:Vt,Image2Video:Rt},Sora2Pro:{Text2Video:Nt,Image2Video:Bt}},Sd=Pl;export{Sd 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")(),P=uo,co=P.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]",Po="[object GeneratorFunction]",Eo="[object Proxy]";function Mo(e){if(!gt(e))return!1;var t=ee(e);return t==Co||t==Po||t==Ao||t==Eo}var To=Mo,jo=P["__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,Oo=Vo.toString;function Do(e){if(e!=null){try{return Oo.call(e)}catch{}try{return e+""}catch{}}return""}var T=Do,$o=/[\\^$.*+?()[\]{}|]/g,Ro=/^\[object .+?Constructor\]$/,Fo=Function.prototype,No=Object.prototype,zo=Fo.toString,Uo=No.hasOwnProperty,Bo=RegExp("^"+zo.call(Uo).replace($o,"\\$&").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(P,"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?P.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]",Pa="[object Uint8ClampedArray]",Ea="[object Uint16Array]",Ma="[object Uint32Array]",m={};m[xa]=m[Ia]=m[ka]=m[Sa]=m[Aa]=m[Ca]=m[Pa]=m[Ea]=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,Oa=function(){try{var e=W&&W.require&&W.require("util").types;return e||we&&we.binding&&we.binding("util")}catch{}}(),rt=Oa,it=rt&&rt.isTypedArray,Jl=it?La(it):ja;var Da=Object.prototype,Xl=Da.hasOwnProperty;function $a(e,t){return function(r){return e(t(r))}}var Ra=$a,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(P,"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 Ps=Cs;function Es(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=Es;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=Ps;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 Os=Vs;function Ds(e){return this.__data__.has(e)}var $s=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=Os;te.prototype.has=$s;te.prototype.set=Ns;var zs=Object.prototype,ru=zs.propertyIsEnumerable;var Us=N(P,"DataView"),Ie=Us,Bs=N(P,"Promise"),ke=Bs,Gs=N(P,"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=P.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 E(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 E(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 Pt={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 Et(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:Pt,inputReference:"#/components/schemas/Veo31FastText2VideoInput",cesdk:t,middleware:e.middlewares??[],getBlockInput:async r=>{let i=Et(r.format??"1280x720");return{video:{width:i.width,height:i.height,duration:8}}},mapInput:r=>{let i=Et(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 E(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 Ot(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 $t(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 E(i.image_url,t.engine),a=i.format??Il(n,o),s=$t(a),u=parseInt(i.duration??"8",10);return{video:{width:s.width,height:s.height,duration:u}}},mapInput:i=>{let n=$t(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 Pl(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 E(i.image_url,t.engine),a=i.format??Pl(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 El={Veo31:{Text2Video:kt,Image2Video:Ct},Veo31Fast:{Text2Video:Mt,Image2Video:_t},Sora2:{Text2Video:Ot,Image2Video:Rt},Sora2Pro:{Text2Video:zt,Image2Video:Gt}},Ad=El;export{Ad as default};
129
129
  /*! Bundled license information:
130
130
 
131
131
  lodash-es/lodash.js: