2024-10-03
This commit is contained in:
parent
93a452ec4a
commit
7b90cf9d33
64 changed files with 518 additions and 281 deletions
|
|
@ -1,2 +1,2 @@
|
|||
import{r as u,p as C,z as l,N as E}from"./index.Dxgx1GXj.js";import{x as t}from"./chunk-7BKSRZNG.F4GWJRq9.js";import{p as c}from"./index.C9ScFdVV.js";import{R as f}from"./api2.js";import{a as I,b as S,c as d,d as P,e as L,f as O,A as U}from"./dom.js";import{N as T,T as h}from"./messages3.js";import{a as v,r as _,b as i}from"./dom2.js";import{r as m,D as A,l as B,a as g,b as M,c as b,E as w,d as y}from"./erreurs.js";import{e as D,a as W}from"./gardes.js";import{v as k}from"./messages.js";import{p as j}from"./reseau.js";import{W as X}from"./cart-remove-item.js";import{W as x}from"./cart.js";import{i as N}from"./erreurs2.js";import{a as z,r as G}from"./utils.js";import{M as J,E as Q}from"./Either.DDEPhGsy.js";import"./exports.BNibT8R5.js";import"./messages2.js";const $=_etats,q=t(z(I),v),F=t(G(S),_),H=()=>{q.forEach(e=>{const s=J.fromNullable(e.getAttribute(d));i(e)(P).ifLeft(()=>t(new A(`L'entrée « ${s.orDefault("CLE_PANIER_INEXISTANTE")} » n'a pas de Bouton de suppression.`),m)).ifRight(o=>{o.addEventListener("click",()=>{const p=s.ifNothing(()=>{e.remove()}).orDefault("CLE_PANIER_INEXISTANTE");o.textContent="C= C= C= C= C=┌(;・ω・)┘",Q.encase(()=>c(X,{key:p})).map(R=>{j({corps:JSON.stringify(R),nonce:$.nonce,route:f}).then(async r=>{D(r)&&B("500 Server Error"),t(await r.json(),n=>l(n).with({body:E.select(),status:400},N,g).with({body:E.select(),status:401},N,M).with({body:E.select(),status:404},N,b).with(E._,a=>c(x,a)).otherwise(a=>t(a,w,y)),C("items_count"),u(n=>{new BroadcastChannel(T).postMessage({donnees:n,type:h.MiseAJourPanier}),e.remove()}))}).catch(r=>{W(r)?(m(r),console.error(r)):console.error("e n'est pas une Erreur ?!",r)})})})}),i(e)(L).ifLeft(()=>t(new A(`L'entrée « ${s.orDefault("CLE_PANIER_INEXISTANTE")} » n'a pas de Bouton de soustraction.`),m)).ifRight(o=>{o.addEventListener("click",()=>{t(i(e)(O),_)})})})},Y=()=>{const e=new BroadcastChannel(T);e.onmessage=s=>{k(s).ifRight(o=>{F.setAttribute(U,String(o.donnees!==0))})}};document.addEventListener("DOMContentLoaded",()=>{H(),Y()});
|
||||
import{r as d,p as k,z as p,N as s}from"./index.Dxgx1GXj.js";import{x as i}from"./chunk-7BKSRZNG.F4GWJRq9.js";import{p as A}from"./index.DYThEupQ.js";import{R as D,b as B}from"./api2.js";import{a as W,b as x,c as j,d as q,e as Q,f as z,g as G,A as F}from"./dom.js";import{N as b,T}from"./messages3.js";import{a as H,r as J,b as X}from"./dom2.js";import{l as R,a as f,b as g,c as S,E as O,d as I,r as h}from"./erreurs.js";import{e as P,a as U}from"./gardes.js";import{v as Y}from"./messages.js";import{p as v}from"./reseau.js";import{W as K}from"./cart-remove-item.js";import{W as M}from"./cart-update-item.js";import{W as y}from"./cart.js";import{e as n}from"./erreurs2.js";import{a as V,r as Z}from"./utils.js";import{M as C,E as L}from"./Either.DDEPhGsy.js";import"./exports.CqgMoAXr.js";import"./messages2.js";import"./cart2.js";const w=_etats,$=i(V(W),H),ee=i(Z(x),J),te=E=>u=>i(X(E)(u),J),re=()=>{$.forEach(E=>{const u=te(E),c=C.fromNullable(E.getAttribute(j)).ifNothing(()=>{E.remove()}).orDefault("CLE_PANIER_INEXISTANTE"),m=u(q),_=u(Q),N=u(z),o=u(G);o.addEventListener("click",()=>{o.textContent="C= C= C= C= C=┌(;・ω・)┘",L.encase(()=>A(K,{key:c})).map(l=>{v({corps:JSON.stringify(l),nonce:w.nonce,route:D}).then(async a=>{P(a)&&R("500 Server Error"),i(await a.json(),e=>p(e).with({body:s.select(),status:400},n,f).with({body:s.select(),status:401},n,g).with({body:s.select(),status:404},n,S).with(s._,r=>A(y,r)).otherwise(r=>i(r,O,I)),k("items_count"),d(e=>{console.debug("nombreArticlesPanier",e),new BroadcastChannel(b).postMessage({donnees:e,type:T.MiseAJourPanier}),E.remove()}))}).catch(a=>{U(a)?h(a):console.error("e n'est pas une Erreur ?!",a)})})}),m.addEventListener("click",()=>{C.fromNullable(_.valueAsNumber).filter(l=>l>1).ifJust(l=>{o.textContent="C= C= C= C= C=┌(;・ω・)┘",m.toggleAttribute("disabled"),N.toggleAttribute("disabled"),o.toggleAttribute("disabled"),L.encase(()=>A(M,{key:c,quantity:l-1})).map(a=>{v({corps:JSON.stringify(a),nonce:w.nonce,route:B}).then(async e=>{P(e)&&R("500 Server Error"),i(await e.json(),r=>p(r).with({body:s.select(),status:400},n,f).with({body:s.select(),status:401},n,g).with({body:s.select(),status:404},n,S).with(s._,t=>A(y,t)).otherwise(t=>i(t,O,I)),d(r=>{new BroadcastChannel(b).postMessage({donnees:r.items_count,type:T.MiseAJourPanier})}),d(r=>{C.fromNullable(r.items.find(t=>c===t.key)?.quantity).ifJust(t=>_.setAttribute("value",String(t))),m.toggleAttribute("disabled"),N.toggleAttribute("disabled"),o.toggleAttribute("disabled"),o.textContent="Remove"}))}).catch(e=>{U(e)?h(e):console.error("e n'est pas une Erreur ?!",e)})})})}),N.addEventListener("click",()=>{C.fromNullable(_.valueAsNumber).ifJust(l=>{o.textContent="C= C= C= C= C=┌(;・ω・)┘",m.toggleAttribute("disabled"),N.toggleAttribute("disabled"),o.toggleAttribute("disabled"),L.encase(()=>A(M,{key:c,quantity:l+1})).map(a=>{v({corps:JSON.stringify(a),nonce:w.nonce,route:B}).then(async e=>{P(e)&&R("500 Server Error"),i(await e.json(),r=>p(r).with({body:s.select(),status:400},n,f).with({body:s.select(),status:401},n,g).with({body:s.select(),status:404},n,S).with(s._,t=>A(y,t)).otherwise(t=>i(t,O,I)),d(r=>{new BroadcastChannel(b).postMessage({donnees:r.items_count,type:T.MiseAJourPanier})}),d(r=>{C.fromNullable(r.items.find(t=>c===t.key)?.quantity).ifJust(t=>_.setAttribute("value",String(t))),m.toggleAttribute("disabled"),N.toggleAttribute("disabled"),o.toggleAttribute("disabled"),o.textContent="Remove"}))}).catch(e=>{U(e)?h(e):console.error("e n'est pas une Erreur ?!",e)})})})})})},se=()=>{const E=new BroadcastChannel(b);E.onmessage=u=>{Y(u).ifRight(c=>{ee.setAttribute(F,String(c.donnees!==0))})}};document.addEventListener("DOMContentLoaded",()=>{re(),se()});
|
||||
//# sourceMappingURL=scripts-page-panier.js.map
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue