1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1689],{41899:function(e,t,a){"use strict";var r=a(64836);t.Z=void 0;var i=r(a(64938)),s=a(85893);t.Z=(0,i.default)((0,s.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy")},16023:function(e,t,a){"use strict";var r=a(64836);t.Z=void 0;var i=r(a(64938)),s=a(85893);t.Z=(0,i.default)((0,s.jsx)("path",{d:"M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3m-3 11H8v-5h8zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m-1-9H6v4h12z"}),"Print")},22961:function(e,t,a){"use strict";var r=a(64836);t.Z=void 0;var i=r(a(64938)),s=a(85893);t.Z=(0,i.default)((0,s.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility")},45843:function(e,t,a){"use strict";a.d(t,{Z:function(){return C}});var r=a(63366),i=a(87462),s=a(67294),n=a(90512),o=a(93427),l=a(94581),c=a(98216),d=a(21964),h=a(71657),u=a(90948),p=a(45154),x=a(22104);function getSwitchUtilityClass(e){return(0,x.ZP)("MuiSwitch",e)}let m=(0,p.Z)("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]);var g=a(85893);let v=["className","color","edge","size","sx"],useUtilityClasses=e=>{let{classes:t,edge:a,size:r,color:s,checked:n,disabled:l}=e,d={root:["root",a&&`edge${(0,c.Z)(a)}`,`size${(0,c.Z)(r)}`],switchBase:["switchBase",`color${(0,c.Z)(s)}`,n&&"checked",l&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},h=(0,o.Z)(d,getSwitchUtilityClass,t);return(0,i.Z)({},t,h)},Z=(0,u.ZP)("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,a.edge&&t[`edge${(0,c.Z)(a.edge)}`],t[`size${(0,c.Z)(a.size)}`]]}})(({ownerState:e})=>(0,i.Z)({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"}},"start"===e.edge&&{marginLeft:-8},"end"===e.edge&&{marginRight:-8},"small"===e.size&&{width:40,height:24,padding:7,[`& .${m.thumb}`]:{width:16,height:16},[`& .${m.switchBase}`]:{padding:4,[`&.${m.checked}`]:{transform:"translateX(16px)"}}})),f=(0,u.ZP)(d.Z,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.switchBase,{[`& .${m.input}`]:t.input},"default"!==a.color&&t[`color${(0,c.Z)(a.color)}`]]}})(({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${"light"===e.palette.mode?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${m.checked}`]:{transform:"translateX(20px)"},[`&.${m.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${"light"===e.palette.mode?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${m.checked} + .${m.track}`]:{opacity:.5},[`&.${m.disabled} + .${m.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${"light"===e.palette.mode?.12:.2}`},[`& .${m.input}`]:{left:"-100%",width:"300%"}}),({theme:e,ownerState:t})=>(0,i.Z)({"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,l.Fq)(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"default"!==t.color&&{[`&.${m.checked}`]:{color:(e.vars||e).palette[t.color].main,"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,l.Fq)(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${m.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t.color}DisabledColor`]:`${"light"===e.palette.mode?(0,l.$n)(e.palette[t.color].main,.62):(0,l._j)(e.palette[t.color].main,.55)}`}},[`&.${m.checked} + .${m.track}`]:{backgroundColor:(e.vars||e).palette[t.color].main}})),j=(0,u.ZP)("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(e,t)=>t.track})(({theme:e})=>({height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}
1),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${"light"===e.palette.mode?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${"light"===e.palette.mode?.38:.3}`})),b=(0,u.ZP)("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),w=s.forwardRef(function(e,t){let a=(0,h.Z)({props:e,name:"MuiSwitch"}),{className:s,color:o="primary",edge:l=!1,size:c="medium",sx:d}=a,u=(0,r.Z)(a,v),p=(0,i.Z)({},a,{color:o,edge:l,size:c}),x=useUtilityClasses(p),m=(0,g.jsx)(b,{className:x.thumb,ownerState:p});return(0,g.jsxs)(Z,{className:(0,n.Z)(x.root,s),sx:d,ownerState:p,children:[(0,g.jsx)(f,(0,i.Z)({type:"checkbox",icon:m,checkedIcon:m,ref:t,ownerState:p},u,{classes:(0,i.Z)({},x,{root:x.switchBase})})),(0,g.jsx)(j,{className:x.track,ownerState:p})]})});var C=w},53184:function(e,t,a){"use strict";a.d(t,{Z:function(){return f}});var r=a(87462),i=a(63366),s=a(67294),n=a(90512),o=a(93427),l=a(44063),c=a(71657),d=a(90948),h=a(45154),u=a(22104);function getTableHeadUtilityClass(e){return(0,u.ZP)("MuiTableHead",e)}(0,h.Z)("MuiTableHead",["root"]);var p=a(85893);let x=["className","component"],useUtilityClasses=e=>{let{classes:t}=e;return(0,o.Z)({root:["root"]},getTableHeadUtilityClass,t)},m=(0,d.ZP)("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-header-group"}),g={variant:"head"},v="thead",Z=s.forwardRef(function(e,t){let a=(0,c.Z)({props:e,name:"MuiTableHead"}),{className:s,component:o=v}=a,d=(0,i.Z)(a,x),h=(0,r.Z)({},a,{component:o}),u=useUtilityClasses(h);return(0,p.jsx)(l.Z.Provider,{value:g,children:(0,p.jsx)(m,(0,r.Z)({as:o,className:(0,n.Z)(u.root,s),ref:t,role:o===v?null:"rowgroup",ownerState:h},d))})});var f=Z},34535:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/compte/cartes-cadeau-imprimable",function(){return a(45823)}])},45823:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSP:function(){return G},default:function(){return GiftCardsPrintable}});var r=a(91309),i=a(85893),s=a(2962),n=a(67294),o=a(73481),l=a(21214),c=a(9992),d=a(43902),h=a(84391),u=a(75431),p=a(93946),x=a(41899),m=a(22961),g=a(45843),v=a(50480),Z=a(7906),f=a(295),j=a(53252),b=a(72882),w=a(53184),C=a(53816),_=a(71929),k=a(33299),S=a(29496),y=a(30381),N=a.n(y),$=a(90050),M=a(16898),P=a(69417),R=a(64666),z=a(31425),E=a(6514),H=a(37645),T=a(89755),D=a.n(T),B=a(16023),G=!0;function GiftCardsPrintable(){var e=(0,r._)((0,n.useState)(null),2),t=e[0],a=e[1],y=(0,r._)((0,n.useState)(!1),2),T=y[0],G=y[1],U=(0,r._)((0,n.useState)(null),2),A=U[0],O=U[1],Y=(0,r._)((0,n.useState)(null),2),I=Y[0],W=Y[1],F=(0,r._)((0,n.useState)("A.jpg"),2),L=F[0],V=F[1],X=(0,k.useSession)().data,q=(0,_.Z)({session:X}),J=q.giftCardsPrint,Q=q.isLoadingGiftCards,K=q.isErrorGiftCards,ee=(0,n.useRef)(null),et=(0,n.useRef)(null),ea=(0,S.Ds)().enqueueSnackbar,showSnackbar=function(e,t){ea(t,{variant:e})},giftCardMapper=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=[],r=0;return e.length>0?(e.forEach(function(e){if(e.date_limite&&(t||!e.isExpired)){var i;r=(0,$.xG)(parseFloat(e.valeur)-parseFloat(e.solde_utilise)),a.push((i=e.code,{code:i,date:N()(e.date_limite.date).format("DD/MM/YYYY"),value:(0,$.xG)(e.valeur),balance:r,imgName:e.image}))}}),a.reverse()):null},handleCloseModalPrintCard=function(){G(!1)};return(0,n.useEffect)(function(){if(T){var e=ee.current;null!==e&&e.focus()}},[T]),(0,n.useEffect)(function(){J&&a(giftCardMapper(J,!1))},[J]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.PB,{title:"Cartes cadeau imprimable | Book dâOreille, votre libraire audio",description:""}),(0,i.jsxs)(l.Z,{maxWidth:"xl",children:[(0,i.jsx)(o.Z,{size:"xs"}),(0,i.jsxs)(c.Z,{children:[(0,i.jsx)("div",{children:(0,i.jsx)(d.Z,{})}),(0,i.jsx)("div",{children:(0,i.jsxs)(h.Z,{children:[(0,i.jsx)(u.Z,{children:"Cartes cadeau imprimable"}),J.length>0&&(0,i.jsx)(v.Z,{control:(0,i.jsx)(g.Z,{onChange:function(e){a(giftCardMapper(J,e.target.checked))},inputProps:{"aria-label":"controlled"}}),label:"Afficher les cartes cadeau expir\xe9es"}),Q&&(0,i.jsx)(b.Z,{className:"table-container-custom",children:(0,i.jsxs)(Z.Z,{sx:{minWidth:340},"aria-label":"Liste des cartes cadeaux",className:"table-custom",children:[(0,i.jsx)(w.Z,{children:(0,i.jsxs)(C.Z,{children:[(0,i.jsx)(j.Z,{children:"\xa0"}),(0,i.jsx)(j.Z,{align:"right",children:"\xa0"}),(0,i.jsx)(j.Z,{align:"right",children:"\xa0"})]})}),(0,i.jsxs)(f.Z,{children:[(0,i.jsxs)(C.Z,{children:[(0,i.jsx)(j.Z,{component:"th",scope:"row",children:"\xa0"}),(0,i.jsx)(j.Z,{align:"right",children:"\xa0"}),(0,i.jsx)(j.Z,{align:"right",children:"\xa0"})]},"loadingGiftCardRow1"),(0,i.jsxs)(C.Z,{children:[(0,i.jsx)(j.Z,{component:"th",scope:"row",children:"\xa0"}),(0,i.jsx)(j.Z,{align:"right",children:"\xa0"}),(0,i.jsx)(j.Z,{align:"right",children:"\xa0"})]},"loadingGiftCardRow2"),(0,i.jsxs)(C.Z,{children:[(0,i.jsx)(j.Z,{component:"th",scope:"row",children:"\xa0"}),(0,i.jsx)(j.Z,{align:"right",children:"\xa0"}),(0,i.jsx)(j.Z,{align:"right",children:"\xa0"})]},"loadingGiftCardRow3")]})]})}),!Q&&t&&t.length>0&&(0,i.jsx)(b.Z,{className:"table-container-custom",children:(0,i.jsxs)(Z.Z,{sx:{minWidth:340},"aria-label":"Liste des cartes cadeaux",className:"table-custom "+M.tableCoupons,children:[(0,i.jsx)(w.Z,{children:(0,i.jsxs)(C.Z,{children:[(0,i.jsx)(j.Z,{children:"Code"}),(0,i.jsx)(j.Z,{align:"right",children:"Date limite"}),(0,i.jsx)(j.Z,{align:"right",children:"Montant"}),(0,i.jsx)(j.Z,{align:"right",children:(0,i.jsx)("strong",{children:"Solde restant"})})]})}),(0,i.jsx)(f.Z,{children:t.map(function(e){return(0,i.jsxs)(C.Z,{children:[(0,i.jsx)(j.Z,{component:"th",scope:"row",children:(0,i.jsxs)("div",{children:[(0,i.jsx)(p.Z,{color:"primary","aria-label":"add to shopping cart",onClick:function(){showSnackbar("success","Code copi\xe9 dans le presse-papier"),navigator.clipboard.writeText(e.code)},children:(0,i.jsx)(x.Z,{})}),(0,i.jsx)(p.Z,{color:"primary","aria-label":"add to shopping cart",onClick:function(){O(e.code),W(e.value),G(!0),V(e.imgName||"A.jpg")},children:(0,i.jsx)(m.Z,{})}),(0,i.jsx)("span",{children:e.code})]})}),(0,i.jsx)(j.Z,{align:"right",children:e.date}),(0,i.jsx)(j.Z,{align:"right",children:e.value}),(0,i.jsx)(j.Z,{align:"right",children:N()(e.date,"DD/MM/YYYY").diff(N()(Date.now()))>0?(0,i.jsx)("strong",{children:e.balance}):"Expir\xe9"})]},e.code)})})]})}),(0,i.jsx)(function(){if(!Q&&!K){if(0===J.length)return(0,i.jsx)("div",{className:M.containerNo
1Results,children:(0,i.jsx)("span",{children:"Aucune carte-cadeau trouv\xe9e"})});if(t&&0===t.length)return(0,i.jsx)("div",{className:M.containerNoResults,children:(0,i.jsx)("span",{children:"Aucune carte-cadeau active trouv\xe9e"})})}return null},{})]})})]}),(0,i.jsx)(o.Z,{}),(0,i.jsx)(o.Z,{size:"xl"}),(0,i.jsxs)(R.Z,{open:T,onClose:handleCloseModalPrintCard,scroll:"body","aria-labelledby":"scroll-dialog-title","aria-describedby":"scroll-dialog-description",disableScrollLock:!0,children:[(0,i.jsx)(H.Z,{id:"scroll-dialog-title",className:M.title,children:"Imprimez votre carte cadeau"}),(0,i.jsx)(E.Z,{dividers:!0,ref:et,className:M.dialogContent,children:(0,i.jsxs)("div",{className:M.imgWrapper,children:[(0,i.jsx)(D(),{src:"https://admin.bookdoreille.com/images_carte_cadeau/"+L,width:"1800",height:"1200",alt:"",className:M.imgWrapper__img}),(0,i.jsxs)("div",{className:M.info,children:[(0,i.jsx)("span",{className:M.amount,children:null==I?void 0:I.replace(/,0+/,"").replace(/,/,"")}),(0,i.jsx)("br",{}),(0,i.jsx)("span",{className:M.code,children:A})]})]})}),(0,i.jsxs)(z.Z,{className:M.actions,children:[(0,i.jsx)(P.Z,{onClick:handleCloseModalPrintCard,variant:"contained",color:"neutral",size:"medium",children:"Annuler"}),(0,i.jsx)(P.Z,{variant:"contained",startIcon:(0,i.jsx)(B.Z,{}),size:"medium",color:"primary",onClick:function(){et.current&&window.print()},children:"Imprimer"})]})]})]})]})}GiftCardsPrintable.auth=!0},16898:function(e){e.exports={containerNoResults:"coupons_containerNoResults__DPZSh",tableCoupons:"coupons_tableCoupons__RDZ4u",imgWrapper:"coupons_imgWrapper__NQ96t",info:"coupons_info__V0JuJ",amount:"coupons_amount__pPXUs",code:"coupons_code__EHROv",title:"coupons_title__lbEk2",actions:"coupons_actions__Fz7ot",dialogContent:"coupons_dialogContent__p1Ec9"}}},function(e){e.O(0,[1130,6261,5559,9774,2888,179],function(){return e(e.s=34535)}),_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.