beancount-gs/public/static/js/17.8d9bad0f.chunk.js

1 line
24 KiB
JavaScript

(this["webpackJsonpbeancount-web"]=this["webpackJsonpbeancount-web"]||[]).push([[17],{188:function(e,t,a){"use strict";var n=a(0),c=a(5);t.a=e=>class extends n.Component{constructor(){super(...arguments),this.defaultCommodity={currency:"CNY",symbol:"\uffe5"},this.currentCommodity=window.localStorage.getItem("ledgerCurrency")}render(){return Object(c.jsx)(e,{...this.props,commodity:this.currentCommodity?JSON.parse(this.currentCommodity):this.defaultCommodity})}}},238:function(e,t,a){"use strict";var n=a(1),c=a(3),r=a(7),i=a(10),l=a.n(i),s=a(0),o=a(42),d=a(68),u=function(e){var t=e.prefixCls,a=e.className,r=e.style,i=e.size,o=e.shape,d=l()(Object(n.a)(Object(n.a)({},"".concat(t,"-lg"),"large"===i),"".concat(t,"-sm"),"small"===i)),u=l()(Object(n.a)(Object(n.a)(Object(n.a)({},"".concat(t,"-circle"),"circle"===o),"".concat(t,"-square"),"square"===o),"".concat(t,"-round"),"round"===o)),m=s.useMemo((function(){return"number"===typeof i?{width:i,height:i,lineHeight:"".concat(i,"px")}:{}}),[i]);return s.createElement("span",{className:l()(t,d,u,a),style:Object(c.a)(Object(c.a)({},m),r)})},m=function(e){var t=e.prefixCls,a=e.className,r=e.active,i=e.shape,m=void 0===i?"circle":i,b=e.size,f=void 0===b?"default":b,h=(0,s.useContext(o.b).getPrefixCls)("skeleton",t),v=Object(d.a)(e,["prefixCls","className"]),j=l()(h,"".concat(h,"-element"),Object(n.a)({},"".concat(h,"-active"),r),a);return s.createElement("div",{className:j},s.createElement(u,Object(c.a)({prefixCls:"".concat(h,"-avatar"),shape:m,size:f},v)))},b=function(e){var t=e.prefixCls,a=e.className,r=e.active,i=e.block,m=void 0!==i&&i,b=e.size,f=void 0===b?"default":b,h=(0,s.useContext(o.b).getPrefixCls)("skeleton",t),v=Object(d.a)(e,["prefixCls"]),j=l()(h,"".concat(h,"-element"),Object(n.a)(Object(n.a)({},"".concat(h,"-active"),r),"".concat(h,"-block"),m),a);return s.createElement("div",{className:j},s.createElement(u,Object(c.a)({prefixCls:"".concat(h,"-button"),size:f},v)))},f=a(2),h={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM288 604a64 64 0 10128 0 64 64 0 10-128 0zm118-224a48 48 0 1096 0 48 48 0 10-96 0zm158 228a96 96 0 10192 0 96 96 0 10-192 0zm148-314a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"dot-chart",theme:"outlined"},v=a(12),j=function(e,t){return s.createElement(v.a,Object(f.a)(Object(f.a)({},e),{},{ref:t,icon:h}))};var p=s.forwardRef(j),O=function(e){var t=e.prefixCls,a=e.className,c=e.style,r=e.active,i=e.children,d=(0,s.useContext(o.b).getPrefixCls)("skeleton",t),u=l()(d,"".concat(d,"-element"),Object(n.a)({},"".concat(d,"-active"),r),a),m=null!==i&&void 0!==i?i:s.createElement(p,null);return s.createElement("div",{className:u},s.createElement("div",{className:l()("".concat(d,"-image"),a),style:c},m))},g=function(e){var t=e.prefixCls,a=e.className,c=e.style,r=e.active,i=(0,s.useContext(o.b).getPrefixCls)("skeleton",t),d=l()(i,"".concat(i,"-element"),Object(n.a)({},"".concat(i,"-active"),r),a);return s.createElement("div",{className:d},s.createElement("div",{className:l()("".concat(i,"-image"),a),style:c},s.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:"".concat(i,"-image-svg")},s.createElement("path",{d:"M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",className:"".concat(i,"-image-path")}))))},y=function(e){var t=e.prefixCls,a=e.className,r=e.active,i=e.block,m=e.size,b=void 0===m?"default":m,f=(0,s.useContext(o.b).getPrefixCls)("skeleton",t),h=Object(d.a)(e,["prefixCls"]),v=l()(f,"".concat(f,"-element"),Object(n.a)(Object(n.a)({},"".concat(f,"-active"),r),"".concat(f,"-block"),i),a);return s.createElement("div",{className:v},s.createElement(u,Object(c.a)({prefixCls:"".concat(f,"-input"),size:b},h)))},x=a(6),C=function(e){var t=function(t){var a=e.width,n=e.rows,c=void 0===n?2:n;return Array.isArray(a)?a[t]:c-1===t?a:void 0},a=e.prefixCls,n=e.className,c=e.style,r=e.rows,i=Object(x.a)(Array(r)).map((function(e,a){return s.createElement("li",{key:a,style:{width:t(a)}})}));return s.createElement("ul",{className:l()(a,n),style:c},i)},w=function(e){var t=e.prefixCls,a=e.className,n=e.width,r=e.style;return s.createElement("h3",{className:l()(t,a),style:Object(c.a)({width:n},r)})};function E(e){return e&&"object"===Object(r.a)(e)?e:{}}var N=function(e){var t=e.prefixCls,a=e.loading,r=e.className,i=e.style,d=e.children,m=e.avatar,b=void 0!==m&&m,f=e.title,h=void 0===f||f,v=e.paragraph,j=void 0===v||v,p=e.active,O=e.round,g=s.useContext(o.b),y=g.getPrefixCls,x=g.direction,N=y("skeleton",t);if(a||!("loading"in e)){var S,z,k=!!b,I=!!h,L=!!j;if(k){var R=Object(c.a)(Object(c.a)({prefixCls:"".concat(N,"-avatar")},function(e,t){return e&&!t?{size:"large",shape:"square"}:{size:"large",shape:"circle"}}(I,L)),E(b));S=s.createElement("div",{className:"".concat(N,"-header")},s.createElement(u,Object(c.a)({},R)))}if(I||L){var M,P;if(I){var q=Object(c.a)(Object(c.a)({prefixCls:"".concat(N,"-title")},function(e,t){return!e&&t?{width:"38%"}:e&&t?{width:"50%"}:{}}(k,L)),E(h));M=s.createElement(w,Object(c.a)({},q))}if(L){var T=Object(c.a)(Object(c.a)({prefixCls:"".concat(N,"-paragraph")},function(e,t){var a={};return e&&t||(a.width="61%"),a.rows=!e&&t?3:2,a}(k,I)),E(j));P=s.createElement(C,Object(c.a)({},T))}z=s.createElement("div",{className:"".concat(N,"-content")},M,P)}var V=l()(N,Object(n.a)(Object(n.a)(Object(n.a)(Object(n.a)({},"".concat(N,"-with-avatar"),k),"".concat(N,"-active"),p),"".concat(N,"-rtl"),"rtl"===x),"".concat(N,"-round"),O),r);return s.createElement("div",{className:V,style:i},S,z)}return"undefined"!==typeof d?d:null};N.Button=b,N.Avatar=m,N.Input=y,N.Image=g,N.Node=O;var S=N;t.a=S},240:function(e,t,a){"use strict";var n=a(3),c=a(2),r=a(4),i=a(17),l=a(0),s=a.n(l),o=a(10),d=a.n(o),u=a(202),m=a(40),b=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],f=void 0;function h(e,t){var a=e.prefixCls,r=e.invalidate,s=e.item,o=e.renderItem,m=e.responsive,h=e.responsiveDisabled,v=e.registerSize,j=e.itemKey,p=e.className,O=e.style,g=e.children,y=e.display,x=e.order,C=e.component,w=void 0===C?"div":C,E=Object(i.a)(e,b),N=m&&!y;function S(e){v(j,e)}l.useEffect((function(){return function(){S(null)}}),[]);var z,k=o&&s!==f?o(s):g;r||(z={opacity:N?0:1,height:N?0:f,overflowY:N?"hidden":f,order:m?x:f,pointerEvents:N?"none":f,position:N?"absolute":f});var I={};N&&(I["aria-hidden"]=!0);var L=l.createElement(w,Object(n.a)({className:d()(!r&&a,p),style:Object(c.a)(Object(c.a)({},z),O)},I,E,{ref:t}),k);return m&&(L=l.createElement(u.a,{onResize:function(e){S(e.offsetWidth)},disabled:h},L)),L}var v=l.forwardRef(h);v.displayName="Item";var j=v,p=a(59),O=a(28),g=a(41);function y(){var e=l.useRef(null);return function(t){e.current||(e.current=[],function(e){if("undefined"===typeof MessageChannel)Object(g.a)(e);else{var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(void 0)}}((function(){Object(O.unstable_batchedUpdates)((function(){e.current.forEach((function(e){e()})),e.current=null}))}))),e.current.push(t)}}function x(e,t){var a=l.useState(t),n=Object(r.a)(a,2),c=n[0],i=n[1];return[c,Object(p.a)((function(t){e((function(){i(t)}))}))]}var C=s.a.createContext(null),w=["component"],E=["className"],N=["className"],S=function(e,t){var a=l.useContext(C);if(!a){var c=e.component,r=void 0===c?"div":c,s=Object(i.a)(e,w);return l.createElement(r,Object(n.a)({},s,{ref:t}))}var o=a.className,u=Object(i.a)(a,E),m=e.className,b=Object(i.a)(e,N);return l.createElement(C.Provider,{value:null},l.createElement(j,Object(n.a)({ref:t,className:d()(o,m)},u,b)))},z=l.forwardRef(S);z.displayName="RawItem";var k=z,I=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],L="responsive",R="invalidate";function M(e){return"+ ".concat(e.length," ...")}function P(e,t){var a=e.prefixCls,s=void 0===a?"rc-overflow":a,o=e.data,b=void 0===o?[]:o,f=e.renderItem,h=e.renderRawItem,v=e.itemKey,p=e.itemWidth,O=void 0===p?10:p,g=e.ssr,w=e.style,E=e.className,N=e.maxCount,S=e.renderRest,z=e.renderRawRest,k=e.suffix,P=e.component,q=void 0===P?"div":P,T=e.itemComponent,V=e.onVisibleChange,A=Object(i.a)(e,I),B="full"===g,K=y(),D=x(K,null),H=Object(r.a)(D,2),F=H[0],G=H[1],W=F||0,_=x(K,new Map),J=Object(r.a)(_,2),Q=J[0],X=J[1],Y=x(K,0),U=Object(r.a)(Y,2),$=U[0],Z=U[1],ee=x(K,0),te=Object(r.a)(ee,2),ae=te[0],ne=te[1],ce=x(K,0),re=Object(r.a)(ce,2),ie=re[0],le=re[1],se=Object(l.useState)(null),oe=Object(r.a)(se,2),de=oe[0],ue=oe[1],me=Object(l.useState)(null),be=Object(r.a)(me,2),fe=be[0],he=be[1],ve=l.useMemo((function(){return null===fe&&B?Number.MAX_SAFE_INTEGER:fe||0}),[fe,F]),je=Object(l.useState)(!1),pe=Object(r.a)(je,2),Oe=pe[0],ge=pe[1],ye="".concat(s,"-item"),xe=Math.max($,ae),Ce=N===L,we=b.length&&Ce,Ee=N===R,Ne=we||"number"===typeof N&&b.length>N,Se=Object(l.useMemo)((function(){var e=b;return we?e=null===F&&B?b:b.slice(0,Math.min(b.length,W/O)):"number"===typeof N&&(e=b.slice(0,N)),e}),[b,O,F,N,we]),ze=Object(l.useMemo)((function(){return we?b.slice(ve+1):b.slice(Se.length)}),[b,Se,we,ve]),ke=Object(l.useCallback)((function(e,t){var a;return"function"===typeof v?v(e):null!==(a=v&&(null===e||void 0===e?void 0:e[v]))&&void 0!==a?a:t}),[v]),Ie=Object(l.useCallback)(f||function(e){return e},[f]);function Le(e,t,a){(fe!==e||void 0!==t&&t!==de)&&(he(e),a||(ge(e<b.length-1),null===V||void 0===V||V(e)),void 0!==t&&ue(t))}function Re(e,t){X((function(a){var n=new Map(a);return null===t?n.delete(e):n.set(e,t),n}))}function Me(e){return Q.get(ke(Se[e],e))}Object(m.a)((function(){if(W&&"number"===typeof xe&&Se){var e=ie,t=Se.length,a=t-1;if(!t)return void Le(0,null);for(var n=0;n<t;n+=1){var c=Me(n);if(B&&(c=c||0),void 0===c){Le(n-1,void 0,!0);break}if(e+=c,0===a&&e<=W||n===a-1&&e+Me(a)<=W){Le(a,null);break}if(e+xe>W){Le(n-1,e-c-ie+ae);break}}k&&Me(0)+ie>W&&ue(null)}}),[W,Q,ae,ie,ke,Se]);var Pe=Oe&&!!ze.length,qe={};null!==de&&we&&(qe={position:"absolute",left:de,top:0});var Te,Ve={prefixCls:ye,responsive:we,component:T,invalidate:Ee},Ae=h?function(e,t){var a=ke(e,t);return l.createElement(C.Provider,{key:a,value:Object(c.a)(Object(c.a)({},Ve),{},{order:t,item:e,itemKey:a,registerSize:Re,display:t<=ve})},h(e,t))}:function(e,t){var a=ke(e,t);return l.createElement(j,Object(n.a)({},Ve,{order:t,key:a,item:e,renderItem:Ie,itemKey:a,registerSize:Re,display:t<=ve}))},Be={order:Pe?ve:Number.MAX_SAFE_INTEGER,className:"".concat(ye,"-rest"),registerSize:function(e,t){ne(t),Z(ae)},display:Pe};if(z)z&&(Te=l.createElement(C.Provider,{value:Object(c.a)(Object(c.a)({},Ve),Be)},z(ze)));else{var Ke=S||M;Te=l.createElement(j,Object(n.a)({},Ve,Be),"function"===typeof Ke?Ke(ze):Ke)}var De=l.createElement(q,Object(n.a)({className:d()(!Ee&&s,E),style:w,ref:t},A),Se.map(Ae),Ne?Te:null,k&&l.createElement(j,Object(n.a)({},Ve,{responsive:Ce,responsiveDisabled:!we,order:ve,className:"".concat(ye,"-suffix"),registerSize:function(e,t){le(t)},display:!0,style:qe}),k));return Ce&&(De=l.createElement(u.a,{onResize:function(e,t){G(t.clientWidth)},disabled:!we},De)),De}var q=l.forwardRef(P);q.displayName="Overflow",q.Item=k,q.RESPONSIVE=L,q.INVALIDATE=R;var T=q;t.a=T},327:function(e,t,a){"use strict";var n=a(2),c=a(0),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},i=a(12),l=function(e,t){return c.createElement(i.a,Object(n.a)(Object(n.a)({},e),{},{ref:t,icon:r}))},s=c.forwardRef(l);t.a=s},463:function(e,t,a){"use strict";a.r(t);var n=a(63),c=a(449),r=a(2),i=a(0),l=a.n(i),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-260 72h96v209.9L621.5 312 572 347.4V136zm220 752H232V136h280v296.9c0 3.3 1 6.6 3 9.3a15.9 15.9 0 0022.3 3.7l83.8-59.9 81.4 59.4c2.7 2 6 3.1 9.4 3.1 8.8 0 16-7.2 16-16V136h64v752z"}}]},name:"book",theme:"outlined"},o=a(12),d=function(e,t){return i.createElement(o.a,Object(r.a)(Object(r.a)({},e),{},{ref:t,icon:s}))};var u=i.forwardRef(d),m={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"}}]},name:"calendar",theme:"outlined"},b=function(e,t){return i.createElement(o.a,Object(r.a)(Object(r.a)({},e),{},{ref:t,icon:m}))};var f=i.forwardRef(b),h={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},v=function(e,t){return i.createElement(o.a,Object(r.a)(Object(r.a)({},e),{},{ref:t,icon:h}))};var j=i.forwardRef(v),p=a(327),O=a(183),g=a(61),y=a(1),x=a(3),C=a(10),w=a.n(C),E=a(68),N=a(42),S=a(57),z=a(238),k=a(441),I=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var c=0;for(n=Object.getOwnPropertySymbols(e);c<n.length;c++)t.indexOf(n[c])<0&&Object.prototype.propertyIsEnumerable.call(e,n[c])&&(a[n[c]]=e[n[c]])}return a},L=function(e){var t=e.prefixCls,a=e.className,n=e.hoverable,c=void 0===n||n,r=I(e,["prefixCls","className","hoverable"]);return i.createElement(N.a,null,(function(e){var n=(0,e.getPrefixCls)("card",t),l=w()("".concat(n,"-grid"),a,Object(y.a)({},"".concat(n,"-grid-hoverable"),c));return i.createElement("div",Object(x.a)({},r,{className:l}))}))},R=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var c=0;for(n=Object.getOwnPropertySymbols(e);c<n.length;c++)t.indexOf(n[c])<0&&Object.prototype.propertyIsEnumerable.call(e,n[c])&&(a[n[c]]=e[n[c]])}return a};var M=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var c=0;for(n=Object.getOwnPropertySymbols(e);c<n.length;c++)t.indexOf(n[c])<0&&Object.prototype.propertyIsEnumerable.call(e,n[c])&&(a[n[c]]=e[n[c]])}return a},P=function(e){return i.createElement(N.a,null,(function(t){var a=t.getPrefixCls,n=e.prefixCls,c=e.className,r=e.avatar,l=e.title,s=e.description,o=M(e,["prefixCls","className","avatar","title","description"]),d=a("card",n),u=w()("".concat(d,"-meta"),c),m=r?i.createElement("div",{className:"".concat(d,"-meta-avatar")},r):null,b=l?i.createElement("div",{className:"".concat(d,"-meta-title")},l):null,f=s?i.createElement("div",{className:"".concat(d,"-meta-description")},s):null,h=b||f?i.createElement("div",{className:"".concat(d,"-meta-detail")},b,f):null;return i.createElement("div",Object(x.a)({},o,{className:u}),m,h)}))},q=i.forwardRef((function(e,t){var a,n=i.useContext(N.b),c=n.getPrefixCls,r=n.direction,l=i.useContext(S.b),s=e.prefixCls,o=e.className,d=e.extra,u=e.headStyle,m=void 0===u?{}:u,b=e.bodyStyle,f=void 0===b?{}:b,h=e.title,v=e.loading,j=e.bordered,p=void 0===j||j,O=e.size,g=e.type,C=e.cover,I=e.actions,M=e.tabList,P=e.children,q=e.activeTabKey,T=e.defaultActiveTabKey,V=e.tabBarExtraContent,A=e.hoverable,B=e.tabProps,K=void 0===B?{}:B,D=R(e,["prefixCls","className","extra","headStyle","bodyStyle","title","loading","bordered","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps"]),H=c("card",s),F=i.createElement(z.a,{loading:!0,active:!0,paragraph:{rows:4},title:!1},P),G=void 0!==q,W=Object(x.a)(Object(x.a)({},K),Object(y.a)(Object(y.a)({},G?"activeKey":"defaultActiveKey",G?q:T),"tabBarExtraContent",V)),_=M&&M.length?i.createElement(k.a,Object(x.a)({size:"large"},W,{className:"".concat(H,"-head-tabs"),onChange:function(t){var a;null===(a=e.onTabChange)||void 0===a||a.call(e,t)},items:M.map((function(e){var t;return{label:e.tab,key:e.key,disabled:null!==(t=e.disabled)&&void 0!==t&&t}}))})):null;(h||d||_)&&(a=i.createElement("div",{className:"".concat(H,"-head"),style:m},i.createElement("div",{className:"".concat(H,"-head-wrapper")},h&&i.createElement("div",{className:"".concat(H,"-head-title")},h),d&&i.createElement("div",{className:"".concat(H,"-extra")},d)),_));var J=C?i.createElement("div",{className:"".concat(H,"-cover")},C):null,Q=i.createElement("div",{className:"".concat(H,"-body"),style:f},v?F:P),X=I&&I.length?i.createElement("ul",{className:"".concat(H,"-actions")},function(e){return e.map((function(t,a){return i.createElement("li",{style:{width:"".concat(100/e.length,"%")},key:"action-".concat(a)},i.createElement("span",null,t))}))}(I)):null,Y=Object(E.a)(D,["onTabChange"]),U=O||l,$=w()(H,Object(y.a)(Object(y.a)(Object(y.a)(Object(y.a)(Object(y.a)(Object(y.a)(Object(y.a)(Object(y.a)({},"".concat(H,"-loading"),v),"".concat(H,"-bordered"),p),"".concat(H,"-hoverable"),A),"".concat(H,"-contain-grid"),function(){var t;return i.Children.forEach(e.children,(function(e){e&&e.type&&e.type===L&&(t=!0)})),t}()),"".concat(H,"-contain-tabs"),M&&M.length),"".concat(H,"-").concat(U),U),"".concat(H,"-type-").concat(g),!!g),"".concat(H,"-rtl"),"rtl"===r),o);return i.createElement("div",Object(x.a)({ref:t},Y,{className:$}),a,J,Q,X)}));q.Grid=L,q.Meta=P;var T=q,V=a(275),A=a(462),B=a(469),K=a(91),D=a(73),H=a(188),F=a(5);const G={required:"${label} \u4e0d\u80fd\u4e3a\u7a7a\uff01"};class W extends i.Component{constructor(){super(...arguments),this.theme=this.context.theme,this.formRef=l.a.createRef(),this.state={loading:!1,expand:!1,newLedger:!1,selectedLedger:{},ledgers:[],config:{}},this.handleQueryLedgerList=()=>{this.setState({loading:!0}),Object(K.d)("/api/ledger",{method:"GET"}).then((e=>{this.setState({ledgers:e,newLedger:0===e.length})})).finally((()=>{this.setState({loading:!1})}))},this.handleQueryServerConfig=()=>{this.setState({loading:!0}),Object(K.d)("/api/config",{method:"GET"}).then((e=>{e.dataPath?this.setState({config:e}):window.location.href="/web/#/init"})).finally((()=>{this.setState({loading:!1})}))},this.handleCreateLedger=e=>{e.secret||!this.state.newLedger?this.handleReqCreateLedger(e):O.a.confirm({title:"\u63d0\u9192",icon:Object(F.jsx)(n.a,{}),content:"\u672a\u8bbe\u7f6e\u5bc6\u7801\uff0c\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6570\u636e\u4e0d\u5b89\u5168",okText:"\u786e\u8ba4\u4e0d\u8bbe\u7f6e\u5bc6\u7801",cancelText:"\u53d6\u6d88",onOk:()=>this.handleReqCreateLedger(e)})},this.handleReqCreateLedger=e=>{this.setState({loading:!0}),Object(K.d)("/api/ledger",{method:"POST",headers:{"Content-Type":"application/json"},body:e}).then((e=>{window.localStorage.setItem("ledgerId",e.ledgerId),e.title&&window.localStorage.setItem("ledgerTitle",e.title),e.currency&&window.localStorage.setItem("ledgerCurrency",JSON.stringify({currency:e.currency,symbol:e.currencySymbol})),this.props.history.replace("/")})).finally((()=>{this.setState({loading:!1})}))},this.handleSelectLedger=e=>{this.setState({selectedLedger:e})}}componentWillMount(){window.localStorage.getItem("ledgerId")&&Object(K.n)()}componentDidMount(){this.handleQueryServerConfig(),this.handleQueryLedgerList()}render(){return this.context.theme!==this.theme&&(this.theme=this.context.theme),this.state.selectedLedger.mail||this.state.newLedger?Object(F.jsx)("div",{className:"ledger-page",children:Object(F.jsx)("div",{children:Object(F.jsxs)(V.a,{name:"add-account-form",size:"middle",layout:"vertical",ref:this.formRef,onFinish:this.handleCreateLedger,validateMessages:G,loading:this.state.loading,children:[Object(F.jsx)(V.a.Item,{name:"ledgerName",label:"\u8d26\u672c\u540d\u79f0",initialValue:this.state.selectedLedger.mail||"",rules:[{required:!0}],children:Object(F.jsx)(A.a,{placeholder:"\u4f60\u53ef\u4ee5\u521b\u5efa\u591a\u4e2a\u7684\u8d26\u672c\uff0c\u8d26\u672c\u4e4b\u95f4\u7684\u6570\u636e\u65e0\u6cd5\u4e92\u901a"})}),Object(F.jsx)(V.a.Item,{label:"\u4fee\u6539\u6e90\u6587\u4ef6\u65f6\u662f\u5426\u5907\u4efd\u6570\u636e",name:"isBak",valuePropName:"checked",rules:[{required:!0}],initialValue:this.state.config.isBak,children:Object(F.jsx)(B.a,{})}),Object(F.jsx)(V.a.Item,{name:"secret",label:"\u8d26\u672c\u5bc6\u7801",children:Object(F.jsx)(A.a,{type:"password",placeholder:"\u8d26\u672c\u5bc6\u7801"})}),!this.state.selectedLedger.mail&&Object(F.jsxs)(i.Fragment,{children:[Object(F.jsx)("div",{style:{fontSize:14,marginBottom:"2rem",textAlign:"center"},children:Object(F.jsxs)("a",{onClick:()=>{this.setState({expand:!this.state.expand})},children:[this.state.expand?Object(F.jsx)(j,{}):Object(F.jsx)(p.a,{})," \u66f4\u591a\u8d26\u672c\u8bbe\u7f6e"]})}),this.state.expand&&Object(F.jsxs)(i.Fragment,{children:[Object(F.jsx)(V.a.Item,{label:"\u8d26\u672c\u5f00\u59cb\u65e5\u671f",name:"startDate",initialValue:this.state.config.startDate,rules:[{required:!0}],children:Object(F.jsx)(A.a,{type:"date",placeholder:"\u8d26\u672c\u5f00\u59cb\u65e5\u671f"})}),Object(F.jsx)(V.a.Item,{label:"\u5e01\u79cd",name:"operatingCurrency",initialValue:this.state.config.operatingCurrency,rules:[{required:!0}],children:Object(F.jsx)(A.a,{placeholder:"\u5e01\u79cd"})}),Object(F.jsx)(V.a.Item,{label:"\u5e73\u8861\u8d26\u6237\u540d\u79f0\u8bbe\u7f6e",name:"openingBalances",initialValue:this.state.config.openingBalances,rules:[{required:!0}],children:Object(F.jsx)(A.a,{placeholder:"\u5e73\u8861\u8d26\u6237\u540d\u79f0\u8bbe\u7f6e"})})]})]}),Object(F.jsx)(V.a.Item,{children:Object(F.jsx)(g.a,{type:"primary",block:!0,htmlType:"submit",children:"\u521b\u5efa/\u8fdb\u5165\u4e2a\u4eba\u8d26\u672c"})}),this.state.ledgers.length>0&&Object(F.jsx)(V.a.Item,{children:Object(F.jsx)(g.a,{block:!0,onClick:()=>{this.setState({selectedLedger:{},newLedger:!1})},children:"\u8fd4\u56de\u8d26\u672c"})})]})})}):Object(F.jsxs)("div",{className:"ledger-page",children:[Object(F.jsx)("div",{children:Object(F.jsx)(g.a,{block:!0,type:"dashed",icon:Object(F.jsx)(c.a,{}),onClick:()=>{this.setState({newLedger:!0})},children:"\u521b\u5efa\u65b0\u8d26\u672c"})}),this.state.ledgers.map((e=>Object(F.jsx)(T,{style:{width:"100%",marginTop:16,cursor:"pointer"},loading:this.state.loading,children:Object(F.jsx)(T.Meta,{onClick:()=>{this.handleSelectLedger(e)},title:e.title,description:Object(F.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[Object(F.jsxs)("div",{children:[Object(F.jsxs)("span",{children:[Object(F.jsx)(u,{}),"\xa0",e.mail]}),"\xa0\xa0",e.createDate&&Object(F.jsxs)("span",{children:[Object(F.jsx)(f,{}),"\xa0",e.createDate]})]}),Object(F.jsx)("div",{children:Object(F.jsx)("span",{children:e.operatingCurrency})})]})})})))]})}}W.contextType=D.a;t.default=Object(H.a)(W)}}]);