PageSourceSearch

https://taaghche.com/tmp/_next/static/chunks/pages/gift-0217d838da26f893.js

js taaghche.com collected 2026-10-01 11:26:45 UTC 9,969 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2487],{26291:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/gift",function(){return t(80828)}])},80899:function(e,n,t){"use strict";t.d(n,{Z:function(){return d}});var o=t(85893),i=t(67294),s=t(73935),r=t(97163),a=t(67799),l=t(26299),c=t.n(l);class d extends i.PureComponent{componentDidMount(){"undefined"!=typeof document&&(this.modalRoot=document.body,this.modalRoot.appendChild(this.el),this.props.isOpen&&(document.body.style.overflow="hidden",this.setBodyOverflow=!0))}componentDidUpdate(e){"undefined"!=typeof document&&(this.props.isOpen&&!e.isOpen?(document.body.style.overflow="hidden",this.setBodyOverflow=!0):!this.props.isOpen&&e.isOpen&&this.setBodyOverflow&&(document.body.style.overflow="auto",this.setBodyOverflow=!1))}componentWillUnmount(){this.modalRoot.removeChild(this.el),document.body.style.overflow="auto"}render(){let{isOpen:e,isfull:n,children:t,forArticle:i=!1}=this.props;return e?i?(0,o.jsx)("div",{children:n?(0,o.jsx)("div",{className:c().back,onClick:this.handleBackdropClick,children:t}):(0,o.jsx)("div",{className:"".concat(c().overlay),onClick:this.handleBackdropClick,children:t})}):(0,s.createPortal)((0,o.jsx)("div",{children:n?(0,o.jsx)("div",{className:c().back,onClick:this.handleBackdropClick,children:t}):(0,o.jsx)("div",{className:"".concat(c().overlay," ").concat(this.context===a.Q2.dark?c().dark:""),onClick:this.handleBackdropClick,children:t})}),this.el):null}constructor(e){super(e),this.modalRoot=null,this.setBodyOverflow=!1,this.handleBackdropClick=e=>{var n;if(e.target!==e.currentTarget)return;let t=null!==(n=this.props.onClickOverlay)&&void 0!==n?n:this.props.closeModal;null==t||t()},this.el="undefined"!=typeof document?document.createElement("div"):{}}}d.contextType=r.Ni},98904:function(e,n,t){"use strict";var o=t(85893),i=t(95813),s=t.n(i),r=t(80899),a=t(67294),l=t(67799),c=t(97163);n.Z=e=>{let{isOpen:n,closeModal:t,okText:i="بله",cancelText:d="نه",message:u="مطمئنی؟",onOk:h=t,onCancel:p=t,children:_}=e,m=(0,a.useContext)(c.Ni);return(0,o.jsx)(r.Z,{isfull:!1,isOpen:n,closeModal:t,onClickOverlay:t,children:(0,o.jsxs)("div",{className:"".concat(s().modal," ").concat(m===l.Q2.dark?s().dark:""),onClick:e=>e.stopPropagation(),children:[u&&(0,o.jsx)("p",{className:s().message,children:u}),_&&(0,o.jsx)("p",{className:s().message,children:_}),(0,o.jsxs)("div",{className:"".concat(s().buttons," d-flex"),children:[(0,o.jsx)("div",{className:s().cancel,onClick:()=>{p()},children:d}),(0,o.jsx)("div",{className:s().ok,onClick:()=>{h()},children:i})]})]})})}},11143:function(e,n,t){"use strict";var o=t(85893),i=t(84947),s=t.n(i);n.Z=e=>{var n,t;let{icon:i,book:r,children:a}=e,l=r?"".concat(null==r?void 0:r.prefix,"  \xab").concat(null==r?void 0:r.title,"\xbb"):"";return(0,o.jsxs)("div",{className:s().panel,children:[(0,o.jsxs)("div",{className:s().imageBox,children:[(0,o.jsx)("img",{className:(null==r?void 0:null===(n=r.type)||void 0===n?void 0:n.toLowerCase())==="audio"?s().audioBookCover:s().bookCover,src:null!==(t=null==r?void 0:r.coverUri)&&void 0!==t?t:"/images/gift/untitleBook.svg",alt:l,title:l}),(0,o.jsx)("img",{className:s().icon,src:"/images/gift/".concat(i,".svg"),alt:"هدیه"})]}),(0,o.jsx)("div",{children:a})]})}},63952:function(e,n,t){"use strict";var o,i,s,r;t.d(n,{M:function(){return i},Y:function(){return o}}),(s=o||(o={}))[s.Valid=0]="Valid",s[s.Used=1]="Used",s[s.Invalid=2]="Invalid",(r=i||(i={}))[r.Success=0]="Success",r[r.InvalidForSender=1]="InvalidForSender",r[r.Used=2]="Used",r[r.AlreadyInYourLibrary=3]="AlreadyInYourLibrary",r[r.InvalidToken=4]="InvalidToken",r[r.Error=5]="Error",r[r.Expired=6]="Expired",r[r.SignupAlert=7]="SignupAlert"},9273:function(e,n,t){"use strict";var o=t(85893),i=t(67294),s=t(4896),r=t(60550),a=t(1431),l=t.n(a);n.Z=e=>{let[n,t]=(0,i.useState)(e.content),a=(0,i.useRef)(),c=(0,i.useContext)(s.uL);return(0,i.useEffect)(()=>{t(e.content)},[e.content]),(0,o.jsxs)("div",{className:"".concat(l().giftShare," container"),children:[(0,o.jsx)("h1",{children:"ارسال هدیه"}),(0,o.jsx)("h2",{children:"لطفاً متن زیر را برای دوست خود ارسال کنید تا هدیه‌ی شما را دریافت کند."}),(0,o.jsx)("p",{children:"در صورت تمایل می‌توانید متن را تغییر دهید، اما توجه داشته باشید که لینک موجود در متن را حذف ن
1کنید."}),(0,o.jsx)("textarea",{id:"message",name:"string",className:"faq-answer",rows:8,value:n,onChange:e=>{t(e.target.value)},ref:a}),(0,o.jsx)("div",{className:l().copyContainer,children:(0,o.jsx)("button",{onClick:()=>(0,r.SO)(a,c),children:"کپی"})})]})}},80828:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSP:function(){return y},default:function(){return j}});var o,i,s=t(85893),r=t(9008),a=t.n(r),l=t(67294),c=t(11163),d=t(84947),u=t.n(d),h=t(11143),p=t(9273),_=t(71549),m=t(4896),f=t(63952),v=t(98904);(o=i||(i={}))[o.Share=100]="Share";let x={...f.Y,...i};var g=e=>{let{token:n,info:t}=e,{book:o,status:i,giftUrl:r}=t,[a,d]=(0,l.useState)(i),[g,k]=(0,l.useState)(!1),y=(0,l.useContext)(m.uL),j=(0,c.useRouter)(),C=()=>{var e;j.push("/mylibrary?type=".concat((null==o?void 0:null===(e=o.type)||void 0===e?void 0:e.toLowerCase())==="audio"?"audio":"text"))},b=async()=>{let e=await (0,_.Hp)(n);k(!1),e===f.M.Success?(C(),y({type:"push",value:{type:m.pC.Success,msg:"عملیات با موفقیت انجام شد."}})):e===f.M.AlreadyInYourLibrary?y({type:"push",value:{type:m.pC.Error,msg:"".concat(o.prefix," را قبلا دریافت کرده‌اید و در کتاب‌های شما موجود است.")}}):e===f.M.Error&&y({type:"push",value:{type:m.pC.Error,msg:"خطایی در سیستم رخ داده. لطفا دوباره تلاش کنید."}})};return(0,s.jsxs)("div",{className:"container ".concat(u().giftPage),children:[(0,s.jsx)(h.Z,{icon:a===x.Invalid||a===x.Used?"warning":"gift",book:o,children:a===x.Valid?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{children:[" ","لینک ",o.prefix," \xab",o.title,"\xbb برای هدیه به یک دوست آماده است."]}),(0,s.jsxs)("p",{children:["اگر قصد هدیه دادن نداری، می‌توانی با انتخاب \xabافزودن به کتاب‌‌‌های من\xbb ",o.prefix," را در کتابخانه‌ی خودت نگه داری."]})]}):a===x.Used?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:u().errorMsg,children:"این کد هدیه قبلا استفاده شده."}),(0,s.jsxs)("p",{children:["اگر خودت از آن استفاده کرده‌ای، به قسمت \xabکتاب‌های من\xbb برو. ",o.prefix," \xab",o.title,"\xbb را در آن قسمت می‌توانی پیدا کنی."]})]}):a===x.Invalid?(0,s.jsx)("p",{className:u().errorMsg,children:"این کد هدیه نامعتبر است."}):a===x.Share?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(p.Z,{content:"سلام دوست عزیز\n".concat(o.prefix," \xab").concat(o.title,"\xbb هدیه‌ای برای شماست. \nاین هدیه را می‌توانی از لینک زیر دریافت کنی. امیدوارم از مطالعه‌ٔ آن در اپلیکیشن طاقچه لذت ببری.\n").concat(r)})}):(0,s.jsx)(s.Fragment,{})}),a===x.Valid?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:u().button,onClick:()=>{d(x.Share),scrollTo(0,0)},children:["ارسال لینک ",o.prefix," به عنوان هدیه"]}),(0,s.jsx)("a",{onClick:()=>{k(!0)},children:"انصراف از هدیه دادن و افزودن به کتاب‌‌های من"})]}):a===x.Used?(0,s.jsx)("div",{className:u().button,onClick:C,children:"ورود به کتاب‌های من"}):a===x.Share?(0,s.jsx)("a",{onClick:()=>{k(!0)},children:"انصراف از هدیه دادن و افزودن به کتاب‌‌های من"}):(0,s.jsx)("div",{}),g&&(0,s.jsx)(v.Z,{isOpen:g,closeModal:()=>{k(!1)},onOk:b,message:"",okText:"تایید",cancelText:"انصراف",children:(0,s.jsxs)("div",{className:u().confirmMessage,children:["شما این ",o.prefix," را به عنوان هدیه خریده‌ای. آیا می‌خواهی به کتابخانه‌ی خودت اضافه شود؟ در این صورت نمی‌توانی آن را به شخص دیگری هدیه بدهی."]})})]})},k=t(87447),y=!0,j=e=>{let{token:n,info:t}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(a(),{children:[(0,s.jsx)("title",{children:"هدیه | ".concat(k.Z.appNameFA)}),(0,s.jsx)("meta",{name:"robots",content:"noindex"})]}),(0,s.jsx)(g,{token:n,info:t})]})}},71549:function(e,n,t){"use strict";t.d(n,{Hp:function(){return i},KG:function(){return s}});var o=t(76446);let i=async e=>await o.ZP.post("/mybook/gift/add-to-sender",{token:e}),s=async(e,n)=>await o.ZP.post("/mybook/gift/receive",{token:e,receiver:n})},26299:function(e){e.exports={back:"modal_back__6USx7",BackFlash:"modal_BackFlash__b92aa",overlay:"modal_overlay__MR62_",OverlayFlash:"modal_OverlayFlash__9gYzB",content:"modal_content__ChqFp",OverlayFlashDark:"modal_OverlayFlashDark__H8t0a",dark:"modal_dark__Q7Thb"}},95813:function(e){e.exports={modal:"whiteConfirmModal_modal__9x_qJ",dark:"whiteConfirmModal_dark__QQp_z",buttons:"whiteConfirmModal_buttons__dh3Ak",cancel:"whiteConfirmModal_cancel__JxrjY",message:"whiteConfirmModal_message__OVrRg",ok:"whiteConfirmModal_ok__KkYKC"}},84947:function(e){e.exports={giftPage:"gift_giftPage__m1zZo",button:"gift_button__3kO4l",errorMsg:"gift_errorMsg__pEccq",greenText:"gift_greenText__QnxpI",form:"gift_form__z_Gtq",panel:"gift_panel__l_97f",imageBox:"gift_imageBox__WRtDS",bookCover:"gift_bookCover__68BW1",audioBookCover:"gift_audioBookCover__hOt6p",icon:"gift_icon__h5oES",confirmMessage:"gift_confirmMessage__ayQC4"}},1431:function(e){e.exports={giftShare:"share_giftShare__papIK",copyContainer:"share_copyContainer__HD43j"}}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=26291)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.