(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=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=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=[];++u1)for(var n=1;n1),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-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;nt,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>>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)=>te.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)}}]);