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AAW,GACH,EAAKN,SAAS,CACVL,WAAW,IAEfY,QAAQC,IAAIF,GACZD,EAAAA,EAAAA,MAAY,wD,oBAIxB,WAAS,IACDoD,EACAK,EAFC,OA8BL,OA1BK/D,KAAKL,MAAM+D,MAAMb,QAAW7C,KAAKL,MAAMC,YACxCmE,EAAS,2FAGT/D,KAAKL,MAAM+D,MAAMb,SACjBa,EAAQ,+BAAK3C,UAAU,OACnB,+BAAKA,UAAU,gCACX,+BAAKA,UAAU,wBACX,8BAAIA,UAAU,eAAef,KAAKL,MAAM+D,MAAMb,OAA9C,QAAuF,IAA5B7C,KAAKL,MAAM+D,MAAMb,OAAe,GAAK,IAAhG,UACA,+BAAK9B,UAAU,cACX,sIAEJ,6BAAGA,UAAU,uEAAuEiD,KAAI,+DAA0D9D,EAAAA,EAAAA,IAAeuC,OAAO,SAAQ,qDAChL,wBAAC,EAAD,CAAkBJ,GAAInC,EAAAA,EAAAA,OAG7BF,KAAKL,MAAM+D,MAAMZ,KAAI,SAACmB,EAASC,GAAV,OAClB,wBAAC,GAAD,QAAiBC,IAAKD,GAAWD,EAAjC,CAA0CG,SAAQ,qCAAgCF,GAAS7D,SAAU,EAAKsD,qBAKlH3D,KAAKL,MAAMC,YACXmE,EAAS,wBAAC,IAAD,CAAexC,MAAM,KAI9B,+BAAKZ,MAAM,aACP,8BAAIA,MAAM,WAAWX,KAAKN,MAAM2E,OAC/BX,EACAK,O,EAnFXN,CAAwBxC,EAAAA","sources":["webpack://Vollrath.Kentico.Web/./js/shared/react/components/wishlist-product-item.jsx","webpack://Vollrath.Kentico.Web/./js/shared/react/components/wishlist-csv-modal.jsx","webpack://Vollrath.Kentico.Web/./js/shared/apis/wishlist.js","webpack://Vollrath.Kentico.Web/./js/shared/react/pages/wishlist-landing.jsx"],"sourcesContent":["import React, { Component } from \"react\";\r\nimport ProductBase from './product-base.jsx';\r\nimport wishlist from '../../components/wishlist';\r\nimport toast from '../../components/toast';\r\n\r\nclass WishlistProduct extends Component {\r\n    constructor(props) {\r\n        super(props);\r\n\r\n        this.state = {\r\n            isLoading: false\r\n        };\r\n\r\n        this.handleDeleteClick = this.handleDeleteClick.bind(this);\r\n    }\r\n\r\n    handleDeleteClick(e) {\r\n        this.setState({\r\n            isLoading: true\r\n        });\r\n\r\n        wishlist.delete(this.props.skuNumber)\r\n            .then(() => {\r\n                this.props.onDelete();\r\n                toast.success('Removed from your wish list');\r\n            })\r\n            .catch(error => {\r\n                console.log(error);\r\n                toast.error('There was an error trying to remove this product');\r\n            })\r\n            .finally(() => {\r\n                this.setState({\r\n                    isLoading: false\r\n                });\r\n            });\r\n    }\r\n\r\n    render() {\r\n        const actions = <div class=\"full-card-actions\">\r\n            <button class=\"btn btn-outline-alt\" type=\"button\" onClick={this.handleDeleteClick} disabled={this.state.isLoading}>\r\n                <span>Remove</span> \r\n                <svg className=\"icon icon-trash\"><use xlinkHref=\"#icon-trash\"></use></svg>\r\n            </button>\r\n        </div>;\r\n\r\n        return (\r\n            <ProductBase {...this.props} actions={actions} />\r\n        );\r\n    }\r\n}\r\n\r\nWishlistProduct.defaultProps = {\r\n    onDelete: function () { }\r\n};\r\n\r\nexport default WishlistProduct;","import React, { Component } from \"react\";\r\nimport Magnific from './magnific.jsx';\r\nimport { postSendWishlistCSVEmail } from '../../apis/wishlist';\r\nimport toast from '../../components/toast';\r\n\r\nclass WishlistCSVModal extends Component {\r\n    constructor(props) {\r\n        super(props);\r\n\r\n        this.state = {\r\n            name: '',\r\n            email: '',\r\n            message: '',\r\n            show: false,\r\n            isSending: false,\r\n            errors: []\r\n        };\r\n\r\n        this.handleClick = this.handleClick.bind(this);\r\n        this.handleClose = this.handleClose.bind(this);\r\n        this.handleFormSubmit = this.handleFormSubmit.bind(this);\r\n        this.handleChange = this.handleChange.bind(this);\r\n\r\n        this.openBtn = React.createRef();\r\n    }\r\n\r\n    handleClick() {\r\n        this.setState({\r\n            show: true\r\n        });\r\n    }\r\n\r\n    handleClose() {\r\n        this.setState({\r\n            show: false\r\n        },\r\n            () => {\r\n                this.openBtn.current.focus();\r\n            });\r\n    }\r\n\r\n    handleFormSubmit(e) {\r\n        e.preventDefault();\r\n\r\n        if (!this.state.isSending) {\r\n            this.setState({\r\n                isSending: true,\r\n                errors: []\r\n            });\r\n\r\n            postSendWishlistCSVEmail({\r\n                wishlistId: this.props.id,\r\n                name: this.state.name,\r\n                email: this.state.email,\r\n                message: this.state.message\r\n            })\r\n                .then(json => {\r\n                    this.setState({\r\n                        isSending: false\r\n                    });\r\n\r\n                    if (json.success) {\r\n                        this.setState({\r\n                            name: '',\r\n                            email: '',\r\n                            message: '',\r\n                            show: false\r\n                        });\r\n                        toast.success('Your email will be sent shortly');\r\n                    }\r\n                    else {\r\n                        this.setState({\r\n                            errors: json.errors\r\n                        });\r\n                    }\r\n                })\r\n                .catch(error => {\r\n                    console.log(error);\r\n                    this.setState({\r\n                        isSending: false\r\n                    });\r\n                    toast.error('There was an issue sending your email. Please try again soon.');\r\n                });\r\n        }\r\n    }\r\n\r\n    handleChange(e) {\r\n        this.setState({\r\n            [e.target.name]: e.target.value\r\n        });\r\n    }\r\n\r\n    render() {\r\n        let errors;\r\n        const activator = <button className=\"btn btn-icon-left btn-email-bg btn-block\" type=\"button\" ref={this.openBtn} onClick={this.handleClick}><span>Share via Email</span></button>;\r\n\r\n        if (this.state.errors.length) {\r\n            errors = <ul className=\"error-list\">\r\n                {this.state.errors.map((error) => (\r\n                    <li>{error}</li>\r\n                ))}\r\n            </ul>;\r\n        }\r\n\r\n        return (\r\n            <Magnific activator={activator} type=\"inline\" show={this.state.show} onClose={this.handleClose}>\r\n                <div className=\"card padded rounded\">\r\n                    <div className=\"card-title-content\">\r\n                        <h3 className=\"heading\">Email your Wist List</h3>\r\n                    </div>\r\n                    <div className=\"card-text-content\">\r\n                        <p class=\"add-margin-btm\">Send your wish list to someone.</p>\r\n                        <form action=\"#\" method=\"post\" onSubmit={this.handleFormSubmit}>\r\n                            {errors}\r\n\r\n                            <div className=\"form-group\">\r\n                                <label htmlFor=\"name\">Your Name *</label>\r\n                                <input className=\"form-control\" type=\"text\" id=\"name\" name=\"name\" placeholder=\"John Doe\" required value={this.state.name} onChange={this.handleChange}/>\r\n                            </div>\r\n\r\n                            <div className=\"form-group\">\r\n                                <label htmlFor=\"email\">To Email *</label>\r\n                                <input className=\"form-control\" type=\"email\" id=\"email\" name=\"email\" placeholder=\"hello@vollrath.com\" required value={this.state.email} onChange={this.handleChange}/>\r\n                            </div>\r\n\r\n                            <div className=\"form-group\">\r\n                                <label htmlFor=\"message\">Message</label>\r\n                                <textarea className=\"form-control\" id=\"message\" name=\"message\" placeholder=\"Take a look at my wishlist!\" rows=\"3\" value={this.state.question} onChange={this.handleChange}></textarea>\r\n                            </div>\r\n\r\n                            <div className=\"form-actions\">\r\n                                <button className=\"btn\" disabled={this.state.isSending}>Send</button>\r\n                            </div>\r\n                        </form>\r\n                    </div>\r\n                </div>\r\n            </Magnific>\r\n        );\r\n    }\r\n}\r\n\r\nexport default WishlistCSVModal;","import jfetch from '@jontetz/jfetch';\r\n\r\nexport function postSendWishlistCSVEmail(data) {\r\n    return jfetch.post('/api/wishlist/sendcsv', data);\r\n}","import React, { Component } from 'react';\r\nimport { getCollection } from '../../apis/product-collection';\r\nimport LoaderSection from '../components/loader-section.jsx';\r\nimport WishlistProduct from '../components/wishlist-product-item.jsx';\r\nimport WishlistCSVModal from '../components/wishlist-csv-modal.jsx';\r\nimport toast from '../../components/toast';\r\nimport wishlist from '../../components/wishlist';\r\n\r\nclass WishlistLanding extends Component {\r\n    constructor(props) {\r\n        super(props);\r\n\r\n        this.state = {\r\n            isLoading: true,\r\n            items: []\r\n        };\r\n\r\n        this.handleDelete = this.handleDelete.bind(this);\r\n    }\r\n\r\n    componentDidMount() {\r\n        if (wishlist.id) {\r\n            this.load();\r\n        }\r\n        else {\r\n            this.setState({\r\n                isLoading: false\r\n            });\r\n        }\r\n    }\r\n\r\n    handleDelete() {\r\n        this.load();\r\n    }\r\n\r\n    load() {\r\n        this.setState({\r\n            isLoading: true\r\n        });\r\n\r\n        getCollection(wishlist.id)\r\n            .then(data => {\r\n                console.log(data);\r\n                this.setState({\r\n                    items: data.products,\r\n                    isLoading: false\r\n                });\r\n            })\r\n            .catch(error => {\r\n                this.setState({\r\n                    isLoading: false\r\n                });\r\n                console.log(error);\r\n                toast.error('There was an issue getting your wish list items');\r\n            });\r\n    }\r\n\r\n    render() {\r\n        let items,\r\n            loader;\r\n\r\n        if (!this.state.items.length && !this.state.isLoading) {\r\n            loader = <p>You haven't added any products to your Wish List yet.</p>;\r\n        }\r\n\r\n        if (this.state.items.length) {\r\n            items = <div className=\"row\">\r\n                <div className=\"col-xl-3 col-sm-6 order-xl-3\">\r\n                    <div className=\"panel add-margin-top\">\r\n                        <h3 className=\"panel-title\">{this.state.items.length} Item{this.state.items.length === 1 ? '' : 's'} Total</h3>\r\n                        <div className=\"panel-text\">\r\n                            <p>Download a CSV document of these products or share them via email by clicking the buttons below.</p>\r\n                        </div>\r\n                        <a className=\"btn btn-icon-left btn-csv-bg btn-block add-margin-btm add-margin-top\" href={`/api/productcollection/exportcollection?collectionId=${wishlist.id}`} target=\"blank\"><span>Download CSV</span></a>\r\n                        <WishlistCSVModal id={wishlist.id}/>\r\n                    </div>\r\n                </div>\r\n                {this.state.items.map((product, index) => (\r\n                    <WishlistProduct key={index} {...product} colClass={`col-lg-3 col-sm-6 order-lg-${index}`} onDelete={this.handleDelete} />\r\n                ))}\r\n            </div>;\r\n        }\r\n\r\n        if (this.state.isLoading) {\r\n            loader = <LoaderSection show={true} />;\r\n        }\r\n\r\n        return (\r\n            <div class=\"container\">\r\n                <h1 class=\"heading\">{this.props.title}</h1>\r\n                {items}\r\n                {loader}\r\n            </div>\r\n        );\r\n    }\r\n}\r\n\r\nexport default WishlistLanding;"],"names":["WishlistProduct","props","state","isLoading","handleDeleteClick","bind","e","this","setState","wishlist","skuNumber","then","onDelete","toast","error","console","log","actions","class","type","onClick","disabled","className","xlinkHref","Component","defaultProps","WishlistCSVModal","name","email","message","show","isSending","errors","handleClick","handleClose","handleFormSubmit","handleChange","openBtn","React","current","focus","data","preventDefault","wishlistId","id","jfetch","json","success","target","value","activator","ref","length","map","onClose","action","method","onSubmit","htmlFor","placeholder","required","onChange","rows","question","WishlistLanding","items","handleDelete","load","getCollection","products","loader","href","product","index","key","colClass","title"],"sourceRoot":""}