"use strict";(self.webpackChunkbeancount_web=self.webpackChunkbeancount_web||[]).push([[332],{9332:(e,t,n)=>{n.r(t),n.d(t,{default:()=>h});var r=n(8380),i=n(5231),a=n(4412),l=n(9663),o=n(1896),s=n(9284),c=n(4760),d=n(2475),p=n(2069),u=n(712);class m extends s.Component{constructor(){super(...arguments),this.ledgerTitle=localStorage.getItem("ledgerTitle")||"\u8d26\u672c",this.state={loading:!1},this.handleOpenDeleteModal=()=>{i.A.confirm({title:`\u786e\u8ba4\u5220\u9664${this.ledgerTitle}\uff1f`,icon:(0,u.jsx)(r.A,{}),content:"\u5220\u9664\u540e\u5c06\u4e0d\u80fd\u6062\u590d",okText:"\u5220\u9664",onOk:this.handleDelete,okButtonProps:{danger:!0},cancelText:"\u53d6\u6d88"})},this.handleDelete=()=>{this.setState({loading:!0}),(0,c.hd)("/api/auth/ledger",{method:"DELETE"}).then((()=>{localStorage.clear(),a.Ay.success(`${this.ledgerTitle}\u5df2\u5220\u9664`),this.props.history.replace("/ledger")})).finally((()=>{this.setState({loading:!1})}))}}render(){return this.context.theme!==this.theme&&(this.theme=this.context.theme),(0,u.jsx)("div",{className:"setting-page",children:(0,u.jsx)(l.A,{direction:"vertical",size:"middle",style:{display:"flex"},children:(0,u.jsx)(o.A,{block:!0,danger:!0,loading:this.state.loading,onClick:this.handleOpenDeleteModal,children:"\u5220\u9664\u8d26\u672c"})})})}}m.contextType=d.A;const h=(0,p.A)(m)},2069:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(9284),i=n(712);const a=e=>class extends r.Component{constructor(){super(...arguments),this.defaultCommodity={currency:"CNY",symbol:"\uffe5"},this.currentCommodity=window.localStorage.getItem("ledgerCurrency")}render(){return(0,i.jsx)(e,{...this.props,commodity:this.currentCommodity?JSON.parse(this.currentCommodity):this.defaultCommodity})}}},9309:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(5544),i=n(9284),a=n(209);const l=function(){var e=i.useState(!1),t=(0,r.A)(e,2),n=t[0],l=t[1];return i.useEffect((function(){l((0,a.Pu)())}),[]),n}},9663:(e,t,n)=>{n.d(t,{e:()=>g,A:()=>v});var r=n(8168),i=n(4467),a=n(5544),l=n(4480),o=n.n(l),s=n(4650),c=n(9284),d=n(3135),p=n(9309);function u(e){var t=e.className,n=e.direction,a=e.index,l=e.marginDirection,o=e.children,s=e.split,d=e.wrap,p=c.useContext(g),u=p.horizontalSize,m=p.verticalSize,h=p.latestIndex,y={};return p.supportFlexGap||("vertical"===n?a