"use strict";(self.webpackChunkseahub_frontend=self.webpackChunkseahub_frontend||[]).push([[6655],{46655:function(e,t,n){n.r(t),n.d(t,{default:function(){return s}});var r=n(62822),a=n(10467),s=function(){var e=(0,a.default)((0,r.A)().mark((function e(t){var n,a,s,c,i,u,l,o,p,f=arguments;return(0,r.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=f.length>1&&void 0!==f[1]?f[1]:[{}],a=f.length>2&&void 0!==f[2]?f[2]:null,s=f.length>3&&void 0!==f[3]&&f[3],c=f.length>4&&void 0!==f[4]?f[4]:null,Array.isArray(n)||(n=[n]),n[0].fileName=n[0].fileName||"Untitled",i=[],u=null,t instanceof Blob&&t.type?u=t.type:t.headers&&t.headers.get("content-type")&&(u=t.headers.get("content-type")),n.forEach((function(e,t){i[t]={description:e.description||"",accept:{}},e.mimeTypes?(0===t&&u&&e.mimeTypes.push(u),e.mimeTypes.map((function(n){i[t].accept[n]=e.extensions||[]}))):u&&(i[t].accept[u]=e.extensions||[])})),!a){e.next=17;break}return e.prev=8,e.next=11,a.getFile();case 11:e.next=17;break;case 13:if(e.prev=13,e.t0=e.catch(8),a=null,!s){e.next=17;break}throw e.t0;case 17:if(e.t1=a,e.t1){e.next=22;break}return e.next=21,window.showSaveFilePicker({suggestedName:n[0].fileName,id:n[0].id,startIn:n[0].startIn,types:i,excludeAcceptAllOption:n[0].excludeAcceptAllOption||!1});case 21:e.t1=e.sent;case 22:return l=e.t1,!a&&c&&c(),e.next=26,l.createWritable();case 26:if(o=e.sent,!("stream"in t)){e.next=32;break}return p=t.stream(),e.next=31,p.pipeTo(o);case 31:return e.abrupt("return",l);case 32:if(!("body"in t)){e.next=38;break}return e.next=35,t.body.pipeTo(o);case 35:e.t2=l,e.next=47;break;case 38:return e.t3=o,e.next=41,t;case 41:return e.t4=e.sent,e.next=44,e.t3.write.call(e.t3,e.t4);case 44:return e.next=46,o.close();case 46:e.t2=l;case 47:return e.abrupt("return",e.t2);case 48:case"end":return e.stop()}}),e,null,[[8,13]])})));return function(t){return e.apply(this,arguments)}}()}}]);