Spaces:
Running
Running
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[639,931],{4875:function(e,t){var n;/*! | |
Copyright (c) 2018 Jed Watson. | |
Licensed under the MIT License (MIT), see | |
http://jedwatson.github.io/classnames | |
*/!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var o=i.apply(null,n);o&&e.push(o)}}else if("object"===a){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var s in n)r.call(n,s)&&n[s]&&e.push(s)}}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0!==(n=(function(){return i}).apply(t,[]))&&(e.exports=n)}()},7280:function(e,t,n){var r,i;void 0!==(r="function"==typeof(i=function(){var e={172351395:{name:"EBML",type:"Container"},646:{name:"EBMLVersion",type:"Uint"},759:{name:"EBMLReadVersion",type:"Uint"},754:{name:"EBMLMaxIDLength",type:"Uint"},755:{name:"EBMLMaxSizeLength",type:"Uint"},642:{name:"DocType",type:"String"},647:{name:"DocTypeVersion",type:"Uint"},645:{name:"DocTypeReadVersion",type:"Uint"},108:{name:"Void",type:"Binary"},63:{name:"CRC-32",type:"Binary"},190023271:{name:"SignatureSlot",type:"Container"},16010:{name:"SignatureAlgo",type:"Uint"},16026:{name:"SignatureHash",type:"Uint"},16037:{name:"SignaturePublicKey",type:"Binary"},16053:{name:"Signature",type:"Binary"},15963:{name:"SignatureElements",type:"Container"},15995:{name:"SignatureElementList",type:"Container"},9522:{name:"SignedElement",type:"Binary"},139690087:{name:"Segment",type:"Container"},21863284:{name:"SeekHead",type:"Container"},3515:{name:"Seek",type:"Container"},5035:{name:"SeekID",type:"Binary"},5036:{name:"SeekPosition",type:"Uint"},88713574:{name:"Info",type:"Container"},13220:{name:"SegmentUID",type:"Binary"},13188:{name:"SegmentFilename",type:"String"},1882403:{name:"PrevUID",type:"Binary"},1868715:{name:"PrevFilename",type:"String"},2013475:{name:"NextUID",type:"Binary"},1999803:{name:"NextFilename",type:"String"},1092:{name:"SegmentFamily",type:"Binary"},10532:{name:"ChapterTranslate",type:"Container"},10748:{name:"ChapterTranslateEditionUID",type:"Uint"},10687:{name:"ChapterTranslateCodec",type:"Uint"},10661:{name:"ChapterTranslateID",type:"Binary"},710577:{name:"TimecodeScale",type:"Uint"},1161:{name:"Duration",type:"Float"},1121:{name:"DateUTC",type:"Date"},15273:{name:"Title",type:"String"},3456:{name:"MuxingApp",type:"String"},5953:{name:"WritingApp",type:"String"},103:{name:"Timecode",type:"Uint"},6228:{name:"SilentTracks",type:"Container"},6359:{name:"SilentTrackNumber",type:"Uint"},39:{name:"Position",type:"Uint"},43:{name:"PrevSize",type:"Uint"},35:{name:"SimpleBlock",type:"Binary"},32:{name:"BlockGroup",type:"Container"},33:{name:"Block",type:"Binary"},34:{name:"BlockVirtual",type:"Binary"},13729:{name:"BlockAdditions",type:"Container"},38:{name:"BlockMore",type:"Container"},110:{name:"BlockAddID",type:"Uint"},37:{name:"BlockAdditional",type:"Binary"},27:{name:"BlockDuration",type:"Uint"},122:{name:"ReferencePriority",type:"Uint"},123:{name:"ReferenceBlock",type:"Int"},125:{name:"ReferenceVirtual",type:"Int"},36:{name:"CodecState",type:"Binary"},13730:{name:"DiscardPadding",type:"Int"},14:{name:"Slices",type:"Container"},104:{name:"TimeSlice",type:"Container"},76:{name:"LaceNumber",type:"Uint"},77:{name:"FrameNumber",type:"Uint"},75:{name:"BlockAdditionID",type:"Uint"},78:{name:"Delay",type:"Uint"},79:{name:"SliceDuration",type:"Uint"},72:{name:"ReferenceFrame",type:"Container"},73:{name:"ReferenceOffset",type:"Uint"},74:{name:"ReferenceTimeCode",type:"Uint"},47:{name:"EncryptedBlock",type:"Binary"},106212971:{name:"Tracks",type:"Container"},46:{name:"TrackEntry",type:"Container"},87:{name:"TrackNumber",type:"Uint"},13253:{name:"TrackUID",type:"Uint"},3:{name:"TrackType",type:"Uint"},57:{name:"FlagEnabled",type:"Uint"},8:{name:"FlagDefault",type:"Uint"},5546:{name:"FlagForced",type:"Uint"},28:{name:"FlagLacing",type:"Uint"},11751:{name:"MinCache",type:"Uint"},11768:{name:"MaxCache",type:"Uint"},254851:{name:"DefaultDuration",type:"Uint"},216698:{name:"DefaultDecodedFieldDuration",type:"Uint"},209231:{name:"TrackTimecodeScale",type:"Float"},4991:{name:"TrackOffset",type:"Int"},5614:{name:"MaxBlockAdditionID",type:"Uint"},4974:{name:"Name",type:"String"},177564:{name:"Language",type:"String"},6:{name:"CodecID",type:"String"},9122:{name:"CodecPrivate",type:"Binary"},362120:{name:"CodecName",type:"String"},13382:{name:"AttachmentLink",type:"Uint"},1742487:{name:"CodecSettings",type:"String"},1785920:{name:"CodecInfoURL",type:"String"},438848:{name:"CodecDownloadURL",type:"String"},42:{name:"CodecDecodeAll",type:"Uint"},12203:{name:"TrackOverlay",type:"Uint"},5802:{name:"CodecDelay",type:"Uint"},5819:{name:"SeekPreRoll",type:"Uint"},9764:{name:"TrackTranslate",type:"Container"},9980:{name:"TrackTranslateEditionUID",type:"Uint"},9919:{name:"TrackTranslateCodec",type:"Uint"},9893:{name:"TrackTranslateTrackID",type:"Binary"},96:{name:"Video",type:"Container"},26:{name:"FlagInterlaced",type:"Uint"},5048:{name:"StereoMode",type:"Uint"},5056:{name:"AlphaMode",type:"Uint"},5049:{name:"OldStereoMode",type:"Uint"},48:{name:"PixelWidth",type:"Uint"},58:{name:"PixelHeight",type:"Uint"},5290:{name:"PixelCropBottom",type:"Uint"},5307:{name:"PixelCropTop",type:"Uint"},5324:{name:"PixelCropLeft",type:"Uint"},5341:{name:"PixelCropRight",type:"Uint"},5296:{name:"DisplayWidth",type:"Uint"},5306:{name:"DisplayHeight",type:"Uint"},5298:{name:"DisplayUnit",type:"Uint"},5299:{name:"AspectRatioType",type:"Uint"},963876:{name:"ColourSpace",type:"Binary"},1029411:{name:"GammaValue",type:"Float"},230371:{name:"FrameRate",type:"Float"},97:{name:"Audio",type:"Container"},53:{name:"SamplingFrequency",type:"Float"},14517:{name:"OutputSamplingFrequency",type:"Float"},31:{name:"Channels",type:"Uint"},15739:{name:"ChannelPositions",type:"Binary"},8804:{name:"BitDepth",type:"Uint"},98:{name:"TrackOperation",type:"Container"},99:{name:"TrackCombinePlanes",type:"Container"},100:{name:"TrackPlane",type:"Container"},101:{name:"TrackPlaneUID",type:"Uint"},102:{name:"TrackPlaneType",type:"Uint"},105:{name:"TrackJoinBlocks",type:"Container"},109:{name:"TrackJoinUID",type:"Uint"},64:{name:"TrickTrackUID",type:"Uint"},65:{name:"TrickTrackSegmentUID",type:"Binary"},70:{name:"TrickTrackFlag",type:"Uint"},71:{name:"TrickMasterTrackUID",type:"Uint"},68:{name:"TrickMasterTrackSegmentUID",type:"Binary"},11648:{name:"ContentEncodings",type:"Container"},8768:{name:"ContentEncoding",type:"Container"},4145:{name:"ContentEncodingOrder",type:"Uint"},4146:{name:"ContentEncodingScope",type:"Uint"},4147:{name:"ContentEncodingType",type:"Uint"},4148:{name:"ContentCompression",type:"Container"},596:{name:"ContentCompAlgo",type:"Uint"},597:{name:"ContentCompSettings",type:"Binary"},4149:{name:"ContentEncryption",type:"Container"},2017:{name:"ContentEncAlgo",type:"Uint"},2018:{name:"ContentEncKeyID",type:"Binary"},2019:{name:"ContentSignature",type:"Binary"},2020:{name:"ContentSigKeyID",type:"Binary"},2021:{name:"ContentSigAlgo",type:"Uint"},2022:{name:"ContentSigHashAlgo",type:"Uint"},206814059:{name:"Cues",type:"Container"},59:{name:"CuePoint",type:"Container"},51:{name:"CueTime",type:"Uint"},55:{name:"CueTrackPositions",type:"Container"},119:{name:"CueTrack",type:"Uint"},113:{name:"CueClusterPosition",type:"Uint"},112:{name:"CueRelativePosition",type:"Uint"},50:{name:"CueDuration",type:"Uint"},4984:{name:"CueBlockNumber",type:"Uint"},106:{name:"CueCodecState",type:"Uint"},91:{name:"CueReference",type:"Container"},22:{name:"CueRefTime",type:"Uint"},23:{name:"CueRefCluster",type:"Uint"},4959:{name:"CueRefNumber",type:"Uint"},107:{name:"CueRefCodecState",type:"Uint"},155296873:{name:"Attachments",type:"Container"},8615:{name:"AttachedFile",type:"Container"},1662:{name:"FileDescription",type:"String"},1646:{name:"FileName",type:"String"},1632:{name:"FileMimeType",type:"String"},1628:{name:"FileData",type:"Binary"},1710:{name:"FileUID",type:"Uint"},1653:{name:"FileReferral",type:"Binary"},1633:{name:"FileUsedStartTime",type:"Uint"},1634:{name:"FileUsedEndTime",type:"Uint"},4433776:{name:"Chapters",type:"Container"},1465:{name:"EditionEntry",type:"Container"},1468:{name:"EditionUID",type:"Uint"},1469:{name:"EditionFlagHidden",type:"Uint"},1499:{name:"EditionFlagDefault",type:"Uint"},1501:{name:"EditionFlagOrdered",type:"Uint"},54:{name:"ChapterAtom",type:"Container"},13252:{name:"ChapterUID",type:"Uint"},5716:{name:"ChapterStringUID",type:"String"},17:{name:"ChapterTimeStart",type:"Uint"},18:{name:"ChapterTimeEnd",type:"Uint"},24:{name:"ChapterFlagHidden",type:"Uint"},1432:{name:"ChapterFlagEnabled",type:"Uint"},11879:{name:"ChapterSegmentUID",type:"Binary"},11964:{name:"ChapterSegmentEditionUID",type:"Uint"},9155:{name:"ChapterPhysicalEquiv",type:"Uint"},15:{name:"ChapterTrack",type:"Container"},9:{name:"ChapterTrackNumber",type:"Uint"},0:{name:"ChapterDisplay",type:"Container"},5:{name:"ChapString",type:"String"},892:{name:"ChapLanguage",type:"String"},894:{name:"ChapCountry",type:"String"},10564:{name:"ChapProcess",type:"Container"},10581:{name:"ChapProcessCodecID",type:"Uint"},1293:{name:"ChapProcessPrivate",type:"Binary"},10513:{name:"ChapProcessCommand",type:"Container"},10530:{name:"ChapProcessTime",type:"Uint"},10547:{name:"ChapProcessData",type:"Binary"},39109479:{name:"Tags",type:"Container"},13171:{name:"Tag",type:"Container"},9152:{name:"Targets",type:"Container"},10442:{name:"TargetTypeValue",type:"Uint"},9162:{name:"TargetType",type:"String"},9157:{name:"TagTrackUID",type:"Uint"},9161:{name:"TagEditionUID",type:"Uint"},9156:{name:"TagChapterUID",type:"Uint"},9158:{name:"TagAttachmentUID",type:"Uint"},10184:{name:"SimpleTag",type:"Container"},1443:{name:"TagName",type:"String"},1146:{name:"TagLanguage",type:"String"},1156:{name:"TagDefault",type:"Uint"},1159:{name:"TagString",type:"String"},1157:{name:"TagBinary",type:"Binary"}};function t(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e}function n(e,t){this.name=e||"Unknown",this.type=t||"Unknown"}function r(e,t){n.call(this,e,t||"Uint")}function i(e){return e.length%2==1?"0"+e:e}function a(e,t){n.call(this,e,t||"Float")}function o(e,t){n.call(this,e,t||"Container")}function s(e){o.call(this,"File","File"),this.setSource(e)}function l(e,t,n,r){if("object"==typeof n&&(r=n,n=void 0),!n)return new Promise(function(n){l(e,t,n,r)});try{var i=new FileReader;i.onloadend=function(){try{var a=new s(new Uint8Array(i.result));a.fixDuration(t,r)&&(e=a.toBlob(e.type))}catch(o){}n(e)},i.readAsArrayBuffer(e)}catch(a){n(e)}}return n.prototype.updateBySource=function(){},n.prototype.setSource=function(e){this.source=e,this.updateBySource()},n.prototype.updateByData=function(){},n.prototype.setData=function(e){this.data=e,this.updateByData()},t(r,n),r.prototype.updateBySource=function(){this.data="";for(var e=0;e<this.source.length;e++){var t=this.source[e].toString(16);this.data+=i(t)}},r.prototype.updateByData=function(){var e=this.data.length/2;this.source=new Uint8Array(e);for(var t=0;t<e;t++){var n=this.data.substr(2*t,2);this.source[t]=parseInt(n,16)}},r.prototype.getValue=function(){return parseInt(this.data,16)},r.prototype.setValue=function(e){this.setData(i(e.toString(16)))},t(a,n),a.prototype.getFloatArrayType=function(){return this.source&&4===this.source.length?Float32Array:Float64Array},a.prototype.updateBySource=function(){var e=this.source.reverse(),t=new(this.getFloatArrayType())(e.buffer);this.data=t[0]},a.prototype.updateByData=function(){var e=new(this.getFloatArrayType())([this.data]),t=new Uint8Array(e.buffer);this.source=t.reverse()},a.prototype.getValue=function(){return this.data},a.prototype.setValue=function(e){this.setData(e)},t(o,n),o.prototype.readByte=function(){return this.source[this.offset++]},o.prototype.readUint=function(){for(var e=this.readByte(),t=8-e.toString(2).length,n=e-(1<<7-t),r=0;r<t;r++)n*=256,n+=this.readByte();return n},o.prototype.updateBySource=function(){for(this.data=[],this.offset=0;this.offset<this.source.length;this.offset=s){var t=this.readUint(),i=this.readUint(),s=Math.min(this.offset+i,this.source.length),l=this.source.slice(this.offset,s),c=e[t]||{name:"Unknown",type:"Unknown"},u=n;switch(c.type){case"Container":u=o;break;case"Uint":u=r;break;case"Float":u=a}var d=new u(c.name,c.type);d.setSource(l),this.data.push({id:t,idHex:t.toString(16),data:d})}},o.prototype.writeUint=function(e,t){for(var n=1,r=128;e>=r&&n<8;n++,r*=128);if(!t)for(var i=r+e,a=n-1;a>=0;a--){var o=i%256;this.source[this.offset+a]=o,i=(i-o)/256}this.offset+=n},o.prototype.writeSections=function(e){this.offset=0;for(var t=0;t<this.data.length;t++){var n=this.data[t],r=n.data.source,i=r.length;this.writeUint(n.id,e),this.writeUint(i,e),e||this.source.set(r,this.offset),this.offset+=i}return this.offset},o.prototype.updateByData=function(){var e=this.writeSections("draft");this.source=new Uint8Array(e),this.writeSections()},o.prototype.getSectionById=function(e){for(var t=0;t<this.data.length;t++){var n=this.data[t];if(n.id===e)return n.data}return null},t(s,o),s.prototype.fixDuration=function(e,t){var n=t&&t.logger;void 0===n?n=function(e){console.log(e)}:n||(n=function(){});var r=this.getSectionById(139690087);if(!r)return n("[fix-webm-duration] Segment section is missing"),!1;var i=r.getSectionById(88713574);if(!i)return n("[fix-webm-duration] Info section is missing"),!1;var o=i.getSectionById(710577);if(!o)return n("[fix-webm-duration] TimecodeScale section is missing"),!1;var s=i.getSectionById(1161);if(s){if(!(0>=s.getValue()))return n("[fix-webm-duration] Duration section is present"),!1;n("[fix-webm-duration] Duration section is present, but the value is empty"),s.setValue(e)}else n("[fix-webm-duration] Duration section is missing"),(s=new a("Duration","Float")).setValue(e),i.data.push({id:1161,data:s});return o.setValue(1e6),i.updateByData(),r.updateByData(),this.updateByData(),!0},s.prototype.toBlob=function(e){return new Blob([this.source.buffer],{type:e||"video/webm"})},l.default=l,l})?i.call(t,n,t,e):i)&&(e.exports=r)},820:function(e,t,n){"use strict";var r,i;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(i=n.g.process)?void 0:i.env)?n.g.process:n(3488)},7632:function(e,t,n){"use strict";n.d(t,{ko:function(){return l.ko},tX:function(){return y},Fd:function(){return l.Fd},Sj:function(){return u}});var r=n(931),i=n(4499),a=n(9485),o=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{l(r.next(e))}catch(t){a(t)}}function s(e){try{l(r.throw(e))}catch(t){a(t)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(o,s)}l((r=r.apply(e,t||[])).next())})};class s{initSession(e,t){return o(this,void 0,void 0,function*(){return yield this.session.initSession(e,t)})}transcribe(e,t,n){return o(this,void 0,void 0,function*(){return null==this.session?a.x4.err(Error("Session not initialized")):n?this.session instanceof r.z?yield this.session.stream(e,t,n):yield this.session.stream(e,t,i.sj(n)):yield this.session.run(e)})}destroy(){null!==this.innerWorker&&(console.warn("Terminating worker"),this.innerWorker.terminate()),this.session=null}constructor(e,t){this.session=e,this.innerWorker=t||null}}var l=n(5453),c=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{l(r.next(e))}catch(t){a(t)}}function s(e){try{l(r.throw(e))}catch(t){a(t)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(o,s)}l((r=r.apply(e,t||[])).next())})};class u{loadModel(e,t,n){return c(this,void 0,void 0,function*(){let r=yield this.createSession(!0,e,n);return r.isErr?a.x4.err(r.error):(t(r.value),a.x4.ok(r.value))})}createSession(e,t,o){return c(this,void 0,void 0,function*(){if(e&&"undefined"!=typeof document){let l=new Worker(n.tu(new URL(n.p+n.u(931),n.b)),{type:void 0}),c=i.Ud(l),u=yield new c,d=yield u.initSession(t,i.sj(o)),[p,m]=d.repr;return"Err"===p?a.x4.err(Error("Session initialization failed: "+m.toString())):a.x4.ok(new s(u,l))}{let y=new r.z,f=yield y.initSession(t,o);return f.isErr?(console.error("Error initializing session: ",f),a.x4.err(f.error)):a.x4.ok(new s(y))}})}}var d=n(7280),p=n.n(d),m=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{l(r.next(e))}catch(t){a(t)}}function s(e){try{l(r.throw(e))}catch(t){a(t)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(o,s)}l((r=r.apply(e,t||[])).next())})};class y{static start(){return m(this,void 0,void 0,function*(){if(!navigator.mediaDevices)throw Error("Media device not available");let e=yield navigator.mediaDevices.getUserMedia({audio:!0}),t=new MediaRecorder(e,{mimeType:y.supportedMimes.find(e=>MediaRecorder.isTypeSupported(e))}),n=new y(t);return n.currentStream=e,t.addEventListener("dataavailable",e=>{n.audioChunks.push(e.data)}),t.start(),n.currentStart=Date.now(),n})}isRecording(){return null!==this.inner&&"recording"===this.inner.state}stop(){return m(this,void 0,void 0,function*(){if(!this.inner)throw Error("Please start the recorder first");let e=new Promise(e=>{this.inner.addEventListener("stop",()=>m(this,void 0,void 0,function*(){let t=Date.now()-this.currentStart,n=new Blob(this.audioChunks,{type:this.inner.mimeType});this.inner.mimeType.includes("webm")&&(n=yield p()(n,t,{logger:!1}));let r=yield n.arrayBuffer();e({blob:n,buffer:r})})),this.inner.stop(),this.currentStream.getTracks().forEach(e=>e.stop())});return e})}constructor(e){this.currentStart=null,this.currentStream=null,this.inner=null,this.audioChunks=[],this.inner=e}}y.supportedMimes=["audio/webm","audio/ogg"]},5453:function(e,t,n){"use strict";n.d(t,{Fd:function(){return o},Hn:function(){return s},ko:function(){return i}});var r,i,a=n(9485);(r=i||(i={})).WHISPER_TINY="tiny",r.WHISPER_BASE="base",r.WHISPER_SMALL="small",r.WHISPER_MEDIUM="medium",r.WHISPER_LARGE="large";let o=new Map([[i.WHISPER_TINY,51444634],[i.WHISPER_BASE,96834130],[i.WHISPER_SMALL,313018088],[i.WHISPER_MEDIUM,972263884],[i.WHISPER_LARGE,1954315876]]);class s{static fromDBModel(e,t){var n,r,i,o;return n=this,r=void 0,i=void 0,o=function*(){let n=yield t.getTokenizer(e.ID);if(n.isErr)return a.x4.err(n.error);let r=n.value.bytes;return a.x4.ok(new s(e.name,e.bytes,r))},new(i||(i=Promise))(function(e,t){function a(e){try{l(o.next(e))}catch(n){t(n)}}function s(e){try{l(o.throw(e))}catch(n){t(n)}}function l(t){var n;t.done?e(t.value):((n=t.value)instanceof i?n:new i(function(e){e(n)})).then(a,s)}l((o=o.apply(n,r||[])).next())})}constructor(e,t,n){this.name=e,this.data=t,this.tokenizer=n}}},931:function(e,t,n){"use strict";n.d(t,{z:function(){return c}});var r=n(8054),i=n(4499),a=n(9485),o=n(5453),s=n(4208),l=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{l(r.next(e))}catch(t){a(t)}}function s(e){try{l(r.throw(e))}catch(t){a(t)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(o,s)}l((r=r.apply(e,t||[])).next())})};class c{initSession(e,t){return l(this,void 0,void 0,function*(){if(this.whisperSession)return a.x4.err(Error("Session already initialized. Call `destroy()` first."));let n=yield this.loadModel(e,t);if(n.isErr)return a.x4.err(n.error);let i=n.value;yield r.ZP();let o=new r.hE,s=yield o.setModel(i.data).setTokenizer(i.tokenizer).build();return this.whisperSession=s,a.x4.ok(void 0)})}loadModel(e,t){return l(this,void 0,void 0,function*(){let n=yield s.Z.create(),r=yield n.getModel(e,t);if(r.isErr)return a.x4.err(Error("Failed to load model ".concat(e," with error: ").concat(r.error)));let i=r.value,l=yield o.Hn.fromDBModel(i,n);if(l.isErr)return a.x4.err(Error("Failed to transmute model ".concat(e," with error: ").concat(l.error)));let c=l.value;return a.x4.ok(c)})}run(e){return l(this,void 0,void 0,function*(){return this.whisperSession?a.x4.ok((yield this.whisperSession.run(e))):a.x4.err(Error("The session is not initialized. Call `initSession()` method first."))})}stream(e,t,n){return l(this,void 0,void 0,function*(){return this.whisperSession?a.x4.ok((yield this.whisperSession.stream(e,t,n))):a.x4.err(Error("The session is not initialized. Call `initSession()` method first."))})}}"undefined"!=typeof self&&i.Jj(c)},9172:function(e){e.exports={style:{fontFamily:"'__VT323_2a9463', '__VT323_Fallback_2a9463'",fontWeight:400,fontStyle:"normal"},className:"__className_2a9463"}},3488:function(e){!function(){var t={229:function(e){var t,n,r,i=e.exports={};function a(){throw Error("setTimeout has not been defined")}function o(){throw Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===a||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:a}catch(e){t=a}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(r){n=o}}();var l=[],c=!1,u=-1;function d(){c&&r&&(c=!1,r.length?l=r.concat(l):u=-1,l.length&&p())}function p(){if(!c){var e=s(d);c=!0;for(var t=l.length;t;){for(r=l,l=[];++u<t;)r&&r[u].run();u=-1,t=l.length}r=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(r){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function y(){}i.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new m(e,t)),1!==l.length||c||s(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(e){return[]},i.binding=function(e){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw Error("process.chdir is not supported")},i.umask=function(){return 0}}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var a=n[e]={exports:{}},o=!0;try{t[e](a,a.exports,r),o=!1}finally{o&&delete n[e]}return a.exports}r.ab="//";var i=r(229);e.exports=i}()},6980:function(e,t,n){e.exports=n(493)},5084:function(e,t,n){"use strict";n.d(t,{Z:function(){return P}});var r=n(959),i=n(422),a=n(4875),o=n.n(a),s=!1;if("undefined"!=typeof window){var l={get passive(){s=!0;return}};window.addEventListener("testPassive",null,l),window.removeEventListener("testPassive",null,l)}var c="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),u=[],d=!1,p=-1,m=void 0,y=void 0,f=function(e){return u.some(function(t){return!!(t.options.allowTouchMove&&t.options.allowTouchMove(e))})},h=function(e){var t=e||window.event;return!!f(t.target)||t.touches.length>1||(t.preventDefault&&t.preventDefault(),!1)},v=function(e){if(void 0===y){var t=!!e&&!0===e.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;t&&n>0&&(y=document.body.style.paddingRight,document.body.style.paddingRight=n+"px")}void 0===m&&(m=document.body.style.overflow,document.body.style.overflow="hidden")},g=function(){void 0!==y&&(document.body.style.paddingRight=y,y=void 0),void 0!==m&&(document.body.style.overflow=m,m=void 0)},b=function(e,t){var n=e.targetTouches[0].clientY-p;return!f(e.target)&&(t&&0===t.scrollTop&&n>0?h(e):t&&t.scrollHeight-t.scrollTop<=t.clientHeight&&n<0?h(e):(e.stopPropagation(),!0))},C=function(e,t){if(!e){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}!u.some(function(t){return t.targetElement===e})&&(u=[].concat(function(e){if(!Array.isArray(e))return Array.from(e);for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}(u),[{targetElement:e,options:t||{}}]),c?(e.ontouchstart=function(e){1===e.targetTouches.length&&(p=e.targetTouches[0].clientY)},e.ontouchmove=function(t){1===t.targetTouches.length&&b(t,e)},d||(document.addEventListener("touchmove",h,s?{passive:!1}:void 0),d=!0)):v(t))},S=function(e){if(!e){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}u=u.filter(function(t){return t.targetElement!==e}),c?(e.ontouchstart=null,e.ontouchmove=null,d&&0===u.length&&(document.removeEventListener("touchmove",h,s?{passive:!1}:void 0),d=!1)):u.length||g()};function w(){return(w=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n(820);var E=function(e){var t=e.classes,n=e.classNames,i=e.styles,a=e.id,s=e.closeIcon,l=e.onClick;return r.createElement("button",{id:a,className:o()(t.closeButton,null==n?void 0:n.closeButton),style:null==i?void 0:i.closeButton,onClick:l,"data-testid":"close-button"},s||r.createElement("svg",{className:null==n?void 0:n.closeIcon,style:null==i?void 0:i.closeIcon,width:28,height:28,viewBox:"0 0 36 36","data-testid":"close-icon"},r.createElement("path",{d:"M28.5 9.62L26.38 7.5 18 15.88 9.62 7.5 7.5 9.62 15.88 18 7.5 26.38l2.12 2.12L18 20.12l8.38 8.38 2.12-2.12L20.12 18z"})))},U="undefined"!=typeof window,T=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'];function k(e){for(var t=document.activeElement,n=e.querySelectorAll(T.join(",")),r=[],i=0;i<n.length;i++){var a=n[i];(t===a||!a.disabled&&function(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?e.getAttribute("contentEditable")?0:e.tabIndex:t}(a)>-1&&!(null===a.offsetParent||"hidden"===getComputedStyle(a).visibility)&&function(e){if("INPUT"!==e.tagName||"radio"!==e.type||!e.name)return!0;var t=(e.form||e.ownerDocument).querySelectorAll('input[type="radio"][name="'+e.name+'"]'),n=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return n===e||void 0===n&&t[0]===e}(a))&&r.push(a)}return r}var x=function(e){var t=e.container,n=e.initialFocusRef,i=(0,r.useRef)();return(0,r.useEffect)(function(){var e=function(e){(null==t?void 0:t.current)&&function(e,t){if(e&&"Tab"===e.key&&t&&t.contains&&t.contains(e.target)){var n=k(t),r=n[0],i=n[n.length-1];e.shiftKey&&e.target===r?(i.focus(),e.preventDefault()):e.shiftKey||e.target!==i||(r.focus(),e.preventDefault())}}(e,t.current)};if(U&&document.addEventListener("keydown",e),U&&(null==t?void 0:t.current)){var r=function(){-1!==T.findIndex(function(e){var t;return null==(t=document.activeElement)?void 0:t.matches(e)})&&(i.current=document.activeElement)};if(n)r(),requestAnimationFrame(function(){var e;null==(e=n.current)||e.focus()});else{var a=k(t.current);a[0]&&(r(),a[0].focus())}}return function(){if(U){var t;document.removeEventListener("keydown",e),null==(t=i.current)||t.focus()}}},[t,n]),null},D=[],B={add:function(e){D.push(e)},remove:function(e){D=D.filter(function(t){return t!==e})},isTopModal:function(e){return!!D.length&&D[D.length-1]===e}},I=function(e,t,n,i,a){var o=(0,r.useRef)(null);(0,r.useEffect)(function(){return t&&e.current&&i&&(o.current=e.current,C(e.current,{reserveScrollBarGap:a})),function(){o.current&&(S(o.current),o.current=null)}},[t,n,e,i,a])},A={root:"react-responsive-modal-root",overlay:"react-responsive-modal-overlay",overlayAnimationIn:"react-responsive-modal-overlay-in",overlayAnimationOut:"react-responsive-modal-overlay-out",modalContainer:"react-responsive-modal-container",modalContainerCenter:"react-responsive-modal-containerCenter",modal:"react-responsive-modal-modal",modalAnimationIn:"react-responsive-modal-modal-in",modalAnimationOut:"react-responsive-modal-modal-out",closeButton:"react-responsive-modal-closeButton"},P=r.forwardRef(function(e,t){var n,a,s,l,c=e.open,u=e.center,d=e.blockScroll,p=e.closeOnEsc,m=void 0===p||p,y=e.closeOnOverlayClick,f=void 0===y||y,h=e.container,v=e.showCloseIcon,g=e.closeIconId,b=e.closeIcon,C=e.focusTrapped,S=e.initialFocusRef,T=e.animationDuration,k=void 0===T?300:T,D=e.classNames,P=e.styles,F=e.role,R=e.ariaDescribedby,M=e.ariaLabelledby,L=e.containerId,N=e.modalId,O=e.onClose,j=e.onEscKeyDown,z=e.onOverlayClick,H=e.onAnimationEnd,_=e.children,W=e.reserveScrollBarGap,V=function(e,t={isStateful:!0}){let n=function(e=null){let[t,n]=r.useState(e),{current:i}=r.useRef({current:t});return Object.defineProperty(i,"current",{get:()=>t,set:e=>{Object.is(t,e)||(t=e,n(e))}}),i}(null),i=(0,r.useRef)(null),a=t.isStateful?n:i;return r.useEffect(()=>{e&&("function"==typeof e?e(a.current):e.current=a.current)}),a}(t),$=(0,r.useRef)(null),G=(0,r.useRef)(null),q=(0,r.useRef)(null);null===q.current&&U&&(q.current=document.createElement("div"));var Y=(0,r.useState)(!1),K=Y[0],Z=Y[1];(0,r.useEffect)(function(){return c&&B.add($),function(){B.remove($)}},[c,$]),I($,c,K,void 0===d||d,W);var J=function(){!q.current||h||document.body.contains(q.current)||document.body.appendChild(q.current),document.addEventListener("keydown",Q)},X=function(){q.current&&!h&&document.body.contains(q.current)&&document.body.removeChild(q.current),document.removeEventListener("keydown",Q)},Q=function(e){27===e.keyCode&&B.isTopModal($)&&(null==j||j(e),m&&O())};(0,r.useEffect)(function(){return function(){K&&X()}},[K]),(0,r.useEffect)(function(){c&&!K&&(Z(!0),J())},[c]);var ee=function(){G.current=!1},et=h||q.current,en=c?null!=(n=null==D?void 0:D.overlayAnimationIn)?n:A.overlayAnimationIn:null!=(a=null==D?void 0:D.overlayAnimationOut)?a:A.overlayAnimationOut,er=c?null!=(s=null==D?void 0:D.modalAnimationIn)?s:A.modalAnimationIn:null!=(l=null==D?void 0:D.modalAnimationOut)?l:A.modalAnimationOut;return K&&et?i.createPortal(r.createElement("div",{className:o()(A.root,null==D?void 0:D.root),style:null==P?void 0:P.root,"data-testid":"root"},r.createElement("div",{className:o()(A.overlay,null==D?void 0:D.overlay),"data-testid":"overlay","aria-hidden":!0,style:w({animation:en+" "+k+"ms"},null==P?void 0:P.overlay)}),r.createElement("div",{ref:$,id:L,className:o()(A.modalContainer,u&&A.modalContainerCenter,null==D?void 0:D.modalContainer),style:null==P?void 0:P.modalContainer,"data-testid":"modal-container",onClick:function(e){if(null===G.current&&(G.current=!0),!G.current){G.current=null;return}null==z||z(e),f&&O(),G.current=null}},r.createElement("div",{ref:V,className:o()(A.modal,null==D?void 0:D.modal),style:w({animation:er+" "+k+"ms"},null==P?void 0:P.modal),onMouseDown:ee,onMouseUp:ee,onClick:ee,onAnimationEnd:function(){c||Z(!1),null==H||H()},id:N,role:void 0===F?"dialog":F,"aria-modal":"true","aria-labelledby":M,"aria-describedby":R,"data-testid":"modal",tabIndex:-1},(void 0===C||C)&&r.createElement(x,{container:V,initialFocusRef:void 0===S?void 0:S}),_,(void 0===v||v)&&r.createElement(E,{classes:A,classNames:D,styles:P,closeIcon:b,onClick:O,id:g})))),et):null})},4499:function(e,t,n){"use strict";n.d(t,{Jj:function(){return c},Ud:function(){return d},sj:function(){return f}});let r=Symbol("Comlink.proxy"),i=Symbol("Comlink.endpoint"),a=Symbol("Comlink.releaseProxy"),o=Symbol("Comlink.thrown"),s=e=>"object"==typeof e&&null!==e||"function"==typeof e,l=new Map([["proxy",{canHandle:e=>s(e)&&e[r],serialize(e){let{port1:t,port2:n}=new MessageChannel;return c(e,t),[n,[n]]},deserialize:e=>(e.start(),d(e))}],["throw",{canHandle:e=>s(e)&&o in e,serialize:({value:e})=>[e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[]],deserialize(e){if(e.isError)throw Object.assign(Error(e.value.message),e.value);throw e.value}}]]);function c(e,t=self){t.addEventListener("message",function n(r){let i;if(!r||!r.data)return;let{id:a,type:s,path:l}=Object.assign({path:[]},r.data),d=(r.data.argumentList||[]).map(v);try{let p=l.slice(0,-1).reduce((e,t)=>e[t],e),m=l.reduce((e,t)=>e[t],e);switch(s){case"GET":i=m;break;case"SET":p[l.slice(-1)[0]]=v(r.data.value),i=!0;break;case"APPLY":i=m.apply(p,d);break;case"CONSTRUCT":{let g=new m(...d);i=f(g)}break;case"ENDPOINT":{let{port1:b,port2:C}=new MessageChannel;c(e,C),y.set(b,[b]),i=b}break;case"RELEASE":i=void 0;break;default:return}}catch(S){i={value:S,[o]:0}}Promise.resolve(i).catch(e=>({value:e,[o]:0})).then(e=>{let[r,i]=h(e);t.postMessage(Object.assign(Object.assign({},r),{id:a}),i),"RELEASE"===s&&(t.removeEventListener("message",n),u(t))})}),t.start&&t.start()}function u(e){"MessagePort"===e.constructor.name&&e.close()}function d(e,t){return function e(t,n=[],r=function(){}){let o=!1,s=new Proxy(r,{get(r,i){if(p(o),i===a)return()=>g(t,{type:"RELEASE",path:n.map(e=>e.toString())}).then(()=>{u(t),o=!0});if("then"===i){if(0===n.length)return{then:()=>s};let l=g(t,{type:"GET",path:n.map(e=>e.toString())}).then(v);return l.then.bind(l)}return e(t,[...n,i])},set(e,r,i){p(o);let[a,s]=h(i);return g(t,{type:"SET",path:[...n,r].map(e=>e.toString()),value:a},s).then(v)},apply(r,a,s){p(o);let l=n[n.length-1];if(l===i)return g(t,{type:"ENDPOINT"}).then(v);if("bind"===l)return e(t,n.slice(0,-1));let[c,u]=m(s);return g(t,{type:"APPLY",path:n.map(e=>e.toString()),argumentList:c},u).then(v)},construct(e,r){p(o);let[i,a]=m(r);return g(t,{type:"CONSTRUCT",path:n.map(e=>e.toString()),argumentList:i},a).then(v)}});return s}(e,[],t)}function p(e){if(e)throw Error("Proxy has been released and is not useable")}function m(e){var t;let n=e.map(h);return[n.map(e=>e[0]),(t=n.map(e=>e[1]),Array.prototype.concat.apply([],t))]}let y=new WeakMap;function f(e){return Object.assign(e,{[r]:!0})}function h(e){for(let[t,n]of l)if(n.canHandle(e)){let[r,i]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},i]}return[{type:"RAW",value:e},y.get(e)||[]]}function v(e){switch(e.type){case"HANDLER":return l.get(e.name).deserialize(e.value);case"RAW":return e.value}}function g(e,t,n){return new Promise(r=>{let i=[,,,,].fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.addEventListener("message",function t(n){n.data&&n.data.id&&n.data.id===i&&(e.removeEventListener("message",t),r(n.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),n)})}},1953:function(e,t,n){"use strict";let r,i;n.d(t,{x7:function(){return ei},ZP:function(){return ea}});var a,o=n(959);let s={data:""},l=e=>"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||s,c=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,u=/\/\*[^]*?\*\/| +/g,d=/\n+/g,p=(e,t)=>{let n="",r="",i="";for(let a in e){let o=e[a];"@"==a[0]?"i"==a[1]?n=a+" "+o+";":r+="f"==a[1]?p(o,a):a+"{"+p(o,"k"==a[1]?"":t)+"}":"object"==typeof o?r+=p(o,t?t.replace(/([^,])+/g,e=>a.replace(/(^:.*)|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):a):null!=o&&(a=/^--/.test(a)?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=p.p?p.p(a,o):a+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},m={},y=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+y(e[n]);return t}return e},f=(e,t,n,r,i)=>{var a,o;let s=y(e),l=m[s]||(m[s]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(s));if(!m[l]){let f=s!==e?e:(e=>{let t,n,r=[{}];for(;t=c.exec(e.replace(u,""));)t[4]?r.shift():t[3]?(n=t[3].replace(d," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(d," ").trim();return r[0]})(e);m[l]=p(i?{["@keyframes "+l]:f}:f,n?"":"."+l)}let h=n&&m.g?m.g:null;return n&&(m.g=m[l]),a=m[l],o=t,h?o.data=o.data.replace(h,a):-1===o.data.indexOf(a)&&(o.data=r?a+o.data:o.data+a),l},h=(e,t,n)=>e.reduce((e,r,i)=>{let a=t[i];if(a&&a.call){let o=a(n),s=o&&o.props&&o.props.className||/^go/.test(o)&&o;a=s?"."+s:o&&"object"==typeof o?o.props?"":p(o,""):!1===o?"":o}return e+r+(null==a?"":a)},"");function v(e){let t=this||{},n=e.call?e(t.p):e;return f(n.unshift?n.raw?h(n,[].slice.call(arguments,1),t.p):n.reduce((e,n)=>Object.assign(e,n&&n.call?n(t.p):n),{}):n,l(t.target),t.g,t.o,t.k)}v.bind({g:1});let g,b,C,S=v.bind({k:1});function w(e,t){let n=this||{};return function(){let r=arguments;function i(a,o){let s=Object.assign({},a),l=s.className||i.className;n.p=Object.assign({theme:b&&b()},s),n.o=/ *go\d+/.test(l),s.className=v.apply(n,r)+(l?" "+l:""),t&&(s.ref=o);let c=e;return e[0]&&(c=s.as||e,delete s.as),C&&c[0]&&C(s),g(c,s)}return t?t(i):i}}var E=e=>"function"==typeof e,U=(e,t)=>E(e)?e(t):e,T=(r=0,()=>(++r).toString()),k=()=>{if(void 0===i&&"u">typeof window){let e=matchMedia("(prefers-reduced-motion: reduce)");i=!e||e.matches}return i},x=new Map,D=e=>{if(x.has(e))return;let t=setTimeout(()=>{x.delete(e),F({type:4,toastId:e})},1e3);x.set(e,t)},B=e=>{let t=x.get(e);t&&clearTimeout(t)},I=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,20)};case 1:return t.toast.id&&B(t.toast.id),{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case 2:let{toast:n}=t;return e.toasts.find(e=>e.id===n.id)?I(e,{type:1,toast:n}):I(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?D(r):e.toasts.forEach(e=>{D(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===r||void 0===r?{...e,visible:!1}:e)};case 4:return void 0===t.toastId?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(e=>({...e,pauseDuration:e.pauseDuration+i}))}}},A=[],P={toasts:[],pausedAt:void 0},F=e=>{P=I(P,e),A.forEach(e=>{e(P)})},R={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},M=(e={})=>{let[t,n]=(0,o.useState)(P);(0,o.useEffect)(()=>(A.push(n),()=>{let e=A.indexOf(n);e>-1&&A.splice(e,1)}),[t]);let r=t.toasts.map(t=>{var n,r;return{...e,...e[t.type],...t,duration:t.duration||(null==(n=e[t.type])?void 0:n.duration)||(null==e?void 0:e.duration)||R[t.type],style:{...e.style,...null==(r=e[t.type])?void 0:r.style,...t.style}}});return{...t,toasts:r}},L=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(null==n?void 0:n.id)||T()}),N=e=>(t,n)=>{let r=L(t,e,n);return F({type:2,toast:r}),r.id},O=(e,t)=>N("blank")(e,t);O.error=N("error"),O.success=N("success"),O.loading=N("loading"),O.custom=N("custom"),O.dismiss=e=>{F({type:3,toastId:e})},O.remove=e=>F({type:4,toastId:e}),O.promise=(e,t,n)=>{let r=O.loading(t.loading,{...n,...null==n?void 0:n.loading});return e.then(e=>(O.success(U(t.success,e),{id:r,...n,...null==n?void 0:n.success}),e)).catch(e=>{O.error(U(t.error,e),{id:r,...n,...null==n?void 0:n.error})}),e};var j=(e,t)=>{F({type:1,toast:{id:e,height:t}})},z=()=>{F({type:5,time:Date.now()})},H=e=>{let{toasts:t,pausedAt:n}=M(e);(0,o.useEffect)(()=>{if(n)return;let e=Date.now(),r=t.map(t=>{if(t.duration===1/0)return;let n=(t.duration||0)+t.pauseDuration-(e-t.createdAt);if(n<0){t.visible&&O.dismiss(t.id);return}return setTimeout(()=>O.dismiss(t.id),n)});return()=>{r.forEach(e=>e&&clearTimeout(e))}},[t,n]);let r=(0,o.useCallback)(()=>{n&&F({type:6,time:Date.now()})},[n]),i=(0,o.useCallback)((e,n)=>{let{reverseOrder:r=!1,gutter:i=8,defaultPosition:a}=n||{},o=t.filter(t=>(t.position||a)===(e.position||a)&&t.height),s=o.findIndex(t=>t.id===e.id),l=o.filter((e,t)=>t<s&&e.visible).length;return o.filter(e=>e.visible).slice(...r?[l+1]:[0,l]).reduce((e,t)=>e+(t.height||0)+i,0)},[t]);return{toasts:t,handlers:{updateHeight:j,startPause:z,endPause:r,calculateOffset:i}}},_=w("div")` | |
width: 20px; | |
opacity: 0; | |
height: 20px; | |
border-radius: 10px; | |
background: ${e=>e.primary||"#ff4b4b"}; | |
position: relative; | |
transform: rotate(45deg); | |
animation: ${S` | |
from { | |
transform: scale(0) rotate(45deg); | |
opacity: 0; | |
} | |
to { | |
transform: scale(1) rotate(45deg); | |
opacity: 1; | |
}`} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) | |
forwards; | |
animation-delay: 100ms; | |
&:after, | |
&:before { | |
content: ''; | |
animation: ${S` | |
from { | |
transform: scale(0); | |
opacity: 0; | |
} | |
to { | |
transform: scale(1); | |
opacity: 1; | |
}`} 0.15s ease-out forwards; | |
animation-delay: 150ms; | |
position: absolute; | |
border-radius: 3px; | |
opacity: 0; | |
background: ${e=>e.secondary||"#fff"}; | |
bottom: 9px; | |
left: 4px; | |
height: 2px; | |
width: 12px; | |
} | |
&:before { | |
animation: ${S` | |
from { | |
transform: scale(0) rotate(90deg); | |
opacity: 0; | |
} | |
to { | |
transform: scale(1) rotate(90deg); | |
opacity: 1; | |
}`} 0.15s ease-out forwards; | |
animation-delay: 180ms; | |
transform: rotate(90deg); | |
} | |
`,W=w("div")` | |
width: 12px; | |
height: 12px; | |
box-sizing: border-box; | |
border: 2px solid; | |
border-radius: 100%; | |
border-color: ${e=>e.secondary||"#e0e0e0"}; | |
border-right-color: ${e=>e.primary||"#616161"}; | |
animation: ${S` | |
from { | |
transform: rotate(0deg); | |
} | |
to { | |
transform: rotate(360deg); | |
} | |
`} 1s linear infinite; | |
`,V=w("div")` | |
width: 20px; | |
opacity: 0; | |
height: 20px; | |
border-radius: 10px; | |
background: ${e=>e.primary||"#61d345"}; | |
position: relative; | |
transform: rotate(45deg); | |
animation: ${S` | |
from { | |
transform: scale(0) rotate(45deg); | |
opacity: 0; | |
} | |
to { | |
transform: scale(1) rotate(45deg); | |
opacity: 1; | |
}`} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) | |
forwards; | |
animation-delay: 100ms; | |
&:after { | |
content: ''; | |
box-sizing: border-box; | |
animation: ${S` | |
0% { | |
height: 0; | |
width: 0; | |
opacity: 0; | |
} | |
40% { | |
height: 0; | |
width: 6px; | |
opacity: 1; | |
} | |
100% { | |
opacity: 1; | |
height: 10px; | |
}`} 0.2s ease-out forwards; | |
opacity: 0; | |
animation-delay: 200ms; | |
position: absolute; | |
border-right: 2px solid; | |
border-bottom: 2px solid; | |
border-color: ${e=>e.secondary||"#fff"}; | |
bottom: 6px; | |
left: 6px; | |
height: 10px; | |
width: 6px; | |
} | |
`,$=w("div")` | |
position: absolute; | |
`,G=w("div")` | |
position: relative; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
min-width: 20px; | |
min-height: 20px; | |
`,q=w("div")` | |
position: relative; | |
transform: scale(0.6); | |
opacity: 0.4; | |
min-width: 20px; | |
animation: ${S` | |
from { | |
transform: scale(0.6); | |
opacity: 0.4; | |
} | |
to { | |
transform: scale(1); | |
opacity: 1; | |
}`} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) | |
forwards; | |
`,Y=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return void 0!==t?"string"==typeof t?o.createElement(q,null,t):t:"blank"===n?null:o.createElement(G,null,o.createElement(W,{...r}),"loading"!==n&&o.createElement($,null,"error"===n?o.createElement(_,{...r}):o.createElement(V,{...r})))},K=e=>` | |
0% {transform: translate3d(0,${-200*e}%,0) scale(.6); opacity:.5;} | |
100% {transform: translate3d(0,0,0) scale(1); opacity:1;} | |
`,Z=e=>` | |
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} | |
100% {transform: translate3d(0,${-150*e}%,-1px) scale(.6); opacity:0;} | |
`,J=w("div")` | |
display: flex; | |
align-items: center; | |
background: #fff; | |
color: #363636; | |
line-height: 1.3; | |
will-change: transform; | |
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05); | |
max-width: 350px; | |
pointer-events: auto; | |
padding: 8px 10px; | |
border-radius: 8px; | |
`,X=w("div")` | |
display: flex; | |
justify-content: center; | |
margin: 4px 10px; | |
color: inherit; | |
flex: 1 1 auto; | |
white-space: pre-line; | |
`,Q=(e,t)=>{let n=e.includes("top")?1:-1,[r,i]=k()?["0%{opacity:0;} 100%{opacity:1;}","0%{opacity:1;} 100%{opacity:0;}"]:[K(n),Z(n)];return{animation:t?`${S(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${S(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},ee=o.memo(({toast:e,position:t,style:n,children:r})=>{let i=e.height?Q(e.position||t||"top-center",e.visible):{opacity:0},a=o.createElement(Y,{toast:e}),s=o.createElement(X,{...e.ariaProps},U(e.message,e));return o.createElement(J,{className:e.className,style:{...i,...n,...e.style}},"function"==typeof r?r({icon:a,message:s}):o.createElement(o.Fragment,null,a,s))});a=o.createElement,p.p=void 0,g=a,b=void 0,C=void 0;var et=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let a=o.useCallback(t=>{if(t){let n=()=>{r(e,t.getBoundingClientRect().height)};n(),new MutationObserver(n).observe(t,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return o.createElement("div",{ref:a,className:t,style:n},i)},en=(e,t)=>{let n=e.includes("top"),r=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:k()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...n?{top:0}:{bottom:0},...r}},er=v` | |
z-index: 9999; | |
> * { | |
pointer-events: auto; | |
} | |
`,ei=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:a,containerClassName:s})=>{let{toasts:l,handlers:c}=H(n);return o.createElement("div",{style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...a},className:s,onMouseEnter:c.startPause,onMouseLeave:c.endPause},l.map(n=>{let a=n.position||t,s=en(a,c.calculateOffset(n,{reverseOrder:e,gutter:r,defaultPosition:t}));return o.createElement(et,{id:n.id,key:n.id,onHeightUpdate:c.updateHeight,className:n.visible?er:"",style:s},"custom"===n.type?U(n.message,n):i?i(n):o.createElement(ee,{toast:n,position:a}))}))},ea=O},9485:function(e,t,n){"use strict";n.d(t,{x4:function(){return r.x4}}),n(4826);var r=n(3807);n(1866),n(113)}}]); |