PageSourceSearch

https://suno.com/_next/static/immutable/chunks/15e08cul1mz06.js

js suno.com collected 2026-10-01 08:29:46 UTC 133,577 bytes, 6 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3c9fca7b-5ac5-5c22-9e74-e4a4c48926b4")}catch(e){}}();
3(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,216025,e=>{"use strict";var t=e.i(224568);e.s(["CacheProvider",()=>t.C])},871819,e=>{"use strict";var t=e.i(224568);e.s(["ThemeProvider",()=>t.a])},230902,661977,e=>{"use strict";let t={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function r(e){return (t={})=>{let r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}let n={date:r({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:r({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:r({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},a={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function o(e){return(t,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,a=r?.width?String(r.width):t;n=e.formattingValues[a]||e.formattingValues[t]}else{let t=e.defaultWidth,a=r?.width?String(r.width):e.defaultWidth;n=e.values[a]||e.values[t]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function i(e){return(t,r={})=>{let n,a=r.width,o=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;let s=i[0],u=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(u)?function(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}(u,e=>e.test(s)):function(e,t){for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}(u,e=>e.test(s));return n=e.valueCallback?e.valueCallback(l):l,{value:n=r.valueCallback?r.valueCallback(n):n,rest:t.slice(s.length)}}}let s={code:"en-US",formatDistance:(e,r,n)=>{let a,o=t[e];if(a="string"==typeof o?o:1===r?o.one:o.other.replace("{{count}}",r.toString()),n?.addSuffix)if(n.comparison&&n.comparison>0)return"in "+a;else return a+" ago";return a},formatLong:n,formatRelative:(e,t,r,n)=>a[e],localize:{ordinalNumber:(e,t)=>{let r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:o({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:o({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:o({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:o({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
3ay","Saturday"]},defaultWidth:"wide"}),dayPeriod:o({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(l={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{let r=e.match(l.matchPattern);if(!r)return null;let n=r[0],a=e.match(l.parsePattern);if(!a)return null;let o=l.valueCallback?l.valueCallback(a[0]):a[0];return{value:o=t.valueCallback?t.valueCallback(o):o,rest:e.slice(n.length)}}),era:i({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:i({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:i({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:i({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:i({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},u={};var l,c=e.i(516467);function d(e){let t=(0,c.toDate)(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),e-r}var f=e.i(487122),h=e.i(511518);function p(e,t){let r=(0,c.toDate)(e,t?.in);return r.setHours(0,0,0,0),r}function m(e,t){let r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??u.weekStartsOn??u.locale?.options?.weekStartsOn??0,n=(0,c.toDate)(e,t?.in),a=n.getDay();return n.setDate(n.getDate()-(7*(a<r)+a-r)),n.setHours(0,0,0,0),n}function g(e,t){return m(e,{...t,weekStartsOn:1})}function y(e,t){let r=(0,c.toDate)(e,t?.in),n=r.getFullYear(),a=(0,f.constructFrom)(r,0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);let o=g(a),i=(0,f.constructFrom)(r,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);let s=g(i);return r.getTime()>=o.getTime()?n+1:r.getTime()>=s.getTime()?n:n-1}function v(e,t){let r=(0,c.toDate)(e,t?.in),n=r.getFullYear(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??u.firstWeekContainsDate??u.locale?.options?.firstWeekContainsDate??1,o=(0,f.constructFrom)(t?.in||e,0);o.setFullYear(n+1,0,a),o.setHours(0,0,0,0);let i=m(o,t),s=(0,f.constructFrom)(t?.in||e,0);s.setFullYear(n,0,a),s.setHours(0,0,0,0);let l=m(s,t);return+r>=+i?n+1:+r>=+l?n:n-1}function w(e,t){let r=Math.abs(e).toString().padStart(t,"0");return(e<0?"-":"")+r}let b={y(e,t){let r=e.getFullYear(),n=r>0?r:1-r;return w("yy"===t?n%100:n,t.length)},M(e,t){let r=e.getMonth();return"M"===t?String(r+1):w(r+1,2)},d:(e,t)=>w(e.getDate(),t.length),a(e,t){let r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];
3default:return"am"===r?"a.m.":"p.m."}},h:(e,t)=>w(e.getHours()%12||12,t.length),H:(e,t)=>w(e.getHours(),t.length),m:(e,t)=>w(e.getMinutes(),t.length),s:(e,t)=>w(e.getSeconds(),t.length),S(e,t){let r=t.length;return w(Math.trunc(e.getMilliseconds()*Math.pow(10,r-3)),t.length)}},S={G:function(e,t,r){let n=+(e.getFullYear()>0);switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){let t=e.getFullYear();return r.ordinalNumber(t>0?t:1-t,{unit:"year"})}return b.y(e,t)},Y:function(e,t,r,n){let a=v(e,n),o=a>0?a:1-a;return"YY"===t?w(o%100,2):"Yo"===t?r.ordinalNumber(o,{unit:"year"}):w(o,t.length)},R:function(e,t){return w(y(e),t.length)},u:function(e,t){return w(e.getFullYear(),t.length)},Q:function(e,t,r){let n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return w(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){let n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return w(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){let n=e.getMonth();switch(t){case"M":case"MM":return b.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){let n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return w(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){let a,o,i,s,l=Math.round((m(a=(0,c.toDate)(e,n?.in),n)-(o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??u.firstWeekContainsDate??u.locale?.options?.firstWeekContainsDate??1,i=v(a,n),(s=(0,f.constructFrom)(n?.in||a,0)).setFullYear(i,0,o),s.setHours(0,0,0,0),m(s,n)))/h.millisecondsInWeek)+1;return"wo"===t?r.ordinalNumber(l,{unit:"week"}):w(l,t.length)},I:function(e,t,r){let n,a,o,i=Math.round((g(n=(0,c.toDate)(e,void 0))-(a=y(n,void 0),(o=(0,f.constructFrom)(n,0)).setFullYear(a,0,4),o.setHours(0,0,0,0),g(o)))/h.millisecondsInWeek)+1;return"Io"===t?r.ordinalNumber(i,{unit:"week"}):w(i,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getDate(),{unit:"date"}):b.d(e,t)},D:function(e,t,r){let n,a,o=function(e,t){let[r,n]=function(e,...t){let r=f.constructFrom.bind(null,e||t.find(e=>"object"==typeof e));return t.map(r)}(void 0,e,t),a=p(r),o=p(n);return Math.round((a-d(a)-(o-d(o)))/h.millisecondsInDay)}(n=(0,c.toDate)(e,void 0),((a=(0,c.toDate)(n,void 0)).setFullYear(a.getFullYear(),0,1),a.setHours(0,0,0,0),a))+1;return"Do"===t?r.ordinalNumber(o,{unit:"dayOfYear"}):w(o,t.length)},E:function(e,t,r){let n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){let a=e.getDay(),o=(a-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return w(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){let a=e.getDay(),o=(a-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return w(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,r){let n=e.getDay(),a=0===n?7:n;switch(t){case"i":return String(a);case"ii":return w(a,t.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){let n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){let n,a=e.getHours();switch(n=12===a?"noon":0===a?"midnight":a/12>
3=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,r){let n,a=e.getHours();switch(n=a>=17?"evening":a>=12?"afternoon":a>=4?"morning":"night",t){case"B":case"BB":case"BBB":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),r.ordinalNumber(t,{unit:"hour"})}return b.h(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getHours(),{unit:"hour"}):b.H(e,t)},K:function(e,t,r){let n=e.getHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):w(n,t.length)},k:function(e,t,r){let n=e.getHours();return(0===n&&(n=24),"ko"===t)?r.ordinalNumber(n,{unit:"hour"}):w(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):b.m(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getSeconds(),{unit:"second"}):b.s(e,t)},S:function(e,t){return b.S(e,t)},X:function(e,t,r){let n=e.getTimezoneOffset();if(0===n)return"Z";switch(t){case"X":return M(n);case"XXXX":case"XX":return _(n);default:return _(n,":")}},x:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"x":return M(n);case"xxxx":case"xx":return _(n);default:return _(n,":")}},O:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+x(n,":");default:return"GMT"+_(n,":")}},z:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+x(n,":");default:return"GMT"+_(n,":")}},t:function(e,t,r){return w(Math.trunc(e/1e3),t.length)},T:function(e,t,r){return w(+e,t.length)}};function x(e,t=""){let r=e>0?"-":"+",n=Math.abs(e),a=Math.trunc(n/60),o=n%60;return 0===o?r+String(a):r+String(a)+t+w(o,2)}function M(e,t){return e%60==0?(e>0?"-":"+")+w(Math.abs(e)/60,2):_(e,t)}function _(e,t=""){let r=Math.abs(e);return(e>0?"-":"+")+w(Math.trunc(r/60),2)+t+w(r%60,2)}let k=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},E=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},C={p:E,P:(e,t)=>{let r,n=e.match(/(P+)(p+)?/)||[],a=n[1],o=n[2];if(!o)return k(e,t);switch(a){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;default:r=t.dateTime({width:"full"})}return r.replace("{{date}}",k(a,t)).replace("{{time}}",E(o,t))}},T=/^D+$/,P=/^Y+$/,A=["D","DD","YY","YYYY"];function O(e){return!(!(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))&&"number"!=typeof e||isNaN(+(0,c.toDate)(e)))}e.s(["isValid",0,O],661977);let I=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,B=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,D=/^'([^]*?)'?$/,R=/''/g,j=/[a-zA-Z]/;e.s(["format",0,function(e,t,r){let n=r?.locale??u.locale??s,a=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??u.firstWeekContainsDate??u.locale?.options?.firstWeekContainsDate??1,o=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??u.weekStartsOn??u.locale?.options?.weekStartsOn??0,i=(0,c.toDate)(e,r?.in);if(!O(i))throw RangeError("Invalid time value");let l=t.match(B).map(e=>{let t=e[0];return"p"===t||"P"===t?(0,C[t])(e,n.formatLong):e}).join("").match(I).map(e=>{if("''"===e)return{isToken:!1,value:"'"};let t=e[0];if("'"===t){var r;let t;return{isToken:!1,value:(t=(r=e).match(D))?t[1].replace(R,"'"):r}}if(S[t])return{isToken:!0,value:e};if(t.match(j))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});n.localize.preprocessor&&(l=n.localize.preprocessor(i,l));let d={firstWeekContainsDate:a,weekStartsOn:o,locale:n};return l.map(a=>{if(!a.isToken)return a.value;let o=a.value;return(!r?.useAdditionalWeekYearTokens&&P.test(o)||!r?.useAdditionalDayOfYearTokens&&T.test(o))&&function(e,t,r){var n,a,o;let i,s=(n=e,a=t,o=r,i="Y"===n[0]?"years":"days of the month",`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${a}\`) for formatting ${i} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(console.warn(s),A.includes(e))throw RangeError(s)}(o,t,String(e)),(0,S[o[0]])(i,o,n.localize,d)}).join("")}],230902)}
3,516467,511518,487122,e=>{"use strict";let t=Symbol.for("constructDateFrom");function r(e,r){return"function"==typeof e?e(r):e&&"object"==typeof e&&t in e?e[t](r):e instanceof Date?new e.constructor(r):new Date(r)}e.s(["constructFromSymbol",0,t,"millisecondsInDay",0,864e5,"millisecondsInHour",0,36e5,"millisecondsInMinute",0,6e4,"millisecondsInWeek",0,6048e5],511518),e.s(["constructFrom",0,r],487122),e.s(["toDate",0,function(e,t){return r(t||e,e)}],516467)},230564,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={callServer:function(){return o.callServer},createServerReference:function(){return s.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let o=e.r(906840),i=e.r(191208),s=e.r(725201)},884464,(e,t,r)=>{var n={872:function(e,t){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,o=u(e),i=o[0],s=o[1],l=new a((i+s)*3/4-s),c=0,d=s>0?i-4:i;for(r=0;r<d;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],l[c++]=t>>16&255,l[c++]=t>>8&255,l[c++]=255&t;return 2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t),1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t),l},t.fromByteArray=function(e){for(var t,n=e.length,a=n%3,o=[],i=0,s=n-a;i<s;i+=16383)o.push(function(e,t,n){for(var a,o=[],i=t;i<n;i+=3)a=(e[i]<<16&0xff0000)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(r[a>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}(e,i,i+16383>s?s:i+16383));return 1===a?o.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===a&&o.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")};for(var r=[],n=[],a="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=o.length;i<s;++i)r[i]=o[i],n[o.charCodeAt(i)]=i;function u(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},230:function(e,t,r){"use strict";var n=r(872),a=r(321),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function i(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e){var n=e,a=t;if(("string"!=typeof a||""===a)&&(a="utf8"),!s.isEncoding(a))throw TypeError("Unknown encoding: "+a);var o=0|h(n,a),u=i(o),l=u.write(n,a);return l!==o&&(u=u.slice(0,l)),u}if(ArrayBuffer.isView(e))return d(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(P(e,ArrayBuffer)||e&&P(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(P(e,SharedArrayBuffer)||e&&P(e.buffer,SharedArrayBuffer)))return function(e,t,r){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),s.prototype),n}(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var c=e.valueOf&&e.valueOf();if(null!=c&&c!==e)return s.from(c,t,r);var p=function(e){if(s.isBuffer(e)){var t=0|f(e.length),r=i(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?i(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(p)return p;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');
vendor: 16,509 bytes, line 3
3if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return l(e),i(e<0?0:0|f(e))}function d(e){for(var t=e.length<0?0:0|f(e.length),r=i(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}t.Buffer=s,t.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,s.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!s.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(e,t,r){return(l(e),e<=0)?i(e):void 0!==t?"string"==typeof r?i(e).fill(t,r):i(e).fill(t):i(e)},s.allocUnsafe=function(e){return c(e)},s.allocUnsafeSlow=function(e){return c(e)};function f(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function h(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||P(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return k(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return C(e).length;default:if(a)return n?-1:k(e).length;t=(""+t).toLowerCase(),a=!0}}function p(e,t,r){var a,o,i,s=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var a="",o=t;o<r;++o)a+=A[e[o]];return a}(this,t,r);case"utf8":case"utf-8":return v(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;a<r;++a)n+=String.fromCharCode(127&e[a]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;a<r;++a)n+=String.fromCharCode(e[a]);return n}(this,t,r);case"base64":return a=this,o=t,i=r,0===o&&i===a.length?n.fromByteArray(a):n.fromByteArray(a.slice(o,i));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),a="",o=0;o<n.length;o+=2)a+=String.fromCharCode(n[o]+256*n[o+1]);return a}(this,t,r);default:if(s)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,a){var o;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(a)return -1;else r=e.length-1;else if(r<0)if(!a)return -1;else r=0;if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,a);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(a)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return y(e,[t],r,n,a)}throw TypeError("val must be string, number or Buffer")}function y(e,t,r,n,a){var o,i=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;i=2,s/=2,u/=2,r/=2}function l(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(a){var c=-1;for(o=r;o<s;o++)if(l(e,o)===l(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*i}else -1!==c&&(o-=o-c),c=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){for(var d=!0,f=0;f<u;f++)if(l(e,o+f)!==l(t,f)){d=!1;break}if(d)return o}return -1}s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(P(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),P(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,a=0,o=Math.min(r,n);a<o;++a)if(e[a]!==t[a]){r=e[a],n=t[a];break}return r<n?-1:+(n<r)},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,n=s.allocUnsafe(t),a=0;for(r=0;r<e.length;++r){var o=e[r];if(P(o,Uint8Array)&&(o=s.from(o)),!s.isBuffer(o))throw TypeError('"list" argument must be an Array of Buffers');o.copy(n,a),a+=o.length}return n},s.byteLength=h,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},s.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?v(this,0,e):p.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(s.prototype[o]=s.prototype.inspect),s.prototype.compare=function(e,t,r,n,a){if(P(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),t<0||r>e.length||n<0||a>this.length)throw RangeError("out of range index");if(n>=a&&t>=r)return 0;if(n>=a)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,a>>>=0,this===e)return 0;for(var o=a-n,i=r-t,u=Math.min(o,i),l=this.slice(n,a),c=e.slice(t,r),d=0;d<u;++d)if(l[d]!==c[d]){o=l[d],i=c[d];break}return o<i?-1:+(i<o)},s.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},s.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},s.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)};function v(e,t,r){r=Math.min(e.length,r);for(var n=[],a=t;a<r;){var o,i,s,u,l=e[a],c=null,d=l>239?4:l>223?3:l>191?2:1;if(a+d<=r)switch(d){case 1:l<128&&(c=l);break;case 2:(192&(o=e[a+1]))==128&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[a+1],i=e[a+2],(192&o)==128&&(192&i)==128&&(u=(15&l)<<12|(63&o)<<6|63&i)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[a+1],i=e[a+2],s=e[a+3],(192&o)==128&&(192&i)==128&&(192&s)==128&&(u=(15&l)<<18|(63&o)<<12|(63&i)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,d=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),a+=d}var f=n,h=f.length;if(h<=4096)return String.fromCharCode.apply(String,f);for(var p="",m=0;m<h;)p+=String.fromCharCode.apply(String,f.slice(m,m+=4096));return p}function w(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function b(e,t,r,n,a,o){if(!s.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<o)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function S(e,t,r,n,a,o){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function x(e,t,r,n,o){return t*=1,r>>>=0,o||S(e,t,r,4,34028234663852886e22,-34028234663852886e22),a.write(e,t,r,n,23,4),r+4}function M(e,t,r,n,o){return t*=1,r>>>=0,o||S(e,t,r,8,17976931348623157e292,-17976931348623157e292),a.write(e,t,r,n,52,8),r+8}s.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a,o,i,s,u,l,c,d,f=this.length-t;if((void 0===r||r>f)&&(r=f),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var h=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var a=e.length-r;n?(n=Number(n))>a&&(n=a):n=a;var o=t.length;n>o/2&&(n=o/2);for(var i=0;i<n;++i){var s,u=parseInt(t.substr(2*i,2),16);if((s=u)!=s)break;e[r+i]=u}return i}(this,e,t,r);case"utf8":case"utf-8":return a=t,o=r,T(k(e,this.length-a),this,a,o);case"ascii":return i=t,s=r,T(E(e),this,i,s);case"latin1":case"binary":return function(e,t,r,n){return T(E(t),e,r,n)}(this,e,t,r);case"base64":return u=t,l=r,T(C(e),this,u,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,d=r,T(function(e,t){for(var r,n,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,a.push(r%256),a.push(n);return a}(e,this.length-c),this,c,d);default:if(h)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),h=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,s.prototype),n},s.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e],a=1,o=0;++o<t&&(a*=256);)n+=this[e+o]*a;return n},s.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e+--t],a=1;t>0&&(a*=256);)n+=this[e+--t]*a;return n},s.prototype.readUInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e],a=1,o=0;++o<t&&(a*=256);)n+=this[e+o]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=t,a=1,o=this[e+--n];n>0&&(a*=256);)o+=this[e+--n]*a;return o>=(a*=128)&&(o-=Math.pow(2,8*t)),o},s.prototype.readInt8=function(e,t){return(e>>>=0,t||w(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||w(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt16BE=function(e,t){e>>>=0,t||w(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||w(e,4,this.length),a.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||w(e,4,this.length),a.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||w(e,8,this.length),a.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||w(e,8,this.length),a.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var a=Math.pow(2,8*r)-1;b(this,e,t,r,a,0)}var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},s.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var a=Math.pow(2,8*r)-1;b(this,e,t,r,a,0)}var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},s.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var a=Math.pow(2,8*r-1);b(this,e,t,r,a-1,-a)}var o=0,i=1,s=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/i|0)-s&255;return t+r},s.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var a=Math.pow(2,8*r-1);b(this,e,t,r,a-1,-a)}var o=r-1,i=1,s=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/i|0)-s&255;return t+r},s.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeFloatLE=function(e,t,r){return x(this,e,t,!0,r)},s.prototype.writeFloatBE=function(e,t,r){return x(this,e,t,!1,r)},s.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},s.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},s.prototype.copy=function(e,t,r,n){if(!s.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var a=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var o=a-1;o>=0;--o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return a},s.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var a,o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var i=s.isBuffer(e)?e:s.from(e,n),u=i.length;
3if(0===u)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<r-t;++a)this[a+t]=i[a%u]}return this};var _=/[^+/0-9A-Za-z-_]/g;function k(e,t){t=t||1/0;for(var r,n=e.length,a=null,o=[],i=0;i<n;++i){if((r=e.charCodeAt(i))>55295&&r<57344){if(!a){if(r>56319||i+1===n){(t-=3)>-1&&o.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),a=r;continue}r=(a-55296<<10|r-56320)+65536}else a&&(t-=3)>-1&&o.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function E(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function C(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(_,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function T(e,t,r,n){for(var a=0;a<n&&!(a+r>=t.length)&&!(a>=e.length);++a)t[a+r]=e[a];return a}function P(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var A=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,a=0;a<16;++a)t[n+a]=e[r]+e[a];return t}()},321:function(e,t){t.read=function(e,t,r,n,a){var o,i,s=8*a-n-1,u=(1<<s)-1,l=u>>1,c=-7,d=r?a-1:0,f=r?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=256*o+e[t+d],d+=f,c-=8);for(i=o&(1<<-c)-1,o>>=-c,c+=n;c>0;i=256*i+e[t+d],d+=f,c-=8);if(0===o)o=1-l;else{if(o===u)return i?NaN:1/0*(h?-1:1);i+=Math.pow(2,n),o-=l}return(h?-1:1)*i*Math.pow(2,o-n)},t.write=function(e,t,r,n,a,o){var i,s,u,l=8*o-a-1,c=(1<<l)-1,d=c>>1,f=5960464477539062e-23*(23===a),h=n?0:o-1,p=n?1:-1,m=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(s=+!!isNaN(t),i=c):(i=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-i))<1&&(i--,u*=2),i+d>=1?t+=f/u:t+=f*Math.pow(2,1-d),t*u>=2&&(i++,u/=2),i+d>=c?(s=0,i=c):i+d>=1?(s=(t*u-1)*Math.pow(2,a),i+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,a),i=0));a>=8;e[r+h]=255&s,h+=p,s/=256,a-=8);for(i=i<<a|s,l+=a;l>0;e[r+h]=255&i,h+=p,i/=256,l-=8);e[r+h-p]|=128*m}}},a={};function o(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}},i=!0;try{n[e](r,r.exports,o),i=!1}finally{i&&delete a[e]}return r.exports}o.ab="/ROOT/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]_@types+_21e96915e21e273dac0045357c6d97b7/node_modules/next/dist/compiled/buffer/",t.exports=o(230)},174334,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={bindSnapshot:function(){return l},createAsyncLocalStorage:function(){return u},createSnapshot:function(){return c}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let o=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class i{disable(){throw o}getStore(){}run(){throw o}exit(){throw o}enterWith(){throw o}static bind(e){return e}}let s="u">typeof globalThis&&globalThis.AsyncLocalStorage;function u(){return s?new s:new i}function l(e){return s?s.bind(e):i.bind(e)}function c(){return s?s.snapshot():function(e,...t){return e(...t)}}},473395,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,e.r(174334).createAsyncLocalStorage)()},615040,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorage",{enumerable:!0,get:function(){return n.workAsyncStorageInstance}});let n=e.r(473395)},40403,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return a}});let n=e.r(982693);function a({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new n.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,
3configurable:!0});return t}},74181,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return u}});let n=e.r(818297),a=e.r(177888),o=e.r(615040),i=e.r(116971),s=e.r(48484);function u({moduleIds:e}){if("u">typeof window)return null;let t=o.workAsyncStorage.getStore();if(void 0===t)return null;let r=[];if(t.reactLoadableManifest&&e){let n=t.reactLoadableManifest;for(let t of e){if(!n[t])continue;let e=n[t].files;r.push(...e)}}if(0===r.length)return null;let l=(0,s.getAssetTokenQuery)();return(0,n.jsx)(n.Fragment,{children:r.map(e=>{let r=`${t.assetPrefix}/_next/${(0,i.encodeURIPath)(e)}${l}`;return e.endsWith(".css")?(0,n.jsx)("link",{precedence:"dynamic",href:r,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,a.preload)(r,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},426128,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return l}});let n=e.r(818297),a=e.r(249892),o=e.r(40403),i=e.r(74181);function s(e){return{default:e&&"default"in e?e.default:e}}let u={loader:()=>Promise.resolve(s(()=>null)),loading:null,ssr:!0},l=function(e){let t={...u,...e},r=(0,a.lazy)(()=>t.loader().then(s)),l=t.loading;function c(e){let s=l?(0,n.jsx)(l,{isLoading:!0,pastDelay:!0,error:null}):null,u=!t.ssr||!!t.loading,c=u?a.Suspense:a.Fragment,d=t.ssr?(0,n.jsxs)(n.Fragment,{children:["u"<typeof window?(0,n.jsx)(i.PreloadChunks,{moduleIds:t.modules}):null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(o.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(c,{...u?{fallback:s}:{},children:d})}return c.displayName="LoadableComponent",c}},446600,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return a}});let n=e.r(836437)._(e.r(426128));function a(e,t){let r={};"function"==typeof e&&(r.loader=e);let a={...r,...t};return(0,n.default)({...a,modules:a.loadableGenerated?.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},953818,e=>{"use strict";let t=(0,e.i(249892).createContext)(null);e.s(["UnifiedPopupSurfaceContext",0,t])},671511,e=>{"use strict";var t=e.i(673157),r=e.i(877130);e.s(["Footer",0,e=>(0,t.jsx)("div",{...e,className:(0,r.twMerge)("flex h-4 items-center justify-between px-4",e.className)}),"MainContent",0,e=>(0,t.jsx)("div",{...e,className:(0,r.twMerge)("min-h-0 flex-1 px-4",e.className)}),"TitleLine",0,e=>(0,t.jsx)("h3",{...e,className:(0,r.twMerge)("px-4 font-serif text-2xl",e.className),children:e.children}),"Wrapper",0,e=>(0,t.jsx)("div",{...e,className:(0,r.twMerge)("flex min-h-0 flex-1 flex-col items-stretch gap-4",e.className)})])},584355,e=>{"use strict";var t=e.i(249892),r=e.i(719288);e.s(["useApplyPlaylistAsInspiration",0,function(){let e=(0,r.default)();return(0,t.useCallback)(t=>{e(t)},[e])}])},557573,e=>{"use strict";var t=e.i(740851);let r="/create";e.s(["useIsOnCreate",0,function(){let e=(0,t.usePathname)();return{isOnCreate:e===r,isOnCreatePath:e===r||(e?.startsWith(`${r}/`)??!1)}}])},714267,e=>{"use strict";e.s(["HookFormProvider",()=>A,"MAX_MEDIA_DESYNCED_MS",()=>C,"MAX_VIDEO_DURATION_SECONDS",()=>E,"MAX_VIDEO_UPLOAD_FILESIZE_MB",()=>_,"MIN_VIDEO_DURATION_SECONDS",()=>k,"default",()=>O]);var t=e.i(673157),r=e.i(810789),n=e.i(511927),a=e.i(374686);e.i(975824);var o=e.i(524986),i=e.i(740851),s=e.i(249892),u=e.i(248949);e.i(179395);var l=e.i(73605),c=e.i(274918),d=e.i(757855),f=e.i(334959),h=e.i(328062);e.i(948952);var p=e.i(350671),m=e.i(730502),g=e.i(964977),y=e.i(838038),v=e.i(974374),w=e.i(376151);e.i(696800);var b=e.i(3867),S=e.i(79076),x=e.i(277565),M=e.i(354804);let _=200,k=10,E=241,C=200;function T(e){let t=e.videoEnd-e.videoStart,r=.5*Math.max(0,e.audioViewportWidth-t);return{...e,duration:t,audioEnd:e.audioStart+t,audioViewportStart:e.audioStart-r,audioViewportEnd:e.audioStart+t+r,videoViewportStart:0,videoViewportEnd:e.videoDuration}}let P=(0,s.createContext)(void 0),A=(0,o.observer)(e=>{let o=(()=>{let e,o,C=(0,g.useAppI18n)(),{openModal:P,closeModal:A}
3=(0,y.useModalContext)(),[O,I]=(0,s.useState)("selectSongInFlow"),[B,D]=(0,s.useState)(null),[R,j]=(0,s.useState)(null),[F,L]=(0,s.useState)(0),[N,U]=(0,s.useState)([0,0]),[q,K]=(0,s.useState)(0),[H,W]=(0,s.useState)(null),[z,Q]=(0,s.useState)(""),[V,G]=(0,s.useState)(""),[Y,$]=(0,s.useState)(!0),[X,J]=(0,s.useState)(!0),Z=(0,i.useRouter)(),[ee,et]=(0,s.useState)(!1),{uploadId:er,uploadImageUrl:en,uploadProgress:ea,uploadStatus:eo,audioAlignmentTimestamp:ei,removeFiles:es,updateSelectedVideo:eu}=(0,w.useVideoUpload)({requireVideoSprite:!0,requireModeration:!1,videoUploadType:"video_hook",maxFileSizeMb:_,minDuration:k,maxDuration:E,onVideoSelected:j,uploadTimeout:6e5,clipId:B?.id}),el=(0,s.useMemo)(()=>R?URL.createObjectURL(R):"",[R]);(0,s.useEffect)(()=>{if(!el)return void L(0);let e=document.createElement("video");e.preload="metadata";let t=()=>{e.remove()};return e.onloadedmetadata=()=>{L(Math.round(1e3*e.duration)),U([e.videoWidth,e.videoHeight]),t()},e.onerror=()=>{console.error("Error loading video metadata"),L(0),U([0,0]),t()},e.src=el,t},[el]);let ec=(0,s.useCallback)(e=>{I(e)},[]),ed=B?.audioMetadata?.audio_snippet?.start_timestamp&&Math.round(B?.audioMetadata?.audio_snippet?.start_timestamp*1e3),ef=function(e){let{videoDuration:t,audioDuration:r,minDuration:n=Math.min(t,1e4),maxDuration:o=Math.min(r,t,241e3),defaultVideoStart:i=0,defaultVideoEnd:u=Math.min(r,t),defaultAudioStart:l=0,defaultPlayheadTime:c=l,audioViewportWidth:d=Math.min(2*o,r)}=e,[f,h]=(0,s.useState)(()=>T({videoStart:i,videoEnd:u,audioStart:l,current:c,audioViewportWidth:d,minDuration:n,maxDuration:o,videoDuration:t,audioDuration:r})),p=(0,s.useCallback)(e=>{h(t=>T({...t,..."function"==typeof e?e(t):e}))},[]);(0,s.useEffect)(()=>{h(e=>{let{videoStart:i,videoEnd:s,audioStart:u,current:l}=e,c=(0,a.clamp)(s-i,n,o);return i=Math.max(0,(s=(0,a.clamp)(s,c,Math.min(r,t)))-c),c=s-i,u=(0,a.clamp)(u,0,r-c),l=(0,a.clamp)(l,u,u+c),{...e,videoStart:i,videoEnd:s,audioStart:u,current:l,audioViewportWidth:d,minDuration:n,maxDuration:o,videoDuration:t,audioDuration:r}})},[d,n,o,t,r]);let m=(0,s.useCallback)((e,t)=>{p(r=>{let n={...r,videoStart:(0,a.clamp)(e,0,r.videoDuration),videoEnd:(0,a.clamp)(t,0,r.videoDuration)};t===r.videoEnd?n.videoStart=(0,a.clamp)(n.videoStart,r.videoEnd-r.maxDuration,r.videoEnd-r.minDuration):e===r.videoStart&&(n.videoEnd=(0,a.clamp)(n.videoEnd,r.videoStart+r.minDuration,r.videoStart+r.maxDuration));let o=n.videoEnd-n.videoStart;n.audioStart+o>r.audioDuration&&(n.audioStart=Math.max(0,r.audioDuration-o));let i=r.current-r.audioStart,s=n.audioStart+o;return n.current=Math.min(n.audioStart+i,s),n})},[p]),g=(0,s.useCallback)(e=>{p(t=>{let r={...t,audioStart:(0,a.clamp)(e,0,t.audioDuration-t.duration)};r.audioEnd=r.audioStart+t.duration;let n=t.current-t.audioStart;return r.current=(0,a.clamp)(r.audioStart+n,r.audioStart,r.audioEnd),r})},[p]),y=(0,s.useCallback)(e=>{p(t=>({...t,current:(0,a.clamp)(e,t.audioStart,t.audioEnd)}))},[p]);return{...f,onVideoRangeSet:m,onAudioRangeSet:g,onCurrentTimeSet:y}}({defaultAudioStart:ed,audioDuration:Math.round((B?.metadata?.duration??0)*1e3),videoDuration:F}),{onCurrentTimeSet:eh,onVideoRangeSet:ep,onAudioRangeSet:em}=ef;(0,s.useEffect)(()=>{F&&(ep(0,F),em(ed??0))},[F,ed,ep,em]),(0,s.useEffect)(()=>{B&&null!=ed&&eh(ed)},[B,ed,eh]);let eg=(0,s.useCallback)(()=>{D(null),j(null),L(0),U([0,0]),et(!1),Q(""),G(""),$(!0),J(!0),I("selectSongInFlow"),es()},[es]),ey=(0,s.useCallback)(()=>{A(f.ModalTypes.SELECT_HOOK_SONG)},[A]),ev=(0,s.useCallback)(()=>{P(f.ModalTypes.SELECT_HOOK_SONG)},[P]);(0,s.useEffect)(()=>{"error"===eo&&(j(null),ev(),ec("uploadVideoInFlow"))},[eo,ev,ec]);let ew=(e=(0,g.useAppI18n)(),o=(0,S.useApiClient)(),(0,n.useMutation)({mutationFn:async({videoUploadID:e,videoFile:t,clipId:n,title:a,caption:i,allowComments:s,showLyrics:u,clipStartTimeMs:l,clipEndTimeMs:c,clipDurationMs:d,videoStartTimeMs:f,videoEndTimeMs:h,clipVolume:p=100,videoVolume:m=0,customThumbnailS3Id:g})=>{let y=c-l,v=p||!m?100:0;if(!t||!e)throw Error("Please select a video file or wait for it to upload.");if(!n)throw Error("Please select a song.");if(v){if(l>=c)throw Error(`Audio start time (${l}) must be less than audio end time (${c}).`);
3if(l<0||c>d)throw Error(`Audio start time (${l}) and end time (${c}) must be within the song duration (0 - ${d}).`);if(y>241e3)throw Error(`Audio duration (${c-l}) must be less than 30 seconds.`);if(Math.abs(h-f-y)>100)throw Error(`Audio duration (${c-l}) must be equal to video duration (${h-f}).`)}let w={clip_id:n,hook_publish:{title:a,caption:i,allow_comments:s,show_lyrics:u,custom_thumbnail_s3_id:g},video_render:{song:{song_id:n,clip_start_time:l/1e3,clip_end_time:c/1e3,volume:v},videos:[{upload_id:e,source_start_time:f/1e3,source_end_time:h/1e3,volume:100-v}]}},{data:b,response:S}=await o.POST("/api/video/hooks/create",{body:w});if(423===S.status)throw Error("Your account requires support assistance");if(!b||!b.id)throw(0,r.captureException)({message:"Hooks creation failed",payload:w,response:b}),Error("Failed to create hook: Invalid response data from server.");return b},onSuccess:e=>{console.log("Hook creation successful:",e)},onError:t=>{(0,u.resolveTextOnDemand)({instance:e,namespace:"hooks",resolve:e=>t instanceof Error?e("hooks.creationError",{message:t.message}):e("hooks.creationUnexpectedError")}).then(e=>{p.toastManager.add({title:e,type:"error"})}),console.error("Exception during hook creation:",t)}})),eb=(0,s.useRef)(""),eS=(0,s.useRef)(""),ex=(0,s.useCallback)(()=>(0,t.jsx)(l.Button,{shape:c.ButtonShape.Pill,size:c.ButtonSize.Small,onClick:()=>{},children:eb.current}),[]),eM=(0,s.useCallback)(({hookId:e,label:r})=>{let n=()=>(0,t.jsx)(l.Button,{variant:c.ButtonVariant.Aura,size:c.ButtonSize.Small,shape:c.ButtonShape.Pill,onClick:()=>{if(!e)return void console.error("Could not find hook ID");let t=(0,M.generateLinkUrl)(e,"hook");navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(t).then(()=>{(0,u.resolveTextOnDemand)({instance:C,namespace:"hooks",resolve:e=>e("hookEditor.hookLinkCopied")}).then(t=>{eC.current===e&&p.toastManager.add({title:t,type:"info",timeout:2e3,position:"top"})})}).catch(e=>{console.error("Failed to copy: ",e)}):(0,u.resolveTextOnDemand)({instance:C,namespace:"common",resolve:e=>e("runtimeFeedback.clipboardUnsupported")}).then(e=>alert(e))},children:r});return n.displayName="ShareButtonComponent",n},[C]),[e_,ek]=(0,s.useState)(void 0),eE=(0,s.useRef)(void 0),eC=(0,s.useRef)(void 0),eT=(0,s.useCallback)(()=>(0,t.jsxs)("div",{className:"relative px-3",children:[(0,t.jsx)(d.default,{src:en,className:"relative h-16 w-12 rounded-lg object-cover opacity-50",alt:eS.current}),(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:eE.current?(0,t.jsx)(h.default,{className:"h-6 w-6 text-accent-brand"}):(0,t.jsx)(b.CheckIcon,{className:"h-6 w-6"})})]}),[en]),{data:eP}=(0,v.useHookById)({hookId:e_,shouldPoll:!!e_}),eA=(0,s.useCallback)(async()=>{let[e,t,r]=await Promise.all([(0,u.resolveTextOnDemand)({instance:C,namespace:"hooks",resolve:e=>e("hookEditor.hookImageAlt")}),(0,u.resolveTextOnDemand)({instance:C,namespace:"hooks",resolve:e=>e("hookEditor.uploadingHook")}),(0,u.resolveTextOnDemand)({instance:C,namespace:"common",resolve:e=>e("cta.cancel")})]);eb.current=r,eS.current=e,Z.push("/hooks"),eE.current=p.toastManager.add({title:t,position:"top",timeout:0,data:{isClosable:!1,actionComponent:ex,imageComponent:eT}}).id,eg()},[ex,eT,C,Z,eg]);(0,s.useEffect)(()=>{e_&&eP&&[v.HOOK_STATUS.rendered_failed_moderation,v.HOOK_STATUS.rendered_passed_moderation,v.HOOK_STATUS.error].includes(eP.status)&&(eE.current&&p.toastManager.close(eE.current),eP.status===v.HOOK_STATUS.rendered_failed_moderation?(0,m.reportHookUploadFailure)({data:{imageComponent:eT},failure:"moderation-failed",contentRatingTags:eP.content_rating_tags,instance:C,isCurrent:()=>eC.current===e_}):Promise.all([(0,u.resolveTextOnDemand)({instance:C,namespace:"hooks",resolve:e=>e(eP.status===v.HOOK_STATUS.rendered_passed_moderation?"hookEditor.postedToFeed":"hookEditor.processingFailed")}),(0,u.resolveTextOnDemand)({instance:C,namespace:"common",resolve:e=>e("actions.share")})]).then(([e,t])=>{eC.current===e_&&p.toastManager.add({title:e,type:eP.status===v.HOOK_STATUS.rendered_passed_moderation?"info":"error",position:"top",timeout:3e3,data:{actionComponent:eP.status===v.HOOK_STATUS.rendered_passed_moderation?eM({hookId:e_,label:t}):void 0,imageComponent:eT}})}),Z.push(`/hook/${e_}`),eE.current=void 0,ek(void 0))},[eT,eM,e_,eP,C,Z]);let eO=(0,s.useCallback)(()=>{let e=R?B?null:"song":"video";e?(0,u.resolveTextOnDemand)({instance:C,namespace:"hooks",resolve:t=>t("video"===e?"hookEditor.selectVideoRequired":"hookEditor.selectSongRequired")}).then(e=>{p.toastManager.add({title:e,type:"error"})}):((0,x.default)({actionName:"HookPostSubmitted",context:{uploadId:er||void 0,clipId:B?.id||void 0}}),ew.mutate({videoUploadID:er,videoFile:R,clipId:B?.id||"",title:z||"",caption:V,allowComments:Y,showLyrics:X,clipStartTimeMs:ef.audioStart,clipEndTimeMs:ef.audioEnd,clipDurationMs:ef.audioDuration,videoStartTimeMs:ef.videoStart,videoEndTimeMs:ef.videoEnd,clipVolume:100*!ee,videoVolume:100*!!ee,customThumbnailS3Id:H},{onSuccess:e=>{(0,x.default)({actionName:"HookPostSucceeded",context:{uploadId:er||void 0,clipId:B?.id||void 0,hookId:e?.id||void 0}}),eC.current=e?.id||void 0;let t=eC.current;eA().then(()=>{eC.current===t&&ek(t)})},onError:e=>{(0,x.default)({actionName:"HookPostFailed",context:{uploadId:er||void 0,clipId:B?.id||void 0}})}}))},[Y,z,er,V,X,ew,H,C,eA,B,R,ef,ee]);return(0,s.useMemo)(()=>({currentScreen:O,setCurrentScreen:I,navigateTo:ec,selectedSong:
3B,setSelectedSong:D,selectedVideo:R,updateSelectedVideo:eu,uploadStatus:eo,videoUrl:el,uploadId:er,videoSound:ee,setVideoSound:et,title:z,setTitle:Q,caption:V,setCaption:G,allowComments:Y,setAllowComments:$,showLyrics:X,setShowLyrics:J,closeModal:ey,openModal:ev,handlePostHook:eO,isCreatingHook:ew.isPending,videoDimensions:N,videoDuration:F,thumbnailTimestamp:q,setThumbnailTimestamp:K,customThumbnailS3Id:H,setCustomThumbnailS3Id:W,mediaEditState:ef,createdHookId:e_,hookStatus:eP,resetFormState:eg,uploadProgress:ea,audioAlignmentTimestamp:ei}),[O,ec,B,D,R,eu,eo,el,er,ee,et,z,Q,V,G,Y,$,X,J,ey,ev,eO,ew.isPending,N,F,q,K,H,W,ef,e_,eP,eg,ea,ei])})();return(0,t.jsx)(P.Provider,{value:o,children:e.children})}),O=P},361791,e=>{"use strict";var t=e.i(673157),r=e.i(853629),n=e.i(249892),a=e.i(248949),o=e.i(334959);e.i(948952);var i=e.i(350671),s=e.i(964977),u=e.i(838038),l=e.i(213267);e.i(462951);var c=e.i(646984);e.i(179395);var d=e.i(73605),f=e.i(274918);e.i(696800);var h=e.i(162705);let p=()=>(0,t.jsx)("div",{className:"mr-3 flex shrink-0 items-center",children:(0,t.jsx)(h.SparklesIcon,{className:"h-[1.875rem] w-[1.875rem] animate-pulse2 text-white"})}),m=({thumbnailUrl:e,alt:r})=>(0,t.jsx)("div",{className:"mr-3 flex shrink-0 items-center",children:(0,t.jsx)("img",{src:e,alt:r,className:"h-10 w-10 rounded-lg object-cover"})}
3),g=({clipId:e,label:r,onClick:n})=>(0,t.jsx)(d.Button,{variant:f.ButtonVariant.Aura,size:f.ButtonSize.Small,shape:f.ButtonShape.Pill,onClick:()=>n(e),children:r}),y=({onClick:e})=>{let{t:r}=(0,c.useTranslation)("common");return(0,t.jsx)(d.Button,{variant:f.ButtonVariant.FrostedGlassBorderless,size:f.ButtonSize.Small,shape:f.ButtonShape.Pill,onClick:e,children:r("cta.dismiss")})};var v=e.i(531960),w=e.i(458376),b=e.i(79076),S=e.i(720869),x=e.i(22920);let M=(0,n.createContext)(null);e.s(["GenerationNotificationProvider",0,({children:e})=>{let c=(0,r.useQueryClient)(),d=(0,s.useAppI18n)(),{isModalOpen:f,openModalWithData:h}=(0,u.useModalContext)(),[_,k]=(0,n.useState)(!0),[E,C]=(0,n.useState)(0),T=(0,n.useRef)(new Set),P=(0,n.useRef)(new Map),A=(0,n.useRef)(void 0),O=(0,n.useRef)(0),I=(0,n.useRef)(void 0),B=(0,n.useRef)(void 0),D=(0,n.useCallback)(()=>{let e=++O.current;return I.current=void 0,B.current=void 0,e},[]),R=f(o.ModalTypes.UPDATE_CLIP_METADATA),j=f(o.ModalTypes.SONG_COVER_ART),F=R||j,{isSignedIn:L}=(0,l.useAuth)(),N=!F&&!!L,{finishedClipBatches:U,pendingBatchIds:q}=function(e=!0){let t=(0,b.useApiClient)(),a=(0,r.useQueryClient)(),o=(0,v.useQuery)({queryKey:x.generationQueryKeys.pendingBatchIds(),queryFn:async()=>{let{data:e,error:r}=await t.POST("/api/video_gen/pending_batches",{body:{}});if(r||!e)throw Error("Failed to get pending batch IDs");return e.batch_ids},enabled:e}),i=o?.data?.filter(e=>"video"===e.type)??[],s=(0,v.useQuery)({queryKey:x.generationQueryKeys.pollMultipleClips(i),queryFn:async()=>{if(!i.length)return{};let{data:e,error:r}=await t.POST("/api/video_gen/poll_batches",{body:{batch_ids:i}});if(r||!e)throw Error("Failed to poll batches");let n={};for(let[t,r]of Object.entries(e.batches)){if(0===r.length)continue;let e=r[0].clip_id;e&&(e in n||(n[e]={}),n[e][t]=(0,w.deepCamelKeys)(r))}return n},enabled:e&&i.length>0,refetchInterval:7e3,staleTime:0}),{finishedClipBatches:u={},someCompletedClipBatches:l={}}=(0,n.useMemo)(()=>{if(!s.data)return{};let e={},t={};for(let[r,n]of Object.entries(s.data)){let{someCompletedBatches:a,completedBatches:o}=(0,S.filterBatchesByCompletionStatus)(n);Object.keys(o).length>0&&(e[r]=o),Object.keys(a).length>0&&(t[r]=a)}return{finishedClipBatches:e,someCompletedClipBatches:t}},[s.data]);return(0,n.useEffect)(()=>{for(let[e]of Object.entries(u))(0,x.removeCompletedGenerations)(a,u[e]??{});for(let[e]of Object.entries(l))(0,x.updateGenerationHistoryCache)(a,e,l[e]??{})},[l,u,a]),{finishedClipBatches:u,pendingBatchIds:i,pollBatchesQuery:s,pendingBatchIdsQuery:o}}(N),K=(0,n.useCallback)(()=>{if(A.current){let e=A.current;A.current=void 0;try{i.toastManager.close(e)}catch(t){throw A.current=e,t}}},[A]),H=(0,n.useCallback)(()=>{A.current=void 0},[]),W=(0,n.useCallback)(()=>{k(!1),D(),K()},[K,D]),z=(0,n.useCallback)(e=>{h(o.ModalTypes.SONG_COVER_ART,{clipId:e})},[h]);(0,n.useEffect)(()=>{if(!N)return;let e=Object.keys(U).length>0,r=null,n=null;for(let[e,t]of Object.entries(U))for(let[a,o]of Object.entries(t)){let t=`${e}:${a}`,i={batchId:a,clipId:e,thumbnailUrl:o[0]?.thumbnailUrl};P.current.set(t,i),!T.current.has(t)&&B.current?.key!==t&&(r||(r=i),!n&&o.length>0&&o.every(e=>"complete"===e.status)&&(n=i))}let o=[...P.current.entries()].find(([e])=>!T.current.has(e)&&B.current?.key!==e)?.[1],s=B.current?null:n||r||o;if(e||s){if(s){let{batchId:e,clipId:r,thumbnailUrl:n}=s,o=`${r}:${e}`,u=D();B.current={key:o,requestId:u},(0,a.resolveTranslationsOnDemand)({instance:d,namespace:"musicVideo",resolve:e=>({title:e("videoGeneration.videoCoversComplete"),viewLabel:e("videoGeneration.view"),thumbnailAlt:e("videoGeneration.generatedCoverAlt")}),fallback:e=>({title:e("runtimeFeedback.errorTitle"),viewLabel:null,thumbnailAlt:null})}).then(({title:e,viewLabel:a,thumbnailAlt:s})=>{if(O.current!==u||B.current?.requestId!==u)return;K();let l=i.toastManager.add({title:e,description:void 0,type:"info",timeout:0,position:"top",onRemove:H,data:{className:"w-[41rem]",closeButtonClassName:"absolute top-1/2 -translate-y-1/2 right-4",actionComponent:a?()=>(0,t.jsx)(g,{clipId:r,label:a,onClick:z}):void 0,imageComponent:n&&s?()=>(0,t.jsx)(m,{thumbnailUrl:n,alt:s}):void 0}});if(T.current.add(o),P.current.delete(o),B.current=void 0,A.current=l.id,C(e
3=>e+1),T.current.size>10){let e=Array.from(T.current);T.current=new Set(e.slice(-10))}})}}else if(!(q.length>0)||A.current||I.current||B.current||!_)0===q.length&&void 0!==I.current&&D();else{let e=D();I.current=e,(0,a.resolveTranslationsOnDemand)({instance:d,namespace:"musicVideo",resolve:e=>({title:e("videoGeneration.generatingVideoCovers"),description:e("videoGeneration.notifyWhenDone")}),fallback:e=>({title:e("runtimeFeedback.errorTitle"),description:e("fallbacks.contentUnavailable")})}).then(({title:r,description:n})=>{O.current===e&&I.current===e&&(I.current=void 0,A.current=i.toastManager.add({title:r,description:n,type:"info",timeout:0,position:"top",data:{isClosable:!1,className:"w-[41rem]",imageComponent:p,actionComponent:()=>(0,t.jsx)(y,{onClick:W})}}).id)})}},[U,q,N,c,d,z,K,H,W,D,_,E]),(0,n.useEffect)(()=>{F&&(D(),K())},[F,K,D]);let Q=(0,n.useCallback)(()=>{k(!0)},[]),V=(0,n.useCallback)(()=>{k(!1),D()},[D]),G=(0,n.useMemo)(()=>({enablePendingToasts:Q,disablePendingToasts:V}),[Q,V]);return(0,t.jsx)(M.Provider,{value:G,children:e})},"useGenerationNotifications",0,function(){let e=(0,n.useContext)(M);if(!e)throw Error("useGenerationNotifications must be used within GenerationNotificationProvider");return e}],361791)},999032,e=>{"use strict";var t=e.i(673157);e.s(["default",0,e=>(0,t.jsx)("svg",{width:"100%",height:"100%",viewBox:"0 0 380 380",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,t.jsx)("path",{d:"M370 190C370 213.145 342.654 230.677 334.305 250.784C325.956 270.891 332.258 303.253 316.539 319.039C300.82 334.825 269.205 328.253 248.361 336.894C227.517 345.535 210.711 372.5 187.5 372.5C164.289 372.5 146.744 345.227 126.639 336.894C106.534 328.561 74.1486 334.825 58.4609 319.039C42.7732 303.253 49.0439 270.891 40.6945 250.784C32.3452 230.677 5 213.145 5 190C5 166.855 32.3452 149.323 40.6945 129.216C49.0439 109.109 42.7732 76.7467 58.4609 60.9609C74.1486 45.1751 106.764 51.7467 126.639 43.1056C145.744 34.7731 164.289 7.5 187.5 7.5C210.711 7.5 227.517 34.4645 248.361 43.1056C269.205 51.7467 300.82 45.1751 316.539 60.9609C332.258 76.7467 325.956 109.109 334.305 129.216C342.654 149.323 370 166.855 370 190Z",stroke:"currentColor",strokeWidth:"2",fill:"none"})})])},32806,e=>{"use strict";var t=e.i(810789);let r=[/ChunkLoadError/i,/Loading chunk [\w-]+ failed/i,/Loading CSS chunk/i,/Failed to fetch dynamically imported module/i,/error loading dynamically imported module/i,/Importing a module script failed/i,/is not a valid JavaScript MIME type/i,/module factory is not available/i],n=[/is not a function/i,/is not a constructor/i,/undefined is not an object/i,/Cannot read properties of undefined \(reading /i,/Cannot read properties of null \(reading /i,/Invalid or unexpected token/i,/Unexpected token '<'/i,/expected expression, got '<'/i,/missing \) after argument list/i,/Unexpected token '\{'/i,/requires mobx at least version/i],a=[/requireAsyncModule/,/getOrInstantiateModuleFromParent/,/instantiateModule/,/moduleFactory/,/esmImport/,/__turbopack_require__/,/__turbopack_load__/,/\/chunks\/turbopack-/,/\[turbopack\]/];e.s(["reportClientBoundaryError",0,function({error:e,source:o,nonRecoverableLevel:i,extra:s}){let u=function(e,t){if(!function(e){let t,o=e instanceof Error?`${e.name}: ${e.message}`:String(e??"");return!!r.some(e=>e.test(o))||n.some(e=>e.test(o))&&"string"==typeof(t=e instanceof Error?e.stack:void 0)&&a.some(e=>e.test(t))}(e))return!1;let o=function(){try{let e=window.sessionStorage,t="suno.storageProbe";return e.setItem(t,"1"),e.removeItem(t),e}catch{return null}}();if(!o)return!1;let i=`suno.staleDeployReloaded:${t??"unknown"}`;return!o.getItem(i)&&(o.setItem(i,"1"),!0)}(e,function(){try{return"4190e44"}catch{return}}());t.captureException(e,{tags:{source:o,stale_deploy_recovery:u?"reloading":"none"},level:u?"warning":i,extra:s}),u&&t.flush(2e3).finally(()=>{window.location.reload()})}],32806)},406303,e=>{"use strict";var t=e.i(673157),r=e.i(249892),n=e.i(885696);e.s(["default",0,function({encryptedSrc:e,contentId:a,contentType:o,mediaContentType:i,duration:s,forceProgressiveDownload:u,swDrmMode:l,muffleAfterSeconds:c,downloadMode:d,onDrmProgress:f,onDrmError:h,onDrmStatusChange:p,useFallbackOnError:m,enabled:g,src:y,ref:v,...w}){let{audioRef:b,status:S,resolvedSrc:x}=(0,n.useDrmAudio)({encryptedSrc:e,fallbackSrc:y??null,contentId:a,contentType:o,mediaContentType:i,duration:s,forceProgressiveDownload:u,swDrmMode:l,muffleAfterSeconds:c,downloadMode:d,onProgress:f,onError:h,useFallbackOnError:m,enabled:g});(0,r.useEffect)(()=>{p?.({status:S,resolvedSrc:x})},[S,x,p]);let M=(0,r.useCallback)(e=>{b.current=e,"function"==typeof v?v(e):v&&(v.current=e)},[b,v]);return(0,t.jsx)("audio",{ref:M,crossOrigin:w.crossOrigin??"anonymous",...w})}])},463558,e=>{"use strict";var t=e.i(673157),r=e.i(249892);e.i(462951);var n=e.i(646984);e.i(179395);var a=e.i(73605),o=e.i(274918),i=e.i(157348);e.s(["CompactInstrumentsNamespaceFallback",0,function({appearance:e="themed",isRetrying:r,retry:i}){let{t:s}=(0,n.useTranslation)("common"),u="dark"===e;return(0,t.jsxs)("div",{role:"alert",className:"shrink-0",children:[(0,t.jsx)("span",{className:"sr-only",children:s("fallbacks.contentUnavailable")}),(0,t.jsx)(a.Button,{size:o.ButtonSize.Small,variant:u?o.ButtonVariant.Inherit:o.ButtonVariant.Standard,className:u?"bg-white/10 text-white/60 hover:bg-white/15 disabled:opacity-40":void 0,disabled:r,onClick:i,children:s(r?"actions.retrying":"actions.retry")})]})},"InstrumentsNamespaceBoundary",0,function({children:e,pendingFallback:n=null,renderFallback:a}
3){return(0,t.jsx)(i.NamespaceLoadErrorBoundary,{renderFallback:a,children:(0,t.jsx)(r.Suspense,{fallback:n,children:e})})}])},316805,e=>{"use strict";function t(e,t,r,n){for(let a of t)!function(e,t,r,n){if(0===t.points.length)return;let a=Math.max(2,t.size*Math.min(r,n));if(1===t.points.length){let o=t.points[0];e.beginPath(),e.fillStyle=t.color,e.arc(o.x*r,o.y*n,a/2,0,2*Math.PI),e.fill();return}e.beginPath(),e.strokeStyle=t.color,e.lineWidth=a,e.lineJoin="round",e.lineCap="round",t.points.forEach((t,a)=>{let o=t.x*r,i=t.y*n;0===a?e.moveTo(o,i):e.lineTo(o,i)}),e.stroke()}(e,a,r,n)}e.s(["MAX_PEN_SIZE",0,.03,"MIN_PEN_SIZE",0,.002,"PEN_SIZE",0,.005,"countStrokeVoices",0,function(e){let t=e.points;if(t.length<=2)return 1;let r=1,n=0;for(let e=1;e<t.length;e++){let a=t[e].x-t[e-1].x;if(0===a)continue;let o=a>0?1:-1;0===n?n=o:o!==n&&(r++,n=o)}return r},"drawSketch",0,t,"offsetStrokes",0,function(e,t,r){let n=1,a=0,o=1,i=0;for(let t of e)for(let e of t.points)n=Math.min(n,e.x),a=Math.max(a,e.x),o=Math.min(o,e.y),i=Math.max(i,e.y);let s=Math.max(-n,Math.min(1-a,t)),u=Math.max(-o,Math.min(1-i,r));return e.map(e=>({...e,timbre:{...e.timbre},points:e.points.map(e=>({x:e.x+s,y:e.y+u}))}))},"remapSelectionAfterRemoval",0,function(e,t){if(0===e.length||0===t.length)return e;let r=new Set(t),n=[...r].sort((e,t)=>e-t),a=[];for(let t of e){if(r.has(t))continue;let e=0;for(let r of n){if(r>=t)break;e++}a.push(t-e)}return a},"renderSketchPngDataUrl",0,function(e,r){let n=Number.isFinite(r)&&r>0?r:16/9,a=n>=1?1024:Math.round(1024*n),o=n>=1?Math.round(1024/n):1024,i=document.createElement("canvas");i.width=a,i.height=o;let s=i.getContext("2d");if(!s)throw Error("Could not create export canvas context");return s.fillStyle="#0d0d10",s.fillRect(0,0,a,o),t(s,e,a,o),i.toDataURL("image/png")},"strokeGesture",0,function(e){let t=e.points;if(t.length<2)return"dot";let r=t[0].x,n=t[0].x,a=t[0].y,o=t[0].y;for(let e=1;e<t.length;e++){let i=t[e];r=Math.min(r,i.x),n=Math.max(n,i.x),a=Math.min(a,i.y),o=Math.max(o,i.y)}return .012>Math.hypot(n-r,o-a)?"dot":"line"},"usedSketchColors",0,function(e){let t=new Set,r=[];for(let n of e)t.has(n.color)||(t.add(n.color),r.push({hex:n.color,timbre:n.timbre}));return r}])},544324,e=>{"use strict";let t=e=>Math.min(1,Math.max(0,e)),r=e=>1-t(e.x),n=e=>t(e.y);e.s(["brightnessOf",0,n,"strokeRegister",0,function(e){let t=e.points.reduce((e,t)=>e+(1-t.y),0)/e.points.length;return t<.33?"low":t>.67?"high":"mid"},"timbreAdjectives",0,function(e){var t,a;return[...(t=r(e))>.72?["warm","rounded"]:t>.5?["mellow","smooth"]:t>.28?["cool","clean"]:["glassy","crystalline"],...(a=n(e))>.72?["bright","shimmering"]:a>.5?["open","airy"]:a>.28?["soft","dusky"]:["dark","covered"]]},"timbreHex",0,function(e){return function(e,t){let r=(1-Math.abs(2*t-1))*.72,n=(e%360+360)%360/60%6,a=r*(1-Math.abs(n%2-1)),[o,i,s]=n<1?[r,a,0]:n<2?[a,r,0]:n<3?[0,r,a]:n<4?[0,a,r]:n<5?[a,0,r]:[r,0,a],u=t-r/2,l=e=>Math.round((e+u)*255).toString(16).padStart(2,"0");return`#${l(o)}${l(i)}${l(s)}`}(0+240*t(e.x),.2+.6000000000000001*t(e.y))},"timbreSynthParams",0,function(e){return{sawMix:r(e),cutoffHz:400*2**(4.3*n(e))}}])},71684,894487,e=>{"use strict";e.s(["BAR_OPTIONS",0,[2,4,8],"BEATS_PER_BAR",0,4,"DEFAULT_BARS",0,4,"DEFAULT_TEMPO_BPM",0,90,"MAX_TEMPO_BPM",0,180,"MIN_TEMPO_BPM",0,50,"loopDurationMs",0,(e,t)=>4*t*6e4/e],894487);let t={C:0,"C#/Db":1,D:2,"D#/Eb":3,E:4,F:5,"F#/Gb":6,G:7,"G#/Ab":8,A:9,"A#/Bb":10,B:11}
3,r=[0,2,4,5,7,9,11],n=[0,2,3,5,7,8,10],a=2*Math.PI,o=(e,t,r)=>{for(let n=0;n<r.length;n++)e.setUint8(t+n,r.charCodeAt(n))};e.s(["CLIP_SAMPLE_RATE",0,44100,"KEY_TONICS",0,["C","C#/Db","D","D#/Eb","E","F","F#/Gb","G","G#/Ab","A","A#/Bb","B"],"addMetronome",0,(e,t,r,n)=>{let o=Math.floor(.03*t);for(let i=0;i<n;i++){let n=Math.floor(i*r*t),s=i%4==0?1600:1e3,u=i%4==0?.28:.16;for(let r=0;r<o&&n+r<e.length;r++){let i=1-r/o;e[n+r]+=Math.sin(a*s*r/t)*u*i*i}}},"buildScaleMidiSet",0,(e,a,o)=>{let i=t[e.tonic]??0,s="minor"===e.mode?n:r,u=[];for(let e=a-12;e<=a+o+12;e++)s.includes((e-i+120)%12)&&u.push(e);return u},"encodeWav",0,(e,t)=>{let r=new ArrayBuffer(44+2*e.length),n=new DataView(r);o(n,0,"RIFF"),n.setUint32(4,36+2*e.length,!0),o(n,8,"WAVE"),o(n,12,"fmt "),n.setUint32(16,16,!0),n.setUint16(20,1,!0),n.setUint16(22,1,!0),n.setUint32(24,t,!0),n.setUint32(28,2*t,!0),n.setUint16(32,2,!0),n.setUint16(34,16,!0),o(n,36,"data"),n.setUint32(40,2*e.length,!0);let a=44;for(let t=0;t<e.length;t++){let r=Math.max(-1,Math.min(1,e[t]));n.setInt16(a,32767*r,!0),a+=2}return new Blob([r],{type:"audio/wav"})},"frequencyFromMidi",0,e=>440*2**((e-69)/12),"keyLabel",0,e=>`${e.tonic} ${e.mode}`,"registerLowMidi",0,(e,r)=>(t[e.tonic]??0)+12*(r+1),"snapToScale",0,(e,t)=>{let r=t[0],n=1/0;for(let a of t){let t=Math.abs(a-e);t<n&&(n=t,r=a)}return r}],71684)},603517,780255,529715,671777,789684,453216,262545,e=>{"use strict";var t=e.i(316805),r=e.i(544324),n=e.i(71684),a=e.i(894487);let o=2*Math.PI;function i(e){let{strokes:i,bpm:s,bars:u,key:l,sampleRate:c,withMetronome:d}
3=e,f=u*a.BEATS_PER_BAR,h=60/s,p=Math.max(1,Math.floor(f*h*c)),m=new Float32Array(p),g=.1/f;for(let e of i)0!==e.points.length&&function(e,a,i,s,u){var l;let c=(0,n.registerLowMidi)(i,2),d=(0,n.buildScaleMidiSet)(i,c,48),{sawMix:f,cutoffHz:h}=(0,r.timbreSynthParams)(a.timbre),p={sawMix:f,cutoffHz:h,makeupGain:1+(1-(0,r.brightnessOf)(a.timbre))*.5};for(let r of"dot"===(0,t.strokeGesture)(a)?[function(e,t,r){let n=e.points.reduce((e,t)=>e+(1-t.y),0)/e.points.length,a=Math.min(...e.points.map(e=>e.x)),o=Array(t).fill(n),i=Array(t).fill(!1);for(let e=0;e<t;e++){let n=t<=1?0:e/(t-1);i[e]=n>=a&&n<=a+r}return{pitch:o,gate:i}}(a,e.length,u)]:(l=e.length,(function(e){if(e.length<=2)return[e];let t=[],r=0,n=0;for(let a=1;a<e.length;a++){let o=e[a].x-e[a-1].x;if(0===o)continue;let i=o>0?1:-1;0===n?n=i:i!==n&&(t.push(e.slice(r,a)),r=a-1,n=i)}return t.push(e.slice(r)),t})(a.points.map(e=>({x:e.x,y:1-e.y}))).map(e=>((e,t)=>{let r=Array(t).fill(.5),n=Array(t).fill(!1);if(0===e.length)return{pitch:r,gate:n};let a=[...e].sort((e,t)=>e.x-t.x),o=a[0].x,i=a[a.length-1].x,s=e=>t<=1?0:e/(t-1);if(i-o<1e-4){let e=a.reduce((e,t)=>e+t.y,0)/a.length;for(let a=0;a<t;a++)r[a]=e,n[a]=s(a)>=o;return{pitch:r,gate:n}}let u=0;for(let e=0;e<t;e++){let t=s(e);if(t<o){r[e]=a[0].y;continue}if(t>i){r[e]=a[a.length-1].y;continue}for(;u<a.length-2&&a[u+1].x<t;)u++;let l=a[u],c=a[u+1]??l,d=c.x-l.x,f=d<1e-6?0:(t-l.x)/d;r[e]=l.y+(c.y-l.y)*f,n[e]=!0}return{pitch:r,gate:n}})(e,l))))!function(e,t,r,a,i,s){let{pitch:u,gate:l}=t,{sawMix:c,cutoffHz:d,makeupGain:f}=r,h=1-Math.exp(-o*d/s),p=1/Math.max(1,.012*s),m=1/Math.max(1,.05*s),g=0,y=0,v=0;for(let t=0;t<e.length;t++){let r=+!!l[t];if((y+=Math.max(-m,Math.min(p,r-y)))<=1e-4&&!l[t])continue;let d=(0,n.snapToScale)(a+48*u[t],i);g+=(0,n.frequencyFromMidi)(d)/s;let w=Math.sin(o*(g-=Math.floor(g)))*(1-c)+(2*g-1)*.65*c;v+=h*(w-v),e[t]+=v*y*.42*f}}(e,r,p,c,d,s)}(m,e,l,c,g);let y=Math.floor(.012*c);for(let e=0;e<p;e++){let t=.85*Math.tanh(1.2*m[e]);e>p-y&&(t*=(p-e)/y),m[e]=t}return d&&(0,n.addMetronome)(m,c,h,f),m}e.s(["frequencyForPitch",0,function(e,t){let r=(0,n.registerLowMidi)(t,2),a=(0,n.buildScaleMidiSet)(t,r,48);return(0,n.frequencyFromMidi)((0,n.snapToScale)(r+48*e,a))},"registerOctaveLabels",0,function(e){return Array.from({length:5},(t,r)=>`${e.tonic}${2+r}`)},"renderSketchMixSamples",0,i,"renderSketchMixWav",0,function(e,t,r,a){let o=i({strokes:e,bpm:t,bars:r,key:a,sampleRate:n.CLIP_SAMPLE_RATE,withMetronome:!1});return(0,n.encodeWav)(o,n.CLIP_SAMPLE_RATE)}],780255);let s=[{id:"quarter",grid:1,labelKey:null,notationLabel:"1/4"},{id:"eighth",grid:.5,labelKey:null,notationLabel:"1/8"},{id:"sixteenth",grid:.25,labelKey:null,notationLabel:"1/16"},{id:"off",grid:null,labelKey:"instrumentControls.quantizeOff"}],u=e=>
3e*a.BEATS_PER_BAR,l=(e,t)=>null==t?e:Math.round(e/t)*t;e.s(["DEFAULT_QUANTIZE_GRID",0,.25,"PASTE_OFFSET_FALLBACK_BEATS",0,.25,"QUANTIZE_OPTIONS",0,s,"getQuantizeOptionId",0,function(e){return s.find(t=>t.grid===e)?.id??"off"},"getQuantizeOptionLabel",0,function({option:e,t}){return null===e.labelKey?e.notationLabel:t("instrumentControls.quantizeOff")},"quantizeBeats",0,l,"shiftStartBeatsInLoop",0,function(e,t,r){return e.map(e=>({...e,startBeats:((e.startBeats+t)%r+r)%r}))},"totalLoopBeats",0,u],529715);let c=[{id:"bassDrum",labelKey:"drumKit.bassDrum",key:"1"},{id:"snare",labelKey:"drumKit.snare",key:"2"},{id:"lowTom",labelKey:"drumKit.lowTom",key:"3"},{id:"midTom",labelKey:"drumKit.midTom",key:"4"},{id:"hiTom",labelKey:"drumKit.highTom",key:"q"},{id:"lowConga",labelKey:"drumKit.lowConga",key:"w"},{id:"midConga",labelKey:"drumKit.midConga",key:"e"},{id:"hiConga",labelKey:"drumKit.highConga",key:"r"},{id:"rimShot",labelKey:"drumKit.rimShot",key:"a"},{id:"handClap",labelKey:"drumKit.handClap",key:"s"},{id:"cowbell",labelKey:"drumKit.cowbell",key:"d"},{id:"cymbal",labelKey:"drumKit.cymbal",key:"f"},{id:"openHat",labelKey:"drumKit.openHat",key:"z"},{id:"closedHat",labelKey:"drumKit.closedHat",key:"x"},{id:"maracas",labelKey:"drumKit.maracas",key:"c"},{id:"claves",labelKey:"drumKit.claves",key:"v"}],d=c.length,f=["closedHat","openHat","cymbal","maracas","claves","cowbell","rimShot","handClap","snare","hiConga","midConga","lowConga","hiTom","midTom","lowTom","bassDrum"].map(e=>c.findIndex(t=>t.id===e)),h=f.reduce((e,t,r)=>(e[t]=r,e),Array(d).fill(0)),p={openHat:"hat",closedHat:"hat"},m=e=>{let t=c[e]?.id;return void 0===t?null:p[t]??null};e.s(["DEFAULT_VELOCITY",0,.8,"DRUM_PADS",0,c,"PAD_COUNT",0,d,"PAD_TO_ROW",0,h,"ROW_TO_PAD",0,f,"chokeGroupForPad",0,m,"finalizeHit",0,function(e){let{pad:t,startBeats:r,velocity:n,loopBeats:a,grid:o}=e,i=l((r%a+a)%a,o);return{pad:t,startBeats:i>=a?0:i,velocity:n}},"getDrumPadLabel",0,function({pad:e,t}){switch(e.labelKey){case"drumKit.bassDrum":return t("drumKit.bassDrum");case"drumKit.snare":return t("drumKit.snare");case"drumKit.lowTom":return t("drumKit.lowTom");case"drumKit.midTom":return t("drumKit.midTom");case"drumKit.highTom":return t("drumKit.highTom");case"drumKit.lowConga":return t("drumKit.lowConga");case"drumKit.midConga":return t("drumKit.midConga");case"drumKit.highConga":return t("drumKit.highConga");case"drumKit.rimShot":return t("drumKit.rimShot");case"drumKit.handClap":return t("drumKit.handClap");case"drumKit.cowbell":return t("drumKit.cowbell");case"drumKit.cymbal":return t("drumKit.cymbal");case"drumKit.openHat":return t("drumKit.openHat");case"drumKit.closedHat":return t("drumKit.closedHat");case"drumKit.maracas":return t("drumKit.maracas");case"drumKit.claves":return t("drumKit.claves")}},"padForKey",0,e=>{let t=c.findIndex(t=>t.key===e);return -1===t?null:t}],671777);let g=2*Math.PI;function y(e,t,r){let{durationSec:n,startHz:a,endHz:o,pitchTauSec:i,ampTauSec:s}=r,u=Math.max(1,Math.floor(n*t)),l=new Float32Array(u),c=i*t,d=s*t,f=0;for(let r=0;r<u;r++){let n=o+(a-o)*Math.exp(-r/c),i=Math.exp(-r/d);l[r]=Math.sin(g*f)*i*e,f+=n/t,f-=Math.floor(f)}return l}function v(e,t,r){let{durationSec:n,ampTauSec:a,highpass:o,gain:i}=r,s=Math.max(1,Math.floor(n*t)),u=new Float32Array(s),l=a*t,c=0;for(let t=0;t<s;t++){let r=2*Math.random()-1,n=o?r-c:r;c=r,u[t]=n*Math.exp(-t/l)*i*e}return u}let w=[205.3,304.4,369.6,522.7,540,800];function b(e,t,r){let{durationSec:n,ampTauSec:a,gain:o}=r,i=Math.max(1,Math.floor(n*t)),s=new Float32Array(i),u=a*t,l=w.map(()=>0),c=w.map(e=>e/t),d=0;for(let t=0;t<i;t++){let r=0;for(let e=0;e<w.length;e++)r+=l[e]<.5?1:-1,l[e]+=c[e],l[e]-=Math.floor(l[e]);let n=(r/=w.length)-d;d=r;let a=.7*n+(2*Math.random()-1)*.3;s[t]=a*Math.exp(-t/u)*o*e}return s}function S(e,t,r){switch((c[e]??c[0]).id){case"bassDrum":return y(t,r,{durationSec:.5,startHz:150,endHz:52,pitchTauSec:.035,ampTauSec:.13});case"snare":return function(e,t){let r=Math.max(1,Math.floor(.22*t)),n=v(e,t,{durationSec:.22,ampTauSec:.07,highpass:!1,gain:.7}),a=.09*t;for(let o=0;o<r;o++){let r=Math.exp(-o/a);n[o]+=Math.sin(185*g*o/t)*r*.5*e}return n}(t,r);case"lowTom":return y(t,r,{durationSec:.42,startHz:165,endHz:90,pitchTauSec:.06,ampTauSec:.2});
3case"midTom":return y(t,r,{durationSec:.38,startHz:220,endHz:130,pitchTauSec:.05,ampTauSec:.17});case"hiTom":return y(t,r,{durationSec:.34,startHz:300,endHz:180,pitchTauSec:.045,ampTauSec:.15});case"lowConga":return y(t,r,{durationSec:.3,startHz:260,endHz:220,pitchTauSec:.04,ampTauSec:.13});case"midConga":return y(t,r,{durationSec:.26,startHz:380,endHz:340,pitchTauSec:.035,ampTauSec:.11});case"hiConga":return y(t,r,{durationSec:.22,startHz:520,endHz:470,pitchTauSec:.03,ampTauSec:.1});case"rimShot":return function(e,t){let r=Math.max(1,Math.floor(.06*t)),n=new Float32Array(r),a=.012*t;for(let o=0;o<r;o++){let r=Math.sin(1700*g*o/t),i=(2*Math.random()-1)*.3;n[o]=(r+i)*Math.exp(-o/a)*.6*e}return n}(t,r);case"handClap":return function(e,t){let r=Math.max(1,Math.floor(.3*t)),n=new Float32Array(r),a=[0,.009,.018].map(e=>Math.floor(e*t)),o=.007*t,i=.11*t,s=a[a.length-1];for(let t=0;t<r;t++){let r=0;for(let e of a)t>=e&&(r+=Math.exp(-(t-e)/o));t>=s&&(r+=.5*Math.exp(-(t-s)/i)),n[t]=(2*Math.random()-1)*r*.5*e}return n}(t,r);case"cowbell":return function(e,t){let r=Math.max(1,Math.floor(.4*t)),n=new Float32Array(r),a=.12*t,o=540/t,i=800/t,s=0,u=0;for(let t=0;t<r;t++){let r=((s<.5?1:-1)+(u<.5?1:-1))*.5;s+=o,s-=Math.floor(s),u+=i,u-=Math.floor(u),n[t]=r*Math.exp(-t/a)*.4*e}return n}(t,r);case"cymbal":return b(t,r,{durationSec:.8,ampTauSec:.28,gain:.4});case"openHat":return b(t,r,{durationSec:.4,ampTauSec:.12,gain:.45});case"closedHat":return b(t,r,{durationSec:.08,ampTauSec:.02,gain:.5});case"maracas":return v(t,r,{durationSec:.05,ampTauSec:.012,highpass:!0,gain:.5});case"claves":let n=Math.max(1,Math.floor(.06*r)),a=new Float32Array(n),o=.012*r;for(let e=0;e<n;e++)a[e]=Math.sin(2500*g*e/r)*Math.exp(-e/o)*.6*t;return a}}function x(e){let{hits:t,bpm:r,bars:o,sampleRate:i,withMetronome:s}=e,l=u(o),c=60/r,d=c*i,f=Math.max(1,Math.floor(l*c*i)),h=new Float32Array(f),p=function(e,t,r){let n=e.map(()=>null),a=new Map;for(let o of(e.forEach((e,t)=>{let r=m(e.pad);if(null==r)return;let n=a.get(r);n?n.push(t):a.set(r,[t])}),a.values())){if(o.length<2)continue;let a=[...o].sort((t,r)=>e[t].startBeats-e[r].startBeats);a.forEach((o,i)=>{let s=a[(i+1)%a.length],u=(i===a.length-1?e[s].startBeats+t:e[s].startBeats)-e[o].startBeats;n[o]=Math.max(0,Math.round(u*r))})}return n}(t,l,d);t.forEach((e,t)=>{!function(e,t,r,n,a){let o=S(t.pad,t.velocity,n),i=e.length,s=Math.round(t.startBeats*r),u=null!=a&&a<o.length,l=u?a:o.length,c=Math.max(1,Math.round(.005*n));if(u&&l<=c)return;let d=u?c:0,f=l-d;for(let t=0;t<l;t++){let r=t>=f?(l-t)/d:1;e[(s+t)%i]+=.9*o[t]*r}}(h,e,d,i,p[t])});for(let e=0;e<f;e++)h[e]=.9*Math.tanh(1.2*h[e]);return s&&(0,n.addMetronome)(h,i,c,o*a.BEATS_PER_BAR),h}e.s(["CHOKE_FADE_SEC",0,.005,"VOICE_GAIN",0,.9,"renderDrumMixSamples",0,x,"renderDrumMixWav",0,function(e,t,r){let a=x({hits:e,bpm:t,bars:r,sampleRate:n.CLIP_SAMPLE_RATE,withMetronome:!1});return(0,n.encodeWav)(a,n.CLIP_SAMPLE_RATE)},"renderPadVoice",0,S],789684),e.s(["MIN_NOTE_BEATS",0,.0625,"finalizeNote",0,function(e){let{pitch:t,startBeats:r,endBeats:n,velocity:a,loopBeats:o,grid:i}=e,s=Math.max(.0625,n-r),u=l((r%o+o)%o,i);return{pitch:t,startBeats:u>=o?0:u,durationBeats:Math.min(s,o),velocity:a}}],453216);let M=2*Math.PI;function _(e){return .22+2.78*e}function k(e){let{notes:t,bpm:r,bars:o,sampleRate:i,withMetronome:s}=e,l=u(o),c=60/r,d=c*i,f=Math.max(1,Math.floor(l*c*i)),h=new Float32Array(f);for(let e of t){let t=(0,n.frequencyFromMidi)(e.pitch);!function(e,t,r,n,a){let o=e.length,i=Math.round(t.startBeats*n),s=Math.max(1,Math.round(t.durationBeats*n)),u=Math.max(1,.004*a),l=2.2*a,c=.12*a,d=.35*a,f=.045*a,h=.3*t.velocity,p=_(t.velocity),m=.2*t.velocity,g=r/a,y=r/a,v=14*r,w=v<.45*a,b=v/a,S=0,x=0,k=0;for(let t=0;;t++){let r;if(r=t<u?t/u:Math.exp(-(t-u)/l),t>=s&&(r*=Math.exp(-(t-s)/c))<.001||t>o&&t>=s)break;let n=Math.sin(M*x)*(.22+(p-.22)*Math.exp(-t/d)),a=Math.sin(M*S+n);w&&(a+=Math.sin(M*k)*m*Math.exp(-t/f)),e[(i+t)%o]+=a*r*h,S+=g,S-=Math.floor(S),x+=y,x-=Math.floor(x),k+=b,k-=Math.floor(k)}}(h,e,t,d,i)}for(let e=0;e<f;e++)h[e]=.9*Math.tanh(1.2*h[e]);
3return s&&(0,n.addMetronome)(h,i,c,o*a.BEATS_PER_BAR),h}e.s(["EP_INDEX_SUSTAIN",0,.22,"EP_INDEX_TAU_SECONDS",0,.35,"EP_MOD_RATIO",0,1,"EP_TINE_LEVEL",0,.2,"EP_TINE_RATIO",0,14,"EP_TINE_TAU_SECONDS",0,.045,"PIANO_ATTACK_SECONDS",0,.004,"PIANO_DECAY_TAU_SECONDS",0,2.2,"PIANO_RELEASE_TAU_SECONDS",0,.12,"SOFT_CLIP_DRIVE",0,1.2,"SOFT_CLIP_LEVEL",0,.9,"epIndexPeak",0,_,"renderKeyboardMixSamples",0,k,"renderKeyboardMixWav",0,function(e,t,r){let a=k({notes:e,bpm:t,bars:r,sampleRate:n.CLIP_SAMPLE_RATE,withMetronome:!1});return(0,n.encodeWav)(a,n.CLIP_SAMPLE_RATE)}],262545),e.s(["renderSynthRequest",0,function(e,t){return"drawing"===e.kind?i({strokes:e.strokes,bpm:e.bpm,bars:e.bars,key:e.key,sampleRate:t,withMetronome:e.withMetronome}):"drums"===e.kind?x({hits:e.hits,bpm:e.bpm,bars:e.bars,sampleRate:t,withMetronome:e.withMetronome}):k({notes:e.notes,bpm:e.bpm,bars:e.bars,sampleRate:t,withMetronome:e.withMetronome})}],603517)},720869,e=>{"use strict";e.s(["deriveProcessingBatchIds",0,function(e){return e?e.filter(e=>e.items.some(e=>"processing"===e.status)).map(e=>({id:e.batchId,type:"image-to-video"===e.type?"video":e.type})):[]},"filterBatchesByCompletionStatus",0,function(e){let t={},r={};for(let[n,a]of Object.entries(e)){let e=a.reduce((e,t)=>e+ +("processing"===t.status),0),o=e===a.length,i=0===e;!o&&(t[n]=a,i&&(r[n]=a))}return{someCompletedBatches:t,completedBatches:r}}])},323654,e=>{"use strict";var t=e.i(249892);let r=0,n=new Set;function a(){for(let e of n)e()}function o(e){return n.add(e),()=>{n.delete(e)}}let i=()=>r>0,s=()=>!1;e.s(["useGlobalHotkeysSuspended",0,function(){return(0,t.useSyncExternalStore)(o,i,s)},"useSuspendGlobalHotkeys",0,function(e=!0){(0,t.useEffect)(()=>{if(e)return r+=1,a(),()=>{r=Math.max(0,r-1),a()}},[e])}])},457002,e=>{"use strict";var t=e.i(673157),r=e.i(249892);let n=(0,r.createContext)({markNavigatedFromSearch:()=>{},consumeNavigatedFromSearch:()=>!1});e.s(["SearchArrivalProvider",0,({children:e})=>{let a=(0,r.useRef)(!1),o=(0,r.useCallback)(()=>{a.current=!0},[]),i=(0,r.useCallback)(()=>{let e=a.current;return a.current=!1,e},[]),s=(0,r.useMemo)(()=>({markNavigatedFromSearch:o,consumeNavigatedFromSearch:i}),[o,i]);return(0,t.jsx)(n.Provider,{value:s,children:e})},"useSearchArrival",0,()=>(0,r.useContext)(n)])},875732,e=>{"use strict";var t=e.i(673157),r=e.i(559992),n=e.i(744461),a=e.i(249892),o=e.i(177888),i=e.i(423204),s=e.i(548004),u=e.i(42305),l=e.i(256044);let c=!1,d=(0,r.keyframes)("from{opacity:1;}to{opacity:0;}"),f=(0,n.default)("div",{target:"e130o77r0"})("position:fixed;top:0;left:0;right:0;bottom:0;opacity:1;background-color:black;z-index:1000000000;display:flex;align-items:center;justify-content:center;&.fade-out{pointer-events:none;animation:1s ease-out 1s 1 both ",d,";}"),h=(0,a.createContext)({done:!1,setDone:()=>{}});e.s(["StudioLoadingCompleter",0,()=>{let{setDone:e}=(0,a.useContext)(h);return(0,a.useEffect)(()=>{e(!0)},[e]),null},"StudioLoadingOverlayProvider",0,({children:e})=>{let[r,n]=(0,a.useState)(!1),o=(0,a.useMemo)(()=>({done:r,setDone:n}),[r,n]);return(0,t.jsx)(h.Provider,{value:o,children:e})},"default",0,function(){let{done:e}=(0,a.useContext)(h),[r,n]=(0,a.useState)(c);c=r||c,(0,a.useEffect)(()=>{e&&setTimeout(()=>{n(!0)},8e3)},[e]);let d=(0,i.useIsClient)(),p=!(0,s.useBreakpointMd)()||(0,u.isMobileBrowser)();return r||!d||p?null:(0,o.createPortal)((0,t.jsx)(f,{className:e?"fade-out":"",children:(0,t.jsx)("video",{className:"w-[17.5rem]",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,src:(0,l.staticAssetUrl)("studio/studio_loading_h264.mp4")},"studio-loading-video")},"studio-loading-overlay"),document.body)}])},926561,e=>{"use strict";var t=e.i(673157),r=e.i(877130);e.s(["TextInput",0,function({className:e,type:n,...a}){return(0,t.jsx)("input",{type:n,"data-slot":"input",className:(0,r.twMerge)("h-12 w-full rounded-2xl bg-background-primary px-4 outline-none",e),...a})}])},730502,e=>{"use strict";var t=e.i(248949);e.i(948952);var r=e.i(350671),n=e.i(200279),a=e.i(605960);function o(e){return e.t("runtimeFeedback.tryAgain",{ns:"common"})}async function i(e){let i,{data:s,instance:u,isCurrent:l}=e;if(l?.()===!1)return;let{timeout:c,position:d}=function(e){switch(e){case"moderation-failed":return{timeout:0,position:"top"};case"upload-timed-out":case"processing-timed-out":return{timeout:6e3};case"video-too-short":case"video-too-long":case"file-too-large":case"generic-upload-error":return{timeout:5e3,position:"top"};case"processing-failed":case"processing-mutation-failed":case"upload-failed":return{timeout:4e3}}}(e.failure),f=u.t("fallbacks.contentUnavailable",{ns:"common"});try{let r=await (0,t.loadTranslationsOnDemand)(u,"uploads");switch(e.failure){case"moderation-failed":({title:f,description:i}=(0,n.getHookModerationMessage)({contentRatingTags:e.contentRatingTags,t:r}));break;case"processing-failed":({title:f,description:i}=(0,a.getVideoUploadErrorMessage)({contentRatingTags:e.contentRatingTags,errorMessage:e.errorMessage,errorType:e.errorType,t:r}));break;case"processing-mutation-failed":f=r("videoUpload.processingFailedTitle"),i=e.errorMessage??o(u);break;case"upload-timed-out":f=r("videoUpload.uploadTimedOutTitle"),i=r("videoUpload.uploadTimedOutDescription");break;case"upload-failed":f=r("videoUpload.failed"),i=o(u);break;case"processing-timed-out":f=r("videoUpload.processingTimedOutTitle"),i=r("videoUpload.processingTimedOutDescription");break;case"video-too-short":f=r("videoUpload.tooShortTitle"),i="seconds"===e.unit?r("videoUpload.tooShortSeconds",{count:e.count}):r("videoUpload.tooShortMinutes",{count:e.count});break;case"video-too-long":f=r("videoUpload.tooLongTitle"),i="seconds"===e.unit?r("videoUpload.tooLongSeconds",{count:e.count}):r("videoUpload.tooLongMinutes",{count:e.count});break;case"file-too-large":f=r("videoUpload.fileTooLarge",{maxFileSizeMb:e.maxFileSizeMb});break;case"generic-upload-error":f=r("videoUpload.genericUploadError")}}catch{}l?.()!==!1&&r.toastManager.add({title:f,description:i,type:"error",timeout:c,data:s,...d?{position:d}:{}})}e.s(["reportHookUploadFailure",0,i])},561809,e=>{"use strict";var t=e.i(673157),r=e.i(249892);let n=(0,r.createContext)({feedId:void 0,hookId:void 0,userHandle:void 0,feedCurrentHookId:void 0,feedCurrentIndex:void 0,updateState:()=>({})});e.s(["HooksFeedProvider",0,({children:e})=>{let[a,o]=(0,r.useReducer)((e,t)=>({...e,...t}),{}),i=(0,r.useMemo)(()=>({...a,updateState:o}),[a,o]);return(0,t.jsx)(n.Provider,{value:i,children:e})},"useHooksFeedContext",0,function(e){let t=(0,r.useContext)(n),a=null!=e,{feedId:o,hookId:i,userHandle:s}=e||{},{updateState:u}=t;return(0,r.useEffect)(()=>{a&&u({feedId:o,hookId:i,userHandle:s})},[a,o,i,s,u]),(0,r.useMemo)(()=>a?{...t,feedId:o,hookId:i,userHandle:s}:t,[t,a,o,i,s])}])},624219,e=>{"use strict";var t,r=e.i(673157),n=e.i(249892),a=e.i(863406),o=e.i(277565);let i="0.1.3";var s=((t={}).Disabled="disabled",t.Registering="registering",t.Installed="installed",t.Ready="ready",t.Error="error",t);let u=(0,n.createContext)(null);e.s(["ServiceWorkerProvider",0,function(e){let{children:t,enabled:s}
3=e,l=(0,n.useRef)(!1),c=s??!0,[d,f]=(0,n.useState)(()=>c&&(0,a.isServiceWorkerSupported)()?(0,a.isServiceWorkerReady)()?"ready":"registering":"disabled"),[h,p]=(0,n.useState)(null),[m,g]=(0,n.useState)(null),[y,v]=(0,n.useState)(!1),[w,b]=(0,n.useState)(!1),[S,x]=(0,n.useState)(null);"ready"!==d||l.current||(l.current=!0),(0,n.useEffect)(()=>{(0,a.isServiceWorkerSupported)()&&(navigator.serviceWorker.getRegistrations().then(e=>{e.length>0&&g(e[0])}),(0,a.isServiceWorkerReady)()&&(0,a.getServiceWorkerVersion)().then(e=>{e&&x(e)}))},[]),(0,n.useEffect)(()=>{if(!c||!(0,a.isServiceWorkerSupported)()||l.current)return;let e=!1;return async function(){let t=null;try{f("registering");let r=await (0,a.initializeServiceWorker)();if(e)return;g(r.registration),f("ready"===r.status?"ready":"installed"),p(null),"ready"===r.status&&(0,a.getServiceWorkerVersion)().then(t=>{!e&&t&&x(t)}),t={actionName:"ServiceWorkerRegistration",context:{status:r.status}}}catch(r){e||(a.logger.error("Initialization failed:",r),p(r instanceof Error?r:Error(String(r))),f("error"),t={actionName:"ServiceWorkerError",context:{error:r instanceof Error?r.message:String(r)}})}t&&(0,o.default)(t)}(),()=>{e=!0}},[c]),(0,n.useEffect)(()=>{if(!c||!(0,a.isServiceWorkerSupported)()||"installed"!==d)return;let e=()=>{navigator.serviceWorker.controller&&f("ready")};return navigator.serviceWorker.addEventListener("controllerchange",e),navigator.serviceWorker.controller&&f("ready"),()=>{navigator.serviceWorker.removeEventListener("controllerchange",e)}},[c,d]),(0,n.useEffect)(()=>{if(c&&m)return(0,a.enableServiceWorkerUpdates)({registration:m,onUpdateAvailable:e=>{v(!0),(0,o.default)({actionName:"ServiceWorkerUpdateAvailable"}),(0,a.getServiceWorkerVersion)().then(t=>{t&&((0,o.default)({actionName:"ServiceWorkerVersionMismatchAutoActivate",context:{runningVersion:t,expectedVersion:i}}),(0,a.activateWaitingServiceWorker)(e,{reload:!1}))})},onUpdateActivated:e=>{v(!!e.waiting),(0,o.default)({actionName:"ServiceWorkerUpdateActivated"}),(0,a.getServiceWorkerVersion)().then(e=>{e&&x(e),e&&e!==i&&(a.logger.log(`Page behind (sw=${e}, page=${i}), reload recommended`),(0,o.default)({actionName:"ServiceWorkerPageBehind",context:{swVersion:e,pageVersion:i}}),b(!0))})}})},[c,m]);let M={status:l.current?"ready":d,isReady:l.current||"ready"===d,isEnabled:c,hasWaitingWorker:y,needsPageReload:w,swVersion:S,error:h,registration:m};return(0,r.jsx)(u.Provider,{value:M,children:t})},"ServiceWorkerStatus",()=>s,"useServiceWorkerContextOptional",0,function(){return(0,n.useContext)(u)}],624219)},718502,e=>{"use strict";var t=e.i(673157),r=e.i(249892);let n={},a=(0,r.createContext)(n);e.s(["ServerLayoutProvider",0,function({ssrLayoutCookies:e,children:r}){return(0,t.jsx)(a.Provider,{value:e??n,children:r})},"useServerLayout",0,function(){return(0,r.useContext)(a)}])},959585,e=>{"use strict";var t=e.i(607892),r=e.i(853629),n=e.i(249892),a=e.i(79076),o=e.i(725516),i=e.i(690836);e.s(["useFollowedPersonas",0,function({enabled:e=!0}={}){let s=(0,a.useApiClient)(),u=(0,r.useQueryClient)(),l=(0,t.useInfiniteQuery)({queryKey:i.personaKeys.followedPersonas({}),queryFn:async({pageParam:e})=>{let{data:t,response:r}=await s.GET("/api/persona/get-followed-personas/",{params:{query:{page:e}}});if(404===r.status)return{personas:[],totalResults:0,currentPage:1};if(!r.ok||!t)throw Error("Failed to fetch followed personas");return{personas:t.personas||[],totalResults:t.total_results||0,currentPage:t.current_page||1}},initialPageParam:1,getNextPageParam:e=>e.totalResults>e.currentPage*o.PERSONA_PAGE_SIZE?e.currentPage+1:void 0,enabled:e,staleTime:3e5,retry:3}),c=(0,n.useMemo)(()=>l.data?.pages.flatMap(e=>e.personas)??[],[l.data]),d=l.data?.pages[0]?.totalResults??0,f=(0,n.useCallback)(()=>{u.invalidateQueries({queryKey:i.personaKeys.followedPersonas({})})},[u]);return{personas:c,totalResults:d,isLoading:l.isLoading,isFetching:l.isFetching,isFetchingNextPage:l.isFetchingNextPage,isError:l.isError,error:l.error,hasNextPage:l.hasNextPage??!1,fetchNextPage:l.fetchNextPage,refetch:l.refetch,invalidate:f}}])},323199,e=>{"use strict";var t=e.i(511927),r=e.i(853629);e.i(462951);var n=e.i(646984),a=e.i(248949);e.i(948952);var o=e.i(350671),i=e.i(690836),s=e.i(79076);function u(e,t,r){return e?{...e,pages:e.pages.map(e=>({...e,personas:e.personas.map(e=>e.id===t?{...e,is_loved:r}:e)}))}:e}e.s(["useToggleLovePersona",0,function(){let e=(0,s.useApiClient)(),l=(0,r.useQueryClient)(),{i18n:c,t:d}=(0,n.useTranslation)("common");return(0,t.useMutation)({mutationFn:async({personaId:t})=>{let{data:r,error:n,response:a}=await e.POST("/api/persona/{persona_id}/toggle_love/",{params:{path:{persona_id:t}}});if(!a.ok||n)throw Error("Failed to update persona love status");if(!r)throw Error("No data returned from toggle love endpoint");return r},onMutate:async e=>{await l.cancelQueries({queryKey:i.personaKeys.userPersonas({})}),await l.cancelQueries({queryKey:i.personaKeys.followedPersonas({})}),await l.cancelQueries({queryKey:i.personaKeys.lovedPersonas({})});let t=l.getQueryData(i.personaKeys.userPersonas({})),r=l.getQueryData(i.personaKeys.followedPersonas({})),n=l.getQueryData(i.personaKeys.lovedPersonas({})),a=!1;for(let o of[...t?.pages??[],...r?.pages??[],...n?.pages??[]]){let t=
3o.personas.find(t=>t.id===e.personaId);if(t){a=t.is_loved??!1;break}}let o=!a;return l.setQueryData(i.personaKeys.userPersonas({}),t=>u(t,e.personaId,o)),l.setQueryData(i.personaKeys.followedPersonas({}),t=>u(t,e.personaId,o)),l.setQueryData(i.personaKeys.lovedPersonas({}),t=>u(t,e.personaId,o)),{previousUserPersonas:t,previousFollowedPersonas:r,previousLovedPersonas:n}},onSuccess:async(e,t)=>{o.toastManager.add({title:await (0,a.resolveTextOnDemand)({instance:c,namespace:"voices",resolve:r=>{let n=t.personaName??r("voices.entityLabel");return r(e.loved?"voices.lovedToast":"voices.unlovedToast",{name:n})}}),type:"info",timeout:3e3})},onError:async(e,t,r)=>{r?.previousUserPersonas&&l.setQueryData(i.personaKeys.userPersonas({}),r.previousUserPersonas),r?.previousFollowedPersonas&&l.setQueryData(i.personaKeys.followedPersonas({}),r.previousFollowedPersonas),r?.previousLovedPersonas&&l.setQueryData(i.personaKeys.lovedPersonas({}),r.previousLovedPersonas),o.toastManager.add({title:d("runtimeFeedback.errorTitle"),description:e.message||await (0,a.resolveTextOnDemand)({instance:c,namespace:"voices",resolve:e=>e("voices.failedToUpdateLoveStatus")}),type:"error",timeout:3e3}),console.error("Error toggling persona love:",e)},onSettled:(e,t,r)=>{l.invalidateQueries({queryKey:i.personaKeys.personaById(r.personaId)}),l.invalidateQueries({queryKey:i.personaKeys.personaPaginated({personaId:r.personaId})}),l.invalidateQueries({queryKey:i.personaKeys.lovedPersonas({})}),l.invalidateQueries({queryKey:i.personaKeys.userPersonas({})}),l.invalidateQueries({queryKey:i.personaKeys.followedPersonas({})})}})}])},785616,e=>{"use strict";var t=e.i(607892),r=e.i(853629),n=e.i(249892),a=e.i(79076),o=e.i(690836);e.s(["useUserPersonas",0,function({enabled:e=!0}={}){let i=(0,a.useApiClient)(),s=(0,r.useQueryClient)(),u=(0,t.useInfiniteQuery)({queryKey:o.personaKeys.userPersonas({}),queryFn:async({pageParam:e})=>{let{page:t,token:r}=e,{data:n,response:a}=await i.GET("/api/persona/get-personas/",{params:{query:{page:t,...r&&{continuation_token:r}}}});if(!a.ok||!n)throw Error("Failed to fetch user personas");return{personas:n.personas||[],totalResults:n.total_results||0,currentPage:n.current_page||1,continuationToken:n.continuation_token||null}},initialPageParam:{page:1,token:null},getNextPageParam:e=>{if(e.continuationToken)return{page:e.currentPage+1,token:e.continuationToken}},enabled:e,staleTime:3e5,retry:3}),l=(0,n.useMemo)(()=>(u.data?.pages.flatMap(e=>e.personas)??[]).filter(e=>!e.is_trashed),[u.data]),c=u.data?.pages[0]?.totalResults??0,d=(0,n.useCallback)(()=>{s.invalidateQueries({queryKey:o.personaKeys.userPersonas({})})},[s]);return{personas:l,totalResults:c,isLoading:u.isLoading,isFetching:u.isFetching,isFetchingNextPage:u.isFetchingNextPage,isError:u.isError,error:u.error,hasNextPage:u.hasNextPage??!1,fetchNextPage:u.fetchNextPage,refetch:u.refetch,invalidate:d}}])},974374,e=>{"use strict";var t=e.i(531960),r=e.i(79076);let n={submitted:"submitted",rendering:"rendering",rendered_in_moderation:"rendered_in_moderation",rendered_failed_moderation:"rendered_failed_moderation",rendered_passed_moderation:"rendered_passed_moderation",error:"error"},a=[n.rendered_failed_moderation,n.rendered_passed_moderation,n.error];e.s(["HOOK_STATUS",0,n,"useHookById",0,({hookId:e,shouldPoll:o=!1})=>{let i=(0,r.useApiClient)();return(0,t.useQuery)({queryKey:["hookStatus",e],queryFn:async()=>{if(!e)return null;let{data:t}=await i.GET("/api/video/hooks/{hook_id}",{params:{path:{hook_id:e}}});if(t?.status===n.error)throw Error("Hook failed to render");return t},enabled:!!e,refetchInterval:t=>!(!o||!t.state.data||!e||t.state.data?.status&&a.includes(t.state.data.status))&&2e3,refetchOnWindowFocus:!1})}])},98638,e=>{"use strict";var t=e.i(740851),r=e.i(249892);let n=[];e.s(["default",0,()=>{let e=(0,t.usePathname)();(0,r.useEffect)(()=>{n.push({path:e,timestamp:new Date().toISOString()}),n.length>5&&(n=n.slice(-5))},[e])},"getNavigationHistory",0,function(){return n}])},536975,e=>{"use strict";var t,r=e.i(810789),n=e.i(249892),a=e.i(919306),o=e.i(922847),i=e.i(809582),s=e.i(609291),u=((t={}).Ready="Ready",t.Preparing="Preparing",t.Recording="Recording",t.Paused="Paused",t);e.s(["RecordingStage",()=>u,"default",0,(t=4*a.default.sampleRate)=>{let u=(0,n.useMemo)(()=>
3new Float32Array(t),[]),[l,c]=(0,n.useState)("Ready"),[d,f]=(0,n.useState)(null),h=(0,n.useRef)(1/0),p=(0,n.useRef)(0),m=(0,n.useRef)(null),g=(0,n.useRef)(null),y=(0,n.useRef)(async()=>null),v=(0,n.useCallback)(()=>null!==m.current?p.current:p.current+Math.max(0,Date.now()-h.current),[]),w=(0,n.useRef)(null),b="Ready"===l,S=(0,n.useCallback)(async(t="default",n={})=>{if(b){c("Preparing"),f(null),p.current=0,m.current=null;try{"suspended"===a.default.state&&await a.default.resume();let s=await new Promise((e,r)=>navigator.mediaDevices.getUserMedia({audio:{deviceId:t,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,...n,latency:0,sampleRate:a.default.sampleRate},video:!1}).then(t=>{e(t)}).catch(e=>{r(e)})),l=a.default.createMediaStreamSource(s);w.current||(await a.default.audioWorklet.addModule(new e.U(e.r(905506))),w.current=new window.AudioWorkletNode(a.default,"waveformGetterWorklet",{outputChannelCount:[2],numberOfInputs:1}));let d=w.current,f={},p=(0,i.getSafariCompatibleMimeType)();p&&(f.mimeType=p);let m=new MediaRecorder(s,f);g.current=m;let v=!1,b=!1;l.connect(d),d.port.onmessage=e=>{v||b||(v=!0),"waveform"===e.data.type&&(b||"inactive"!==m.state||(m.start(),b=!0),u.set(u.subarray(e.data.waveform.length)),u.set(e.data.waveform,u.length-e.data.waveform.length))};let S=[],x=!1;m.ondataavailable=e=>{x||(x=!0),S.push(e.data)};let M=()=>{},_=new Promise(e=>{M=e}),k=(e,t)=>{r.captureException(t instanceof Error?t:Error(`Recording failed: ${e}`),{tags:{source:"recording-stop-failed",reason:e}}),M(null)};m.onstop=async()=>{try{let e=await (0,o.default)(await new Blob(S).arrayBuffer());M(e)}catch(e){console.error("Error processing recorded audio:",e),k("decode-failed",e)}},m.onerror=e=>{console.error("MediaRecorder error:",e),k("recorder-errored")},h.current=Date.now(),c("Recording"),y.current=()=>{try{l.disconnect()}catch(e){console.warn("Error disconnecting MediaStreamSource:",e)}try{d.disconnect()}catch(e){console.warn("Error disconnecting WaveformGetterWorklet:",e)}try{s.getAudioTracks().forEach(e=>{e.stop()})}catch(e){console.warn("Error stopping audio tracks:",e)}try{"inactive"!==m.state?m.stop():0===S.length&&k("no-data-recorded")}catch(e){console.warn("Error stopping MediaRecorder:",e),k("stop-threw",e)}return _}}catch(e){throw y.current=async()=>null,c("Ready"),e}}},[b,u]),x=(0,n.useCallback)(()=>{if("Recording"!==l)return;let e=Date.now();p.current+=Math.max(0,e-h.current),m.current=e,g.current&&"recording"===g.current.state&&g.current.pause(),c("Paused")},[l]),M=(0,n.useCallback)(()=>{"Paused"===l&&(m.current=null,h.current=Date.now(),g.current&&"paused"===g.current.state&&g.current.resume(),c("Recording"))},[l]),_=(0,n.useCallback)(async()=>{if("Recording"!==l&&"Paused"!==l)return d;c("Ready");let e=await y.current();return f(e),e},[l,d]);return(0,s.default)(_),{startRecording:S,stopRecording:_,pauseRecording:x,resumeRecording:M,recordedBuffer:d,visualizedWindow:u,stage:l,getCurrentDuration:v}}])},455249,e=>{"use strict";var t=e.i(607892),r=e.i(853629),n=e.i(249892),a=e.i(79076),o=e.i(335380);let i=new Set(["public_song","hybrid_search","tag_song","library_song"]),s={all:[{scope:"search"}],query:({term:e,searchType:t,rankBy:r,isPublic:n,isInstrumental:a,modelVersions:o,languages:i,creatorFilters:u,pageSize:l})=>[{...s.all[0],searchType:t,term:e.trim().substring(0,256),rankBy:r,isPublic:n,isInstrumental:a,modelVersions:o,languages:i,creatorFilters:u,pageSize:l}]};e.s(["useSearch",0,function({term:e,searchType:u,rankBy:l="most_relevant",isPublic:c=!0,isInstrumental:d,modelVersions:f,languages:h,creatorFilters:p,pageSize:m=20,enabled:g=!0,allowEmptyTerm:y=!1}){let v=(0,a.useApiClient)(),w=(0,r.useQueryClient)(),b=e.trim().substring(0,256),S=(0,t.useInfiniteQuery)({queryKey:s.query({term:e,searchType:u,rankBy:l,isPublic:c,isInstrumental:d,modelVersions:f,languages:h,creatorFilters:p,pageSize:m}),queryFn:async({pageParam:e})=>{let{data:t,error:r}=await v.POST("/api/search/",{body:{search_queries:[{name:u,search_type:u,term:b,from_index:e,size:m,rank_by:l,is_public:c,is_instrumental:d,model_versions:f,languages:h,creator_filters:p}]}});if(r)throw Error("Search request failed");let n=t?.result?.[u],a=n?.result??[];return i.has(u)&&(0,o.seedClipCaches)(a.filter(e=>e?.id),w),{results:a,totalHits:n?.total_hits??0,fromIndex:n?.from_index??0,pageSize:n?.page_size??m}},initialPageParam:0,getNextPageParam:e=>{let t=e.fromIndex+e.pageSize;return t>=e.totalHits?void 0:t},enabled:g&&(y||!!b),staleTime:3e5});return{results:(0,n.useMemo)(()=>{let e=new Set,t=[];for(let r of S.data?.pages??[])for(let n of r.results){let r=n?.id;if(r){if(e.has(r))continue;e.add(r)}t.push(n)}return t},[S.data]),totalHits:S.data?.pages[0]?.totalHits??0,isLoading:S.isLoading,isFetching:S.isFetching,isFetchingNextPage:S.isFetchingNextPage,hasNextPage:S.hasNextPage,fetchNextPage:S.fetchNextPage,refetch:S.refetch,error:S.error}}])},376151,e=>{"use strict";e.s(["getVideoDuration",()=>f,"useVideoUpload",()=>h]);var t=e.i(511927),r=e.i(531960),n=e.i(526222),a=e.i(199757),o=e.i(249892),i=e.i(714267),s=e.i(730502),u=e.i(964977),l=e.i(79076),c=e.i(277565);let d={all:[{scope:"videoUpload"}],uploadStatus:({uploadId:e})=>[{...d.all[0],entity:"uploadStatus",uploadId:e}]};function f(e){return new Promise((t,r)=>{let n=document.createElement("video"),a=URL.createObjectURL(e);n.preload="metadata",n.onloadedmetadata=()=>{URL.revokeObjectURL(a),t(n.duration)},n.onerror=()=>{URL.revokeObjectURL(a),r(Error("Failed to load video metadata"))},n.src=a})}let h=e=>{let h=(0,l.useApiClient)(),p=(0,u.useAppI18n)(),[m,g]=(0,o.useState)(null),[y,v]=(0,o.useState)(null),[w,b]=(0,o.useState)(null),[S,x]=(0,o.useState)(0),[M,_]=(0,o.useState)(null),[k,E]=(0,o.useState)(null),[C,T]=(0,o.useState)(null),P=(0,o.useRef)(null),A=(0,o.useRef)(null),O=(0,o.useRef)(null),I=(0,o.useRef)(0),B=(0,o.useCallback)(e=>I.current===e,[]),{isVideoCover:D=!1,requireVideoSprite:R=!1,requireModeration:j=!0,videoUploadType:F,maxFileSizeMb:L=100,maxFileSize:N=1024*L*1024,minDuration:U,maxDuration:q,pollingTimeout:K=18e4,onVideoSelected:H,uploadTimeout:W=6e5,clipId:z}=e,Q=(0,o.useCallback)(async e=>{b("uploading"),x(0),v(null);let{data:t}=await h.POST("/api/uploads/video/",{body:{extension:e.extension}});if(!t)throw Error("Failed to fetch upload parameters");return O.current=t.id,g(t.id),{url:t?.url,fields:t.fields}},[h,g,x,v]),V=(0,o.useMemo)(()=>new a.default({id:"video-upload",restrictions:{maxNumberOfFiles:1,maxFileSize:N}}).use(n.default,{getUploadParameters:Q}),[N,Q]),G=(0,o.useCallback)(()=>
3{V.getFiles().forEach(e=>{V.removeFile(e.id)})},[V]),Y=(0,o.useCallback)(()=>{V.cancelAll();let e=I.current;(0,s.reportHookUploadFailure)({failure:"upload-timed-out",instance:p,isCurrent:()=>B(e)}),b("error"),x(0),G()},[V,G,p,B]),$=(0,o.useCallback)(()=>{A.current&&(clearTimeout(A.current),A.current=null)},[]),X=(0,o.useCallback)(()=>{$(),A.current=setTimeout(Y,W)},[$,Y,W]);(0,o.useEffect)(()=>{let e=(e,t)=>{x(Math.round(t.bytesUploaded/t.bytesTotal*100))},t=()=>{$(),"video_hook"===F&&(0,c.default)({actionName:"HookUploadVideoFailed",context:{uploadId:m||void 0,clipId:z||void 0}});let e=I.current;(0,s.reportHookUploadFailure)({failure:"upload-failed",instance:p,isCurrent:()=>B(e)}),b("error"),x(0),G()},r=()=>{$(),v(V.getFiles()?.[0]?.name||null),b("uploading-complete"),"video_hook"===F&&(0,c.default)({actionName:"HookUploadVideoSucceeded",context:{uploadId:m||void 0,clipId:z||void 0}})},n=()=>{$(),G()};return V.on("upload-progress",e),V.on("upload-success",r),V.on("upload-error",t),V.on("complete",n),()=>{V.off("upload-progress",e),V.off("upload-success",r),V.off("upload-error",t),V.off("complete",n),$()}},[V,W,$,Y,p,B]);let J=(({isVideoCover:e,requireVideoSprite:r,requireModeration:n,videoUploadType:a,setUploadStatus:i,pollingStartTime:u,clipId:c,instance:d,isCurrentAttempt:f})=>{let h=(0,l.useApiClient)(),p=(0,o.useCallback)(()=>{i("processing"),u.current=Date.now()},[i,u]),m=(0,o.useCallback)((e,t)=>{i("error"),(0,s.reportHookUploadFailure)({failure:"processing-mutation-failed",errorMessage:e instanceof Error?e.message:null,instance:d,isCurrent:()=>f(t.attempt)})},[i,d,f]);return(0,t.useMutation)({mutationFn:async({uploadId:t,uploadedFilename:o})=>{let{error:i}=await h.POST("/api/uploads/video/{upload_id}/upload-finish/",{params:{path:{upload_id:t}},body:{upload_type:"file_upload",upload_filename:o||"unknown",is_video_cover:e,require_video_sprite:r,fail_task_on_moderation:n,video_upload_type:a,clip_id:c}});if(i)throw i},onSuccess:p,onError:m})})({isVideoCover:D,requireVideoSprite:R,requireModeration:j,videoUploadType:F,setUploadStatus:b,pollingStartTime:P,clipId:z,instance:p,isCurrentAttempt:B});(0,o.useEffect)(()=>{"uploading-complete"===w&&m&&y&&J.mutate({uploadId:m,uploadedFilename:y,attempt:I.current})},[w,m,y]),(({uploadId:e,uploadStatus:t,pollingConfig:n,onSuccess:a,onError:i,onPollingTimedOut:s})=>{let u=(0,l.useApiClient)(),{pollingStartTime:c,pollingTimeout:f}=n,h=(0,o.useCallback)(()=>!!c.current&&Date.now()-c.current>f,[f]);return(0,r.useQuery)({queryKey:d.uploadStatus({uploadId:e||""}),queryFn:async()=>{if(!e)return;if(h())return void s();let{data:t}=await u.GET("/api/uploads/video/{upload_id}/",{params:{path:{upload_id:e}}});return t?.status==="error"&&i({failedUploadId:e,errorMessage:t?.error_message||"Unknown error",errorType:t?.error_type,contentRatingTags:t?.content_rating_tags}),t?.status==="complete"&&a(t),t},enabled:!!e&&"processing"===t&&!h(),refetchInterval:!("processing"!==t||h())&&2e3,staleTime:0})})({uploadId:m,uploadStatus:w,pollingConfig:{pollingTimeout:K,pollingStartTime:P},onSuccess:e=>{b("complete"),_(e?.s3_id||null),E(e?.image_url||null),T(e?.audio_alignment_timestamp||null)},onError:({failedUploadId:e,errorMessage:t,errorType:r,contentRatingTags:n})=>{let a=()=>O.current===e;a()&&(b("error"),(0,s.reportHookUploadFailure)({failure:"processing-failed",contentRatingTags:n,errorMessage:t,errorType:r,instance:p,isCurrent:a}))},onPollingTimedOut:()=>{b("error");let e=I.current;(0,s.reportHookUploadFailure)({failure:"processing-timed-out",instance:p,isCurrent:()=>B(e)})}});let Z=(0,o.useCallback)(async(e,t)=>{let{onError:r}=t||{};I.current+=1;let n=I.current;if(e){if(null!=U||null!=q){let t=await f(e);if(null!=U&&t<U){let e=U<i.MAX_VIDEO_DURATION_SECONDS;(0,s.reportHookUploadFailure)({failure:"video-too-short",unit:e?"seconds":"minutes",count:e?U:Math.round(U/60),instance:p,isCurrent:()=>B(n)}),r?.();return}if(null!=q&&t>q){let e=q<i.MAX_VIDEO_DURATION_SECONDS;(0,s.reportHookUploadFailure)({failure:"video-too-long",unit:e?"seconds":"minutes",count:e?q:Math.round(q/60),instance:p,isCurrent:()=>B(n)}),r?.();return}}let t=null;try{t=V.addFile({name:e.name,type:e.type,data:e}),O.current=null,X(),"video_hook"===F&&(0,c.default)({actionName:"HookUploadVideoStarted",context:{uploadId:m||void 0,clipId:z||void 0}}),await V.upload()}catch(a){$();let e=a instanceof Error&&a.message.includes("exceeds maximum");(0,s.reportHookUploadFailure)(e?{failure:"file-too-large",maxFileSizeMb:i.MAX_VIDEO_UPLOAD_FILESIZE_MB,instance:p,isCurrent:()=>B(n)}:{failure:"generic-upload-error",instance:p,isCurrent:()=>B(n)}),H?.(null),t&&V.removeFile(t),r?.();return}}else O.current=null,$(),G();H?.(e)},[V,H,G,p,B]);return(0,o.useMemo)(()=>({uploadId:m,uploadS3Id:M,uploadImageUrl:k,uploadStatus:w,uploadProgress:S,audioAlignmentTimestamp:C,updateSelectedVideo:Z,removeFiles:G}),[m,M,k,w,S,C,Z,G])}},325327,e=>{"use strict";var t=e.i(673157);e.s(["default",0,e=>(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"
3currentColor",...e,children:(0,t.jsx)("g",{children:(0,t.jsx)("path",{d:"M12 21a5.93 5.93 0 0 1-3.012-.8A5.84 5.84 0 0 1 6.8 18H4v-2h2.1a8 8 0 0 1-.087-1A40 40 0 0 1 6 14H4v-2h2q0-.5.013-1a8 8 0 0 1 .087-1H4V8h2.8a8 8 0 0 1 .788-1.075q.437-.5 1.012-.875L7 4.4 8.4 3l2.15 2.15a4.63 4.63 0 0 1 2.85 0L15.6 3 17 4.4l-1.65 1.65A5.8 5.8 0 0 1 17.2 8H20v2h-2.1q.075.5.088 1T18 12h2v2h-2q0 .5-.012 1a8 8 0 0 1-.088 1H20v2h-2.8a5.84 5.84 0 0 1-2.187 2.2Q13.625 21 12 21m-2-5h4v-2h-4zm0-4h4v-2h-4z"})})})])},873935,e=>{"use strict";var t=e.i(673157);e.s(["default",0,e=>(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:(0,t.jsx)("g",{children:(0,t.jsx)("path",{d:"m11.995 9.35 6.337 6.337q.323.324.765.313t.766-.335.323-.765-.323-.765l-6.64-6.618a1.7 1.7 0 0 0-.582-.388A1.7 1.7 0 0 0 11.995 7a1.7 1.7 0 0 0-.647.13q-.324.129-.582.387l-6.64 6.64a1 1 0 0 0-.312.754q.011.43.334.755.324.323.766.323t.765-.324z"})})})])},382010,e=>{"use strict";var t=e.i(673157);e.s(["default",0,e=>(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:(0,t.jsx)("g",{children:(0,t.jsx)("path",{d:"M11 13v6H9v-4H5v-2zm4-8v4h4v2h-6V5z"})})})])},699666,e=>{"use strict";var t=e.i(673157);e.s(["default",0,e=>(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:(0,t.jsx)("g",{children:(0,t.jsxs)("g",{children:[(0,t.jsx)("path",{d:"M9.6 19q-.66 0-1.13-.477Q8 18.045 8 17.375t.47-1.148q.47-.477 1.13-.477t1.13.477.47 1.148-.47 1.148T9.6 19m4.8 0q-.66 0-1.13-.477-.47-.478-.47-1.148t.47-1.148q.47-.477 1.13-.477t1.13.477.47 1.148-.47 1.148T14.4 19m-4.8-4.875q-.66 0-1.13-.477Q8 13.17 8 12.5t.47-1.148 1.13-.477 1.13.477q.47.478.47 1.148t-.47 1.148-1.13.477m4.8 0q-.66 0-1.13-.477-.47-.478-.47-1.148t.47-1.148 1.13-.477 1.13.477q.47.478.47 1.148t-.47 1.148-1.13.477M9.6 9.25q-.66 0-1.13-.477Q8 8.295 8 7.625t.47-1.148T9.6 6t1.13.477q.47.478.47 1.148t-.47 1.148-1.13.477m4.8 0q-.66 0-1.13-.477-.47-.478-.47-1.148t.47-1.148T14.4 6t1.13.477q.47.478.47 1.148t-.47 1.148-1.13.477"}),(0,t.jsx)("path",{d:"M9.6 19q-.66 0-1.13-.477Q8 18.045 8 17.375t.47-1.148q.47-.477 1.13-.477t1.13.477.47 1.148-.47 1.148T9.6 19m4.8 0q-.66 0-1.13-.477-.47-.478-.47-1.148t.47-1.148q.47-.477 1.13-.477t1.13.477.47 1.148-.47 1.148T14.4 19m-4.8-4.875q-.66 0-1.13-.477Q8 13.17 8 12.5t.47-1.148 1.13-.477 1.13.477q.47.478.47 1.148t-.47 1.148-1.13.477m4.8 0q-.66 0-1.13-.477-.47-.478-.47-1.148t.47-1.148 1.13-.477 1.13.477q.47.478.47 1.148t-.47 1.148-1.13.477M9.6 9.25q-.66 0-1.13-.477Q8 8.295 8 7.625t.47-1.148T9.6 6t1.13.477q.47.478.47 1.148t-.47 1.148-1.13.477m4.8 0q-.66 0-1.13-.477-.47-.478-.47-1.148t.47-1.148T14.4 6t1.13.477q.47.478.47 1.148t-.47 1.148-1.13.477"})]})})})])},696889,e=>{"use strict";var t=e.i(673157);e.s(["default",0,e=>(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:(0,t.jsx)("g",{children:(0,t.jsx)("path",{d:"M9.9 19q-2.425 0-4.163-1.575Q4 15.85 4 13.5t1.737-3.925T9.9 8h6.3l-1.9-1.9a.99.99 0 1 1 1.4-1.4l3.593 3.593a1 1 0 0 1 0 1.414L15.7 13.3a.99.99 0 1 1-1.4-1.4l1.9-1.9H9.9q-1.575 0-2.738 1Q6 12 6 13.5T7.162 16q1.164 1 2.738 1H16a1 1 0 1 1 0 2z"})})})])},709637,191989,e=>{"use strict";var t=e.i(673157);let r=e=>(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:(0,t.jsx)("g",{children:(0,t.jsx)("path",{d:"M12 20q-.315 0-.641-.113a1.5 1.5 0 0 1-.574-.362l-1.553-1.426a62 62 0 0 1-4.308-4.356Q3 11.58 3 8.979q0-2.127 1.418-3.553Q5.835 4 7.95 4q1.193 0 2.25.51 1.058.509 1.8 1.391a5.4 5.4 0 0 1 1.8-1.392A5.1 5.1 0 0 1 16.05 4q2.115 0 3.532 1.426Q21 6.852 21 8.979q0 2.603-1.913 4.775a54 54 0 0 1-4.342 4.368l-1.53 1.403a1.5 1.5 0 0 1-.574.362A2 2 0 0 1 12 20"})})});e.s(["default",0,r],191989),e.s(["HeartIcon",0,r],709637)},661049,e=>{"use strict";var t=e.i(673157);e.s(["default",0,e=>(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"
3currentColor",...e,children:(0,t.jsx)("g",{children:(0,t.jsx)("path",{d:"M12 20q-.315 0-.641-.113a1.5 1.5 0 0 1-.574-.362l-1.553-1.426a62 62 0 0 1-4.308-4.356Q3 11.58 3 8.979q0-2.127 1.418-3.553Q5.835 4 7.95 4q1.193 0 2.25.51 1.058.509 1.8 1.391a5.4 5.4 0 0 1 1.8-1.392A5.1 5.1 0 0 1 16.05 4q2.115 0 3.532 1.426Q21 6.852 21 8.979q0 2.603-1.913 4.775a54 54 0 0 1-4.342 4.368l-1.53 1.403a1.5 1.5 0 0 1-.574.362A2 2 0 0 1 12 20m-.855-12.289q-.652-.928-1.395-1.414-.742-.487-1.8-.487-1.35 0-2.25.906-.9.905-.9 2.263 0 1.177.833 2.5a17.3 17.3 0 0 0 1.99 2.57q1.16 1.244 2.386 2.33T12 18.167q.765-.702 1.991-1.788a35 35 0 0 0 2.385-2.33 17.3 17.3 0 0 0 1.991-2.57q.833-1.323.833-2.5 0-1.358-.9-2.263-.9-.906-2.25-.906-1.058 0-1.8.487t-1.395 1.414a1.03 1.03 0 0 1-.855.453q-.247 0-.473-.113a1 1 0 0 1-.382-.34"})})})])},280204,e=>{"use strict";var t=e.i(661049);e.s(["HeartOutlineIcon",()=>t.default])},53204,e=>{"use strict";var t=e.i(673157);e.s(["default",0,e=>(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:(0,t.jsx)("g",{children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M2.263 2.264A.91.91 0 0 1 3.479 2.2l.069.063 2.294 2.294c1.705-.711 3.85-1.121 6.151-1.121 2.305 0 4.453.412 6.16 1.125l2.293-2.293.069-.063a.91.91 0 0 1 1.279 1.28l-.063.068-1.904 1.903c1.26.86 2.171 2.03 2.171 3.465q-.002.198-.024.39a1 1 0 0 1 .024.204v7.313c0 1.794-1.42 3.173-3.166 4.05-1.798.904-4.218 1.435-6.839 1.435s-5.041-.534-6.839-1.439c-1.744-.878-3.166-2.257-3.166-4.046V9.516a1 1 0 0 1 .024-.204 3 3 0 0 1-.024-.39c0-1.437.915-2.609 2.178-3.47L2.263 3.55 2.2 3.481a.91.91 0 0 1 .063-1.217m6.15 17.838c.82.19 1.717.319 2.669.369v-6.087a18 18 0 0 1-2.67-.327zm7.173-6.048a18 18 0 0 1-2.686.33v6.087c.958-.05 1.861-.179 2.686-.37zm-11.78 2.775c0 .734.617 1.643 2.166 2.422q.295.15.622.282V13.57a11.5 11.5 0 0 1-1.44-.599 8.3 8.3 0 0 1-1.347-.842zm16.375-4.7c-.41.316-.865.599-1.347.841q-.663.333-1.43.595v5.967q.321-.132.612-.278c1.547-.777 2.165-1.685 2.165-2.425zm-8.188-6.874c-1.778 0-3.407.27-4.74.715l3.585 3.584.062.068a.91.91 0 0 1-1.279 1.28l-.068-.063L5.48 6.767c-1.189.713-1.673 1.502-1.673 2.155 0 .737.616 1.645 2.163 2.423 1.494.752 3.623 1.243 6.023 1.243s4.53-.491 6.024-1.243c1.547-.778 2.163-1.686 2.164-2.423 0-.652-.484-1.438-1.668-2.15l-4.067 4.067a.909.909 0 1 1-1.285-1.285l3.58-3.581c-1.334-.447-2.966-.718-4.748-.718",clipRule:"evenodd"})})})])},25283,e=>{"use strict";var t=e.i(673157);e.s(["default",0,e=>(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:(0,t.jsx)("g",{children:(0,t.jsx)("path",{d:"M2 11q0-2.925 2.037-4.962T9 4h6q2.925 0 4.962 2.037T22 11q0 2.575-1.65 4.525t-4.2 2.375a.98.98 0 0 1-.8-.2.85.85 0 0 1-.35-.7q0-.425.338-.725.337-.3.787-.4 1.725-.4 2.8-1.762A4.9 4.9 0 0 0 20 11q0-2.075-1.462-3.537Q17.074 6 15 6H9Q6.925 6 5.463 7.463 4 8.925 4 11t1.463 3.537T9 16h.175l-.9-.9A.93.93 0 0 1 8 14.413q0-.414.3-.713a.95.95 0 0 1 .7-.275q.425 0 .7.275l2.6 2.6q.3.3.3.7t-.3.7l-2.6 2.6a.93.93 0 0 1-.687.275q-.413 0-.713-.275-.3-.3-.3-.713 0-.412.3-.712L9.175 18H9q-2.925 0-4.962-2.037T2 11"})})})])},18150,e=>{"use strict";var t=e.i(673157);e.s(["default",0,e=>(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:(0,t.jsx)("g",{children:(0,t.jsx)("path",{d:"M5.723 6.81a.857.857 0 0 1 1.084-1.084L17.43 9.259c.765.255.787 1.33.033 1.615l-3.02 1.146 3.55 3.556q.156.172.242.38.087.205.086.435 0 .228-.085.443a1 1 0 0 1-.258.371l-.8.786a.93.93 0 0 1-.371.25 1.24 1.24 0 0 1-.865 0 1.1 1.1 0 0 1-.378-.25l-3.547-3.546-1.147 3.022c-.286.754-1.36.731-1.615-.034z"})})})])},430806,e=>{"use strict";var t=e.i(673157);e.s(["default",0,e=>(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:(0,t.jsx)("g",{children:(0,t.jsx)("path",{d:"M19.031 16.969q0 .617-.32.914a1.03 1.03 0 0 1-.742.305q-.39 0-.766-.22l-8.32-4.843q-.46-.265-.68-.516a.93.93 0 0 1-.21-.609q0-.351.21-.602.22-.257.68-.523l8.32-4.844q.375-.218.766-.218.43 0 .742.304.32.297.32.906zm-12.11 1.18H5.087q-.555 0-.836-.282t-.281-.844V6.97q0-.57.281-.844.281-.28.836-.281h1.836q.546 0 .828.289.29.28.29.836v10.054q0 .563-.282.844t-.836.281"})})})])},681575,e=>{"use strict";var t=e.i(673157);e.s(["default",0,e=>(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"
3currentColor",...e,children:(0,t.jsx)("g",{children:(0,t.jsx)("path",{d:"M12 21q-3.45 0-6.012-2.288Q3.424 16.426 3.05 13H5.1q.35 2.6 2.313 4.3Q9.375 19 12 19q2.925 0 4.962-2.038T19 12t-2.038-4.962T12 5a6.75 6.75 0 0 0-3.225.8A7.4 7.4 0 0 0 6.25 8H9v2H3V4h2v2.35a8.7 8.7 0 0 1 3.113-2.475A8.9 8.9 0 0 1 12 3q1.874 0 3.512.712a9.2 9.2 0 0 1 2.85 1.926 9.2 9.2 0 0 1 1.926 2.85A8.7 8.7 0 0 1 21 12q0 1.874-.712 3.512a9.2 9.2 0 0 1-1.925 2.85 9.2 9.2 0 0 1-2.85 1.926A8.7 8.7 0 0 1 12 21m2.8-4.8L11 12.4V7h2v4.6l3.2 3.2z"})})})])},69758,e=>{"use strict";var t=e.i(673157);e.s(["default",0,e=>(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:(0,t.jsx)("g",{children:(0,t.jsx)("path",{d:"M12 16H3.37C2.61 16 2 15.39 2 14.63V7c0-.55.45-1 1-1h15.63c.76 0 1.37.61 1.37 1.37V9h-1.63v-.7c0-.12 0-.3-.27-.3H4.52c-.29 0-.52.23-.52.52v4.95c0 .29.23.52.52.52H12c.55 0 1 .45 1 1s-.45 1-1 1zm3.7-.1 1.4-1.4-1.4-1.4a.984.984 0 0 1 0-1.4.984.984 0 0 1 1.4 0l1.4 1.4 1.4-1.4a.984.984 0 0 1 1.4 0c.38.39.39 1.01 0 1.4l-1.38 1.4 1.38 1.4c.38.39.38 1.01 0 1.4s-1.01.4-1.4.01l-1.4-1.38-1.4 1.38c-.39.38-1.01.38-1.4 0a.984.984 0 0 1 0-1.4z"})})})])},335239,e=>{"use strict";var t=e.i(673157),r=e.i(740851),n=e.i(249892),a=e.i(18436);e.i(462951);var o=e.i(646984);e.i(248949);var i=e.i(325775),s=e.i(32806),u=e.i(157348);class l extends a.ErrorBoundary{static getDerivedStateFromError(e){return(0,r.unstable_rethrow)(e),a.ErrorBoundary.getDerivedStateFromError(e)}}function c({resetErrorBoundary:e}){let t=(0,r.useSearchParams)().toString(),a=(0,n.useRef)(t);return(0,n.useEffect)(()=>{t!==a.current&&e()},[e,t]),null}function d({error:e,resetErrorBoundary:r}){return e instanceof i.NamespaceLoadError?(0,t.jsx)(f,{error:e,resetErrorBoundary:r}):(0,t.jsx)(h,{isRetrying:!1,resetErrorBoundary:r,retry:r})}function f({error:e,resetErrorBoundary:r}){let{i18n:n}=(0,o.useTranslation)("common"),a=(0,u.useNamespaceLoadRecovery)({error:e,instance:n,resetErrorBoundary:r});return(0,t.jsx)(h,{isRetrying:a.isRetrying,resetErrorBoundary:r,retry:a.retry})}function h({isRetrying:e,resetErrorBoundary:r,retry:a}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.Suspense,{fallback:null,children:(0,t.jsx)(c,{resetErrorBoundary:r})}),(0,t.jsx)(u.ContentUnavailableRetryView,{isRetrying:e,retry:a})]})}function p(e,t){e instanceof i.NamespaceLoadError||(0,s.reportClientBoundaryError)({error:e,source:"route-content-boundary",nonRecoverableLevel:"error",extra:{componentStack:t.componentStack}})}e.s(["RouteContentBoundary",0,function({children:e}){let n=(0,r.usePathname)();return(0,t.jsx)(l,{FallbackComponent:d,onError:p,resetKeys:[n],children:e})}])},349526,e=>{"use strict";var t=e.i(206274);let r="suno_session_recoverable";e.s(["clearSessionRecoveryCookie",0,function(){(0,t.writeDocumentCookie)(`${r}=; Path=/; Max-Age=0; SameSite=Lax`)},"setSessionRecoveryCookie",0,function(){let e="https:"===window.location.protocol?"; Secure":"";(0,t.writeDocumentCookie)(`${r}=1; Path=/; Max-Age=31536000; SameSite=Lax${e}`)}])},459381,e=>{"use strict";var t=e.i(810789),r=e.i(47529);let n=()=>{try{return(0,r.normalizeViewRoute)(window.location.pathname)}catch{return"unknown"}},a="challenges.cloudflare.com",o=()=>{let e={};try{let t=navigator.connection;t&&("string"==typeof t.effectiveType&&(e.effective_type=t.effectiveType),"number"==typeof t.downlink&&(e.downlink=t.downlink),"number"==typeof t.rtt&&(e.rtt=t.rtt),"boolean"==typeof t.saveData&&(e.save_data=t.saveData))}catch{}try{e.visibility=document.visibilityState}catch{}try{e.cross_origin_isolated=window.crossOriginIsolated}catch{}return e},i=()=>{try{let e=window.performance;if(!e?.getEntriesByType)return[];let t=e.getEntriesByType("resource"),r=e=>Math.max(0,Math.round(e));return t.filter(e=>(e=>{try{let{hostname:t}=new URL(e);return t===a||t.endsWith(`.${a}`)}catch{return!1}})(e.name)).slice(-10).map(e=>{let t=e.responseStart>0,n={name:e.name,initiator_type:e.initiatorType,start_time:r(e.startTime),duration:r(e.duration),transfer_size:e.transferSize??0,timing_allowed:t};return t?{...n,dns:r(e.domainLookupEnd-e.domainLookupStart),connect:r(e.connectEnd-e.connectStart),tls:e.secureConnectionStart>0?r(e.connectEnd-e.secureConnectionStart):0,ttfb:r(e.responseStart-e.requestStart),response:r(e.responseEnd-e.responseStart)}:n})}catch{return[]}},s=t=>{let r=o();(async()=>{try{let{datadogRum:n}=await e.A(374300);n.addAction("turnstile.generation.outcome",{...t,...r})}catch{}})()};e.s(["captchaFlow",0,n,"emitTurnstileMetric",0,s,"reportCaptchaMountFailure",0,e=>{let{reason:r,isTurnstile:a,isPaid:u,userId:l,clerkId:c}=e,d=n(),f=l||c||void 0,h=o(),p=i();try{t.captureMessage("Generation captcha required but no widget mounted before deadline",{level:"warning",tags:{component:a?"generation_turnstile":"generation_hcaptcha",provider:a?"turnstile":"hcaptcha",reason:r,flow:d,interactive:"false",...f?{turnstile_user_id:f}:{},...h.effective_type?{network_effective_type:h.effective_type}:{},...h.visibility?{tab_visibility:h.visibility}:{},...void 0!==h.cross_origin_isolated?{cross_origin_isolated:h.cross_origin_isolated?"true":"false"}:{}},user:l?{id:l}:void 0,extra:{reason:r,flow:d,clerkId:c,is_paid:u,is_turnstile:a,interactive:!1,network_downlink:h.downlink,network_rtt:h.rtt,save_data:h.save_data,cf_resource_timings:p,cf_resource_count:p.length}})}catch{}a&&s({outcome:"no_token",reason:r,is_paid:u,flow:d,interactive:!1})},"reportCaptchaProviderFallback",0,t=>{let r=o();(async()=>{try{let{datadogRum:a}=await e.A(374300);a.addAction("captcha.provider_fallback.client",{recovered:t.recovered,relatched:t.relatched,is_paid:t.isPaid,flow:n(),...r})}catch{}})()},"reportCaptchaVerificationHang",0,e=>{let{isTurnstile:r,userId:n,clerkId:a}=e,s=n||a||void 0,u=o(),l=i();try{t.captureMessage(`Captcha verification not complete after 30 seconds. window.crossOriginIsolated is ${window.crossOriginIsolated}.`,{level:"warning",tags:{component:"generation_captcha_diagnostic",provider:r?"turnstile":"hcaptcha",reason:"verification_hang",...s?{turnstile_user_id:s}:{},...u.effective_type?{network_effective_type:u.effective_type}:{},...u.visibility?{tab_visibility:u.visibility}:{},...void 0!==u.cross_origin_isolated?{cross_origin_isolated:u.cross_origin_isolated?"true":"false"}:{}},user:n?{id:n}:void 0,extra:{network_downlink:u.downlink,network_rtt:u.rtt,save_data:u.save_data,cf_resource_timings:l,cf_resource_count:l.length}})}catch{}},"reportStemCaptchaRetry",0,t=>{(async()=>{try{let{datadogRum:r}=await e.A(374300);r.addAction("stem_extraction.captcha_retry",{recovered:t.recovered,is_paid:t.isPaid,flow:n()})}catch{}})()},"reportTurnstileFailure",0,(e,r)=>{let{reason:n,blocked:a,isPaid:u,userId:l,clerkId:c,flow:d,interactive:f,extra:h}=r,p="string"==typeof h?.errorCode?h.errorCode:void 0,m=l||c||void 0,g=o(),y=i();try{t.captureMessage(e,{level:"warning",tags:{component:"generation_turnstile",reason:n,flow:d,interactive:f?"true":"false",...m?{turnstile_user_id:m}:{},...p?{turnstile_error_code:p}:{},...g.effective_type?{network_effective_type:g.effective_type}:{},...g.visibility?{tab_visibility:g.visibility}:{},...void 0!==g.cross_origin_isolated?{cross_origin_isolated:g.cross_origin_isolated?"true":"false"}:{}},user:l?{id:l}:void 0,extra:{...h,reason:n,blocked:a,is_paid:u,flow:d,interactive:f,clerkId:c,network_downlink:g.downlink,network_rtt:g.rtt,save_data:g.save_data,cf_resource_timings:y,cf_resource_count:y.length}})}catch{}a&&s({outcome:"no_token",reason:n,is_paid:u,flow:d,interactive:f})}])},104886,e=>{"use strict";e.s(["default",0,e=>{let t=new AudioBuffer({sampleRate:e.sampleRate,length:e.length,numberOfChannels:e.numberOfChannels}),r=0;for(let t=0;t<e.numberOfChannels;t++){let n=e.getChannelData(t);for(let e=0;e<n.length;e++)r=Math.max(r,Math.abs(n[e]))}for(let n=0;n<e.numberOfChannels;n++){let a=e.getChannelData(n),o=t.getChannelData(n);for(let e=0;e<a.length;e++)o[e]=a[e]/r}return t}])},756834,e=>{"use strict";var t=e.i(613335),r=e.i(725516),n=e.i(379694);let a="suno_poe",o="suno_poe";function i(e){try{let t,r,n=e.split(".");if(3!==n.length)return null;return JSON.parse(((r=(t=n[1].replace(/-/g,"+").replace(/_/g,"/")).length%4)&&(t+="=".repeat(4-r)),atob(t)))}catch{return null}}let s=null,u=null;function l(e){s=e;let r=i(e),u=r?.exp,l=new Date(u?1e3*u:Date.now()+36e5);n.safeLocalStorage.setItem(o,e),t.default.set(a,e,{path:"/",expires:l,sameSite:"lax"})}function c(){s=null,u=null,n.safeLocalStorage.removeItem(o),t.default.remove(a,{path:"/"}),window.location.href=r.PageRoutes.LoggedInHome}e.s(["IMPERSONATION_TOKEN_LOCALSTORAGE",0,o,"clearImpersonationToken",0,c,"decodeJwtPayload",0,i,"getImpersonationState",0,function(){return u},"getImpersonationToken",0,function(){return s},"initializeImpersonationFromStorage",0,function(){let e=[n.safeLocalStorage.getItem(o),t.default.get(a)??null];for(let t of e){if(!t)continue;let e=i(t);if(!e)continue;let r=e.exp;if(!(r&&Date.now()/1e3>=r))return l(t),!0}return e.some(e=>null!=e)&&c(),!1},"isImpersonating",0,function(){return u?.isImpersonating??!1},"setImpersonationState",0,function(e){u=e},"storeImpersonationToken",0,l])},976250,e=>{"use strict";let t=new Map;e.s(["default",0,({ctx:e,channelData:r,topPadding:n=0,inverse:a=!1,normalize:o=!0,enableCache:i=!0,useLineVariant:s=!1,pxPerPoint:u,overReadSamples:l=256})=>{let c=e.canvas,d=(c.height-n)/2,f=void 0!==u?u:s?10:2,h=[],p=[],m=t.get(r)?.get(c.width);if(!m||!i){let e=1;if(o){let t=0;for(let e=0;e<r.length;e++)t=Math.max(t,Math.abs(r[e]));e=t?1/t:0}let n=[],a=[];for(let t=0;t<c.width;t+=f){let o=Math.floor(Math.max(0,t/(c.width-1)*r.length-l/2)),i=Math.floor(Math.min((t+f)/(c.width-1)*r.length+l/2,r.length-1)),s=-1/0,u=1/0;for(let e=o;e<=i;e++)s=Math.max(s,r[e]),u=Math.min(u,r[e]);n.push(s*e),a.push(u*e)}if(h=n,p=a,i){let e=t.get(r);e||(e=new Map),e.set(c.width,{tops:n,bottoms:a}),t.set(r,e)}}m&&(h=m.tops,p=m.bottoms),s||(a?(e.moveTo(0,0),e.lineTo(0,-(h[0]*d)+d+n)):e.moveTo(0,-(h[0]*d)+d+n)),s&&(e.strokeStyle="#666",e.lineWidth=3,e.lineCap="round");let g=0;for(let t=f;t<c.width;t+=f){let r=(h[t/f]+h[Math.max(0,(t-f)/f)]+h[Math.min(h.length-1,(t+f)/f)])/3;if(s){let a=(p[t/f]+p[Math.max(0,(t-f)/f)]+p[Math.min(p.length-1,(t+f)/f)])/3;e.moveTo(t,-(r*d)+d+n-1),e.lineTo(t,-(a*d)+d+n+1)}else e.lineTo(t,-(r*d)+d+n-1);g=t}if(s)e.stroke();else if(e.lineTo(c.width,d+n),a){e.lineTo(c.width,0),e.lineTo(0,0),e.moveTo(0,c.height),e.lineTo(0,-(p[0]*d)+d+n);for(let t=f;t<c.width;t++){let r=(p[t/f]+p[Math.max(0,(t-f)/f)]+p[Math.min(p.length-1,(t+f)/f)])/3;e.lineTo(t,-(r*d)+d+n+1),g=t}e.lineTo(c.width,d+n),e.lineTo(c.width,c.height),e.lineTo(0,c.height)}else{e.lineTo(c.width,d+n);for(let t=g;t>=0;t--){let r=(p[t/f]+p[Math.max(0,(t-f)/f)]+p[Math.min(p.length-1,(t+f)/f)])/3;e.lineTo(t,-(r*d)+d+n+1)}e.lineTo(0,h[0]*d+d+n)}}])},844911,e=>{"use strict";e.s(["isValidEmail",0,function(e){return/^[^\s@]+@[^\s.@]+(?:\.[^\s.@]+)+$/.test(e)}])}]);
4
5//# sourceMappingURL=2crjf673pzbne.js.map
6//# debugId=3c9fca7b-5ac5-5c22-9e74-e4a4c48926b4

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.