orgmode-to-gemini-blog/exports/html/Récapitulatif de mon contenu twitter - Dragonfeu - Medium_fichiers/3735.afb7e926.chunk.js

2 lines
19 KiB
JavaScript
Raw Permalink Normal View History

2024-11-02 18:30:04 +01:00
"use strict";(self.webpackChunklite=self.webpackChunklite||[]).push([[3735],{16647:(e,t,n)=>{n.d(t,{h:()=>g});var i=n(64467),r=n(80296),l=n(55364),o=n.n(l),a=n(95420),s=n(96540),u=n(75636),c=n(11321),d=n(21335),m=n(72130),b=n(49287),v=n(91830),p=n(53301),w=n(99766);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){(0,i.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var g=function(e){var t=e.newsletterV3,n=e.creator,i=e.newsletterName,l=e.hideLinkInConfirmationToast,f=void 0!==l&&l,g=t||{},S=g.id,E=g.type,k=g.slug,y=g.collection,V=(null==t?void 0:t.user)||n,N=null!=i?i:null==t?void 0:t.name,O=s.useState(!1),x=(0,r.A)(O,2),T=x[0],A=x[1],P=(0,c.h)({newsletterSlug:k,collectionSlug:null==y?void 0:y.slug,username:null==V?void 0:V.username}),C=P.viewerEdge,D=P.loading,R=(0,u.z)({name:"enable_auto_follow_on_subscribe",placeholder:!1}),M=s.useState(!1),U=(0,r.A)(M,2),I=U[0],F=U[1];s.useEffect((function(){F(!(null==C||!C.isSubscribed))}),[null==C?void 0:C.isSubscribed]);var j=(0,m.$L)(),_=(0,b.jI)(),B=(0,v.zF)();T&&j.event("newsletterV3.subscribe.error",{newsletterV3Id:S});var L=function(e,t,n){if(n){var i={id:"User:".concat(null==V?void 0:V.id),fragment:p.fh,fragmentName:"useNewsletterV3Subscription_user"},r=e.readFragment(i);r&&e.writeFragment(h(h({},i),{},{data:h(h({},r),{},{newsletterV3:n})}))}if(C){var l=e.readQuery({query:w.k,variables:{newsletterSlug:k||"",collectionSlug:(null==y?void 0:y.slug)||null,username:(null==V?void 0:V.username)||null}}),a=o()({},l,{newsletterV3:{viewerEdge:{isSubscribed:t}}});e.writeQuery({query:w.k,variables:{newsletterSlug:k||"",collectionSlug:(null==y?void 0:y.slug)||null,username:(null==V?void 0:V.username)||null},data:a})}t&&null!=V&&V.id&&R&&(0,d.YG)(e,V.id,{isFollowing:!0})},z=(0,a.n)(p.yS,{optimisticResponse:{subscribeNewsletterV3:!0},onCompleted:function(e){var t=e.subscribeNewsletterV3;A(!t),t&&(j.event("newsletterV3.subscribeClicked",{newsletterV3Id:S,source:_}),F(!0))},update:function(e){L(e,!0)}}),G=(0,r.A)(z,1)[0],W=(0,a.n)(p.H$,{optimisticResponse:{unsubscribeNewsletterV3:!0},onCompleted:function(e){var t=e.unsubscribeNewsletterV3;A(!t),t&&(F(!1),B({duration:f?5e3:"NEXTPAGE",toastStyle:"NEWSLETTER_UNSUBSCRIBE",extraParams:{newsletterName:N||null,newsletterType:E||null,unsubscribeFn:function(){return F(!1)},hideEmailSettingsLink:f,hideCloseButton:f}}))},update:function(e){L(e,!1)}}),H=(0,r.A)(W,1)[0],$=(0,a.n)(p.vw,{onCompleted:function(e){var t=e.fetchOrLazilyCreateNewsletterV3AndMaybeSubscribe;A(!t),t&&(j.event("newsletterV3.subscribeClicked",{newsletterV3Id:t.id,source:_}),F(!0))},update:function(e,t){var n,i=h({},null===(n=t.data)||void 0===n?void 0:n.fetchOrLazilyCreateNewsletterV3AndMaybeSubscribe);L(e,!0,i)}}),q=(0,r.A)($,1)[0];return{isSubscribed:I,hasError:T,setSubscribe:function(e){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];A(!1),e&&!t&&null!=n&&n.id?q({variables:{userId:null==n?void 0:n.id}}):e&&null!=t&&t.id?G({variables:{newsletterV3Id:null==t?void 0:t.id,shouldRecordConsent:i}}):null!=t&&t.id?H({variables:{newsletterV3Id:null==t?void 0:t.id}}):A(!0)},loading:D}}},99766:(e,t,n)=>{n.d(t,{k:()=>r});var i=n(45458),r={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"NewsletterV3ViewerEdge"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"newsletterSlug"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"collectionSlug"}},type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},{ki
//# sourceMappingURL=https://stats.medium.build/lite/sourcemaps/3735.afb7e926.chunk.js.map