1(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/newsletter-subscription"],{1766:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>g});var i=t(217),s=t(216),o=t(218),r=t.n(o),a=t(96),c=t(1767),l=t.n(c),d=t(731);const u="send_announce",p="send_personalized_announce",f=a.Locale.getSection("components.newsletter-subscription"),m=a.Locale.getTranslate("components.newsletter-subscription"),v=({dialogShown:e,consents:n,email:t,reportConsent:o,onClose:r,privacyPolicyUrl:a,isOpen:c})=>{const[v,g]=(0,s.useState)(null),S=()=>f.lmsg(y()?"reconfirmConsent":"consent",{privacyPolicy:f.lmsg("privacyPolicy")}),y=()=>n.some((e=>e.enabled&&e.type===u))&&!n.some((e=>e.enabled&&e.type===p)),w=y();return(0,s.jsxs)(i.Dialog,{isOpen:c,size:"sm",banner:l(),title:(0,s.jsx)(m,{content:w?"reconfirmTitle":"title"}),form:{state:v,onSubmit:async()=>{g("submit");const e=await o(t,p,S());g(null),e?(0,d.addToast)({intent:"success",message:(0,s.jsx)(m,{content:"subscribeMessage"})}):(0,d.addToast)({intent:"danger",message:(0,s.jsx)(m,{content:"errorMessage"})}),r(!!e||void 0)},submitButton:{children:(0,s.jsx)(m,{content:w?"reconfirmButton":"subscribeButton"})},cancelButton:{children:(0,s.jsx)(m,{content:"closeButton"})},hideRequiredLegend:!0},onClose:async()=>{if(v)return;const e=y();g("cancel");const n=await o(t,e?u:"none",S());g(null),n?e&&(0,d.addToast)({intent:"success",message:(0,s.jsx)(m,{content:"noReconfirmMessage"})}):(0,d.addToast)({intent:"danger",message:(0,s.jsx)(m,{content:"errorMessage"})}),r(!n&&void 0)},children:[!w&&(0,s.jsx)("p",{children:(0,s.jsx)(m,{content:"text"})}),y()?(0,s.jsx)(i.StatusMessage,{intent:"info",children:(0,s.jsx)(m,{content:"consentGivenInfo"})}):e&&!n.some((e=>e.enabled))?(0,s.jsx)(i.StatusMessage,{intent:"info",children:(0,s.jsx)(m,{content:"consentNotGivenInfo"})}):void 0,(0,s.jsx)("p",{children:(0,s.jsx)(m,{content:w?"reconfirmConsent":"consent",params:{privacyPolicy:(0,s.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",children:(0,s.jsx)(m,{content:"privacyPolicy"})})}})})]})};v.propTypes={isOpen:r().bool.isRequired,email:r().string.isRequired,reportConsent:r().func.isRequired,privacyPolicyUrl:r().string.isRequired,dialogShown:r().bool.isRequired,consents:r().array.isRequired,onClose:r().func.isRequired};const g=v},1765:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>v});var i=t(216),s=t(96),o=t(416),r=t(1766),a=t(218),c=t.n(a),l=t(373),d=t(1768),u=t.n(d);const p="plesk-newsletter-subscription-shown",f=async(e,n,t)=>{const i=new Date(Date.now()+864e5);o.default.set(p,1,i.toUTCString(),"/");try{const i=await s.api.post((0,s.prepareUrl)("/my-profile/report-consent"),{email:e,text:t,consent:n});return"error"!==i.status&&window.loadConsentStatus(),"error"!==i.status}catch{return!1}},m=({isShow:e,...n})=>{const[t,a]=(0,i.useState)(null),c=(0,i.useRef)([]),{data:{viewer:d,config:m}={}}=(0,l.useQuery)(u()),v=async(e,n=s.emptyFn)=>{c.current.push(n),a(await(async e=>{const{consents:n=[]}=await s.api.get((0,s.prepareUrl)("/my-profile/get-consent"),{email:e});return n})(e))};return(0,i.useEffect)((()=>{if(d?.client?.email)return e&&!o.default.get(p)&&v(d?.client?.email),(0,s.namespace)("PleskExt.Advisor").showNewsletterSubscription=e=>{v(d?.client?.email,e)},()=>{delete(0,s.namespace)("PleskExt.Advisor").showNewsletterSubscription}}),[d?.client?.email]),(0,i.jsx)(r.default,{isOpen:null!==t,consents:t||[],reportConsent:f,onClose:e=>{a(null),void 0!==e&&c.current.forEach((n=>n(e))),c.current=[]},privacyPolicyUrl:m?.product?.privacyPolicyUrl,email:d?.client?.email,...n})};m.propTypes={isShow:c().bool.isRequired};const v=m},1767:e=>{e.exports=Jsw.skinUrl+"/images/newsletter-subscription.png?b1de5a7718f72cdae8b90e2f38d2b322"},1768:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"NewsletterSubscription"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"viewer"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"login"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"client"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"config"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"product"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"privacyPolicyUrl"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:187}};n.loc.source={body:"query NewsletterSubscription {\n viewer {\n login\n client {\n email\n }\n }\n config {\n product {\n privacyPolicyUrl\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function t(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);
1else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&n.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){t(e,n)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){t(e,n)})),e.definitions&&e.definitions.forEach((function(e){t(e,n)}))}var i={};function s(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n,e.exports.NewsletterSubscription=function(e,n){var t={kind:e.kind,definitions:[s(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var o=i[n]||new Set,r=new Set,a=new Set;for(o.forEach((function(e){a.add(e)}));a.size>0;){var c=a;a=new Set,c.forEach((function(e){r.has(e)||(r.add(e),(i[e]||new Set).forEach((function(e){a.add(e)})))}))}return r.forEach((function(n){var i=s(e,n);i&&t.definitions.push(i)})),t}(n,"NewsletterSubscription")}}]); 2//# sourceMappingURL=newsletter-subscription.js.map?c43f2fa34e51386a395d
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.