1window.bp=window.bp||{},(k=>{var r;"undefined"!=typeof BP_Nouveau&&(bp.Nouveau=bp.Nouveau||{},bp.Nouveau.Media=bp.Nouveau.Media||{},bp.Nouveau.TopicReplyDraft=function(t){t=t||k("#new-post"),this.currentForm=t,this.start=function(){void 0!==BP_Nouveau.forums.params.bb_current_user_id&&0!==parseInt(BP_Nouveau.forums.params.bb_current_user_id)&&(this.setupGlobals(),this.addListeners())},this.setupGlobals=function(){this.bbp_forum_id=!1,this.bbp_topic_id=!1,this.bbp_reply_to=!1,this.is_bb_theme=k("body").hasClass("buddyboss-theme"),this.topic_reply_local_interval=!1,this.topic_reply_ajax_interval=!1,this.draft_ajax_request=null,this.is_topic_reply_form_submit=!1,this.draft_content_changed=!1,this.all_draft_data={},this.bbp_lead_topic_tags="",this.bp_nouveau_forums_data=void 0!==BP_Nouveau.forums.draft?BP_Nouveau.forums.draft:{},this.topic_reply_draft={object:!1,data_key:!1,data:!1,post_action:"update",is_content_valid:!1};var t=new Event(this.currentForm);this.setupTopicReplyDraftKeys(t),this.getTopicReplyDraftData(),this.syncTopicReplyDraftData()},this.addListeners=function(){var i=this;this.is_bb_theme?(this.currentForm.closest(".bbp-topic-form").on("bbp_after_load_topic_form",function(){i.setupOnOpenTopicReplyModal()}),this.currentForm.closest(".bbp-reply-form").on("bbp_after_load_reply_form",function(){i.setupOnOpenTopicReplyModal()}),this.currentForm.closest(".bbp-reply-form").on("bbp_after_load_inline_reply_form",function(){i.setupOnOpenTopicReplyModal()}),this.currentForm.find(".js-modal-close").on("bbp_after_close_topic_reply_form",function(){i.clearOnCloseTopicReplyModal()}),k(document).on("bbp_after_close_topic_reply_form_on_overlay",function(){i.clearOnCloseTopicReplyModal()})):(k(window).on("load",function(){i.setupTopicReplyDraftIntervals()}),i.displayTopicReplyDraft()),k("body").hasClass("activity")||(window.onbeforeunload=function(t){void 0!==t&&i.setupOnReloadWindow()},window.unload=function(t){void 0!==t&&i.setupOnReloadWindow()}),this.currentForm.on("click","#bbp_topic_submit",function(){i.submitTopicReplyDraftForm()}),this.currentForm.on("click","#bbp_reply_submit",function(){i.submitTopicReplyDraftForm()}),this.currentForm.on("click",".bb_discard_topic_reply_draft",function(){i.discardTopicReplyDraftForm()})},this.setupOnOpenTopicReplyModal=function(){this.setupTopicReplyDraftKeys(),this.getTopicReplyDraftData(),this.syncTopicReplyDraftData(),this.setupTopicReplyDraftIntervals(),this.displayTopicReplyDraft()},this.setupTopicReplyDraftKeys=function(){this.currentForm&&(0<this.currentForm.find("#bbp_forum_id").length?(this.bbp_forum_id=parseInt(this.currentForm.find("#bbp_forum_id").val()),this.topic_reply_draft.object="topic",this.topic_reply_draft.data_key="draft_topic",0<this.bbp_forum_id&&(this.topic_reply_draft.data_key="draft_discussion_"+this.bbp_forum_id)):0<this.currentForm.find("#bbp_topic_id").length&&(this.bbp_topic_id=parseInt(this.currentForm.find("#bbp_topic_id").val()),this.bbp_reply_to=parseInt(this.currentForm.find("#bbp_reply_to").val()),this.topic_reply_draft.object="reply",this.topic_reply_draft.data_key="draft_reply",0<this.bbp_topic_id&&0===this.bbp_reply_to?this.topic_reply_draft.data_key="draft_reply_"+this.bbp_topic_id:0<this.bbp_topic_id&&0<this.bbp_reply_to&&(this.topic_reply_draft.data_key="draft_reply_"+this.bbp_topic_id+"_"+this.bbp_reply_to)),this.currentForm.hasClass("has-draft")&&this.currentForm.removeClass("has-draft"),this.updateLeadDiscussionTagsInForm(),this.bbp_topic_id)&&1<r.length&&this.updateSubscriptionCheckboxes()},this.updateSubscriptionCheckboxes=function(){var t=this.currentForm.find("#bbp_topic_subscription");t.prop("id","bbp_topic_subscription_"+this.bbp_topic_id),t.siblings("label").prop("for","bbp_topic_subscription_"+this.bbp_topic_id)},this.updateLeadDiscussionTagsInForm=function(){var t,i,e;this.currentForm&&(t=[],i=this.is_bb_theme?".item-tags ul li":".bbp-topic-tags p a",this.currentForm.closest("#bbpress-forums").find(i).each(function(){t.push(k(this).text().trim())}),this.bbp_lead_topic_tags=0<t.length?t.join(","):"",this.currentForm.find("#bbp_topic_tags").val(this.bbp_lead_topic_tags),e=this.currentForm.find("#bbp_to
1pic_tags_dropdown"),""!==this.bbp_lead_topic_tags&&(e.find("option").remove(),_.each(this.bbp_lead_topic_tags.split(","),function(t){e.append(new Option(t,t,!1,!0))})),e.trigger("change"))},this.getTopicReplyDraftData=function(){var t;return this.topic_reply_draft.data_key&&""===this.topic_reply_draft.data_key||(t=localStorage.getItem(this.topic_reply_draft.data_key),!_.isUndefined(t)&&null!==t&&0<t.length&&(t=JSON.parse(t),this.topic_reply_draft.data=t.data,this.all_draft_data[this.topic_reply_draft.data_key]=t.data)),this.topic_reply_draft},this.syncTopicReplyDraftData=function(){void 0===this.all_draft_data[this.topic_reply_draft.data_key]&&void 0!==this.bp_nouveau_forums_data&&void 0!==this.bp_nouveau_forums_data[this.topic_reply_draft.data_key]&&(this.topic_reply_draft=this.bp_nouveau_forums_data[this.topic_reply_draft.data_key],this.all_draft_data[this.topic_reply_draft.data_key]=this.bp_nouveau_forums_data[this.topic_reply_draft.data_key].data,localStorage.setItem(this.topic_reply_draft.data_key,JSON.stringify(this.topic_reply_draft)))},this.setupTopicReplyDraftIntervals=function(){this.is_bb_theme&&k(".bb-modal-box").hasClass("bb-modal-open")?(window.topic_reply_local_interval||(window.topic_reply_local_interval=setInterval(function(){this.collectTopicReplyDraftActivity()}.bind(this),3e3)),window.topic_reply_ajax_interval||(window.topic_reply_ajax_interval=setInterval(function(){this.postTopicReplyDraft(!1,!1,!1)}.bind(this),2e4))):this.is_bb_theme||(window.topic_reply_local_interval||(window.topic_reply_local_interval=setInterval(function(){this.collectTopicReplyDraftActivity()}.bind(this),3e3)),window.topic_reply_ajax_interval)||(window.topic_reply_ajax_interval=setInterval(function(){this.postTopicReplyDraft(!1,!1,!1)}.bind(this),2e4))},this.clearOnCloseTopicReplyModal=function(){bp.Nouveau.Media.reply_topic_display_post="",this.is_topic_reply_form_submit||(this.collectTopicReplyDraftActivity(),this.postTopicReplyDraft(!1,!0,!1)),this.clearTopicReplyDraftIntervals(),setTimeout(function(){this.resetTopicReplyDraftLinkPreview(),this.resetTopicReplyDraftPostForm()}.bind(this),500),bp.Nouveau.Media.reply_topic_display_post="",this.is_topic_reply_form_submit=!1},this.clearTopicReplyDraftIntervals=function(){clearInterval(window.topic_reply_local_interval),window.topic_reply_local_interval=!1,clearInterval(window.topic_reply_ajax_interval),window.topic_reply_ajax_interval=!1},this.resetLocalTopicReplyDraft=function(){bp.Nouveau.Media.reply_topic_display_post="",this.is_topic_reply_form_submit=!0,void 0!==this.all_draft_data[this.topic_reply_draft.data_key]&&delete this.all_draft_data[this.topic_reply_draft.data_key],void 0!==this.bp_nouveau_forums_data[this.topic_reply_draft.data_key]&&delete this.bp_nouveau_forums_data[this.topic_reply_draft.data_key],this.topic_reply_draft.data=!1,localStorage.removeItem(this.topic_reply_draft.data_key),bp.Nouveau.Media.reply_topic_display_post="edit";var t=this.currentForm||k("form#new-post");0<k(t).find("#bb_link_url").length&&k(t).find("#bb_link_url").remove(),t.removeClass("has-draft has-content has-media has-gif has-link-preview")},this.resetTopicReplyDraftPostForm=function(){var t,i=this.currentForm||k("form#new-post"),e=i.find(".bbp-the-content").data("key"),o=i.find("#forums-post-media-uploader"),a=i.find("#forums-post-document-uploader"),p=i.find("#forums-post-video-uploader"),n=i.find("#whats-new-attachments .forums-attached-gif-container"),e=(void 0!==window.MediumEditor?"topic"===this.topic_reply_draft.object?(window.forums_medium_topic_editor&&window.forums_medium_topic_editor[e].setContent(""),(t=i.find("#bbp_editor_topic_content_"+e)).removeClass("error"),i.find("#bbp_topic_content").val(""),i.find("#bbp_topic_title").val(""),i.removeClass("has-title")):"reply"===this.topic_reply_draft.object&&(window.forums_medium_reply_editor&&window.forums_medium_reply_editor[e].setContent(""),(t=i.find("#bbp_editor_reply_content_"+e)).removeClass("error"),t=i.find("#bbp_editor_reply_content_"+e),i.find("#bbp_reply_content").val(""),setTimeout(function(){t.removeClass("error")},300)):(i.find(".bbp-the-content:not(.emojionearea)").empty(),i.find("#bbp_reply_content").val("")),1<r.length&&this.bbp_topic_id?"#bbp_topic_subscription_"+this.bbp_topic_id:"#bbp_to
1pic_subscription");("topic"===this.topic_reply_draft.object&&!k("#subscribe-"+this.bbp_forum_id).hasClass("is-subscribed")||"reply"===this.topic_reply_draft.object&&!k("#subscribe-"+this.bbp_topic_id).hasClass("is-subscribed"))&&i.find(e).prop("checked",!1),i.find("#bbp_topic_tags").val(""),i.find("#bbp_topic_tags_dropdown").val(""),i.find("#bbp_topic_tags_dropdown").trigger("change"),i.find("#bbp_media").val(""),void 0!==o.length&&0<o.length&&(e=o.data("key"),bp.Nouveau.Media.resetForumsMediaComponent(e),i.find("#forums-media-button"))&&i.find("#forums-media-button").parents(".post-elements-buttons-item").removeClass("disable no-click"),i.find("#bbp_document").val(""),void 0!==a.length&&0<a.length&&(o=a.data("key"),bp.Nouveau.Media.resetForumsDocumentComponent(o),i.find("#forums-document-button"))&&i.find("#forums-document-button").parents(".post-elements-buttons-item").removeClass("disable no-click"),i.find("#bbp_video").val(""),void 0!==p.length&&0<p.length&&(e=p.data("key"),bp.Nouveau.Media.resetForumsVideoComponent(e),i.find("#forums-video-button"))&&i.find("#forums-video-button").parents(".post-elements-buttons-item").removeClass("disable no-click"),void 0!==a.length&&0<a.length&&(i.find("#whats-new-toolbar #forums-gif-button").removeClass("active"),i.find(".gif-media-search-dropdown").removeClass("open"),n.length&&(n.addClass("closed"),n.find(".gif-image-container img").attr("src",""),n[0].style="",i.find("#forums-gif-button").parents(".post-elements-buttons-item").removeClass("disable no-click")),i.find("#bbp_media_gif").length)&&i.find("#bbp_media_gif").val(""),this.topic_reply_draft.data=!1,bp.Nouveau.Media.reply_topic_display_post="edit",i[0].reset(),i.removeClass("has-content")},this.resetTopicReplyDraftLinkPreview=function(){var t=this.currentForm||k("form#new-post");k(t).find("#bb-close-link-suggestion").trigger("click"),0<k(t).find("#link_preview_data").length&&(k(t).find("#link_preview_data").val(""),k(t).find("#whats-new-attachments").val("")),k(t).find(".bb-url-scrapper-container").remove(),k(t).find("#bb_link_url").remove()},this.collectTopicReplyDraftActivity=function(){var i,t=this.currentForm||k("#new-post"),e={},o=(_.each(t.serializeArray(),function(t){t.name=t.name.replace("[]",""),-1===_.indexOf(["_wpnonce","_wp_http_referer","_bbp_unfiltered_html_reply","redirect_to","_bbp_unfiltered_html_topic"],t.name)&&(void 0===e[t.name]?e[t.name]=t.value:(_.isArray(e[t.name])||(e[t.name]=[e[t.name]]),e[t.name].push(t.value)))}),void 0===e.bbp_topic_subscription&&(e.bbp_topic_subscription=""),void 0!==e.bbp_topic_title&&""!==e.bbp_topic_title&&(i=(i=e.bbp_topic_title).replace(/\\(.)/g,"$1"),[/javascript:/gi,/on\w+=".*?"/gi,/<script.*?>.*?<\/script>/gi,/\b(alert|confirm|prompt|eval|setTimeout|setInterval)\b\(.*?\)/gi].forEac
1h(function(t){i=i.replace(t,"")}),i=i.trim(),e.bbp_topic_title=i),!1);void 0!==e.bbp_media&&""!==e.bbp_media&&"[]"!==e.bbp_media&&(o=!0),void 0!==e.bbp_document&&""!==e.bbp_document&&"[]"!==e.bbp_document&&(o=!0),void 0!==e.bbp_video&&""!==e.bbp_video&&"[]"!==e.bbp_video&&(o=!0);0<t.find("#forums-gif-button").length&&!t.find("#forums-gif-button").parents(".post-elements-buttons-item").hasClass("disable")&&void 0!==e.bbp_media_gif&&""!==e.bbp_media_gif&&"[]"!==e.bbp_media_gif&&(o=!0),void 0!==e.link_preview_data&&""!==e.link_preview_data&&"[]"!==e.link_preview_data&&(o=!0,t=JSON.parse(e.link_preview_data),(a={}).embed=!1===t.link_embed?0:1,a.url=t.link_url,a.link_image_index_save=0,e.bb_link_url=JSON.stringify(a)),o||void 0===this.topic_reply_draft.data||!1===this.topic_reply_draft.data||(void 0!==this.topic_reply_draft.data.bbp_media&&""!==this.topic_reply_draft.data.bbp_media&&"[]"!==this.topic_reply_draft.data.bbp_media&&(o=!0),void 0!==this.topic_reply_draft.data.bbp_video&&""!==this.topic_reply_draft.data.bbp_video&&"[]"!==this.topic_reply_draft.data.bbp_video&&(o=!0),void 0!==this.topic_reply_draft.data.bbp_document&&""!==this.topic_reply_draft.data.bbp_document&&"[]"!==this.topic_reply_draft.data.bbp_document&&(o=!0));var a,t=!0;(t=("topic"!==this.topic_reply_draft.object||void 0===e.bbp_topic_content||""!==k(k.parseHTML(e.bbp_topic_content)).text().trim()||o)&&("reply"!==this.topic_reply_draft.object||void 0===e.bbp_reply_content||""!==k(k.parseHTML(e.bbp_reply_content)).text().trim()||o)?t:!1)||void 0===this.topic_reply_draft.data||!1===this.topic_reply_draft.data||("topic"===this.topic_reply_draft.object&&(void 0!==this.topic_reply_draft.data.bbp_topic_title&&""!==this.topic_reply_draft.data.bbp_topic_title.trim()&&(t=!0),void 0!==this.topic_reply_draft.data.bbp_topic_content)&&""!==this.topic_reply_draft.data.bbp_topic_content.trim()&&(t=!0),"reply"===this.topic_reply_draft.object&&void 0!==this.topic_reply_draft.data.bbp_reply_content&&""!==this.topic_reply_draft.data.bbp_reply_content.trim()&&(t=!0)),t&&(void 0!==e.bbp_video&&""!==e.bbp_video&&(a=JSON.parse(e.bbp_video).filter(function(t){return void 0!==t.js_preview&&delete t.js_preview,t}),e.bbp_video=JSON.stringify(a)),o={},void 0!==this.all_draft_data[this.topic_reply_draft.data_key]&&(o=this.all_draft_data[this.topic_reply_draft.data_key]),this.checkedTopicReplyDataChanged(o,e),this.topic_reply_draft.data=e,this.all_draft_data[this.topic_reply_draft.data_key]=e,this.topic_reply_draft.is_content_valid=!0,localStorage.setItem(this.topic_reply_draft.data_key,JSON.stringify(this.topic_reply_draft)))},this.checkedTopicReplyDataChanged=function(i,e){var o=this;_.each(["bbp_topic_title","bbp_topic_content","bbp_stick_topic","bbp_to
1pic_tags","bbp_reply_content","bbp_media","bbp_document","bbp_video","bbp_media_gif","link_embed","link_description","link_image","link_title","link_url"],function(t){void 0!==i[t]&&void 0===e[t]||void 0===i[t]&&void 0!==e[t]?o.draft_content_changed=!0:void 0!==i[t]&&void 0!==e[t]&&(-1!==_.indexOf(["bbp_topic_content","bbp_reply_content"],t)?k(k.parseHTML(i[t])).text().trim()!==k(k.parseHTML(e[t])).text().trim()&&(o.draft_content_changed=!0):i[t]!==e[t]&&(o.draft_content_changed=!0))})},this.postTopicReplyDraft=function(t,i,e){!t&&void 0===this.all_draft_data[this.topic_reply_draft.data_key]||!t&&!this.draft_content_changed||(this.topic_reply_draft.data=this.all_draft_data[this.topic_reply_draft.data_key],i?((t=new FormData).append("_wpnonce_post_topic_reply_draft",BP_Nouveau.forums.nonces.post_topic_reply_draft),t.append("action","post_topic_reply_draft"),t.append("draft_topic_reply",JSON.stringify(this.topic_reply_draft)),e&&t.append("all_data",JSON.stringify(this.all_draft_data)),navigator.sendBeacon(BP_Nouveau.ajaxurl,t)):(this.draft_ajax_request&&this.draft_ajax_request.abort(),i={_wpnonce_post_topic_reply_draft:BP_Nouveau.forums.nonces.post_topic_reply_draft,action:"post_topic_reply_draft",draft_topic_reply:this.topic_reply_draft},this.draft_ajax_request=k.ajax({type:"POST",url:BP_Nouveau.ajaxurl,data:i,success:function(){}})),this.draft_content_changed=!1)},this.displayTopicReplyDraft=function(){bp.Nouveau.Media.reply_topic_allow_delete_media=!0,_.isUndefined(this.topic_reply_draft)||("topic"===this.topic_reply_draft.object?this.appendTopicDraftData():this.appendReplyDraftData())},this.appendTopicDraftData=function(){this.getTopicReplyDraftData();var t,i,e,o=this.currentForm||k("form#new-post"),a={},p=o.find(".bbp-the-content").data("key"),p=o.find("#bbp_editor_topic_content_"+p);void 0===(a=void 0!==this.all_draft_data[this.topic_reply_draft.data_key]?this.all_draft_data[this.topic_reply_draft.data_key]:a).bbp_topic_title&&void 0===a.bbp_topic_content||!(""!==a.bbp_topic_title||""!==a.bbp_topic_content||void 0!==a.bbp_media&&""!==a.bbp_media&&"[]"!==a.bbp_media||void 0!==a.bbp_document&&""!==a.bbp_document&&"[]"!==a.bbp_document||void 0!==a.bbp_video&&""!==a.bbp_video&&"[]"!==a.bbp_video)||(o.addClass("has-draft"),void 0!==a.bbp_topic_title&&""!==a.bbp_topic_title&&(o.find("#bbp_topic_title").val(a.bbp_topic_title),o.addClass("has-title")),void 0!==a.bbp_topic_content&&""!==a.bbp_topic_content&&(t=p.get(0),null!==(i=window.MediumEditor?window.MediumEditor.getEditorFromElement(t):null)?(i.setContent(a.bbp_topic_content),""!==k(t).text()&&o.addClass("has-content")):(p.html(a.bbp_topic_content),o.find("#bbp_topic_content").focus(),o.find("#bbp_topic_content").val(a.bbp_topic_content),""!==k(t).val()&&o.addClass("has-content"))),o.find('#bbp_stick_topic_select option[value="'+a.bbp_stick_topic+'"]').prop("selected",!0),i=1<r.length&&this.bbp_topic_id?"#bbp_topic_subscription_"+this.bbp_topic_id:"#bbp_topic_subscription",void 0!==a.bbp_topic_subscription&&""!==a.bbp_topic_subscription?o.find(i).prop("checked",!0):(void 0!==a.bbp_topic_subscription&&""===a.bbp_topic_subscription||0<this.bbp_forum_id&&!k("#subscribe-"+this.bbp_forum_id).hasClass("is-subscribed"))&&o.find(i).prop("checked",!1),null!=a.bbp_topic_tags&&(o.find("#bbp_topic_tags").val(a.bbp_topic_tags),(e=o.find("#bbp_topic_tags_dropdown")).val(""),""!==a.bbp_topic_tags&&_.each(a.bbp_topic_tags.split(","),function(t){e.append(new Option(t,t,!1,!0))}),e.trigger("change")),void 0!==a.bb_link_url&&""!==a.bb_link_url&&(0<o.find("#bb_link_url").length&&o.find("#bb_link_url").remove(),k("<input>").attr({type:"hidden",id:"bb_link_url",name:"bb_link_url",value:a.bb_link_url}).appendTo(o)),this.previewDraftMedia(o,a))},this.appendReplyDraftData=function(){this.getTopicReplyDraftData();var t,i,e,o=this.currentForm||k("form#new-post"),a={},p=o.find(".bbp-the-content").data("key"),p=o.find("#bbp_editor_reply_content_"+p);void 0===(a=void 0!==this.all_draft_data[this.topic_reply_draft.data_key]?this.all_draft_data[this.topic_reply_draft.data_key]:a).bbp_reply_content&&void 0===a.bb_link_url||!(""!==a.bbp_reply_content||void 0!==a.bb_link_url&&""!==a.bb_link_url||void 0!==a.bbp_media&&""!==a.bbp_media&&"[]"!==a.bbp_media||void 0!==a.bbp_document&&""!==a.bbp_document&&"[]"!==a.bbp_document||void 0!==a.bbp_video&&""!==a.bbp_video&&"[]"!==a.bbp_video)||(o.addClass("has-draft"),void 0!==a.bbp_reply_content&&""!==a.bbp_reply_content&&(t=p.get(0),null!==(i=window.MediumEditor?window.MediumEditor.getEditorFromElement(t):null)?(i.setContent(a.bbp_reply_content),""!==k(t).text()&&o.addClass("has-content")):(p.html(a.bbp_reply_content),o.find("#bbp_reply_content").focus(),o.find("#bbp_reply_content").val(a.bbp_reply_content),""!==k(t).val()&&o.addClass("has-content"))),i=1<r.length&&this.bbp_topic_id?"#bbp_topic_subscription_"+this.bbp_topic_id:"#bbp_to
1pic_subscription",void 0!==a.bbp_topic_subscription&&""!==a.bbp_topic_subscription?o.find(i).prop("checked",!0):(void 0!==a.bbp_topic_subscription&&""===a.bbp_topic_subscription||0<this.bbp_topic_id&&!k("#subscribe-"+this.bbp_topic_id).hasClass("is-subscribed"))&&o.find(i).prop("checked",!1),null!=a.bbp_topic_tags&&(o.find("#bbp_topic_tags").val(a.bbp_topic_tags),(e=o.find("#bbp_topic_tags_dropdown")).val(""),""!==a.bbp_topic_tags&&_.each(a.bbp_topic_tags.split(","),function(t){e.append(new Option(t,t,!1,!0))}),e.trigger("change")),void 0!==a.bb_link_url&&""!==a.bb_link_url&&(o.find("#bb_link_url").remove(),k("<input>").attr({type:"hidden",id:"bb_link_url",name:"bb_link_url",value:a.bb_link_url}).appendTo(o)),this.previewDraftMedia(o,a))},this.previewDraftMedia=function(t,i){var l=bp.Nouveau.Media,e=t.find("#forums-post-media-uploader"),o=t.find("#forums-post-document-uploader"),a=t.find("#forums-post-video-uploader"),p=t.find("#whats-new-attachments .forums-attached-gif-container");if(void 0!==e.length&&0<e.length&&void 0!==i.bbp_media&&""!==i.bbp_media){t.find("#bbp_media").val(i.bbp_media);var n=JSON.parse(i.bbp_media);if(n.length){t.find("a#forums-media-button").trigger("click");for(var r,d=e.data("key"),s=0;s<n.length;s++)l.dropzone_media[d].push({id:n[s].id,media_id:0,name:n[s].name,thumb:n[s].thumb,url:n[s].url,uuid:n[s].uuid,menu_order:n[s].menu_order,saved:!1}),r={name:n[s].name,accepted:!0,kind:"image",upload:{filename:n[s].name,uuid:n[s].uuid},dataURL:n[s].url,id:n[s].id},l.dropzone_obj[d].files.push(r),l.dropzone_obj[d].emit("addedfile",r),l.createThumbnailFromUrl(r,e),l.dropzone_obj[d].emit("dz-success",r),l.dropzone_obj[d].emit("dz-complete",r);l.addMediaIdsToForumsForm(e),_.isNull(l.dropzone_obj[d].files)||0===l.dropzone_obj[d].files.length||(t.find("#forums-document-button")&&t.find("#forums-document-button").parents(".post-elements-buttons-item").addClass("disable"),t.find("#forums-video-button")&&t.find("#forums-video-button").parents(".post-elements-buttons-item").addClass("disable"),t.find("#forums-gif-button")&&t.find("#forums-gif-button").parents(".post-elements-buttons-item").addClass("disable"),t.find("#forums-media-button")&&t.find("#forums-media-button").parents(".post-elements-buttons-item").addClass("no-click")),t.addClass("has-media")}}if(void 0!==o.length&&0<o.length&&void 0!==i.bbp_document&&""!==i.bbp_document){t.find("#bbp_document").val(i.bbp_document);var b=JSON.parse(i.bbp_document);if(b.length){t.find("a#forums-document-button").trigger("click");for(var c,u=o.data("key"),f=0;f<b.length;f++)l.dropzone_media[u].push({id:b[f].id,document_id:0,name:b[f].full_name,full_name:b[f].full_name,type:"document",title:b[f].name,size:b[f].size,url:b[f].url,uuid:b[f].uuid,menu_order:b[f].menu_order,saved:!1,svg_icon:_.isUndefined(b[f].svg_icon)?"":b[f].svg_icon}),c={name:b[f].full_name,size:b[f].size,accepted:!0,kind:"document",upload:{name:b[f].full_name,title:b[f].name,filename:b[f].full_name,size:b[f].size,uuid:b[f].uuid},dataURL:b[f].url,id:b[f].id,svg_icon:_.isUndefined(b[f].svg_icon)?"":b[f].svg_icon},l.dropzone_obj[u].files.push(c),l.dropzone_obj[u].emit("addedfile",c),l.dropzone_obj[u].emit("dz-success",c),l.dropzone_obj[u].emit("complete",c);l.addDocumentIdsToForumsForm(o),_.isNull(l.dropzone_obj[u].files)||0===l.dropzone_obj[u].files.length||(t.find("#forums-media-button")&&t.find("#forums-media-button").parents(".post-elements-buttons-item").addClass("disable"),t.find("#forums-video-button")&&t.find("#forums-video-button").parents(".post-elements-buttons-item").addClass("disable"),t.find("#forums-gif-button")&&t.find("#forums-gif-button").parents(".post-elements-buttons-item").addClass("disable"),t.find("#forums-document-button")&&t.find("#forums-document-button").parents(".post-elements-buttons-item").addClass("no-click")),t.addClass("has-media")}}if(void 0!==a.length&&0<a.length&&void 0!==i.bbp_video&&""!==i.bbp_video){t.find("#bbp_video").val(i.bbp_video);var m=JSON.parse(i.bbp_video);if(m.length){t.find("a#forums-video-button").trigger("click"),t.addClass("media-uploading draft-video-uploading");for(var h,v=a.data("key"),y={count:0},g=0;g<m.length;g++)l.dropzone_media[v].push({id:m[g].id,video_id:0,name:m[g].name,type:"video",title:m[g].name,size:m[g].size,url:m[g].url,uuid:m[g].uuid,thumb:m[g].thumb,menu_order:m[g].menu_order,saved:!1}),h={name:m[g].name,size:m[g].size,accepted:!0,kind:"video",upload:{name:m[g].name,title:m[g].name,size:m[g].size,uuid:m[g].uuid},dataURL:m[g].url,dataThumb:m[g].thumb,id:m[g].id}
1,l.dropzone_obj[v].files.push(h),l.dropzone_obj[v].emit("addedfile",h),((a,p,n,r,d)=>{var s=setInterval(function(){var t=k(a.previewElement).closest(".dz-preview");if((t.hasClass("dz-has-no-thumbnail")||t.hasClass("dz-has-thumbnail"))&&(p.js_preview=t.find(".dz-video-thumbnail img").attr("src"),clearInterval(s),d.count++,d.count>=r.length)){n.find("#bbp_video").val(JSON.stringify(r)),n.removeClass("media-uploading draft-video-uploading");t=n.find("#forums-post-video-uploader");if(0<t.length){t=t.data("key");if(t&&l.dropzone_media&&"object"==typeof l.dropzone_media&&Object.prototype.hasOwnProperty.call(l.dropzone_media,t)){var i=l.dropzone_media[t];if(Array.isArray(i)&&Array.isArray(r))for(var e=0;e<i.length;e++)if(i[e]&&i[e].id)for(var o=0;o<r.length;o++)if(r[o]&&r[o].id&&i[e].id===r[o].id){void 0!==r[o].js_preview&&r[o].js_preview&&(i[e].js_preview=r[o].js_preview);break}}}}},100)})(h,m[g],t,m,y),l.dropzone_obj[v].emit("dz-success",h),l.dropzone_obj[v].emit("complete",h);_.isNull(l.dropzone_obj[v].files)||0===l.dropzone_obj[v].files.length||(t.find("#forums-media-button")&&t.find("#forums-media-button").parents(".post-elements-buttons-item").addClass("disable"),t.find("#forums-gif-button")&&t.find("#forums-gif-button").parents(".post-elements-buttons-item").addClass("disable"),t.find("#forums-document-button")&&t.find("#forums-document-button").parents(".post-elements-buttons-item").addClass("disable"),t.find("#forums-video-button")&&t.find("#forums-video-button").parents(".post-elements-buttons-item").addClass("no-click")),t.addClass("has-media")}}void 0!==p.length&&0<p.length&&void 0!==i.bbp_media_gif&&""!==i.bbp_media_gif&&void 0!==(o=JSON.parse(i.bbp_media_gif)).images&&(t.find("a#forums-gif-button").trigger("click"),p[0].style.backgroundImage="url("+o.images.fixed_width.url+")",p[0].style.backgroundSize="contain",p[0].style.height=o.images.original.height+"px",p[0].style.width=o.images.original.width+"px",p.find(".gif-image-container img").attr("src",o.images.original.url),p.removeClass("closed"),k("#bbp_media_gif").length)&&(k("#bbp_media_gif").val(JSON.stringify(o)),t.find("#forums-document-button")&&t.find("#forums-document-button").parents(".post-elements-buttons-item").addClass("disable"),t.find("#forums-video-button")&&t.find("#forums-video-button").parents(".post-elements-buttons-item").addClass("disable"),t.find("#forums-gif-button")&&t.find("#forums-gif-button").parents(".post-elements-buttons-item").addClass("no-click"),t.find("#forums-media-button")&&t.find("#forums-media-button").parents(".post-elements-buttons-item").addClass("disable"),t.addClass("has-gif"))},this.submitTopicReplyDraftForm=function(){this.topic_reply_draft.post_action="delete",this.clearTopicReplyDraftIntervals(),this.resetLocalTopicReplyDraft()},this.discardTopicReplyDraftForm=function(){var t=this.currentForm.find("a[data-modal-id]"),i=this.currentForm.find(".bbp-reply-to-link");t.css("pointer-events","none"),i.css("pointer-events","none"),this.topic_reply_draft.post_action="delete",this.postTopicReplyDraft(!0,!0,!1),this.clearTopicReplyDraftIntervals(),this.resetLocalTopicReplyDraft(),this.resetTopicReplyDraftPostForm(),this.resetTopicReplyDraftLinkPreview(),this.topic_reply_draft.post_action="update",this.setupTopicReplyDraftIntervals(),this.is_topic_reply_form_submit=!1,t.css("pointer-events",""),i.css("pointer-events","")},this.setupOnReloadWindow=function(){"update"===this.topic_reply_draft.post_action&&(this.clearTopicReplyDraftIntervals(),this.collectTopicReplyDraftActivity(),this.postTopicReplyDraft(!1,!0,!0))}},(r=k('form[name="new-post"]')).each(function(){new bp.Nouveau.TopicReplyDraft(k(this)).start()}))})((bp,jQuery));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.