/*! For license information please see add_forge_now.be14507bc77d00485525.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.swh=t():(e.swh=e.swh||{},e.swh.add_forge_now=t())}(self,(function(){return function(){var __webpack_modules__={87757:function(e,t,r){e.exports=r(35666)},86515:function(e,t,r){"use strict";r.d(t,{XC:function(){return n}});var n=(0,r(59537).TT)("img/swh-spinner.gif")},59537:function(e,t,r){"use strict";r.d(t,{DK:function(){return a},Jp:function(){return c},TT:function(){return i},_3:function(){return d},e_:function(){return s},mQ:function(){return u},ry:function(){return o}});r(87757);var n=r(31955);function o(e){if(!e.ok)throw e;return e}function a(e,t){var r="";try{var n=JSON.parse(e.reason);Object.entries(n).forEach((function(e,t){var n=e[0],o=e[1][0];r+="\n"+n+": "+o}))}catch(t){r=e.reason}return r?"Error: "+r:t}function i(e){return"/static/"+e}function s(e,t,r){return void 0===t&&(t={}),void 0===r&&(r=null),t["X-CSRFToken"]=n.Z.get("csrftoken"),fetch(e,{credentials:"include",headers:t,method:"POST",body:r})}function u(e,t){void 0===t&&(t=[]);var r=null,n=!0;try{r=new URL(e)}catch(e){n=!1}return n&&t.length&&(n=void 0!==t.find((function(e){return e===r.protocol}))),n?r:null}function c(e){return new Date(e).toLocaleString()}function d(e,t,r,n){if(void 0===r&&(r=!1),void 0===n&&(n=""),"display"===t&&e){var o=encodeURI(e);n||(n=o);var a="";return r&&(a='target="_blank" rel="noopener noreferrer"'),'"+n+""}return e}},27931:function(e,t,r){"use strict";r.d(t,{Br:function(){return _},Tl:function(){return p},xE:function(){return f}});var n,o=r(15861),a=r(87757),i=r.n(a),s=r(86515),u=r(59537),c=r(39449),d="swh-add-forge-user-filter",l=r.n(c)()({inputId:d,checked:!0});function p(){$(document).ready((function(){$("#requestCreateForm").submit(function(){var e=(0,o.Z)(i().mark((function e(t){var r,o,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.prev=1,e.next=4,(0,u.e_)($(this).attr("action"),{"Content-Type":"application/x-www-form-urlencoded"},$(this).serialize());case 4:r=e.sent,(0,u.ry)(r),$("#userMessageDetail").empty(),$("#userMessage").text("Your request has been submitted"),$("#userMessage").removeClass("badge-danger"),$("#userMessage").addClass("badge-success"),n.draw(),e.next=23;break;case 13:return e.prev=13,e.t0=e.catch(1),$("#userMessageDetail").empty(),e.next=18,e.t0.json();case 18:a=e.sent,o=409===e.t0.status?a:(0,u.DK)(a,"An unknown error occurred during the request creation"),$("#userMessage").text(o),$("#userMessage").removeClass("badge-success"),$("#userMessage").addClass("badge-danger");case 23:case"end":return e.stop()}}),e,this,[[1,13]])})));return function(t){return e.apply(this,arguments)}}()),f()}))}function f(){n=$("#add-forge-request-browse").on("error.dt",(function(e,t,r,n){$("#add-forge-browse-request-error").text(n)})).DataTable({serverSide:!0,processing:!0,language:{processing:''},retrieve:!0,searching:!0,dom:'<"row"<"col-sm-3"l><"col-sm-6 text-left user-requests-filter"><"col-sm-3"f>><"row"<"col-sm-12"tr>><"row"<"col-sm-5"i><"col-sm-7"p>>',ajax:{url:Urls.add_forge_request_list_datatables(),data:function(e){var t=$("#"+d).prop("checked");swh.webapp.isUserLoggedIn()&&(void 0===t||t)&&(e.user_requests_only="1")}},fnInitComplete:function(){swh.webapp.isUserLoggedIn()&&($("div.user-requests-filter").html(l),$("#"+d).on("change",(function(){n.draw()})))},columns:[{data:"submission_date",name:"submission_date",render:u.Jp},{data:"forge_type",name:"forge_type",render:$.fn.dataTable.render.text()},{data:"forge_url",name:"forge_url",render:function(e,t,r){var n=$.fn.dataTable.render.text().display(e);return(0,u._3)(n,t,!0)}},{data:"status",name:"status",render:function(e,t,r,n){return swh.add_forge_now.formatRequestStatusName(e)}},{render:function(e,t,r){if("FIRST_ORIGIN_LOADED"===r.status){var n=$.fn.dataTable.render.text().display(r.forge_url),o=Urls.browse_search()+"?q="+encodeURIComponent(n);return''}return""}}],order:[[0,"desc"]]})}function _(e){var t="";(0,u.mQ)(e.value.trim(),["http:","https:"])||(t="The provided forge URL is not valid."),e.setCustomValidity(t)}},23120:function(e,t,r){"use strict";r.d(t,{f:function(){return s},y:function(){return u}});var n=r(15861),o=r(87757),a=r.n(o),i=r(59537);function s(){u()}function u(){return c.apply(this,arguments)}function c(){return(c=(0,n.Z)(a().mark((function e(){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:$("#swh-add-forge-now-moderation-list").on("error.dt",(function(e,t,r,n){$("#swh-add-forge-now-moderation-list-error").text(n)})).DataTable({serverSide:!0,processing:!0,searching:!0,dom:'<<"d-flex justify-content-between align-items-center"f<"#list-exclude">l>rt<"bottom"ip>>',ajax:{url:Urls.add_forge_request_list_datatables()},columns:[{data:"id",name:"id",render:function(e,t,r,n){return""+e+""}},{data:"submission_date",name:"submission_date",render:i.Jp},{data:"forge_type",name:"forge_type",render:$.fn.dataTable.render.text()},{data:"forge_url",name:"forge_url",render:function(e,t,r){var n=$.fn.dataTable.render.text().display(e);return(0,i._3)(n,t,!0)}},{data:"last_moderator",name:"last_moderator",render:$.fn.dataTable.render.text()},{data:"last_modified_date",name:"last_modified_date",render:i.Jp},{data:"status",name:"status",render:function(e,t,r,n){return swh.add_forge_now.formatRequestStatusName(e)}},{render:function(e,t,r){var n='
';if(n+='',"FIRST_ORIGIN_LOADED"===r.status){var o=$.fn.dataTable.render.text().display(r.forge_url),a=Urls.browse_search()+"?q="+encodeURIComponent(o);n+=''}return n+="
"}}],order:[[0,"desc"]]});case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},39333:function(e,t,r){"use strict";r.d(t,{H:function(){return g},q:function(){return p}});var n,o=r(15861),a=r(87757),i=r.n(a),s=r(59537),u=r(31878),c=r.n(u),d=r(92791),l=r.n(d);function p(e,t){$(document).ready((function(){f(e,t),$("#contactForgeAdmin").click((function(e){var t,r,o,a,i;t=encodeURIComponent($("#contactForgeAdmin").attr("emailTo")),r=encodeURIComponent($("#contactForgeAdmin").attr("emailCc")),o=encodeURIComponent($("#contactForgeAdmin").attr("emailSubject")),a=encodeURIComponent(l()({forgeUrl:n.forge_url}).trim().replace(/\n/g,"\r\n")),(i=window.open("","_blank","",!0)).location.href="mailto:"+t+"?Cc="+r+"&Reply-To="+r+"&Subject="+o+"&body="+a,i.focus()})),$("#updateRequestForm").submit(function(){var r=(0,o.Z)(i().mark((function r(n){var o;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n.preventDefault(),r.prev=1,r.next=4,(0,s.e_)($(this).attr("action"),{"Content-Type":"application/x-www-form-urlencoded"},$(this).serialize());case 4:o=r.sent,(0,s.ry)(o),$("#userMessage").text("The request status has been updated "),$("#userMessage").removeClass("badge-danger"),$("#userMessage").addClass("badge-success"),f(e,t),r.next=17;break;case 12:r.prev=12,r.t0=r.catch(1),$("#userMessage").text("Sorry; Updating the request failed"),$("#userMessage").removeClass("badge-success"),$("#userMessage").addClass("badge-danger");case 17:case"end":return r.stop()}}),r,this,[[1,12]])})));return function(e){return r.apply(this,arguments)}}())}))}function f(e,t){return _.apply(this,arguments)}function _(){return(_=(0,o.Z)(i().mark((function e(t,r){var o,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(Urls.api_1_add_forge_request_get(t));case 3:return o=e.sent,(0,s.ry)(o),e.next=7,o.json();case 7:a=e.sent,n=a.request,$("#requestStatus").text(swh.add_forge_now.formatRequestStatusName(n.status)),$("#requestType").text(n.forge_type),$("#requestURL").text(n.forge_url),$("#requestContactName").text(n.forge_contact_name),$("#requestContactConsent").text(n.submitter_forward_username),$("#requestContactEmail").text(n.forge_contact_email),$("#submitterMessage").text(n.forge_contact_comment),$("#updateComment").val(""),$("#contactForgeAdmin").attr("emailTo",n.forge_contact_email),$("#contactForgeAdmin").attr("emailCc",n.inbound_email_address),$("#contactForgeAdmin").attr("emailSubject","Software Heritage archival notification for "+n.forge_domain),h(a.history),g(n.status,r),e.next=32;break;case 24:if(e.prev=24,e.t0=e.catch(0),!(e.t0 instanceof Response)){e.next=31;break}$("#fetchError").removeClass("d-none"),$("#requestDetails").addClass("d-none"),e.next=32;break;case 31:throw e.t0;case 32:case"end":return e.stop()}}),e,null,[[0,24]])})))).apply(this,arguments)}function h(e){$("#requestHistory").children().remove(),e.forEach((function(e,t){var r=c()({event:e,index:t,getHumanReadableDate:s.Jp});$("#requestHistory").append(r)}))}function g(e,t){var r=t[e];$("#decisionOptions").children().remove(),r.forEach((function(e,t){var r=swh.add_forge_now.formatRequestStatusName(e);$("#decisionOptions").append('")})),$("#decisionOptions").append("")}},39449:function(module){module.exports=function anonymous(locals,escapeFn,include,rethrow){escapeFn=escapeFn||function(e){return null==e?"":String(e).replace(_MATCH_HTML,encode_char)};var _ENCODE_HTML_RULES={"&":"&","<":"<",">":">",'"':""","'":"'"},_MATCH_HTML=/[&<>'"]/g;function encode_char(e){return _ENCODE_HTML_RULES[e]||e}var __output="";function __append(e){null!=e&&(__output+=e)}with(locals||{})__append('\n
\n \n \n
\n');return __output}},31878:function(module){module.exports=function anonymous(locals,escapeFn,include,rethrow){escapeFn=escapeFn||function(e){return null==e?"":String(e).replace(_MATCH_HTML,encode_char)};var _ENCODE_HTML_RULES={"&":"&","<":"<",">":">",'"':""","'":"'"},_MATCH_HTML=/[&<>'"]/g;function encode_char(e){return _ENCODE_HTML_RULES[e]||e}var __output="";function __append(e){null!=e&&(__output+=e)}with(locals||{})__append('\n
\n\t
\n\t\t
\n\t\t\t

\n\t\t\t\t\n\t\t\t

\n\t\t
\n\t\t
\n\t\t\t
\n\t\t\t\t'),event.text&&(__append("\n\t\t\t\t
"),__append(escapeFn(event.text)),__append("
\n\t\t\t\t")),__append("\n\t\t\t\t"),null!==event.message_source_url&&(__append('\n\t\t\t\t

Open original message in email client

\n\t\t\t\t')),__append("\n\t\t\t\t"),null!==event.new_status&&(__append("\n\t\t\t\t\t

\n\t\t\t\t\t\tStatus changed to: "),__append(escapeFn(swh.add_forge_now.formatRequestStatusName(event.new_status))),__append("\n\t\t\t\t\t

\n\t\t\t\t")),__append("\n\t\t\t
\n\t\t
\n\t
\n
\n");return __output}},92791:function(module){module.exports=function anonymous(locals,escapeFn,include,rethrow){escapeFn=escapeFn||function(e){return null==e?"":String(e).replace(_MATCH_HTML,encode_char)};var _ENCODE_HTML_RULES={"&":"&","<":"<",">":">",'"':""","'":"'"},_MATCH_HTML=/[&<>'"]/g;function encode_char(e){return _ENCODE_HTML_RULES[e]||e}var __output="";function __append(e){null!=e&&(__output+=e)}with(locals||{})__append("\nDear forge administrator,\n\nThe mission of Software Heritage is to collect, preserve and share all\nthe publicly available source code (see\nhttps://www.softwareheritage.org for more information).\n\nWe just received a request to add the forge hosted at "),__append(escapeFn(forgeUrl)),__append('\nto the list of software origins that are archived, and it is our\nunderstanding that you are the contact person for this forge.\n\nIn order to archive the forge contents, we will have to periodically\npull the public repositories it contains and clone them into the\nSoftware Heritage archive.\n\nPlease let us know if there are any technical issues to consider before\n we launch the archival of the public repositories hosted on your\n infrastructure.(use "Reply all" to ensure our system will process\n your answer properly)\n\nIn the absence of an answer to this message, we will start to archive\nyour forge in the coming weeks (only the publicly accessible\nrepositories will be archived)\n\nThank you in advance for your help.\n\nKind regards,\nThe Software Heritage team\n');return __output}},35666:function(e){var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var a=t&&t.prototype instanceof g?t:g,i=Object.create(a.prototype),s=new C(n||[]);return o(i,"_invoke",{value:S(e,r,s)}),i}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var p="suspendedStart",f="executing",_="completed",h={};function g(){}function m(){}function v(){}var w={};c(w,i,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(R([])));b&&b!==r&&n.call(b,i)&&(w=b);var x=v.prototype=g.prototype=Object.create(w);function E(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function r(o,a,i,s){var u=l(e[o],e,a);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,i,s)}),(function(e){r("throw",e,i,s)})):t.resolve(d).then((function(e){c.value=e,i(c)}),(function(e){return r("throw",e,i,s)}))}s(u.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function S(e,t,r){var n=p;return function(o,a){if(n===f)throw new Error("Generator is already running");if(n===_){if("throw"===o)throw a;return $()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var s=T(i,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===p)throw n=_,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var u=l(e,t,r);if("normal"===u.type){if(n=r.done?_:"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=_,r.method="throw",r.arg=u.arg)}}}function T(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var a=l(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,h;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,h):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function q(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function R(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),q(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;q(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},15861:function(e,t,r){"use strict";function n(e,t,r,n,o,a,i){try{var s=e[a](i),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function o(e){return function(){var t=this,r=arguments;return new Promise((function(o,a){var i=e.apply(t,r);function s(e){n(i,o,a,s,u,"next",e)}function u(e){n(i,o,a,s,u,"throw",e)}s(void 0)}))}}r.d(t,{Z:function(){return o}})},31955:function(e,t){"use strict";function r(e){for(var t=1;t