UNPKG

filecat

Version:
2 lines 19.7 kB
/*! For license information please see 209.e7120b01e96f41cdd0af.js.LICENSE.txt */ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[209],{7209(t,e,n){n.r(e),n.d(e,{default:()=>z});var r=n(6540),o=n(5725),a=n(1443),u=n(447),i=n(5997),c=n(4289),l=n(2389),f=n(2042),s=n(6007),p=n(3459);function m(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function a(n,r,o,a){var c=r&&r.prototype instanceof i?r:i,l=Object.create(c.prototype);return y(l,"_invoke",function(n,r,o){var a,i,c,l=0,f=o||[],s=!1,p={p:0,n:0,v:t,a:m,f:m.bind(t,4),d:function(e,n){return a=e,i=0,c=t,p.n=n,u}};function m(n,r){for(i=n,c=r,e=0;!s&&l&&!o&&e<f.length;e++){var o,a=f[e],m=p.p,y=a[2];n>3?(o=y===r)&&(c=a[(i=a[4])?5:(i=3,3)],a[4]=a[5]=t):a[0]<=m&&((o=n<2&&m<a[1])?(i=0,p.v=r,p.n=a[1]):m<y&&(o=n<3||a[0]>r||r>y)&&(a[4]=n,a[5]=r,p.n=y,i=0))}if(o||n>1)return u;throw s=!0,r}return function(o,f,y){if(l>1)throw TypeError("Generator is already running");for(s&&1===f&&m(f,y),i=f,c=y;(e=i<2?t:c)||!s;){a||(i?i<3?(i>1&&(p.n=-1),m(i,c)):p.n=c:p.v=c);try{if(l=2,a){if(i||(o="next"),e=a[o]){if(!(e=e.call(a,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,i<2&&(i=0)}else 1===i&&(e=a.return)&&e.call(a),i<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),i=1);a=t}else if((e=(s=p.n<0)?c:n.call(r,p))!==u)break}catch(e){a=t,i=1,c=e}finally{l=1}}return{value:e,done:s}}}(n,o,a),!0),l}var u={};function i(){}function c(){}function l(){}e=Object.getPrototypeOf;var f=[][r]?e(e([][r]())):(y(e={},r,function(){return this}),e),s=l.prototype=i.prototype=Object.create(f);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,y(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return c.prototype=l,y(s,"constructor",l),y(l,"constructor",c),c.displayName="GeneratorFunction",y(l,o,"GeneratorFunction"),y(s),y(s,o,"Generator"),y(s,r,function(){return this}),y(s,"toString",function(){return"[object Generator]"}),(m=function(){return{w:a,m:p}})()}function y(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}y=function(t,e,n,r){function a(e,n){y(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(a("next",0),a("throw",1),a("return",2))},y(t,e,n,r)}function h(t,e,n,r,o,a,u){try{var i=t[a](u),c=i.value}catch(t){return void n(t)}i.done?e(c):Promise.resolve(c).then(r,o)}function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a,u,i=[],c=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(i.push(r.value),i.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(l)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return d(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function b(t){var e=(0,l.Bd)().t,n=v((0,r.useState)(e("毫秒")),2),y=n[0],d=n[1],b=v((0,r.useState)(""),2),g=b[0],w=b[1],E=v((0,r.useState)(""),2),S=E[0],_=E[1],j=v((0,r.useState)(null),2),O=j[0],x=j[1],k=v((0,r.useState)(null),2),A=k[0],C=k[1],P=v((0,r.useState)(Date.now()),2),T=P[0],I=P[1];var G=function(){var t,e=(t=m().m(function t(){var e,n;return m().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,s.Yu.get("sys_time/get");case 1:if((e=t.v).code!==p.m.Sucess){t.n=3;break}return t.n=2,e.data;case 2:n=t.v,x(n.timestamp),C(n.timezone),I(n.timestamp);case 3:return t.a(2)}},t)}),function(){var e=this,n=arguments;return new Promise(function(r,o){var a=t.apply(e,n);function u(t){h(a,r,o,u,i,"next",t)}function i(t){h(a,r,o,u,i,"throw",t)}u(void 0)})});return function(){return e.apply(this,arguments)}}();return(0,r.useEffect)(function(){G();var t=setInterval(function(){I(function(t){return t+1e3})},1e3);return function(){return clearInterval(t)}},[]),r.createElement(o.fI,null,r.createElement(o.VP,null,r.createElement(u.Zp,{title:e("时间转换器"),rightBottomCom:r.createElement(i.C3,{text:e("确定"),clickFun:function(){if(g||S){var t=0,e=""!==g&&0!==g;if(e){if(!(0,c.kf)(g))return void(0,f.zN)("must be number !");t=parseInt(g),"分秒"===y&&(t*=1e3)}var n=new Date(e?t:S),r=new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(n);if(_(r),!g){var o=n.getTime();w("毫秒"===y?o:o/1e3)}}else new Noty({type:"error",text:"不能都为空",timeout:1e3,layout:"bottomLeft"}).show()}})},r.createElement(a.l6,{options:[{title:e("毫秒"),value:"毫秒"},{title:e("分秒"),value:"分秒"}],onChange:function(t){d(t)}}),r.createElement(a.Sm,{placeholder:y,value:g,handleInputChange:function(t){w(t)}}),r.createElement(a.Sm,{placeholder:e("格式化时间"),value:S,handleInputChange:function(t){_(t)}}))),r.createElement(o.VP,null,null!==O&&null!==A&&r.createElement(u.Zp,{title:e("服务器时间")},r.createElement("h1",null,e("时区"),": ",A),r.createElement("h1",null,e("时间"),": ",new Date(T).toLocaleString(navigator.language,{timeZone:A})))))}var g=n(3413),w=n.n(g),E=n(7952),S=n(3029),_=n(8247),j=n(3430);function O(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function a(n,r,o,a){var c=r&&r.prototype instanceof i?r:i,l=Object.create(c.prototype);return x(l,"_invoke",function(n,r,o){var a,i,c,l=0,f=o||[],s=!1,p={p:0,n:0,v:t,a:m,f:m.bind(t,4),d:function(e,n){return a=e,i=0,c=t,p.n=n,u}};function m(n,r){for(i=n,c=r,e=0;!s&&l&&!o&&e<f.length;e++){var o,a=f[e],m=p.p,y=a[2];n>3?(o=y===r)&&(c=a[(i=a[4])?5:(i=3,3)],a[4]=a[5]=t):a[0]<=m&&((o=n<2&&m<a[1])?(i=0,p.v=r,p.n=a[1]):m<y&&(o=n<3||a[0]>r||r>y)&&(a[4]=n,a[5]=r,p.n=y,i=0))}if(o||n>1)return u;throw s=!0,r}return function(o,f,y){if(l>1)throw TypeError("Generator is already running");for(s&&1===f&&m(f,y),i=f,c=y;(e=i<2?t:c)||!s;){a||(i?i<3?(i>1&&(p.n=-1),m(i,c)):p.n=c:p.v=c);try{if(l=2,a){if(i||(o="next"),e=a[o]){if(!(e=e.call(a,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,i<2&&(i=0)}else 1===i&&(e=a.return)&&e.call(a),i<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),i=1);a=t}else if((e=(s=p.n<0)?c:n.call(r,p))!==u)break}catch(e){a=t,i=1,c=e}finally{l=1}}return{value:e,done:s}}}(n,o,a),!0),l}var u={};function i(){}function c(){}function l(){}e=Object.getPrototypeOf;var f=[][r]?e(e([][r]())):(x(e={},r,function(){return this}),e),s=l.prototype=i.prototype=Object.create(f);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,x(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return c.prototype=l,x(s,"constructor",l),x(l,"constructor",c),c.displayName="GeneratorFunction",x(l,o,"GeneratorFunction"),x(s),x(s,o,"Generator"),x(s,r,function(){return this}),x(s,"toString",function(){return"[object Generator]"}),(O=function(){return{w:a,m:p}})()}function x(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}x=function(t,e,n,r){function a(e,n){x(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(a("next",0),a("throw",1),a("return",2))},x(t,e,n,r)}function k(t,e,n,r,o,a,u){try{var i=t[a](u),c=i.value}catch(t){return void n(t)}i.done?e(c):Promise.resolve(c).then(r,o)}function A(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var a=t.apply(e,n);function u(t){k(a,r,o,u,i,"next",t)}function i(t){k(a,r,o,u,i,"throw",t)}u(void 0)})}}function C(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a,u,i=[],c=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(i.push(r.value),i.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(l)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return P(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function T(t){var e=(0,l.Bd)().t,n=(0,_.MH)().check_user_auth,o=C((0,r.useState)(""),2),u=o[0],c=o[1],f=function(){var t=A(O().m(function t(e){var n;return O().w(function(t){for(;;)switch(t.n){case 0:if(n=e||u){t.n=1;break}return new(w())({type:"error",text:"mac地址不能为空",timeout:1e3,layout:"bottomLeft"}).show(),t.a(2);case 1:return t.n=2,s._U.post("wol/exec",{mac:n});case 2:if(t.v.code===p.m.Sucess){t.n=3;break}return t.a(2);case 3:new(w())({type:"success",text:"发送唤醒命令成功",timeout:1e3,layout:"bottomLeft"}).show();case 4:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}(),m=function(){var t=A(O().m(function t(){var e;return O().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,s._U.get("wol/tag");case 1:if((e=t.v).code!==p.m.Sucess){t.n=2;break}return t.a(2,e.data);case 2:return t.a(2,[])}},t)}));return function(){return t.apply(this,arguments)}}(),y=function(){var t=A(O().m(function t(e){return O().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,s._U.post("wol/tag/save",e);case 1:t.v.code!==p.m.Sucess&&new(w())({type:"error",text:"网络错误",timeout:1e3,layout:"bottomLeft"}).show();case 2:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}(),h=function(){var t=A(O().m(function t(e){return O().w(function(t){for(;;)switch(t.n){case 0:c(e.mac),f(e.mac);case 1:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}();return r.createElement("div",null,r.createElement(E.A,null,r.createElement(i.rA,{icon:"play_arrow",title:e("发送"),onClick:function(){f()}}),r.createElement(a.$Z,{placeholder:e("目标设备mac地址"),icon:"laptop_mac",value:u,handleInputChange:function(t){return c(t)}})),r.createElement(S.N,{have_auth_edit:n(j.oV.wol_proxy_tag_update),getItems:m,save:y,clickItem:h,items:[{key:"name",preName:e("名字")},{key:"mac",preName:"mac"+e("地址")},{key:"color",preName:"color"}]}))}var I,G=n(7481),F=n(7444),N=n(6417),M=n(505);function L(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function a(n,r,o,a){var c=r&&r.prototype instanceof i?r:i,l=Object.create(c.prototype);return D(l,"_invoke",function(n,r,o){var a,i,c,l=0,f=o||[],s=!1,p={p:0,n:0,v:t,a:m,f:m.bind(t,4),d:function(e,n){return a=e,i=0,c=t,p.n=n,u}};function m(n,r){for(i=n,c=r,e=0;!s&&l&&!o&&e<f.length;e++){var o,a=f[e],m=p.p,y=a[2];n>3?(o=y===r)&&(c=a[(i=a[4])?5:(i=3,3)],a[4]=a[5]=t):a[0]<=m&&((o=n<2&&m<a[1])?(i=0,p.v=r,p.n=a[1]):m<y&&(o=n<3||a[0]>r||r>y)&&(a[4]=n,a[5]=r,p.n=y,i=0))}if(o||n>1)return u;throw s=!0,r}return function(o,f,y){if(l>1)throw TypeError("Generator is already running");for(s&&1===f&&m(f,y),i=f,c=y;(e=i<2?t:c)||!s;){a||(i?i<3?(i>1&&(p.n=-1),m(i,c)):p.n=c:p.v=c);try{if(l=2,a){if(i||(o="next"),e=a[o]){if(!(e=e.call(a,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,i<2&&(i=0)}else 1===i&&(e=a.return)&&e.call(a),i<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),i=1);a=t}else if((e=(s=p.n<0)?c:n.call(r,p))!==u)break}catch(e){a=t,i=1,c=e}finally{l=1}}return{value:e,done:s}}}(n,o,a),!0),l}var u={};function i(){}function c(){}function l(){}e=Object.getPrototypeOf;var f=[][r]?e(e([][r]())):(D(e={},r,function(){return this}),e),s=l.prototype=i.prototype=Object.create(f);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,D(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return c.prototype=l,D(s,"constructor",l),D(l,"constructor",c),c.displayName="GeneratorFunction",D(l,o,"GeneratorFunction"),D(s),D(s,o,"Generator"),D(s,r,function(){return this}),D(s,"toString",function(){return"[object Generator]"}),(L=function(){return{w:a,m:p}})()}function D(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}D=function(t,e,n,r){function a(e,n){D(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(a("next",0),a("throw",1),a("return",2))},D(t,e,n,r)}function B(t,e,n,r,o,a,u){try{var i=t[a](u),c=i.value}catch(t){return void n(t)}i.done?e(c):Promise.resolve(c).then(r,o)}function U(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var a=t.apply(e,n);function u(t){B(a,r,o,u,i,"next",t)}function i(t){B(a,r,o,u,i,"throw",t)}u(void 0)})}}function V(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a,u,i=[],c=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(i.push(r.value),i.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(l)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Z(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Z(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function $(){var t=V((0,r.useState)("rsa"),2),e=t[0],n=t[1],c=V((0,r.useState)("pem"),2),m=c[0],y=c[1],h=(0,l.Bd)(),v=h.t,d=(h.i18n,V((0,F.L4)(N.A.confirm),2)),b=(d[0],d[1]),g=V((0,r.useState)(""),2),w=g[0],S=g[1],_=V((0,r.useState)(""),2),j=_[0],O=_[1],x=function(){var t=U(L().m(function t(){var n;return L().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,s.cD.post("generate",{type:e,form:m});case 1:(n=t.v).code===p.m.Sucess&&(S(n.data.public_key),O(n.data.private_key),I=n.data.home_path);case 2:return t.a(2)}},t)}));return function(){return t.apply(this,arguments)}}(),k=function(){var t=U(L().m(function t(n){var r;return L().w(function(t){for(;;)switch(t.n){case 0:if(j&&w){t.n=1;break}return(0,f.zN)("密钥不能为空"),t.a(2);case 1:r="id_"+e,"pub"===n&&(r+=".pub"),b({open:!0,title:v("将覆盖密钥文件"),sub_title:"之前的密钥将作废。 将会作为 ".concat(r,' 文件保存到系统上的"').concat(I,'"目录下,此目录会作为openssh(git)所使用的默认目录。'),handle:function(){var t=U(L().m(function t(){return L().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,s.cD.post("save_openssh",{name:r,context:"pub"===n?w:j});case 1:t.v.code===p.m.Sucess&&((0,f.LW)("完成"),b({open:!1,handle:null}));case 2:return t.a(2)}},t)}));return function(){return t.apply(this,arguments)}}()});case 2:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}();return r.createElement(r.Fragment,null,r.createElement(o.xh,null,r.createElement(E.A,null,r.createElement(G.S,{isFlex:!0,columns:[r.createElement(a.l6,{tip:"加密算法",value:e,width:"auto",onChange:function(t){n(t)},options:[{title:v("RSA"),value:"rsa"},{title:v("DSA"),value:"dsa"},{title:v("ECDSA"),value:"ecdsa"}]}),r.createElement(a.l6,{tip:"输出格式",value:m,width:"auto",onChange:function(t){y(t)},options:[{title:v("普通PEM"),value:"pem"},{title:v("opensshPEM"),value:"openssh_pem"}]}),r.createElement(i.rA,{icon:"play_arrow",title:v("生成"),onClick:function(){x()}})]})),r.createElement(o.fI,null,r.createElement(o.VP,null,r.createElement(u.Zp,{title:"公钥",titleCom:r.createElement(i.rA,{title:"复制",icon:"copy_all",onClick:function(){w&&((0,M.l)(w),(0,f.LW)("完成"))}}),rightBottomCom:"openssh_pem"===m&&r.createElement(i.C3,{text:v("保存到.ssh目录"),clickFun:function(){k("pub")}})},r.createElement("textarea",{className:"input--textarea input--no_border",style:{width:"100%",height:"270px"},onChange:function(t){S(t.target.value)},value:w}))),r.createElement(o.VP,null,r.createElement(u.Zp,{title:"私钥",titleCom:r.createElement(i.rA,{title:"复制",icon:"copy_all",onClick:function(){j&&((0,M.l)(j),(0,f.LW)("成功"))}}),rightBottomCom:"openssh_pem"===m&&r.createElement(i.C3,{text:v("保存到.ssh目录"),clickFun:function(){k("pri")}})},r.createElement("textarea",{className:"input--textarea input--no_border",style:{width:"100%",height:"270px"},value:j,onChange:function(t){O(t.target.value)}}))))))}function z(t){var e=(0,l.Bd)().t,n=(0,_.MH)().check_user_auth,a=[];return a.push.apply(a,[{index:1,name:e("时间工具"),rto:"timeutil/"},{index:1,name:e("非对称密钥"),rto:"crypto/"}]),n(j.oV.wol_proxy)&&a.push({index:1,name:e("网络唤醒"),rto:"netwol/"}),r.createElement(o.W1,{optionList:a},r.createElement(b,null),r.createElement($,null),n(j.oV.wol_proxy)&&r.createElement(T,null))}},7481(t,e,n){n.d(e,{S:()=>i,X:()=>u});var r=n(6540);function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a,u,i=[],c=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(i.push(r.value),i.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(l)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return a(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function u(t){var e,n=o(r.useState([]),2),a=n[0],u=n[1];return(0,r.useEffect)(function(){t.children?u(Array.isArray(t.children)?t.children:[t.children]):u(t.rows)},[t.rows,t.children]),r.createElement("table",null,r.createElement("thead",null,r.createElement("tr",null,null===(e=t.headers)||void 0===e?void 0:e.map(function(t,e){return r.createElement("th",{key:e},t)}))),r.createElement("tbody",null,a.map(function(e,n){return r.createElement("tr",{key:n,onContextMenu:function(){t.handleContextMenu&&t.handleContextMenu(e)}},e.map(function(e,n){var o;return r.createElement("td",{style:{width:null!==(o=t.width)&&void 0!==o?o:"auto"},key:n,className:n===a.length-1?"small":""},e)}))})))}function i(t){return r.createElement("div",{style:{display:t.isFlex?"flex":"block"}},t.columns.map(function(t,e){return r.createElement("div",{key:e},t)}))}}}]);