(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[55582],{155582:(e,o,l)=>{l.d(o,{Z:()=>T});var s=l(667294),t=l(412067);var i=l(512465),n=l(898781),r=l(19121),a=l(349700),c=l(129274),_=l(966113),d=l(883119),h=l(785893);const u=_.K_+"?source=block_dialogue";function f(e){return e.map((({full_name:e})=>e))}const m=function({users:e,onClose:o,onSubmit:l}){const s=(0,n.ZP)(),t=(0,h.jsx)("strong",{children:(0,i.Z)(f(e),s)},"userlist");return(0,h.jsxs)("form",{method:"post",children:[(0,h.jsxs)(d.xu,{padding:8,children:[(0,h.jsx)(d.xv,{children:(0,a.nk)(s._('If you block {{ users }}, you won\u2019t be able to follow each other or interact with each other\u2019s Pins.', 'description of blocking users', 'description of blocking users'),{users:t})}),(0,h.jsx)("br",{}),(0,h.jsx)("br",{}),(0,h.jsx)(d.xv,{children:(0,h.jsx)(d.rU,{display:"inlineBlock",href:u,underline:"hover",children:s._('Learn more', 'link to learn more about blocking', 'link to learn more about blocking')})})]}),(0,h.jsx)(d.xu,{padding:2,children:(0,h.jsxs)(d.kC,{alignItems:"stretch",justifyContent:"end",gap:{row:1,column:0},children:[(0,h.jsx)(d.zx,{fullWidth:!0,onClick:o,text:s._('Cancel', 'UserBlock.Cancel', 'cancel form')}),(0,h.jsx)(d.zx,{fullWidth:!0,color:"red",onClick:()=>{l()},text:s._('Block', 'UserBlock.Submit', 'submit form to block users'),type:"submit"})]})})]})};var p=l(174798);const g=({flagReason:e,flagType:o,onClose:l,selectedReason:u,status:g,users:k})=>{const x=(0,n.ZP)(),[P,b]=(0,s.useState)({}),{setModalTitle:A,setStatus:z}=(0,c.d)(),w=(0,r.Z)(),{id:T}=w.isAuth?w:{},j=k.filter((({id:e})=>P[e])),C=j.length>0;(0,s.useEffect)((()=>{(()=>{let e;[p.qb.SUBMITTED,p.qb.PROCESSING].includes(g)?e=x.ngettext('Block this person?', 'Block these people?', j.length, 'BlockAndUnfollow', 'Confirmation text when blocking users (plural)'):o===p.Vm.CONVERSATION&&(e=g===p.qb.COMPLETED?(0,a.nk)(x._('You\u2019ve blocked {{usernames}}', 'BlockAndUnfollow', 'title of modal after user has been blocked'),{usernames:(0,i.Z)(f(j),x).join("")}).join(""):x._('Thanks for your report', 'BlockAndUnfollow', 'title at end of report flow')),A(e)})()}),[g]),(0,s.useEffect)((()=>{z(C?p.qb.SELECTED:p.qb.STARTED)}),[P]);const v=k.filter((({id:e})=>e!==T)),y=[p.qb.STARTED,p.qb.COMPLETED].includes(g);return(0,h.jsx)("form",{method:"post",children:[p.qb.SUBMITTED,p.qb.PROCESSING].includes(g)?(0,h.jsx)(m,{onClose:()=>{z(p.qb.SELECTED)},onSubmit:()=>(z(p.qb.PROCESSING),Promise.all(Object.keys(P).filter((e=>P[e])).map((e=>function(e){return t.Z.create("UserBlockResource",{blocked_user_id:e}).callCreate().then((()=>{}),(()=>{}))}(e)))).finally((()=>{z(p.qb.COMPLETED)}))),users:j}):(0,h.jsxs)(d.xu,{padding:8,children:[(0,h.jsx)(d.xu,{children:g!==p.qb.COMPLETED?(()=>{let o;"harassingOther"===u?o=(0,a.nk)(x._('We remove content that identifies and attacks private people because we consider it to be bullying. We also don\u2019t allow content that reveal someone\u2019s personally identifiable information. Learn more about our {{ communityGuidelines }}.', 'confirmation message after reporting harassment', 'confirmation message after reporting harassment'),{communityGuidelines:(0,h.jsx)(d.rU,{display:"inlineBlock",href:_.Ms,underline:"hover",children:x._('Community Guidelines', 'link to community guidelines for harassment', 'link to community guidelines for harassment')},"policyLink")}):"harassingPublicFigure"===u?o=x._('Please note that we won\u2019t necessarily take down stuff that attacks public figures.', 'message shown after reporting harrassment', 'message shown after reporting harrassment'):"harassingFriend"===u?o=x._('Before we can review this Pin, we need to hear from the person who\u2019s being harassed. Please have your friend report this Pin to us.', 'message shown after reporting harrassment', 'message shown after reporting harrassment'):["spam","policies","hurtfulContent"].includes(e)&&(o=x._('We\u2019ll take a look at this Pin and delete it if it goes against our policies.', 'confirmation message after reporting a pin', 'confirmation message after reporting a pin'));const l=x.ngettext('You can also block this person.', 'You can also block these people.', v.length, 'description to block people', 'description to block people');return(0,h.jsxs)(s.Fragment,{children:[o&&(0,h.jsx)(d.xu,{marginBottom:8,children:(0,h.jsx)(d.xv,{children:o})}),(0,h.jsx)(d.xu,{marginBottom:8,children:(0,h.jsx)(d.xv,{children:l})}),(0,h.jsx)(d.xu,{marginBottom:8,children:v.map((({id:e,full_name:o})=>(0,h.jsx)(d.XZ,{id:"blockPinner"+e,checked:Boolean(P[e]),label:(0,a.nk)(x._('Block {{ pinnerName }}', 'BlockAndUnfollow', 'form option to block a pinner'),{pinnerName:o}).join(""),onChange:({checked:o})=>{b({...P,[e]:o})},helperText:x._('You won\u2019t be able to send each other messages or interact with each other\u2019s Pins.', 'BlockAndUnfollow', 'explanation of blocking a user')},e)))})]})})():C&&(0,h.jsx)(d.xu,{marginBottom:8,children:(0,h.jsx)(d.xv,{children:x._('You won\u2019t be able to follow each other or interact with each other\u2019s pins.', 'BlockAndUnfollow', 'message describing what blocking means')},"blockingConfirmation")})}),(0,h.jsxs)(d.xu,{children:[g!==p.qb.COMPLETED&&(0,h.jsx)(d.xu,{marginBottom:8,children:(0,h.jsx)(d.xv,{size:"100",children:(0,a.nk)(x._('Learn more about {{ linkToTopic }}', 'BlockAndUnfollow', 'footer link to learn more about a topic'),{linkToTopic:(0,h.jsx)(d.rU,{display:"inlineBlock",href:_.K_,underline:"hover",children:x._('blocking', 'BlockAndUnfollow', 'footer link to learn more about blocking')},"policyLink")})})}),(0,h.jsx)(d.xu,{children:(0,h.jsx)(d.zx,{fullWidth:!0,color:"red",onClick:y?l:()=>{b(P),z(p.qb.SUBMITTED)},text:y?x._('Done', 'Block.Complete', 'confirm reporting flow is done & close modal'):x._('Block', 'BlockAndUnfollow', 'submit users to block')})})]})]})})};function k({flagOptions:e,flow:o,handleClose:l,handleNext:s,selectedReason:t,showPrimaryAction:i,submitButton:r}){const a=(0,n.ZP)();if(o===p.Zw.REPORT){var c;if(p.qb.PROCESSING===status||null!==(c=e.getFlagOption(t))&&void 0!==c&&c.isTerminalReason)return r;if(i)return(0,h.jsx)(d.zx,{fullWidth:!0,color:"red",disabled:void 0===t,onClick:s,text:a._('Next', 'go to the next view in the report flow', 'go to the next view in the report flow')})}else if(o===p.Zw.END)return(0,h.jsx)(d.zx,{fullWidth:!0,color:"red",onClick:l,text:a._('Got it', 'confirm reporting flow is done & close modal', 'confirm reporting flow is done & close modal')});return null}var x=l(121151);function P({flow:e,flagReason:o}){const l=(0,n.ZP)();if(e===p.Zw.REPORT){if("attacks"===o)return(0,h.jsx)(d.xv,{size:"100",children:(0,a.nk)(l._('Learn more about our {{ linkToTopic }}', 'footer link to learn more about community guidelines', 'footer link to learn more about community guidelines'),{linkToTopic:(0,h.jsx)(d.rU,{target:"blank",href:_.Ms,children:(0,h.jsx)(d.xv,{inline:!0,color:"error",size:"100",weight:"bold",children:l._('Community Guidelines', 'name of footer link to community guidelines', 'name of footer link to community guidelines')})},"policyLink")})});if("policies"===o)return(0,h.jsxs)("p",{children:[(0,h.jsx)(d.xv,{size:"100",children:(0,a.nk)(l._('Learn about {{ linkToTopic }}', 'footer link to learn more about a topic', 'footer link to learn more about a topic'),{linkToTopic:(0,h.jsx)(d.rU,{target:"blank",href:_.Ms+"#sub-section-adult-content",children:(0,h.jsx)(d.xv,{inline:!0,color:"error",size:"100",children:l._('our nudity policies', 'name of footer link to policy', 'name of footer link to policy')})},"policyLink")})}),(0,h.jsx)(d.xv,{size:"100",children:(0,a.nk)(l._('Learn about {{ linkToTopic }}', 'footer link to learn more about a topic', 'footer link to learn more about a topic'),{linkToTopic:(0,h.jsx)(d.rU,{target:"blank",href:_.Ms+"#sub-section-dangerous-goods-and-activities",children:(0,h.jsx)(d.xv,{inline:!0,color:"error",size:"100",children:l._('our policies on hurtful content', 'name of footer link to policy', 'name of footer link to policy')})},"policyLink")})}),(0,h.jsx)(d.xv,{size:"100",children:(0,a.nk)(l._('Learn about {{ linkToTopic }}', 'footer link to learn more about a topic', 'footer link to learn more about a topic'),{linkToTopic:(0,h.jsx)(d.rU,{target:"blank",href:_.Ms+"#sub-section-violence",children:(0,h.jsx)(d.xv,{inline:!0,color:"error",size:"100",children:l._('our policies on gore', 'name of footer link to policy', 'name of footer link to policy')})},"policyLink")})})]});if("spam"===o||void 0===o)return(0,h.jsx)(d.xv,{size:"100",children:(0,a.nk)(l._('Learn about {{ linkToTopic }}', 'footer link to learn more about a topic', 'footer link to learn more about a topic'),{linkToTopic:(0,h.jsx)(d.rU,{target:"blank",href:_.Ms,children:(0,h.jsx)(d.xv,{inline:!0,color:"error",size:"100",weight:"bold",children:"spam"===o?l._('our spam policies', 'name of footer link to policy', 'name of footer link to policy'):l._('our policies', 'name of footer link to policy', 'name of footer link to policy')})},"policyLink")})})}return null}function b({arrayOfData:e,handleSelectReason:o,selectedReason:l}){const s=(0,n.ZP)();return(0,h.jsx)(d.xu,{padding:2,children:(0,h.jsx)(d.FX,{id:"flag-option-radio-group",legend:s._('Flag legends', 'flag_legend', 'Flag legends'),legendDisplay:"hidden",children:e.map(((e,s)=>{const{condition:t}=e;return void 0===t||t?function(e,o,l,s){const{text:t,value:i,category:n}=e;return(0,h.jsx)(d.xu,{paddingY:2,children:(0,h.jsx)(d.FX.RadioButton,{checked:l===i,id:i,onChange:({checked:e})=>o(e,i,n),name:"flagReason",value:i,label:t})},s)}(e,o,l,s):null}))})})}class A{constructor(e){this.config=e,this.configMap=function(e){const o={};for(const l in e)e[l].forEach((e=>{const s=e.value;if(Object.prototype.hasOwnProperty.call(o,s))throw new Error("Duplicate key in FlagOptions config: "+s);o[s]={...e,parentOption:l}}));return o}(e)}getFlagOption(e){return e?this.configMap[e]:null}renderFlagLabels(e){const{flagReason:o,onSelectReason:l,selectedReason:s}=e;return(0,h.jsx)(b,{arrayOfData:this.config[o],handleSelectReason:l,selectedReason:s})}}function z(e,o,l){return o in e?Object.defineProperty(e,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[o]=l,e}class w extends s.Component{constructor(...e){super(...e),z(this,"flagOptions",new A(this.props.flagOptionsConfig)),z(this,"renderContent",(()=>{const{content:e,flow:o,onSelectReason:l,selectedReason:s}=this.props;return e||(o===p.Zw.REPORT?this.flagOptions.renderFlagLabels({flagReason:this.props.flagReason||"__default",onSelectReason:l,selectedReason:s}):o===p.Zw.END?(0,h.jsx)(d.xv,{children:this.props.i18n._('We\u2019ll use your feedback to make your Pinterest experience better.', 'final message in reporting flow', 'final message in reporting flow')}):void 0)}))}componentDidUpdate(e){const{flow:o,onCompletedReport:l,onCompletedBlock:s}=e;if(this.props.flow!==o)switch(o){case p.Zw.REPORT:l&&l();break;case p.Zw.BLOCK:s&&s()}}render(){const{accessibilityModalLabel:e,flagType:o,flow:l,status:s,modalTitle:t,onClose:i,selectedReason:n,submitButton:r,flagReason:a,showPrimaryAction:c,users:_}=this.props;return(0,h.jsx)(x.ZP,{accessibilityModalLabel:e,heading:t,onDismiss:i,size:"md",footer:l!==p.Zw.BLOCK?(0,h.jsxs)(d.kC,{alignItems:"center",justifyContent:"start",children:[(0,h.jsx)(d.xu,{flex:"grow",children:(0,h.jsx)(P,{flagReason:a,flow:l})}),(0,h.jsx)(d.xu,{padding:1,children:l===p.Zw.REPORT?(0,h.jsx)(d.zx,{fullWidth:!0,onClick:void 0===a?this.props.onClose:()=>{var e,o;null===(e=(o=this.props).onRevert)||void 0===e||e.call(o)},text:void 0===a?this.props.i18n._('Cancel', 'cancel form', 'cancel form'):this.props.i18n._('Back', 'previous step in a form', 'previous step in a form')}):null}),(0,h.jsx)(d.xu,{padding:1,children:(0,h.jsx)(k,{flagOptions:this.flagOptions,flow:l,handleClose:this.props.onClose,handleNext:()=>{var e,o;null===(e=(o=this.props).onNext)||void 0===e||e.call(o)},selectedReason:n,showPrimaryAction:!!c,submitButton:r})})]}):void 0,children:(0,h.jsx)(d.xu,{children:l===p.Zw.BLOCK?(0,h.jsx)(g,{flagReason:a,flagType:o,onClose:i,selectedReason:n,status:s,users:_}):this.renderContent()})})}}function T(e){const o=(0,n.ZP)();return(0,h.jsx)(w,{...e,i18n:o})}},129274:(e,o,l)=>{l.d(o,{N:()=>c,d:()=>a});var s=l(667294),t=l(425288),i=l(174798),n=l(785893);const{Provider:r,useHook:a}=(0,t.Z)("Flag"),c=({children:e})=>{const[o,l]=(0,s.useState)(),[t,a]=(0,s.useState)(i.Zw.REPORT),[c,_]=(0,s.useState)(i.qb.STARTED),[d,h]=(0,s.useState)(),[u,f]=(0,s.useState)(),m=(0,s.useMemo)((()=>({flagReason:u,flow:t,status:c,selectedReason:d,modalTitle:o,setFlagReason:f,setFlow:a,setModalTitle:l,setStatus:_,setSelectedReason:h})),[o,t,c,d,u]);return(0,n.jsx)(r,{value:m,children:e})}},174798:(e,o,l)=>{l.d(o,{Vm:()=>i,Zw:()=>s,qb:()=>t});const s={REPORT:"REPORT",BLOCK:"BLOCK",END:"END"},t={STARTED:"STARTED",SELECTED:"SELECTED",SUBMITTED:"SUBMITTED",PROCESSING:"PROCESSING",COMPLETED:"COMPLETED"},i={CONVERSATION:"CONVERSATION",DID_IT:"DID_IT"}},512465:(e,o,l)=>{l.d(o,{Z:()=>_,w:()=>d});var s=l(349700);const t=e=>e._('{{ first }}', 'Generic message that lists 1 item', 'Generic message that lists 1 item (ex: Stevie)'),i=e=>e._('{{ first }} and {{ second }}', 'Generic message that lists 2 items', 'Generic message that lists 2 items (ex: Stevie and Michael)'),n=e=>e._('{{ first }}, {{ second }} and {{ third }}', 'Generic message that lists 3 items', 'Generic message that lists 3 items (ex: Stevie, Michael and Cyndi)'),r=e=>e._('{{ first }}, {{ second }}, {{ third }} and {{ fourth }}', 'Generic message that lists 4 items', 'Generic message that lists 4 items (ex: Stevie, Michael, Cyndi and Bob)'),a=e=>e._('{{ first }}, {{ second }}, {{ third }}, {{ fourth }} and {{ fifth }}', 'Generic message that lists 5 items', 'Generic message that lists 5 items (ex: Stevie, Michael, Cyndi, Bob and Bruce)'),c=e=>e._('{{ first }}, {{ second }}, {{ third }}, {{ fourth }}, {{ fifth }} and {{ sixth }}', 'Generic message that lists 6 items', 'Generic message that lists 6 items (ex: Stevie, Michael, Cyndi, Bob, Bruce and Lionel)');function _(e,o){const l={first:e[0],second:e[1],third:e[2],fourth:e[3],fifth:e[4],sixth:e[5],remaining:e.length-5};switch(e.length){case 0:return[];case 1:return(0,s.nk)(t(o),l);case 2:return(0,s.nk)(i(o),l);case 3:return(0,s.nk)(n(o),l);case 4:return(0,s.nk)(r(o),l);case 5:return(0,s.nk)(a(o),l);case 6:return(0,s.nk)(c(o),l);default:return(0,s.nk)((e=>e._('{{ first }}, {{ second }}, {{ third }}, {{ fourth }}, {{ fifth }} and {{ remaining }} others', 'Generic message that lists more than 6 items', 'Generic message that lists more than 6 items (ex: Stevie, Michael, Cyndi, Bob, Bruce and 2 others)'))(o),l)}}function d(e,o){const l={first:e[0],second:e[1],third:e[2],fourth:e[3],fifth:e[4],sixth:e[5],seventh:e[6],remaining:e.length-6};switch(e.length){case 0:return[];case 1:return(0,s.nk)(t(o),l);case 2:return(0,s.nk)(i(o),l);case 3:return(0,s.nk)(n(o),l);case 4:return(0,s.nk)(r(o),l);case 5:return(0,s.nk)(a(o),l);case 6:return(0,s.nk)(c(o),l);case 7:return(0,s.nk)((e=>e._('{{ first }}, {{ second }}, {{ third }}, {{ fourth }}, {{ fifth }}, {{ sixth }} and {{ seventh }}', 'Generic message that lists 7 items', 'Generic message that lists 7 items (ex: Stevie, Michael, Cyndi, Bob, Bruce, Lionel and Tina)'))(o),l);default:return(0,s.nk)((e=>e._('{{ first }}, {{ second }}, {{ third }}, {{ fourth }}, {{ fifth }}, {{ sixth }} and {{ remaining }} others', 'Generic message that lists more than 7 items', 'Generic message that lists more than 7 items (ex: Stevie, Michael, Cyndi, Bob, Bruce, Lionel and 2 others)'))(o),l)}}}}]); //# sourceMappingURL=https://sm.pinimg.com/webapp/55582-e8781c26ad4f3632.mjs.map