1import{s as m}from"./voice-source-badge-BEXSvevR.js";import{f as r,s,p as f,A,B as c,b as l,h as g,c as P}from"./agent-empty-illustration-pIvQc9AP.js";import"./not-found-D8inZVAo.js";import"./plan-Dq4jfPIL.js";import"./format-currency-rqydBdV9.js";import"./not-found-catch-all-DI0P2EIj.js";import"./useAsync-DTBN0dvx.js";import"./useEvent-Dr-4GR-2.js";import"./infinite-scroll-gnXaRzw0.js";function b(e,t){const o=t&&typeof t=="object"&&"message"in t?t.message:null,a=new Error(typeof o=="string"&&o?o:"Unknown error occurred");return a.status=e,a.data=t,a}async function d(e){try{return(await e()).data}catch(t){throw t instanceof A?b(t.status,t.data):t}}const x=r.path("/model/{id}").method("get").create(),G=s.path("/model/{id}").method("get").create(),p=r.path("/model/batch/lookup").method("post").create(),Z=s.path("/model/batch/lookup").method("post").create(),u=200;async function J(e,t){if(e.model_ids.length<=u)return p(e,t);let o;const a=[];for(let n=0;n<e.model_ids.length;n+=u){const i=await p({...e,model_ids:e.model_ids.slice(n,n+u)},t);o??=i,a.push(...i.data)}return{...o,data:a}}const S=r.path("/model").method("get").create(),K=s.path("/model").method("get").create(),v=s.path("/model/counts").method("get").create();function W(e){return d(()=>v({},{signal:e}))}async function L(e){const{data:t}=await S({self:!0,page_size:500,page_number:1},{signal:e});let o=0,a=0,n=0;for(const i of t.items)i.visibility==="public"?o+=1:i.visibility==="unlist"?n+=1:a+=1;return{public:o,private:a,unlist:n,total:t.total}}async function Q(e){try{return await W(e)}catch(t){const o=t.status;if(o!==404&&o!==405)throw t;return L(e)}}const Y=r.path("/model/default-voices").method("get").create(),X=s.path("/model/default-voices/languages").method("get").create(),ee=s.path("/model/recommended-voices").method("get").create(),te=f.path("/model/recommended-voices").method("get").create(),oe=f.path("/model/batch/lookup").method("post").create(),ae=r.path("/model/web").method("get").create(),ne=s.path("/model/web").method("get").create(),re=r.path("/model/{id}/like").method("put").create(),ie=r.path("/model/{id}/mark").method("put").create(),se=r.path("/model/{id}/like").method("delete").create(),de=r.path("/model/{id}/unlike").method("put").create(),ce=r.path("/model/{id}/unlike").method("delete").create(),le=r.path("/model/{id}/mark").method("delete").create(),me=r.path("/model/{id}/share").method("post").create(),ue=r.path("/model/{id}").method("delete").create(),he=r.path("/model/{id}/clone").method("post").create(),pe=r.path("/model/languages").method("get").create(),fe=r.path("/model/{id}").method("patch").create(),I=s.path("/model/{id}/admin/dmca-takedown").method("post").create();async function ge(e){await d(()=>I({id:e}))}const E=["multi_speaker","truncated"];function F(e){return e?.quality?E.filter(t=>{const o=e.quality?.[t];return typeof o=="number"&&o>.5}):[]}function be(e){if(!e?.quality)return!1;const t=e.quality.normal;return typeof t=="number"&&t<.5}function ye(e){return F(e).length>0}async function y(e){if(e.status===401&&g(),e.ok)return e;let t=null;try{t=await e.json()}catch{t=null}throw b(e.status,t)}const O=s.path("/model/web/upload-url").method("post").create();async function N(e){const t=await d(()=>O({file_name:e.name,file_size:e.size,content_type:e.type||void 0})),o=await fetch(t.upload_url,{method:t.method??"PUT",headers:t.headers??{},body:e});if(!o.ok)throw new Error(`Failed to upload file: ${o.status}`);return{object_key:t.object_key,file_name:e.name,file_size:e.size,content_type:e.type||void 0}}async function w(e){return Promise.all(e.map(N))}const C=s.path("/model/web/preflight").method("post").create(),T=s.path("/model/web/preflight/verification-token").method("post").create(),V=s.path("/model/web/preflight/verification-prompt").method("post").create();async function we(e){const t=await w(e.voices);return d(()=>C({uploaded_voices:t}))}function _e(e){return d(()=>T({preflight_id:e}))}function Me(e,t){return d(()=>V({preflight_id:e,language:t}))}const _={noAttributesWithArrayNotation:!0,noFilesWithArrayNotation:!0,dotsForObjectNotation:!0,nullsAsUndefineds:!0};function M(e,t){t&&m.serialize(t,_,e)}async function h(e){return await y(e),e.status===201?{created:!0,model:await e.json()}:{created:!1,preflight:await e.json()}}const ke=async({preflightId:e,verificationToken:t,verificationSignature:o,audio:a,creation:n})=>{const i=new FormData;i.append("preflight_id",e),i.append("verification_token",t),i.append("verification_signature",o),i.append("audio",a),M(i,n);const k=await fetch(`${c}/model/web/preflight/verification`,{method:"POST",headers:l(),body:i});return h(k)},Ae=async({preflightId:e,file:t,creation:o})=>{const a=new FormData;a.append("preflight_id",e),a.append("file",t),M(a,o);const n=await fetch(`${c}/model/web/preflight/contract`,{method:"POST",headers:l(),body:a});return h(n)},Pe=async e=>{const t={...e,generate_sample:!0},o=m.serialize(t,_),a=await fetch(`${c}/model/web/preflight/create`,{method:"POST",headers:l(),body:o});return h(a)},Se=async e=>{e.generate_sample=!0;const t=await w(e.voices),o=Object.fromEntries(Object.entries(e).filter(([i])=>i!=="voices")),a=m.serialize(o,{noAttributesWithArrayNotation:!0,noFilesWithArrayNotation:!0,dotsForObjectNotation:!0,nullsAsUndefineds:!0});a.append("uploaded_voices",JSON.stringify(t));const n=await fetch(`${c}/model/web`,{method:"POST",headers:l(),body:a});if(n.status==401&&g(),!n.ok)if(n.status>=400&&n.status<500)P(await n.json());else throw new Error("Unknown error occurred");return n},ve=async(e,t)=>{const o=m.serialize(t,{noAttributesWithArrayNotation:!0,noFilesWithArrayNotation:!0,dotsForObjectNotation:!0,nullsAsUndefineds:!0}),a=await fetch(`${c}/model/${encodeURIComponent(e)}`,{method:"PATCH",headers:l(),body:o});return y(a)},We=r.path("/model/{id}/samples").method("put").create(),Le=r.path("/model/search/autocomplete").method("get").create();export{u as MODEL_INFO_BATCH_SIZE,E as MODEL_PREFLIGHT_WARNING_SIGNAL_KEYS,he as cloneModel,Se as createModel,Pe as createModelFromPreflight,we as createModelPreflight,X as defaultVoiceLanguagesList,Y as defaultVoicesList,ue as deleteModel,de as dislikeModel,ge as dmcaTakedownModel,ve as editModel,We as editModelSample,W as getModelCounts,Q as getModelCountsWithFallback,F as getModelPreflightWarningSignals,_e as getModelWebPreflightVerificationToken,ye as hasModelPreflightQualityWarning,be as hasModelPreflightSpeechClarityInfo,re as likeModel,ie as markModel,x as modelInfo,J as modelInfoBatch,oe as modelInfoBatchPublic,Z as modelInfoBatchSilent,G as modelInfoSilent,pe as modelLanguages,S as modelList,K as modelListSilent,Le as modelSearchAutoComplete,ae as modelWebList,ne as modelWebListSilent,fe as modifyModel,ee as re
1commendedVoicesList,te as recommendedVoicesListPublic,Me as regenerateModelWebPreflightVerificationPrompt,me as shareModel,Ae as submitModelWebPreflightContract,ke as submitModelWebPreflightVerification,ce as unDislikeModel,se as unLikeModel,le as unMarkModel,w as uploadModelWebVoices};
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.