(window.webpackJsonp=window.webpackJsonp||[]).push([["2FxO"],{"26bL":function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.HIDE_PROGRAM_EVERYWHERE=void 0,t.hideProgramEverywhere=async function(e,t,n){try{var o;const a=await e(l,{variables:{programID:t,hide:n}});var r;if(null!=a&&null!=(o=a.hideProgramEverywhere)&&o.error)throw new s.KAError("hideProgramEverywhere returned an error",s.Errors.Internal,{cause:JSON.stringify(null==a||null==(r=a.hideProgramEverywhere)?void 0:r.error)})}catch(e){throw new s.KAError("Error hiding a program everywhere",s.Errors.Internal,{cause:e})}};var r=n("Xbru"),a=o(n("lTCR")),s=n("4PhQ");let i;const l=(0,r.gqlOp)((0,a.default)(i||(i=(e=>e)`
    mutation hideProgramEverywhere($programID: ID!, $hide: Boolean!) {
        hideProgramEverywhere(programID: $programID, hide: $hide) {
            error {
                code
                debugMessage
            }
        }
    }
`)));t.HIDE_PROGRAM_EVERYWHERE=l},"2Boh":function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.FEEDBACK_ANSWERS_QUERY=void 0;var r=n("Xbru"),a=o(n("lTCR"));let s;const i=(0,r.gqlOp)((0,a.default)(s||(s=(e=>e)`
    query FeedbackAnswers($parentKey: String!) {
        feedbackByKey(key: $parentKey) {
            ... on QuestionFeedback {
                answers {
                    isLocked
                    isPinned
                    replyCount
                    appearsAsDeleted
                    author {
                        id
                        kaid
                        nickname
                        avatar {
                            name
                            imageSrc
                        }
                    }
                    content
                    date
                    definitelyNotSpam
                    deleted
                    downVoted
                    expandKey
                    feedbackType
                    flaggedBy
                    flags
                    focusUrl
                    focus {
                        kind
                        id
                        translatedTitle
                        relativeUrl
                    }
                    fromVideoAuthor
                    key
                    lowQualityScore
                    notifyOnAnswer
                    permalink
                    qualityKind
                    replyCount
                    replyExpandKeys
                    showLowQualityNotice
                    sumVotesIncremented
                    upVoted
                }
            }
        }
    }
`)));t.FEEDBACK_ANSWERS_QUERY=i},"3qJ5":function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({flagType:e,message:t}){return r.createElement(s.View,{style:u.flag},r.createElement(i.default,{size:"small",icon:p}),r.createElement(s.View,{style:u.flagType},e),t&&r.createElement(s.View,{style:u.flagMessage},t))};var r=d(n("q1tI")),a=n("mR6N"),s=n("JimW"),i=o(n("yts4")),l=d(n("TqM9"));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}function d(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o}const p={small:"M4 11.775V15a1 1 0 0 1-2 0V2.66a1 1 0 0 1 .435-.826c1.04-.712 2.274-.968 3.701-.768 2.448.342 2.734 2.094 4.728 2.342 1.11.138 2.256-.05 3.436-.566a.5.5 0 0 1 .7.458v9.182a.5.5 0 0 1-.18.385c-1.097.914-2.416 1.275-3.956 1.083-2.439-.303-2.744-2.065-4.728-2.342A5.104 5.104 0 0 0 4 11.775zm6.617-6.382c-1.2-.15-1.981-.57-2.99-1.39l-.279-.228c-.596-.484-.907-.647-1.489-.729-.735-.103-1.34-.035-1.859.195v6.474c.807-.169 1.614-.2 2.413-.088 1.185.166 1.945.585 2.957 1.41l.239.195c.618.503.92.661 1.501.733.743.093 1.354.002 1.89-.274V5.323a7.902 7.902 0 0 1-2.383.07z"};const u=a.StyleSheet.create({flag:{display:"flex",flexDirection:"col",gap:"8px",margin:"8px 0"},flagType:{flexShrink:0},flagMessage:{borderColor:l.borderColor,borderLeftWidth:"2px",padding:"0 0 0 8px"}})},"5elA":function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ReplyList=t.CommentButton=void 0;var r=C(n("q1tI")),a=n("mR6N"),s=n("/MKj"),i=o(n("wa3X")),l=o(n("Pwnf")),c=n("Vxy9"),d=n("JimW"),p=o(n("gE8/")),u=n("hDgO"),f=C(n("TqM9")),g=o(n("y6Wz")),m=o(n("HbaH")),y=o(n("mXPZ")),h=o(n("b3m9")),w=o(n("qRKg")),b=o(n("uEGL")),E=n("DDFQ"),P=n("AE4M"),v=n("i4Cj");function k(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(k=function(e){return e?n:t})(e)}function C(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=k(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o}const S=e=>{const{postKey:t,replies:n,tab:o,topicSlug:a,resetNewPostKeyInfo:i,contentId:l,contentKind:c,restrictPosting:p,isLocked:u,isExpanded:f,containerId:h,gqlClient:w,viewMode:b}=e,E=(0,s.useSelector)((e=>e.fetchingRepliesStatus[t])),P="complete"===E||"partial"===E||"loading_next"===E;if((!E||"failed"===E||"complete"===E&&!(null!=n&&n.length))&&(!y.default.isLoggedIn||p))return null;if(f&&"loading_first"===E)return r.createElement(A,{style:[x.replyContainer,x.loading]});const v=[x.outerRepliesContainer,"compact"===b&&O.outerRepliesContainer];return r.createElement(d.View,{style:f?v:[x.collapsedReplyContainer,x.displayNone],id:h},r.createElement(d.View,{style:x.innerRepliesContainer},P&&(null==n?void 0:n.map(((t,n)=>r.createElement(d.View,{key:t},r.createElement(d.View,{style:x.replyContainer},r.createElement(g.default,{tab:o,postKey:t,newPostKey:e.newPostKey,resetNewPostKeyInfo:e.resetNewPostKeyInfo,topicSlug:e.topicSlug,restrictPosting:e.restrictPosting,moderatorMode:e.moderatorMode,viewMode:e.viewMode,isMaximized:e.isMaximized,autoFocusPostOnMount:0===n&&f}))))))),("partial"===E||"loading_next"===E)&&r.createElement(T,{postKey:t,gqlClient:w,status:E}),y.default.isLoggedIn&&!p&&!u&&r.createElement(d.View,{style:x.replyInputContainer},r.createElement(m.default,{autoFocus:f&&!(null!=n&&n.length),isReply:!0,tab:o,topicSlug:a,feedbackKey:t,resetNewPostKeyInfo:i,onPostSuccess:(e,t)=>{},contentKind:c,contentId:l,showAvatar:"compact"===b})))};t.ReplyList=S;t.CommentButton=e=>{var t,n;const{post:o,isExpanded:l,onClick:c,containerId:d,hideContributionButtons:p}=e,u=(0,s.useSelector)((e=>e.fetchingRepliesStatus[o.key])),f=u&&"complete"===u&&null!=(t=null==(n=o.replies)?void 0:n.length)?t:o.replyCount,g=(0,P.getRespondButtonSrString)(o,"comment"),m=o.replyCount&&o.replyCount>0?v.postStrings.getComments(null!=f?f:0):v.postStrings.comment,h=o.replyCount&&o.replyCount>0;return!h&&p?null:h||y.default.isLoggedIn?r.createElement(r.Fragment,null,r.createElement(i.default,{id:d,kind:"tertiary",onClick:c,"aria-expanded":l?"true":"false","aria-controls":d},m),r.createElement("label",{className:(0,a.css)(w.default.srOnly),htmlFor:d},g)):r.createElement(r.Fragment,null,r.createElement(i.default,{id:d,kind:"tertiary",onClick:c},m),r.createElement("label",{className:(0,a.css)(w.default.srOnly),htmlFor:d},v.strings.toolNavigateSignUp))};const T=e=>{const{postKey:t,gqlClient:n,status:o}=e,a=(0,s.useDispatch)(),l=(0,s.useSelector)((e=>e.posts[t].repliesCursor));return l?"loading_next"===o?r.createElement(A,{style:[x.replyContainer,x.loading,x.center]}):r.createElement(i.default,{kind:"tertiary","aria-label":"Load more comments",onClick:()=>{a((0,E.fetchRepliesPage)(t,n,{cursor:l}))}},v.strings.showMoreComments):null},A=({style:e})=>r.createElement(d.View,{style:e},r.createElement(h.default,{size:"xsmall",style:x.spinner,sentryId:"discussion_replies_load",description:"Loading discussion post replies",sentryTeam:"learning-platform"}),r.createElement("span",{className:(0,a.css)(c.styles.LabelLarge)},v.postStrings.loading)),x=a.StyleSheet.create({replyContainer:{marginBottom:2},loading:{flexDirection:"row",paddingTop:0,minHeight:48,alignItems:"center"},center:{justifyContent:"center"},spinner:{marginRight:p.default.xSmall_8},outerRepliesContainer:{backgroundColor:l.default.offWhite,marginTop:p.default.large_24,paddingTop:p.default.large_24,paddingLeft:p.default.large_24,paddingRight:p.default.large_24,maxHeight:"none",transition:`all ${u.standardTransition}`,[b.default.xsOrSmaller]:f.compactStyles.outerRepliesContainer},outerRepliesContainerWithAvatar:{[b.default.xsOrSmaller]:{marginLeft:-64}},collapsedReplyContainer:{paddingLeft:p.default.large_24,paddingRight:p.default.large_24,maxHeight:0,overflow:"hidden",transition:`all ${u.standardTransition}`,visibility:"hidden"},displayNone:{display:"none"},innerRepliesContainer:{marginBottom:2},replyInputContainer:{paddingBottom:p.default.large_24}}),O=a.StyleSheet.create(f.compactStyles);var I=S;t.default=I},"9QWv":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toGqlSortEnum=void 0;var o=n("A/Rc");t.toGqlSortEnum=e=>{switch(e){case"top-voted":return 1;case"recent":return 2;case"trending":return 5;default:throw(0,o.logUnreachableCode)("Unexpected sort type provided",e)}}},"Az/T":function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.DiscussionListStructuredData=t.DiscussionList=void 0;var r=o(n("pVnL")),a=T(n("q1tI")),s=n("/MKj"),i=n("mR6N"),l=o(n("wa3X")),c=n("yhei"),d=T(n("Pwnf")),p=n("Vxy9"),u=o(n("gE8/")),f=n("JimW"),g=n("Pk2J"),m=T(n("8jAt")),y=n("sExA"),h=o(n("y6Wz")),w=n("AE4M"),b=n("i4Cj"),E=T(n("TqM9")),P=o(n("cfQQ")),v=n("NVWR"),k=n("DDFQ"),C=o(n("M+bw"));function S(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(S=function(e){return e?n:t})(e)}function T(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=S(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o}n("LN89");class A extends a.Component{constructor(...e){super(...e),this.getPostsToShow=()=>{const{postKeys:e,newPostKey:t,tab:n,contentKind:o,profile:r}=this.props,a=r&&r.get("isModerator");return"clarifications"===n&&"Article"===o&&!a?e.filter((e=>e===t)):e},this.isCompactView=()=>"compact"===this.props.discussionContext.viewMode,this.isMaximized=()=>"maximized"===this.props.discussionContext.view,this.onClickSelectAll=()=>{const{onSelectPosts:e,postKeys:t}=this.props;e(t)},this.maybeRenderListHeader=e=>{const{tab:t,contentKind:n}=this.props;return e.length||"Video"!==n||"clarifications"!==t?null:a.createElement(p.LabelLarge,{style:E.clarificationsListHeader},b.miscStrings.clarificationListSuggested)},this.renderContent=e=>{const{fetchingPosts:t,newPostKey:n,resetNewPostKeyInfo:o,tab:r,topicSlug:s,discussionContext:d,clarificationsEnabled:u,onContentPage:g,setFocusOnTopLevelInput:m,profileLoading:y,profile:E,contentKind:P,hasUnansweredHelpRequests:v,includeCheckboxes:k,posts:C,onSelectProgramPost:S,selectedProgramKey:T}=this.props;if(!e.length){if(t)return a.createElement(c.CircularSpinner,{size:"medium",style:O.noPostsWrapper});const e=g&&(0,w.showMainDiscussionInput)(r,P,d,E,v);return a.createElement(f.View,{style:O.noPostsWrapper},a.createElement(p.LabelLarge,null,b.miscStrings.noPosts),e&&a.createElement(l.default,{onClick:m,style:O.noPostsButton},b.miscStrings.joinTheConversation))}const A=y||E&&E.get("isChildAccount"),I=k,M=I?[O.horizontalSeperator]:[O.post,!this.isCompactView()&&O.postExtraSpacing];return a.createElement(a.Fragment,null,a.createElement(x,{tab:r,posts:C}),a.createElement("ul",null,e.map((e=>a.createElement("li",{"data-test-id":"discussion-list-item",key:e,className:i.css.apply(void 0,M.concat([e===T&&O.programHighlighted]))},a.createElement("div",{className:(0,i.css)(I&&O.flagQueuePostWrapper)},a.createElement(h.default,{tab:r,postKey:e,newPostKey:n,resetNewPostKeyInfo:o,topicSlug:s,restrictPosting:null!=A&&A,clarificationsEnabled:u,isMaximized:this.isMaximized(),moderatorMode:d.moderatorMode,viewMode:d.viewMode,isProjectFeedback:d.showProjectFeedback,includeCheckbox:k,onSelectProgramPost:S,selectedProgramKey:T})))))))},this.renderMultiSelectors=()=>{const{selectedPosts:e}=this.props,t=(0,y.keys)(e).length>0?(0,y.values)(e).filter((e=>e)).length:0;return a.createElement(f.View,{style:O.selectionContainer},a.createElement(l.default,{kind:"secondary",size:"small",style:O.selectAllButton,onClick:this.onClickSelectAll},m._("Select all")),a.createElement(l.default,{kind:"secondary",size:"small",onClick:this.props.onDeselectAll},m._("Deselect all")),t>0&&a.createElement("div",{className:(0,i.css)(O.selectedTotal)},a.createElement(a.Fragment,null,t," "),a.createElement(a.Fragment,null,m._("Selected")," ")))}}componentDidUpdate(e,t,n){const{selectedPosts:o,onSelectedPostsChanged:r,postKeys:a,onDeselectAll:s,onSelectErroredPosts:i,erroredKeys:l}=this.props;r&&(a===e.postKeys||l||s(),o!==e.selectedPosts&&r(o),l&&l!==e.erroredKeys&&i(l))}render(){const{fetchingPosts:e,contentKind:t,isComplete:n,cursor:o,onNextPage:r,includeCheckboxes:s,gqlClient:i,posts:c}=this.props,d=this.getPostsToShow(),p=this.isMaximized(),u=s;return a.createElement(f.View,{style:[O.wrapper,p&&O.maximizedContainer]},s&&this.renderMultiSelectors(),a.createElement(f.View,{style:[!p&&E.listWrapper,!this.isCompactView()&&O.listWrapperExtraSpacing]},"Topic"===t&&a.createElement(w.EnglishLink,{style:O.englishLink}),this.maybeRenderListHeader(d),a.createElement(f.View,{style:u&&O.postsWrapper},this.renderContent(d))),o&&!n&&a.createElement(l.default,{onClick:()=>r(i),spinner:e&&0===c.length},b.miscStrings.showMoreComments))}}t.DiscussionList=A;const x=({tab:e,posts:t})=>{if("questions"!==e)return null;const n=(0,y.keys)(t).reduce(((e,n)=>{var o;const r=t[n];if(null==(o=r.answers)||!o.length)return e;const a=t[r.answers[0]];return r&&"QUESTION"===r.feedbackType&&a&&a.content&&a.sumVotesIncremented>1&&e.push({q:r,a}),e}),[]).sort(((e,t)=>t.q.sumVotesIncremented-e.q.sumVotesIncremented));return!!n.length&&a.createElement(v.JsonLd,{schema:(0,v.faqPageSchema)({mainEntity:n.map((({q:e,a:t})=>({name:e.content,acceptedAnswer:{text:t.content}})))})})};t.DiscussionListStructuredData=x;const O=i.StyleSheet.create({wrapper:{width:"100%"},maximizedContainer:{backgroundColor:d.default.white,maxWidth:"100%",padding:"0 20px"},listWrapper:{backgroundColor:d.default.white,paddingTop:u.default.medium_16},listWrapperExtraSpacing:{paddingTop:u.default.xLarge_32},post:(0,r.default)({},E.postWrapper),postExtraSpacing:{marginBottom:u.default.large_24},flagQueuePostWrapper:{padding:u.default.small_12},horizontalSeperator:{borderBottom:E.border,clear:"both",paddingBottom:u.default.small_12,":last-child":{borderBottom:"none",paddingBottom:0}},programHighlighted:{background:(0,d.fade)(d.default.blue,.08),boxShadow:`inset 4px 0 ${d.default.blue}`,":first-child":{borderTopRightRadius:"12px",borderTopLeftRadius:"12px"},":last-child":{borderBottomRightRadius:"12px",borderBottomLeftRadius:"12px"}},linkStyledButton:{color:d.default.offBlack64,border:"none",backgroundColor:"transparent",cursor:"pointer",padding:0,margin:0},englishLink:{marginBottom:20},postsWrapper:{borderWidth:"1px",borderRadius:"12px",borderColor:d.default.offBlack16},noPostsWrapper:{textAlign:"center",margin:"0 auto",padding:`${u.default.xLarge_32}px 0 ${u.default.medium_16}px`},noPostsButton:{marginTop:u.default.medium_16},selectionContainer:{flexDirection:"row",marginTop:u.default.medium_16},selectAllButton:{marginRight:4},selectedTotal:{marginLeft:10,paddingTop:5}}),I={resetNewPostKeyInfo:k.resetNewPostKeyInfoAction,onNextPage:k.getNextPageAction,setFocusOnTopLevelInput:k.setFocusOnTopLevelInputAction,onSelectPosts:k.selectPosts,onDeselectAll:k.deselectAll,onSelectErroredPosts:k.selectErroredPosts};var M=(0,g.compose)(C.default,P.default,(0,s.connect)((e=>{const t=e.tabs[e.currentTab];return{fetchingPosts:e.fetchingPosts,tab:e.currentTab,newPostKey:e.newPostKey,cursor:t.cursor,isComplete:t.isComplete,postKeys:t.postKeys,contentKind:e.contentKind,selectedPosts:e.selectedPosts,posts:e.posts}}),I))(A);t.default=M},DDFQ:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.upvotePost=t.updatePosts=t.unpinThread=t.unlockThread=t.undeletePost=t.toggleReplyInputAction=t.stopEditingPostAction=t.stopAcceptingClarificationAction=t.startEditingPostAction=t.startAcceptingClarificationAction=t.skipPosts=t.setFocusOnTopLevelInputAction=t.selectPosts=t.selectErroredPosts=t.resetNewPostKeyInfoAction=t.resetFocusOnTopLevelInputAction=t.resetExpandKeyAction=t.postSuccessAction=t.pinThread=t.modifyNotificationsAction=t.lockThread=t.initializeDiscussionListComponentAction=t.initializeContentAction=t.hideProgramFromHotlist=t.hideProgramEverywhere=t.getNextPageAction=t.flagPost=t.fetchRepliesPage=t.fetchPostsAction=t.fetchAnswers=t.editPost=t.editAcceptedClarificationAction=t.downvotePost=t.deselectPost=t.deselectAll=t.deletePost=t.deleteAcceptedClarificationPost=t.clearFlags=t.clearAndFetchPostsAction=t.changeType=t.changeTabAction=t.changeSortByAction=t.acceptClarificationAction=void 0;var r=o(n("pVnL")),a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}o.default=e,n&&n.set(e,o);return o}(n("4PhQ")),s=o(n("tCRy")),i=n("69Ww"),l=n("9QWv");function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}const d=e=>t=>{a.default.log(`Failed to ${e} due to: ${t}`)},p=(e,t)=>{const{currentTab:n}=t();e({type:"updatePosts",tab:n,posts:[],cursor:"",isComplete:!0,totalCount:0}),e({type:"clearLoadingStatus"})};t.fetchPostsAction=e=>(t,n)=>u(t,n,e);const u=(e,t,n)=>{const o=t(),{currentSort:a,currentTab:c,qaExpandKey:p,youtubeId:u,apiId:f}=o;let g=o.contentKind.toLowerCase(),m=o.contentId;"Video"===o.contentKind&&"clarifications"===c&&u&&(g="youtubevideo",m=u);const y=(0,i.toGqlFeedbackType)(c);e({type:"fetchingPosts"}),s.default.get(f).fetchPosts({topicId:m,feedbackType:y,currentSort:(0,l.toGqlSortEnum)(a),qaExpandKey:p,focusKind:g},n).then((t=>{if(null==t)return;const{feedback:n,cursor:o,totalCount:a,isComplete:i}=t,l={type:"updatePosts",tab:c,posts:n,cursor:o,totalCount:a,isComplete:i};return"clarifications"===c&&"youtubevideo"===g&&u?s.default.get(f).fetchAcceptedClarifications({youtubeId:u}).then((t=>{e((0,r.default)({},l,{acceptedClarificationPosts:t}))})).catch(d("fetch accepted clarifications")):e(l),t})).catch(d("fetch posts"))};t.clearAndFetchPostsAction=e=>(t,n)=>{p(t,n),u(t,n,e)};t.initializeContentAction=(e,t,n,o,r,a,s)=>s=>{s({type:"initializeContent",topicSlug:e,contentKind:t,contentId:n,youtubeId:o,expandFeedbackType:r,qaExpandKey:a})};t.initializeDiscussionListComponentAction=(e,t,n,o,r,a,s)=>(i,l)=>{i({type:"initializeDiscussionListComponent",topicSlug:e,tab:t,cursor:n,apiId:o}),a?i(f(t,a,n,r)):(p(i,l),u(i,l,s))};t.getNextPageAction=e=>(t,n)=>{const o=n(),{currentSort:r,currentTab:a,qaExpandKey:c,youtubeId:p,apiId:u,tabs:f}=o,g=f[a];if(!g.cursor)return;let m=o.contentKind.toLowerCase(),y=o.contentId;"Video"===o.contentKind&&"clarifications"===a&&p&&(m="youtubevideo",y=p),t({type:"fetchingPosts"}),s.default.get(u).fetchPosts({topicId:y,cursor:g.cursor,feedbackType:(0,i.toGqlFeedbackType)(a),qaExpandKey:c,focusKind:m,currentSort:(0,l.toGqlSortEnum)(r)},e).then((e=>{if(null!=e)return t({type:"appendPosts",tab:a,posts:e.feedback,cursor:e.cursor,totalCount:e.totalCount,isComplete:e.isComplete}),e})).catch(d("get next"))};t.changeTabAction=(e,t)=>(n,o)=>{n({type:"changeTab",tab:e});o().tabs[e].postKeys.length||u(n,o,t)};t.changeSortByAction=(e,t)=>(n,o)=>{n({type:"changeSortBy",sort:e}),p(n,o),u(n,o,t)};t.resetExpandKeyAction=()=>({type:"resetExpandKey"});t.resetNewPostKeyInfoAction=()=>({type:"resetNewPostKey"});t.setFocusOnTopLevelInputAction=()=>({type:"setFocusOnTopLevelInput"});t.resetFocusOnTopLevelInputAction=()=>({type:"resetFocusOnTopLevelInput"});t.postSuccessAction=(e,t)=>({type:"postSuccess",post:e,tab:t});t.upvotePost=(e,t)=>(n,o)=>{const{apiId:r}=o();s.default.get(r).upvotePost({postKey:e.key,alreadyVoted:e.upVoted},t).catch(d("upvote post")),n({type:"upvotePost",postKey:e.key})};t.downvotePost=(e,t)=>(n,o)=>{const{apiId:r}=o();s.default.get(r).downvotePost({postKey:e.key,alreadyVoted:e.downVoted},t).catch(d("downvote post")),n({type:"downvotePost",postKey:e.key})};t.flagPost=(e,t,n)=>(o,r)=>{const{apiId:a}=r();s.default.get(a).flagPost({postKey:e.key,flag:t},n).then((n=>{if(!n)return d("flag post");o({type:"flagPost",postKey:e.key,flag:t})})).catch(d("flag post"))};t.changeType=(e,t,n)=>(o,r)=>{const{apiId:a}=r(),l=(0,i.toGqlFeedbackType)(t);s.default.get(a).changeType({entityKey:e.key,intoType:l},n).catch(d("change type of post")),o({type:"changePostType",postKey:e.key,postType:t})};t.clearFlags=(e,t)=>(n,o)=>{const{apiId:r}=o();s.default.get(r).clearFlags({entityKey:e.key},t).catch(d("clear flags")),n({type:"clearFlags",postKey:e.key})};t.deletePost=(e,t)=>(n,o)=>{const{apiId:r}=o();s.default.get(r).deletePost({postKey:e.key},t).then((t=>{t&&n({type:"deletePost",postKey:e.key})}))};t.hideProgramEverywhere=(e,t,n)=>(o,r)=>{const{apiId:a}=r();s.default.get(a).hideProgramEverywhere({programID:e,hide:t},n)};t.hideProgramFromHotlist=(e,t,n,o)=>(r,a)=>{const{apiId:i}=a();s.default.get(i).hideProgramFromHotlist({programID:t,hide:n},o).then((t=>{t&&r({type:"hideProgramFromHotlist",postKey:e,hidden:n})}))};t.deleteAcceptedClarificationPost=(e,t)=>(t,n)=>{const{apiId:o}=n();s.default.get(o).deleteAcceptedClarification({clarificationId:e.id}).catch(d("delete accepted clarification")),t({type:"deleteAcceptedClarificationPost",clarificationId:e.id})};t.undeletePost=(e,t)=>(n,o)=>{const{apiId:r}=o();s.default.get(r).undeletePost({entityKey:e.key},t).catch(d("undelete post")),n({type:"undeletePost",postKey:e.key})};t.lockThread=(e,t)=>(n,o)=>{const{apiId:r}=o();s.default.get(r).lockThread({entityKey:e.key},t).catch(d("lock thread")),n({type:"lockThread",postKey:e.key})};t.unlockThread=(e,t)=>(n,o)=>{const{apiId:r}=o();s.default.get(r).unlockThread({entityKey:e.key},t).catch(d("unlock thread")),n({type:"unlockThread",postKey:e.key})};t.pinThread=(e,t)=>(n,o)=>{const{apiId:r}=o();s.default.get(r).pinThread({entityKey:e.key},t).catch(d("pin thread")),n({type:"pinThread",postKey:e.key})};t.unpinThread=(e,t)=>(n,o)=>{const{apiId:r}=o();s.default.get(r).unpinThread({entityKey:e.key},t).catch(d("unpin thread")),n({type:"unpinThread",postKey:e.key})};t.editPost=(e,t)=>(t,n)=>{t({type:"editPost",postKey:e.key,content:e.content})};t.acceptClarificationAction=(e,t,n,o,r,i,l,c)=>(e,t)=>{const{youtubeId:n,clarificationBeingAcceptedId:d,apiId:p}=t();if(!n)throw new a.KAError("Can't accept a clarification if we don't know the youtubeId.",a.Errors.Internal);if(!d)throw new a.KAError("Can't accept a clarification if we don't have a clarificationBeingAcceptedId.",a.Errors.Internal);s.default.get(p).acceptClarification({kaid:o,youtubeId:n,openTimestamp:i,closeTimestamp:l,text:r}).then((t=>{s.default.get(p).deletePost({postKey:d},c).then((n=>{n&&e({type:"acceptClarification",originalClarificationId:d,clarification:t})}))}))};t.startAcceptingClarificationAction=e=>t=>{t({type:"startAcceptingClarification",clarificationId:e})};t.startEditingPostAction=e=>t=>{t({type:"startEditingPost",postKey:e})};t.editAcceptedClarificationAction=(e,t,n,o)=>(o,i)=>{const{acceptedClarificationPosts:l,postBeingEditedKey:c,apiId:p}=i(),u=l.find((e=>e.id===c));if(!u)throw new a.KAError(`The clarification you're trying to edit doesn't seem to exist!\nThe posts's key is:\n${c||"unknown"}`,a.Errors.Internal);const f=(0,r.default)({},u,{openTimestamp:t,closeTimestamp:n,text:e,youtubeId:u.youtubeId});s.default.get(p).editAcceptedClarification((0,r.default)({},f)).then((e=>{o({type:"editAcceptedClarification",clarification:e}),o({type:"stopEditingPost"})})).catch(d("edit accepted clarification"))};t.stopAcceptingClarificationAction=()=>e=>{e({type:"stopAcceptingClarification"})};t.stopEditingPostAction=()=>e=>{e({type:"stopEditingPost"})};t.modifyNotificationsAction=(e,t,n)=>(o,a)=>{const{apiId:i}=a();s.default.get(i).modifyNotificationsFlag({postKey:e,enable:t},n).then((t=>{if(null==t)return d("modify notification settings");const n=a().posts[e];o({type:"updatePost",post:(0,r.default)({},n,{notifyOnAnswer:t})})})).catch(d("modify notification settings"))};t.fetchAnswers=(e,t)=>(n,o)=>{const{apiId:r,fetchingAnswersStatus:a}=o();if("loading"===a[e]||"loaded"===a[e])return;const i=t=>n({type:"fetchingAnswers",parentKey:e,status:t});i("loading"),s.default.get(r).fetchAnswers({parentKey:e},t).then((t=>{if(null==t)return i("failed"),d("fetch answers");n({type:"updateAnswers",parentKey:e,answers:t}),i("loaded")})).catch((()=>{i("failed"),d("fetch answers")}))};t.toggleReplyInputAction=e=>(t,n)=>{t({type:"toggleReplyInput",postKey:e})};const f=(e,t,n,o)=>(r,a)=>{r({type:"updatePosts",tab:e,posts:t,cursor:n,isComplete:o,totalCount:t.length}),r({type:"changeTab",tab:e})};t.updatePosts=f;t.fetchRepliesPage=(e,t,n)=>(o,r)=>{const a=t=>o({type:"fetchingReplies",parentKey:e,status:t});if(null!=n&&n.noneToLoad)return void a("complete");const{apiId:i,fetchingRepliesStatus:l}=r(),c=l[e];"loading_first"!==c&&"loading_next"!==c&&"complete"!==c&&(a(null!=n&&n.cursor?"loading_next":"loading_first"),s.default.get(i).fetchRepliesPaginated({postKey:e,cursor:null==n?void 0:n.cursor,limit:10},t).then((t=>{if(null==t)return a("failed"),d("fetch replies page");o({type:"updateRepliesPaginated",parentKey:e,replies:t.feedback,repliesCursor:t.cursor}),a(t.isComplete?"complete":"partial")})).catch((()=>{a("failed"),d("fetch replies page")})))};t.selectPosts=e=>(t,n)=>{t({type:"selectPosts",postKeys:e})};t.skipPosts=e=>(t,n)=>{t({type:"skipPosts",postKeys:e})};t.deselectPost=e=>(t,n)=>{t({type:"deselectPost",postKey:e})};t.deselectAll=()=>(e,t)=>{e({type:"deselectAll"})};t.selectErroredPosts=e=>(t,n)=>{t({type:"selectErroredPosts",postKeys:e})}},DHUe:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.AnswerList=void 0;var r=n("mR6N"),a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=b(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}o.default=e,n&&n.set(e,o);return o}(n("q1tI")),s=n("/MKj"),i=n("Vxy9"),l=o(n("wa3X")),c=n("JimW"),d=o(n("gE8/")),p=n("SjSX"),u=o(n("uEGL")),f=n("TqM9"),g=n("i4Cj"),m=n("AE4M"),y=o(n("HbaH")),h=o(n("y6Wz")),w=o(n("b3m9"));function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(b=function(e){return e?n:t})(e)}const E=e=>{const t=(0,s.useSelector)((t=>t.fetchingAnswersStatus[e.topLevelPostKey])),n=(0,s.useSelector)((e=>e.contentKind));if("questions"!==e.tab&&"projecthelp"!==e.tab)return null;if((!e.answerCount||!e.answers||!e.answers.length)&&e.restrictPosting)return null;const o=()=>{e.expandAnswers(e.topLevelPostKey)},l=()=>{e.collapseAnswers(e.topLevelPostKey)},d=e.answers||[],u=e.displayInputPostKey===e.topLevelPostKey,f=a.createElement("div",{className:(0,r.css)(k.answerInputFieldContainer,u&&k.answerInputFieldContainerExpanded),id:(0,m.getAnswerInputId)(e.topLevelPostKey)},"projecthelp"===e.tab&&((0,p.getKaid)(e.profile)===e.authorKaid?g.userProjectsStrings.authorAnsweringOwnHelpRequest:null),a.createElement(y.default,{isAnswer:!0,autoFocus:u,tab:e.tab,clarificationsEnabled:e.clarificationsEnabled,onPostSuccess:e.handleAnswerPostSuccess,topicSlug:e.topicSlug,feedbackKey:e.topLevelPostKey,onToggleFormattingOptionsExpanded:e.handleToggleFormattingOptionsExpanded,onTogglePreviewExpanded:e.handleTogglePreviewExpanded,showAvatar:!e.isCompactView,contentKind:n}));if(e.answers&&e.answers.length&&0!==e.answerCount){var b;const n=e.isExpanded?d:[d[0]],s="loaded"===t?(null==(b=e.answers)?void 0:b.length)||0:e.answerCount;return a.createElement("div",{className:(0,r.css)(k.answersList,"compact"===e.viewMode&&v.answersList)},!e.restrictPosting&&!e.isLocked&&f,a.createElement("ul",null,n.map(((i,c)=>a.createElement("li",{key:i,className:(0,r.css)(k.answer)},a.createElement(h.default,{tab:e.tab,postKey:i,newPostKey:e.newPostKey,resetNewPostKeyInfo:e.resetNewPostKeyInfo,isAnswer:!0,getRef:t=>e.nodes[i]=t,topicSlug:e.topicSlug,restrictPosting:e.restrictPosting,moderatorMode:e.moderatorMode,viewMode:e.viewMode,isMaximized:e.isMaximized,autoFocusPostOnMount:1===c}),0===c&&"loaded"===t&&e.isExpanded&&s>2&&n.length&&a.createElement(P,{answerCount:s,onShowAnswers:()=>e.onShowAnswers(),status:t,expanded:e.isExpanded,handleExpand:()=>o(),handleCollapse:()=>l()}))))),"loading"===t?a.createElement(c.View,{style:[k.loading,k.expandCollapseButton]},a.createElement(w.default,{size:"xsmall",style:k.spinner,sentryId:"discussion_replies_load",description:"Loading discussion post replies",sentryTeam:"learning-platform"}),a.createElement("span",{className:(0,r.css)(i.styles.LabelLarge)},g.postStrings.loading)):a.createElement(P,{answerCount:s,onShowAnswers:()=>e.onShowAnswers(),status:t,expanded:e.isExpanded,handleExpand:()=>o(),handleCollapse:()=>l()}))}return a.createElement("div",{className:(0,r.css)(k.answersList,e.isCompactView&&v.answersList,!e.displayInputPostKey&&k.displayNone)},f)};t.AnswerList=E;const P=e=>{const t=e.answerCount-1;if(t<1)return null;return a.createElement(l.default,{kind:"tertiary",style:k.expandCollapseButton,onClick:()=>{e.expanded?e.handleCollapse():(e.onShowAnswers(),e.handleExpand())}},"loaded"===e.status?e.expanded?g.answersStrings.hideAnswers(t):g.answersStrings.seeAllAnswers(t):g.answersStrings.showMore)},v=r.StyleSheet.create(f.compactStyles),k=r.StyleSheet.create({answersList:{marginLeft:68,[u.default.xsOrSmaller]:f.compactStyles.answersList},answerInputFieldContainer:{display:"none"},answerInputFieldContainerExpanded:{margin:"20px 0 28px 0",display:"block"},answer:{marginTop:24},spinner:{marginRight:d.default.xSmall_8},displayNone:{display:"none"},expandCollapseButton:{marginTop:24,marginBottom:8},loading:{flexDirection:"row",paddingTop:0,minHeight:48,alignItems:"center"}});var C=E;t.default=C},EFbQ:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if(null===e)return"";const r=o._(a(t||""));if("TOO_BRIEF"===e)return o._("Your %(feedbackType)s is too brief. Try writing a more specific %(feedbackType)s.",{feedbackType:r});if("BAD_CAPITALS"===e)return o._("Try using standard capitalization to improve your %(feedbackType)s's quality.",{feedbackType:r});if("TOO_MANY_REPEATS"===e)return o._('Try to avoid repeating the "%(letter)s" character so many times.',{letter:n});if("TIP_OR_THANKS"===e)return o._("Are you trying to post a tip or thanks? Check out the Tips & Thanks section above.");return""};var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=r(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var i=a?Object.getOwnPropertyDescriptor(e,s):null;i&&(i.get||i.set)?Object.defineProperty(o,s,i):o[s]=e[s]}o.default=e,n&&n.set(e,o);return o}(n("8jAt"));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(r=function(e){return e?n:t})(e)}const a=e=>e.replaceAll("_"," ").toLocaleLowerCase()},F4p2:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=p(n("q1tI")),r=n("mR6N"),a=n("Vxy9"),s=n("JimW"),i=n("i4Cj"),l=p(n("TqM9")),c=p(n("8jAt"));function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function p(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o}const u=r.StyleSheet.create({formattingOptionsTable:{width:"100%",marginTop:14},formattingOptionsRow:{borderTop:l.border,borderBottom:l.border},formattingOptionsHeaderRow:{backgroundColor:l.secondaryBackgroundColor,textAlign:"left",textTransform:"uppercase"},formattingOptionsRowContent:{padding:"14px 16px 16px 16px"},italic:{fontStyle:"italic"},code:{fontFamily:"Inconsolata"},codeSnippet:{height:231}});var f=()=>o.createElement("table",{className:(0,r.css)(u.formattingOptionsTable)},o.createElement("thead",null,o.createElement("tr",{className:(0,r.css)(u.formattingOptionsRow,u.formattingOptionsHeaderRow)},o.createElement("th",{scope:"col"},o.createElement(s.View,{style:u.formattingOptionsRowContent},i.formattingOptionsStrings.rawTextHeading)),o.createElement("th",{scope:"col"},o.createElement(s.View,{style:u.formattingOptionsRowContent},i.formattingOptionsStrings.formattedTextHeading)))),o.createElement("tbody",null,o.createElement("tr",{className:(0,r.css)(u.formattingOptionsRow)},o.createElement("td",null,o.createElement(s.View,{style:u.formattingOptionsRowContent},"*",i.formattingOptionsStrings.bold,"*")),o.createElement("td",null,o.createElement(s.View,{style:u.formattingOptionsRowContent,"aria-labelledby":"bold","aria-describedby":"boldDescription"},o.createElement(a.LabelLarge,{id:"bold"},i.formattingOptionsStrings.bold),o.createElement("span",{className:"sr-only",id:"boldDescription"},i.formattingOptionsStrings.boldDescription)))),o.createElement("tr",{className:(0,r.css)(u.formattingOptionsRow)},o.createElement("td",null,o.createElement(s.View,{style:u.formattingOptionsRowContent},c.doNotTranslate("_"),i.formattingOptionsStrings.italics,c.doNotTranslate("_"))),o.createElement("td",null,o.createElement(s.View,{style:[u.formattingOptionsRowContent,u.italic],"aria-labelledby":"italics","aria-describedby":"italicsDescription"},o.createElement("span",{id:"italics"},i.formattingOptionsStrings.italics),o.createElement("span",{className:"sr-only",id:"italicsDescription"},i.formattingOptionsStrings.italicsDescription)))),o.createElement("tr",{className:(0,r.css)(u.formattingOptionsRow)},o.createElement("td",null,o.createElement(s.View,{style:u.formattingOptionsRowContent},"`",i.formattingOptionsStrings.code,"`")),o.createElement("td",null,o.createElement(s.View,{style:[u.formattingOptionsRowContent,u.code],"aria-labelledby":"code","aria-describedby":"codeDescription"},o.createElement("span",{id:"code"},i.formattingOptionsStrings.code),o.createElement("span",{className:"sr-only",id:"codeDescription"},i.formattingOptionsStrings.codeDescription)))),o.createElement("tr",{className:(0,r.css)(u.formattingOptionsRow)},o.createElement("td",null,o.createElement(s.View,{style:u.formattingOptionsRowContent},o.createElement(s.View,null,c.doNotTranslate("```if (x < 0) {")),o.createElement(s.View,null,"    ",c.doNotTranslate("return;")),o.createElement(s.View,null,c.doNotTranslate("&#125;```")))),o.createElement("td",null,o.createElement(s.View,{style:[u.formattingOptionsRowContent,u.code],"aria-describedby":"codeSnippetDescription"},o.createElement(s.View,null,c.doNotTranslate("if (x < 0) {")),o.createElement(s.View,null,"    ",c.doNotTranslate("return;")),o.createElement(s.View,null,c.doNotTranslate("&#125;")),o.createElement("span",{className:"sr-only",id:"codeSnippetDescription"},i.formattingOptionsStrings.codeDescription))))));t.default=f},HbaH:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n("pVnL")),a=F(n("q1tI")),s=o(n("i8i4")),i=n("/MKj"),l=n("mR6N"),c=n("Vxy9"),d=n("JimW"),p=n("JasB"),u=o(n("Pwnf")),f=n("z8VS"),g=n("Pk2J"),m=o(n("mt3D")),y=o(n("mEQP")),h=o(n("EFbQ")),w=n("hDgO"),b=n("zbaY"),E=o(n("cfQQ")),P=F(n("4PhQ")),v=o(n("OcLW")),k=n("3xyp"),C=F(n("TqM9")),S=n("i4Cj"),T=n("AE4M"),A=n("DDFQ"),x=n("nR7h"),O=n("iMDn"),I=o(n("M+bw")),M=n("69Ww"),K=n("gMOT");function R(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(R=function(e){return e?n:t})(e)}function F(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=R(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o}const L=(0,b.domainColors)("default").domain1,D=()=>a.createElement("a",{href:(0,k.getZendeskCommunityLink)(),className:(0,l.css)(V.helpLink)},S.footerStrings.helpCenter);class _ extends a.Component{constructor(e){super(e),this.editingOrAcceptingClarification=()=>!!(this.props.editing||this.props.acceptingClarification||this.props.editingAcceptedClarification),this.handleWindowKeyup=e=>{"Tab"===e.key&&this.textarea&&document.activeElement===this.textarea&&this.setState({hideFocusOutline:!1})},this.handleFocus=()=>{this.setState({textareaExpanded:!0})},this.collapseTextarea=()=>{if(!this._isMounted)return;this.setState({hideFocusOutline:!0,textareaExpanded:!1,formattingOptionsExpanded:!1,previewExpanded:!1});const{onToggleFormattingOptionsExpanded:e,onTogglePreviewExpanded:t}=this.props;e&&e(!1),t&&t(!1)},this.handleDocumentInteraction=e=>{if(!this.container)return;const t=e.target;this.container.contains(t)||this.collapseTextarea()},this.getSanitizedText=e=>{if(e&&e.length){const t=e.trim();if(t.length)return t}return null},this.handleTextChange=e=>{let t=!0;const n=this.getSanitizedText(e.target.value);n&&(t=!1),this.setState({postContent:n,submitButtonDisabled:t})},this.updateUI=e=>{const{filteredFeedback:t,notice:n}=e;let o=!1;if(n&&n.showLowQualityNotice){const e=(0,h.default)(n.feedbackCode,n.feedbackType,n.feedbackChar);return void(this._isMounted&&this.setState({submitStatus:"failed",isLowQuality:!0,feedbackEditTip:e||""}))}const{onPostSuccess:r,tab:a,editing:s,onEditPost:i}=this.props;t&&(s?i(t,t.content):this.textarea&&(this.textarea.value=""),r(t,a),o=!0,this.collapseTextarea(),this._isMounted&&this.setState({postContent:"",submitStatus:"ready",submitButtonDisabled:true,isLowQuality:!1}))},this.getPlaceholderText=()=>{const{isReply:e,isAnswer:t,tab:n}=this.props,o=S.postStrings.areResponsesCalledAnswers(n);return e?S.postStrings.replyCommentPlaceholder:!t&&n&&S.tabsStrings[n]?S.tabsStrings[n].placeholder:t&&o?S.postStrings.answerPlaceholder:S.postStrings.replyPlaceholder},this.getTextareaLabel=()=>{const{isReply:e,isAnswer:t,tab:n,acceptingClarification:o}=this.props,r=S.postStrings.areResponsesCalledAnswers(n);return e?S.postStrings.comment:t&&r?S.postStrings.answer:t?S.postStrings.reply:n&&S.tabsStrings[n]?S.tabsStrings[n].textAreaLabel:o?S.miscStrings.acceptedClarificationLabel:""},this.updateFeedback=(e,t,n,o)=>{o.mutate(K.UPDATE_FEEDBACK,{variables:{feedbackKey:e,textContent:t,shownLowQualityNotice:n}}).then((e=>{var t,n,o,r,a,s,i;null!=e&&null!=(t=e.data)&&null!=(n=t.updateFeedback)&&null!=(o=n.error)&&o.code?this.handleErrors(null==e||null==(r=e.data)||null==(a=r.updateFeedback)||null==(s=a.error)?void 0:s.code):this.updateUI(j(null==e||null==(i=e.data)?void 0:i.updateFeedback))}))},this.addFeedbackToDiscussion=(e,t,n,o,r)=>{var a;const s=null!=(a=(0,M.toGqlFeedbackType)(n))?a:"QUESTION";this.props.gqlClient.mutate(x.ADD_FEEDBACK_TO_DISCUSSION,{variables:{focusKind:e,focusId:t,feedbackType:s,textContent:o,shownLowQualityNotice:r}}).then((e=>{var t,n,o,r,a,s,i;null!=e&&null!=(t=e.data)&&null!=(n=t.addFeedbackToDiscussion)&&null!=(o=n.error)&&o.code?this.handleErrors(null==e||null==(r=e.data)||null==(a=r.addFeedbackToDiscussion)||null==(s=a.error)?void 0:s.code):this.updateUI(j(null==e||null==(i=e.data)?void 0:i.addFeedbackToDiscussion))}))},this.addAnswerToQuestion=(e,t,n,o)=>this.addChildPost(e,t,n,o,"ANSWER"),this.addReply=(e,t,n,o)=>this.addChildPost(e,t,n,o,"REPLY"),this.addChildPost=(e,t,n,o,r)=>{"ANSWER"!==r&&"REPLY"!==r&&P.default.error("Feedback type must be ANSWER or REPLY",P.Errors.Internal,{sentryData:{contexts:{extras:{feedbackType:r}}}}),this.props.gqlClient.mutate(x.ADD_FEEDBACK_TO_DISCUSSION,{variables:{parentKey:e,textContent:t,fromVideoAuthor:n,shownLowQualityNotice:o,feedbackType:r}}).then((t=>{var n,o,a;if(null!=t&&null!=(n=t.data)&&null!=(o=n.addFeedbackToDiscussion)&&null!=(a=o.error)&&a.code)this.handleErrors(t.data.addFeedbackToDiscussion.error.code);else{var s;const n=j(null==t||null==(s=t.data)?void 0:s.addFeedbackToDiscussion);null!=n&&n.filteredFeedback&&"ANSWER"===r&&(n.filteredFeedback.questionKey=e),this.updateUI(n)}}))},this.handleErrors=e=>{if(this._isMounted&&(this.setState({submitStatus:"failed"}),"NOT_ALLOWED"===e))this.setState({feedbackEditTip:S.strings.discussionLocked})},this.getSubmissionType=()=>{const{feedbackKey:e,youtubeId:t,tab:n,topicSlug:o,isAnswer:r,isReply:a,postKey:s}=this.props;let i=this.props.contentKind?this.props.contentKind.toLowerCase():null,l=this.props.contentId;return"video"===i&&"clarifications"===n&&t&&(i="youtubevideo",l=t),s?"UpdateFeedback":!s&&r&&e?"AddAnswer":!s&&a&&e?"AddReply":!s&&l&&i&&"comments"===n&&!r?"AddComment":!s&&l&&i&&n?"AddFeedback":(P.default.error("We don't have enough information to submit this type of post.",P.Errors.Internal,{sentryData:{contexts:{extras:{feedbackType:n,contentKind:i,topicSlug:o}}}}),"error")},this.handleSubmit=()=>{const{feedbackKey:e,youtubeId:t,tab:n,postKey:o,acceptingClarification:r,editingAcceptedClarification:a,onSubmitAcceptedClarification:s,gqlClient:i}=this.props,{postContent:l,isFromAuthor:c,submitStatus:d,isLowQuality:p}=this.state;if(!l||"submitting"===d)return;if((r||a)&&s&&l)return void s(l);this.setState({submitStatus:"submitting",feedbackEditTip:""});let u=this.props.contentKind?this.props.contentKind.toLowerCase():null,f=this.props.contentId;"video"===u&&"clarifications"===n&&t&&(u="youtubevideo",f=t);switch(this.getSubmissionType()){case"UpdateFeedback":o&&this.updateFeedback(o,l,p,i);break;case"AddAnswer":e&&this.addAnswerToQuestion(e,l,c,p);break;case"AddReply":e&&this.addReply(e,l,c,p);break;default:u&&f&&this.addFeedbackToDiscussion(u,f,n,l,p)}},this.renderTextarea=e=>{const{isAnswer:t,isReply:n,editing:o}=this.props,{hideFocusOutline:s,textareaExpanded:i,submitStatus:c,feedbackEditTip:p}=this.state,u="submitting"===c,f=this.getPlaceholderText(),g=i&&p,m=i&&!t&&!n&&!o,y=[V.textareaContainer,!!g&&V.textareaContainerError,i&&(n||this.editingOrAcceptingClarification()?V.replyTextareaContainerExpanded:V.textareaContainerExpanded)],h=[V.textareaField,(t||this.editingOrAcceptingClarification())&&V.textareaFieldForAnswer,m&&V.textareaFieldExpanded,s&&V.textareaNoFocusOutline,g&&V.textareaFieldError],w=n?{rows:1}:null;return a.createElement(d.View,{style:y},a.createElement("textarea",(0,r.default)({id:e,className:(0,l.css)(h),placeholder:`${f}`,"aria-label":f,onFocus:this.handleFocus,onBlur:()=>this.setState({hideFocusOutline:!0}),onClick:()=>this.setState({hideFocusOutline:!0}),onChange:this.handleTextChange,onKeyUp:this.handleTextChange,ref:e=>this.textarea=e,disabled:u},w)))},this.renderFooter=()=>{const{tab:e,isAnswer:t,isReply:n,editing:o,acceptingClarification:r,editingAcceptedClarification:s,onToggleFormattingOptionsExpanded:i,onTogglePreviewExpanded:l,onCancel:c}=this.props,{formattingOptionsExpanded:d,previewExpanded:p,submitButtonDisabled:u,submitStatus:f,textareaExpanded:g}=this.state,m=r||s,h=!!(g||t||o)&&!r;return a.createElement(y.default,{tab:e,content:this.state.postContent||"",isAnswer:t,isReply:n,editing:o,acceptingClarification:m,submitButtonDisabled:u&&!m,submitStatus:f,onSubmit:this.handleSubmit,onCancel:c,canShowFormattingOptions:h,formattingOptionsExpanded:d,onToggleFormattingOptionsExpanded:e=>{i&&i(e),this.setState({formattingOptionsExpanded:e})},previewExpanded:p,onTogglePreviewExpanded:e=>{l&&l(e),this.setState({previewExpanded:e})}})},this.state={hideFocusOutline:!0,textareaExpanded:!1,formattingOptionsExpanded:!1,previewExpanded:!1,postContent:e.initialPostContent,submitButtonDisabled:!0,submitStatus:"ready",isLowQuality:!1,feedbackEditTip:"",isFromAuthor:!1}}UNSAFE_componentWillMount(){const{isAnswer:e,isReply:t}=this.props;e||t||!(0,T.userHasJustLoggedIn)(window.location)||this.setState({hideFocusOutline:!1})}componentDidMount(){const{isAnswer:e,isReply:t}=this.props;this._isMounted=!0;const{textarea:n}=this;n&&!e&&!t&&(0,T.userHasJustLoggedIn)(window.location)&&n.focus({preventScroll:!0}),n&&this.props.autoFocus&&n.focus(),n&&(n.value=this.props.initialPostContent),document.addEventListener("keyup",this.handleWindowKeyup),document.addEventListener("mousedown",this.handleDocumentInteraction),document.addEventListener("touchstart",this.handleDocumentInteraction)}UNSAFE_componentWillUpdate(e,t){const{textarea:n}=this;n&&e.autoFocus&&this.state.hideFocusOutline&&this.setState({hideFocusOutline:!1}),e.newPostKey&&"submitting"===this.state.submitStatus&&(this.textarea&&(this.textarea.value=""),this.collapseTextarea(),this.setState({submitStatus:"ready",submitButtonDisabled:!0,isLowQuality:!1}),this.props.resetNewPostKeyInfo&&this.props.resetNewPostKeyInfo())}componentDidUpdate(e,t){const{textarea:n}=this;n&&this.props.autoFocus&&!e.autoFocus&&(setTimeout((()=>n&&n.focus()),0),this.props.resetFocusOnTopLevelInput())}componentWillUnmount(){this._isMounted=!1,document.removeEventListener("keyup",this.handleWindowKeyup),document.removeEventListener("mousedown",this.handleDocumentInteraction),document.removeEventListener("touchstart",this.handleDocumentInteraction)}getIsModerator(){const{profile:e}=this.props;return!!e&&e.get("isModerator")}render(){const{tab:e,isAnswer:t,isReply:n,showAvatar:o,clarificationsEnabled:r,contentKind:i}=this.props,{textareaExpanded:u,feedbackEditTip:g,isFromAuthor:y}=this.state,h=this.getTextareaLabel(),w=e&&S.tabsStrings[e]||{},b=!t&&w.tipLabel,E=!t&&w.tipContents,P=u&&g,k=u||t||this.editingOrAcceptingClarification(),C=u&&!t&&!n&&!this.editingOrAcceptingClarification(),T="clarifications"!==e&&r,A=e=>{const r=e.get("content-input");return a.createElement(d.View,{style:n?V.replyContainer:V.container,ref:e=>this.container=s.default.findDOMNode(e)},a.createElement(d.View,{"aria-live":"polite",style:V.errorText},P&&a.createElement(c.Body,null,g)),a.createElement(d.View,{style:[V.textAreaHeading,o&&V.textAreaHeadingMargin]},a.createElement("label",{htmlFor:r},a.createElement(c.Body,null,h)),a.createElement(p.Spring,null),t&&"scratchpad"!==i&&this.getIsModerator()?a.createElement(f.Checkbox,{label:S.postStrings.fromTheAuthor,style:V.postAsAuthorCheckbox,checked:y,onChange:e=>this.setState({isFromAuthor:e})}):null),a.createElement(d.View,{style:V.expandableContainer},o&&a.createElement(d.View,{style:V.avatarContainer},a.createElement(m.default,{showCurrentUserAvatar:!0})),a.createElement(d.View,{style:V.textareaAndTipsContainer},this.renderTextarea(r),k&&this.renderFooter(),C&&a.createElement(d.View,null,a.createElement(d.View,{style:V.tip},a.createElement(d.View,{style:V.tipHeading},a.createElement(c.LabelLarge,null,b)),E),a.createElement(d.View,{style:V.helpLinksContainer},a.createElement(D,null),T&&a.createElement(v.default,{className:(0,l.css)(V.helpLink),onClick:this.props.onReportMistake},S.footerStrings.reportMistake))))))};return a.createElement(d.UniqueIDProvider,{mockOnFirstRender:!0,scope:"discussion-input"},(e=>a.createElement("form",null,A(e))))}}_.defaultProps={initialPostContent:"",editing:!1,showAvatar:!0};const j=e=>{let t,n;return e?(null!=e&&e.feedback&&(t=(0,O.filterFeedback)(null==e?void 0:e.feedback)),null!=e&&e.lowQualityResponse&&(n=(e=>{if(!e)return null;const{feedbackChar:t,feedbackCode:n,feedbackType:o,showLowQualityNotice:r}=e;return{feedbackChar:t,feedbackCode:n,feedbackType:o,showLowQualityNotice:r}})(null==e?void 0:e.lowQualityResponse)),{filteredFeedback:t,notice:n}):{filteredFeedback:t,notice:n}},V=l.StyleSheet.create({container:{backgroundColor:u.default.white},replyContainer:{backgroundColor:u.default.offWhite},errorText:{marginLeft:64,color:u.default.red},expandableContainer:{flexDirection:"row"},avatarContainer:{marginRight:C.avatarFormSpace},textareaAndTipsContainer:{width:"100%"},textAreaHeading:{flexDirection:"row"},textAreaHeadingMargin:{marginLeft:56},postAsAuthorCheckbox:{minWidth:148,marginTop:4},textareaContainer:{marginTop:4,marginBottom:0,borderRadius:4,flex:1,border:C.border,backgroundColor:u.default.white},textareaContainerExpanded:{borderBottomRightRadius:0,borderBottomLeftRadius:0},replyTextareaContainerExpanded:{paddingBottom:7},textareaContainerError:{borderColor:u.default.red,backgroundColor:C.errorBackgroundColor},textareaField:{boxSizing:"border-box",border:"none",resize:"vertical",width:"98%",fontSize:16,lineHeight:1.38,transition:`min-height ${w.standardTransition}`,minHeight:34,overflow:"auto",padding:"8px 12px",margin:"1px 0px 1px 1px",":focus":{outline:"auto"},"::placeholder":{color:`solid 1px ${u.default.offBlack16}`,fontSize:16,lineHeight:1.38}},textareaFieldForAnswer:{minHeight:62},textareaFieldError:{backgroundColor:C.errorBackgroundColor},textareaFieldExpanded:{minHeight:C.textareaMinHeight,overflow:"auto"},textareaNoFocusOutline:{":focus":{outline:"none"}},tip:{marginTop:24,marginBottom:16,padding:24,borderRadius:2,backgroundColor:C.secondaryBackgroundColor},tipHeading:{marginBottom:8},helpLinksContainer:{textAlign:"right"},helpLink:{color:L,textDecoration:"none",":hover":{textDecoration:"underline"}}}),N={onEditPost:A.editPost,resetFocusOnTopLevelInput:A.resetFocusOnTopLevelInputAction};var q=(0,g.compose)(E.default,I.default,(0,i.connect)((e=>({newPostKey:e.newPostKey,youtubeId:e.youtubeId})),N))(_);t.default=q},IW3x:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.FEEDBACK_QUERY=void 0;var r=n("Xbru"),a=o(n("lTCR"));let s;const i=(0,r.gqlOp)((0,a.default)(s||(s=(e=>e)`
    query feedbackQuery(
        $topicId: String!
        $focusKind: String!
        $cursor: String
        $limit: Int
        $feedbackType: FeedbackType!
        $currentSort: Int
        $qaExpandKey: String
    ) {
        feedback(
            focusId: $topicId
            cursor: $cursor
            limit: $limit
            feedbackType: $feedbackType
            focusKind: $focusKind
            sort: $currentSort
            qaExpandKey: $qaExpandKey
            answersLimit: 1
        ) {
            feedback {
                isLocked
                isPinned
                replyCount
                appearsAsDeleted
                author {
                    id
                    kaid
                    nickname
                    avatar {
                        name
                        imageSrc
                    }
                }
                badges {
                    name
                    icons {
                        smallUrl
                    }
                    description
                }
                content
                date
                definitelyNotSpam
                deleted
                downVoted
                expandKey
                feedbackType
                flaggedBy
                flaggedByUser
                flags
                focusUrl
                focus {
                    kind
                    id
                    translatedTitle
                    relativeUrl
                }
                fromVideoAuthor
                key
                lowQualityScore
                notifyOnAnswer
                permalink
                qualityKind
                replyCount
                replyExpandKeys
                showLowQualityNotice
                sumVotesIncremented
                upVoted
                ... on QuestionFeedback {
                    hasAnswered
                    answers {
                        isLocked
                        isPinned
                        replyCount
                        appearsAsDeleted
                        author {
                            id
                            kaid
                            nickname
                            avatar {
                                name
                                imageSrc
                            }
                        }
                        badges {
                            name
                            icons {
                                smallUrl
                            }
                            description
                        }
                        content
                        date
                        definitelyNotSpam
                        deleted
                        downVoted
                        expandKey
                        feedbackType
                        flaggedBy
                        flaggedByUser
                        flags
                        focusUrl
                        focus {
                            kind
                            id
                            translatedTitle
                            relativeUrl
                        }
                        fromVideoAuthor
                        key
                        lowQualityScore
                        notifyOnAnswer
                        permalink
                        qualityKind
                        replyCount
                        replyExpandKeys
                        showLowQualityNotice
                        sumVotesIncremented
                        upVoted
                    }
                    isOld
                    answerCount
                }
                ... on AnswerFeedback {
                    question {
                        isLocked
                        isPinned
                        replyCount
                        appearsAsDeleted
                        author {
                            id
                            kaid
                            nickname
                            avatar {
                                name
                                imageSrc
                            }
                        }
                        badges {
                            name
                            icons {
                                smallUrl
                            }
                            description
                        }
                        content
                        date
                        definitelyNotSpam
                        deleted
                        downVoted
                        expandKey
                        feedbackType
                        flaggedBy
                        flaggedByUser
                        flags
                        focusUrl
                        focus {
                            kind
                            id
                            translatedTitle
                            relativeUrl
                        }
                        fromVideoAuthor
                        key
                        lowQualityScore
                        notifyOnAnswer
                        permalink
                        qualityKind
                        replyCount
                        replyExpandKeys
                        showLowQualityNotice
                        sumVotesIncremented
                        upVoted
                    }
                }
            }
            cursor
            isComplete
            sortedByDate
        }
    }
`)));t.FEEDBACK_QUERY=i},IZy4:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.getTimestampSecondsFromText=t.getTimestampFromSeconds=t.formatContent=t.VideoTimestampLink=void 0;var r=l(n("q1tI")),a=l(n("8jAt")),s=o(n("wINb"));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}function l(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=i(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o}const c=/(\d{1,3}):([0-5]\d)/g;t.getTimestampSecondsFromText=e=>{let t=0,n=20;const o=c.exec(e);return o&&(t=parseFloat(o[1]),n=parseFloat(o[2])),60*t+n};t.getTimestampFromSeconds=e=>{const t=Math.floor(e/60),n=e-60*t,o=t.toString(),r=n.toString();return{minutes:o,seconds:r.length>1?r:0+r}};const d={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},p=e=>d[e],u=/[&<>"'`=]/,f=/[&<>"'`=]/g,g=(e,t,n,o)=>{const r=`<img src=${(0,s.default)("/images/play.png")} class='youTubePlayIcon' aria-hidden="true" alt="" />`;return`<div class='youTubeLink' data-seconds='${60*Number(t)+Number(n)}' tabindex='0' role='link' aria-label='${`${e} ${a._("Click to jump to %(timestamp)s in video",{timestamp:e})}`}'>${o||`${r} ${e}`}</div>`},m=(e,t,n)=>g(e,t,n);t.VideoTimestampLink=e=>r.createElement("span",{dangerouslySetInnerHTML:{__html:g(e.timestamp,e.minutes,e.seconds,e.children)}});t.formatContent=(e,t)=>{let n=(e=>{if("string"!=typeof e){if(e&&e.toHTML)return e.toHTML();if(null==e)return"";if(!e)return e+"";e=""+e}return u.test(e)?e.replace(f,p):e})(e);return n=n.replace(/[\n]/g,"<br>"),n=n.replace(/(\W|^)_(\S.*?\S)_(\W|$)/g,(function(e,t,n,o){return t+"<em>"+n+"</em>"+o})),n=n.replace(/(\W|^)\*(\b.*?\b)\*(\W|$)/g,(function(e,t,n,o){return t+"<strong>"+n+"</strong>"+o})),n=n.replace(/&#x60;&#x60;&#x60;(.*?)&#x60;&#x60;&#x60;/gm,(function(e,t){return"<pre><code class='discussion-code-format discussion-code-block'>"+(t=(t=t.replace(/^\s*(<br>)+/,"")).replace(/(<br>)+\s*$/,""))+"</code></pre>"})),n=n.replace(/&#x60;(.*?)&#x60;/g,(function(e,t){return"<code class='discussion-code-format discussion-code-inline'>"+t+"</code>"})),n=((e,t)=>e.replace(/\b(?:(?:https?:\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>&]+|&amp;|\((?:[^\s()<>]|(?:\([^\s()<>]+\)))*\))+(?:\((?:[^\s()<>]|(?:\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’&]))/gi,(e=>{if(!/^https?:\/\//.test(e)){if(!e.match(/[^\/]*khanacademy.org|^\//))return e;e="https://"+e}return`<a  href="${e}" ${t?'rel="nofollow"':""}>${e}</a>`})))(n,t),n=n.replace(c,m),n}},KPIR:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=i(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}o.default=e,n&&n.set(e,o);return o}(n("q1tI")),r=n("mR6N"),a=n("i4Cj"),s=n("4Arr");function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}function l(e,t){return Array.prototype.filter.call(e,t)}function c(e){const t=l(e,(e=>e.classList.contains("overall-eval-info"))),n=t.length>0?t[0].textContent:"";return 0===n.length?null:o.createElement("div",{className:(0,r.css)(p.moreInfo)},o.createElement("strong",null,a.evalStrings.fromTheEvaluator),o.createElement("div",{dangerouslySetInnerHTML:{__html:(0,s.formatContent)(n,!0)}}))}class d extends o.Component{render(){const{post:e}=this.props,{content:t,question:n}=e,i=e.sumVotesIncremented>1,d=function(e){const t=document.implementation.createHTMLDocument();return t.body?(t.body.innerHTML=e,t.body.children||new HTMLCollection):new HTMLCollection}(t),u=l(d,(e=>{const t="li"===e.tagName.toLowerCase(),n=e.classList.contains("pass");return t&&!n})),f=i?a.evalStrings.projectPassedEval:a.evalStrings.projectFailedEval;let g=null;if(i){const e=c(d);e&&(g=o.createElement("div",null,e))}else{const e=u.map((function(e,t){const{primary:n,extra:a}=function(e){const t=(e=e.cloneNode(!0)).querySelector("div");let n="";return t&&(n=t.textContent,t.innerHTML=""),{primary:e.textContent,extra:n}}(e);return o.createElement("li",{key:"objective-"+t},o.createElement("div",{className:(0,r.css)(p.failedObjectiveItem)},o.createElement("strong",null,n)),o.createElement("div",{className:(0,r.css)(p.objectiveMoreInfo),dangerouslySetInnerHTML:{__html:(0,s.formatContent)(a,!0)}}))}));g=o.createElement("div",null,c(d),o.createElement("div",{className:(0,r.css)(p.failedObjectives)},o.createElement("strong",null,a.evalStrings.needsMoreWork),o.createElement("ul",{className:(0,r.css)(p.styledList)},e)))}const m=n&&n.content||"";return o.createElement("div",null,o.createElement("div",null,m),o.createElement("div",{className:"eval-guideline"},o.createElement("div",{className:(0,r.css)(p.evalTitle)},f),g))}}t.default=d;const p=r.StyleSheet.create({moreInfo:{marginTop:20},objectiveMoreInfo:{marginBottom:10},failedObjectiveItem:{marginTop:10},failedObjectives:{marginTop:20},styledList:{marginLeft:16,listStyle:"disc"},evalTitle:{fontSize:"larger"}})},RTsg:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var i=r?Object.getOwnPropertyDescriptor(e,s):null;i&&(i.get||i.set)?Object.defineProperty(o,s,i):o[s]=e[s]}o.default=e,n&&n.set(e,o);return o}(n("q1tI")),r=n("IZy4");function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}class s extends o.Component{render(){const e=(0,r.formatContent)(this.props.string,!0);return o.createElement("span",{dangerouslySetInnerHTML:{__html:e}})}}t.default=s},RdRB:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=w(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}o.default=e,n&&n.set(e,o);return o}(n("q1tI")),a=n("mR6N"),s=o(n("lTCR")),i=n("JimW"),l=o(n("Pwnf")),c=o(n("gE8/")),d=n("Vxy9"),p=o(n("yA8i")),u=n("8r+/"),f=o(n("wINb")),g=o(n("fXTs")),m=n("i4Cj"),y=n("AE4M");let h;function w(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(w=function(e){return e?n:t})(e)}class b extends r.Component{shouldComponentUpdate(e){return!e.gqlResult.loading}render(){const{gqlResult:{loading:e,data:t}}=this.props;if(e||!t||!t.user)return r.createElement("span",null,m.avatarStrings.findingProfileInformation);const{nickname:n,username:o,avatar:s,bio:l,points:c,isPhantom:p,isActor:u,isCoachedByActor:g,userSummaryIsVisibleToActor:h,actorHasUserScopedPermission:w}=t.user,b=!(u||g||h||w);return r.createElement(i.View,{style:P.tooltipContainer},r.createElement(i.View,{style:P.avatarContainer},s&&n&&r.createElement("img",{className:(0,a.css)(P.tooltipAvatar),src:(0,f.default)(s.imageSrc),alt:m.avatarStrings.getAvatarForUser(s&&(0,y.getAriaAvatarName)(s.name),n)})),r.createElement(i.View,{style:P.tooltipBody},r.createElement(i.View,{style:P.tooltipHeader},r.createElement(d.HeadingSmall,{style:[P.nameText,P.nickname]},p?m.avatarStrings.unclaimedPoints:n),r.createElement(d.LabelMedium,{style:[P.nameText,P.username]},o?"@"+o:null)),r.createElement(d.LabelMedium,{style:P.bio},(0,y.hideExternalLinks)(l)),"sal"===o?r.createElement(d.LabelMedium,{style:P.points},"+∞"):r.createElement(d.LabelMedium,{style:P.points},!c&&0!==c||b?m.avatarStrings.questionMark:"+"+c.toLocaleString())))}}const E=(0,u.gqlOp)((0,s.default)(h||(h=(e=>e)`
    query getUserHoverCardProfile($kaid: String!) {
        user(kaid: $kaid) {
            id
            nickname
            username
            bio
            avatar {
                name
                imageSrc
            }
            points
            isPhantom
            isActor
            isCoachedByActor
            userSummaryIsVisibleToActor
            actorHasUserScopedPermission(capability: CAN_VIEW_USER_IDENTITY)
        }
    }
`))),P=a.StyleSheet.create({tooltipContainer:{flexDirection:"row",width:350},avatarContainer:{marginRight:c.default.xLarge_32,marginTop:c.default.xxSmall_6},tooltipAvatar:{width:64,height:64},tooltipBody:{width:"100%"},tooltipHeader:{flexDirection:"row",alignItems:"flex-end",flexWrap:"wrap",marginTop:c.default.xxSmall_6,marginBottom:c.default.small_12},nameText:{marginTop:c.default.xxSmall_6,maxWidth:272,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},nickname:{marginRight:c.default.small_12},username:{color:l.default.offBlack50,":hover":{textDecoration:"none"}},bio:{marginBottom:c.default.medium_16},points:{color:l.default.darkBlue,textAlign:"right",fontWeight:700,fontSize:16,marginBottom:c.default.small_12}}),v=(0,p.default)((({kaid:e})=>({query:E,fetchPolicy:"cache-first",variables:{kaid:e}})))(b);var k=e=>r.createElement(g.default,null,r.createElement(v,e));t.default=k},WmEb:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.VOTE_ENTITY_MUTATION=void 0;var r=n("Xbru"),a=o(n("lTCR"));let s;const i=(0,r.gqlOp)((0,a.default)(s||(s=(e=>e)`
    mutation VoteEntityMutation($postKey: String!, $voteType: Int!) {
        voteEntity(entityKey: $postKey, voteType: $voteType) {
            error {
                code
            }
        }
    }
`)));t.VOTE_ENTITY_MUTATION=i},XKyD:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ConfirmDeletionModal=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}o.default=e,n&&n.set(e,o);return o}(n("q1tI")),a=n("mR6N"),s=n("Uafs"),i=n("JimW"),l=n("Vxy9"),c=n("JasB"),d=o(n("wa3X")),p=n("i4Cj");function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}const f=({handleClose:e,handleSubmit:t})=>r.createElement(s.OnePaneDialog,{style:{maxHeight:280},role:"alertdialog",title:p.confirmDeletionModalStrings.delete,content:r.createElement(i.View,null,r.createElement(l.Body,null,p.confirmDeletionModalStrings.confirmDeletion)),footer:r.createElement(i.View,{style:g.footer},r.createElement(d.default,{onClick:e,kind:"tertiary"},p.confirmDeletionModalStrings.cancel),r.createElement(c.Strut,{size:16}),r.createElement(d.default,{onClick:t,color:"destructive"},p.confirmDeletionModalStrings.delete))});t.ConfirmDeletionModal=f;const g=a.StyleSheet.create({footer:{flexDirection:"row"}});var m=f;t.default=m},doqZ:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.DELETE_POST_MUTATION=void 0;var r=n("Xbru"),a=o(n("lTCR"));let s;const i=(0,r.gqlOp)((0,a.default)(s||(s=(e=>e)`
    mutation DeletePostMutation($postKey: String!) {
        hideFeedback(feedbackKey: $postKey) {
            error {
                code
            }
        }
    }
`)));t.DELETE_POST_MUTATION=i},fjY8:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}o.default=e,n&&n.set(e,o);return o}(n("q1tI")),a=n("mR6N"),s=n("DzHr"),i=n("JimW"),l=n("Vxy9"),c=o(n("wa3X")),d=n("JasB"),p=o(n("SGU3")),u=n("i4Cj");function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}class g extends r.Component{render(){const{flaggedBy:e,flags:t,onCancel:n,onClearAllFlags:o}=this.props;return r.createElement(s.OneColumnModal,{content:r.createElement(i.View,null,r.createElement(l.Title,{style:m.title},u.clearFlagsModalStrings.flagsTitle),e.map(((e,n)=>r.createElement(l.Body,{key:e},r.createElement(p.default,{href:`/profile/${e}/discussion`,target:"_blank"},e)," - ",t[n])))),footer:r.createElement(i.View,{style:m.footer},r.createElement(c.default,{onClick:n,kind:"tertiary"},u.clearFlagsModalStrings.cancel),r.createElement(d.Strut,{size:16}),r.createElement(c.default,{onClick:o},u.clearFlagsModalStrings.clearAllFlags))})}}t.default=g;const m=a.StyleSheet.create({footer:{flexDirection:"row"},title:{marginBottom:24}})},gMOT:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.UPDATE_FEEDBACK=void 0;var r=n("Xbru"),a=o(n("lTCR"));let s;const i=(0,r.gqlOp)((0,a.default)(s||(s=(e=>e)`
    mutation UpdateFeedback(
        $feedbackKey: String!
        $textContent: String!
        $shownLowQualityNotice: Boolean
    ) {
        updateFeedback(
            feedbackKey: $feedbackKey
            textContent: $textContent
            shownLowQualityNotice: $shownLowQualityNotice
        ) {
            feedback {
                isLocked
                isPinned
                appearsAsDeleted
                author {
                    id
                    kaid
                    nickname
                    avatar {
                        name
                        imageSrc
                    }
                }
                content
                date
                definitelyNotSpam
                deleted
                downVoted
                expandKey
                feedbackType
                flaggedBy
                flags
                focusUrl
                focus {
                    kind
                    id
                    translatedTitle
                    relativeUrl
                }
                fromVideoAuthor
                key
                notifyOnAnswer
                permalink
                qualityKind
                replyCount
                replyExpandKeys
                sumVotesIncremented
                upVoted
            }
            lowQualityResponse {
                feedbackCode
                feedbackChar
                feedbackType
                showLowQualityNotice
            }
            error {
                code
            }
        }
    }
`)));t.UPDATE_FEEDBACK=i},giNK:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.PERFORM_MOD_ACTION=void 0;var r=n("Xbru"),a=o(n("lTCR"));let s;const i=(0,r.gqlOp)((0,a.default)(s||(s=(e=>e)`
    mutation PerformModAction(
        $modAction: ModAction!
        $entityKey: String!
        $intoType: FeedbackType
    ) {
        performModAction(
            modAction: $modAction
            entityKey: $entityKey
            intoType: $intoType
        ) {
            error {
                code
            }
        }
    }
`)));t.PERFORM_MOD_ACTION=i},gzgZ:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}o.default=e,n&&n.set(e,o);return o}(n("q1tI")),a=n("mR6N"),s=o(n("Pwnf")),i=n("Vxy9");function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}const c=(0,n("JimW").addStyle)("button");class d extends r.Component{render(){const{disabled:e,icon:t,id:n,children:o,onClick:a,style:s}=this.props;return r.createElement(c,{id:n,onClick:a,style:[p.linkStyledButton,p.toolButton,e&&p.disabled,s],disabled:e},t,r.createElement(i.LabelXSmall,{style:p.text},o))}}t.default=d;const p=a.StyleSheet.create({linkStyledButton:{color:s.default.offBlack64,border:"none",backgroundColor:"transparent",cursor:"pointer",padding:0,margin:0,":focus":{outline:"auto"}},toolButton:{display:"flex",alignItems:"center"},text:{marginLeft:5},disabled:{cursor:"default",color:s.default.offBlack32}})},i6LP:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.HIDE_PROGRAM_FROM_HOTLIST=void 0,t.hideProgramFromHotlist=async function(e,t,n){try{var o;const a=await e(l,{variables:{programID:t,hide:n}});var r;if(null!=a&&null!=(o=a.hideProgramFromHotlist)&&o.error)throw new s.KAError("hideProgramFromHotlist returned an error",s.Errors.Internal,{cause:JSON.stringify(null==a||null==(r=a.hideProgramFromHotlist)?void 0:r.error)})}catch(e){throw new s.KAError("Error hiding a program from hotlist",s.Errors.Internal,{cause:e})}};var r=n("Xbru"),a=o(n("lTCR")),s=n("4PhQ");let i;const l=(0,r.gqlOp)((0,a.default)(i||(i=(e=>e)`
        mutation hideProgramFromHotlist($programID: ID!, $hide: Boolean!) {
            hideProgramFromHotlist(programID: $programID, hide: $hide) {
                error {
                    code
                    debugMessage
                }
            }
        }
    `)));t.HIDE_PROGRAM_FROM_HOTLIST=l},iMDn:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.filterFeedbackList=t.filterFeedback=void 0;var r=o(n("pVnL")),a=o(n("8OQS"));const s=["__typename","feedbackType","author","replyCount","answerCount","focus","answers"],i=e=>{var t,n;const{feedbackType:o,author:i,replyCount:c,answerCount:d,focus:p,answers:u}=e,f=(0,a.default)(e,s),g=o?o.toLowerCase():"",m=(0,r.default)({},f,{type:g,authorAvatarName:(null==i||null==(t=i.avatar)?void 0:t.name)||"",authorAvatarSrc:(null==i||null==(n=i.avatar)?void 0:n.imageSrc)||"",authorKaid:(null==i?void 0:i.kaid)||"",authorNickname:(null==i?void 0:i.nickname)||"",replyCount:c||0,answerCount:d||0,focus:p,replies:[],feedbackType:o});if(u){const e=u?l(u):[];m.answers=e}return m};t.filterFeedback=i;const l=e=>e.filter(Boolean).map(i);t.filterFeedbackList=l},iRWY:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n("pVnL")),a=y(n("q1tI")),s=n("mR6N"),i=n("JimW"),l=n("Vxy9"),c=o(n("Pwnf")),d=y(n("l6hM")),p=o(n("aqQx")),u=o(n("oia8")),f=n("i4Cj"),g=y(n("TqM9"));function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=function(e){return e?n:t})(e)}function y(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=m(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o}const h=(0,i.addStyle)("button");class w extends a.Component{constructor(...e){super(...e),this.state={flagType:null},this.handleSubmit=()=>{this.props.onClose(this.state.flagType)}}render(){const{onClose:e,post:t,tab:n}=this.props,o=["inappropriate"];return"questions"===n?o.push("shouldBeTipsOrThanks"):"comments"===n&&o.push("shouldBeQuestion"),o.push.apply(o,["lowquality","spam"]),a.createElement(d.default,{style:b.modal,onClose:e},a.createElement(i.View,{style:b.content},a.createElement(l.Title,{style:b.title},f.flagModalStrings.header),a.createElement(i.View,{style:b.post},a.createElement(l.Body,null,t.content)),a.createElement(i.View,null,o.map(((e,t)=>a.createElement(i.View,{key:e,style:[b.row,t>0&&b.separator]},a.createElement(h,{style:b.button,onClick:()=>this.setState({flagType:e})},a.createElement(u.default,{selected:this.state.flagType===e}),a.createElement(l.Body,null,f.flagModalStrings.flags[e].title)),a.createElement(l.Body,{style:b.desc},f.flagModalStrings.flags[e].description)))))),a.createElement(d.ModalFooter,{style:E},a.createElement(p.default,{width:138,color:c.default.blue,onClick:this.handleSubmit,disabled:!this.state.flagType},f.flagModalStrings.submit)))}}t.default=w;const b=s.StyleSheet.create({modal:{width:662,maxHeight:"80%"},title:{marginBottom:24},content:{flex:1,padding:"64px 64px 0px 64px"},row:{padding:"16px 0",flexShrink:0,alignItems:"start"},button:(0,r.default)({},g.notAButton,{display:"inline-flex",flexDirection:"row",alignItems:"center",":focus":{outline:"auto"}}),separator:{borderTop:`solid 1px ${c.default.offBlack16}`},desc:{color:c.default.offBlack64,paddingLeft:24},post:{flex:1,border:`solid 1px ${c.default.offBlack16}`,color:c.default.offBlack64,borderRadius:4,padding:16,overflow:"auto"}}),E={justifyContent:"flex-end",paddingLeft:16,paddingRight:16}},j9RJ:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Badges=void 0;var r=n("JimW"),a=n("mR6N"),s=o(n("wINb")),i=n("179n"),l=o(n("6RhW")),c=n("i4Cj"),d=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}o.default=e,n&&n.set(e,o);return o}(n("q1tI"));function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}const u=e=>{const t={locked:"/images/discussions/discussions-lock@3x.png",pinned:"/images/discussions/discussions-pin@3x.png"},n=[].concat((null==e?void 0:e.badges)||[],(()=>{const t=[];return e.isLocked&&t.push({name:"locked",translatedDescription:c.strings.discussionLocked,icons:{small:"/images/discussions/discussions-lock.svg"}}),e.isPinned&&t.push({name:"pinned",translatedDescription:c.strings.postPinned,icons:{small:"/images/discussions/discussions-pin.svg"}}),t})());return 0===n.length?null:d.createElement(r.View,{style:f.badges},n.map(((e,n)=>{const{icons:o,translatedDescription:c,name:p}=e,u=o.small||o.smallUrl,g=c||(0,i.getTextForBadgeInexact)({name:e.name||"",description:e.description||"",fullDescription:""},!1).translatedDescription;return d.createElement(l.default,{content:g,key:p},d.createElement(r.View,null,d.createElement("img",{className:(0,a.css)(f.badge),src:(0,s.default)(u),alt:g,onError:({currentTarget:e})=>{e.onerror=null,t[p||""]&&(e.src=t[p||""])}})))})))};t.Badges=u;const f=a.StyleSheet.create({badges:{flexDirection:"row"},badge:{width:16,height:16,marginLeft:4}});var g=u;t.default=g},jEbg:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.FEEDBACK_REPLIES_QUERY=t.FEEDBACK_REPLIES_PAGINATED_QUERY=void 0;var r=n("Xbru"),a=o(n("lTCR"));let s,i,l=e=>e;const c=(0,r.gqlOp)((0,a.default)(s||(s=l`
    query getFeedbackReplies($postKey: String!) {
        feedbackReplies(feedbackKey: $postKey) {
            isLocked
            isPinned
            expandKey
            appearsAsDeleted
            author {
                id
                kaid
                nickname
                avatar {
                    name
                    imageSrc
                }
            }
            content
            date
            definitelyNotSpam
            deleted
            downVoted
            expandKey
            feedbackType
            flaggedBy
            flaggedByUser
            flags
            focusUrl
            fromVideoAuthor
            key
            lowQualityScore
            notifyOnAnswer
            permalink
            qualityKind
            replyCount
            replyExpandKeys
            showLowQualityNotice
            sumVotesIncremented
            upVoted
        }
    }
`)));t.FEEDBACK_REPLIES_QUERY=c;const d=(0,r.gqlOp)((0,a.default)(i||(i=l`
    query getFeedbackRepliesPage(
        $postKey: String!
        $cursor: String
        $limit: Int!
    ) {
        feedbackRepliesPaginated(
            feedbackKey: $postKey
            cursor: $cursor
            limit: $limit
        ) {
            cursor
            isComplete
            feedback {
                isLocked
                isPinned
                expandKey
                appearsAsDeleted
                author {
                    id
                    kaid
                    nickname
                    avatar {
                        name
                        imageSrc
                    }
                }
                content
                date
                definitelyNotSpam
                deleted
                downVoted
                expandKey
                feedbackType
                flaggedBy
                flaggedByUser
                flags
                focusUrl
                fromVideoAuthor
                key
                lowQualityScore
                notifyOnAnswer
                permalink
                qualityKind
                replyCount
                replyExpandKeys
                showLowQualityNotice
                sumVotesIncremented
                upVoted
            }
        }
    }
`)));t.FEEDBACK_REPLIES_PAGINATED_QUERY=d},mEQP:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n("pVnL")),a=E(n("q1tI")),s=o(n("i8i4")),i=n("mR6N"),l=o(n("wa3X")),c=n("JasB"),d=n("JimW"),p=n("Vxy9"),u=o(n("F4p2")),f=n("i4Cj"),g=n("hDgO"),m=n("zbaY"),y=o(n("uEGL")),h=E(n("TqM9")),w=o(n("RTsg"));function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(b=function(e){return e?n:t})(e)}function E(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=b(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o}const P=(0,m.domainColors)("default").domain1;class v extends a.Component{constructor(...e){super(...e),this.renderFormattingOptionsButton=e=>{const{onToggleFormattingOptionsExpanded:t,formattingOptionsExpanded:n}=this.props,o=!n,r=n?f.footerStrings.hideFormattingOptions:f.footerStrings.showFormattingOptions;return a.createElement(l.default,{kind:"tertiary","aria-expanded":n?"true":"false","aria-controls":e,"aria-label":r,style:(k.button,k.formattingButton),onClick:()=>{t&&t(o)}},r)},this.renderPreviewButton=e=>{const{onTogglePreviewExpanded:t,previewExpanded:n}=this.props,o=!n,r=n?f.footerStrings.hideMarkdownPreview:f.footerStrings.showMarkdownPreview;return a.createElement(l.default,{kind:"tertiary","aria-expanded":n?"true":"false","aria-controls":e,"aria-label":r,style:(k.button,k.formattingButton),onClick:()=>{t&&t(o)}},r)}}componentDidUpdate(e){const{submitButton:t}=this;t&&"failed"===this.props.submitStatus&&"submitting"===e.submitStatus&&setTimeout((()=>t&&t.focus()),0)}getSubmitButtonCopy(){const{tab:e,isAnswer:t,isReply:n,editing:o,acceptingClarification:r,submitStatus:a}=this.props,s=f.postStrings.areResponsesCalledAnswers(e);return"submitting"===a?f.footerStrings.submitting:o?f.postStrings.saveChanges:r?f.postStrings.acceptClarification:n?f.postStrings.comment:!t&&e?f.tabsStrings[e].buttonContents:t&&s?f.postStrings.answerButtonContents:f.postStrings.replyButtonContents}renderPreviewArea(){return a.createElement(p.Body,{style:[h.content,k.previewContainer,this.props.previewExpanded&&k.previewContainerExpanded]},a.createElement(w.default,{string:this.props.content}))}render(){const{isReply:e,editing:t,acceptingClarification:n,canShowFormattingOptions:o,formattingOptionsExpanded:r,submitButtonDisabled:i,submitStatus:p,onSubmit:g}=this.props,m=t||n,y="submitting"===p,h=this.getSubmitButtonCopy(),w=n?[k.textareaFooter,k.textareaFooterAcceptingClarification]:k.textareaFooter;return a.createElement(d.UniqueIDProvider,{mockOnFirstRender:!0,scope:"discussion-post-formatting-options-button"},(t=>a.createElement(d.View,{style:[k.textareaContainerFooter,e&&k.textareaReplyFooter]},a.createElement(d.View,{style:w,"aria-live":"polite"},!n&&this.renderPreviewButton(t.get("toggle-preview-button")),!n&&this.renderFormattingOptionsButton(t.get("toggle-button")),a.createElement(d.View,{style:k.buttonContainer},m&&a.createElement(l.default,{kind:"tertiary",onClick:this.props.onCancel,style:k.button},f.postStrings.cancel),m&&a.createElement(c.Strut,{size:8}),a.createElement(l.default,{disabled:i||y,onClick:g,spinner:y,style:k.button,ref:e=>this.submitButton=s.default.findDOMNode(e),"aria-label":h},h))),a.createElement(d.View,null,this.renderPreviewArea()),a.createElement(d.View,{style:[k.formattingOptionsContainer,o&&r&&k.formattingOptionsContainerExpanded],id:t.get("toggle-button")},o&&r&&a.createElement(u.default,null)))))}}t.default=v,v.defaultProps={editing:!1,acceptingClarification:!1};const k=i.StyleSheet.create({textareaContainerFooter:{padding:"12px 16px",border:h.border,borderTop:"none",borderBottomRightRadius:4,borderBottomLeftRadius:4},textareaFooter:{flexDirection:"row",justifyContent:"space-between",[y.default.xsOrSmaller]:{flexDirection:"column"}},textareaReplyFooter:{border:"none",paddingLeft:0,paddingRight:0},textareaFooterAcceptingClarification:{justifyContent:"flex-end"},submitButtonContents:{flexDirection:"row",alignItems:"center",justifyContent:"center"},button:{[y.default.xsOrSmaller]:{width:"calc(100% + 60px)"}},submitButtonSpinner:{marginRight:8},notAButton:(0,r.default)({},h.notAButton),footerSecondaryButton:{color:P,marginRight:16,":hover":{textDecoration:"underline"},[y.default.xsOrSmaller]:{width:"100%",marginBottom:16,marginRight:0}},previewContainer:{display:"none"},previewContainerExpanded:{borderTop:h.border,borderBottom:h.border,boxSizing:"border-box",marginTop:16,marginBottom:16,display:"block",minHeight:h.textareaMinHeight,transition:`min-height ${g.standardTransition}`,overflow:"auto"},formattingOptionsContainer:{display:"none"},formattingOptionsContainerExpanded:{display:"flex"},formattingLabel:{fontWeight:"bold"},formattingButton:{[y.default.xsOrSmaller]:{width:"100%"}},buttonContainer:{flexDirection:"row"}})},mt3D:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.DATA_QUERY=void 0;var r=P(n("q1tI")),a=n("mR6N"),s=o(n("lTCR")),i=n("JimW"),l=P(n("6RhW")),c=o(n("Pwnf")),d=P(n("TqM9")),p=n("8r+/"),u=o(n("f4yp")),f=o(n("wINb")),g=n("i4Cj"),m=o(n("RdRB")),y=o(n("OcLW")),h=n("AE4M"),w=o(n("cfQQ"));let b;function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(E=function(e){return e?n:t})(e)}function P(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=E(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o}const v=(0,p.gqlOp)((0,s.default)(b||(b=(e=>e)`
    query discussionAvatar {
        user {
            id
            avatar {
                name
                imageSrc
            }
        }
    }
`)));t.DATA_QUERY=v;class k extends r.Component{constructor(...e){super(...e),this.renderImage=(e,t,n)=>{let o=null;return o=t?r.createElement("img",{className:(0,a.css)(C.image),src:(0,f.default)(n),alt:g.avatarStrings.getAvatarForUser((0,h.getAriaAvatarName)(t),e)}):r.createElement("img",{className:(0,a.css)(C.image),src:(0,f.default)(n),alt:"","aria-hidden":!0}),r.createElement(i.View,{style:C.container},o)},this.renderTooltip=(e,t,n,o)=>{const a=r.createElement(m.default,{kaid:n}),s=`${g.avatarStrings.getAvatarForUser((0,h.getAriaAvatarName)(t),e)} ${g.avatarStrings.goToUserProfile(e)}`,i=`/profile/${n}/discussion`;return r.createElement(l.default,{content:r.createElement(l.TooltipContent,null,a)},r.createElement(y.default,{href:i,"aria-label":s},o))}}render(){const{showCurrentUserAvatar:e,avatarSrc:t,avatarName:n,username:o,enableProfilePreviewTooltip:a,kaid:s,profile:i}=this.props;let l;return e&&i?r.createElement(u.default,{query:v,fetchPolicy:"cache-and-network"},(({data:e})=>{var r,c;const d=i.get("username"),p=(null==e||null==(r=e.user)?void 0:r.avatar.name)||n,u=(null==e||null==(c=e.user)?void 0:c.avatar.imageSrc)||t;return l=this.renderImage(d,p,u),a?this.renderTooltip(o,n,s,l):l})):(l=this.renderImage(o,n,t),a?this.renderTooltip(o,n,s,l):l)}}k.defaultProps={showCurrentUserAvatar:!1,avatarName:"Default Khan Academy avatar",avatarSrc:"/images/avatars/svg/blobby-green.svg",username:"",kaid:"",enableProfilePreviewTooltip:!1};const C=a.StyleSheet.create({container:{borderRadius:"50%",width:48,minWidth:48,height:48,border:`solid 2px ${d.borderColor}`,backgroundColor:c.default.white,flexDirection:"row",justifyContent:"center",alignItems:"center"},image:{width:32,height:32}});var S=(0,w.default)(k);t.default=S},nR7h:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.ADD_FEEDBACK_TO_DISCUSSION=void 0;var r=n("Xbru"),a=o(n("lTCR"));let s;const i=(0,r.gqlOp)((0,a.default)(s||(s=(e=>e)`
    mutation AddFeedbackToDiscussion(
        $focusKind: String
        $focusId: String
        $parentKey: String
        $textContent: String!
        $feedbackType: FeedbackType!
        $fromVideoAuthor: Boolean
        $shownLowQualityNotice: Boolean
    ) {
        addFeedbackToDiscussion(
            focusKind: $focusKind
            focusId: $focusId
            parentKey: $parentKey
            textContent: $textContent
            feedbackType: $feedbackType
            fromVideoAuthor: $fromVideoAuthor
            shownLowQualityNotice: $shownLowQualityNotice
        ) {
            feedback {
                appearsAsDeleted
                author {
                    id
                    kaid
                    nickname
                    avatar {
                        name
                        imageSrc
                    }
                }
                content
                date
                definitelyNotSpam
                deleted
                downVoted
                expandKey
                feedbackType
                flaggedBy
                flags
                focusUrl
                focus {
                    kind
                    id
                    translatedTitle
                    relativeUrl
                }
                fromVideoAuthor
                key
                notifyOnAnswer
                permalink
                qualityKind
                replyCount
                replyExpandKeys
                sumVotesIncremented
                upVoted
            }
            lowQualityResponse {
                feedbackCode
                feedbackChar
                feedbackType
                showLowQualityNotice
            }
            error {
                code
            }
        }
    }
`)));t.ADD_FEEDBACK_TO_DISCUSSION=i},oia8:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=d(n("q1tI")),a=n("mR6N"),s=o(n("Pwnf")),i=n("JimW"),l=d(n("TqM9"));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}function d(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o}class p extends r.Component{render(){const{selected:e}=this.props;return r.createElement(i.View,{"aria-hidden":"true",style:[u.fakeRadioButton,e&&u.selectedFakeRadioButton]})}}t.default=p,p.defaultProps={selected:!1};const u=a.StyleSheet.create({fakeRadioButton:{flexShrink:0,flexGrow:0,borderRadius:"50%",width:16,height:16,border:l.border,marginRight:8,boxSizing:"border-box"},selectedFakeRadioButton:{border:`4px solid ${s.default.blue}`}})},qRmI:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.AcceptedClarificationInput=void 0;var r=m(n("q1tI")),a=n("/MKj"),s=n("mR6N"),i=o(n("gE8/")),l=n("JimW"),c=o(n("HbaH")),d=n("IZy4"),p=n("i4Cj"),u=m(n("TqM9")),f=n("DDFQ");function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(g=function(e){return e?n:t})(e)}function m(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o}class y extends r.Component{constructor(e){super(e),this.getStartAndEndFromProps=()=>{const{post:e,editingOrAccepting:t}=this.props;let n=20,o=40;"editing"===t&&e.closeTimestamp?(n=e.openTimestamp,o=e.closeTimestamp):e.content&&(n=(0,d.getTimestampSecondsFromText)(e.content),o=n+20);const r=(0,d.getTimestampFromSeconds)(n),a=(0,d.getTimestampFromSeconds)(o);return{startingTimestampMinutes:Number(r.minutes),startingTimestampSeconds:Number(r.seconds),endingTimestampMinutes:Number(a.minutes),endingTimestampSeconds:Number(a.seconds)}},this.handleSubmitAcceptedClarification=e=>{const{post:t,editingOrAccepting:n,onSubmitClarificationAcceptance:o,onSubmitClarificationEdit:r}=this.props,{startingTimestampMinutes:a,startingTimestampSeconds:s,endingTimestampMinutes:i,endingTimestampSeconds:l}=this.state,c=60*a+s,d=60*i+l;c>=d||("editing"===n?r(e,c,d):t.authorAvatarSrc&&o(t.key,t.authorAvatarSrc,t.authorNickname,t.authorKaid,e,c,d))},this.renderClarificationTimestampInput=e=>{const t=this.state[e];return r.createElement("input",{className:(0,s.css)(h.acceptClarificationInput),value:t,onChange:t=>{const n=t.target.value,o=n.length?Number(n):0;this.setState({[e]:o})},type:"number",min:0,max:59})},this.state=this.getStartAndEndFromProps()}componentDidUpdate(e){this.props.editingOrAccepting===e.editingOrAccepting&&this.props.post.openTimestamp===e.post.openTimestamp&&this.props.post.closeTimestamp===e.post.closeTimestamp&&this.props.post.content===e.post.content||this.setState(this.getStartAndEndFromProps())}render(){const{post:e,contentId:t,topicSlug:n,onCancel:o}=this.props;let a="",s="";return e.key?(a=e.key,s=e.content):e.id&&(a=e.id,s=e.text),r.createElement(l.View,{style:h.replyInputContainer},r.createElement(c.default,{acceptingClarification:!0,tab:"clarifications",contentKind:"Video",contentId:t,topicSlug:n,feedbackKey:a,initialPostContent:s,onCancel:o,onSubmitAcceptedClarification:this.handleSubmitAcceptedClarification}),r.createElement(l.View,{style:h.acceptClarificationContainer},p.miscStrings.timestampFromLabel,this.renderClarificationTimestampInput("startingTimestampMinutes"),":",this.renderClarificationTimestampInput("startingTimestampSeconds"),p.miscStrings.timestampToLabel,this.renderClarificationTimestampInput("endingTimestampMinutes"),":",this.renderClarificationTimestampInput("endingTimestampSeconds")))}}t.AcceptedClarificationInput=y;const h=s.StyleSheet.create({spinner:{marginRight:i.default.xSmall_8},replyInputContainer:{paddingBottom:i.default.large_24},acceptClarificationContainer:{display:"block",marginLeft:u.avatarContainerDiameter+u.avatarFormSpace},acceptClarificationInput:{width:40,padding:0,margin:"16px 4px 0 4px",textAlign:"right"}}),w={onSubmitClarificationAcceptance:f.acceptClarificationAction,onSubmitClarificationEdit:f.editAcceptedClarificationAction};var b=(0,a.connect)((e=>({contentId:e.contentId})),w)(y);t.default=b},"r/58":function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.MODIFY_NOTIFICATIONS_FLAG_MUTATION=void 0;var r=n("Xbru"),a=o(n("lTCR"));let s;const i=(0,r.gqlOp)((0,a.default)(s||(s=(e=>e)`
    mutation notifyAnswer($key: String!, $notifyOnAnswer: Boolean!) {
        modifyNotifyOnAnswer(
            feedbackKey: $key
            notifyOnAnswer: $notifyOnAnswer
        ) {
            feedback {
                feedbackType
                content
                notifyOnAnswer
            }
        }
    }
`)));t.MODIFY_NOTIFICATIONS_FLAG_MUTATION=i},"t/UD":function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.FLAG_POST_MUTATION=void 0;var r=n("Xbru"),a=o(n("lTCR"));let s;const i=(0,r.gqlOp)((0,a.default)(s||(s=(e=>e)`
    mutation FlagPostMutation(
        $flag: String!
        $entityKey: String!
        $justification: String
    ) {
        flagEntity(
            flag: $flag
            entityKey: $entityKey
            justification: $justification
        ) {
            error {
                code
            }
        }
    }
`)));t.FLAG_POST_MUTATION=i},t0zn:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.createDiscussionStore=void 0;var r=n("ANjH"),a=o(n("TdMD")),s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}o.default=e,n&&n.set(e,o);return o}(n("wkgs")),i=n("0zMT"),l=o(n("mXPZ"));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}const d=(0,i.createCompose)({reduxDevtoolsOptions:{name:"Discussions"}})((0,r.applyMiddleware)(a.default))(r.createStore);t.createDiscussionStore=e=>{const t=(0,s.getDefaultState)(l.default),n=null==e?t:(0,s.mergeStateWithNewPosts)(t,e.feedback,t.currentTab,e.isComplete,e.totalCount,e.cursor);return d(s.default,n)}},tCRy:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.feedbackQueryToFetchPostResponse=t.defaultApi=t.default=void 0;var r=o(n("pVnL")),a=n("R0mg"),s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=E(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}o.default=e,n&&n.set(e,o);return o}(n("4PhQ")),i=n("lGNd"),l=n("doqZ"),c=n("r/58"),d=n("t/UD"),p=n("giNK"),u=n("WmEb"),f=n("IW3x"),g=n("AE4M"),m=n("jEbg"),y=n("iMDn"),h=n("2Boh"),w=n("26bL"),b=n("i6LP");function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(E=function(e){return e?n:t})(e)}const P=1,v=0,k=-1,C=(e,t)=>{var n,o,r,a;const s=null!=(n=t.cursor)?n:"",i=null==(o=t.sortedByDate)||o,l=null!=(r=t.isComplete)&&r,c=(0,y.filterFeedbackList)(null!=(a=t.feedback)?a:[]);return{cursor:s,feedback:c,isComplete:l,qaExpandKey:e.qaExpandKey||"",sortedByDate:i,totalCount:c.length,type:e.feedbackType}};t.feedbackQueryToFetchPostResponse=C;const S=(e,t)=>t.mutate(u.VOTE_ENTITY_MUTATION,{variables:e}).then((({data:e})=>{var t;return null!=e&&null!=(t=e.voteEntity)&&t.error?(0,g.getVoteEntityErrorMessage)(e.voteEntity.error):null})).catch((e=>(0,g.getVoteEntityErrorMessage)({code:"INTERNAL"}))),T={inappropriate:"inappropriate",lowquality:"lowquality",shouldBeQuestion:"changetoquestion",shouldBeTipsOrThanks:"changetocomment",spam:"spam",plagiarism:"plagiarism","vote-soliciting":"vote-soliciting","using-disallowed":"using-disallowed"},A=(e,t,n)=>{const o=(0,r.default)({modAction:n},e);return t.mutate(p.PERFORM_MOD_ACTION,{variables:o}).then((({data:e})=>{var t;return null==e||null==(t=e.performModAction)||!t.error})).catch((()=>!1))},x={getId:()=>"default",fetchPosts:async(e,t)=>{const n=await t.query(f.FEEDBACK_QUERY,{variables:e,fetchPolicy:"network-only"});return n&&n.data&&n.data.feedback?C(e,n.data.feedback):null},modifyNotificationsFlag:async(e,t)=>{var n,o;const r=await t.mutate(c.MODIFY_NOTIFICATIONS_FLAG_MUTATION,{variables:{key:e.postKey,notifyOnAnswer:e.enable}});return null!=r&&null!=(n=r.data)&&null!=(o=n.modifyNotifyOnAnswer)&&o.feedback?r.data.modifyNotifyOnAnswer.feedback.notifyOnAnswer:null},upvotePost:({postKey:e,alreadyVoted:t},n)=>S({postKey:e,voteType:t?v:P},n),downvotePost:({postKey:e,alreadyVoted:t},n)=>S({postKey:e,voteType:t?v:k},n),flagPost:async(e,t)=>{var n,o;const r=T[e.flag],a=await t.mutate(d.FLAG_POST_MUTATION,{variables:{entityKey:e.postKey,flag:r}});return null==(null==a||null==(n=a.data)||null==(o=n.flagEntity)?void 0:o.error)},changeType:(e,t)=>A(e,t,"CHANGE_TYPE"),clearFlags:(e,t)=>A(e,t,"CLEAR_FLAGS"),deletePost:async(e,t)=>{var n,o,r;const a=await t.mutate(l.DELETE_POST_MUTATION,{variables:{postKey:e.postKey}});return null==(null==a||null==(n=a.data)||null==(o=n.hideFeedback)||null==(r=o.error)?void 0:r.code)},hideProgramEverywhere:async(e,t)=>{var n,o,r;const a=await t.mutate(w.HIDE_PROGRAM_EVERYWHERE,{variables:{programID:e.programID,hide:e.hide}});return null==(null==a||null==(n=a.data)||null==(o=n.hideProgramEverywhere)||null==(r=o.error)?void 0:r.code)},hideProgramFromHotlist:async(e,t)=>{var n,o,r;const a=await t.mutate(b.HIDE_PROGRAM_FROM_HOTLIST,{variables:{programID:e.programID,hide:e.hide}});return null==(null==a||null==(n=a.data)||null==(o=n.hideProgramFromHotlist)||null==(r=o.error)?void 0:r.code)},undeletePost:(e,t)=>A(e,t,"UNDELETE"),lockThread:(e,t)=>A(e,t,"LOCK"),unlockThread:(e,t)=>A(e,t,"UNLOCK"),pinThread:(e,t)=>A(e,t,"PIN"),unpinThread:(e,t)=>A(e,t,"UNPIN"),fetchAnswers:async({parentKey:e},t)=>{var n;if(!e){const e=new s.KAError("Cannot fetch answers without a questionKey",s.Errors.NotAllowed);return s.default.error(e,s.Errors.Internal),Promise.reject(e)}const o=await t.query(h.FEEDBACK_ANSWERS_QUERY,{variables:{parentKey:e},fetchPolicy:"network-only"}),r=null==o||null==(n=o.data)?void 0:n.feedbackByKey;if(null!=r&&r.answers){return(0,y.filterFeedbackList)(r.answers)}return null},fetchRepliesPaginated:(e,t)=>t.query(m.FEEDBACK_REPLIES_PAGINATED_QUERY,{variables:e,fetchPolicy:"network-only"}).then((({data:e})=>{if(null!=e&&e.feedbackRepliesPaginated){const{feedback:t,cursor:n,isComplete:o}=e.feedbackRepliesPaginated;return{cursor:n,isComplete:o,feedback:(0,y.filterFeedbackList)(t||[])}}return null})),fetchAcceptedClarifications:e=>(0,a.getOfficialClarifications)((0,i.getUnsafeApolloGqlClient)(),e.youtubeId),acceptClarification:e=>(0,a.createOfficialClarification)((0,i.getUnsafeApolloGqlClient)(),e.youtubeId,e.kaid,e.text,e.openTimestamp,e.closeTimestamp),editAcceptedClarification:e=>(0,a.updateOfficialClarification)((0,i.getUnsafeApolloGqlClient)(),e.id,e.youtubeId,e.text,e.openTimestamp,e.closeTimestamp),deleteAcceptedClarification:e=>(0,a.deleteOfficialClarification)((0,i.getUnsafeApolloGqlClient)(),e.clarificationId)};t.defaultApi=x;const O={};var I={get:e=>e&&O[e]||(0,r.default)({},x),register(e,t){O[e]=t}};t.default=I},wkgs:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.calcSumVotes=d,t.default=function(e,t){if(!e)return c();switch(t.type){case"initializeContent":{const{topicSlug:n,contentKind:o,contentId:a,youtubeId:s,qaExpandKey:i}=t,l="projectfeedback"===t.expandFeedbackType?"projecthelp":t.expandFeedbackType;return(0,r.default)({},e,{topicSlug:n,contentKind:o,contentId:a,youtubeId:s,qaExpandKey:i,expandFeedbackType:l,currentTab:l||e.currentTab})}case"initializeDiscussionListComponent":{const{topicSlug:n,tab:o,cursor:a,apiId:s}=t,{tabs:i}=e;return(0,r.default)({},e,{topicSlug:n,apiId:s||"",contentKind:"Topic",currentTab:o,tabs:(0,r.default)({},i,{[o]:(0,r.default)({},i[o],{cursor:a})})})}case"postSuccess":{const{post:n,tab:o}=t;n.answers=n.answers||[],n.replies=n.replies||[];let a=[],i={};const{questionKey:l}=n;if("answer"===n.type&&l){a=e.tabs[o].postKeys;const t=e.posts[l];t.answers.unshift(n.key),t.answerCount=(t.answerCount||0)+1,i=(0,r.default)({},e.posts,{[l]:t,[n.key]:n})}else a=[n.key].concat(e.tabs[o].postKeys),i=(0,r.default)({[n.key]:n},e.posts);let c=e.hasUnansweredHelpRequests;if("projecthelp"===n.type)c=!0;else if("projecthelp"===o&&"answer"===n.type&&c){const t=e.tabs.projecthelp.postKeys;if(1===t.length)c=!1;else{const e=t.find((e=>(0,s.isPostUnanswered)(e,i)));c=!!e}}return(0,r.default)({},e,{posts:i,hasUnansweredHelpRequests:c,tabs:(0,r.default)({},e.tabs,{[o]:(0,r.default)({},e.tabs[o],{postKeys:a,totalCount:e.tabs[o].totalCount+1})}),newPostKey:n.key})}case"fetchingPosts":return(0,r.default)({},e,{fetchingPosts:!0});case"updatePosts":return u(e,t.posts,t.tab,t.isComplete,t.totalCount,t.cursor,t.acceptedClarificationPosts);case"appendPosts":{const{tab:n,cursor:o,isComplete:s}=t,{tabs:i}=e,l=t.posts.filter((t=>!(0,a.keys)(e.posts).includes(t.key))),c=(0,r.default)({},e.posts,p(l)),d=i[n].postKeys,u=l.map((e=>e.key)),f=[].concat(d,u);return(0,r.default)({},e,{fetchingPosts:!1,posts:c,newPostKey:u.length?u[0]:null,tabs:(0,r.default)({},i,{[n]:(0,r.default)({},e.tabs[n],{postKeys:f,cursor:o,isComplete:s})})})}case"updatePost":{const{post:n}=t,o=e.posts[n.key];return(0,r.default)({},e,{posts:(0,r.default)({},e.posts,{[n.key]:(0,r.default)({},o,n)})})}case"updateReplies":{const{replies:n,parentKey:o}=t,a=(0,r.default)({},e.posts,p(n));return(0,r.default)({},e,{posts:(0,r.default)({},a,{[o]:(0,r.default)({},a[o],{replies:n.map((e=>e.key))})})})}case"updateRepliesPaginated":{const{replies:n,parentKey:o,repliesCursor:a}=t,s=(0,r.default)({},e.posts,p(n)),i=s[o].replies||[],l=[].concat(i);return n.forEach((e=>{-1===i.indexOf(e.key)&&l.push(e.key)})),(0,r.default)({},e,{posts:(0,r.default)({},s,{[o]:(0,r.default)({},s[o],{replies:l,repliesCursor:a})})})}case"updateAnswers":{const{answers:n,parentKey:o}=t,a=(0,r.default)({},e.posts,p(n));return(0,r.default)({},e,{posts:(0,r.default)({},a,{[o]:(0,r.default)({},a[o],{answers:n.map((e=>e.key))})})})}case"fetchingAnswers":{const{parentKey:n,status:o}=t;return(0,r.default)({},e,{fetchingAnswersStatus:(0,r.default)({},e.fetchingAnswersStatus,{[n]:o})})}case"fetchingReplies":{const{parentKey:n,status:o}=t;return(0,r.default)({},e,{fetchingRepliesStatus:(0,r.default)({},e.fetchingRepliesStatus,{[n]:o})})}case"clearLoadingStatus":return(0,r.default)({},e,{fetchingAnswersStatus:{},fetchingRepliesStatus:{}});case"addReply":{var n;const{parentKey:o,post:a}=t,s=(0,r.default)({},e.posts,{[a.key]:a});s[o].replyCount=null!=(n=s[o].replyCount)?n:0,s[o].replyCount+=1;const i=s[o].replies||[];return s[o].replies=[].concat(i,[a.key]),(0,r.default)({},e,{posts:s,newPostKey:a.key})}case"upvotePost":{const{postKey:n}=t,o=e.posts[n];if(!o)throw new i.KAError("post doesn't exist",i.Errors.Internal);return(0,r.default)({},e,{posts:(0,r.default)({},e.posts,{[n]:(0,r.default)({},o,{downVoted:!1,upVoted:!o.upVoted,sumVotesIncremented:d(o,1)})})})}case"changePostType":{const{postKey:n,postType:o}=t,a=e.posts[n],c=(0,s.getPostType)(a);if("answer"===o)throw new i.KAError("Cannot change the type to an Answer",i.Errors.Internal);if(!a)throw new i.KAError("post doesn't exist",i.Errors.Internal);if(!c)throw new i.KAError("post has no type",i.Errors.Internal);if("reply"===c||"scratchpad"===c||"projecthelp"===c||"projecteval"===c||"projectevalanswer"===c||"projecthelpanswer"===c)throw new i.KAError(`posts of type "${c}" can't be changed to another type`,i.Errors.Internal);const d={comment:"comments",question:"questions",clarification:"clarifications"}[o],p=e.tabs[d].postKeys;if("answer"===c||"projecthelp"===c){if(!a.questionKey)throw new i.KAError("answer has no parent",i.Errors.Internal);const t=e.posts[a.questionKey];let n=e.posts;return t&&(n=(0,r.default)({},e.posts,{[t.key]:(0,r.default)({},t,{answers:t.answers.filter((e=>e!==a.key))})})),(0,r.default)({},e,{posts:(0,r.default)({},n,{[a.key]:(0,r.default)({},a,{type:o,feedbackType:(0,l.toGqlFeedbackType)(o)})}),tabs:(0,r.default)({},e.tabs,{[d]:(0,r.default)({},e.tabs[d],{postKeys:[a.key].concat(p),totalCount:e.tabs[d].totalCount+1})}),clearedPosts:[].concat(e.clearedPosts,[a.key])})}const u={comment:"comments",question:"questions",clarification:"clarifications"}[c];return(0,r.default)({},e,{posts:(0,r.default)({},e.posts,{[a.key]:(0,r.default)({},a,{type:o,feedbackType:(0,l.toGqlFeedbackType)(o)})}),tabs:(0,r.default)({},e.tabs,{[u]:(0,r.default)({},e.tabs[u],{postKeys:e.tabs[u].postKeys.filter((e=>e!==a.key)),totalCount:e.tabs[u].totalCount-1}),[d]:(0,r.default)({},e.tabs[d],{postKeys:[a.key].concat(p),totalCount:e.tabs[d].totalCount+1})}),clearedPosts:[].concat(e.clearedPosts,[a.key])})}case"clearFlags":{const{postKey:n}=t,o=e.posts[n];if(!o)throw new i.KAError("post doesn't exist",i.Errors.Internal);return(0,r.default)({},e,{posts:(0,r.default)({},e.posts,{[n]:(0,r.default)({},o,{flags:[],flaggedByUser:!1})}),selectedPosts:(0,r.default)({},e.selectedPosts,{[n]:!1}),clearedPosts:[].concat(e.clearedPosts,[o.key])})}case"downvotePost":{const{postKey:n}=t,o=e.posts[n];if(!o)throw new i.KAError("post doesn't exist",i.Errors.Internal);return(0,r.default)({},e,{posts:(0,r.default)({},e.posts,{[n]:(0,r.default)({},o,{downVoted:!o.downVoted,upVoted:!1,sumVotesIncremented:d(o,-1)})})})}case"flagPost":{const{postKey:n,flag:o}=t,a=e.posts[n],s=a.flags||[];if(!a)throw new i.KAError("post doesn't exist",i.Errors.Internal);return(0,r.default)({},e,{posts:(0,r.default)({},e.posts,{[n]:(0,r.default)({},a,{flaggedByUser:!0,flags:[].concat(s,[o])})})})}case"changeTab":return(0,r.default)({},e,{currentTab:t.tab,newPostKey:null});case"changeSortBy":return(0,r.default)({},e,{currentSort:t.sort,newPostKey:null});case"resetNewPostKey":return(0,r.default)({},e,{newPostKey:null});case"setFocusOnTopLevelInput":return(0,r.default)({},e,{focusOnTopLevelInput:!0});case"resetFocusOnTopLevelInput":return(0,r.default)({},e,{focusOnTopLevelInput:!1});case"resetExpandKey":return(0,r.default)({},e,{expandFeedbackType:null,qaExpandKey:null});case"deletePost":{const{currentTab:n}=e,{postKey:o}=t,a=e.posts[o];if(!a)throw new i.KAError("post doesn't exist",i.Errors.Internal);const l=(0,r.default)({},e.posts,{[o]:(0,r.default)({},a,{deleted:!0})}),c="projecthelp"===a.type;let d=e.hasUnansweredHelpRequests;if(c&&d){d=!1;const t=e.tabs.projecthelp.postKeys;t.length>1&&(d=t.some((e=>(0,s.isPostUnanswered)(e,l))))}if("projecthelp"===n&&"answer"===a.type&&!d&&a.questionKey){const t=e.posts[a.questionKey],n=t.answers.some((e=>{const t=l[e];return t&&!t.deleted&&!t.appearsAsDeleted}));d=!n}return(0,r.default)({},e,{hasUnansweredHelpRequests:d,posts:l,clearedPosts:[].concat(e.clearedPosts,[a.key])})}case"deleteAcceptedClarificationPost":{const{clarificationId:n}=t,o=e.acceptedClarificationPosts.filter((e=>e.id!==n));if(o.length===e.acceptedClarificationPosts.length)throw new i.KAError("accepted clarification doesn't exist",i.Errors.Internal);return(0,r.default)({},e,{acceptedClarificationPosts:o})}case"undeletePost":{const{postKey:n}=t,o=e.posts[n];if(!o)throw new i.KAError("post doesn't exist",i.Errors.Internal);return(0,r.default)({},e,{posts:(0,r.default)({},e.posts,{[n]:(0,r.default)({},o,{deleted:!1})})})}case"editPost":{const{postKey:n,content:o}=t,a=e.posts[n];if(!a)throw new i.KAError("post doesn't exist",i.Errors.Internal);return(0,r.default)({},e,{posts:(0,r.default)({},e.posts,{[n]:(0,r.default)({},a,{content:o})})})}case"lockThread":{const{postKey:n}=t,o=e.posts[n];if(!o)throw new i.KAError("post doesn't exist",i.Errors.Internal);if("question"!==o.type&&"comment"!==o.type)throw new i.KAError("You can only lock questions and tips&thanks",i.Errors.Internal);return f(n,e,!0)}case"unlockThread":{const{postKey:n}=t,o=e.posts[n];if(!o)throw new i.KAError("post doesn't exist",i.Errors.Internal);if("question"!==o.type&&"comment"!==o.type)throw new i.KAError("You can only lock questions and tips&thanks",i.Errors.Internal);return f(n,e,!1)}case"pinThread":{const{postKey:n}=t,o=e.posts[n];if(!o)throw new i.KAError("post doesn't exist",i.Errors.Internal);if("question"!==o.type&&"answer"!==o.type&&"comment"!==o.type)throw new i.KAError("can only lock questions, answers, or tips&thanks",i.Errors.Internal);return(0,r.default)({},e,{posts:(0,r.default)({},e.posts,{[n]:(0,r.default)({},o,{isPinned:!0})})})}case"unpinThread":{const{postKey:n}=t,o=e.posts[n];if(!o)throw new i.KAError("post doesn't exist",i.Errors.Internal);if("question"!==o.type&&"answer"!==o.type&&"comment"!==o.type)throw new i.KAError("can only unlock questions, answers, or tips&thanks",i.Errors.Internal);return(0,r.default)({},e,{posts:(0,r.default)({},e.posts,{[n]:(0,r.default)({},o,{isPinned:!1})})})}case"acceptClarification":{const{originalClarificationId:n,clarification:o}=t,a=(0,r.default)({},e.posts);delete a[n];const s=e.tabs.clarifications.postKeys.filter((e=>e!==n));if(s.length===e.tabs.clarifications.postKeys.length)throw new i.KAError("Couldn't find the clarification to delete.",i.Errors.Internal);return(0,r.default)({},e,{posts:a,acceptedClarificationPosts:[].concat(e.acceptedClarificationPosts,[o]),tabs:(0,r.default)({},e.tabs,{clarifications:(0,r.default)({},e.tabs.clarifications,{postKeys:s,totalCount:e.tabs.clarifications.totalCount-1})})})}case"startAcceptingClarification":return(0,r.default)({},e,{clarificationBeingAcceptedId:t.clarificationId});case"stopAcceptingClarification":return(0,r.default)({},e,{clarificationBeingAcceptedId:null});case"startEditingPost":return(0,r.default)({},e,{postBeingEditedKey:t.postKey});case"stopEditingPost":return(0,r.default)({},e,{postBeingEditedKey:null});case"editAcceptedClarification":{const{clarification:n}=t,o=e.acceptedClarificationPosts.map((e=>e.id===n.id?n:e));return(0,r.default)({},e,{acceptedClarificationPosts:o})}case"toggleReplyInput":return(0,r.default)({},e,{displayInputPostKey:e.displayInputPostKey===t.postKey?null:t.postKey});case"selectPosts":{const n=(0,r.default)({},e.selectedPosts);return t.postKeys.filter((t=>!e.clearedPosts.includes(t))).forEach((e=>{n[e]=!0})),(0,r.default)({},e,{selectedPosts:n})}case"skipPosts":{const n=[].concat(e.clearedPosts,t.postKeys);return(0,r.default)({},e,{clearedPosts:n})}case"deselectPost":{const n=(0,r.default)({},e.selectedPosts,{[t.postKey]:!1});return(0,r.default)({},e,{selectedPosts:n})}case"deselectAll":return(0,r.default)({},e,{selectedPosts:{}});case"selectErroredPosts":{const n={};return t.postKeys.forEach((e=>{n[e]=!0})),(0,r.default)({},e,{selectedPosts:n})}case"hideProgramFromHotlist":{const{postKey:n,hidden:o}=t,a=e.posts[n];if(!a)throw new i.KAError("post doesn't exist",i.Errors.Internal);return(0,r.default)({},e,{posts:(0,r.default)({},e.posts,{[n]:(0,r.default)({},a,{hideFromHotlist:o})})})}default:t.type;return e}},t.flattenPosts=p,t.getDefaultState=c,t.mergeStateWithNewPosts=u;var r=o(n("pVnL")),a=n("sExA"),s=n("AE4M"),i=n("4PhQ"),l=n("69Ww");function c(e={isLoggedIn:!1}){return{topicSlug:"",contentKind:"",contentId:"",youtubeId:null,posts:{},acceptedClarificationPosts:[],tabs:{questions:{cursor:"",isComplete:!0,postKeys:[],totalCount:0},answers:{cursor:"",isComplete:!0,postKeys:[],totalCount:0},comments:{cursor:"",isComplete:!0,postKeys:[],totalCount:0},clarifications:{cursor:"",isComplete:!0,postKeys:[],totalCount:0},projecthelp:{cursor:"",isComplete:!0,postKeys:[],totalCount:0}},newPostKey:null,focusOnTopLevelInput:!1,currentTab:"questions",currentSort:e.isLoggedIn?"trending":"top-voted",currentCursor:"",qaExpandKey:null,expandFeedbackType:null,displayInputPostKey:null,apiId:"",clarificationBeingAcceptedId:null,postBeingEditedKey:null,hasUnansweredHelpRequests:null,selectedPosts:{},clearedPosts:[],fetchingAnswersStatus:{},fetchingRepliesStatus:{}}}function d(e,t){return 1===t?e.upVoted?e.sumVotesIncremented-1:e.sumVotesIncremented+(e.downVoted?2:1):e.downVoted?e.sumVotesIncremented+1:e.sumVotesIncremented-(e.upVoted?2:1)}function p(e){return e.reduce(((e,t)=>{const n=t.answers||[];return(0,r.default)({},e,p(n),{[t.key]:(0,r.default)({},t,{answers:n.map((e=>e.key)),replies:[]})})}),{})}function u(e,t,n,o,a,i,l){const{tabs:c}=e,d=(0,r.default)({},e.posts,p(t)),u=t.map((e=>e.key));return(0,r.default)({},e,{fetchingPosts:!1,posts:d,acceptedClarificationPosts:null!=l?l:[],hasUnansweredHelpRequests:(f=d,"projecthelp"===n?t.some((e=>("projecthelp"===e.type||"PROJECT_HELP_QUESTION"===e.feedbackType)&&(0,s.isPostUnanswered)(e.key,f))):e.hasUnansweredHelpRequests),tabs:(0,r.default)({},c,{[n]:{postKeys:u,cursor:i,isComplete:o,totalCount:a}})});var f}const f=(e,t,n)=>{const o=t.posts[e],a=[e];if(a.push.apply(a,(o.answers||[]).concat(o.replies||[])),o.answers)for(const e of o.answers){const n=t.posts[e];n&&a.push.apply(a,n.replies)}const s=(0,r.default)({},t);for(const e of a)s.posts[e]&&(s.posts[e]=(0,r.default)({},s.posts[e],{isLocked:n}));return s}},y6Wz:function(e,t,n){"use strict";var o=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.DiscussionPost=void 0;var r=o(n("pVnL")),a=ne(n("q1tI")),s=ne(n("i8i4")),i=n("/MKj"),l=n("mR6N"),c=o(n("eIwi")),d=n("Pk2J"),p=n("JimW"),u=n("vwLt"),f=n("Vxy9"),g=o(n("wa3X")),m=o(n("Pwnf")),y=o(n("yts4")),h=o(n("gE8/")),w=n("Uafs"),b=n("g8Be"),E=ne(n("8jAt")),P=n("z8VS"),v=o(n("SGU3")),k=o(n("qRmI")),C=o(n("fjY8")),S=o(n("mt3D")),T=o(n("HbaH")),A=o(n("iRWY")),x=o(n("KPIR")),O=o(n("RTsg")),I=o(n("XM9p")),M=o(n("hWmx")),K=o(n("XKyD")),R=n("AE4M"),F=o(n("mXPZ")),L=n("Y8R6"),D=n("Tipd"),_=o(n("RNNr")),j=o(n("gzgZ")),V=n("SjSX"),N=o(n("cfQQ")),q=o(n("4Du/")),B=o(n("M+bw")),W=o(n("wF1t")),U=n("i4Cj"),H=o(n("uEGL")),$=ne(n("TqM9")),Q=o(n("qRKg")),z=o(n("wINb")),Y=o(n("DHUe")),G=ne(n("5elA")),J=o(n("3qJ5")),X=o(n("j9RJ")),Z=n("DDFQ"),ee=o(n("duQp"));function te(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(te=function(e){return e?n:t})(e)}function ne(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=te(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o}const{compactStyles:oe}=$,re={downvoteSelected:{small:"M8.868 14.48l6.277-10.984A1 1 0 0 0 14.277 2H1.723a1 1 0 0 0-.868 1.496l6.277 10.985a1 1 0 0 0 1.736 0z"},downvote:{small:"M8 11.969L12.554 4H3.446L8 11.969zm.868 2.512a1 1 0 0 1-1.736 0L.855 3.496A1 1 0 0 1 1.723 2h12.554a1 1 0 0 1 .868 1.496L8.868 14.481z"},flagSelected:{small:"M4 11.775V15a1 1 0 0 1-2 0V2.66a1 1 0 0 1 .435-.826c1.04-.712 2.274-.968 3.701-.768 2.448.342 2.734 2.094 4.728 2.342 1.11.138 2.256-.05 3.436-.566a.5.5 0 0 1 .7.458v9.182a.5.5 0 0 1-.18.385c-1.097.914-2.416 1.275-3.956 1.083-2.439-.303-2.744-2.065-4.728-2.342A5.104 5.104 0 0 0 4 11.775z"},flag:{small:"M4 11.775V15a1 1 0 0 1-2 0V2.66a1 1 0 0 1 .435-.826c1.04-.712 2.274-.968 3.701-.768 2.448.342 2.734 2.094 4.728 2.342 1.11.138 2.256-.05 3.436-.566a.5.5 0 0 1 .7.458v9.182a.5.5 0 0 1-.18.385c-1.097.914-2.416 1.275-3.956 1.083-2.439-.303-2.744-2.065-4.728-2.342A5.104 5.104 0 0 0 4 11.775zm6.617-6.382c-1.2-.15-1.981-.57-2.99-1.39l-.279-.228c-.596-.484-.907-.647-1.489-.729-.735-.103-1.34-.035-1.859.195v6.474c.807-.169 1.614-.2 2.413-.088 1.185.166 1.945.585 2.957 1.41l.239.195c.618.503.92.661 1.501.733.743.093 1.354.002 1.89-.274V5.323a7.902 7.902 0 0 1-2.383.07z"},upvoteSelected:{small:"M8.868 2.52l6.277 10.984A1 1 0 0 1 14.277 15H1.723a1 1 0 0 1-.868-1.496L7.132 2.519a1 1 0 0 1 1.736 0z"},upvote:{small:"M3.446 13h9.108L8 5.031 3.446 13zM8.868 2.52l6.277 10.984A1 1 0 0 1 14.277 15H1.723a1 1 0 0 1-.868-1.496L7.132 2.519a1 1 0 0 1 1.736 0z"}},ae=({label:e,onClick:t})=>a.createElement(g.default,{kind:"tertiary",size:"small",style:{marginRight:12},onClick:t},e);class se extends a.Component{static getRepliesExpandedFromProps(e){const{post:t,qaExpandKey:n,newPostKey:o}=e,{replyCount:r}=t;return(0,R.shouldAutoExpandReplies)(t,n)&&null!=r&&r>0&&!o}constructor(e){super(e),this.nodes={},this.srOnlyFlagModal=a.createElement(p.View,{style:Q.default.srOnly}," ",U.postStrings.flagAriaLabel),this.srOnlyToolOpensModal=a.createElement(p.View,{style:Q.default.srOnly}," ",U.postStrings.toolOpensModal),this.getRepliesContainerId=()=>`${this.props.post.key}-replies-container`,this.setModalVisibility=e=>t=>{this.setState((n=>({isModalOpen:(0,r.default)({},n.isModalOpen,{[t]:e})})))},this.openModal=this.setModalVisibility(!0),this.closeModal=this.setModalVisibility(!1),this.redirectToSignup=()=>{const{pathname:e,search:t,hash:n}=this.props.location,o=e+t+n;(0,L.redirect)((0,D.getLoginURL)(o))},this.maybeAutoFocusPost=e=>{if(!this.postElement||!this.postElement.focus)return;const{post:t,qaExpandKey:n,newPostKey:o,resetExpandKey:r,resetNewPostKeyInfo:a}=this.props;return o&&o===t.key?(this.postElement.focus(),void a()):n&&t.expandKey===n?(this.postElement.focus(),void r()):void(!this.postElement||e&&e.autoFocusPostOnMount||!this.props.autoFocusPostOnMount||this.postElement.focus())},this.handleUpvote=()=>{if(!F.default.isLoggedIn)return void this.redirectToSignup();const{post:e,gqlClient:t,onUpvotePost:n}=this.props,{key:o,sumVotesIncremented:r,upVoted:a,downVoted:s}=e;if(n({key:o,upVoted:!!a},t),a){const t=r-1;this.setState({ariaVoteMessage:U.postStrings.ariaAbstained(e,t)})}else{const t=r+(s?2:1);this.setState({ariaVoteMessage:U.postStrings.ariaUpvoted(e,t)})}},this.handleDownvote=()=>{if(!F.default.isLoggedIn)return void this.redirectToSignup();const{post:e,gqlClient:t,onDownvotePost:n}=this.props,{key:o,sumVotesIncremented:r,downVoted:a,upVoted:s}=e;if(n({key:o,downVoted:!!a},t),a){const t=r+1;this.setState({ariaVoteMessage:U.postStrings.ariaAbstained(e,t)})}else{const t=r-(s?2:1);this.setState({ariaVoteMessage:U.postStrings.ariaDownvoted(e,t)})}},this.handleChangeToQuestion=()=>{const{onChangeType:e,moderatorMode:t,post:n,gqlClient:o}=this.props;e(n,"question",o),this.handleSelectionChange(!1),this.setState({skipped:t})},this.handleChangeToTipsAndThanks=()=>{const{onChangeType:e,moderatorMode:t,post:n,gqlClient:o}=this.props;e(n,"comment",o),this.handleSelectionChange(!1),this.setState({skipped:t})},this.handleChangeToMistakes=()=>{const{onChangeType:e,moderatorMode:t,post:n,gqlClient:o}=this.props;e(n,"clarification",o),this.handleSelectionChange(!1),this.setState({skipped:t})},this.handleClearAllFlags=()=>{const{moderatorMode:e,onClearFlags:t,post:n,gqlClient:o}=this.props;t(n,o),e&&(this.handleSelectionChange(!1),this.setState({skipped:!0}))},this.handleUndelete=()=>{const{onUndeletePost:e,post:t,gqlClient:n}=this.props;e(t,n),this.setState({ariaPostStatusChangedMessage:U.postStrings.ariaUndeleted})},this.handleDelete=()=>{const{moderatorMode:e,onDeletePost:t,post:n,gqlClient:o}=this.props;t(n,o),this.handleSelectionChange(!1),this.setState({ariaPostStatusChangedMessage:U.postStrings.ariaDeleted,skipped:e})},this.handleLockThread=()=>{const{onLockThread:e,post:t,gqlClient:n}=this.props;e(t,n)},this.handleUnlockThread=()=>{const{onUnlockThread:e,post:t,gqlClient:n}=this.props;e(t,n)},this.handlePinThread=()=>{const{onPinThread:e,post:t,gqlClient:n}=this.props;e(t,n)},this.handleUnpinThread=()=>{const{onUnpinThread:e,post:t,gqlClient:n}=this.props;e(t,n)},this.handleHideProgramEverywhere=()=>{const{moderatorMode:e,onHideProgramEverywhere:t,post:n,gqlClient:o}=this.props,{programID:r,deleted:a}=n;if(!r)return;t(r,!a,o),e&&this.setState({skipped:!0})},this.handleHideProgramFromHotlist=()=>{const{onHideProgramFromHotlist:e,post:t,gqlClient:n}=this.props,{key:o,programID:r,hideFromHotlist:a}=t;if(!r)return;e(o,r,!a,n)},this.handleSkip=()=>{const{onSkipPosts:e,post:t}=this.props;this.handleSelectionChange(!1),e([t.key]),this.setState({skipped:!0})},this.handleClickComment=()=>{const{post:e,onShowReplies:t,gqlClient:n}=this.props,{replyCount:o}=e,r=!o||0===o;this.state.repliesExpanded||t(this.props.post.key,n,{noneToLoad:r}),!F.default.isLoggedIn&&r?this.redirectToSignup():this.setState({repliesExpanded:!this.state.repliesExpanded})},this.handleReplyInputToggle=()=>{const{displayInputPostKey:e,post:t}=this.props;this.props.onToggleReplyInput(t.key),e===t.key&&this.setState({formattingOptionsExpanded:!1})},this.showFlagButton=e=>{const{post:t,profileLoading:n}=this.props,o=(0,R.getPostTypeAllowingProgram)(t);return!("projecteval"===o)&&((!this.isCompactView()||"reply"===o)&&(!n&&(!e||e&&!e.get("isChildAccount"))))},this.renderPostHeader=()=>{var e,t;const{post:n,showPostedIn:o,showParentQuestion:r,moderatorMode:s,profile:i}=this.props,{expandKey:l,author:d,feedbackType:u,authorNickname:g,authorKaid:m,date:y,badges:h,permalink:w,focus:b,updated:P,isLocked:k,isPinned:C}=n,S=[$.datetime,!this.shouldShowAuthor()&&oe.datetime],T="reply"===(0,R.getPostTypeAllowingProgram)(n),A="scratchpad"===(0,R.getPostTypeAllowingProgram)(n),x=s?(0,c.default)(y).toString():(0,c.default)(y).fromNow(),O=(0,R.getDirectLinkSrString)(x,n),I=a.createElement(f.LabelMedium,{style:S},a.createElement(p.View,{"aria-hidden":"true"},x),a.createElement(p.View,{style:Q.default.srOnly},O));let M=null;A&&P&&(M=a.createElement(f.LabelMedium,{style:S},E._("Last updated")," ",(0,c.default)(P).format("MMM DD YYYY, h:mma")));const K=w&&l&&u?`${w}?qa_expand_key=${l}&qa_expand_type=${u.toLowerCase()}`:"";let F=null;n.deleted?F=a.createElement(f.HeadingXSmall,{style:ce.deletedPostLabel},U.miscStrings.deleted):n.appearsAsDeleted&&(F=a.createElement(f.HeadingXSmall,{style:ce.hiddenPostLabel},U.miscStrings.automaticallyHidden));const L=[$.nameAndDatetime,this.isCompactView()&&le.nameAndDatetime];return a.createElement(p.View,{style:[ce.postHeader,T&&ce.replyHeader]},a.createElement(p.View,null,a.createElement(p.View,{style:L},this.shouldShowAuthor()&&a.createElement(R.PostAuthorName,{name:null!=(e=null==d?void 0:d.nickname)?e:g,kaid:null!=(t=null==d?void 0:d.kaid)?t:m}),a.createElement(v.default,{href:K,rel:"nofollow"},I),M,F,a.createElement(p.View,{style:Q.default.srOnly,role:"status","aria-live":"polite"},this.state.ariaPostStatusChangedMessage)),o&&!!b&&a.createElement(p.View,{style:ce.postedInContainer},a.createElement(f.LabelMedium,{style:ce.postedInLabel},U.miscStrings.postedIn),a.createElement(f.LabelMedium,null,a.createElement(v.default,{href:K,kind:"primary",rel:"nofollow"},b.translatedTitle||U.miscStrings.untitled))),r&&n.question&&a.createElement(p.View,{style:ce.postedInContainer},a.createElement(f.LabelMedium,{style:ce.postedInLabel},U.postStrings.answerQuestion,":"),a.createElement(f.Caption,null,n.question&&n.question.content))),a.createElement(X.default,{badges:h,isLocked:k,isPinned:C}),this.renderModeratorOrOwnerActionsAsDropdown(i,$.actionPickerMobile))},this.renderAnswerButton=()=>{const{displayInputPostKey:e,post:t}=this.props,n=(0,R.getRespondButtonSrString)(t,"answer"),o=`${t.key}-answer-button`;return F.default.isLoggedIn?a.createElement(a.Fragment,null,a.createElement(g.default,{id:o,kind:"tertiary",onClick:this.handleReplyInputToggle,"aria-expanded":e===t.key?"true":"false","aria-controls":(0,R.getAnswerInputId)(t.key)},U.postStrings.answer),a.createElement("label",{className:(0,l.css)(Q.default.srOnly),htmlFor:o},n)):a.createElement(a.Fragment,null,a.createElement(g.default,{id:o,kind:"tertiary",onClick:this.redirectToSignup},U.postStrings.answer),a.createElement("label",{className:(0,l.css)(Q.default.srOnly),htmlFor:o},U.strings.toolNavigateSignUp))},this.renderPostFooter=()=>{const{post:e,restrictPosting:t,isMaximized:n,profile:o}=this.props,{repliesExpanded:r}=this.state,s=(0,R.getPostTypeAllowingProgram)(e),i="reply"===s,l="question"===s,c="projecthelp"===s,d="projecteval"===s,u="projectevalanswer"===s,g="scratchpad"===s,m=t||this.isCompactView()||e.isLocked,y=a.createElement(p.View,{style:ce.postFooterPrimary},(l||c)&&!m&&a.createElement(a.Fragment,null,this.renderAnswerButton(),a.createElement(f.LabelMedium,{style:ce.separator,"aria-hidden":"true"},"•")),!t&&!i&&!d&&!u&&!this.isCompactView()&&a.createElement(G.CommentButton,{post:e,isExpanded:r,onClick:this.handleClickComment,containerId:this.getRepliesContainerId(),hideContributionButtons:!!m}),a.createElement(_.default,null),a.createElement(p.View,{style:$.tools},!i&&!d&&!u&&a.createElement(f.LabelXSmall,{style:ce.votesSum},"(",U.postStrings.getVotes(e.sumVotesIncremented),")"),this.renderTools(o)),!n&&this.renderModeratorOrOwnerActions(o,$.actionPickerDesktop)),h=a.createElement(p.View,null,n&&this.renderModeratorOrOwnerActions(o,ce.maximizedDesktop));return a.createElement(p.View,{style:ce.postFooter},!g&&y,h)},this.expandAnswers=e=>{this.setState({expandedKeys:[].concat(this.state.expandedKeys,[e])})},this.collapseAnswers=e=>{var t;this.setState({expandedKeys:this.state.expandedKeys.filter((t=>t!==e))}),null==(t=this.postElement)||t.scrollIntoView({behavior:this.props.prefersReducedMotion?"auto":"smooth"})},this.handleToggleFormattingOptionsExpanded=e=>this.setState({formattingOptionsExpanded:e}),this.handleTogglePreviewExpanded=e=>this.setState({previewExpanded:e}),this.handleAnswerPostSuccess=(e,t)=>{this.props.onPostSuccess(e,t),this.hideReplyInputField()},this.handleEditingPost=e=>{this.setState({editing:!1})},this.hideReplyInputField=()=>{this.props.onToggleReplyInput(this.props.post.key),this.setState({formattingOptionsExpanded:!1})},this.handleSelectionChange=e=>{const{onSelectPosts:t,onDeselectPost:n,post:o}=this.props;e?t([o.key]):n(o.key)},this.state={ariaVoteMessage:"",ariaFlagMessage:"",ariaPostStatusChangedMessage:"",repliesExpanded:se.getRepliesExpandedFromProps(e),editing:!1,formattingOptionsExpanded:!1,previewExpanded:!1,expandedKeys:[],skipped:!1,isModalOpen:{clearFlags:!1,confirmDeletion:!1},fetchingAnswersStatus:{}}}componentDidMount(){const{qaExpandKey:e,onShowReplies:t,onShowAnswers:n,post:o,gqlClient:r}=this.props,{replyCount:a,replies:s,key:i,answerCount:l}=o,{repliesExpanded:c}=this.state;(0,R.shouldAutoExpandAnswers)(o,e)&&this.state.expandedKeys.length!==l&&(n(i,r),this.expandAnswers(i)),(c||(0,R.shouldAutoExpandReplies)(o,e))&&a&&s.length!==a&&t(i,r),this.maybeAutoFocusPost()}componentDidUpdate(e){const t=se.getRepliesExpandedFromProps(e),n=se.getRepliesExpandedFromProps(this.props);!t&&n&&this.setState({repliesExpanded:!0}),this.maybeAutoFocusPost(e)}renderFlagsTooltipContent(){const{post:e}=this.props,{flaggedBy:t,flags:n}=e,o=(t||[]).map(((e,t)=>({kaid:e,flag:n&&n[t]})));return a.createElement(p.View,null,a.createElement("ul",null,o.map(((e,t)=>a.createElement("li",{key:t},a.createElement(p.View,{style:ce.flagsTooltipRow},a.createElement(f.LabelSmall,{style:ce.flagsTooltipKaid},e.kaid,":"),a.createElement(f.LabelSmall,{style:ce.flagsTooltipText},e.flag||U.miscStrings.unknown)))))))}renderMinimalFlags(e,t,n){return a.createElement(p.UniqueIDProvider,{mockOnFirstRender:!0,scope:"discussion-list"},(o=>a.createElement(M.default,{content:this.renderFlagsTooltipContent(),toggleOnHover:e.length>0,offset:12,a11y:{title:{id:o.get("flag-tt")}}},a.createElement(f.LabelXSmall,{style:[n,ce.moderatorFlagged],"aria-labelledby":o.get("flag-tt")},U.postStrings.flagged,t))))}renderFlagButton(e){const{onFlagPost:t,post:n,tab:o,gqlClient:r}=this.props,s=[ce.flagText,this.isCompactView()&&le.flagText],i=n.flags||[],l=` (${i.length})`;if((0,R.isModeratorProfile)(e))return this.renderMinimalFlags(i,l,s);const c=e&&!e.get("isPhantom")&&!(0,R.userMeetsCommunityRequirements)(e),d=n.flaggedByUser?m.default.blue:c?m.default.offBlack32:m.default.offBlack64;return a.createElement(p.UniqueIDProvider,{mockOnFirstRender:!0,scope:"discussion-list"},(i=>a.createElement(I.default,{modal:({closeModal:e})=>a.createElement(A.default,{post:n,tab:o,onClose:o=>{o&&(t(n,o,r),this.setState({ariaFlagMessage:U.postStrings.ariaFlagged})),e()}}),ariaLabel:U.postStrings.flagModal,focusId:i.get("flag")},(t=>a.createElement(M.default,{content:c&&U.upsellStrings.notEnoughPointsUnverifiedEmailAccountAgeFlag,toggleOnHover:!!c,offset:12,a11y:{title:{id:"flag"}}},a.createElement(j.default,{id:i.get("flag"),icon:a.createElement(y.default,{size:"small",icon:n.flaggedByUser?re.flagSelected:re.flag,color:d}),style:[ce.toolButton,ce.flagTool],disabled:n.flaggedByUser||!!c,onClick:()=>{F.default.isLoggedIn?t():this.redirectToSignup()}},a.createElement(p.View,{style:s},n.flaggedByUser?U.postStrings.flagged:U.postStrings.flag,(0,R.isModeratorProfile)(e)&&l,F.default.isLoggedIn?this.srOnlyFlagModal:this.srOnlyToolOpensModal)))))))}isCompactView(){const{viewMode:e}=this.props;return"compact"===e}shouldShowAuthor(){const{post:e,moderatorMode:t}=this.props,n="projectevalanswer"===(0,R.getPostTypeAllowingProgram)(e);return!!t||!this.isCompactView()&&!n}renderOpenModals(){const{post:e,schedule:t}=this.props,{isModalOpen:n}=this.state;return a.createElement(a.Fragment,null,a.createElement(w.ModalLauncher,{key:"deletePost",onClose:()=>{this.closeModal("confirmDeletion"),t.animationFrame((()=>{this.actionMenu&&this.actionMenu.focus()}))},opened:n.confirmDeletion,modal:({closeModal:e})=>a.createElement(K.default,{handleClose:e,handleSubmit:()=>{this.handleDelete(),e()}})}),a.createElement(w.ModalLauncher,{key:"clearFlags",onClose:()=>this.closeModal("clearFlags"),opened:n.clearFlags,modal:({closeModal:t})=>a.createElement(C.default,{flaggedBy:e.flaggedBy||e.flaggedByKaid||[],flags:e.flags||[],postKey:e.key,onCancel:t,onClearAllFlags:this.handleClearAllFlags})}))}renderDeleteAction(e,t){const n=(0,R.isModeratorProfile)(e)?this.handleDelete:()=>this.openModal("confirmDeletion");return a.createElement(t,{key:"delete",label:U.postStrings.delete,onClick:n})}renderHideProgramActions(e,t){const n=e.deleted?U.postStrings.undoHideEverywhere:U.postStrings.hideEverywhere,o=e.hideFromHotlist?U.postStrings.undoHideFromHotlist:U.postStrings.hideFromHotlist;return[a.createElement(t,{key:"hideEverywhere",label:n,onClick:this.handleHideProgramEverywhere}),a.createElement(t,{key:"hideHotlist",label:o,onClick:this.handleHideProgramFromHotlist})]}getModeratorOrOwnerActions(e,t){var n,o;const{moderatorMode:r,isProjectFeedback:s}=this.props;if(!e)return[];const{post:i,tab:l,onModifyNotifications:c,contentKind:d,onStartAcceptingClarification:p,gqlClient:u,flag:f,flagLoading:g}=this.props,m=!g&&f,y=null!=(n=null==(o=i.author)?void 0:o.kaid)?n:i.authorKaid,h=(0,R.getPostTypeAllowingProgram)(i),w=(0,V.getKaid)(e)===y,b="reply"===h,E="scratchpad"===h,P="projecteval"===h,v="projectevalanswer"===h,k="question"===h,C="comment"===h,S=k||C,T=k||C||"answer"===h;if(!(0,R.isModeratorProfile)(e)&&!w)return[];const A=[],x=(0,R.getPostContext)({profile:e,post:i,moderatorMode:!!r});!(0,R.isModeratorProfile)(e)||b||E||v||P||("comments"!==l&&"clarifications"!==l||A.push(a.createElement(t,{key:"changeToQuestion",onClick:this.handleChangeToQuestion,label:U.postStrings.changeToQuestion})),"questions"!==l&&"clarifications"!==l||A.push(a.createElement(t,{key:"changeToTipsAndThanks",onClick:this.handleChangeToTipsAndThanks,label:U.postStrings.changeToTipsAndThanks})),s||"questions"!==l&&"comments"!==l||A.push(a.createElement(t,{key:"changeToMistakes",onClick:this.handleChangeToMistakes,label:U.postStrings.changeToMistakes}))),m&&((0,R.isModeratorProfile)(e)&&S&&!i.deleted&&!i.isLocked&&A.push(a.createElement(t,{key:"lock",label:U.postStrings.lock,onClick:this.handleLockThread})),(0,R.isModeratorProfile)(e)&&S&&!i.deleted&&i.isLocked&&A.push(a.createElement(t,{key:"unlock",label:U.postStrings.unlock,onClick:this.handleUnlockThread})),(0,R.isModeratorProfile)(e)&&T&&!i.deleted&&!i.isPinned&&A.push(a.createElement(t,{key:"pin",label:U.postStrings.pin,onClick:this.handlePinThread})),(0,R.isModeratorProfile)(e)&&T&&!i.deleted&&i.isPinned&&A.push(a.createElement(t,{key:"unpin",label:U.postStrings.unpin,onClick:this.handleUnpinThread})));const O=i.notifyOnAnswer?U.postStrings.turnNotificationsOff:U.postStrings.turnNotificationsOn;return k&&w&&!i.isOld&&A.push(a.createElement(t,{key:"notification",label:O,onClick:()=>{c(i.key,!i.notifyOnAnswer,u)}})),E||P||v||i.isLocked&&!(0,R.isModeratorProfile)(e)||A.push(a.createElement(t,{key:"edit",label:U.postStrings.edit,onClick:()=>this.setState({editing:!0})})),i.deleted||E||A.push(this.renderDeleteAction(e,t)),E&&A.push.apply(A,this.renderHideProgramActions(i,t)),(0,R.isModeratorProfile)(e)&&i.deleted&&!E&&A.push(a.createElement(t,{key:"undelete",label:U.postStrings.undelete,onClick:this.handleUndelete})),R.capabilities.clearFlags(x)&&A.push(a.createElement(t,{key:"clearFlags2",label:U.postStrings.clearFlags,onClick:()=>this.openModal("clearFlags")})),R.capabilities.approve(x)&&A.push(a.createElement(t,{key:"approve",label:U.postStrings.approve,onClick:this.handleClearAllFlags})),r&&(0,R.isModeratorProfile)(e)&&A.push(a.createElement(t,{key:"skip",label:U.postStrings.skip,onClick:this.handleSkip})),!(0,R.isModeratorProfile)(e)||"clarifications"!==l||"Video"!==d&&"video"!==d&&"YouTubeVideo"!==d||A.push(a.createElement(t,{key:"accept_clarification",label:U.postStrings.acceptClarification,onClick:()=>p(i.key)})),A}renderModeratorOrOwnerActionsAsDropdown(e,t){const n=this.getModeratorOrOwnerActions(e,u.ActionItem);return a.createElement(u.ActionMenu,{ref:e=>{const t=s.findDOMNode(e);this.props.getRef&&this.props.getRef(t);const n=t&&t.querySelector("button");n instanceof HTMLButtonElement&&(this.actionMenu=n)},menuText:E._("more"),alignment:"right",style:t},n)}renderModeratorOrOwnerActionsAsFlat(e,t){const n=this.getModeratorOrOwnerActions(e,ae);return a.createElement(p.View,{style:[t,ce.expandedActionList]},n.map(((e,t)=>a.createElement(p.View,{key:t},e))))}renderModeratorOrOwnerActions(e,t){const{isMaximized:n}=this.props;return n?this.renderModeratorOrOwnerActionsAsFlat(e,t):this.renderModeratorOrOwnerActionsAsDropdown(e,t)}renderTools(e){const{post:t,restrictPosting:n}=this.props,o=(0,R.getPostTypeAllowingProgram)(t),r="projecteval"===o,s="projectevalanswer"===o,i="reply"===(0,R.getPostTypeAllowingProgram)(t),c=!(this.isCompactView()||r||s||i||n),d=a.createElement("li",null,this.renderFlagButton(e));return(c||this.showFlagButton(e))&&a.createElement(a.Fragment,null,a.createElement("ul",{className:(0,l.css)(ce.voteFlagList)},c&&this.renderVoteTools(e),this.showFlagButton(e)&&d),a.createElement(p.View,{style:Q.default.srOnly,role:"status","aria-live":"polite"},c&&a.createElement(p.View,null,this.state.ariaVoteMessage),this.showFlagButton(e)&&a.createElement(p.View,null,this.state.ariaFlagMessage)))}renderVoteTools(e){const{post:t}=this.props;let n=null;var o,r;e&&!e.get("isPhantom")&&(e.get("kaid")===(null!=(o=null==(r=t.author)?void 0:r.kaid)?o:t.authorKaid)?n="noSelfVoting":e.get("points")<5e3&&!(0,R.isModeratorProfile)(e)&&(n="atLeast5000"));const s=!!n,i=s?m.default.offBlack32:t.upVoted?m.default.green:m.default.offBlack64,c=s?m.default.offBlack32:t.downVoted?m.default.red:m.default.offBlack64,d=t.upVoted?U.postStrings.alreadyUpVoted:void 0,u=t.downVoted?U.postStrings.alreadyDownVoted:void 0;return a.createElement(a.Fragment,null,a.createElement("li",null,a.createElement(M.default,{content:n&&U.postStrings[n],toggleOnHover:s,offset:12,a11y:{title:{id:"upvote"}}},a.createElement(j.default,{icon:a.createElement(y.default,{"aria-label":d,size:"small",icon:t.upVoted?re.upvoteSelected:re.upvote,color:i}),style:ce.toolButton,onClick:()=>this.handleUpvote(),disabled:s,"aria-labelledby":"upvote"},a.createElement(p.View,{style:ce.voteText},U.postStrings.upvote,!F.default.isLoggedIn&&this.srOnlyToolOpensModal,F.default.isLoggedIn&&n&&a.createElement("span",{className:(0,l.css)(Q.default.srOnly)},U.postStrings[n]))))),a.createElement("li",null,a.createElement(M.default,{content:n&&U.postStrings[n],toggleOnHover:s,offset:12,a11y:{title:{id:"downvote"}}},a.createElement(j.default,{icon:a.createElement(y.default,{"aria-label":u,size:"small",icon:t.downVoted?re.downvoteSelected:re.downvote,color:c}),style:ce.toolButton,onClick:()=>this.handleDownvote(),disabled:s,"aria-labelledby":"downvote"},a.createElement(p.View,{style:ce.voteText},U.postStrings.downvote,!F.default.isLoggedIn&&this.srOnlyToolOpensModal,F.default.isLoggedIn&&n&&a.createElement("span",{className:(0,l.css)(Q.default.srOnly)},U.postStrings[n]))))))}renderDefaultContent(){var e;const{post:t}=this.props,n="reply"===(null==(e=(0,R.getPostTypeAllowingProgram)(t))?void 0:e.toLowerCase());return a.createElement(f.Body,{style:[$.content,n&&ce.replyContent]},a.createElement(O.default,{string:t.content}))}renderProjectEval(){const{post:e}=this.props;return a.createElement(x.default,{post:e})}renderProgramContent(){const{post:e,onSelectProgramPost:t,selectedProgramKey:n}=this.props,{relativeUrl:o="",title:r="",flags:s,content:i,thumbnail:l,key:c}=e;return a.createElement(p.View,{onClick:()=>t(c),style:c!==n&&ce.programHover},a.createElement("h2",null,a.createElement("a",{href:o,target:"_blank"},r)),a.createElement(p.View,null,a.createElement(p.View,{style:ce.programViewInfo},a.createElement("img",{src:(0,z.default)(l),alt:r,width:"200",height:"200"}),a.createElement(p.View,{style:ce.programCode},a.createElement("pre",null,a.createElement(f.BodyMonospace,null,i)))),a.createElement("ul",null,s&&s.map(((e,t)=>{const[n,...o]=e.split(": "),r=o.join(": ");return a.createElement("li",{key:t},a.createElement(J.default,{flagType:n,message:r}))})))))}renderProjectPreview(){const{post:e}=this.props,{focus:t}=e;return t&&t.relativeUrl?a.createElement("img",{className:(0,l.css)(ce.projectPreview),src:(0,z.default)(`${t.relativeUrl}/latest.png`),alt:t.translatedTitle}):null}renderContent(){const{post:e}=this.props;switch((0,R.getPostTypeAllowingProgram)(e)){case"scratchpad":return this.renderProgramContent();case"projectevalanswer":return this.renderProjectEval();case"projecteval":case"projecthelp":return a.createElement(p.View,null,this.renderDefaultContent(),this.renderProjectPreview());default:return this.renderDefaultContent()}}render(){var e,t,n,o,r,i,l,c;const{clarificationBeingAcceptedId:d,clarificationsEnabled:u,contentId:g,contentKind:m,displayInputPostKey:y,gqlClient:h,includeCheckbox:w,isAnswer:b,isMaximized:E,moderatorMode:v,newPostKey:C,onShowAnswers:A,onStopAcceptingClarification:x,post:O,profile:I,resetNewPostKeyInfo:M,restrictPosting:K,selected:F,tab:L,topicSlug:D,viewMode:_}=this.props,{answerCount:j,answers:V,author:N,authorAvatarName:q,authorAvatarSrc:B,authorKaid:W,authorNickname:H,content:Q,fromVideoAuthor:z}=O,{editing:J,skipped:X,expandedKeys:Z,repliesExpanded:ee}=this.state,te=O.key===d,ne="reply"===(0,R.getPostTypeAllowingProgram)(O);if(X)return null;const oe=w;return a.createElement(p.View,{testId:"discussion-post"},this.renderOpenModals(),!J&&!te&&a.createElement(p.View,{style:[$.post,ne&&!oe&&ce.horizontalSeparator],tabIndex:-1,ref:e=>{const t=s.findDOMNode(e);this.props.getRef&&this.props.getRef(t),this.postElement=t}},this.shouldShowAuthor()&&a.createElement(p.View,{style:ce.avatar},a.createElement(S.default,{username:null!=(e=null==N?void 0:N.nickname)?e:H,avatarName:null!=(t=null==N||null==(n=N.avatar)?void 0:n.name)?t:q,avatarSrc:null!=(o=null==N||null==(r=N.avatar)?void 0:r.imageSrc)?o:B,kaid:null!=(i=null==N?void 0:N.kaid)?i:W,enableProfilePreviewTooltip:!0})),a.createElement(p.View,{style:$.everythingButTheAvatar},this.renderPostHeader(),a.createElement(p.View,{style:ce.contentContainer},z&&a.createElement(f.LabelSmall,{style:ce.fromTheAuthor},U.postStrings.fromTheAuthor),this.renderContent(),(O.appearsAsDeleted||O.deleted)&&a.createElement(p.View,{style:[ce.contentBackdrop,O.deleted&&ce.deletedPost,O.appearsAsDeleted&&!O.deleted&&ce.hiddenPost]})),this.renderPostFooter(),!ne&&a.createElement(G.default,{isExpanded:ee,containerId:this.getRepliesContainerId(),postKey:O.key,replies:O.replies,tab:L,topicSlug:D,newPostKey:C,resetNewPostKeyInfo:M,contentKind:m,contentId:g,gqlClient:h,viewMode:_,isMaximized:this.props.isMaximized,moderatorMode:this.props.moderatorMode,restrictPosting:K,isLocked:!!O.isLocked}))),J&&a.createElement(p.View,{style:ce.replyInputContainer},a.createElement(T.default,{editing:J,postKey:O.key,isReply:ne,isAnswer:b,tab:L,contentKind:m,contentId:g,topicSlug:D,feedbackKey:O.key,resetNewPostKeyInfo:M,initialPostContent:Q,onPostSuccess:(e,t)=>this.handleEditingPost(e),onCancel:()=>this.setState({editing:!1}),showAvatar:!this.isCompactView()}),!ne&&a.createElement(p.View,{style:{marginLeft:48}},a.createElement(G.default,{isExpanded:ee,containerId:this.getRepliesContainerId(),postKey:O.key,replies:O.replies,tab:L,topicSlug:D,newPostKey:C,resetNewPostKeyInfo:M,contentKind:m,contentId:g,gqlClient:h,viewMode:_,isMaximized:this.props.isMaximized,moderatorMode:this.props.moderatorMode,restrictPosting:K,isLocked:!!O.isLocked}))),te&&a.createElement(k.default,{post:O,editingOrAccepting:"accepting",onCancel:x}),!b&&!ne&&a.createElement(Y.default,{answers:V,answerCount:j||0,topLevelPostKey:O.key,topicSlug:D,newPostKey:C,resetNewPostKeyInfo:M,tab:L,displayInputPostKey:y,restrictPosting:K,isLocked:!!O.isLocked,clarificationsEnabled:u,viewMode:_,authorKaid:null!=(l=null==(c=O.author)?void 0:c.kaid)?l:O.authorKaid,moderatorMode:v,isMaximized:E,onShowAnswers:()=>A(O.key,h),profile:I,handleAnswerPostSuccess:this.handleAnswerPostSuccess,handleToggleFormattingOptionsExpanded:this.handleToggleFormattingOptionsExpanded,handleTogglePreviewExpanded:this.handleTogglePreviewExpanded,isCompactView:this.isCompactView(),nodes:this.nodes,expandAnswers:this.expandAnswers,collapseAnswers:this.collapseAnswers,isExpanded:Z.includes(O.key),displayReplyInput:y===O.key}),w&&a.createElement(P.Checkbox,{style:ce.checkbox,checked:F,onChange:this.handleSelectionChange,"aria-label":"Post selection"}))}}t.DiscussionPost=se;const ie=m.default.offBlack64,le=l.StyleSheet.create(oe),ce=l.StyleSheet.create({postHeader:{flexDirection:"row",justifyContent:"space-between",marginBottom:8},outerRepliesContainerWithAvatar:{[H.default.xsOrSmaller]:{marginLeft:-64}},replyHeader:{marginBottom:0},replyContent:{paddingTop:h.default.xxxSmall_4},replyInputContainer:{paddingBottom:h.default.large_24},postedInContainer:{marginTop:h.default.xxxSmall_4,flexDirection:"row",alignItems:"baseline"},postedInLabel:{color:m.default.offBlack64,marginRight:h.default.xxSmall_6},hiddenPostLabel:{color:m.default.gold,marginLeft:8,alignSelf:"center"},deletedPostLabel:{color:m.default.red,marginLeft:8,alignSelf:"center"},contentContainer:{position:"relative"},contentBackdrop:{width:"100%",height:"100%",borderRadius:4,opacity:.1,position:"absolute",zIndex:-1},hiddenPost:{backgroundColor:m.default.gold},deletedPost:{backgroundColor:m.default.red},postFooter:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",height:40},postFooterPrimary:{flexDirection:"row",alignItems:"center",width:"100%"},votesSum:{color:ie,marginLeft:12,[H.default.xsOrSmaller]:{display:"none"}},voteText:{[H.default.xsOrSmaller]:{display:"none"}},voteFlagList:{display:"flex"},toolButton:{marginLeft:12},flagTool:{[H.default.xsOrSmaller]:{}},flagText:{[H.default.xsOrSmaller]:oe.flagText},moderatorFlagged:{marginLeft:8},fromTheAuthor:{marginLeft:8},notificationsUnavailableText:{marginLeft:12},horizontalSeparator:{borderBottom:$.border,clear:"both",paddingBottom:h.default.small_12,":last-child":{borderBottom:"none",paddingBottom:0}},separator:{color:$.borderColor,paddingLeft:h.default.xxxSmall_4,paddingRight:h.default.xxxSmall_4},maximizedDesktop:{[H.default.smOrSmaller]:{display:"none"}},expandedActionList:{flexDirection:"row"},avatar:{marginRight:24},programHover:{":hover":{cursor:"pointer"}},programViewInfo:{display:"flex",flexDirection:"row",gap:20},programCode:{height:"200px",width:"100%",overflow:"scroll",backgroundColor:"#f0f0f0"},flagsTooltipRow:{flexDirection:"row"},flagsTooltipKaid:{color:m.default.blue},flagsTooltipText:{paddingLeft:8},projectPreview:{width:40},checkbox:{position:"absolute",top:60,left:15}}),de={onChangeType:Z.changeType,onClearFlags:Z.clearFlags,onDeletePost:Z.deletePost,onSkipPosts:Z.skipPosts,onHideProgramEverywhere:Z.hideProgramEverywhere,onHideProgramFromHotlist:Z.hideProgramFromHotlist,onDownvotePost:Z.downvotePost,onFlagPost:Z.flagPost,onModifyNotifications:Z.modifyNotificationsAction,onPostSuccess:Z.postSuccessAction,onShowReplies:Z.fetchRepliesPage,onShowAnswers:Z.fetchAnswers,onToggleReplyInput:Z.toggleReplyInputAction,onUndeletePost:Z.undeletePost,onUpvotePost:Z.upvotePost,resetExpandKey:Z.resetExpandKeyAction,onStartAcceptingClarification:Z.startAcceptingClarificationAction,onStopAcceptingClarification:Z.stopAcceptingClarificationAction,onSelectPosts:Z.selectPosts,onDeselectPost:Z.deselectPost,onLockThread:Z.lockThread,onUnlockThread:Z.unlockThread,onPinThread:Z.pinThread,onUnpinThread:Z.unpinThread};var pe=(0,d.compose)((0,W.default)({name:"pinning_and_locking"}),q.default,N.default,b.withActionScheduler,B.default,ee.default,(0,i.connect)(((e,t)=>{const n=e.posts[t.postKey],{contentKind:o,contentId:r}=((e,t,n,o)=>{if(n.focus)return{contentKind:n.focus.kind,contentId:n.focus.id};if(n.question&&n.question.focus)return{contentKind:n.question.focus.kind,contentId:n.question.focus.id};if(n.questionKey){const t=e[n.questionKey];if(t&&t.focus)return{contentKind:t.focus.kind,contentId:t.focus.id}}else if(o)return{contentKind:o.contentKind,contentId:o.contentId};return t})(e.posts,{contentKind:e.contentKind,contentId:e.contentId},n,t.contentKind?{contentKind:t.contentKind,contentId:t.contentId}:void 0),a="Topic"===e.contentKind,s=a&&"answer"===(0,R.getPostTypeAllowingProgram)(n),i=!0===e.selectedPosts[n.key];return{post:n,contentId:r,contentKind:o,qaExpandKey:e.qaExpandKey,newPostKey:e.newPostKey,displayInputPostKey:e.displayInputPostKey,clarificationBeingAcceptedId:e.clarificationBeingAcceptedId,showPostedIn:a,showParentQuestion:s,selected:i}}),de))(se);t.default=pe}}]);
//# sourceMappingURL=../../sourcemaps/en/2FxO.ee7d70c48a8b2908ef60.js.map