PageSourceSearch

https://www.recraft.ai/_next/static/chunks/0c1zk-bems3rx.js?dpl=35895827138-1

js recraft.ai collected 2026-09-24 08:29:21 UTC 281,189 bytes, 4 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="0547190b-1504-75fb-bde1-4cf8be78ca39")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,309121,188147,464100,426612,59192,683032,396734,959856,928563,726736,815666,16708,142568,38385,237486,722203,207784,832784,744434,578888,615290,877132,89703,22104,775417,642254,15466,588575,175792,253977,676382,204969,159868,601098,494439,586836,624675,747596,991145,983383,963788,34771,944183,25285,122572,612331,96344,430801,477972,433165,528425,520394,395904,748523,593601,756382,929760,913122,346241,126234,858811,324743,e=>{"use strict";let t="http://localhost".replace(/\/+$/,"");class a{configuration;constructor(e={}){this.configuration=e}set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:t}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t,a=""){return Object.keys(t).map(i=>(function t(a,i,r=""){let n=r+(r.length?`[${a}]`:a);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join(`&${encodeURIComponent(n)}=`);return`${encodeURIComponent(n)}=${e}`}return i instanceof Set?t(a,Array.from(i),r):i instanceof Date?`${encodeURIComponent(n)}=${encodeURIComponent(i.toISOString())}`:i instanceof Object?e(i,n):`${encodeURIComponent(n)}=${encodeURIComponent(String(i))}`})(i,t[i],a)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}let i=new a;class r{configuration;static jsonRegex=RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i");middleware;constructor(e=i){this.configuration=e,this.fetchApi=async(e,t)=>{let a,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{a=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(a=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:a?a.clone():void 0})||a);if(void 0===a)if(e instanceof Error)throw new o(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(a=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:a.clone()})||a);return a},this.middleware=e.middleware}withMiddleware(...e){let t=this.clone();return t.middleware=t.middleware.concat(...e),t}withPreMiddleware(...e){let t=e.map(e=>({pre:e}));return this.withMiddleware(...t)}withPostMiddleware(...e){let t=e.map(e=>({post:e}));return this.withMiddleware(...t)}isJsonMime(e){return!!e&&r.jsonRegex.test(e)}async request(e,t){let{url:a,init:i}=await this.createFetchParams(e,t),r=await this.fetchApi(a,i);if(r&&r.status>=200&&r.status<300)return r;throw new n(r,"Response returned an error code")}async createFetchParams(e,t){var a,i;let r,n=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(n+="?"+this.configuration.queryParamsStringify(e.query));let o=Object.assign({},this.configuration.headers,e.headers);Object.keys(o).forEach(e=>void 0===o[e]?delete o[e]:{});let s={method:e.method,headers:o,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return a=l.body,r="u">typeof FormData&&a instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"u">typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(o["Content-Type"])?JSON.stringify(l.body):l.body,{url:n,init:{...l,body:r}}}fetchApi;clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}}
2class n extends Error{response;name;constructor(e,t){super(t),this.response=e,this.name="ResponseError"}}class o extends Error{cause;name;constructor(e,t){super(t),this.cause=e,this.name="FetchError"}}class s extends Error{field;name;constructor(e,t){super(t),this.field=e,this.name="RequiredError"}}function l(e,t){let a={};for(let i of Object.keys(e))a[i]=t(e[i]);return a}function u(e){for(let t of e)if("multipart/form-data"===t.contentType)return!0;return!1}class c{raw;transformer;constructor(e,t=e=>e){this.raw=e,this.transformer=t}async value(){return this.transformer(await this.raw.json())}}class d{raw;constructor(e){this.raw=e}async value(){}}class p{raw;constructor(e){this.raw=e}async value(){return await this.raw.blob()}}function h(e){var t;return null==(t=e)?t:{selectedOptions:null==t.selected_options?void 0:t.selected_options,other:null==t.other?void 0:t.other}}function m(e){return function(e,t=!1){return null==e?e:{selected_options:e.selectedOptions,other:e.other}}(e,!1)}function g(e){var t;return null==(t=e)?t:{label:t.label,description:t.description}}function w(e){var t;return null==(t=e)?t:{question:t.question,header:t.header,options:t.options.map(g),multiple:t.multiple}}function f(e){return e}function _(e){return e}function y(e){var t,a=e;if(null==a)return a;return{type:a.type,text:a.text,message:null==a.message?void 0:null==(t=a.message)?t:{text:t.text,sendImmediately:t.send_immediately,imageAttachmentRequired:t.image_attachment_required,styleIds:null==t.style_ids?void 0:t.style_ids,transformModels:null==t.transform_models?void 0:t.transform_models.map(f)}}}function I(e){var t;return null==(t=e)?t:{imageId:t.image_id}}function v(e){return function(e,t=!1){return null==e?e:{image_id:e.imageId}}(e,!1)}e.s(["BaseAPI",0,r,"BlobApiResponse",0,p,"Configuration",0,a,"FetchError",0,o,"JSONApiResponse",0,c,"RequiredError",0,s,"ResponseError",0,n,"VoidApiResponse",0,d,"canConsumeForm",0,u,"mapValues",0,l],188147),e.s(["TransformModel",0,{Refm1:"refm1",Recraft20b:"recraft20b",Recraftv2:"recraftv2",Recraftv2Raster:"recraftv2_raster",Recraftv2Vector:"recraftv2_vector",Recraftv3:"recraftv3",Recraftv3Raster:"recraftv3_raster",Recraftv3Vector:"recraftv3_vector",Recraftv4:"recraftv4",Recraftv4Raster:"recraftv4_raster",Recraftv4Vector:"recraftv4_vector",Recraftv4Pro:"recraftv4_pro",Recraftv4ProRaster:"recraftv4_pro_raster",Recraftv4ProVector:"recraftv4_pro_vector",Recraftv41:"recraftv4_1",Recraftv41Raster:"recraftv4_1_raster",Recraftv41Vector:"recraftv4_1_vector",Recraftv41Pro:"recraftv4_1_pro",Recraftv41ProRaster:"recraftv4_1_pro_raster",Recraftv41ProVector:"recraftv4_1_pro_vector",Recraftv41Utility:"recraftv4_1_utility",Recraftv41UtilityRaster:"recraftv4_1_utility_raster",Recraftv41UtilityVector:"recraftv4_1_utility_vector",Recraftv41UtilityPro:"recraftv4_1_utility_pro",Recraftv41UtilityProRaster:"recraftv4_1_utility_pro_raster",Recraftv41UtilityProVector:"recraftv4_1_utility_pro_vector",Recraftv41Flash:"recraftv4_1_flash",Recraftv41FlashRaster:"recraftv4_1_flash_raster",Recraftv4Explore:"recraftv4_explore",Recraftv4ExploreRaster:"recraftv4_explore_raster",Recraftv4ExploreVector:"recraftv4_explore_vector",Recraftv4Styles:"recraftv4_styles",Recraftv4StylesRaster:"recraftv4_styles_raster",Recraftv4StylesVector:"recraftv4_styles_vector",Recraftv4StylesPro:"recraftv4_styles_pro",Recraftv4StylesProRaster:"recraftv4_styles_pro_raster",Recraftv4StylesProVector:"recraftv4_styles_pro_vector",Flux1KontextPro:"flux1_kontext_pro",Flux1KontextMax:"flux1_kontext_max",Flux11pro:"flux1_1pro",Flux1dev:"flux1dev",Imagen3:"imagen3",Imagen4:"imagen4",Imagen4Ultra:"imagen4_ultra",HidreamI1Dev:"hidream_i1_dev",GptImage1Low:"gpt_image_1_low",GptImage1Medium:"gpt_image_1_medium",GptImage1High:"gpt_image_1_high",GptImage1p5Low:"gpt_image_1p5_low",GptImage1p5Medium:"gpt_image_1p5_medium",GptImage1p5High:"gpt_image_1p5_high",GptImage2Low:"gpt_image_2_low",GptImage2Medium:"gpt_image_2_medium",GptImage2High:"gpt_image_2_high",GptImage2p5Flare:"gpt_image_2p5_flare",GptImage2p5Sunburst:"gpt_image_2p5_sunburst",IdeogramV3Turbo:"ideogram_v3_turbo",IdeogramV3Default:"ideogram_v3_default",IdeogramV3Quality:"ideogram_v3_quality",IdeogramV4Turbo:"ideogram_v4_turbo",IdeogramV4Balanced:"ideogram_v4_balanced",IdeogramV4Quality:"ideogram_v4_quality",QwenImage:"qwen_image",QwenImage2:"qwen_image_2",Gemini25FlashImage:"gemini_25_flash_image",BytedanceSeedreamv4:"bytedance-seedreamv4",BytedanceSeedreamv4p5:"bytedance_seedreamv4p5",NanoBananaPro:"nano_banana_pro",NanoBananaPro4k:"nano_banana_pro_4k",NanoBanana2:"nano_banana_2",NanoBanana2With4k:"nano_banana_2_with_4k",NanoBanana2Lite:"nano_banana_2_lite",Flux2Dev:"flux2_dev",Flux2Pro:"flux2_pro",Flux2Flex:"flux2_flex",Flux2Max:"flux2_max",ZImageTurbo:"z_image_turbo",BytedanceSeedreamv5Lite:"bytedance_seedreamv5_lite",BytedanceSeedreamv5Pro:"bytedance_seedreamv5_pro",QwenImage2Pro:"qwen_image_2_pro",QwenImage3:"qwen_image_3",QwenImage32k:"qwen_image_3_2k",Flux1Schnell:"flux1_schnell",GrokImagineImage:"grok_imagine_image",GrokImagineImage2:"grok_imagine_image_2",Imagineart2:"imagineart_2",Krea2Large:"krea_2_large",Krea2Medium:"krea_2_medium",Krea2Turbo:"krea_2_turbo",Cosmos3Super:"cosmos_3_super",Reve21:"reve_2_1",HiggsfieldSoul2:"higgsfield_soul_2",Veo3p1:"veo3p1",Veo3p1Fast:"veo3p1_fast",Veo3p1Lite:"veo3p1_lite",Veo3:"veo3",Veo3Fast:"veo3_fast",Veo2:"veo2",GeminiOmniFlash:"gemini_omni_flash",GeminiOmniFlash1p1:"gemini_omni_flash_1p1",Sora2Pro:"sora2_pro",Sora2:"sora2",Ray2:"ray2",Ray2Flash:"ray2_flash",Kling2p6Pro:"kling2p6_pro",Kling2p5Turbo:"kling2p5_turbo",Kling2p1Master:"kling2p1_master",Hailuo02Pro:"hailuo02_pro",Hailuo02Standard:"hailuo02_standard",Hailuo2p3Pro:"hailuo2p3_pro",Hailuo2p3Standard:"hailuo2p3_standard",Minimaxh3:"minimaxh3",Minimaxh3Max:"minimaxh3_max",Minimaxh3MaxTurbo:"minimaxh3_max_turbo",Wan3:"wan3",Wan2p7:"wan2p7",Wan2p6:"wan2p6",Wan2p5Preview:"wan2p5_preview",Wan2p2A14b:"wan2p2_a14b",BytedanceSeedance1p5:"bytedance_seedance1p5",BytedanceSeedance2:"bytedance_seedance2",BytedanceSeedance2Fast:"bytedance_seedance2_fast",BytedanceSeedance2p5:"bytedance_seedance2p5",PixverseV5p5:"pixverse_v5p5",PixverseV5p6:"pixverse_v5p6",PixverseV6:"pixverse_v6",GrokImagineVideo:"grok_imagine_video",GrokImagineVideo1p5:"grok_imagine_video_1p5",Kling3Pro:"kling3_pro",Kling3Standard:"kling3_standard",Kling3OmniPro:"kling3_omni_pro",Kling3OmniStandard:"kling3_omni_standard",Kling3Turbo:"kling3_turbo",HappyHorse1:"happy_horse_1",HappyHorse1p1:"happy_horse_1p1",Flux3Video:"flux3_video",RecraftSuperResolution:"recraft_super_resolution",RecraftGenerativeUpscale:"recraft_generative_upscale",Topaz:"topaz"},"TransformModelFromJSON",0,f,"TransformModelToJSON",0,_],464100);let k={StyleMatchRegular:"regular",StyleMatchPrecise:"precise",StyleMatchFlexible:"flexible"};function R(e){return e}function T(e){return e}function q(e){var t;return null==(t=e)?t:{videoId:t.video_id}}function S(e){return e}function b(e){var t;return null==(t=e)?t:{name:t.name,value:t.value,label:t.label,controlType:S(t.control_type),valueLabel:null==t.value_label?void 0:t.value_label}}function C(e){return e}function P(e){return e}function j(e){return e}function A(e){return e}function U(e){return e}function x(e){return e}function B(e){return e}function O(e){var t;return null==(t=e)?t:{rgb:null==t.rgb?void 0:t.rgb,std:null==t.std?void 0:t.std,weight:null==t.weight?void 0:t.weight}}function z(e){return function(e,t=!1){return null==e?e:{rgb:e.rgb,std:e.std,weight:e.weight}}(e,!1)}e.s(["StyleMatch",0,k,"StyleMatchFromJSON",0,R,"StyleMatchToJSON",0,T,"instanceOfStyleMatch",0,function(e){for(let t in k)if(Object.prototype.hasOwnProperty.call(k,t)&&k[t]===e)return!0;return!1}],426612),e.s(["ControlType",0,{ControlTypeEnum:"enum",ControlTypeRange:"range"},"ControlTypeFromJSON",0,S],59192);let E={InternalShapeStackingCutOut:"cut_out",InternalShapeStackingHierarchical:"hierarchical",InternalShapeStackingCutOutWithBg:"
2cut_out_with_bg",InternalShapeStackingInclusionOnly:"inclusion_only"};function $(e){return e}function D(e){return e}function G(e){return e}function M(e){return e}function F(e){return e}function W(e){return e}e.s(["InternalShapeStacking",0,E,"InternalShapeStackingFromJSON",0,$,"InternalShapeStackingToJSON",0,D,"instanceOfInternalShapeStacking",0,function(e){for(let t in E)if(Object.prototype.hasOwnProperty.call(E,t)&&E[t]===e)return!0;return!1}],683032),e.s(["ImageType",0,{Any:"any",DigitalIllustration:"digital_illustration",Icon:"icon",IconOutline:"icon_outline",IconBrokenLine:"icon_broken_line",IconColoredShapes:"icon_colored_shapes",IconColoredOutline:"icon_colored_outline",IconUnevenFill:"icon_uneven_fill",IconDoodleFill:"icon_doodle_fill",IconOffsetFill:"icon_offset_fill",IconDoodleOffsetFill:"icon_doodle_offset_fill",IconOutlineGradient:"icon_outline_gradient",IconColoredShapesGradient:"icon_colored_shapes_gradient",IconPictogram:"icon_pictogram",VectorIllustration:"vector_illustration",RealisticImage:"realistic_image",RealisticImageMockup:"realistic_image_mockup",RealisticImageBAndW:"realistic_image_b_and_w",RealisticImageEnterprise:"realistic_image_enterprise",RealisticImageHardFlash:"realistic_image_hard_flash",RealisticImageHdr:"realistic_image_hdr",RealisticImageNaturalLight:"realistic_image_natural_light",RealisticImageStudioPortrait:"realistic_image_studio_portrait",RealisticImageMotionBlur:"realistic_image_motion_blur",VectorIllustrationSeamless:"vector_illustration_seamless",VectorIllustrationLineArt:"vector_illustration_line_art",VectorIllustrationDoodleLineArt:"vector_illustration_doodle_line_art",VectorIllustrationFlat2:"vector_illustration_flat_2",VectorIllustration70s:"vector_illustration_70s",VectorIllustrationCartoon:"vector_illustration_cartoon",VectorIllustrationKawaii:"vector_illustration_kawaii",VectorIllustrationLinocut:"vector_illustration_linocut",VectorIllustrationEngraving:"vector_illustration_engraving",VectorIllustrationHalloweenStickers:"vector_illustration_halloween_stickers",VectorIllustrationLineCircuit:"vector_illustration_line_circuit",DigitalIllustrationSeamless:"digital_illustration_seamless",DigitalIllustrationPixelArt:"digital_illustration_pixel_art",DigitalIllustration3d:"digital_illustration_3d",DigitalIllustrationPlastic:"digital_illustration_plastic",DigitalIllustrationPsychedelic:"digital_illustration_psychedelic",DigitalIllustrationHandDrawn:"digital_illustration_hand_drawn",DigitalIllustrationGrain:"digital_illustration_grain",DigitalIllustrationGlow:"digital_illustration_glow",DigitalIllustration80s:"digital_illustration_80s",DigitalIllustrationWatercolor:"digital_illustration_watercolor",DigitalIllustrationVoxel:"digital_illustration_voxel",DigitalIllustrationInfantileSketch:"digital_illustration_infantile_sketch",DigitalIllustration2dArtPoster:"digital_illustration_2d_art_poster",DigitalIllustrationKawaii:"digital_illustration_kawaii",DigitalIllustrationHalloweenDrawings:"digital_illustration_halloween_drawings",DigitalIllustration2dArtPoster2:"digital_illustration_2d_art_poster_2",DigitalIllustrationEngravingColor:"digital_illustration_engraving_color",DigitalIllustrationFlatAirArt:"digital_illustration_flat_air_art",DigitalIllustrationHandDrawnOutline:"digital_illustration_hand_drawn_outline",DigitalIllustrationHandmade3d:"digital_illustration_handmade_3d",DigitalIllustrationStickersDrawings:"digital_illustration_stickers_drawings",Logo:"logo",LogoRaster:"logo_raster",LogoRasterEmblemGraffiti:"logo_raster_emblem_graffiti",LogoRasterEmblemPopArt:"logo_raster_emblem_pop_art",LogoRasterEmblemPunk:"logo_raster_emblem_punk",LogoRasterEmblemStamp:"logo_raster_emblem_stamp",LogoRasterEmblemVintage:"logo_raster_emblem_vintage",DigitalIllustrationAntiquarian:"digital_illustration_antiquarian",DigitalIllustrationBoldFantasy:"digital_illustration_bold_fantasy",DigitalIllustrationChildBook:"digital_illustration_child_book",DigitalIllustrationChildBooks:"digital_illustration_child_books",DigitalIllustrationCover:"digital_illustration_cover",DigitalIllustrationCrosshatch:"digital_illustration_crosshatch",DigitalIllustrationDigitalEngraving:"digital_illustration_digital_engraving",DigitalIllustrationDreamlikeHues:"digital_illustration_dreamlike_hues",DigitalIllustrationExpressionism:"digital_illustration_expressionism",DigitalIllustrationFreehandDetails:"digital_illustration_freehand_details",DigitalIllustrationGrain20:"digital_illustration_grain_20",DigitalIllustrationGraphicIntensity:"digital_illustration_graphic_intensity",DigitalIllustrationHardComics:"digital_illustration_hard_comics",DigitalIllustrationLongShadow:"digital_illustration_long_shadow",DigitalIllustrationModernFolk:"digital_illustration_modern_folk",DigitalIllustrationMulticolor:"digital_illustration_multicolor",DigitalIllustrationNeonCalm:"digital_illustration_neon_calm",DigitalIllustrationNoir:"digital_illustration_noir",DigitalIllustrationNostalgicPastel:"digital_illustration_nostalgic_pastel",DigitalIllustrationOutlineDetails:"digital_illustration_outline_details",DigitalIllustrationPastelGradient:"digital_illustration_pastel_gradient",DigitalIllustrationPastelSketch:"digital_illustration_pastel_sketch",DigitalIllustrationPopArt:"digital_illustration_pop_art",DigitalIllustrationPopRenaissance:"digital_illustration_pop_renaissance",DigitalIllustrationQuietCuriosity:"digital_illustration_quiet_curiosity",DigitalIllustrationSketchAndShade:"digital_illustration_sketch_and_shade",DigitalIllustrationStreetArt:"digital_illustration_street_art",DigitalIllustrationTabletSketch:"digital_illustration_tablet_sketch",DigitalIllustrationUrbanGlow:"digital_illustration_urban_glow",DigitalIllustrationUrbanSketching:"digital_illustration_urban_sketching",DigitalIllustrationVanillaDreams:"digital_illustration_vanilla_dreams",DigitalIllustrationYoungAdultBook:"digital_illustration_young_adult_book",DigitalIllustrationYoungAdultBook2:"digital_illustration_young_adult_book_2",RealisticImageEveningLight:"realistic_image_evening_light",RealisticImageFadedNostalgia:"realistic_image_faded_nostalgia",RealisticImageForestLife:"realistic_image_forest_life",RealisticImageGoldenHues:"realistic_image_golden_hues",RealisticImageIntensityHue:"realistic_image_intensity_hue",RealisticImageMysticNaturalism:"realistic_image_mystic_naturalism",RealisticImageNaturalTones:"realistic_image_natural_tones",RealisticImageNightlifeShine:"realistic_image_nightlife_shine",RealisticImageOrganicCalm:"realistic_image_organic_calm",RealisticImageRealLifeGlow:"realistic_image_real_life_glow",RealisticImageRetroRealism:"realistic_image_retro_realism",RealisticImageRetroSnapshot:"realistic_image_retro_snapshot",RealisticImageSereneFogscape:"realistic_image_serene_fogscape",RealisticImageUrbanDrama:"realistic_image_urban_drama",RealisticImageVillageRealism:"realistic_image_village_realism",RealisticImageWarmFolk:"realistic_image_warm_folk",VectorIllustrationBoldStroke:"vector_illustration_bold_stroke",VectorIllustrationChemistry:"vector_illustration_chemistry",VectorIllustrationColoredStencil:"vector_illustration_colored_stencil",VectorIllustrationContourPopArt:"vector_illustration_contour_pop_art",VectorIllustrationCosmics:"vector_illustration_cosmics",VectorIllustrationCutout:"vector_illustration_cutout",VectorIllustrationDepressive:"vector_illustration_depressive",VectorIllustrationEditorial:"vector_illustration_editorial",VectorIllustrationEmotionalFlat:"vector_illustration_emotional_flat",VectorIllustrationInfographical:"vector_illustration_infographical",VectorIllustrationMarkerOutline:"vector_illustration_marker_outline",VectorIllustrationMosaic:"vector_illustration_mosaic",VectorIllustrationNaivector:"vector_illustration_naivector",VectorIllustrationOrnamenticute:"vector_illustration_ornamenticute",VectorIllustrationRoundishFlat:"vector_illustration_roundish_flat",VectorIllustrationSegmentedColors:"vector_illustration_segmented_colors",VectorIllustrationSharpContrast:"vector_illustration_sharp_contrast",VectorIllustrationThin:"vector_illustration_thin",VectorIllustrationVectorPhoto:"vector_illustration_vector_photo",VectorIllustrationVividShapes:"vector_illustration_vivid_shapes",Pictogram:"pictogram",Illustration3d:"illustration_3d"},"ImageTypeFromJSON",0,M,"ImageTypeToJSON",0,F],396734);function L(e,t){return null==e?e:{...e,imageType:null==e.image_type?void 0:M(e.image_type),transparentBackgroun
2d:null==e.transparent_background?void 0:e.transparent_background,complexity:null==e.complexity?void 0:e.complexity,palette:null==e.palette?void 0:e.palette,resolution:null==e.resolution?void 0:e.resolution,strokeThickness:null==e.stroke_thickness?void 0:e.stroke_thickness,hasStrokes:null==e.has_strokes?void 0:e.has_strokes,hasGradient:null==e.has_gradient?void 0:e.has_gradient,iconType:null==e.icon_type?void 0:B(e.icon_type),iconGeometryType:null==e.icon_geometry_type?void 0:P(e.icon_geometry_type),iconLineWidth:null==e.icon_line_width?void 0:G(e.icon_line_width),iconJoinType:null==e.icon_join_type?void 0:x(e.icon_join_type),iconCapType:null==e.icon_cap_type?void 0:j(e.icon_cap_type),iconSquareAngle:null==e.icon_square_angle?void 0:C(e.icon_square_angle),iconFillType:null==e.icon_fill_type?void 0:A(e.icon_fill_type),iconLineType:null==e.icon_line_type?void 0:U(e.icon_line_type),isometric:null==e.isometric?void 0:e.isometric,colors:null==e.colors?void 0:e.colors.map(O),backgroundColor:null==e.background_color?void 0:O(e.background_color),mixedPresets:null==e.mixed_presets?void 0:e.mixed_presets,industry:null==e.industry?void 0:e.industry,specialEvent:null==e.special_event?void 0:W(e.special_event),styleDiversityEnabled:null==e.style_diversity_enabled?void 0:e.style_diversity_enabled,artisticLevel:null==e.artistic_level?void 0:e.artistic_level,promptDiversityEnabled:null==e.prompt_diversity_enabled?void 0:e.prompt_diversity_enabled,noText:null==e.no_text?void 0:e.no_text,disableGradientFills:null==e.disable_gradient_fills?void 0:e.disable_gradient_fills,shapeStacking:null==e.shape_stacking?void 0:$(e.shape_stacking)}}function V(e){return function(e,t=!1){return null==e?e:{...e,image_type:F(e.imageType),transparent_background:e.transparentBackground,complexity:e.complexity,palette:e.palette,resolution:e.resolution,stroke_thickness:e.strokeThickness,has_strokes:e.hasStrokes,has_gradient:e.hasGradient,icon_type:e.iconType,icon_geometry_type:e.iconGeometryType,icon_line_width:e.iconLineWidth,icon_join_type:e.iconJoinType,icon_cap_type:e.iconCapType,icon_square_angle:e.iconSquareAngle,icon_fill_type:e.iconFillType,icon_line_type:e.iconLineType,isometric:e.isometric,colors:null==e.colors?void 0:e.colors.map(z),background_color:z(e.backgroundColor),mixed_presets:e.mixedPresets,industry:e.industry,special_event:e.specialEvent,style_diversity_enabled:e.styleDiversityEnabled,artistic_level:e.artisticLevel,prompt_diversity_enabled:e.promptDiversityEnabled,no_text:e.noText,disable_gradient_fills:e.disableGradientFills,shape_stacking:D(e.shapeStacking)}}(e,!1)}function N(e){return e}function H(e){return e}function J(e,t){return null==e?e:{id:e.id,appId:null==e.app_id?void 0:e.app_id,recraftTime:e.recraft_time,transformType:N(e.transform_type),resultImageIds:e.result_image_ids.map(I),resultVideoIds:e.result_video_ids.map(q),imageType:null==e.image_type?void 0:M(e.image_type),prompt:null==e.prompt?void 0:e.prompt,negativePrompt:null==e.negative_prompt?void 0:e.negative_prompt,userControls:null==e.user_controls?void 0:L(e.user_controls,!1),negativeUserControls:null==e.negative_user_controls?void 0:L(e.negative_user_controls,!1),controls:null==e.controls?void 0:e.controls.map(b),styleRefIds:null==e.style_ref_ids?void 0:e.style_ref_ids.map(I),sourceImage:null==e.source_image?void 0:I(e.source_image),sourceImageIds:null==e.source_image_ids?void 0:e.source_image_ids.map(I),videoFirstFrameSourceImage:null==e.video_first_frame_source_image?void 0:I(e.video_first_frame_source_image),videoLastFrameSourceImage:null==e.video_last_frame_source_image?void 0:I(e.video_last_frame_source_image),maskImage:null==e.mask_image?void 0:I(e.mask_image),imageStrength:null==e.image_strength?void 0:e.image_strength,exploreSimilarity:null==e.explore_similarity?void 0:e.explore_similarity,styleId:null==e.style_id?void 0:e.style_id,styleMatch:null==e.style_match?void 0:R(e.style_match),transformModel:null==e.transform_model?void 0:f(e.transform_model)}}function K(e){return e}function Q(e){return e}function Y(e){return e}function X(e){return e}function Z(e){return e}e.s(["TransformType",0,{PromptToImage:"prompt_to_image",CaptionsToImage:"captions_to_image",PromptToMockup:"prompt_to_mockup",PromptsToImageSet:"prompts_to_image_set",ImageToImage:"image_to_image",ImageEdit:"image_edit",Inpaint:"inpaint",InpaintDeterministic:"inpaint_deterministic",ReplaceBg:"replace_bg",RemoveBg:"remove_bg",SuperResolution:"super_resolution",Vectorization:"vectorization",GenerativeUpscale:"generative_upscale",Variate:"variate",Animate:"animate",Segment:"segment",Mockupize:"mockupize",Autolayout:"autolayout",DescribeImage:"describe_image",DescribeStyle:"describe_style",ExtractCharacters:"extract_characters",MagicSelect:"magic_select",PromptToVideo:"prompt_to_video",ImageToVideo:"image_to_video",Explore:"explore",ImageUpscale:"image_upscale",EnhanceRealism:"enhance_realism",RefineDetails:"refine_details"},"TransformTypeFromJSON",0,N,"TransformTypeToJSON",0,H],959856),e.s(["AspectRatio",0,{AspectRatio8x1:"8:1",AspectRatio4x1:"4:1",AspectRatio3x1:"3:1",AspectRatio21x9:"21:9",AspectRatio2x1:"2:1",AspectRatio16x9:"16:9",AspectRatio3x2:"3:2",AspectRatio14x10:"14:10",AspectRatio4x3:"4:3",AspectRatio5x4:"5:4",AspectRatio1x1:"1:1",AspectRatio4x5:"4:5",AspectRatio3x4:"3:4",AspectRatio10x14:"10:14",AspectRatio2x3:"2:3",AspectRatio6x10:"6:10",AspectRatio9x16:"9:16",AspectRatio1x2:"1:2",AspectRatio1x3:"1:3",AspectRatio1x4:"1:4",AspectRatio1x8:"1:8"}
2,"AspectRatioFromJSON",0,K,"AspectRatioToJSON",0,Q],928563),e.s(["MediaType",0,{MediaTypeImage:"image",MediaTypeVideo:"video"},"MediaTypeFromJSON",0,Y,"MediaTypeToJSON",0,X],726736);function ee(e,t=!1){return null==e?e:{media_type:X(e.mediaType),prompt:e.prompt,style_id:e.styleId,transform_model:_(e.transformModel),num_images_per_prompt:e.numImagesPerPrompt,aspect_ratio:Q(e.aspectRatio),negative_prompt:e.negativePrompt,duration:e.duration,resolution:e.resolution,audio:e.audio,simple_mode:e.simpleMode,user_controls:V(e.userControls),artistic_level:e.artisticLevel,no_text:e.noText,background_color:z(e.backgroundColor),colors:null==e.colors?void 0:e.colors.map(z)}}function et(e,t){return null==e?e:{size:e.size,limit:e.limit}}function ea(e){var t,a=e;if(null==a)return a;return{id:a.id,createTime:a.create_time,lastMessageUpdateTime:a.last_message_update_time,lastMessageId:null==a.last_message_id?void 0:a.last_message_id,meta:null==(t=a.meta)?t:{mediaType:null==t.media_type?void 0:Y(t.media_type),prompt:null==t.prompt?void 0:t.prompt,styleId:null==t.style_id?void 0:t.style_id,transformModel:null==t.transform_model?void 0:f(t.transform_model),numImagesPerPrompt:null==t.num_images_per_prompt?void 0:t.num_images_per_prompt,aspectRatio:null==t.aspect_ratio?void 0:K(t.aspect_ratio),negativePrompt:null==t.negative_prompt?void 0:t.negative_prompt,duration:null==t.duration?void 0:t.duration,resolution:null==t.resolution?void 0:Z(t.resolution),audio:null==t.audio?void 0:t.audio,simpleMode:null==t.simple_mode?void 0:t.simple_mode,userControls:null==t.user_controls?void 0:L(t.user_controls,!1),artisticLevel:null==t.artistic_level?void 0:t.artistic_level,noText:null==t.no_text?void 0:t.no_text,backgroundColor:null==t.background_color?void 0:O(t.background_color),colors:null==t.colors?void 0:t.colors.map(O)},name:null==a.name?void 0:a.name,isReadonly:a.is_readonly,isArchived:a.is_archived,isTemporary:a.is_temporary,contextSize:null==a.context_size?void 0:et(a.context_size,!1),parentChatId:null==a.parent_chat_id?void 0:a.parent_chat_id}}function ei(e){return e}function er(e,t){return null==e?e:{height:e.height,width:e.width}}function en(e){return function(e,t=!1){return null==e?e:{height:e.height,width:e.width}}(e,!1)}function eo(e){var t;return null==(t=e)?t:{skillId:t.skill_id}}function es(e){return function(e,t=!1){return null==e?e:{skill_id:e.skillId}}(e,!1)}e.s(["ImageTypeFormat",0,{Raster:"raster",Vector:"vector"},"ImageTypeFormatFromJSON",0,ei],815666);function el(e,t){var a,i;if(null==e)return e;switch(e.type){case"action":return Object.assign({},null==e?e:{type:e.type,role:e.role,text:e.text},{type:"action"});case"ask_user":return Object.assign({},null==e?e:{type:e.type,role:e.role,questions:e.questions.map(w)},{type:"ask_user"});case"ask_user_answer":return Object.assign({},null==e?e:{type:e.type,role:e.role,replyToAskUserMessageId:e.reply_to_ask_user_message_id,questions:e.questions.map(w),answers:null==e.answers?void 0:e.answers.map(h),declined:e.declined},{type:"ask_user_answer"});case"assistant_message":return Object.assign({},null==e?e:{type:e.type,role:e.role,text:e.text},{type:"assistant_message"});case"error":return Object.assign({},null==e?e:{type:e.type,role:e.role,error:e.error,replyToToolCallMessageId:null==e.reply_to_tool_call_message_id?void 0:e.reply_to_tool_call_message_id},{type:"error"});case"follow_up":return Object.assign({},null==e?e:{type:e.type,role:e.role,choices:e.choices.map(y)},{type:"follow_up"});case"reasoning":return Object.assign({},null==e?e:{type:e.type,role:e.role,text:e.text},{type:"reasoning"});
2case"recraft":return Object.assign({},null==(a=e)?a:{type:a.type,role:a.role,recraft:J(a.recraft,!1),videoIdToThumbnailImage:null==a.video_id_to_thumbnail_image?void 0:l(a.video_id_to_thumbnail_image,I),replyToToolCallMessageId:null==a.reply_to_tool_call_message_id?void 0:a.reply_to_tool_call_message_id},{type:"recraft"});case"subagent":return Object.assign({},null==(i=e)?i:{type:i.type,role:i.role,chat:ea(i.chat),chatGeneration:function(e){if(null==e)return e;return{id:e.id,chatId:e.chat_id,startTime:e.start_time,endTime:null==e.end_time?void 0:e.end_time,endReason:null==e.end_reason?void 0:e.end_reason}}(i.chat_generation),name:i.name,replyToToolCallMessageId:null==i.reply_to_tool_call_message_id?void 0:i.reply_to_tool_call_message_id},{type:"subagent"});case"tool_call":return Object.assign({},function(e){var t;if(null==e)return e;return{type:e.type,role:e.role,text:e.text,params:null==e.params?void 0:null==(t=e.params)?t:{transformType:null==t.transform_type?void 0:N(t.transform_type),prompt:null==t.prompt?void 0:t.prompt,images:null==t.images?void 0:t.images.map(I),styleId:null==t.style_id?void 0:t.style_id,size:null==t.size?void 0:er(t.size,!1),numImages:null==t.num_images?void 0:t.num_images,resultImageTypeFormat:null==t.result_image_type_format?void 0:ei(t.result_image_type_format),resultMediaType:null==t.result_media_type?void 0:Y(t.result_media_type)}}}(e),{type:"tool_call"});case"user_message":return Object.assign({},null==e?e:{type:e.type,role:e.role,text:e.text,images:null==e.images?void 0:e.images.map(I),videoFirstFrame:null==e.video_first_frame?void 0:I(e.video_first_frame),videoLastFrame:null==e.video_last_frame?void 0:I(e.video_last_frame),skills:null==e.skills?void 0:e.skills.map(eo)},{type:"user_message"});default:return e}}function eu(e){return ec(e,!1)}function ec(e,t){return null==e?e:{type:e.type,id:e.id,chatId:e.chat_id,chatGenerationId:e.chat_generation_id,createTime:e.create_time,hasShowPriority:e.has_show_priority,message:el(e.message,!1)}}function ed(e){return function(e,t=!1){return null==e?e:{...e,type:e.type,description:e.description}}(e,!1)}function ep(e){return function(e,t=!1){return null==e?e:{name:e.name,description:e.description,properties:l(e.properties,ed)}}(e,!1)}function eh(e){return e}function em(e){return e}function eg(e){var t;return null==(t=e)?t:{value:t.value,title:t.title}}function ew(e){return function(e){if(null==e)return e;switch(e.control_type){case"enum":return Object.assign({},null==e?e:{label:e.label,controlType:S(e.control_type),choices:e.choices.map(eg),_default:null==e.default?void 0:e.default},{controlType:"enum"});case"range":return Object.assign({},null==e?e:{label:e.label,controlType:S(e.control_type),min:e.min,max:e.max,_default:null==e.default?void 0:e.default},{controlType:"range"});default:return e}}(e)}function ef(e){var t;return null==(t=e)?t:{price:t.price,maxPrice:t.max_price,discountedPrice:null==t.discounted_price?void 0:t.discounted_price,priceExact:t.price_exact,maxPriceExact:t.max_price_exact,discountedPriceExact:null==t.discounted_price_exact?void 0:t.discounted_price_exact}}function e_(e){var t;return null==(t=e)?t:{transformModel:f(t.transform_model),controls:null==t.controls?void 0:l(t.controls,ew),priceRange:null==t.price_range?void 0:ef(t.price_range)}}function ey(e){var t;return null==(t=e)?t:{transformModel:f(t.transform_model),controls:null==t.controls?void 0:l(t.controls,ew),priceRange:null==t.price_range?void 0:ef(t.price_range)}}function eI(e){return function(e,t=!1){return null==e?e:{reply_to_ask_user_message_id:e.replyToAskUserMessageId,answers:e.answers.map(m),system_prompt:e.systemPrompt,skip_follow_up:e.skipFollowUp,stream:e.stream,tools:null==e.tools?void 0:e.tools.map(ep),config:e.config}}(e,!1)}function ev(e){return function(e,t=!1){return null==e?e:{message:function(e,t=!1){return null==e?e:{type:e.type,role:e.role,text:e.text,images:null==e.images?void 0:e.images.map(v),video_first_frame:v(e.videoFirstFrame),video_last_frame:v(e.videoLastFrame),skills:null==e.skills?void 0:e.skills.map(es)}}(e.message,!1),meta:ee(e.meta,!1),system_prompt:e.systemPrompt,skip_follow_up:e.skipFollowUp,stream:e.stream,tools:null==e.tools?void 0:e.tools.map(ep),config:e.config}}(e,!1)}e.s(["ChatMessageStreamChunkFromJSON",0,function(e){return function(e){var t,a,i;if(null==e)return e;switch(e.type){case"delta":return Object.assign({},null==(t=e)?t:{type:t.type,id:t.id,chatId:t.chat_id,chatGenerationId:t.chat_generation_id,createTime:t.create_time,deltaIndex:t.delta_index,delta:function(e){if(null==e)return e;switch(e.type){case"assistant_message":return Object.assign({},null==e?e:{type:e.type,role:e.role,text:e.text},{type:"assistant_message"});case"reasoning":return Object.assign({},null==e?e:{type:e.type,role:e.role,text:e.text},{type:"reasoning"});default:return e}}(t.delta)},{type:"delta"});case"error":return Object.assign({},null==e?e:{type:e.type,chatId:e.chat_id,chatGenerationId:e.chat_generation_id,message:e.message},{type:"error"});case"message":return Object.assign({},ec(e,!0),{type:"message"});case"message_update":return Object.assign({},null==(a=e)?a:{type:a.type,id:a.id,chatId:a.chat_id,chatGenerationId:a.chat_generation_id,message:el(a.message,!1)},{type:"message_update"});case"status":return Object.assign({},null==(i=e)?i:{type:i.type,chatId:i.chat_id,chatGenerationId:i.chat_generation_id,createTime:i.create_time,contextSize:null==i.context_size?void 0:et(i.context_size,!1),credits:i.credits,status:i.status}
2,{type:"status"});case"tool_call":return Object.assign({},null==e?e:{type:e.type,chatId:e.chat_id,chatGenerationId:e.chat_generation_id,callId:e.call_id,name:e.name,arguments:e.arguments},{type:"tool_call"});default:return e}}(e)}],16708),e.s(["OnboardingStatus",0,{NotStarted:"not_started",InProgress:"in_progress",Finished:"finished"},"OnboardingStatusFromJSON",0,eh,"OnboardingStatusToJSON",0,em],142568),e.s(["RespondToAskUserRequestToJSON",0,eI],38385);function ek(e,t){return null==e?e:{unlimitedRecrafts:e.unlimited_recrafts,privateRecrafts:e.private_recrafts,commercialImages:e.commercial_images,userOwned:e.user_owned,generativeUpscale:e.generative_upscale,recraftPriority:e.recraft_priority,maxConcurrentRecrafts:e.max_concurrent_recrafts,maxNumImagesPerPrompt:e.max_num_images_per_prompt,imagesUploadLimit:null==e.images_upload_limit?void 0:e.images_upload_limit,externalModels:e.external_models,freeExternalModels:e.free_external_models,videoModels:e.video_models,artisticLevel:e.artistic_level,describeImage:e.describe_image,describeStyle:e.describe_style,colorPalette:e.color_palette,magicSelection:e.magic_selection,privateStyles:e.private_styles,stylesUsageLimited:e.styles_usage_limited,maxChatContextLimit:e.max_chat_context_limit}}function eR(e){return e}e.s(["SendChatUserMessageRequestToJSON",0,ev],237486);function eT(e,t){return null==e?e:{credits:e.credits}}function eq(e,t){return null==e?e:{name:e.name,disabled:e.disabled,productId:e.product_id,refillPeriod:eR(e.refill_period),creditsPerPeriod:e.credits_per_period,isFree:e.is_free,features:ek(e.features,!1),flags:eT(e.flags,!1),upgradable:e.upgradable,addons:e.addons}}function eS(e){return e}function eb(e){var t;return null==(t=e)?t:{status:eh(t.status),data:t.data,projectId:null==t.project_id?void 0:t.project_id}}function eC(e){return e}function eP(e){return e}function ej(e){return e}e.s(["SubscriptionRefillPeriod",0,{Yearly:"yearly",Monthly:"monthly",Weekly:"weekly",Daily:"daily"},"SubscriptionRefillPeriodFromJSON",0,eR],722203),e.s(["SubscriptionStatus",0,{Active:"active",Inactive:"inactive",Trialing:"trialing",Overdue:"overdue",Cancelling:"cancelling",Cancelled:"cancelled",Error:"error"},"SubscriptionStatusFromJSON",0,eS],207784),e.s(["WorkspaceUserRole",0,{Admin:"admin",BillingAdmin:"billing_admin",Member:"member"},"WorkspaceUserRoleFromJSON",0,eC,"WorkspaceUserRoleToJSON",0,eP],832784);function eA(e,t){return null==e?e:{id:e.id,endTime:null==e.end_time?void 0:e.end_time,trialEndTime:null==e.trial_end_time?void 0:e.trial_end_time,creditsExpireTime:e.credits_expire_time,createTime:e.create_time,status:eS(e.status),externalService:null==e.external_service?void 0:ej(e.external_service),allowedSubscriptionService:null==e.allowed_subscription_service?void 0:ej(e.allowed_subscription_service),billingPeriod:null==e.billing_period?void 0:eR(e.billing_period),refill:null==e.refill?void 0:function(e){var t;if(null==e)return e;return{period:eR(e.period),credits:e.credits,nextRefillTime:e.next_refill_time,limit:null==e.limit?void 0:null==(t=e.limit)?t:{period:eR(t.period),credits:t.credits,refilledCredits:t.refilled_credits,expireTime:t.expire_time}}}(e.refill)}}function eU(e){var t;return null==(t=e)?t:{workspaceId:t.workspace_id,workspaceName:t.workspace_name,role:eC(t.role),subscriptionCredits:t.subscription_credits,extraCredits:t.extra_credits,subscription:eA(t.subscription,!1),plan:eq(t.plan,!1)}}e.s(["SubscriptionService",0,{Stripe:"stripe",Google:"google",Apple:"apple"},"SubscriptionServiceFromJSON",0,ej],744434),e.s([],578888);function ex(e,t){return null==e?e:{triggerBelow:null==e.trigger_below?void 0:e.trigger_below,topUpBy:null==e.top_up_by?void 0:e.top_up_by,coupon:null==e.coupon?void 0:e.coupon}}function eB(e,t=!1){return null==e?e:{trigger_below:e.triggerBelow,top_up_by:e.topUpBy,coupon:e.coupon}}e.s(["AdminApi",0,class extends r{async updateMockupDecalPlacementRaw(e,t){if(null==e.mockupId)throw new s("mockupId",'Required parameter "mockupId" was null or undefined when calling updateMockupDecalPlacement().');if(null==e.updateMockupDecalPlacementRequest)throw new s("updateMockupDecalPlacementRequest",'Required parameter "updateMockupDecalPlacementRequest" was null or undefined when calling updateMockupDecalPlacement().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/mockup/{mockup_id}/decal_placement";return i=i.replace("{mockup_id}",encodeURIComponent(String(e.mockupId))),new d(await this.request({path:i,method:"PUT",headers:a,query:{},body:function(e,t=!1){return null==e?e:{decal_placement:function(e,t=!1){return null==e?e:{decal_size:function(e,t=!1){return null==e?e:{w:e.w,h:e.h}}(e.decalSize,!1),transform:function(e,t=!1){return null==e?e:{a:e.a,b:e.b,c:e.c,d:e.d,tx:e.tx,ty:e.ty}}(e.transform,!1)}}(e.decalPlacement,!1)}}(e.updateMockupDecalPlacementRequest,!1)},t))}async updateMockupDecalPlacement(e,t){await this.updateMockupDecalPlacementRaw(e,t)}}],615290);function eO(e,t=!1){return null==e?e:{quantity:e.quantity}}function ez(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,mask:t.mask,createTime:t.create_time,value:null==t.value?void 0:t.value}}e.s(["ApiAutopaymentApi",0,class extends r{async getExternalAutoPaymentRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling getExternalAutoPayment().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/users/{user_id}/external_auto_payment";return i=i.replace("{user_id}
2",encodeURIComponent(String(e.userId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>ex(e,!1))}async getExternalAutoPayment(e,t){let a=await this.getExternalAutoPaymentRaw(e,t);return await a.value()}async getWorkspaceExternalAutoPaymentRaw(e,t){if(null==e.workspaceId)throw new s("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceExternalAutoPayment().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/workspaces/{workspace_id}/external_auto_payment";return i=i.replace("{workspace_id}",encodeURIComponent(String(e.workspaceId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>ex(e,!1))}async getWorkspaceExternalAutoPayment(e,t){let a=await this.getWorkspaceExternalAutoPaymentRaw(e,t);return await a.value()}async setExternalAutoPaymentRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling setExternalAutoPayment().');if(null==e.autoPaymentParameters)throw new s("autoPaymentParameters",'Required parameter "autoPaymentParameters" was null or undefined when calling setExternalAutoPayment().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/users/{user_id}/external_auto_payment";return i=i.replace("{user_id}",encodeURIComponent(String(e.userId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:eB(e.autoPaymentParameters,!1)},t))}async setExternalAutoPayment(e,t){let a=await this.setExternalAutoPaymentRaw(e,t);return await a.value()}async setWorkspaceExternalAutoPaymentRaw(e,t){if(null==e.workspaceId)throw new s("workspaceId",'Required parameter "workspaceId" was null or undefined when calling setWorkspaceExternalAutoPayment().');if(null==e.autoPaymentParameters)throw new s("autoPaymentParameters",'Required parameter "autoPaymentParameters" was null or undefined when calling setWorkspaceExternalAutoPayment().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}
2let i="/workspaces/{workspace_id}/external_auto_payment";return i=i.replace("{workspace_id}",encodeURIComponent(String(e.workspaceId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:eB(e.autoPaymentParameters,!1)},t))}async setWorkspaceExternalAutoPayment(e,t){let a=await this.setWorkspaceExternalAutoPaymentRaw(e,t);return await a.value()}}],877132);function eE(e,t=!1){return null==e?e:{name:e.name}}function e$(e){var t;return null==(t=e)?t:{tokenId:t.token_id,userId:t.user_id,name:t.name,mask:t.mask,createTime:t.create_time}}e.s(["ApiTokenApi",0,class extends r{async deleteAPITokenRaw(e,t){if(null==e.tokenId)throw new s("tokenId",'Required parameter "tokenId" was null or undefined when calling deleteAPIToken().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/api_token/{token_id}";return i=i.replace("{token_id}",encodeURIComponent(String(e.tokenId))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{}},t))}async deleteAPIToken(e,t){let a=await this.deleteAPITokenRaw(e,t);return await a.value()}async deleteServiceTokenRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling deleteServiceToken().');
2if(null==e.tokenId)throw new s("tokenId",'Required parameter "tokenId" was null or undefined when calling deleteServiceToken().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/users/{user_id}/service_tokens/{token_id}";return i=(i=i.replace("{user_id}",encodeURIComponent(String(e.userId)))).replace("{token_id}",encodeURIComponent(String(e.tokenId))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{}},t))}async deleteServiceToken(e,t){let a=await this.deleteServiceTokenRaw(e,t);return await a.value()}async generateAPITokenRaw(e,t){if(null==e.generateAPITokenRequest)throw new s("generateAPITokenRequest",'Required parameter "generateAPITokenRequest" was null or undefined when calling generateAPIToken().');let a={};null!=e.userId&&(a.user_id=e.userId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/api_tokens",method:"POST",headers:i,query:a,body:eE(e.generateAPITokenRequest,!1)},t),e=>ez(e))}async generateAPIToken(e,t){let a=await this.generateAPITokenRaw(e,t);return await a.value()}async generateServiceTokenRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling generateServiceToken().');
2if(null==e.generateAPITokenRequest)throw new s("generateAPITokenRequest",'Required parameter "generateAPITokenRequest" was null or undefined when calling generateServiceToken().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/users/{user_id}/service_tokens";return i=i.replace("{user_id}",encodeURIComponent(String(e.userId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:eE(e.generateAPITokenRequest,!1)},t),e=>{var t;return null==(t=e)?t:{tokenId:t.token_id,userId:t.user_id,name:t.name,mask:t.mask,createTime:t.create_time,value:t.value}})}async generateServiceToken(e,t){let a=await this.generateServiceTokenRaw(e,t);return await a.value()}async listAPITokensRaw(e,t){let a={};null!=e.limit&&(a.limit=e.limit),null!=e.offset&&(a.offset=e.offset),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/api_tokens",method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{data:t.data.map(ez)}})}async listAPITokens(e={},t){let a=await this.listAPITokensRaw(e,t);return await a.value()}async listServiceTokensRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling listServiceTokens().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/users/{user_id}/service_tokens";return i=i.replace("{user_id}",encodeURIComponent(String(e.userId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{data:t.data.map(e$)}})}async listServiceTokens(e,t){let a=await this.listServiceTokensRaw(e,t);return await a.value()}}],89703);function eD(e,t=!1){return null==e?e:{prompt:e.prompt,style_id:e.styleId,layer_size:en(e.layerSize),transform:H(e.transform)}}function eG(e){var t;return null==(t=e)?t:{id:t.id,label:null==t.label?void 0:t.label,text:null==t.text?void 0:t.text,imageId:null==t.image_id?void 0:t.image_id,attachImageId:null==t.attach_image_id?void 0:t.attach_image_id,styleId:null==t.style_id?void 0:t.style_id}}function eM(e){return function(e,t=!1){return null==e?e:{id:e.id,label:e.label,text:e.text,image_id:e.imageId,attach_image_id:e.attachImageId,style_id:e.styleId}}(e,!1)}function eF(e){return e}function eW(e){return e}function eL(e){var t;return null==(t=e)?t:{...t,name:t.name,label:null==t.label?void 0:t.label,type:eF(t.type),required:t.required,items:null==t.items?void 0:t.items.map(eG),minImageCount:null==t.min_image_count?void 0:t.min_image_count,maxImageCount:null==t.max_image_count?void 0:t.max_image_count}}function eV(e){return function(e,t=!1){return null==e?e:{...e,name:e.name,label:e.label,type:eW(e.type),required:e.required,items:null==e.items?void 0:e.items.map(eM),min_image_count:e.minImageCount,max_image_count:e.maxImageCount}}(e,!1)}e.s(["AppControlType",0,{AppControlTypeImage:"image",AppControlTypeSelect:"select",AppControlTypeText:"text"},"AppControlTypeFromJSON",0,eF,"AppControlTypeToJSON",0,eW],22104);function eN(e,t=!1){return null==e?e:{...e,controls:e.controls.map(eV)}}function eH(e){var t,a,i=e;if(null==i)return i;return{appId:i.app_id,name:i.name,description:i.description,published:i.published,tags:i.tags,config:null==i.config?void 0:null==(t=i.config)?t:{prompt:t.prompt,styleId:t.style_id,layerSize:null==t.layer_size?void 0:er(t.layer_size,!1),transform:null==t.transform?void 0:N(t.transform)},data:null==(a=i.data)?a:{...a,controls:a.controls.map(eL)},previewImageId:i.preview_image_id,thumbnailImageId:i.thumbnail_image_id,priority:i.priority}}function eJ(e){var t,a=e;if(null==a)return a;return{image:I(a.image),originalImage:I(a.original_image),bbox:null==(t=a.bbox)?t:{x:t.x,y:t.y,w:t.w,h:t.h},labels:a.labels,originalImageWidth:a.original_image_width,originalImageHeight:a.original_image_height}}function eK(e){return function(e,t=!1){return null==e?e:{image:v(e.image),original_image:v(e.originalImage),bbox:function(e,t=!1){return null==e?e:{x:e.x,y:e.y,w:e.w,h:e.h}}(e.bbox,!1),labels:e.labels,original_image_width:e.originalImageWidth,original_image_height:e.originalImageHeight}}(e,!1)}function eQ(e){var t;return null==(t=e)?t:{label:t.label,boxes:t.boxes.map(eJ)}}function eY(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,images:t.images.map(I),isDraft:t.is_draft}}function eX(e){var t;return null==(t=e)?t:{skillId:t.skill_id,name:t.name,disableModelInvocation:t.disable_model_invocation,isPrivate:t.is_private,isBasic:t.is_basic}}e.s(["AppApi",0,class extends r{async createAppRaw(e,t){if(null==e.createAppRequest)throw new s("createAppRequest",'Required parameter "createAppRequest" was null or undefined when calling createApp().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/apps",method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{name:e.name,description:e.description,published:e.published,tags:e.tags,config:eD(e.config,!1),data:eN(e.data,!1),preview_image_id:e.previewImageId,thumbnail_image_id:e.thumbnailImageId,priority:e.priority}}(e.createAppRequest,!1)},t),e=>eH(e))}async createApp(e,t){let a=await this.createAppRaw(e,t);return await a.value()}async deleteAppRaw(e,t){if(null==e.appId)throw new s("appId",'Required parameter "appId" was null or undefined when calling deleteApp().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/apps/{app_id}";return i=i.replace("{app_id}",encodeURIComponent(String(e.appId))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{}},t))}async deleteApp(e,t){let a=await this.deleteAppRaw(e,t);return await a.value()}async getAppRaw(e,t){if(null==e.appId)throw new s("appId",'Required parameter "appId" was null or undefined when calling getApp().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/apps/{app_id}";return i=i.replace("{app_id}",encodeURIComponent(String(e.appId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>eH(e))}
2async getApp(e,t){let a=await this.getAppRaw(e,t);return await a.value()}async listAppsRaw(e,t){let a={};null!=e.includeNotPublished&&(a.include_not_published=e.includeNotPublished),null!=e.tag&&(a.tag=e.tag);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/apps",method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{apps:t.apps.map(eH)}})}async listApps(e={},t){let a=await this.listAppsRaw(e,t);return await a.value()}async modifyAppRaw(e,t){if(null==e.appId)throw new s("appId",'Required parameter "appId" was null or undefined when calling modifyApp().');if(null==e.modifyAppRequest)throw new s("modifyAppRequest",'Required parameter "modifyAppRequest" was null or undefined when calling modifyApp().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/apps/{app_id}";return i=i.replace("{app_id}",encodeURIComponent(String(e.appId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{name:e.name,description:e.description,published:e.published,tags:e.tags,config:eD(e.config,!1),data:eN(e.data,!1),preview_image_id:e.previewImageId,thumbnail_image_id:e.thumbnailImageId,priority:e.priority}}(e.modifyAppRequest,!1)},t),e=>eH(e))}async modifyApp(e,t){let a=await this.modifyAppRaw(e,t);return await a.value()}async runAppRaw(e,t){if(null==e.appId)throw new s("appId",'Required parameter "appId" was null or undefined when calling runApp().');if(null==e.runAppRequest)throw new s("runAppRequest",'Required parameter "runAppRequest" was null or undefined when calling runApp().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/apps/{app_id}/run";return r=r.replace("{app_id}",encodeURIComponent(String(e.appId))),new c(await this.request({path:r,method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{values:e.values}}(e.runAppRequest,!1)},t),e=>{var t;return null==(t=e)?t:{operationId:t.operation_id}})}async runApp(e,t){let a=await this.runAppRaw(e,t);return await a.value()}}],775417),e.s(["BlobApi",0,class extends r{async downloadBlobRaw(e,t){if(null==e.blobId)throw new s("blobId",'Required parameter "blobId" was null or undefined when calling downloadBlob().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/blob/{blob_id}";return i=i.replace("{blob_id}",encodeURIComponent(String(e.blobId))),new p(await this.request({path:i,method:"GET",headers:a,query:{}},t))}async downloadBlob(e,t){let a=await this.downloadBlobRaw(e,t);return await a.value()}}],642254),e.s(["CharacterApi",0,class extends r{async addCharacterRaw(e,t){if(null==e.addCharacterRequest)throw new s("addCharacterRequest",'Required parameter "addCharacterRequest" was null or undefined when calling addCharacter().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/characters",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{character:function(e,t=!1){return null==e?e:{label:e.label,boxes:e.boxes.map(eK)}}(e.character,!1),name:e.name,is_draft:e.isDraft}}(e.addCharacterRequest,!1)},t),e=>eY(e))}async addCharacter(e,t){let a=await this.addCharacterRaw(e,t);return await a.value()}async deleteCharacterRaw(e,t){if(null==e.characterId)throw new s("characterId",'Required parameter "characterId" was null or undefined when calling deleteCharacter().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/characters/{character_id}";return i=i.replace("{character_id}",encodeURIComponent(String(e.characterId))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{}},t))}async deleteCharacter(e,t){let a=await this.deleteCharacterRaw(e,t);return await a.value()}async extractCharactersRaw(e,t){if(null==e.extractCharactersRequest)throw new s("extractCharactersRequest",'Required parameter "extractCharactersRequest" was null or undefined when calling extractCharacters().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/extract_characters",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{images:e.images.map(v),random_seed:e.randomSeed}}(e.extractCharactersRequest,!1)},t),e=>{var t;return null==(t=e)?t:{characters:t.characters.map(eQ),credits:t.credits}})}async extractCharacters(e,t){let a=await this.extractCharactersRaw(e,t);return await a.value()}async getCharacterRaw(e,t){if(null==e.characterId)throw new s("characterId",'Required parameter "characterId" was null or undefined when calling getCharacter().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/characters/{character_id}";return i=i.replace("{character_id}",encodeURIComponent(String(e.characterId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>eY(e))}async getCharacter(e,t){let a=await this.getCharacterRaw(e,t);return await a.value()}async listCreatedCharactersRaw(e,t){let a={};null!=e.name&&(a.name=e.name),null!=e.nameFilter&&(a.name_filter=e.nameFilter),null!=e.limit&&(a.limit=e.limit),null!=e.offset&&(a.offset=e.offset);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/characters",method:"GET",headers:i,query:a},t),e=>e.map(eY))}async listCreatedCharacters(e={},t){let a=await this.listCreatedCharactersRaw(e,t);return await a.value()}async modifyCharacterRaw(e,t){if(null==e.characterId)throw new s("characterId",'Required parameter "characterId" was null or undefined when calling modifyCharacter().');if(null==e.modifyCharacterRequest)throw new s("modifyCharacterRequest",'Required parameter "modifyCharacterRequest" was null or undefined when calling modifyCharacter().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/characters/{character_id}";return i=i.replace("{character_id}",encodeURIComponent(String(e.characterId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{name:e.name,is_draft:e.isDraft}}
2(e.modifyCharacterRequest,!1)},t),e=>eY(e))}async modifyCharacter(e,t){let a=await this.modifyCharacterRaw(e,t);return await a.value()}}],15466);function eZ(e,t){return null==e?e:{skillId:e.skill_id,name:e.name,disableModelInvocation:e.disable_model_invocation,isPrivate:e.is_private,isBasic:e.is_basic,description:e.description,skill:e.skill,images:e.images.map(I),version:e.version}}function e0(e,t){return null==e?e:{fileId:e.file_id,name:e.name,text:e.text,images:e.images.map(I),subagentOnly:e.subagent_only}}function e1(e){var t;return null==(t=e)?t:{fileId:t.file_id,name:t.name,subagentOnly:t.subagent_only,imagesCount:t.images_count}}function e2(e){var t;return null==(t=e)?t:{minLength:t.min_length,maxLength:t.max_length}}function e4(e){return function(e,t=!1){if(null==e)return e;switch(e.type){case"image":return Object.assign({},function(e,t=!1){return null==e?e:{type:e.type,image:v(e.image)}}(e,!1),{type:"image"});case"text":return Object.assign({},function(e,t=!1){return null==e?e:{type:e.type,text:e.text}}(e,!1),{type:"text"});case"video":return Object.assign({},function(e,t=!1){return null==e?e:{type:e.type,video:function(e,t=!1){return null==e?e:{video_id:e.videoId}}(e.video,!1)}}(e,!1),{type:"video"});default:return e}}(e,!1)}function e3(e){var t;return null==(t=e)?t:{text:null==t.text?void 0:t.text,imageId:null==t.image_id?void 0:t.image_id,videoId:null==t.video_id?void 0:t.video_id,isAuxiliaryImage:null==t.is_auxiliary_image?void 0:t.is_auxiliary_image}}function e5(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,arguments:t.arguments}}function e6(e){var t;return null==(t=e)?t:{chatGenerationId:t.chat_generation_id,createTime:t.create_time,role:t.role,text:null==t.text?void 0:t.text,reasoning:null==t.reasoning?void 0:t.reasoning,callId:null==t.call_id?void 0:t.call_id,toolCalls:null==t.tool_calls?void 0:t.tool_calls.map(e5),content:null==t.content?void 0:t.content.map(e3)}}function e8(e){var t;return null==(t=e)?t:{timestamp:t.timestamp,chatGenerationId:t.chat_generation_id,completionsRequestId:t.completions_request_id,type:t.type,model:t.model,cost:t.cost,credits:t.credits,usage:null==t.usage?void 0:t.usage,error:null==t.error?void 0:t.error}}e.s(["ChatApi",0,class extends r{async archiveChatRaw(e,t){if(null==e.chatId)throw new s("chatId",'Required parameter "chatId" was null or undefined when calling archiveChat().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/chat/{chat_id}/archive";return i=i.replace("{chat_id}",encodeURIComponent(String(e.chatId))),new c(await this.request({path:i,method:"POST",headers:a,query:{}},t),e=>ea(e))}async archiveChat(e,t){let a=await this.archiveChatRaw(e,t);return await a.value()}async cloneChatRaw(e,t){if(null==e.chatId)throw new s("chatId",'Required parameter "chatId" was null or undefined when calling cloneChat().');let a={};null!=e.projectId&&(a.project_id=e.projectId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/chat/{chat_id}/clone";return r=r.replace("{chat_id}",encodeURIComponent(String(e.chatId))),new c(await this.request({path:r,method:"POST",headers:i,query:a},t),e=>ea(e))}async cloneChat(e,t){let a=await this.cloneChatRaw(e,t);return await a.value()}async createChatRaw(e,t){if(null==e.createChatRequest)throw new s("createChatRequest",'Required parameter "createChatRequest" was null or undefined when calling createChat().');let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/chat",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{meta:ee(e.meta,!1),category:e.category,onboarding:e.onboarding,is_temporary:e.isTemporary,landing_request_id:e.landingRequestId}}(e.createChatRequest,!1)},t),e=>ea(e))}async createChat(e,t){let a=await this.createChatRaw(e,t);return await a.value()}async createSkillRaw(e,t){if(null==e.createSkillRequest)throw new s("createSkillRequest",'Required parameter "createSkillRequest" was null or undefined when calling createSkill().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/chat/skills",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{name:e.name,description:e.description,skill:e.skill,images:null==e.images?void 0:e.images.map(v),disable_model_invocation:e.disableModelInvocation,is_basic:e.isBasic}}(e.createSkillRequest,!1)},t),e=>eZ(e,!1))}async createSkill(e,t){let a=await this.createSkillRaw(e,t);return await a.value()}async createSkillFileRaw(e,t){if(null==e.skillId)throw new s("skillId",'Required parameter "skillId" was null or undefined when calling createSkillFile().');if(null==e.createSkillFileRequest)throw new s("createSkillFileRequest",'Required parameter "createSkillFileRequest" was null or undefined when calling createSkillFile().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/chat/skills/{skill_id}/files";return i=i.replace("{skill_id}",encodeURIComponent(String(e.skillId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{name:e.name,text:e.text,images:null==e.images?void 0:e.images.map(v),subagent_only:e.subagentOnly}}(e.createSkillFileRequest,!1)},t),e=>e0(e,!1))}async createSkillFile(e,t){let a=await this.createSkillFileRaw(e,t);return await a.value()}async deleteSkillRaw(e,t){if(null==e.skillId)throw new s("skillId",'Required parameter "skillId" was null or undefined when calling deleteSkill().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/chat/skills/{skill_id}";return i=i.replace("{skill_id}",encodeURIComponent(String(e.skillId))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{}},t))}async deleteSkill(e,t){let a=await this.deleteSkillRaw(e,t);return await a.value()}async deleteSkillFileRaw(e,t){if(null==e.skillId)throw new s("skillId",'Required parameter "skillId" was null or undefined when calling deleteSkillFile().');if(null==e.fileId)throw new s("fileId",'Required parameter "fileId" was null or undefined when calling deleteSkillFile().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/chat/skills/{skill_id}/files/{file_id}";return i=(i=i.replace("{skill_id}",encodeURIComponent(String(e.skillId)))).replace("{file_id}",encodeURIComponent(String(e.fileId))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{}},t))}async deleteSkillFile(e,t){let a=await this.deleteSkillFileRaw(e,t);return await a.value()}async getChatRaw(e,t){if(null==e.chatId)throw new s("chatId",'Required parameter "chatId" was null or undefined when calling getChat().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/chat/{chat_id}";return i=i.replace("{chat_id}",encodeURIComponent(String(e.chatId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>ea(e))}async getChat(e,t){let a=await this.getChatRaw(e,t);return await a.value()}async getChatCompletionsMessagesRaw(e,t){if(null==e.chatId)throw new s("chatId",'Required parameter "chatId" was null or undefined when calling getChatCompletionsMessages().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/chat/{chat_id}/completions_messages";return i=i.replace("{chat_id}",encodeURIComponent(String(e.chatId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{messages:t.messages.map(e6)}})}async getChatCompletionsMessages(e,t){let a=await this.getChatCompletionsMessagesRaw(e,t);return await a.value()}async getChatCompletionsRawRequestRaw(e,t){if(null==e.completionsRequestId)throw new s("completionsRequestId",'Required parameter "completionsRequestId" was null or undefined when calling getChatCompletionsRawRequest().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/chat/completions_raw_requests/{completions_request_id}";return i=i.replace("{completions_request_id}",encodeURIComponent(String(e.completionsRequestId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{timestamp:t.timestamp,chatGenerationId:t.chat_generation_id,completionsRequestId:t.completions_request_id,type:t.type,model:t.model,cost:t.cost,credits:t.credits,usage:null==t.usage?void 0:t.usage,error:null==t.error?void 0:t.error,chatId:t.chat_id,systemPrompt:null==t.system_prompt?void 0:t.system_prompt,responseFormat:null==t.response_format?void 0:t.response_format,input:t.input,tools:null==t.tools?void 0:t.tools,response:t.response}})}async getChatCompletionsRawRequest(e,t){let a=await this.getChatCompletionsRawRequestRaw(e,t);return await a.value()}async getChatMessageRaw(e,t){if(null==e.chatMessageId)throw new s("chatMessageId",'Required parameter "chatMessageId" was null or undefined when calling getChatMessage().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/chat/messages/{chat_message_id}";return i=i.replace("{chat_message_id}",encodeURIComponent(String(e.chatMessageId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>eu(e))}async getChatMessage(e,t){let a=await this.getChatMessageRaw(e,t);return await a.value()}async getChatStatisticsRaw(e,t){if(null==e.chatId)throw new s("chatId",'Required parameter "chatId" was null or undefined when calling getChatStatistics().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/chat/{chat_id}/statistics";return i=i.replace("{chat_id}",encodeURIComponent(String(e.chatId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{designAgentFlag:t.design_agent_flag}})}async getChatStatistics(e,t){let a=await this.getChatStatisticsRaw(e,t);return await a.value()}async getSkillRaw(e,t){if(null==e.skillId)throw new s("skillId",'Required parameter "skillId" was null or undefined when calling getSkill().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/chat/skills/{skill_id}";return i=i.replace("{skill_id}",encodeURIComponent(String(e.skillId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>eX(e))}
2async getSkill(e,t){let a=await this.getSkillRaw(e,t);return await a.value()}async getSkillDetailsRaw(e,t){if(null==e.skillId)throw new s("skillId",'Required parameter "skillId" was null or undefined when calling getSkillDetails().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/chat/skills/{skill_id}/details";return i=i.replace("{skill_id}",encodeURIComponent(String(e.skillId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>eZ(e,!1))}async getSkillDetails(e,t){let a=await this.getSkillDetailsRaw(e,t);return await a.value()}async getSkillFileRaw(e,t){if(null==e.skillId)throw new s("skillId",'Required parameter "skillId" was null or undefined when calling getSkillFile().');if(null==e.fileId)throw new s("fileId",'Required parameter "fileId" was null or undefined when calling getSkillFile().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/chat/skills/{skill_id}/files/{file_id}";return i=(i=i.replace("{skill_id}",encodeURIComponent(String(e.skillId)))).replace("{file_id}",encodeURIComponent(String(e.fileId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>e0(e,!1))}
2async getSkillFile(e,t){let a=await this.getSkillFileRaw(e,t);return await a.value()}async getSkillLimitsRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("auth0",[]);a&&(t.Authorization=`Bearer ${a}`)}return new c(await this.request({path:"/chat/skills/limits",method:"GET",headers:t,query:{}},e),e=>(function(e){var t;if(null==e)return e;return{name:e2(e.name),description:e2(e.description),skill:e2(e.skill),maxImages:e.max_images,files:null==(t=e.files)?t:{name:e2(t.name),text:e2(t.text),subagentText:e2(t.subagent_text),maxImages:t.max_images,maxFiles:t.max_files}}})(e))}async getSkillLimits(e){let t=await this.getSkillLimitsRaw(e);return await t.value()}async listChatCompletionsRawRequestsRaw(e,t){if(null==e.chatId)throw new s("chatId",'Required parameter "chatId" was null or undefined when calling listChatCompletionsRawRequests().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/chat/{chat_id}/list_completions_raw_requests";return i=i.replace("{chat_id}",encodeURIComponent(String(e.chatId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{completionsRequests:t.completions_requests.map(e8)}})}async listChatCompletionsRawRequests(e,t){let a=await this.listChatCompletionsRawRequestsRaw(e,t);return await a.value()}async listChatsRaw(e,t){if(null==e.offset)throw new s("offset",'Required parameter "offset" was null or undefined when calling listChats().');if(null==e.limit)throw new s("limit",'Required parameter "limit" was null or undefined when calling listChats().');let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId),null!=e.offset&&(a.offset=e.offset),null!=e.limit&&(a.limit=e.limit);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/list_chats",method:"GET",headers:i,query:a},t),e=>e.map(ea))}async listChats(e,t){let a=await this.listChatsRaw(e,t);return await a.value()}async listSkillFilesRaw(e,t){if(null==e.skillId)throw new s("skillId",'Required parameter "skillId" was null or undefined when calling listSkillFiles().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/chat/skills/{skill_id}/files";return i=i.replace("{skill_id}",encodeURIComponent(String(e.skillId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>e.map(e1))}async listSkillFiles(e,t){let a=await this.listSkillFilesRaw(e,t);return await a.value()}async listSkillsRaw(e,t){if(null==e.type)throw new s("type",'Required parameter "type" was null or undefined when calling listSkills().');let a={};null!=e.type&&(a.type=e.type),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/chat/skills",method:"GET",headers:i,query:a},t),e=>e.map(eX))}async listSkills(e,t){let a=await this.listSkillsRaw(e,t);return await a.value()}async modifyChatRaw(e,t){if(null==e.chatId)throw new s("chatId",'Required parameter "chatId" was null or undefined when calling modifyChat().');if(null==e.modifyChatRequest)throw new s("modifyChatRequest",'Required parameter "modifyChatRequest" was null or undefined when calling modifyChat().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/chat/{chat_id}";return i=i.replace("{chat_id}",encodeURIComponent(String(e.chatId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{name:e.name,meta:ee(e.meta,!1)}}(e.modifyChatRequest,!1)},t),e=>ea(e))}async modifyChat(e,t){let a=await this.modifyChatRaw(e,t);return await a.value()}async modifySkillRaw(e,t){if(null==e.skillId)throw new s("skillId",'Required parameter "skillId" was null or undefined when calling modifySkill().');if(null==e.modifySkillRequest)throw new s("modifySkillRequest",'Required parameter "modifySkillRequest" was null or undefined when calling modifySkill().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/chat/skills/{skill_id}";return i=i.replace("{skill_id}",encodeURIComponent(String(e.skillId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{description:e.description,skill:e.skill,images:null==e.images?void 0:e.images.map(v),disable_model_invocation:e.disableModelInvocation,is_basic:e.isBasic}}(e.modifySkillRequest,!1)},t),e=>eZ(e,!1))}async modifySkill(e,t){let a=await this.modifySkillRaw(e,t);return await a.value()}async modifySkillFileRaw(e,t){if(null==e.skillId)throw new s("skillId",'Required parameter "skillId" was null or undefined when calling modifySkillFile().');if(null==e.fileId)throw new s("fileId",'Required parameter "fileId" was null or undefined when calling modifySkillFile().');if(null==e.modifySkillFileRequest)throw new s("modifySkillFileRequest",'Required parameter "modifySkillFileRequest" was null or undefined when calling modifySkillFile().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/chat/skills/{skill_id}/files/{file_id}";return i=(i=i.replace("{skill_id}",encodeURIComponent(String(e.skillId)))).replace("{file_id}",encodeURIComponent(String(e.fileId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{name:e.name,text:e.text,images:null==e.images?void 0:e.images.map(v),subagent_only:e.subagentOnly}}(e.modifySkillFileRequest,!1)},t),e=>e0(e,!1))}async modifySkillFile(e,t){let a=await this.modifySkillFileRaw(e,t);return await a.value()}async pollChatRaw(e,t){if(null==e.chatId)throw new s("chatId",'Required parameter "chatId" was null or undefined when calling pollChat().');let a={};null!=e.createdAfter&&(a.created_after=e.createdAfter);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/chat/{chat_id}/poll";return r=r.replace("{chat_id}",encodeURIComponent(String(e.chatId))),new c(await this.request({path:r,method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{chat:ea(t.chat),isGenerating:t.is_generating,messages:t.messages.map(eu),activeChatGenerationIds:t.active_chat_generation_ids}})}async pollChat(e,t){let a=await this.pollChatRaw(e,t);return await a.value()}async respondToAskUserRaw(e,t){if(null==e.chatId)throw new s("chatId",'Required parameter "chatId" was null or undefined when calling respondToAskUser().');if(null==e.respondToAskUserRequest)throw new s("respondToAskUserRequest",'Required parameter "respondToAskUserRequest" was null or undefined when calling respondToAskUser().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/chat/{chat_id}/respond_to_ask_user";return i=i.replace("{chat_id}",encodeURIComponent(String(e.chatId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:eI(e.respondToAskUserRequest)},t),e=>ea(e))}async respondToAskUser(e,t){let a=await this.respondToAskUserRaw(e,t);return await a.value()}async sendChatToolCallResponseRaw(e,t){if(null==e.callId)throw new s("callId",'Required parameter "callId" was null or undefined when calling sendChatToolCallResponse().');if(null==e.chatToolCallResponse)throw new s("chatToolCallResponse",'Required parameter "chatToolCallResponse" was null or undefined when calling sendChatToolCallResponse().');let a={};null!=e.proxied&&(a.proxied=e.proxied);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/chat/tool_calls/{call_id}";return r=r.replace("{call_id}",encodeURIComponent(String(e.callId))),new c(await this.request({path:r,method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{content:null==e.content?void 0:e.content.map(e4),is_stopped:e.isStopped,error:e.error}}(e.chatToolCallResponse,!1)},t))}async sendChatToolCallResponse(e,t){let a=await this.sendChatToolCallResponseRaw(e,t);return await a.value()}async sendChatUserMessageRaw(e,t){if(null==e.chatId)throw new s("chatId",'Required parameter "chatId" was null or undefined when calling sendChatUserMessage().');if(null==e.sendChatUserMessageRequest)throw new s("sendChatUserMessageRequest",'Required parameter "sendChatUserMessageRequest" was null or undefined when calling sendChatUserMessage().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/chat/{chat_id}/send_message";return i=i.replace("{chat_id}",encodeURIComponent(String(e.chatId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:ev(e.sendChatUserMessageRequest)},t),e=>ea(e))}async sendChatUserMessage(e,t){let a=await this.sendChatUserMessageRaw(e,t);return await a.value()}async stopChatGenerationRaw(e,t){if(null==e.chatId)throw new s("chatId",'Required parameter "chatId" was null or undefined when calling stopChatGeneration().');let a={};null!=e.chatGenerationId&&(a.chat_generation_id=e.chatGenerationId),null!=e.proxied&&(a.proxied=e.proxied);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/chat/{chat_id}/stop_generation";return r=r.replace("{chat_id}",encodeURIComponent(String(e.chatId))),new c(await this.request({path:r,method:"POST",headers:i,query:a},t),e=>ea(e))}async stopChatGeneration(e,t){let a=await this.stopChatGenerationRaw(e,t);return await a.value()}}],588575);function e7(e,t=!1){return null==e?e:{reason:e.reason}}function e9(e,t){return null==e?e:{checkoutUrl:e.checkout_url}}function te(e){return e}function tt(e){var t;return null==(t=e)?t:{imageId:t.image_id,recraftId:t.recraft_id,appId:null==t.app_id?void 0:t.app_id,recraft:null==t.recraft?void 0:J(t.recraft,!1),imageType:null==t.image_type?void 0:t.image_type,prompt:null==t.prompt?void 0:t.prompt,likesCount:null==t.likes_count?void 0:t.likes_count,dislikesCount:null==t.dislikes_count?void 0:t.dislikes_count,liked:null==t.liked?void 0:t.liked,disliked:null==t.disliked?void 0:t.disliked,width:null==t.width?void 0:t.width,height:null==t.height?void 0:t.height,createTime:null==t.create_time?void 0:t.create_time,publicCommercialUse:t.public_commercial_use,isPrivate:t.is_private,userOwned:t.user_owned,transformModel:null==t.transform_model?void 0:f(t.transform_model),contentType:null==t.content_type?void 0:t.content_type,galleryTags:null==t.gallery_tags?void 0:t.gallery_tags}}function ta(e){var t;return null==(t=e)?t:{recraftImages:t.recraft_images.map(tt)}}function ti(e){var t;return null==(t=e)?t:{sign:t.sign,points:t.points,numPoints:t.num_points}}function tr(e){var t;return null==(t=e)?t:{index:t.index,entries:t.entries.map(ti)}}e.s(["ListRecraftImagesRequestType",0,{Liked:"liked",Community:"community",CommunityRandom:"community_random",CommunityRaw:"community_raw",History:"history",Styles:"styles",AllInStyle:"all_in_style",BestInStyle:"best_in_style"},"ListRecraftImagesRequestTypeToJSON",0,te],175792);function tn(e,t){var a;if(null==e)return e;return{styleReferences:null==e.style_references?void 0:e.style_references,promptBasedStyleReference:null==e.prompt_based_
2style_reference?void 0:e.prompt_based_style_reference,image2image:null==e.image2image?void 0:e.image2image,inpaint:null==e.inpaint?void 0:e.inpaint,eraseRegion:null==e.erase_region?void 0:e.erase_region,replaceBg:null==e.replace_bg?void 0:e.replace_bg,negativePrompt:null==e.negative_prompt?void 0:e.negative_prompt,textLayout:null==e.text_layout?void 0:e.text_layout,imageSets:null==e.image_sets?void 0:e.image_sets,specialEvent:null==e.special_event?void 0:e.special_event,match:e.match.map(R),transforms:null==(a=e.transforms)?a:{promptToImage:a.prompt_to_image,captionsToImage:a.captions_to_image,promptToMockup:a.prompt_to_mockup,promptsToImageSet:a.prompts_to_image_set,imageToImage:a.image_to_image,imageEdit:a.image_edit,inpaint:a.inpaint,inpaintDeterministic:a.inpaint_deterministic,replaceBg:a.replace_bg,variate:a.variate,promptToVideo:a.prompt_to_video,imageToVideo:a.image_to_video,explore:a.explore}}}function to(e,t){var a;if(null==e)return e;return{...e,aspectRatio:null==e.aspect_ratio?void 0:e.aspect_ratio.map(K),promptLength:null==e.prompt_length?void 0:e.prompt_length,negativePromptLength:null==e.negative_prompt_length?void 0:e.negative_prompt_length,imageEditingAttachments:null==e.image_editing_attachments?void 0:e.image_editing_attachments,transparentBackground:null==e.transparent_background?void 0:e.transparent_background,complexity:null==e.complexity?void 0:e.complexity,palette:null==e.palette?void 0:e.palette,resolution:null==e.resolution?void 0:e.resolution,strokeThickness:null==e.stroke_thickness?void 0:e.stroke_thickness,hasStrokes:null==e.has_strokes?void 0:e.has_strokes,hasGradient:null==e.has_gradient?void 0:e.has_gradient,iconType:null==e.icon_type?void 0:e.icon_type.map(B),iconGeometryType:null==e.icon_geometry_type?void 0:e.icon_geometry_type.map(P),iconLineWidth:null==e.icon_line_width?void 0:e.icon_line_width.map(G),iconJoinType:null==e.icon_join_type?void 0:e.icon_join_type.map(x),iconCapType:null==e.icon_cap_type?void 0:e.icon_cap_type.map(j),iconSquareAngle:null==e.icon_square_angle?void 0:e.icon_square_angle.map(C),iconFillType:null==e.icon_fill_type?void 0:e.icon_fill_type.map(A),iconLineType:null==e.icon_line_type?void 0:e.icon_line_type.map(U),isometric:null==e.isometric?void 0:e.isometric,colors:null==e.colors?void 0:e.colors,backgroundColor:null==e.background_color?void 0:e.background_color,mixedPresets:null==e.mixed_presets?void 0:e.mixed_presets.map(M),styleDiversityEnabled:null==e.style_diversity_enabled?void 0:e.style_diversity_enabled,specialEvent:null==e.special_event?void 0:e.special_event.map(W),artisticLevel:null==e.artistic_level?void 0:e.artistic_level,noText:null==e.no_text?void 0:e.no_text,video:null==e.video?void 0:null==(a=e.video)?a:{aspectRatio:a.aspect_ratio.map(K),duration:a.duration,resolution:a.resolution.map(Z),audio:a.audio,firstFrame:null==a.first_frame?void 0:a.first_frame,firstLastFrame:null==a.first_last_frame?void 0:a.first_last_frame,lastFrameOnly:null==a.last_frame_only?void 0:a.last_frame_only,negativePrompt:null==a.negative_prompt?void 0:a.negative_prompt,aspectRatioInImageToVideo:null==a.aspect_ratio_in_image_to_video?void 0:a.aspect_ratio_in_image_to_video}}}function ts(e){var t;return null==(t=e)?t:{imageType:M(t.image_type),transformModel:null==t.transform_model?void 0:f(t.transform_model),userControls:to(t.user_controls,!1),supports:tn(t.supports,!1)}}function tl(e,t){return null==e?e:{videoId:e.video_id,thumbnailImageId:I(e.thumbnail_image_id),recraftId:e.recraft_id,recraft:null==e.recraft?void 0:J(e.recraft,!1),appId:null==e.app_id?void 0:e.app_id,videoType:M(e.video_type),prompt:e.prompt,resolution:Z(e.resolution),duration:e.duration,audio:e.audio,width:e.width,height:e.height,createTime:e.create_time,publicCommercialUse:e.public_commercial_use,isPrivate:e.is_private,userOwned:e.user_owned,transformModel:f(e.transform_model),contentType:e.content_type,likesCount:null==e.likes_count?void 0:e.likes_count,dislikesCount:null==e.dislikes_count?void 0:e.dislikes_count,liked:null==e.liked?void 0:e.liked,disliked:null==e.disliked?void 0:e.disliked,galleryTags:null==e.gallery_tags?void 0:e.gallery_tags}}function tu(e){var t;return null==(t=e)?t:{image:null==t.image?void 0:tt(t.image),video:null==t.video?void 0:tl(t.video,!1)}}function tc(e){return e}function td(e){var t;return null==(t=e)?t:{blobId:t.blob_id}}function tp(e){return e}e.s(["DecalColorCorrection",0,{None:"none",LimitedBrightness:"limited_brightness"},"DecalColorCorrectionFromJSON",0,tc],253977);function th(e,t){return null==e?e:{mockupId:e.mockup_id,version:null==e.version?void 0:e.version,uv:null==e.uv?void 0:td(e.uv),uvHeight:null==e.uv_height?void 0:e.uv_height,uvWidth:null==e.uv_width?void 0:e.uv_width,hfov:e.hfov,vfov:e.vfov,nearClippingPlane:e.near_clipping_plane,farClippingPlane:e.far_clipping_plane,shadeMap:null==e.shade_map?void 0:td(e.shade_map),shadeMapHeight:null==e.shade_map_height?void 0:e.shade_map_height,shadeMapWidth:null==e.shade_map_width?void 0:e.shade_map_width,coarseShadeMap:null==e.coarse_shade_map?void 0:td(e.coarse_shade_map),depth:td(e.depth),depthHeight:e.depth_height,depthWidth:e.depth_width,depthScaleMin:e.depth_scale_min,depthScaleMax:e.depth_scale_max,dx:null==e.dx?void 0:td(e.dx),dy:null==e.dy?void 0:td(e.dy),dxHeight:null==e.dx_height?void 0:e.dx_height,dxWidth:null==e.dx_width?void 0:e.dx_width,segmentationMap:null==e.segmentation_map?void 0:td(e.segmentation_map),segmentationMapHeight:null==e.segmentation_map_height?void 0:e.segmentation_map_height,segmentationMapWidth:null==e.segmentation_map_width?void 0:e.segmentation_map_width,distortion:null==e.distortion?void 0:tp(e.distortion),colorCorrection:null==e.color_correction?void 0:tc(e.color_correction),decalPlacement:null==e.decal_placement?void 0:function(e){var t,a;if(null==e)return e;return{decalSize:null==(t=e.decal_size)?t:{w:t.w,h:t.h},transform:null==(a=e.transform)?a:{a:a.a,b:a.b,c:a.c,d:a.d,tx:a.tx,ty:a.ty}}}(e.decal_placement)}}function tm(e){var t;return null==(t=e)?t:{colors:t.colors.map(O),backgroundColor:null==t.background_color?void 0:O(t.background_color)}}e.s(["DecalDistortion",0,{None:"none",Voronoi:"voronoi"},"DecalDistortionFromJSON",0,tp],676382);function tg(e,t=!1){return null==e?e:{colors:e.colors.map(z),background_color:z(e.backgroundColor)}}function tw(e){return e}e.s(["MediaReaction",0,{Like:"like",Dislike:"dislike",Save:"save",SaveFromGallery:"save_from_gallery",SaveFromHistory:"save_from_history",Share:"share",RemoveFromHistory:"remove_from_history",RemoveFromStyleHistory:"remove_from_style_history",DiscordSelect:"discord_select",Report:"report"},"MediaReactionToJSON",0,tw],204969);function tf(e,t=!1){return null==e?e:{reaction:tw(e.reaction),cancel:e.cancel,reason:e.reason}}function t_(e,t=!1){return null==e?e:{count:e.count,offset:e.offset,limit:e.limit,image_types:null==e.imageTypes?void 0:e.imageTypes.map(F),transform_types:null==e.transformTypes?void 0:e.transformTypes.map(H),prompt:e.prompt,user_controls:V(e.userControls)}}function ty(e,t=!1){return null==e?e:{tags:e.tags}}function tI(e,t=!1){return null==e?e:{is_public:e.isPublic}}function tv(e){var t;return null==(t=e)?t:{userId:t.user_id,email:null==t.email?void 0:t.email,name:null==t.name?void 0:t.name,username:t.username,image:null==t.image?void 0:t.image}}function tk(e){return e}function tR(e){return e}function tT(e){var t;return null==(t=e)?t:{id:t.id,imageId:t.image_id,previewImageId:null==t.preview_image_id?void 0:t.preview_image_id,mediaType:Y(t.media_type),imageType:M(t.image_type),parentImageType:tR(t.parent_image_type),imageTypeFormat:ei(t.image_type_format),name:null==t.name?void 0:t.name,slug:t.slug,styleImages:null==t.style_images?void 0:t.style_images.map(I),styleImagesWeights:null==t.style_images_weights?void 0:t.style_images_weights,sourceStyles:null==t.source_styles?void 0:t.source_styles,sourceStylesWeights:null==t.source_styles_weights?void 0:t.source_styles_weights,generatedImages:null==t.generated_images?void 0:t.generated_images.map(I),galleryTags:null==t.gallery_tags?void 0:t.gallery_tags,galleryImageIds:null==t.gallery_image_ids?void 0:t.gallery_image_ids,isPrivate:t.is_private,isDefault:t.is_default,owner:null==t.owner?void 0:tv(t.owner),transformModel:f(t.transform_model),transformModelFamily:t.transform_model_family.map(f),match:R(t.match),isDraft:t.is_draft,prompt:null==t.prompt?void 0:t.prompt,tags:t.tags,rankDebug:null==t.rank_debug?void 0:t.rank_debug,likesCount:t.likes_count,dislikesCount:t.dislikes_count,accessType:tk(t.access_type),limit:null==t.limit?void 0:t.limit,usageCount:null==t.usage_count?void 0:t.usage_count,colors:null==t.colors?void 0:t.colors.map(O),backgroundColor:null==t.background_color?void 0:O(t.background_color),useStyleTemplate:t.use_style_template,controls:to(t.controls,!1),supports:tn(t.supports,!1),price:ef(t.price)}}function tq(e){var t;return null==(t=e)?t:{prompt:t.prompt,negativePrompt:null==t.negative_prompt?void 0:t.negative_prompt,userControls:null==t.user_controls?void 0:L(t.user_controls,!1),styleRefs:null==t.style_refs?void 0:t.style_refs.map(I),styleId:null==t.style_id?void 0:t.style_id}}e.s(["StyleAccessType",0,{Owner:"owner",Shared:"shared",Public:"public",Private:"private"},"StyleAccessTypeFromJSON",0,tk],159868),e.s(["ParentImageType",0,{Unknown:"unknown",DigitalIllustration:"digital_illustration",VectorIllustration:"vector_illustration",Icon:"icon",LogoVector:"logo_vector",LogoRaster:"logo_raster",RealisticImage:"realistic_image",Illustration3d:"illustration3d",Any:"any"},"ParentImageTypeFromJSON",0,tR],601098);function tS(e,t){return null==e?e:{checkoutUrl:null==e.checkout_url?void 0:e.checkout_url,instantPayment:e.instant_payment}}function tb(e){var t;return null==(t=e)?t:{axisName:t.axisName,axisValue:t.axisValue}}function tC(e){var t;return null==(t=e)?t:{coords:t.coords.map(tb),name:t.name}}function tP(e){var t;return null==(t=e)?t:{name:t.name,defaultValue:t.defaultValue,minimum:t.minimum,maximum:t.maximum}}function tj(e){var t;return null==(t=e)?t:{fontId:t.font_id,name:t.name,subfamilyName:t.subfamily_name,previewBlobId:t.preview_blob_id,axes:t.axes.map(tP),axesInstances:t.axes_instances.map(tC)}}function tA(e){return function(e,t=!1){return null==e?e:{sha256:e.sha256,
2content_type:e.contentType,insert_offset:e.insertOffset,source_image_id:e.sourceImageId}}(e,!1)}e.s(["DefaultApi",0,class extends r{async banUserByImageRaw(e,t){if(null==e.imageId)throw new s("imageId",'Required parameter "imageId" was null or undefined when calling banUserByImage().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/images/{image_id}/banUser";return i=i.replace("{image_id}",encodeURIComponent(String(e.imageId))),new c(await this.request({path:i,method:"POST",headers:a,query:{}},t))}async banUserByImage(e,t){let a=await this.banUserByImageRaw(e,t);return await a.value()}async complainAboutImageRaw(e,t){if(null==e.imageId)throw new s("imageId",'Required parameter "imageId" was null or undefined when calling complainAboutImage().');if(null==e.complainAboutImageRequest)throw new s("complainAboutImageRequest",'Required parameter "complainAboutImageRequest" was null or undefined when calling complainAboutImage().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/images/{image_id}/complain";return i=i.replace("{image_id}",encodeURIComponent(String(e.imageId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:e7(e.complainAboutImageRequest,!1)},t))}async complainAboutImage(e,t){let a=await this.complainAboutImageRaw(e,t);return await a.value()}async complainAboutVideoRaw(e,t){if(null==e.videoId)throw new s("videoId",'Required parameter "videoId" was null or undefined when calling complainAboutVideo().');if(null==e.complainAboutImageRequest)throw new s("complainAboutImageRequest",'Required parameter "complainAboutImageRequest" was null or undefined when calling complainAboutVideo().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/videos/{video_id}/complain";return i=i.replace("{video_id}",encodeURIComponent(String(e.videoId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:e7(e.complainAboutImageRequest,!1)},t))}async complainAboutVideo(e,t){let a=await this.complainAboutVideoRaw(e,t);return await a.value()}async createOnboardingProjectRaw(e,t){let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/create_onboarding_project",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{project_kind:e.projectKind,create_all:e.createAll,landing_request_id:e.landingRequestId,chat_based:e.chatBased}}(e.createOnboardingProjectRequest,!1)},t),e=>{var t;return null==(t=e)?t:{projectId:t.project_id}})}async createOnboardingProject(e={},t){let a=await this.createOnboardingProjectRaw(e,t);return await a.value()}async createPaymentRaw(e,t){if(null==e.createPaymentRequest)throw new s("createPaymentRequest",'Required parameter "createPaymentRequest" was null or undefined when calling createPayment().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/users/payments",method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{price_id:e.priceId,success_url:e.successUrl,cancel_url:e.cancelUrl,ui_mode:e.uiMode}}(e.createPaymentRequest,!1)},t),e=>e9(e,!1))}async createPayment(e,t){let a=await this.createPaymentRaw(e,t);return await a.value()}async findRecraftImagesRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/find_recraft_images",method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{type:te(e.type),filter:e.filter,image_types:null==e.imageTypes?void 0:e.imageTypes.map(F),transform_types:null==e.transformTypes?void 0:e.transformTypes.map(H),tag:e.tag,limit:e.limit,offset:e.offset,style_id:e.styleId,workspace_id:e.workspaceId,transform_model:_(e.transformModel)}}(e.findRecraftImagesRequest,!1)},t),e=>ta(e))}async findRecraftImages(e={},t){let a=await this.findRecraftImagesRaw(e,t);return await a.value()}async getAnonymousCheckoutSessionRaw(e,t){if(null==e.sessionId)throw new s("sessionId",'Required parameter "sessionId" was null or undefined when calling getAnonymousCheckoutSession().');let a={};null!=e.sessionId&&(a.session_id=e.sessionId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/users/payments/checkout-session",method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{status:t.status,paymentStatus:t.payment_status,email:null==t.email?void 0:t.email,priceId:null==t.price_id?void 0:t.price_id}})}async getAnonymousCheckoutSession(e,t){let a=await this.getAnonymousCheckoutSessionRaw(e,t);return await a.value()}async getFullOnboardingStatusRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("auth0",[]);a&&(t.Authorization=`Bearer ${a}`)}return new c(await this.request({path:"/get_onboarding_status",method:"GET",headers:t,query:{}},e),e=>{var t;return null==(t=e)?t:{status:l(t.status,eh)}})}async getFullOnboardingStatus(e){let t=await this.getFullOnboardingStatusRaw(e);return await t.value()}async getImageDetailsRaw(e,t){if(null==e.imageId)throw new s("imageId",'Required parameter "imageId" was null or undefined when calling getImageDetails().');let a={};null!=e.projectId&&(a.project_id=e.projectId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/recraft_images/{image_id}";return r=r.replace("{image_id}",encodeURIComponent(String(e.imageId))),new c(await this.request({path:r,method:"GET",headers:i,query:a},t),e=>tt(e))}async getImageDetails(e,t){let a=await this.getImageDetailsRaw(e,t);return await a.value()}async getImageDetailsDeprecatedRaw(e,t){if(null==e.recraftId)throw new s("recraftId",'Required parameter "recraftId" was null or undefined when calling getImageDetailsDeprecated().');
2if(null==e.imageId)throw new s("imageId",'Required parameter "imageId" was null or undefined when calling getImageDetailsDeprecated().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/recrafts/{recraft_id}/{image_id}";return i=(i=i.replace("{recraft_id}",encodeURIComponent(String(e.recraftId)))).replace("{image_id}",encodeURIComponent(String(e.imageId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>tt(e))}async getImageDetailsDeprecated(e,t){let a=await this.getImageDetailsDeprecatedRaw(e,t);return await a.value()}async getKYCInfoRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("auth0",[]);a&&(t.Authorization=`Bearer ${a}`)}return new c(await this.request({path:"/users/me/kyc",method:"GET",headers:t,query:{}},e),e=>{var t;return null==(t=e)?t:{status:eh(t.status),specialization:null==t.specialization?void 0:t.specialization}})}async getKYCInfo(e){let t=await this.getKYCInfoRaw(e);return await t.value()}async getMagicSegmentationRaw(e,t){if(null==e.magicSegmentationId)throw new s("magicSegmentationId",'Required parameter "magicSegmentationId" was null or undefined when calling getMagicSegmentation().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/magic_segmentation/{magic_segmentation_id}";return i=i.replace("{magic_segmentation_id}",encodeURIComponent(String(e.magicSegmentationId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{pointsOfInterest:null==t.points_of_interest?void 0:t.points_of_interest,selector:t.selector,vectorMasks:t.vector_masks.map(tr)}})}async getMagicSegmentation(e,t){let a=await this.getMagicSegmentationRaw(e,t);return await a.value()}async getMockupRaw(e,t){if(null==e.mockupId)throw new s("mockupId",'Required parameter "mockupId" was null or undefined when calling getMockup().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/mockup/{mockup_id}";return i=i.replace("{mockup_id}",encodeURIComponent(String(e.mockupId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>th(e,!1))}async getMockup(e,t){let a=await this.getMockupRaw(e,t);return await a.value()}async getOnboardingStatusRaw(e,t){if(null==e.id)throw new s("id",'Required parameter "id" was null or undefined when calling getOnboardingStatus().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/get_onboarding_status/{id}";return i=i.replace("{id}",encodeURIComponent(String(e.id))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>eb(e))}async getOnboardingStatus(e,t){let a=await this.getOnboardingStatusRaw(e,t);return await a.value()}async getPaletteRaw(e,t){if(null==e.paletteId)throw new s("paletteId",'Required parameter "paletteId" was null or undefined when calling getPalette().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/palettes/{palette_id}";return i=i.replace("{palette_id}",encodeURIComponent(String(e.paletteId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>tm(e))}async getPalette(e,t){let a=await this.getPaletteRaw(e,t);return await a.value()}async getPaymentsPortalRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling getPaymentsPortal().');let a={};null!=e.returnUrl&&(a.return_url=e.returnUrl);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/users/{user_id}/payments";return r=r.replace("{user_id}
2",encodeURIComponent(String(e.userId))),new c(await this.request({path:r,method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{portalUrl:null==t.portal_url?void 0:t.portal_url}})}async getPaymentsPortal(e,t){let a=await this.getPaymentsPortalRaw(e,t);return await a.value()}async getRecraftRaw(e,t){if(null==e.recraftId)throw new s("recraftId",'Required parameter "recraftId" was null or undefined when calling getRecraft().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/recrafts/{recraft_id}";return i=i.replace("{recraft_id}",encodeURIComponent(String(e.recraftId))),new c(await this.request({path:i,method:"POST",headers:a,query:{}},t),e=>J(e,!1))}async getRecraft(e,t){let a=await this.getRecraftRaw(e,t);return await a.value()}async getStyleRaw(e,t){if(null==e.styleId)throw new s("styleId",'Required parameter "styleId" was null or undefined when calling getStyle().');let a={};null!=e.generatedImages&&(a.generated_images=e.generatedImages),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/styles/{style_id}";return r=r.replace("{style_id}",encodeURIComponent(String(e.styleId))),new c(await this.request({path:r,method:"GET",headers:i,query:a},t),e=>tT(e))}
2async getStyle(e,t){let a=await this.getStyleRaw(e,t);return await a.value()}async getSystemStatusRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("auth0",[]);a&&(t.Authorization=`Bearer ${a}`)}return new c(await this.request({path:"/status",method:"GET",headers:t,query:{}},e),e=>{var t;return null==(t=e)?t:{service:t.service,generation:t.generation}})}async getSystemStatus(e){let t=await this.getSystemStatusRaw(e);return await t.value()}async listControlsRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("auth0",[]);a&&(t.Authorization=`Bearer ${a}`)}return new c(await this.request({path:"/list_controls",method:"GET",headers:t,query:{}},e),e=>{var t;return null==(t=e)?t:{controlsInfos:t.controls_infos.map(ts)}})}async listControls(e){let t=await this.listControlsRaw(e);return await t.value()}async listGalleryRaw(e,t){if(null==e.type)throw new s("type",'Required parameter "type" was null or undefined when calling listGallery().');let a={};null!=e.type&&(a.type=e.type),null!=e.workspaceId&&(a.workspace_id=e.workspaceId),null!=e.filter&&(a.filter=e.filter),null!=e.styleId&&(a.style_id=e.styleId),null!=e.transformModel&&(a.transform_model=e.transformModel),null!=e.imageTypes&&(a.image_types=e.imageTypes),null!=e.transformTypes&&(a.transform_types=e.transformTypes),null!=e.tag&&(a.tag=e.tag),null!=e.galleryTags&&(a.gallery_tags=e.galleryTags),null!=e.mediaTypes&&(a.media_types=e.mediaTypes),null!=e.createdFrom&&(a.created_from=e.createdFrom),null!=e.createdTo&&(a.created_to=e.createdTo),null!=e.limit&&(a.limit=e.limit),null!=e.offset&&(a.offset=e.offset);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/gallery",method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{galleryItems:t.gallery_items.map(tu)}})}async listGallery(e,t){let a=await this.listGalleryRaw(e,t);return await a.value()}async listRecraftImagesRaw(e,t){if(null==e.type)throw new s("type",'Required parameter "type" was null or undefined when calling listRecraftImages().');let a={};null!=e.type&&(a.type=e.type),null!=e.workspaceId&&(a.workspace_id=e.workspaceId),null!=e.filter&&(a.filter=e.filter),null!=e.styleId&&(a.style_id=e.styleId),null!=e.transformModel&&(a.transform_model=e.transformModel),null!=e.imageTypes&&(a.image_types=e.imageTypes),null!=e.transformTypes&&(a.transform_types=e.transformTypes),null!=e.tag&&(a.tag=e.tag),null!=e.galleryTags&&(a.gallery_tags=e.galleryTags),null!=e.createdFrom&&(a.created_from=e.createdFrom),null!=e.createdTo&&(a.created_to=e.createdTo),null!=e.limit&&(a.limit=e.limit),null!=e.offset&&(a.offset=e.offset);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/recraft_images",method:"GET",headers:i,query:a},t),e=>ta(e))}async listRecraftImages(e,t){let a=await this.listRecraftImagesRaw(e,t);return await a.value()}async onboardRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/onboard",method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{onboarding_id:e.onboardingId,onboarding_status:em(e.onboardingStatus),data:e.data}}(e.onboardingInfo,!1)},t))}async onboard(e={},t){let a=await this.onboardRaw(e,t);return await a.value()}async pingGetRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("auth0",[]);a&&(t.Authorization=`Bearer ${a}`)}return new d(await this.request({path:"/ping",method:"GET",headers:t,query:{}},e))}async pingGet(e){await this.pingGetRaw(e)}async postImageReactionRaw(e,t){if(null==e.imageId)throw new s("imageId",'Required parameter "imageId" was null or undefined when calling postImageReaction().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/images/{image_id}/reactions";return i=i.replace("{image_id}",encodeURIComponent(String(e.imageId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:tf(e.postMediaReactionRequest,!1)},t))}async postImageReaction(e,t){let a=await this.postImageReactionRaw(e,t);return await a.value()}async postImagesReactionRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/images/reactions",method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{reaction:tw(e.reaction),cancel:e.cancel,reason:e.reason,image_ids:e.imageIds}}(e.postImagesReactionRequest,!1)},t))}async postImagesReaction(e={},t){let a=await this.postImagesReactionRaw(e,t);return await a.value()}async postMediaReactionsRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/media/reactions",method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{reaction:tw(e.reaction),cancel:e.cancel,reason:e.reason,image_ids:e.imageIds,video_ids:e.videoIds}}(e.postMediaReactionsRequest,!1)},t))}async postMediaReactions(e={},t){let a=await this.postMediaReactionsRaw(e,t);return await a.value()}async postVideoReactionRaw(e,t){if(null==e.videoId)throw new s("videoId",'Required parameter "videoId" was null or undefined when calling postVideoReaction().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/videos/{video_id}/reactions";return i=i.replace("{video_id}",encodeURIComponent(String(e.videoId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:tf(e.postMediaReactionRequest,!1)},t))}async postVideoReaction(e,t){let a=await this.postVideoReactionRaw(e,t);return await a.value()}async removeStylePublicLinkRaw(e,t){if(null==e.styleId)throw new s("styleId",'Required parameter "styleId" was null or undefined when calling removeStylePublicLink().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/styles/{style_id}/public_access";return i=i.replace("{style_id}",encodeURIComponent(String(e.styleId))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{}},t))}async removeStylePublicLink(e,t){let a=await this.removeStylePublicLinkRaw(e,t);return await a.value()}async resetOnboardingRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("auth0",[]);a&&(t.Authorization=`Bearer ${a}`)}return new c(await this.request({path:"/onboard",method:"DELETE",headers:t,query:{}},e))}async resetOnboarding(e){let t=await this.resetOnboardingRaw(e);return await t.value()}async resetSingleOnboardingRaw(e,t){if(null==e.id)throw new s("id",'Required parameter "id" was null or undefined when calling resetSingleOnboarding().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/onboard/{id}";return i=i.replace("{id}",encodeURIComponent(String(e.id))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{}},t))}async resetSingleOnboarding(e,t){let a=await this.resetSingleOnboardingRaw(e,t);return await a.value()}async saveBugReportRaw(e,t){if(null==e.bugReport)throw new s("bugReport",'Required parameter "bugReport" was null or undefined when calling saveBugReport().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/bug_reports",method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{subject:e.subject,message:e.message,details:e.details}}(e.bugReport,!1)},t))}async saveBugReport(e,t){let a=await this.saveBugReportRaw(e,t);return await a.value()}async saveUserSurveyRaw(e,t){if(null==e.surveyId)throw new s("surveyId",'Required parameter "surveyId" was null or undefined when calling saveUserSurvey().');
2if(null==e.body)throw new s("body",'Required parameter "body" was null or undefined when calling saveUserSurvey().');let a={};null!=e.surveyId&&(a.survey_id=e.surveyId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/user_surveys",method:"POST",headers:i,query:a,body:e.body},t))}async saveUserSurvey(e,t){let a=await this.saveUserSurveyRaw(e,t);return await a.value()}async setGalleryTagsForImageRaw(e,t){if(null==e.imageId)throw new s("imageId",'Required parameter "imageId" was null or undefined when calling setGalleryTagsForImage().');if(null==e.setGalleryTagsRequest)throw new s("setGalleryTagsRequest",'Required parameter "setGalleryTagsRequest" was null or undefined when calling setGalleryTagsForImage().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/recraft_images/{image_id}/gallery_tags";return i=i.replace("{image_id}",encodeURIComponent(String(e.imageId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:ty(e.setGalleryTagsRequest,!1)},t))}async setGalleryTagsForImage(e,t){let a=await this.setGalleryTagsForImageRaw(e,t);return await a.value()}async setGalleryTagsForVideoRaw(e,t){if(null==e.videoId)throw new s("videoId",'Required parameter "videoId" was null or undefined when calling setGalleryTagsForVideo().');if(null==e.setGalleryTagsRequest)throw new s("setGalleryTagsRequest",'Required parameter "setGalleryTagsRequest" was null or undefined when calling setGalleryTagsForVideo().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/recraft_videos/{video_id}/gallery_tags";return i=i.replace("{video_id}",encodeURIComponent(String(e.videoId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:ty(e.setGalleryTagsRequest,!1)},t))}async setGalleryTagsForVideo(e,t){let a=await this.setGalleryTagsForVideoRaw(e,t);return await a.value()}async setImagePublicityRaw(e,t){if(null==e.imageId)throw new s("imageId",'Required parameter "imageId" was null or undefined when calling setImagePublicity().');if(null==e.setPublicityRequest)throw new s("setPublicityRequest",'Required parameter "setPublicityRequest" was null or undefined when calling setImagePublicity().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/recraft_images/{image_id}/publicity";return i=i.replace("{image_id}",encodeURIComponent(String(e.imageId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:tI(e.setPublicityRequest,!1)},t))}async setImagePublicity(e,t){let a=await this.setImagePublicityRaw(e,t);return await a.value()}async setVideoPublicityRaw(e,t){if(null==e.videoId)throw new s("videoId",'Required parameter "videoId" was null or undefined when calling setVideoPublicity().');if(null==e.setPublicityRequest)throw new s("setPublicityRequest",'Required parameter "setPublicityRequest" was null or undefined when calling setVideoPublicity().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/recraft_videos/{video_id}/publicity";return i=i.replace("{video_id}",encodeURIComponent(String(e.videoId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:tI(e.setPublicityRequest,!1)},t))}async setVideoPublicity(e,t){let a=await this.setVideoPublicityRaw(e,t);return await a.value()}async shareStyleOverLinkRaw(e,t){if(null==e.styleId)throw new s("styleId",'Required parameter "styleId" was null or undefined when calling shareStyleOverLink().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/styles/{style_id}/public_access";return i=i.replace("{style_id}",encodeURIComponent(String(e.styleId))),new c(await this.request({path:i,method:"POST",headers:a,query:{}},t))}async shareStyleOverLink(e,t){let a=await this.shareStyleOverLinkRaw(e,t);return await a.value()}async suggestPromptsRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/suggest_prompts",method:"POST",headers:a,query:{},body:t_(e.promptSuggestRequest,!1)},t),e=>{var t;return null==(t=e)?t:{promptSuggests:t.prompt_suggests.map(tq)}})}async suggestPrompts(e={},t){let a=await this.suggestPromptsRaw(e,t);return await a.value()}async userPaymentRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling userPayment().');if(null==e.userPaymentRequest)throw new s("userPaymentRequest",'Required parameter "userPaymentRequest" was null or undefined when calling userPayment().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/users/{user_id}/payments";return i=i.replace("{user_id}
2",encodeURIComponent(String(e.userId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{price_id:e.priceId,product_id:e.productId,success_url:e.successUrl,cancel_url:e.cancelUrl,ui_mode:e.uiMode,quantity:e.quantity,trial:e.trial,try_instant_payment:e.tryInstantPayment}}(e.userPaymentRequest,!1)},t),e=>tS(e,!1))}async userPayment(e,t){let a=await this.userPaymentRaw(e,t);return await a.value()}}],494439),e.s(["FontsApi",0,class extends r{async deleteFontRaw(e,t){if(null==e.fontId)throw new s("fontId",'Required parameter "fontId" was null or undefined when calling deleteFont().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/fonts/{font_id}";return i=i.replace("{font_id}",encodeURIComponent(String(e.fontId))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{}},t))}async deleteFont(e,t){let a=await this.deleteFontRaw(e,t);return await a.value()}async downloadFontRaw(e,t){if(null==e.fontId)throw new s("fontId",'Required parameter "fontId" was null or undefined when calling downloadFont().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/fonts/{font_id}";return i=i.replace("{font_id}",encodeURIComponent(String(e.fontId))),new p(await this.request({path:i,method:"GET",headers:a,query:{}},t))}async downloadFont(e,t){let a=await this.downloadFontRaw(e,t);return await a.value()}async listFontsRaw(e,t){let a={};null!=e.limit&&(a.limit=e.limit),null!=e.offset&&(a.offset=e.offset),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/fonts",method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{fonts:t.fonts.map(tj)}})}async listFonts(e={},t){let a=await this.listFontsRaw(e,t);return await a.value()}async modifyFontRaw(e,t){if(null==e.fontId)throw new s("fontId",'Required parameter "fontId" was null or undefined when calling modifyFont().');if(null==e.modifyFontRequest)throw new s("modifyFontRequest",'Required parameter "modifyFontRequest" was null or undefined when calling modifyFont().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/fonts/{font_id}";return i=i.replace("{font_id}",encodeURIComponent(String(e.fontId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{name:e.name}}(e.modifyFontRequest,!1)},t),e=>tj(e))}async modifyFont(e,t){let a=await this.modifyFontRaw(e,t);return await a.value()}async uploadFontRaw(e,t){let a;if(null==e.file)throw new s("file",'Required parameter "file" was null or undefined when calling uploadFont().');if(null==e.name)throw new s("name",'Required parameter "name" was null or undefined when calling uploadFont().');let i={};null!=e.workspaceId&&(i.workspace_id=e.workspaceId);let r={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(r.Authorization=`Bearer ${t}`)}let n=u([{contentType:"multipart/form-data"}]);return a=n?new FormData:new URLSearchParams,null!=e.file&&a.append("file",e.file),null!=e.name&&a.append("name",e.name),new c(await this.request({path:"/fonts",method:"POST",headers:r,query:i,body:a},t),e=>tj(e))}async uploadFont(e,t){let a=await this.uploadFontRaw(e,t);return await a.value()}}],586836),e.s(["SignImageHashRequestContentTypeEnum",0,{ImagePng:"image/png",ImageJpeg:"image/jpeg",ImageSvgxml:"image/svg+xml"},"SignImageHashRequestToJSON",0,tA],624675);function tU(e,t){return null==e?e:{imageId:null==e.image_id?void 0:e.image_id}}function tx(e){var t;return null==(t=e)?t:{colors:t.colors.map(O),backgroundColor:null==t.background_color?void 0:O(t.background_color),paletteId:t.palette_id}}function tB(e){return e}function tO(e){var t,a=e;if(null==a)return a;return{priceId:a.price_id,amount:a.amount,currency:null==a.currency?void 0:a.currency,recurring:null==a.recurring?void 0:null==(t=a.recurring)?t:{interval:null==t.interval?void 0:tB(t.
2interval),trialPeriodDays:null==t.trial_period_days?void 0:t.trial_period_days}}}function tz(e){var t;return null==(t=e)?t:{name:t.name,description:t.description,productId:t.product_id,planTextId:t.plan_text_id,prices:t.prices.map(tO),meta:t.meta,refillPeriod:eR(t.refill_period),creditsPerPeriod:t.credits_per_period,features:ek(t.features,!1),flags:eT(t.flags,!1)}}function tE(e){var t;return null==(t=e)?t:{credits:t.credits,expireDays:null==t.expire_days?void 0:t.expire_days,productId:t.product_id,price:tO(t.price),meta:t.meta}}function t$(e){var t;return null==(t=e)?t:{name:t.name,description:t.description,productId:t.product_id,planTextId:t.plan_text_id,trialPeriodDays:t.trial_period_days,trialDiscount:t.trial_discount,refillPeriod:eR(t.refill_period),creditsPerPeriod:t.credits_per_period,isFree:t.is_free,addons:t.addons,features:ek(t.features,!1),flags:eT(t.flags,!1),prices:t.prices.map(tO),meta:t.meta}}function tD(e){var t;return null==(t=e)?t:{shapeType:t.shape_type,styleIndex:t.style_index,svgPath:null==t.svg_path?void 0:t.svg_path}}function tG(e){return function(e,t=!1){return null==e?e:{shape_type:e.shapeType,style_index:e.styleIndex,svg_path:e.svgPath}}(e,!1)}function tM(e){var t;return null==(t=e)?t:{rgbaHex:null==t.rgba_hex?void 0:t.rgba_hex}}function tF(e){return function(e,t=!1){return null==e?e:{rgba_hex:e.rgbaHex}}(e,!1)}e.s(["DownloadImageRasterImageContentTypeEnum",0,{ImagePng:"image/png",ImageWebp:"image/webp",ImageJpeg:"image/jpeg"},"ImageApi",0,class extends r{async batchDownloadImagesRaw(e,t){if(null==e.imageId)throw new s("imageId",'Required parameter "imageId" was null or undefined when calling batchDownloadImages().');let a={};null!=e.imageId&&(a.image_id=e.imageId),null!=e.rasterImageContentType&&(a.raster_image_content_type=e.rasterImageContentType);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new p(await this.request({path:"/image/batch-download",method:"GET",headers:i,query:a},t))}async batchDownloadImages(e,t){let a=await this.batchDownloadImagesRaw(e,t);return await a.value()}async deleteImageRaw(e,t){if(null==e.imageId)throw new s("imageId",'Required parameter "imageId" was null or undefined when calling deleteImage().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/image/{image_id}";return i=i.replace("{image_id}",encodeURIComponent(String(e.imageId))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{}},t))}async deleteImage(e,t){let a=await this.deleteImageRaw(e,t);return await a.value()}async downloadImageRaw(e,t){if(null==e.imageId)throw new s("imageId",'Required parameter "imageId" was null or undefined when calling downloadImage().');let a={};null!=e.rector&&(a.rector=e.rector),null!=e.rasterImageContentType&&(a.raster_image_content_type=e.rasterImageContentType),null!=e.visibleWatermark&&(a.visible_watermark=e.visibleWatermark),null!=e.filename&&(a.filename=e.filename);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/image/{image_id}";return r=r.replace("{image_id}",encodeURIComponent(String(e.imageId))),new p(await this.request({path:r,method:"GET",headers:i,query:a},t))}async downloadImage(e,t){let a=await this.downloadImageRaw(e,t);return await a.value()}async getCommunityRecraftImagesRaw(e,t){let a={};null!=e.limit&&(a.limit=e.limit),null!=e.offset&&(a.offset=e.offset),null!=e.transformModel&&(a.transform_model=e.transformModel),null!=e.tag&&(a.tag=e.tag),null!=e.imageTypes&&(a.image_types=e.imageTypes),null!=e.transformTypes&&(a.transform_types=e.transformTypes);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/images/community",method:"GET",headers:i,query:a},t),e=>ta(e))}async getCommunityRecraftImages(e={},t){let a=await this.getCommunityRecraftImagesRaw(e,t);return await a.value()}async getImagesLinksRaw(e,t){if(null==e.imageId)throw new s("imageId",'Required parameter "imageId" was null or undefined when calling getImagesLinks().');let a={};null!=e.imageId&&(a.image_id=e.imageId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/images/links",method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{links:t.links}})}async getImagesLinks(e,t){let a=await this.getImagesLinksRaw(e,t);return await a.value()}async getLikedRecraftImagesRaw(e,t){let a={};
2null!=e.filter&&(a.filter=e.filter),null!=e.limit&&(a.limit=e.limit),null!=e.offset&&(a.offset=e.offset),null!=e.transformModel&&(a.transform_model=e.transformModel),null!=e.imageTypes&&(a.image_types=e.imageTypes),null!=e.transformTypes&&(a.transform_types=e.transformTypes),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/images/liked",method:"GET",headers:i,query:a},t),e=>ta(e))}async getLikedRecraftImages(e={},t){let a=await this.getLikedRecraftImagesRaw(e,t);return await a.value()}async getRandomCommunityRecraftImagesRaw(e,t){let a={};null!=e.filter&&(a.filter=e.filter),null!=e.limit&&(a.limit=e.limit),null!=e.offset&&(a.offset=e.offset),null!=e.transformModel&&(a.transform_model=e.transformModel),null!=e.tag&&(a.tag=e.tag),null!=e.imageTypes&&(a.image_types=e.imageTypes),null!=e.transformTypes&&(a.transform_types=e.transformTypes),null!=e.styleId&&(a.style_id=e.styleId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/images/community/random",method:"GET",headers:i,query:a},t),e=>ta(e))}async getRandomCommunityRecraftImages(e={},t){let a=await this.getRandomCommunityRecraftImagesRaw(e,t);return await a.value()}async getRawCommunityRecraftImagesRaw(e,t){let a={};null!=e.filter&&(a.filter=e.filter),null!=e.limit&&(a.limit=e.limit),null!=e.offset&&(a.offset=e.offset),null!=e.transformModel&&(a.transform_model=e.transformModel),null!=e.imageTypes&&(a.image_types=e.imageTypes),null!=e.transformTypes&&(a.transform_types=e.transformTypes),null!=e.styleId&&(a.style_id=e.styleId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/images/community/raw",method:"GET",headers:i,query:a},t),e=>ta(e))}async getRawCommunityRecraftImages(e={},t){let a=await this.getRawCommunityRecraftImagesRaw(e,t);return await a.value()}async getRecraftImagesHistoryRaw(e,t){let a={};null!=e.filter&&(a.filter=e.filter),null!=e.limit&&(a.limit=e.limit),null!=e.offset&&(a.offset=e.offset),null!=e.styleId&&(a.style_id=e.styleId),null!=e.transformModel&&(a.transform_model=e.transformModel),null!=e.imageTypes&&(a.image_types=e.imageTypes),null!=e.transformTypes&&(a.transform_types=e.transformTypes),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/images/history",method:"GET",headers:i,query:a},t),e=>ta(e))}async getRecraftImagesHistory(e={},t){let a=await this.getRecraftImagesHistoryRaw(e,t);return await a.value()}async getStylesRecraftImagesRaw(e,t){let a={};null!=e.filter&&(a.filter=e.filter),null!=e.limit&&(a.limit=e.limit),null!=e.offset&&(a.offset=e.offset),null!=e.transformModel&&(a.transform_model=e.transformModel);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/images/styles",method:"GET",headers:i,query:a},t),e=>ta(e))}async getStylesRecraftImages(e={}
2,t){let a=await this.getStylesRecraftImagesRaw(e,t);return await a.value()}async searchCommunityRecraftImagesRaw(e,t){let a={};null!=e.filter&&(a.filter=e.filter),null!=e.limit&&(a.limit=e.limit),null!=e.offset&&(a.offset=e.offset),null!=e.transformModel&&(a.transform_model=e.transformModel),null!=e.imageTypes&&(a.image_types=e.imageTypes),null!=e.transformTypes&&(a.transform_types=e.transformTypes);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/images/community/search",method:"GET",headers:i,query:a},t),e=>ta(e))}async searchCommunityRecraftImages(e={},t){let a=await this.searchCommunityRecraftImagesRaw(e,t);return await a.value()}async signImageHashRaw(e,t){if(null==e.signImageHashRequest)throw new s("signImageHashRequest",'Required parameter "signImageHashRequest" was null or undefined when calling signImageHash().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/image/sign_hash",method:"POST",headers:a,query:{},body:tA(e.signImageHashRequest)},t),e=>{var t;return null==(t=e)?t:{signed:t.signed,manifest:null==t.manifest?void 0:t.manifest,offset:null==t.offset?void 0:t.offset,length:null==t.length?void 0:t.length}})}async signImageHash(e,t){let a=await this.signImageHashRaw(e,t);return await a.value()}async uploadAndDownloadImageRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId),null!=e.type&&(a.type=e.type),null!=e.sourceImageId&&(a.source_image_id=e.sourceImageId),null!=e.rasterImageContentType&&(a.raster_image_content_type=e.rasterImageContentType),null!=e.visibleWatermark&&(a.visible_watermark=e.visibleWatermark);let i={};if(i["Content-Type"]="image/*",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new p(await this.request({path:"/image/upload_and_download",method:"POST",headers:i,query:a,body:e.body},t))}async uploadAndDownloadImage(e={},t){let a=await this.uploadAndDownloadImageRaw(e,t);return await a.value()}async uploadImageRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId),null!=e.type&&(a.type=e.type),null!=e.sourceImageId&&(a.source_image_id=e.sourceImageId);let i={};if(i["Content-Type"]="image/*",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/image",method:"POST",headers:i,query:a,body:e.body},t),e=>tU(e,!1))}async uploadImage(e={},t){let a=await this.uploadImageRaw(e,t);return await a.value()}async uploadImageRectorRaw(e,t){if(null==e.imageId)throw new s("imageId",'Required parameter "imageId" was null or undefined when calling uploadImageRector().');let a={};if(a["Content-Type"]="*",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/image/{image_id}/rector";return i=i.replace("{image_id}",encodeURIComponent(String(e.imageId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:e.body},t))}async uploadImageRector(e,t){let a=await this.uploadImageRectorRaw(e,t);return await a.value()}},"UploadAndDownloadImageRasterImageContentTypeEnum",0,{ImagePng:"image/png",ImageWebp:"image/webp",ImageJpeg:"image/jpeg"}],747596),e.s(["BatchDownloadMediaRasterImageContentTypeEnum",0,{ImagePng:"image/png",ImageWebp:"image/webp",ImageJpeg:"image/jpeg"},"MediaApi",0,class extends r{async batchDownloadMediaRaw(e,t){let a={};null!=e.imageId&&(a.image_id=e.imageId),null!=e.videoId&&(a.video_id=e.videoId),null!=e.imageFilename&&(a.image_filename=e.imageFilename),null!=e.videoFilename&&(a.video_filename=e.videoFilename),null!=e.rasterImageContentType&&(a.raster_image_content_type=e.rasterImageContentType),null!=e.visibleWatermark&&(a.visible_watermark=e.visibleWatermark);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new p(await this.request({path:"/media/batch-download",method:"GET",headers:i,query:a},t))}async batchDownloadMedia(e={},t){let a=await this.batchDownloadMediaRaw(e,t);return await a.value()}}
2],991145),e.s(["PaletteApi",0,class extends r{async addPaletteRaw(e,t){if(null==e.paletteSuggest)throw new s("paletteSuggest",'Required parameter "paletteSuggest" was null or undefined when calling addPalette().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/palettes",method:"POST",headers:i,query:a,body:tg(e.paletteSuggest,!1)},t),e=>{var t;return null==(t=e)?t:{paletteId:t.palette_id}})}async addPalette(e,t){let a=await this.addPaletteRaw(e,t);return await a.value()}async addPaletteFromImageRaw(e,t){let a={};null!=e.imageId&&(a.image_id=e.imageId),null!=e.save&&(a.save=e.save),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="image/*",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/palettes/fromImage",method:"POST",headers:i,query:a,body:e.body},t),e=>tx(e))}async addPaletteFromImage(e={},t){let a=await this.addPaletteFromImageRaw(e,t);return await a.value()}async deletePaletteRaw(e,t){if(null==e.paletteId)throw new s("paletteId",'Required parameter "paletteId" was null or undefined when calling deletePalette().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/palettes/{palette_id}";return i=i.replace("{palette_id}",encodeURIComponent(String(e.paletteId))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{}},t))}async deletePalette(e,t){let a=await this.deletePaletteRaw(e,t);return await a.value()}async listPalettesRaw(e,t){let a={};null!=e.limit&&(a.limit=e.limit),null!=e.offset&&(a.offset=e.offset),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/palettes",method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{data:t.data.map(tx)}})}async listPalettes(e={},t){let a=await this.listPalettesRaw(e,t);return await a.value()}async updatePaletteRaw(e,t){if(null==e.paletteId)throw new s("paletteId",'Required parameter "paletteId" was null or undefined when calling updatePalette().');if(null==e.paletteSuggest)throw new s("paletteSuggest",'Required parameter "paletteSuggest" was null or undefined when calling updatePalette().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/palettes/{palette_id}";return i=i.replace("{palette_id}",encodeURIComponent(String(e.paletteId))),new c(await this.request({path:i,method:"PUT",headers:a,query:{},body:tg(e.paletteSuggest,!1)},t))}async updatePalette(e,t){let a=await this.updatePaletteRaw(e,t);return await a.value()}}],983383),e.s(["ProductPriceInterval",0,{Month:"month",Year:"year"},"ProductPriceIntervalFromJSON",0,tB],963788),e.s(["ProductApi",0,class extends r{async getProductsRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("auth0",[]);a&&(t.Authorization=`Bearer ${a}`)}return new c(await this.request({path:"/products",method:"GET",headers:t,query:{}},e),e=>(function(e){var t;if(null==e)return e;return{subscriptions:e.subscriptions.map(t$),workspaceSubscriptions:e.workspace_subscriptions.map(tz),creditPacks:e.credit_packs.map(tE),apiCreditPacks:e.api_credit_packs.map(tE),workspaceCreditPacks:e.workspace_credit_packs.map(tE),flags:null==(t=e.flags)?t:{credits:t.credits}}})(e))}async getProducts(e){let t=await this.getProductsRaw(e);return await t.value()}}],34771);function tW(e,t){return null==e?e:{x:e.x,y:e.y}}function tL(e,t=!1){return null==e?e:{x:e.x,y:e.y}}function tV(e){var t;return null==(t=e)?t:{styleType:t.style_type,solidColor:null==t.solid_color?void 0:tM(t.solid_color),startColor:null==t.start_color?void 0:tM(t.start_color),finishColor:null==t.finish_color?void 0:tM(t.finish_color),startPoint:null==t.start_point?void 0:tW(t.start_point,!1),finishPoint:null==t.finish_point?void 0:tW(t.finish_point,!1)}}function tN(e){return function(e,t=!1){return null==e?e:{style_type:e.styleType,solid_color:tF(e.solidColor),start_color:tF(e.startColor),finish_color:tF(e.finishColor),start_point:tL(e.startPoint,!1),finish_point:tL(e.finishPoint,!1)}}(e,!1)}function tH(e){var t;return null==(t=e)?t:{fill:tV(t.fill),stroke:tV(t.stroke),strokeWidth:null==t.stroke_width?void 0:t.stroke_width,strokeCap:null==t.stroke_cap?void 0:t.stroke_cap,strokeJoin:null==t.stroke_join?void 0:t.stroke_join}}function tJ(e){return function(e,t=!1){return null==e?e:{fill:tN(e.fill),stroke:tN(e.stroke),stroke_width:e.strokeWidth,stroke_cap:e.strokeCap,stroke_join:e.strokeJoin}}(e,!1)}e.s(["FillStyleFromJSON",0,tV,"FillStyleStyleTypeEnum",0,{None:"none",Solid:"solid",Linear:"linear"},"FillStyleToJSON",0,tN],944183);function tK(e){var t;return null==(t=e)?t:{version:t.version,width:t.width,height:t.height,styles:t.styles.map(tH),shapes:t.shapes.map(tD),hierarchy:null==t.hierarchy?void 0:function e(t){return function(t){if(null==t)return t;switch(t.type){case"ElementNode":return Object.assign({},null==t?t:{type:t.type,shapeIdx:t.shapeIdx},{type:"ElementNode"});case"GroupNode":return Object.assign({},null==t?t:{type:t.type,children:t.children.map(e)},{type:"GroupNode"});default:return t}}(t)}(t.hierarchy)}}function tQ(e){return function(e,t=!1){return null==e?e:{version:e.version,width:e.width,height:e.height,styles:e.styles.map(tJ),shapes:e.shapes.map(tG),hierarchy:function e(t){return function(t,a=!1){if(null==t)return t;switch(t.type){case"ElementNode":return Object.assign({},function(e,t=!1){return null==e?e:{type:e.type,shapeIdx:e.shapeIdx}}(t,!1),{type:"ElementNode"});case"GroupNode":return Object.assign({},function(t,a=!1){return null==t?t:{type:t.type,children:t.children.map(e)}}(t,!1),{type:"GroupNode"});default:return t}}(t,!1)}(e.hierarchy)}}(e,!1)}e.s(["RectorFromJSON",0,tK,"RectorToJSON",0,tQ],25285);function tY(e,t=!1){return null==e?e:{rector:tQ(e.rector),animate_params:function(e,t=!1){return null==e?e:{num_frames:e.numFrames}}(e.animateParams,!1)}}function tX(e){return function(e,t=!1){return null==e?e:{data_url:e.dataUrl}}(e,!1)}function tZ(e,t){var a;if(null==e)return e;return{lottie:null==(a=e.lottie)?a:{dataUrl:a.data_url},credits:e.credits}}function t0(e,t){return null==e?e:{nonbgColorsSuperset:null==e.nonbg_colors_superset?void 0:e.nonbg_colors_superset.map(tM),bgColor:null==e.bg_color?void 0:tM(e.bg_color),preset
2:null==e.preset?void 0:e.preset}}function t1(e){return function(e,t=!1){return null==e?e:{nonbg_colors_superset:null==e.nonbgColorsSuperset?void 0:e.nonbgColorsSuperset.map(tF),bg_color:tF(e.bgColor),preset:e.preset}}(e,!1)}function t2(e,t=!1){return null==e?e:{image:tX(e.image),image_invariants:t1(e.imageInvariants),return_vector:e.returnVector,fast:e.fast,return_mask:e.returnMask,image_id:v(e.imageId)}}function t4(e,t){return null==e?e:{result:null==e.result?void 0:I(e.result),requestId:e.request_id,svg:null==e.svg?void 0:I(e.svg),rector:null==e.rector?void 0:tK(e.rector),imageInvariants:null==e.image_invariants?void 0:t0(e.image_invariants,!1),width:e.width,height:e.height,credits:e.credits}}function t3(e,t=!1){return null==e?e:{image:v(e.image),random_seed:e.randomSeed}}function t5(e,t){return null==e?e:{caption:e.caption,requestId:e.request_id,credits:e.credits}}function t6(e,t=!1){return null==e?e:{style_refs:e.styleRefs.map(v),random_seed:e.randomSeed}}function t8(e,t){return null==e?e:{styleCaption:e.style_caption,credits:e.credits}}function t7(e){var t;return null==(t=e)?t:{text:t.text,bbox:t.bbox}}function t9(e){return function(e,t=!1){return null==e?e:{text:e.text,bbox:e.bbox}}(e,!1)}function ae(e){var t;return null==(t=e)?t:{imageId:t.image_id,transparent:t.transparent,vectorImage:t.vector_image,rector:null==t.rector?void 0:tK(t.rector),imageInvariants:null==t.image_invariants?void 0:t0(t.image_invariants,!1),isNsfw:null==t.is_nsfw?void 0:t.is_nsfw,mockupSurfaceId:null==t.mockup_surface_id?void 0:t.mockup_surface_id,textLayout:null==t.text_layout?void 0:t.text_layout.map(t7),height:t.height,width:t.width,textToStyleCluster:null==t.text_to_style_cluster?void 0:t.text_to_style_cluster}}function at(e){var t;return null==(t=e)?t:{videoId:t.video_id,thumbnailImageId:I(t.thumbnail_image_id),height:t.height,width:t.width,resolution:Z(t.resolution),duration:t.duration,audio:t.audio}}function aa(e){var t;return null==(t=e)?t:{images:t.images.map(ae),videos:t.videos.map(at),requestId:t.request_id,width:t.width,height:t.height,randomSeed:t.random_seed,imageSetId:null==t.image_set_id?void 0:t.image_set_id,imageSetStyleId:null==t.image_set_style_id?void 0:t.image_set_style_id,credits:t.credits,creditsExact:null==t.credits_exact?void 0:t.credits_exact,imageType:null==t.image_type?void 0:M(t.image_type),transformType:N(t.transform_type),transformModel:null==t.transform_model?void 0:f(t.transform_model),styleId:null==t.style_id?void 0:t.style_id}}function ai(e){return e}function ar(e){return e}function an(e){var t;return null==(t=e)?t:{userId:null==t.user_id?void 0:t.user_id,email:t.email,name:null==t.name?void 0:t.name,image:null==t.image?void 0:t.image,accessLevel:null==t.access_level?void 0:ai(t.access_level)}}function ao(e){var t;return null==(t=e)?t:{id:t.id,images:t.images.map(I),previewImageId:null==t.preview_image_id?void 0:I(t.preview_image_id),previewImageVersion:null==t.preview_image_version?void 0:t.preview_image_version,coverImageId:null==t.cover_image_id?void 0:I(t.cover_image_id),title:t.title,createTime:t.create_time,updateTime:null==t.update_time?void 0:t.update_time,lastLoadTime:null==t.last_load_time?void 0:t.last_load_time,tags:null==t.tags?void 0:t.tags,ownedByMe:null==t.owned_by_me?void 0:t.owned_by_me,readOnly:null==t.read_only?void 0:t.read_only,sharedWithOther:null==t.shared_with_other?void 0:t.shared_with_other}}e.s(["GenerateImageResponseFromJSON",0,aa],122572),e.s(["ProjectAccessLevel",0,{Owner:"owner",Editor:"editor",Commenter:"commenter",Viewer:"viewer"},"ProjectAccessLevelFromJSON",0,ai,"ProjectAccessLevelToJSON",0,ar],612331);function as(e,t=!1){return null==e?e:{image:v(e.image),selectable_points:e.selectablePoints}}function al(e,t){return null==e?e:{magicSegmentationId:e.magic_segmentation_id,requestId:e.request_id,credits:e.credits}}function au(e,t=!1){return null==e?e:{image:tX(e.image),image_invariants:t1(e.imageInvariants),image_id:v(e.imageId)}}function ac(e,t){return null==e?e:{result:I(e.result),imageInvariants:null==e.image_invariants?void 0:t0(e.image_invariants,!1),requestId:e.request_id,credits:e.credits,width:e.width,height:e.height}}function ad(e,t=!1){return null==e?e:{image:tX(e.image),image_invariants:t1(e.imageInvariants),extra_params:function(e,t=!1){return null==e?e:{...e,tear_gradient_relative_threshold:e.tearGradientRelativeThreshold,color_model_error_threshold:e.colorModelErrorThreshold,simplify_geometry:e.simplifyGeometry,colors:function(e,t=!1){return null==e?e:{...e,colors:function(e,t=!1){return null==e?e:{color_rgb_colors:e.colorRgbColors,color_rgb_weights:e.colorRgbWeights,color_rgb_bg:e.colorRgbBg}}(e.colors,!1),strictly_2_colors:e.strictly2Colors,binary_transparency:e.binaryTransparency,disable_gradient_fills:e.disableGradientFills,strict_color_reduction:e.strictColorReduction,join_gradients:e.joinGradients,do_remove_background:e.doRemoveBackgroun
2d,strict_color_palette:e.strictColorPalette}}(e.colors,!1),color_reduction:e.colorReduction,small_shape_filter:e.smallShapeFilter,shape_stacking:D(e.shapeStacking),svg_compression:e.svgCompression,max_num_shapes:e.maxNumShapes,max_num_colors:e.maxNumColors,weak_denoiser_for_small_shapes:e.weakDenoiserForSmallShapes}}(e.extraParams,!1),image_id:v(e.imageId),shape_stacking:D(e.shapeStacking)}}function ap(e,t){return null==e?e:{requestId:e.request_id,svg:I(e.svg),rector:null==e.rector?void 0:tK(e.rector),superResolution:null==e.super_resolution?void 0:I(e.super_resolution),imageInvariants:null==e.image_invariants?void 0:t0(e.image_invariants,!1),width:e.width,height:e.height,credits:e.credits}}e.s(["ProjectApi",0,class extends r{async authProjectRoomRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling authProjectRoom().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}/auth";return i=i.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:i,method:"POST",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{token:t.token}})}async authProjectRoom(e,t){let a=await this.authProjectRoomRaw(e,t);return await a.value()}async copyProjectRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling copyProject().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/project/{project_id}/copy";return r=r.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:r,method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{title:e.title}}(e.copyProjectRequest,!1)},t),e=>ao(e))}async copyProject(e,t){let a=await this.copyProjectRaw(e,t);return await a.value()}async createMockupRaw(e,t){let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/create_mockup",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{image:v(e.image)}}(e.createMockupRequest,!1)},t),e=>{var t;return null==(t=e)?t:{result:null==t.result?void 0:th(t.result,!1),credits:t.credits}})}async createMockup(e={},t){let a=await this.createMockupRaw(e,t);return await a.value()}async createProjectRaw(e,t){if(null==e.createProjectRequest)throw new s("createProjectRequest",'Required parameter "createProjectRequest" was null or undefined when calling createProject().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/project",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{tags:e.tags}}(e.createProjectRequest,!1)},t),e=>ao(e))}async createProject(e,t){let a=await this.createProjectRaw(e,t);return await a.value()}async deleteProjectRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling deleteProject().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}";return i=i.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{}},t))}async deleteProject(e,t){let a=await this.deleteProjectRaw(e,t);return await a.value()}async downloadProjectImageRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling downloadProjectImage().');if(null==e.imageId)throw new s("imageId",'Required parameter "imageId" was null or undefined when calling downloadProjectImage().');let a={};null!=e.rector&&(a.rector=e.rector);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/project/{project_id}/image/{image_id}";return r=(r=r.replace("{project_id}",encodeURIComponent(String(e.projectId)))).replace("{image_id}",encodeURIComponent(String(e.imageId))),new p(await this.request({path:r,method:"GET",headers:i,query:a},t))}async downloadProjectImage(e,t){let a=await this.downloadProjectImageRaw(e,t);return await a.value()}async getProjectImageDetailsRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling getProjectImageDetails().');
2if(null==e.imageId)throw new s("imageId",'Required parameter "imageId" was null or undefined when calling getProjectImageDetails().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}/image/{image_id}/details";return i=(i=i.replace("{project_id}",encodeURIComponent(String(e.projectId)))).replace("{image_id}",encodeURIComponent(String(e.imageId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>tt(e))}async getProjectImageDetails(e,t){let a=await this.getProjectImageDetailsRaw(e,t);return await a.value()}async getProjectPreviewRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling getProjectPreview().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}";return i=i.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>ao(e))}async getProjectPreview(e,t){let a=await this.getProjectPreviewRaw(e,t);return await a.value()}async getProjectVideoDetailsRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling getProjectVideoDetails().');if(null==e.videoId)throw new s("videoId",'Required parameter "videoId" was null or undefined when calling getProjectVideoDetails().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}/video/{video_id}/details";return i=(i=i.replace("{project_id}",encodeURIComponent(String(e.projectId)))).replace("{video_id}",encodeURIComponent(String(e.videoId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>tl(e,!1))}async getProjectVideoDetails(e,t){let a=await this.getProjectVideoDetailsRaw(e,t);return await a.value()}async listPaletteHistoryRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling listPaletteHistory().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}/list_palette_history";return i=i.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{minSize:e.minSize,maxSize:e.maxSize,offset:e.offset,limit:e.limit}}(e.paletteSuggestRequest,!1)},t),e=>{var t;return null==(t=e)?t:{paletteSuggests:t.palette_suggests.map(tm)}})}async listPaletteHistory(e,t){let a=await this.listPaletteHistoryRaw(e,t);return await a.value()}async listProjectCollaboratorsRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling listProjectCollaborators().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}/collaborators";return i=i.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{collaborators:t.collaborators.map(an),linkAccessLevel:null==t.link_access_level?void 0:ai(t.link_access_level)}})}async listProjectCollaborators(e,t){let a=await this.listProjectCollaboratorsRaw(e,t);return await a.value()}async listProjectImagesRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling listProjectImages().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}/images";return i=i.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{images:t.images.map(I)}})}async listProjectImages(e,t){let a=await this.listProjectImagesRaw(e,t);return await a.value()}async listProjectMediaRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling listProjectMedia().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}/media";return i=i.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{media:t.media.map(tu)}})}async listProjectMedia(e,t){let a=await this.listProjectMediaRaw(e,t);return await a.value()}async listProjectVideosRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling listProjectVideos().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}/videos";return i=i.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{videos:t.videos.map(q)}})}async listProjectVideos(e,t){let a=await this.listProjectVideosRaw(e,t);return await a.value()}async listProjectsRaw(e,t){let a={};null!=e.limit&&(a.limit=e.limit),null!=e.offset&&(a.offset=e.offset),null!=e.order&&(a.order=e.order),null!=e.workspaceId&&(a.workspace_id=e.workspaceId),null!=e.ownershipFilter&&(a.ownership_filter=e.ownershipFilter),null!=e.sortBy&&(a.sort_by=e.sortBy),null!=e.userId&&(a.user_id=e.userId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/project",method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{projects:t.projects.map(ao)}})}async listProjects(e={},t){let a=await this.listProjectsRaw(e,t);return await a.value()}async listPromptHistoryRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling listPromptHistory().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}/list_prompt_history";return i=i.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:t_(e.promptSuggestRequest,!1)},t),e=>{var t;return null==(t=e)?t:{promptSuggests:t.prompt_suggests.map(tq)}})}async listPromptHistory(e,t){let a=await this.listPromptHistoryRaw(e,t);return await a.value()}async listStyleHistoryRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling listStyleHistory().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}/list_style_history";return i=i.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{offset:e.offset,limit:e.limit}}(e.styleSuggestRequest,!1)},t),e=>{var t;return null==(t=e)?t:{styleSuggests:t.style_suggests.map(I)}})}async listStyleHistory(e,t){let a=await this.listStyleHistoryRaw(e,t);return await a.value()}async pollProjectRecraftRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling pollProjectRecraft().');if(null==e.operationId)throw new s("operationId",'Required parameter "operationId" was null or undefined when calling pollProjectRecraft().');let a={};null!=e.proxied&&(a.proxied=e.proxied),null!=e.requestImageData&&(a.request_image_data=e.requestImageData),null!=e.operationId&&(a.operation_id=e.operationId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/project/{project_id}/poll_recraft";return r=r.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:r,method:"GET",headers:i,query:a},t),e=>aa(e))}async pollProjectRecraft(e,t){let a=await this.pollProjectRecraftRaw(e,t);switch(a.raw.status){case 200:default:return await a.value();case 202:return null}}async projectAnimateRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling projectAnimate().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/project/{project_id}/animate";return r=r.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:r,method:"POST",headers:i,query:a,body:tY(e.animateImageRequest,!1)},t),e=>tZ(e,!1))}async projectAnimate(e,t){let a=await this.projectAnimateRaw(e,t);return await a.value()}async projectDescribeImageRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling projectDescribeImage().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/project/{project_id}/describe_image";return r=r.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:r,method:"POST",headers:i,query:a,body:t3(e.describeImageRequest,!1)},t),e=>t5(e,!1))}async projectDescribeImage(e,t){let a=await this.projectDescribeImageRaw(e,t);return await a.value()}async projectDescribeStyleRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling projectDescribeStyle().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/project/{project_id}/describe_style";return r=r.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:r,method:"POST",headers:i,query:a,body:t6(e.describeStyleRequest,!1)},t),e=>t8(e,!1))}async projectDescribeStyle(e,t){let a=await this.projectDescribeStyleRaw(e,t);return await a.value()}async projectMagicSelectRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling projectMagicSelect().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/project/{project_id}/magic_select";return r=r.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:r,method:"POST",headers:i,query:a,body:as(e.magicSelectRequest,!1)},t),e=>al(e,!1))}async projectMagicSelect(e,t){let a=await this.projectMagicSelectRaw(e,t);return await a.value()}
2async projectRemoveBackgroundRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling projectRemoveBackground().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/project/{project_id}/remove_background";return r=r.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:r,method:"POST",headers:i,query:a,body:t2(e.backgroundRemoveRequest,!1)},t),e=>t4(e,!1))}async projectRemoveBackground(e,t){let a=await this.projectRemoveBackgroundRaw(e,t);return await a.value()}async projectSuperResolutionRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling projectSuperResolution().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/project/{project_id}/super_resolution";return r=r.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:r,method:"POST",headers:i,query:a,body:au(e.superResolutionRequest,!1)},t),e=>ac(e,!1))}async projectSuperResolution(e,t){let a=await this.projectSuperResolutionRaw(e,t);return await a.value()}async projectVectorizeRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling projectVectorize().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/project/{project_id}/vectorize";return r=r.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:r,method:"POST",headers:i,query:a,body:ad(e.vectorizeImageRequest,!1)},t),e=>ap(e,!1))}async projectVectorize(e,t){let a=await this.projectVectorizeRaw(e,t);return await a.value()}async removeProjectCollaboratorRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling removeProjectCollaborator().');if(null==e.email)throw new s("email",'Required parameter "email" was null or undefined when calling removeProjectCollaborator().');let a={};null!=e.email&&(a.email=e.email);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/project/{project_id}/collaborators";return r=r.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:r,method:"DELETE",headers:i,query:a},t))}async removeProjectCollaborator(e,t){let a=await this.removeProjectCollaboratorRaw(e,t);return await a.value()}async requestProjectAccessRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling requestProjectAccess().');if(null==e.requestProjectAccessRequest)throw new s("requestProjectAccessRequest",'Required parameter "requestProjectAccessRequest" was null or undefined when calling requestProjectAccess().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}/request_access";return i=i.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{access_level:ar(e.accessLevel)}}(e.requestProjectAccessRequest,!1)},t))}async requestProjectAccess(e,t){let a=await this.requestProjectAccessRaw(e,t);return await a.value()}async resetCoverImageRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling resetCoverImage().');if(null==e.body)throw new s("body",'Required parameter "body" was null or undefined when calling resetCoverImage().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}/cover";return i=i.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{},body:e.body},t))}async resetCoverImage(e,t){let a=await this.resetCoverImageRaw(e,t);return await a.value()}async resetProjectPreviewRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling resetProjectPreview().');
2if(null==e.body)throw new s("body",'Required parameter "body" was null or undefined when calling resetProjectPreview().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}/preview";return i=i.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{},body:e.body},t))}async resetProjectPreview(e,t){let a=await this.resetProjectPreviewRaw(e,t);return await a.value()}async updateCoverImageRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling updateCoverImage().');if(null==e.updateCoverImageRequest)throw new s("updateCoverImageRequest",'Required parameter "updateCoverImageRequest" was null or undefined when calling updateCoverImage().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}/cover";return i=i.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{image:v(e.image)}}(e.updateCoverImageRequest,!1)},t))}async updateCoverImage(e,t){let a=await this.updateCoverImageRaw(e,t);return await a.value()}async updateProjectLinkAccessLevelRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling updateProjectLinkAccessLevel().');if(null==e.updateProjectLinkAccessLevelRequest)throw new s("updateProjectLinkAccessLevelRequest",'Required parameter "updateProjectLinkAccessLevelRequest" was null or undefined when calling updateProjectLinkAccessLevel().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}/link_access_level";return i=i.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{link_access_level:ar(e.linkAccessLevel)}}(e.updateProjectLinkAccessLevelRequest,!1)},t))}async updateProjectLinkAccessLevel(e,t){let a=await this.updateProjectLinkAccessLevelRaw(e,t);return await a.value()}async updateProjectPreviewRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling updateProjectPreview().');if(null==e.updateProjectPreviewRequest)throw new s("updateProjectPreviewRequest",'Required parameter "updateProjectPreviewRequest" was null or undefined when calling updateProjectPreview().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}";return i=i.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{images:null==e.images?void 0:e.images.map(v),title:e.title,tags:e.tags}}(e.updateProjectPreviewRequest,!1)},t))}async updateProjectPreview(e,t){let a=await this.updateProjectPreviewRaw(e,t);return await a.value()}async uploadProjectImageRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling uploadProjectImage().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId),null!=e.type&&(a.type=e.type),null!=e.sourceImageId&&(a.source_image_id=e.sourceImageId);let i={};if(i["Content-Type"]="image/*",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/project/{project_id}/image";return r=r.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:r,method:"POST",headers:i,query:a,body:e.body},t),e=>tU(e,!1))}async uploadProjectImage(e,t){let a=await this.uploadProjectImageRaw(e,t);return await a.value()}async uploadProjectImageRectorRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling uploadProjectImageRector().');if(null==e.imageId)throw new s("imageId",'Required parameter "imageId" was null or undefined when calling uploadProjectImageRector().');let a={};if(a["Content-Type"]="*",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}/image/{image_id}/rector";return i=(i=i.replace("{project_id}",encodeURIComponent(String(e.projectId)))).replace("{image_id}",encodeURIComponent(String(e.imageId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:e.body},t))}async uploadProjectImageRector(e,t){let a=await this.uploadProjectImageRectorRaw(e,t);return await a.value()}async uploadProjectPreviewRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling uploadProjectPreview().');let a={};if(a["Content-Type"]="image/*",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}/preview";return i=i.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:e.body},t))}async uploadProjectPreview(e,t){let a=await this.uploadProjectPreviewRaw(e,t);return await a.value()}async upsertProjectCollaboratorRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling upsertProjectCollaborator().');if(null==e.upsertProjectCollaboratorRequest)throw new s("upsertProjectCollaboratorRequest",'Required parameter "upsertProjectCollaboratorRequest" was null or undefined when calling upsertProjectCollaborator().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}/collaborators";return i=i.replace("{project_id}",encodeURIComponent(String(e.projectId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{email:e.email,user_id:e.userId,access_level:ar(e.accessLevel)}}(e.upsertProjectCollaboratorRequest,!1)},t))}async upsertProjectCollaborator(e,t){let a=await this.upsertProjectCollaboratorRaw(e,t);return await a.value()}}],96344),e.s(["PromptApi",0,class extends r{async enhancePromptRaw(e,t){if(null==e.enhancePromptRequest)throw new s("enhancePromptRequest",'Required parameter "enhancePromptRequest" was null or undefined when calling enhancePrompt().');let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/enhance_prompt",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{prompt:e.prompt,system_prompt_id:e.systemPromptId}}(e.enhancePromptRequest,!1)},t),e=>{var t;return null==(t=e)?t:{enhancedPrompt:t.enhanced_prompt}})}async enhancePrompt(e,t){let a=await this.enhancePromptRaw(e,t);return await a.value()}}],430801);function ah(e,t=!1){return null==e?e:{prompt:e.prompt,image_type:F(e.imageType),negative_prompt:e.negativePrompt,user_controls:V(e.userControls),layer_size:en(e.layerSize),random_seed:e.randomSeed,image_set_id:e.imageSetId,style_refs:null==e.styleRefs?void 0:e.styleRefs.map(v),style_id:e.styleId,style_match:T(e.styleMatch),num_images_per_prompt:e.numImagesPerPrompt,private:e._private,developer_params:e.developerParams,transform_model:_(e.transformModel),creativity:e.creativity,text_layout:null==e.textLayout?void 0:e.textLayout.map(t9),source_images:null==e.sourceImages?void 0:e.sourceImages.map(v),attached_images:null==e.attachedImages?void 0:e.attachedImages.map(v)}}function am(e){var t;return null==(t=e)?t:{operationId:null==t.operationId?void 0:t.operationId,singleItemOperationIds:null==t.singleItemOperationIds?void 0:t.singleItemOperationIds}}function ag(e,t){var a;if(null==e)return e;return{operationId:null==e.operationId?void 0:e.operationId,cost:null==e.cost?void 0:e.cost,outputImageSize:null==e.output_image_size?void 0:null==(a=e.output_image_size)?a:{height:a.height,width:a.width}}}function aw(e){return e}e.s(["RecraftApi",0,class extends r{async animateRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/recraft/animate",method:"POST",headers:i,query:a,body:tY(e.animateImageRequest,!1)},t),e=>tZ(e,!1))}async animate(e={},t){let a=await this.animateRaw(e,t);return await a.value()}async describeImageRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/recraft/describe_image",method:"POST",headers:i,query:a,body:t3(e.describeImageRequest,!1)},t),e=>t5(e,!1))}async describeImage(e={},t){let a=await this.describeImageRaw(e,t);return await a.value()}async describeStyleRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/recraft/describe_style",method:"POST",headers:i,query:a,body:t6(e.describeStyleRequest,!1)},t),e=>t8(e,!1))}async describeStyle(e={},t){let a=await this.describeStyleRaw(e,t);return await a.value()}async getImageUpscaleControlsRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("auth0",[]);a&&(t.Authorization=`Bearer ${a}`)}return new c(await this.request({path:"/image_upscale/controls",method:"GET",headers:t,query:{}},e),e=>e.map(e_))}async getImageUpscaleControls(e){let t=await this.getImageUpscaleControlsRaw(e);return await t.value()}async getLabellingTaskRaw(e,t){if(null==e.source)throw new s("source",'Required parameter "source" was null or undefined when calling getLabellingTask().');let a={};null!=e.source&&(a.source=e.source);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/labelling_tasks",method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{source:null==t.source?void 0:t.source,recraftId:null==t.recraft_id?void 0:t.recraft_id,taskId:null==t.task_id?void 0:t.task_id,prompt:null==t.prompt?void 0:t.prompt,imageIdLeft:null==t.image_id_left?void 0:t.image_id_left,imageIdRight:null==t.image_id_right?void 0:t.image_id_right,statsLabelled:t.stats_labelled,statsSkip:t.stats_skip,statsAll:t.stats_all}})}async getLabellingTask(e,t){let a=await this.getLabellingTaskRaw(e,t);return await a.value()}
2async getRefineDetailsControlsRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("auth0",[]);a&&(t.Authorization=`Bearer ${a}`)}return new c(await this.request({path:"/refine_details/controls",method:"GET",headers:t,query:{}},e),e=>e.map(ey))}async getRefineDetailsControls(e){let t=await this.getRefineDetailsControlsRaw(e);return await t.value()}async magicSelectRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/recraft/magic_select",method:"POST",headers:i,query:a,body:as(e.magicSelectRequest,!1)},t),e=>al(e,!1))}async magicSelect(e={},t){let a=await this.magicSelectRaw(e,t);return await a.value()}async pollRecraftRaw(e,t){if(null==e.operationId)throw new s("operationId",'Required parameter "operationId" was null or undefined when calling pollRecraft().');let a={};null!=e.proxied&&(a.proxied=e.proxied),null!=e.requestImageData&&(a.request_image_data=e.requestImageData),null!=e.operationId&&(a.operation_id=e.operationId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/poll_recraft",method:"GET",headers:i,query:a},t),e=>aa(e))}async pollRecraft(e,t){let a=await this.pollRecraftRaw(e,t);switch(a.raw.status){case 200:default:return await a.value();case 202:return null}}async postLabellingTaskRaw(e,t){if(null==e.postLabellingTaskRequest)throw new s("postLabellingTaskRequest",'Required parameter "postLabellingTaskRequest" was null or undefined when calling postLabellingTask().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/labelling_tasks",method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{source:e.source,recraft_id:e.recraftId,task_id:e.taskId,prompt:e.prompt,image_id_left:e.imageIdLeft,image_id_right:e.imageIdRight,preference:e.preference}}(e.postLabellingTaskRequest,!1)},t))}async postLabellingTask(e,t){let a=await this.postLabellingTaskRaw(e,t);return await a.value()}async queueCaptionsToImageRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/queue_recraft/captions_to_image",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{prompt:e.prompt,image_type:F(e.imageType),negative_prompt:e.negativePrompt,user_controls:V(e.userControls),layer_size:en(e.layerSize),random_seed:e.randomSeed,image_set_id:e.imageSetId,style_refs:null==e.styleRefs?void 0:e.styleRefs.map(v),style_id:e.styleId,style_match:T(e.styleMatch),num_images_per_prompt:e.numImagesPerPrompt,private:e._private,developer_params:e.developerParams,transform_model:_(e.transformModel),text_layout:null==e.textLayout?void 0:e.textLayout.map(t9),source_images:e.sourceImages.map(v)}}(e.captionsToImageRequest,!1)},t),e=>am(e))}async queueCaptionsToImage(e={},t){let a=await this.queueCaptionsToImageRaw(e,t);return await a.value()}async queueEnhanceRealismRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/queue_recraft/enhance_realism",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{images:e.images.map(v),layer_size:en(e.layerSize),transform_model:_(e.transformModel),private:e._private,developer_params:e.developerParams}}(e.enhanceRealismRequest,!1)},t),e=>am(e))}async queueEnhanceRealism(e={},t){let a=await this.queueEnhanceRealismRaw(e,t);return await a.value()}async queueEraseRegionRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/queue_recraft/erase_region",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{image:v(e.image),image_invariants:t1(e.imageInvariants),source_image_id:v(e.sourceImageId),source_image_invariants:t1(e.sourceImageInvariants),mask:tX(e.mask),return_vector:e.returnVector,transform_model:_(e.transformModel)}}(e.eraseRegionRequest,!1)},t),e=>am(e))}async queueEraseRegion(e={},t){let a=await this.queueEraseRegionRaw(e,t);return await a.value()}async queueExploreRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/queue_recraft/explore",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{prompt:e.prompt,negative_prompt:e.negativePrompt,num_images:e.numImages,liked_image:v(e.likedImage),similarity:e.similarity,image_type:F(e.imageType),transform_model:_(e.transformModel),user_controls:V(e.userControls),layer_size:en(e.layerSize),random_seed:e.randomSeed,private:e._private}}(e.exploreRequest,!1)},t),e=>am(e))}async queueExplore(e={},t){let a=await this.queueExploreRaw(e,t);return await a.value()}async queueGenerativeUpscaleRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/queue_recraft/generative_upscale",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{image:v(e.image),image_invariants:t1(e.imageInvariants),source_image_id:v(e.sourceImageId),source_image_invariants:t1(e.sourceImageInvariants),random_seed:e.randomSeed,return_vector:e.returnVector,developer_params:e.developerParams,upscale:e.upscale}}(e.generativeUpscaleRequest,!1)},t),e=>am(e))}async queueGenerativeUpscale(e={},t){let a=await this.queueGenerativeUpscaleRaw(e,t);return await a.value()}async queueImageEditRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/queue_recraft/image_edit",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{prompt:e.prompt,images:e.images.map(v),image_type:F(e.imageType),negative_prompt:e.negativePrompt,user_controls:V(e.userControls),layer_size:en(e.layerSize),random_seed:e.randomSeed,image_set_id:e.imageSetId,style_refs:null==e.styleRefs?void 0:e.styleRefs.map(v),style_id:e.styleId,style_match:T(e.styleMatch),num_images_per_prompt:e.numImagesPerPrompt,private:e._private,developer_params:e.developerParams,transform_model:_(e.transformModel),text_layout:null==e.textLayout?void 0:e.textLayout.map(t9)}}(e.imageEditRequest,!1)},t),e=>am(e))}async queueImageEdit(e={},t){let a=await this.queueImageEditRaw(e,t);return await a.value()}async queueImageToImageRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/queue_recraft/image_to_image",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{prompt:e.prompt,image:v(e.image),image_invariants:t1(e.imageInvariants),source_image_id:v(e.sourceImageId),source_image_invariants:t1(e.sourceImageInvariants),strength:e.strength,image_type:F(e.imageType),negative_prompt:e.negativePrompt,user_controls:V(e.userControls),layer_size:en(e.layerSize),random_seed:e.randomSeed,image_set_id:e.imageSetId,style_refs:null==e.styleRefs?void 0:e.styleRefs.map(v),style_id:e.styleId,style_match:T(e.styleMatch),num_images_per_prompt:e.numImagesPerPrompt,private:e._private,developer_params:e.developerParams,transform_model:_(e.transformModel),text_layout:null==e.textLayout?void 0:e.textLayout.map(t9)}}(e.imageToImageRequest,!1)},t),e=>am(e))}async queueImageToImage(e={},t){let a=await this.queueImageToImageRaw(e,t);return await a.value()}async queueImageToVideoRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/queue_recraft/image_to_video",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{prompt:e.prompt,video_type:F(e.videoType),first_frame_image:v(e.firstFrameImage),last_frame_image:v(e.lastFrameImage),negative_prompt:e.negativePrompt,resolution:e.resolution,duration:e.duration,generate_audio:e.generateAudio,user_controls:V(e.userControls),layer_size:en(e.layerSize),random_seed:e.randomSeed,style_id:e.styleId,private:e._private,developer_params:e.developerParams,transform_model:_(e.transformModel)}}(e.imageToVideoRequest,!1)},t),e=>am(e))}async queueImageToVideo(e={},t){let a=await this.queueImageToVideoRaw(e,t);return await a.value()}async queueImageUpscaleRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId),null!=e.dryRun&&(a.dry_run=e.dryRun);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/queue_recraft/image_upscale",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{transform_model:_(e.transformModel),image:v(e.image),image_invariants:t1(e.imageInvariants),source_image_id:v(e.sourceImageId),source_image_invariants:t1(e.sourceImageInvariants),c
2ontrols:e.controls,random_seed:e.randomSeed,return_vector:e.returnVector,developer_params:e.developerParams}}(e.imageUpscaleRequest,!1)},t),e=>ag(e,!1))}async queueImageUpscale(e={},t){let a=await this.queueImageUpscaleRaw(e,t);return await a.value()}async queueInpaintRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/queue_recraft/inpaint",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{prompt:e.prompt,image:v(e.image),image_invariants:t1(e.imageInvariants),mask:tX(e.mask),source_image_id:v(e.sourceImageId),source_image_invariants:t1(e.sourceImageInvariants),image_type:F(e.imageType),negative_prompt:e.negativePrompt,user_controls:V(e.userControls),random_seed:e.randomSeed,image_set_id:e.imageSetId,style_refs:null==e.styleRefs?void 0:e.styleRefs.map(v),style_id:e.styleId,style_match:T(e.styleMatch),num_images_per_prompt:e.numImagesPerPrompt,private:e._private,developer_params:e.developerParams,transform_model:_(e.transformModel),text_layout:null==e.textLayout?void 0:e.textLayout.map(t9)}}(e.inpaintRequest,!1)},t),e=>am(e))}async queueInpaint(e={},t){let a=await this.queueInpaintRaw(e,t);return await a.value()}async queueLandingGenerationRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/queue_recraft/landing_generation",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{landing_request_id:e.landingRequestId}}(e.landingGenerationRequest,!1)},t),e=>am(e))}async queueLandingGeneration(e={},t){let a=await this.queueLandingGenerationRaw(e,t);return await a.value()}async queuePromptToImageRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId),null!=e.requestSingleItemOperations&&(a.request_single_item_operations=e.requestSingleItemOperations);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/queue_recraft/prompt_to_image",method:"POST",headers:i,query:a,body:ah(e.promptToImageRequest,!1)},t),e=>am(e))}async queuePromptToImage(e={},t){let a=await this.queuePromptToImageRaw(e,t);return await a.value()}async queuePromptToMockupRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/queue_recraft/prompt_to_mockup",method:"POST",headers:i,query:a,body:ah(e.promptToImageRequest,!1)},t),e=>am(e))}async queuePromptToMockup(e={},t){let a=await this.queuePromptToMockupRaw(e,t);return await a.value()}async queuePromptToVideoRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/queue_recraft/prompt_to_video",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{prompt:e.prompt,video_type:F(e.videoType),negative_prompt:e.negativePrompt,resolution:e.resolution,duration:e.duration,generate_audio:e.generateAudio,user_controls:V(e.userControls),layer_size:en(e.layerSize),random_seed:e.randomSeed,style_id:e.styleId,private:e._private,developer_params:e.developerParams,transform_model:_(e.transformModel)}}(e.promptToVideoRequest,!1)},t),e=>am(e))}async queuePromptToVideo(e={},t){let a=await this.queuePromptToVideoRaw(e,t);return await a.value()}async queuePromptsToImageSetRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/queue_recraft/prompts_to_image_set",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{prompts:e.prompts,image_type:F(e.imageType),negative_prompt:e.negativePrompt,user_controls:V(e.userControls),layer_size:en(e.layerSize),random_seed:e.randomSeed,image_set_id:e.imageSetId,style_refs:null==e.styleRefs?void 0:e.styleRefs.map(v),style_id:e.styleId,style_match:T(e.styleMatch),num_images_per_prompt:e.numImagesPerPrompt,developer_params:e.developerParams,transform_model:_(e.transformModel),text_layouts:e.textLayouts}}(e.promptsToImageSetRequest,!1)},t),e=>am(e))}async queuePromptsToImageSet(e={},t){let a=await this.queuePromptsToImageSetRaw(e,t);return await a.value()}async queueRefineDetailsRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId),null!=e.dryRun&&(a.dry_run=e.dryRun);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/queue_recraft/refine_details",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{transform_model:_(e.transformModel),image:v(e.image),controls:e.controls}}(e.refineDetailsRequest,!1)},t),e=>ag(e,!1))}
2async queueRefineDetails(e={},t){let a=await this.queueRefineDetailsRaw(e,t);return await a.value()}async queueReplaceBackgroundRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/queue_recraft/replace_background",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{prompt:e.prompt,image:v(e.image),image_invariants:t1(e.imageInvariants),mask:tX(e.mask),source_image_id:v(e.sourceImageId),source_image_invariants:t1(e.sourceImageInvariants),image_type:F(e.imageType),negative_prompt:e.negativePrompt,user_controls:V(e.userControls),random_seed:e.randomSeed,image_set_id:e.imageSetId,style_refs:null==e.styleRefs?void 0:e.styleRefs.map(v),style_id:e.styleId,style_match:T(e.styleMatch),num_images_per_prompt:e.numImagesPerPrompt,private:e._private,developer_params:e.developerParams,transform_model:_(e.transformModel),text_layout:null==e.textLayout?void 0:e.textLayout.map(t9)}}(e.replaceBackgroundRequest,!1)},t),e=>am(e))}async queueReplaceBackground(e={},t){let a=await this.queueReplaceBackgroundRaw(e,t);return await a.value()}async queueVariateRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/queue_recraft/variate",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{image:v(e.image),image_invariants:t1(e.imageInvariants),source_image_id:v(e.sourceImageId),random_seed:e.randomSeed,layer_size:en(e.layerSize),return_vector:e.returnVector,num_images_per_prompt:e.numImagesPerPrompt,private:e._private,developer_params:e.developerParams,text_layout:null==e.textLayout?void 0:e.textLayout.map(t9),transform_model:_(e.transformModel)}}(e.variateRequest,!1)},t),e=>am(e))}async queueVariate(e={},t){let a=await this.queueVariateRaw(e,t);return await a.value()}async removeBackgroundRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/recraft/remove_background",method:"POST",headers:i,query:a,body:t2(e.backgroundRemoveRequest,!1)},t),e=>t4(e,!1))}async removeBackground(e={},t){let a=await this.removeBackgroundRaw(e,t);return await a.value()}async superResolutionRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/super_resolution",method:"POST",headers:a,query:{},body:au(e.superResolutionRequest,!1)},t),e=>ac(e,!1))}async superResolution(e={},t){let a=await this.superResolutionRaw(e,t);return await a.value()}async vectorizeRaw(e,t){let a={};null!=e.projectId&&(a.project_id=e.projectId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/recraft/vectorize",method:"POST",headers:i,query:a,body:ad(e.vectorizeImageRequest,!1)},t),e=>ap(e,!1))}async vectorize(e={},t){let a=await this.vectorizeRaw(e,t);return await a.value()}}],477972),e.s(["SettingApi",0,class extends r{async getCurrentUserSettingsRaw(e,t){let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId),null!=e.key&&(a.key=e.key);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/users/me/settings",method:"GET",headers:i,query:a},t))}async getCurrentUserSettings(e={},t){let a=await this.getCurrentUserSettingsRaw(e,t);return await a.value()}async getProjectUserSettingsRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling getProjectUserSettings().');
2if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling getProjectUserSettings().');let a={};null!=e.key&&(a.key=e.key);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/project/{project_id}/settings/{user_id}";return r=(r=r.replace("{project_id}",encodeURIComponent(String(e.projectId)))).replace("{user_id}",encodeURIComponent(String(e.userId))),new c(await this.request({path:r,method:"GET",headers:i,query:a},t))}async getProjectUserSettings(e,t){let a=await this.getProjectUserSettingsRaw(e,t);return await a.value()}async getUserSettingsRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling getUserSettings().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId),null!=e.key&&(a.key=e.key);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/users/{user_id}/settings";return r=r.replace("{user_id}",encodeURIComponent(String(e.userId))),new c(await this.request({path:r,method:"GET",headers:i,query:a},t))}async getUserSettings(e,t){let a=await this.getUserSettingsRaw(e,t);return await a.value()}async resetProjectUserSettingsRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling resetProjectUserSettings().');if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling resetProjectUserSettings().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}/settings/{user_id}";return i=(i=i.replace("{project_id}",encodeURIComponent(String(e.projectId)))).replace("{user_id}",encodeURIComponent(String(e.userId))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{}},t))}async resetProjectUserSettings(e,t){let a=await this.resetProjectUserSettingsRaw(e,t);return await a.value()}async setProjectUserSettingRaw(e,t){if(null==e.projectId)throw new s("projectId",'Required parameter "projectId" was null or undefined when calling setProjectUserSetting().');if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling setProjectUserSetting().');if(null==e.body)throw new s("body",'Required parameter "body" was null or undefined when calling setProjectUserSetting().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/project/{project_id}/settings/{user_id}";return i=(i=i.replace("{project_id}",encodeURIComponent(String(e.projectId)))).replace("{user_id}",encodeURIComponent(String(e.userId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:e.body},t))}async setProjectUserSetting(e,t){let a=await this.setProjectUserSettingRaw(e,t);return await a.value()}async setUserSettingRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling setUserSetting().');if(null==e.body)throw new s("body",'Required parameter "body" was null or undefined when calling setUserSetting().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/users/{user_id}/settings";return i=i.replace("{user_id}",encodeURIComponent(String(e.userId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:e.body},t))}async setUserSetting(e,t){let a=await this.setUserSettingRaw(e,t);return await a.value()}}],433165);function af(e,t=!1){return null==e?e:{list:aw(e.list),style:function(e,t=!1){return null==e?e:{style_id:e.styleId,image_type:F(e.imageType),transform_model:_(e.transformModel)}}(e.style,!1)}}e.s(["SavedStyleList",0,{SavedStyleListSaved:"saved",SavedStyleListPinned:"pinned"},"SavedStyleListToJSON",0,aw],528425);function a_(e,t){return null==e?e:{styles:e.styles.map(tT)}}function ay(e){return e}function aI(e){var t,a,i=e;if(null==i)return i;return{transformModel:f(i.transform_model),mediaType:Y(i.media_type),isExternal:i.is_external,price:ef(i.price),defaultStyleId:i.default_style_id,supports:null==(t=i.supports)?t:{styleReferences:t.style_references,promptBasedStyleReference:t.prompt_based_
2style_reference},controls:null==(a=i.controls)?a:{styleReferences:a.style_references},provider:ay(i.provider),displayName:i.display_name,tags:i.tags}}function av(e){var t;return null==(t=e)?t:{userStyle:tT(t.user_style)}}function ak(e){return e}function aR(e){return e}function aT(e){var t;return null==(t=e)?t:{username:t.username,email:null==t.email?void 0:t.email,name:null==t.name?void 0:t.name,image:null==t.image?void 0:t.image,role:ak(t.role)}}function aq(e){return function(e,t=!1){return null==e?e:{type:e.type,user_id:e.userId,style_id:e.styleId,query:e.query,image_types:null==e.imageTypes?void 0:e.imageTypes.map(F),transform_model:_(e.transformModel),offset:e.offset,limit:e.limit,include_drafts:e.includeDrafts}}(e,!1)}function aS(e){var t;return null==(t=e)?t:{templateId:t.template_id,type:t.type,name:t.name,coverImageId:null==t.cover_image_id?void 0:t.cover_image_id,description:t.description,published:t.published,priority:t.priority,data:t.data,groupId:null==t.group_id?void 0:t.group_id}}e.s(["ProviderEnum",0,{ProviderRecraft:"recraft",ProviderOpenai:"openai",ProviderBlackForestLabs:"black_forest_labs",ProviderGoogle:"google",ProviderBytedance:"bytedance",ProviderIdeogram:"ideogram",ProviderXai:"xai",ProviderKrea:"krea",ProviderAlibaba:"alibaba",ProviderKuaishou:"kuaishou",ProviderPixverse:"pixverse",ProviderMinimax:"minimax",ProviderLuma:"luma",ProviderImagineart:"imagineart",ProviderNvidia:"nvidia",ProviderHidream:"hidream",ProviderReve:"reve",ProviderHiggsfield:"higgsfield",ProviderOther:"other"},"ProviderEnumFromJSON",0,ay],520394),e.s(["StyleUserRole",0,{Owner:"owner",Viewer:"viewer"},"StyleUserRoleFromJSON",0,ak,"StyleUserRoleToJSON",0,aR],395904),e.s(["ListStylesRequestToJSON",0,aq,"ListStylesRequestTypeEnum",0,{UserStyles:"user_styles",CommunityStyles:"community_styles",CuratedStyles:"curated_styles",SharedWithMeStyles:"shared_with_me_styles"}],748523),e.s(["StyleApi",0,class extends r{async addSavedStyleRaw(e,t){if(null==e.addSavedStyleRequest)throw new s("addSavedStyleRequest",'Required parameter "addSavedStyleRequest" was null or undefined when calling addSavedStyle().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/saved_styles",method:"POST",headers:i,query:a,body:af(e.addSavedStyleRequest,!1)},t),e=>av(e))}async addSavedStyle(e,t){let a=await this.addSavedStyleRaw(e,t);return await a.value()}async addStyleRaw(e,t){if(null==e.addStyleRequest)throw new s("addStyleRequest",'Required parameter "addStyleRequest" was null or undefined when calling addStyle().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/styles",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{image_type:F(e.imageType),style_images:null==e.styleImages?void 0:e.styleImages.map(v),style_images_weights:e.styleImagesWeights,source_styles:e.sourceStyles,source_styles_weights:e.sourceStylesWeights,preview_image_id:e.previewImageId,name:e.name,transform_model:_(e.transformModel),match:T(e.match),is_private:e.isPrivate,is_draft:e.isDraft,prompt:e.prompt,tags:e.tags,use_style_template:e.useStyleTemplate,colors:null==e.colors?void 0:e.colors.map(z),background_color:z(e.backgroundColor)}}(e.addStyleRequest,!1)},t),e=>{var t;return null==(t=e)?t:{id:t.id,imageId:t.image_id,previewImageId:null==t.preview_image_id?void 0:t.preview_image_id,mediaType:Y(t.media_type),imageType:M(t.image_type),parentImageType:tR(t.parent_image_type),imageTypeFormat:ei(t.image_type_format),name:null==t.name?void 0:t.name,slug:t.slug,styleImages:null==t.style_images?void 0:t.style_images.map(I),styleImagesWeights:null==t.style_images_weights?void 0:t.style_images_weights,sourceStyles:null==t.source_styles?void 0:t.source_styles,sourceStylesWeights:null==t.source_styles_weights?void 0:t.source_styles_weights,generatedImages:null==t.generated_images?void 0:t.generated_images.map(I),galleryTags:null==t.gallery_tags?void 0:t.gallery_tags,galleryImageIds:null==t.gallery_image_ids?void 0:t.gallery_image_ids,isPrivate:t.is_private,isDefault:t.is_default,owner:null==t.owner?void 0:tv(t.owner),transformModel:f(t.transform_model),transformModelFamily:t.transform_model_family.map(f),match:R(t.match),isDraft:t.is_draft,prompt:null==t.prompt?void 0:t.prompt,tags:t.tags,rankDebug:null==t.rank_debug?void 0:t.rank_debug,likesCount:t.likes_count,dislikesCount:t.dislikes_count,accessType:tk(t.access_type),limit:null==t.limit?void 0:t.limit,usageCount:null==t.usage_count?void 0:t.usage_count,colors:null==t.colors?void 0:t.colors.map(O),backgroundColor:null==t.background_color?void 0:O(t.background_color),useStyleTemplate:t.use_style_template,controls:to(t.controls,!1),supports:tn(t.supports,!1),price:ef(t.price),styleId:t.style_id}})}async addStyle(e,t){let a=await this.addStyleRaw(e,t);return await a.value()}async deleteSavedStyleRaw(e,t){if(null==e.addSavedStyleRequest)throw new s("addSavedStyleRequest",'Required parameter "addSavedStyleRequest" was null or undefined when calling deleteSavedStyle().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/saved_styles",method:"DELETE",headers:i,query:a,body:af(e.addSavedStyleRequest,!1)},t))}async deleteSavedStyle(e,t){let a=await this.deleteSavedStyleRaw(e,t);return await a.value()}async deleteStyleRaw(e,t){if(null==e.styleId)throw new s("styleId",'Required parameter "styleId" was null or undefined when calling deleteStyle().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/styles/{style_id}";return i=i.replace("{style_id}",encodeURIComponent(String(e.styleId))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{}},t))}async deleteStyle(e,t){let a=await this.deleteStyleRaw(e,t);return await a.value()}async deleteStyleWorkspaceRaw(e,t){if(null==e.styleId)throw new s("styleId",'Required parameter "styleId" was null or undefined when calling deleteStyleWorkspace().');if(null==e.workspaceId)throw new s("workspaceId",'Required parameter "workspaceId" was null or undefined when calling deleteStyleWorkspace().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/styles/{style_id}/workspace";return r=r.replace("{style_id}",encodeURIComponent(String(e.styleId))),new c(await this.request({path:r,method:"DELETE",headers:i,query:a},t))}async deleteStyleWorkspace(e,t){let a=await this.deleteStyleWorkspaceRaw(e,t);return await a.value()}async getBasicStylesRaw(e,t){let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/styles/basic",method:"GET",headers:i,query:a},t),e=>a_(e,!1))}async getBasicStyles(e={},t){let a=await this.getBasicStylesRaw(e,t);return await a.value()}async getExternalStylesRaw(e,t){let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/styles/external",method:"GET",headers:i,query:a},t),e=>a_(e,!1))}async getExternalStyles(e={},t){let a=await this.getExternalStylesRaw(e,t);return await a.value()}async getGalleryStylesRaw(e,t){let a={};null!=e.transformModels&&(a.transform_models=e.transformModels),null!=e.imageTypeFormat&&(a.image_type_format=e.imageTypeFormat),null!=e.tag&&(a.tag=e.tag),null!=e.searchString&&(a.search_string=e.searchString),null!=e.queryType&&(a.query_type=e.queryType),null!=e.offset&&(a.offset=e.offset),null!=e.limit&&(a.limit=e.limit),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/styles/gallery",method:"GET",headers:i,query:a},t),e=>a_(e,!1))}async getGalleryStyles(e={},t){let a=await this.getGalleryStylesRaw(e,t);return await a.value()}async getStyleBySlugNameRaw(e,t){if(null==e.slug)throw new s("slug",'Required parameter "slug" was null or undefined when calling getStyleBySlugName().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/styles/by-slug/{slug}";return i=i.replace("{slug}",encodeURIComponent(String(e.slug))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>tT(e))}
2async getStyleBySlugName(e,t){let a=await this.getStyleBySlugNameRaw(e,t);return await a.value()}async getStyleUsageCountRaw(e,t){if(null==e.styleId)throw new s("styleId",'Required parameter "styleId" was null or undefined when calling getStyleUsageCount().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/styles/{style_id}/usage_count";return r=r.replace("{style_id}",encodeURIComponent(String(e.styleId))),new c(await this.request({path:r,method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{usageCount:null==t.usage_count?void 0:t.usage_count}})}async getStyleUsageCount(e,t){let a=await this.getStyleUsageCountRaw(e,t);return await a.value()}async getStyleWorkspacesRaw(e,t){if(null==e.styleId)throw new s("styleId",'Required parameter "styleId" was null or undefined when calling getStyleWorkspaces().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/styles/{style_id}/workspace";return i=i.replace("{style_id}",encodeURIComponent(String(e.styleId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t))}
2async getStyleWorkspaces(e,t){let a=await this.getStyleWorkspacesRaw(e,t);return await a.value()}async getTransformModelsRaw(e,t){let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/models",method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{models:t.models.map(aI)}})}async getTransformModels(e={},t){let a=await this.getTransformModelsRaw(e,t);return await a.value()}async isStyleSharedOverLinkRaw(e,t){if(null==e.styleId)throw new s("styleId",'Required parameter "styleId" was null or undefined when calling isStyleSharedOverLink().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/styles/{style_id}/public_access";return i=i.replace("{style_id}",encodeURIComponent(String(e.styleId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{shared:null==t.shared?void 0:t.shared}})}async isStyleSharedOverLink(e,t){let a=await this.isStyleSharedOverLinkRaw(e,t);return await a.value()}async listSavedStylesRaw(e,t){if(null==e.list)throw new s("list",'Required parameter "list" was null or undefined when calling listSavedStyles().');let a={};null!=e.list&&(a.list=e.list),null!=e.imageType&&(a.image_type=e.imageType),null!=e.transformModel&&(a.transform_model=e.transformModel),null!=e.styleId&&(a.style_id=e.styleId),null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/saved_styles",method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{styles:t.styles.map(av)}})}async listSavedStyles(e,t){let a=await this.listSavedStylesRaw(e,t);return await a.value()}async listStyleUsersRaw(e,t){if(null==e.styleId)throw new s("styleId",'Required parameter "styleId" was null or undefined when calling listStyleUsers().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/styles/{style_id}/users";return i=i.replace("{style_id}",encodeURIComponent(String(e.styleId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{users:t.users.map(aT)}})}async listStyleUsers(e,t){let a=await this.listStyleUsersRaw(e,t);return await a.value()}async listStylesRaw(e,t){if(null==e.listStylesRequest)throw new s("listStylesRequest",'Required parameter "listStylesRequest" was null or undefined when calling listStyles().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/list_styles",method:"POST",headers:i,query:a,body:aq(e.listStylesRequest)},t),e=>a_(e,!1))}async listStyles(e,t){let a=await this.listStylesRaw(e,t);return await a.value()}async modifyStyleRaw(e,t){if(null==e.styleId)throw new s("styleId",'Required parameter "styleId" was null or undefined when calling modifyStyle().');if(null==e.modifyStyleRequest)throw new s("modifyStyleRequest",'Required parameter "modifyStyleRequest" was null or undefined when calling modifyStyle().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/styles/{style_id}";return i=i.replace("{style_id}",encodeURIComponent(String(e.styleId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{name:e.name,transform_model:_(e.transformModel),is_draft:e.isDraft,is_private:e.isPrivate,style_images:null==e.styleImages?void 0:e.styleImages.map(v),style_images_weights:e.styleImagesWeights,source_styles:e.sourceStyles,source_styles_weights:e.sourceStylesWeights,image_type:F(e.imageType),preview_image_id:e.previewImageId,prompt:e.prompt,tags:e.tags,use_style_template:e.useStyleTemplate,colors:null==e.colors?void 0:e.colors.map(z),background_color:z(e.backgroundColor),gallery_image_ids:e.galleryImageIds}}(e.modifyStyleRequest,!1)},t),e=>tT(e))}async modifyStyle(e,t){let a=await this.modifyStyleRaw(e,t);return await a.value()}async removeStyleReactionRaw(e,t){if(null==e.styleId)throw new s("styleId",'Required parameter "styleId" was null or undefined when calling removeStyleReaction().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/styles/{style_id}/reaction";return i=i.replace("{style_id}",encodeURIComponent(String(e.styleId))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{}},t))}async removeStyleReaction(e,t){let a=await this.removeStyleReactionRaw(e,t);return await a.value()}async removeStyleUserRaw(e,t){if(null==e.styleId)throw new s("styleId",'Required parameter "styleId" was null or undefined when calling removeStyleUser().');let a={};null!=e.email&&(a.email=e.email);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/styles/{style_id}/users";return r=r.replace("{style_id}",encodeURIComponent(String(e.styleId))),new c(await this.request({path:r,method:"DELETE",headers:i,query:a},t))}async removeStyleUser(e,t){let a=await this.removeStyleUserRaw(e,t);return await a.value()}async shareStyleWithWorkspaceRaw(e,t){if(null==e.styleId)throw new s("styleId",'Required parameter "styleId" was null or undefined when calling shareStyleWithWorkspace().');if(null==e.shareStyleWithWorkspaceRequest)throw new s("shareStyleWithWorkspaceRequest",'Required parameter "shareStyleWithWorkspaceRequest" was null or undefined when calling shareStyleWithWorkspace().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/styles/{style_id}/workspace";return i=i.replace("{style_id}",encodeURIComponent(String(e.styleId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{workspace_id:e.workspaceId}}(e.shareStyleWithWorkspaceRequest,!1)},t))}async shareStyleWithWorkspace(e,t){let a=await this.shareStyleWithWorkspaceRaw(e,t);return await a.value()}async upsertStyleGalleryTagsRaw(e,t){if(null==e.styleId)throw new s("styleId",'Required parameter "styleId" was null or undefined when calling upsertStyleGalleryTags().');
2if(null==e.upsertStyleGalleryTagsRequest)throw new s("upsertStyleGalleryTagsRequest",'Required parameter "upsertStyleGalleryTagsRequest" was null or undefined when calling upsertStyleGalleryTags().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/styles/{style_id}/gallery_tags";return i=i.replace("{style_id}",encodeURIComponent(String(e.styleId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{gallery_tags:e.galleryTags}}(e.upsertStyleGalleryTagsRequest,!1)},t))}async upsertStyleGalleryTags(e,t){let a=await this.upsertStyleGalleryTagsRaw(e,t);return await a.value()}async upsertStyleReactionRaw(e,t){if(null==e.styleId)throw new s("styleId",'Required parameter "styleId" was null or undefined when calling upsertStyleReaction().');if(null==e.upsertStyleReactionRequest)throw new s("upsertStyleReactionRequest",'Required parameter "upsertStyleReactionRequest" was null or undefined when calling upsertStyleReaction().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/styles/{style_id}/reaction";return i=i.replace("{style_id}",encodeURIComponent(String(e.styleId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{reaction:e.reaction}}(e.upsertStyleReactionRequest,!1)},t))}async upsertStyleReaction(e,t){let a=await this.upsertStyleReactionRaw(e,t);return await a.value()}async upsertStyleUserRaw(e,t){if(null==e.styleId)throw new s("styleId",'Required parameter "styleId" was null or undefined when calling upsertStyleUser().');if(null==e.upsertStyleUserRequest)throw new s("upsertStyleUserRequest",'Required parameter "upsertStyleUserRequest" was null or undefined when calling upsertStyleUser().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/styles/{style_id}/users";return i=i.replace("{style_id}",encodeURIComponent(String(e.styleId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{email:e.email,role:aR(e.role)}}(e.upsertStyleUserRequest,!1)},t))}async upsertStyleUser(e,t){let a=await this.upsertStyleUserRaw(e,t);return await a.value()}}],593601),e.s(["StyleClassifierApi",0,class extends r{async classifyImageStyleRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/classify_style",method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{images:e.images.map(v),styles:e.styles}}(e.styleClassifierRequest,!1)},t),e=>{var t;return null==(t=e)?t:{style:M(t.style)}})}async classifyImageStyle(e={},t){let a=await this.classifyImageStyleRaw(e,t);return await a.value()}}],756382),e.s(["SubscriptionApi",0,class extends r{async cancelUserSubscriptionRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling cancelUserSubscription().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/users/{user_id}/subscription/cancel";return i=i.replace("{user_id}",encodeURIComponent(String(e.userId))),new c(await this.request({path:i,method:"POST",headers:a,query:{}},t))}async cancelUserSubscription(e,t){let a=await this.cancelUserSubscriptionRaw(e,t);return await a.value()}async getUserSubscriptionRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling getUserSubscription().');let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/users/{user_id}/subscription";return r=r.replace("{user_id}
2",encodeURIComponent(String(e.userId))),new c(await this.request({path:r,method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{credits:t.credits,subscriptionCredits:t.subscription_credits,extraCredits:t.extra_credits,subscription:eA(t.subscription,!1),plan:eq(t.plan,!1)}})}async getUserSubscription(e,t){let a=await this.getUserSubscriptionRaw(e,t);return await a.value()}async reactivateUserSubscriptionRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling reactivateUserSubscription().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/users/{user_id}/subscription/reactivate";return i=i.replace("{user_id}",encodeURIComponent(String(e.userId))),new c(await this.request({path:i,method:"POST",headers:a,query:{}},t))}async reactivateUserSubscription(e,t){let a=await this.reactivateUserSubscriptionRaw(e,t);return await a.value()}async setUserSubscriptionRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling setUserSubscription().');if(null==e.setUserSubscriptionRequest)throw new s("setUserSubscriptionRequest",'Required parameter "setUserSubscriptionRequest" was null or undefined when calling setUserSubscription().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/users/{user_id}/subscription";return i=i.replace("{user_id}",encodeURIComponent(String(e.userId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{plan_text_id:e.planTextId,duration_mins:e.durationMins}}(e.setUserSubscriptionRequest,!1)},t))}async setUserSubscription(e,t){let a=await this.setUserSubscriptionRaw(e,t);return await a.value()}async switchUserSubscriptionRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling switchUserSubscription().');if(null==e.switchUserSubscriptionRequest)throw new s("switchUserSubscriptionRequest",'Required parameter "switchUserSubscriptionRequest" was null or undefined when calling switchUserSubscription().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/users/{user_id}/subscription/switch";return i=i.replace("{user_id}",encodeURIComponent(String(e.userId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{price_id:e.priceId}}(e.switchUserSubscriptionRequest,!1)},t))}async switchUserSubscription(e,t){let a=await this.switchUserSubscriptionRaw(e,t);return await a.value()}async userSubscriptionIntentRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling userSubscriptionIntent().');if(null==e.userSubscriptionIntentRequest)throw new s("userSubscriptionIntentRequest",'Required parameter "userSubscriptionIntentRequest" was null or undefined when calling userSubscriptionIntent().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/users/{user_id}/subscription/intent";return i=i.replace("{user_id}",encodeURIComponent(String(e.userId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{price_id:e.priceId,coupon:e.coupon,trial:e.trial}}(e.userSubscriptionIntentRequest,!1)},t),e=>(function(e){if(null==e)return e;return{type:e.type,clientSecret:e.client_secret,trialPeriodDays:e.trial_period_days,amount:e.amount}})(e))}async userSubscriptionIntent(e,t){let a=await this.userSubscriptionIntentRaw(e,t);return await a.value()}}],929760),e.s(["TemplateApi",0,class extends r{async createTemplateRaw(e,t){if(null==e.createTemplateRequest)throw new s("createTemplateRequest",'Required parameter "createTemplateRequest" was null or undefined when calling createTemplate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/templates",method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{type:e.type,name:e.name,cover_image_id:e.coverImageId,description:e.description,published:e.published,priority:e.priority,data:e.data,group_id:e.groupId}}(e.createTemplateRequest,!1)},t),e=>aS(e))}async createTemplate(e,t){let a=await this.createTemplateRaw(e,t);return await a.value()}async createTemplateGroupRaw(e,t){if(null==e.createTemplateGroupRequest)throw new s("createTemplateGroupRequest",'Required parameter "createTemplateGroupRequest" was null or undefined when calling createTemplateGroup().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/template_groups",method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{type:e.type,name:e.name,cover_image_id:e.coverImageId,description:e.description,published:e.published,priority:e.priority,data:e.data}}(e.createTemplateGroupRequest,!1)},t),e=>aS(e))}async createTemplateGroup(e,t){let a=await this.createTemplateGroupRaw(e,t);return await a.value()}async deleteTemplateRaw(e,t){if(null==e.templateId)throw new s("templateId",'Required parameter "templateId" was null or undefined when calling deleteTemplate().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/templates/{template_id}";return i=i.replace("{template_id}",encodeURIComponent(String(e.templateId))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{}},t))}async deleteTemplate(e,t){let a=await this.deleteTemplateRaw(e,t);return await a.value()}async deleteTemplateGroupRaw(e,t){if(null==e.templateId)throw new s("templateId",'Required parameter "templateId" was null or undefined when calling deleteTemplateGroup().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/template_groups/{template_id}";return i=i.replace("{template_id}",encodeURIComponent(String(e.templateId))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{}},t))}async deleteTemplateGroup(e,t){let a=await this.deleteTemplateGroupRaw(e,t);return await a.value()}async getTemplateRaw(e,t){if(null==e.templateId)throw new s("templateId",'Required parameter "templateId" was null or undefined when calling getTemplate().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/templates/{template_id}";return i=i.replace("{template_id}",encodeURIComponent(String(e.templateId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>aS(e))}async getTemplate(e,t){let a=await this.getTemplateRaw(e,t);return await a.value()}async getTemplateGroupRaw(e,t){if(null==e.templateId)throw new s("templateId",'Required parameter "templateId" was null or undefined when calling getTemplateGroup().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/template_groups/{template_id}";return i=i.replace("{template_id}",encodeURIComponent(String(e.templateId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>aS(e))}async getTemplateGroup(e,t){let a=await this.getTemplateGroupRaw(e,t);return await a.value()}async listTemplateGroupsRaw(e,t){if(null==e.type)throw new s("type",'Required parameter "type" was null or undefined when calling listTemplateGroups().');let a={};null!=e.type&&(a.type=e.type),null!=e.includeNotPublished&&(a.include_not_published=e.includeNotPublished);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/template_groups",method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{templateGroups:t.template_groups.map(aS)}})}async listTemplateGroups(e,t){let a=await this.listTemplateGroupsRaw(e,t);return await a.value()}async listTemplatesRaw(e,t){if(null==e.type)throw new s("type",'Required parameter "type" was null or undefined when calling listTemplates().');let a={};null!=e.type&&(a.type=e.type),null!=e.includeNotPublished&&(a.include_not_published=e.includeNotPublished),null!=e.groupId&&(a.group_id=e.groupId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/templates",method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{templates:t.templates.map(aS)}})}async listTemplates(e,t){let a=await this.listTemplatesRaw(e,t);return await a.value()}async modifyTemplateRaw(e,t){if(null==e.templateId)throw new s("templateId",'Required parameter "templateId" was null or undefined when calling modifyTemplate().');if(null==e.modifyTemplateRequest)throw new s("modifyTemplateRequest",'Required parameter "modifyTemplateRequest" was null or undefined when calling modifyTemplate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/templates/{template_id}";return i=i.replace("{template_id}",encodeURIComponent(String(e.templateId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{name:e.name,cover_image_id:e.coverImageId,description:e.description,published:e.published,priority:e.priority,data:e.data,group_id:e.groupId}}(e.modifyTemplateRequest,!1)},t),e=>aS(e))}async modifyTemplate(e,t){let a=await this.modifyTemplateRaw(e,t);return await a.value()}async modifyTemplateGroupRaw(e,t){if(null==e.templateId)throw new s("templateId",'Required parameter "templateId" was null or undefined when calling modifyTemplateGroup().');
2if(null==e.modifyTemplateGroupRequest)throw new s("modifyTemplateGroupRequest",'Required parameter "modifyTemplateGroupRequest" was null or undefined when calling modifyTemplateGroup().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/template_groups/{template_id}";return i=i.replace("{template_id}",encodeURIComponent(String(e.templateId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{name:e.name,cover_image_id:e.coverImageId,description:e.description,published:e.published,priority:e.priority,data:e.data}}(e.modifyTemplateGroupRequest,!1)},t),e=>aS(e))}async modifyTemplateGroup(e,t){let a=await this.modifyTemplateGroupRaw(e,t);return await a.value()}}],913122);function ab(e,t){return null==e?e:{users:e.users.map(tv)}}function aC(e){var t;return null==(t=e)?t:{timestamp:t.timestamp,detectionMethod:t.detection_method,reason:t.reason,recraftId:null==t.recraft_id?void 0:t.recraft_id,metadata:null==t.metadata?void 0:t.metadata}}function aP(e){var t;return null==(t=e)?t:{timestamp:t.timestamp,detectionMethod:t.detection_method,reason:t.reason,riskLevel:t.risk_level,chargeId:t.charge_id,metadata:null==t.metadata?void 0:t.metadata}}function aj(e){var t;return null==(t=e)?t:{timestamp:t.timestamp,event:t.event,actorId:null==t.actor_id?void 0:t.actor_id,data:null==t.data?void 0:t.data}}function aA(e){var t;return null==(t=e)?t:{mark:t.mark,markTime:t.mark_time,description:t.description,count:t.count}}function aU(e){var t;return null==(t=e)?t:{domain:t.domain,enabled:t.enabled,mandatory:t.mandatory,entityId:t.entity_id,signOnUrl:t.sign_on_url,logoutUrl:t.logout_url,certificate:t.certificate}}function ax(e){var t;return null==(t=e)?t:{email:t.email,role:eC(t.role)}}function aB(e){var t;return null==(t=e)?t:{username:t.username,email:t.email,name:null==t.name?void 0:t.name,image:null==t.image?void 0:t.image,role:eC(t.role),subscriptionCredits:t.subscription_credits,extraCredits:t.extra_credits}}e.s(["UserApi",0,class extends r{async addBlockedEmailRaw(e,t){if(null==e.addBlockedEmailRequest)throw new s("addBlockedEmailRequest",'Required parameter "addBlockedEmailRequest" was null or undefined when calling addBlockedEmail().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/blocked_emails",method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{domain:e.domain,registration_only:e.registrationOnly,comment:e.comment}}(e.addBlockedEmailRequest,!1)},t))}async addBlockedEmail(e,t){let a=await this.addBlockedEmailRaw(e,t);return await a.value()}async banUserRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling banUser().');if(null==e.complainAboutImageRequest)throw new s("complainAboutImageRequest",'Required parameter "complainAboutImageRequest" was null or undefined when calling banUser().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/users/{user_id}/ban";return i=i.replace("{user_id}",encodeURIComponent(String(e.userId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:e7(e.complainAboutImageRequest,!1)},t))}async banUser(e,t){let a=await this.banUserRaw(e,t);return await a.value()}async confirmCurrentUserEmailChangeRaw(e,t){if(null==e.confirmCurrentUserEmailChangeRequest)throw new s("confirmCurrentUserEmailChangeRequest",'Required parameter "confirmCurrentUserEmailChangeRequest" was null or undefined when calling confirmCurrentUserEmailChange().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/users/me/confirm_change_email",method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{request_id:e.requestId,current_email_code:e.currentEmailCode,new_email_code:e.newEmailCode}}(e.confirmCurrentUserEmailChangeRequest,!1)},t))}async confirmCurrentUserEmailChange(e,t){let a=await this.confirmCurrentUserEmailChangeRaw(e,t);return await a.value()}async deleteUserRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling deleteUser().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/users/{user_id}";return i=i.replace("{user_id}
2",encodeURIComponent(String(e.userId))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{}},t))}async deleteUser(e,t){let a=await this.deleteUserRaw(e,t);return await a.value()}async deleteUsersRaw(e,t){if(null==e.userIds)throw new s("userIds",'Required parameter "userIds" was null or undefined when calling deleteUsers().');if(null==e.reason)throw new s("reason",'Required parameter "reason" was null or undefined when calling deleteUsers().');let a={};null!=e.userIds&&(a.user_ids=e.userIds),null!=e.reason&&(a.reason=e.reason);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/users",method:"DELETE",headers:i,query:a},t))}async deleteUsers(e,t){let a=await this.deleteUsersRaw(e,t);return await a.value()}async getCurrentUserRaw(e,t){let a={};null!=e.userId&&(a.user_id=e.userId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/users/me",method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{id:t.id,email:null==t.email?void 0:t.email,name:null==t.name?void 0:t.name,image:null==t.image?void 0:t.image,username:t.username,registrationTime:null==t.registration_time?void 0:t.registration_time,credits:t.credits,subscriptionCredits:t.subscription_credits,extraCredits:t.extra_credits,apiCredits:null==t.api_credits?void 0:t.api_credits,subscription:eA(t.subscription,!1),plan:eq(t.plan,!1),mergedAccount:null==t.merged_account?void 0:t.merged_account,onboarding:l(t.onboarding,eb),admin:t.admin,roles:t.roles,subscriptionStatus:eS(t.subscription_status),country:null==t.country?void 0:t.country,workspaces:t.workspaces,workspaceRoles:t.workspace_roles.map(eU)}})}async getCurrentUser(e={},t){let a=await this.getCurrentUserRaw(e,t);return await a.value()}async getCurrentUserBasicRaw(e,t){let a={};null!=e.userId&&(a.user_id=e.userId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/users/me/basic",method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{id:t.id,email:null==t.email?void 0:t.email,name:null==t.name?void 0:t.name,image:null==t.image?void 0:t.image,username:t.username,registrationTime:null==t.registration_time?void 0:t.registration_time,mergedAccount:null==t.merged_account?void 0:t.merged_account,country:null==t.country?void 0:t.country,admin:t.admin,roles:t.roles,onboarding:l(t.onboarding,eb)}})}async getCurrentUserBasic(e={},t){let a=await this.getCurrentUserBasicRaw(e,t);return await a.value()}async getCurrentUserReferralProgramInfoRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("auth0",[]);a&&(t.Authorization=`Bearer ${a}`)}return new c(await this.request({path:"/users/me/referral_program",method:"GET",headers:t,query:{}},e),e=>{var t;return null==(t=e)?t:{enabled:t.enabled,inviteCode:t.invite_code,earnedCredits:t.earned_credits,earnedCreditsLimit:t.earned_credits_limit,invitedUsers:t.invited_users,invitedCountedUsers:t.invited_counted_users}})}async getCurrentUserReferralProgramInfo(e){let t=await this.getCurrentUserReferralProgramInfoRaw(e);return await t.value()}async getCurrentUserStatisticsRaw(e,t){let a={};null!=e.userId&&(a.user_id=e.userId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/users/me/statistics",method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{recraftCount:t.recraft_count}})}async getCurrentUserStatistics(e={},t){let a=await this.getCurrentUserStatisticsRaw(e,t);return await a.value()}async getMyRestrictionsRaw(e,t){let a={};null!=e.workspaceId&&(a.workspace_id=e.workspaceId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/users/me/restrictions",method:"GET",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{limits:function(e){var t;if(null==e)return e;return{imageUpload:null==e.image_upload?void 0:null==(t=e.image_upload)?t:{usageCount:t.usage_count,limit:t.limit}}}(t.limits)}})}async getMyRestrictions(e={},t){let a=await this.getMyRestrictionsRaw(e,t);return await a.value()}async getUserBanContextRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling getUserBanContext().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/users/{user_id}/ban_context";return i=i.replace("{user_id}
2",encodeURIComponent(String(e.userId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{banEvents:t.ban_events.map(aj),fraudDetections:t.fraud_detections.map(aC),stripeFraudDetections:t.stripe_fraud_detections.map(aP)}})}async getUserBanContext(e,t){let a=await this.getUserBanContextRaw(e,t);return await a.value()}async getUserRestrictionsRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling getUserRestrictions().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/users/{user_id}/restrictions";return i=i.replace("{user_id}",encodeURIComponent(String(e.userId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{banTime:null==t.ban_time?void 0:t.ban_time,softBanTime:null==t.soft_ban_time?void 0:t.soft_ban_time,botMarks:t.bot_marks.map(aA),temporaryBanned:t.temporary_banned,temporaryBanCount:t.temporary_ban_count,loginBlocked:t.login_blocked,accountRestored:t.account_restored,referralEligible:t.referral_eligible,challengeBalance:null==t.challenge_balance?void 0:t.challenge_balance,challengeFrequency:null==t.challenge_frequency?void 0:t.challenge_frequency}})}async getUserRestrictions(e,t){let a=await this.getUserRestrictionsRaw(e,t);return await a.value()}async getUsersRaw(e,t){let a={};null!=e.email&&(a.email=e.email),null!=e.userIds&&(a.user_ids=e.userIds);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/users",method:"GET",headers:i,query:a},t),e=>ab(e,!1))}async getUsers(e={},t){let a=await this.getUsersRaw(e,t);return await a.value()}async listUsersRaw(e,t){if(null==e.listUsersRequest)throw new s("listUsersRequest",'Required parameter "listUsersRequest" was null or undefined when calling listUsers().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/users/info",method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{user_ids:e.userIds}}(e.listUsersRequest,!1)},t),e=>ab(e,!1))}async listUsers(e,t){let a=await this.listUsersRaw(e,t);return await a.value()}async logoutCurrentUserRaw(e,t){let a={};null!=e.userId&&(a.user_id=e.userId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/users/me/logout",method:"POST",headers:i,query:a},t))}async logoutCurrentUser(e={},t){let a=await this.logoutCurrentUserRaw(e,t);return await a.value()}async markClientAsBotRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/users/mark_bot",method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{detections:e.detections}}(e.markClientAsBotRequest,!1)},t))}async markClientAsBot(e={},t){let a=await this.markClientAsBotRaw(e,t);return await a.value()}async requestCurrentUserEmailChangeRaw(e,t){if(null==e.requestCurrentUserEmailChangeRequest)throw new s("requestCurrentUserEmailChangeRequest",'Required parameter "requestCurrentUserEmailChangeRequest" was null or undefined when calling requestCurrentUserEmailChange().');let a={};null!=e.userId&&(a.user_id=e.userId);let i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/users/me/request_change_email",method:"POST",headers:i,query:a,body:function(e,t=!1){return null==e?e:{email:e.email}}(e.requestCurrentUserEmailChangeRequest,!1)},t),e=>{var t;return null==(t=e)?t:{requestId:t.request_id}})}async requestCurrentUserEmailChange(e,t){let a=await this.requestCurrentUserEmailChangeRaw(e,t);return await a.value()}async softBanUserRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling softBanUser().');if(null==e.complainAboutImageRequest)throw new s("complainAboutImageRequest",'Required parameter "complainAboutImageRequest" was null or undefined when calling softBanUser().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/users/{user_id}/softBan";return i=i.replace("{user_id}
2",encodeURIComponent(String(e.userId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:e7(e.complainAboutImageRequest,!1)},t))}async softBanUser(e,t){let a=await this.softBanUserRaw(e,t);return await a.value()}async updateUserInfoRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling updateUserInfo().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/users/{user_id}";return i=i.replace("{user_id}",encodeURIComponent(String(e.userId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{name:e.name,image:tX(e.image),username:e.username,roles:e.roles}}(e.updateUserInfoRequest,!1)},t))}async updateUserInfo(e,t){let a=await this.updateUserInfoRaw(e,t);return await a.value()}async userSolveChallengeRaw(e,t){if(null==e.userId)throw new s("userId",'Required parameter "userId" was null or undefined when calling userSolveChallenge().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/users/{user_id}/solve_challenge";return i=i.replace("{user_id}",encodeURIComponent(String(e.userId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{turnstile_token:e.turnstileToken,debug_set_frequency:e.debugSetFrequency}}(e.userSolveChallengeRequest,!1)},t))}async userSolveChallenge(e,t){let a=await this.userSolveChallengeRaw(e,t);return await a.value()}}],346241),e.s(["VideoApi",0,class extends r{async downloadVideoRaw(e,t){if(null==e.videoId)throw new s("videoId",'Required parameter "videoId" was null or undefined when calling downloadVideo().');let a={};null!=e.visibleWatermark&&(a.visible_watermark=e.visibleWatermark),null!=e.filename&&(a.filename=e.filename);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/video/{video_id}";return r=r.replace("{video_id}",encodeURIComponent(String(e.videoId))),new p(await this.request({path:r,method:"GET",headers:i,query:a},t))}async downloadVideo(e,t){let a=await this.downloadVideoRaw(e,t);return await a.value()}async getVideoDetailsRaw(e,t){if(null==e.videoId)throw new s("videoId",'Required parameter "videoId" was null or undefined when calling getVideoDetails().');let a={};null!=e.projectId&&(a.project_id=e.projectId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r="/recraft_videos/{video_id}";return r=r.replace("{video_id}",encodeURIComponent(String(e.videoId))),new c(await this.request({path:r,method:"GET",headers:i,query:a},t),e=>tl(e,!1))}async getVideoDetails(e,t){let a=await this.getVideoDetailsRaw(e,t);return await a.value()}}],126234),e.s(["VoiceApi",0,class extends r{async transcribeVoiceRaw(e,t){let a;if(null==e.file)throw new s("file",'Required parameter "file" was null or undefined when calling transcribeVoice().');let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}let r=u([{contentType:"multipart/form-data"}]);return a=r?new FormData:new URLSearchParams,null!=e.file&&a.append("file",e.file),new c(await this.request({path:"/voice/transcribe",method:"POST",headers:i,query:{},body:a},t),e=>{var t;return null==(t=e)?t:{text:t.text}})}async transcribeVoice(e,t){let a=await this.transcribeVoiceRaw(e,t);return await a.value()}}],858811);function aO(e,t=!1){return null==e?e:{email:e.email,role:eP(e.role)}}function az(e,t){var a,i;if(null==e)return e;return{id:e.id,name:e.name,image:null==e.image?void 0:e.image,createTime:e.create_time,currentUserRole:eC(e.current_user_role),billingInfo:null==e.billing_info?void 0:null==(a=e.billing_info)?a:{name:a.name,email:a.email},subscription:null==e.subscription?void 0:null==(i=e.subscription)?i:{id:i.id,endTime:null==i.end_time?void 0:i.end_time,status:eS(i.status),quantity:i.quantity,free:i.free,creditsPerPeriod:i.credits_per_period,billingPeriod:eR(i.billing_period),externalProductId:null==i.external_product_id?void 0:i.external_product_id,userPlanId:i.user_plan_id},credits:e.credits,apiCredits:e.api_credits}}
2e.s(["WorkspaceApi",0,class extends r{async acceptWorkspaceInvitationRaw(e,t){if(null==e.invitationId)throw new s("invitationId",'Required parameter "invitationId" was null or undefined when calling acceptWorkspaceInvitation().');let a={};null!=e.invitationId&&(a.invitation_id=e.invitationId);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/workspaces/accept_invitation",method:"POST",headers:i,query:a},t),e=>{var t;return null==(t=e)?t:{workspaceId:t.workspace_id}})}async acceptWorkspaceInvitation(e,t){let a=await this.acceptWorkspaceInvitationRaw(e,t);return await a.value()}async createWorkspaceRaw(e,t){if(null==e.createWorkspaceRequest)throw new s("createWorkspaceRequest",'Required parameter "createWorkspaceRequest" was null or undefined when calling createWorkspace().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}return new c(await this.request({path:"/workspaces",method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{name:e.name,admin_email:e.adminEmail,subscription_end_date:e.subscriptionEndDate,quantity:e.quantity,user_plan_id:e.userPlanId}}(e.createWorkspaceRequest,!1)},t),e=>az(e,!1))}async createWorkspace(e,t){let a=await this.createWorkspaceRaw(e,t);return await a.value()}async createWorkspaceOnPaymentRaw(e,t){if(null==e.createWorkspaceOnPaymentRequest)throw new s("createWorkspaceOnPaymentRequest",'Required parameter "createWorkspaceOnPaymentRequest" was null or undefined when calling createWorkspaceOnPayment().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}
2return new c(await this.request({path:"/workspaces/create_on_payment",method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{name:e.name,success_url:e.successUrl,cancel_url:e.cancelUrl,price_id:e.priceId,ui_mode:e.uiMode,quantity:e.quantity}}(e.createWorkspaceOnPaymentRequest,!1)},t),e=>e9(e,!1))}async createWorkspaceOnPayment(e,t){let a=await this.createWorkspaceOnPaymentRaw(e,t);return await a.value()}async createWorkspacePaymentSessionRaw(e,t){if(null==e.workspaceId)throw new s("workspaceId",'Required parameter "workspaceId" was null or undefined when calling createWorkspacePaymentSession().');if(null==e.createWorkspacePaymentSessionRequest)throw new s("createWorkspacePaymentSessionRequest",'Required parameter "createWorkspacePaymentSessionRequest" was null or undefined when calling createWorkspacePaymentSession().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}
2let i="/workspaces/{workspace_id}/payments";return i=i.replace("{workspace_id}",encodeURIComponent(String(e.workspaceId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{price_id:e.priceId,success_url:e.successUrl,cancel_url:e.cancelUrl,ui_mode:e.uiMode,quantity:e.quantity,try_instant_payment:e.tryInstantPayment}}(e.createWorkspacePaymentSessionRequest,!1)},t),e=>tS(e,!1))}async createWorkspacePaymentSession(e,t){let a=await this.createWorkspacePaymentSessionRaw(e,t);return await a.value()}async createWorkspaceSSODomainRaw(e,t){if(null==e.workspaceId)throw new s("workspaceId",'Required parameter "workspaceId" was null or undefined when calling createWorkspaceSSODomain().');if(null==e.workspaceSSODomain)throw new s("workspaceSSODomain",'Required parameter "workspaceSSODomain" was null or undefined when calling createWorkspaceSSODomain().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}
2let i="/workspaces/{workspace_id}/sso";return i=i.replace("{workspace_id}",encodeURIComponent(String(e.workspaceId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{domain:e.domain,enabled:e.enabled,mandatory:e.mandatory,entity_id:e.entityId,sign_on_url:e.signOnUrl,logout_url:e.logoutUrl,certificate:e.certificate}}(e.workspaceSSODomain,!1)},t))}async createWorkspaceSSODomain(e,t){let a=await this.createWorkspaceSSODomainRaw(e,t);return await a.value()}async deleteWorkspaceRaw(e,t){if(null==e.workspaceId)throw new s("workspaceId",'Required parameter "workspaceId" was null or undefined when calling deleteWorkspace().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/workspaces/{workspace_id}";return i=i.replace("{workspace_id}",encodeURIComponent(String(e.workspaceId))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{}},t))}async deleteWorkspace(e,t){let a=await this.deleteWorkspaceRaw(e,t);return await a.value()}async deleteWorkspaceSSODomainRaw(e,t){if(null==e.workspaceId)throw new s("workspaceId",'Required parameter "workspaceId" was null or undefined when calling deleteWorkspaceSSODomain().');if(null==e.domain)throw new s("domain",'Required parameter "domain" was null or undefined when calling deleteWorkspaceSSODomain().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}
2let i="/workspaces/{workspace_id}/sso/{domain}";return i=(i=i.replace("{workspace_id}",encodeURIComponent(String(e.workspaceId)))).replace("{domain}",encodeURIComponent(String(e.domain))),new c(await this.request({path:i,method:"DELETE",headers:a,query:{}},t))}async deleteWorkspaceSSODomain(e,t){let a=await this.deleteWorkspaceSSODomainRaw(e,t);return await a.value()}async getWorkspaceRaw(e,t){if(null==e.workspaceId)throw new s("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspace().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/workspaces/{workspace_id}";return i=i.replace("{workspace_id}",encodeURIComponent(String(e.workspaceId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>az(e,!1))}async getWorkspace(e,t){let a=await this.getWorkspaceRaw(e,t);return await a.value()}async getWorkspacePaymentsPortalRaw(e,t){if(null==e.workspaceId)throw new s("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspacePaymentsPortal().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}
2let i="/workspaces/{workspace_id}/payments";return i=i.replace("{workspace_id}",encodeURIComponent(String(e.workspaceId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{portalUrl:t.portal_url}})}async getWorkspacePaymentsPortal(e,t){let a=await this.getWorkspacePaymentsPortalRaw(e,t);return await a.value()}async getWorkspaceSSODomainsRaw(e,t){if(null==e.workspaceId)throw new s("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceSSODomains().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/workspaces/{workspace_id}/sso";return i=i.replace("{workspace_id}",encodeURIComponent(String(e.workspaceId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{domains:t.domains.map(aU)}})}async getWorkspaceSSODomains(e,t){let a=await this.getWorkspaceSSODomainsRaw(e,t);return await a.value()}async inviteWorkspaceUserRaw(e,t){if(null==e.workspaceId)throw new s("workspaceId",'Required parameter "workspaceId" was null or undefined when calling inviteWorkspaceUser().');if(null==e.updateWorkspaceUserRequest)throw new s("updateWorkspaceUserRequest",'Required parameter "updateWorkspaceUserRequest" was null or undefined when calling inviteWorkspaceUser().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}
2let i="/workspaces/{workspace_id}/users/invite";return i=i.replace("{workspace_id}",encodeURIComponent(String(e.workspaceId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:aO(e.updateWorkspaceUserRequest,!1)},t),e=>{var t;return null==(t=e)?t:{invitationId:t.invitation_id}})}async inviteWorkspaceUser(e,t){let a=await this.inviteWorkspaceUserRaw(e,t);return await a.value()}async leaveWorkspaceRaw(e,t){if(null==e.workspaceId)throw new s("workspaceId",'Required parameter "workspaceId" was null or undefined when calling leaveWorkspace().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/workspaces/{workspace_id}/leave";return i=i.replace("{workspace_id}",encodeURIComponent(String(e.workspaceId))),new c(await this.request({path:i,method:"POST",headers:a,query:{}},t),e=>az(e,!1))}async leaveWorkspace(e,t){let a=await this.leaveWorkspaceRaw(e,t);return await a.value()}async listWorkspaceUsersRaw(e,t){if(null==e.workspaceId)throw new s("workspaceId",'Required parameter "workspaceId" was null or undefined when calling listWorkspaceUsers().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}
2let i="/workspaces/{workspace_id}/users";return i=i.replace("{workspace_id}",encodeURIComponent(String(e.workspaceId))),new c(await this.request({path:i,method:"GET",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{users:t.users.map(aB),invitedUsers:t.invited_users.map(ax)}})}async listWorkspaceUsers(e,t){let a=await this.listWorkspaceUsersRaw(e,t);return await a.value()}async modifyWorkspaceRaw(e,t){if(null==e.workspaceId)throw new s("workspaceId",'Required parameter "workspaceId" was null or undefined when calling modifyWorkspace().');if(null==e.modifyWorkspaceRequest)throw new s("modifyWorkspaceRequest",'Required parameter "modifyWorkspaceRequest" was null or undefined when calling modifyWorkspace().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/workspaces/{workspace_id}";return i=i.replace("{workspace_id}",encodeURIComponent(String(e.workspaceId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{name:e.name,image:tX(e.image),billing_name:e.billingName,billing_email:e.billingEmail}}(e.modifyWorkspaceRequest,!1)},t),e=>az(e,!1))}async modifyWorkspace(e,t){let a=await this.modifyWorkspaceRaw(e,t);return await a.value()}async removeWorkspaceUserRaw(e,t){if(null==e.workspaceId)throw new s("workspaceId",'Required parameter "workspaceId" was null or undefined when calling removeWorkspaceUser().');if(null==e.email)throw new s("email",'Required parameter "email" was null or undefined when calling removeWorkspaceUser().');let a={};null!=e.email&&(a.email=e.email);let i={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(i.Authorization=`Bearer ${t}`)}
2let r="/workspaces/{workspace_id}/users";return r=r.replace("{workspace_id}",encodeURIComponent(String(e.workspaceId))),new c(await this.request({path:r,method:"DELETE",headers:i,query:a},t))}async removeWorkspaceUser(e,t){let a=await this.removeWorkspaceUserRaw(e,t);return await a.value()}async setWorkspaceSeatsRaw(e,t){if(null==e.workspaceId)throw new s("workspaceId",'Required parameter "workspaceId" was null or undefined when calling setWorkspaceSeats().');if(null==e.addUserCreditPackRequest)throw new s("addUserCreditPackRequest",'Required parameter "addUserCreditPackRequest" was null or undefined when calling setWorkspaceSeats().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/workspaces/{workspace_id}/seats";return i=i.replace("{workspace_id}",encodeURIComponent(String(e.workspaceId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:eO(e.addUserCreditPackRequest,!1)},t))}async setWorkspaceSeats(e,t){let a=await this.setWorkspaceSeatsRaw(e,t);return await a.value()}async updateWorkspaceSSODomainRaw(e,t){if(null==e.workspaceId)throw new s("workspaceId",'Required parameter "workspaceId" was null or undefined when calling updateWorkspaceSSODomain().');if(null==e.domain)throw new s("domain",'Required parameter "domain" was null or undefined when calling updateWorkspaceSSODomain().');if(null==e.updateWorkspaceSSODomainRequest)throw new s("updateWorkspaceSSODomainRequest",'Required parameter "updateWorkspaceSSODomainRequest" was null or undefined when calling updateWorkspaceSSODomain().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}
2let i="/workspaces/{workspace_id}/sso/{domain}";return i=(i=i.replace("{workspace_id}",encodeURIComponent(String(e.workspaceId)))).replace("{domain}",encodeURIComponent(String(e.domain))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:function(e,t=!1){return null==e?e:{enabled:e.enabled,mandatory:e.mandatory,entity_id:e.entityId,sign_on_url:e.signOnUrl,logout_url:e.logoutUrl,certificate:e.certificate}}(e.updateWorkspaceSSODomainRequest,!1)},t))}async updateWorkspaceSSODomain(e,t){let a=await this.updateWorkspaceSSODomainRaw(e,t);return await a.value()}async updateWorkspaceSubscriptionRaw(e,t){if(null==e.workspaceId)throw new s("workspaceId",'Required parameter "workspaceId" was null or undefined when calling updateWorkspaceSubscription().');if(null==e.addUserCreditPackRequest)throw new s("addUserCreditPackRequest",'Required parameter "addUserCreditPackRequest" was null or undefined when calling updateWorkspaceSubscription().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}
2let i="/workspaces/{workspace_id}/subscription";return i=i.replace("{workspace_id}",encodeURIComponent(String(e.workspaceId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:eO(e.addUserCreditPackRequest,!1)},t))}async updateWorkspaceSubscription(e,t){let a=await this.updateWorkspaceSubscriptionRaw(e,t);return await a.value()}async updateWorkspaceUserRaw(e,t){if(null==e.workspaceId)throw new s("workspaceId",'Required parameter "workspaceId" was null or undefined when calling updateWorkspaceUser().');if(null==e.updateWorkspaceUserRequest)throw new s("updateWorkspaceUserRequest",'Required parameter "updateWorkspaceUserRequest" was null or undefined when calling updateWorkspaceUser().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("auth0",[]);t&&(a.Authorization=`Bearer ${t}`)}let i="/workspaces/{workspace_id}/users";return i=i.replace("{workspace_id}",encodeURIComponent(String(e.workspaceId))),new c(await this.request({path:i,method:"POST",headers:a,query:{},body:aO(e.updateWorkspaceUserRequest,!1)},t))}async updateWorkspaceUser(e,t){let a=await this.updateWorkspaceUserRaw(e,t);return await a.value()}}],324743),e.s([],309121)}]);
3
4//# debugId=0547190b-1504-75fb-bde1-4cf8be78ca39

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.