1var jt=Object.defineProperty;var Ne=e=>{throw TypeError(e)};var Wt=(e,t,i)=>t in e?jt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var S=(e,t,i)=>Wt(e,typeof t!="symbol"?t+"":t,i),Le=(e,t,i)=>t.has(e)||Ne("Cannot "+i);var z=(e,t,i)=>(Le(e,t,"read from private field"),i?i.call(e):t.get(e)),F=(e,t,i)=>t.has(e)?Ne("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),M=(e,t,i,s)=>(Le(e,t,"write to private field"),s?s.call(e,i):t.set(e,i),i);import{L as zt,cm as p,eS as $t,eT as B,eU as L,eV as w,r as C,e as a,cq as Y,j as l,M as J,d3 as Gt,i as o,af as ee,a6 as Ht,u as Ft,F as ke,bM as Kt,o as Yt,p as Qt,bV as be,z as Xt,v as Zt,eW as Jt,d9 as ei,d8 as ti,eX as ii,eY as ai,f as si,eZ as ni,e_ as De,e$ as oi,b as Mt,n as ri,bB as ye,f0 as li,Q as Oe,aD as Pe,am as ci,aE as Se,e9 as ze,f1 as Fe,f2 as ae,f3 as Ee}from"./index-dK-KQR3u.js";import{u as di}from"./useBlockBrowserClose-DN9OSrBq.js";import{u as ui}from"./usePageTitle-BXecPlTx.js";import{L as pi}from"./LeaveConfirmationModal-CGN7e6eL.js";import{u as Me,A as mi,U as qe}from"./AvatarCreateHeader-Crz9D08b.js";import{c as hi}from"./consts-BXPWDzdU.js";import{V as fi}from"./VoiceModal-Bn4B-Az9.js";import"./chunk-Dcp1dJ6f.js";import"./chunk-C3Vsn2JD.js";import"./chunk-Chjiymov.js";import"./WizardHeader-BZmgOJet.js";import"./LockKeyhole-CCLA48hj.js";import"./TextField-C0GKjWZ2.js";import"./textByLanguage-BCHyhp1a.js";import"./AdornmentSelect-BZIYoObi.js";import"./Autocomplete-AdwFbrGX.js";import"./chunk-hHWxwtHM.js";import"./getLangaugeFlagSrc-CxRzUSgO.js";import"./uploadIcon-CQnRkjwN.js";import"./s3-BQJuckyL.js";import"./ReactPlayer-Bghvi9s3.js";import"./Slider-j3S92_L-.js";import"./dump-DewtckIM.js";import"./Alert-DdPxodJE.js";import"./AltArrowDown-CLy8fyI1.js";import"./AltArrowUp-Jk-7PJMa.js";import"./chunk-Ccq0P8SR.js";import"./index.esm-DDWa65cW.js";import"./index.esm-C4qE9m-H.js";import"./Link-DOVGJBbg.js";import"./Stop-YUvT33VP.js";import"./store-BerQXuIb.js";import"./ExpandMore-CxR-uHRp.js";import"./lottie-react.esm-CgzLbITc.js";import"./Clear-DU0TUgTT.js";import"./Search-BNMkVD8u.js";import"./Trash-DmwKbRsY.js";var qt=(e=>(e.Friendly="Friendly",e.Professional="Professional",e.Excited="Excited",e.Empathetic="Empathetic",e.Frustrated="Frustrated",e))(qt||{});const fe=Object.values(qt),Ie={Friendly:"warm, casual, approachable tone (e.g. hi/hey/hello, thanks, happy to help, feel free, here to help, let'sâ¦). Default when no explicit emotional markers apply.",Excited:"strong enthusiasm (e.g. awesome, amazing, fantastic, super cool, love it, can't wait, let's go, or 2+ exclamation marks).",Professional:"short, factual, neutral, system-like responses.",Empathetic:"acknowledge or respond to emotional distress, concern, frustration, or vulnerability (e.g. I understand this is hard, that sounds frustrating, I'm sorry you're dealing with this).",Frustrated:"clear reprimand, safety, or policy-enforcement language only (e.g. offensive, inappropriate, hate speech, harassment, against policy, this behavior is not okay, I don't tolerate)."};var E=(e=>(e[e.SENTIMENTS=0]="SENTIMENTS",e[e.VOICE=1]="VOICE",e[e.WAIT_FOR_UPLOADS=2]="WAIT_FOR_UPLOADS",e))(E||{});let Be,je,We,$e,Ge,He,Ke,Ye,Qe,Xe,Ze,Je,et,tt,it,at,st,nt,ot,rt,lt,ct,dt,ut;function gi(e,t,i,s,n,c){function d(m,h,f){return function(v,b){return f&&f(v),m[h].call(v,b)}}function y(m,h){for(var f=0;f<m.length;f++)m[f].call(h);return h}function g(m,h,f,v){if(typeof m!="function"&&(v||m!==void 0))throw new TypeError(h+" must "+(f||"be")+" a function"+(v?"":" or undefined"));return m}function N(m,h,f,v,b,H,K,j,X,D,R,_,T){function O(I){if(!T(I))throw new TypeError("Attempted to access private element on non-instance")}var x,P=h[0],U=h[3],q=!j;if(!q){f||Array.isArray(P)||(P=[P]);var u={},r=[],k=b===3?"get":b===4||_?"set":"value";D?(R||_?u={get:pt(function(){return U(this)},v,"get"),set:function(I){h[4](this,I)}}:u[k]=U,R||pt(u[k],v,b===2?"":k)):R||(u=Object.getOwnPropertyDescriptor(m,v))}for(var A=m,me=P.length-1;me>=0;me-=f?2:1){var we=P[me],Re=f?P[me-1]:void 0,Ae={},te={kind:["field","accessor","method","getter","setter","class"][b],name:v,metadata:H,addInitializer:(function(I,W){if(I.v)throw Error("attempted to call addInitializer after decoration was finished");g(W,"An initializer","be",!0),K.push(W)}).bind(null,Ae)};try{if(q)(x=g(we.call(Re,A,te),"class decorators","return"))&&(A=x);else{var ie,he;te.static=X,te.private=D,D?b===2?ie=function(I){return O(I),u.value}:(b<4&&(ie=d(u,"get",O)),b!==3&&(he=d(u,"set",O))):(ie=function(I){return I[v]},(b<2||b===4)&&(he=function(I,W){I[v]=W}));var Ue=te.access={has:D?T.bind():function(I){return v in I}};if(ie&&(Ue.get=ie),he&&(Ue.set=he),A=we.call(Re,_?{get:u.get,set:u.set}:u[k],te),_){if(typeof A=="object"&&A)(x=g(A.get,"accessor.get"))&&(u.get=x),(x=g(A.set,"accessor.set"))&&(u.set=x),(x=g(A.init,"accessor.init"))&&r.push(x);else if(A!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else g(A,(R?"field":"method")+" decorators","return")&&(R?r.push(A):u[k]=A)}}finally{Ae.v=!0}}return(R||_)&&j.push(function(I,W){for(var ve=r.length-1;ve>=0;ve--)W=r[ve].call(I,W);return W}),R||q||(D?_?j.push(d(u,"get"),d(u,"set")):j.push(b===2?u[k]:d.call.bind(u[k])):Object.defineProperty(m,v,u)),A}function V(m,h){return Object.defineProperty(m,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:h})}if(arguments.length>=6)var Q=c[Symbol.metadata||Symbol.for("Symbol.metadata")];var G=Object.create(Q??null),ge=(function(m,h,f,v){var b,H,K=[],j=function(k){return yi(k)===m},X=new Map;function D(k){k&&K.push(y.bind(null,k))}for(var R=0;R<h.length;R++){var _=h[R];if(Array.isArray(_)){var T=_[1],O=_[2],x=_.length>3,P=16&T,U=!!(8&T),q=(T&=7)==0,u=O+"/"+U;if(!q&&!x){var r=X.get(u);if(r===!0||r===3&&T!==4||r===4&&T!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+O);X.set(u,!(T>2)||T)}N(U?m:m.prototype,_,P,x?"#"+O:vi(O),T,v,U?H=H||[]:b=b||[],K,U,x,q,T===1,U&&x?j:f)}}return D(b),D(H),K})(e,t,n,G);return i.length||V(e,G),{e:ge,get c(){var m=[];return i.length&&[V(N(e,[i],s,e.name,5,G,m),G),y.bind(null,m,e)]}}}function vi(e){var t=bi(e,"string");return typeof t=="symbol"?t:t+""}function bi(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var s=i.call(e,t);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function pt(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function yi(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}const Si=[{id:E.SENTIMENTS,label:"Upload footage"},{id:E.VOICE,label:"Voice"},{id:E.WAIT_FOR_UPLOADS,label:"",hidden:!0}],Z=(e="")=>({id:$t(),sentimentLabel:e,description:Ie[e]??"",file:null,s3Url:"",uploadStatus:p.IDLE,maskFile:null,maskUploadStatus:p.IDLE});var se,ne,oe,re,le,ce,de,ue,pe;const Te=class Te{constructor(){S(this,"type",(Be(this),zt.Expressive));S(this,"_abortControllers",new Map);F(this,se,je(this,E.SENTIMENTS));F(this,ne,We(this,""));F(this,oe,$e(this,""));F(this,re,Ge(this,[Z(fe[0])]));F(this,le,He(this,Z("Idle")));F(this,ce,Ke(this,null));F(this,de,Ye(this,{clone:!0}));F(this,ue,Qe(this,!1));F(this,pe,Xe(this,!1));S(this,"setTab",Ze(this,t=>{this.tab=t}));S(this,"setDisplayName",Je(this,t=>{this.displayName=t}));S(this,"setAvatarName",et(this,t=>{this.avatarName=t}));S(this,"addSentiment",tt(this,(t=5)=>{this.sentiments.length>=t||this.sentiments.push(Z())}));S(this,"removeSentiment",it(this,t=>{var i,s;(i=this._abortControllers.get(t))==null||i.abort(),this._abortControllers.delete(t),(s=this._abortControllers.get(`${t}_mask`))==null||s.abort(),this._abortControllers.delete(`${t}_mask`),this.sentiments=this.sentiments.filter(n=>n.id!==t)}));S(this,"updateSentimentLabel",at(this,(t,i)=>{const s=this.sentiments.find(d=>d.id===t);if(!s)return;const n=Ie[s.sentimentLabel];s.sentimentLabel=i;const c=Ie[i]??"";(!s.description||s.description===n)&&(s.description=c)}));S(this,"updateSentimentDescription",st(this,(t,i)=>{const s=this.allSentimentEntries.find(n=>n.id===t);
1s&&(s.description=i)}));S(this,"setListeningEntry",nt(this,t=>{var i,s;if(!t&&this.listeningEntry){const n=this.listeningEntry.id;(i=this._abortControllers.get(n))==null||i.abort(),this._abortControllers.delete(n),(s=this._abortControllers.get(`${n}_mask`))==null||s.abort(),this._abortControllers.delete(`${n}_mask`)}this.listeningEntry=t?Z("Listening"):null}));S(this,"setVoice",ot(this,t=>{this.voice={...this.voice,...t}}));S(this,"setIsPublic",rt(this,t=>{this.isPublic=t}));S(this,"setCreateDebugAssets",lt(this,t=>{this.createDebugAssets=t}));S(this,"handleSentimentVideoUpload",ct(this,async(t,i,s=!1)=>{var N;const n=this.allSentimentEntries.find(V=>V.id===t);if(!n)return;const c=s?`${t}_mask`:t;(N=this._abortControllers.get(c))==null||N.abort();const d=new AbortController;this._abortControllers.set(c,d);const y=i.name.replace(/[^A-Za-z0-9_\-.]/g,"_"),g=y!==i.name?new File([i],y,{type:i.type}):i;s?await Me(g,V=>{n.maskUploadStatus=V},V=>{n.maskFile=i,n.maskS3Url=V},d.signal):await Me(g,V=>{n.uploadStatus=V},V=>{n.file=i,n.s3Url=V},d.signal),this._abortControllers.get(c)===d&&this._abortControllers.delete(c)}));S(this,"clearSentimentVideo",dt(this,(t,i=!1)=>{var c;const s=this.allSentimentEntries.find(d=>d.id===t);if(!s)return;const n=i?`${t}_mask`:t;(c=this._abortControllers.get(n))==null||c.abort(),this._abortControllers.delete(n),i?(s.maskFile=null,s.maskS3Url=void 0,s.maskUploadStatus=p.IDLE):(s.file=null,s.s3Url="",s.uploadStatus=p.IDLE)}));S(this,"init",ut(this,()=>{this._abortControllers.forEach(t=>t.abort()),this._abortControllers.clear(),this.tab=E.SENTIMENTS,this.displayName="",this.avatarName="",this.sentiments=[Z(fe[0])],this.idleEntry=Z("Idle"),this.listeningEntry=null,this.voice={clone:!0},this.isPublic=!1,this.createDebugAssets=!1}))}get tab(){return z(this,se)}set tab(t){M(this,se,t)}get displayName(){return z(this,ne)}set displayName(t){M(this,ne,t)}get avatarName(){return z(this,oe)}set avatarName(t){M(this,oe,t)}get sentiments(){return z(this,re)}set sentiments(t){M(this,re,t)}get idleEntry(){return z(this,le)}set idleEntry(t){M(this,le,t)}get listeningEntry(){return z(this,ce)}set listeningEntry(t){M(this,ce,t)}get voice(){return z(this,de)}set voice(t){M(this,de,t)}get isPublic(){return z(this,ue)}set isPublic(t){M(this,ue,t)}get createDebugAssets(){return z(this,pe)}set createDebugAssets(t){M(this,pe,t)}get tabs(){return Si.map(t=>({...t,disabled:t.id===E.VOICE?!this.isSentimentsValid:t.disabled}))}get allSentimentEntries(){return[...this.sentiments,this.idleEntry,...this.listeningEntry?[this.listeningEntry]:[]]}get allUploadsReady(){return this.allSentimentEntries.every(t=>t.uploadStatus===p.SUCCESS&&(t.maskUploadStatus===p.IDLE||t.maskUploadStatus===p.SUCCESS))}get sentimentsValidationReason(){return this.sentiments.length<1?"Add at least one sentiment.":this.sentiments.some(t=>!t.sentimentLabel)?"Choose a label for every sentiment.":this.sentiments.some(t=>!t.description)?"Add a description for every sentiment.":this.sentiments.some(t=>t.uploadStatus!==p.SUCCESS)?"Upload a video for every sentiment.":this.idleEntry.uploadStatus!==p.SUCCESS?"Upload the required Idle video.":this.listeningEntry&&this.listeningEntry.uploadStatus!==p.SUCCESS?"Upload the Listening video.":this.masksValidationReason}get masksValidationReason(){const t=this.allSentimentEntries.filter(i=>i.maskUploadStatus!==p.IDLE);if(t.length!==0){if(t.length<this.allSentimentEntries.length)return"Add a mask video for every sentiment, or remove all masks.";if(t.some(i=>i.maskUploadStatus===p.LOADING))return"Wait for all mask uploads to finish.";if(t.some(i=>i.maskUploadStatus===p.ERROR))return"A mask video failed to upload. Retry or remove it."}}get isSentimentsValid(){return!this.sentimentsValidationReason}get isVoiceValid(){return this.voice.clone||!!this.voice.selectedVoiceId}get createValidationReason(){if(!this.displayName)return"Enter a display name.";if(!this.avatarName)return"Enter an avatar name.";if(this.sentimentsValidationReason)return this.sentimentsValidationReason;if(!this.isVoiceValid)return"Select a voice for your avatar."}get isValid(){return!this.createValidationReason}get isDirty(){return!!this.displayName||!!this.avatarName||this.isPublic||this.createDebugAssets||this.allSentimentEntries.some(t=>t.uploadStatus===p.LOADING||t.uploadStatus===p.SUCCESS||t.maskUploadStatus===p.LOADING||t.maskUploadStatus===p.SUCCESS)}get payload(){var i;const t=!this.voice.clone&&this.voice.selectedVoiceId?{voice_id:this.voice.selectedVoiceId,voice_provider:this.voice.selectedVoiceProvider}:{};return{display_name:this.displayName,avatar_name:this.avatarName,default_sentiment:(i=this.sentiments[0])==null?void 0:i.sentimentLabel.toLowerCase(),sentiments:this.allSentimentEntries.filter(s=>s.s3Url).map((s,n)=>({sentiment:s.sentimentLabel.toLowerCase(),source_url:s.s3Url,description:s.description??"",...n===0?{is_primary:!0}:{},...s.maskS3Url?{mask_url:s.maskS3Url}:{}})),...this.isPublic?{future_public_presenter:!0}:{},...this.createDebugAssets?{create_debug_assets:!0}:{},...t}}};se=new WeakMap,ne=new WeakMap,oe=new WeakMap,re=new WeakMap,le=new WeakMap,ce=new WeakMap,de=new WeakMap,ue=new WeakMap,pe=new WeakMap,[je,We,$e,Ge,He,Ke,Ye,Qe,Xe,Ze,Je,et,tt,it,at,st,nt,ot,rt,lt,ct,dt,ut,Be]=gi(Te,[[B,1,"tab"],[B,1,"displayName"],[B,1,"avatarName"],[B,1,"sentiments"],[B,1,"idleEntry"],[B,1,"listeningEntry"],[B,1,"voice"],[B,1,"isPublic"],[B,1,"createDebugAssets"],[L,3,"tabs"],[L,3,"allSentimentEntries"],[L,3,"allUploadsReady"],[L,3,"sentimentsValidationReason"],[L,3,"masksValidationReason"],[L,3,"isSentimentsValid"],[L,3,"isVoiceValid"],[L,3,"createValidationReason"],[L,3,"isValid"],[L,3,"isDirty"],[L,3,"payload"],[w,0,"setTab"],[w,0,"setDisplayName"],[w,0,"setAvatarName"],[w,0,"addSentiment"],[w,0,"removeSentiment"],[w,0,"updateSentimentLabel"],[w,0,"updateSentimentDescription"],[w,0,"setListeningEntry"],[w,0,"setVoice"],[w,0,"setIsPublic"],[w,0,"setCreateDebugAssets"],[w,0,"handleSentimentVideoUpload"],[w,0,"clearSentimentVideo"],[w,0,"init"]],[]).e;let Ve=Te;const mt=new Ve,Bt=C.createContext(null),Ei=({children:e})=>{const[t]=C.useState(()=>(mt.init(),mt));return C.useEffect(()=>()=>t.init(),[t]),a(Bt.Provider,{value:t,children:e})},$=()=>{const e=C.useContext(Bt);if(!e)throw new Error("useExpressiveCreateAvatarStore must be used within an ExpressiveCreateAvatarProvider");return e},xe=o(ee,{target:"ee317zk1"})({name:"u5tau2",styles:"width:16rem;font-size:1.6rem;margin:1px 15px 0 0;padding:5px 16px 4px"}),xi=o("div",{target:"ee317zk0"})({name:"1xztgus",styles:"display:flex;flex-wrap:nowrap"}),ht=({reason:e,children:t})=>a(Ht,{content:e??"",disabled:!e,placement:"top",children:a("span",{children:t})}),Ci=Y(()=>{const e=$(),t=e.tab===E.WAIT_FOR_UPLOADS,i=e.tab===E.SENTIMENTS,s=e.tab===E.VOICE,n=()=>{i||t||e.setTab(e.tab-1)},c=()=>{t||e.setTab(e.tab+1)},d=e.tab===E.SENTIMENTS&&!e.isSentimentsValid,y=!e.isValid;return l(xi,{children:[!i&&!t&&a(xe,{variant:"outlined",onClick:n,"aria-label":"Back",children:"Back"}),!s&&!t&&a(ht,{reason:d?e.sentimentsValidationReason:void 0,children:a(xe,{variant:"secondary",onClick:c,"aria-label":"Next",disabled:d,rightIcon:a(J,{src:Gt,color:"white",size:"26px"}),children:"Next"})}),s&&a(ht,{reason:y?e.createValidationReason:void 0,children:a(xe,{variant:"secondary",onClick:c,"aria-label":"Create Avatar",disabled:y,children:"Create Avatar"})})]})}),_i=Y(()=>{const e=Ft(),t=$(),[i,s]=C.useState(!1);return l(ke,{children:[a(mi,{onBack:()=>{t.isDirty?s(!0):e(-1)},tab:t.tab,setTab:c=>t.setTab(c),tabs:t.tabs,actions:a(Ci,{})}),a(pi,{open:i,onClose:()=>s(!1),onCancel:()=>{s(!1),e(-1)},onConfirm:()=>s(!1),cancelText:"Leave",confirmText:"Stay",message:"Your uploaded videos will be lost if you leave now."})]})}),ki=e=>{const t=Ft(),i=Kt(),s=$(),n=Yt();return Qt(()=>(n==null||n.track("avatar-generate",{type:s.type,event:be.CLICK}),ni(s.payload)),{onSuccess:async({id:c})=>{await Promise.all([i.invalidateQueries([Jt,ei(ti.Upload)],{refetchInactive:!0}),i.invalidateQueries(ii,{refetchInactive:!0}),i.invalidateQueries(ai,{refetchInactive:!0})]),n==null||n.track("avatar-generate",{type:s.type,id:c,event:be.SUCCESS}),t(si.AvatarCreateExpressiveSuccessPage)},onError:c=>{n==null||n.track("avatar-generate",{type:s.type,event:be.ERROR}),Xt.error("Failed to create expressive avatar",c),e?e():s.setTab(E.VOICE),Zt.error({title:"Failed to create avatar, please try again"})}})},Ii=o("div",{target:"e1squkz35"})({name:"6o3yio",styles:"display:grid;grid-template-rows:1fr 1fr 1fr 1fr;height:100%"}),Vi=o("div",{target:"e1squkz34"})({name:"ocf6c8",styles:"display:flex;flex-direction:column;align-items:center;grid-row:2"}),Ti=o("h2",{target:"e1squkz33"})("font-size:36px;font-weight:700;color:",({theme:e})=>e.colors.secondary[900],";margin:0;"),wi=o("p",{target:"e1squkz32"})("font-size:28px;font-weight:700;color:",({theme:e})=>e.colors.black[700],";margin:8px 0 0;"),Ri=o("div",{target:"e1squkz31"})({name:"1qn8hon",styles:"margin-top:52px;width:278px"}),Ai=o(ee,{target:"e1squkz30"})("display:flex;align-items:center;width:16rem;margin:30px 15px 0 0;padding:5px 16px 4px;gap:6px;font-size:1.6rem;border:1px solid ",({theme:e})=>e.colors.black[300],";"),ft=120,Ui=Y(({onCancel:e,onError:t})=>{const i=$(),s=ki(t),n=C.useRef(new Date().getTime());C.useEffect(()=>De(()=>i.allUploadsReady,()=>s.mutate()),[]),C.useEffect(()=>De(()=>i.allSentimentEntries.some(y=>y.uploadStatus===p.ERROR||y.maskUploadStatus===p.ERROR),()=>{e?e():i.setTab(E.SENTIMENTS)}),[]);const c=()=>{e?e():i.setTab(E.VOICE)};return a(Ii,{children:l(Vi,{children:[a(Ti,{children:"Uploading your footage."}),a(wi,{children:"This won't take long."}),a(Ri,{children:a(oi,{duration:ft,startedAt:n.current,calcFormula:()=>ft,updateIntervalMS:100,minProgressShown:1,theme:"light",textVariant:"text-aside"})}),a(Ai,{variant:"outlined",onClick:c,"aria-label":"Cancel",children:"Cancel"})]})})}),gt="__other__",Ni=o("div",{target:"e1ydqrhb11"})("display:flex;flex-direction:column;gap:16px;padding:24px;border:1px solid ",({theme:e})=>e.colors.black[200],";border-radius:12px;background:",({theme:e})=>e.colors.chill.panelBg,";"),Li=o("div",{target:"e1ydqrhb10"})({name:"bcffy2",styles:"display:flex;align-items:center;justify-content:space-between"}),Di=o("span",{target:"e1ydqrhb9"})("font-size:16px;font-weight:700;color:",({theme:e})=>e.colors.secondary[900],";"),Oi=o("div",{target:"e1ydqrhb8"})({name:"1efjp34",styles:"display:flex;gap:16px;align-items:flex-start"}),Pi=o("div",{target:"e1ydqrhb7"})("display:flex;flex-direction:column;gap:10px;padding-top:4px;border-top:1px solid ",({theme:e})=>e.colors.black[100],";"),vt=o("button",{target:"e1ydqrhb6"})("background:none;border:none;padding:0;font-size:13px;font-weight:500;color:",({theme:e})=>e.colors.black[700],";cursor:pointer;text-align:left;text-decoration:underline;&:hover{color:",({theme:e})=>e.colors.secondary[900],";}"),zi=o("span",{target:"e1ydqrhb5"})("font-size:13px;font-weight:600;color:",({theme:e})=>e.colors.black[700],";"),bt=o("div",{target:"e1ydqrhb4"})("position:relative;width:100%;border-radius:8px;overflow:hidden;aspect-ratio:16/9;background:",({theme:e})=>e.colors.black[100],";display:flex;align-items:center;justify-content:center;"),yt=o("video",{target:"e1ydqrhb3"})({name:"4uwt2b",styles:"width:100%;height:100%;object-fit:cover"}),St=o(ee,{target:"e1ydqrhb2"})({name:"plyrhm",styles:"position:absolute;top:6px;right:6px;min-width:unset;padding:4px;border-radius:50%"}),Et=o("div",{target:"e1ydqrhb1"})({name:"1pi78hi",styles:"display:flex;align-items:center;gap:6px"}),xt=o("span",{target:"e1ydqrhb0"})("font-size:13px;color:",({theme:e})=>e.colors.black[700],";"),{minFileDurationInSeconds:Ct,maxFileDurationInSeconds:_t,maxFileSizeInMB:kt,uploadFootageSubtext:It,minResolution:Vt}=hi[zt.Expressive],Tt=Y(({entry:e,title:t,removable:i=!1,showLabelPicker:s=!1})=>{var u;const n=$(),{user:c}=Mt(),d=ri(),y=!((u=c==null?void 0:c.features)!=null&&u.includes("expressives-self-serve:no-duration-check")),g=fe.includes(e.sentimentLabel),[N,V]=C.useState(g?e.sentimentLabel:e.sentimentLabel?gt:""),[Q,G]=C.useState(!g&&!!e.sentimentLabel),[ge,m]=C.useState(!1),h=C.useMemo(()=>e.file?URL.createObjectURL(e.file):null,[e.file]),f=C.useMemo(()=>e.maskFile?URL.createObjectURL(e.maskFile):null,[e.maskFile]);C.useEffect(()=>()=>{h&&URL.revokeObjectURL(h)},[h]),C.useEffect(()=>()=>{f&&URL.revokeObjectURL(f)},[f]);const v=new Set(n.sentiments.filter(r=>r.id!==e.id).map(r=>r.sentimentLabel)),b=[...fe.map(r=>({value:r,label:r,disabled:v.has(r)}))],H=r=>{r&&(V(r),r!==gt?(G(!1),n.updateSentimentLabel(e.id,r)):(G(!0),n.updateSentimentLabel(e.id,"")))},K=r=>{const k=r.target.value;v.has(k)||n.updateSentimentLabel(e.id,k)},j=r=>{n.updateSentimentDescription(e.id,r.target.value)},X=r=>{r&&n.handleSentimentVideoUpload(e.id,r)},D=r=>{r&&n.handleSentimentVideoUpload(e.id,r,!0)},R=()=>n.clearSentimentVideo(e.id),_=()=>n.clearSentimentVideo(e.id,!0),T=()=>n.removeSentiment(e.id),O=e.uploadStatus===p.LOADING,x=e.uploadStatus===p.SUCCESS,P=e.maskUploadStatus===p.LOADING,U=e.maskUploadStatus===p.SUCCESS,q=e.maskUploadStatus===p.ERROR;return l(Ni,{children:[l(Li,{children:[a(Di,{children:t}),i&&a(ee,{variant:"neutral",appearance:"text",onClick:T,"aria-label":"Remove sentiment",size:"small",children:a(J,{src:ye,size:"18px",color:d.colors.black[500]})})]}),s&&l(Oi,{children:[a("div",{style:{flex:Q?1:void 0,width:Q?void 0:"100%"},children:a(li,{options:b,value:N,onValueChange:H,placeholder:"Select sentiment",size:"small","aria-label":"Sentiment"})}),Q&&a(Oe,{size:"small",label:"Custom label",placeholder:"e.g. Surprised",value:e.sentimentLabel,onChange:K,sx:{flex:1}})]}),a(Oe,{size:"small",label:"Description",placeholder:"Briefly describe the emotion or scenario in the video",value:e.description??"",onChange:j,multiline:!0,minRows:2,fullWidth:!0}
1),x&&h?l(bt,{children:[a(yt,{src:h,controls:!1}),a(St,{variant:"neutral",appearance:"text",onClick:R,"aria-label":"Remove video",size:"small",children:a(J,{src:ye,size:"16px",color:"white"})})]}):a(qe,{onFileChange:X,isDurationCheckRequired:y,minFileDurationInSeconds:Ct,maxFileDurationInSeconds:_t,maxFileSizeInMB:kt,uploadFootageSubtext:It,minResoultion:Vt,compact:!0,isLoading:O}),x&&l(Et,{children:[a(J,{src:Pe,size:"18px",color:d.colors.success[550]}),l(xt,{children:["Video uploaded",e.file?` â ${e.file.name}`:""]})]}),a(Pi,{children:!ge&&!U&&!q?a(vt,{onClick:()=>m(!0),children:"+ Add mask video (optional â auto-generated if not provided)"}):l(ke,{children:[a(zi,{children:"Mask video (optional)"}),U&&f?l(bt,{children:[a(yt,{src:f,controls:!1}),a(St,{variant:"neutral",appearance:"text",onClick:_,"aria-label":"Remove mask video",size:"small",children:a(J,{src:ye,size:"16px",color:"white"})})]}):l(ke,{children:[a(qe,{onFileChange:D,isDurationCheckRequired:y,minFileDurationInSeconds:Ct,maxFileDurationInSeconds:_t,maxFileSizeInMB:kt,uploadFootageSubtext:It,minResoultion:Vt,compact:!0,isLoading:P}),q&&a(vt,{onClick:_,children:"Upload failed â click to remove and try again"})]}),U&&l(Et,{children:[a(J,{src:Pe,size:"18px",color:d.colors.success[550]}),l(xt,{children:["Mask uploaded",e.maskFile?` â ${e.maskFile.name}`:""]})]})]})})]})}),Fi="enable-to-create-public-presenters",Mi="internal-call",qi=o("div",{target:"e1rtetvw8"})({name:"mv10ia",styles:"display:flex;flex-direction:column;gap:40px;padding:32px 48px 48px;max-width:800px;width:100%;margin:0 auto;overflow-y:auto"}),wt=o("h2",{target:"e1rtetvw7"})("font-size:22px;font-weight:700;color:",({theme:e})=>e.colors.secondary[900],";margin:0;"),Rt=o("p",{target:"e1rtetvw6"})("font-size:15px;color:",({theme:e})=>e.colors.black[700],";margin:4px 0 0;"),Ce=o("div",{target:"e1rtetvw5"})({name:"urqszi",styles:"display:flex;flex-direction:column;gap:4px"}),_e=o("div",{target:"e1rtetvw4"})({name:"90biyi",styles:"display:flex;flex-direction:column;gap:20px"}),At=o("hr",{target:"e1rtetvw3"})("border:none;border-top:1px solid ",({theme:e})=>e.colors.black[200],";margin:0;"),Bi=o(ee,{target:"e1rtetvw2"})({name:"1o6hn7j",styles:"align-self:flex-start;font-size:14px"}),Ut=o("div",{target:"e1rtetvw0"})({name:"urqszi",styles:"display:flex;flex-direction:column;gap:4px"}),ji=!1,Wi=Y(()=>{var d,y;const e=$(),{user:t}=Mt(),i=ci("expressive_creation_max_sentiments",5),s=((d=t==null?void 0:t.features)==null?void 0:d.includes(Fi))??!1,n=((y=t==null?void 0:t.features)==null?void 0:y.includes(Mi))??!1,c=e.sentiments.length<i;return l(qi,{children:[l(_e,{children:[a(Ce,{children:a(Se,{variant:"title",as:"h2",children:"Avatar name"})}),a(ze,{size:"small",label:"Display name",placeholder:"e.g. My Expressive Avatar",value:e.displayName,onChange:g=>e.setDisplayName(g.target.value)}),a(ze,{size:"small",label:"Avatar name",placeholder:"e.g. my-expressive-avatar",value:e.avatarName,onChange:g=>e.setAvatarName(g.target.value)}),s&&l(Ut,{children:[a(Fe,{checked:e.isPublic,onChange:e.setIsPublic,label:"Make this a public avatar","aria-label":"Make this a public avatar"}),a(Se,{variant:"caption",color:"muted",as:"span",children:"Public avatars are available to all users in the shared avatar library."})]}),n&&l(Ut,{children:[a(Fe,{checked:e.createDebugAssets,onChange:e.setCreateDebugAssets,label:"Create debug assets","aria-label":"Create debug assets"}),a(Se,{variant:"caption",color:"muted",as:"span",children:"Generates additional debug artifacts during training. Internal use only."})]})]}),a(At,{}),l(_e,{children:[l(Ce,{children:[a(wt,{children:"Upload footage per sentiment"}),l(Rt,{children:["Upload a 30â90 second video for each sentiment. The first sentiment is your default. You can add up to"," ",i," sentiments total. For each video you may also upload an optional mask â if not provided, one will be generated automatically."]})]}),e.sentiments.map((g,N)=>a(Tt,{entry:g,title:N===0?"Primary sentiment (default)":`Sentiment ${N+1}`,removable:N>0,showLabelPicker:!0},g.id)),c&&a(Bi,{variant:"outlined","aria-label":"Add another sentiment",onClick:()=>e.addSentiment(i),children:"+ Add another sentiment"})]}),a(At,{}),l(_e,{children:[l(Ce,{children:[a(wt,{children:"Idle"}),a(Rt,{children:"Required. Upload a 30â90 second idle video â the avatar will loop this when not speaking. Mask video is optional; one will be auto-generated if not uploaded."})]}),a(Tt,{entry:e.idleEntry,title:"Idle video"})]}),ji]})}),$i=e=>!(e.name.includes(" HD ")||e.name.endsWith(" HD")),Gi=[ae.LANGUAGE,ae.USE_CASE,ae.VOICE_FUNCTION],Hi=[Ee.Elevenlabs,Ee.Microsoft,Ee.AzureOpenAi],Ki=o("div",{target:"e18yxfps10"})({name:"86pv77",styles:"display:flex;flex-direction:column;gap:40px;padding:32px 48px 48px;max-width:700px;width:100%;margin:0 auto"}),Yi=o("h2",{target:"e18yxfps9"})("font-size:22px;font-weight:700;color:",({theme:e})=>e.colors.secondary[900],";margin:0;"),Qi=o("p",{target:"e18yxfps8"})("font-size:15px;color:",({theme:e})=>e.colors.black[700],";margin:4px 0 0;"),Xi=o("div",{target:"e18yxfps7"})({name:"urqszi",styles:"display:flex;flex-direction:column;gap:4px"}),Nt=o("div",{target:"e18yxfps6"})("display:flex;align-items:center;justify-content:space-between;padding:20px 24px;border-radius:12px;border:2px solid ",({active:e,theme:t})=>e?t.colors.secondary[900]:t.colors.black[200],";cursor:pointer;transition:border-color 0.15s;background:",({theme:e})=>e.colors.chill.panelBg,";&:hover{border-color:",({theme:e})=>e.colors.secondary[500],";}"),Lt=o("div",{target:"e18yxfps5"})({name:"urqszi",styles:"display:flex;flex-direction:column;gap:4px"}),Dt=o("span",{target:"e18yxfps4"})("font-size:16px;font-weight:600;color:",({theme:e})=>e.colors.secondary[900],";"),Ot=o("span",{target:"e18yxfps3"})("font-size:14px;color:",({theme:e})=>e.colors.black[700],";"),Pt=o("div",{target:"e18yxfps2"})("width:20px;height:20px;border-radius:50%;border:2px solid ",({active:e,theme:t})=>e?t.colors.secondary[900]:t.colors.black[300],";display:flex;align-items:center;justify-content:center;flex-shrink:0;&::after{content:'';display:",({active:e})=>e?"block":"none",";width:10px;height:10px;border-radius:50%;background:",({theme:e})=>e.colors.secondary[900],";}"),Zi=o("span",{target:"e18yxfps1"})("font-size:14px;color:",({theme:e})=>e.colors.black[700],";margin-top:8px;"),Ji=o(ee,{target:"e18yxfps0"})({name:"1fr82jm",styles:"align-self:flex-start;font-size:14px;margin-top:4px"}),ea=Y(()=>{const e=$(),[t,i]=C.useState(!1),s=n=>{e.setVoice({clone:!1,selectedVoiceId:n.id,selectedVoiceProvider:n.provider,selectedVoiceName:n.name}),i(!1)};return l(Ki,{children:[l(Xi,{children:[a(Yi,{children:"Choose a voice"}),a(Qi,{children:"Select how your avatar will speak."})]}),l(Nt,{active:!!e.voice.clone,onClick:()=>e.setVoice({clone:!0,selectedVoiceId:void 0,selectedVoiceProvider:void 0}),children:[l(Lt,{children:[a(Dt,{children:"Clone my voice"}),a(Ot,{children:"We will clone your voice from the footage you uploaded."})]}),a(Pt,{active:!!e.voice.clone})]}),l(Nt,{active:!e.voice.clone,onClick:()=>e.setVoice({clone:!1}),children:[l(Lt,{children:[a(Dt,{children:"Select a voice"}),a(Ot,{children:"Choose from our library of voices."}),!e.voice.clone&&e.voice.selectedVoiceName&&a(Zi,{children:e.voice.selectedVoiceName}),!e.voice.clone&&a(Ji,{variant:"outlined","aria-label":e.voice.selectedVoiceId?"Change voice":"Browse voices",onClick:n=>{n.stopPropagation(),i(!0)},children:e.voice.selectedVoiceId?"Change voice":"Browse voices"})]}),a(Pt,{active:!e.voice.clone})]}),a(fi,{open:t,onClose:()=>i(!1),selectedVoice:null,onSelectedVoiceChange:s,filters:{[ae.PROVIDERS]:Hi,[ae.CUSTOM]:$i},hiddenFilters:Gi,showLowLatencyTag:!0})]})}),ta=o("div",{target:"e15r6df70"})("background-color:",({theme:e})=>e.colors.chill.panelBg,";display:flex;flex-direction:column;height:100%;max-width:100vw;"),ia="Create Avatar - D-ID",aa=Y(()=>{const e=$();return di(()=>e.isDirty),ui(ia),l(ta,{children:[a(_i,{}),e.tab===E.SENTIMENTS&&a(Wi,{}),e.tab===E.VOICE&&a(ea,{}),e.tab===E.WAIT_FOR_UPLOADS&&a(Ui,{})]})}),Ba=()=>a(Ei,{children:a(aa,{})});
1export{Ba as AvatarExpressiveCreatePage};
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.