1function _get(e){"use strict";let t=1;for(;!_.isNil(e)&&t<arguments.length;t++)e=e[arguments[t]];if(t===arguments.length)return e}function _access(e){"use strict";let t,s=1;for(;!_.isNil(e)&&s<arguments.length;)switch(arguments[s++]){case"":t=e,e=e[arguments[s++]];break;case"call":e=e.apply(t,arguments[s++]),t=void 0;break;default:throw new Error(`bad _access directive: ${arguments[s-1]}`)}if(s<arguments.length&&"call"===arguments[s]){let e="undefined function";throw""===arguments[s-2]&&(e+=" "+arguments[s-1]),new Error(e)}if(s===arguments.length)return e}function _ref(e,t){"use strict";for(let s=2;s<arguments.length;e=e[arguments[s++]]){if(_.isNil(e))return;let i=e.$ref;if(i&&_.isFunction(i[t])){const r=arguments[s];if(_.isString(r)){const t=e[`${r}Ref`];if(_.isFunction(t)){if(i=t.call(e),_.isNil(i))return;s+=1}else{const t=Object.getOwnPropertyDescriptor(e,r);if(t&&(!t.enumerable||_.isObject(e[r])))continue}}return i[t].apply(i,Array.prototype.slice.call(arguments,s))}}if(!_.isNil(e)){if(e.$ref)return e.$ref;throw new Error(`No $ref with ${t} method found in chain`)}}function useCssVars(e,t){"use strict";e.$observe(t.bind(null,e),t=>{const s=e.$el;_.forEach(t,([e,t])=>{const i=e&&s&&s.nodeType===Node.ELEMENT_NODE?s.style:document.documentElement.style;for(const e in t)i.setProperty(`--${e}`,t[e])})},{precise:!0,deep:!0})}window._declareVue=function(){"use strict";const e={beforeCreate:!0,created:!0,beforeMount:!0,mounted:!0,beforeUpdate:!0,updated:!0,activated:!0,deactivated:!0,beforeDestroy:!0,destroyed:!0,errorCaptured:!0,render:!0,renderError:!0,data:!0,bind:!0,inserted:!0,update:!0,componentUpdated:!0,unbind:!0},t=["$truss","$info","$store","$now","$newKey"],s=Vue.component;return Vue.component=function(e,t){if(t&&t.functional&&_.isFunction(t.render)){const e=t.render;t.render=function(t,s){const i=e(t,s);return _.has(s,"$options.methods.rendered")&&s.$options.methods.rendered(i,s),i}}return s.call(this,e,t)},function(s,i,r,n,a){const o=/Directive$/.test(s)?"directive":"component",l=/Singleton$/.test(s),c={computed:{},methods:{},mixins:[]};i.$vueOptions&&_.assign(c,i.$vueOptions),n&&n.functional||c.mixins.push({data:e=>function(e,s){const i=s.prototype;if(!i.$truss)for(const e of t)Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(Vue.prototype,e));const r=_.filter(Object.getOwnPropertyNames(e),e=>"_"!==e.charAt(0)&&!Object.hasOwnProperty.call(i,e));if(e.$options.props)for(const t in e.$options.props)Object.hasOwnProperty.call(e,t)||Object.hasOwnProperty.call(i,t)||r.push(t);for(const t of r)Object.defineProperty(i,t,{get:()=>e[t],set:s=>{e[t]=s},configurable:!0});const n=new s;for(const e of r)delete i[e];const a={};for(const e in n)Object.hasOwnProperty.call(n,e)&&(a[e]=n[e]);return a}(e,i)}),a&&a.scopeId&&(c._scopeId=a.scopeId),a&&a.cssVarsGetter&&c.mixins.push({mounted(){useCssVars(this,a.cssVarsGetter)}}),r&&(c.extends=Vue.component(r));for(const t of Object.getOwnPropertyNames(i.prototype)){if("constructor"===t)continue;const r=Object.getOwnPropertyDescriptor(i.prototype,t);if(r.value){if(!_.isFunction(r.value))throw new Error(`${s}.${t} is not a function`);e[t]?c[t]=r.value:c.methods[t]=r.value}else if(r.get||r.set){const e=Truss.computedPropertyStats.wrap(r.get,s,t);if(r.set){const s=`setterDelegate_${t}`;c.methods[s]=function(e){r.set.call(this,e)},c.computed[t]={get:e,set(e){this[s](e)}}}else c.computed[t]=e}}if(!c.render&&n&&(_.assign(c,n),c._compiled=!0),"directive"===o&&(s=s.replace(/Directive$/,"")),l)return c.name=_.camelCase(s.replace(/Singleton$/,"")),new Vue(c);Vue[o](s,c)}}(),window._declareGuides=function(e,t,s,i){"use strict";window._pendingGuides||(window._pendingGuides=[]),window._pendingGuides.push(r=>{const n=document.createElement("div");n.setAttribute("id",`${e}-guides`),r.appendChild(n),new Vue({render:s,staticRenderFns:i,_compiled:!0,_scopeId:t,el:`#${e}-guides`})})},_reviewable.define(["AdminCenter"],["truss","Guide","session","router"],function(e,t,s,i){"use strict";class AdminCenter{constructor(){Vue.set(this,"owner",void 0)}created(){this.$observe(()=>this.$info.userid,e=>{null===e&&i.go({path:"/",query:null,hash:null},{replace:!0})}),this.$store.services.reposManager.activate(),this.$when(()=>this.$store.services.reposManager.ready&&s.settings.$ready).then(()=>{this.syncOwner()})}_findOwner(e){return e&&_.find(this.$store.services.reposManager.list,{$owner:_.toLower(e)})}syncOwner(){if(this.$store.services.reposManager.ready&&s.settings.$ready&&this.$info.user){if(Vue.set(this,"owner",this._findOwner(i.params.owner)),this.owner)return Vue.set(s.settings,"lastAdminOrganization",this.owner.$owner),void(s.settings.lastDashboardOrganization&&(Vue.set(s.settings,"lastDashboardOrganization",this.owner.$owner),this.$store.services.auth.updateExtra({lastDashboardOrganization:this.owner.$owner}),Vue.set(this.$store.services.auth,"lastReviewsPath","/reviews/"+this.owner.$owner)));i.go({path:"/admin/"+(this._findOwner(s.settings.lastAdminOrganization)?s.settings.lastAdminOrganization:this.$info.user.github.username),query:_.omit(i.query,"pr")},{replace:!0})}}destroyed(){if(!_.startsWith(i.path,"/admin")){this.$store.services.reposManager.deactivate();const e=_.omit(i.query,["annually-billed","pr","slack-auth-error"]);
1i.go({query:_.isEmpty(e)?null:e},{replace:!0})}}get selectedOrganization(){return _get(this,"owner","$owner")||i.params.owner}onOrganizationChange(e){i.go({path:"/admin/"+e})}}return _declareVue("AdminCenter",AdminCenter,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"admin center"},[s("admin-messages"),e.$store.subscriptions.enterpriseList.length?[s("div",{staticClass:"ui top attached center aligned relative header"},[e._v("\n License\n ")]),s("div",{staticClass:"ui bottom attached segment"},e._l(e.$store.subscriptions.enterpriseList,function(t,i){return s("enterprise-license",{key:t.$key,attrs:{subscription:t,last:i===e.$store.subscriptions.enterpriseList.length-1}})}),1)]:e._e(),s("div",{staticClass:"ui top attached center aligned relative header"},[s("span",{staticClass:"nowrap"},[e._v("\n Organization:\n "),s("organization-selector",{attrs:{value:e.selectedOrganization},on:{input:e.onOrganizationChange}})],1)]),s("div",{staticClass:"ui bottom attached dimmable segment",class:{dimmed:!_get(e,"owner","ready")}},[_get(e,"owner","ready")?s("div",["saas"===e.$session.config.env?s("subscription-settings",{attrs:{owner:e.owner}}):e._e(),"organization"===_get(e,"owner","type")?s("organization-settings",{attrs:{owner:e.owner}}):e._e(),s("repo-connections",{attrs:{owner:e.owner}})],1):e._e(),e._m(0)])],2)},staticRenderFns:[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui simple inverted dimmer"},[s("div",{staticClass:"ui text loader"},[e._v("Loading...")])])}],functional:!1},{scopeId:"data-v-8f130060"}),_declareGuides("AdminCenter","data-v-8f130060",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".subscription.description[data-v-8f130060]",onboarding:"sawSubscriptionDescription",highlight:"under"}},[s("p",[e._v("\n The current "),s("em",[e._v("status of this organization's subscription")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n If you're an "),s("em",[e._v("organization owner")]),e._v(" or the "),s("em",[e._v("subscriber")]),e._v(", this will show\n "),s("em",[e._v("your current plan")]),e._v(", monthly fee, and the number of days left in the free\n trial (if any). Click "),s("span",{staticClass:"ui tiny green labeled icon dummy button"},[s("i",{staticClass:"generic card icon",attrs:{alt:""}}),e._v(" Manage billing")]),e._v(" to\n "),s("em",[e._v("change the subscription's details")]),e._v(" or "),s("em",[e._v("unsubscribe")]),e._v(". Click\n "),s("span",{staticClass:"ui tiny green labeled icon dummy button"},[s("i",{staticClass:"free trial icon",attrs:{alt:""}}),e._v("Start a trial")]),e._v(" to start a "),s("em",[e._v("free trial")]),e._v(" for this organization.\n ")]),e._v(" "),s("p",[e._v('\n If this shows "'),s("em",[e._v("Organizational subscription active")]),e._v("\", then your organization\n has an active subscription but you're not authorized to control it. Only the\n original subscriber (if they're still a member of the organization) and organization\n owners have permission to do so.\n ")])])],1)},[]),{AdminCenter:AdminCenter}},!0,!0,{filename:"src/view/admin/admin-center.vue"}),_reviewable.define(["AdminMessages"],["truss","session"],function(e,t){"use strict";class AdminMessages{created(){this.$connect(this,{missingScopes:()=>_ref(this.$store,"child","users","current","missingScopes")})}getMissingAuthScopes(e,s){return _(this.missingScopes).pickBy(e).keys().union(s).reject(e=>t.hasScope(e)).value()}get missingRepoAuthScopes(){return this.getMissingAuthScopes("lastMissedAsConnectorTimestamp",_.map(_get(this,"$store","users","current","enrollments"),(e,t)=>"public"===t?"public_repo":"repo"))}get missingAlternativeAdminAuthScopes(){return this.getMissingAuthScopes("lastMissedAsAlternativeAdminTimestamp")}get shouldWarnAboutMissingOrgAuth(){return!(_.find(this.$store.subscriptions,{organization:"*"})||_.isEmpty(this.$store.subscriptions)||t.hasScope("admin:org_hook"))}get showAuthButtons(){return!_get(this,"$store","memberships","welcome","offered")&&!this.missingRepoAuthScopes.length&&!this.shouldWarnAboutMissingOrgAuth&&!this.$store.services.reposManager.fetchError&&(!t.hasScope("read:org")||this.$session.config.privateReposAllowed&&!t.hasScope("repo"))}}return _declareVue("AdminMessages",AdminMessages,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"admin-messages"},[e.$store.services.reposManager.fetchError?s("div",{staticClass:"ui error icon message"},[s("i",{staticClass:"frowning face icon"}),s("div",{staticClass:"content"},[e._v("\n Failed to fetch a list of your repositories:\n "+e._s(e.$store.services.reposManager.fetchError)+".\n "),s("a",{staticClass:"link",on:{click:function(t){return e.$store.services.reposManager.refresh()}}}
1,[e._v("Try again")]),e._v(".\n ")])]):e._e(),_get(e,"$store","memberships","welcome","offered")?s("div",{staticClass:"ui icon warning message"},[s("i",{staticClass:"big sign in icon"}),s("div",{staticClass:"content"},[e._v("\n To get started with code reviews at\n "),e._l(e.$store.memberships.welcome.memberships,function(t,i){return s("span",{key:t.organization},[i>0&&e.$store.memberships.welcome.memberships.length>2?s("span",[e._v(",")]):e._e(),i===e.$store.memberships.welcome.memberships.length-1&&e.$store.memberships.welcome.memberships.length>1?s("span",[e._v(" and ")]):e._e(),s("avatar-image",{staticClass:"ui company avatar image",attrs:{src:e.$store.services.avatars.scaleGitHubAvatarUrl(t.logoUrl),fallback:t.organization}}),e._v(e._s(t.company))],1)}),e._v(",\n you'll first need to\n "),s("span",{staticClass:"ui green labeled icon button",class:{disabled:e.$session.auth.disabled},on:{click:function(t){return e.$session.auth.login(e.$store.memberships.welcome.requiredScopes,"optional")}}},[s("i",{staticClass:"authorize icon"}),e._v("\n Authorize access\n ")]),e._v("\n for Reviewable.\n ")],2)]):e._e(),e.missingRepoAuthScopes.length?s("div",{staticClass:"ui warning icon message"},[s("i",{staticClass:"big warning sign icon",attrs:{alt:"warning sign"}}),s("div",{staticClass:"content"},[e._v("\n You have repositories connected but haven't fully authorized Reviewable to access\n them. You need to\n "),s("span",{staticClass:"ui green labeled icon button",class:{disabled:e.$session.auth.disabled},on:{click:function(t){return e.$session.auth.login(e.missingRepoAuthScopes,"optional")}}},[s("i",{staticClass:"authorize icon",attrs:{alt:""}}),e._v("\n authorize access\n ")]),e._v("\n so that Reviewable can keep reviews up to date.\n ")])]):e.missingAlternativeAdminAuthScopes.length?s("div",{staticClass:"ui icon message"},[s("i",{staticClass:"announcement icon",attrs:{alt:"additional auth suggestion"}}),s("div",{staticClass:"content"},[e._v("\n You have admin access to some connected repositories that could benefit from\n additional authorized access. You can\n "),s("span",{staticClass:"ui green labeled icon button",class:{disabled:e.$session.auth.disabled},on:{click:function(t){return e.$session.auth.login(e.missingAlternativeAdminAuthScopes,"optional")}}},[s("i",{staticClass:"authorize icon",attrs:{alt:""}}),e._v("\n authorize access\n ")]),e._v("\n to help keep reviews up to date.\n ")])]):e._e(),e.shouldWarnAboutMissingOrgAuth?s("div",{staticClass:"ui warning icon message"},[s("i",{staticClass:"big warning sign icon",attrs:{alt:"warning sign"}}),s("div",{staticClass:"content"},[e._v("\n You have subscriptions but haven't authorized Reviewable to hook into your\n organizational events to keep track of your organization members so we can welcome\n them nicely when they first sign in. You need to\n "),s("span",{staticClass:"ui green labeled icon button",class:{disabled:e.$session.auth.disabled},on:{click:function(t){return e.$session.auth.login(["admin:org_hook"],"optional")}}},[s("i",{staticClass:"authorize icon",attrs:{alt:""}}),e._v("\n authorize hook access\n ")]),e._v("\n to keep the membership cache updated live, otherwise we'll only poll for updates\n every 24 hours.\n ")])]):e._e(),e.showAuthButtons?s("div",{staticClass:"ui basic center aligned segment"},[e.$session.hasScope("read:org")?e._e():s("span",{staticClass:"ui green labeled icon button",class:{disabled:e.$session.auth.disabled},on:{click:function(t){return e.$session.auth.login(["read:org"],"optional")}}},[s("i",{staticClass:"all organizations icon",attrs:{alt:""}}),e._v("\n Show All Organizations\n ")]),e.$session.config.privateReposAllowed&&!e.$session.hasScope("repo")?s("span",{staticClass:"ui green labeled icon button",class:{disabled:e.$session.auth.disabled},on:{click:function(t){return e.$session.auth.login(["repo","read:org"],"optional")}}},[s("i",{staticClass:"private icon",attrs:{alt:""}}
1),e._v("\n Also Show Private Repos\n ")]):e._e()]):e._e()])},staticRenderFns:[],functional:!1},{}),{AdminMessages:AdminMessages}},!0,!0,{filename:"src/view/admin/admin-messages.vue"}),_reviewable.define(["CheckoutButton"],["truss"],function(e){"use strict";class CheckoutButton{constructor(){if(!!this.priceId+this.billingPortal+this.upgrade!==1)throw new Error("Requires exactly one property of price-id, billing-portal or upgrade.");Vue.set(this,"checkingOut",!1)}get effectiveDisabled(){return this.disabled||!this.owner||this.owner.checkingOut}handleClick(){this.effectiveDisabled||(Vue.set(this,"checkingOut",!0),this.owner.checkout(this.billingPortal?null:this.upgrade?"_upgrade":this.priceId,this.priceId?this.quantity:null))}}CheckoutButton.$vueOptions={props:{owner:Object,disabled:Boolean,priceId:String,quantity:Number,billingPortal:Boolean,upgrade:Boolean}};return _declareVue("CheckoutButton",CheckoutButton,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ui-button",{staticClass:"dimmable",class:{dimmed:e.checkingOut&&_get(e,"owner","checkingOut")},attrs:{disabled:!e.checkingOut&&e.effectiveDisabled},on:{click:e.handleClick}},[s("div",{staticClass:"ui simple inverted dimmer"},[s("div",{staticClass:"ui loader"})]),e._t("default")],2)},staticRenderFns:[],functional:!1},{}),{CheckoutButton:CheckoutButton}},!0,!0,{filename:"src/view/admin/checkout-button.vue"}),_reviewable.define(["EnterpriseLicense"],["truss","Guide","corpsman"],function(e,t,s){"use strict";const i=864e5;class EnterpriseLicense{constructor(){Vue.set(this,"originalSeatConstraints",_(this.subscription.seatsTeamConstraints).keys().sortBy().join(", ")),Vue.set(this,"seatConstraints",this.originalSeatConstraints),Vue.set(this,"applyingSeatConstraints",!1),Vue.set(this,"seatConstraintsError",void 0),Vue.set(this,"showOccupants",!1),Vue.set(this,"showGuestOccupants",!1)}get constraintsModified(){return this.seatConstraints!==this.originalSeatConstraints}get guestOccupants(){const e=this.$now;return _(_get(this,"subscription","guestSeats")).map((t,s)=>({userKey:s,daysRemaining:Math.ceil((t+12096e5-e)/i)})).reject(e=>e.daysRemaining<=0).sortBy("daysRemaining").value()}applySeatConstraints(){if(this.applyingSeatConstraints||!this.constraintsModified)return;Vue.set(this,"applyingSeatConstraints",!0);const e=_.compact(this.seatConstraints.split(/\s*,\s*|\s*\n\s*/));this.subscription.applySeatConstraints(e).then(()=>{Vue.set(this,"originalSeatConstraints",this.seatConstraints),Vue.set(this,"seatConstraintsError",void 0),Vue.set(this,"applyingSeatConstraints",!1)},e=>{s.markHandled(e),Vue.set(this,"seatConstraintsError",e.toString()),Vue.set(this,"applyingSeatConstraints",!1)})}}EnterpriseLicense.$vueOptions={props:{subscription:{type:Object,required:!0},last:Boolean}};return _declareVue("EnterpriseLicense",EnterpriseLicense,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("div",[e._v("\n License for "+e._s(e.subscription.reposCoverage)+" repos in "+e._s(e.subscription.organizationsCoverage)+"\n "),s("span",{directives:[{name:"show",rawName:"v-show",value:e.subscription.seats.max,expression:"subscription.seats.max"}]},[e._v("\n with\n "),s("span",{staticClass:"ui compact message",class:e.subscription.seats.color},[s("a",{staticClass:"link",on:{click:function(t){e.showOccupants=!0}}},[e._v(e._s(e.subscription.seats.current)+"\n of "+e._s(e.subscription.seats.max)+" seats in use")]),e._v("\n ("+e._s(e.subscription.seats.percentage)+"%)\n ")]),s("span",{directives:[{name:"show",rawName:"v-show",value:e.guestOccupants.length,expression:"guestOccupants.length"}]},[e._v(" and\n "),s("span",{staticClass:"ui compact message yellow"},[s("a",{staticClass:"link",on:{click:function(t){e.showGuestOccupants=!0}}},[e._v("\n "+e._s(e.guestOccupants.length)+" temporary guest seat"+e._s(e.guestOccupants.length>1?"s":"")+"\n ")])])])]),e._v("\n expires on\n "),s("span",{staticClass:"ui compact message",class:e.subscription.expiry.color},[e._v("\n "+e._s(e._f("fullDate")(e.subscription.expiry.date))+"\n ")]),e._v(".\n "),s("animate-wipe-down",[e.
1showOccupants?s("div",[s("h4",{staticClass:"ui dividing header"},[e._v("Allocated seats")]),s("div",{staticClass:"seat occupants"},e._l(e.subscription.seats.occupants,function(t){return s("div",{key:t.userKey,staticClass:"occupant"},[s("avatar",{attrs:{"user-key":t.userKey,size:"tiny",display:"picture,username,name"}}),s("span",{staticClass:"days remaining"},[e._v("\n â\n "+e._s(t.daysRemaining)+" day"+e._s(1===t.daysRemaining?"":"s")+" left\n ")])],1)}),0)]):e._e()]),s("animate-wipe-down",[e.showGuestOccupants?s("div",[s("h4",{staticClass:"ui dividing header"},[e._v("Guest seats")]),s("div",{staticClass:"seat occupants"},e._l(e.guestOccupants,function(t){return s("div",{key:t.userKey,staticClass:"occupant"},[s("avatar",{attrs:{"user-key":t.userKey,size:"tiny",display:"picture,username,name"}}),s("span",{staticClass:"days remaining"},[e._v("\n â\n "+e._s(t.daysRemaining)+" day"+e._s(1===t.daysRemaining?"":"s")+" left\n ")])],1)}),0)]):e._e()])],1),s("div",{staticClass:"ui dimmable seat constraints",class:{dimmed:e.applyingSeatConstraints,bottom:e.last}},[e._m(0),s("span",{staticClass:"ui small apply button",class:{disabled:!e.constraintsModified,green:e.constraintsModified},on:{click:e.applySeatConstraints}},[e._v("Apply")]),e.seatConstraintsError?s("div",{staticClass:"ui error message"},[s("i",{staticClass:"close icon",on:{click:function(t){e.seatConstraintsError=null}}}),s("div",{staticClass:"content",staticStyle:{"white-space":"pre-line"}},[e._v(e._s(e.seatConstraintsError))])]):e._e(),s("div",{staticClass:"ui form"},[s("div",{staticClass:"inline field"},[s("label",[e._v("Usage restricted to members of:")]),s("textarea",{directives:[{name:"text-model",rawName:"v-text-model",value:e.seatConstraints,expression:"seatConstraints"}],attrs:{placeholder:"Organization-A/Team-1, Organization-B/Team-2, â¦",spellcheck:"false"}})])])])])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ui simple inverted dimmer"},[t("div",{staticClass:"ui loader"})])}],functional:!1},{scopeId:"data-v-a6ecc3a8"}),_declareGuides("EnterpriseLicense","data-v-a6ecc3a8",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".seat.constraints[data-v-a6ecc3a8]",onboarding:"setSeatConstraints",highlight:"bracket"}},[s("p",[e._v("\n Optional list of teams. "),s("em",[e._v("If specified")]),e._v(", only "),s("em",[e._v("team members")]),e._v(" will be\n able to "),s("em",[e._v("sign in")]),e._v(" to Reviewable. "),s("em",[e._v("If empty")]),e._v(", any GitHub Enterprise\n user will be able to sign in.\n ")]),e._v(" "),s("p",[e._v("\n Teams should be entered in the format "),s("kbd",[e._v("organization/team-slug")]),e._v(" (just like\n for @-mentions) and separated by commas. The subscription admin\n "),s("em",[e._v("must have access")]),e._v(" to all the teams listed and\n "),s("em",[e._v("must keep "),s("kbd",[e._v("repo")]),e._v(" scope granted")]),e._v(" to Reviewable.\n ")])])],1)},[]),{EnterpriseLicense:EnterpriseLicense}},!0,!0,{filename:"src/view/admin/enterprise-license.vue"}),_reviewable.define(["OrganizationSettings"],["truss","Guide","config","session","router","corpsman"],function(e,t,s,i,r,n){"use strict";class OrganizationSettings{constructor(){Vue.set(this,"connector",void 0),Vue.set(this,"masterRepoInput",null),Vue.set(this,"masterRepoError",null),Vue.set(this,"repoTypeAsyncValue",void 0),Vue.set(this,"lastRepoInput",void 0),Vue.set(this,"saving",!1)}created(){s.slackClientEnabled&&Vue.set(this,"connector",this.$connect(this,{slackUserInfoSynced:_ref(this.$store,"child","organizations",this.owner.$owner,"cache","membersHaveSlackUserInfo")}))}destroyed(){const e=_.omit(r.query,"slack-auth-error");r.go({query:e},{replace:!0})}disconnectSlack(){_ref(this.$store,"child","organizations",this.owner.$owner,"slackWorkspace").set(null)}get slackAuthError(){return r.query["slack-auth-error"]}get canConnectSlack(){return!1!==_access(this,"","owner","","coverage","","canUseFeature","call",["slack"])}get slackAuthUrl(){if(!this.canConnectSlack)return;const e=this.owner.$owner,t=this.$info.userid,i=_get(this,"$truss","store","queues","permissions",`${e}|!|${t}`,"secret");return`${s.authHostUrl}/slack_auth?owner=${encodeURIComponent(e)}&userKey=${encodeURIComponent(t)}&secret=${encodeURIComponent(i)}`}get masterRepo(){return null!==this.masterRepoInput?this.masterRepoInput:this.owner.masterRepositoryName||_get(this,"owner","prototypeRepository","name")}set masterRepo(e){Vue.set(this,"masterRepoInput",e),Vue.set(this,"masterRepoError",null)}
1get repoType(){if(null===this.masterRepoInput)return this.owner.ready?this.owner.masterRepositoryName?"master":this.owner.prototypeRepository?"prototype":null:"pending";const e=_.toLower(_.trim(this.masterRepoInput));return e?(this.lastRepoInput!==e&&(Vue.set(this,"lastRepoInput",e),Vue.set(this,"repoTypeAsyncValue","pending"),setTimeout(async()=>{try{if(this.$destroyed||e!==this.lastRepoInput)return;const t=await this.$peek(_ref(this.$store,"child","repositories",this.owner.$owner,e,"core").annotate({permissionRequirement:{owner:this.owner.$owner,level:"own"}}));if(this.$destroyed||e!==this.lastRepoInput)return;if(!t)return void Vue.set(this,"repoTypeAsyncValue",null);let s;if("active"===t.connection){try{s=await i.hubkit().graph('\n query ($owner: String!, $repo: String!) {\n repository (owner: $owner, name: $repo) {\n defaultBranchRef {\n target {\n ... on Commit {\n file(path: "/.reviewable/") {oid}\n }\n }\n }\n }\n }\n',{variables:{owner:this.owner.$owner,repo:e},ifNotFound:null})}catch(e){n.capture(e,"fetch repository settings origin")}if(this.$destroyed||e!==this.lastRepoInput)return;if(void 0===s)return Vue.set(this,"repoTypeAsyncValue","unknown"),void Vue.set(this,"masterRepoError","Failed to fetch repository info from GitHub.")}Vue.set(this,"repoTypeAsyncValue",_get(s,"repository","defaultBranchRef","target","file")?"master":"prototype")}catch(e){Sentry.captureException(e)}},500)),this.repoTypeAsyncValue):null}async save(){if(!this.saving&&null!==this.masterRepoInput){Vue.set(this,"masterRepoError",null),Vue.set(this,"saving",!0);try{if(await this.$when(()=>"pending"!==this.repoType),"unknown"===this.repoType)return;const e=_.toLower(_.trim(this.masterRepoInput)),{repoType:t}=this;try{if(e&&!t)throw new Error("Repository not found in this organization.");await Promise.all([this.$store.queues.requests.send({action:"setMasterRepo",ownerName:this.owner.$owner,repoName:"master"===t?e:null}),_ref(this.$store,"child","organizations",this.owner.$key,"prototypeRepository").set("prototype"===t?{name:e,connectorKey:this.$info.userid}:null)]),Vue.set(this,"masterRepoInput",null)}catch(e){Vue.set(this,"masterRepoError",e.message)}}finally{Vue.set(this,"saving",!1)}}}cancel(){Vue.set(this,"masterRepoInput",null),Vue.set(this,"masterRepoError",null)}}OrganizationSettings.$vueOptions={props:{owner:Object}};return _declareVue("OrganizationSettings",OrganizationSettings,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("h3",{staticClass:"ui dividing admin header"},[s("i",{staticClass:"team icon"}),s("div",{staticClass:"content"},[e._v("Organization")]),e.owner.userIsOwner?s("settings-buttons",{attrs:{disabled:null===e.masterRepoInput||"unknown"===e.repoType,saving:e.saving},on:{apply:function(t){return e.save()},cancel:function(t){return e.cancel()}},scopedSlots:e._u([{key:"cancel-label",fn:function(){return[e._v("Revert")]},proxy:!0}],null,!1,2785573362)}):e._e()],1),e.owner.userIsOwner?s("div",{staticClass:"ui form organization settings",class:{error:e.slackAuthError,warning:e.owner.slackWorkspace&&e.connector.ready&&!e.slackUserInfoSynced}},[s("div",{staticClass:"ui message warning"},[e._v("\n Slack user information has not been synced yet.\n ")]),s("div",{staticClass:"ui message error"},["access_denied"===e.slackAuthError?s("span",[e._v("\n Access to Slack workspace denied.\n ")]):"timed_out"===e.slackAuthError?s("span",[e._v("\n Slack authorization process took too long, please try again.\n ")]):"invalid_state"===e.slackAuthError?s("span",[e._v("\n Slack authorization state corrupted.\n ")]):"unauthorized"===e.slackAuthError?s("span",[e._v("\n Only organization owners can connect a Slack workspace.\n ")]):"upgrade_required"===e.slackAuthError||"upgrade_required_for_enterprise"===e.slackAuthError?s("span",[e._v("\n In order to connect a Slack\n "),"upgrade_required"===e.slackAuthError?s("span",[e._v("workspace")]):s("span",[e._v("Enterprise environment")]),e._v("\n you need to\n "),s("checkout-button",{staticClass:"tiny circular",attrs:{owner:e.owner,upgrade:""}},[e._v("\n upgrade\n ")]),e._v("\n to the\n "),"upgrade_required"===e.slackAuthError?s("span",[e._v("Team or")]):e._e(
1),e._v("\n Business plan.\n ")],1):s("span",[e._v("\n Slack authorization failed due to an unexpected error.\n ")])]),s("div",[e.$session.config.slackClientEnabled?s("div",{staticClass:"field slack integration"},[s("label",[e._v("Slack integration")]),s("div",[e.owner.slackWorkspace?s("span",[s("ui-button",{staticClass:"basic small circular labeled icon slack",on:{click:e.disconnectSlack}},[s("i",{staticClass:"slack icon"}),s("i",{staticClass:"slash icon"}),e._v("\n Remove from Slack\n ")]),s("span",{staticClass:"nowrap"},[e._v("\n Connected to\n "+e._s(e.owner.slackWorkspace.enterpriseInstall?"organization":"workspace")+":\n "),s("strong",[e._v(e._s(e.owner.slackWorkspace.name))])])],1):s("span",[s("a",{attrs:{href:e.slackAuthUrl}},[s("ui-button",{staticClass:"basic small circular labeled icon slack",attrs:{disabled:!e.canConnectSlack}},[s("i",{staticClass:"slack icon"}),e._v("\n Add to Slack\n ")])],1),e.canConnectSlack?e._e():s("span",{staticClass:"nowrap"},[e._v("\n Requires a Team or Business plan.\n  \n "),s("checkout-button",{staticClass:"basic small circular",attrs:{owner:e.owner,upgrade:""}},[e._v("\n Upgrade\n ")])],1)])])]):e._e(),s("div",{staticClass:"field master repository",class:{error:e.masterRepoError}},[s("label",[e._v("Master repository")]),s("div",[s("input",{directives:[{name:"model",rawName:"v-model",value:e.masterRepo,expression:"masterRepo"}],attrs:{type:"text",disabled:e.saving,placeholder:"Repository name"},domProps:{value:e.masterRepo},on:{input:function(t){t.target.composing||(e.masterRepo=t.target.value)}}}),s("animate-slide-down",[e.masterRepoError?s("div",{staticClass:"ui red pointing above error label"},[e._v("\n "+e._s(e.masterRepoError)+"\n ")]):e.repoType||null!==e.masterRepoInput?s("div",{staticClass:"repo info unobtrusive"},["master"===e.repoType?s("span",[e._v("\n Settings from this repository's "),s("code",[e._v("/.reviewable")]),e._v(" directory will\n apply to all repositories in the organization.\n ")]):"prototype"===e.repoType?s("span",[e._v("\n Settings from this repository will be copied to newly created repositories\n in the organization.\n ")]):"pending"===e.repoType?s("span",[e._v("\n Checking for repository settings origin...\n ")]):e._e()]):e._e()])],1)])])]):s("div",{staticClass:"ui info message"},[e._v("\n Only organization owners can edit organization settings.\n ")])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-54603cd2"}),_declareGuides("OrganizationSettings","data-v-54603cd2",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".admin.center .organization.settings .field.slack.integration[data-v-54603cd2]",onboarding:"slackIntegration",highlight:"bracket",position:"right"}},[s("p",[e._v("\n Authorize Reviewable to access your "),s("em",[e._v("Slack workspace")]),e._v(", enabling members\n of your organization to "),s("em",[e._v("receive review updates")]),e._v(" via Slack, "),s("em",[e._v("sync handles")]),e._v(", etc.\n ")])]),e._v(" "),s("guide",{attrs:{for:".admin.center .organization.settings .field.master.repository[data-v-54603cd2]",onboarding:"setSettingsMasterRepository",highlight:"bracket",position:"right"}},[s("p",[e._v("\n Designate a "),s("em",[e._v("repository")]),e._v(" to provide settings for your organization.\n ")]),e._v(" "),s("p",[e._v("\n If the master repository is connected and contains a "),s("code",[e._v("/.reviewable")]),e._v(" directory,\n its "),s("code",[e._v("settings.yaml")]),e._v(" file will "),s("em",[e._v("apply to all repositories")]),e._v(" in the\n organization.\n ")]),e._v(" "),s("p",[e._v("\n Otherwise, settings are managed via the user interface and will be\n "),s("em",[e._v("copied to newly created repositories")]),e._v(".\n ")])])],1)},[]),{OrganizationSettings:OrganizationSettings}},!0,!0,{filename:"src/view/admin/organization-settings.vue"}),_reviewable.define(["PlanSelection"],["truss","Guide","session","shared","animator","router"],function(e,t,s,i,r,n){"use strict";class Rates{constructor(e={}){Vue.set(this,"monthly",null),Vue.set(this,"annualTotal",null),Vue.set(this,"current",null),_.isFinite(e.monthly)&&(Vue.set(this,"monthly",e.monthly),null===this.current&&Vue.set(this,"current",e.monthly)),_.isFinite(e.annualTotal)&&Vue.set(this,"annualTotal",e.annualTotal)}get annually(){return _.isFinite(this.annualTotal)?_.round(this.annualTotal/12,2):null}}class PlanSelection{constructor(){Vue.set(this,"annuallyBilled",void 0),Vue.set(this,"hasGitHubEnterprise",void 0),Vue.set(this,"contributors",void 0),Vue.set(this,"maxContributors",i.maxContributors),Vue.set(this,"moreInfoOpened",!1),Vue.set(this,"rates",{team:new Rates({monthly:8,annualTotal:88}),business:new Rates({monthly:16,annualTotal:176})})}created(){Promise.resolve(s.hasScope("repo")||s.auth.login(["read:org"])).then(()=>s.hubkit().request("GET /orgs/:org",{org:this.owner.login})).then(e=>{Vue.set(this,"hasGitHubEnterprise","enterprise"===_get(e,"plan","
1name")),Vue.set(this,"contributors",_.clamp(_.max([_get(e,"plan","seats"),_get(e,"plan","filled_seats")])||1,1,i.maxContributors))},e=>{Vue.set(this.owner,"subscriptionError",`Failed to load organization: ${e.message}`)}),Vue.set(this,"annuallyBilled",n.query["annually-billed"]),this.$observe(()=>this.annuallyBilled,()=>{const e=_.assign({},n.query,{"annually-billed":this.annuallyBilled||null});n.go({query:e}),this._animateRates()})}chat(e){let t=!1;const i={subject:e,organization:this.owner.login};try{"undefined"!=typeof MissiveChat&&(MissiveChat.addMeta(i),MissiveChat.open(),t=!0)}finally{Vue.set(i,"failedToOpenChat",!t),s.analytics.track("Contacted sales",i)}}toggleMoreInfo(){Vue.set(this,"moreInfoOpened",!this.moreInfoOpened)}get defaultDuration(){return _.toString(r.defaultOptions.duration)}get cooldownDaysRemaining(){const e=_get(this,"owner","coverage","trialDaysRemaining");if(void 0!==e)return e+i.retrialTimeoutDays}_animateRates(){const e=this.annuallyBilled?"annually":"monthly";r.shouldAnimate()?_.forEach(this.rates,t=>{anime({targets:t,current:t[e],round:100,duration:r.defaultOptions.duration})}):_.forEach(this.rates,t=>{Vue.set(t,"current",t[e])})}}PlanSelection.$vueOptions={props:{owner:Object}};return _declareVue("PlanSelection",PlanSelection,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"plan selection"},[s("div",{staticClass:"billing options"},[_get(e,"owner","coverage","trialStatus")?"cooldown"===e.owner.coverage.trialStatus?s("div",{staticClass:"cooldown"},[e._v("\n Trial has ended, available again in "+e._s(e.cooldownDaysRemaining)+" days.\n ")]):e._e():s("div",[s("trial-button",{staticClass:"green",attrs:{organization:e.owner.$owner}})],1),s("div",[s("span",{staticClass:"monthly"},[e._v("Pay monthly")]),s("ui-toggle-input",{model:{value:e.annuallyBilled,callback:function(t){e.annuallyBilled=t},expression:"annuallyBilled"}},[e._v("\n Pay annually (one month free!)\n ")])],1)]),s("div",{staticClass:"ui four column doubling relaxed aligned pricing grid"},[s("div",{staticClass:"team paid plan column"},[s("div",{staticClass:"ui vertical fluid plan menu"},[s("div",{staticClass:"header item"},[e._v("\n Team\n ")]),s("div",{staticClass:"item"},[e._v("For small companies and independent teams.")]),s("div",{staticClass:"item"},[s("ui-details",{staticClass:"basic",attrs:{isOpen:e.moreInfoOpened,fixedAnimationDuration:e.defaultDuration},on:{toggle:e.toggleMoreInfo},scopedSlots:e._u([{key:"summary",fn:function(){return[e._v("See Features")]},proxy:!0}])},[s("ul",{staticClass:"ui list"},[s("li",[e._v("Unlimited reviews for "),s("b",[e._v("all")]),e._v(" repositories")]),s("li",[e._v("File uploads limited to 10MB")]),s("li",[e._v("Removable Reviewable badge in PRs")]),s("li",[e._v("Email and chat support")])])])],1),e.hasGitHubEnterprise?s("div",{staticClass:"item"},[e._m(0),e._m(1)]):[s("div",{staticClass:"fee item"},[s("div",{staticClass:"amount"},[e._v("$"+e._s(e.rates.team.current))]),s("div",[e._v("per contributor / month")]),s("span",{staticClass:"faded unobtrusive",class:{in:e.annuallyBilled}},[e._v("\n Billed annually at $"+e._s(e.rates.team.annualTotal)+"\n ")]),e.owner.promotionDescription?s("div",{staticClass:"promo"},[e._v("\n "+e._s(e.owner.promotionDescription)+"\n ")]):e._e()]),s("div",{staticClass:"item ui form"},[s("div",{staticClass:"contributors"},[s("ui-number-input",{attrs:{min:1,max:e.maxContributors,disabled:void 0===e.contributors},model:{value:e.contributors,callback:function(t){e.contributors=t},expression:"contributors"}}),s("span",[e._v("contributors")])],1),s("br"),s("checkout-button",{class:{green:_get(e,"owner","coverage","trialStatus")},attrs:{disabled:void 0===e.contributors,owner:e.owner,"price-id":"plan_team2024"+(e.annuallyBilled?"annually":""),quantity:e.contributors}},[e._v("\n Subscribe\n ")])],1),e.owner.ranPrivateCompletionConditionRecently?s("div",{staticClass:"item"},[e._m(2)]):e._e()]],2)]),s("div",{staticClass:"business paid plan column"},[s("div",{staticClass:"ui vertical fluid plan menu"},[s("div",{staticClass:"header item"},[e._v("\n Business\n ")]),s("div",{staticClass:"item"},[e._v("\n For sophisticated engineering teams with advanced needs.\n ")]),s("div",{staticClass:"item"},[s("ui-details",{staticClass:"basic",attrs:{isOpen:e.moreInfoOpened,fixedAnimationDuration:e.defaultDuration},on:{toggle:e.toggleMoreInfo},scopedSlots:e._u([{key:"summary",fn:function(){return[e._v("See Features")]},proxy:!0}])},[e._v("\n Everything in "),s("b",[e._v("Team")]),e._v(", plus...\n "),s("ul",{staticClass:"ui list"},[s("li",[e._v("Unlimited custom acceptance criteria\n "),s("ul",[s("li",[e._v("File/folder organization")]),s("li",[e._v("Per-file reviewer assignment")]),s("li",[e._v("And more through a custom completion condition")])])]),s("li",[e._v("Multiple GitHub organization support")]),s("li",[e._v("Priority email support")]),s("li",[e._v("Unlimited file uploads")]),s("li",[e._v("SSO/SAML support")]),s("li",[e._v("GitHub Enterprise Cloud support")])])])],1
1),s("div",{staticClass:"fee item"},[s("div",{staticClass:"amount"},[e._v("$"+e._s(e.rates.business.current))]),s("div",[e._v("per contributor / month")]),s("span",{staticClass:"faded unobtrusive",class:{in:e.annuallyBilled}},[e._v("\n Billed annually at $"+e._s(e.rates.business.annualTotal)+"\n ")]),e.owner.promotionDescription?s("div",{staticClass:"promo"},[e._v("\n "+e._s(e.owner.promotionDescription)+"\n ")]):e._e()]),s("div",{staticClass:"item ui form"},[s("div",{staticClass:"contributors"},[s("ui-number-input",{attrs:{min:1,max:e.maxContributors,disabled:void 0===e.contributors},model:{value:e.contributors,callback:function(t){e.contributors=t},expression:"contributors"}}),s("span",[e._v("contributors")])],1),s("br"),s("checkout-button",{class:{green:_get(e,"owner","coverage","trialStatus")},attrs:{disabled:void 0===e.contributors,owner:e.owner,"price-id":"plan_business2024"+(e.annuallyBilled?"annually":""),quantity:e.contributors}},[e._v("\n Subscribe\n ")])],1)])]),s("div",{staticClass:"enterprise paid plan column"},[s("div",{staticClass:"ui vertical fluid plan menu"},[s("div",{staticClass:"header item"},[e._v("\n Enterprise\n ")]),s("div",{staticClass:"item"},[e._v("\n For larger, stricter environments requiring a dedicated instance.\n ")]),s("div",{staticClass:"item"},[s("ui-details",{staticClass:"basic",attrs:{isOpen:e.moreInfoOpened,fixedAnimationDuration:e.defaultDuration},on:{toggle:e.toggleMoreInfo},scopedSlots:e._u([{key:"summary",fn:function(){return[e._v("See Features")]},proxy:!0}])},[e._v("\n Everything in "),s("b",[e._v("Business")]),e._v(", plus...\n "),s("ul",{staticClass:"ui list"},[s("li",[e._v("On-prem or dedicated cloud")]),s("li",[e._v("Unlimited contributors")]),s("li",[e._v("Analytics - advanced")]),s("li",[e._v("Audit log")]),s("li",[e._v("Selectable database location for lower latency in Europe or Asia")]),s("li",[e._v("Shared Slack channel for support")]),s("li",[e._v("Roadmap influence")]),s("li",[e._v("GitHub Enterprise Server support")])])])],1),e._m(3),s("div",{staticClass:"item fee",on:{click:function(t){return e.chat("Enterprise licensing")}}},[s("ui-button",[e._v("Contact us")])],1)])]),s("div",{staticClass:"free plan column"},[s("div",{staticClass:"ui vertical fluid plan menu"},[s("div",{staticClass:"header item"},[e._v("\n Open Source & Personal\n ")]),s("div",{staticClass:"item"},[e._v("\n Free forever for community projects and personal use.\n ")]),s("div",{staticClass:"item"},[s("ui-details",{staticClass:"basic",attrs:{isOpen:e.moreInfoOpened,fixedAnimationDuration:e.defaultDuration},on:{toggle:e.toggleMoreInfo},scopedSlots:e._u([{key:"summary",fn:function(){return[e._v("See Features")]},proxy:!0}])},[s("ul",{staticClass:"ui list"},[s("li",[e._v("Unlimited reviews for "),s("b",[e._v("public")]),e._v(" and\n "),s("b",[e._v("personal private")]),e._v(" repositories")]),s("li",[e._v("File uploads limited to 10MB")]),s("li",[e._v("Email support")])])])],1),e._m(4),s("div",{staticClass:"item ui form"},[s("ui-button",{staticClass:"standin disabled green dimmable"},[e._v("Already yours!")])],1)])])]),s("div",{staticClass:"faq"},[s("div",{staticClass:"ui medium header"},[e._v("Frequently Asked Questions")]),s("ui-details-group",{scopedSlots:e._u([{key:"summary-contributor",fn:function(){return[e._v('\n Who counts as a "contributor"?\n ')]},proxy:!0},{key:"content-contributor",fn:function(){return[e._v("\n A contributor is anyone in your GitHub organization who creates a pull request,\n potentially limited to members of a GitHub team.\n This does not include admins, reviewers, or people using the reporting features.\n ")]},proxy:!0},{key:"summary-repos",fn:function(){return[e._v("\n Which GitHub repositories qualify for a free plan?\n ")]},proxy:!0},{key:"content-repos",fn:function(){return[e._v("\n All public repositories, as well as any repository attached to an individual\n user as opposed to an organization, are included in the free plan.\n ")]},proxy:!0},{key:"summary-card",fn:function(){return[e._v("\n Is a credit card required for the trial?\n ")]},proxy:!0},{key:"content-card",fn:function(){return[e._v("\n No credit card is required to start a trial. Once a trial is started,\n anyone in the organization can enter a credit card to start a subscription.\n We use "),s("a",{staticClass:"link",attrs:{target:"_blank",href:"https://stripe.com"}},[e._v("Stripe")]),e._v("\n to store your card and process payments.\n ")]},proxy:!0},{key:"summary-cancel",fn:function(){return[e._v("\n What is the cancellation policy?\n ")]},proxy:!0},{key:"content-cancel",fn:function(){return[e._v("\n You can change plans or cancel at any time; no refunds.\n ")]},proxy:!0}])}),s("div",{staticClass:"blurb"},[e._v("\n More questions? Please\n "),s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/subscriptions",target:"_blank"},on:{click:function(t){return e.$session.analytics.track("Opened user guide",{from:"subscription"})}}},[e._v("\n see the user guide\n ")]),e._v("\n or\n "),s("a",{staticClass:"link",attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.chat("Subscription help")}}},[e._v("ask us")]),e._v(".\n ")])],1)])},staticRenderFns:[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("p",[s("b",[e._v("Not available for")])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("p",[s("b",[e._v("GitHub Enterprise")])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui message warning"},[s("i",{staticClass:"big icon yellow warning sign"}),s("div",{staticClass:"content left-text"},[e._v("\n You have recently run a custom completion condition for a private repository.\n This feature is not included in this plan,\n and will no longer be available if you subscribe to this plan.\n ")])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"fee item"},[s("div",{staticClass:"amount"},[e._v("Custom Pricing")])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"fee item"},[s("div",{staticClass:"amount"},[e._v("Free")])])}],functional:!1},{scopeId:"data-v-213f155e"}),_declareGuides("PlanSelection","data-v-213f155e",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".admin.center .plan.selection[data-v-213f155e]",group:".paid.plan .plan.menu[data-v-213f155e]",onboarding:"selectedPaidPlan",highlight:"bracket",position:"top"}},[s("p",[e._v("\n Select a "),s("em",[e._v("paid plan")]),e._v(" to enable Reviewable for "),s("em",[e._v("private repos")]),e._v(" in the\n organization.\n ")]),e._v(" "),s("p",[s("em",[e._v("Any organization member")]),e._v(" can subscribe: you don't need to be an owner or repo admin.\n ")]),e._v(" "),s("p",[s("em",[e._v("Contributors")]),e._v(" are counted as distinct authors of private PRs for which a review\n is created in a given billing period.\n More details in "),s("a",{staticClass:"link",attrs:{target:"_blank",href:"https://docs.reviewable.io/subscriptions#selecting-a-plan"}},[e._v("the user guide")]),e._v(".\n ")])])],1)},[]),{PlanSelection:PlanSelection}},!0,!0,{filename:"src/view/admin/plan-selection.vue"}),_reviewable.define(["RepoConnections"],["truss","Guide","session","corpsman","config","router"],function(e,t,s,i,r,n){"use strict";class RepoConnections{constructor(){Vue.set(this,"publicEnrollPromise",null),Vue.set(this,"privateEnrollPromise",null),Vue.set(this,"personalEnrollPromise",null),Vue.set(this,"publicEnrollError",null),Vue.set(this,"privateEnrollError",null),Vue.set(this,"personalEnrollError",null)}created(){n.params.repo||this.$observe(()=>this.owner.reposStale,e=>{!e&&this.owner.repos||this.owner.fetchRepos()})}get allowEnrollments(){return r.enrollmentsAllowed&&(!r.coveredRepoClasses||_(r.coveredRepoClasses).map("organization").includes("*"))}get enrollments(){return _get(this,"$store","users","current","enrollments")}get showPublicEnrollment(){return"person"===this.owner.type&&this.allowEnrollments}get showPrivateEnrollment(){return"person"===this.owner.type&&this.allowEnrollments&&r.privateReposAllowed&&s.hasScope("repo")}get showPersonalEnrollment(){return"person"===this.owner.type&&this.allowEnrollments&&r.privateReposAllowed}get showAutoConnect(){return"person"!==this.owner.type&&(!1!==this.owner.someCanAdmin||this.owner.showAllRepos||_get(this,"owner","autoConnect","connectorKey"))}get canToggleAutoConnect(){return _get(this.$store.services.warden.getVerdict(this.owner.$key),"own")&&!this.owner.autoConnectInProgress}get showAnyEnrollments(){return this.showPublicEnrollment||this.showPrivateEnrollment||this.showPersonalEnrollment||this.showAutoConnect}get hasNoRepos(){return!this.owner.reposFetching&&_.isEmpty(this.owner.repos)}toggleEnrolled(e){const t=!_get(this,"$store","users","current","enrollments",e,"enrolled");return Vue.set(this,e+"EnrollPromise",this.$store.enrollments.toggleEnrollment(t,e)),this[e+"EnrollPromise"].then(()=>{Vue.set(this,e+"EnrollPromise",null),Vue.set(this,e+"EnrollError",null)},t=>{i.capture(t,"toggleEnrolled"),Vue.set(this,e+"EnrollPromise",null),Vue.set(this,e+"EnrollError",t)})}get showConnectionHeadsUp(){return!1!==this.owner.someCanAdmin&&s.onboarding.$ready&&!0!==s.onboarding.connectedRepo&&!0!==s.onboarding.autoConnected}openRepoSettings(e){e.permissions.admin&&n.go({path:`/admin/${this.owner.$key}/${e.name}`},{replace:!0})}
1closeRepoSettings(){n.go({path:`/admin/${this.owner.$key}`,query:_.omit(n.query,"pr")},{replace:!0})}}RepoConnections.$vueOptions={props:{owner:Object}};return _declareVue("RepoConnections",RepoConnections,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"repositories settings"},[e._m(0),e.showConnectionHeadsUp?s("div",{staticClass:"ui connection headsup icon message"},[s("i",{staticClass:"announcement icon",attrs:{alt:""}}),s("div",{staticClass:"content"},[e._v("\n Heads up: by default, connecting a repository may insert links to the review into all\n open pull requests and post a pending review completion status check on all head\n commits. Click on the repository to change these settings.\n ")])]):e._e(),s("div",{staticClass:"ui dimmable repos",class:{dimmed:e.owner.reposFetching}},[e._m(1),s("div",{staticClass:"repositories list"},[e.showPublicEnrollment?s("div",{staticClass:"enrollment repository"},[s("div",{staticClass:"inline field"},[s("div",{staticClass:"toggle wrapper"},[s("ui-toggle-input",{class:{broken:_get(e,"enrollments","public","errorCode")},attrs:{checked:_get(e,"enrollments","public","enrolled"),disabled:!!e.publicEnrollPromise},on:{change:function(t){return e.toggleEnrolled("public")}}})],1),e._v("\n My PRs in any public repo\n ")]),e.publicEnrollError||_get(e,"enrollments","public","error")?s("div",{staticClass:"ui red pointing above error label"},[e._v(e._s(e.publicEnrollError||_get(e,"enrollments","public","error")))]):e._e()]):e._e(),e.showPrivateEnrollment?s("div",{staticClass:"enrollment repository"},[s("div",{staticClass:"inline field"},[s("div",{staticClass:"toggle wrapper"},[s("ui-toggle-input",{class:{broken:_get(e,"enrollments","private","errorCode")},attrs:{checked:_get(e,"enrollments","private","enrolled"),disabled:!!e.privateEnrollPromise},on:{change:function(t){return e.toggleEnrolled("private")}}})],1),e._v("\n My PRs in any private repo\n "),s("i",{staticClass:"private icon",attrs:{alt:"private repository"}})]),e.privateEnrollError||_get(e,"enrollments","private","error")?s("div",{staticClass:"ui red pointing above error label"},[e._v(e._s(e.privateEnrollError||_get(e,"enrollments","private","error")))]):e._e()]):e._e(),e.showPersonalEnrollment?s("div",{staticClass:"connectall repository"},[s("div",{staticClass:"inline field"},[s("div",{staticClass:"toggle wrapper"},[s("ui-toggle-input",{class:{broken:_get(e,"enrollments","personal","errorCode")},attrs:{checked:_get(e,"enrollments","personal","enrolled"),disabled:!!e.personalEnrollPromise},on:{change:function(t){return e.toggleEnrolled("personal")}}})],1),e._v("\n All current and future repos\n "),s("i",{staticClass:"private icon",attrs:{alt:"private repository"}})]),e.personalEnrollError||_get(e,"enrollments","personal","error")?s("div",{staticClass:"ui red pointing above error label"},[e._v(e._s(e.personalEnrollError||_get(e,"enrollments","personal","error")))]):e._e()]):e._e(),e.showAutoConnect?s("div",{staticClass:"connectall repository"},[s("div",{staticClass:"inline field"},[s("div",{staticClass:"toggle wrapper"},[s("ui-toggle-input",{class:{broken:_get(e,"owner","autoConnect","error")},attrs:{checked:!!_get(e,"owner","autoConnect","connectorKey"),disabled:!e.canToggleAutoConnect},on:{change:function(t){return e.owner.toggleAutoConnect()}}})],1),e._v("\n All current and future repos\n "),s("i",{staticClass:"private icon",attrs:{alt:"private repository"}}),_get(e,"owner","autoConnect","connectorKey")?s("avatar",{attrs:{"user-key":_get(e,"owner","autoConnect","connectorKey"),display:"picture,popup","popup-prefix":"Connected by",size:"tiny"}}):e._e()],1),e.owner.autoConnectError||_get(e,"owner","autoConnect","error")?s("div",{staticClass:"ui red pointing above error label"},[e._v("\n "+e._s(e.owner.autoConnectError||_get(e,"owner","autoConnect","error"))+"\n ")]):e._e()]):e._e(),e._l(e.owner.visibleRepositories,function(t){return s("repo-row",{key:t.name,attrs:{owner:e.owner,repo:t},on:{"open-settings":function(s){return e.openRepoSettings(t)}}})})],2),e.owner.reposFetchError?s("div",{staticClass:"ui error message"},[e._v(e._s(e.owner.reposFetchError))]):e.hasNoRepos&&!e.showAnyEnrollments?s("div",[e._v("\n No repositories found.\n ")]):e._e(
1),s("div",[e.owner.canLoadMoreRepos?s("a",{staticClass:"repos link",class:{disabled:e.owner.reposFetching},on:{click:function(t){return e.owner.fetchRepos(!0)}}},[e._v("\n "+e._s(e.owner.reposFetching?"Loadingâ¦":"Show more repos")+"\n ")]):!e.owner.showAllRepos&&e.owner.hasNonAdminRepos?s("a",{staticClass:"repos link",on:{click:function(t){e.owner.showAllRepos=!0}}},[e._v("\n Show repos without admin access\n ")]):e._e()]),e.owner.reposTruncated?s("div",{staticClass:"ui warning message"},[e._v("\n Only the first 1,000 repositories are shown.\n ")]):e._e()]),s("repo-settings-overlay",{attrs:{owner:e.owner},on:{close:e.closeRepoSettings}})],1)},staticRenderFns:[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("h3",{staticClass:"ui dividing admin header"},[s("i",{staticClass:"repositories icon"}),s("div",{staticClass:"content"},[e._v("Repositories")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ui simple inverted dimmer"},[t("div",{staticClass:"ui loader"})])}],functional:!1},{scopeId:"data-v-6c07ee48"}),_declareGuides("RepoConnections","data-v-6c07ee48",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".repositories[data-v-6c07ee48]",group:".enrollment.repository[data-v-6c07ee48]",onboarding:"enrolled",position:"right",highlight:"bracket"}},[s("p",[s("em",[e._v("Automatically create reviews")]),e._v(" for all "),s("em",[e._v("your own pull requests")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n This can be useful to create reviews for all your\n "),s("em",[e._v("open source contributions")]),e._v(", or if only a subset of the users of an\n organization's private repo want to use Reviewable.\n ")]),e._v(" "),s("p",[e._v("\n Note that for private repos, the owner organization\n "),s("em",[e._v("must have a subscription")]),e._v(" (or trial) active at the time the PR is created.\n If no subscription is found, the "),s("em",[e._v("review won't be created")]),e._v(" and Reviewable\n "),s("em",[e._v("won't try again")]),e._v(" even if a subscription is added later.\n ")])]),e._v(" "),s("guide",{attrs:{for:".connectall.repository[data-v-6c07ee48]",onboarding:"autoConnected",position:"right",highlight:"bracket"}},[s("p",[s("em",[e._v("Connect all current and future repositories")]),e._v(" in this organization, to\n "),s("em",[e._v("automatically create reviews")]),e._v(" for all current and future open pull requests.\n ")]),e._v(" "),s("p",[e._v("\n This will "),s("em",[e._v("insert links to Reviewable")]),e._v(" into\n "),s("em",[e._v("all open pull requests")]),e._v(" in all the repositories, so use with care!\n ")]),e._v(" "),s("p",[e._v("\n Repositories that were previously manually toggled off will not be connected.\n Restricted to "),s("em",[e._v("organization owners")]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".repository:not(.enrollment):not(.connectall) .toggle.wrapper[data-v-6c07ee48]",onboarding:"connectedRepo",position:"left"}},[s("div",[e._v("\n Toggle a repository's "),s("em",[e._v("connection to Reviewable")]),e._v(", controlling the automatic\n "),s("em",[e._v("creation of reviews")]),e._v(" for open PRs.\n ")]),e._v(" "),s("dl",[s("dt",[s("span",{staticClass:"inactive connection toggle"})]),e._v(" "),s("dd",[e._v("\n A "),s("em",[e._v("disconnected repo")]),e._v(" will not automatically create reviews for new PRs,\n but reviews can be "),s("em",[e._v("created on demand")]),e._v(" from the\n "),s("i",{staticClass:"reviews dashboard icon"}),e._v(" Reviews dashboard.\n ")]),e._v(" "),s("dt",[s("span",{staticClass:"active connection toggle"})]),e._v(" "),s("dd",[e._v("\n A "),s("em",[e._v("connected repo")]),e._v(" will "),s("em",[e._v("create reviews for all open pull requests")]),e._v(",\n inserting a link to the review into each PR's description.\n ")]),e._v(" "),s("dt",[s("span",{staticClass:"broken connection toggle"})]),e._v(" "),s("dd",[e._v("\n A repo with a "),s("em",[e._v("broken connection")]),e._v(" has encountered an error (displayed below)\n that you'll "),s("em",[e._v("need to fix")]),e._v(", though some reviews may continue to be created.\n ")])]),e._v(" "),s("p",[e._v("\n You need "),s("em",[e._v("admin permissions")]),e._v(" to toggle a repo's connnection.\n ")]),e._v(" "),s("p",[e._v("\n It's "),s("em",[e._v("safe to disconnect then reconnect")]),e._v(" a repo at any timeâno data will\n be lost. Once created, reviews are not affect by this toggle.\n ")])]),e._v(" "),s("guide",{attrs:{for:".review.count.link[data-v-6c07ee48]",onboarding:"navigatedToRepoDashboard",highlight:"under"}},[s("p",[e._v("\n Go to the "),s("em",[e._v("repo's reviews dashboard")]),e._v(", which lists all the open pull requests\n in the repo.\n ")])]),e._v(" "),s("guide",{attrs:{for:".repository .avatar[data-v-6c07ee48]",onboarding:"sawConnector",position:"right"}},[s("p",[e._v("\n The user who "),s("em",[e._v("connected the repo")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n Backgroun
1d review updates prefer to use "),s("em",[e._v("this user's credentials")]),e._v(", but will\n fall back on other repo admins' credentials to avoid unduly depleting any single\n person's GitHub API quota.\n ")]),e._v(" "),s("p",[e._v("\n Any repo admin can disconnect a repo, not just the person who originally connected it.\n ")])]),e._v(" "),s("guide",{attrs:{for:".repository:not(.enrollment):not(.connectall) .repo.name.link[data-v-6c07ee48]",onboarding:"openedRepoSettings",highlight:"under"}},[s("p",[e._v("\n Edit the "),s("em",[e._v("repository's settings")]),e._v(".\n ")])])],1)},[]),{RepoConnections:RepoConnections}},!0,!0,{filename:"src/view/admin/repo-connections.vue"}),_reviewable.define(["RepoRow"],["truss"],function(e){"use strict";class RepoRow{constructor(){Vue.set(this,"repository",null)}created(){const e=_ref(this.$store,"child","services","reposManager",this.owner.$owner,"repositories",_.toLower(this.repo.name));e.update({active:!0}),Vue.set(this,"repository",e.value)}get archivedAndInactive(){return this.repo.archived&&"active"!==_get(this,"repository","core","connection")}get readyToConnect(){return _get(this,"repository","ready")&&!_get(this,"repository","connecting")&&this.repo.permissions.admin&&!_get(this,"repository","disabled")&&!this.archivedAndInactive}get prototypeOrMaster(){const e=_.toLower(this.repo.name);return _.toLower(_get(this,"owner","prototypeRepository","name"))===e||_.toLower(this.owner.masterRepositoryName)===e}get tooltip(){return this.repo.permissions.admin?_get(this,"repository","disabled")?"Connections for this repository have been disabled by the system administrator.":this.archivedAndInactive?"Repository is archived.":"":"No admin privileges."}toggleConnection(){this.readyToConnect&&this.repository.toggleConnection(this.repo.private)}}RepoRow.$vueOptions={props:{owner:Object,repo:Object}};return _declareVue("RepoRow",RepoRow,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"repository",class:{busy:_get(e,"repository","connecting")}},[s("div",{staticClass:"inline field"},[s("div",{staticClass:"toggle wrapper"},[s("ui-toggle-input",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:e.tooltip},expression:"{text: tooltip}"}],class:{broken:"broken"===_get(e,"repository","core","connection")},attrs:{checked:_get(e,"repository","isConnected"),disabled:!e.readyToConnect},on:{change:e.toggleConnection}})],1),s("a",{staticClass:"repo name",class:{link:e.repo.permissions.admin},on:{click:function(t){return e.$emit("open-settings")}}},[e._v("\n "+e._s(e.repo.name)+"\n ")]),_get(e,"repository","core","connector")&&"person"!==e.owner.type?s("avatar",{attrs:{"user-key":_get(e,"repository","core","connector"),display:"picture,popup","popup-prefix":"Connected by",size:"tiny"}}):e._e(),e.repo.private?s("i",{staticClass:"private icon",attrs:{alt:"private repository"}}):e._e(),e.owner.userIsOwner&&e.prototypeOrMaster?s("i",{staticClass:"master repo icon",attrs:{alt:"prototype/master repository"}}):e._e()],1),_get(e,"repository","error")||_get(e,"repository","core","error")?s("div",{staticClass:"ui red pointing above error label"},[e._v(e._s(_get(e,"repository","error")||_get(e,"repository","core","error")))]):e._e(),_get(e,"repository","openPullRequestsCount")?s("a",{staticClass:"review count link",attrs:{href:"/reviews/"+e.owner.$key+"/"+e.repo.name}},[e._v("\n "+e._s(e.repository.openPullRequestsCount)+"\n open review"+e._s(1===e.repository.openPullRequestsCount?"":"s")+"\n ")]):e._e()])},staticRenderFns:[],functional:!1},{scopeId:"data-v-7806adca"}),{RepoRow:RepoRow}},!0,!0,{filename:"src/view/admin/repo-row.vue"}),_reviewable.define(["ApproveButtonOutputSettings"],["truss","Guide"],function(e,t){"use strict";class ApproveButtonOutputSettings{constructor(){Vue.set(this,"tributeOptions",void 0)}created(){Vue.set(this,"tributeOptions",{collection:[{trigger:":",values:this.completeEmoji,selectTemplate:({original:e})=>`:${e.label}:`,requireLeadingSpace:!0,slotName:"emoji",menuClass:"ui person completions vertical menu emoji"}],lookup:"searchTerm",selectClass:"active",allowSpaces:!0})}completeEmoji(e,t){e||(e="lgtm");const s=this.$store.services.completions;this.$when(()=>s.emojis.list).then(i=>t(s.find(i,e)))}}ApproveButtonOutputSettings.$vueOptions={props:{repoSetting:{Object:Object,required:!0}}};return _declareVue("ApproveButtonOutputSettings",ApproveButtonOutputSettings,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"inline field"},[s("label",[e._v('"Approve" button output')]),s("tribute",{staticClass:"lgtm inline-block",staticStyle:{"vertical-align":"middle"},attrs:{options:e.tributeOptions},scopedSlots:e._u([{key:"emoji",fn:function(e){var t=e.item,i=e.query;return[s("a",{staticClass:"item"},[s("img",{attrs:{src:t.imageUrl}}),s("span",{directives:[{name:"highlight-match",rawName:"v-highlight-match:highlight",value:{item:t.label,query:i},expression:"{item: item.label, query}",arg:"highlight"}]})])]}}])},[s("template",{slot:"editor"},[s("textarea",{directives:[{name:"text-model",rawName:"v-text-model",value:e.repoSetting.lgtmText,expression:"repoSetting.lgtmText"}],attrs:{spellcheck:"false"}})])],2)],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-3c1f69ce"}),_declareGuides("ApproveButtonOutputSettings","data-v-3c1f69ce",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".lgtm[data-v-3c1f69ce]",onboarding:"setLgtmText",highlight:"bracket"}},[s("p",[e._v("\n Set the "),s("em",[e._v("comment text")]),e._v(" when a reviewer "),s("em",[e._v("clicks the LGTM button")]
1),e._v(" on the review's\n top-level discussion. This can be an emoji or any other text; an emoji will replace the\n button's label.\n ")]),e._v(" "),s("p",[e._v("\n If the text is "),s("em",[s("kbd",[e._v("none")])]),e._v(" then the LGTM button "),s("em",[e._v("won't be shown at all")]),e._v(".\n ")])])],1)},[]),{ApproveButtonOutputSettings:ApproveButtonOutputSettings}},!0,!0,{filename:"src/view/admin/repo-settings/approve-button-output-settings.vue"}),_reviewable.define(["BadgeSettings"],["truss","Guide"],function(e,t){"use strict";class BadgeSettings{constructor(){Vue.set(this,"locationOptions",[{value:"top"},{value:"bottom"}]),Vue.set(this,"conditionOptions",[{value:"accessed",label:"visited"},{value:"published",label:"started"},{value:"requested",label:"requested"}])}created(){this.$observe(()=>_get(this,"repoSetting","reviewableBadge"),()=>{"none"===_get(this,"repoSetting","reviewableBadge")&&Vue.delete(this.repoSetting,"badgeCondition")})}get repoSetting(){return this.repoSettings.current}get badgeLocation(){return _.find(this.locationOptions,{value:this.repoSetting.badgePullRequestLocation})}set badgeLocation(e){_get(e,"value")&&Vue.set(this.repoSetting,"badgePullRequestLocation",e.value)}get badgeConditionOn(){return!(!this.repoSetting.badgeCondition||"none"===this.repoSetting.reviewableBadge)}set badgeConditionOn(e){"none"!==this.repoSetting.reviewableBadge&&(e&&!this.repoSetting.badgeCondition&&Vue.set(this.repoSetting,"badgeCondition","published"),e||Vue.delete(this.repoSetting,"badgeCondition"))}get badgeCondition(){if("none"!==this.repoSetting.reviewableBadge)return _.find(this.conditionOptions,{value:this.repoSetting.badgeCondition})}set badgeCondition(e){e&&"none"!==this.repoSetting.reviewableBadge&&Vue.set(this.repoSetting,"badgeCondition",e.value)}activateBadgeCondition(){this.repoSettings.badgeConditionAllowed&&Vue.set(this,"badgeConditionOn",!0)}}BadgeSettings.$vueOptions={props:{repoSettings:{Object:Object,required:!0}}};return _declareVue("BadgeSettings",BadgeSettings,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"inline field"},[s("label",{staticClass:"main"},[e._v("Reviewable badge")]),s("div",{staticClass:"main group"},[s("div",{staticClass:"ui grouped badge placement inline fields"},[s("div",{staticClass:"adjusted field"},[s("ui-radio-input",{attrs:{value:"pullRequest"},model:{value:e.repoSetting.reviewableBadge,callback:function(t){e.$set(e.repoSetting,"reviewableBadge",t)},expression:"repoSetting.reviewableBadge"}},[e._v("\n At \n "),s("multiselect",{staticClass:"location selector",attrs:{options:e.locationOptions,"track-by":"value",value:"value",label:"value",disabled:"pullRequest"!==e.repoSetting.reviewableBadge,searchable:!1,"show-labels":!1},nativeOn:{click:function(e){e.preventDefault()}},model:{value:e.badgeLocation,callback:function(t){e.badgeLocation=t},expression:"badgeLocation"}}),e._v("\n  of PR description\n ")],1)],1),s("div",{staticClass:"comment location field",class:{adjusted:"organization"===e.repoSettings.owner.type}},[s("ui-radio-input",{attrs:{value:"comment"},model:{value:e.repoSetting.reviewableBadge,callback:function(t){e.$set(e.repoSetting,"reviewableBadge",t)},expression:"repoSetting.reviewableBadge"}},[e._v("\n In PR comment\n "),"organization"===e.repoSettings.owner.type?s("span",[e._v("\n by \n "),s("div",{staticClass:"ui input"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.repoSettings.commentBadgeUsername,expression:"repoSettings.commentBadgeUsername"}],attrs:{type:"text",placeholder:"username"},domProps:{value:e.repoSettings.commentBadgeUsername},on:{click:function(t){e.repoSetting.reviewableBadge="comment"},input:function(t){t.target.composing||e.$set(e.repoSettings,"commentBadgeUsername",t.target.value)}}})])]):e._e()])],1),s("div",{staticClass:"field"},[s("ui-radio-input",{attrs:{value:"none",disabled:!e.repoSettings.reviewableBadgeNoneAllowed},model:{value:e.repoSetting.reviewableBadge,callback:function(t){e.$set(e.repoSetting,"reviewableBadge",t)},expression:"repoSetting.reviewableBadge"}},[e._v("\n None\n ")])],1)]),s("div",{staticClass:"badge condition field"},[s("ui-checkbox-input",{attrs:{disabled:!e.repoSettings.badgeConditionAllowed},model:{value:e.badgeConditionOn,callback:function(t){e.badgeConditionOn=t},expression:"badgeConditionOn"}},[e._v("\n but only if the review has been\n ")]),e._v("\n  \n "),s("multiselect",{staticClass:"condition selector",attrs:{options:e.conditionOptions,"track-by":"value",value:"value",label:"label",disabled:!e.badgeConditionOn||!e.repoSettings.badgeConditionAllowed,searchable:!1,"show-labels":!1,placeholder:"started"},nativeOn:{click:function(t){return e.activateBadgeCondition.apply(null,arguments)}},model:{value:e.badgeCondition,callback:function(t){e.badgeCondition=t},expression:"badgeCondition"}}),e._v("\n  \n "),e._m(0)],1)])])},staticRenderFns:[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("span",{staticClass:"condition note"},[e._v("\n (defaults to "),s("i",[e._v("only if started")]),e._v(" when the repository isn't connected)\n ")])}],functional:!1},{scopeId:"data-v-14758d70"}),_declareGuides("BadgeSettings","data-v-14758d70",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".main.group[data-v-14758d70]",onboarding:"setBadgePlacement",highlight:"bracket"}},[s("p",[e._v("\n Select "),s("em",[e._v("where the Reviewable badge is inserted")]),e._v(" in the pull request on GitHub:\n ")]),e._v(" "),s("dl",{staticClass:"wide-80"},[s("dt",[s("em",[e._v("Description")])]),s("dd",[e._v("At the top or bottom of the pull request's description.")]),e._v(" "),s("dt",[s("em",[e._v("Comment")])]),s("dd",[e._v("In a new pull request comment. Optionally specify who should be\n the comment's author (
1organization members only), otherwise default to repository connector\n or review visitor.")]),e._v(" "),s("dt",[s("em",[e._v("None")])]),s("dd",[e._v("No badges at all (paid accounts only).")])]),e._v(" "),s("p",[e._v("\n You can also "),s("em",[e._v("delay inserting the badge")]),e._v(' until the review has been visited,\n started (first round published) or requested using the "but only ifâ¦" checkbox.\n This will be applied lazily, as reviews are visited or updated.\n ')]),e._v(" "),s("p",[e._v("\n Changes are retroactive except that an existing description badge won't be moved to a comment,\n but will be applied lazily as reviews are visited.\n ")])])],1)},[]),{BadgeSettings:BadgeSettings}},!0,!0,{filename:"src/view/admin/repo-settings/badge-settings.vue"}),_reviewable.define(["CodeCoverageSettings"],["truss","Guide"],function(e,t){"use strict";class CodeCoverageSettings{constructor(){Vue.set(this,"headerName",void 0),Vue.set(this,"headerValue",void 0)}created(){_.forEach(_get(this,"repoSetting","coverage","headers"),(e,t)=>(Vue.set(this,"headerName",t),Vue.set(this,"headerValue",e),!1)),this.$observe(()=>[this.headerName,this.headerValue],()=>{this.headerValue?_.set(this.repoSetting,"coverage.headers",{[this.headerName||"Authorization"]:this.headerValue}):_get(this,"repoSetting","coverage","headers")&&Vue.delete(this.repoSetting.coverage,"headers")})}setToCodecov(){_.set(this.repoSetting,"coverage.urlTemplate","https://api.codecov.io/api/v2/github/{{owner}}/repos/{{repo}}/commits/{{commitSha}}")}}CodeCoverageSettings.$vueOptions={props:{repoSetting:{Object:Object,required:!0},headersAllowed:Boolean}};return _declareVue("CodeCoverageSettings",CodeCoverageSettings,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"inline field"},[s("label",{staticClass:"main"},[e._v("\n Code coverage\n "),s("span",{staticClass:"ui basic circular mini codecov button",on:{click:e.setToCodecov}},[e._v("\n Set to Codecov\n ")])]),s("div",{staticClass:"main group"},[s("label",[e._v("Report URL template:")]),s("div",{staticClass:"ui url template input"},[s("input",{directives:[{name:"text-model",rawName:"v-text-model",value:_get(e,"repoSetting","coverage","urlTemplate"),expression:"~repoSetting.coverage.urlTemplate"}],attrs:{type:"text"}})]),s("label",[e._v("Header:")]),s("div",{staticClass:"header name field",class:{disabled:!e.headersAllowed}},[s("input",{directives:[{name:"text-model",rawName:"v-text-model",value:e.headerName,expression:"headerName"}],attrs:{type:"text",disabled:!e.headersAllowed,placeholder:"Authorization"}})]),s("div",{staticClass:"header value field",class:{disabled:!e.headersAllowed}},[s("input",{directives:[{name:"text-model",rawName:"v-text-model",value:e.headerValue,expression:"headerValue"}],attrs:{type:"text",disabled:!e.headersAllowed,placeholder:"<token>"}})])])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-6ce61aa2"}),_declareGuides("CodeCoverageSettings","data-v-6ce61aa2",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".codecov.button[data-v-6ce61aa2]",onboarding:"setToCodecov"}},[s("p",[e._v("\n Sets the report URL template to "),s("em",[e._v("fetch code coverage reports")]),e._v(" from\n "),s("em",[s("a",{staticClass:"link",attrs:{href:"https://codecov.io"}},[e._v("Codecov")])]),e._v(". If you're using Codecov on\n private repos you'll also need to\n "),s("a",{staticClass:"link",attrs:{href:"https://docs.codecov.com/reference/authorization"}},[e._v("generate an access token")]),e._v("\n in Codecov and paste it into the Authorization header value field.\n ")]),e._v(" "),s("p",[e._v("\n If you're using a "),s("em",[e._v("self-hosted")]),e._v(" instance of Codecov Enterprise, please\n "),s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/admincenter#code-coverage"}},[e._v("see the docs")]),e._v("\n for configuration instructions.\n ")])]),e._v(" "),s("guide",{attrs:{for:".main.group[data-v-6ce61aa2]",onboarding:"connectedCodeCoverage",highlight:"bracket"}}
1,[s("p",[e._v("\n Configures Reviewable to fetch "),s("em",[e._v("code coverage reports")]),e._v(" from an external source, so that\n "),s("em",[e._v("diffs")]),e._v(" can be annotated with "),s("em",[e._v("coverage levels")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n You need to set a "),s("em",[e._v("URL template")]),e._v(" that can be instantiated to fetch a report for a given\n commit SHA. In private repositories, you can also optionally specify a "),s("em",[e._v("header")]),e._v(" to\n include for authorizing access to "),s("em",[e._v("private reports")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n Please\n "),s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/admincenter#code-coverage"}},[e._v("see the docs")]),e._v("\n for more details.\n ")])])],1)},[]),{CodeCoverageSettings:CodeCoverageSettings}},!0,!0,{filename:"src/view/admin/repo-settings/code-coverage-settings.vue"}),_reviewable.define(["CompletionConditionSettings"],["truss","Guide"],function(e,t){"use strict";class CompletionConditionSettings{constructor(){}get prNumberOnly(){return!!this.repoSettings.$owner&&!!this.repoSettings.$repo}}CompletionConditionSettings.$vueOptions={props:{repoSettings:{type:Object,required:!0}}};return _declareVue("CompletionConditionSettings",CompletionConditionSettings,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui dimmable completion condition form",class:{dimmed:!e.repoSettings.completionInitialized,warning:e.repoSettings.completionConditionRequiresUpgrade&&e.repoSettings.conditionCode}},[e.repoSettings.completionConditionRequiresUpgrade?s("div",{staticClass:"ui message",class:{warning:e.repoSettings.conditionCode}},[s("div",{staticClass:"content"},[s("i",{staticClass:"big icon",class:e.repoSettings.conditionCode?"yellow warning sign":"meh face"}),e._v("\n Custom conditions for private repositories are not included with your plan,\n and won't be executed until you upgrade.\n ")])]):e._e(),e._m(0),s("div",{staticClass:"ui two fields"},[s("div",{staticClass:"ui condition field"},[e._m(1),s("label",[e._v("Condition function (dependencies: "+e._s(e.repoSettings.dependencies)+")")]),s("code-editor",{directives:[{name:"text-model",rawName:"v-text-model",value:e.repoSettings.conditionCode,expression:"repoSettings.conditionCode"}],staticClass:"editor wrapper",attrs:{"no-autosize":"","indent-string":" ",language:"javascript","line-numbers":!0}})],1),s("div",{staticClass:"state field"},[s("label",[e._v("\n Review state\n "),s("form",{staticClass:"ui state fetcher inline field",on:{submit:function(t){return t.preventDefault(),e.repoSettings.loadCompletionInfo()}}},[e._v("\n PR "),e.prNumberOnly?s("span",[e._v("#")]):e._e(),s("span",{staticClass:"ui mini action input",class:{number:e.prNumberOnly}},[s("input",{directives:[{name:"text-model",rawName:"v-text-model",value:e.repoSettings.completionInfoPrNumber,expression:"repoSettings.completionInfoPrNumber"}],attrs:{type:"text",placeholder:e.prNumberOnly?"":"owner/repo#pr or URL"}}),s("span",{staticClass:"ui small icon button",on:{click:function(t){return e.repoSettings.loadCompletionInfo()}}},[s("i",{staticClass:"pointing down icon"})])])])]),s("code-editor",{directives:[{name:"text-model",rawName:"v-text-model",value:e.repoSettings.completionInfo,expression:"repoSettings.completionInfo"}],staticClass:"editor wrapper",attrs:{"no-autosize":"","indent-string":" ",language:"json","line-numbers":!0}})],1)]),s("div",{staticClass:"ui result field"},[s("label",[e._v("\n Evaluation result "),s("i",{directives:[{name:"show",rawName:"v-show",value:e.repoSettings.evaluating,expression:"repoSettings.evaluating"}],staticClass:"loading spinner icon"})]),s("pre",{staticClass:"monospace output",class:{error:_get(e,"repoSettings","evaluationOutput","error")},domProps:{textContent:e._s(_get(e,"repoSettings","evaluationOutput","error")||_get(e,"repoSettings","evaluationOutput","result"))}},[e._v(" ")])])])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ui simple inverted dimmer"},[t("div",{staticClass:"ui loader"})])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui condition examples"},[s("a",{staticClass:"link",attrs:{href:"https://github.com/Reviewable/Reviewable/tree/master/examples/conditions",target:"_blank"}},[e._v("Examples "),s("i",{staticClass:"external url icon"})])])}],functional:!1},{scopeId:"data-v-70c35b10"}),_declareGuides("CompletionConditionSettings","data-v-70c35b10",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".condition.field .editor[data-v-70c35b10]",onboarding:"editedConditionCode",highlight:"bracket",position:"right"}},[s("p",[e._v("\n Edit the "),s("em",[e._v("custom code")]),e._v(" that determines whether a "),s("em",[e._v("review is complete")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n You can access the current "),s("em",[e._v("state of the review")]),e._v(" via the predefined\n "),s("em",[s("code",[e._v("review")]),e._v(" variable")]),e._v(', whose contents will look similar to the "review state"\n shown on the right. You must '),s("em",[e._v("return an object")]),e._v(" with a "),s("em",[s("code",[e._v("completed")]),e._v("\n boolean")]),e._v(" and optionally a "),s("em",[s("code",[e._v("description")]),e._v(" string")]),e._v(" and a\n "),s("code",[e._v("debug")]),e._v(" value.\n ")]),e._v(" "),s("p",[e._v("\n The code will be executed in an isolated "),s("em",[e._v("NodeJS")]),e._v(" environment, with a recent 4.x\n version of the "),s("a",{staticClass:"link",attrs:{target:"_blank",href:"https://lodash.com/"}},[e._v("lodash")]),e._v(" module\n available via "),s("code",[e._v("_")]),e._v(". You cannot require any other modules. Each invocation must\n return a result "),s("em",[e._v("within 3 seconds")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n For testing, your co
1de will be "),s("em",[e._v("continuously evaluated")]),e._v(" against the review state on the\n right, and the "),s("em",[e._v("results shown below")]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".state.field .editor[data-v-70c35b10]",onboarding:"editedCompletionInfo",highlight:"bracket",position:"left"}},[s("p",[e._v("\n Edit the "),s("em",[e._v("review state")]),e._v(" used for "),s("em",[e._v("testing")]),e._v(" your condition code. The initial\n state is that of the current review.\n ")]),e._v(" "),s("p",[e._v("\n For an annotated overview of the structure of this data please "),s("em",[s("a",{staticClass:"link",attrs:{target:"_blank",href:"https://docs.reviewable.io/admincenter#review-state-input"}},[e._v("see the\n user guide")])]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".state.fetcher[data-v-70c35b10]",onboarding:"loadedCompletionInfo",highlight:"bracket",position:"left"}},[s("p",[s("em",[e._v("Load")]),e._v(" the review state of a given "),s("em",[e._v("pull request")]),e._v(" in this repository.\n ")]),e._v(" "),s("p",[e._v("\n This only works if a review has already been created for the given pull request. It will\n replace the contents of the review state editor.\n ")])]),e._v(" "),s("guide",{attrs:{for:".result.field[data-v-70c35b10]",onboarding:"sawCompletionTestResult",highlight:"bracket",position:"top"}},[s("p",[e._v("\n The result of "),s("em",[e._v("running your condition code")]),e._v(" on the review state object. "),s("em",[e._v("Updated\n continuously")]),e._v(". Should look like:\n ")]),e._v(" "),s("pre",[e._v("{\n completed: false,\n description: 'almost done',\n debug: {foo: 'bar'}\n}")])])],1)},[]),{CompletionConditionSettings:CompletionConditionSettings}},!0,!0,{filename:"src/view/admin/repo-settings/completion-condition-settings.vue"}),_reviewable.define(["DefaultReviewOverlapStrategySettings"],["truss","Guide"],function(e,t){"use strict";const s={defer:{value:"defer",label:"Defer to user default",text:"leave the strategy up to each user's preference."},unclaimed:{value:"unclaimed",label:"Skip files claimed by others",text:"divide work by skipping files reviewed by someone else at an earlier revision."},unreviewed:{value:"unreviewed",label:"Review any unreviewed files",text:"combine efforts and review any files that need reviewing."},personallyUnreviewed:{value:"personallyUnreviewed",label:"Review all files personally",text:"ensure that you review every file yourself, ignoring other reviewers."}};class DefaultReviewOverlapStrategySettings{constructor(){Vue.set(this,"reviewOverlapStrategies",[s.defer,s.unclaimed,s.unreviewed,s.personallyUnreviewed])}get reviewOverlapStrategy(){return s[this.repoSetting.reviewOverlapStrategy||"defer"]}set reviewOverlapStrategy(e){e&&Vue.set(this.repoSetting,"reviewOverlapStrategy","defer"===e.value?null:e.value)}}DefaultReviewOverlapStrategySettings.$vueOptions={props:{repoSetting:{Object:Object,required:!0}}};return _declareVue("DefaultReviewOverlapStrategySettings",DefaultReviewOverlapStrategySettings,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"inline field"},[s("label",[e._v("Default review overlap strategy")]),s("multiselect",{staticClass:"review overlap selection",attrs:{"track-by":"value",value:"value",label:"label",options:e.reviewOverlapStrategies,searchable:!1,"show-labels":!1},scopedSlots:e._u([{key:"option",fn:function(t){var i=t.option;return[s("span",{staticClass:"option"},[s("b",[e._v(e._s(i.label))]),e._v(":\n "+e._s(i.text)+"\n ")])]}}]),model:{value:e.reviewOverlapStrategy,callback:function(t){e.reviewOverlapStrategy=t},expression:"reviewOverlapStrategy"}})],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-75165665"}),_declareGuides("DefaultReviewOverlapStrategySettings","data-v-75165665",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".review.overlap.selection[data-v-75165665]",onboarding:"selectedDefaultReviewOverlapStrategy",highlight:"bracket"}},[s("p",[e._v("\n Select the default "),s("em",[e._v("review overlap strategy")]),e._v(" for this repository. Your choice will\n affect which files are presented for review to a user, based on who else has already reviewed\n them.\n ")]),e._v(" "),s("p",[e._v("\n This setting can be overridden by anyone, but only for themselves.\n ")])])],1)},[]),{DefaultReviewOverlapStrategySettings:DefaultReviewOverlapStrategySettings}},!0,!0,{filename:"src/view/admin/repo-settings/default-review-overlap-strategy-settings.vue"}),_reviewable.define(["DefaultReviewStyleSettings"],["truss","Guide"],function(e,t){"use strict";const s={combinedCommits:{value:"combinedCommits",label:"Combine commits for review",text:"of the overall amalgamated changes proposed for\n merging; not every commit may be accessible for diffing."},onePerCommit:{value:"onePerCommit",label:"Review each commit separately",text:"even if the changes were overwritten by a later\n commit;
1 recommended only if commits are carefully organized."}};class DefaultReviewStyleSettings{constructor(){Vue.set(this,"reviewStyles",[s.combinedCommits,s.onePerCommit])}get reviewStyle(){return s[this.repoSetting.revisionSplitStrategy]}set reviewStyle(e){e&&Vue.set(this.repoSetting,"revisionSplitStrategy",e.value)}}DefaultReviewStyleSettings.$vueOptions={props:{repoSetting:{Object:Object,required:!0}}};return _declareVue("DefaultReviewStyleSettings",DefaultReviewStyleSettings,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"inline field"},[s("label",[e._v("Default review style")]),s("multiselect",{staticClass:"review style selection",attrs:{"track-by":"value",value:"value",label:"label",options:e.reviewStyles,searchable:!1,"show-labels":!1},scopedSlots:e._u([{key:"option",fn:function(t){var i=t.option;return[s("span",{staticClass:"option"},[s("b",[e._v(e._s(i.label))]),e._v("\n "+e._s(i.text)+"\n ")])]}}]),model:{value:e.reviewStyle,callback:function(t){e.reviewStyle=t},expression:"reviewStyle"}})],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-6472afed"}),_declareGuides("DefaultReviewStyleSettings","data-v-6472afed",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".review.style.selection[data-v-6472afed]",onboarding:"selectedDefaultReviewStyle",highlight:"bracket"}},[s("p",[e._v("\n Select the default "),s("em",[e._v("review style")]),e._v(" for this repository. Your choice will affect how\n commits are grouped into revisions, and the suggested sequence of diffs to review.\n ")]),e._v(" "),s("p",[e._v("\n This setting can be overridden for a review by anyone with push permissions.\n ")])])],1)},[]),{DefaultReviewStyleSettings:DefaultReviewStyleSettings}},!0,!0,{filename:"src/view/admin/repo-settings/default-review-style-settings.vue"}),_reviewable.define(["DiscussionDismissalAuthoritySettings"],["truss","Guide"],function(e,t){"use strict";class DiscussionDismissalAuthoritySettings{constructor(){}}DiscussionDismissalAuthoritySettings.$vueOptions={props:{repoSetting:{Object:Object,required:!0}}};return _declareVue("DiscussionDismissalAuthoritySettings",DiscussionDismissalAuthoritySettings,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"inline field"},[s("label",[e._v("Discussion dismissal authority")]),s("div",{staticClass:"ui grouped discussion dismissal inline fields"},[s("div",{staticClass:"field"},[s("ui-radio-input",{attrs:{value:"push"},model:{value:e.repoSetting.discussionDismissalRestriction,callback:function(t){e.$set(e.repoSetting,"discussionDismissalRestriction",t)},expression:"repoSetting.discussionDismissalRestriction"}},[e._v("\n Write permission\n ")])],1),s("div",{staticClass:"field"},[s("ui-radio-input",{attrs:{value:"maintain"},model:{value:e.repoSetting.discussionDismissalRestriction,callback:function(t){e.$set(e.repoSetting,"discussionDismissalRestriction",t)},expression:"repoSetting.discussionDismissalRestriction"}},[e._v("\n Maintain permission\n ")])],1),s("div",{staticClass:"field"},[s("ui-radio-input",{attrs:{value:"admin"},model:{value:e.repoSetting.discussionDismissalRestriction,callback:function(t){e.$set(e.repoSetting,"discussionDismissalRestriction",t)},expression:"repoSetting.discussionDismissalRestriction"}},[e._v("\n Admin permission\n ")])],1)])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-2b3d7d2c"}),_declareGuides("DiscussionDismissalAuthoritySettings","data-v-2b3d7d2c",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".discussion.dismissal[data-v-2b3d7d2c]",onboarding:"setDiscussionDismissalRestriction",highlight:"bracket"}},[s("p",[e._v("\n Set the "),s("em",[e._v("permission level")]),e._v(" required to "),s("em",[e._v("dismiss participants")]),e._v(' from a discussion.\n Only users with this permission level or higher for the pull request\'s repository will see the\n "dismiss" link.\n ')])])],1)},[]),{DiscussionDismissalAuthoritySettings:DiscussionDismissalAuthoritySettings}},!0,!0,{filename:"src/view/admin/repo-settings/discussion-dismissal-authority-settings.vue"}),_reviewable.define(["GithubReviewStatusSyncSettings"],["truss","Guide"],function(e,t){"use strict";class GithubReviewStatusSyncSettings{constructor(){}}GithubReviewStatusSyncSettings.$vueOptions={props:{repoSetting:{Object:Object,required:!0}}};return _declareVue("GithubReviewStatusSyncSettings",GithubReviewStatusSyncSettings,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"inline field"},[s("label",[e._v("Review status in GitHub PR")]),s("div",{staticClass:"ui grouped github status inline fields"},[s("div",{staticClass:"field"},[s("ui-radio-input",{attrs:{value:"always"},model:{value:e.repoSetting.gitHubStatusUpdates,callback:function(t){e.$set(e.repoSetting,"gitHubStatusUpdates",t)},expression:"repoSetting.gitHubStatusUpdates"}},[e._v("\n On\n ")])],1),s("div",{staticClass:"field"},[s("ui-radio-input",{attrs:{value:"accessed"},model:{value:e.repoSetting.gitHubStatusUpdates,callback:function(t){e.$set(e.repoSetting,"gitHubStatusUpdates",t)},expression:"repoSetting.gitHubStatusUpdates"}},[e._v("\n On for visited reviews only\n ")])],1),s("div",{staticClass:"field"},[s("ui-radio-input",{attrs:{value:"never"},model:{value:e.repoSetting.gitHubStatusUpdates,callback:function(t){e.$set(e.repoSetting,"gitHubStatusUpdates",t)},expression:"repoSetting.gitHubStatusUpdates"}},[e._v("\n Off\n ")])],1)])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-2872cb66"}),_declareGuides("GithubReviewStatusSyncSettings","data-v-2872cb66",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".github.status[data-v-2872cb66]",onboarding:"setGitHubStatusUpdates",highlight:"bracket"}},[s("p",[e._v("\n Set whether to "),s("em",[e._v("post review completion as a status check")]),e._v(' on GitHub. "On for visited\n reviews only" means to only post after a given review has been accessed at least once on\n Reviewable.\n ')]),e._v(" "),s("p",[e._v('\n Note that it\'s not possible to delete status checks, so if you switch to "Off" previously\n posted status checks will remain. Sorry!\n ')])])],1)},[]),{GithubReviewStatusSyncSettings:GithubReviewStatusSyncSettings}},!0,!0,{filename:"src/view/admin/repo-settings/github-review-status-sync-settings.vue"}
1),_reviewable.define(["RepoSettingsOverlay"],["truss","Guide","session","corpsman","router"],function(e,t,s,i,r){"use strict";class RepoSettingsOverlay{constructor(){Vue.set(this,"open",!1),Vue.set(this,"repo",null),Vue.set(this,"repoError",null),Vue.set(this,"repoSettings",null),Vue.set(this,"migrationInfoShown",!1),Vue.set(this,"scrolledToTop",!0),Vue.set(this,"closeRequested",!1)}created(){const e=r.params.repo;if(!e)return;const t=_get(this,"owner","repos",_.toLower(e));(t?Promise.resolve(t):s.hubkit().request(`GET /repos/${this.owner.$owner}/${e}`)).then(e=>{if(this.$destroyed)return;if(!e.permissions.admin)return void this.$emit("close");Vue.set(this,"repo",e),Vue.set(this,"open",!0);const t=this._settingsRef;t.update({active:!0}),Vue.set(this,"repoSettings",t.value),Vue.set(this.repoSettings,"completionInfoPrNumber",r.query.pr)}).catch(e=>{this.$destroyed||(i.capture(e,"fetchRepo"),Vue.set(this,"repoError",e.toString()),Vue.set(this,"open",!0))})}mounted(){this.$el.firstChild.addEventListener("scroll",e=>{Vue.set(this,"scrolledToTop",0===e.target.scrollTop)})}destroyed(){const e=this._settingsRef;e&&(e.update({active:!1}),e.set(null)),r.go({query:_.omit(r.query,"pr")},{replace:!0})}get _settingsRef(){if(!this.repo)return null;const e=_.toLower(this.repo.name);return _ref(this.$store,"child","services","reposManager",this.owner.$owner,"repositories",e,"settings")}get errors(){return _.compact([this.repoError,_get(this,"repoSettings","loadError"),_get(this,"repoSettings","saveError")])}get configuredInUI(){if(_get(this,"repoSettings","ready"))return!this.repoSettings.loadError&&!this.repoSettings.settingsFileEffective&&!this.repoSettings.owner.hasMasterRepository}cancel(){_get(this,"repoSettings","saving")||this.requestClose()}requestClose(){this.closeRequested||(Vue.set(this,"closeRequested",!0),Vue.set(this,"open",!1))}finishClose(){this.closeRequested&&(Vue.set(this,"closeRequested",!1),this.$emit("close"))}save(){_get(this,"repoSettings","ready")&&!_get(this,"repoSettings","saving")&&this.repoSettings.save().then(()=>{_get(this,"repoSettings","saveError")||this.requestClose()})}}RepoSettingsOverlay.$vueOptions={props:{owner:Object}};return _declareVue("RepoSettingsOverlay",RepoSettingsOverlay,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("modal-overlay",{attrs:{closable:"",open:e.open},on:{close:e.cancel,closed:e.finishClose}},[s("div",{staticClass:"repo settings overlay"},[s("div",{staticClass:"settings header"},[s("i",{staticClass:"settings icon"}),s("div",{staticClass:"header content"},[s("div",{staticClass:"header top row"},[s("h2",{staticClass:"ui header"},[e._v("Repository Settings")]),s("animate-fade-in-out",[s("a",{directives:[{name:"show",rawName:"v-show",value:e.configuredInUI&&!e.migrationInfoShown&&e.scrolledToTop,expression:"configuredInUI && !migrationInfoShown && scrolledToTop"}],staticClass:"unobtrusive repo settings migration link",on:{click:function(t){e.migrationInfoShown=!0}}},[e._v("\n Store settings in the repo?\n ")])]),s("div",{staticClass:"settings actions"},[e.configuredInUI?s("settings-buttons",{staticClass:"settings buttons",attrs:{disabled:!_get(e,"repoSettings","ready")||_get(e,"repoSettings","saving"),saving:_get(e,"repoSettings","saving")},on:{apply:e.save,cancel:e.cancel},scopedSlots:e._u([{key:"apply-label",fn:function(){return[e._v("Apply")]},proxy:!0}],null,!1,2250643670)}):s("div",{staticClass:"ui small buttons"},[s("ui-button",{staticClass:"basic cancel",on:{click:e.cancel}},[e._v("\n Cancel\n ")])],1)],1)],1),s("div",{staticClass:"sub header"},[e._v(e._s(e.owner.login)+" / "+e._s(_get(e,"repo","name")))])])]),s("div",{staticClass:"ui dimmable",class:{dimmed:!e.repoError&&!_get(e,"repoSettings","ready")&&!_get(e,"repoSettings","loadError")}},[s("div",{staticClass:"ui simple inverted dimmer"},[s("div",{staticClass:"ui loader"})]),e._l(e.errors,function(t,i){return s("div",{key:i,staticClass:"ui error message"},[s("i",{staticClass:"warning sign icon",attrs:{alt:"error"}}),e._v("\n "+e._s(t)+"\n ")])}),_get(e,"repoSettings","ready")?s("div",[e.configuredInUI?s("div",[s("animate-slide-down",[e.migrationInfoShown?s("div",{staticClass:"ui message"},[e._v("\n Download\n "),s("a",{staticClass:"link",attrs:{href:e.repoSettings.settingsFileUrl,download:"settings.yaml"}},[e._v("\n settings.yaml")]),e.repoSettings.conditionCode.trim()?s("span",[e._v(" and\n "),s("a",{staticClass:"link",attrs:{href:e.repoSettings.conditionFileUrl,download:"completion.js"}},[e._v("completion.js")]),e._v(", add them\n ")]):s("span",[e._v(", add it")]),e._v("\n to the "),s("code",[e._v("/.reviewable")]),e._v(" directory in the repository, and\n "),"active"===_get(e,"repoSettings","core","connection")?s("span",[e._v("\n keep the repository connected")]):s("span",[e._v("connect the repository")]),e._v(".\n ")]):e._e(
1)]),s("h3",{staticClass:"ui dividing header"},[e._v("Basic options")]),s("div",{staticClass:"ui form"},[e.repoSettings.current?s("badge-settings",{attrs:{"repo-settings":e.repoSettings}}):e._e(),e.repoSettings.current?s("default-review-style-settings",{attrs:{"repo-setting":e.repoSettings.current}}):e._e(),e.repoSettings.current?s("default-review-overlap-strategy-settings",{attrs:{"repo-setting":e.repoSettings.current}}):e._e(),e.repoSettings.current?s("approve-button-output-settings",{attrs:{"repo-setting":e.repoSettings.current}}):e._e(),e.repoSettings.current?s("discussion-dismissal-authority-settings",{attrs:{"repo-setting":e.repoSettings.current}}):e._e(),e.repoSettings.current?s("github-review-status-sync-settings",{attrs:{"repo-setting":e.repoSettings.current}}):e._e(),e.repoSettings.current?s("code-coverage-settings",{attrs:{"repo-setting":e.repoSettings.current,"headers-allowed":e.repoSettings.areCodeCoverageFetchHeadersAllowed()}}):e._e()],1),s("h3",{staticClass:"ui dividing header"},[e._v("\n Review completion condition\n "),s("a",{staticClass:"completion condition docs link",attrs:{href:"https://docs.reviewable.io/admincenter#completion-condition",target:"_blank"}},[e._v("Docs "),s("i",{staticClass:"external url icon"})])]),s("completion-condition-settings",{attrs:{"repo-settings":e.repoSettings}}
1)],1):s("div",{staticClass:"ui message"},[s("p",[e._v("\n The settings for this repository are configured by files in the\n "),s("strong",[s("code",[e._v("/.reviewable")])]),e._v(" directory in\n "),s("span",{domProps:{innerHTML:e._s(e.repoSettings.settingsFileSource)}}),e._v(".\n ")]),s("p",[e._v("\n You can debug completion condition code in the\n "),s("a",{staticClass:"link",attrs:{href:"/playground"}},[s("strong",[e._v("Completion Condition Playground")])]),e._v(".\n ")])])]):e._e()],2)])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-e3ec8102"}),_declareGuides("RepoSettingsOverlay","data-v-e3ec8102",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".repo.settings.overlay .settings.buttons[data-v-e3ec8102]",onboarding:"appliedRepositorySettings",position:"left"}},[s("p",[s("em",[e._v("Update the settings")]),e._v(" for the repository.\n ")])]),e._v(" "),s("guide",{attrs:{for:".repo.settings.overlay .settings.buttons[data-v-e3ec8102] .cancel.button",onboarding:"canceledRepositorySettings",position:"top"}},[s("p",[s("em",[e._v("Cancel any changes")]),e._v(" you made to the repository settings.\n ")])])],1)},[]),{RepoSettingsOverlay:RepoSettingsOverlay}},!0,!0,{filename:"src/view/admin/repo-settings/repo-settings-overlay.vue"}),_reviewable.define(["SettingsButtons"],["truss"],function(e){"use strict";class SettingsButtons{constructor(){}}SettingsButtons.$vueOptions={props:{disabled:Boolean,saving:Boolean}};return _declareVue("SettingsButtons",SettingsButtons,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui small buttons"},[s("ui-button",{staticClass:"green dimmable",class:{dimmed:e.saving},attrs:{disabled:e.disabled},on:{click:function(t){return e.$emit("apply")}}},[s("div",{staticClass:"ui simple inverted dimmer"},[s("div",{staticClass:"ui loader"})]),e._t("apply-label",function(){return[e._v("Apply")]})],2),e._t("additional-buttons"),s("div",{staticClass:"or"}),s("ui-button",{staticClass:"basic cancel",attrs:{disabled:e.disabled||e.saving},on:{click:function(t){return e.$emit("cancel")}}},[e._t("cancel-label",function(){return[e._v("Cancel")]})],2)],2)},staticRenderFns:[],functional:!1},{}),{SettingsButtons:SettingsButtons}},!0,!0,{filename:"src/view/admin/settings-buttons.vue"}),_reviewable.define(["SubscriptionSettings"],["truss","Guide","session"],function(e,t,s){"use strict";class SubscriptionSettings{constructor(){Vue.set(this,"teams",void 0),Vue.set(this,"members",void 0),Vue.set(this,"selectedPeriod",null),Vue.set(this,"saving",!1),Vue.set(this,"showPlansPublicOnly",!1),Vue.set(this,"someReposArePrivate",void 0),Vue.set(this,"privateRepoCountFetching",!1),Vue.set(this,"privateRepoCountStale",!1),Vue.set(this,"periodDateFormat",new Intl.DateTimeFormat([],{year:"2-digit",month:"numeric",timeZone:"UTC"}))}initSettings(){Vue.set(this.owner.subscriptionSettings,"contributorTeamId",null),Vue.set(this.owner.subscriptionSettings,"extraOrganizations",_get(this,"owner","subscription","stripe","metadata","extraOrganizations")),Vue.set(this.owner.subscriptionSettings,"subscriberKey",null),Vue.set(this.owner,"subscriptionSettingsChanged",!1)}initSettingsWithMembers(){Vue.set(this.owner.subscriptionSettings,"contributorTeamId",_get(this,"owner","subscription","stripe","metadata","contributorTeamId"));const e=_get(this,"owner","subscription","subscriberKey");e in this.members&&Vue.set(this.owner.subscriptionSettings,"subscriberKey",e)}created(){this.owner.editSubscriptionAllowed&&(this.initSettings(),s.auth.login(["read:org"]).then(()=>{const e=s.hubkit();return Promise.all([e.request("GET /orgs/:org/teams",{org:this.owner.login,ifNotFound:[]}),e.request("GET /orgs/:org/members",{org:this.owner.login,ifNotFound:[]})])}).then(([e,t])=>{Vue.set(this,"teams",_.mapKeys(e,e=>e.id)),Vue.set(this,"members",_.mapKeys(t,e=>`github:${e.id}`)),this.initSettingsWithMembers()}).catch(e=>{Vue.set(this.owner,"subscriptionError",`Failed to load organization info: ${e.message}`)})),"person"!==this.owner.type&&this.$observe(()=>this.$store.services.reposManager.fetchScopes,()=>{this.fetchPrivateRepoCount()},{deep:!0})}async fetchPrivateRepoCount(){if(Vue.set(this,"privateRepoCountStale",!0),!this.privateRepoCountFetching){Vue.set(this,"privateRepoCountFetching",!0);try{let e;do{Vue.set(this,"privateRepoCountStale",!1),e=await s.hubkit().graph("\n query ($owner: String!) {\n repositoryOwner(login: $owner) {\n repositories(privacy: PRIVATE, first: 1) {\n totalCount\n }\n }\n }\n",{variables:{owner:this.owner.login}})}while(this.privateRepoCountStale);Vue.set(this,"someReposArePrivate",e.repositoryOwner.repositories.totalCount>0)}catch(e){Vue.set(this.owner,"subscriptionError",`Failed to load organization info: ${e.message}`)}finally{Vue.set(this,"privateRepoCountFetching",!1)}}}get showPlanSelection(){return!this.owner.coveredBySubscription&&void 0!==this.someReposArePrivate&&(this.someReposArePrivate||this.showPlansPublicOnly)}get downgradeWarning(){return this.owner.editSubscriptionAllowed&&this.owner.ranPrivateCompletionConditionRecently&&"false"!==_get(this,"owner","subscription","stripe","plan","metadata","completionCondition")}get contributorsAdjustable(){return this.owner.editSubscriptionAllowed&&"true"===_get(this,"owner","subscription","stripe","plan","metadata","flexibleQuantity")}
1get businessUpgrade(){const e=_get(this,"owner","subscription","stripe","plan","metadata");return"true"!==_get(e,"slack")||"false"===e.completionCondition}async save(){Vue.set(this,"saving",!0);try{await this.owner.saveSubscriptionSettings()}finally{Vue.set(this,"saving",!1)}}cancel(){this.initSettings(),this.members&&this.initSettingsWithMembers()}get extraOrganizationsValidity(){const e=_.trim(this.owner.subscriptionSettings.extraOrganizations);if(!e)return"empty";const t=_.toLower(this.owner.login);return _.every(e.split(/\s*,\s*/),e=>(e=_.toLower(e))!==t&&_.some(this.$store.services.reposManager.list,t=>_.toLower(t.login)===e&&"organization"===t.type))?"valid":"invalid"}getActiveUsers(e){return _get(this,"owner","subscription","periods",e,"activeUsers")}get contributorUserKeys(){return _.keys(this.getActiveUsers(this.selectedPeriod))}get contributorUsernames(){return _(this.contributorUserKeys).map(e=>_get(this,"$store","services","avatars","users",e,"username")).join(", ")}get periods(){return _(_get(this,"owner","subscription","periods")).keys().sortBy(_.parseInt).value()}get selectablePeriods(){return _.filter(this.periods,e=>this.getActiveUsers(e))}getPeriodLabel(e,t=!0){const s="current"===e?new Date:new Date(_.parseInt(e));let i=this.periodDateFormat.format(s);return t&&"current"===e&&(i+=" so far"),i}get chartData(){return _(this.periods).slice(-12).map(e=>({key:e,value:_get(this,"owner","subscription","periods",e,"activeUsersCount")||0,label:this.getPeriodLabel(e,!1),disabled:!this.getActiveUsers(e)})).value()}get hasContributors(){return _.some(this.chartData,"value")}}SubscriptionSettings.$vueOptions={props:{owner:Object}};return _declareVue("SubscriptionSettings",SubscriptionSettings,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("h3",{staticClass:"ui dividing admin header"},[s("i",{staticClass:"generic card icon"}),s("div",{staticClass:"content"},[e._v("Subscription")]),e.owner.editSubscriptionAllowed?s("settings-buttons",{attrs:{disabled:!e.owner.subscriptionSettingsChanged,saving:e.saving},on:{apply:function(t){return e.save()},cancel:function(t){return e.cancel()}},scopedSlots:e._u([{key:"cancel-label",fn:function(){return[e._v("Revert")]},proxy:!0}],null,!1,2785573362)}):e._e()],1),e.owner.subscriptionError?s("div",{staticClass:"ui error icon message"},[s("i",{staticClass:"frowning face icon",attrs:{alt:""}}),s("div",{staticClass:"content"},[e._v(e._s(e.owner.subscriptionError))])]):e._e(),e.downgradeWarning?s("div",{staticClass:"ui icon message"},[s("i",{staticClass:"info circle icon"}),s("div",{staticClass:"content"},[e._v("\n Private repositories in this organization are using\n features available only on the\n "),"true"===_get(e,"owner","subscription","stripe","plan","metadata","flexibleQuantity")?s("span",[e._v("\n Business plan:\n ")]):s("span",[e._v("\n Business plan and your current legacy plan:\n ")]),e._v("\n custom completion conditions.\n ")])]):e._e(),"person"===e.owner.type?s("div",[s("span",{staticClass:"subscription description"},[e._v("Personal use, no subscription needed.")])]):s("div",[void 0===e.someReposArePrivate?s("span",{staticClass:"subscription description"},[e._v("\n Loadingâ¦\n ")]):e.someReposArePrivate||e.owner.coveredBySubscription?s("span",{staticClass:"subscription description",domProps:{innerHTML:e._s(e.owner.subscriptionDescription)}}):s("span",{staticClass:"subscription description"},[e._v("\n Public repositories only, no subscription needed\n ("),s("a",{staticClass:"link",on:{click:function(t){e.showPlansPublicOnly=!e.showPlansPublicOnly}}},[e._v(e._s(e.showPlansPublicOnly?"hide":"show")+" plans")]),e._v(").\n ")]),e.owner.editSubscriptionAllowed||e.owner.viewPastInvoicesAllowed?s("div",{staticClass:"manage section"},[s("checkout-button",{staticClass:"manage button labeled icon",class:{green:e.owner.editSubscriptionAllowed},attrs:{owner:e.owner,"billing-portal":""}},[e.owner.editSubscriptionAllowed?[s("i",{staticClass:"generic card icon"}),e._v("\n Manage Billing\n ")]:[s("i",{staticClass:"file invoice icon"}),e._v("\n View Past Invoices\n ")]],2),e.contributorsAdjustable?s("checkout-button",{staticClass:"contributors button labeled icon",attrs:{owner:e.owner,upgrade:""}},[s("i",{staticClass:"contributors icon"}
1),e._v("\n Add/Remove Contributors\n ")]):e._e(),e.owner.coveredBySubscription&&e.businessUpgrade?s("div",{staticClass:"business upgrade"},[s("span",["active"===_get(e,"owner","coverage","trialStatus")?s("span",[e._v("\n Keep using\n "),s("a",{staticClass:"link",attrs:{href:"https://www.reviewable.io/pricing"}},[e._v("Business features")]),e._v("\n after your trial ends:\n ")]):s("span",[e._v("\n The Business plan offers\n "),s("a",{staticClass:"link",attrs:{href:"https://www.reviewable.io/pricing"}},[e._v("more features")]),e._v(":\n ")])]),_get(e,"owner","coverage","trialStatus")?s("checkout-button",{staticClass:"upgrade small circular",attrs:{owner:e.owner,upgrade:""}},[e._v("\n Upgrade\n ")]):s("trial-button",{staticClass:"small circular",attrs:{organization:e.owner.$owner}})],1):e._e()],1):e.owner.coveredBySubscription?s("div",{staticClass:"ui info message"},[_get(e,"owner","coverage","extra")?s("span",[e._v("\n This organization is covered by another organization's subscription, which can only be\n managed from that organization.\n ")]):s("span",[e._v("\n Only organization owners and the billing manager can manage this subscription.\n ")])]):e._e(),e.showPlanSelection?s("plan-selection",{attrs:{owner:e.owner}}):e._e(),e.owner.coveredBySubscription&&e.owner.editSubscriptionAllowed?s("div",{staticClass:"subscription settings"},[s("div",{staticClass:"ui form"},[s("div",{staticClass:"subscription manager field"},[s("label",{attrs:{for:"billingManager"}},[e._v("\n Delegate subscription management to\n ")]),s("multiselect",{staticClass:"billing manager",attrs:{options:e.members?Object.keys(e.members):[],disabled:!e.members,placeholder:e.members?"Organization owners only":"Loadingâ¦",searchable:!1,"replicate-root-class":""},on:{input:function(t){e.owner.subscriptionSettingsChanged=!0}},scopedSlots:e._u([{key:"option",fn:function(t){var i=t.option;return[s("avatar",{staticClass:"avatar",attrs:{"github-user":_get(e,"members",i),display:"picture,name,username"}})]}},{key:"singleLabel",fn:function(t){var i=t.option;return[s("avatar",{staticClass:"avatar",attrs:{"github-user":_get(e,"members",i),display:"picture,name,username"}})]}}],null,!1,301236214),model:{value:e.owner.subscriptionSettings.subscriberKey,callback:function(t){e.$set(e.owner.subscriptionSettings,"subscriberKey",t)},expression:"owner.subscriptionSettings.subscriberKey"}})],1),s("div",{staticClass:"contributors constraint field"},[s("label",{attrs:{for:"contributorTeamId"}},[e._v("\n Limit contributors to members of\n ")]),s("multiselect",{attrs:{id:"contributorTeamId",options:e.teams?Object.keys(e.teams):[],"custom-label":function(t){return _get(e,"teams",t,"name")},disabled:!e.teams,placeholder:e.teams?"Select team":"Loadingâ¦"},on:{input:function(t){e.owner.subscriptionSettings.extraOrganizations=null,e.owner.subscriptionSettingsChanged=!0}},scopedSlots:e._u([{key:"option",fn:function(t){var i=t.option;return[e._v("\n "+e._s(e.teams[i].name)+" "),s("span",{staticClass:"details"},[e._v(e._s(e.teams[i].description))])]}}],null,!1,2733543231),model:{value:e.owner.subscriptionSettings.contributorTeamId,callback:function(t){e.$set(e.owner.subscriptionSettings,"contributorTeamId",t)},expression:"owner.subscriptionSettings.contributorTeamId"}})],1),s("div",{staticClass:"extra organizations field"},[s("label",{attrs:{for:"extraOrganizations"}},[e._v("\n Cover reviews in additional organizations\n ")]),s("div",{staticClass:"ui extra organizations labeled input"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.owner.subscriptionSettings.extraOrganizations,expression:"owner.subscriptionSettings.extraOrganizations"}],attrs:{type:"text",id:"extraOrganizations",placeholder:"OrganizationA, OrganizationB, â¦",disabled:!_get(e,"owner","subscription","stripe","plan","metadata","extraOrganizations")},domProps:{value:e.owner.subscriptionSettings.extraOrganizations},on:{input:[function(t){t.target.composing||e.$set(e.owner.subscriptionSettings,"extraOrganizations",t.target.value)},function(t){e.owner.subscriptionSettings.contributorTeamId=null,e.owner.subscriptionSettingsChanged=!0}]}}),"empty"!==e.extraOrganizationsValidity?s("div",{staticClass:"ui corner label",class:"valid"===e.extraOrganizationsValidity?"green":"red"},[s("i",{staticClass:"icon",class:e.extraOrganizationsValidity,attrs:{alt:e.extraOrganizationsValidity+" value"}}
1)]):e._e()])])]),s("h4",{staticClass:"ui header"},[e._v("Contributors history")]),e.hasContributors?s("div",[s("div",{staticClass:"contributors history controls"},[s("bar-chart",{attrs:{data:e.chartData},model:{value:e.selectedPeriod,callback:function(t){e.selectedPeriod=t},expression:"selectedPeriod"}}),s("multiselect",{attrs:{options:e.selectablePeriods,"custom-label":e.getPeriodLabel,placeholder:"Select month to show contributor list"},model:{value:e.selectedPeriod,callback:function(t){e.selectedPeriod=t},expression:"selectedPeriod"}})],1),e.selectedPeriod?s("div",[e.contributorUserKeys.length?s("div",[s("copy-button",{staticClass:"ui bare icon copy button",attrs:{text:e.contributorUsernames}},[e._v("\n copy usernames\n ")]),e._l(e.contributorUserKeys,function(e){return s("div",{key:e},[s("avatar",{staticClass:"avatar",attrs:{"user-key":e,display:"picture,name,username"}})],1)})],2):s("div",{staticClass:"nodata"},[e._v("\n No usage data available for the selected period.\n ")])]):e._e()]):e.chartData.length?s("div",[e._v("\n No contributors recorded in last "+e._s(e.chartData.length)+"\n month"+e._s(1===e.chartData.length?"":"s")+".\n ")]):s("div",[e._v("\n No usage data available.\n ")])]):e._e()],1)])},staticRenderFns:[],functional:!1},{scopeId:"data-v-ded7d004"}),_declareGuides("SubscriptionSettings","data-v-ded7d004",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".admin.center .subscription.settings .contributors.constraint.field[data-v-ded7d004]",onboarding:"constrainedContributors",highlight:"bracket",position:"right"}},[s("p",[e._v("\n Optionally, select a "),s("em",[e._v("team")]),e._v(" in your organization to "),s("em",[e._v("limit contributors")]),e._v(".\n Pull requests created by users who are not members of this team will not be turned into\n reviews, and hence their authors "),s("em",[e._v("won't count")]),e._v(" against your plan's\n "),s("em",[e._v("contributor quota")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n This option is mutually exclusive with the option to cover additional organizations below.\n More details in "),s("a",{staticClass:"link",attrs:{target:"_blank",href:"https://docs.reviewable.io/subscriptions#managing-the-scope-of-your-subscription"}},[e._v("\n the user guide")]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".admin.center .subscription.settings .extra.organizations.field[data-v-ded7d004]",onboarding:"extendedToExtraOrganizations",highlight:"bracket",position:"right"}},[s("p",[e._v("\n Optionally, "),s("em",[e._v("extend")]),e._v(" your subscription's coverage to "),s("em",[e._v("other organizations")]),e._v("\n as well. Distinct contributors will be counted across all reviews in all the\n organizations, so this can save you some money compared to separate plans for each\n organization. Not every plan allows this option, though.\n ")]),e._v(" "),s("p",[e._v("\n This option is mutually exclusive with the option above to limit contributors to a team.\n More details in "),s("a",{staticClass:"link",attrs:{target:"_blank",href:"https://docs.reviewable.io/subscriptions#managing-the-scope-of-your-subscription"}},[e._v("\n the user guide")]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".admin.center .subscription.settings .subscription.manager.field[data-v-ded7d004]",onboarding:"billingManager",highlight:"bracket",position:"right"}},[s("p",[e._v("\n Optionally, "),s("em",[e._v("delegate")]),e._v(" billing administration to another user.\n That user (in addition to the organization's owners) is permitted to\n "),s("em",[e._v("update")]),e._v(" these settings and to "),s("em",[e._v("manage")]),e._v(" the subscription.\n ")])]),e._v(" "),s("guide",{attrs:{for:".manage.button[data-v-ded7d004]",onboarding:"managedSubscription",position:"left"}},[s("p",[s("em",[e._v("Manage")]),e._v(" your "),s("em",[e._v("subscription")]),e._v(" for this organization, upgrade/downgrade plans,\n change payment information, or "),s("em",[e._v("unsubscribe")]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".contributors.button[data-v-ded7d004]",onboarding:"adjustedContributors",position:"right"}},[s("p",[e._v("\n Go straight to the page in the billing portal where you can "),s("em",[e._v("adjust")]),e._v(" the number of\n "),s("em",[e._v("contributors")]),e._v(" covered by your subscription.\n ")]),e._v(" "),s("p",[e._v("\n O
1nly plans priced "),s("em",[e._v("per contributor")]),e._v(" offer this; on a legacy plan you need to\n "),s("em",[e._v("switch plans")]),e._v(" to change your contributor quota.\n ")])])],1)},[]),{SubscriptionSettings:SubscriptionSettings}},!0,!0,{filename:"src/view/admin/subscription-settings.vue"}),_reviewable.define(["TrialButton"],["truss","Guide","shared","corpsman"],function(e,t,s,i){"use strict";class TrialButton{constructor(){Vue.set(this,"trialRequested",!1),Vue.set(this,"trialDurationDays",s.trialDurationDays)}async startTrial(){if(!this.trialRequested){Vue.set(this,"trialRequested",!0);try{await this.$store.queues.requests.send({action:"startTrial",ownerName:this.organization}),this.$emit("trialStarted")}catch(e){i.setCondition("notrial",e.message)}finally{Vue.set(this,"trialRequested",!1)}}}}TrialButton.$vueOptions={props:{organization:String}};return _declareVue("TrialButton",TrialButton,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ui-button",{staticClass:"labeled icon trial",attrs:{disabled:e.trialRequested},on:{click:function(t){return e.startTrial()}}},[s("i",{staticClass:"icon",class:e.trialRequested?"spinner":"free trial"}),e._v("\n Start a "+e._s(e.trialDurationDays)+" day trial\n ")])},staticRenderFns:[],functional:!1},{}),_declareGuides("TrialButton",void 0,function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".trial.button",onboarding:"trialStarted",position:"left"}},[s("p",[s("em",[e._v("Start a free trial")]),e._v(" for this organization.\n ")])])],1)},[]),{TrialButton:TrialButton}},!0,!0,{filename:"src/view/admin/trial-button.vue"}),_reviewable.define(["AnimateBase"],["truss","animator"],function(e,t){"use strict";class AnimateBase{constructor(){this.computeDuration(),Vue.set(this,"firstAnimation",!0)}computeDuration(){if(this.disabled)return 0;let e=t.defaultOptions.duration;if(this.duration)if(/^\d+$/.test(this.duration))e=_.parseInt(this.duration);else{if(!/^[-+*/]=\d+(\.\d+)?$/.test(this.duration))throw new Error("Malformed animation duration attribute: "+this.duration);{const t=parseFloat(this.duration.slice(2));switch(this.duration[0]){case"+":e+=t;break;case"-":e-=t;break;case"*":e*=t;break;case"/":e/=t}}}return e}anime(e,t,s){Vue.set(s,"done",t);const i=s.complete;return Vue.set(s,"complete",e=>{this.$destroyed||(i&&i(e),this.$emit("complete"))}),this.firstAnimation?_.defer(()=>{Vue.set(this,"firstAnimation",!1)}):anime.remove(e),this.$emit("begin"),anime(_.assign({targets:e,delay:this.delay,duration:this.computeDuration(),easing:"easeInOutSine"},s))}}return AnimateBase.$vueOptions={props:{duration:String,appear:Boolean,disabled:Boolean,group:Boolean,delay:{type:[String,Number],default:0}}},_declareVue("AnimateBase",AnimateBase,null,null,{}),{AnimateBase:AnimateBase}},!0,!0,{filename:"src/view/animation/animate-base.vue"}),_reviewable.define(["AnimateFadeInOut"],["truss","AnimateBase"],function(e,t){"use strict";class AnimateFadeInOut extends t{constructor(){super()}enter(e,t){const s=this.opacity||1;this.anime(e,t,{opacity:this.firstAnimation?[0,s]:s})}leave(e,t){this.anime(e,t,{opacity:0})}}AnimateFadeInOut.$vueOptions={props:{opacity:[String,Number]}};return _declareVue("AnimateFadeInOut",AnimateFadeInOut,"AnimateBase",{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.group?"transition-group":"transition",{tag:"component",attrs:{tag:e.group?"span":void 0,name:"fade-in-out",css:!1,appear:e.appear},on:{enter:e.enter,leave:e.leave}},[e._t("default")],2)},staticRenderFns:[],functional:!1},{}),{AnimateFadeInOut:AnimateFadeInOut}},!0,!0,{filename:"src/view/animation/animate-fade-in-out.vue"}),_reviewable.define(["AnimateFadeIn"],["truss","AnimateBase"],function(e,t){"use strict";class AnimateFadeIn extends t{constructor(){super()}enter(e,t){this.anime(e,t,{opacity:[0,this.opacity||1]})}}AnimateFadeIn.$vueOptions={props:{opacity:[String,Number]}};return _declareVue("AnimateFadeIn",AnimateFadeIn,"AnimateBase",{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.group?"transition-group":"transition",{tag:"component",attrs:{tag:e.group?"span":void 0,name:"fade-in",css:!1,appear:e.appear},on:{enter:e.enter}},[e._t("default")],2)},staticRenderFns:[],functional:!1},{}),{AnimateFadeIn:AnimateFadeIn}},!0,!0,{filename:"src/view/animation/animate-fade-in.vue"}),_reviewable.define(["AnimateFlip"],["truss"],function(e){"use strict";class AnimateFlip{}return _declareVue("AnimateFlip",AnimateFlip,null,{render:function(e,t){return(0,t._c)("transition",{attrs:{name:"flip",mode:"out-in",appear:t.props.appear}},[t._t("default")],2)},staticRenderFns:[],functional:!0},{}),{AnimateFlip:AnimateFlip}},!0,!0,{filename:"src/view/animation/animate-flip.vue"}),_reviewable.define(["AnimateReflow"],["truss","animator"],function(e,t){"use strict";const s=[":scope .panel.reflow.animator",":scope .panel.reflow.animator *",".reflow-pending-removal"].join(", ");class AnimateReflow{constructor(){Vue.set(this,"ruler",this.$store.services.ruler),Vue.set(this,"pendingReflowId",void 0),Vue.set(this,"reflowStatus",{inProgress:!1})}mounted(){this.$when(()=>this.firstReflow,{timeout:1e4}).then(()=>{this.animateReflow({snap:!0})},e=>{if("Timeout"!==e.message)throw e}).then(()=>{this.$observe(()=>[this.ruler.windowWidth,this.ruler.flowOffset],()=>{this._markFirstInRowElements(this.$el)},{deep:!0})})}get animeDuration(){return this.duration||t.defaultOptions.duration}_getBoundingClientRectDelta(e,t){return{x:e.x-t.x,y:e.y-t.y,scaleX:e.width/t.width,scaleY:e.height/t.height}}_markFirstInRowElements(e){const t=e.querySelectorAll(`[data-reflow-key]:not(${s})`),i=new Set;if(!t.length)return i;const r=_.map(t,e=>e.offsetTop);_.forEach(t,e=>e.removeAttribute("first-in-row"));let n=r[0];t[0].setAttribute("first-in-row",""),i.add(t[0].dataset.reflowKey);for(let e=1;e<t.length;e++)r[e]!==n&&(t[e].setAttribute("first-in-row",""),i.add(t[e].dataset.reflowKey),n=r[e]);return i}
1_beginReflow({enterTargetState:e,snap:i,globalTransitionsOff:r=!0}={}){const n=this.$el.querySelectorAll(`[data-reflow-key]:not(${s})`),a=_(n).map(e=>({key:e.dataset.reflowKey,el:e,parent:e.parentElement,origin:e.getBoundingClientRect()})).keyBy(e=>e.key).value();r&&(this.$el.classList.add("no-reflow-transitions"),t.disableTransitions(!0)),e(),requestAnimationFrame(()=>{const e=this.$el.querySelectorAll(`[data-reflow-key]:not(${s})`);_.forEach(e,e=>{e.removeAttribute("first-in-row")});const r=new Set(_.difference(e,n)),o=new Set(_.difference(n,e));_.forEach(e,e=>{if(r.has(e)){const t=e.dataset.reflowKey;e.classList.add("reflow-pending-addition"),Vue.set(a,t,{key:t,el:e,added:!0,origin:e.getBoundingClientRect()})}}),_.forEach(a,e=>{o.has(e.el)&&(Vue.set(e.el.style,"position","absolute"),e.el.classList.add("reflow-pending-removal"),e.parent.append(e.el),Vue.set(e,"removed",!0))});const l=this._markFirstInRowElements(this.$el);_.forEach(l,e=>{a[e]&&Vue.set(a[e],"firstInRow",!0)}),_.forEach(a,e=>{Vue.set(e,"deltas",this._getBoundingClientRectDelta(e.origin,e.el.getBoundingClientRect())),e.el.classList.contains("reflow-pending-addition")||Vue.set(e.el.style,"transformOrigin",e.removed||e.added?"":"top left")});const c=_.values(a);anime.remove(_.map(a,"el")),anime(_.assign({targets:_.map(a,"el"),translateX:(e,t)=>{const s=c[t].removed?c[t].deltas.x:0;return[c[t].deltas.x,s]},translateY:(e,t)=>{const s=c[t].removed?c[t].deltas.y:0;return[c[t].deltas.y,s]},scale:(e,t)=>c[t].added?[0,1]:c[t].removed?[1,0]:1,opacity:(e,t)=>c[t].added?[0,1]:c[t].removed?[1,0]:1,duration:i?0:this.animeDuration,easing:t.animeJsEasing,done:()=>{_.defer(()=>{this.reflowStatus.inProgress||(this.$el.classList.remove("no-reflow-transitions"),t.enableTransitions())}),Vue.set(this.reflowStatus,"inProgress",!1),_.forEach(a,e=>{Vue.set(e.el.style,"transformOrigin",""),Vue.set(e.el.style,"transform",""),e.removed&&e.el.remove(),e.added&&e.el.classList.remove("reflow-pending-addition")})}},this.scale?{scaleX:(e,t)=>[c[t].deltas.scaleX,1]}:{},this.scale?{scaleY:(e,t)=>[c[t].deltas.scaleY,1]}:{}))})}animateReflow(e={}){e.enterTargetState||Vue.set(e,"enterTargetState",_.noop),this.pendingReflowId&&(clearTimeout(this.pendingReflowId),Vue.set(this,"pendingReflowId",null)),t.shouldAnimate()||(_access(e,"","enterTargetState","call",[]),Vue.set(e,"snap",!0)),Vue.set(this.reflowStatus,"inProgress",!0),e.delay?Vue.set(this,"pendingReflowId",_.delay(()=>{this._beginReflow(e)},_.isNumber(e.delay)?e.delay:this.animeDuration)):this._beginReflow(e)}}AnimateReflow.$vueOptions={props:{duration:Number,scale:{type:Boolean,default:!1},firstReflow:{type:Boolean,default:!0}},provide:function(){return{animateReflow:this.animateReflow,reflowStatus:this.reflowStatus}}};return _declareVue("AnimateReflow",AnimateReflow,null,{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{staticClass:"panel reflow animator"},[e._t("default")],2)},staticRenderFns:[],functional:!1},{}),{AnimateReflow:AnimateReflow}},!0,!0,{filename:"src/view/animation/animate-reflow.vue"}),_reviewable.define(["AnimateSlideDownGroup"],["truss","AnimateBase"],function(e,t){"use strict";class AnimateSlideDownGroup extends t{constructor(){super()}getDuration(e){const t=super.computeDuration();return t&&_.clamp(t*e.offsetHeight/200,200,400)}enter(e,t){const s=this.getDuration(e);this.anime(e.firstChild,t,{translateY:e.firstChild.style.transform.match(/translateY\((?!0+\D*\))(.*?)\)/)?0:["-100%",0],duration:s}),Vue.set(e.style,"overflow","hidden"),this.anime(e,t,{height:[0,e.offsetHeight],duration:s,complete:()=>{Vue.set(e.style,"overflow",""),Vue.set(e.style,"height","")}})}leave(e,t){const s=this.getDuration(e);this.anime(e.firstChild,t,{translateY:"-100%",duration:s}),Vue.set(e.style,"overflow","hidden"),this.anime(e,t,{height:0,duration:s,complete:()=>{Vue.set(e.style,"overflow",""),Vue.set(e.style,"height","")}})}}return _declareVue("AnimateSlideDownGroup",AnimateSlideDownGroup,"AnimateBase",{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("transition-group",{attrs:{name:"slide-down-group",css:!1,appear:e.appear},on:{enter:e.enter,leave:e.leave,"after-leave":function(t){return e.$emit("after-leave")}}},[e._t("default")],2)},staticRenderFns:[],functional:!1},{}),{AnimateSlideDownGroup:AnimateSlideDownGroup}},!0,!0,{filename:"src/view/animation/animate-slide-down-group.vue"}),_reviewable.define(["AnimateSlideDown"],["truss","AnimateBase"],function(e,t){"use strict";class AnimateSlideDown extends t{constructor(){if(super(),Vue.set(this,"cancelTracker",{visible:!1,
1cancelledFrom:""}),this.group)throw new Error("animate-slide-down doesn't support group animation, please use animate-slide-down-group")}computeDuration(){let e=super.computeDuration();return this.$refs.wrapper&&e&&!this.duration&&(e=_.clamp(e*this.$refs.wrapper.offsetHeight/200,e/2,1.5*e)),e}enter(e,t){Vue.set(this.cancelTracker,"visible",!1),Vue.set(this.cancelTracker,"cancelledFrom",void 0);const s=this.$refs.wrapper.style.height?this.$refs.wrapper.offsetHeight:0;Vue.set(this.$refs.wrapper.style,"height",""),Vue.set(this.$refs.wrapper.children[0],"position","relative");const i=this.$refs.wrapper.offsetHeight;Vue.set(this.$refs.wrapper.style,"overflow","hidden"),Vue.set(this.$refs.wrapper.children[0],"position","");const r=this.anime(this.$refs.wrapper,t,{height:[s,i],complete:()=>{Vue.set(this.$refs.wrapper.style,"height",""),Vue.set(this.$refs.wrapper.style,"overflow","")}});this.anime(e,t,{duration:r.duration-this.delay,translateY:e.style.transform.match(/translateY\([^0]+px\)/)?0:[-i,0],complete:()=>{"cancelled-enter"!==this.cancelTracker.cancelledFrom&&this.$emit("visible",!0)}})}leave(e,t){Vue.set(this.cancelTracker,"visible",!0),Vue.set(this.cancelTracker,"cancelledFrom",void 0);const s=this.$refs.wrapper.offsetHeight;Vue.set(this.$refs.wrapper.style,"overflow","hidden");const i=this.anime(this.$refs.wrapper,t,{height:[s,0],complete:()=>{Vue.set(this.$refs.wrapper.style,"height",""),Vue.set(this.$refs.wrapper.style,"overflow","")}});this.anime(e,t,{duration:i.duration-this.delay,translateY:-s,complete:()=>{"cancelled-leave"!==this.cancelTracker.cancelledFrom&&this.$emit("visible",!1)}})}cancel(){this.$emit("visible",!this.cancelTracker.visible),_.defer(()=>{Vue.set(this.cancelTracker,"cancelledFrom",this.cancelTracker.visible?"cancelled-enter":"cancelled-leave")})}}return _declareVue("AnimateSlideDown",AnimateSlideDown,"AnimateBase",{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{ref:"wrapper"},[s("transition",e._b({attrs:{name:"slide-down",css:!1,appear:e.appear},on:{enter:e.enter,leave:e.leave,"before-leave":function(t){return e.$emit("before-leave")}}},"transition",e.$attrs,!1),[e._t("default")],2)],1)},staticRenderFns:[],functional:!1},{}),{AnimateSlideDown:AnimateSlideDown}},!0,!0,{filename:"src/view/animation/animate-slide-down.vue"}),_reviewable.define(["AnimateSlideUp"],["truss","AnimateBase"],function(e,t){"use strict";class AnimateSlideUp extends t{constructor(){if(super(),this.group)throw new Error("animate-slide-up doesn't support group animation")}computeDuration(){let e=super.computeDuration();return this.$refs.wrapper&&e&&(e=_.clamp(e*this.$refs.wrapper.offsetHeight/200,200,400)),e}enter(e,t){this.$emit("visible",!0),Vue.set(this.$refs.wrapper.style,"height",""),Vue.set(this.$refs.wrapper.style,"overflow","hidden"),this.anime(e,t,{translateY:e.style.translateY?0:["100%",0],complete:()=>{Vue.set(this.$refs.wrapper.style,"height",""),Vue.set(this.$refs.wrapper.style,"overflow","")}})}leave(e,t){Vue.set(this.$refs.wrapper.style,"overflow","hidden"),this.anime(e,t,{translateY:"100%",complete:()=>{this.$emit("visible",!1),Vue.set(this.$refs.wrapper.style,"height",""),Vue.set(this.$refs.wrapper.style,"overflow","")}})}}return _declareVue("AnimateSlideUp",AnimateSlideUp,"AnimateBase",{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{ref:"wrapper"},[s("transition",{attrs:{name:"slide-down",css:!1,appear:e.appear},on:{enter:e.enter,leave:e.leave,"before-leave":function(t){return e.$emit("before-leave")}}},[e._t("default")],2)],1)},staticRenderFns:[],functional:!1},{}
1),{AnimateSlideUp:AnimateSlideUp}},!0,!0,{filename:"src/view/animation/animate-slide-up.vue"}),_reviewable.define(["AnimateSlideX"],["truss","AnimateBase"],function(e,t){"use strict";class AnimateSlideX extends t{computeDuration(){let e=super.computeDuration();return this.$refs.wrapper&&e&&(e=_.clamp(e*this.$refs.wrapper.offsetWidth/200,200,400)),e}enter(e,t){Vue.set(this.$refs.wrapper.style,"overflow","hidden");const s=e.getAttribute("slide-direction")||"right";this.anime(e,t,{translateX:["right"===s?"-100%":"100%",0],complete:()=>{Vue.set(this.$refs.wrapper.style,"overflow","")}})}leave(e,t){Vue.set(this.$refs.wrapper.style,"overflow","hidden");const s=e.getAttribute("slide-direction")||"right";this.anime(e,t,{translateX:"right"===s?"-100%":"100%",complete:()=>{Vue.set(this.$refs.wrapper.style,"overflow","")}})}}return _declareVue("AnimateSlideX",AnimateSlideX,"AnimateBase",{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{ref:"wrapper",staticClass:"relative"},[s("transition",{attrs:{name:"slide-x",css:!1,appear:e.appear},on:{enter:e.enter,leave:e.leave}},[e._t("default")],2)],1)},staticRenderFns:[],functional:!1},{}),{AnimateSlideX:AnimateSlideX}},!0,!0,{filename:"src/view/animation/animate-slide-x.vue"}),_reviewable.define(["AnimateWipeDownGroup"],["truss","AnimateBase"],function(e,t){"use strict";class AnimateWipeDownGroup extends t{constructor(){super()}getDuration(e){return super.computeDuration()&&_.clamp(super.computeDuration()*e.offsetHeight/200,200,400)}enter(e,t){Vue.set(e.style,"overflow","hidden");const s=parseFloat(window.getComputedStyle(e).height);this.anime(e,t,{height:[0,s],duration:this.getDuration(e),complete:()=>{Vue.set(e.style,"overflow",""),Vue.set(e.style,"height","")}})}leave(e,t){Vue.set(e.style,"overflow","hidden"),this.anime(e,t,{height:0,duration:this.getDuration(e),complete:()=>{Vue.set(e.style,"overflow",""),Vue.set(e.style,"height","")}})}}return _declareVue("AnimateWipeDownGroup",AnimateWipeDownGroup,"AnimateBase",{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("transition-group",{attrs:{name:"wipe-down-group",css:!1,appear:e.appear},on:{enter:e.enter,leave:e.leave}},[e._t("default")],2)},staticRenderFns:[],functional:!1},{}),{AnimateWipeDownGroup:AnimateWipeDownGroup}},!0,!0,{filename:"src/view/animation/animate-wipe-down-group.vue"}),_reviewable.define(["AnimateWipeDown"],["truss","AnimateBase"],function(e,t){"use strict";class AnimateWipeDown extends t{constructor(){if(super(),this.group)throw new Error("animate-wipe-down doesn't support group animation, please use animate-wipe-down-group")}computeDuration(){let e=super.computeDuration();return this.$refs.wrapper&&e&&this.clamp&&(e=_.clamp(e*this.$refs.wrapper.offsetHeight/200,200,400)),e}enter(e,t){const s=_.isNil(this.initialHeight)?this.$refs.wrapper.style.height?this.$refs.wrapper.offsetHeight:0:this.initialHeight;Vue.set(this.$refs.wrapper.style,"height","");const i=this.$refs.wrapper.offsetHeight;Vue.set(this.$refs.wrapper.style,"overflow","hidden"),this.anime(this.$refs.wrapper,t,{height:[s,i],complete:()=>{Vue.set(this.$refs.wrapper.style,"height",""),Vue.set(this.$refs.wrapper.style,"overflow","")}})}leave(e,t){Vue.set(this.$refs.wrapper.style,"overflow","hidden"),this.anime(this.$refs.wrapper,t,{height:this.initialHeight||0,complete:()=>{Vue.set(this.$refs.wrapper.style,"height",""),Vue.set(this.$refs.wrapper.style,"overflow","")}})}}AnimateWipeDown.$vueOptions={props:{clamp:{type:Boolean,default:!0},initialHeight:Number}};return _declareVue("AnimateWipeDown",AnimateWipeDown,"AnimateBase",{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{ref:"wrapper"},[s("transition",{attrs:{name:"wipe-down",css:!1,appear:e.appear},on:{enter:e.enter,leave:e.leave}},[e._t("default")],2)],1)},staticRenderFns:[],functional:!1},{}),{AnimateWipeDown:AnimateWipeDown}},!0,!0,{filename:"src/view/animation/animate-wipe-down.vue"}),_reviewable.define(["AnimateWipeRight"],["truss","AnimateBase"],function(e,t){"use strict";class AnimateWipeRight extends t{constructor(){super()}onAppear([e,t]){this.$nextTick().then(()=>this.enter(e,t))}enter(e,t){const s=e.style.width?e.offsetWidth:0;Vue.set(e.style,"width",""),Vue.set(e.style,"overflow","hidden");const i=e.offsetWidth;this.anime(e,t,{width:[s,i],complete:()=>{Vue.set(e.style,"width",""),Vue.set(e.style,"overflow","")}})}leave(e,t){Vue.set(e.style,"overflow","hidden"),this.anime(e,t,{width:[e.offsetWidth,0],complete:()=>Vue.set(e.style,"overflow","")})}}return _declareVue("AnimateWipeRight",AnimateWipeRight,"AnimateBase",{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.group?"transition-group":"transition",{tag:"component",attrs:{tag:e.group?"span":void 0,name:"wipe-right",css:!1,appear:e.appear},on:{enter:e.enter,leave:e.leave,appear:function(t){e.appear&&e.onAppear(arguments)}}},[e._t("default")],2)},staticRenderFns:[],functional:!1},{}),{AnimateWipeRight:AnimateWipeRight}},!0,!0,{filename:"src/view/animation/animate-wipe-right.vue"}),_reviewable.define(["CircuitTrace"],["truss","animator","bus","corpsman","pageControl"],function(e,t,s,i,r){"use strict";function n(e){return new Promise(t=>setTimeout(t,e))}class CircuitTrace{constructor(){Vue.set(this,"path",null),Vue.set(this,"painted",!1),Vue.set(this,"duration",0)}created(){s.trace.react(async({from:e,to:s,duration:h})=>{try{let i;if(Vue.set(this,"painted",!0),({path:this.path,scaleFactor:i}=function(e,t){const s=a(e.element,e.side,8),i=a(t.element,t.side);if(!s||!i)return{};const n=o(s,e.side,23),h=o(i,t.side,15),p={x:(s.x+i.x)/2,y:(s.y+i.y)/2},v=[l(n,e.side),l(h,t.side),c(n,e.side),c(h,t.side),[{x:p.x,y:-1/0},{x:p.x,y:1/0}],[{x:-1/0,y:p.y},{x:1/0,y:p.y}]],m=["M",s,"L",n];if(g=n,f=v[1],!(g.x>=f[0].x&&g.x<=f[1].x&&g.y>=f[0].y&&g.y<=f[1].y)){const e=u(v[0],v[1]);if(e)m.push("L",e);else{const e=_(v).slice(2).findLast(e=>u(e,v[0])&&u(e,v[1]));if(e){const t=u(e,v[0]),s=u(e,v[1]);m.push("L",t,"L",s)}else{const e=_(v).slice(4).maxBy(e=>_(v).slice(0,4).map(t=>u(e,t)).compact().size()-1||null);if(e){const t=u(v[0],e)||u(v[2],e),s=u(v[1],e)||u(v[3],e);m.push("L",t,"L",s)}else{const e=u(v[2],v[3]);if(!e)throw new Error("No route found");m.push("L",e)}}}}var g,f;m.push("L",h,"L",i);const w=_.max(_(r.getViewportDimensions()).pick("width","height").values().value(
1));return{path:_(m).map(e=>_.isString(e)?e:`${e.x} ${e.y}`).join(" "),scaleFactor:_.clamp(d(m),w/1.5,1.5*w)/w}}(e,s)),!this.path)return;const p=t.shouldAnimate();if(p?Vue.set(this,"duration",Math.round(h*i)):s.element.classList.add("highlight"),await n(this.duration||h),Vue.set(this,"painted",!1),Vue.set(this,"duration",0),p){const e=t.defaultOptions.duration/2;s.element.classList.add("highlight","highlighting"),await n(e),s.element.classList.remove("highlight"),await n(e),s.element.classList.remove("highlighting")}else s.element.classList.remove("highlight")}catch(e){i.capture(e,"trace.react")}},{scope:this})}}function a(e,t,s=0){const i=e.getBoundingClientRect();let n;switch(t){case"top":n={x:i.left+i.width/2,y:i.top+s};break;case"bottom":n={x:i.left+i.width/2,y:i.bottom-s};break;case"left":n={x:i.left+s,y:i.top+i.height/2};break;case"right":n={x:i.right-s,y:i.top+i.height/2}}const a=r.getViewportDimensions();if(n.x>=a.left&&n.x<=a.right&&n.y>=a.top&&n.y<=a.bottom)return n}function o(e,t,s){return{x:"left"===t?e.x-s:"right"===t?e.x+s:e.x,y:"top"===t?e.y-s:"bottom"===t?e.y+s:e.y}}function l(e,t){switch(t){case"top":return[{x:e.x,y:-1/0},e];case"bottom":return[e,{x:e.x,y:1/0}];case"left":return[{x:-1/0,y:e.y},e];case"right":return[e,{x:1/0,y:e.y}]}}function c(e,t){switch(t){case"top":case"bottom":return[{x:-1/0,y:e.y},{x:1/0,y:e.y}];case"left":case"right":return[{x:e.x,y:-1/0},{x:e.x,y:1/0}]}}function u(e,t){if(!(e[1].x<t[0].x||e[0].x>t[1].x||e[1].y<t[0].y||e[0].y>t[1].y)){if(e[0].x===e[1].x&&t[0].y===t[1].y)return{x:e[0].x,y:t[0].y};if(e[0].y===e[1].y&&t[0].x===t[1].x)return{x:t[0].x,y:e[0].y};throw new Error("Overlapping but non-orthogonal segments")}}function d(e){let t,s=0;for(const i of e)_.isString(i)||(t&&(s+=Math.abs(t.x-i.x)+Math.abs(t.y-i.y)),t=i);return s}return _declareVue("CircuitTrace",CircuitTrace,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg"}},[s("path",{class:{painted:e.painted,animating:e.duration},attrs:{d:e.path,pathLength:"100"}})])},staticRenderFns:[],functional:!1},{cssVarsGetter:function(e){return[[!0,{"6ecc96d7545f7972":`${e.duration}ms`}]]},scopeId:"data-v-6ecc96d7"}),{CircuitTrace:CircuitTrace}},!0,!0,{filename:"src/view/animation/circuit-trace.vue"}),_reviewable.define(["AppRoot"],["truss","router"],function(e,t){"use strict";class AppRoot{get current(){return t.current}get reviewContext(){if("review-page"===t.current.pageClass)return this.$store.services.reviewContext.current}get review(){if(this.reviewContext)return _get(this,"reviewContext","review")}get reviewReady(){return!!this.reviewContext&&(_get(this,"reviewContext","ready")&&_get(this,"review","context"))}mounted(){this.$observe(()=>!!t.current.component,e=>{e&&window._pendingGuides&&(_.forEach(window._pendingGuides,e=>e(this.$refs.guidesContainer)),Vue.delete(window,"_pendingGuides"))}),this.$observe(()=>[this.$store.services.connection.offline,this.$store.services.guideDirectory.overlayActive],()=>{document.body.classList.toggle("guide-overlaid",!!_get(this,"$store","services","guideDirectory","overlayActive")),document.body.classList.toggle("offline",!!_get(this,"$store","services","connection","offline"))},{precise:!0}),this.$observe(()=>[t.current.pageTitle,t.current.pageTitleSuffix],([e,t])=>{Vue.set(document,"title",`${e?`${e} - `:""}Reviewable${t?` - ${t}`:""}`)})}}return _declareVue("AppRoot",AppRoot,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.current.component?s("div",[s("app-layout",{attrs:{context:e.reviewContext},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.effectiveSidebarState;return[s(e.current.component,e._b({key:e.current.componentKey,tag:"component"},"component",e.reviewContext?{effectiveSidebarState:i}:null,!1))]}},{key:"sidebar",fn:function(t){var i=t.effectiveSidebarState;return[e.reviewReady?s("sidebar",{attrs:{review:e.review,effectiveSidebarState:i}}):e._e()]}}],null,!1,2468783138)}),s("member-welcome-overlay"),s("crash-overlay"),s("offline-overlay"),s("upgrade-overlay"),s("maintenance-overlay"),s("hotkeys-sheet"),s("changelog-overlay"),s("div",{attrs:{id:"guides-group"}}
1,[s("guide-overlay"),s("div",{ref:"guidesContainer",staticClass:"guide-mounts"})],1),s("circuit-trace")],1):e._e()},staticRenderFns:[],functional:!1},{scopeId:"data-v-49c58df6"}),{AppRoot:AppRoot}},!0,!0,{filename:"src/view/app-root.vue"}),_reviewable.define(["CompletionConditionPlayground"],["truss"],function(e){"use strict";class CompletionConditionPlayground{constructor(){Vue.set(this,"playground",null)}created(){Vue.set(this,"playground",this.$store.services.playground.create())}beforeDestroy(){this.playground.$update({active:!1}),this.playground.$set(null)}}return _declareVue("CompletionConditionPlayground",CompletionConditionPlayground,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"playground"},[e._m(0),s("div",{staticClass:"ui bottom attached segment"},[s("completion-condition-settings",{staticClass:"settings",attrs:{"repo-settings":e.playground}})],1)])},staticRenderFns:[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui top attached center aligned relative header"},[s("span",{staticClass:"text"},[e._v("Completion Condition Playground")])])}],functional:!1},{scopeId:"data-v-83a2174e"}),{CompletionConditionPlayground:CompletionConditionPlayground}},!0,!0,{filename:"src/view/completion-condition-playground.vue"}),_reviewable.define(["DashboardMainToggles"],["truss","Guide","session"],function(e,t,s){"use strict";class DashboardMainToggles{constructor(){}created(){this.personal&&this.$observe(()=>this.$session.settings.showPullRequestsFromPushableRepos,e=>{e&&this.$store.services.auth.login(null,"optional").then(()=>{s.hasScope("read:org")||Vue.set(s.settings,"showPullRequestsFromPushableRepos",!1)})})}get showPullRequestsFromPushableRepos(){return s.settings.showPullRequestsFromPushableRepos}set showPullRequestsFromPushableRepos(e){Vue.set(s.onboarding,"toggledShowPullRequestsFromPushableRepos",!0),s.settings.showPullRequestsFromPushableRepos?Vue.set(s.settings,"showPullRequestsFromPushableRepos",!1):this.$store.services.auth.login(["read:org"],"optional").then(()=>{s.hasScope("read:org")&&Vue.set(s.settings,"showPullRequestsFromPushableRepos",!0)})}}DashboardMainToggles.$vueOptions={props:{personal:Boolean}};return _declareVue("DashboardMainToggles",DashboardMainToggles,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui bottom attached segment"},[s("span",{staticClass:"toggle option unconnected"},[s("span",{staticClass:"ui toggle checkbox"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.$session.settings.effectiveShowUnconnectedPullRequests,expression:"$session.settings.effectiveShowUnconnectedPullRequests"}],attrs:{id:"show-unconnected",type:"checkbox"},domProps:{checked:Array.isArray(e.$session.settings.effectiveShowUnconnectedPullRequests)?e._i(e.$session.settings.effectiveShowUnconnectedPullRequests,null)>
1-1:e.$session.settings.effectiveShowUnconnectedPullRequests},on:{change:function(t){var s=e.$session.settings.effectiveShowUnconnectedPullRequests,i=t.target,r=!!i.checked;if(Array.isArray(s)){var n=e._i(s,null);i.checked?n<0&&e.$set(e.$session.settings,"effectiveShowUnconnectedPullRequests",s.concat([null])):n>-1&&e.$set(e.$session.settings,"effectiveShowUnconnectedPullRequests",s.slice(0,n).concat(s.slice(n+1)))}else e.$set(e.$session.settings,"effectiveShowUnconnectedPullRequests",r)}}}),s("label",{attrs:{for:"show-unconnected"}}),s("span",{staticClass:"checkbox label"},[e._v("\n Show pull requests not yet connected to Reviewable.\n ")])])]),s("span",{staticClass:"toggle option show-all-repos"},[e.personal?s("span",{staticClass:"ui toggle checkbox"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.showPullRequestsFromPushableRepos,expression:"showPullRequestsFromPushableRepos"}],attrs:{id:"show-pushable-repos",type:"checkbox"},domProps:{checked:Array.isArray(e.showPullRequestsFromPushableRepos)?e._i(e.showPullRequestsFromPushableRepos,null)>-1:e.showPullRequestsFromPushableRepos},on:{change:function(t){var s=e.showPullRequestsFromPushableRepos,i=t.target,r=!!i.checked;if(Array.isArray(s)){var n=e._i(s,null);i.checked?n<0&&(e.showPullRequestsFromPushableRepos=s.concat([null])):n>-1&&(e.showPullRequestsFromPushableRepos=s.slice(0,n).concat(s.slice(n+1)))}else e.showPullRequestsFromPushableRepos=r}}}),s("label",{attrs:{for:"show-pushable-repos"}}),s("span",{staticClass:"checkbox label"},[e._v("\n Also show pull requests you're not involved with from all repos to which you can push.\n (Optionally limited to only\n "),s("inline-icon-checkbox",{attrs:{"icon-class":"watched"},model:{value:e.$session.settings.showPullRequestsFromWatchedReposOnly,callback:function(t){e.$set(e.$session.settings,"showPullRequestsFromWatchedReposOnly",t)},expression:"$session.settings.showPullRequestsFromWatchedReposOnly"}},[e._v("watched")]),e._v(" or\n "),s("inline-icon-checkbox",{attrs:{"icon-class":"starred"},model:{value:e.$session.settings.showPullRequestsFromStarredReposOnly,callback:function(t){e.$set(e.$session.settings,"showPullRequestsFromStarredReposOnly",t)},expression:"$session.settings.showPullRequestsFromStarredReposOnly"}},[e._v("starred")]),e._v(", and\n "),s("inline-icon-checkbox",{attrs:{"icon-class":"connected"},model:{value:e.$session.settings.showPullRequestsFromConnectedReposOnly,callback:function(t){e.$set(e.$session.settings,"showPullRequestsFromConnectedReposOnly",t)},expression:"$session.settings.showPullRequestsFromConnectedReposOnly"}},[e._v("connected")]),e._v(" repos.)\n ")],1)]):e._e()])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-6f426bd1"}),_declareGuides("DashboardMainToggles","data-v-6f426bd1",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".unconnected[data-v-6f426bd1]",onboarding:"toggledShowUnconnectedPullRequests",position:"top",highlight:"bracket"}},[s("p",[e._v("\n Toggle whether to include pull requests for which "),s("em",[e._v("a review has not yet been created")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n Those pull requests will be marked with the\n "),s("i",{staticClass:"create review icon",attrs:{alt:"will create new review"}}),e._v(" icon,\n and clicking on one of them will connect the pull request to a review and\n "),s("em",[e._v("insert a link")]),e._v(" into the pull request's description.\n ")]),e._v(" "),s("p",[e._v("\n You may want to turn off this option if you only want to see\n pull requests that you're involved with from connected repositories.\n ")])]),e._v(" "),s("guide",{attrs:{for:".show-all-repos[data-v-6f426bd1]",onboarding:"toggledShowPullRequestsFromPushableRepos",position:"top",highlight:"bracket"}},[s("p",[e._v("\n Toggle whether to include pull requests from\n "),s("em",[e._v("all repos where you have commit privileges")]),e._v(".\n ")]),e._v(" "),s("p",[s("em",[e._v("Optionally")]),e._v(", you can restrict this set of repos to only ones that you've also\n "),s("em",[e._v("watched or starred on GitHub")]),e._v(". This can be useful if you have push permissions\n on a lot of repos, and will not show you random open-source repos that\n you've starred but can't commit to.\n ")])])],1)},[]),{DashboardMainToggles:DashboardMainToggles}},!0,!0,{filename:"src/view/dashboard/dashboard-main-toggles.vue"}),_reviewable.define(["DashboardRestrictedOrgsWarning"],["truss"],function(e){"use strict";class DashboardRestrictedOrgsWarning{constructor(){}}DashboardRestrictedOrgsWarning.$vueOptions={props:{restrictedOrgs:{type:Array,required:!0}}};return _declareVue("DashboardRestrictedOrgsWarning",DashboardRestrictedOrgsWarning,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui icon message"},[s("i",{staticClass:"meh face icon"}),s("span",{staticClass:"content"},[e._v("\n Incomplete results from the\n "),e._l(e.restrictedOrgs,function(t,i){return s("span",{key:t},[0!==i&&e.restrictedOrgs.length>2&&i!==e.restrictedOrgs.length-1?s("span",[e._v(",\n ")]):e._e(
1),i===e.restrictedOrgs.length-1&&e.restrictedOrgs.length>1?s("span",[e._v("\n and\n ")]):e._e(),s("span",[e._v(e._s(t))])])}),e._v("\n organization"+e._s(e.restrictedOrgs.length>1?"s":"")+"\n because they have enabled\n "),s("a",{staticClass:"link",attrs:{href:"https://help.github.com/articles/restricting-access-to-your-organization-s-data/"}},[e._v("\n third-party app access restrictions")]),e._v(". You'll need to request that they\n "),s("a",{staticClass:"link",attrs:{href:"https://help.github.com/articles/requesting-organization-approval-for-oauth-apps/"}},[e._v("\n whitelist Reviewable\n ")]),e._v("\n to fix this.\n ")],2)])},staticRenderFns:[],functional:!1},{}),{DashboardRestrictedOrgsWarning:DashboardRestrictedOrgsWarning}},!0,!0,{filename:"src/view/dashboard/dashboard-restricted-orgs-warning.vue"}),_reviewable.define(["DashboardStaleConcludedToggles"],["truss","Guide","session"],function(e,t,s){"use strict";class DashboardStaleConcludedToggles{constructor(){}get itemName(){return s.settings.effectiveShowUnconnectedPullRequests?"pull request":"review"}}DashboardStaleConcludedToggles.$vueOptions={props:{pullRequests:{type:Object,required:!0}}};return _declareVue("DashboardStaleConcludedToggles",DashboardStaleConcludedToggles,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"stalled notice"},[e.pullRequests.staleCount?s("span",[s("a",{staticClass:"stale link",on:{click:function(t){e.pullRequests.showingStale=!e.pullRequests.showingStale}}},[s("span",[e._v(e._s(e.pullRequests.showingStale?"Exclude":"Include")+" ")]),1===e.pullRequests.staleCount?s("span",[e._v("1 stalled "+e._s(e.itemName))]):s("span",[e._v(e._s(e.pullRequests.staleCount)+" stalled "+e._s(e.itemName)+"s")])]),s("span",{staticClass:"spacer"},[e._v("â¢")])]):e._e(),e.pullRequests.mayHaveMoreClosedResults?s("span",[s("a",{staticClass:"concluded link",on:{click:function(t){return e.pullRequests.raiseClosedHorizon()}}},[s("span",[e._v("Show more concluded "+e._s(e.itemName)+"s")])]),e.pullRequests.closedHorizonWeeks?s("span",[e._v("\n ("+e._s(e.pullRequests.closedHorizonWeeks)+"\n week"+e._s(e.pullRequests.closedHorizonWeeks>1?"s":"")+")\n ")]):e._e()]):e._e()])},staticRenderFns:[],functional:!1},{scopeId:"data-v-c98ce386"}),_declareGuides("DashboardStaleConcludedToggles","data-v-c98ce386",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{onboarding:"includedStalePullRequests",for:".stale.link[data-v-c98ce386]",highlight:"under"}},[s("p",[e._v("\n Include or exclude "),s("em",[e._v("stalled pull requests")]),e._v("\n in the listâthat is, ones with "),s("em",[e._v("no activity")]),e._v("\n in the last "),s("em",[e._v("two weeks")]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{onboarding:"showMoreConcludedPullRequests",for:".concluded.link[data-v-c98ce386]",highlight:"under"}},[s("p",[e._v("\n Temporarily show "),s("em",[e._v("more concluded pull requests")]),e._v(" in the listâthat is,\n "),s("em",[e._v("closed or merged")]),e._v(" ones.\n ")]),e._v(" "),s("p",[e._v("\n Each click shows "),s("em",[e._v("one more week")]),e._v("'s worth of pull requests, and removes the normal\n maximum of three showing.\n ")])])],1)},[]),{DashboardStaleConcludedToggles:DashboardStaleConcludedToggles}},!0,!0,{filename:"src/view/dashboard/dashboard-stale-concluded-toggles.vue"}),_reviewable.define(["Dashboard"],["truss","Guide","config","session","router","analytics","corpsman"],function(e,t,s,i,r,n,a){"use strict";const o=new RegExp("^"+_.escapeRegExp(s.gitHubUrl).replace(/^https?:/,"https?:")+"\\/([^/]+)\\/([^/]+)\\/pull\\/(\\d+)(\\/.*)?(#.*)?$");class Dashboard{constructor(){Vue.set(this,"routeParams",r.params),Vue.set(this,"pullRequests",{}),Vue.set(this,"normalPullRequests",void 0),Vue.set(this,"specificPullRequests",void 0),Vue.set(this,"pullRequestUrlValid",void 0),Vue.set(this,"query",void 0),Vue.set(this,"global",!this.routeParams.owner&&!this.routeParams.repo),Vue.set(this,"personal",!this.routeParam
1s.repo),Vue.set(this,"currentPath",void 0),Vue.set(this,"organizationScope",void 0)}beforeDestroy(){Vue.set(this.$store.services.auth,"lastReviewsPath",this.currentPath),this.normalPullRequests.release(),this.specificPullRequests&&this.specificPullRequests.release()}created(){this.global?(Vue.set(this,"normalPullRequests",this.$store.services.pullRequests.list()),Vue.set(this,"organizationScope","all")):this.routeParams.repo?(Vue.set(document,"title",`Reviews in ${this.routeParams.owner}/${this.routeParams.repo}`),Vue.set(i.onboarding,"navigatedToRepoDashboard",!0),Vue.set(this,"normalPullRequests",this.$store.services.pullRequests.list(this.routeParams.owner,this.routeParams.repo))):(Vue.set(document,"title",`My Reviews in ${this.routeParams.owner}`),Vue.set(i.onboarding,"navigatedToOrgDashboard",!0),Vue.set(this,"organizationScope",_.toLower(this.routeParams.owner.replace(/\s/g,""))),Vue.set(this,"normalPullRequests",this.$store.services.pullRequests.list(this.routeParams.owner))),this.personal&&(this.$when(()=>this.$info.userid).then(()=>{this.$observe(()=>this.organizationScope,this.selectOrganizationScope)}),this.$when(()=>this.$info.userid&&i.hasScope("read:org")).then(()=>this.$store.services.gitHubCache.refreshUserOrganizations()).catch(e=>{this.$info.userid&&a.capture(e,"refreshUserOrganizations")})),this.$observe(()=>[this.routeParams.owner,this.routeParams.repo],e=>{"dashboard-page"===r.current.pageClass&&(e[0]&&e[1]?Vue.set(this,"currentPath",`/reviews/${e[0]}/${e[1]}`):e[0]?Vue.set(this,"currentPath",`/reviews/${e[0]}`):Vue.set(this,"currentPath","/reviews"))}),this.$observe(()=>this.query,this.onQueryChange),this.$when(()=>_get(this,"pullRequests","items")).then(()=>{n.time("list",{numReviews:_.size(this.pullRequests.items)})}),this.$when(()=>_get(this,"pullRequests","items")&&_get(this,"pullRequests","listReady")).then(()=>{n.time("show"),n.recordTimings()});{const e={};_.forEach((r.hash||"").split("&"),t=>{const s=t.split("=");s.length<2||Vue.set(e,s[0],s[1].replace(/\\[0-9a-f][0-9a-f]/g,e=>String.fromCharCode(_.parseInt(e.slice(1),16))))}),Vue.set(this,"query",e.q||""),Vue.set(this.normalPullRequests,"showingStale","1"===e.stalled)}this.personal&&this.$when(()=>i.settings.$ready).then(()=>{!this.query&&i.settings.defaultReviewsQuery&&Vue.set(this,"query",i.settings.defaultReviewsQuery)}),this.$when(()=>_.isBoolean(i.settings.showUnconnectedPullRequests)).then(()=>Vue.set(i.onboarding,"toggledShowUnconnectedPullRequests",!0)),this.$when(()=>this.query).then(()=>Vue.set(i.onboarding,"filteredOpenReviews",!0)),this.$observe(()=>[this.query,this.pullRequests.showingStale],_.debounce(this.addQuery)),this.$observe(()=>this.$info.userid,(e,t)=>{null===e?r.go({path:"/",query:null,hash:null},{replace:!0}):e&&Vue.set(i.onboarding,"sawDashboard",!0)},{precise:!0})}get showingSampleLink(){return"saas"===i.config.env&&this.global&&!(i.onboarding.demoReview||i.onboarding.dismissed||i.onboarding.published||!i.onboarding.$ready)}get visitRepositoryDashboardAllowed(){return/^[\w.-]+\/[\w.-]+$/.test(this.query)&&this.normalPullRequests.$key!==_.toLower(this.query)}get setDefaultQueryAllowed(){return this.personal&&null===this.pullRequestUrlValid}get busy(){return _.includes(["invalid","fetching"],_get(this,"pullRequests","state"))}selectOrganizationScope(e,t){if(e===t)return;const s="all"===e?void 0:e;Vue.set(i.settings,"lastDashboardOrganization",s),s&&Vue.set(i.settings,"lastAdminOrganization",s),this.$store.services.auth.updateExtra({lastDashboardOrganization:s});const n=s?`/reviews/${s}`:"/reviews";r.go({path:n})}
1onQueryChange(e){if(/^https?:\/\//.test(this.query)){const e=this.query.match(o);if(Vue.set(this,"pullRequestUrlValid",!!e),e){const t=`${e[1]}/${e[2]}/${e[3]}`;this.specificPullRequests&&this.specificPullRequests.$key!==t&&(this.specificPullRequests.release(),Vue.set(this,"specificPullRequests",null)),this.specificPullRequests||Vue.set(this,"specificPullRequests",this.$store.services.pullRequests.listUrl(t)),Vue.set(this,"pullRequests",this.specificPullRequests)}else Vue.set(this,"pullRequests",{})}else Vue.set(this,"pullRequestUrlValid",null),Vue.set(this,"pullRequests",this.normalPullRequests),Vue.set(this.pullRequests,"query",this.query)}addQuery(){const e=[];this.query&&!/^https?:\/\//.test(this.query)&&e.push("q="+this.query.replace(/[=&\\]/g,e=>"\\"+e.charCodeAt(0).toString(16))),_get(this,"pullRequests","showingStale")&&e.push("stalled=1"),r.go({hash:e.join("&")||null},{replace:!0})}openPullRequestUrl(){if(!this.pullRequestUrlValid)return;Vue.set(i.onboarding,"openedReviewFromGitHubUrl",!0);const e=this.query.match(o);e&&r.go({path:"/reviews/"+e[1]+"/"+e[2]+"/"+e[3],hash:null})}setDefaultQuery(){Vue.set(i.settings,"defaultReviewsQuery",this.query||null)}visitRepositoryDashboard(){this.visitRepositoryDashboardAllowed&&r.go({path:"/reviews/"+this.query,hash:null})}}return _declareVue("Dashboard",Dashboard,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"open reviews"},[s("div",{staticClass:"ui top attached center aligned relative header"},[s("span",{staticClass:"text"},[e.routeParams.repo?e._e():s("span",[e._v("My")]),e._v("\n Reviews in\n "),e.routeParams.repo?s("span",[e._v(e._s(e.routeParams.owner)+"/"+e._s(e.routeParams.repo))]):s("span",[s("organization-selector",{attrs:{"all-option":"All repositories"},model:{value:e.organizationScope,callback:function(t){e.organizationScope=t},expression:"organizationScope"}})],1),e.pullRequests.lastUpdateTimeAgo?s("span",{staticClass:"unobtrusive last updated"},[e._v("\n Last updated "+e._s(e.pullRequests.lastUpdateTimeAgo)+".\n "),"refreshing"===e.pullRequests.state?s("span",[s("i",{staticClass:"spinner icon"}),e._v(" "+e._s(e.pullRequests.stateMessage)+"\n ")]):e._e()]):e._e()])]),s("div",{staticClass:"ui attached dimmable segment",class:{dimmed:e.busy}},[s("div",{staticClass:"ui simple inverted dimmer"},[s("div",{staticClass:"ui text loader"},[e._v(e._s(e.pullRequests.stateMessage))])]),e.pullRequests.error?s("p",{staticClass:"ui error message"},[e._v("\n Failed to\n "),e.pullRequests.items?s("span",[e._v("update your list of")]):s("span",[e._v("fetch a list of your")]),e._v("\n reviews: "+e._s(e.pullRequests.error)+"\n "),s("a",{staticClass:"link",on:{click:function(t){return e.pullRequests.refresh(!0)}}},[e._v("Try again")]),e._v(".\n ")]):e._e(),"incomplete"===e.pullRequests.state?s("p",{staticClass:"ui warning message"},[s("i",{staticClass:"warning sign icon"}),e._v("\n The list of reviews may be incompleteâthe GitHub query returned partial results.\n ")]):e._e(),s("animate-slide-down",[e.showingSampleLink?s("div",{staticClass:"try sample wrapper center-text"},[s("a",{staticClass:"try sample button ui green",attrs:{href:"/reviews/Reviewable/demo/1"},on:{click:function(t){_access(e,"","$session","","analytics","","track","call",["Opened Demo",{from:"dashboard"}])}}},[e._v("\n Try a sample code review\n ")])]):e._e()]),s("form",{on:{submit:function(t){return t.preventDefault(),e.openPullRequestUrl.apply(null,arguments)}}},[s("div",{staticClass:"ui filter icon input"},[s("input",{directives:[{name:"text-model",rawName:"v-text-model:debounce_150",value:e.query,expression:"query",arg:"debounce_150"}],attrs:{type:"text",autofocus:"",placeholder:"Enter filter query, or any pull request URLâ¦"}}),s("i",{staticClass:"search icon",attrs:{alt:"filter"}})]),e.setDefaultQueryAllowed?s("div",{staticClass:"unobtrusive set default"},[s("animate-fade-in-out",[s("span",{directives:[{name:"show",rawName:"v-show",value:e.$session.settings.defaultReviewsQuery||e.query,expression:"$session.settings.defaultReviewsQuery || query"}]},[s("animate-fade-in-out",{attrs:{opacity:.75}},[s("i",{directives:[{name:"show",rawName:"v-show",value:e.query===e.$session.settings.defaultReviewsQuery,expression:"query === $session.settings.defaultReviewsQuery"}],staticClass:"default query set icon"})]),s("a",{staticClass:"link manage-default-query",on:{click:function(t){return e.setDefaultQuery()}}},[!e.query&&e.$session.settings.defaultReviewsQuery?s("span",[e._v("Clear")]):s("span",[e._v("Set as")]),e._v("\n your default\n ")])],1)])],1):e._e(
1),s("animate-fade-in-out",[e.visitRepositoryDashboardAllowed?s("div",{staticClass:"unobtrusive visit repository dashboard"},[s("a",{staticClass:"link",on:{click:function(t){return e.visitRepositoryDashboard()}}},[e._v("\n Go to dashboard for "+e._s(e.query)+"\n ")])]):e._e()]),s("div",{staticClass:"clear"}),s("animate-slide-down",[s("div",{directives:[{name:"show",rawName:"v-show",value:!1===e.pullRequestUrlValid,expression:"pullRequestUrlValid === false"}],staticClass:"ui icon error message"},[s("i",{staticClass:"frowning face icon"}),s("div",{staticClass:"content"},[e._v("Invalid pull request URL.")])])])],1),e.busy?e._e():s("div",[e.pullRequests.hiddenItemsStillLoading?s("div",{staticClass:"relative",staticStyle:{height:"2em"}},[e._m(0)]):e._e(),s("animate-slide-down-group",e._l(e.pullRequests.warnings,function(t){return s("div",{key:t},[s("div",{staticClass:"ui icon warning message"},[s("i",{staticClass:"warning icon"}),s("span",{staticClass:"content"},[e._v(e._s(t))])])])}),0),e.pullRequests.empty?s("div",{staticClass:"empty notice"},[e._v("\n No\n "),s("span",{directives:[{name:"show",rawName:"v-show",value:!e.pullRequests.showingStale&&e.pullRequests.staleCount,expression:"!pullRequests.showingStale && pullRequests.staleCount"}]},[e._v("current")]),e._v("\n open\n "),e.$session.settings.effectiveShowUnconnectedPullRequests?s("span",[e._v("\n pull requests ")]):s("span",[e._v("reviews ")]),e.routeParams.repo?s("span",[e._v("in this repository.")]):s("span",[e.routeParams.owner?s("span",[e._v("in this organization")]):e._e(),e._v("\n that you're involved with.\n ")])]):e._e(),_get(e,"pullRequests","list","length")?s("pull-requests",{attrs:{"pull-requests":e.pullRequests.list,listingType:e.pullRequests.type}}):e._e(),s("dashboard-stale-concluded-toggles",{attrs:{"pull-requests":e.pullRequests}}),s("animate-slide-down",[_get(e,"pullRequests","restrictedOrganizations","length")?s("dashboard-restricted-orgs-warning",{attrs:{"restricted-orgs":e.pullRequests.restrictedOrganizations}}):e._e()],1),!e.$session.hasScope("repo")&&e.$session.config.privateReposAllowed||!e.$session.hasScope("read:org")?s("div",{staticClass:"ui basic center aligned segment"},[e.$session.hasScope("read:org")?e._e():s("ui-button",{staticClass:"green labeled icon team-reviews",attrs:{disabled:e.$session.auth.disabled},on:{click:function(t){return e.$session.auth.login(["read:org"],"optional")}}},[s("i",{staticClass:"all organizations icon",attrs:{alt:"World icon"}}),e._v("\n Also Show Team Reviews\n ")]),e.$session.config.privateReposAllowed&&!e.$session.hasScope("repo")?s("ui-button",{staticClass:"green labeled icon private-reviews",attrs:{disabled:e.$session.auth.disabled},on:{click:function(t){return e.$session.auth.login(["repo"],"optional")}}},[s("i",{staticClass:"private icon",attrs:{alt:"Lock icon"}}),e._v("\n Also Show Private Reviews\n ")]):e._e()],1):e._e()],1)],1),s("animate-slide-down",{staticClass:"animate-toggles"},[s("dashboard-main-toggles",{directives:[{name:"show",rawName:"v-show",value:null===e.pullRequestUrlValid,expression:"pullRequestUrlValid === null"}],attrs:{personal:e.personal}})],1)],1)},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ui active inverted dimmer"},[t("div",{staticClass:"ui small loader"})])}],functional:!1},{scopeId:"data-v-08bba47f"}),_declareGuides("Dashboard","data-v-08bba47f",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".header .text[data-v-08bba47f]",onboarding:"sawOpenReviews",position:"left",highlight:"bracket"}},[s("p",[e._v("\n Lists the "),s("em",[e._v("open pull requests you're involved with")]),e._v(":\n created by you, assigned to you, commented on by you, or that mentioned you or any of\n the teams you're on. The list is "),s("em",[e._v("updated every minute")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n Up to 3 "),s("em",[e._v("closed pull requests")]),e._v(" from the last 3 days are also listed,\n to make it easier to follow-up on recently completed reviews.\n (Filter for "),s("code",[e._v("+open")]),e._v(" to hide them.)\n ")]),e._v(" "),s("p",[e._v("\n Various toggles and filters on this page let you control exactly what gets listed.\n You can "),s("em",[e._v("constrain the list to an organization")]),e._v(" using the dropdown.\n You can also list "),s("em",[e._v("all the pull requests in a repository")]),e._v("\n b
1y following a link from the Repositories page.\n ")])]),e._v(" "),s("guide",{attrs:{for:".show.organizations[data-v-08bba47f]",onboarding:"showedAllOrganizations"}},[s("p",[e._v("\n Grant the authorization for Reviewable to see a "),s("em",[e._v("list of organizations")]),e._v(" of which you\n are a "),s("em",[e._v("member")]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".filter[data-v-08bba47f]",onboarding:"filteredOpenReviews",position:"left",highlight:"bracket"}},[s("p",[s("em",[e._v("Filter reviews")]),e._v(" against a substring in the pull request's "),s("em",[e._v("summary")]),e._v(",\n "),s("em",[e._v("repository")]),e._v(", "),s("em",[e._v("number")]),e._v(", "),s("em",[e._v("milestone")]),e._v(", "),s("em",[e._v("labels")]),e._v(",\n "),s("em",[e._v("author")]),e._v(" username, or "),s("em",[e._v("blocking reviewer")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n The matches are "),s("em",[e._v("case-insensitive")]),e._v(" but otherwise exact, including spaces.\n ")]),e._v(" "),s("div",[e._v("\n You can also use these special filters, in both positive (+) and negative (-) flavors (more filters are listed in the "),s("em",[s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/dashboard#filter-reviews"}},[e._v("docs")])]),e._v("):\n ")]),e._v(" "),s("dl",{staticClass:"tight wide-80"},[s("dt",[s("em",[e._v("±open")])]),s("dd",[e._v("currently open PRs")]),e._v(" "),s("dt",[s("em",[e._v("±red")])]),s("dd",[e._v("PRs with red counters")]),e._v(" "),s("dt",[s("em",[e._v("±deferred")])]),s("dd",[e._v("PRs with deferred counters")]),e._v(" "),s("dt",[s("em",[e._v("±mine")])]),s("dd",[e._v("created, assigned and requested PRs")]),e._v(" "),s("dt",[s("em",[e._v("±label:"),s("i",[e._v("name")])])]),s("dd",[e._v("PRs with given label")]),e._v(" "),s("dt",[s("em",[e._v("±needs:")])]),s("dd",[e._v(" ")]),e._v(" "),s("dt",[s("em",[e._v("  review")])]),s("dd",[e._v("incomplete reviews")]),e._v(" "),s("dt",[s("em",[e._v("  fix")])]),s("dd",[e._v("reviews with failing checks")]),e._v(" "),s("dt",[s("em",[e._v("  merge")])]),s("dd",[e._v("completed and clean reviews")]),e._v(" "),s("dt",[s("em",[e._v("  me")])]),s("dd",[e._v("reviews waiting on you")]),e._v(" "),s("dt",[s("em",[e._v("±am:")])]),s("dd",[e._v(" ")]),e._v(" "),s("dt",[s("em",[e._v("  author")])]),s("dd",[e._v("created PRs")]),e._v(" "),s("dt",[s("em",[e._v("  assigned")])]),s("dd",[e._v("assigned PRs")]),e._v(" "),s("dt",[s("em",[e._v("  requested")])]),s("dd",[e._v("requested reviewer PRs")])]),e._v(" "),s("p",[e._v('\n You can OR the positive filters with a comma, so "+needs:review,needs:fix"\n means "all reviews that need work or have a failing check". For negative filters,\n the comma ANDs instead.\n ')]),e._v(" "),s("p",[e._v("\n You can also paste the URL of "),s("em",[e._v("any pull request")]),e._v("\n you can see on GitHub to create a review for it.\n ")])]),e._v(" "),s("guide",{attrs:{for:".visit.repository.dashboard[data-v-08bba47f]",onboarding:"visitedRepositoryDashboard"}},[s("p",[e._v("\n Go to a "),s("em",[e._v("repository-specific dashboard")]),e._v(" that shows "),s("em",[e._v("all pull requests")]),e._v(" in the\n given repository.\n ")])]),e._v(" "),s("guide",{attrs:{for:".manage-default-query[data-v-08bba47f]",onboarding:"setDefaultReviewsQuery"}},[s("p",[e._v("\n Set the "),s("em",[e._v("current query as the default")]),e._v(" when you visit the Reviews page.\n ")])]),e._v(" "),s("guide",{attrs:{for:".team-reviews[data-v-08bba47f]",onboarding:"showedTeamReviews"}},[s("p",[e._v("\n Grant the authorizations necessary to include pull requests that\n "),s("em",[e._v("mention a team you belong to")]),e._v(" in the list.\n ")])]),e._v(" "),s("guide",{attrs:{for:".private-reviews[data-v-08bba47f]",onboarding:"showedPrivateReviews"}},[s("p",[e._v("\n Grant the authorizations necessary to "),s("em",[e._v("include private pull requests")]),e._v(" in the list.\n ")]),e._v(" "),s("p",[e._v("\n For an explanation of why this requires write permissions to your repos please see the\n "),s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/registration#github-authorizations"}},[e._v("user guide")]),e._v(".\n ")])])],1)},[]),{Dashboard:Dashboard}},!0,!0,{filename:"src/view/dashboard/dashboard.vue"}),_reviewable.define(["PullRequestAvatars"],["truss"],function(e){"use strict";class PullRequestAvatars{constructor(){}get maxSlots(){const e=Math.max(0,this.$store.services.ruler.windowWidth-1024);return Math.floor(e/70+4)}get slots(){let e=!1,t=!1;const s=[];if(_.forEach(_get(this,"pullRequest","importantUsers"),i=>{i.blocker&&!e?(s.push({separator:!0,dashboardIcon:"waiting on",alt:"Waiting on:"}),e=!0):i.blocker||t||!e||(s.push({separator:!0,dashboardIcon:"participating",alt:"Also participating:"}),t=!0),s.push(i)}),s.length>this.maxSlots){const e=_.slice(s,this.maxSlots-1);e[0].separator||e.unshift(_.findLast(s,"separator",this.maxSlots-1)||{separator:!0,alt:"Also participating:"});const t=_(e).map(e=>e.separator?e.alt:_.repeat(" ",4)+_.escape(e.name)).join("\n");s.splice(this.maxSlots-1,1/0),s.push({separator:!0,dashboardIcon:"more",alt:"more...",dashboardTooltip:`<div class="left-text">${t}</div>`})}return s}agentTagName(e){return _get(this,"$store","services","avatars","users",e.$userKey,"tag","name")}agentTagColors(e){const t=_get(this,"$store","services","avatars","users",e.$userKey,"tag","color");return this.$store.services.colors.computeAgentTagColors(t)}}PullRequestAvatars.$vueOptions={props:{pullRequest:{type:Object,required:!0}}};return _declareVue("PullRequestAvatars",PullRequestAvatars,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("td",{staticClass:"avatars"},e._l(e.slots,function(t){return s("span",{key:t.$userKey,staticClass:"ample only"},[t.separator?s("i",{directives:[{name:"tooltip",rawName:"v-tooltip.html",value:t.dashboardTooltip,expression:"slot.dashboardTooltip",modifiers:{html:!0}}],staticClass:"black separator icon",class:t.dashboardIcon,attrs:{alt:t.alt}}):s("span",{staticClass:"relative inline-block"},[s("span",{staticClass:"avatar-wrapper",class:[t.avatarClass,{icon:t.dashboardIcon,lgtm:"lgtm"===t.dashboardIcon,idle:!t.blocker}],on:{click:function(s){return s.stopPropagation(),s.preventDefault(),e.$emit("toggle-avatar",t.avatarClass)}}},[s("avatar-image",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.dashboardTooltip,expression:"slot.dashboardTooltip"}],attrs:{src:t.scaledAvatarUrl,fallback:t.$userKey}}),/^ghagent:/.test(t.$userKey)?s("span",{staticClass:"agent tag"},[s("span",{staticClass:"agent name",style:e.agentTagColors(t)},[e._v("\n "+e._s(e.agentTagName(t))+"\n ")])]):e._e(
1)],1),"lgtm"===t.dashboardIcon?s("span",{staticClass:"corner emoji"},[s("img",{attrs:{src:"/"+t.lgtm+".png",alt:"LGTM"}})]):t.dashboardIcon?s("i",{staticClass:"black corner icon",class:t.dashboardIcon,attrs:{alt:t.dashboardIcon}}):e._e()])])}),0)},staticRenderFns:[],functional:!1},{scopeId:"data-v-0099e465"}),{PullRequestAvatars:PullRequestAvatars}},!0,!0,{filename:"src/view/dashboard/pull-request-avatars.vue"}),_reviewable.define(["PullRequestCounters"],["truss","Guide"],function(e,t){"use strict";class PullRequestCounters{constructor(){}get checkStateDescription(){const e=this.pullRequest.visualCheckState;return!1===this.pullRequest.visualCheckFailureRequired?`${e} (not required)`:e}get reviewFilesNum(){const e=_get(this,"pullRequest","review","files","num")||{},t="valid"===_get(this,"pullRequest","review","state","dashboardCacheValidity")&&!!_get(this,"pullRequest","review","state","dashboardCache");return e.leftEstimate||t||!this.pullRequest.tooManyFiles?e:{leftEstimate:"???",description:"Too many files to count here"}}get reviewTrackerNum(){return _get(this,"pullRequest","review","tracker","num")||{}}get userStateNum(){return _get(this,"pullRequest","userState","num")||{}}get deferred(){return _get(this,"pullRequest","review","userHasDeferred")}get deferredDiscussionCounterShown(){return this.deferred&&!!_get(this,"pullRequest","review","tracker","num","unreplied")}get deferredFileCounterShown(){return this.deferred&&!!_get(this,"pullRequest","review","files","num","toReviewAttention")}}PullRequestCounters.$vueOptions={props:{pullRequest:{type:Object,required:!0}}};return _declareVue("PullRequestCounters",PullRequestCounters,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("span",{staticClass:"counters"},[s("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Commit checks: "+e.checkStateDescription+".",expression:"`Commit checks: ${checkStateDescription}.`"}],staticClass:"counter",class:{hidden:!e.pullRequest.visualCheckState}},[s("i",{staticClass:"status checks counter icon wide only",attrs:{alt:"status checks"}}),s("i",{class:e._f("statusIconClass")(e.pullRequest.visualCheckState,e.pullRequest.visualCheckFailureRequired),attrs:{alt:e.checkStateDescription}})]),s("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.reviewFilesNum.description,expression:"reviewFilesNum.description"}],staticClass:"counter",class:{hidden:!e.reviewFilesNum.leftEstimate}},[s("i",{staticClass:"files counter icon wide only",attrs:{alt:"unreviewed files"}}),s("span",{staticClass:"ui file-counter label",class:{red:e.reviewFilesNum.toReviewAttention&&!e.deferred,deferred:e.deferredFileCounterShown,estimate:e.reviewFilesNum.estimate}},[e._v("\n "+e._s(e.reviewFilesNum.leftEstimate)+"\n "),e.reviewFilesNum.selfReviewAttention?s("span",{staticClass:"self-review disc"}):e._e(),e.reviewFilesNum.estimate?s("span",{staticClass:"estimate-decoration"}):e._e()])]),s("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.reviewTrackerNum.description,expression:"reviewTrackerNum.description"}],staticClass:"counter",class:{hidden:!e.reviewTrackerNum.left}},[s("i",{staticClass:"discussions counter icon wide only",attrs:{alt:"unreplied or unresolved discussions"}}),s("span",{staticClass:"ui label",class:{red:e.reviewTrackerNum.unreplied&&!e.deferred,deferred:e.deferredDiscussionCounterShown}},[e._v("\n "+e._s(e.reviewTrackerNum.left)+"\n ")])]),s("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.userStateNum.description,expression:"userStateNum.description"}],staticClass:"counter",class:{hidden:!e.userStateNum.pending}},[s("i",{staticClass:"drafts counter icon wide only",attrs:{alt:"drafts and review marks"}}),s("span",{staticClass:"ui label",class:{red:e.userStateNum.pending}},[e._v("\n "+e._s(e.userStateNum.drafts)+"\n ")])])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-76d666ce"}),_declareGuides("PullRequestCounters","data-v-76d666ce",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".counters[data-v-76d666ce]",onboarding:"sawOpenReviewCounters",highlight:"under"}},[s("div",[e._v("\n A "),s("em",[e._v("summary of the review's state")]),e._v(", updated in real time:\n ")]),e._v(" "),s("dl",[s("dt",[s("i",{staticClass:"status checks counter icon",attrs:{alt:"status checks"}})]),s("dd",[e._v("Status checks.")]),e._v(" "),s("dt",[s("i",{staticClass:"files counter icon",attrs:{alt:"unreviewed files"}})]),s("dd",[e._v("Unreviewed files.")]),e._v(" "),s("dt",[s("i",{staticClass:"discussions counter icon",attrs:{alt:"unreplied or unresolved discussions"}}
1)]),e._v(" "),s("dd",[e._v("Unreplied or unresolved discussions.")]),e._v(" "),s("dt",[s("i",{staticClass:"drafts counter icon",attrs:{alt:"drafts and review marks"}})]),e._v(" "),s("dd",[e._v("Unpublished drafts and review marks.")])]),e._v(" "),s("p",[s("span",{staticClass:"ui red lowercase label"},[e._v("Red")]),e._v("\n counters indicate that the review is waiting on your action.\n ")]),e._v(" "),s("p",[e._v("\n For authors who aren't designated as reviewers,\n "),s("span",{staticClass:"ui file-counter lowercase label"},[e._v("Gray"),s("span",{staticClass:"self-review disc"})]),e._v("\n file counters show shared unreviewed files. The dot indicates files left to self-review,\n until all files have been reviewed.\n ")]),e._v(" "),s("p",[s("span",{staticClass:"ui red deferred lowercase label"},[e._v("Red")]),e._v("\n striped counters indicate that the review needs your attention but you've deferred to others\n for now.\n ")]),e._v(" "),s("p",[e._v("\n An orange check state (like "),s("i",{staticClass:"optional status check failure icon",attrs:{alt:"failure (not required)"}}),e._v(") indicates that none of the failing checks are required\n to merge.\n ")])])],1)},[]),{PullRequestCounters:PullRequestCounters}},!0,!0,{filename:"src/view/dashboard/pull-request-counters.vue"}),_reviewable.define(["PullRequestLink"],["truss","session"],function(e,t){"use strict";class PullRequestLink{constructor(){}get tooltip(){let e=_.escape(this.pullRequest.headBranch);return this.pullRequest.baseBranch&&(e+=` <i class="target branch icon"></i> ${_.escape(this.pullRequest.baseBranch)}`),`<div class="center-text">${_.escape(this.pullRequest.owner)}/${_.escape(this.pullRequest.repo)} #${this.pullRequest.number}<br><em><i class="italic pull request branch icon"></i> ${e}</em><br>from ${_.escape(this.pullRequest.author.name)}</div>`}navigateToPullRequest(e){Vue.set(t.onboarding,"navigatedToPullRequestFromOpenReview",!0),e.stopPropagation()}}PullRequestLink.$vueOptions={props:{pullRequest:{type:Object,required:!0},listingType:{type:String,required:!0}}};return _declareVue("PullRequestLink",PullRequestLink,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("td",{directives:[{name:"tooltip",rawName:"v-tooltip.html",value:e.tooltip,expression:"tooltip",modifiers:{html:!0}}],staticClass:"pull request"},[s("a",{staticClass:"review-link",attrs:{href:e.pullRequest.reviewLink},on:{click:function(t){return e.$emit("pr-click",e.pullRequest,t)},auxclick:function(t){return e.$emit("pr-click",e.pullRequest,t,!0)}}},[s("div",{staticClass:"cell"},[s("a",{staticClass:"link",attrs:{href:e.pullRequest.url},on:{auxclick:e.navigateToPullRequest,click:e.navigateToPullRequest}},[s("span",{staticClass:"wide only"},["personal"===e.listingType?s("span",[e._v(e._s(e.pullRequest.owner)+"/")]):e._e(),"personal"===e.listingType||"org"===e.listingType?s("span",[e._v(e._s(e.pullRequest.repo))]):e._e()]),"pr"!==e.listingType?s("span",[e._v(" #"+e._s(e.pullRequest.number))]):e._e()]),"pr"!==e.listingType?s("i",{staticClass:"external modifier icon",attrs:{alt:"open in new tab"}}):e._e(),"personal"!==e.listingType?s("span",{staticClass:"italic branch note wide only"},[s("span",[s("i",{staticClass:"italic pull request branch icon"}),e._v(" "+e._s(e.pullRequest.headBranch))]),e.pullRequest.baseBranch?s("span",["org"!==e.listingType?s("span",[e._v("\n  "),s("i",{staticClass:"target branch icon"}),e._v(" "+e._s(e.pullRequest.baseBranch)+"\n ")]):s("span",[e._v("*")])]):e._e()]):e._e()])])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-5c7fc3fd"}),{PullRequestLink:PullRequestLink}},!0,!0,{filename:"src/view/dashboard/pull-request-link.vue"}),_reviewable.define(["PullRequestSummary"],["truss"],function(e){"use strict";class PullRequestSummary{constructor(){}get pullRequestTitle(){return _access(_.escape(_get(this,"pullRequest","title")).replace(/`{3}(.*?)`{3}/g,"<code>$1</code> "),"","replace","call",[/`(.*?)`/g,"<code>$1</code> "])}}PullRequestSummary.$vueOptions={props:{pullRequest:{type:Object,required:!0}}};return _declareVue("PullRequestSummary",PullRequestSummary,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("td",{staticClass:"summary"},[s("a",{staticClass:"review-link",attrs:{href:e.pullRequest.reviewLink},on:{click:function(t){return e.$emit("pr-click",e.pullRequest,t)},auxclick:function(t){return e.$emit("pr-click",e.pullRequest,t,!0)}}},[s("table",{staticClass:"table"},[s("tbody",[s("tr",[s("td",{staticClass:"cell"},[s("span",{staticClass:"avatar-wrapper",class:e.pullRequest.author.avatarClass,on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.$emit("toggle-avatar",e.pullRequest.author.avatarClass)}}},[s("avatar-image",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.pullRequest.author.dashboardTooltip,expression:"pullRequest.author.dashboardTooltip"}],staticClass:"author",attrs:{src:e.pullRequest.author.scaledAvatarUrl,fallback:e.pullRequest.author.$userKey}})],1),s("span",{staticClass:"title"},[s("span",{directives:[{name:"untrusted-html",rawName:"v-untrusted-html",value:e.pullRequestTitle,expression:"pullRequestTitle"}],staticClass:"html pr-title"}),s("animate-wipe-right",[e.pullRequest.draft?s("span",{staticClass:"marker"},[s("span",{staticClass:"draft"}
1,[e._v("\n  (draft)\n ")])]):e._e()])],1),!1===e.pullRequest.reviewCreated?s("span",[s("i",{staticClass:"create review icon",attrs:{alt:"will create new review"}})]):e._e(),e.pullRequest.stale?s("i",{staticClass:"black stalled icon",attrs:{alt:"review stalled"}}):e._e(),e.pullRequest.reviewCreated&&e.pullRequest.notConnected?s("i",{staticClass:"black unconnected icon",attrs:{alt:"repository not connected"}}):e._e(),s("i",{staticClass:"external modifier icon",attrs:{alt:"open in new tab"}}),s("animate-wipe-right",[e.pullRequest.milestone?s("span",{staticClass:"milestone marker"},[s("i",{staticClass:"milestone icon"}),s("span",[e._v(e._s(e.pullRequest.milestone.title))])]):e._e()]),s("animate-wipe-right",{attrs:{group:""}},e._l(e.pullRequest.labelsList,function(t){return s("span",{key:t.name},[s("span",{staticClass:"ui tag label",style:{"background-color":t.backgroundColor,color:t.color}},[e._v("\n "+e._s(t.displayName)+"\n ")])])}),0)],1)])])])])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-9c509970"}),{PullRequestSummary:PullRequestSummary}},!0,!0,{filename:"src/view/dashboard/pull-request-summary.vue"}),_reviewable.define(["PullRequestsHeading"],["truss"],function(e){"use strict";class PullRequestsHeading{constructor(){}}PullRequestsHeading.$vueOptions={props:{category:{type:String,required:!0}}};return _declareVue("PullRequestsHeading",PullRequestsHeading,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("tr",{staticClass:"section heading"},[s("td",{staticClass:"cell",attrs:{colspan:"4"}},["1.blocking"===e.category?s("span",[e._v("Awaiting my action:")]):"2.unread"===e.category?s("span",[e._v("New comments for me:")]):"3.working"===e.category?s("span",[e._v("Working on it:")]):"4.reviewing"===e.category?s("span",[e._v("Being reviewed by me:")]):"5.assigned"===e.category?s("span",[e._v("Assigned to me:")]):"6.created"===e.category?s("span",[e._v("Created by me:")]):"7.involved"===e.category?s("span",[e._v("Involving me:")]):"8.team"===e.category?s("span",[e._v("Involving my teams:")]):"9.concluded"===e.category?s("span",[e._v("Recently concluded:")]):"xtra"===e.category?s("span",[e._v("Unrelated to me:")]):e._e()])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-2c6e9526"}),{PullRequestsHeading:PullRequestsHeading}},!0,!0,{filename:"src/view/dashboard/pull-requests-heading.vue"}),_reviewable.define(["PullRequests"],["truss","Guide","session","modifiers","router"],function(e,t,s,i,r){"use strict";const n={category:"1.blocking",showing:!0,firstShowingInCategory:!0,$key:"alldone",image:"bunny-nap"};class PullRequests{constructor(){Vue.set(this,"highlightedParticipantClass",void 0),Vue.set(this,"highlightedAuthorClass",void 0),Vue.set(this,"highlightingStyleSheet",new CSSStyleSheet)}created(){Vue.set(document,"adoptedStyleSheets",[...document.adoptedStyleSheets,this.highlightingStyleSheet]),this.$observe(()=>this.allAvatarClasses,e=>{const t=(({avatarClasses:e})=>`\n ${_.map(e,e=>`\n .open.reviews .highlighting.participant.${e} .avatars .avatar-wrapper.${e},\n .open.reviews .highlighting.author.${e} .summary .avatar-wrapper.${e},\n `).join("")} .consume-trailing-comma {\n border-color: var(--yellow-2);\n cursor: var(--filter-off) 12 10, pointer;\n }\n\n ${_.map(e,e=>`\n .open.reviews .highlighting.participant.${e} .row.${e},\n .open.reviews .highlighting.author.${e} .row.author-${e},\n `).join("")} .consume-trailing-comma {\n opacity: 1 !important;\n pointer-events: auto;\n }\n`)({avatarClasses:e});this.highlightingStyleSheet.replaceSync(t)},{precise:!0}),document.addEventListener("click",this.clearFilters),this.$connect({publishOnPushTasks:_ref(this.$store,"child","queues","publishOnPush").query({by:_ref(this.$store,"child","queues","publishOnPush","prKey","userKey"),at:this.$info.userid})})}beforeDestroy(){Vue.set(document,"adoptedStyleSheets",_.without(document.adoptedStyleSheets,this.highlightingStyleSheet)),document.removeEventListener("click",this.clearFilters)}get displayPullRequests(){return"1.blocking"===_get(this,"pullRequests",0,"category")?this.pullRequests:[n].concat(this.pullRequests)}get allAvatarClasses(){return _(this.pullRequests).flatMap("importantUsers").flatMap("avatarClass").compact().uniq().value(
1)}toggleParticipantFilter(e){Vue.set(this,"highlightedParticipantClass",e===this.highlightedParticipantClass?void 0:e),Vue.set(this,"highlightedAuthorClass",void 0)}toggleAuthorFilter(e){Vue.set(this,"highlightedAuthorClass",e===this.highlightedAuthorClass?void 0:e),Vue.set(this,"highlightedParticipantClass",void 0)}clearFilters(){Vue.set(this,"highlightedParticipantClass",void 0),Vue.set(this,"highlightedAuthorClass",void 0)}handleTouchStart(e,t){(this.highlightedAuthorClass&&e.author.avatarClass!==this.highlightedAuthorClass||this.highlightedParticipantClass&&!_(e.importantUsers).map("avatarClass").includes(this.highlightedParticipantClass))&&(t.preventDefault(),t.stopPropagation(),this.clearFilters())}navigateToReview(e,t,r){const n=i.externalLinkActive||r,a=e.private?"repo":"public_repo";e.review||s.hasScope(a)?(Vue.set(s.onboarding,"navigatedToOpenReview",!0),n||(t.preventDefault(),this.goToReviewInCurrentTab(e.reviewLink))):(t.preventDefault(),this.$store.services.auth.login([a],"optional").then(()=>{s.hasScope(a)&&(Vue.set(s.onboarding,"navigatedToOpenReview",!0),n?window.open(e.reviewLink):this.goToReviewInCurrentTab(e.reviewLink))}))}goToReviewInCurrentTab(e){r.go({path:e,hash:null})}}PullRequests.$vueOptions={props:{pullRequests:{type:Array,required:!0},listingType:{type:String,required:!0}}};return _declareVue("PullRequests",PullRequests,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("table",{staticClass:"ui unstackable table",class:[e.highlightedParticipantClass,e.highlightedAuthorClass,{highlighting:!(!e.highlightedParticipantClass&&!e.highlightedAuthorClass),participant:!!e.highlightedParticipantClass,author:!!e.highlightedAuthorClass}]},[e._l(e.displayPullRequests,function(t){return[t.showing&&t.firstShowingInCategory?s("pull-requests-heading",{key:"heading_"+t.$key,staticClass:"row",attrs:{category:t.category}}):e._e(),t.image?s("tr",{key:"image_"+t.$key,staticClass:"bunny cell"},[e._m(0,!0)]):s("tr",{directives:[{name:"show",rawName:"v-show",value:t.showing,expression:"item.showing"}],key:t.$key,staticClass:"link row cell",class:[{closed:t.closed,odd:t.striped,pending:"pending"===t.displayKind},"author-"+t.author.avatarClass].concat(_access(t,"","importantUsers","","map","call",[function(e){return e.avatarClass}])),on:{"!touchstart":function(s){return e.handleTouchStart(t,s)}}},[s("pull-request-avatars",{attrs:{"pull-request":t},on:{"toggle-avatar":function(t){return e.toggleParticipantFilter(t)},"pr-click":e.navigateToReview}}),s("pull-request-summary",{attrs:{"pull-request":t},on:{"toggle-avatar":function(t){return e.toggleAuthorFilter(t)},"pr-click":e.navigateToReview}}),s("td",{staticClass:"ui dimmable status",class:{dimmed:!t.displayKind}},[e._m(1,!0),"queued"===t.displayKind?s("merge-queued",{attrs:{review:t.review,"merge-queue-entry":_get(t,"review","mergeQueueEntry")||t.mergeQueueEntry}}):"complete"===t.displayKind?s("merge-button",{staticClass:"ui dimmable thin green buttons complete",attrs:{review:t.review}}):s("a",{staticClass:"review-link",attrs:{href:t.reviewLink},on:{click:function(s){return e.navigateToReview(t,s)},auxclick:function(s){return e.navigateToReview(t,s,!0)}}},["pending"===t.displayKind?s("span",[s("i",{staticClass:"publish icon",attrs:{alt:""}}),e._v("\n waiting "),s("span",{staticClass:"ample only"},[e._v("for")]),s("span",{staticClass:"narrow only"},[e._v("â")]),e._v(" push\n "),_get(t,"review","state")?s("span",{staticClass:"wide only"},[e._v("\n ("+e._s(t.review.state.publishOnPushTimeout)+")\n ")]):e._e()]):"counters"===t.displayKind?s("pull-request-counters",{attrs:{"pull-request":t}}):"closed"===t.displayKind?s("span",{staticClass:"notice"},[t.merged?s("span",[e._v("Merged")]):s("span",[e._v("Closed")])]):"archived"===t.displayKind?s("span",{staticClass:"notice archived-notice"},[e._v("\n Archived\n ")]):"broken"===t.displayKind?s("span",{staticClass:"notice broken-notice"},[s("i",{staticClass:"ui red warning icon"}),e._v(" Broken "),s("i",{staticClass:"ui red warning icon"}
1)]):e._e()],1)],1),s("pull-request-link",{staticClass:"pull request",attrs:{"pull-request":t,listingType:e.listingType},on:{"pr-click":e.navigateToReview}})],1)]})],2)},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("td",{attrs:{colspan:"4"}},[t("div",{staticClass:"bunny-nap"})])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ui simple inverted dimmer"},[t("div",{staticClass:"ui mini loader"})])}],functional:!1},{scopeId:"data-v-71a9b74f"}),_declareGuides("PullRequests","data-v-71a9b74f",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".open.reviews .link.cell[data-v-71a9b74f]",group:"td.avatars[data-v-71a9b74f], td.summary[data-v-71a9b74f]",onboarding:"navigatedToOpenReview",position:"left",highlight:"under"}},[s("p",[s("em",[e._v("Open the review")]),e._v(" for this pull request.\n If "),s("i",{staticClass:"create review icon",attrs:{alt:"will create new review"}}),e._v("\n is shown, this will "),s("em",[e._v("create a new review")]),e._v("\n and insert a link into the pull request's description.\n ")]),e._v(" "),s("p",[e._v("\n The pull request's\n "),s("em",[e._v("review participants")]),e._v(" being\n "),s("i",{staticClass:"waiting on icon",attrs:{alt:"waiting on"}}),e._v(" waited on or\n "),s("i",{staticClass:"participating icon",attrs:{alt:"being reviewed by"}}),e._v(" not\n (with approval status icons overlaid), "),s("em",[e._v("author")]),e._v(",\n "),s("em",[e._v("summary")]),e._v(", "),s("em",[e._v("draft status")]),e._v(", "),s("em",[e._v("milestone")]),e._v(", and "),s("em",[e._v("labels")]),e._v("\n are displayed. You can "),s("em",[e._v("click on any avatar")]),e._v(" to "),s("em",[e._v("filter")]),e._v(" for relevant pull\n requests.\n ")]),e._v(" "),s("p",[e._v("\n If "),s("i",{staticClass:"black unconnected icon",attrs:{alt:"repository not connected"}}),e._v("\n is shown, the pull requests's "),s("em",[e._v("repository is not connected")]),e._v("\n to Reviewable and the review will be\n "),s("a",{staticClass:"link",attrs:{target:"_blank",href:"https://docs.reviewable.io/admincenter#reviews-in-connected-vs-unconnected-repos"}},[e._v("\n updated on demand only")]),e._v(", so the counters may be out of date.\n An admin can connect the repository from the\n "),s("a",{staticClass:"link",attrs:{href:"/repositories"}},[e._v("Repositories page")]),e._v(".\n ")]),e._v(" "),s("p",[s("em",[e._v("Stalled")]),e._v(" reviews are marked with a\n "),s("i",{staticClass:"black stalled icon",attrs:{alt:"review stalled"}}),e._v(" icon.\n ")])]),e._v(" "),s("guide",{attrs:{for:".open.reviews .closed.cell td.status[data-v-71a9b74f]",onboarding:"sawClosedReview",highlight:"under","click-onboard":"never"}},[s("p",[e._v("\n Indicates that this pull requested has been "),s("em",[e._v("closed or merged")]),e._v(".\n Up to "),s("em",[e._v("5 closed")]),e._v(" pull requests from the "),s("em",[e._v("last 3 days")]),e._v(" are listed,\n to make it easier to follow-up on recently completed reviews.\n ")])]),e._v(" "),s("guide",{attrs:{for:".open.reviews td.pull.request[data-v-71a9b74f]",onboarding:"navigatedToPullRequestFromOpenReview",highlight:"under"}},[s("p",[e._v("\n Visit the "),s("em",[e._v("pull request")]),e._v(" on GitHub.\n ")])]),e._v(" "),s("guide",{attrs:{for:".open.reviews .pending.cell td.status[data-v-71a9b74f]",onboarding:"sawReviewWaitingOnPush",highlight:"under","click-onboard":"never"}},[s("p",[e._v("\n Indicates that you have draft comments for this pull request scheduled to be published\n when you push a new revision to the pull request's source branch.\n ")])])],1)},[]),{PullRequests:PullRequests}},!0,!0,{filename:"src/view/dashboard/pull-requests.vue"}),_reviewable.define(["DiffTestPage"],["truss","safeStorage"],function(e,t){"use strict";const s="reviewable:manual_testing",i=["leftText","rightText","leftBaseText","rightBaseText"];class DiffTestPage{constructor(){Vue.set(this,"leftText",""),Vue.set(this,"rightText",""),Vue.set(this,"leftBaseText",""),Vue.set(this,"rightBaseText",""),Vue.set(this,"bundle",null),Vue.set(this,"error",null)}created(){try{_.assign(this,JSON.parse(t.local.getItem(s)||"{}"))}catch{t.local.removeItem(s)}}async diff(){t.local.setItem(s,JSON.stringify(_.pick(this,i)));const e={leftFile:{content:this.leftText},rightFile:{content:this.rightText},leftBaseFile:{content:this.leftBaseText||""},rightBaseFile:{content:this.rightBaseText||""},decorate:!0};try{Vue.set(this,"bundle",null),await this.$nextTick();const t=await this.$store.services.diffWorkerBridge.diffText(e);Vue.set(this,"bundle",_.assign(t,{ready:!0,acquire:_.noop,release:_.noop,createDraft:_.noop,locators:{grouped:{}}})),Vue.set(this,"error",null)}catch(e){Vue.set(this,"bundle",null),Vue.set(this,"error",e)}}}return _declareVue("DiffTestPage",DiffTestPage,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"diff-test"},[s("div",{staticClass:"table-wrapper",staticStyle:{"--diff-width":"calc((100vw - 17px - 30px) / 2)"}},[s("h2",[e._v("Diff Test")]),s("table",[s("tr",[s("td",[s("textarea",{directives:[{name:"text-model",rawName:"v-text-model",value:e.leftText,expression:"leftText"}],staticClass:"monospace mp-no-track",attrs:{spellcheck:"false"}})]),s("td"),s("td",[s("textarea",{directives:[{name:"text-model",rawName:"v-text-model",value:e.rightText,expression:"rightText"}],staticClass:"monospace mp-no-track",attrs:{spellcheck:"false"}})])]),s("tr",[s("td",[s("textarea",{directives:[{name:"text-model",rawName:"v-text-model",value:e.leftBaseText,expression:"leftBaseText"}],staticClass:"monospace mp-no-track",attrs:{spellcheck:"false"}})]),s("td"),s("td",[s("textarea",{directives:[{name:"text-model",rawName:"v-text-model",value:e.rightBaseText,expression:"rightBaseText"}],staticClass:"monospace mp-no-track",attrs:{spellcheck:"false"}})])]),s("tr",[s("td",{staticClass:"center-text",attrs:{colspan:"3"}},[s("ui-button",{on:{click:e.diff}},[e._v("Diff")]),e.bundle?s("div",{staticClass:"unobtrusive"},[e._v("\n baseChangesMissing: "+e._s(e.bundle.baseChangesMissing)+"\n ")]):e._e(
1)],1)])]),e.error?s("pre",{staticClass:"ui error monospace message"},[e._v(e._s(e.error.toString()))]):e._e(),e.bundle?s("blocks-diff-viewer",{attrs:{diff:e.bundle,columns:"two"}}):e._e()],1)])},staticRenderFns:[],functional:!1},{scopeId:"data-v-279065aa"}),{DiffTestPage:DiffTestPage}},!0,!0,{filename:"src/view/diff-test-page.vue"}),_reviewable.define(["BindWithBrDirective"],[],function(){"use strict";function e(e,t){Vue.set(e,"textContent",t),e.appendChild(document.createElement("br"))}class BindWithBrDirective{bind(t,s){e(t,s.value)}update(t,s){s.value!==s.oldValue&&e(t,s.value)}}return _declareVue("BindWithBrDirective",BindWithBrDirective,null,null,{}),{BindWithBrDirective:BindWithBrDirective}},!0,!0,{filename:"src/view/directives/bind-with-br.vue"}),_reviewable.define(["DefaultTrueDirective"],[],function(){"use strict";function e(e){const t=e.data.model||_.find(e.data.directives,{name:"model"});t&&_.isUndefined(t.value)&&_.set(e.context,t.expression,!0)}class DefaultTrueDirective{bind(t,s,i){e(i)}update(t,s,i){e(i)}}return _declareVue("DefaultTrueDirective",DefaultTrueDirective,null,null,{}),{DefaultTrueDirective:DefaultTrueDirective}},!0,!0,{filename:"src/view/directives/default-true.vue"}),_reviewable.define(["DiffCopyFixerDirective"],["textSelectionTracker","corpsman","diffCopyUtils","bus","dom","findFlowPanel","pageControl","truss"],function(e,t,s,i,r,n,a,o){"use strict";let l,c,u,d,h,p,v,m=null,g=null,f=null;function w(){m=null,g=null,f&&(f.stopSelectionPositioning(),f=null)}class DiffCopyFixerDirective{bind(C){let k,$,S,R=null;function x(e){S||window.getSelection().isCollapsed||(S=!0,document.removeEventListener("mousemove",x,!0))}function V(e){if(k)return;const t=r.findClosestElement(e.target,".line.content");if(T(t)){C.classList.add("selection-active");const s=t.classList.contains("left"),i=t.classList.contains("right");return $=r.findClosestElement(e.target,".file.diff"),$.classList.add("selecting"),$.classList.add("select"),void(s||i?(k=s?"left":"right",$.classList[s?"add":"remove"]("select-left"),$.classList[i?"add":"remove"]("select-right"),C.removeEventListener("mouseover",V)):($.classList.add("select-right"),$.classList.add("select-left")))}const s=r.findClosestElement(e.target,".codeblock.view .code.area .line");if(T(s)){C.classList.add("selection-active");const t=s.classList.contains("add"),i=s.classList.contains("remove");return $=r.findClosestElement(e.target,".codeblock.view .code.area"),void(t||i?(k=t?"codeblock-add":"codeblock-remove",$.classList[t?"add":"remove"]("select-add"),$.classList[i?"add":"remove"]("select-remove"),C.removeEventListener("mouseover",V)):($.classList.add("select-add"),$.classList.add("select-remove")))}const i=r.findClosestElement(e.target,".markdown-body");T(i)&&(k="discussion",C.classList.add("selection-active"),$=i,$.classList.add("select"))}function D(e){$&&($.classList.remove("selecting"),window.getSelection().isCollapsed?E():S=!0),document.removeEventListener("mouseup",D,!0),C.removeEventListener("mousemove",x),C.removeEventListener("mouseover",V)}function E(){C.classList.remove("selection-active"),$.classList.remove("select"),$.classList.remove("select-left"),$.classList.remove("select-right"),$.classList.remove("select-add"),$.classList.remove("select-remove"),$=null}function T(e){return e&&(!C.classList.contains("selection-active")||"none"!==getComputedStyle(e).getPropertyValue("user-select")||"none"!==getComputedStyle(e).getPropertyValue("-webkit-user-select"))}function P(){const e=window.getSelection();if(e.isCollapsed)return!1;if("left"===k||"right"===k)return!0;if(!e.anchorNode)return!1;try{return r.findClosestElement(e.anchorNode,".file.diff")&&!r.findClosestElement(e.anchorNode,".discussion.segment")}catch{return!1}}Vue.set(C,"unbindReleaseSelection",i.releaseSelection.react(()=>{$&&(window.getSelection().removeAllRanges(),E(),e.clearOverride(),e.setPaletteHidden(!0))},{scope:null})),l=function(t){if(_get(o,"store","services","guideDirectory","overlayActive")||r.findClosestElement(t.target,".guide.indicator"))return void(S=!1);const s=_access(C,"","querySelector","call",[".command-palette"],"","contains","call",[t.target]);s||e.setPaletteHidden(!0);const n=_access(document,"","querySelector","call",[".gutter-horizontal"],"","contains","call",[t.target]);1===t.which&&(S=!1,s||n||(k=null,R=null,$&&(window.getSelection().removeAllRanges(),E()),e.selectionHandlesVisible||(V(t),k||C.addEventListener("mouseover",V),document.addEventListener("mousemove",x,!0),document.addEventListener("mouseup",D,!0)),!e.selectionHandlesVisible||_access(C,"","querySelector","call",[".upper.selection-handle"],"","contains","call",[t.target])||_access(C,"","querySelector","call",[".lower.selection-handle"],"","contains","call",[t.target])||(e.setSelectionHandlesVisible(!1),i.clearDiffLineSelection(),window.getSelection().removeAllRanges())))},c=function(t){if(_get(o,"store","services","guideDirectory","overlayActive")||r.f
1indClosestElement(t.target,".guide.indicator"))return;if(e.selectionHandlesVisible)return;const i=s.getSelectionDirection();let n;!function(){const e=window.getSelection();if(e.isCollapsed)return!1;if("codeblock-add"===k||"codeblock-remove"===k)return!0;if(!e.anchorNode)return!1;try{return r.findClosestElement(e.anchorNode,".codeblock.view .code.area")}catch{return!1}}()?P()&&(k||(k="right"),n=s.adjustSelection(i)):k||(k="codeblock-add"),!window.getSelection().isCollapsed&&k&&e.setPaletteHidden(!!_access($,"","classList","","contains","call",["no-palette"]),!_access($,"","classList","","contains","call",["no-quote"])),R=s.getLineNumber(n),function(t,s){const i=window.getSelection();if(!i.rangeCount||i.isCollapsed||!$)return void e.setPaletteLocation(null,null);const r=_(s).map(e=>{if(0===e.childNodes.length)return;const t=document.createRange();return t.selectNodeContents(e),t}).compact().value(),n=[];for(let e=0;e<i.rangeCount;e++){const t=i.getRangeAt(e);if(r.length)for(const e of r){const s=t.cloneRange();y(s,e),s.collapsed||n.push(s)}else n.push(t)}const o={top:1/0,bottom:-1/0,left:1/0,right:-1/0};for(const e of n)e&&b(o,e.getBoundingClientRect());l=o,c=$.parentNode.getBoundingClientRect(),Vue.set(l,"top",Math.max(l.top,c.top)),Vue.set(l,"bottom",Math.min(l.bottom,c.bottom)),Vue.set(l,"left",Math.max(l.left,c.left)),Vue.set(l,"right",Math.min(l.right,c.right));var l,c;const u=a.scrollContexts.primary,d=new DOMRect(o.left+u.scrollX(),o.top+u.scrollY()-a.getLayoutTopOffset(),o.right-o.left,o.bottom-o.top),h="backward"===t?"above":"below";e.setPaletteLocation(d,h)}(i,n),s.captureSelection(function(){if(!P())return;return _access(r,"","findClosestElement","call",[window.getSelection().anchorNode,".file.diff"],"","diff")}(),function(){if(P())return;return _access(r,"","findClosestElement","call",[window.getSelection().anchorNode,".discussion.segment"],"","discussion")}(),k,R,_get(n,"length")>1?n:void 0)},u=function(i){if($)try{const t=i.clipboardData||window.clipboardData,r=s.extractSelectedText(k);_.forEach(r,(e,s)=>{t.setData(s,e)}),i.preventDefault(),e.setPaletteHidden(!0)}catch(e){t.capture(e,"handleCopy")}},d=function(e){S&&e.stopPropagation()},h=function(e){0===e.button&&e.isPrimary&&(w(),m=e.pointerId,g=n(e.target))},p=function(e){e.pointerId===m&&(1&e.buttons?g&&(f=g,g=null,f.startSelectionPositioning()):w())},v=function(e){e.pointerId===m&&w()},document.addEventListener("mousedown",l,!0),document.addEventListener("mouseup",c,!0),document.addEventListener("copy",u),document.addEventListener("click",d,!0),document.addEventListener("pointerdown",h,!0),document.addEventListener("pointermove",p,!0),document.addEventListener("pointerup",v,!0),document.addEventListener("pointercancel",v,!0)}unbind(e){document.removeEventListener("mousedown",l,!0),document.removeEventListener("mouseup",c,!0),document.removeEventListener("copy",u),document.removeEventListener("click",d,!0),document.removeEventListener("pointerdown",h,!0),document.removeEventListener("pointermove",p,!0),document.removeEventListener("pointerup",v,!0),document.removeEventListener("pointercancel",v,!0),w(),e.unbindReleaseSelection&&(e.unbindReleaseSelection(),Vue.delete(e,"unbindReleaseSelection"))}}function y(e,t){-1===e.compareBoundaryPoints(Range.START_TO_START,t)&&e.setStart(t.startContainer,t.startOffset),1===e.compareBoundaryPoints(Range.END_TO_END,t)&&e.setEnd(t.endContainer,t.endOffset)}function b(e,t){Vue.set(e,"top",Math.min(e.top,t.top)),Vue.set(e,"bottom",Math.max(e.bottom,t.bottom)),Vue.set(e,"left",Math.min(e.left,t.left)),Vue.set(e,"right",Math.max(e.right,t.right))}return _declareVue("DiffCopyFixerDirective",DiffCopyFixerDirective,null,null,{}),{DiffCopyFixerDirective:DiffCopyFixerDirective}},!0,!0,{filename:"src/view/directives/diff-copy-fixer.vue"}),_reviewable.define(["FireTouchenterTouchleaveDirective"],[],function(){"use strict";class FireTouchenterTouchleaveDirective{bind(e,t,s){let i;e.addEventListener("touchmove",t=>{if(1!==t.touches.length)return;const s=t.touches[0],r=document.elementFromPoint(s.clientX,s.clientY),n=e.contains(r);if(i&&!n){const s="undefined"==typeof TouchEvent?new CustomEvent("touchleave"):new TouchEvent("touchleave",t);e.dispatchEvent(s)}else if(!i&&n){const s="undefined"==typeof TouchEvent?new CustomEvent("touchenter"):new TouchEvent("touchenter",t);e.dispatchEvent(s)}i=n})}}return _declareVue("FireTouchenterTouchleaveDirective",FireTouchenterTouchleaveDirective,null,null,{}),{FireTouchenterTouchleaveDirective:FireTouchenterTouchleaveDirective}},!0,!0,{filename:"src/view/directives/fire-touchenter-touchleave.vue"}),_reviewable.define(["HighlightMatchDirective"],[],function(){"use strict";class HighlightMatchDirective{bind(e,{value:{item:t,query:s},arg:i}){if(t=_.escape(""+t),!s)return Vue.set(e,"innerHTML",t);const r=i?'<span class="'+i+'">$&</span>':"<strong>$&</strong>";Vue.set(e,"innerHTML",t.replace(new RegExp(_.escapeRegExp(_.escape(s)),"gi"),r))}}return _declareVue("HighlightMatchDirective",HighlightMatchDirective,null,null,{}),{HighlightMatchDirective:HighlightMatchDirective}},!0,!0,{filename:"src/view/directives/highlight-match.vue"}),_reviewable.define(["PasteImageDirective"],[],function(){"use strict";class PasteImageDirective{bind(e,t,s){e.addEventListener("paste",e=>{const i=(e.clipboardData||e.originalEvent.clipboardData).items,r=_.find(i,e=>_.includes(e.type,"image"));r&&s.context[t.expression](r.getAsFile())})}}return _declareVue("PasteImageDirective",PasteImageDirective,null,null,{}),{PasteImageDirective:PasteImageDirective}},!0,!0,{filename:"src/view/directives/paste-image.vue"}),_reviewable.define(["TextModelDirective"],["bus"],function(e){"use strict";class TextModelDirective{bind(t,s,i){function r(){_.set(i.context,s.expression,t.value),Vue.set(t,"lastFlushedValue",t.value)}const n=s.arg&&s.arg.match(/debounce_(\d+)(?:_(\d+))?/),a=n?_.parseInt(n[1]):0,o=_get(n,2)&&_.parseInt(n[2]),l=_.debounce(r,a,{maxWait:o});Vue.set(t,"unbindTextModelFlush",e.flush.react(r,{scope:null})),Vue.set(t,"lastFlushedValue",void 0),t.addEventListener("input",e=>{e.target.composing||(t.value&&t.lastFlushedValue?l():r())}),t.addEventListener("blur",e=>{r()}),Vue.set(t,"value",s.value||"")}
1inserted(e){"TEXTAREA"!==e.nodeName||e.hasAttribute("no-autosize")||autosize(e)}update(e,t,s){t.value!==t.oldValue&&t.value!==e.lastFlushedValue&&(Vue.set(e,"lastFlushedValue",Vue.set(e,"value",t.value||"")),"TEXTAREA"!==e.nodeName||e.hasAttribute("no-autosize")||autosize.update(e))}unbind(e){e.unbindTextModelFlush&&(e.unbindTextModelFlush(),Vue.delete(e,"unbindTextModelFlush")),Vue.delete(e,"lastFlushedValue"),"TEXTAREA"!==e.nodeName||e.hasAttribute("no-autosize")||autosize.destroy(e)}}return _declareVue("TextModelDirective",TextModelDirective,null,null,{}),{TextModelDirective:TextModelDirective}},!0,!0,{filename:"src/view/directives/text-model.vue"}),_reviewable.define(["TooltipDirective"],["animator","truss","pageControl"],function(e,t,s){"use strict";const i=["top","bottom","left","right","start","end"],r=["focus","click","hover"];function n(t,n){const a=_.isString(n.value)?{text:n.value}:n.value;if(_get(a,"text")){const o=a.fixed?"fixed":"absolute";if(t._tippy)t._tippy.state.isMounted&&n.modifiers.snapshot||t._tippy.setProps({content:a.text,popperOptions:{strategy:o}});else{const l=_.find(r,e=>n.modifiers[e])||"hover";tippy(t,{content:a.text,allowHTML:n.modifiers.html,animation:"shift-away",appendTo:()=>s.topDialog||document.body,arrow:!0,duration:e.defaultOptions.duration,delay:[n.modifiers.immediate?0:200,20],interactive:n.modifiers.interactive,maxWidth:350,placement:_.filter(i,e=>n.modifiers[e]).join("-")||"top",theme:a.theme||"tooltip",trigger:"hover"===l?"mouseenter":l,popperOptions:{strategy:o,modifiers:[{name:"preventOverflow",options:{boundary:document.documentElement}}]},zIndex:1e6})}}else t._tippy&&t._tippy.destroy()}function a(t){t._tippy&&t._tippy.setProps({duration:e.defaultOptions.duration})}tippy.setDefaultProps({ignoreAttributes:!0});class TooltipDirective{bind(s,i){n(s,i),Vue.set(s,"updateTooltip",_.debounce(_.partial(n,s),10)),Vue.set(s,"unobserveAnimationDuration",t.observe(()=>e.defaultOptions.duration,_.partial(a,s)))}update(e,t){_.isEqual(t.value,t.oldValue)||e.updateTooltip(t)}unbind(e){e._tippy&&e._tippy.destroy(),e.unobserveAnimationDuration()}}return _declareVue("TooltipDirective",TooltipDirective,null,null,{}),{TooltipDirective:TooltipDirective}},!0,!0,{filename:"src/view/directives/tooltip.vue"}),_reviewable.define(["TranslucentOnHoverDirective"],["animator"],function(e){"use strict";let t;class TranslucentOnHoverDirective{bind(s,{value:{targetOpacity:i=1}={}}){let r=!1;t=function(t){const n=s.getBoundingClientRect(),a=t.clientX-n.left,o=t.clientY-n.top,l=a>=0&&a<s.clientWidth&&o>=0&&o<s.clientHeight;r!==l&&(r=l,anime({targets:s,opacity:r?[i,.1]:[.1,i],duration:.33*e.defaultOptions.duration,easing:e.animeJsEasing}))},document.addEventListener("mousemove",t)}unbind(e){document.removeEventListener("mousemove",t)}}return _declareVue("TranslucentOnHoverDirective",TranslucentOnHoverDirective,null,null,{}),{TranslucentOnHoverDirective:TranslucentOnHoverDirective}},!0,!0,{filename:"src/view/directives/translucent-on-hover.vue"}),_reviewable.define(["UntrustedHtmlDirective"],["router","mangler"],function(e,t){"use strict";let s={};function i(e){if(!e)return"";let t=s[e];if(!t){try{t=DOMPurify.sanitize(e)}catch(e){Sentry.captureMessage("Malformed HTML: "+e.message),t="<p><i>Error: malformed content received from GitHub</i></p>"}Vue.set(s,e,t)}return t}e.afterChange(()=>s={},null),DOMPurify.addHook("uponSanitizeAttribute",(e,s)=>{if("A"===e.nodeName&&/noopener/.test(e.getAttribute("rel"))&&"target"===s.attrName&&Vue.set(s,"forceKeepAttr",!0),"IMG"===e.nodeName){const i=e.getAttribute("onerror");!(i===t.brokenImageErrorCallback||i===t.fallbackAvatarErrorCallback)||"onerror"!==s.attrName&&"fallback"!==s.attrName||Vue.set(s,"forceKeepAttr",!0)}return e});class UntrustedHtmlDirective{bind(e,t){Vue.set(e,"innerHTML",i(t.value))}update(e,t){t.value!==t.oldValue&&Vue.set(e,"innerHTML",i(t.value))}}return _declareVue("UntrustedHtmlDirective",UntrustedHtmlDirective,null,null,{}),{UntrustedHtmlDirective:UntrustedHtmlDirective}},!0,!0,{filename:"src/view/directives/untrusted-html.vue"}),_reviewable.define(["GoodbyePage"],["truss"],function(e){"use strict";class GoodbyePage{constructor(){Vue.set(this,"ownerGoodbyes",{})}mounted(){this.reposManager.activate()}beforeDestroy(){this.reposManager.deactivate()}get reposManager(){return this.$store.services.reposManager}fetchRepositories(){this.reposManager.refresh()}ownerState(e){const t=_.toLower(e.login);return this.ownerGoodbyes[t]||{pending:!1,error:null,numDisassociated:null,publicOnly:!1}}async goodbye(e,{publicOnly:t}={}){const s=_.toLower(e.login),i=this.ownerGoodbyes[s]||this.$set(this.ownerGoodbyes,s,{pending:!1,error:null,numDisassociated:null,publicOnly:!1});if(!i.pending){Vue.set(i,"pending",!0),Vue.set(i,"error",null),Vue.set(i,"numDisassociated",null),Vue.set(i,"publicOnly",!!t);try{await this.$store.services.auth.login(["admin:repo_hook",t?"public_repo":"repo"]),Vue.set(i,"numDisassociated",await this.$store.queues.requests.send({action:"disassociate",ownerName:s},3e5)),i.numDisassociated||Vue.set(i,"error",`No ${t?"public ":""}repos you can admin were found.`)}catch(e){Vue.set(i,"error",e.toString())}finally{Vue.set(i,"pending",!1)}}}}return _declareVue("GoodbyePage",GoodbyePage,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.$session.user?s("div",{staticClass:"connections"},[s("div",{staticClass:"ui top attached center aligned header"},[e._v("\n I Want Out!\n ")]),s("div",{staticClass:"ui attached dimmable segment",class:{dimmed:e.reposManager.fetching}},[e.reposManager.fetchError?s("p",{staticClass:"ui error message"},[e._v("\n Failed to fetch a list of your repositories: "+e._s(e.reposManager.fetchError)+".\n "),s("a",{staticClass:"link",on:{click:e.fetchRepositories}},[e._v("Try again")]),e._v(".\n ")]):s("div",[e._v("\n When you disassociate an organization, all its repos for which you have admin privileges\n will be disconnected from Reviewable (including any reviews in progress), and\n links to Reviewable will be removed from all PRs into which they were inserted. Review\n data is not deleted from the Reviewable datastore, however, and you will still be able to\n connect these repos to Reviewable later if you wish. (The contents of your repos are\n never stored in Reviewable.)\n ")]),s("div",{staticClass:"owners"},e._l(e.reposManager.list,function(t){return s("div",{key:t.login,staticClass:"ui dimmable owner",class:{dimmed:e.ownerState(t).pending}},[e._m(0,!0),s("span",{staticClass:"name"},[s("img",{staticClass:"ui avatar image",attrs:{src:t.avatarUrl,alt:""}}),e._v("\n "+e._s(t.login)+"\n ")]),s("span",{staticClass:"actions"},[s("ui-button",{staticClass:"small red",attrs:{disabled:e.ownerState(t).pending},on:{click:function(s){return e.goodbye(t)}}},[e._v("\n Disassociate all repos\n ")]),e.$session.hasScope("repo")?e._e():s("ui-button",{staticClass:"small red",attrs:{disabled:e.ownerState(t).pending},on:{click:function(s){return e.goodbye(t,{publicOnly:!0})}}},[e._v("\n Disassociate public repos\n ")]),e.ownerState(t).error?s("span",{staticClass:"ui red pointing left error label"},[e._v("\n "+e._s(e.ownerState(t).error)+"\n ")]):null!==e.ownerState(t).numDisassociated?s("span",{staticClass:"ui green pointing left error label"},[e._v("\n "+e._s(e.ownerState(t).numDisassociated)+"\n "+e._s(e.ownerState(t).publicOnly?"public":"")+"\n repo"+e._s(1===e.ownerState(t).numDisassociated?"":"s")+"\n disassociated successfully\n ")]):e._e(
1)],1)])}),0),e._m(1)]),e._m(2)]):e._e()},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ui simple inverted dimmer"},[t("div",{staticClass:"ui mini loader"})])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ui simple inverted dimmer"},[t("div",{staticClass:"ui loader"})])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui bottom attached segment"},[s("p",[e._v("\n If you don't see an organization that you're a member of, please double-check that your\n "),s("a",{staticClass:"link",attrs:{href:"https://help.github.com/articles/publicizing-or-concealing-organization-membership",target:"_blank"}},[e._v("membership is public")]),e._v(".\n ")])])}],functional:!1},{scopeId:"data-v-9e50e2ec"}),{GoodbyePage:GoodbyePage}},!0,!0,{filename:"src/view/goodbye-page.vue"}),_reviewable.define(["GuideIndicator"],["truss","animator","pageControl","dom","bus"],function(e,t,s,i,r){"use strict";class GuideIndicator{constructor(){Vue.set(this,"visible",!1),Vue.set(this,"touch",!1),Vue.set(this,"timeoutHandle",null),Vue.set(this,"clientX",1/0),Vue.set(this,"clientY",1/0),Vue.set(this,"showing",!1),Vue.set(this,"shouldShow",!1),Vue.set(this,"hideDurationMultiplier",.5),Vue.set(this,"lastFocus",null),Vue.set(this,"focusLocked",!1),Vue.set(this,"unreactShowGuideMap",null),Vue.set(this,"guideDirectory",this.$store.services.guideDirectory)}mounted(){Vue.set(this,"unreactShowGuideMap",r.showGuideMap.react(e=>{_.isUndefined(e)&&(this.updateFocus(!0),Vue.set(this,"focusLocked",!0)),this.hideIndicator()},{scope:this})),document.addEventListener("mousemove",this.markViewChange),document.addEventListener("scroll",this.markViewChange,!0),window.addEventListener("resize",this.markViewChange),document.addEventListener("touchstart",this.pin)}beforeDestroy(){this.unreactShowGuideMap&&this.unreactShowGuideMap(),this.timeoutHandle&&clearTimeout(this.timeoutHandle),document.removeEventListener("mousemove",this.markViewChange),document.removeEventListener("scroll",this.markViewChange,!0),window.removeEventListener("resize",this.markViewChange),document.removeEventListener("touchstart",this.pin)}markViewChange(e){e.clientX&&Math.abs(e.clientX-this.clientX)<=2&&e.clientY&&Math.abs(e.clientY-this.clientY)<=2||(this.hideIndicator(),Vue.set(this,"shouldShow","mousemove"===e.type&&(e.clientX!==this.clientX||e.clientY!==this.clientY)),this.guideDirectory.focus&&!this.focusLocked&&(Vue.set(this,"lastFocus",this.guideDirectory.focus),Vue.set(this.guideDirectory,"focus",null)),e.clientX&&e.clientY&&(Vue.set(this,"clientX",e.clientX),Vue.set(this,"clientY",e.clientY)),Vue.set(this,"timeoutHandle",setTimeout(()=>this.showIndicatorIfNeeded(),100)))}hideIndicator(){if(this.showing){const e=this.$refs.indicator;anime.remove(e),anime({targets:e,opacity:0,scale:1,delay:100,duration:300*this.hideDurationMultiplier,easing:t.animeJsEasing,complete:()=>{this.$destroyed||Vue.set(this,"visible",!1)}}),Vue.set(this,"showing",!1)}this.timeoutHandle&&clearTimeout(this.timeoutHandle)}abortHideIndicator(e){if(e.stopPropagation(),!this.showing){const e=this.$refs.indicator;anime.remove(e),Vue.set(this,"visible",!0),Vue.set(e.style,"opacity",1),Vue.set(e.style,"transform","scale(1)"),Vue.set(this.guideDirectory,"focus",this.lastFocus),Vue.set(this,"showing",!0)}}showIndicatorIfNeeded(){const e=this.$refs.indicator;if(this.guideDirectory.focus||Vue.set(this,"focusLocked",!1),this.shouldShow&&!this.showing&&!this.focusLocked&&(this.updateFocus(),this.guideDirectory.focus)){if(Vue.set(this,"visible",!0),anime.remove(e),this.guideDirectory.focus.guide.completed||this.guideDirectory.focus.guide.noTooltip)Vue.set(e.style,"position","static"),Vue.set(e.style,"backgroundColor","transparent"),anime({targets:e,opacity:[parseFloat(e.style.opacity)||0,1],scale:1,duration:2100,easing:t.animeJsEasing}),Vue.set(this,"hideDurationMultiplier",3.5);else{const i=s.getViewportDimensions(),r=e.offsetWidth+20,n=e.offsetHeight+5;let a=this.clientX,o=this.clientY;a>i.right-r&&(a=this.clientX-r-10),o>i.bottom-n&&(o=this.clientY-n),Vue.set(e.style,"position","fixed"),Vue.set(e.style,"top",`${o}px`),Vue.set(e.style,"left",`${a}px`),Vue.set(e.style,"backgroundColor","hsl(var(--bg-base-hsl), 0.8)"),t.shouldAnimate()?(e.classList.add("bouncing"),anime.timeline({targets:e,complete:()=>{e.classList.remove("bouncing")}}).add({opacity:1,scale:1.5,duration:150,easing:"easeInExpo"}).add({scale:1,duration:t.defaultOptions.duration,easing:"easeOutExpo"})):(Vue.set(e.style,"opacity",1),Vue.set(e.style,"transform","scale(1)")),Vue.set(this,"hideDurationMultiplier",.5)}Vue.set(this,"showing",!0)}}updateFocus(e){if(!e&&this.guideDirectory.focus||!_.isNumber(this.clientX)||this.clientX===1/0||!_.isNumber(this.clientY)||this.clientY===1/0)return;const t=document.elementFromPoint(this.clientX,this.clientY);t&&(i.findClosestElement(t,".guide.overlay")||(Vue.set(this,"focusLocked",!1),i.findClosestElement(t,".show.guide.map.item")?Vue.set(this.guideDirectory,"focus",null):Vue.set(this.guideDirectory,"focus",this.guideDirectory.resolveTarget(t))))}showGuideMapFromIndicator(){r.showGuideMap()}pin(){const e=this.$refs.indicator;Vue.set(this,"showing",!0),Vue.set(this,"touch",!0),document.removeEventListener("touchstart",this.pin),document.removeEventListener("mousemove",this.markViewChange),document.removeEventListener("scroll",this.markViewChange,!0),window.removeEventListener("resize",this.markViewChange),Vue.set(this,"visible",!0),anime.remove(e),anime({targets:e,opacity:1,duration:10*t.defaultOptions.duration,easing:t.animeJsEasing})}}return _declareVue("GuideIndicator",GuideIndicator,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("span",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],ref:"indicator",staticClass:"guide indicator passthrough",on:{click:e.showGuideMapFromIndicator,mousemove:e.abortHideIndicator}},[s("animate-fade-in-out",{attrs:{opacity:.5}},[e.touch?e._e():s("span",{staticClass:"cfp-hotkeys-key"},[e._v("F1")])]),s("i",{staticClass:"help circle icon",attrs:{alt:"help"}})],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-103b6cfe"}),{GuideIndicator:GuideIndicator}},!0,!0,{filename:"src/view/guide/guide-indicator.vue"}),_reviewable.define(["GuideOutline"],["truss","animator","pageControl","analytics","hotkeys","
1session"],function(e,t,s,i,r,n){"use strict";const a=[{side:"bottom",src:"/images/59b53774.bunny_sketch_bottom_1.png",style:"width: 60px; height: 86px; top: 1px; left: calc(50% - 85px);"},{side:"bottom",src:"/images/075a8cbc.bunny_sketch_bottom_2.png",style:"width: 80px; height: 100px; top: 1px; left: calc(50%);"},{side:"bottom",src:"/images/188e4bcb.bunny_sketch_bottom_3.png",style:"width: 60px; height: 100px; top: 1px; left: calc(50% + 25px);"},{side:"bottom",src:"/images/5b397750.bunny_sketch_bottom_4.png",style:"width: 60px; height: 79px; top: 10px; right: 10px;"},{side:"top",src:"/images/90f513e7.bunny_sketch_top_1.png",style:"width: 88.5px; height: 49px; bottom: 10px; left: calc(50% - 60px);"},{side:"left",src:"/images/9beb9d1f.bunny_sketch_left_1.png",style:"width: 50px; height: 85px; right: 10px; top: 0;"},{side:"left",src:"/images/462c8a5d.bunny_sketch_left_2.png",style:"width: 60px; height: 73px; right: 10px; bottom: -21px;"},{side:"left",src:"/images/febddb21.bunny_sketch_left_3.png",style:"width: 46.5px; height: 94px; right: 10px; top: calc(50% - 47px);"},{side:"right",src:"/images/50d842ce.bunny_sketch_right_1.png",style:"width: 44.5px; height: 87px; left: 10px; top: -12px;"},{side:"right",src:"/images/aec00566.bunny_sketch_right_2.png",style:"width: 70px; height: 86.5px; left: 10px; bottom: -35px;"},{side:"right",src:"/images/3a7811d2.bunny_sketch_right_3.png",style:"width: 53.5px; height: 88.5px; left: 10px; bottom: -10px;"},{side:"right",src:"/images/12ef4fd7.bunny_sketch_right_4.png",style:"width: 44.5px; height: 89.5px; left: 10px; top: calc(50% - 45px);"}],o={top:"bottom",bottom:"top",left:"right",right:"left"},l={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","bottom","top"],right:["right","left","bottom","top"]},c={"top-true":{opacity:1,marginTop:["-0.75em","-3em"]},"top-false":{opacity:0,marginTop:"-3em"},"bottom-true":{opacity:1,marginTop:["0.75em","3em"]},"bottom-false":{opacity:0,marginTop:"3em"},"left-true":{opacity:1,marginLeft:["-0.75em","-3em"]},"left-false":{opacity:0,marginLeft:"-3em"},"right-true":{opacity:1,marginLeft:["0.75em","3em"]},"right-false":{opacity:0,marginLeft:"3em"}};let u;"/headless"!==window.location.pathname&&_.forEach(a,e=>{const t=new Image;Vue.set(t,"src",e.src)});class GuideOutline{constructor(){Vue.set(this,"hotkeys",[]),Vue.set(this,"position",null),Vue.set(this,"location",null),Vue.set(this,"translationCss",""),Vue.set(this,"popupBounds",null),Vue.set(this,"sketch",null),Vue.set(this,"popupPositionInterval",null)}mounted(){this.guide.prepped||(this.smartify([this.guide.element,...this.guide.element.querySelectorAll("*")]),Vue.set(this.guide,"prepped",!0)),this.$refs.content.appendChild(this.guide.element),this.guide.hotkeyActions&&Vue.set(this,"hotkeys",_(this.guide.hotkeyActions).map(e=>_.find(r.list,t=>t.callback&&t.expression===e&&t.combo&&t.combo.length&&t.combo[0])).compact().value()),this.guide.open&&(this.guide.updateLocation(!0),this.$nextTick().then(()=>{this.updatePopupPosition(),this.pickSketch(1)})),this.$observe(()=>[this.guide.open,this.position],()=>{this.animateWrapper()},{deep:!0}),this.$observe(()=>this.guide.open,e=>{e&&(this.guide.updateLocation(!0),this.$nextTick().then(()=>{this.updatePopupPosition(),this.pickSketch(this.position?.35:1)}))})}beforeDestroy(){this.popupPositionInterval&&clearInterval(this.popupPositionInterval),this.guide.element.remove()}get hole(){return _.mapValues(this.guide.hole,e=>`${e}px`)}getPopupRect(){const e=this.$refs.wrapper,t=e.style.display;e.style.setProperty("display","block","important");const s=this.$refs.popup.getBoundingClientRect();return t?Vue.set(e.style,"display",t):e.style.removeProperty("display"),s}pickSketch(e){if(Vue.set(this,"sketch",null),Math.random()>e||!this.popupBounds)return;const t={};Vue.set(t,o[this.position],!0);const i=s.getViewportDimensions({bottom:-37});this.popupBounds.left-i.left<60&&Vue.set(t,"left",!0),this.popupBounds.top-i.top<60&&Vue.set(t,"top",!0),i.right-this.popupBounds.right<60&&Vue.set(t,"right",!0),i.bottom-this.popupBounds.bottom<60&&Vue.set(t,"bottom",!0);const r=_.reject(a,e=>e===u||t[e.side]);if(!r.length)return;const n=r[_.random(r.length-1)],l={left:0,right:0,top:0,bottom:0};Vue.set(l,o[n.side],"auto"),Vue.set(this,"sketch",{...n,position:_.mapValues(l,e=>_.isNumber(e)?`${e}px`:e)}),u=n}updatePopupPosition(){if(!this.guide.open)return void(this.popupPositionInterval&&(clearInterval(this.popupPositionInterval),Vue.set(this,"popupPositionInterval",null)));if(this.popupPositionInterval||Vue.set(this,"popupPositionInterval",setInterval(()=>this.updatePopupPosition(),200)),!this.guide.clickArea)return;const e=this.getPopupRect(),t=s.getViewportDimensions({top:5,left
1:5,right:-5,bottom:-5}),i=_.find(l[this.guide.position],s=>{switch(s){case"top":return this.guide.clickArea.top-e.height-8>=t.top;case"bottom":return this.guide.clickArea.bottom+e.height+8<=t.bottom;case"left":return this.guide.clickArea.left-e.width-8>=t.left;case"right":return this.guide.clickArea.right+e.width+8<=t.right}})||this.guide.position,r=this.guide.computeOffset(this.guide.clickArea,i);switch(i){case"top":r.top-=Math.min(0,r.top-e.height-8-t.top),Vue.set(this,"popupBounds",{top:r.top-e.height-8,bottom:r.top});break;case"bottom":r.top-=Math.max(0,r.top+e.height+8-t.bottom),Vue.set(this,"popupBounds",{top:r.top,bottom:r.top+e.height+8});break;case"left":r.left-=Math.min(0,r.left-e.width-8-t.left),Vue.set(this,"popupBounds",{left:r.left-e.width-8,right:r.left});break;case"right":r.left-=Math.max(0,r.left+e.width+8-t.right),Vue.set(this,"popupBounds",{left:r.left,right:r.left+e.width+8})}const n={};switch(i){case"bottom":case"top":Vue.set(n,"y",0),r.left+e.width/2>t.right?Vue.set(n,"x",t.right-r.left-e.width):r.left-e.width/2<t.left?Vue.set(n,"x",t.left-r.left):Vue.set(n,"x",-e.width/2),Vue.set(this.popupBounds,"left",r.left+n.x),Vue.set(this.popupBounds,"right",this.popupBounds.left+e.width);break;case"left":case"right":Vue.set(n,"x",0),r.top+e.height/2>t.bottom?Vue.set(n,"y",t.bottom-r.top-e.height):r.top-e.height/2<t.top?Vue.set(n,"y",t.top-r.top):Vue.set(n,"y",-e.height/2),Vue.set(this.popupBounds,"top",r.top+n.y),Vue.set(this.popupBounds,"bottom",this.popupBounds.top+e.height)}const a=`translate(${n.x}px,${n.y}px)`;this.position===i&&_.isEqual(this.location,r)&&a===this.translationCss||(Vue.set(this,"position",i),Vue.set(this,"location",_.mapValues(r,e=>`${e}px`)),Vue.set(this,"translationCss",a))}toggleGuide(e){if("single"!==this.mapShowing)if(e.stopPropagation(),this.guide.open)Vue.set(this.guide,"open",!1),this.animateMap();else{let e=!1;_.forEach(this.$store.services.guideDirectory.guides,t=>{e=e||t.open,Vue.set(t,"open",!1)}),Vue.set(this.guide,"open",!0),this.animateMap(),e?(Vue.set(this.guide,"open",!1),_.delay(()=>this.toggleGuideOpen(),t.defaultOptions.duration/2)):this.toggleGuideOpen()}}toggleGuideOpen(){Vue.set(this.guide,"open",!0),i.track("Looked at Guide",{onboardingKey:this.guide.onboardingKey,from:"map",completed:n.onboarding[this.guide.onboardingKey]}),this.updatePopupPosition(),this.pickSketch(.35),Vue.set(n.onboarding,this.guide.onboardingKey,!0)}showCheatSheet(){this.showGuideMap(!1).then(()=>{r.toggleCheatSheet()})}animateWrapper(){if(!this.position||!this.$refs.wrapper)return;const e=this.$refs.wrapper,s=c[`${this.position}-${this.guide.open}`];anime.remove(e);const i={targets:e,opacity:s.opacity,duration:t.defaultOptions.duration/2,easing:t.animeJsEasing,complete:()=>{this.guide.open||Vue.set(this,"location",null)}};void 0!==s.marginTop&&Vue.set(i,"marginTop",_.isArray(s.marginTop)?[s.marginTop[1],s.marginTop[0]]:s.marginTop),void 0!==s.marginLeft&&Vue.set(i,"marginLeft",_.isArray(s.marginLeft)?[s.marginLeft[1],s.marginLeft[0]]:s.marginLeft),anime(i)}smartify(e){_.forEach(e,e=>{const t=e.childNodes;for(let e=0;e<t.length;e++){const s=t[e];s.nodeType===Element.TEXT_NODE&&Vue.set(s,"nodeValue",s.nodeValue.replace(/'''/g,"â´").replace(/(\W|^)"(\S)/g,"$1â$2").replace(/(\u201c[^"]*)"([^"]*$|[^\u201c"]*\u201c)/g,"$1â$2").replace(/([^0-9])"/g,"$1â").replace(/''/g,"â³").replace(/(\W|^)'(\S)/g,"$1â$2").replace(/([a-z])'([a-z])/gi,"$1â$2").replace(/((\u2018[^']*)|[a-z])'([^0-9]|$)/gi,"$1â$3").replace(/(\u2018)([0-9]{2}[^\u2019]*)(\u2018([^0-9]|$)|$|\u2019[a-z])/gi,"â$2$3").replace(/(\B|^)\u2018(?=([^\u2019]*\u2019\b)*([^\u2019\u2018]*\W[\u2019\u2018]\b|[^\u2019\u2018]*$))/gi,"$1â").replace(/'/g,"â²"))}})}}GuideOutline.$vueOptions={props:{guide:{type:Object,required:!0},mapShowing:{type:[String,Boolean],required:!0},animateMap:{type:Function,required:!0},showGuideMap:{type:Function,required:!0}}};return _declareVue("GuideOutline",GuideOutline,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"relative"},[s("div",{staticClass:"guide outline target",class:{available:e.guide.available},style:e.hole,on:{click:e.toggleGuide}}),s("div",{directives:[{name:"show",rawName:"v-show",value:e.location,expression:"location"}],ref:"wrapper",staticClass:"guide root popup wrapper",class:e.position,style:e.location,on:{click:function(e){e.stopPropagation()}}},[s("div",{ref:"popup",staticClass:"guide popup main",style:{transform:e.translationCss}},[s("div",{ref:"content",staticClass:"hyphenated content"}),e.hotkeys.length?s("p",{staticClass:"shortcut"},[s("span",{staticStyle:{"margin-right":"10px"}},[s("a",{staticClass:"link",on:{click:e.showCheatSheet}},[e._v("\n Keyboard shortcut"+e._s(e.hotkeys.length>
11?"s":"")+"\n ")]),e._v(":\n ")]),e._l(e.hotkeys,function(t){return s("span",{key:t.expression,staticClass:"cfp-hotkeys-group comma-item"},e._l(t.sequences,function(t){return s("span",{key:t.source},e._l(t,function(t,i){return s("span",{key:i,staticClass:"cfp-hotkeys-key"},[e._v(e._s(t))])}),0)}),0)})],2):e._e(),e.sketch?s("div",{staticClass:"decor",style:e.sketch.position},[s("img",{style:e.sketch.style,attrs:{src:e.sketch.src}})]):e._e()]),s("div",{staticClass:"guide popup tip"})])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-4503002c"}),{GuideOutline:GuideOutline}},!0,!0,{filename:"src/view/guide/guide-outline.vue"}),_reviewable.define(["GuideOverlay"],["truss","session","pageControl","animator","analytics","bus"],function(e,t,s,i,r,n){"use strict";class GuideOverlay{constructor(){Vue.set(this,"mapShowing",!1),Vue.set(this,"outlines",[]),Vue.set(this,"overlayOpacity",0),Vue.set(this,"removeMapWatcher",null),Vue.set(this,"canvasElement",null),Vue.set(this,"map",null),Vue.set(this,"transitioning",!1),Vue.set(this,"pending",null),Vue.set(this,"computeLocationsInterval",void 0),Vue.set(this,"unreactAllowHotkey",null),Vue.set(this,"unreactShowGuideMap",null),Vue.set(this,"guideDirectory",this.$store.services.guideDirectory)}mounted(){Vue.set(this,"computeLocationsInterval",setInterval(()=>this.computeLocations(),200)),window.addEventListener("resize",this.handleResize),document.addEventListener("keydown",this.handleKeyDown),Vue.set(this,"unreactShowGuideMap",n.showGuideMap.react((e,s)=>{_.isUndefined(e)&&!this.mapShowing&&this.guideDirectory.focus&&(e=this.guideDirectory.focus.guide),e?(r.track("Looked at Guide",{onboardingKey:e.onboardingKey,from:s||"app",completed:t.onboarding[e.onboardingKey]}),Vue.set(t.onboarding,e.onboardingKey,!0),Vue.set(e,"open",!0),this.showGuideMap("single",[e])):this.showGuideMap()},{scope:this})),Vue.set(this,"unreactAllowHotkey",n.allowHotkey.react(e=>{this.mapShowing&&!_get(e,"callback","allowOnGuideMap")&&Vue.set(e,"prevented",!0)},{scope:this}))}beforeDestroy(){this.removeMapWatcher&&this.removeMapWatcher(),this.unreactShowGuideMap&&this.unreactShowGuideMap(),this.unreactAllowHotkey&&this.unreactAllowHotkey(),this.computeLocationsInterval&&clearInterval(this.computeLocationsInterval),window.removeEventListener("resize",this.handleResize),document.removeEventListener("keydown",this.handleKeyDown),this.mapShowing&&s.closeDialog(this.$el)}toggleOverlayPointerEvents(e){document.elementsFromPoint||_.forEach(document.querySelectorAll(".guide.passthrough"),t=>{Vue.set(t.style,"pointerEvents",e?"auto":"none")})}computeLocations(e=!1){let t=!1;this.toggleOverlayPointerEvents(!1),Vue.set(this,"outlines",_.reject(this.outlines,e=>(e.targetElement&&e.updateLocation(!0)&&(t=!0),!e.targetElement))),this.toggleOverlayPointerEvents(!0),t&&(e||this.paintMap())}async showGuideMap(e,t){if(_.isUndefined(e)&&(e="multi"!==this.mapShowing&&"multi"),this.mapSh
1owing!==e){if(!this.transitioning){Vue.set(this,"transitioning",!0);try{e?await this.show(e,t):await this.hide(e)}finally{Vue.set(this,"transitioning",!1)}return this.pending?(({state:e,guides:t}=this.pending),Vue.set(this,"pending",null),this.showGuideMap(e,t)):void 0}Vue.set(this,"pending",{state:e,guides:t})}}async show(e,i){const r=this.mapShowing;if(Vue.set(this,"mapShowing",e),Vue.set(this.guideDirectory,"overlayActive",!0),r)return _.forEach(this.outlines,e=>{Vue.set(e,"open",!1),Vue.set(e,"available",!0)}),void await this.animateMap();let n;do{await this.$nextTick();const t=_.map(document.querySelectorAll("[data-tippy-root]"),e=>({root:e,bounds:e.getBoundingClientRect()})),s={},r=[];this.toggleOverlayPointerEvents(!1);const a=_.sortBy(_.map(this.guideDirectory.guides,e=>(e.updatePotentialTargets(),e)),"potentialTargets.length");n=_(i||[]).concat(a).filter(e=>_access(e,"","selectForOverlay","call",[s,r,t])).sortBy(e=>-e.hole.width*e.hole.height).value(),this.toggleOverlayPointerEvents(!0),_.forEach(n,t=>{Vue.set(t,"available","multi"===e||t.open),t.resetPaintState(i?_.includes(i,t)?1:0:1)})}while(await t.hideAllTooltips());if(!n.length)return Vue.set(this,"mapShowing",!1),void Vue.set(this.guideDirectory,"overlayActive",!1);s.openDialog(this.$el),Vue.set(this,"outlines",n),await this.$nextTick(),Vue.set(this,"canvasElement",this.$refs.canvas),Vue.set(this,"map",this.canvasElement&&this.canvasElement.getContext("2d")),Vue.set(this,"overlayOpacity",0),this.computeLocations(!0),this.removeMapWatcher&&this.removeMapWatcher(),Vue.set(this,"removeMapWatcher",this.$observe(()=>_.map(this.outlines,e=>e.completed),()=>{this.paintMap()},{precise:!0})),await this.animateProgress(0,1,e=>{Vue.set(this,"overlayOpacity",e),this.paintMap(e)})}async hide(e){this.removeMapWatcher&&(this.removeMapWatcher(),Vue.set(this,"removeMapWatcher",null)),_.forEach(this.guideDirectory.guides,e=>{Vue.set(e,"open",!1)}),await this.animateProgress(this.overlayOpacity,0,e=>{Vue.set(this,"overlayOpacity",e),this.paintMap(e)}),Vue.set(this,"mapShowing",e),s.closeDialog(this.$el),Vue.set(this.guideDirectory,"overlayActive",!1),n.guideMapHidden(),Vue.set(this,"canvasElement",null),Vue.set(this,"map",null),Vue.set(this.guideDirectory,"focus",null),Vue.set(this,"outlines",[]),Vue.set(this,"overlayOpacity",0)}animateMap(){if("multi"!==this.mapShowing)return Promise.resolve();const e=_.some(this.outlines,"open");return _.forEach(this.outlines,t=>{t.animatePaintState(t.open||!e?1:.25)}),this.canvasElement?this.animateProgress(0,1,e=>this.paintMap(e)):Promise.resolve()}animateProgress(e,t,s){if(!i.defaultOptions.duration)return s(t),Promise.resolve();const r={value:e};return anime.remove(r),anime({targets:r,value:t,duration:i.defaultOptions.duration,easing:i.animeJsEasing,update:()=>{s(r.value)}}).finished}paintMap(e=1){this.mapShowing&&this.canvasElement&&this.map&&(Vue.set(this.canvasElement,"width",this.canvasElement.clientWidth),Vue.set(this.canvasElement,"height",this.canvasElement.clientHeight),Vue.set(this.map,"globalCompositeOperation","source-over"),this.map.clearRect(0,0,this.map.canvas.width,this.map.canvas.height),Vue.set(this.map,"fillStyle","rgba(0, 0, 0, 0.7)"),this.map.fillRect(0,0,this.map.canvas.width,this.map.canvas.height),Vue.set(this.map,"globalCompositeOperation","destination-out"),_.forEach(this.outlines,t=>{t.tweenPaintState(e),t.paintState.current&&(Vue.set(this.map,"fillStyle",`rgba(0, 0, 0, ${t.paintState.current})`),this.map.beginPath(),this.map.roundRect(t.hole.left,t.hole.top,t.hole.width,t.hole.height,5),this.map.fill())}),Vue.set(this.map,"lineWidth",2),Vue.set(this.map,"lineJoin","round"),Vue.set(this.map,"lineCap","round"),_.forEach(this.outlines,t=>{if(!t.paintState.current)return;let s;t.generateRandomParams(),this.map.beginPath();const i=t.expandRectToCoverHighlight(_.clone(t.hole));switch(t.highlight){case"around":s=this.drawOpenOval(t,i.left,i.top,i.width,i.height);break;case"under":{const e=6*(.5+t.random()),r=6*(.5+t.random());s=-this.drawHorizontalWavyLine(t,i.left+e,i.top+i.height,i.width-e-r);break}case"bracket":s=-this.drawRoughBrackets(t,i.left,i.top,i.width,i.height)}this.map.save(),1===e?Vue.set(t.paintState,"highlightPainted",!0):!t.paintState.highlightPainted&&this.map.set
1LineDash&&(this.map.setLineDash([Math.abs(s)]),Vue.set(this.map,"lineDashOffset",(1+e)*s)),Vue.set(this.map,"strokeStyle",`rgba(${t.completed?"204,204,204":"249,244,124"},${t.paintState.current})`),Vue.set(this.map,"globalCompositeOperation","source-atop"),this.map.stroke(),Vue.set(this.map,"strokeStyle",`rgba(${t.completed?"204,204,204":"249,244,124"},`+.2*t.paintState.current+")"),Vue.set(this.map,"globalCompositeOperation","destination-over"),this.map.stroke(),this.map.restore()}))}drawOpenOval(e,t,s,i,r){const n=.5522848,a=i/2*n,o=r/2*n,l=t+i,c=s+r,u=t+i/2,d=t-4*(1+e.random()),h=t+(l-d)/2,p=s+1.5*(1+e.random()),v=p+(c-p)/2,m=l+4*(1+e.random()),g=l-(m-t)/2,f=s-1.5*(1+e.random()),_=f+(c-f)/2;this.map.moveTo(g,f),this.map.bezierCurveTo(g+a,f,m,_-o,m,_),this.map.bezierCurveTo(m,_+o,u+a,c,u,c),this.map.bezierCurveTo(u-a,c,d,v+o,d,v),this.map.bezierCurveTo(d,v-o,h-a,p,h,p);const w=(i-r)*(i-r)/((i+r)*(i+r));return Math.PI*(i+r)*(1+3*w/(10+Math.sqrt(4-3*w)))+(h-u)+(u-g)}drawHorizontalWavyLine(e,t,s,i){const r=t+i;this.map.moveTo(t,s);let n=t,a=e.random()<.5?1:-1;for(;n+=30+10*e.random(),n=Math.min(r,n),this.map.quadraticCurveTo(t+(n-t)/2,s+a*e.random()*(n-t)/13,n,s),a=-a,n!==r;)t=n;return 1.05*i}drawVerticalWavyLine(e,t,s,i){const r=s+i;this.map.moveTo(t,s);let n=s,a=e.random()<.5?1:-1;for(;n+=30+10*e.random(),n=Math.min(r,n),this.map.quadraticCurveTo(t+a*e.random()*(n-s)/13,s+(n-s)/2,t,n),a=-a,n!==r;)s=n;return 1.05*i}drawRoughBrackets(e,t,s,i,r){return this.map.moveTo(t+6,s+2),this.map.quadraticCurveTo(t+1,s+2,t+1,s+7),this.drawVerticalWavyLine(e,t,s+7,r-14),this.map.quadraticCurveTo(t+1,s+r-2,t+6,s+r-2),this.map.moveTo(t+i-6,s+2),this.map.quadraticCurveTo(t+i-1,s+2,t+i-1,s+7),this.drawVerticalWavyLine(e,t+i-1,s+7,r-14),this.map.quadraticCurveTo(t+i-1,s+r-2,t+i-6,s+r-2),1.05*(r-14)+15}handleOverlayClick(){if(!this.mapShowing)return;let e=!1;_.forEach(this.outlines,t=>{e=e||t.open,Vue.set(t,"open",!1)}),"single"!==this.mapShowing&&e?e&&this.animateMap():this.showGuideMap(!1)}handleKeyDown(e){this.mapShowing&&27===e.which&&this.showGuideMap(!1)}handleResize(){this.paintMap()}}return _declareVue("GuideOverlay",GuideOverlay,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("dialog",{ref:"dialog",staticClass:"guide overlay",on:{click:e.handleOverlayClick}},[s("canvas",{ref:"canvas",staticClass:"guide veil",style:{opacity:e.overlayOpacity}}),e._l(e.outlines,function(t){return s("guide-outline",{key:t.id,attrs:{guide:t,mapShowing:e.mapShowing,animateMap:e.animateMap,showGuideMap:e.showGuideMap}})})],2)},staticRenderFns:[],functional:!1},{scopeId:"data-v-10033178"}),{GuideOverlay:GuideOverlay}},!0,!0,{filename:"src/view/guide/guide-overlay.vue"}),_reviewable.define(["Guide"],["truss","config","dom","pageControl","session"],function(e,t,s,i,r){"use strict";_.assign(Vue.prototype,{config:t});let n=0;class GuideModel{constructor(e){Vue.set(this,"id","guide-"+ ++n),_.assign(this,e),Vue.set(this,"randomParams",[]),Vue.set(this,"paintState",{start:0,end:0,current:0,highlightPainted:!1}),Vue.set(this,"available",!1),Vue.set(this,"open",!1)}get completed(){return!0===r.onboarding[this.onboardingKey]}generateRandomParams(){Vue.set(this,"randomParamIndex",0)}random(){return this.randomParamIndex>=this.randomParams.length&&this.randomParams.push(Math.random()),this.randomParams[this.randomParamIndex++]}resetPaintState(e){Vue.set(this.paintState,"start",Vue.set(this.paintState,"current",Vue.set(this.paintState,"end",e))),Vue.set(this.paintState,"highlightPainted",!1)}animatePaintState(e){Vue.set(this.paintState,"start",this.paintState.current),Vue.set(this.paintState,"end",e)}tweenPaintState(e){Vue.set(this.paintState,"current",this.paintState.start+(this.paintState.end-this.paintState.start)*e)}selectForOverlay(e,t,s){if(e[this.onboardingKey])return!1;let i;if(this.guideDirectory.focus&&this===this.guideDirectory.focus.guide)i={target:this.guideDirectory.focus.target,rect:this.getTargetBounds(this.guideDirectory.focus.target,!0)},Vue.set(i,"visibleRect",this.getVisibleTargetBounds(this.guideDirectory.focus.target,i.rect,!0)),Vue.set(i,"highlightRect",this.expandRectToCoverHighlight(_.clone(i.rect)));else{const e=[];
1if(_.forEach(this.potentialTargets,r=>{r.matches(".multiselect--active")&&(r=document.querySelector(".multiselect__content"));const n={target:r,overlap:0,rect:this.getTargetBounds(r)};if(n.rect&&(Vue.set(n,"visibleRect",this.getVisibleTargetBounds(r,n.rect)),n.visibleRect)){for(const e of s)if(!e.root.contains(r)&&o(e.bounds,n.visibleRect))return;if(Vue.set(n,"highlightRect",this.expandRectToCoverHighlight(_.clone(n.rect))),_.forEach(t,e=>{n.overlap+=o(e,n.highlightRect)}),!n.overlap)return i=n,!1;e.push(n)}}),!i&&e.length&&(i=_.minBy(e,"overlap")),!i)return!1}return Vue.set(this,"targetElement",i.target),Vue.set(this,"hole",_.pick(i.rect,"top","left","bottom","right","width","height")),t.push(i.highlightRect),Vue.set(e,this.onboardingKey,!0),!0}updatePotentialTargets(){Vue.set(this,"potentialTargets",this.selector())}expandRectToCoverHighlight(e){if(!e)return e;switch(this.highlight){case"under":e.bottom+=4,e.height+=4;break;case"around":e.width*=1.4142,e.height*=1.4142,Vue.set(e,"top",e.top+(e.bottom-e.top-e.height)/2),Vue.set(e,"left",e.left+(e.right-e.left-e.width)/2),Vue.set(e,"bottom",e.top+e.height),Vue.set(e,"right",e.left+e.width);break;case"bracket":e.left-=10,e.right+=10,e.width+=20}return e}getTargetBounds(e,t){const r=i.getViewportDimensions(),n=this.groupSelector(e);if(!n.length){if(!t)return;return e.getBoundingClientRect()}let a={top:1/0,bottom:-1/0,left:1/0,right:-1/0};if(_.forEach(n,e=>{try{const t=e.getBoundingClientRect();a={top:Math.min(a.top,t.top),bottom:Math.max(a.bottom,t.bottom),left:Math.min(a.left,t.left),right:Math.max(a.right,t.right)}}catch{}}),_.forEach(s.getAncestorsAndSelf(e),e=>{const{overflowX:t,overflowY:s}=getComputedStyle(e);if("hidden"===t||"hidden"===s)try{const i=e.getBoundingClientRect();"hidden"===t&&(Vue.set(a,"left",Math.max(a.left,i.left)),Vue.set(a,"right",Math.min(a.right,i.right))),"hidden"===s&&(Vue.set(a,"top",Math.max(a.top,i.top)),Vue.set(a,"bottom",Math.min(a.bottom,i.bottom)))}catch{}return"DIALOG"!==e.nodeName}),!t){if(a.bottom<r.top||a.top>r.bottom||a.right<r.left||a.left>r.right)return;if(!_.every(n,e=>s.isElementVisible(e)))return}return Vue.set(a,"width",a.right-a.left),Vue.set(a,"height",a.bottom-a.top),a}getVisibleTargetBounds(e,s,i){const r=this.computeVisibleRect(s,i);return i||!r||function(e,t,s){const i=t.left+t.width/2,r=t.top+t.height/2;return e.contains(a(i,t.top+s))&&e.contains(a(i,t.bottom-s))&&e.contains(a(t.left+s,r))&&e.contains(a(t.right-s,r))}(e,r,4)||function(e,t,s){return e.contains(a(t.left+s,t.top+s))&&e.contains(a(t.left+s,t.bottom-s))&&e.contains(a(t.right-s,t.top+s))&&e.contains(a(t.right-s,t.bottom-s))}(e,r,4)?r:void(t.prod||console.log("Discarded obscured guide target:",this.onboardingKey,e))}updateLocation(e){const t=this.hole,s=this.getTargetBounds(this.targetElement,e);return s&&(Vue.set(this,"hole",_.pick(s,"top","left","bottom","right","width","height")),Vue.set(this,"clickArea",this.getVisibleTargetBounds(this.targetElement,s,e))),this.clickArea||Vue.set(this,"targetElement",null),!_.isEqual(this.hole,t)}computeOffset(e,t){let s;switch(t){case"top":s={top:0,left:e.width/2};break;case"left":s={top:e.height/2,left:0};break;case"right":s={top:e.height/2,left:e.width};break;case"bottom":s={top:e.height,left:e.width/2}}
1return{top:e.top+s.top,left:e.left+s.left}}computeVisibleRect(e,t){const s=i.getViewportDimensions(),r=_.clone(e);if(Vue.set(r,"left",Math.min(s.width,Math.max(0,r.left))),Vue.set(r,"right",Math.min(s.width,Math.max(0,r.right))),Vue.set(r,"top",Math.min(s.height,Math.max(0,r.top))),Vue.set(r,"bottom",Math.min(s.height,Math.max(0,r.bottom))),Vue.set(r,"width",r.right-r.left),Vue.set(r,"height",r.bottom-r.top),t||!(r.width<e.width&&r.width<200||r.height<e.height&&r.height<200))return r}}function a(e,t){if(document.elementsFromPoint){const i=document.elementsFromPoint(e,t);for(let e=0;e<i.length;e++){const t=i[e];if(!s.findClosestElement(t,".guide.passthrough"))return t}}return document.elementFromPoint(e,t)}function o(e,t){return Math.max(0,Math.min(e.right,t.right)-Math.max(e.left,t.left))*Math.max(0,Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top))}class Guide{constructor(){}mounted(){const e=new GuideModel({element:this.$el,selector:()=>Array.from(document.querySelectorAll(this.for)),selectorSource:this.for,groupSelector:e=>this.group?Array.from(e.querySelectorAll(this.group)):[e],groupSelectorSource:this.group,onboardingKey:this.onboarding,noTooltip:this.noTooltip,hotkeyActions:this.hotkeyAction?_.trim(this.hotkeyAction).split(/\s*,\s*/):null,clickOnboard:this.clickOnboard,position:this.position,highlight:this.highlight,guideDirectory:this.$store.services.guideDirectory});this.$el.parentNode.removeChild(this.$el),this.$store.services.guideDirectory.register(e)}}Guide.$vueOptions={props:{for:{type:String,required:!0},group:String,onboarding:{type:String,required:!0},noTooltip:Boolean,position:{type:String,default:"bottom",validator:_.oneOf("top","bottom","left","right")},highlight:{type:String,default:"around",validator:_.oneOf("around","under","bracket")},hotkeyAction:String,clickOnboard:{type:String,default:"auto",validator:_.oneOf("auto","always","never")}}};return _declareVue("Guide",Guide,null,{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{staticClass:"guide content no-top-bottom-margin"},[e._t("default")],2)},staticRenderFns:[],functional:!1},{}),{Guide:Guide}},!0,!0,{filename:"src/view/guide/guide.vue"}),_reviewable.define(["AccountSettings"],["truss","Guide","session","animator"],function(e,t,s,i){"use strict";const r=6e4,n=36e5,a="08:00";let o,l;function c(e,t){return(e%t+t)%t}class AccountSettings{constructor(){Vue.set(this,"contrastTemp",void 0),Vue.set(this,"themeManager",this.$store.services.themeManager),Vue.set(this,"slackInfoConnector",void 0),Vue.set(this,"gitHubError",void 0),Vue.set(this,"showingRetiredAgents",!1),Vue.set(this,"provisioningAgent",!1),Vue.set(this,"agentProvisioningError",void 0),Vue.set(this,"agentIndexConnector",void 0),Vue.set(this,"agentKeys",[]),Vue.set(this,"agentApiKeys",{})}created(){const t=_.debounce(e=>{Vue.set(s.onboarding,"adjustedContrast",!0),Vue.set(s.settings,"contrast",e),Vue.set(this,"contrastTemp",void 0)},250);this.$observe(()=>this.contrastTemp,e=>{void 0!==e&&(e<10&&(e=Vue.set(this,"contrastValue",10),this.$refs.slider.setValue(e)),t(e))}),s.config.slackClientEnabled&&this.$when(()=>s.hasScope("read:org")).then(()=>this.$store.services.gitHubCache.refreshUserOrganizations()).then(e=>{Vue.set(this,"slackInfoConnector",this.$connect({workspaces:_(e).keyBy(e=>_.toLower(e.login)).mapValues((e,t)=>_ref(this.$store,"child","organizations",t,"slackWorkspace","core")).value(),accounts:_ref(this.$store,"child","users",this.$info.userid,"slackAccounts")}))},e=>{Vue.set(this,"gitHubError",e.message)}),s.config.agentsEnabled&&(Vue.set(this,"agentIndexConnector",o||(o=e.connect(()=>_ref(e,"child","store","users",e.info.userid,"index","agents")),l=e.observe(()=>e.info.userid,e=>{_.isNil(e)&&(o.destroy(),o=void 0,l(),l=void 0)}),o)),this.$observe(()=>[_get(this,"$store","users","current","index","agents"),this.showingRetiredAgents],this.updateAgentKeys,{deep:!0}))}get contrastValue(){return this.contrastTemp||s.settings.contrast||50}set contrastValue(e){Vue.set(this,"contrastTemp",e)}get animation(){return i.shouldAnimate()}set animation(e){Vue.set(s.settings,"animation",e)}get defaultAnimationDuration(){return i.defaultOptions.duration}get colorblind(){return _get(s,"settings","a11y","colorblind")}set colorblind(e){s.settings.a11y||Vue.set(s.settings,"a11y",{}),Vue.set(s.settings.a11y,"colorblind",e)}handleRateLimitInput(e){Vue.set(e.target,"value",e.target.value.replace(/[^0-9]/g,"").slice(0,5))}get rateLimitServerCutoff(){return s.settings.rateLimitServerCutoff}set rateLimitServerCutoff(e){!/^[0-9]*$/.test(e)||e.length>5||Vue.set(s.settings,"rateLimitServerCutoff",e?_.parseInt(e):null)}get defaultRateLimitServerCutoff(){return _get(s,"rateLimit","resources","core","limit")?s.rateLimit.resources.core.limit-1e3:"unknown"}
1get slackWorkspaces(){if(!_get(this,"slackInfoConnector","ready"))return;const{accounts:e}=this.slackInfoConnector.data;return _(this.slackInfoConnector.at.workspaces).map("value").compact().uniqBy("id").filter(t=>_get(e,t.domain+(t.enterpriseInstall?".enterprise":""))||t.enterpriseDomain&&_get(e,t.enterpriseDomain+".enterprise")).value()}get canLoadSlackWorkspaces(){return s.hasScope("read:org")&&!this.gitHubError}get canNotifySlack(){return s.config.slackBotEnabled||!this.canLoadSlackWorkspaces||!_.isEmpty(this.slackWorkspaces)}get slackNotifications(){return this.canNotifySlack&&"off"!==s.settings.slackNotifications?s.settings.slackNotifications||"instantly":null}set slackNotifications(e){_.isString(e)||(e=e?"instantly":"off"),Vue.set(s.settings,"slackNotifications",e),"daily"!==e||s.settings.slackNotificationsTime||Vue.set(this,"slackNotificationsTime",a),this.$store.queues.slackNotifications.resetScheduledTasks()}get slackNotificationsTime(){const e=s.settings.slackNotificationsTime;if(!_.isNil(e)){const t=Math.floor(c(e,864e5)/n),s=Math.floor(c(e,n)/r);return _([t,s]).map(e=>_.padStart(e,2,"0")).join(":")}return"daily"===s.settings.slackNotifications?"":a}set slackNotificationsTime(e){let t=null;if(e){const[s,i]=_(e).split(":").map(_.parseInt).value();t=s*n+i*r}Vue.set(s.settings,"slackNotificationsTime",t)}onSlackNotificationsTimeBlur(){s.settings.slackNotificationsTime||Vue.set(s.settings,"slackNotifications","instantly"),this.$store.queues.slackNotifications.resetScheduledTasks()}get slackTooltip(){return this.canLoadSlackWorkspaces?_.isEmpty(this.slackWorkspaces)?void 0:_(this.slackWorkspaces).groupBy(e=>e.enterpriseInstall?"Organizations":"Workspaces").flatMap((e,t)=>[`${t}:`,..._.map(e,({name:e})=>`⢠${_.escape(e)}`)]).join("\n"):"Unable to list your workspaces"+(this.gitHubError?". "+_.escape(this.gitHubError):'\ndue to insufficient permissions.\n\n<span class="ui tiny button" onclick="truss.store.services.auth.login([\'read:org\'])">Authorize</span>')}get loadingSlackWorkspaces(){return s.config.slackClientEnabled&&this.canLoadSlackWorkspaces&&!_get(this,"slackInfoConnector","ready")}get numAgents(){return _.size(_get(this,"$store","users","current","index","agents"))}get numRetiredAgents(){return _(_get(this,"$store","users","current","index","agents")).filter(e=>"retired"===e).size()}updateAgentKeys(){const e=_get(this,"$store","users","current","index","agents"),t=_(e).pickBy((e,t)=>("active"===e||this.showingRetiredAgents)&&!_.includes(this.agentKeys,t)).keys().sortBy().value(),s=this.showingRetiredAgents?[]:_(e).pickBy(e=>"retired"===e).keys().value();Vue.set(this,"agentKeys",_(this.agentKeys).concat(t).without(...s).filter(t=>e[t]).value())}async provisionAgent(e){if(!this.provisioningAgent){Vue.set(s.onboarding,"provisionedAgent",!0),Vue.set(this,"provisioningAgent",!0);try{Vue.set(this,"agentProvisioningError",void 0);const{agentKey:t,apiKey:s}=await this.$store.queues.requests.send({action:"activateAgent",type:e},{timeout:1e4});Vue.set(this.agentApiKeys,t,s)}catch(e){Vue.set(this,"agentProvisioningError",e.message)}finally{Vue.set(this,"provisioningAgent",!1)}}}}AccountSettings.$vueOptions={props:{visitedFromExternal:Boolean,accountSettingsRef:Object}};return _declareVue("AccountSettings",AccountSettings,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"account dialog",on:{click:function(e){e.stopPropagation()}}},[e._m(0),s("div",{staticClass:"ui bottom attached form segment"},[s("div",{staticClass:"font-family fields"},[s("div",{staticClass:"seven wide field"},[s("label",[e._v("Custom diff font")]),s("input",{directives:[{name:"text-model",rawName:"v-text-model:debounce_250",value:_get(e,"$session","settings","monospaceFont","family"),expression:"~$session.settings.monospaceFont.family",arg:"debounce_250"}],attrs:{type:"text",placeholder:"Liberation Mono"}})]),s("div",{staticClass:"three wide field"},[s("label",[e._v("size")]),s("input",{directives:[{name:"text-model",rawName:"v-text-model:debounce_250",value:_get(e,"$session","settings","monospaceFont","size"),expression:"~$session.settings.monospaceFont.size",arg:"debounce_250"}],attrs:{type:"text",placeholder:"89%"}})]),s("div",{staticClass:"three wide field"},[s("label",[e._v("weight")]),s("input",{directives:[{name:"text-model",rawName:"v-text-model:debounce_250",value:_get(e,"$session","settings","monospaceFont","weight"),expression:"~$session.settings.monospaceFont.weight",arg:"debounce_250"}],attrs:{type:"text",placeholder:"400"}})]),s("div",{staticClass:"three wide field"},[s("label",[e._v("height")]),s("input",{directives:[{name:"text-model",rawName:"v-text-model:debounce_250",value:_get(e,"$session","settings","monospaceFont","height"),expression:"~$session.settings.monospaceFont.height",arg:"debounce_250"}],attrs:{type:"text",placeholder:"1.2"}})])]),s("div",{staticClass:"field stylesheet"},[e._m(1),s("input",{directives:[{name:"text-model",rawName:"v-text-model:debounce_250",value:e.$session.settings.syntaxStylesheetUrl,expression:"$session.settings.syntaxStylesheetUrl",arg:"debounce_250"}],attrs:{type:"text",placeholder:"http://experiments.reviewable.io/"}})]),s("editor-link-template",{attrs:{visitedFromExternal:e.visitedFromExternal,accountSettingsRef:e.accountSettingsRef}}),s("div",{staticClass:"field key-bindings"},[s("label",[e._v("Custom review page keyboard shortcuts URL")]),s("input",{directives:[{name:"text-model",rawName:"v-text-model:debounce_250",value:e.$session.settings.keyBindingsUrl,expression:"$session.settings.keyBindingsUrl",arg:"debounce_250"}],attrs:{type:"text",placeholder:e.$session.config.hostUrl+"/bindings.json"}})]),e.$session.config.slackClientEnabled||e.$session.config.slackBotEnabled?s("div",[s("span",{staticClass:"fieldset label"},[e._v("\n Review notifications\n ")]),s("fieldset",{staticClass:"ui dimmable",class:{dimmed:e.loadingSlackWorkspaces}},[e._m(2),s("div",{staticClass:"slack"},[s("ui-toggle-input",{attrs:{disabled:!e.canNotifySlack},model:{value:e.slackNotifications,callback:function(t){e.slackNotifications=t},expression:"slackNotifications"}},[s("span",{directives:[{name:"tooltip",rawName:"v-tooltip.html.interactive",value:e.slackTooltip,expression:"slackTooltip",modifiers:{html:!0,interactive:!0}}],class:{tooltip:!!e.slackTooltip}},[e._v("\n Slack DM\n ")])]),s("div",{staticClass:"options"},[s("ui-radio-input",{attrs:{value:"instantly",disabled:!e.slackNotifications},model:{value:e.slackNotifications,callback:function(t){e.slackNotifications=t},expression:"slackNotifications"}},[e._v("\n instantly\n ")]),s("ui-radio-input",{attrs:{value:"daily",disabled:!e.slackNotifications},model:{value:e.slackNotifications,callback:function(t){e.slackNotifications=t},expression:"slackNotifications"}},[e._v("\n daily at\n ")])],1),s("div",{staticClass:"ui field",class:{error:!e.slackNotificationsTime}},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.slackNotificationsTime,expression:"slackNotificationsTime"}],class:{disabled:"daily"!==e.slackNotifications},attrs:{type:"time",disabled:"daily"!==e.slackNotifications},domProps:{value:e.slackNotificationsTime},on:{blur:e.onSlackNotificationsTimeBlur,input:function(t){t.target.composing||(e.slackNotificationsTime=t.target.value)}}}
1)])],1)])]):e._e(),s("div",{staticClass:"visual tweaks"},[s("span",{staticClass:"fieldset label"},[e._v("Visual tweaks")]),s("fieldset",[s("div",{staticClass:"animated-transitions"},[s("ui-toggle-input",{model:{value:e.animation,callback:function(t){e.animation=t},expression:"animation"}},[s("span",[e._v("Animated transitions")])])],1),s("div",{staticClass:"contrast"},[s("label",[e._v("Contrast")]),s("vue-slider-component",{ref:"slider",staticClass:"account slider",attrs:{duration:e.defaultAnimationDuration,width:"260px",height:"5px","dot-size":10,"drag-on-click":"",tooltip:"always","tooltip-formatter":"{value}%"},model:{value:e.contrastValue,callback:function(t){e.contrastValue=t},expression:"contrastValue"}})],1),s("div",{staticClass:"colorscheme"},[s("label",[e._v("Color scheme")]),s("div",{staticClass:"options"},e._l(e.themeManager.colorSchemes,function(t){return s("div",{key:t},[s("ui-radio-input",{attrs:{value:t},model:{value:e.$session.settings.colorScheme,callback:function(t){e.$set(e.$session.settings,"colorScheme",t)},expression:"$session.settings.colorScheme"}},[e._v("\n "+e._s(t)+"\n ")])],1)}),0)]),s("div",{staticClass:"color replacement"},[s("div",{staticClass:"vertical align"},[s("ui-toggle-input",{on:{change:e.themeManager.updateColorblindScheme},model:{value:e.colorblind,callback:function(t){e.colorblind=t},expression:"colorblind"}},[s("span",[e._v("Color replacement")])]),s("div",{staticClass:"relative"},[e.themeManager.redReplacementActive?s("div",{staticClass:"ui circular label",on:{click:function(t){return e.themeManager.updateColorReplacement("red",e.themeManager.defaultRed)}}},[s("i",{staticClass:"icon close"})]):e._e(),s("input",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:"replaces red"},expression:"{text: 'replaces red'}"}],staticClass:"replace red field",class:{disabled:!_get(e,"$session","settings","a11y","colorblind")},attrs:{type:"color",disabled:!_get(e,"$session","settings","a11y","colorblind")},domProps:{value:e.themeManager.redReplacement},on:{input:function(t){return e.themeManager.updateColorReplacement("red",t.target.value)}}})]),s("div",{staticClass:"relative"},[e.themeManager.greenReplacementActive?s("div",{staticClass:"ui circular label",on:{click:function(t){return e.themeManager.updateColorReplacement("green",e.themeManager.defaultGreen)}}},[s("i",{staticClass:"icon close"})]):e._e(),s("input",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:"replaces green"},expression:"{text: 'replaces green'}"}],staticClass:"replace green field",class:{disabled:!_get(e,"$session","settings","a11y","colorblind")},attrs:{type:"color",disabled:!_get(e,"$session","settings","a11y","colorblind")},domProps:{value:e.themeManager.greenReplacement},on:{input:function(t){return e.themeManager.updateColorReplacement("green",t.target.value)}}})])],1)])])]),e.$session.config.agentsEnabled?s("div",{staticClass:"agents"},[s("span",{staticClass:"fieldset label"},[e._v("Agent identities")]),s("fieldset",{staticClass:"ui dimmable",class:{dimmed:!_get(e,"agentIndexConnector","ready")}},[e._m(3),e.agentKeys.length?e._l(e.agentKeys,function(t){return s("agent-settings",{key:t,attrs:{agentKey:t,newApiKey:e.agentApiKeys[t]}})}):e._e(),s("span",{staticClass:"provision wrapper"},[s("ui-button",{staticClass:"dimmable mini basic circular provision agent",class:[{dimmed:this.provisioningAgent},_get(e,"$refs","agentTypeTippy","placement")]},[s("div",{staticClass:"ui simple inverted dimmer"},[s("div",{staticClass:"ui mini loader"})]),e._v("\n Provision new agentâ¦\n ")]),s("tippy-dropdown",{ref:"agentTypeTippy",attrs:{options:{placement:"bottom",theme:"dropdown-flat-top attached",zIndex:1e6,parentTippy:e.accountSettingsRef},fixed:!0}},[s("div",{staticClass:"ui agent types segment fluid vertical menu"},[s("a",{staticClass:"item",on:{click:function(t){return e.provisionAgent("author")}}},[s("b",[e._v("Author:")]),e._v(" has its own identity but acts as author on your PRs.\n ")]),s("a",{staticClass:"item",on:{click:function(t){return e.provisionAgent("reviewer")}}},[s("b",[e._v("Reviewer:")]),e._v(" has its own identity and acts as reviewer on all PRs.\n ")]),s("a",{staticClass:"item",on:{click:function(t){return e.provisionAgent("replicant")}}},[s("b",[e._v("Replicant:")]),e._v(" has no identity of its own and acts in your name.\n ")])])])],1
1),e.numRetiredAgents&&!e.showingRetiredAgents?s("a",{staticClass:"unobtrusive link",on:{click:function(t){e.showingRetiredAgents=!0}}},[e._v("+ "+e._s(e.numRetiredAgents)+"\n retired agent"+e._s(1===e.numRetiredAgents?"":"s"))]):e._e(),e.numAgents?e._e():s("div",{staticClass:"unobtrusive"},[e._v("\n No agents provisioned\n ")]),e.agentProvisioningError?s("div",{staticClass:"ui error message"},[e._v("\n "+e._s(e.agentProvisioningError)+"\n ")]):e._e()],2)]):e._e(),e.$session.rateLimit?s("div",{staticClass:"rate limit field"},[s("label",[e._v("GitHub API background usage cutoff")]),s("div",{staticClass:"ui input"},[s("input",{directives:[{name:"text-model",rawName:"v-text-model:debounce_250",value:e.rateLimitServerCutoff,expression:"rateLimitServerCutoff",arg:"debounce_250"}],attrs:{type:"text",placeholder:e.defaultRateLimitServerCutoff},on:{input:e.handleRateLimitInput}})])]):e._e(),s("div",{staticClass:"field authorizations"},[s("label",[e._v("GitHub authorizations granted")]),s("div",[s("i",{directives:[{name:"show",rawName:"v-show",value:!_get(e,"$info","user","github","baseScopes","length"),expression:"!~$info.user.github.baseScopes.length"}],staticClass:"scope"},[e._v("None")]),e._l(_get(e,"$info","user","github","baseScopes"),function(t){return s("span",{key:t,staticClass:"scope"},[e._v(e._s(t))])})],2)])],1)])},staticRenderFns:[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui top attached header segment"},[s("span",[e._v("Account Settings")])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("label",[e._v("Custom stylesheet URL\n "),s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/tips#visual-tweaks"}},[s("span",{staticClass:"unobtrusive"},[e._v("Sample custom styles")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ui simple inverted dimmer"},[t("div",{staticClass:"ui loader"})])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ui simple inverted dimmer"},[t("div",{staticClass:"ui loader"})])}],functional:!1},{scopeId:"data-v-9e75ef50"}),_declareGuides("AccountSettings","data-v-9e75ef50",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".font-family.fields[data-v-9e75ef50]",onboarding:"customizedDiffFont",position:"left",highlight:"bracket"}},[s("p",[e._v("\n Set the "),s("em",[e._v("font for diffs")]),e._v(". The font must be "),s("em",[e._v("monospace")]),e._v(", already be installed on\n your machine, and the name must match precisely. The font metrics (size and weight) should be\n specified in CSS format, and the height needs to be plain number.\n ")])]),e._v(" "),s("guide",{attrs:{for:".stylesheet[data-v-9e75ef50]",onboarding:"customizedStylesheet",position:"left",highlight:"bracket"}},[s("p",[e._v("\n Set a "),s("em",[e._v("stylesheet for diffed code")]),e._v(". The URL "),s("em",[e._v("must")]),e._v("\n serve a document with type "),s("em",[s("kbd",[e._v("text/css")])]),e._v("!\n ")]),e._v(" "),s("p",[e._v("\n We use "),s("a",{staticClass:"link",attrs:{target:"_blank",href:"https://highlightjs.org"}},[e._v("highlight.js")]),e._v(",\n so you can either pick one of their\n "),s("a",{staticClass:"link",attrs:{target:"_blank",href:"https://highlightjs.org/static/test.html"}},[e._v("\n predesigned styles\n ")]),e._v(" from the\n "),s("a",{staticClass:"link",attrs:{target:"_blank",href:"https://github.com/isagalaev/highlight.js/tree/master/src/styles"}},[e._v("\n styles directory\n ")]),e._v(" or\n "),s("a",{staticClass:"link",attrs:{target:"_blank",href:"http://highlightjs.readthedocs.org/en/latest/css-classes-reference.html"}},[e._v("\n create your own\n ")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n You can make some other small styling tweaks too; see\n "),s("a",{staticClass:"link",attrs:{target:"_blank",href:"https://docs.reviewable.io/accountsettings#custom-stylesheet"}},[e._v("\n the user guide\n ")]),e._v(" for details.\n ")])]),e._v(" "),s("guide",{attrs:{for:".key-bindings[data-v-9e75ef50]",onboarding:"customizedKeyBindings",position:"left",highlight:"bracket"}},[s("p",[e._v("\n Set custom "),s("em",[e._v("keyboard shortcuts")]),e._v(" for the review page.\n ")]),e._v(" "),s("p",[e._v("\n Grab a copy of the\n "),s("a",{staticClass:"link",attrs:{target:"_blank",href:e.$session.config.hostUrl+"/bindings.json"}},[e._v("\n default bindings file\n ")]),e._v("\n and put it somewhere accessible on the web (like in a\n "),s("a",{staticClass:"link",attrs:{target:"_blank",href:""+e.$session.config.gitHubGistUrl}},[e._v("\n gist\n ")]),e._v("). Edit to taste: all available commands are listed in the file,\n though not all are bound by default.\n Enter the URL to your file here and check the keyboard shortcuts cheatsheet;\n if your bindings don't show up, check the console for errors.\n ")]),e._v(" "),s("p",[e._v("\n See\n "),s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/accountsettings#custom-key-bindings",target:"_blank"}},[e._v("\n the user guide\n ")]),e._v(" for a few more details.\n ")])]),e._v(" "),s("guide",{attrs:{for:".slack[data-v-9e75ef50]",onboarding:"slackNotifications",position:"left",highlight:"under"}},[s("p",[e._v("\n Enable or disable review notifications via "),s("em",[e._v("Slack DM")]),e._v(",\n optionally sent in one batch at a specified time of the day.\n ")]),e._v(" "),s("p",[e._v("In order to use Slack notifications:")]),e._v(" "),s("ol",[s("li",[e._v("\n An owner of your organization has to connect a Slack\n workspace in the organization settings (reviewable.io only).\n ")]),e._v(" "),s("li",[e._v("\n You need to add the URL of your Slack profile to your social\n links in your GitHub profile.\n ")])])]),e._v(" "),s("guide",{attrs:{for:".animated-transitions[data-v-9e75ef50]",onboarding:"toggledAnimations",position:"left",highlight:"under"}},[s("p",[e._v("\n Enable or disable "),s("em",[e._v("animated transitions")]),e._v("\n throughout the application.\n Turn these off for a small performance boost.\n ")])]),e._v(" "),s("guide",{attrs:{for:".contrast[data-v-9e75ef50]",onboarding:"adjustedContrast",position:"left",highlight:"under"}},[s("p",[s("em",[e._v("Adjust the contrast")]),e._v(" of various visual elements, most prominently\n "),s("em",[e._v("diff highlighting")]),e._v(". The default setting is 50%.\n ")])]),e._v(" "),s("guide",{attrs:{for:".colorscheme[data-v-9e75ef50]",onboarding:"setColorScheme",position:"left",highlight:"under"}},[s("p",[s("em",[e._v("Set the color scheme")]),e._v(" to always dark, always light, or\n dynamically adjusted per your OS or browser settings (system).")])]),e._v(" "),s("guide",{attrs:{for:".color.replacement[data-v-9e75ef50]",onboarding:"setColorReplacement",position:"left",highlight:"under"}},[s("p",[s("em",[e._v("Turn on colorblind mode")]),e._v(" and set red/green color replacements that\n apply to the entire application. Click the X on a color swatch to reset that\n individual color to the default.")])]),e._v(" "),s("guide",{attrs:{for:".provision.agent.button[data-v-9e75ef50]",onboarding:"provisionedAgent",position:"left"}},[s("p",[e._v("\n Provision a "),s("em",[e._v("new agent identity")]),e._v(" to use with Reviewable's\n "),s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/accountsettings#agents"}},[e._v("MCP server")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n There are three kinds of agents:\n "),s("ul",[s("li",[s("em",[e._v("Author")]),e._v(" agents have their own identity in Reviewable but are considered as\n author of any pull requests that you create.")]),e._v(" "),s("li",[s("em",[e._v("Reviewer")]),e._v(" agents have their own identity in Reviewable and are never treated\n as the author of a pull request.")]),e._v(" "),s("li",[s("em",[e._v("Replicant")]),e._v(" agents have no identity of their own and act entirely in your\n name.")])])]),e._v(" "),s("p",[e._v("\n The new agent will display its "),s("em",[e._v("token")]),e._v(" (API key). You'll want to "),s("em",[e._v("copy it")]),e._v(" into\n a secure location as this is the only time you'll be able to see it in Reviewable.\n ")])]),e._v(" "),s("guide",{attrs:{for:".rate.limit[data-v-9e75ef50]",onboarding:"setRateLimitServerCutoff",position:"left",highlight:"bracket"}},[s("p",[e._v("\n Set the "),s("em",[e._v("hourly GitHub API usage cutoff")]),e._v(" after which Review
1able will stop using your\n account for "),s("em",[e._v("background requests")]),e._v(" on its server. This applies a maximum across all\n types of quota but is typically most relevant for core API quota. It doesn't affect\n interactive usage of Reviewable however.\n ")]),e._v(" "),s("p",[e._v("\n This setting can be helpful if you're a member of an organization subscribed to "),s("em",[e._v("GitHub\n Enterprise Cloud")]),e._v(" but also use personal access tokens or the "),s("code",[e._v("gh")]),e._v(" command line\n tool. GHEC grants OAuth applications such as Reviewable a higher quota, but doesn't extend\n this benefit to personal tokens, so it's possible for Reviewable to unknowingly exhaust your\n quota. To prevent this, set the cutoff to a number below your personal token's limit, e.g.\n 4000.\n ")])]),e._v(" "),s("guide",{attrs:{for:".authorizations[data-v-9e75ef50]",onboarding:"sawGitHubAuths",position:"left",highlight:"bracket"}},[s("p",[e._v("\n These are the "),s("em",[e._v("GitHub authorizations you have granted")]),e._v("\n to Reviewable. The\n "),s("a",{staticClass:"link",attrs:{target:"_blank",href:"https://docs.reviewable.io/registration#github-authorizations"}},[e._v("\n user guide\n ")]),e._v(" explains how we use them.\n ")]),e._v(" "),s("p",[e._v("\n You can "),s("em",[e._v("revoke")]),e._v(" all authorizations in your\n "),s("a",{staticClass:"link",attrs:{target:"_blank",href:e.$session.config.gitHubUrl+"/settings/applications"}},[e._v("\n GitHub settings\n ")]),e._v(".\n ")])])],1)},[]),{AccountSettings:AccountSettings}},!0,!0,{filename:"src/view/header/account-settings.vue"}),_reviewable.define(["AgentSettings"],["truss","Guide","session"],function(e,t,s){"use strict";class AgentSettings{constructor(){Vue.set(this,"connector",void 0),Vue.set(this,"tagEdited",!1),Vue.set(this,"busy",!1),Vue.set(this,"error",void 0),Vue.set(this,"reissuedApiKey",void 0)}created(){Vue.set(this,"connector",e.connect({tag:_ref(this.$store,"child","users",this.agentKey,"core","public","tag"),agent:_ref(this.$store,"child","users",this.agentKey,"agent")}))}beforeDestroy(){if(this.tagEdited&&this.tagName&&this.tagColor){const e=_.toUpper(this.tagName).replace(/[^A-Z0-9_-]/g,"").slice(0,4)||"AGNT",t=_get(this,"$store","users","current","core","public");_ref(this.$store,"child","users",this.agentKey,"core","public").update({tag:{name:e,color:this.tagColor},...t&&{username:`${t.username}+${e}`,displayName:`Agent ${e} for ${t.displayName||t.username}`}})}}get apiKey(){return this.reissuedApiKey||this.newApiKey}get tag(){return _get(this,"$store","users",this.agentKey,"core","public","tag")}get agent(){return _get(this,"$store","users",this.agentKey,"agent")}get tagName(){return _get(this,"tag","name")}set tagName(e){e!==this.tagName&&(Vue.set(this,"tagEdited",!0),Vue.set(s.onboarding,"editedAgentTag",!0),e=_.toUpper(e).slice(0,4),_ref(this.$store,"child","users",this.agentKey,"core","public","tag","name").override(e))}get tagColor(){return _get(this,"tag","color")}set tagColor(e){e!==this.tagColor&&(Vue.set(this,"tagEdited",!0),Vue.set(s.onboarding,"editedAgentTag",!0),_ref(this.$store,"child","users",this.agentKey,"core","public","tag","color").override(e))}get repositoriesGlob(){return _get(this,"agent","settings","repositoriesGlob")}set repositoriesGlob(e){if(Vue.set(this,"error",void 0),(e=e||null)!==(this.repositoriesGlob||null)){Vue.set(s.onboarding,"editedAgentRepositoriesGlob",!0);try{this.$store.services.completions.people.validateRepoGlob(e),_ref(this.$store,"child","users",this.agentKey,"agent","settings","repositoriesGlob").set(e)}catch(e){Vue.set(this,"error",e.message)}}}async reissue(){if(!this.busy){Vue.set(s.onboarding,"reissuedAgentToken",!0),Vue.set(this,"error",void 0),Vue.set(this,"busy",!0);try{const{apiKey:e}=await this.$store.queues.requests.send({action:"activateAgent",agentKey:this.agentKey,type:this.agent.type},{timeout:1e4});Vue.set(this,"reissuedApiKey",e)}catch(e){Vue.set(this,"error",e.message)}finally{Vue.set(this,"busy",!1)}}}async retire(){if(!this.busy){Vue.set(s.onboarding,"retiredAgent",!0),Vue.set(this,"error",void 0),Vue.set(this,"busy",!0);try{await this.$store.queues.requests.send({action:"retireAgent",agentKey:this.agentKe
1y},{timeout:1e4}),Vue.set(this,"reissuedApiKey",void 0)}catch(e){Vue.set(this,"error",e.message)}finally{Vue.set(this,"busy",!1)}}}}AgentSettings.$vueOptions={props:{agentKey:{type:String,required:!0},newApiKey:String}};return _declareVue("AgentSettings",AgentSettings,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui dimmable",class:{dimmed:!_get(e,"connector","ready")}},[e._m(0),s("avatar",{staticClass:"agent avatar",attrs:{userKey:"replicant"===_get(e,"agent","type")?e.$info.userid:e.agentKey,display:"picture,popup"}}),s("div",{staticClass:"wrapper"},[s("div",{staticClass:"ui form"},[s("div",{staticClass:"fields"},[s("div",{staticClass:"tag field"},[s("label",[e._v("Tag "),s("span",{staticClass:"unobtrusive type"},[e._v("("+e._s(_get(e,"agent","type"))+")")])]),s("input",{directives:[{name:"text-model",rawName:"v-text-model",value:e.tagName,expression:"tagName"}],staticClass:"tag name",attrs:{type:"text",maxlength:"4",pattern:"[A-Z0-9_-]+"}}),s("input",{staticClass:"tag color",attrs:{type:"color"},domProps:{value:e.tagColor},on:{input:function(t){e.tagColor=t.target.value}}})]),s("div",{staticClass:"repositories field"},[s("label",[e._v("Repositories")]),s("input",{directives:[{name:"text-model",rawName:"v-text-model:debounce_250",value:e.repositoriesGlob,expression:"repositoriesGlob",arg:"debounce_250"}],attrs:{type:"text",placeholder:"*/*"}})])])]),s("div",{staticClass:"api key"},[e.apiKey?s("span",[s("span",[e._v("Token: ")]),s("span",{staticClass:"full token"},[e._v(e._s(e.apiKey))]),s("span",[e._v(" "),s("copy-button",{attrs:{text:e.apiKey}})],1)]):_get(e,"agent","apiKeyPrefix")?s("span",[s("span",[e._v("Token: ")]),s("span",{staticClass:"token"},[e._v(e._s(_get(e,"agent","apiKeyPrefix"))+"â¦")]),s("div",{staticClass:"ui dimmable actions",class:{dimmed:e.busy}},[e._m(1),s("ui-button",{staticClass:"mini basic circular reissue",on:{click:e.reissue}},[e._v("Reissue")]),s("ui-button",{staticClass:"mini basic circular retire",on:{click:e.retire}},[e._v("Revoke")])],1)]):s("span",[e._v("\n Token: none\n "),s("div",{staticClass:"ui dimmable actions",class:{dimmed:e.busy}},[e._m(2),s("ui-button",{staticClass:"mini basic circular reissue",on:{click:e.reissue}},[e._v("Reactivate")])],1)])]),_get(e,"agent","lastRequest")?s("div",{staticClass:"unobtrusive last request"},[e._v("\n Last seen:\n "+e._s(e._f("shortDateTime")(new Date(e.agent.lastRequest.timestamp)))+"\n from "+e._s(e.agent.lastRequest.ipAddress)+"\n ")]):e._e(),e.error?s("div",{staticClass:"ui error message"},[e._v(e._s(e.error))]):e._e()])],1)},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ui simple inverted dimmer"},[t("div",{staticClass:"ui loader"})])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ui simple inverted dimmer"},[t("div",{staticClass:"ui mini loader"})])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ui simple inverted dimmer"},[t("div",{staticClass:"ui mini loader"})])}],functional:!1},{scopeId:"data-v-4da60648"}),_declareGuides("AgentSettings","data-v-4da60648",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".tag.field[data-v-4da60648]",onboarding:"editedAgentTag",highlight:"bracket"}},[s("p",[e._v("\n The "),s("em",[e._v("agent's name")]),e._v(" and the "),s("em",[e._v("color of the tag")]),e._v(" applied to your avatar to give the\n agent its own identity.\n ")]),e._v(" "),s("p",[e._v("\n You may want to edit these to more easily distinguish multiple agents, or to better harmonize\n with your avatar's color scheme.\n ")])]),e._v(" "),s("guide",{attrs:{for:".repositories.field[data-v-4da60648]",onboarding:"editedAgentRepositoriesGlob",highlight:"bracket"}},[s("p",[e._v("\n A comma-separated list of "),s("em",[s("code",[e._v("owner/repo")]),e._v(" globs")]),e._v(" that selects the repositories\n your agent will be allowed to access.\n ")]),e._v(" "),s("p",[e._v("\n Your agents "),s("em",[e._v("inherit all of your own permissions")]),e._v(" by default but you can use these\n globs to constrain them. An agent will never have more permissions than you, though.\n ")])]),e._v(" "),s("guide",{attrs:{for:".reissue.button[data-v-4da60648]",onboarding:"reissuedAgentToken"}},[s("p",[e._v("\n Issue a "),s("em",[e._v("fresh token")]),e._v(" for the agent. Useful if you lost the current one, need to\n rotate it, or you previously retired the agent.\n ")])]),e._v(" "),s("guide",{attrs:{for:".retire.button[data-v-4da60648]",onboarding:"retiredAgent"}},[s("p",[e._v("\n Retire the agent, immediately "),s("em",[e._v("revoking its token")]),e._v(". Any sessions in progress will be\n terminated on the agent's next request.\n ")])])],1)},[]),{AgentSettings:AgentSettings}},!0,!0,{filename:"src/view/header/agent-settings.vue"}),_reviewable.define(["AppHeader"],["truss","Guide","hotkeys","config","modifiers","router","bus"],function(e,t,s,i,r,n,a){"use strict";class AppHeader{constructor(){Vue.set(this,"chatUrl",void 0),Vue.set(this,"homeUrl",void 0)}created(){Vue.set(this,"chatUrl",i.chatUrl||null),Vue.set(this,"homeUrl","reviewable.io"===location.hostname?"https://www.reviewable.io":null)}mounted(){if(_.has(n.query,"autologin")){const e=_.omit(n.query,"autologin");n.go({query:e}),this.$when(()=>void 0!==this.$info.user).then(()=>{this.$info.user||this.login("redirect")})}}get currentPageClass(){return n.current.pageClass}get lastReviewsPath(){return"dashboard-page"===this.currentPageClass?"/reviews":this.$store.services.auth.lastReviewsPath}
1loginAndGoTo(e,t,s){if(!r.externalLinkActive)return s.preventDefault(),this.$store.services.auth.login(null,"optional").then(()=>{this.$info.userid&&(Vue.set(this.$session.onboarding,t,!0),n.go({path:e,hash:null}))}),!1}toggleCheatSheet(){s.toggleCheatSheet()}toggleSupport(){Vue.set(this.$session.onboarding,"showedSupportMenu",!0)}showGuideMap(){a.showGuideMap()}navigateToReviews(){n.go({path:this.lastReviewsPath})}login(e){this.$store.services.auth.login(void 0,e).then(()=>{"/"===n.path&&this.navigateToReviews()})}logout(){this.$session.auth.logout().then(()=>{this.$emit("logged-out")})}openChat(){i.chatUrl?this.$session.analytics.track("Opened Chatroom",{from:"support"}):_access(window,"","MissiveChat","","open","call",[])}}AppHeader.$vueOptions={props:{isReview:Boolean}};return _declareVue("AppHeader",AppHeader,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"medium page header",attrs:{id:"app-header"}},[s("div",{staticClass:"ui large inverted borderless attached top labeled icon fluid menu"},[s("div",{staticClass:"title glow"}),s("a",{staticClass:"title item",class:{disabled:!e.homeUrl},attrs:{href:e.homeUrl}},[s("span",{staticClass:"text"},[e._v("Reviewable")])]),s("a",{staticClass:"reviews item",class:{hover:"dashboard-page"===e.currentPageClass},attrs:{href:e.lastReviewsPath},on:{click:function(t){return e.loginAndGoTo(e.lastReviewsPath,"visitedReviews",t)}}},[s("i",{staticClass:"reviews dashboard icon"}),e._v("\n Reviews\n ")]),s("a",{staticClass:"admin item",class:{hover:"admin-page"===e.currentPageClass},attrs:{href:"/admin"},on:{click:function(t){return e.loginAndGoTo("/admin","visitedRepositories",t)}}},[s("i",{staticClass:"admin center icon"}),e._v("\n Admin"),s("span",{staticClass:"ample only"},[e._v("Â Center")])]),s("div",{staticClass:"menu right"},[s("div",{staticClass:"ui support dropdown item",on:{click:e.toggleSupport}},[s("i",{staticClass:"support icon"}),s("i",{staticClass:"dropdown icon"}),e._v("\n Support\n "),s("tippy-dropdown",{attrs:{options:{offset:[0,1],theme:"support dropdown-flat-top",zIndex:1e6}}},[s("div",{staticClass:"ui vertical menu guide passthrough support"},[s("div",[s("a",{staticClass:"show guide map item",on:{click:e.showGuideMap}},[s("i",{staticClass:"help icon"}),e._v(" Help "),s("span",{staticClass:"cfp-hotkeys-key"},[e._v("H")])]),s("a",{staticClass:"item",attrs:{href:"https://docs.reviewable.io",target:"_blank"},on:{click:function(t){return e.$session.analytics.track("Opened user guide",{from:"support"})}}},[s("i",{staticClass:"user guide icon"}),e._v(" User guide\n ")]),s("a",{staticClass:"item",on:{click:e.toggleCheatSheet}},[s("i",{staticClass:"keyboard shortcuts icon"}),e._v(" Shortcuts\n ")]),s("a",{staticClass:"item",on:{click:function(t){e.$store.services.changelog.displayed=!0}}},[s("i",{staticClass:"changelog icon"}),e._v(" Changelog\n ")]),s("a",{staticClass:"item",attrs:{href:"https://github.com/Reviewable/Reviewable/issues",target:"_blank",rel:"noopener"},on:{click:function(t){return e.$session.analytics.track("Opened Issues",{from:"support"})}}},[s("i",{staticClass:"issues icon"}),e._v(" Issues\n ")]),"off"!==e.chatUrl?s("a",{staticClass:"item",attrs:{href:e.chatUrl,target:"_blank",rel:"noopener"},on:{click:e.openChat}},[s("i",{staticClass:"chatroom icon"}),e._v(" Chat\n ")]):e._e(),s("a",{staticClass:"item",attrs:{href:"mailto:[email protected]",target:"_blank",rel:"noopener"},on:{click:function(t){return e.$session.analytics.track("Opened Email Us",{from:"support"})}}},[s("i",{staticClass:"email us icon"}),e._v(" Email us\n ")]),s("div",{staticClass:"item compliance"},[s("span",{staticClass:"small"},[s("i",{staticClass:"legal icon"}),e._v(" Legal")]),s("div",{staticClass:"menu"},[e.$session.config.termsUrl?s("a",{staticClass:"item",attrs:{href:e.$session.config.termsUrl,target:"_blank",rel:"noopener"}},[e._v("Terms\n ")]):e._e(),e.$session.config.privacyUrl?s("a",{staticClass:"item",attrs:{href:e.$session.config.privacyUrl,target:"_blank",rel:"noopener"}}
1,[e._v("Privacy\n ")]):e._e(),s("a",{staticClass:"item",attrs:{href:"/open_source_licenses.txt",target:"_blank",rel:"noopener"}},[e._v("OSS licenses\n ")])])]),e.config.systemBuild?s("div",{staticClass:"unobtrusive"},[e._v("v"+e._s(e.config.systemBuild))]):e._e()])])])],1),s("span",{directives:[{name:"show",rawName:"v-show",value:e.$session.auth.shouldShowLogin&&!e.isReview,expression:"$session.auth.shouldShowLogin && !isReview"}],staticClass:"signin item"},[s("span",{staticClass:"ui labeled icon green sign in button",class:{disabled:e.$session.auth.disabled},on:{click:e.login}},[s("i",{staticClass:"github icon"}),e._v("\n Sign in "),s("span",{staticClass:"wide only"},[e._v("with GitHub")])])]),e.$session.user?s("user-item"):e._e(),s("a",{directives:[{name:"show",rawName:"v-show",value:e.$session.user,expression:"$session.user"}],staticClass:"signout item",class:{disabled:e.$session.auth.disabled},on:{click:e.logout}},[s("i",{staticClass:"sign out icon"})])],1)])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-6088fea1"}),_declareGuides("AppHeader","data-v-6088fea1",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".page.header .reviews.item[data-v-6088fea1], .return.reviews.link[data-v-6088fea1]",onboarding:"visitedReviews",highlight:"under"}},[s("p",[e._v("\n Navigate to your review dashboard, which shows all the\n "),s("em",[e._v("pull requests you're involved in")]),e._v(", and optionally also all those you're able to merge.\n ")]),e._v(" "),s("p",[e._v("\n If you visit a repository-specific dashboard via a link on the Repositories page, this button\n will return you to that dashboard by default. Click again to see your personal dashboard\n instead.\n ")])]),e._v(" "),s("guide",{attrs:{for:".page.header .admin.item[data-v-6088fea1]",onboarding:"visitedRepositories",highlight:"under"}},[s("p",[e._v("\n Navigate to your list of repositories, where you can "),s("em",[e._v("connect / disconnect")]),e._v("\n automatic review creation, manage your "),s("em",[e._v("subscriptions")]),e._v(", and configure\n "),s("em",[e._v("organization settings")]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".page.header .supp
1ort.item[data-v-6088fea1]",onboarding:"showedSupportMenu",highlight:"under"}},[s("p",[e._v("\n If you need "),s("em",[e._v("help")]),e._v(" with Reviewable, found a "),s("em",[e._v("bug")]),e._v(", or just want to\n "),s("em",[e._v("chat")]),e._v(", check out this menu for support options.\n ")])]),e._v(" "),s("guide",{attrs:{for:".sign.in.button[data-v-6088fea1]",onboarding:"signedIn"}},[s("p",[s("em",[e._v("Sign in")]),e._v(" using your GitHub account. While you can explore public reviews\n anonymously, you'll need to sign in to "),s("em",[e._v("see private reviews or make comments")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n Signing in takes just two clicks. We won't ask for any more permissions than we "),s("a",{staticClass:"link",attrs:{target:"_blank",href:"https://docs.reviewable.io/registration#github-authorizations"}},[e._v("absolutely need")]),e._v(", just before we need them, so you can get started with none at all.\n ")])]),e._v(" "),s("guide",{attrs:{for:".page.header .signout.item[data-v-6088fea1]",onboarding:"signedOut",highlight:"under"}},[s("p",[s("em",[e._v("Sign out")]),e._v(" of Reviewable. Note that this does not sign you out in any other browsers,\n nor does it revoke your GitHub authorization.\n ")])]),e._v(" "),s("guide",{attrs:{for:".user.item[data-v-6088fea1]",onboarding:"showedAccountSettings",highlight:"under"}},[s("p",[e._v("\n Manage your "),s("em",[e._v("global settings and customizations")]),e._v(". Includes an animations off switch!\n ")])])],1)},[]),{AppHeader:AppHeader}},!0,!0,{filename:"src/view/header/app-header.vue"}),_reviewable.define(["BadReviewBanner"],["truss","Guide","corpsman"],function(e,t,s){"use strict";class BadReviewBanner{constructor(){Vue.set(this,"headCommitSha",void 0),Vue.set(this,"errorOverrideRef",void 0),Vue.set(this,"overridePromise",void 0),Vue.set(this,"overrideError",void 0)}created(){const e=_ref(this.$store,"child","repositories",_.toLower(this.core.ownerName),_.toLower(this.core.repoName));Vue.set(this,"errorOverrideRef",_ref(this,"child","core","errorOverride"));const t=this.$connect(this,{connection:()=>_ref(e,"child","core","connection"),errorOverride:this.errorOverrideRef,gitHubStatusUpdates:()=>_ref(e,"child","core","settings","gitHubStatusUpdates")});Promise.all([this.$session.hubkit(this.core.ownerName,this.core.repoName).request("/repos/:owner/:repo/pulls/:prNumber",{prNumber:this.core.pullRequestId}),this.$when(()=>t.ready)]).then(([e])=>{Vue.set(this,"headCommitSha",e.head.sha)})}get adminVerdict(){return _access(this,"","$store","","services","","warden","","getVerdict","call",[this.core.ownerName,this.core.repoName],"","admin")}get overridePossible(){return"active"===this.connection&&"never"!==this.gitHubStatusUpdates}override(){!this.overridePromise&&this.adminVerdict&&(Vue.set(this,"overrideError",void 0),Vue.set(this,"overridePromise",this.errorOverrideRef.set({commitSha:this.headCommitSha,userKey:this.$info.userid}).then(()=>this.$store.queues.reconciliation.request(this.core.ownerName,this.core.repoName,this.core.pullRequestId,"override status",{reviewKey:this.core.$reviewKey,scope:this,waitForCompletion:!0})).catch(e=>{Vue.set(this,"overrideError",e.toString()),s.markHandled(e)}).finally(()=>{Vue.set(this,"overridePromise",void 0)})))}}BadReviewBanner.$vueOptions={props:{core:{type:Object,required:!0}}};return _declareVue("BadReviewBanner",BadReviewBanner,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("div",[e._v("\n Review broken: "+e._s(e.core.error)+e._s(_access(e,"","core","","error","","endsWith","call",["."])?"":".")+"\n "),e.headCommitSha?_get(e,"errorOverride","commitSha")!==e.headCommitSha||e.overridePromise?e.overridePossible?s("span",[s("ui-button",{staticClass:"override button",attrs:{disabled:!e.adminVerdict||!!e.overridePromise},on:{click:e.override}},[e.overridePromise?s("i",{staticClass:"spinner icon"}):s("i",{staticClass:"success status check icon"}),e._v("\n Override status check\n ")]),s("span",{staticClass:"unobtrusive"}
1,[e._v(" (repository admins only)")])],1):e._e():s("span",{staticClass:"status message"},[e._v("\n Reviewable status check "),s("i",{staticClass:"success status check icon"}),e._v(" overriden by\n "),s("avatar",{attrs:{"user-key":e.errorOverride.userKey,display:"name,username,picture",size:"tiny"}}),e._v("\n at commit "),s("span",{staticClass:"monospace"},[e._v(e._s(e.headCommitSha.slice(0,7)))]),e._v(".\n ")],1):s("span",[s("i",{staticClass:"spinner icon"}),e._v(" Loading status check details...\n ")])]),e.overrideError?s("div",[e._v("\n Error overriding status check: "+e._s(e.overrideError)+".\n ")]):e._e()])},staticRenderFns:[],functional:!1},{scopeId:"data-v-26b2b0d2"}),_declareGuides("BadReviewBanner","data-v-26b2b0d2",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".override.button[data-v-26b2b0d2]",onboarding:"overrodeStatusCheck"}},[s("p",[e._v("\n Force Reviewable's "),s("span",{staticClass:"monospace"},[e._v("code-review/"),s("wbr"),e._v("reviewable")]),e._v(" "),s("em",[e._v("status on GitHub")]),e._v(" to be "),s("i",{staticClass:"success status check icon"}),e._v(" "),s("em",[e._v("successful")]),e._v(" for\n the pull request's current head commit, even though the review is broken and likely\n incomplete.\n ")]),e._v(" "),s("p",[e._v("\n Only repository admins can do this.\n ")])])],1)},[]),{BadReviewBanner:BadReviewBanner}},!0,!0,{filename:"src/view/header/bad-review-banner.vue"}),_reviewable.define(["ChangelogNotifier"],["truss"],function(e){"use strict";class ChangelogNotifier{constructor(){Vue.set(this,"changelog",this.$store.services.changelog)}}return _declareVue("ChangelogNotifier",ChangelogNotifier,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.changelog.availableChanges?s("div",{staticClass:"wrapper",on:{click:function(t){e.changelog.displayed=!0}}},[s("div",{staticClass:"dot",class:e.changelog.availableChanges})]):e._e()},staticRenderFns:[],functional:!1},{scopeId:"data-v-5c8af962"}),{ChangelogNotifier:ChangelogNotifier}},!0,!0,{filename:"src/view/header/changelog-notifier.vue"}),_reviewable.define(["EditorLinkTemplate"],["truss","Guide","config"],function(e,t,s){"use strict";const i="--workspace-path--",r=[{id:"atom",name:"Atom",template:`atm://open?url=file://${i}/{{repo}}/{{path}}&line={{line}}`},{id:"eclipse",name:"Eclipse",template:`openineclipse://open?url=file://${i}/{{repo}}/{{path}}&line={{line}}`},{id:"emacs",name:"Emacs",template:`emacs://open?url=file://${i}/{{repo}}/{{path}}&line={{line}}`},{id:"github",name:"GitHub",template:`${s.gitHubUrl}/{{owner}}/{{repo}}/edit/{{headBranch}}/{{path}}?pr=%2F{{owner}}%2F{{repo}}%2Fpull%2F{{pr}}#L{{line}}`},{id:"intellij-idea",name:"IntelliJ IDEA",template:`idea://open?file=${i}/{{repo}}/{{path}}&line={{line}}`},{id:"php-storm",name:"PHPStorm",template:`phpstorm://open?file=${i}/{{repo}}/{{path}}&line={{line}}`},{id:"pycharm",name:"PyCharm",template:`pycharm://open?file=${i}/{{repo}}/{{path}}&line={{line}}`},{id:"sublime-text",name:"Sublime Text",template:`subl://open?url=file://${i}/{{repo}}/{{path}}&line={{line}}`},{id:"text-mate",name:"TextMate",template:`txmt://open?url=file://${i}/{{repo}}/{{path}}&line={{line}}`},{id:"visual-studio-code",name:"VS Code",template:`vscode://file/${i}/{{repo}}/{{path}}:{{line}}`},{id:"visual-studio-code-ssh",name:"VS Code / SSH",needsHost:!0,template:`vscode://vscode-remote/ssh-remote+${i}/{{repo}}/{{path}}:{{line}}`},{id:"visual-studio-code-wsl",name:"VS Code / WSL",needsDistro:!0,template:`vscode://vscode-remote/wsl+${i}/{{repo}}/{{path}}:{{line}}`},{id:"custom",name:"Custom",template:""}];class EditorLinkTemplate{constructor(){Vue.set(this,"templates",r),Vue.set(this,"selectedTemplate",null),Vue.set(this,"workspacePath",""),Vue.set(this,"interacted",!1)}created(){const e=this.$session.settings.lineLinkEditor,t=e&&_(this.templates).map("id").includes(e)?e:"custom";Vue.set(this,"selectedTemplate",_.find(this.templates,e=>e.id===t)),Vue.set(this,"workspacePath",this.$session.settings.lineLinkWorkspacePath)}get showErrorMessage(){const e=this.hasCustomTemplate&&_.isEmpty(this.customTemplateSetting),t=!this.hasCustomTemplate&&_.isEmpty(this.workspacePathSetting)&&"github"!==this.selectedTemplate.id,s=this.interacted||this.visitedFromExternal;return this.$session.onboarding.linkedToFile&&s&&(t||e||this.compilationError)}get compilationError(){return this.$session.computed.lineLinkTemplateCompilationError}get workspacePathSetting(){return this.workspacePath}set workspacePathSetting(e){Vue.set(this,"interacted",!0),Vue.set(this,"workspacePath",e),this.replaceTemplate()}get customTemplateSetting(){return this.$session.settings.lineLinkTemplate}set customTemplateSetting(e){Vue.set(this,"interacted",!0),Vue.set(this.$session.settings,"lineLinkTemplate",e),this.replaceCustomTemplate()}get template(){return this.selectedTemplate?this.selectedTemplate.template:""}get hasCustomTemplate(){return"custom"===_get(this,"selectedTemplate","id")}get hasWorkspacePathSetting(){return _.includes(this.template,i)}get defaultWorkspacePath(){let e="";return this.selectedTemplate.needsHost?e="example.com":this.selectedTemplate.needsDistro&&(e="Distro-Name"),`${e||(s.windows?"c:":"")}/directory/with/repos`}selectTemplate(e){Vue.set(this,"interacted",!0),Vue.set(this,"selectedTemplate",e),this.hasCustomTemplate?this.replaceCustomTemplate():this.replaceTemplate()}replaceTemplate(){const e=this.workspacePath?_.trim(this.workspacePath.replace(/\/+$/,"")):this.defaultWorkspacePath,t=this.template.replace(i,e);Vue.set(this.$session.settings,"lineLinkTemplate",t),Vue.set(this.$session.settings,"lineLinkEditor",this.selectedTemplate.id),Vue.set(this.$session.settings,"lineLinkWorkspacePath",this.workspacePath)}replaceCustomTemplate(){Vue.set(this.$session.settings,"lineLinkEditor",this.selectedTemplate.id),Vue.set(this.$session.settings,"lineLinkWorkspacePath",null)}}EditorLinkTemplate.$vueOptions={props:{visitedFromExternal:Boolean,accountSettingsRef:Object}};return _declareVue("EditorLinkTemplate",EditorLinkTemplate,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"field line-link-template"},[s("label",[e._v("External editor link template")]),s("div",{staticClass:"inline field template flex column"},[s("div",{staticClass:"flex row"},[s("multiselect",{staticClass:"editor-templates",attrs:{value:e.selectedTemplate,options:e.templates,"track-by":"id",label:"name",placeholder:"Select template",searchable:!1,"show-labels":!1,"replicate-root-class":"","tippy-options":{zIndex:1e6,parentTippy:e.accountSettingsRef}},on:{select:e.selectTemplate}}),e.hasCustomTemplate?s("input",{directives:[{name:"text-model",rawName:"v-text-model:debounce_500",value:e.customTemplateSetting,expression:"customTemplateSetting",arg:"debounce_500"}],key:"custom-template-input",attrs:{type:"text",placeholder:"scheme://see/docs/for/syntax"}}):s("input",{directives:[{name:"text-model",rawName:"v-text-model:debounce_500",value:e.workspacePathSetting,expression:"workspacePathSetting",arg:"debounce_500"}],key:"workspace-path-input",attrs:{disabled:!e.hasWorkspacePathSetting,type:"text",placeholder:e.hasWorkspacePathSetting&&e.defaultWorkspacePath}})],1)]),s("animate-slide-down",[s("div",{directives:[{name:"show",rawName:"v-show",value:e.showErrorMessage,expression:"showErrorMessage"}],staticClass:"ui yellow message"},[e._v("\n "+e._s(e.compilationError||"You must fill out the template to use external editor links.")+"\n "),s("span",[e._v("\n See the\n "),s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/accountsettings#external-editor-line-link-template"}},[e._v("\n docs\n ")]),e._v(" for more info.\n ")])])])],1
1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-590b218e"}),_declareGuides("EditorLinkTemplate","data-v-590b218e",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".line-link-template[data-v-590b218e]",onboarding:"customizedLineLinkTemplate",position:"left",highlight:"bracket"}},[s("p",[e._v("\n Set the "),s("em",[e._v("destination of the line link")]),e._v(" in the upper-right corner of discussions.\n ")]),e._v(" "),s("p",[e._v("\n This goes to GitHub by default but can instead "),s("em",[e._v("open the file in your favorite editor")]),e._v("\n on the right line. Select one of the editors from the list and enter the workspace path where\n the repositories can be located. You can also define a custom template. See\n "),s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/accountsettings#custom-line-link-template",target:"_blank"}},[e._v("\n the user guide\n ")]),e._v(" for examples and details of the syntax.\n ")])])],1)},[]),{EditorLinkTemplate:EditorLinkTemplate}},!0,!0,{filename:"src/view/header/editor-link-template.vue"}),_reviewable.define(["FrownBanner"],["truss","Guide","corpsman","router"],function(e,t,s,i){"use strict";class FrownBanner{constructor(){Vue.set(this,"connector",void 0)}get condition(){return s.condition}get conditionData(){return s.conditionData}get reviewBusy(){return"badreview"===this.condition&&_.startsWith(_get(this,"conditionData","error"),"Review busy: ")}get severity(){return this.reviewBusy?"info":"error"}get icon(){return this.reviewBusy?"work in progress":"frowning face"}get organization(){return i.params.owner}get trialStatus(){this.connector||Vue.set(this,"connector",this.$connect(this,{coverage:_ref(this.$store,"child","organizations",_.toLower(this.organization),"coverage")}));const e=this.$store.services.warden.getVerdict(this.organization);return e?e.member?this.connector.ready?_get(this,"coverage","trialStatus")||"available":"pending":"not-a-member":"pending"}subscribe(){i.go({path:`/admin/${this.organization}`,query:null,hash:null})}}return _declareVue("FrownBanner",FrownBanner,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.condition?s("div",{staticClass:"ui large icon attached frown message",class:e.severity},[s("i",{staticClass:"icon",class:e.icon,attrs:{alt:""}}),"autherror"===e.condition?s("div",{staticClass:"content"},[e._v("\n "+e._s(e.conditionData)+"\n ")]):"authstale"===e.condition?s("div",{staticClass:"content"},[e._v("\n Your GitHub authorization is out of date, please\n "),s("ui-button",{staticClass:"labeled icon green",attrs:{disabled:e.$session.auth.disabled},on:{click:function(t){return e.$session.auth.login(null,"optional")}}},[s("i",{staticClass:"github icon",attrs:{alt:"github"}}),e._v("\n sign in\n ")]),e._v("\n again to continue working.\n ")],1):"samlerror"===e.condition?s("div",{staticClass:"content"},[e._v("\n Your GitHub organization "+e._s(e.conditionData)+" has enforced SAML authorization. Please\n "),s("ui-button",{staticClass:"labeled icon green",attrs:{disabled:e.$session.auth.disabled},on:{click:function(t){return e.$session.auth.login(null,"optional")}}},[s("i",{staticClass:"github icon",attrs:{alt:"github"}}),e._v("\n sign in\n ")]),e._v("\n again and authorize access to "+e._s(e.conditionData)+". For more details,\n "),s("a",{staticClass:"link",attrs:{target:"_blank",href:"https://docs.reviewable.io/registration#saml-authorization"}},[e._v("see docs")]),e._v(".\n ")],1):"badbrowser"===e.condition?s("div",{staticClass:"content"},[e._v("\n Sorry, but the browser you're using lacks some features that Reviewable needs to work.\n Please try using a different, modern browser. We generally try to support the latest versions\n of Chrome, Firefox, and Safari on both desktop and mobile platforms.\n ")]):"alloworigin"===e.condition?s("div",{staticClass:"content"},[e._v("\n It looks like Reviewable's requests to "+e._s(e.$session.config.gitHubApiUrl)+" are not getting\n through. Please check your network connection, make sure to disable any browser extensions\n that may be blocking cross-domain requests, and reload the page to try again.\n ")]):"ghquota"===e.condition?s("div",{staticClass:"content"},[e._v("\n Sorry, but\n "),e.$session.user?s("span",[e._v("you've run out of")]):s("span",[e._v("your IP address has run out of anonymous")]),e._v("\n GitHub request quota.\n "),e.$session.user?s("span",[e._v("\n You might want to check if you have other\n "),s("a",{staticClass:"link",attrs:{href:e.$session.config.gitHubUrl+"/settings/applications"}},[e._v("\n authorized GitHub applications\n ")]),e._v("\n that are drawing more than their fair share from your account's common pool.\n ")]):s("span",[e._v("\n You'll need to\n "),s("ui-button",{staticClass:"labeled icon green",attrs:{disabled:e.$session.auth.disabled},on:{click:function(t){return e.$session.auth.login(null,"optional")}}},[s("i",{staticClass:"github icon",attrs:{alt:"github"}}),e._v("\n sign in\n ")]),e._v("\n to continue working.\n ")],1)]):"ghsuspended"===e.condition?s("div",{staticClass:"content"},[e._v("\n Sorry, but this GitHub account has been suspended.\n ")]):"notallowed"===e.condition?s("div",{staticClass:"content"},[e._v("\n Sorryâeither this review doesn't exist or\n "),e.$session.user?s("span",[e._v("\n you don't have permission to access it.\n "),e.$session.config.privateReposAllowed&&!e.$session.hasScope("repo")?s("span",[e._v("\n If this is a private repo, you need to\n "),s("ui-button",{staticClass:"green",attrs:{disabled:e.$session.auth.disabled},on:{click:function(t){return e.$session.auth.login(["repo"],"optional")}}},[e._v("grant authorization")]),e._v("\n to Reviewable to access it.\n ")],1):e._e(
1)]):s("span",[e._v("\n it isn't public. You should probably\n "),s("ui-button",{staticClass:"green",attrs:{disabled:e.$session.auth.disabled},on:{click:function(t){return e.$session.auth.login(null,"optional")}}},[e._v("\n sign in\n ")]),e._v(".\n ")],1)]):"badprnumber"===e.condition?s("div",{staticClass:"content"},[e._v('\n Invalid pull request number in URL: "'+e._s(e.conditionData)+'"\n ')]):"notcreated"===e.condition?s("div",{staticClass:"content"},[e._v("\n Unable to create review: "+e._s(e.conditionData)+"\n "),/not covered by a subscription/i.test(e.conditionData)?s("span",["available"===e.trialStatus?s("span",[e._v("\n Please subscribe or start a free trial.\n ")]):"cooldown"===e.trialStatus?s("span",[e._v("\n The trial for your organization has expired.\n ")]):"not-a-member"===e.trialStatus?s("span",[e._v("\n Only members of the organization can start a trial or subscribe.\n ")]):"pending"===e.trialStatus?s("span",[e._v("\n Checking for trial eligibility...\n ")]):e._e(),"available"===e.trialStatus||"cooldown"===e.trialStatus?s("ui-button",{staticClass:"labeled icon subscribe",class:"available"===e.trialStatus?"small circular":"green",on:{click:e.subscribe}},[s("i",{staticClass:"generic card icon"}),e._v("\n Subscribe\n ")]):e._e(),"available"===e.trialStatus?s("trial-button",{staticClass:"green",attrs:{organization:e.organization},on:{trialStarted:function(t){return e.$session.corpsman.clearCondition("notcreated")}}}):e._e()],1):e._e()]):"badlicense"===e.condition?s("div",{staticClass:"content"},[e._v("\n Unable to access review: "+e._s(e.conditionData)+"\n ")]):e.reviewBusy?s("div",{staticClass:"content"},[e._v("\n "+e._s(e.conditionData.error)+"\n ")]):"badreview"===e.condition?s("bad-review-banner",{staticClass:"content",attrs:{core:e.conditionData}}):"notrial"===e.condition?s("div",{staticClass:"content"},[e._v("\n Failed to start trial: "+e._s(e.conditionData)+"\n ")]):e._e()],1):e._e()},staticRenderFns:[],functional:!1},{scopeId:"data-v-4c6209a2"}),_declareGuides("FrownBanner","data-v-4c6209a2",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".subscribe.button[data-v-4c6209a2]",onboarding:"subscribed",position:"left"}},[s("p",[s("em",[e._v("Subscribe")]),e._v(" to a plan for this organization's "),s("em",[e._v("private repositories")]),e._v(".\n ")])])],1)},[]),{FrownBanner:FrownBanner}},!0,!0,{filename:"src/view/header/frown-banner.vue"}),_reviewable.define(["UserItem"],["truss","safeStorage","session"],function(e,t,s){"use strict";const i=["--diff-add","--diff-remove"],r=document.documentElement;class UserItem{constructor(){Vue.set(this,"visitedFromExternal",!1),Vue.set(this,"header",this.$store.services.header)}created(){const e=_.debounce(e=>{if(_access(document,"","getElementById","call",["custom-syntax-stylesheet"],"","remove","call",[]),e){const t=document.createElement("link");Vue.set(t,"rel","stylesheet"),Vue.set(t,"id","custom-syntax-stylesheet"),Vue.set(t,"href",e),document.head.appendChild(t)}const t=document.getElementById("custom-syntax-stylesheet");t?t.addEventListener("load",this.checkForDeprecatedCSSVariables):this.checkForDeprecatedCSSVariables()},250);this.$observe(()=>[s.settings.syntaxStylesheetUrl,_get(s,"settings","a11y","colorblind")],([t,s])=>e(t))}mounted(){this.$observe(()=>this.header.accountSettings.showing,(e,t)=>{void 0!==t&&(Vue.set(this,"visitedFromExternal",!0),this.$refs.accountSettings&&this.$refs.accountSettings.toggle(e))})}checkForDeprecatedCSSVariables(e){const s=getComputedStyle(r);_.forEach(i,e=>{const i=s.getPropertyValue(e),r=t.session.getItem("reviewable:dismissed-deprecated-css-vars-message");Vue.set(this.$store.services.themeManager,"shouldShowOutdatedCSSVarsMessage",_.trim(i)&&_get(this,"$session","settings","a11y","redReplacement")&&!r)}),_get(e,"target")&&_access(e,"","target","","removeEventListener","call",["load",this.checkForDeprecatedCSSVariables])}scale(e,t){return.5===e?t:t<=.5?e<=.5?t*e*2:(4-8*t)*e*e+(10*t-4)*e+1-2*t:e>=.5?(1-t)*(e-.5)*2+t:(4-8*t)*e*e+(6*t-2)*e}handleLeave(e){e||Vue.set(this,"visitedFromExternal",!1)}get adjustedContrast(){return Math.max(10,s.settings.contrast||50)/100}}return _declareVue("UserItem",UserItem,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.$session.user?s("a",{staticClass:"user item dropdown-highlight dropdown-toggle"},[s("avatar",{attrs:{"user-key":e.$session.user.uid,display:"picture,username"}}),s("tippy-dropdown",{ref:"accountSettings",attrs:{options:{placement:"bottom",zIndex:1e6,offset:[0,1]}},on:{opened:function(t){return e.header.accountSettings.toggle(!0)},closed:function(t){return e.header.accountSettings.toggle(!1)},complete:function(t){return e.header.accountSettings.concludeAnimation()}}},[s("account-settings",{attrs:{visitedFromExternal:e.visitedFromExternal,"account-settings-ref":e.$refs.accountSettings}}
1)],1)],1):e._e()},staticRenderFns:[],functional:!1},{cssVarsGetter:function(e){return[[void 0,{"73f96bb641c0be6c":e.scale(e.adjustedContrast,.3),"73f96bb61351eda2":e.scale(e.adjustedContrast,.15),"73f96bb641c0be4d":e.scale(e.adjustedContrast,.2),"73f96bb61351d71c":e.scale(e.adjustedContrast,.45),"73f96bb641c0be2e":e.scale(e.adjustedContrast,.1),"73f96bb641c0bec9":e.scale(e.adjustedContrast,.6),"73f96bb641c0bec9":e.scale(e.adjustedContrast,.6)}],[void 0,{"73f96bb641c0bec9":e.scale(e.adjustedContrast,.6),"73f96bb641c0bec9":e.scale(e.adjustedContrast,.6)}]]},scopeId:"data-v-73f96bb6"}),{UserItem:UserItem}},!0,!0,{filename:"src/view/header/user-item.vue"}),_reviewable.define(["HomePage"],["truss","router","analytics"],function(e,t,s){"use strict";class HomePage{constructor(){Vue.set(this,"ready",!1)}created(){this.$observe(()=>this.$info.userid,()=>{this.$info.userid?t.go({path:this.$store.services.auth.lastReviewsPath,hash:null}):null===this.$info.userid&&Vue.set(this,"ready",!0)}),setTimeout(()=>{Vue.set(this,"ready",!0)},3e3),window.addEventListener("load",()=>{this.$destroyed||(s.time("show"),s.recordTimings({signedIn:!!this.$info.user}))})}logLocation(e){const t=e.target.getBoundingClientRect(),s=[e.clientX-t.left,e.clientY-t.top];console.log(s)}}return _declareVue("HomePage",HomePage,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.ready?s("div",{staticClass:"wrapper"},[s("div",{staticClass:"frame"},[s("twinkling-stars",{staticClass:"stars"}),s("img",{staticClass:"door",attrs:{src:"images/2031353b.safe_door_bunny_solid.svg",alt:""}}),s("svg",{staticClass:"door",attrs:{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 3003.5 1700.1"}},[s("use",{staticClass:"home-bunny-symbol",attrs:{href:"images/b1258283.safe_door_bunny.svg#home-bunny-symbol"}})]),s("div",{staticClass:"logo image"}),s("ui-button",{staticClass:"ui labeled green sign in button",class:{disabled:e.$session.auth.disabled},on:{click:function(t){return e.$session.auth.login(null,"optional")}}},[e._v("\n Sign in\n ")])],1)]):e._e()},staticRenderFns:[],functional:!1},{scopeId:"data-v-4294d7ca"}),{HomePage:HomePage}},!0,!0,{filename:"src/view/home-page.vue"}),_reviewable.define(["HotkeysSheet"],["truss","hotkeys","router"],function(e,t,s){"use strict";class HotkeysSheet{constructor(){Vue.set(this,"hotkeys",t)}get hotkeyList(){return _.filter(this.hotkeys.list,e=>{const t=_get(s,"current","pageClass");return this.hotkeys.isAvailableInContext(e.statements,t)})}get rows(){const e=[],t=Math.ceil(this.hotkeyList.length/2);for(let s=0;s<t;s++){const i=[];for(let e=0;e<2;e++){const r=this.hotkeyList[s+e*t];r&&i.push(r)}e.push(i)}return e}}return _declareVue("HotkeysSheet",HotkeysSheet,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("modal-overlay",{attrs:{closable:""},model:{value:e.hotkeys.helpVisible,callback:function(t){e.$set(e.hotkeys,"helpVisible",t)},expression:"hotkeys.helpVisible"}},[s("h3",{staticClass:"ui center aligned header"},[e._v("Keyboard Shortcuts")]),s("table",[s("tbody",e._l(e.rows,function(t,i){return s("tr",{key:"row"
1+i},[e._l(t,function(t,i){return[s("td",{key:"sequences"+i,staticClass:"cfp-hotkeys-keys"},e._l(t.sequences,function(t){return s("span",{key:t.source,staticClass:"cfp-hotkeys-group"},e._l(t,function(t,i){return s("span",{key:"hotkey"+i,staticClass:"cfp-hotkeys-key"},[e._v("\n "+e._s(t)+"\n ")])}),0)}),0),s("td",{key:"description"+i,staticClass:"cfp-hotkeys-text"},[e._v(e._s(t.description))])]})],2)}),0)]),s("div",{staticClass:"cfp-hotkeys-footer"},[s("div",[e.hotkeys.successfullyAppliedCustomBindings?s("span",{staticClass:"custom"},[e._v("\n Custom key bindings applied! ")]):s("span",{staticClass:"customize"},[e._v("\n You can\n "),s("a",{staticClass:"link",attrs:{target:"_blank",href:"https://docs.reviewable.io/accountsettings#custom-key-bindings"}},[e._v("customize")]),e._v("\n these shortcuts and add more!\n ")]),s("span",{staticClass:"more"},[e._v("More shortcuts available on review pages.")])])])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-61e1ccc0"}),{HotkeysSheet:HotkeysSheet}},!0,!0,{filename:"src/view/hotkeys/hotkeys-sheet.vue"}),_reviewable.define(["AuthExpiryIndicator"],["truss","Guide"],function(e,t){"use strict";const s=36e5,i=24*s;class AuthExpiryIndicator{get timeLeft(){const e=this.$session.auth.expiryRemaining;if(!_.isFinite(e))return"soon";if(e<2*i){const t=Math.max(Math.ceil(e/s),1);return`${t} ${1===t?"hour":"hours"}`}const t=Math.ceil(e/i);return`${t} ${1===t?"day":"days"}`}}return _declareVue("AuthExpiryIndicator",AuthExpiryIndicator,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("indicator",{attrs:{name:"authExpiry",onboarding:"sawAuthExpiry",icon:"auth expiry",severity:"warning"===e.$session.auth.expiryPhase?"warning":null}},[s("p",[e._v("Your Reviewable sign-in expires in "+e._s(e.timeLeft)+".")]),s("ui-button",{staticClass:"small refresh auth",attrs:{disabled:e.$session.auth.disabled},on:{click:function(t){return e.$session.auth.refresh("optional")}}},[e._v("\n Refresh sign-in\n ")])],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-4201fb4e"}),_declareGuides("AuthExpiryIndicator","data-v-4201fb4e",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".auth.expiry.indicator[data-v-4201fb4e]",onboarding:"sawAuthExpiry",position:"top"}},[e._v("\n Indicates that your "),s("em",[e._v("Reviewable sign-in will expire soon")]),e._v(".\n")])],1)},[]),{AuthExpiryIndicator:AuthExpiryIndicator}},!0,!0,{filename:"src/view/indicators/auth-expiry-indicator.vue"}),_reviewable.define(["BadConnectionIndicator"],["truss","Guide"],function(e,t){"use strict";class BadConnectionIndicator{get severity(){const e=this.$store.services.connection.warningLevel;if(e)return 1===e?"warning":"error"}get explanation(){return this.$store.services.connection.warningExplanation}}return _declareVue("BadConnectionIndicator",BadConnectionIndicator,null,{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("indicator",{attrs:{name:"badConnection",onboarding:"sawBadConnection",icon:"no signal",severity:e.severity}},[e._v("\n "+e._s(e.explanation)+"\n")])},staticRenderFns:[],functional:!1},{scopeId:"data-v-b6b30fb8"}),_declareGuides("BadConnectionIndicator","data-v-b6b30fb8",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".no.signal.indicator[data-v-b6b30fb8]",onboarding:"sawBadConnection",position:"top"}},[s("p",[e._v("\n Indicates that you have a "),s("em",[e._v("bad connection")]),e._v(" to Reviewable's servers, and that some\n changes may have "),s("em",[e._v("not been saved")]),e._v(" yet.\n ")])])],1)},[]),{BadConnectionIndicator:BadConnectionIndicator}},!0,!0,{filename:"src/view/indicators/bad-connection-indicator.vue"}),_reviewable.define(["DiffOverflowIndicator"],["truss","Guide","hotkeys"],function(e,t,s){"use strict";class DiffOverflowIndicator{constructor(){Vue.set(this,"overflow",void 0)}created(){this.$observe(()=>_get(this,"context","overflow"),e=>{e&&Vue.set(this,"overflow",_.clone(e))})}get context(){return this.$store.services.reviewContext.current}separator(){return _get(this,"overflow","size")-1}toggleCheatSheet(){s.toggleCheatSheet()}}return _declareVue("DiffOverflowIndicator",DiffOverflowIndicator,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("indicator",{attrs:{name:"diffOverflow",onboarding:"sawDiffOverflow",icon:"overflow",severity:_get(e,"context","overflow")&&!e.context.overflow.expected?"info":null}},[s("p",[e._v("\n Because\n "),_get(e,"overflow","tooManyFiles")?s("span",[e._v("\n there are "+e._s(_get(e,"context","review","files","num","presented"))+" files\n to display"+e._s([""," and",","][e.separator])+"\n ")]):e._e(
1),_get(e,"overflow","diffsThrottled")?s("span",[e._v("\n diffing was taking too long"+e._s(["",e.overflow.tooManyFiles?",":" and",", and"][e.separator])+"\n ")]):e._e(),_get(e,"overflow","bigDiffs")?s("span",[e._v("\n some of the diffs were really big"+e._s(["",",",","][e.separator])+"\n ")]):e._e(),e._v("\n we've hidden some diffs to keep things snappy.\n ")]),_get(e,"overflow","tooManyFiles")?s("p",[e._v("\n You can navigate between all files using the\n "),s("a",{staticClass:"link",on:{click:function(t){return e.context.navigation.visitPanel("fileMatrix")}}},[e._v("file matrix")]),e._v(",\n the counters in the toolbar, or\n "),s("a",{staticClass:"link",on:{click:e.toggleCheatSheet}},[e._v("keyboard shortcuts")]),e._v(".\n ")]):_get(e,"overflow","diffsThrottled")||_get(e,"overflow","bigDiffs")?s("p",[e._v("\n The diffs will fill in automatically when you get to them.\n ")]):e._e(),s("ui-button",{staticClass:"small show diffs",on:{click:function(t){return e.context.overrideOverflow()}}},[e._v("Show all diffs anyway")])],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-15667b93"}),_declareGuides("DiffOverflowIndicator","data-v-15667b93",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".overflow.indicator[data-v-15667b93]",onboarding:"sawDiffOverflow",position:"top"}},[s("p",[e._v("\n Indicates that "),s("em",[e._v("not all files or diffs are displayed")]),e._v(" on the page for performance\n reasons. The popup gives you the option to "),s("em",[e._v("show all diffs")]),e._v(" anyway.\n ")])]),e._v(" "),s("guide",{attrs:{for:".show.diffs.button[data-v-15667b93]",onboarding:"showedAllDiffs",position:"left",highlight:"bracket"}},[s("p",[s("em",[e._v("Forces all file diffs to display")]),e._v(", at the risk of overwhelming your browser.\n ")])])],1)},[]),{DiffOverflowIndicator:DiffOverflowIndicator}},!0,!0,{filename:"src/view/indicators/diff-overflow-indicator.vue"}),_reviewable.define(["FailureIndicators"],["truss","Guide","animator","corpsman"],function(e,t,s,i){"use strict";class FailureIndicators{async retry(e,t){await e.retry(),e.active&&s.shouldAnimate()&&anime.timeline({targets:t.tippy.popper}).add({duration:.33*s.defaultOptions.duration,scaleX:1.3,easing:"easeOutQuad"}).add({duration:s.defaultOptions.duration,scaleX:1,easing:"easeOutBounce"})}dismiss(e){i.clearFailure(e.key)}}return _declareVue("FailureIndicators",FailureIndicators,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("span",e._l(e.$session.corpsman.failures,function(t,i){return s("indicator",{key:i,attrs:{name:"failure",onboarding:"sawFailure",icon:"operation failure "+t.icon,severity:t.active||t.retrying?"error":null,durable:""},scopedSlots:e._u([{key:"default",fn:function(i){var r=i.tippyDropdown;return[s("p",[e._v(e._s(t.message))]),s("span",{staticClass:"ui dimmable buttons retry-or-dismiss",class:{dimmed:t.retrying}},[t.retry?s("ui-button",{staticClass:"dimmable small retry",on:{click:function(s){return e.retry(t,r)}}},[e._v("\n Retry\n ")]):e._e(),s("div",{staticClass:"ui simple inverted dimmer"},[s("div",{staticClass:"ui mini loader"})]),t.retry?s("span",{staticClass:"or"}):e._e(),s("ui-button",{staticClass:"small dismiss",on:{click:function(s){return e.dismiss(t)}}},[e._v("Dismiss")])],1)]}}],null,!0)})}),1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-b20b27a4"}),_declareGuides("FailureIndicators","data-v-b20b27a4",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".failure.indicator[data-v-b20b27a4]",onboarding:"sawFailure",position:"top"}},[s("p",[e._v("\n Indicates that a "),s("em",[e._v("major operation failed")]),e._v(". The error is presented this way so that\n you'll be aware of it even if you already navigated to another page.\n ")])]),e._v(" "),s("guide",{attrs:{for:".retry-or-dismiss.buttons[data-v-b20b27a4]",onboarding:"retriedOrDismissedFailure",position:"left",highlight:"bracket"}},[s("p",[s("em",[e._v("Retry the operation")]),e._v(" (if possible) or "),s("em",[e._v("dismiss the error")]),e._v(" with no further\n action.\n ")])])],1)},[]),{FailureIndicators:FailureIndicators}},!0,!0,{filename:"src/view/indicators/failure-indicators.vue"}),_reviewable.define(["GithubStatusIndicator"],["truss","Guide"],function(e,t){"use strict";class GithubStatusIndicator{get status(){return this.$store.services.gitHubStatus}get severity(){const e=_get(this,"status","severity");if(e)switch(e){case"none":return"success";case"maintenance":return"info";case"minor":return"warning";default:return"error"}}}return _declareVue("GithubStatusIndicator",GithubStatusIndicator,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("indicator",{attrs:{name:"gitHubStatus",onboarding:"sawGitHubStatus",icon:"github",severity:e.severity}},[s("p",{staticClass:"message"},[e._v(e._s(_get(e,"status","message")))]),s("p",{staticClass:"attribution"},[e._v("\n (Reported by GitHub "+e._s(_get(e,"status","timestampTimeAgo"))+".\n See the "),s("a",{staticClass:"link",attrs:{href:_get(e,"status","url")}},[e._v("status page")]),e._v(" for details.)\n ")])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-6770f99b"}),_declareGuides("GithubStatusIndicator","data-v-6770f99b",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".github.indicator[data-v-6770f99b]",onboarding:"sawGitHubStatus",position:"top"}},[s("p",[e._v("\n Indicates that there's a "),s("em",[e._v("problem with GitHub")]),e._v(" that may be affecting Reviewable. Click\n for details.\n ")])])],1)},[]),{GithubStatusIndicator:GithubStatusIndicator}},!0,!0,{filename:"src/view/indicators/github-status-indicator.vue"}),_reviewable.define(["GuestSeatIndicator"],["truss","Guide"],function(e,t){"use strict";class GuestSeatIndicator{get severity(){return _get(this,"$info","user","enterpriseGuest")?"warning":null}get daysLeft(){const e=_get(this,"$info","user","claims","expires"),t=Math.ceil((e-this.$now)/864e5);return`${t} ${1===t?"day":"days"}`}}return _declareVue("GuestSeatIndicator",GuestSeatIndicator,null,{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("indicator",{attrs:{name:"guestSeat",onboarding:"sawGuestSeat",icon:"guest seat",severity:e.severity}},[e._v("\n You've been allocated a temporary guest seat that will expire in "+e._s(e.daysLeft)+".\n Please contact your organization administrator to obtain a permanent one.\n")])},staticRenderFns:[],functional:!1},{scopeId:"data-v-780e985a"}),_declareGuides("GuestSeatIndicator","data-v-780e985a",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".guest.seat.indicator[data-v-780e985a]",onboarding:"sawGuestSeat",position:"top"}},[e._v("\n Indicates that you have a "),s("em",[e._v("temporary guest seat")]),e._v(" for Reviewable that will expire in the\n near future.\n")])],1)},[]),{GuestSeatIndicator:GuestSeatIndicator}},!0,!0,{filename:"src/view/indicators/guest-seat-indicator.vue"}),_reviewable.define(["Indicator"],["truss","Guide","animator","bus","session"],function(e,t,s,i,r){"use strict";const n=[];function a(e){if(e)_.forEach(n,t=>{t!==e&&t.toggle(!1)});else{let e=!1;_.forEachRight(n,t=>{t.durable&&!e?(t.toggle(!0),e=!0):t.open&&t.toggle(!1)})}}
1class Indicator{constructor(){Vue.set(this,"cachedSeverity",void 0),Vue.set(this,"toastComplete",!1),Vue.set(this,"forcedClosed",!1)}mounted(){this.$observe(()=>this.severity,(e,t)=>{const s=_get(this,"$refs","toast");s&&(e?(Vue.set(this,"cachedSeverity",e),t||(n.push(this),this.updateTippys(),this.$when(()=>void 0!==this.autoPopup).then(()=>{this.autoPopup&&(s.toggle(!0),a(this),this.durable||s.close({delay:4e3,unlessCursorInside:!0}))}))):t&&(_.pull(n,this),this.updateTippys(),a(),s.close({delay:100})))})}updateTippys(){i.forceTippyUpdate({expectAnimation:!0,duration:s.defaultOptions.duration/2})}handleClick(){this.onboarding&&Vue.set(r.onboarding,this.onboarding,!0)}handleOpened(){Vue.set(this,"toastComplete",!1),a(this)}handleClosed(){this.forcedClosed||a(),Vue.set(this,"forcedClosed",!1)}handleComplete(){Vue.set(this,"toastComplete",!0)}get tippyOptions(){return{placement:"top",arrow:!0,offset:[0,7],theme:`dropdown toast ${this.cachedSeverity}`,hideOnClick:this.toastComplete&&!this.durable}}get autoPopup(){if(void 0!==this.$info.userid&&(!this.$info.userid||r.settings.$ready))return!1!==_get(r,"settings","indicatorToggles",this.name)}set autoPopup(e){Vue.set(r.settings,"indicatorToggles",r.settings.indicatorToggles||{}),Vue.set(r.settings.indicatorToggles,this.name,e)}get open(){return _get(this,"$refs","toast","open")}toggle(e){_access(this,"","$refs","","toast","","toggle","call",[e]),e||Vue.set(this,"forcedClosed",!0)}}Indicator.$vueOptions={props:{name:{type:String,required:!0},onboarding:String,icon:{type:String,required:!0},severity:{validator:e=>_.includes(["info","success","warning","error"],e)},durable:Boolean}};return _declareVue("Indicator",Indicator,null,{render:function(){var e,t=this,s=t.$createElement,i=t._self._c||s;return i("span",{staticClass:"indicator",class:(e={active:t.severity},e[t.icon]=!0,e),on:{click:t.handleClick}},[i("i",{staticClass:"icon",class:[t.icon,t.cachedSeverity]}),i("tippy-dropdown",{ref:"toast",attrs:{fixed:"",options:t.tippyOptions},on:{opened:t.handleOpened,complete:t.handleComplete,closed:t.handleClosed}},[i("div",{staticClass:"ui segment icon message",class:t.cachedSeverity},[t._t("default",null,{tippyDropdown:t.$refs.toast}),t.durable?t._e():i("ui-toggle-input",{staticClass:"toggle",model:{value:t.autoPopup,callback:function(e){t.autoPopup=e},expression:"autoPopup"}},[t._v("\n Pop up automatically\n ")])],2)])],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-25cedba5"}),_declareGuides("Indicator","data-v-25cedba5",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".toggle[data-v-25cedba5]",onboarding:"toggledAutoToast",highlight:"under",position:"left"}},[s("p",[e._v("\n Controls whether the "),s("em",[e._v("toast notification")]),e._v(" for this condition "),s("em",[e._v("pops up\n automatically")]),e._v(" or only when you click the indicator.\n ")])])],1)},[]),{Indicator:Indicator}},!0,!0,{filename:"src/view/indicators/indicator.vue"}),_reviewable.define(["MissingNavigationItemIndicator"],["truss","Guide"],function(e,t){"use strict";class MissingNavigationItemIndicator{constructor(){Vue.set(this,"missing",void 0)}created(){this.$observe(()=>_get(this,"context","navigation","missing"),e=>{e&&Vue.set(this,"missing",_.clone(e))})}get context(){return this.$store.services.reviewContext.current}get numMissingItems(){return this.missing?this.missing.numFiles+this.missing.numParleys:0}get maybeMore(){return _get(this,"context","singleFile")&&_get(this,"context","onlyFile")}get itemsDescriptor(){if(this.missing)return this.missing.descriptor.replace(/\[s\]/g,1===this.numMissingItems?"":"s")}revealMissingItems(){const e=_get(this,"context","review");if(!e||!this.missing)return;_.forEach(e.files.showingList,e=>{this.missing.filePredicate(e)&&Vue.set(e,"nonTrivialLatch",!0)});const t=_(e.discussions.parleys).uniqBy("$key").filter(e=>this.missing.discussionPredicate(e.$key)).value();this.context.navigation.exhibitParleys(0,t),Vue.set(this.context.navigation,"missing",null)}}return _declareVue("MissingNavigationItemIndicator",MissingNavigationItemIndicator,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("indicator",{ref:"indicator",attrs:{name:"missingNavigationItem",onboarding:"sawMissingNavigationItem",icon:"missing "+(_get(e,"missing","numFiles")?"files":"discussions"),severity:_get(e,"context","navigation","missing")?"info":null}},[s("p",[e._v("\n "+e._s(e.numMissingItems)+" "+e._s(e.itemsDescriptor)+" "+e._s(e.maybeMore?"(or more)":"")+"\n "+e._s(1!==e.numMissingItems||e.maybeMore?"are":"is")+" not currently displayed.\n ")]),s("ui-button",{staticClass:"small show missing",on:{click:e.revealMissingItems}},[e._v("Show missing items")])],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-1618451e"}),_declareGuides("MissingNavigationItemIndicator","data-v-1618451e",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".missing.indicator[data-v-1618451e]",onboarding:"sawMissingNavigationItem",position:"top"}},[s("p",[e._v("\n Indicates that your last navigation action "),s("em",[e._v("will not visit all relevant files or\n discussions")]),e._v(". The popup gives you the option to "),s("em",[e._v("show all the missing items")]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".show.missing.button[data-v-1618451e]",onboarding:"revealedMissingNavigationItems",position:"left",highlight:"bracket"}},[s("p",[s("em",[e._v("Reveals files and discussions")]),e._v(" that are part of your current "),s("em",[e._v("navigation cycle")]),e._v("\n but would otherwise be silently skipped.\n ")])])],1)},[]),{MissingNavigationItemIndicator:MissingNavigationItemIndicator}},!0,!0,{filename:"src/view/indicators/missing-navigation-item-indicator.vue"}),_reviewable.define(["ChangelogOverlay"],["truss","Guide","animator"],function(e,t,s){"use strict";class ChangelogOverlay{constructor(){Vue.set(this,"changelog",this.$store.services.changelog),Vue.set(this,"importanceSliderData",[{value:4,label:"Major"},{value:3,label:"Minor"},{value:2,label:"Fix"}]),Vue.set(this,"availabilitySliderData",[{value:3,label:"Deployed"},{value:2,label:"Released"},{value:1,label:"Upcoming"}])}handleContentVisible(e){e||this.changelog.markSeen()}get defaultAnimationDuration(){return s.defaultOptions.duration}}return _declareVue("ChangelogOverlay",ChangelogOverlay,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("modal-overlay",{attrs:{closable:""},on:{"content-visible":e.handleContentVisible},model:{value:e.changelog.displayed,callback:function(t){e.$set(e.changelog,"displayed",t)},expression:"changelog.displayed"}},[s("h3",{staticClass:"ui center aligned header"},[s("i",{staticClass:"changelog header icon"}),e._v(" Changelog\n ")]),e.changelog.error?s("div",{staticClass:"ui error message"},[e._v("\n "+e._s(e.changelog.error)+"\n "),s("ui-button",{on:{click:function(t){return e.changelog.fetch()}}},[e._v("Retry")])],1):[s("div",{staticClass:"ui dimmable scroll container",class:{dimmed:e.changelog.busy}},[s("div",{staticClass:"ui simple inverted dimmer"},[s("div",{staticClass:"ui loader"})]),s("div",{staticClass:"ui ask message"},[s("img",{staticClass:"thank you bunny",attrs:{src:"images/52fa1aa5.bunny-thanks.svg"}}),s("div",{staticClass:"content"},[e._v("\n As you may know, Reviewable's growth is 100% organic and driven by word of mouth â thank\n you for sharing! If you love Reviewable then\n "),s("a",{staticClass:"link",attrs:{href:"https://www.g2.com/products/reviewable/reviews"}},[e._v("leaving a review")]),e._v("\n or a\n "),s("a",{staticClass:"link",attrs:{href:"mailto:[email protected]?subject=Testimonial"}},[e._v("testimonial for our homepage")]),e._v("\n would also help a lot. ð\n "),s("span",{staticClass:"work"},[e._v("\n (Psst⦠Want to\n "),s("a",{staticClass:"link",attrs:{href:"https://github.com/Reviewable/Reviewable/blob/master/careers/README.md"}},[e._v("work with us")]),e._v("?)\n ")])])]),s("div",{staticClass:"markdown-body"},[e._l(e.changelog.displayedItems,function(t){return["divider"===t.kind?s("div",{key:t.title,staticClass:"ui relative divider"},[s("div",{staticClass:"title"},[e._v(e._s(t.title))]),t.affix?s("div",{staticClass:"affix"}
1,[e._v(e._s(t.affix))]):e._e()]):"change"===t.kind&&t.html?s("div",{key:t.title,staticClass:"change"},[s("div",{staticClass:"entry",domProps:{innerHTML:e._s(t.html)}}),s("div",{staticClass:"bar",class:t.type})]):"ribbon"===t.kind?s("div",{key:t.title,staticClass:"ribbon wrapper"},[s("div",{staticClass:"ui ribbon label",class:t.style},[e._v(e._s(t.title))])]):e._e()]})],2),e.changelog.allFetched?e._e():s("div",{staticClass:"ui loading placeholder"},["some"===e.changelog.fetched?s("ui-button",{staticClass:"basic circular",on:{click:function(t){return e.changelog.fetch()}}},[e._v("\n Load all entries\n ")]):e._e()],1)]),s("div",{staticClass:"controls"},[s("div",{staticClass:"ui divider"}),s("span",{staticClass:"importance group"},[s("span",{staticClass:"label"},[e._v("Importance:")]),s("span",{staticClass:"pre slider-stub"}),s("vue-slider-component",{staticClass:"slider",attrs:{duration:e.defaultAnimationDuration,data:e.importanceSliderData,"data-value":"value","data-label":"label",width:"130px","dot-size":10,"drag-on-click":"",adsorb:"",tooltip:"none"},model:{value:e.changelog.importanceThreshold,callback:function(t){e.$set(e.changelog,"importanceThreshold",t)},expression:"changelog.importanceThreshold"}}),s("span",{staticClass:"post slider-stub"})],1),"enterprise"===e.$session.config.env?s("span",{staticClass:"availability group"},[s("span",{staticClass:"label"},[e._v("Availability:")]),s("span",{staticClass:"pre slider-stub"}),s("vue-slider-component",{staticClass:"slider",attrs:{duration:e.defaultAnimationDuration,data:e.availabilitySliderData,"data-value":"value","data-label":"label",width:"180px","dot-size":10,"drag-on-click":"",adsorb:"",tooltip:"none"},model:{value:e.changelog.availabilityThreshold,callback:function(t){e.$set(e.changelog,"availabilityThreshold",t)},expression:"changelog.availabilityThreshold"}}),s("span",{staticClass:"post slider-stub"})],1):e._e()])]],2)},staticRenderFns:[],functional:!1},{scopeId:"data-v-5624ad8d"}),_declareGuides("ChangelogOverlay","data-v-5624ad8d",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".controls .importance.group[data-v-5624ad8d]",onboarding:"changedImportanceThreshold",highlight:"bracket"}},[s("p",[s("em",[e._v("Filter changes")]),e._v(" to those with at least the given "),s("em",[e._v("importance")]),e._v(":\n "),s("ul",[s("li",[e._v("major: new features and big updates")]),e._v(" "),s("li",[e._v("minor: normal updates or big bug fixes")]),e._v(" "),s("li",[e._v("fixes: run of the mill bug fixes")])]),e._v("\n Entries below the selected threshold will be hidden.\n ")]),e._v(" "),s("p",[e._v("\n This setting also controls what new changes will "),s("em",[e._v("trigger the red dot")]),e._v(" notification.\n ")]),e._v(" "),"enterprise"===e.$session.config.env?s("p",[e._v("\n If you're a "),s("em",[e._v("Reviewable admin")]),e._v(" there are also admin-specific changes that only show up\n in our "),s("a",{staticClass:"link",attrs:{href:"https://changelog.reviewable.io"}},[e._v("master changelog")]),e._v(".\n ")]):e._e()]),e._v(" "),s("guide",{attrs:{for:".controls .availability.group[data-v-5624ad8d]",onboarding:"changedAvailabilityThreshold",highlight:"bracket"}},[s("p",[s("em",[e._v("Filter changes")]),e._v(" to those with at least the given "),s("em",[e._v("availability")]),e._v(":\n "),s("ul",[s("li",[e._v("deployed: currently available on your instance")]),e._v(" "),s("li",[e._v("released: ready to deploy (nag your admin!)")]),e._v(" "),s("li",[e._v("upcoming: coming in the next release")])]),e._v("\n Entries below the selected threshold will be hidden.\n ")]),e._v(" "),s("p",[e._v("\n This setting also controls what new changes will "),s("em",[e._v("trigger the red dot")]),e._v(" notification.\n ")])])],1)},[]),{ChangelogOverlay:ChangelogOverlay}},!0,!0,{filename:"src/view/overlays/changelog-overlay.vue"}),_reviewable.define(["CrashOverlay"],["truss"],function(e){"use strict";class CrashOverlay{reload(){window.location.reload()}}return _declareVue("CrashOverlay",CrashOverlay,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("modal-overlay",{staticClass:"blocking",attrs:{open:!!e.$session.corpsman.crash}},[s("img",{staticClass:"hero",attrs:{src:"/images/c605e011.goggles.jpg"}}
1),"app"===e.$session.corpsman.crashSource?[s("p",[e._v("\n Well that was⦠unexpected.\n "),e.$session.config.sentryDsn?s("span",[e._v("\n Sorry â we got the crash report and we'll look into it right away.\n ")]):s("span",[e._v("Sorry!")])]),s("p",[e._v("\n Please "),s("a",{staticClass:"link",on:{click:function(t){return e.reload()}}},[e._v("reload the page")]),e._v(". Don't worry, your\n data is safe. You can also\n "),s("a",{staticClass:"link",attrs:{href:"https://github.com/Reviewable/Reviewable/issues",target:"_blank"}},[e._v("report the issue")]),e._v("\n to provide more details if it's reproducible.\n ")])]:e._e(),"external"===e.$session.corpsman.crashSource?[s("p",[e._v("\n Something on the page crashed, but it doesn't look like it was Reviewable. Please try\n "),s("a",{staticClass:"link",on:{click:function(t){return e.reload()}}},[e._v("reloading the page")]),e._v(" with your browser extensions\n disabled.\n ")]),s("p",[e._v("\n Don't worry, your data is safe. You can also\n "),s("a",{staticClass:"link",attrs:{href:"https://github.com/Reviewable/Reviewable/issues",target:"_blank"}},[e._v("report the issue")]),e._v("\n to provide more details if it's reproducible.\n ")])]:e._e(),e.$store.services.gitHubStatus.worthReporting?s("p",[s("i",{staticClass:"github icon"}),s("i",{staticClass:"warning sign icon"}),e._v("\n Note that as of "+e._s(e.$store.services.gitHubStatus.timestampTimeAgo)+" GitHub is reporting the\n following issue with their service: "+e._s(e.$store.services.gitHubStatus.message)+"\n ")]):e._e(),s("p",{staticClass:"selectable details"},[e._v(e._s(e.$session.corpsman.crash))])],2)},staticRenderFns:[],functional:!1},{}),{CrashOverlay:CrashOverlay}},!0,!0,{filename:"src/view/overlays/crash-overlay.vue"}),_reviewable.define(["MaintenanceOverlay"],["truss"],function(e){"use strict";class MaintenanceOverlay{reload(){window.location.reload()}}return _declareVue("MaintenanceOverlay",MaintenanceOverlay,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("modal-overlay",{staticClass:"blocking",attrs:{open:!!e.$session.corpsman.maintenance}},[s("img",{staticClass:"hero",attrs:{src:"/images/ef5a8b9a.maintenance.jpg"}}),s("h2",{staticClass:"ui center aligned header"},[e._v("M A I N T E N A N C E")]),s("p",{staticClass:"justified-text",domProps:{innerHTML:e._s(e.$session.corpsman.maintenance.message)}}),s("p",{staticClass:"justified-text"},[e._v("\n You'll need to "),s("a",{staticClass:"link",on:{click:function(t){return e.reload()}}},[e._v("reload the page")]),e._v(" to check if\n maintenance is complete â don't worry, your data is safe.\n ")])])},staticRenderFns:[],functional:!1},{}),{MaintenanceOverlay:MaintenanceOverlay}},!0,!0,{filename:"src/view/overlays/maintenance-overlay.vue"}),_reviewable.define(["MemberWelcomeOverlay"],["truss"],function(e){"use strict";class MemberWelcomeOverlay{get open(){return _get(this,"$store","memberships","welcome","offered")&&!_get(this,"$store","memberships","welcome","dismissed")}}return _declareVue("MemberWelcomeOverlay",MemberWelcomeOverlay,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("modal-overlay",{staticClass:"dialog",attrs:{closable:"",open:e.open},on:{close:function(t){return e.$store.memberships.dismissWelcome()}}},[s("img",{staticClass:"bunny title",attrs:{src:"/images/18ede5ef.startbunny0.jpg"}}),s("h2",{staticClass:"ui center aligned header"},[e._v("W E L C O M E")]),s("div",{staticClass:"center-text"},[s("avatar",{attrs:{"user-key":e.$info.userid,display:"picture,name"}})],1),s("p",{staticClass:"justified-text intro"},[e._v("\n To get started with code reviews"),e.$store.memberships.list.length?s("span",[e._v(" at\n "),e._l(e.$store.memberships.list,function(t){return s("span",{key:t.organization,staticClass:"comma-item"},[s("avatar-image",{staticClass:"ui company avatar image",attrs:{src:e.$store.services.avatars.scaleGitHubAvatarUrl(t.logoUrl),fallback:t.organization}}),e._v(e._s(t.company))],1)})],2):e._e(),e._v(",\n you'll first need to let Reviewable access GitHub in your name:\n ")]),s("div",{staticClass:"center-text"},[s("span",{staticClass:"ui large green labeled icon button",class:{disabled:e.$session.auth.disabled},on:{click:function(t){return e.$session.auth.login(e.$store.memberships.welcome.requiredScopes,"optional")}}},[s("i",{staticClass:"authorize icon"}),e._v("\n Authorize access\n ")])]),s("p",{staticClass:"unobtrusive justified-text fine print"},[e._v("\n The\n "),s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/registration#github-authorizations",target:"_blank"}},[e._v("user guide")]),e._v("\n explains why Reviewable needs these permissions to function.\n ")])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-c2193842"}),{MemberWelcomeOverlay:MemberWelcomeOverlay}},!0,!0,{filename:"src/view/overlays/member-welcome-overlay.vue"}),_reviewable.define(["OfflineOverlay"],["truss","bus","corpsman","safeStorage"],function(e,t,s,i){"use strict";if("/headless"!==window.location.pathname){const e=new Image;Vue.set(e,"src","/images/7ac19cef.paddles.jpg")}const r="reviewable:work_offline";class OfflineOverlay{constructor(){Vue.set(this,"connection",this.$store.services.connection)}created(){t.allowHotkey.react(e=>{this.connection.offline&&Vue.set(e,"prevented",!0)},{scope:this}),window.addEventListener("beforeunload",e=>{if(this.connection.writesPending&&!s.locked)return e.preventDefault(),Vue.set(e,"returnValue","")},!0),window.Reviewable=window.Reviewable||{},window.Reviewable.workOfflineAtMyOwnRisk=e=>{!0===e?i.local.setItem(r,"at_my_own_risk"):!1===e&&i.local.removeItem(r),!0!==e&&void 0!==e||this.connection.workOffline()};_access(i,"","local","","getItem","call",[r,()=>{console.warn('Unable to access local storage to check "work offline" flag')}])&&this.connection.workOffline()}}return _declareVue("OfflineOverlay",OfflineOverlay,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("modal-overlay",{staticClass:"blocking",attrs:{open:e.connection.offline}},[s("img",{staticClass:"hero",attrs:{src:"/images/7ac19cef.paddles.jpg"}}
1),s("h2",{staticClass:"ui center aligned header"},[e._v("O F F L I N E")]),s("p",{style:{textAlign:e.connection.writesPending?"left":"center"}},[e._v("\n We'll get you reconnected as soon as possible.\n "),e.connection.writesPending?s("span",[e._v("\n There were writes in progress when the connection dropped, so changes may be lost if you\n leave the page before we manage to reconnect.\n ")]):e._e()]),s("p",{staticClass:"details"},[e._v("Reason: "+e._s(e.connection.offlineReason))])])},staticRenderFns:[],functional:!1},{}),{OfflineOverlay:OfflineOverlay}},!0,!0,{filename:"src/view/overlays/offline-overlay.vue"}),_reviewable.define(["UpgradeOverlay"],["truss"],function(e){"use strict";class UpgradeOverlay{reload(){window.location.reload()}}return _declareVue("UpgradeOverlay",UpgradeOverlay,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("modal-overlay",{staticClass:"blocking",attrs:{open:e.$session.corpsman.upgrade}},[s("img",{staticClass:"hero",attrs:{src:"/images/d5705f22.horizon.jpg"}}),s("h2",{staticClass:"ui center aligned header"},[e._v("U P G R A D E")]),s("p",{staticClass:"justified-text"},[e._v("\n Sorry to interrupt, but a new version of Reviewable is available and we need you to upgrade\n right away. Please "),s("a",{staticClass:"link",on:{click:function(t){return e.reload()}}},[e._v("reload the page")]),e._v(" â don't\n worry, your data is safe.\n ")])])},staticRenderFns:[],functional:!1},{}),{UpgradeOverlay:UpgradeOverlay}},!0,!0,{filename:"src/view/overlays/upgrade-overlay.vue"}),_reviewable.define(["AppLayout"],["truss","Guide","animator","corpsman","debug","hotkeys","pageControl","session"],function(e,t,s,i,r,n,a,o){"use strict";const l="primary",c=200,u=["full","drawer-vertical","drawer-horizontal","collapsed"],d=[100,0],h=[75,25];class AppLayout{constructor(){Vue.set(this,"resizeObserver",void 0),Vue.set(this,"syncScrollEl",void 0),Vue.set(this,"pinned",!1),Vue.set(this,"height",0),Vue.set(this,"ruler",this.$store.services.ruler),Vue.set(this,"split",void 0),Vue.set(this,"throttledSplitterDragUpdate",void 0),Vue.set(this,"splitGutterElement",void 0),Vue.set(this,"reviewLayoutResourcesActive",!1),Vue.set(this,"reviewSidebarStateUnwatch",void 0),Vue.set(this,"sidebarObserverUnwatch",void 0),Vue.set(this,"lastShowingSidebarToggle",void 0),Vue.set(this,"animatingPivot",void 0),Vue.set(this,"runtimeSidebarState",void 0),Vue.set(this,"runtimeFullWidthPx",void 0),Vue.set(this,"runtimeSidebarSplitterSyncRequest",void 0)}mounted(){n.register("adjustSidebar",(...e)=>{this.captureAsync("adjustSidebar",...e)},this),a.registerScrollContext(l,this),this.$waitForRefs("container",e=>{e.focus(),Vue.set(this.ruler.width,"scrollContext",this.$refs.container.clientWidth)}),Vue.set(this,"throttledSplitterDragUpdate",_.throttle(e=>{const t=.01*e[1]*this.ruler.width.window;this.showSidebar&&t<=80?this.setEffectiveSidebarState("drawer-vertical"):"drawer-vertical"===this.effectiveSidebarState&&t>=80&&(this.scheduleRuntimeSidebarSplitterSync({preserveLiveDragWidth:!0}),this.setEffectiveSidebarState("full")),_.defer(()=>{!this.$destroyed&&_get(this,"$refs","container")&&_get(this,"$refs","sidebar")&&this.ruler.setSidebarProportions([this.$refs.container.clientWidth,this.$refs.sidebar.clientWidth])})},100)),this.$observe(()=>this.reviewReady,e=>{e?this.captureAsync("activateReviewLayout"):this.deactivateReviewLayout()}),this.$observe(()=>this.context,()=>{Vue.set(this,"lastShowingSidebarToggle",void 0)}),this.$observe(()=>this.reviewChromeShown,e=>{e?this.$waitForRefs("sidebar",e=>{this.reviewChromeShown&&this.$refs.sidebar===e&&Vue.set(this.ruler.width,"sidebar",e.clientWidth)}):Vue.set(this.ruler.width,"sidebar",0)}),this.$observe(()=>this.ruler.width.window,()=>{this.requestScrollContextWidthUpdate()}),this.$observe(()=>[o.settings.$ready,this.ruler.screenWidth,this.ruler.narrow],()=>{this.syncSidebarRuntimeForScreen()}),this.$observe(()=>[this.effectiveSidebarState,"full"===this.effectiveSidebarState?this.runtimeFullWidthPx:void 0],()=>{this.scheduleRuntimeSidebarSplitterSync()})}async activateReviewLayout(){this.reviewLayoutResourcesActive||(Vue.set(this,"reviewLayoutResourcesActive",!0),await this.$nextTick(),!this.$destroyed&&this.reviewLayoutResourcesActive&&this.reviewReady&&(!this.resizeObserver&&this.$refs.content&&(Vue.set(this,"resizeObserver",new ResizeObserver(()=>{requestAnimationFrame(()=>{this.$refs.content&&this.reviewLayoutResourcesActive&&(Vue.set(this,"height",this.$refs.content.clientHeight),a.normalizeViewOnLayoutSettled())})})),this.resizeObserver.observe(this.$refs.content)),this.ruler.updateWindowDimensions(),this.reviewSidebarStateUnwatch&&this.reviewSidebarStateUnwatch(),Vue.set(this,"reviewSidebarStateUnwatch",this.$observe(()=>this.reviewLayoutResourcesActive&&this.showSidebar&&!this.isolated,e=>this.configureReviewSidebar(e)))))}requestScrollContextWidthUpdate(e=!1){this.captureAsync("updateScrollContextWidth",e)}deactivateReviewLayout(){const e=this.reviewLayoutResourcesActive;Vue.set(this,"reviewLayoutResourcesActive",!1),Vue.set(this,"height",0),this.clearReviewSidebarObservers(),this.resizeObserver&&(this.resizeObserver.disconnect(),Vue.set(this,"resizeObserver",void 0)),this.split&&(this.split.de
1stroy(),Vue.set(this,"split",Vue.set(this,"splitGutterElement",null)));const t=this.$refs.drawer;t&&(Vue.set(t.style,"height",""),Vue.set(t.style,"width",""),Vue.set(t.style,"transform",""),Vue.set(t.style,"transformOrigin","")),this.$refs.pivotIconWrap&&Vue.set(this.$refs.pivotIconWrap.style,"transform",""),Vue.set(this,"animatingPivot",!1),this.$refs.sidebar&&Vue.set(this.$refs.sidebar.style,"width",""),this.$refs.layout&&this.$refs.layout.classList.remove("collapsing"),this.$refs.container&&this.ruler.setSidebarProportions([this.$refs.container.clientWidth,0]),e&&this.$nextTick().then(()=>this.$store.services.header.cleanupState())}configureReviewSidebar(e){if(this.sidebarObserverUnwatch&&(this.sidebarObserverUnwatch(),Vue.set(this,"sidebarObserverUnwatch",void 0)),this.reviewLayoutResourcesActive)if(e){let e=this.getStoredSidebarSizes();const t="drawer-vertical"===this.effectiveSidebarState?d:e;this.establishSidebarSplitter(t),Vue.set(this,"sidebarObserverUnwatch",this.$observe(()=>this.ruler.windowWidth,(t,s)=>{if(!s||!this.reviewLayoutResourcesActive)return;const i=_get(this,"context","toggles");if(!_(i).filter("sidebar").some("showing")){const e=this.lastShowingSidebarToggle||i.fileMatrix;e&&Vue.set(e,"showing",!0)}e=this.getStoredSidebarSizes();const r="drawer-vertical"===this.effectiveSidebarState?d:e;this.establishSidebarSplitter(r)}))}else this.$nextTick().then(()=>{this.reviewLayoutResourcesActive&&this.collapseSidebar()}),Vue.set(this,"sidebarObserverUnwatch",this.$observe(()=>this.ruler.windowWidth,()=>{this.reviewLayoutResourcesActive&&this.$refs.container&&this.ruler.setSidebarProportions([this.$refs.container.clientWidth,0])}))}clearReviewSidebarObservers(){this.reviewSidebarStateUnwatch&&(this.reviewSidebarStateUnwatch(),Vue.set(this,"reviewSidebarStateUnwatch",void 0)),this.sidebarObserverUnwatch&&(this.sidebarObserverUnwatch(),Vue.set(this,"sidebarObserverUnwatch",void 0))}get reviewReady(){return this.reviewChromeShown&&_get(this,"context","ready")}get reviewChromeShown(){return!!_get(this,"context")&&!this.isolated}get showSidebar(){return this.reviewReady&&("full"===this.effectiveSidebarState||"drawer-vertical"===this.effectiveSidebarState)}get isolated(){return i.isolated}get indicatorPositionX(){if(!this.reviewReady)return"0px";if(!this.height||!this.ruler.width.scrollContext)return"0px";const e=this.getScrollbarPresent()?17:0;switch(this.effectiveSidebarState){case"drawer-vertical":case"collapsed":return`${36+e+10}px`;case"full":return`${(_get(this,"$refs","sidebar","clientWidth")||0)+10+e}px`;default:return`${e}px`}}get indicatorPositionY(){return this.reviewReady&&"drawer-horizontal"===this.effectiveSidebarState?"36px":"0px"}pin(e){if(!_access(this,"","$refs","","content","","contains","call",[e]))return;Vue.set(this,"pinned",!0);const t=e.getBoundingClientRect().top,s=()=>{if(!this.pinned||!_get(this,"$refs","container"))return;const i=e.getBoundingClientRect().top;i!==t&&(this.$refs.container.scrollTop+=i-t),requestAnimationFrame(s)};s()}unpin(){Vue.set(this,"pinned",!1)}getScrollbarPresent(){if(!this.$refs.content)return;const e=window.innerHeight-this.getLayoutTopOffset();return _.isFinite(e)?this.$refs.content.scrollHeight>_.round(e):void 0}syncScrollContexts(){this.syncScrollEl&&Vue.set(this.syncScrollEl,"scrollTop",this.scrollY())}establishScrollSync(e){Vue.set(this,"syncScrollEl",e),this.$refs.container.addEventListener("scroll",this.syncScrollContexts)}scrollY(){return _get(this,"$refs","container","scrollTop")}scrollX(){return _get(this,"$refs","container","scrollLeft")}getLayoutTopOffset(){return _access(this,"","$refs","","statusbars","","getBoundingClientRect","call",[],"","height")}getContentScrollHeight(){return _get(this,"$refs","content","scrollHeight")}setScrollTop(e){this.$refs.container&&Vue.set(this.$refs.container,"scrollTop",e)}resetScrollTop(){this.setScrollTop(0)}runAfterSidebarAnimation(e){_.delay(()=>{this.$destroyed||e()},s.shouldAnimate()?200:0)}beforeDestroy(){_get(this,"runtimeSidebarSplitterSyncRequest","frameId")&&cancelAnimationFrame(this.runtimeSidebarSplitterSyncRequest.frameId),this.$refs.container&&this.$refs.container.removeEventListener("scroll",this.syncScrollContexts),this.deactivateReviewLayout(),a.unregisterScrollC
1ontext(l),this.$nextTick().then(()=>this.$store.services.header.cleanupState())}collapseSidebar(e=!1){this.reviewLayoutResourcesActive&&(Vue.set(this,"lastShowingSidebarToggle",_(_get(this,"context","toggles")).values().find(e=>e.sidebar&&e.showing)||this.lastShowingSidebarToggle),this.$refs.layout&&this.$refs.layout.classList.add("collapsing"),e?this.split&&this.split.collapse(1):(this.split&&this.split.destroy(),this.$refs.sidebar&&Vue.set(this.$refs.sidebar.style,"width",0),Vue.set(this,"split",Vue.set(this,"splitGutterElement",null))),this.runAfterSidebarAnimation(()=>{this.$refs.container&&this.ruler.setSidebarProportions([this.$refs.container.clientWidth,0]),this.$refs.layout&&this.$refs.layout.classList.remove("collapsing")}))}uncollapseSidebar(){if(!this.reviewLayoutResourcesActive)return;const e=this.getStoredSidebarSizes()||h,t=this.split?this.split.getSizes():[100,0];this.$refs.layout&&this.$refs.layout.classList.add("collapsing"),this.establishSidebarSplitter(t),requestAnimationFrame(()=>{!this.$destroyed&&this.split&&(this.split.setSizes(e),this.runAfterSidebarAnimation(()=>{this.requestScrollContextWidthUpdate(!0),this.$refs.layout&&this.$refs.layout.classList.remove("collapsing")}))})}async updateScrollContextWidth(e=!1){await this.$nextTick(),this.$refs.container&&Vue.set(this.ruler.width,"scrollContext",this.$refs.container.clientWidth),this.$refs.sidebar&&Vue.set(this.ruler.width,"sidebar",this.$refs.sidebar.clientWidth),e&&this.$refs.container&&this.$refs.sidebar&&this.ruler.setSidebarProportions([this.$refs.container.clientWidth,this.$refs.sidebar.clientWidth])}scheduleRuntimeSidebarSplitterSync(e={}){const t=this.runtimeSidebarSplitterSyncRequest||{};_.assign(t,e),t.frameId&&cancelAnimationFrame(t.frameId),Vue.set(t,"frameId",requestAnimationFrame(()=>{if(Vue.set(this,"runtimeSidebarSplitterSyncRequest",void 0),t.resetDrawer){const e=this.$refs.drawer;e&&(Vue.set(e.style,"height",""),Vue.set(e.style,"transform",""),Vue.set(e.style,"transformOrigin",""),this.$refs.pivotIconWrap&&Vue.set(this.$refs.pivotIconWrap.style,"transform",""),Vue.set(e.style,"width","collapsed"===this.effectiveSidebarState?"36px":""),this.requestScrollContextWidthUpdate())}if(!this.isolated&&this.split)if("drawer-vertical"===this.effectiveSidebarState)this.split.collapse(1),this.requestScrollContextWidthUpdate(!0);else if("full"===this.effectiveSidebarState){if(!t.preserveLiveDragWidth){const e=this.getStoredSidebarSizes();this.split.setSizes(e)}this.requestScrollContextWidthUpdate(!0)}})),Vue.set(this,"runtimeSidebarSplitterSyncRequest",t)}get offsetSidebarDrawer(){return!(!this.reviewReady||!this.height)&&(("collapsed"===this.effectiveSidebarState||"drawer-horizontal"===this.effectiveSidebarState)&&this.getScrollbarPresent())}get scrollbarPresent(){return!(!this.reviewReady||!this.height)&&this.getScrollbarPresent()}normalizeSidebarWidthPx(e){return _.isFinite(e)&&e>0?e:void 0}getPersistedScreenSidebarSetting(e=this.ruler.screenWidth&&`sw${this.ruler.screenWidth}`){if(!e)return;const t=(_get(o,"settings","sidebarSettingsByScreenWidth")||{})[e];if(!_.isObject(t))return;const s=_.includes(u,t.state)?t.state:void 0;if(!s)return;const i=this.normalizeSidebarWidthPx(t.fullWidthPx);return _.isFinite(i)?{state:s,fullWidthPx:i}:{state:s}}syncSidebarRuntimeForScreen(){const e=o.settings.$ready?this.getPersistedScreenSidebarSetting():void 0;let t,s;e?(t=e.state,s=this.normalizeSidebarWidthPx(e.fullWidthPx)):_.includes(u,this.runtimeSidebarState)?(t=this.runtimeSidebarState,s=this.normalizeSidebarWidthPx(this.runtimeFullWidthPx)):(t=this.ruler.narrow?"drawer-horizontal":"full",s=void 0);const i=t!==this.runtimeSidebarState||s!==this.runtimeFullWidthPx;Vue.set(this,"runtimeSidebarState",t),Vue.set(this,"runtimeFullWidthPx",s),i&&this.scheduleRuntimeSidebarSplitterSync({resetDrawer:!0})}get effectiveSidebarState(){return _.includes(u,this.runtimeSidebarState)||this.syncSidebarRuntimeForScreen(),this.runtimeSidebarState}setEffectiveSidebarState(e,{persist:t=!0}={}){_.includes(u,e)&&(Vue.set(this,"runtimeSidebarState",e),t&&this.persistCurrentScreenSidebarSetting({state:e}))}getStoredSidebarSizes(){const e=this.normalizeSidebarWidthPx(this.runtimeFullWidthPx);if(_.isFinite(e)){const t=this.convertSidebarWidthPxToSplitSizes(e);
1if(_.isArray(t)&&2===t.length&&_.every(t,_.isFinite))return t}return h}getMaxSidebarWidthPx(){return this.ruler.windowWidth<768?this.ruler.windowWidth:.5*this.ruler.windowWidth}convertSidebarWidthPxToSplitSizes(e=this.runtimeFullWidthPx){const t=(_get(this,"$refs","layout","clientWidth")||this.ruler.windowWidth)-10;if(!_.isFinite(t)||t<=36)return;const s=_.clamp(e,36,Math.min(t,this.getMaxSidebarWidthPx())),i=_.clamp(s/t*100,0,100);return[100-i,i]}persistCurrentScreenSidebarSetting(e={}){const t=this.ruler.screenWidth&&`sw${this.ruler.screenWidth}`;if(!o.settings.$ready||!t)return;const s=this.getPersistedScreenSidebarSetting(t)||{},i=e.state||s.state||this.effectiveSidebarState,r=this.normalizeSidebarWidthPx(e.fullWidthPx)||s.fullWidthPx||this.runtimeFullWidthPx;_.set(o.settings,`sidebarSettingsByScreenWidth.${t}`,{state:i,fullWidthPx:r||null}),e.fullWidthPx&&Vue.set(this,"runtimeFullWidthPx",r)}getNextSidebarState(e){const t=u.indexOf(this.effectiveSidebarState),s=u.indexOf(e);if(t<0||s<0||t===s)return;return u[t+(s>t?1:-1)]}getSidebarTransition(e,t){return"full"===e&&"collapsed"===t||"drawer-vertical"===e&&"collapsed"===t||"collapsed"===e&&"full"===t?"extreme":"full"===e&&"drawer-vertical"===t||"drawer-vertical"===e&&"full"===t?"dock":"drawer-vertical"===e&&"drawer-horizontal"===t||"drawer-horizontal"===e&&"drawer-vertical"===t?"pivot":"drawer-horizontal"===e&&"collapsed"===t||"collapsed"===e&&"drawer-horizontal"===t?"collapse":void 0}async transitionSidebarStep(e,t){const s=this.getSidebarTransition(e,t);if(!s)return!1;switch(s){case"dock":await this.handleGutterDoubleClick();break;case"pivot":await this.handlePivot();break;case"collapse":await this.handleCollapse();break;case"extreme":await this.handlePivotThenCollapse()}return!0}async setSidebarState(e){if(_.includes(u,e))for(let t=0;t<u.length;t++){if(!this.effectiveSidebarState||this.effectiveSidebarState===e)return;const t=this.effectiveSidebarState;if(await this.transitionSidebarStep(t,e))continue;const s=this.getNextSidebarState(e);if(!s)return;if(!await this.transitionSidebarStep(t,s))return}}async adjustSidebar(...e){if(!this.reviewLayoutResourcesActive)return;const t=_(e).filter(e=>_.includes(u,e)).uniq().value();if(!t.length)return;const s=this.effectiveSidebarState,i=t.indexOf(s),r=i<0?t[0]:t[(i+1)%t.length];await this.setSidebarState(r)}async handlePivot(e={}){if(this.animatingPivot)return;const t=this.$refs.drawer;if(!t)return;const i=this.$refs.pivotIconWrap,r=!(!e||!e.compact),n=c,a=(e,t)=>anime({targets:e,duration:s.defaultOptions.duration,easing:s.animeJsEasing,...t}).finished;switch(this.effectiveSidebarState){case"drawer-vertical":if(Vue.set(t.style,"transformOrigin","50% 182px"),this.collapseSidebar(),!s.shouldAnimate())return this.setEffectiveSidebarState("drawer-horizontal"),Vue.set(t.style,"transformOrigin",""),Vue.set(t.style,"height",""),void Vue.set(t.style,"width",r?"200px":"");if(Vue.set(this,"animatingPivot",!0),await Promise.all([a(t,{keyframes:[{height:n},{rotate:-90}]}),a(i,{rotate:90})]),this.setEffectiveSidebarState("drawer-horizontal"),Vue.set(t.style,"height",""),Vue.set(t.style,"transform",""),i&&Vue.set(i.style,"transform",""),r){Vue.set(t.style,"width","200px"),Vue.set(t.style,"transformOrigin","");break}await a(t,{width:["200px",`${window.innerWidth}px`]}),Vue.set(t.style,"transformOrigin",""),Vue.set(t.style,"width","");break;case"drawer-horizontal":{if(Vue.set(t.style,"transformOrigin","182px"),!s.shouldAnimate())return this.setEffectiveSidebarState("drawer-vertical"),Vue.set(t.style,"transformOrigin",""),Vue.set(t.style,"width",""),void Vue.set(t.style,"height",r?"200px":"");Vue.set(this,"animatingPivot",!0);const e=t.getBoundingClientRect().width;if(await Promise.all([a(t,r?{width:n,rotate:90}:Math.abs(e-n)>1?{keyframes:[{width:n},{rotate:90}]}:{rotate:90}),a(i,{rotate:-90})]),this.setEffectiveSidebarState("drawer-vertical"),Vue.set(t.style,"width",""),Vue.set(t.style,"transform",""),i&&Vue.set(i.style,"transform",""),r){Vue.set(t.style,"height","200px"),Vue.set(t.style,"transformOrigin","");break}const o=_get(this,"$refs","layout","clientHeight");if(!o)return Vue.set(t.style,"transformOrigin",""),Vue.set(this,"animatingPivot",!1),void this.requestScrollContextWidthUpdate();await a(t,{height:["200px",`${o}px`]}),Vue.set(t.style,"transformOrigin",""),Vue.set(t.style,"height","");break}}Vue.set(this,"animatingPivot",!1),this.requestScrollContextWidthUpdate()}async handleCollapse(e={}){const t=this.$refs.drawer;if(!t)return;const i=!(!e||!e.compact),r=(e,t=window.innerWidth,i=window.innerWidth)=>(i=_.isFinite(i)&&i>=1?i:1,s.defaultOptions.duration*Math.abs(e-t)/i),n=anime.timeline({targets:t,easing:s.animeJsEasing});switch(this.effectiveSidebarState){case"drawer-horizontal":{const e=t.getBoundingClientRect().width||window.innerWidth;n.add({width:"36px",duration:r(36,e,Math.max(e,c)),complete:()=>{this.setEffectiveSidebarState("collapsed"),this.requestScrollContextWidthUpdate()}});break}case"collapsed":if(this.setEffectiveSidebarState("drawer-horizontal"),i){n.add({width:"200px",duration:r(c,36),complete:()=>{Vue.set(t.style,"width","200px"),this.requestScrollContextWidthUpdate()}});break}n.add({duration:r(72,36),width:"72px"}),n.add({width:"100%",duration:r(window.innerWidth,72),complete:()=>{Vue.set(t.style,"width",""),this.requestScrollContextWidthUpdate()}})}n.children.length&&await n.finished}
1async handlePivotThenCollapse(){if(this.animatingPivot)return;const e="collapsed"===this.effectiveSidebarState||"drawer-horizontal"===this.effectiveSidebarState;if(e){if("collapsed"===this.effectiveSidebarState&&await this.handleCollapse({compact:!0}),"drawer-horizontal"===this.effectiveSidebarState&&await this.handlePivot(),"drawer-vertical"!==this.effectiveSidebarState)return;this.setEffectiveSidebarState("full"),this.$refs.drawer&&(Vue.set(this.$refs.drawer.style,"width",""),Vue.set(this.$refs.drawer.style,"height","")),this.split&&this.uncollapseSidebar()}else"full"===this.effectiveSidebarState&&(this.setEffectiveSidebarState("drawer-vertical"),this.split&&this.split.collapse(1),await this.$nextTick()),"drawer-vertical"===this.effectiveSidebarState&&await this.handlePivot({compact:!0}),"drawer-horizontal"===this.effectiveSidebarState&&await this.handleCollapse(),s.shouldAnimate()||"collapsed"===this.effectiveSidebarState||(this.setEffectiveSidebarState("collapsed"),this.$refs.drawer&&(Vue.set(this.$refs.drawer.style,"width","36px"),Vue.set(this.$refs.drawer.style,"height",""),Vue.set(this.$refs.drawer.style,"transform",""),Vue.set(this.$refs.drawer.style,"transformOrigin","")),this.$refs.pivotIconWrap&&Vue.set(this.$refs.pivotIconWrap.style,"transform",""));this.requestScrollContextWidthUpdate(),e&&"full"===this.effectiveSidebarState&&!this.split&&this.runAfterSidebarAnimation(()=>{this.requestScrollContextWidthUpdate()})}async handleGutterDoubleClick(){"full"===this.effectiveSidebarState?(this.setEffectiveSidebarState("drawer-vertical"),this.collapseSidebar(!0)):(this.setEffectiveSidebarState("full"),this.uncollapseSidebar()),await new Promise(e=>this.runAfterSidebarAnimation(e)),await this.updateScrollContextWidth()}establishSidebarSplitter(e){const t=this.$refs.container,s=this.$refs.sidebar;if(this.$destroyed||!t||!s||!this.reviewLayoutResourcesActive||!document.contains(t)||!document.contains(s))return;this.split&&this.split.destroy(!1,!0);_.isArray(e)&&_.isFinite(e[1])&&e[1]<=0||Vue.set(s.style,"width","");const i=[1/0,this.getMaxSidebarWidthPx()];this.$refs.layout&&this.$refs.layout.classList.add("collapsing"),Vue.set(this,"split",new Split([t,s],{sizes:e||h,minSize:[0,36],snapOffset:44,cursor:"col-resize",maxSize:i,expandToMin:!0,gutter:(e,t,s)=>this.splitGutterElement?s.previousSibling:(Vue.set(this,"splitGutterElement",document.createElement("div")),Vue.set(this.splitGutterElement,"className",`gutter gutter-${t}`),this.splitGutterElement.addEventListener("dblclick",()=>{this.captureAsync("handleGutterDoubleClick")}),this.splitGutterElement),onDrag:this.throttledSplitterDragUpdate,onDragEnd:()=>{if(this.requestScrollContextWidthUpdate(),"full"===this.effectiveSidebarState){const e=this.normalizeSidebarWidthPx(_get(this,"$refs","sidebar","clientWidth"));Vue.set(this,"runtimeFullWidthPx",e),this.persistCurrentScreenSidebarSetting({fullWidthPx:e})}}})),this.runAfterSidebarAnimation(()=>{this.$refs.container&&this.$refs.sidebar&&this.ruler.setSidebarProportions([this.$refs.container.clientWidth,this.$refs.sidebar.clientWidth]),this.$refs.layout&&this.$refs.layout.classList.remove("collapsing")}),Vue.set(this.ruler.width,"scrollContext",t.clientWidth),Vue.set(this.ruler.width,"sidebar",s.clientWidth)}captureAsync(e,...t){Promise.resolve().then(()=>this[e](...t)).catch(t=>{Sentry.captureException(t,{extra:{context:e}})})}get debugStackingContext(){return r.stackingContext}}AppLayout.$vueOptions={props:{context:{type:Object}}};return _declareVue("AppLayout",AppLayout,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{class:{"debug stacking":e.debugStackingContext}},[s("div",{ref:"header",staticClass:"header wrapper"},[e.reviewChromeShown?e._e():s("div",[e._m(0),s("app-header"),s("changelog-notifier")],1)]),s("div",{ref:"statusbars",staticClass:"statusbars"},[e.reviewChromeShown?[s("statusbar",{attrs:{context:e.context}})]:e._e()],2),e.reviewChromeShown?s("div",{ref:"drawer",staticClass:"ui menu reviewable-sidebar drawer",class:[{hidden:!_get(e,"context","ready")||"full"===e.effectiveSidebarState},e.effectiveSidebarState,{vertical:"drawer-vertical"===e.effectiveSidebarState}],style:{right:e.offsetSidebarDrawer?"15px":"0px"}}
1,[s("div",{attrs:{id:"collapsed-sidebar-drawer"}}),s("div",{staticClass:"ui buttons"},["drawer-horizontal"===e.effectiveSidebarState||"collapsed"===e.effectiveSidebarState?s("ui-button",{staticClass:"collapse basic",on:{click:function(t){return e.captureAsync("handleCollapse")}}},[s("i",{staticClass:"icon sidebar"})]):e._e(),"drawer-horizontal"===e.effectiveSidebarState||"drawer-vertical"===e.effectiveSidebarState?s("ui-button",{staticClass:"pivot basic",attrs:{disabled:e.animatingPivot},on:{click:function(t){return e.captureAsync("handlePivot")}}},[s("span",{ref:"pivotIconWrap",staticClass:"pivot-icon-wrap"},[s("i",{staticClass:"icon pivot"})])]):e._e()],1)]):e._e(),s("div",{ref:"layout",staticClass:"layout wrapper"},[s("div",{ref:"container",staticClass:"scroll context",attrs:{id:"scroll-context",tabindex:"0"}},[s("div",{ref:"content",staticClass:"scroll content",attrs:{id:"scroll-content"}},[e.isolated?s("div",[s("frown-banner")],1):s("div",[e._t("default",null,{effectiveSidebarState:e.effectiveSidebarState})],2)]),s("div",{staticClass:"indicators",style:{right:e.indicatorPositionX,bottom:e.indicatorPositionY}},[s("guide-indicator"),s("failure-indicators"),s("missing-navigation-item-indicator"),s("diff-overflow-indicator"),s("bad-connection-indicator"),s("auth-expiry-indicator"),e.$session.config.gitHubStatusUrl?s("github-status-indicator"):e._e(),s("guest-seat-indicator")],1)]),e.reviewChromeShown?s("div",{ref:"sidebar",staticClass:"reviewable-sidebar",attrs:{id:"sidebar"}},[e._t("sidebar",null,{effectiveSidebarState:e.effectiveSidebarState})],2):e._e()])])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"bunny toggle placeholder"},[t("span",{staticClass:"logo image"})])}],functional:!1},{cssVarsGetter:function(e){return[[!0,{"520a9f8d49433a8a":e.isolated?"100dvh":"calc(100dvh - var(--statusbar-height))","520a9f8d548a8c94":e.scrollbarPresent?"calc(100% - 15px":"100%"}]]},scopeId:"data-v-520a9f8d"}),_declareGuides("AppLayout","data-v-520a9f8d",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".ui.buttons[data-v-520a9f8d]",onboarding:"sawSidebarCollapse",highlight:"bracket"}},[s("p",[s("i",{staticClass:"icon sidebar"}),e._v(" "),s("em",[e._v("Collapse the sidebar drawer")]),e._v("\n into a single button when you don't want it in your way or\n "),s("i",{staticClass:"icon pivot"}),e._v(" "),s("em",[e._v("Toggle the sidebar drawer")]),e._v("\n between horizontal to vertical modes.\n ")])])],1)},[]),{AppLayout:AppLayout}},!0,!0,{filename:"src/view/reviews/app-layout.vue"}),_reviewable.define(["ChecksPanel"],["truss","Guide","Review","config","session","shared"],function(e,t,s,i,r,n){"use strict";class ChecksPanel{constructor(){Vue.set(this,"updatingBranch",!1),Vue.set(this,"config",i),Vue.set(this,"shared",n),Vue.set(this,"successfulStatusesShown",!1),Vue.set(this,"connector",void 0),Vue.set(this,"updateError",void 0)}created(){const e=_.toLower(this.review.core.ownerName),t=_.toLower(this.review.core.repoName);Vue.set(this,"connector",this.$connect({settingsFile:_ref(this.$store,"child","repositories",e,t,"settingsFile").annotate({ignorePermissionDenied:!0}),hasMasterRepository:_ref(this.$store,"child","organizations",e,"masterRepository","hasMasterRepository")}))}get shouldOfferCustomizeCondition(){return i.executorAllowed&&_get(this,"review","verdict","admin")&&this.connector.ready&&!(this.connector.data.settingsFile||this.connector.data.hasMasterRepository)}get shouldOfferBranchUpdate(){const e=this.review.statuses[_get(this,"review","core","lastRevisionKey")].services,t=_get(e,n.mergeableStatusKey);return _get(t,"branchNeedsUpdate")||"success"===_get(t,"state")&&!_get(t,"fastForwardAllowed")}get displayedGroups(){const e=_get(this,"review","statuses","grouped");return[..._get(e,"required","length")?["required"]:[],..._get(e,"optional","length")?["optional"]:[],..._get(e,"successful","length")&&this.successfulStatusesShown?["successful"]:[]]}get numSuccessfulStatuses(){return _get(this,"review","statuses","grouped","successful","length")}get allChecksSuccessful(){if(_get(this,"review","statuses","latest"))return this.review.statuses.latest.length===this.numSuccessfulStatuses}get branchUpdatesEnabled(){const e=_get(this,"review","statuses",_get(this,"review","core","lastRevisionKey"),"services");return!_get(e,n.reviewableStatusContext,"branchUpdatesDisabled")&&_get(this,"review","core","branchesInSameRepo")&&_get(this,"review","core","head","permissions","push")}get rebaseUpdateSupported(){if("https://github.com"===i.gitHubUrl)return!0;
1if(!_get(this,"$store","system","gheVersion"))return!1;const[e,t]=_(this.$store.system.gheVersion).split(".").map(_.parseInt).value();return e>3||3===e&&t>=11}get updateMethod(){return this.rebaseUpdateSupported?_get(this,"review","state","settings","updateMethod"):"merge"}cycleUpdateMethod(){if(!this.shouldOfferBranchUpdate||!this.rebaseUpdateSupported)return;const e="merge"===this.updateMethod?"rebase":"merge";_ref(this,"child","review","state","settings","updateMethod").set(e),Vue.set(r.settings,"updateMethod",e)}async updateSourceBranch(){if(this.shouldOfferBranchUpdate){Vue.set(this,"updatingBranch",!0),Vue.set(this,"updateError",void 0);try{const e=this.review.context,t=r.hubkit(this.review.core.head.owner,this.review.core.head.repo),s=await t.graph("query ($owner: String!, $repo: String!, $prNumber: Int!) {\n repository (owner: $owner, name: $repo) {pullRequest (number: $prNumber) {id}}\n }",{variables:{owner:this.review.core.head.owner,repo:this.review.core.head.repo,prNumber:this.review.core.pullRequestId}}),i=this.rebaseUpdateSupported?`, updateMethod: ${_.toUpper(this.updateMethod)}`:"",n=`input: {pullRequestId: "${s.repository.pullRequest.id}"${i}}`;await t.graph(`mutation {updatePullRequestBranch (${n}) {clientMutationId}}`),await e.syncPullRequest("mergeable")}catch(e){Vue.set(this,"updateError",e.message)}finally{Vue.set(this,"updatingBranch",!1)}}}}ChecksPanel.$vueOptions={props:{review:{type:s,required:!0}}};return _declareVue("ChecksPanel",ChecksPanel,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return _get(e,"review","context")?s("flow-panel",{staticClass:"checks",attrs:{panelKey:"checks",collapsible:"",context:e.review.context,type:"info"},scopedSlots:e._u([{key:"title",fn:function(){return[s("span",{staticClass:"title"},[s("statuses-donut",{attrs:{status:_get(e,"review","statuses","latest")}}),e._v("\n Checks @ "+e._s(_get(e,"review","core","lastRevisionKey"))+"\n ")],1)]},proxy:!0},{key:"content",fn:function(){return[s("animate-slide-down-group",e._l(e.displayedGroups,function(t){return s("div",{key:t,staticClass:"group wrapper"},[s("div",{staticClass:"unobtrusive group header"},[e._v(e._s(t)+":")]),s("animate-slide-down-group",e._l(_get(e,"review","statuses","grouped",t),function(t){return s("div",{key:t.$key,staticClass:"report"},[s("i",{class:e._f("statusIconClass")(t.state,!!t.required),attrs:{alt:t.state}}),s("i",{staticClass:"required icon",class:{hidden:!t.required,red:"success"!==t.state},attrs:{alt:"required"}}),t.structuredDescription?[s("div",{staticClass:"description"},[e._v("\n "+e._s(t.structuredDescription.intro)+"\n "),s("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:t.timestampLocalTime,fixed:!0},expression:"{text: status.timestampLocalTime, fixed: true}"}],staticClass:"timeago"},[e._v("\n "+e._s(t.timestampTimeAgo)+"\n ")])]),s("div",{directives:[{name:"untrusted-html",rawName:"v-untrusted-html",value:t.structuredDescription.html,expression:"status.structuredDescription.html"}],staticClass:"description markdown-body text no-palette"})]:[s("a",{staticClass:"description",class:{link:t.url,pre:t.needsPreFormat},attrs:{href:t.url}},[e._v(e._s(t.fullDescription))]),s("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:t.timestampLocalTime,fixed:!0},expression:"{text: status.timestampLocalTime, fixed: true}"}],staticClass:"timeago"},[e._v("\n "+e._s(t.timestampTimeAgo)+"\n ")])],t.neededCodeownersRows?s("table",{staticClass:"ui codeowners table"},[e._l(t.neededCodeownersRows,function(t){return[t.comment?s("tr",{key:"comment-"+t.index,staticClass:"comment"},[s("td",{staticClass:"unobtrusive",attrs:{colspan:"2"}},[e._v(e._s(t.comment))])]):e._e(),t.pattern?s("tr",{key:t.index},[s("td",{staticClass:"monospace"},[s("span",[e._v(e._s(t.pattern))])]),s("td",e._l(t.entityKeys,function(e){return s("avatar",{key:e,staticClass:"comma-item avatar",attrs:{userKey:e,display:"picture,name,popup","link-to":"profile",size:"tiny",fixed:""}})}
1),1)]):e._e()]})],2):e._e(),t.error?s("span",{staticClass:"ui error message"},[e._v(e._s(t.error))]):e._e(),"reviewable"===t.specialType&&e.shouldOfferCustomizeCondition?s("span",[t.structuredDescription?e._e():s("br"),s("a",{staticClass:"ui basic customize action button",attrs:{href:e.review.core.repoSettingUrl}},[s("i",{staticClass:"configure repository icon"}),e._v(" Customize\n ")])]):e._e(),"mergeable"===t.specialType&&e.branchUpdatesEnabled?s("span",[t.structuredDescription?e._e():s("br"),s("span",{staticClass:"ui update branch basic action buttons"},[s("ui-hold-to-arm-button",{staticClass:"update branch",attrs:{disabled:!e.shouldOfferBranchUpdate},on:{click:function(t){return e.updateSourceBranch()}},scopedSlots:e._u([{key:"fizzled-tip",fn:function(){return[e._v("\n Click and hold to arm, release to update.\n ")]},proxy:!0}],null,!0)},[s("span",{staticClass:"update method"},[s("animate-flip",["merge"===e.updateMethod?s("span",{key:"merge"},[e._v("Update")]):s("span",{key:"rebase"},[e._v("Rebase")])])],1)]),s("span",{staticClass:"ui inverted dimmer",class:{active:e.updatingBranch}},[s("span",{staticClass:"ui mini loader"})]),e.rebaseUpdateSupported?s("ui-button",{staticClass:"icon",class:{disabled:!e.shouldOfferBranchUpdate},on:{click:e.cycleUpdateMethod}},[s("i",{staticClass:"cycle icon"})]):e._e()],1)]):e._e(),t.context===e.shared.mergeableStatusKey&&e.updateError?s("span",{staticClass:"ui error message"},[e._v("\n "+e._s(e.updateError)+"\n ")]):e._e()],2)}),0)],1)}),0),_get(e,"review","statuses","latest")?!e.successfulStatusesShown&&e.allChecksSuccessful?s("div",{staticClass:"empty"},[e._v("\n All checks successful!\n ")]):e._e():s("div",{staticClass:"empty"},[e._v("\n No checks so far.\n ")]),_get(e,"review","statuses","latest")&&e.numSuccessfulStatuses&&!e.successfulStatusesShown?s("div",{staticClass:"successful count"},[s("a",{staticClass:"link",on:{click:function(t){e.successfulStatusesShown=!0}}},[e._v("\n +"+e._s(e.numSuccessfulStatuses)+" successful check"+e._s(1===e.numSuccessfulStatuses?"":"s")+"\n ")])]):e._e()]},proxy:!0}],null,!1,2213080732)}):e._e()},staticRenderFns:[],functional:!1},{scopeId:"data-v-11498706"}),_declareGuides("ChecksPanel","data-v-11498706",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".title[data-v-11498706], .checks.panel[data-v-11498706] .panel.title",onboarding:"showedReviewStatus",position:"bottom"}},[s("p",[e._v("\n The checks panel displays detailed information on the current "),s("em",[e._v("status of GitHub CI\n checks")]),e._v(" (including mergeability) at the review's "),s("em",[e._v("latest revision")]),e._v(".\n ")]),e._v(" "),s("div",[e._v("The donut shows an overview of the relative proportion of checks:")]),e._v(" "),s("dl",{staticClass:"wide-60"},[s("dt",[s("span",{staticClass:"ui green label"},[e._v("green")])]),s("dd",[e._v("Successful")]),e._v(" "),s("dt",[s("span",{staticClass:"ui orange label"},[e._v("orange")])]),s("dd",[e._v("Unsuccessful but not required")]),e._v(" "),s("dt",[s("span",{staticClass:"ui red label"},[e._v("red")])]),s("dd",[e._v("Unsuccessful and required")]),e._v(" "),s("dt",[s("span",{staticClass:"ui grey label"},[e._v("grey")])]),s("dd",[e._v("Pending or in progress")])])]),e._v(" "),s("guide",{attrs:{for:".status.check.icon[data-v-11498706]",onboarding:"sawCheckIcon",position:"right"}},[s("p",[e._v("\n The icon shows the "),s("em",[e._v("state of its corresponding check")]),e._v(":\n ")]),e._v(" "),s("dl",[s("dt",[s("i",{staticClass:"status check success icon"})]),s("dd",[e._v("Check successful!")]),e._v(" "),s("dt",[s("i",{staticClass:"status check pending icon"})]),s("dd",[e._v("Check pending.")]),e._v(" "),s("dt",[s("i",{staticClass:"status check missing icon"})]),s("dd",[e._v("Check missing.")]),e._v(" "),s("dt",[s("i",{staticClass:"status check inprogress icon"})]),e._v(" "),s("dd",[e._v("Work in progress, checks ongoing.")]),e._v(" "),s("dt",[s("i",{staticClass:"red status check failure icon"}
1)]),s("dd",[e._v("Check failed.")]),e._v(" "),s("dt",[s("i",{staticClass:"red status check error icon"})]),s("dd",[e._v("Error running the check.")])]),e._v(" "),s("p",[e._v("\n A "),s("i",{staticClass:"red required icon",staticStyle:{"font-size":"0.75em",position:"relative",top:"-2px"},attrs:{alt:"required"}}),e._v("\n after a status icon indicates that success is required to merge the pull request (at least for\n non-admins).\n ")])]),e._v(" "),s("guide",{attrs:{for:".update.branch.buttons[data-v-11498706]",onboarding:"updatedBranch",position:"right"}},[s("p",[s("em",[e._v("Update")]),e._v(" the pull request's branch to include the "),s("em",[e._v("latest changes")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n You can toggle between update techniques using "),s("i",{staticClass:"cycle icon"}),e._v(":\n ")]),s("dl",{staticClass:"wide-55"},[s("dt",[s("em",[e._v("Update")])]),e._v(" "),s("dd",[e._v("The latest changes will be merged into this branch with a "),s("em",[e._v("merge commit")]),e._v(".")]),e._v(" "),s("dt",[s("em",[e._v("Rebase")])]),e._v(" "),s("dd",[e._v("\n This pull request will be "),s("em",[e._v("rebased")]),e._v(" on top of the latest changes and then\n "),s("em",[e._v("force pushed")]),e._v(".\n ")])]),e._v(" "),s("p")]),e._v(" "),s("guide",{attrs:{for:".customize.button[data-v-11498706]",onboarding:"customizedReviewCompletion",position:"right"}},[s("p",[s("em",[e._v("Customize")]),e._v(" the condition that determines whether the\n "),s("em",[e._v("review has been completed")]),e._v(".\n ")])])],1)},[]),{ChecksPanel:ChecksPanel}},!0,!0,{filename:"src/view/reviews/checks-panel.vue"}),_reviewable.define(["BlocksDiffViewer"],["truss","Guide","Region","bus","animator","debug","dom","pageControl"],function(e,t,s,i,r,n,a,o){"use strict";const l=s.MOD;let c=0;const u={one:({blockOp:e,blockQuals:t,lineIds:s,side:i,rightLineNumber:r,leftLineNumber:n,language:a,line:o,coverage:l,zIndex:c,diffId:u,fileKey:d})=>`\n <div class="diff line ${e} ${t}">\n <div class="line gutter" data-line-ids="${s.join(" ")}"></div>\n <div class="line wrapper diffwidth ${i||""}"\n data-line-number="${null===r?n:r}">\n <div class="relative hljs">\n <div class="monospace line content diffwidth ${i||""} ${a||""} ${o?"":"blank"} ${0===r?"zero":""} coverage ${l}"\n lang="">${o||""}</div>\n ${"keep"!==e&&"dummy"!==e?`<div class="delta-symbol">${"left"===i?"-":"+"}</div>`:""}\n </div>\n <div class="left line discussions diffwidth" data-z="${c}"\n id="diff-${u}${d}-left-${null===n?"empty":n}">\n </div>\n <div class="right line discussions diffwidth" data-z="${c-1}"\n id="diff-${u}${d}-right-${null===r?"empty":r}">\n </div>\n </div>\n </div>\n `,two:({blockOp:e,blockQuals:t,leftLine:s,leftLineNumber:i,leftLanguage:r,rightLine:n,rightLineNumber:a,rightLanguage:o,lineIds:l,leftCoverage:c,rightCoverage:u,zIndex:d,diffId:h,fileKey:p})=>`\n <div class="diff line ${e} ${t}">\n <div class="left line wrapper diffwidth ${null===s?"empty":""}"\n data-line-number="${null===i?"":i}">\n <div class="hljs">\n <div class="monospace left line content diffwidth ${r||""} ${s?"":"blank"} ${null===s?"empty-line":""} ${0===i?"zero":""} coverage ${c}"\n lang="">${s||""}</div>\n </div>\n <div class="left line discussions diffwidth" data-z="${d}"\n id="diff-${h}${p}-left-${null===i?"empty":i}">\n </div>\n </div>\n <div class="line gutter" data-line-ids="${l.join(" ")}"></div>\n <div class="right line wrapper diffwidth ${null===n?"empty":""}"\n data-line-number="${null===a?"":a}">\n <div class="hljs">\n <div class="monospace right line content diffwidth ${o||""} ${n?"":"blank"} ${null===n?"empty-line":""} ${0===a?"zero":""} coverage ${u}"\n lang="">${n||""}</div>\n </div>\n <div class="right line discussions diffwidth" data-z="${d-1}"\n id="diff-${h}${p}-right-${null===a?"empty":a}">\n </div>\n </div>\n </div>\n `};function d(e,t,s){return{fileKey:_get(e,"file","$key"),blockOp:t.op,blockQuals:_.keys(t.quals).join(" "),leftLanguage:e.leftLanguage,rightLanguage:e.rightLanguage,diffId:s}}function h(e,t,s,i,r,n,a){if(i){i.lineOverride&&(s=i.lineOverride);let a=!1;void 0!==i.indent&&!i.continuation&&_.some(e[t],e=>e.indent>=i.indent)&&(Vue.set(e,t,_.reject(e[t],e=>e.indent>=i.indent)),a=!0),i.declaration&&(a||Vue.set(e,t,_.clone(e[t])),e[t].unshift({indent:i.indent,lineId:r,language:n,numHiddenLines:0,html:s.replace(/^\s*/,'$&<span class="after-indent">')+"</span>"})),_.forEach(e[t],e=>e.numHiddenLines++)}return e[t].length?e[t]:null}const p={resetLineCount(){Vue.set(this.one,"lineCount",Vue.set(this.two,"lineCount",0))},one:{lineCount:0,keep(e,t,s,i,r){const n=d(e,s,i);Vue.set(n,"side",null);const a=[];for(let i=0;i<s.left.lines.length;i++)this.lineCount++,Vue.set(n,"leftLineNumber",s.left.range[0]+i),Vue.set(n,"rightLineNumber",s.right.range[0]+i),Vue.set(n,"line",s.left.lines[i]),Vue.set(n,"language",n.rightLanguage),Vue.set(n,"lineIds",[`left-${n.leftLineNumber}`,`right-${n.rightLineNumber}`]),Vue.set(n,"coverage",_get(e,"rightCoverage","lines",`${n.rightLineNumber}`)||_get(e,"leftCoverage","lines",`${n.leftLineNumber}`)||""),Vue.set(n,"zIndex",2*(r-this.lineCount)),a.push({mods:0,ids:n.lineIds,html:u.one(n),leftDecls:h(t,"left",n.line,e.lineInfos.left[n.leftLineNumber-1],n.lineIds[0],n.leftLanguage,n.fileKey),rightDecls:h(t,"right",n.line,e.lineInfos.right[n.rightLineNumber-1],n.lineIds[1],n.rightLanguage,n.fileKey)});return a},compare(e,t,s,i,r){const n=d(e,s,i);Vue.set(n,"leftLineNumber",null),Vue.set(n,"rightLineNumber",null);const a=[];let o=0;s.quals.whitespace&&(o|=l.WHITESPACE),s.quals.base&&(o|=l.BASE),s.quals.metadata&&(o|=l.METADATA),o||(o|=l.CONTENT);const c=_.bind(function(i){const l=s[i].lines;if(!l)return;Vue.set(n,"side",i),Vue.set(n,"language",n[`${i}Language`]);let c=s[i].range&&s[i].range[0];for(let s=0;s<l.length;s++){if(null===l[s])continue;this.lineCount++,Vue.set(n,"line",l[s]);const d=Vue.set(n,`${i}LineNumber`,c++);Vue.set(n,"lineIds",[`${i}-${d}`]),Vue.set(n,"coverage",_get(e,`${i}Coverage`,"lines",`${d}`)||""),Vue.set(n,"zIndex",2*(r-this.lineCount));const p={mods:o,ids:n.lineIds,html:u.one(n)};n.line&&Vue.set(p,`${i}Decls`,h(t,i,n.line,e.lineInfos[i][c-2],p.ids[0],n.language,n.fileKey)),a.push(p)}Vue.set(n,`${i}LineNumber`,null)},this);return c("left"),c("right"),a}},two:{lineCount:0,keep(e,t,s,i,r){const n=d(e,s,i),a=[];for(let i=0;i<s.left.lines.length;i++)this.lineCount++,Vue.set(n,"leftLineNumber",s.left.range[0]+i),Vue.set(n,"rightLineNumber",s.right.range[0]+i),Vue.set(n,"leftLine",s.left.lines[i]),Vue.set(n,"rightLine",s.right.lines[i]),Vue.set(n,"lineIds",[`left-${n.leftLineNumber}`,`right-${n.rightLineNumber}`]),Vue.set(n,"leftCoverage",_get(e,"leftCoverage","lines",`${n.leftLineNumber}`)||""),Vue.set(n,"rightCoverage",_get(e,"rightCoverage","lines",`${n.rightLineNumber}`)||""),Vue.set(n,"zIndex",2*(r-this.lineCount)),a.push({mods:0,ids:n.lineIds,html:u.two(n),leftDecls:h(t,"left",n.leftLine,e.lineInfos.left[n.leftLineNumber-1],n.lineIds[0],n.leftLanguage,n.fileKey),rightDecls:h(t,"right",n.rightLine,e.lineInfos.right[n.rightLineNumber-1],n.lineIds[1],n.rightLanguage,n.fileKey)});return a},compare(e,t,s,i,r){const n=d(e,s,i),a=[];let o=0;s.quals.whitespace&&(o|=l.WHITESPACE),s.quals.base&&(o|=l.BASE),s.quals.metadata&&(o|=l.METADATA),o||(o|=l.CONTENT);const c=s.left.lines||[],p=s.right.lines||[];let v=s.left.range&&s.left.range[0],m=s.right.range&&s.right.range[0];const g=Math.max(c.length,p.length);for(let i=0;i<g;i++){this.lineCount++,Vue.set(n,"leftLine",i<c.length?s.left.lines[i]:null),Vue.set(n,"rightLine",i<p.length?s.right.lines[i]:null),Vue.set(n,"leftLineNumber",null===n.left
1Line?null:v++),Vue.set(n,"rightLineNumber",null===n.rightLine?null:m++),Vue.set(n,"lineIds",[]),n.leftLineNumber&&n.lineIds.push(`left-${n.leftLineNumber}`),n.rightLineNumber&&n.lineIds.push(`right-${n.rightLineNumber}`),Vue.set(n,"leftCoverage",_get(e,"leftCoverage","lines",`${n.leftLineNumber}`)||""),Vue.set(n,"rightCoverage",_get(e,"rightCoverage","lines",`${n.rightLineNumber}`)||""),Vue.set(n,"zIndex",2*(r-this.lineCount));const l={mods:o,ids:n.lineIds,html:u.two(n)};n.leftLine&&Vue.set(l,"leftDecls",h(t,"left",n.leftLine,e.lineInfos.left[n.leftLineNumber-1],_.head(n.lineIds),n.leftLanguage,n.fileKey)),n.rightLine&&Vue.set(l,"rightDecls",h(t,"right",n.rightLine,e.lineInfos.right[n.rightLineNumber-1],_.last(n.lineIds),n.rightLanguage,n.fileKey)),a.push(l)}return a}}};Vue.set(p.one,"edit",Vue.set(p.one,"replace",p.one.compare)),Vue.set(p.two,"edit",Vue.set(p.two,"replace",p.two.compare));class BlocksDiffViewer{constructor(){Vue.set(this,"lastCreatedDraft",void 0),Vue.set(this,"groupInstances",{}),Vue.set(this,"markerInstances",{}),Vue.set(this,"regionsById",{}),Vue.set(this,"regions",[]),Vue.set(this,"markersCreated",!1),Vue.set(this,"blocksLaidOut",!1),Vue.set(this,"diffId",c++),Vue.set(this,"CollapsedDiffRegionViewer",Vue.component("CollapsedDiffRegionViewer")),Vue.set(this,"ResolvedMarker",Vue.component("ResolvedMarker")),Vue.set(this,"DiscussionGroup",Vue.component("DiscussionGroup")),Vue.set(this,"updateDiscussionsDebounced",_.debounce(this.updateDiscussions)),Vue.set(this,"ruler",this.$store.services.ruler),Vue.set(this,"unsubscribeCSSRules",void 0)}mounted(){n.focus&&console.log(`Blocks diff viewer ${this.diff.$key} mounted`),Vue.set(this.$el,"diff",this.diff),i.expandAllFilesRegions.react(this.expandAllRegions,{scope:this}),this.$observe(()=>[this.diff.showing&&this.diff.locators.ready&&this.diff.locators.grouped,_get(this,"diff","review","context","navigation","targetDiscussionKey")],(e,t=[])=>{const[s,i]=e,[r,n]=t;s&&(s!==r||!(i!==n)||this.diff.locators[i])&&this.updateDiscussionsDebounced()}),this.$observe(()=>this.columns,this.updateColumns),this.$observe(()=>this.diff.locators.autoUnhideCounter,e=>{e&&this.expandRegionsWithVisibleDiscussions(!0)}),Vue.set(this,"unsubscribeCSSRules",[this.ruler.subscribeCSSRule("width",".file.diff .wrapper.diffwidth",({diff:e})=>({width:`${e}px`})),this.ruler.subscribeCSSRule("width",".two.column.removed.file.diff .line.left:not(.content).diffwidth,\n .two.column.added.file.diff .line.right:not(.content).diffwidth",({bigColumn:e})=>({width:`${_.round(e,2)}px`})),this.ruler.subscribeCSSRule("width",".two.column.removed.file.diff .line.right:not(.content).diffwidth,\n .two.column.added.file.diff .line.left:not(.content).diffwidth",({diff:e,bigColumn:t})=>({width:`${_.round(2*e-t,2)}px`})),this.ruler.subscribeCSSRule("width",".file.diff .delta-symbol",({diff:e})=>({left:`${e+5}px`}))])}destroyed(){_.forEach(this.unsubscribeCSSRules,e=>e()),n.focus&&console.log(`Blocks diff viewer ${this.diff.$key} destroyed`),this._destroyChildComponents()}get coverageBars(){const e=this.$session.settings.showCoverageBars;return e||void 0===e?"coverage bars":""}createDraft(e){if(Vue.set(this,"lastCreatedDraft",null),"A"===_get(e,"target","nodeName"))return;e.stopPropagation();const t=_get(e,"targetElement")||a.findClosestElement(_get(e,"target"),".line.content",".line.wrapper");if(!t||t.matches(".empty"))return;const s=parseInt(t.getAttribute("data-line-number"),10);if(_.isNaN(s))return;const i=t.classList.contains("left")?"left":"right";Vue.set(this,"lastCreatedDraft",this.diff.createDraft(s,i))}cancelDraft(e){const t=a.findClosestElement(_get(e,"target"),".line.content",".line.wrapper");this.lastCreatedDraft&&t&&!t.matches(".empty")&&(this.lastCreatedDraft.delete(!0),Vue.set(this,"lastCreatedDraft",null))}getLineElement(e,t=!0){if(!_get(this,"diff","file"))return;if(!e)throw new Error("Internal error: nil groupKey");const s=this.$el.querySelector(`#diff-${this.diffId}${this.diff.file.$key}-${e}`);return s||!t?s:this.$el.querySelector(`#diff-${this.diffId}${this.diff.file.$key}-${e.replace(/\d+$/,"0")}`)}createHiddenDiscussionMarkers(e){if(!e){if(this.markersCreated||!this.blocksLaidOut)return;e=this.diff.locators.list,Vue.set(this,"markersCreated",!0)}_.forEach(e,e=>{if(!e.hidden)return;if(!1===_get(this.regionsById[e.groupKey],"visible"))return;const t=_access(a,"","findClosestElement","call",[this.getLineElement(e.groupKey),".diff.line"],"","getElementsByClassName","call",["line gutter"],"",0);if(!t)return;let s=this.markerInstances[t.dataset.lineIds];s||(s=new this.ResolvedMarker({parent:this,propsData:{locators:this.diff.locators,groupKeys:t.dataset.lineIds.split(" ")}}),s.$mount(),Vue.set(this.markerInstances,t.dataset.lineIds,s),t.append(s.$el))})}linkDiscussionGroup(e,t,s){if(e in this.groupInstances)return;const i=_.every(t,"hidden"),r=this.getLineElement(e,!i);if(!r)return void(this.markersCreated&&this.blocksLaidOut&&this.createHiddenDiscussionMarkers(t));const n=_.toNumber(r.dataset.z),a=new this.DiscussionGroup({parent:this,propsData:{groupKey:e,zIndex:n,animate:s}});Vue.set(a,"discussionGroup",t);const o=document.createElement("div");r.append(o),a.$mount(o),Vue.set(this.groupInstances,e,a),this.markersCreated&&this.blocksLaidOut&&this.createHiddenDiscussionMarkers(t)}updateDiscussions(e=!0){const t="added"===_get(this,"diff","action")?"left":"removed"===_get(this,"diff","action")?"right":void 0;t&&_.some(this.diff.locators,{side:t})&&Vue.set(this.diff,"action","modified"),this.blocksLaidOut&&this.diff.locators.ready&&this.diff.showing&&(_.forEach(this.groupInstances,(e,t)=>{this.diff.locators.grouped[t]||(e.destroy(),Vue.delete(this.groupInstances,t))}),this.expandRegionsWithVisibleDiscussions(e),this.decorateRegions(),_.forEach(this.diff.locators.grouped,(t,s)=>{this.groupInstances[s]?Vue.set(this.groupInstances[s],"discussionGroup",t):this.linkDiscussionGroup(s,t,e)}))}expandRegion(e,t,s,i){const r=e.split(t,s);_.forEach(r,e=>{if(e.visible)for(let t=e.start;t<e.end;t++){const s=e.lines[t];_.forEach(s.leftDecls,e=>{e.numHiddenLines--}),_.forEach(s.rightDecls,e=>{e.numHiddenLines--})}}),this.regions.splice.apply(this.regions,[_.indexOf(this.regions,e)+("after"===s?1:0),0].concat(r)),Vue.set(e.instance,"animate",i
1);const n=document.createElement("div");n.append(document.createElement("div")),i&&Vue.set(n.style,"display","none");const a=e.element;"after"===s?a.parentNode.insertBefore(n,a.nextSibling):a.parentNode.insertBefore(n,a,a.nextSibling),this.linkRegions(r,n.firstChild,i),this.computeHunkDeclarations(),this.decorateRegions(),i&&window.requestAnimationFrame(()=>this.animateRegionGroup(n,s)),this.updateDiscussionsDebounced()}expandAllRegions(e,t){e=e||_.constant(!0);const s=_.filter(this.regions,e=>!e.visible&&e.start!==e.end);_.forEach(s,s=>{this.expandRegion(s,e,"after",t)})}linkRegions(e,t,s){_.forEach(e,e=>{let i;if(e.visible){i=e.getLines();const t=document.createElement("div");Vue.set(t,"className","expanded region"),Vue.set(t,"innerHTML",_.map(i,"html").join("")),Vue.set(e,"element",t)}else{const t=new this.CollapsedDiffRegionViewer({parent:this,propsData:{diff:this.diff,region:e,columns:this.columns}});t.$on("expand-region",this.expandRegion),t.$on("expand-all-regions",this.expandAllRegions),t.$mount(),Vue.set(e,"element",t.$el),Vue.set(e,"instance",t)}try{t.append(e.element)}catch(s){throw Vue.set(s,"extra",{parentElement:t,element:e.element,append:t.append}),s}this.indexRegion(e),e.visible&&_.forEach(i,e=>{_.forEach(e.ids,e=>{e in this.diff.locators.grouped&&this.linkDiscussionGroup(e,this.diff.locators.grouped[e],s)})})})}indexRegion(e){_.forEach(e.getLines(),t=>{_.forEach(t.ids,t=>{Vue.set(this.regionsById,t,e)})})}computeHunkDeclarations(){const e=_.pickBy(this.regionsById,e=>e.visible);_.forEach(this.regions,t=>{t.visible||t.computeHunkDeclaration(e)})}animateRegionGroup(e,t){Vue.set(e.style,"display","block");const s=e.getBoundingClientRect();if(s.bottom<10||s.top-document.documentElement.clientHeight>10)return;const i=parseFloat(window.getComputedStyle(e).height),n={duration:r.defaultOptions.duration,easing:r.animeJsEasing};Vue.set(e.style,"height","0px"),Vue.set(e.style,"overflow","hidden");let a=0;const l={height:0},c=o.scrollContexts.primary;anime(_.assign({targets:l,height:i,update:()=>{const s=l.height-a;a=l.height,Vue.set(e.style,"height",l.height+"px"),"before"===t&&c.setScrollTop(c.scrollY()+s)},complete:()=>{Vue.set(e.style,"height",""),Vue.set(e.style,"overflow","visible")}},n)),"after"===t&&anime(_.assign({targets:e.firstElementChild,translateY:["-100%",0],complete:()=>Vue.set(e.firstElementChild.style,"transform","")},n))}decorateRegions(){_.forEach(this.regions,e=>{Vue.set(e,"hasResolved",!1)}),_.forEach(this.diff.locators,e=>{const t=this.regionsById[e.groupKey];t&&_get(e,"tracker","resolved")&&Vue.set(t,"hasResolved",!0)})}expandRegionsWithVisibleDiscussions(e){const t=new Set,s=new Set;_.forEach(this.diff.locators,e=>{const i=this.regionsById[e.groupKey];i&&!i.visible&&e.commentExhibitionLevel>=0&&(t.add(i),s.add(e.groupKey))});for(const i of t)this.expandRegion(i,e=>_.some(e.ids,e=>s.has(e)),"after",e)}updateBlocks(){if(!this.columns)return;const e=this.flattenBlocks(this.diff);Vue.set(this,"regions",[new s(!0,0,1,e),new s(!1,1,e.length,e)]),this.linkRegions(this.regions,this.$el,!1);let t=s.MOD.CONTENT;const i=_get(this,"diff","review","context","stateSettings");!1===_get(i,"collapse","whitespace")&&(t|=s.MOD.WHITESPACE),this.expandRegion(this.regions[1],e=>e.mods&t,"after",!1),Vue.set(this,"blocksLaidOut",!0),this.updateDiscussions(!1),this.diff.locators.ready&&this.createHiddenDiscussionMarkers()}flattenBlocks(e){let t=1;_.forEach(_get(this,"diff","blocks"),e=>{"keep"===e.op?t+=e.left.lines.length:t+=e.left.lines.length+e.right.lines.length});const s={fileKey:_get(e,"file","$key"),blockOp:"dummy",blockQuals:"",leftLineNumber:0,rightLineNumber:0,leftLine:null,rightLine:null,line:null,lineIds:["left-0","right-0"],diffId:this.diffId,language:null,side:null,leftLanguage:null,rightLanguage:null,coverage:"",leftCoverage:"",rightCoverage:"",zIndex:2*t};e.blocks.length||_.assign(s,{blockQuals:"empty",leftLine:"Empty file",rightLine:"Empty file",line:"Empty file"});let i=[{mods:0,ids:s.lineIds,html:u[this.columns](s)}];const r={left:[],right:[]};return p.resetLineCount(),_.forEach(e.blocks,s=>{s&&(i=i.concat(p[this.columns][s.op](e,r,s,this.diffId,t)))}),i}wipeBlocks(){Vue.set(this.$el,"innerHTML",""),this._destroyChildComponents(),Vue.set(this,"groupInstances",{}),Vue.set(this,"markerInstances",{}),Vue.set(this,"regionsById",{}),Vue.set(this,"markersCreated",!1),Vue.set(this,"blocksLaidOut",!1)}_destroyChildComponents(){_.forEach(this.groupInstances,e=>e.$destroy()),_.forEach(this.markerInstances,e=>e.$destroy()),_.forEach(this.regions,e=>_access(e,"","instance","","$destroy","call",[]))}updateColumns(){if(this.$destroyed||!this.$el)return;if(!_get(this,"diff","blocks"))return;const e={};_.forEach(this.regions,t=>{t.visible&&_.forEach(t.getLines(),t=>{_.forEach(t.ids,t=>{Vue.set(e,t,!0)})})}),this.wipeBlocks(),this.updateBlocks(),_.isEmpty(e)||s.temporarilySuppressSentinelLines(()=>{_(this.regions).reject("visible").forEach(t=>{this.expandRegion(t,t=>_.some(t.ids,t=>t in e),"after",!1)})})}}BlocksDiffViewer.$vueOptions={props:{columns:{type:String,required:!1},diff:{type:Object,required:!0}}};return _declareVue("BlocksDiffViewer",BlocksDiffViewer,null,{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{staticClass:"column file diff",class:[e.columns,e.diff.action,e.coverageBars,{disabled:_access(e,"","diff","","review","","state","","isLocked","call",[])}],on:{click:e.createDraft,dblclick:e.cancelDraft}})},staticRenderFns:[],functional:!1},{scopeId:"data-v-d9c278ce"}),_declareGuides("BlocksDiffViewer","data-v-d9c278ce",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".file.diff[data-v-d9c278ce] .diff.line:not(.dummy)",group:".file.diff[data-v-d9c278ce] .line.content",onboarding:"createdLineComment",highlight:"under"}},[s("p",[e._v("\n The "),s("em",[e._v("diff between the two revisions")]),e._v(" of the file currently\n set as the "),s("em",[e._v("diff bounds")]),e._v(". The diff will automatically switch\n between "),s("em",[e._v("unified")]),e._v(" and "),s("em",[e._v("side-by-side")]),e._v(" formats based on the\n "),s("em",[e._v("width of the window")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n Click on a line to "),s("em",[e._v("start a new discussion")]),e._v(" about it.\n The discussion
1will be displayed in the diffs of other revisions as well,\n at the nearest corresponding line.\n ")]),e._v(" "),s("p",[e._v("\n Drag to "),s("em",[e._v("select and copy text")]),e._v(". You can safely drag across\n added/removed text and even across discussions.\n ")]),e._v(" "),s("p",[e._v("\n If present, a "),s("em",[e._v("blue / yellow bar")]),e._v(" in the gutter indicates per-line code coverage.\n ")])]),e._v(" "),s("guide",{attrs:{for:".file.diff[data-v-d9c278ce] .diff.line.base .line.gutter",onboarding:"sawBaseLineMarker",position:"right"}},[s("p",[e._v("\n Indicates that the changes on this line are due entirely to\n "),s("em",[e._v("differences between the base versions")]),e._v(" of the two revisions being diffed.\n ")])]),e._v(" "),s("guide",{attrs:{for:".file.diff[data-v-d9c278ce] .diff.line.whitespace:not(.base) .line.gutter",onboarding:"sawWhitespaceLineMarker",position:"right"}},[s("p",[e._v("\n Indicates that the changes on this line are only in "),s("em",[e._v("whitespace")]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".file.diff[data-v-d9c278ce] .diff.line.metadata .line.gutter",onboarding:"sawMetadataLineMarker",position:"right"}},[s("p",[e._v("\n Indicates that the changes on this line are only "),s("em",[e._v("trivial")]),e._v(" ones in\n "),s("em",[e._v("commit metadata")]),e._v(".\n ")])])],1)},[]),{BlocksDiffViewer:BlocksDiffViewer}},!0,!0,{filename:"src/view/reviews/diff/blocks-diff-viewer.vue"}),_reviewable.define(["CollapsedCommitsMessage"],["truss","config"],function(e,t){"use strict";class CollapsedCommitsMessage{constructor(){}get lastCompactedRevisionKey(){return _access(_,"","findLast","call",[_get(this,"review","revisions","list"),"compacted"],"","$key")}get maxExceededMaxRevisions(){return _(_get(this,"review","revisions")).map("exceededMaxRevisions").compact().max()}get hasLegacyRevisions(){return"onePerCommit"===_get(this,"review","core","revisionSplitStrategy")&&!_(_get(this,"review","revisions")).reject("compacted").reject("exceededMaxRevisions").reject(e=>1===_.size(e.commits)).isEmpty()}get somethingToSay(){return this.lastCompactedRevisionKey||this.maxExceededMaxRevisions||this.hasLegacyRevisions}get saas(){return"saas"===t.env}}CollapsedCommitsMessage.$vueOptions={props:{review:{type:Object,required:!0}}};return _declareVue("CollapsedCommitsMessage",CollapsedCommitsMessage,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[e.somethingToSay?s("div",{staticClass:"ui special icon message"},[s("i",{staticClass:"blue info circle icon",attrs:{alt:"blue info circle icon"}}),s("div",{staticClass:"content"},[e.lastCompactedRevisionKey?s("span",[e._v("\n Revisions up to "+e._s(e.lastCompactedRevisionKey)+" were\n "),s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/reviews#compacting-revisions"}},[e._v("compacted")]),e._v(".\n ")]):e._e(),e.hasLegacyRevisions?s("span",[e._v('\n Some revisions contain multiple commits because they were snapshotted before the review\n switched to "review each commit separately" style.\n ')]):e._e(),e.maxExceededMaxRevisions?s("span",[e._v("\n Some revisions contain more commits than ideal because the safety threshold of\n "+e._s(e.maxExceededMaxRevisions)+" revisions was exceeded. Please\n "),e.saas?s("a",{staticClass:"link",attrs:{href:"mailto:[email protected]"}},[e._v("contact us")]):s("span",[e._v("contact your admin")]),e._v("\n if you'd like to raise this threshold for your repository.\n ")]):e._e()])]):e._e()])},staticRenderFns:[],functional:!1},{}),{CollapsedCommitsMessage:CollapsedCommitsMessage}},!0,!0,{filename:"src/view/reviews/diff/collapsed-commits-message.vue"}),_reviewable.define(["CollapsedDiffRegionViewer"],["truss","Guide","Region","bus"],function(e,t,s,i){"use strict";const r=8-s.SENTINEL_LINES;class CollapsedDiffRegionViewer{constructor(){Vue.set(this,"busy",!1),Vue.set(this,"animate",!0),Vue.set(this,"topEdgeOffset",_.random(600)),Vue.set(this,"topEdgeSize",_.random(400,800)),Vue.set(this,"bottom
1EdgeOffset",_.random(600)),Vue.set(this,"bottomEdgeSize",_.random(400,800))}expand(e){const t={all:_.constant(!0),whitespace:e=>e.mods&s.MOD.WHITESPACE,base:e=>e.mods&s.MOD.BASE,metadata:e=>e.mods&s.MOD.METADATA,discussions:e=>_.some(e.ids,e=>e in this.diff.locators.grouped),up:(e,t)=>Math.abs(t-this.region.start)<r,down:(e,t)=>Math.abs(t-this.region.end)<=r};Vue.set(this.$session.onboarding,"sawCollapsedChanges",!0),this.$emit("expand-region",this.region,t[e],"up"===e?"before":"after",!0)}expandDecl(e){Vue.set(this.$session.onboarding,"expandedDeclaration",!0);const t=this.region[e+"Decl"];s.temporarilySuppressSentinelLines(()=>{this.$emit("expand-all-regions",s=>_.includes(s[e+"Decls"],t),!0)})}get stateSettings(){return _get(this,"diff","review","context","stateSettings")}get collapseWhitespaceFlag(){return _get(this,"stateSettings","collapse","whitespace")}set collapseWhitespaceFlag(e){Vue.set(this.stateSettings,"collapse",this.stateSettings.collapse||{}),Vue.set(this.stateSettings.collapse,"whitespace",e)}handleCollapseChanged(e){Vue.set(this.$session.settings,"collapse",this.$session.settings.collapse||{}),Vue.set(this.$session.settings.collapse,e,this.stateSettings.collapse[e])}expandFile(){Vue.set(this,"busy",!0),_.defer(()=>{this.$emit("expand-all-regions"),Vue.set(this,"busy",!1)})}expandAllFiles(){Vue.set(this,"busy",!0),_.defer(()=>{i.expandAllFilesRegions(),Vue.set(this,"busy",!1)})}}CollapsedDiffRegionViewer.$vueOptions={props:{diff:{type:Object,required:!0},region:{type:Object,required:!0},columns:{type:String,required:!1}}};return _declareVue("CollapsedDiffRegionViewer",CollapsedDiffRegionViewer,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("animate-slide-down",{attrs:{duration:e.animate?"":"0"}},[s("div",{directives:[{name:"show",rawName:"v-show",value:e.region.start<e.region.end,expression:"region.start < region.end"}],staticClass:"relative collapsed wrapper"},[s("div",{staticClass:"relative"},[s("div",{staticClass:"background cover"}),s("div",{staticClass:"top wavy edge",style:{"background-position":e.topEdgeOffset+"px 0","background-size":e.topEdgeSize+"px 16px"}}),s("div",{staticClass:"collapsed region"},[s("div",{staticClass:"right"},[s("div",{staticClass:"expand above link",on:{click:function(t){return e.expand("up")}}},[s("div",{staticClass:"blocker"}),s("i",{staticClass:"expand down icon",attrs:{alt:"down"}}),s("span",{staticClass:"text link"},[e._v("EXPAND")])]),s("div",{staticClass:"expand below link",on:{click:function(t){return e.expand("down")}}},[s("div",{staticClass:"blocker"}),s("i",{staticClass:"expand up icon",attrs:{alt:"up"}}),s("span",{staticClass:"text link"},[e._v("EXPAND")])])]),s("span",{staticClass:"relative"},[s("span",{staticClass:"ui bare icon button collapsed lead"},[s("i",{staticClass:"dropdown icon",attrs:{alt:"dropdown menu"}}),e._v("\n Collapsed:\n "),s("tippy-dropdown",{scopedSlots:e._u([{key:"default",fn:function(t){var i=t.close;return[s("div",{staticClass:"collapse settings ui dimmable segment",class:{dimmed:e.busy}},[s("p",{staticClass:"text"},[s("span",{staticClass:"lead"},[e._v("Expand everything:")]),s("a",{staticClass:"link",on:{click:function(t){e.expandFile(),i()}}},[e._v("this file")]),s("span",{staticClass:"all files"},[e._v("\n â¢\n "),s("a",{staticClass:"link",on:{click:function(t){e.expandAllFiles(),i()}}},[e._v("all files")])])]),s("div",{staticClass:"ui toggle checkbox"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.collapseWhitespaceFlag,expression:"collapseWhitespaceFlag"},{name:"default-true",rawName:"v-default-true"}],attrs:{id:"collapse-whitespace-toggle",type:"checkbox"},domProps:{checked:Array.isArray(e.collapseWhitespaceFlag)?e._i(e.collapseWhitespaceFlag,null)>-1:e.collapseWhitespaceFlag},on:{change:[function(t){var s=e.collapseWhitespaceFlag,i=t.target,r=!!i.checked;if(Array.isArray(s)){var n=e._i(s,null);i.checked?n<0&&(e.collapseWhitespaceFlag=s.concat([null])):n>-1&&(e.collapseWhitespaceFlag=s.slice(0,n).concat(s.slice(n+1)))}else e.collapseWhitespaceFlag=r},function(t){e.handleCollapseChanged("whitespace"),i()}]}}),s("label",{attrs:{for:"collapse-whitespace-toggle"}},[e._v("Collapse whitespace changes")])]),s("div",{staticClass:"details"},[e._v("\n Applies to all future diffs in this review\n and sets your default for new reviews.\n ")]),s("div",{staticClass:"ui simple inverted dimmer"},[s("div",{staticClass:"ui loader"})])])]}}])})],1),s("span",{staticClass:"collapsed features"},[s("a",{staticClass:"link",on:{click:function(t){return e.expand("all")}}},[e._v(e._s(1===e.region.numLines?"1 line":e.region.numLines+" lines"))]),e._v("\n with\n "),e.region.whitespaceChanges||e.region.baseChanges||e.region.metadataChanges?e._e():s("span",{staticClass:"change"}
1,[e._v("no changes")]),e.region.whitespaceChanges?s("span",{staticClass:"change"},[s("a",{staticClass:"link",on:{click:function(t){return e.expand("whitespace")}}},[s("b",[e._v("whitespace changes")])])]):e._e(),e.region.baseChanges?s("span",{staticClass:"change"},[s("a",{staticClass:"link",on:{click:function(t){return e.expand("base")}}},[s("b",[e._v("base commit changes")])])]):e._e(),e.region.metadataChanges?s("span",{staticClass:"change"},[s("a",{staticClass:"link",on:{click:function(t){return e.expand("metadata")}}},[s("b",[e._v("trivial commit metadata changes")])])]):e._e(),e.region.hasResolved?s("span",{staticClass:"change"},[s("a",{staticClass:"link",on:{click:function(t){return e.expand("discussions")}}},[e._v("resolved discussions")])]):e._e()])])]),s("div",{staticClass:"bottom wavy edge",style:{"background-position":e.bottomEdgeOffset+"px 0","background-size":e.bottomEdgeSize+"px 14px"}})]),s("animate-slide-down",[e.region.leftDecl||e.region.rightDecl?s("diff-decl",{attrs:{columns:e.columns,region:e.region},on:{"expand-decl":e.expandDecl}}):e._e()],1)],1)])},staticRenderFns:[],functional:!1},{scopeId:"data-v-cc1c498c"}),_declareGuides("CollapsedDiffRegionViewer","data-v-cc1c498c",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".collapsed.region .right[data-v-cc1c498c]",onboarding:"expandedCollapsedSectionUpDown",position:"left"}},[s("p",[s("em",[e._v("Reveal more context")]),e._v(" above or below a changed\n section of the file, 5 lines at a time.\n ")])]),e._v(" "),s("guide",{attrs:{for:".collapsed.lead[data-v-cc1c498c]",onboarding:"sawCollapsedMenu",highlight:"under"}},[s("p",[e._v("\n A dropdown menu lets you "),s("em",[e._v("control collapsing")]),e._v("\n in the "),s("em",[e._v("whole file")]),e._v(" or "),s("em",[e._v("review")]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".collapsed.features[data-v-cc1c498c]",onboarding:"sawCollapsedChanges",highlight:"under"}},[s("p",[s("em",[e._v("Expand")]),e._v(" the diff around listed features of interest in the collapsed region.\n ")]),e._v(" "),s("p",[s("em",[e._v("Whitespace changes")]),e._v(" are lines where only whitespace changed\n (marked with ⣠when expanded).\n ")]),e._v(" "),s("p",[s("em",[e._v("Base commit changes")]),e._v(" are lines where only the base branch has changed,\n likely not due to work on this pull request (marked with ⥠when expanded).\n ")]),e._v(" "),s("p",[s("em",[e._v("Trivial commit metadata changes")]),e._v(" are lines in the virtual Commits file where a commit\n was rebased, matched up against its predecessor, and the commit message didn't change.\n ")]),e._v(" "),s("p",[s("em",[e._v("Resolved discussions")]),e._v(" are lines with resolved discussions attached\n (marked with "),s("i",{staticClass:"discussion resolved
1icon"}),e._v(" when expanded).\n ")])])],1)},[]),{CollapsedDiffRegionViewer:CollapsedDiffRegionViewer}},!0,!0,{filename:"src/view/reviews/diff/collapsed-diff-region-viewer.vue"}),_reviewable.define(["DiffDecl"],["truss","Guide"],function(e,t){"use strict";class DiffDecl{constructor(){}}DiffDecl.$vueOptions={props:{region:{type:Object,required:!0},columns:String}};return _declareVue("DiffDecl",DiffDecl,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"declaration include"},["one"===e.columns?[e.region.leftDecl&&!e.region.sameDecl?s("div",{staticClass:"diff line keep declaration mismatched"},[s("div",{staticClass:"line gutter"}),s("div",{staticClass:"left line wrapper diffwidth"},[s("div",{staticClass:"hljs"},[s("div",{staticClass:"monospace left line content diffwidth",class:e.region.leftDecl.language,on:{click:function(t){return e.$emit("expand-decl","left")}}},[s("span",{staticClass:"declaration",domProps:{innerHTML:e._s(e.region.leftDecl.html)}}),e.region.leftDeclContinued?s("i",{staticClass:"after-indent"},[e._v(" continued")]):e._e(),s("i",{staticClass:"after-indent"},[e._v(" â¯")]),s("i",{staticClass:"numlines after-indent"},[e._v(" expand "+e._s(e.region.leftDecl.numHiddenLines)+" lines")])])])])]):e._e(),e.region.rightDecl?s("div",{staticClass:"diff line keep declaration",class:{mismatched:!e.region.sameDecl}},[s("div",{staticClass:"line gutter"}),s("div",{staticClass:"right line wrapper diffwidth"},[s("div",{staticClass:"hljs"},[s("div",{staticClass:"monospace right line content diffwidth",class:e.region.rightDecl.language,on:{click:function(t){return e.$emit("expand-decl","right")}}},[s("span",{staticClass:"declaration",domProps:{innerHTML:e._s(e.region.rightDecl.html)}}),e.region.rightDeclContinued?s("i",{staticClass:"after-indent"},[e._v(" continued")]):e._e(),s("i",{staticClass:"after-indent"},[e._v(" â¯")]),s("i",{staticClass:"numlines after-indent"},[e._v(" expand "+e._s(e.region.rightDecl.numHiddenLines)+" lines")])])])])]):e._e()]:s("div",{staticClass:"diff line keep declaration"},[s("div",{staticClass:"left line wrapper diffwidth",class:{empty:!e.region.leftDecl}},[s("div",{staticClass:"hljs"},[s("div",{staticClass:"monospace left line content diffwidth",class:_get(e,"regi
1on","leftDecl","language"),on:{click:function(t){return e.$emit("expand-decl","left")}}},[e.region.leftDecl?[s("span",{staticClass:"declaration",domProps:{innerHTML:e._s(e.region.leftDecl.html)}}),e.region.leftDeclContinued?s("i",{staticClass:"after-indent"},[e._v(" continued")]):e._e(),s("i",{staticClass:"after-indent"},[e._v(" â¯")]),s("i",{staticClass:"numlines after-indent"},[e._v(" expand "+e._s(e.region.leftDecl.numHiddenLines)+" lines")])]:e._e()],2)])]),s("div",{staticClass:"line gutter"}),s("div",{staticClass:"right line wrapper diffwidth",class:{empty:!e.region.rightDecl}},[s("div",{staticClass:"hljs"},[s("div",{staticClass:"monospace right line content diffwidth",class:_get(e,"region","rightDecl","language"),on:{click:function(t){return e.$emit("expand-decl","right")}}},[e.region.rightDecl?[s("span",{staticClass:"declaration",domProps:{innerHTML:e._s(_get(e,"region","rightDecl","html"))}}),e.region.rightDeclContinued?s("i",{staticClass:"after-indent"},[e._v(" continued")]):e._e(),s("i",{staticClass:"after-indent"},[e._v(" â¯")]),s("i",{staticClass:"numlines after-indent"}
1,[e._v(" expand "+e._s(_get(e,"region","rightDecl","numHiddenLines"))+" lines")])]:e._e()],2)])])])],2)},staticRenderFns:[],functional:!1},{scopeId:"data-v-7df98fb8"}),_declareGuides("DiffDecl","data-v-7df98fb8",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".diff.line.declaration[data-v-7df98fb8]",group:".line.content[data-v-7df98fb8]",onboarding:"expandedDeclaration",highlight:"under"}},[s("p",[s("em",[e._v("Expands")]),e._v(" the diff to encompass the "),s("em",[e._v("enclosing function")]),e._v(",\n method, or class definition (as long as your code is nicely indented).\n ")])])],1)},[]),{DiffDecl:DiffDecl}},!0,!0,{filename:"src/view/reviews/diff/diff-decl.vue"}),_reviewable.define(["DiffViewer"],["truss","animator","bus"],function(e,t,s){"use strict";s.showGuideMap.react(()=>{_get(e,"store","services","guideDirectory","overlayActive")||(_.forEach(document.querySelectorAll(".single.files.table td.revcell .prior.arcs"),e=>{e.classList.remove("guide-open")}),_.forEach(document.querySelectorAll(".single.files.table td.revcell:hover .prior.arcs"),e=>{e.classList.add("guide-open")}))},{scope:null});let i=0;class DiffViewer{constructor(){Vue.set(this,"currentDiff",void 0),Vue.set(this,"oldDiff",void 0),Vue.set(this,"oldDiffType",void 0),Vue.set(this,"oldHeight",0),Vue.set(this,"diffComponent",void 0),Vue.set(this,"diffComponentKey",void 0)}created(){this.$observe(()=>[this.newDiff,this.newDiff.ready,this.newDiff.message,this.newDiff.blocks,this.oldDiff,this.currentDiff],this.updateView)}updateView(){if(!_get(this,"newDiff","ready"))return;if(this.oldDiff!==this.currentDiff)return;const e=_.find(["message","blocks"],e=>this.newDiff[e]);e&&(this.oldDiff&&this.oldDiff===this.newDiff&&this.oldDiffType===e||(Vue.set(this,"oldDiffType",e),Vue.set(this,"diffComponent",`${e}-diff-viewer`),Vue.set(this,"diffComponentKey",i++),Vue.set(this,"currentDiff",this.newDiff),this.currentDiff.acquire("updateView"),Vue.set(this.currentDiff,"showing",!0)))}beforeDestroy(){this.currentDiff&&this.currentDiff!==this.oldDiff&&(Vue.set(this.currentDiff,"shown",!1),Vue.set(this.currentDiff,"showing",!1),this.currentDiff.release("destroy diff viewer current"),Vue.set(this,"currentDiff",void 0)),this.oldDiff&&(Vue.set(this.oldDiff,"shown",!1),Vue.set(this.oldDiff,"showing",!1),this.oldDiff.release("destroy diff viewer old"),Vue.set(this,"oldDiff",void 0))}enter(e,s){_get(this,"newDiff","review","context")&&this.newDiff.review.context.numRunningDiffTransitions++,_.defer(()=>{const i=parseInt(getComputedStyle(e).height,10);Vue.set(e.style,"height",this.oldHeight+"px"),Vue.set(e.style,"overflow","hidden"),anime({targets:e,opacity:[0,1],left:[100,0],height:[this.oldHeight,i],delay:this.oldHeight?1.33*t.defaultOptions.duration:0,duration:t.defaultOptions.duration,easing:t.animeJsEasing,complete:()=>{Vue.set(e.style,"height",""),Vue.set(e.style,"overflow",""),this.$destroyed||(Vue.set(this.currentDiff,"shown",!0),this.oldDiff||Vue.set(this,"oldDiff",this.currentDiff))},done:()=>{_get(this,"newDiff","review","context")&&this.newDiff.review.context.numRunningDiffTransitions--,s()}})})}leave(e,s){Vue.set(this,"oldHeight",parseInt(getComputedStyle(e).height,10)),Vue.set(e.style,"position","absolute"),Vue.set(e.style,"top","0"),anime({targets:e,opacity:[1,0],left:[0,-100],duration:.66*t.defaultOptions.duration,easing:t.animeJsEasing,complete:()=>{!this.$destroyed&&this.oldDiff&&this.oldDiff!==this.currentDiff&&(Vue.set(this.oldDiff,"shown",!1),Vue.set(this.oldDiff,"showing",!1),this.oldDiff.release("diff viewer old leave"),Vue.set(this,"oldDiff",this.currentDiff))},done:s})}}DiffViewer.$vueOptions={props:{newDiff:{type:Object,required:!0}}};return _declareVue("DiffViewer",DiffViewer,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("transition",{attrs:{name:"diff",css:!1,appear:""},on:{enter:e.enter,leave:e.leave}},[s(e.diffComponent,{key:e.diffComponentKey,tag:"component",staticClass:"relative diff pane",attrs:{diff:e.currentDiff,columns:e.$store.services.ruler.diffColumns}})],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-30908a6c"}),{DiffViewer:DiffViewer}},!0,!0,{filename:"src/view/reviews/diff/diff-viewer.vue"}
1),_reviewable.define(["DiscussionGroup"],["truss","debug"],function(e,t){"use strict";class DiscussionGroup{constructor(){Vue.set(this,"discussionGroup",void 0)}get discussions(){return _.reject(this.discussionGroup,"hidden")}mounted(){t.focus&&console.log(`Discussion group ${this.groupKey} mounted`)}destroy(){t.focus&&console.log(`Discussion group ${this.groupKey} destroy requested`);const e=()=>{this.$nextTick().then(()=>{const e=this.$el;this.$destroy(),e.parentElement&&e.parentElement.removeChild(e)})};this.discussions.length?this.$once("after-leave",e):e(),Vue.set(this,"discussionGroup",[])}destroyed(){t.focus&&console.log(`Discussion group ${this.groupKey} destroyed`)}}DiscussionGroup.$vueOptions={props:{groupKey:{type:String,required:!0},zIndex:{type:Number},animate:{type:Boolean}}};return _declareVue("DiscussionGroup",DiscussionGroup,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("animate-slide-down-group",{staticClass:"relative",style:{"z-index":e.zIndex},attrs:{appear:e.animate},on:{"after-leave":function(t){return e.$emit("after-leave")}}},e._l(e.discussions,function(t,i){return s("div",{key:t.$key,staticClass:"relative",style:{"z-index":e.discussions.length-i}},[s("discussion-component",{attrs:{locator:t}})],1)}),0)},staticRenderFns:[],functional:!1},{}),{DiscussionGroup:DiscussionGroup}},!0,!0,{filename:"src/view/reviews/diff/discussion-group.vue"}),_reviewable.define(["MessageDiffViewer"],["truss","Guide"],function(e,t){"use strict";class MessageDiffViewer{constructor(){}get list(){return _.reject(this.diff.locators.list,"hidden")}showDiff(e){Vue.set(this.$session.onboarding,"forcedFileDiff",!0),this.diff.$parent.force(e?"hard":"soft")}retryDiff(){Vue.set(this.$session.onboarding,"forcedFileDiff",!0),this.diff.$parent.retry()}showFullDiff(){Vue.set(this.$session.onboarding,"showedFullDiff",!0);const e=this.diff.file;e.diff.setBounds(_.clone(e.diff.fullBounds),!0),this.$nextTick().then(()=>{Vue.set(e,"nonTrivialLatch",!0)})}setProposedDiffBounds(){this.diff.review.files.diffs.setProposedBounds()}showHiddenDiscussions(){const e=_.filter(this.diff.file.parleys,e=>_get(e,"locator","commentExhibitionLevel")<0);this.diff.review.context.navigation.exhibitParleys(1,e)}get canCreateDraft(){return this.$session.user&&_get(this,"diff","rightFileRev")&&this.diff.message&&"throttled"!==this.diff.message.code}createDraft(){if(!this.canCreateDraft)return;const e=this.diff.review.revisions[this.diff.rightFileRev.$key];_get(e,"commitSha")&&(Vue.set(this.$session.onboarding,"createdFileComment",!0),this.diff.review.state.drafts.createStarterDraft(this.diff.rightFileRev.original.file.$key,e.$key,!1,0))}}MessageDiffViewer.$vueOptions={props:{diff:{type:Object,required:!0}}};return _declareVue("MessageDiffViewer",MessageDiffViewer,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[e.diff.message?s("div",{staticClass:"ui icon message"},[s("i",{staticClass:"icon",class:{error:"red warning circle",warning:"yellow warning sign"}[e.diff.message.level]||"info circle",attrs:{alt:e.diff.message.level}}),s("div",{staticClass:"content"},["deleted"===e.diff.message.specialState?s("span",[e._v("\n File deleted at selected revision.\n ")]):e._e(),"text"===e.diff.message.code?s("span",[e._v("\n "+e._s(e.diff.message.text)+"\n "),"error"!==e.diff.message.level||e.diff.message.offerDiff?e._e():s("span",{staticClass:"ui small show diff button",on:{click:e.retryDiff}},[e._v("\n Try again\n ")])]):"nofile"===e.diff.message.code?s("span",[_get(e,"diff","file","diff","bounds",1)?s("span",[e._v("\n File not in pull request at selected revision.\n ")]):s("span",[e._v("\n No diff bounds selected.\n "),s("span",{staticClass:"ui small full diff button",on:{click:e.showFullDiff}},[e._v("\n Show full diff\n ")])])]):"longlines"===e.diff.message.code?s("span",[e._v("\n File has excessively long lines (likely minified).\n ")]):"manylines"===e.diff.message.code?s("span",[e._v("\n File has too many lines to work with effectively.\n ")]):"bigdiff"===e.diff.message.code?s("span",[e._v("\n This diff is pretty big, and showing it will slow things down.\n ")]):"generated"===e.diff.message.code?s("span",[e._v("\n Generated file: "+e._s(e.diff.message.kind)+".\n ")]):"vendored"===e.diff.message.code?s("span",[e._v("\n Vendored file.\n ")]):"nodiff"===e.diff.message.code?s("span",[e._v("\n Diff suppressed via "),s("kbd",[e._v(".gitattributes")]),e._v(".\n ")]):"customdiff"===e.diff.message.code?s("span",[e._v("\n Custom diff specified in "),s("kbd",[e._v(".gitattributes")]),e._v(": "),s("kbd",[e._v(e._s(e.diff.message.kind))]),e._v(".\n ")]):"binary"===e.diff.message.code||"imagediff"===e.diff.message.code?s("span",[e.diff.size.left?s("span",[e._v(e._s("binary"===e.diff.message.code?"File appears to be binary: ":"File is an image: "))]):s("span",[e._v(e._s("binary"===e.diff.message.code?"File appears to be binary":"File is an image"))]),s("span",[e._v(e._s(e.diff.size.left))]),e.diff.size.totalDelta?s("span",[e.diff.size.increased?s("span",{staticClass:"text-green"},[e._v("\n +"+e._s(e.diff.size.increased)+" "+e._s(e.diff.size.deltaPercent)+"\n ")]):e._e(
1),e.diff.size.decreased?s("span",{staticClass:"text-red"},[e._v("\n -"+e._s(e.diff.size.decreased)+" "+e._s(e.diff.size.deltaPercent)+"\n ")]):e._e(),e._v("\n â "+e._s(e.diff.size.right)+"\n ")]):e._e(),e._v(".\n ")]):"throttled"===e.diff.message.code?s("span",[e._v("\n Diff skipped to avoid melting down your CPU.\n "),s("span",{staticClass:"ui small show diff button",on:{click:function(t){return e.showDiff(!1)}}},[e._v("\n Show diff\n ")])]):e._e(),e.diff.message.offerDiff?s("span",{staticClass:"ui small show diff button",on:{click:function(t){return e.showDiff(!0)}}},[e._v("\n Show diff\n ")]):e._e(),e.diff.message.offerGitHub?s("a",{staticClass:"ui small view github button",attrs:{href:_get(e,"diff","gitHubUrl"),target:"_blank"}},[e._v("\n View on GitHub\n ")]):e._e(),e.canCreateDraft?s("span",{staticClass:"ui small create file comment button",on:{click:e.createDraft}},[e._v("\n Start a new discussion\n ")]):e._e()])]):e._e(),e.list.length?s("div",{staticClass:"diffwidth nodiff"},[s("animate-slide-down-group",e._l(e.list,function(t,i){return s("div",{key:t.$key},[s("discussion-component",{style:{"z-index":e.list.length-i},attrs:{locator:t}})],1)}),0)],1):e._e(),e.diff.locators.num.hidden?s("div",{staticClass:"resolved count"},[s("a",{staticClass:"link",on:{click:function(t){return e.showHiddenDiscussions()}}},[e._v("\n + "+e._s(e.diff.locators.num.hidden)+" resolved\n discussion"+e._s(e.diff.locators.num.hidden>1?"s":"")+"\n ")])]):e._e()])},staticRenderFns:[],functional:!1},{scopeId:"data-v-6cee1de3"}),_declareGuides("MessageDiffViewer","data-v-6cee1de3",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".show.diff.button[data-v-6cee1de3]",onboarding:"forcedFileDiff"}},[s("p",[s("em",[e._v("Force the diff")]),e._v(" to be displayed.\n ")])]),e._v(" "),s("guide",{attrs:{for:".view.github.button[data-v-6cee1de3]",onboarding:"viewedFileOnGitHub"}},[s("p",[e._v("\n View the "),s("em",[e._v("file on GitHub")]),e._v(", at the current right diff bound.\n ")])]),e._v(" "),s("guide",{attrs:{for:".create.file.comment.button[data-v-6cee1de3]",onboarding:"createdFileComment"}},[s("p",[s("em",[e._v("Create a discussion")]),e._v(" for the file, not associated with any particular line.\n ")])])],1)},[]),{MessageDiffViewer:MessageDiffViewer}},!0,!0,{filename:"src/view/reviews/diff/message-diff-viewer.vue"}),_reviewable.define(["ResolvedMarker"],["truss","Guide"],function(e,t){"use strict";class ResolvedMarker{constructor(){}get numHidden(){return _.reduce(this.groupKeys,(e,t)=>e+(_get(this,"locators","num","grouped",t,"hidden")||0),0)}reveal(){Vue.set(this.$session.onboarding,"revealedResolvedDiscussions",!0),_.forEach(this.groupKeys,e=>{_.forEach(this.locators.grouped[e],e=>{e.hidden&&Vue.set(e,"commentExhibitionLevel",2)})})}}ResolvedMarker.$vueOptions={props:{locators:Object,groupKeys:Array}};return _declareVue("ResolvedMarker",ResolvedMarker,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.numHidden?s("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.numHidden+" resolved discussion"+(1===e.numHidden?"":"s")+".",expression:"`${numHidden} resolved discussion${numHidden === 1 ? '' : 's'}.`"}],staticClass:"ui bare icon resolved marker button",on:{click:e.reveal}}
1,[s("i",{staticClass:"discussion resolved icon",attrs:{alt:"resolved discussions"}})]):e._e()},staticRenderFns:[],functional:!1},{scopeId:"data-v-2839efa2"}),_declareGuides("ResolvedMarker","data-v-2839efa2",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".resolved.marker[data-v-2839efa2]",onboarding:"revealedResolvedDiscussions",position:"right"}},[s("p",[e._v("\n Reveal one or more "),s("em",[e._v("resolved discussions")]),e._v(" attached to this line.\n ")])])],1)},[]),{ResolvedMarker:ResolvedMarker}},!0,!0,{filename:"src/view/reviews/diff/resolved-marker.vue"}),_reviewable.define(["SelectionCommandPalette"],["truss","Guide","bus","config","diffCopyUtils","mangler","textSelectionTracker","pageControl"],function(e,t,s,i,r,n,a,o){"use strict";function l(e){return e?e.replace(/^[\n\r]+/,"").replace(/[\n\r]+$/,"").replace(/^/gm,"> ")+"\n\n":e}class SelectionCommandPalette{constructor(){Vue.set(this,"copySuccessful",!1),Vue.set(this,"copySuccessfulTimeoutHandle",void 0),Vue.set(this,"lastLeft",void 0),Vue.set(this,"primaryScrollContext",void 0)}created(){this.$observe(()=>this.$store.services.ruler.diffColumns,()=>{a.setPaletteHidden(!0)}),this.$when(()=>o.scrollContexts.primary).then(()=>{Vue.set(this,"primaryScrollContext",o.scrollContexts.primary)})}beforeDestroy(){_access(this,"","$el","","parentNode","","removeChild","call",[this.$el])}get quoteAllowed(){return a.paletteQuoteAllowed}createDraft(){this.multipleLines&&r.adjustSelection(r.getSelectionDirection(),!0);const e=a,t=e.getSelectedCode();e.diff&&e.lineNumber&&t&&(e.diff.createDraft(e.lineNumber,e.side||"right",t),_.defer(()=>{this.clearSelection()},500))}quoteComment(){const e=a.getSelectedText("text/markdown")||n.convertHtmlToMarkdown(a.getSelectedText("text/html"))||a.getSelectedText("text/plain");this.insertQuote(l(e)),this.clearSelection()}quoteCodeblock(){let e=a.getSelectedText("text/plain");_.endsWith(e,"\n")||(e+="\n"),this.insertQuote(l("```\n"+e+"```\n")),this.clearSelection()}insertQuote(e){const t=_get(a,"discussion");if(_get(t,"tracker")&&e)if(t.tracker.draft){const s=document.getElementById(`draft${t.$key}`);if(!_get(s,"model"))return;let i=s.selectionEnd;s.setSelectionRange(i,i);let r=s.value;i>0&&"\n"!==s.value.charAt(i-1)&&(i=_.indexOf(r,"\n",i)+1,0===i&&(r+="\n",i=r.length),r=r.slice(0,i)+"\n"+r.slice(i),i+=1),r=r.slice(0,i)+e+r.slice(i),i+=e.length,Vue.set(s,"value",r),s.setSelectionRange(i,i),s.focus(),Vue.set(s.model,"text",r)}else t.review.state.drafts.createReplyDraft(t,e,!0)}copySelection(e){const t=a.text;function s(){return console.warn("Failed to write rich data to clipboard, falling back to plain text"),i.firefox&&console.log("Turn on the dom.events.asyncClipboard.clipboardItem setting to enable clipboard access"),navigator.clipboard.writeText(t["text/plain"])}a.diff&&this.multipleLines&&r.adjustSelection(r.getSelectionDirection(),!0),Promise.resolve().then(()=>navigator.clipboard.write?navigator.clipboard.write([new ClipboardItem(_(t).mapValues((e,t)=>new Blob([e],{type:t})).mapKeys((e,t)=>_.includes(["text/plain","text/html"],t)?t:`web ${t}`).value())]).catch(e=>(i.prod||console.log(e),s())):s()).then(()=>{clearTimeout(this.copySuccessfulTimeoutHandle),Vue.set(this,"copySuccessful",!0),Vue.set(this,"copySuccessfulTimeoutHandle",setTimeout(()=>{Vue.set(this,"copySuccessful",!1),this.clearSelection()},500))})}clearSelection(){s.releaseSelection()}get side(){return a.side}get visible(){return a.text&&!a.paletteHidden}get extendPossible(){return window.getSelection().setBaseAndExtent}get multipleLines(){return a.text&&/\n.+/.test(a.text["text/plain"])}get locked(){return _access(a,"","diff","","review","","state","","isLocked","call",[])}get top(){if(!this.side||!this.primaryScrollContext)return;const e=this.$el.clientHeight;switch(a.palettePosition){case"above":{const t=getComputedStyle(document.documentElement),s=_.parseInt(t.getPropertyValue("--statusbar-cover-height")),i=a.selectionRect.top-4-e;return i<this.primaryScrollContext.scrollY()+s?this.primaryScrollContext.scrollY()+s:i}case"below":{const t=a.selectionRect.bottom+4;return t+e>this.primaryScrollContext.scrollY()+window.innerHeight?this.primaryScrollContext.scrollY()+window.innerHeight-e:t}default:return 0}}get left(){if(!this.side)return;if(this.copySuccessful)return this.lastLeft;const e=this.$el.getBoundingClientRect().width,t=_get(a,"selectionRect","left")+(_get(a,"selectionRect","width")-e)/2;return _.isNumber(t)?t<window.scrollX?window.scrollX:t+e>window.scrollX+window.innerWidth?window.scrollX+window.innerWidth-e:(Vue.set(this,"lastLeft",t),t):""}}return _declareVue("SelectionCommandPalette",SelectionCommandPalette,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"command-palette"},[s("div",{staticClass:"ui menu"},["discussion"===e.side?[e.quoteAllowed?s("span",{staticClass:"quote item",on:{click:e.quoteComment}},[s("i",{staticClass:"quote icon"}
1),s("span",[e._v(" Quote")])]):e._e(),s("span",{staticClass:"copy item",on:{click:e.copySelection}},[s("i",{staticClass:"clone icon",class:{successful:e.copySuccessful}}),s("span",[e._v(" Copy")])])]:"codeblock-add"===e.side||"codeblock-remove"===e.side?[e.quoteAllowed?s("span",{staticClass:"quote item",on:{click:e.quoteCodeblock}},[s("i",{staticClass:"quote icon"}),s("span",[e._v(" Quote")])]):e._e(),s("span",{staticClass:"copy item",on:{click:e.copySelection}},[s("i",{staticClass:"clone icon",class:{successful:e.copySuccessful}}),s("span",[e._v(" Copy")])])]:"left"===e.side||"right"===e.side?[e.quoteAllowed?s("span",{staticClass:"suggest item",class:{disabled:e.locked},on:{click:e.createDraft}},[s("i",{staticClass:"create codeblock icon"}),s("span",[e._v(" Suggest")])]):e._e(),s("span",{staticClass:"copy item",on:{click:e.copySelection}},[s("i",{staticClass:"clone icon",class:{successful:e.copySuccessful}}),s("span",[e._v("\n Copy "),s("span",{directives:[{name:"show",rawName:"v-show",value:e.multipleLines,expression:"multipleLines"}]},[e._v("lines")])])])]:e._e()],2)])},staticRenderFns:[],functional:!1},{cssVarsGetter:function(e){return[[!0,{"5e27dd547a6dbe0e":e.top+"px","5e27dd548e4d7e20":e.left+"px"}]]},scopeId:"data-v-5e27dd54"}),_declareGuides("SelectionCommandPalette","data-v-5e27dd54",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".copy.item[data-v-5e27dd54]",onboarding:"copiedSelection"}},[s("p",[s("em",[e._v("Copy the current selection")]),e._v(" to the clipboard.\n ")])]),e._v(" "),s("guide",{attrs:{for:".quote.item[data-v-5e27dd54]",onboarding:"quotedSelection"}},[s("p",[s("em",[e._v("Quote the current selection")]),e._v(", creating a new draft if necessary.\n ")]),e._v(" "),s("p",[e._v("\n If quoting from a comment, styling will automatically be converted to Markdown.\n ")])]),e._v(" "),s("guide",{attrs:{for:".suggest.item[data-v-5e27dd54]",onboarding:"suggestedFromSelection"}},[s("p",[s("em",[e._v("Suggest a change")]),e._v(" to the selected piece of code, "),s("em",[e._v("creating a new draft")]),e._v(" on the\n last line of the selection.\n ")])])],1)},[]),{SelectionCommandPalette:SelectionCommandPalette}},!0,!0,{filename:"src/view/reviews/diff/selection-command-palette.vue"}),_reviewable.define(["SelectionHandles"],["truss","textSelectionTracker","diffCopyUtils","bus","dom"],function(e,t,s,i,r){"use strict";const n=-10;class SelectionHandles{constructor(){Vue.set(this,"mouseY",0),Vue.set(this,"ruler",this.$store.services.ruler),Vue.set(this,"handleHeight",20),Vue.set(this,"throttledDrag",void 0),Vue.set(this,"fileDiffHasAddedClass",!1),Vue.set(this,"lastValidDiffLineElement",void 0),Vue.set(this,"snapToEdge",void 0),Vue.set(this,"diffArea",void 0),Vue.set(this,"upperHandle",{y:0,minY:0,maxY:1/0,edge:"bottom",offset:1,ref:void 0,diffLineElement:void 0,previousDiffLineElement:void 0}),Vue.set(this,"lowerHandle",{y:30,minY:0,maxY:void 0,edge:"top",offset:-1,ref:void 0,diffLineElement:void 0,previousDiffLineElement:void 0}),Vue.set(this,"draggingHandle",void 0)}created(){Vue.set(this,"throttledDrag",_.throttle(this.dragOnMove))}mounted(){Vue.set(this,"diffArea",this.$el.parentElement),this.diffArea.classList.add("selecting");const e=this.diffArea.querySelector(".file.diff");Vue.set(this,"fileDiffHasAddedClass",_access(e,"","classList","","contains","call",["added"])||_access(e,"","classList","","contains","call",["removed"])),Vue.set(this.upperHandle,"ref",this.$refs.upperHandle.querySelector("path")),Vue.set(this.lowerHandle,"ref",this.$refs.lowerHandle.querySelector("path")),Vue.set(this,"handleHeight",this.$refs.upperHandle.getBoundingClientRect().height||this.handleHeight);let i=this.getCurrentDiffLineElement(this.diffArea);if(i){(i.classList.contains("empty")||i.classList.contains("blank"))&&(i=s.handleSelectionEdgeCase(i,this.target.side)),Vue.set(this.upperHandle,"diffLineElement",Vue.set(this.lowerHandle,"diffLineElement",i));const e=_access(this,"","upperHandle","","diffLineElement","","getBoundingClientRect","call",[],"","top")-this.diffArea.getBoundingClientRect().top;Vue.set(this.upperHandle,"y",e-this.handleHeight),Vue.set(this.lowerHandle,"y",e+i.getBoundingClientRect().height),t.setPaletteHidden(!0),this.lockSide(),this.setSelection(this.upperHandle.diffLineElement,this.lowerHandle.diffLineElement)}Vue.set(this.lowerHandle,"maxY",this.diffArea.getBoundingClientRect().height),Vue.set(this.lowerHandle,"minY",this.up
1perHandle.y+this.handleHeight+this.ruler.lineHeight),Vue.set(this.upperHandle,"maxY",this.lowerHandle.y-this.handleHeight-this.ruler.lineHeight),this.upperHandle.ref.addEventListener("mousedown",this.handleMouseDown.bind(this,this.upperHandle)),this.lowerHandle.ref.addEventListener("mousedown",this.handleMouseDown.bind(this,this.lowerHandle)),this.upperHandle.ref.addEventListener("touchstart",this.handleMouseDown.bind(this,this.upperHandle)),this.lowerHandle.ref.addEventListener("touchstart",this.handleMouseDown.bind(this,this.lowerHandle)),this.$observe(()=>this.ruler.diffColumns,(e,t)=>{void 0!==t&&this.killHandles()})}beforeDestroy(){this.diffArea.classList.remove("selecting"),this.unlockSide()}killHandles(){t.setSelectionHandlesVisible(!1),t.clearOverride(),i.clearDiffLineSelection(),window.getSelection().removeAllRanges()}handleMouseDown(e,t){Vue.set(this,"draggingHandle",e),document.body.classList.add("cursor-grabbing-all"),this.lockSide(),"touchstart"===t.type?(t.preventDefault(),Vue.set(this,"mouseY",_get(t,"targetTouches",0,"clientY"))):Vue.set(this,"mouseY",t.clientY),window.addEventListener("touchmove",this.throttledDrag,{passive:!1}),window.addEventListener("mousemove",this.throttledDrag),window.addEventListener("mouseup",this.handleMouseUp),window.addEventListener("touchend",this.handleMouseUp)}handleMouseUp(e){this.dragOnMove(e),this.draggingHandle&&(this.draggingHandle.y+=this.snapDimension(this.draggingHandle)),Vue.set(this,"draggingHandle",Vue.set(this,"lastValidDiffLineElement",Vue.set(this,"snapToEdge",void 0))),document.body.classList.remove("cursor-grabbing-all"),window.removeEventListener("touchmove",this.throttledDrag),window.removeEventListener("mousemove",this.throttledDrag),window.removeEventListener("mouseup",this.handleMouseUp),window.removeEventListener("touchend",this.handleMouseUp)}dragOnMove(e){const t=_get(e,"clientY")?e.clientY:_get(e,"targetTouches",0,"clientY");if(this.draggingHandle){e.preventDefault();const s=_.isFinite(t)&&_.isFinite(this.mouseY)?t-this.mouseY:0,i=_access(this,"","draggingHandle","","ref","","getBoundingClientRect","call",[]),r=i[this.draggingHandle.edge]+this.draggingHandle.offset*(this.ruler.lineHeight/2)+this.draggingHandle.offset;Vue.set(this.draggingHandle,"previousDiffLineElement",this.draggingHandle.diffLineElement),this.draggingHandle.diffLineElement&&Vue.set(this,"lastValidDiffLineElement",this.draggingHandle.diffLineElement),Vue.set(this.draggingHandle,"diffLineElement",this.getDiffFromPoint(i.right,r)),"HTML"!==e.target.nodeName&&this.draggingHandle.diffLineElement||(Vue.set(this.draggingHandle,"diffLineElement",this.lastValidDiffLineElement),Vue.set(this,"snapToEdge",!0));const n=_access(this,"","draggingHandle","","diffLineElement","","getBoundingClientRect","call",[],"","height")||this.ruler.lineHeight;this.draggingHandle.y+=s,this.checkHandleBoundaries(this.draggingHandle.edge),Vue.set(this.lowerHandle,"minY",this.upperHandle.y+this.handleHeight+n),Vue.set(this.upperHandle,"maxY",this.lowerHandle.y-this.handleHeight-n),this.draggingHandle.previousDiffLineElement!==this.draggingHandle.diffLineElement&&this.setSelection(this.upperHandle.diffLineElement,this.lowerHandle.diffLineElement)}Vue.set(this,"mouseY",t)}checkHandleBoundaries(e){const t=("top"===e?"lower":"upper")+"Handle";this[t].y<this[t].minY?Vue.set(this[t],"y",this[t].minY):this[t].y>this[t].maxY&&Vue.set(this[t],"y",this[t].maxY-this[t].offset)}getCurrentDiffLineElement(e){if("one"===this.ruler.diffColumns){let t;return e.querySelectorAll(`[data-line-ids~="${this.target.side}-${this.target.line}"]`).forEach(e=>{const s=r.findClosestElement(e,".diff.line");_access(s,"","querySelector","call",[`[id*='${this.target.side}-${this.target.line}']`])&&(t=s.querySelector(".line.content.diffwidth"))}),t}return e.querySelector(`.${this.target.side}[data-line-number="${this.target.line}"] .line.content.diffwidth`)}getDiffFromPoint(e,t){if(_.isFinite(e)&&_.isFinite(t)){const i=document.elementFromPoint(e,t);let n=s.getDiffWidthElementFromNode(i,this.target.side,this.ruler.diffColumns);const a=this.draggingHandle===this.upperHandle;_get(n,"querySelector")&&n.querySelector(".after-indent")&&(n=this.getValidFromAfterIndent(n,{findAnchor:a})),n||(n=r.findClosestElement(i,".collapsed.wrapper"));const o=this.getValidDiffWidthElement(n),l=a?this.lowerHandle.diffLineElement:this.upperHandle.diffLineElement;return this.checkOutOfBounds(o,l)}}getValidDiffWidthElement(e){if(!e)return;const t=_get(this,"target","side"),i=r.findClosestElement(e,".wrapper.diffwidth"),n=this.draggingHandle===this.upperHandle;if(n&&_access(i,"","getBoundingClientRect","call",[],"","height")>this.ruler.lineHeight){const r=this.upperHandle.ref.getBoundingClientRect().bottom-e.getBoundingClientRect().top,n=e.getBoundingClientRect().height,a=this.getLineContent(i,{findAnchor:!0});
1if(r<n/2){if(e.querySelector(".discussion.item")){return s.handleSelectionEdgeCase(a,t,{findAnchor:!0})}return s.handleSelectionEdgeCase(e,t,{findAnchor:!0})}const o=s.handleSelectionEdgeCase(a,t,{findAnchor:!0});return s.handleSelectionEdgeCase(o,t,{findAnchor:!0})}return!n&&e.querySelector(".discussion.item")?s.handleSelectionEdgeCase(this.getLineContent(i),t):s.handleSelectionEdgeCase(e,t,{findAnchor:n})}checkOutOfBounds(e,t){if(!e)return;const s=_access(this,"","$el","","parentElement","","getBoundingClientRect","call",[],"","top"),i=e.getBoundingClientRect().top-s,r=_access(this,"","draggingHandle","","diffLineElement","","getBoundingClientRect","call",[],"","height"),n=this.draggingHandle.offset+r/2;if(this.draggingHandle===this.upperHandle){if(i-n>this.upperHandle.maxY)return t}else if(i+n<this.lowerHandle.minY)return t;return e}getLineContent(e,{findAnchor:t=!1}={}){let i=r.findClosestElement(e,".diff.line");t&&(i=_get(i,"nextElementSibling")||_access(s,"","getClosestPopulatedExpandedRegion","call",[r.findClosestElement(i,".expanded.region"),{findAnchor:t}],"","firstElementChild"));return _access(i,"","querySelector","call",[`.${this.target.side}.line.content.diffwidth`])||_access(i,"","querySelector","call",[".line.content.diffwidth"])}getValidFromAfterIndent(e,{findAnchor:t=!1}={}){if(!e)return;let s;return s=_get(e,t?"nextElementSibling":"previousElementSibling"),s}snapDimension(e){if(!e.diffLineElement||!e.ref)return 0;const t=e.ref.getBoundingClientRect()[e.edge],s=e.diffLineElement.getBoundingClientRect(),i=t-s.top,r=s.height;return!(this.snapToEdge&&"top"===e.edge)&&i-e.offset<=r/2?s.top-t:s.bottom-t}setSelection(e,t){if(!e||!t)return;const i=s.getChildTextNode(e,{trim:!1}),r=s.getChildTextNode(t,{getLast:!0,trim:!1}),n=window.getSelection(),a=document.createRange();if(i&&r){a.setStartBefore(i),a.setEndAfter(r),n.removeAllRanges(),n.addRange(a);const e=s.getSelectionDirection(),t=s.adjustSelection(e,!0),o=s.getLineNumber(t);s.captureSelection(this.target.diff,null,this.target.side,o,t)}}lockSide(){const e="right"===this.target.side,t=r.findClosestElement(this.diffArea,".review-component"),s=this.diffArea.querySelector(".diff.file");t&&t.classList.add("selection-active"),s&&(e?s.classList.add("select-right"):s.classList.add("select-left"),s.classList.add("selecting"),s.classList.add("select"))}unlockSide(){const e=r.findClosestElement(this.diffArea,".review-component"),t=this.diffArea.querySelector(".diff.file");e&&e.classList.remove("selection-active"),t&&(t.classList.remove("selecting"),t.classList.remove("select"),t.classList.remove("select-left"),t.classList.remove("select-right"))}get leftOffset(){if("one"!==this.ruler.diffColumns){if("left"===this.target.side)return n;if(this.fileDiffHasAddedClass){const e=2*this.ruler.width.diff-this.ruler.width.bigColumn;return n+e+this.ruler.gutter}return n+this.ruler.width.diff+this.ruler.gutter}return 7}}SelectionHandles.$vueOptions={props:{target:Object}};return _declareVue("SelectionHandles",SelectionHandles,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"drag-area"},[s("div",{ref:"upperHandle",staticClass:"upper selection-handle",style:{top:e.upperHandle.y+"px",left:e.leftOffset+"px",cursor:e.draggingHandle?"grabbing":"grab"},attrs:{draggable:"false"}},[s("svg",{attrs:{width:"30",height:"20",viewBox:"0 0 30 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[s("path",{attrs:{d:"M19.916 7.48483C26.4706 15.5404 27.479 16.9293 30 20C25.9664 20 11.7863 20 9.07563\n 20C4.0633 20 0 15.5228 0 10C0 4.47715 4.0633 9.53674e-07 9.07563 9.53674e-07C14.088\n 9.53674e-07 17.517 4.53654 19.916 7.48483Z"}})])]),s("div",{ref:"lowerHandle",staticClass:"lower selection-handle",style:{top:e.lowerHandle.y+"px",left:e.leftOffset+"px",cursor:e.draggingHandle?"grabbing":"grab"},attrs:{draggable:"false"}},[s("svg",{attrs:{width:"30",height:"20",viewBox:"0 0 30 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[s("path",{attrs:{d:"M19.916 12.5152C26.4706 4.45962 27.479 3.07073 30 -1.43051e-06C25.9664 -1.43051e-06\n 11.7863 -1.43051e-06 9.07563 -1.43051e-06C4.0633 -1.43051e-06 0 4.47715 0 10C0 15.5228\n 4.0633 20 9.07563 20C14.088 20 17.517 15.4635 19.916 12.5152Z"}}
1)])])])},staticRenderFns:[],functional:!1},{}),{SelectionHandles:SelectionHandles}},!0,!0,{filename:"src/view/reviews/diff/selection-handles.vue"}),_reviewable.define(["CodeblockViewer"],["truss","Guide","corpsman"],function(e,t,s){"use strict";class CodeblockViewer{constructor(){Vue.set(this,"html",void 0),Vue.set(this,"diffShowing",void 0),Vue.set(this,"ruler",this.$store.services.ruler)}created(){this.$observe(()=>this.showContents&&(this.diffShowing?this.codeblock.originalText+this.codeblock.suggestedText:this.codeblock.suggestedText),this.computeHtml),this.$observe(()=>this.codeblock.originalText,()=>{Vue.set(this,"diffShowing",!(!this.codeblock.originalText||!this.codeblock.suggestedText))})}get style(){return{minHeight:this.minHeight?`${this.minHeight}px`:"unset",maxHeight:this.maxHeight?`${this.maxHeight}px`:"unset"}}get lineLinkInaccurate(){return _get(this,"codeblock","lastRevisionLocation","accuracy")<.7}get locked(){return _access(this,"","codeblock","","review","","state","","isLocked","call",[this.codeblock.$draftKey])}navigateToCodeblockLine(){this.codeblock.locationDiffersFromComment}deleteCodeblock(){this.locked||(Vue.set(this.$session.onboarding,"deletedCodeblock",!0),this.codeblock.editable&&this.codeblock.delete())}computeHtml(){if(this.showContents)return this.diffShowing?this.diffSuggestion():this.highlightCodeblock()}diffSuggestion(){const e=this.codeblock.suggestedText;return this.$store.services.diffWorkerBridge.diffText({leftFile:{content:this.codeblock.originalText},leftBaseFile:{},rightFile:{content:e},rightBaseFile:{},decorate:!0,language:this.codeblock.language,force:!0}).then(t=>{e===this.codeblock.suggestedText&&Vue.set(this,"html",_.flatMap(t.blocks,e=>{if("keep"===e.op)return _(e.left.lines).filter(_.isString).map(e=>`<div class="line">${e}</div>`).value();const t=_(e.left.lines).filter(_.isString).map(e=>`<div class="remove line">${e}</div>`).value(),s=_(e.right.lines).filter(_.isString).map(e=>`<div class="add line">${e}</div>`).value();return t.concat(s)}).join("\n"))}).catch(t=>{s.capture(t,"diffing suggestion"),e===this.codeblock.suggestedText&&Vue.set(this,"html",`<div class="ui error message">Failed to diff suggestion: ${_.escape(t)}</div>`)})}highlightCodeblock(){const e=this.codeblock.text;return this.$store.services.diffWorkerBridge.highlightCode({code:e,language:this.codeblock.language||null}).then(t=>{this.codeblock.text===e&&Vue.set(this,"html",_.map(t.lines,e=>`<div class="line">${e}</div>`).join("\n"))}).catch(t=>{s.capture(t,"highlighting codeblock"),this.codeblock.text===e&&Vue.set(this,"html",_.escape(e))})}}CodeblockViewer.$vueOptions={props:{codeblock:{type:Object,required:!0},showContents:{type:Boolean,default:!0},showIndex:{type:Boolean,default:!1},showControls:{type:Boolean,default:!0},minHeight:Number,maxHeight:Number}};return _declareVue("CodeblockViewer",CodeblockViewer,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"codeblock view"},[s("div",{staticClass:"separator"},[s("span",{staticClass:"title"},[e._v(e._s(e.codeblock.kind)),e.showIndex?s("span",{staticClass:"numeral"},[e._v("\n ("+e._s(e.codeblock.romanIndex)+")")]):e._e()]),s("span",{directives:[{name:"show",rawName:"v-show",value:e.showContents,expression:"showContents"}]},[e.showControls&&"suggestion"===e.codeblock.kind?s("span",{staticClass:"diff toggle"},[s("ui-toggle-input",{model:{value:e.diffShowing,callback:function(t){e.diffShowing=t},expression:"diffShowing"}},[e._v("diff")])],1):e._e()]),e.showControls?s("span",{staticClass:"right"},[e.showContents?s("span",[s("copy-button",{staticClass:"ui bare icon mini copy button",attrs:{text:e.codeblock.text+"\n",alt:"copy code block"}}),e.codeblock.lineLinkUrl?s("a",{staticClass:"ui mini basic icon editor button",attrs:{href:e.codeblock.lineLinkUrl}},[s("i",{staticClass:"editor icon",class:e.lineLinkInaccurate?"solid red":""})]):s("span",{directives:[{name:"tooltip",rawName:"v-tooltip.click.immediate",value:e.codeblock.lineLinkError,expression:"codeblock.lineLinkError",modifiers:{click:!0,immediate:!0}}],staticClass:"ui mini basic icon editor button"},[s("i",{staticClass:"editor icon"})])],1):e.codeblock.editable?s("span",{staticClass:"ui mini basic icon delete button",class:{disabled:e.locked},on:{click:e.deleteCodeblock}},[s("i",{staticClass:"close icon"}
1)]):e._e()]):e._e()]),s("div",{directives:[{name:"show",rawName:"v-show",value:e.showContents,expression:"showContents"}],staticClass:"code wrapper",style:e.style},[s("code",{staticClass:"hljs monospace code area",class:{"inline diff":e.diffShowing},domProps:{innerHTML:e._s(e.html)}})])])},staticRenderFns:[],functional:!1},{cssVarsGetter:function(e){return[[!0,{"5a0aafb7be88db78":e.ruler.lineHeight+"px"}]]},scopeId:"data-v-5a0aafb7"}),_declareGuides("CodeblockViewer","data-v-5a0aafb7",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".title[data-v-5a0aafb7]",onboarding:"sawCodeblockTitle",highlight:"under"}},[s("p",[e._v("\n This indicates the "),s("em",[e._v("type of code block")]),e._v(":\n ")]),e._v(" "),s("dl",{staticClass:"wide-90"},[s("dt",[s("em",[e._v("Code snippet")])]),s("dd",[e._v("Code written from scratch.")]),e._v(" "),s("dt",[s("em",[e._v("Code quote")])]),s("dd",[e._v("Code copied from the diff.")]),e._v(" "),s("dt",[s("em",[e._v("Suggestion")])]),s("dd",[e._v("Code copied from the diff then modified.")])]),e._v(" "),s("p",[e._v("\n If there are "),s("em",[e._v("multiple code blocks")]),e._v(" they'll be "),s("em",[e._v("numbered")]),e._v(", so you can reference\n them in your comment.\n ")])]),e._v(" "),s("guide",{attrs:{for:".delete.button[data-v-5a0aafb7]",onboarding:"deletedCodeblock"}},[s("p",[s("em",[e._v("Delete this codeblock")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n If needed, you can recover it by creating a new codeblock and clicking the recover button that\n appears before you type anything.\n ")])]),e._v(" "),s("guide",{attrs:{for:".diff.toggle[data-v-5a0aafb7]",onboarding:"diffedCodeblock",highlight:"under"}},[s("p",[e._v("\n Toggle between "),s("em",[e._v("diffing the suggestion")]),e._v(" against the code it was derived from, or just\n "),s("em",[e._v("showing the suggested code")]),e._v(" on its own.\n ")])]),e._v(" "),s("guide",{attrs:{for:".navigate.button[data-v-5a0aafb7]",onboarding:"navigatedToCodeblockLine",highlight:"under"}},[s("p",[s("em",[e._v("Jump")]),e._v(" to the first "),s("em",[e._v("line in the diff")]),e._v(" that this code block was copied from.\n ")])]),e._v(" "),s("guide",{attrs:{for:".copy.button[data-v-5a0aafb7]",onboarding:"copiedCodeblock",highlight:"under"}},[s("p",[s("em",[e._v("Copy the code")]),e._v(" from this code block onto the clipboard. If showing a diff, this\n copies only the new, suggested code.\n ")])]),e._v(" "),s("guide",{attrs:{for:".editor.button[data-v-5a0aafb7]",onboarding:"linkedToCodeblockLine",highlight:"under"}},[s("p",[s("em",[e._v("Open your linked editor")]),e._v(" to the file and line that this code block came from.\n ")])])],1)},[]),{CodeblockViewer:CodeblockViewer}},!0,!0,{filename:"src/view/reviews/discussion/codeblock-viewer.vue"}),_reviewable.define(["DiscussionComment"],["truss","animator","mangler"],function(e,t,s){"use strict";class DiscussionComment{constructor(){Vue.set(this,"minimizedToggleShow",!1),Vue.set(this,"animate",!1)}created(){s.instrumentDiscussionComment(this,()=>this.comment.htmlBody)}mounted(){this.comment.minimizedReason&&Vue.set(this,"animate",!0)}get multiple(){return _get(this,"comment","codeblocks","list","length")>1}get enhancedHtml(){return s.enhanceDiscussionComment(this.comment.htmlBody)}handleHiddenCommentToggle(){Vue.set(this,"minimizedToggleShow",!this.minimizedToggleShow)}enter(e,s){this.animate&&(Vue.set(this.$refs.comment.style,"height",""),anime({targets:this.$refs.comment,duration:t.defaultOptions.duration,translateY:[-this.$refs.comment.offsetHeight,0],height:[0,this.$refs.comment.offsetHeight],easing:"linear",done:s}))}leave(e,s){this.animate&&(Vue.set(this.$refs.comment.style,"height",""),anime({targets:this.$refs.comment,duration:t.defaultOptions.duration,translateY:[0,-this.$refs.comment.offsetHeight-this.$refs.comment.offsetTop],height:[this.$refs.comment.offsetHeight,0],easing:"linear",done:s}))}}DiscussionComment.$vueOptions={props:{comment:{type:Object,required:!0}}};return _declareVue("DiscussionComment",DiscussionComment,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[e.comment.minimizedReason?s("div",{staticClass:"minimized-comment"},[s("em",[e._v("Comment hidden in GitHub.")]),s("div",{staticClass:"ui lowercase label"},[e._v(e._s(e.comment.minimizedReason.replace("_","Â ")))]),s("a",{staticClass:"unobtrusive show full link comment-toggle",on:{click:function(t){return e.handleHiddenCommentToggle()}}},[e._v("\n "+e._s(e.minimizedToggleShow?"Hide":"Show")+" Comment\n ")])]):e._e(
1),s("div",{staticClass:"comment wrapper"},[s("transition",{attrs:{css:!1},on:{enter:e.enter,leave:e.leave}},[!e.comment.minimizedReason||e.comment.minimizedReason&&e.minimizedToggleShow?s("div",{directives:[{name:"untrusted-html",rawName:"v-untrusted-html",value:e.enhancedHtml,expression:"enhancedHtml"}],key:e.comment.$key,ref:"comment",staticClass:"markdown-body text"}):e._e()])],1),e._l(e.comment.codeblocks.list,function(t){return s("codeblock-viewer",{key:t.$key,attrs:{codeblock:t,"show-index":e.multiple}})})],2)},staticRenderFns:[],functional:!1},{scopeId:"data-v-0ad99306"}),{DiscussionComment:DiscussionComment}},!0,!0,{filename:"src/view/reviews/discussion/discussion-comment.vue"}),_reviewable.define(["DiscussionCommentsTransition"],["truss","animator","pageControl"],function(e,t,s){"use strict";class DiscussionCommentsTransition{constructor(){Vue.set(this,"animation",void 0),Vue.set(this,"visibleComments",[]),Vue.set(this,"throttledSampleTargetHeights",void 0)}created(){Vue.set(this,"throttledSampleTargetHeights",_.throttle(this.sampleTargetHeight,50)),this.$observe(()=>this.commentsToShow,()=>{Vue.set(this,"visibleComments",_access(this,"","commentsToShow","","slice","call",[this.firstVisibleIndex]))},{immediate:!0})}mounted(){this.$observe(()=>this.firstVisibleIndex,(e,t)=>{void 0===t&&(e=0,t=_get(this,"commentsToShow","length")-this.firstVisibleIndex);const s=t>e?1:-1;if(this.animationContext.animate&&1!==s||Vue.set(this,"visibleComments",_access(this,"","commentsToShow","","slice","call",[this.firstVisibleIndex])),!this.animationContext.animate)return;let i;this.animation?(this.animation.pause(),i=_.parseInt(this.$refs.viewport.style.minHeight)):i=this.$refs.viewport.offsetHeight,-1===s?this.restoreScroll():this.animationContext.parleysToCheck.length&&this.checkAllParleysMounted(),this.$nextTick(()=>{const r=[];for(let i=t;i*s>e*s;i-=s){const e=Math.abs(i-t);this.$refs[`comment-${e}`]&&this.$refs[`comment-${e}`].length&&r.push(this.$refs[`comment-${e}`][0])}const n=this.buildAnimation(r,i,s),a=Vue.set(this,"animation",anime(n));let o=a.finished;-1===s&&(o=o.then(()=>{this.animation===a&&Vue.set(this,"visibleComments",_access(this,"","commentsToShow","","slice","call",[this.firstVisibleIndex]))})),o.then(()=>{this.animation===a&&(Vue.set(this,"animation",void 0),this.$refs.viewport&&Vue.set(this.$refs.viewport.style,"minHeight",""))})})})}buildAnimation(e,s,i){let r=0;for(const t of e)r+=t.offsetHeight*i;return{targets:this.$refs.viewport,minHeight:[s,s+r],duration:t.defaultOptions.duration,easing:"linear",update:1===i?this.throttledSampleTargetHeights:_.noop}}sampleTargetHeight(e){const t=e.animations[0].tweens[0].to.original,s=e.animations[0].animatable.target.children[0].offsetHeight;s+"px"!==t&&Vue.set(e.animations[0].tweens[0].to.numbers,0,s)}restoreScroll(){this.animationContext.element&&this.animationContext.offsetViewportTop&&s.scrollContexts.primary.setScrollTop(this.offsetFromDocumentTop(this.animationContext.element,0)-this.animationContext.offsetViewportTop)}offsetFromDocumentTop(e,t){return t+=e.offsetTop,(e=e.offsetParent)?this.offsetFromDocumentTop(e,t):t<0?0:t}checkAllParleysMounted(){this.$when(()=>this.allParleysMounted).then(()=>{this.restoreScroll(),Vue.set(this.animationContext,"parleysToCheck",[]),Vue.set(this.animationContext,"offsetViewportTop",0)})}get allParleysMounted(){return _.every(this.animationContext.parleysToCheck,e=>0!==e.showing)}}DiscussionCommentsTransition.$vueOptions={props:{commentsToShow:Array,firstVisibleIndex:Number,animationContext:Object}};return _declareVue("DiscussionCommentsTransition",DiscussionCommentsTransition,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{ref:"viewport",staticClass:"viewport",class:{animating:!!e.animation}},[s("div",{ref:"collection",staticClass:"collection"},e._l(e.visibleComments,function(t,i){return s("div",{key:t.$key,staticClass:"comment"},[s("div",{ref:"comment-"+i,refInFor:!0},[e._t("comment",null,{comment:t,firstShowing:0===i})],2)])}),0)])},staticRenderFns:[],functional:!1},{scopeId:"data-v-9d56c7e2"}),{DiscussionCommentsTransition:DiscussionCommentsTransition}},!0,!0,{filename:"src/view/reviews/discussion/discussion-comments-transition.vue"}
1),_reviewable.define(["DiscussionComments"],["truss","Guide"],function(e,t){"use strict";class DiscussionComments{constructor(){Vue.set(this,"commentProvenanceTexts",{email:"Comment sent by email",github:"Comment added on GitHub",synthetic:"Synthetic info comment"}),Vue.set(this,"commentIndex",void 0),Vue.set(this,"ruler",this.$store.services.ruler),Vue.set(this,"discussionAnimationContext",{animate:!1,parleysToCheck:[],element:void 0,offsetViewportTop:void 0})}created(){Vue.set(this,"commentIndex",_get(this,"comments","firstVisibleComment")?this.comments.firstVisibleComment.index:1===this.locator.commentExhibitionLevel?_get(this,"comments","list","length")-1:_get(this,"comments","list","length"))}mounted(){Vue.set(this.discussionAnimationContext,"element",this.$refs.commentWrapper),this.$observe(()=>_get(this,"locator","review","context","navigation","lastVisitedDiscussionKey"),e=>{Vue.set(this.discussionAnimationContext,"animate",e===this.locator.$key)}),this.$observe(()=>this.locator.commentExhibitionLevel,()=>{2===this.locator.commentExhibitionLevel?this.showAllComments():0===this.locator.commentExhibitionLevel&&this.hideAllComments()})}get context(){return _get(this,"locator","review","context")}get comments(){return _get(this,"locator","discussion","comments")}get olderCommentsMaxed(){return 0===this.commentIndex}get newerCommentsMaxed(){return this.commentIndex===_get(this,"comments","firstVisibleComment","index")}get showCommentNavigation(){return this.commentIndex||0!==_get(this,"comments","firstVisibleComment","index")}get isCommentWordPlural(){return this.commentIndex>1||0===this.commentIndex?"s":"Â "}showAllInFile(){this._setDiscussionAnimationContextElementOffset(),Vue.set(this.discussionAnimationContext,"parleysToCheck",_get(this,"locator","file","parleys")),_access(this,"","context","","navigation","","exhibitParleys","call",[2,_get(this,"locator","file","parleys")])}hideAllInFile(){this._setDiscussionAnimationContextElementOffset(),_access(this,"","context","","navigation","","exhibitParleys","call",[0,_get(this,"locator","file","parleys")])}showAllInReview(){this._setDiscussionAnimationContextElementOffset(),Vue.set(this.discussionAnimationContext,"parleysToCheck",this.locator.review.discussions.parleys),_access(this,"","context","","navigation","","exhibitParleys","call",[2,this.locator.review.discussions.parleys])}hideAllInReview(){this._setDiscussionAnimationContextElementOffset(),_access(this,"","context","","navigation","","exhibitParleys","call",[0,this.locator.review.discussions.parleys])}decreaseCommentIndex(e){this.commentIndex>0&&(this.commentIndex-=e)}showSingleComment(){Vue.set(this.locator,"commentExhibitionLevel",1),this.decreaseCommentIndex(1)}showAllComments(){Vue.set(this.locator,"commentExhibitionLevel",2),this.decreaseCommentIndex(this.commentIndex)}hideAllComments(){Vue.set(this.locator,"commentExhibitionLevel",0),Vue.set(this,"commentIndex",_get(this,"comments","firstVisibleComment")?this.comments.firstVisibleComment.index:_get(this,"comments","list","length"))}_setDiscussionAnimationContextElementOffset(){Vue.set(this.discussionAnimationContext,"offsetViewportTop",this.$refs.commentWrapper.getBoundingClientRect().top)}}DiscussionComments.$vueOptions={props:{locator:{type:Object,required:!0}}};return _declareVue("DiscussionComments",DiscussionComments,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{ref:"commentWrapper",staticClass:"comments wrapper"},[e.showCommentNavigation?s("span",{ref:"commentNavigation",staticClass:"showhide old comments"},[s("span",{staticClass:"relative"},[s("span",{on:{click:function(t){e.$session.onboarding.showedOldComments=!0}}},[s("span",{staticClass:"ui bare icon settings button"},[s("i",{staticClass:"dropdown icon",attrs:{alt:"dropdown menu"}}),s("strong",[s("span",{staticClass:"ui purple label"},[e._v(e._s(e.commentIndex))]),e._v("\n older "+e._s("comment"+e.isCommentWordPlural)+"\n ")]),s("tippy-dropdown",{attrs:{options:{offset:[28,4],placement:"bottom-end"}},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.close;return[s("table",{staticClass:"ui segment showhide settings"},[s("tr",{staticClass:"header"},[s("td",[e._v("Hide")]),s("td"),s("td",[e._v("Show")])]),s("tr",[s("td",[s("ui-button",{staticClass:"basic tiny circular icon expand many down",attrs:{disabled:e.newerCommentsMaxed},on:{click:function(t){e.hideAllComments(),i()}}},[s("i",{staticClass:"expand many down icon"}
1)])],1),s("td",[e._v("in this discussion")]),s("td",[s("ui-button",{staticClass:"basic tiny circular icon expand many up",attrs:{disabled:e.olderCommentsMaxed},on:{click:function(t){e.showAllComments(),i()}}},[s("i",{staticClass:"expand many up icon"})])],1)]),e.locator.file?s("tr",[s("td",[s("ui-button",{staticClass:"basic tiny circular icon expand many down",attrs:{disabled:e.newerCommentsMaxed},on:{click:function(t){e.hideAllInFile(),i()}}},[s("i",{staticClass:"expand many down icon"}),e._v("â¢\n ")])],1),s("td",[e._v("in this file")]),s("td",[s("ui-button",{staticClass:"basic tiny circular icon expand many up",attrs:{disabled:e.olderCommentsMaxed},on:{click:function(t){e.showAllInFile(),i()}}},[e._v("\n â¢"),s("i",{staticClass:"expand many up icon"})])],1)]):e._e(),s("tr",[s("td",[s("ui-button",{staticClass:"basic tiny circular icon expand many down",attrs:{disabled:e.newerCommentsMaxed},on:{click:function(t){e.hideAllInReview(),i()}}},[s("i",{staticClass:"expand many down icon"}),e._v("â¢â¢\n ")])],1),s("td",[e._v("in the review")]),s("td",[s("ui-button",{staticClass:"basic tiny circular icon expand many up",attrs:{disabled:e.olderCommentsMaxed},on:{click:function(t){e.showAllInReview(),i()}}},[e._v("\n â¢â¢"),s("i",{staticClass:"expand many up icon"})])],1)])])]}}],null,!1,2708085985)})],1)])]),s("ui-short-or-long-click-button",{staticClass:"bare icon expand one up",attrs:{disabled:e.olderCommentsMaxed},on:{click:e.showSingleComment,"long-click":e.showAllComments},scopedSlots:e._u([{key:"short",fn:function(){return[s("i",{staticClass:"expand up icon"})]},proxy:!0},{key:"long",fn:function(){return[s("i",{staticClass:"expand many up icon"})]},proxy:!0}],null,!1,1978080746)})],1):e._e(),s("div",{staticClass:"ui comments"},[s("discussion-comments-transition",{attrs:{commentsToShow:_get(e,"comments","list"),firstVisibleIndex:e.commentIndex,animationContext:e.discussionAnimationContext},scopedSlots:e._u([{key:"comment",fn:function(t){var i=t.comment,r=t.firstShowing;return[s("div",{staticClass:"time divider",class:{elided:i.sameTimeAgoAsPreviousComment&&!r}},[s("span",{staticClass:"text"},[e._v("\n "+e._s(i.timestampTimeAgo)+"\n ")])]),s("animate-wipe-right",[i===_get(e,"comments","firstNewComment")?s("div",{staticClass:"disappearing ribbon"},[s("div",{staticClass:"ui new ribbon label"},[s("i",{staticClass:"unread message icon"}),e._v("\n New comment"),i.index<_get(e,"comments","list","length")-1?s("span",[e._v("s")]):e._e(),e.locator.review.state?s("a",{staticClass:"unobtrusive link",on:{click:function(t){return e.locator.tracker.acknowledge()}}},[e._v("\n mark read\n ")]):e._e()])]):e._e()]),s("div"),s("avatar",{staticClass:"avatar",attrs:{"user-key":i.authorKey,"popup-suffix":"("+i.timestampLocalTime+")",display:"picture,popup,search"}}),i.provenance?s("i",{directives:[{name:"tooltip",rawName:"v-tooltip.bottom",value:e.commentProvenanceTexts[i.provenance],expression:"commentProvenanceTexts[comment.provenance]",modifiers:{bottom:!0}}],staticClass:"provenance icon",class:i.provenance}):e._e(),s("discussion-comment",{staticClass:"content",attrs:{comment:i}})]}}])}),_get(e,"locator","tracker","verificationNeeded")?s("div",{staticClass:"comment"},[s("div",{staticClass:"time divider",class:{elided:_get(e,"comments","verificationTimeAgoSameAsLastComment")}},[s("span",{staticClass:"text"},[e._v(e._s(_get(e,"comments","verificationTimeAgo")))])]),e._m(0),s("div",{staticClass:"content",staticStyle:{"font-style":"italic"}},[e._v("\n Some participants' dispositions changed since the last comment.\n ")])]):e._e()],1)])},staticRenderFns:[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"disappearing ribbon"},[s("div",{staticClass:"ui new ribbon label"},[e._v("New dispositions")])])}],functional:!1},{scopeId:"data-v-0e6e8937"}),_declareGuides("DiscussionComments","data-v-0e6e8937",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".new.ribbon.label[data-v-0e6e8937]",onboarding:"sawNewCommentRibbon",highlight:"bracket",position:"right"}},[s("p",[e._v("\n Indicates that you have "),s("em",[e._v("not acknowledged or replied to")]
1),e._v("\n any comments after this point.\n ")]),e._v(" "),s("p",[e._v("\n If you need to "),s("em",[e._v("mark comments as read")]),e._v("\n without replying or accepting the discussion, you can "),s("em",[e._v("hover")]),e._v("\n over the ribbon to reveal a mark read link.\n ")])]),e._v(" "),s("guide",{attrs:{for:".comment .avatar[data-v-0e6e8937]",onboarding:"sawCommentAuthor",position:"left"}},[s("p",[e._v("\n The "),s("em",[e._v("author of the comment")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n You can hover over the avatar to see the name and username, and can "),s("em",[e._v("search")]),e._v("\n for them using\n "),s("span",{staticClass:"cfp-hotkeys-key"},[e._v(e._s(e.config.mac?"â":"ctrl")+" + f")]),e._v("\n even though they don't show up on the page.\n ")])]),e._v(" "),s("guide",{attrs:{for:".time.divider .text[data-v-0e6e8937]",onboarding:"sawTimeAgoDivider",highlight:"bracket"}},[s("p",[e._v("\n Roughly how long ago the "),s("em",[e._v("comments above the divider")]),e._v("\n were made, up to the next timestamped divider.\n ")])]),e._v(" "),s("guide",{attrs:{for:".showhide.old.comments[data-v-0e6e8937]",onboarding:"sawCommentNavigation",highlight:"bracket"}},[s("p",[e._v("\n Reviewable "),s("em",[e._v("hides previously read comments")]),e._v(" in discussions. Click\n "),s("em",[s("i",{staticClass:"expand up icon"}),e._v(" to show the previous comment")]),e._v(", or hold a bit before\n releasing to show all comments.\n ")]),e._v(" "),s("p",[e._v("\n The "),s("i",{staticClass:"alt dropdown icon",attrs:{alt:"dropdown menu"}}),e._v(" dropdown menu has options\n to show or hide comments in the current discussion, the current file, or in all files in\n the review. Click "),s("em",[s("i",{staticClass:"many expand up icon"}),e._v(" to expand all comments")]),e._v(" or\n "),s("em",[s("i",{staticClass:"expand many down icon"}),e._v(" to collapse them")]),e._v(" in the given scope.\n ")]),e._v(" "),s("p",[e._v("\n Collapsing all comments will nonetheless leave the most recent two comments visible, unless\n the discussion has been resolved.\n ")])])],1)},[]),{DiscussionComments:DiscussionComments}},!0,!0,{filename:"src/view/reviews/discussion/discussion-comments.vue"}),_reviewable.define(["DiscussionGroupRow"],["truss"],function(e){"use strict";class DiscussionGroupRow{constructor(){}}DiscussionGroupRow.$vueOptions={props:{row:{type:Object,required:!0},isCollapsed:{type:Function,required:!0}}};return _declareVue("DiscussionGroupRow",DiscussionGroupRow,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("tr",[s("td",{staticClass:"cell",attrs:{colspan:"4"},on:{click:function(t){return e.$emit("toggle-collapsed",e.row.group)}}},[s("span",{staticClass:"collapse toggle"},[s("i",{staticClass:"group icon",class:e.isCollapsed(e.row.group)?"closed":"open"}),s("span",{staticClass:"label"},[e._v(e._s(e.row.label))])]),s("span",[e._v("\n ("+e._s(e.row.numDiscussions)+" discussion"+e._s(1===e.row.numDiscussions?"":"s")+")\n ")])])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-5bc5349f"}),{DiscussionGroupRow:DiscussionGroupRow}},!0,!0,{filename:"src/view/reviews/discussion/discussion-group-row.vue"}),_reviewable.define(["DiscussionHeader"],["truss","Guide"],function(e,t){"use strict";class DiscussionHeader{constructor(){}get discussionUrl(){return window.location.href.replace(/(#.*)?$/,"#"+this.locator.$key)}checkForMissingLineLink(){this.locator.lineLinkUrl||this.$store.services.header.toggleHeaderAndAccountSettings()}}DiscussionHeader.$vueOptions={props:{locator:{type:Object,required:!0}}};return _declareVue("DiscussionHeader",DiscussionHeader,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"discussion header"},["-top"===e.locator.$key?s("span",{staticClass:"top title"},[s("i",{staticClass:"main discussion icon",attrs:{alt:""}}),e._t("title",function(){return[e._v("Review discussion")]})],2):s("span",{staticClass:"discussion status",staticStyle:{"padding-right":"3px"}},[0===e.locator.resolutionLevel?s("span",[s("i",{staticClass:"new discussion icon"}),e._v(" New comment\n ")]):1===e.locator.resolutionLevel?s("span",[s("i",{staticClass:"ongoing discussion icon"}),e._v(" In progress\n ")]):2===e.locator.resolutionLevel?s("span",[s("i",{staticClass:"resolved discussion icon"}),e._v(" Resolved\n ")]):3===e.locator.resolutionLevel?s("span",[s("i",{staticClass:"nonblocking discussion icon"}
1),e._v(" Non-blocking\n ")]):e._e(),s("span",{directives:[{name:"show",rawName:"v-show",value:e.locator.resolutionLevelNeedsPublishing,expression:"locator.resolutionLevelNeedsPublishing"}],staticClass:"unobtrusive"},[e._v("\n after publishing\n ")])]),_get(e,"locator","tracker","irrelevant")?s("span",{staticClass:"unobtrusive"},[e._v("("),s("span",{staticClass:"show comments link",on:{click:function(t){_access(e,"","locator","","reverseCommentExhibitionLevel","call",[])}}},[e._v(e._s(_get(e,"locator","commentExhibitionLevel")>0?"hide":"show")+" discussion")]),e._v(")")]):e._e(),s("span",{staticClass:"line number"},["-top"!==e.locator.$discussionKey?s("span",{staticClass:"info"},[s("i",{staticClass:"discussion scope icon",attrs:{alt:"scope"}}),e._v("\n "+e._s(e.locator.lineLink||"review")+"\n "),s("i",{staticClass:"dropdown icon",attrs:{alt:"dropdown menu"}}),s("tippy-dropdown",{attrs:{options:{placement:"bottom-end",offset:[35,4],theme:"dropdown-flat-top"}}},[s("span",{staticClass:"discussion-header ui segment vertical menu"},[s("copy-button",{staticClass:"item copy address",attrs:{icon:"internal-link",text:e.discussionUrl,alt:"copy discussion link to clipboard"}},[s("span",[e._v("Copy discussion link")])]),e.locator.filePathAndLine?s("copy-button",{staticClass:"item copy address",attrs:{text:e.locator.filePathAndLine,alt:"copy file path and line to clipboard"}},[s("span",[e._v("Copy "+e._s(e.locator.latestLine>0?"line":"file")+" path")])]):e._e(),"-commits"!==e.locator.$fileKey?s("a",{staticClass:"item",attrs:{href:e.locator.lineLinkUrl},on:{click:e.checkForMissingLineLink}},[s("i",{staticClass:"editor icon",attrs:{alt:"open line in editor"}}),s("span",[e._v("Open in editor")])]):e._e(),_get(e,"locator","file","system")?e._e():s("div",{staticClass:"ui simple dropdown item"},[s("i",{staticClass:"github icon",attrs:{alt:"github"}}),s("span",[e._v("Open on GitHubâ¦")]),s("div",{staticClass:"github sub menu"},[s("a",{staticClass:"item",class:{disabled:!e.locator.githubLinkUrl},attrs:{href:e.locator.githubLinkUrl}},[s("span",[e._v("Open file")])]),s("a",{staticClass:"item",class:{disabled:!e.locator.githubEditorLink},attrs:{href:e.locator.githubEditorLink}},[s("span",[e._v("Edit file")])])])])],1)])],1):e._e()])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-450c70d0"}),_declareGuides("DiscussionHeader","data-v-450c70d0",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".showhide.old.comments[data-v-450c70d0]","hotkey-action":"toggleCurrentDiscussionOlderComments()",onboarding:"showedOldComments",highlight:"under",position:"top"}},[s("p",[e._v("\n Show or hide "),s("em",[e._v("older comments")]),e._v(" in the discussion.\n ")]),e._v(" "),s("p",[e._v("\n You can use the "),s("i",{staticClass:"dropdown icon",attrs:{alt:"dropdown menu"}}),e._v("\n dropdown menu to show or hide older comments for multiple discussions at the same time.\n ")])]),e._v(" "),s("guide",{attrs:{for:".line.number .info[data-v-450c70d0]",highlight:"under",onboarding:"sawLineNumber"}},[s("p",[e._v("\n The "),s("em",[e._v("line number")]),e._v(" this discussion is attached to in the currently displayed revision.\n ")]),e._v(" "),s("p",[e._v("\n You "),s("em",[e._v("shouldn't use this line number")]),e._v(" directly since it will change as the underlying\n file is edited. Instead, configure the external editor link to its left.\n ")])]),e._v(" "),s("guide",{attrs:{for:".discussion-header.ui.segment.vertical.menu[data-v-450c70d0]",onboarding:"linkedToLineActions",highlight:"bracket","hotkey-action":"\n copyDiscussionLink(), copyFilePath(), openFileInEditor(), openFileOnGitHub(),\n editFileOnGitHub()\n "}},[s("p",[s("i",{staticClass:"internal-link icon",attrs:{alt:"copy discussion link"}}),e._v(" "),s("em",[e._v("Copy the link")]),e._v(" for this discussion to the clipboard.\n ")]),e._v(" "),s("p",[s("i",{staticClass:"clone icon",attrs:{alt:"copy line path"}}),e._v("\n Copy the "),s("em",[e._v("line path")]),e._v(" to the clipboard.\n ")]),e._v(" "),s("p",[s("i",{staticClass:"editor icon",attrs:{alt:"open line in editor"}}),e._v("\n Open this file in "),s("em",[e._v("an external editor of your choosing")]),e._v(". You can configure this in\n your account settings.\n ")]),e._v(" "),s("p",[s("i",{staticClass:"github icon",attrs:{alt:"open file on GitHub"}}),e._v("\n Open the file at the "),s("em",[e._v("current line")]),e._v(" in "),s("em",[e._v("GitHub")]),e._v(" or in GitHub's editor.\n ")]),e._v(" "),s("p",[e._v("\n (Some actions are not available in virtual files.)\n ")])])],1)},[]),{DiscussionHeader:DiscussionHeader}},!0,!0,{filename:"src/view/reviews/discussion/discussion-header.vue"}
1),_reviewable.define(["DiscussionMatrixBody"],["truss"],function(e){"use strict";class DiscussionMatrixBody{constructor(){Vue.set(this,"collapsedGroups",["5.Resolved"])}toggleCollapsed(e){this.isCollapsed(e)?_.pull(this.collapsedGroups,e):this.collapsedGroups.push(e)}isCollapsed(e){return _.includes(this.collapsedGroups,e)}isRowVisible(e){return e&&("group"===e.type||"spacer"===e.type||!this.isCollapsed(e.group))}}DiscussionMatrixBody.$vueOptions={props:{rows:{required:!0},visible:{type:Boolean},context:{type:Object}}};return _declareVue("DiscussionMatrixBody",DiscussionMatrixBody,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("progressive-render-list",{tag:"tbody",attrs:{items:e.rows,visible:e.visible,batch:1,isRowVisible:e.isRowVisible},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return["parley"!==i.type||e.isCollapsed(i.group)?e._e():s("discussion-row",{key:i.key,staticClass:"link cell row",class:{striped:i.striped},attrs:{parley:i.parley,context:e.context}}),"file"!==i.type||e.isCollapsed(i.group)?e._e():s("tr",{key:i.key,staticClass:"file row",class:{striped:i.striped}},[s("td",{attrs:{colspan:"4"}},["-- commits"===i.path?s("span",[s("i",{staticClass:"commit icon"}),e._v(" Commits\n ")]):s("span",[e._v("\n "+e._s(i.path)+"\n ")])])]),"spacer"===i.type?s("tr",{key:i.key,staticClass:"spacer row"},[s("td",{attrs:{colspan:"4"}})]):e._e(),"group"===i.type?s("discussion-group-row",{key:i.key,staticClass:"group row",attrs:{row:i,isCollapsed:e.isCollapsed},on:{"toggle-collapsed":e.toggleCollapsed}}):e._e()]}}])})},staticRenderFns:[],functional:!1}
1,{scopeId:"data-v-5ad67d92"}),{DiscussionMatrixBody:DiscussionMatrixBody}},!0,!0,{filename:"src/view/reviews/discussion/discussion-matrix-body.vue"}),_reviewable.define(["DiscussionMatrix"],["truss","Review"],function(e,t){"use strict";class DiscussionMatrix{constructor(){Vue.set(this,"sidebarSeeMoreFrame",void 0),Vue.set(this,"overflowObserver",void 0),Vue.set(this,"observedOverflowParent",void 0),Vue.set(this,"availableSidebarWidth",void 0),Vue.set(this,"inlineMatrixContentWidth",void 0),Vue.set(this,"performanceMode",!0),Vue.set(this,"prewarmReady",!1),Vue.set(this,"latchedShowMatrix",!1)}mounted(){if(this.$observe(()=>this.showSidebarSeeMore,()=>{this.scheduleSidebarSeeMoreChange()}),Vue.set(this,"overflowObserver",new ResizeObserver(()=>{requestAnimationFrame(()=>{this.syncOverflowMetrics()})})),this.$waitForRefs("main",e=>{this.overflowObserver&&this.overflowObserver.observe(e),this.syncOverflowMetrics()}),this.$observe(()=>[this.showMatrix,this.overlaid],()=>{requestAnimationFrame(()=>{this.syncOverflowMetrics()})}),!this.showMatrix){const e=()=>{Vue.set(this,"prewarmReady",!0)};window.requestIdleCallback?requestIdleCallback(e):setTimeout(e,3e3)}}beforeDestroy(){this.overflowObserver&&this.overflowObserver.disconnect(),this.sidebarSeeMoreFrame&&cancelAnimationFrame(this.sidebarSeeMoreFrame),this.$emit("sidebar-see-more-change",!1)}get context(){return this.review.context}scheduleSidebarSeeMoreChange(){this.sidebarSeeMoreFrame&&cancelAnimationFrame(this.sidebarSeeMoreFrame),Vue.set(this,"sidebarSeeMoreFrame",requestAnimationFrame(()=>{Vue.set(this,"sidebarSeeMoreFrame",void 0),this.$emit("sidebar-see-more-change",this.showSidebarSeeMore)}))}get sidebarInlineContentOverflowing(){return _.isFinite(this.availableSidebarWidth)&&_.isFinite(this.inlineMatrixContentWidth)&&this.inlineMatrixContentWidth>this.availableSidebarWidth}get showSidebarSeeMore(){return!this.overlaid&&this.showMatrix&&this.sidebarInlineContentOverflowing}get showMatrix(){if(this.latchedShowMatrix)return!0;const e=_.size(this.review.discussions.matrixParleys);return(!this.performanceMode||e>0&&e<200)&&Vue.set(this,"latchedShowMatrix",!0),this.overlaid||this.latchedShowMatrix}refreshOverflowObservation(){if(!this.overflowObserver||!_get(this,"$el"))return;const e=this.$el.parentElement;e!==this.observedOverflowParent&&(this.observedOverflowParent&&this.overflowObserver.unobserve(this.observedOverflowParent),Vue.set(this,"observedOverflowParent",e||void 0),e&&this.overflowObserver.observe(e))}syncOverflowMetrics(){if(this.refreshOverflowObservation(),!this.showMatrix||!this.$refs.main)return Vue.set(this,"availableSidebarWidth",void 0),void Vue.set(this,"inlineMatrixContentWidth",void 0);const e=this.$el.parentElement,t=e&&getComputedStyle(e),s=_get(e,"clientWidth"),i=_.isFinite(s)?s-parseFloat(_get(t,"paddingLeft"))-parseFloat(_get(t,"paddingRight")):void 0,r=this.$refs.main.scrollWidth;_.isFinite(i)&&i>0&&Vue.set(this,"availableSidebarWidth",i),_.isFinite(r)&&r>0&&Vue.set(this,"inlineMatrixContentWidth",r)}}DiscussionMatrix.$vueOptions={props:{review:{type:t,required:!0},overlaid:{type:Boolean}}};return _declareVue("DiscussionMatrix",DiscussionMatrix,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"discussion matrix"},[s("table",{ref:"main",staticClass:"ui collapsing unstackable discussions table"},[e.showMatrix||e.prewarmReady?s("discussion-matrix-body",{directives:[{name:"show",rawName:"v-show",value:e.showMatrix,expression:"showMatrix"}],attrs:{rows:e.review.discussions.matrixRows,visible:e.showMatrix,context:e.context}}):e._e(),e.showMatrix?e._e():s("many-items-warning",{attrs:{context:e.context,itemName:"discussions",panelKey:"discussionMatrix"},on:{"show-all":function(t){e.performanceMode=!1}}})],1)])},staticRenderFns:[],functional:!1},{scopeId:"data-v-c6ff9c24"}),{DiscussionMatrix:DiscussionMatrix}},!0,!0,{filename:"src/view/reviews/discussion/discussion-matrix.vue"}),_reviewable.define(["DiscussionOtherParticipant"],["truss","Guide"],function(e,t){"use strict";class DiscussionOtherParticipant{constructor(){}dismiss(e,t){this.$once("dropdown-hidden",()=>e.dismiss(t)),this.$el.blur()}undismiss(e){this.$once("dropdown-hidden",()=>e.undismiss()),this.$el.blur()}}
1DiscussionOtherParticipant.$vueOptions={props:{participant:Object,index:Number,tracker:Object}};return _declareVue("DiscussionOtherParticipant",DiscussionOtherParticipant,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("multiselect",{class:{unreplied:e.tracker.unrepliedUserKeySet[e.participant.$key]},attrs:{searchable:!1,options:[],"show-labels":!1,"tippy-options":{arrow:!0,offset:[0,10],bypassCloseOnClick:!0,placement:"bottom-end"},"apply-deep-styles":!1},on:{open:function(t){return e.$emit("dropdown-shown")},close:function(t){return e.$emit("dropdown-hidden")}},scopedSlots:e._u([{key:"clear",fn:function(){return[s("div",{staticClass:"notch"})]},proxy:!0},{key:"placeholder",fn:function(){return[s("div",{staticClass:"button"},[s("div",{staticClass:"relative wheel",style:{transform:"rotateZ("+68*(e.tracker.otherParticipants.length-e.index)+"deg)"}},[s("avatar",{staticClass:"avatar",attrs:{"user-key":e.participant.$key,display:"picture"}}),s("i",{class:[e.$options._base.options.filters.dispositionIconClass(e.participant.effectiveDisposition),e.participant.dismissal?"green":""]})],1)])]},proxy:!0},{key:"beforeList",fn:function(){return[e.participant.dismissal?s("div",{staticClass:"unobtrusive preface not-item"},[e._v("\n After you publish,\n "),s("avatar",{staticClass:"avatar",attrs:{"user-key":e.participant.$key,display:"name,username","description-suffix":"will be:"}})],1):s("div",{staticClass:"unobtrusive preface not-item"},[s("avatar",{staticClass:"avatar",attrs:{"user-key":e.participant.$key,display:"name,username","description-suffix":"is:"}})],1)]},proxy:!0},{key:"afterList",fn:function(){return[e.participant.dismissable?s("div",{staticClass:"unobtrusive dismissal not-item"},[s("i",{staticClass:"dismiss icon"}),e._v(" Dismiss from\n "),s("a",{staticClass:"link",on:{click:function(t){return e.dismiss(e.participant,!1)}}},[e._v("this discussion")]),e._v("\n â¢\n "),s("a",{staticClass:"link",on:{click:function(t){return e.dismiss(e.participant,!0)}}},[e._v("unresolved discussions")]),e._v(".\n ")]):e.participant.dismissal?s("div",{staticClass:"unobtrusive dismissal not-item"},[s("a",{staticClass:"link",on:{click:function(t){return e.undismiss(e.participant)}}},[e._v("Cancel dismissal")])]):e._e()]},proxy:!0},{key:"noOptions",fn:function(){return[s("div",{staticClass:"item"},["following"===e.participant.effectiveDisposition?[s("i",{staticClass:"disposition following icon"}),s("b",[e._v("Following")]),e._v(": following new comments but neutral on resolving.\n ")]:"mentioned"===e.participant.effectiveDisposition?[s("i",{staticClass:"disposition mentioned icon"}),s("b",[e._v("Mentioned")]),e._v(": recently @-mentioned in a comment but neutral on resolving.\n ")]:"dismissed"===e.participant.effectiveDisposition?[s("i",{staticClass:"disposition dismissed icon"}),e.participant.effectiveDismisserKey===e.participant.$key?[s("b",[e._v("Disengaged")]),e._v(": left the discussion of their own accord.\n ")]:[s("b",[e._v("Dismissed")]),e._v(": was engaged but dismissed by\n "),s("avatar",{staticClass:"avatar",attrs:{"user-key":e.participant.effectiveDismisserKey,display:"name,username"}}),e._v(".\n ")]]:"withdrawn"===e.participant.effectiveDisposition?[s("i",{staticClass:"disposition withdrawn icon"}),s("b",[e._v("Withdrawn")]),e._v(": dropped and resolved the discussion before it got started.\n ")]:"discussing"===e.participant.effectiveDisposition?[s("i",{staticClass:"disposition discussing icon"}),s("b",[e._v("Discussing")]),e._v(": contributing to the discussion but neutral on resolving.\n ")]:"satisfied"===e.participant.effectiveDisposition?[s("i",{staticClass:"disposition satisfied icon"}),s("b",[e._v("Satisfied")]),e._v(": in favor of resolving the discussion.\n ")]:"informing"===e.participant.effectiveDisposition?[s("i",{staticClass:"disposition informing icon"}),s("b",[e._v("Informing")]),e._v(": resolving a discussion without ending it.\n ")]:"blocking"===e.participant.effectiveDisposition?[s("i",{staticClass:"disposition blocking icon"}),s("b",[e._v("Blocking")]),e._v(":\n opposed to resolving the discussion
1while waiting on somebody else.\n ")]:"working"===e.participant.effectiveDisposition?[s("i",{staticClass:"disposition working icon"}),s("b",[e._v("Working")]),e._v(":\n holding the discussion unresolved while working on something related.\n ")]:e._e()],2)]},proxy:!0}])})},staticRenderFns:[],functional:!1},{scopeId:"data-v-38ef361b"}),_declareGuides("DiscussionOtherParticipant","data-v-38ef361b",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".participant.role .dismissal[data-v-38ef361b]",position:"bottom",highlight:"under",onboarding:"dismissedParticipant"}},[s("p",[s("em",[e._v("Dismiss a participant")]),e._v(" from the discussion, "),s("em",[e._v("voiding their resolution\n vote")]),e._v("âwhether for or against. You need "),s("em",[e._v("appropriate permissions")]),e._v(" to do this.\n ")]),e._v(" "),s("p",[e._v("\n Optionally, you can dismiss the person from all unresolved discussions in this review.\n ")]),e._v(" "),s("p",[e._v("\n This is "),s("em",[e._v("not a ban")]),e._v(": all their comments will remain and they'll be able to rejoin the\n discussion (and vote on resolution) at any time. Rather, this is useful for taking over a\n review, or resolving a discussion when somebody is unavailable.\n ")])])],1)},[]),{DiscussionOtherParticipant:DiscussionOtherParticipant}},!0,!0,{filename:"src/view/reviews/discussion/discussion-other-participant.vue"}),_reviewable.define(["DiscussionParticipants"],["truss","Guide","bus","animator"],function(e,t,s,i){"use strict";s.showGuideMap.react(()=>{_get(e,"store","services","guideDirectory","overlayActive")||(_.forEach(document.querySelectorAll(".discussion.segment .participants.group"),e=>{e.parentElement.classList.remove("guide-open")}),_.forEach(document.querySelectorAll(".discussion.segment .participants.group:hover"),e=>{e.parentElement.classList.add("guide-open")}))},{scope:null});const r=["uninvolved","following","mentioned","dismissed","discussing","informing","satisfied","blocking","working","pondering"],n=["discussing","satisfied","informing","blocking","working","pondering"];class DiscussionParticipants{constructor(){Vue.set(this,"participantsGroupOpen",!1),Vue.set(this,"selectingDefaultDisposition",!1),Vue.set(this,"adjustingDiscussionSettings",!1),Vue.set(this,"tempDefaultDisposition",""),Vue.set(this,"numOpenDropdowns",0)}created(){this.$observe(()=>this.adjustingDiscussionSettings,e=>{const t=_access(this,"","$refs","","dispositionDropdown","","$el","","querySelector","call",[".multiselect__content-wrapper"]);t&&Vue.set(t.style,"minHeight",e?getComputedStyle(t).height:"")}),this.$observe(()=>_get(this,"context","activePanelKey"),(e,t)=>{const i=t===this.locator.$fileKey||this.locator.$parent.top&&"topLevelDiscussions"===t;this.participantsGroupOpen&&i&&this.context.deactivatedPanelScrollDirection>0&&(s.closeMultiselects(),this.closeParticipantsGroup(),this.dropdownHidden())})}get context(){return this.locator.review.context}get currentParticipant(){return _get(this,"locator","tracker","currentParticipant")}openParticipantsGroup(){Vue.set(this,"participantsGroupOpen",!0)}closeParticipantsGroup(){Vue.set(this,"participantsGroupOpen",!1)}dropdownShown(){this.$emit("dropdown-shown"),Vue.set(this,"participantsGroupOpen",!0),this.numOpenDropdowns++}dropdownHidden(){this.$emit("dropdown-hidden"),Vue.set(this,"selectingDefaultDisposition",!1),Vue.set(this,"adjustingDiscussionSettings",!1),_.delay(()=>{--this.numOpenDropdowns||Vue.set(this,"participantsGroupOpen",!1)},i.defaultOptions.duration/2)}get dispositionOptions(){return _.filter(r,e=>this.locator.viableDispositions[e])}get disposition(){return this.locator.disposition}set disposition(e){e&&(this.locator.draft||this.locator.tracker).setDisposition(e),this.selectingDefaultDisposition&&(e||(e=_get(this,"$refs","dispositionDropdown","value")),e&&this.locator.draft&&_.includes(n,e)&&this.locator.draft.setDefaultDisposition(e),Vue.set(this,"selectingDefaultDisposition",!1))}setTempDefaultDisposition(e){this.selectingDefaultDisposition&&Vue.set(this,"tempDefaultDisposition",_.includes(n,e)?e:"")}toggleDiscussionSettings(){Vue.set(this,"adjustingDiscussionSettings",!this.adjustingDiscussionSettings),Vue.set(this,"selectingDefaultDisposition",!1)}toggleSelectDefaultDisposition(){Vue.set(this,"selectingDefaultDisposition",!this.selectingDefaultDisposition)}disengage(){this.$once("dropdown-hidden",()=>{Vue.set(this,"disposition","dismissed")}),this.$refs.dispositionDropdown.$el.blur()}}
1DiscussionParticipants.$vueOptions={props:{locator:{type:Object,required:!0},disabled:{type:Boolean,default:!1},bottom:Boolean}};return _declareVue("DiscussionParticipants",DiscussionParticipants,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return"-top"!==e.locator.$key?s("div",{directives:[{name:"touch",rawName:"v-touch:swipe.left",value:e.openParticipantsGroup,expression:"openParticipantsGroup",arg:"swipe",modifiers:{left:!0}},{name:"touch",rawName:"v-touch:swipe.right",value:e.closeParticipantsGroup,expression:"closeParticipantsGroup",arg:"swipe",modifiers:{right:!0}}],ref:"group",staticClass:"participants group",class:{open:e.participantsGroupOpen},attrs:{tabindex:"-1"},on:{blur:e.closeParticipantsGroup}},[_get(e,"locator","tracker","unrepliedUserKeySet","*")&&!e.bottom?s("multiselect",{staticClass:"ui participant role unreplied dropdown",attrs:{searchable:!1,options:[],"show-labels":!1,"apply-deep-styles":!1,disabled:e.disabled,"tippy-options":{arrow:!0,offset:[0,10],placement:"bottom-end"}},on:{open:e.dropdownShown,close:e.dropdownHidden},scopedSlots:e._u([{key:"clear",fn:function(){return[s("div",{staticClass:"notch"})]},proxy:!0},{key:"placeholder",fn:function(){return[s("div",{staticClass:"button"},[s("div",{staticClass:"relative wheel",style:{transform:"rotateZ("+68*(_get(e,"locator","tracker","otherParticipants","length")+1)+"deg)"}},[s("div",{staticClass:"avatar"},[s("img",{staticClass:"ui user avatar image",attrs:{src:"/favicon-96x96.png"}})]),s("i",{staticClass:"disposition uninvolved icon"})])])]},proxy:!0},{key:"beforeList",fn:function(){return[s("div",{staticClass:"unobtrusive preface not-item"},[e._v("Reviewable is:")])]},proxy:!0},{key:"noOptions",fn:function(){return[s("div",{staticClass:"active item"},[s("i",{staticClass:"disposition uninvolved icon"}),s("b",[e._v("Standing by")]),e._v(": waiting for a reviewer to respond.\n ")])]},proxy:!0}],null,!1,1690080628)}):e._e(),e.bottom?e._e():e._l(_get(e,"locator","tracker","otherParticipants"),function(t,i){return s("discussion-other-participant",{key:t.$key,staticClass:"ui participant role dropdown",attrs:{tracker:e.locator.tracker,participant:t,index:i},on:{"dropdown-shown":e.dropdownShown,"dropdown-hidden":e.dropdownHidden}})}),s("multiselect",{ref:"dispositionDropdown",staticClass:"ui user role dropdown",class:{unreplied:e.locator.tracker&&!e.locator.tracker.replied,resolving:e.locator.dispositionWillResolve,"block-resolving":e.locator.dispositionWillNewlyPreventResolving},attrs:{searchable:!1,options:e.dispositionOptions,"show-labels":!1,"apply-deep-styles":!1,disabled:e.disabled,"replicate-root-class":"","alt-mode":e.adjustingDiscussionSettings,"tippy-options":{arrow:!0,offset:[0,10],lockHeight:!0,placement:"bottom-end",duration:150}},on:{open:e.dropdownShown,close:e.dropdownHidden},scopedSlots:e._u([{key:"clear",fn:function(){return[s("div",{staticClass:"notch"})]},proxy:!0},{key:"singleLabel",fn:function(){return[s("div",{staticClass:"button"},[s("avatar",{staticClass:"avatar",attrs:{"user-key":_get(e,"$session","user","uid"),display:"picture"}}),s("i",{class:[e.$options._base.options.filters.dispositionIconClass(e.locator.disposition),e.locator.dispositionIsProvisional?"green":""]})],1)]},proxy:!0},{key:"alt",fn:function(){return[s("div",{staticClass:"unobtrusive relative preface not-item border-bottom"},[e._v("\n Your global discussion settings:\n "),s("i",{staticClass:"back icon",on:{click:e.toggleDiscussionSettings}})]),s("div",[s("ui-toggle-input",{staticClass:"hyphenated preface trust-but-verify not-item",model:{value:e.$session.settings.trustButVerify,callback:function(t){e.$set(e.$session.settings,"trustButVerify",t)},expression:"$session.settings.trustButVerify"}},[s("b",[e._v("Trust but verify:")]),e._v("\n when you are\n "),s("span",{staticClass:"nowrap"},[s("i",{staticClass:"disposition discussing icon"}),e._v("\ufeff")]),s("em",[e._v("Discussing")]),e._v("\n on a discussion and it gets resolved without\n further comment, bring it to your attention.\n ")])],1),s("div",[s("ui-toggle-input",{directives:[{name:"default-true",rawName:"v-default-true"}],staticClass:"hyphenated preface infer-disposition not-item",nativeOn:{mousedown:function(e){e.preventDefault()}},model:{value:e.$session.settings.inferDisposition,callback:function(t){e.$set(e.$session.settings,"inferDisposition",t)},expression:"$session.settings.inferDisposition"}},[s("b",[e._v("Infer dispositions:")]),e._v("\n detect special keywords at the beginning of a message to automatically set your\n disposition.\n ")])],1)]},proxy:!0},{key:"beforeList",fn:function(){return[s("div",{staticClass:"unobtrusive relative preface not-item"},[s("span",{directives:[{name:"show",rawName:"v-show",value:!e.$session.onboarding.setRole,expression:"!$session.onboarding.setRole"}]},[e._v("\n This is advanced stuff, you don't need it to get started."),s("br")]),e.locator.draft||e.locator.dispositionIsProvisional?s("span",[e._v("\n After publishing you'll be:\n ")]):s("span",[e._v("You are:")]),s("i",{staticClass:"settings icon",on:{click:e.toggleDiscussionSettings}})])]},proxy:!0},{key:"afterList",fn:function(){return[_get(e,"locator","draft","defaultDispositionType")?
1s("div",{staticClass:"default disposition unobtrusive not-item border-top",class:{selecting:e.selectingDefaultDisposition}},[e.selectingDefaultDisposition?s("a",[e._v("\n Set to\n "),s("span",{staticClass:"blank"},[e._v("\n "+e._s(e.tempDefaultDisposition)+"\n ")]),e._v("\n when you\n "),"New"===e.locator.draft.defaultDispositionType?s("span",[e._v("\n start a discussion as reviewer\n ")]):"Joined"===e.locator.draft.defaultDispositionType?s("span",[e._v("\n join a discussion as reviewer\n ")]):"NewAsAuthor"===e.locator.draft.defaultDispositionType?s("span",[e._v("\n start a discussion as PR author\n ")]):"JoinedAsAuthor"===e.locator.draft.defaultDispositionType?s("span",[e._v("\n join a discussion as PR author\n ")]):e._e()]):s("a",{staticClass:"link",on:{click:function(t){return t.stopPropagation(),e.toggleSelectDefaultDisposition.apply(null,arguments)}}},[e._v("\n Change default disposition\n ")])]):e._e(),_get(e,"currentParticipant","dismissable")?s("div",{staticClass:"dismissal unobtrusive not-item border-top"},[s("span",{on:{click:e.disengage}},[s("i",{staticClass:"dismiss icon"}),s("a",{staticClass:"link"},[e._v("Disengage from the discussion")])])]):e._e()]},proxy:!0},{key:"option",fn:function(t){var i=t.option;return[s("div",{staticClass:"disposition item",on:{mouseover:function(t){return e.setTempDefaultDisposition(i)},mouseleave:e.setTempDefaultDisposition}},["uninvolved"===i?[s("i",{staticClass:"disposition uninvolved icon"}),s("b",[e._v("Uninvolved")]),e._v(":\n not yet involved in this discussion.\n ")]:"following"===i?[s("i",{staticClass:"disposition following icon"}),s("b",[e._v("Following")]),e._v(": following new comments but neutral on resolving.\n ")]:"mentioned"===i?[s("i",{staticClass:"disposition mentioned icon"}),s("b",[e._v("Mentioned")]),e._v(":\n recently @-mentioned in a comment but neutral on resolving.\n ")]:"dismissed"===i?[s("i",{staticClass:"disposition dismissed icon"}),_get(e,"currentParticipant","effectiveDismisserKey")===e.$info.userid?[s("b",[e._v("Disengaged")]),e._v(": left the discussion of your own accord.\n ")]:[s("b",[e._v("Dismissed")]),e._v(": was engaged but dismissed by\n "),s("avatar",{staticClass:"avatar",attrs:{"user-key":_get(e,"currentParticipant","effectiveDismisserKey"),display:"name,username"}}),e._v(".\n ")]]:"discussing"===i?[s("i",{staticClass:"disposition discussing icon"}),s("b",[e._v("Discussing")]),e._v(":\n contributing to the discussion but neutral on resolving.\n "),_get(e,"locator","parley","discussingWillResolve")?s("div",{staticClass:"unobtrusive"},[e._v("\n This will resolve the discussion.\n ")]):e._e()]:"informing"===i?[s("i",{staticClass:"disposition informing icon"}),s("b",[e._v("Informing")]),e._v(":\n resolving the discussion but keeping it active for everyone.\n "),_get(e,"locator","tracker","resolved")?e._e():s("div",{staticClass:"unobtrusive"},[e._v("\n This will resolve the discussion.\n ")])]:"satisfied"===i?[s("i",{staticClass:"disposition satisfied icon"}),s("b",[e._v("Satisfied")]),e._v(": in favor of resolving and ending the discussion.\n "),_get(e,"locator","parley","satisfiedWillResolve")?s("div",{staticClass:"unobtrusive"},[e._v("\n This will resolve\n "),s("b",{directives:[{name:"show",rawName:"v-show",value:!_get(e,"locator","tracker","otherUnforcedParticipants","length"),expression:"!~locator.tracker.otherUnforcedParticipants.length"}]},[e._v("\n and hide\n ")]),e._v("\n the discussion.\n ")]):e._e()]:"blocking"===i?[s("i",{staticClass:"disposition blocking icon"}),s("b",[e._v("Blocking")]),e._v(":\n opposed to resolving the discussion while waiting on somebody else.\n "),_get(e,"locator","parley","blockingWillNewlyPreventResolving")?s("div",{staticClass:"unobtrusive"},[e._v("\n This will make you start blocking the discussion.\n ")]):e._e(
1)]:"working"===i?[s("i",{staticClass:"disposition working icon"}),s("b",[e._v("Working")]),e._v(":\n holding the discussion unresolved while working on something related.\n "),_get(e,"locator","parley","blockingWillNewlyPreventResolving")?s("div",{staticClass:"unobtrusive"},[e._v("\n This will make you start blocking the discussion.\n ")]):e._e()]:"pondering"===i?[s("i",{staticClass:"disposition pondering icon"}),s("b",[e._v("Pondering")]),e._v(":\n keeping the draft from being published while thinking about your comment.\n ")]:e._e()],2)]}}],null,!1,3408527148),model:{value:e.disposition,callback:function(t){e.disposition=t},expression:"disposition"}})],2):e._e()},staticRenderFns:[],functional:!1},{scopeId:"data-v-e163d610"}),_declareGuides("DiscussionParticipants","data-v-e163d610",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".default.disposition[data-v-e163d610]",position:"bottom",highlight:"under",onboarding:"setDefaultRole"}},[s("p",[e._v("\n Set the "),s("em",[e._v("default disposition")]),e._v(" to use in the current circumstances.\n ")]),e._v(" "),s("p",[e._v("\n You can set separate defaults for "),s("em",[e._v("starting a discussion")]),e._v(" and\n "),s("em",[e._v("joining a discussion")]),e._v(" as either "),s("em",[e._v("author or reviewer")]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".dismissal[data-v-e163d610]",position:"bottom",highlight:"under",onboarding:"disengaged"}},[s("p",[s("em",[e._v("Leave the discussion")]),e._v(", voiding your resolution vote. You will "),s("em",[e._v("no longer become\n awaited")]),e._v(" when there are "),s("em",[e._v("new comments")]),e._v(" in the discussion.\n ")]),e._v(" "),s("p",[e._v("\n You'll be able to rejoin the discussion at any time.\n ")])]),e._v(" "),s("guide",{attrs:{for:".participants.group[data-v-e163d610]",group:".role[data-v-e163d610] .button",position:"right",highlight:"bracket",onboarding:"participants"}},[s("p",[s("em",[e._v("View the disposition")]),e._v(" of all participants in the discussion, and\n "),s("em",[e._v("set your own")]),e._v(" (or tweak your "),s("em",[e._v("discussion settings")]),e._v(").\n The dispositions determine "),s("em",[e._v("how a discussion gets resolved")]),e._v("âclick\n each one to see an explanation.\n ")]),e._v(" "),s("p",[e._v("\n Dispositions highlighted in "),s("i",{staticClass:"red circle background icon"}),e._v(" red indicate that the\n discussion will show up as "),s("em",[e._v('"needs reply"')]),e._v(" for that person, while ones highlighted in\n "),s("i",{staticClass:"green circle background icon"}),e._v(" green indicate that they are "),s("em",[e._v("drafts")]),e._v(", and\n will only take effect after you publish.\n ")]),e._v(" "),s("p",[e._v("\n If your disposition is "),s("i",{staticClass:"green circle outline icon"}),e._v(" circled in green, then\n "),s("em",[e._v("publishing will resolve")]),e._v(" the discussion. If it's\n "),s("i",{staticClass:"orange circle outline icon"}),e._v(" circled in orange, it's a heads-up that you'll be\n "),s("em",[e._v("preventing the discussion from resolving")]),e._v(" after you publish, and you weren't before.\n ")])]),e._v(" "),s("guide",{attrs:{for:".multiselect__content[data-v-e163d610]",group:".disposition.item[data-v-e163d610]",position:"top",highlight:"bracket",onboarding:"setRole"}},[s("p",[s("em",[e._v("Change your disposition")]),e._v(" towards this discussion, affecting your\n "),s("em",[e._v("vote to resolve it")]),e._v(". Your current disposition is highlighted.\n ")]),e._v(" "),s("p",[e._v("\n Changing your disposition takes effect when you publish or send the draft (if any).\n Note that some dispositions can only be set by Reviewable.\n ")])]),e._v(" "),s("guide",{attrs:{for:".trust-but-verify[data-v-e163d610]",highlight:"bracket",onboarding:"setTrustButVerify"}},[s("p",[e._v("\n When turned on, make a discussion "),s("em",[e._v("unreplied")]),e._v(" if it gets "),s("em",[e._v("resolved")]),e._v(" while your\n disposition is "),s("em",[s("i",{staticClass:"disposition discussing icon"}),e._v("\ufeffDiscussing")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n This is helpful if you "),s("em",[e._v("don't want to be strict")]),e._v(" about resolving discussions as a\n reviewer, but still want to double-check ones that the "),s("em",[e._v("author resolved")]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".infer-disposition[data-v-e163d610]",highlight:"bracket",onboarding:"setInferDisposition"}},[s("p",[e._v("\n When turned on, detect "),s("em",[e._v("special keywords")]),e._v(" (such as FYI, Nit, and others) at the\n beginning of a message to "),s("em",[e._v("automatically set your disposition")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n Consider turning this off if you often "),s("em",[e._v("use keywords accidentally")]),e._v(".\n ")])])],1)},[]),{DiscussionParticipants:DiscussionParticipants}},!0,!0,{filename:"src/view/reviews/discussion/discussion-participants.vue"}
1),_reviewable.define(["DiscussionResponse"],["truss","Guide","textSelectionTracker","draftFocusTracker","shared"],function(e,t,s,i,r){"use strict";class DiscussionResponse{constructor(){Vue.set(this,"files",[]),Vue.set(this,"dropActive",!1),Vue.set(this,"uploadAccept",r.allowedUploadMimeTypes.join(",")),Vue.set(this,"maxInlineReplyDrafts",60)}created(){this.$observe(()=>this.files,this.upload)}mounted(){this.$when(()=>this.$refs.dropUpload).then(()=>{this.$destroyed||this.$observe(()=>this.$refs.dropUpload.dropActive,e=>{Vue.set(this,"dropActive",e)})})}get tracker(){return this.locator.tracker}createReply(){document.activeElement&&document.activeElement.blur();const e=this.locator.discussion;if(e&&!this.$destroyed)return s.lockOverride(),this.$when(()=>this.locator.review.state).then(()=>{this.$destroyed||this.locator.review.state.drafts.createReplyDraft(e)}).finally(()=>{s.unlockOverride()})}upload(e){_.isEmpty(e)||this.locator.locked||this.createReply().then(()=>this.$nextTick()).then(()=>{_.defer(()=>{i.lastFocusedDraftScope&&i.lastFocusedDraftScope.upload(e),Vue.set(this,"files",[])})})}get hasMaxInlineReplyDrafts(){return!!_get(this,"locator","discussion","canInlineReply")&&_get(this,"locator","review","state","drafts","numInlineReplies")>=this.maxInlineReplyDrafts}navigateToPublishOptions(){_access(this,"","locator","","review","","context","","navigation","","visitPanel","call",["publish",{scrollToExtra:!0}])}}DiscussionResponse.$vueOptions={props:{locator:{type:Object,required:!0}}};return _declareVue("DiscussionResponse",DiscussionResponse,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"response wrapper"},[s("div",{staticClass:"ui form response buttons"},[s("div",{staticClass:"ui input field"},[e.$session.config.uploadsAllowed?s("vue-upload-component",{ref:"dropUpload",staticClass:"upload area",class:{active:e.dropActive},attrs:{drop:!0,"input-id":"dropReplyUpload"+e.locator.$key,accept:e.uploadAccept,multiple:""},model:{value:e.files,callback:function(t){e.files=t},expression:"files"}}):e._e(),s("input",{staticClass:"response-input",attrs:{type:"text",placeholder:_get(e,"tracker","replyAction")+"â¦",disabled:e.locator.locked||e.hasMaxInlineReplyDrafts},on:{focus:e.createReply}})],1),s("animate-fade-in-out",[s("div",{directives:[{name:"show",rawName:"v-show",value:_get(e,"tracker","primaryAction"),expression:"~tracker.primaryAction"}],staticClass:"or"})]),s("animate-wipe-right",[s("div",{directives:[{name:"show",rawName:"v-show",value:_get(e,"tracker","primaryAction"),expression:"~tracker.primaryAction"}],staticClass:"ui acknowledge small button",class:{disabled:e.locator.locked},on:{click:function(t){return e.tracker.takePrimaryAction()}}},[s("i",{directives:[{name:"show",rawName:"v-show",value:_get(e,"tracker","primaryActionIcon"),expression:"~tracker.primaryActionIcon"}],staticClass:"icon",class:_get(e,"tracker","primaryActionIcon")}),s("img",{directives:[{name:"show",rawName:"v-show",value:_get(e,"tracker","primaryActionImage"),expression:"~tracker.primaryActionImage"}],staticClass:"emoji",attrs:{src:_get(e,"tracker","primaryActionImage")}}),e._v("\n "+e._s(_get(e,"tracker","primaryActionLabel"))+"\n ")])])],1),s("animate-wipe-down",[e.hasMaxInlineReplyDrafts?s("div",{staticClass:"ui icon reply message warning"},[s("i",{staticClass:"max replies icon"}),s("div",{staticClass:"content"},[e._v("\n GitHub's API doesn't allow Reviewable to post\n "),s("strong",[e._v("more than "+e._s(e.maxInlineReplyDrafts))]),e._v("\n of this kind of reply comments at once. You'll need to\n "),s("strong",[s("a",{staticClass:"link",on:{click:e.navigateToPublishOptions}},[e._v("publish")]),e._v("\n your current drafts")]),e._v(" before you can reply to more comments. Sorry!\n ")])]):e._e()])],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-f7457eb2"}),_declareGuides("DiscussionResponse","data-v-f7457eb2",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".response.buttons .ui.input[data-v-f7457eb2]",onboarding:"createdReply",position:"left","hotkey-action":"replyToCurrentDiscussion()"}},[s("p",[e._v("\n Create a new comment to "),s("em",[e._v("reply to the discussion")]),e._v("\n and mark all comments above as acknowledged and read.\n ")]),e._v(" "),s("p",[e._v('\n Replying keeps an unresolved discussion going,\n and reopens a resolved discussion\n (unless you set your disposition to "satisfied" or reply as OK).\n ')])]),e._v(" "),s("guide",{attrs:{for:".response.buttons .acknowledge.button[data-v-f7457eb2]",position:"right",onboarding:"acknowledgedDiscussion","hotkey-action":"acknowledgeCurrentDiscussion()"}},[s("p",[e._v("\n Indicate that you have "),s("em",[e._v("nothing further to add")]),e._v("\n and mark all comments above as read.\n ")]),e._v(" "),s("p",[e._v("\n Usually this also signals that you're "),s("em",[e._v("OK to resolve")]),e._v("\n the discussion (when the button says Resolve, Accept or Done).\n ")]),e._v(" "),s("p",[e._v("\n At the review level, when the button says Approve, it will mark the PR as approved\n (once you've published) and insert an appropriate reply message â\n "),s("img",{attrs:{src:e.config.hostUrl+"/lgtm.png",height:"14"}}),e._v(" (Looks Good To Me) by default. You can\n "),s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/admincenter#approve-button-output"}},[e._v("\n customize this message\n ")]),e._v("\n in the repository settings.\n ")])])],1)},[]),{DiscussionResponse:DiscussionResponse}},!0,!0,{filename:"src/view/reviews/discussion/discussion-response.vue"}
1),_reviewable.define(["DiscussionRow"],["truss","Guide","mangler","session"],function(e,t,s,i){"use strict";const r=["working","blocking","satisfied","discussing","informing","mentioned","following","dismissed","withdrawn","pondering"];class DiscussionRow{constructor(){Vue.set(this,"lastSummary",void 0)}get mainDiscussion(){return"-top"===this.parley.$key}get authorKey(){return _get(this,"parley","tracker","firstAuthorKey")||_get(this,"parley","comments","list",0,"authorKey")}get author(){return this.transformParticipant(_get(this,"parley","tracker","participants",this.authorKey))}get otherParticipants(){return _(_get(this,"parley","tracker","effectiveParticipants")).omit(this.authorKey).map(e=>this.transformParticipant(e)).sortBy("order","userKey").value()}transformParticipant(e){const t=_get(e,"$key")||this.$info.userid,s=t===this.$info.userid,i=this.mainDiscussion?null:this.parley.disposition||_get(e,"effectiveDisposition"),n=_get(this,"parley","tracker","unrepliedUserKeySet",t),a=e&&(s&&!this.parley.draft&&_get(this,"context","review","state","roleChanges",this.parley.$key)||!!e.dismissal)?" green":n?" red":"";return{userKey:t,dispositionIcon:this.$options._base.options.filters.dispositionIconClass(i)+a,order:_.indexOf(r,i)}}get numComments(){const e=_get(this,"parley","comments","firstNewComment");return e?_get(this,"parley","comments","list","length")-e.index:_.size(this.parley.comments)||null}get summarizing(){return this.context.discussionSummaries.activeDiscussionKey===this.parley.$key}get summary(){let e=this.summarize();return e?(Vue.set(this,"lastSummary",e),e):(e=this.lastSummary||{quote:!1,html:"<i>Rendering draftâ¦</i>"},{...e,stale:!0})}summarize(){if(this.mainDiscussion)return{quote:!1,html:"<i>Overall review discussion</i>"};if("draft"===this.parley.type){const e=_get(this,"parley","summaryHtmlBodies",this.parley.bodyHash);if(e)return{quote:!1,html:e};const t=_get(this,"parley","htmlBodies",this.parley.bodyHash);return void 0===t&&this.parley.markdownBody?void this.parley.requestRender():this.cleanCommentQuote(t,_get(this,"parley","codeblocks"),"<i>New draft</i>")}const e=_get(this,"parley","summary","html");if(e)return{quote:!1,html:e};const t=_get(this,"parley","comments","list",0);return this.cleanCommentQuote(_get(t,"htmlBody")||"",_get(t,"codeblocks"),"<i>Empty comment</i>")}cleanCommentQuote(e,t,i){e=e||"",e=(e=s.injectBrokenImageFallbacks(e)).replace(/^<p.*?\(Reviewable was.*?unable.*?to map.*?this GitHub inline comment thread.*?to the right spot â sorry!\).*?<\/p>/,"").replace(/^<blockquote>[\s\S]*?<\/blockquote>/,"");const r=_get(t,"list",0,"text");return r&&(e+=`<pre><code>${_.escape(r)}</code></pre>`),e?{quote:!0,html:e}:{quote:!1,html:i}}visitParley(e){Vue.set(i.onboarding,"sawDiscussionEntry",!0),this.context.navigation.visitDiscussion(this.parley.$key,1)}}DiscussionRow.$vueOptions={props:{parley:{required:!0},context:{type:Object}}};return _declareVue("DiscussionRow",DiscussionRow,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("tr",{staticClass:"discussion row",class:{current:e.parley.current},on:{click:function(t){return t.preventDefault(),e.visitParley.apply(null,arguments)}}},[s("td",{staticClass:"counters cell"},[s("div",{staticClass:"length flag",class:{"ui new label":!!_get(e,"parley","comments","firstNewComment")}},[e._v("\n "+e._s(e.numComments)+"\n ")]),"draft"===e.parley.type||_get(e,"parley","tracker","draft")?s("div",{staticClass:"draft flag"},[s("i",{staticClass:"green drafts icon"})]):e._e()]),s("td",{staticClass:"author padded cell"},[s("div",{staticClass:"participant"},[e.mainDiscussion?s("img",{staticClass:"ui user avatar image",attrs:{src:"/favicon-96x96.png"}}):[s("avatar",{attrs:{userKey:e.author.userKey,display:"picture,popup"}}),s("i",{class:e.author.dispositionIcon})]],2)]),s("td",{staticClass:"details cell"},[s("div",{staticClass:"summary-wrapper",class:{quote:e.summary.quote,stale:e.summary.stale}},[s("div",{staticClass:"summary"},[s("div",{directives:[{name:"untrusted-html",rawName:"v-untrusted-html",value:e.summary.html,expression:"summary.html"}],staticClass:"markdown-body text"}
1)]),s("animate-fade-in",[e.summarizing?s("div",{staticClass:"summarizing-border"},[s("div",{staticClass:"summarizing-border-track"},[s("div",{staticClass:"summarizing-border-scan"})])]):e._e()])],1)]),s("td",{staticClass:"participants padded cell"},e._l(e.otherParticipants,function(e){return s("span",{key:e.userKey,staticClass:"participant"},[s("avatar",{attrs:{userKey:e.userKey,display:"picture,popup"}}),s("i",{class:e.dispositionIcon})],1)}),0)])},staticRenderFns:[],functional:!1},{scopeId:"data-v-591ea7a9"}),_declareGuides("DiscussionRow","data-v-591ea7a9",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".discussion.row[data-v-591ea7a9]",onboarding:"sawDiscussionEntry",highlight:"under",position:"left"}},[s("p",[e._v("\n A pointer to "),s("em",[e._v("a discussion in the review")]),e._v("; "),s("em",[e._v("click to navigate")]),e._v(" to it.\n ")]),e._v(" "),s("p",[e._v("\n The information presented includes:\n "),s("ul",[s("li",[e._v("\n the "),s("em",[e._v("number of comments")]),e._v(" in the discussion (or the number of\n "),s("span",{staticClass:"ui new label"},[e._v("new")]),e._v(" comments"),e._v(") and whether you have a\n "),s("em",[e._v("pending draft;")])]),e._v(" "),s("li",[e._v("the "),s("em",[e._v("person who started the discussion")]),e._v(" and their disposition (on the left);")]),e._v(" "),s("li",[e._v("\n a "),s("em",[e._v("summary of the first comment")]),e._v(" (direct quotes start with a double quote);\n ")]),e._v(" "),s("li",[s("em",[e._v("other discussion participants")]),e._v(" and their dispositions (on the right).")])])]),e._v(" "),s("p",[e._v("\n You'll also see an "),s("em",[e._v("animated purple scanner")]),e._v(" while Reviewable is "),s("em",[e._v("summarizing the\n first comment")]),e._v(". The summary is computed in your browser and no information is sent to\n third parties.\n ")])])],1)},[]),{DiscussionRow:DiscussionRow}},!0,!0,{filename:"src/view/reviews/discussion/discussion-row.vue"}),_reviewable.define(["DiscussionComponent"],["truss","Guide","bus","animator","debug","pageControl"],function(e,t,s,i,r,n){"use strict";class DiscussionComponent{constructor(){Vue.set(this,"discussionShowingIncremented",!1),Vue.set(this,"draftShowingIncremented",!1),Vue.set(this,"lastMousedownEvent",void 0),Vue.set(this,"shouldAnimateResponse",!0),Vue.set(this,"intersectionObserver",void 0),Vue.set(this,"ruler",this.$store.services.ruler)}created(){s.scrollToAndEmphasizeDiscussion.react(e=>{this.locator.$key===e&&this.scrollToAndEmphasize(e)},{scope:this})}mounted(){Vue.set(this.$refs.discussionSegment,"discussion",this.locator.discussion),this.$when(()=>void 0!==this.locator.discussion).then(()=>{this.locator.discussion.showing++,Vue.set(this,"discussionShowingIncremented",!0)}),this.$when(()=>void 0!==this.locator.draft).then(()=>{this.locator.draft.showing++,Vue.set(this,"draftShowingIncremented",!0)}),"-top"===this.locator.$key&&(Vue.set(this,"intersectionObserver",new IntersectionObserver(([e])=>{Vue.set(this,"shouldAnimateResponse",e.isIntersecting)})),this.intersectionObserver.observe(this.$el))}beforeDestroy(){this.intersectionObserver&&this.intersectionObserver.disconnect()}destroyed(){this.discussionShowingIncremented&&void 0!==this.locator.discussion&&this.locator.discussion.showing--,this.draftShowingIncremented&&void 0!==this.locator.draft&&this.locator.draft.showing--}dropdownShown(){s.saveDraft(this.locator.$key,[])}focusDiscussion(e){const t=this.locator.review.context.navigation;t.lastVisitedDiscussionKey!==this.locator.$key&&(Vue.set(t,"lastVisitedDiscussionKey",this.locator.$key),Vue.set(t,"missing",null)),Vue.set(this,"lastMousedownEvent",e)}selectDiscussionRevision(){const e=this.locator.parley;if(!e||!this.locator.file)return;const t=this.locator.review;if(Vue.set(this.$session.onboarding,"selectedDiscussionRevision",!0),!_get(t,"revisions")||!_get(t,"files"))return;const s=this.locator.file.diff,i=t.revisions[e.revisionKey],r=this.locator.file.revisions[i.$key],n=e.otherRevisionKey&&t.revisions[e.otherRevisionKey],a=e.otherRevisionBase?null:n?this.locator.file.revisions[n.$key]:void 0;e.revisionBase?_.isEqual(s.bounds,[null,r])||(s.selectBounds(null,i),s.commitBounds(),s.force("soft"),t.context.navigation.visitDiscussion(this.locator.$key,_get(this,"locator","tracker","resolved"))):(n||e.otherRevisionBase?_.isEqual(s.bounds,[r,a])||_.isEqual(s.bounds,[a,r]):_.includes(s.bounds,r))||(s.selectBounds(i,a),s.commitBounds(),s.force("soft"),t.context.navigation.visitDiscussion(this.locator.$key,_get(this,"locator","tracker","resolved")))}get pendingDismissalDescription(){const e=_get(this,"locator","tracker","unpublishedDismissedParticipants","length")||0;if(this.locator.draft&&"satisfied"===this.locator.disposition&&"-top"!==this.locator.$key&&e)return`${e} dismissal${1===e?"":"s"} pending`}get dismissalAction(){const e=_get(this,"locator","tracker","undismissedImpedingParticipants","length")||0;if(this.locator.draft&&"satisfied"===this.locator.disposition&&"-top"!==this.locator.$key&&e)return`dismiss ${e} dissenter${1===e?"":"s"}`}get dismissalLinkOffsetStyle(){return{right:.2*(_get(this,"locator","tracker","otherParticipants","length")+1)+4.2+"em"}}get discussionMarginOffset(){return"two"===this.ruler.diffColumns?"0":"16px"}get discussionPaddingOffset(){return"two"===this.ruler.diffColumns?"":"0"}
1get context(){return this.locator.review.context}scrollToAndEmphasize(e){if(r.navigation&&console.log("navigate scrolling to",this.$el),!this.$el)return void Sentry.captureMessage("Visited discussion missing",{level:"debug",discussionKey:e});const t=this.$el.getBoundingClientRect().top+n.scrollContexts.primary.scrollY()-100;if(i.scrollPage(t).then(()=>{_.defer(()=>{this.$destroyed||Vue.set(this.context.navigation,"lastVisitedDiscussionKey",e)})}),i.shouldAnimate()){const e=_access(this,"","$el","","style","","transform","","match","call",[/translateY\((?!0+\D*\))(.*?)\)/],"",1);anime.timeline({targets:this.$el}).add({duration:e?i.defaultOptions.duration:0,translateY:e?[e,0]:0}).add({delay:i.defaultOptions.duration,duration:.33*i.defaultOptions.duration,scaleX:1.3,easing:"easeOutQuad"}).add({duration:i.defaultOptions.duration,scaleX:1,easing:"easeOutBounce"})}Vue.set(this.context.navigation,"targetDiscussionKey",null)}}DiscussionComponent.$vueOptions={props:{locator:{type:Object,required:!0}}};return _declareVue("DiscussionComponent",DiscussionComponent,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"discussion item",attrs:{id:"discussion"+e.locator.$key}},[s("div",{staticClass:"discussion wrapper",on:{mousedown:e.focusDiscussion}},[s("div",{ref:"discussionSegment",staticClass:"ui discussion segment",class:{corner:e.locator.file,new:!_get(e,"locator","discussion","comments"),"top-level":"-top"===e.locator.$key}},[_get(e,"locator","parley","revisionKey")?s("a",{staticClass:"ui right corner label",class:{inaccurate:e.locator.accuracy<.7,nolink:!e.locator.file},on:{click:e.selectDiscussionRevision}},[s("div",{staticClass:"text"},[e._v("\n "+e._s(e.locator.parley.revisionKey)),s("span",{directives:[{name:"show",rawName:"v-show",value:e.locator.parley.revisionBase,expression:"locator.parley.revisionBase"}]},[e._v("â¥")])])]):e._e(),s("discussion-header",{attrs:{locator:e.locator}}),s("animate-slide-down",[!_get(e,"locator","tracker","irrelevant")||_get(e,"locator","commentExhibitionLevel")>0?s("div",{staticClass:"discussion details"},[_get(e,"locator","discussion","comments","list","length")?s("discussion-comments",{attrs:{locator:e.locator}}):e._e(),s("animate-slide-down",[0===_get(e,"locator","discussion","comments","list","length")&&"-top"===e.locator.$key?s("div",{staticClass:"no-comments"}):e._e()]),e.locator.review.state?s("div",{staticClass:"relative discussion bottom",style:{"margin-top":e.locator.discussion?"0.5em":"1em"}},[s("animate-fade-in-out",[e.dismissalAction?s("div",{staticClass:"unobtrusive dismissal no-item",style:e.dismissalLinkOffsetStyle},[s("a",{staticClass:"link",on:{click:function(t){return e.locator.tracker.dismissBlocking()}}},[e._v("\n "+e._s(e.dismissalAction)+"\n ")])]):e.pendingDismissalDescription?s("div",{staticClass:"unobtrusive dismissal no-item",style:e.dismissalLinkOffsetStyle},[e._v("\n "+e._s(e.pendingDismissalDescription)+"\n ("),s("a",{staticClass:"link",on:{click:function(t){return e.locator.tracker.cancelPendingDismissals()}}},[e._v("undo")]),e._v(")\n ")]):e._e()]),s("discussion-participants",{attrs:{locator:e.locator,disabled:!!_access(e,"","locator","","review","","state","","isLocked","call",[])},on:{"dropdown-shown":e.dropdownShown}}),s("animate-slide-down",{attrs:{disabled:!e.shouldAnimateResponse}},[e.locator.discussion&&!e.locator.draft&&e.locator.tracker?s("discussion-response",{attrs:{locator:e.locator}}):e._e()],1),s("animate-slide-down",{attrs:{disabled:!e.shouldAnimateResponse}},[!e.locator.discussion||e.locator.draft?s("draft-comment",{attrs:{focus:"auto",locator:e.locator,"last-mousedown-event":e.lastMousedownEvent}}):e._e()],1)],1):e._e()],1):e._e()])],1)])])},staticRenderFns:[],functional:!1},{cssVarsGetter:function(e){return[[void 0,{e840243a1ec67b9f:e.discussionMarginOffset,e840243a52845406:e.discussionPaddingOffset}]]},scopeId:"data-v-e840243a"}),_declareGuides("DiscussionComponent","data-v-e840243a",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"}
1,[s("guide",{attrs:{for:".discussion.segment .right.corner.label[data-v-e840243a]",onboarding:"selectedDiscussionRevision",position:"left"}},[s("p",[e._v("\n Switch the diff to the "),s("em",[e._v("original revision")]),e._v(" on which the comment was made.\n ")]),e._v(" "),s("p",[e._v("\n If the label is "),s("span",{staticClass:"ui red lowercase label"},[e._v("red")]),e._v("\n then the current context may be "),s("em",[e._v("inaccurate")]),e._v(" due to "),s("em",[e._v("significant changes")]),e._v("\n since the comment's original revision. You should click the label to see the\n discussion in its original context.\n ")])])],1)},[]),{DiscussionComponent:DiscussionComponent}},!0,!0,{filename:"src/view/reviews/discussion/discussion.vue"}),_reviewable.define(["DraftCommentBody"],["truss","Guide","animator","config","corpsman","DraftCommentText","draftFocusTracker","mangler","shared","session"],function(e,t,s,i,r,n,a,o,l,c){"use strict";const u="ui person completions vertical menu",d=new RegExp("^((?:(?:>(?: [^\\n]*|)|\\s*)\\n)*)((?:"+_(l.dispositionKeywords).flatMap().map(_.escapeRegExp).join("|")+")\\b|\\?\\?\\?)","i");class DraftCommentBody extends n{constructor(){super(),Vue.set(this,"tributeOptions",void 0),Vue.set(this,"tipHidden",!0),Vue.set(this,"htmlPreview",void 0),Vue.set(this,"previewPromise",void 0),Vue.set(this,"highlightedText",void 0),Vue.set(this,"magicKeywordSpan",void 0)}created(){Vue.set(this,"tributeOptions",{collection:[{trigger:":",values:this.completeEmoji,selectTemplate:({original:e})=>`:${e.label}:`,requireLeadingSpace:!0,slotName:"emoji",menuClass:u+" emoji"},{trigger:"#",values:this.completeIssue,selectTemplate:({original:e})=>e.number,requireLeadingSpace:!0,slotName:"issue",slotData:null,menuClass:u+" issue"},{trigger:"+",values:this.completeAddLabel,selectTemplate:({original:e})=>this.selectLabel(e,"+"),requireLeadingSpace:!0,slotName:"label",menuClass:u,footerSlotName:e=>_.startsWith(e.mentionText,"@")?"assigneeReviewerToggle":null},{trigger:"-",values:this.completeRemoveLabel,selectTemplate:({original:e})=>this.selectLabel(e,"-"),requireLeadingSpace:!0,slotName:"label",menuClass:u,footerSlotName:e=>_.startsWith(e.mentionText,"@")?"assigneeReviewerToggle":null},{trigger:"@",values:this.completePerson,selectTemplate:({original:e})=>"@"+e.label,requireLeadingSpace:!0,slotName:"person",menuClass:u}],lookup:"completionTerm",selectClass:"active",allowSpaces:!0,noMatchTemplate:""}),_.delay(()=>{Vue.set(this,"tipHidden",!1)},500),o.instrumentDiscussionComment(this,()=>this.htmlPreview)}mounted(){Vue.set(this.model,"textarea",this.$refs.textarea),Vue.set(this.$refs.textarea,"model",this.model),this.$observe(()=>this.mode,()=>{"preview"===this.mode?this.preview():Vue.set(this.$refs.sizer.style,"minHeight","")}),this.$observe(()=>this.model.text,()=>{Vue.set(this.model,"empty",!_.trim(this.model.text))}),this.$observe(()=>[this.model.text,_get(this,"locator","draft","roleSetManually"),_get(this,"locator","review","state","drafts","review")],()=>{_get(this,"locator","review","state","drafts","review")&&this._updateHighlightedText()})}beforeDestroy(){Vue.set(this.model,"destroyed",!0)}get shouldShowTip(){const e=this.locator.draft;return"write"===this.mode&&e&&!this.tipHidden&&!this.model.text&&!e.roleSetManually}get stage(){return _access(this,"","locator","","review","","state","","drafts","","getDraftStage","call",[this.locator.$key])}get enhancedHtmlPreview(){return o.enhanceDiscussionComment(this.htmlPreview)}get completions(){return this.$store.services.completions}preview(){let e;Vue.set(this,"htmlPreview",null),this.adjustPreviewMinHeight();const t=this.save().then(()=>{if(e=this.locator.draft,e)return e.render()}).then(()=>{this.previewPromise===t&&(e&&Vue.set(this,"htmlPreview",_get(e,"htmlBodies",e.bodyHash)),Vue.set(this,"previewPromise",null))}).catch(e=>{this.previewPromise===t&&(Vue.set(this,"htmlPreview",`<div class="ui error message">Failed to render markdown: ${_.escape(e)}</div>`),Vue.set(this,"previewPromise",null)),r.markHandled(e)}).finally(()=>{this.$nextTick().then(()=>{this.adjustPreviewMinHeight();const e=_access(this,"","$refs","","previewArea","","querySelectorAll","call",["img"]),t=_access(this,"","$refs","","previewArea","","querySelectorAll","call",["video"]);_.forEach(e,e=>{e.addEventListener("load",this.adjustPreviewMinHeight)}),_.forEach(t,e=>{e.addEventListener("loadeddata",this.adjustPreviewMinHeight)})})});Vue.set(this,"previewPromise",t)}adjustPreviewMinHeight(){if("preview"===this.mode&&this.$refs.previewArea&&this.$refs.sizer){Vue.set(this.$refs.previewArea.style,"position","static");const e=this.$refs.previewArea.scrollHeight;Vue.set(this.$refs.previewArea.style,"position",""),this.$emit("set-preview-height",e),anime({targets:this.$refs.sizer,minHeight:[this.$refs.sizer.offsetHeight,e],duration:s.defaultOptions.duration,easing:s.animeJsEasing})}}
1async createSecondaryDraft(){switch(await this.$when(()=>this.locator.review.stateReady),this.locator.$key){case"-top":{const e=this.locator.discussion;if(!e)return;this.locator.review.state.drafts.createReplyDraft(e,this.model.text,!0);break}case"-cmd":this.locator.review.state.drafts.createCmdDraft(this.model.text);break;default:throw new Error("Unknown secondary draft key: "+this.locator.$key)}Vue.set(this.model,"saved",!0),a.clearFocus(this.locator.$key)}handleFocus(e){Vue.set(this.model,"lastFocusTimestamp",Date.now()),this.$emit("focus",e)}handleBlur(e){_access(this,"","$refs","","textarea","","matches","call",[".pastable-focus"])||(this._updateHighlightedText(),this.$emit("blur",e))}handleKeyDown(e){27!==e.which||e.shiftKey||e.altKey||e.ctrlKey||e.metaKey||_.defer(()=>{!e.defaultPrevented&&this.$refs.textarea&&(this.$refs.textarea.blur(),this.$emit("escape",e))}),13!==e.which||e.shiftKey||e.altKey||e.ctrlKey||e.metaKey||this._autocompleteMarkdownList(e),13!==e.which||(i.mac?!e.metaKey||e.ctrlKey:!e.ctrlKey||e.metaKey)||e.shiftKey||e.altKey||this.$emit("send",e)}handleInput(){Vue.set(this.model,"saved",!1),_get(this,"magicKeywordSpan","_tippy")&&(this.magicKeywordSpan._tippy.destroy(),Vue.set(this,"magicKeywordSpan",null)),this._updateHighlightedText()}handleClick(e){if(!_.isFinite(e.clientX)||!_.isFinite(e.clientY))return;const t=document.elementsFromPoint(e.clientX,e.clientY);if(Vue.set(this,"magicKeywordSpan",_.find(t,e=>/\bhighlight\b/.test(e.className))),!this.magicKeywordSpan)return;const i=this.magicKeywordSpan.className,r=/effective/.test(i)?"Keyword used to set your disposition":/overridden/.test(i)?"Keyword ignored as you set your disposition manually":/btw/.test(i)?'"BTW" can only be used in your first comment':/invalid/.test(i)?"Keyword ignored as discussion is at the wrong stage":/warning/.test(i)?"â In Markdown, tags are rendered as HTML elements":/ambiguous/.test(i)?'â You must specify "assignee:" or "reviewer:"':null;this.magicKeywordSpan._tippy&&this.magicKeywordSpan._tippy.destroy(),r&&tippy(this.magicKeywordSpan,{content:r,duration:s.defaultOptions.duration,theme:"tooltip",placement:"top",showOnCreate:!0})}handlePaste(e){const t=e.clipboardData.getData("text/markdown")||e.clipboardData.getData("web text/markdown")||o.convertHtmlToMarkdown(e.clipboardData.getData("text/html")),s=(e.clipboardData.getData("text/plain")||"").replace(/\r\n?/g,"\n");let i;const r=this.$refs.textarea;if(o.findLastOpenCodeBlockFence(r.value.slice(0,r.selectionStart)))i=s;else if(t)i=t;else if(this._shouldPasteAsLink(s)){const e=r.value.slice(r.selectionStart,r.selectionEnd).match(/^(.*?)(\s*)$/);e&&(i=`[${e[1]}](${s})${e[2]}`)}i&&(document.execCommand("insertText",!1,i),Vue.set(this.model,"text",r.value),e.preventDefault())}_shouldPasteAsLink(e){const t=this.$refs.textarea;if(t.selectionStart===t.selectionEnd)return!1;const s=t.value.slice(t.selectionStart,t.selectionEnd);if(/\n/.test(s))return!1;try{new URL(e)}catch{return!1}const i=/(\[(?:[^\\\]](?:\\.)?)*\])\([^)]*\)|(?:^|\n)( {0,3}(?:`{3,}|~{3,}))[\s\S]*?(?:\n\2|$)|<code>(.|\n|\r)*?<\/code>|`[\s\S]*?`/gi;let r;for(;r=i.exec(t.value);){const e=r.index,s=r.index+r[0].length;if(_.inRange(t.selectionStart,e,s)||_.inRange(t.selectionEnd-1,e,s))return!1}return!0}_updateHighlightedText(){const e=_get(this,"$refs","textarea","value");let t=_.escape(e);if(!1!==this.$session.settings.inferDisposition&&"-top"!==this.locator.$key&&"-cmd"!==this.locator.$key){const s=_access(e,"","match","call",[d]);if(s){const i=_access(this,"","locator","","review","","state","","drafts","","inferDisposition","call",[this.locator.$key,e])===_get(this,"locator","draft","disposition");let r=_get(this,"locator","draft","roleSetManually")&&!i?"overridden":"effective";const n=_.toLower(s[2]);("fyi"===n||"tip"===n)&&this.stage>0&&(r="invalid"),("lgtm"===n||"done"===n)&&this.stage<1&&(r="invalid"),"btw"===n&&this.stage>=2&&(r="invalid btw");const a=_.escape(s[1]).length,o=s[2].length;t=t.slice(0,a)+`<span class="highlight ${r}"><span>${s[2]}</span></span>`+t.slice(a+o)}}t=t.replace(/(?<=^|\n)\s*> [\s\S]*?(?:\n|$)|```[\s\S]*?```|`[^`]*`|(<[a-z][\s\S]*?>)/gi,(e,t)=>
1t?`<span class="warning highlight">${t}</span>`:e).replace(document.activeElement===this.$refs.textarea?/(?<=^|\n)\s*> [\s\S]*?(?:\n|$)|```[\s\S]*?```|`[^`]*`|(?<=^|\s)([+-]@[a-z0-9_-]+)(?=[^a-z0-9_-])/gi:/(?<=^|\n)\s*> [\s\S]*?(?:\n|$)|```[\s\S]*?```|`[^`]*`|(?<=^|\s)([+-]@[a-z0-9_-]+)/gi,(e,t)=>t?`<span class="ambiguous highlight">${t}</span>`:e),Vue.set(this,"highlightedText",t+"<br>")}_scrollInToView(e,t){const s=e.value,i=e.scrollTop;Vue.set(e,"value",s.substring(0,t));const r=e.scrollHeight;Vue.set(e,"value",s);const n=e.clientHeight;r>=n+i?Vue.set(e,"scrollTop",r-n):i-r>=-20&&Vue.set(e,"scrollTop",r-44)}_setCaretPosition(e,t){e.focus(),this._scrollInToView(e,t),e.setSelectionRange(t,t)}_autocompleteMarkdownList(e){if(!this.$refs.textarea||!this.$refs.textarea.setSelectionRange)return;const t=this.$refs.textarea,s=t.selectionEnd,i=t.value.substring(0,s),r=t.value.substring(s,t.value.length),n=i.lastIndexOf("\n")+1,a=i.substring(n,s);if(s&&/^[-*] |^\d+\. /.test(a)){let o;e.preventDefault(),/^[-*] (\[[ x]\] )?\s*$|^\d+\. \s*$/.test(a)?(Vue.set(t,"value",i.substring(0,n)+r),this._setCaretPosition(t,n)):/^[-*] \[[x ]\] /.test(a)?o=`\n${a.charAt(0)} [ ] `:/^[-*] /.test(a)?o=`\n${a.charAt(0)} `:/^\d+\. /.test(a)&&(o=`\n${_.parseInt(a,10)+1}. `),o&&(Vue.set(t,"value",i+o+r),this._setCaretPosition(t,s+o.length)),t.dispatchEvent(new InputEvent("input"))}}upload(e){this.$emit("upload",e)}completeEmoji(e,t){if(this.$destroyed)return t([]);e||"-top"!==this.locator.$key||(e="lgtm");const s=this.completions;this.$when(()=>s.emojis.list).then(i=>t(s.find(i,e)))}completePerson(e,t){const s=this.locator.review;if(!s||this.$destroyed)return t([]);const i=this.completions;this.$when(()=>i.people.get(s.core.ownerName,s.core.repoName),{timeout:1e4}).then(r=>{_get(s,"people","completions","length")&&(r=s.people.completions.concat(_.reject(r,e=>_get(s,"people","usernameIndex",e.username)))),this.$session.user&&(r=_.reject(r,e=>e.username===_.toLower(this.$session.user.github.username))),r=i.find(r,e),_.forEach(r,e=>{Vue.set(e,"modifier",void 0),Vue.set(e,"completionTerm",e.searchTerm)}),t(r)},e=>{r.markHandled(e),t([])})}completeIssue(e,t){const s=this.locator.review;if(!s)return t([]);const i=this.completions;i.issues.fetch(s.core.ownerName,s.core.repoName,!0);const r=i.issues.get(s.core.ownerName,s.core.repoName);let n;return n=e?i.find(_get(r,"list"),e):_access(r,"","list","","slice","call",[-5]),_.forEach(n,e=>this.$store.services.avatars.connectUser(e.creatorKey)),Vue.set(_.find(this.tributeOptions.collection,{slotName:"issue"}),"slotData",r.meta),t(n)}completeAddLabel(e,t){if(!(_get(this,"locator","review","verdict","triage")||_get(this,"locator","review","verdict","push"))||this.$destroyed)return t([]);const s=this.locator.review,i=this._identifyDirective(e);if("assignee"===_get(i,"type"))this.$when(()=>this.completions.assignees.get(s.core.ownerName,s.core.repoName)).then(e=>{const s=_(this.locator.review.people).filter("assignee").map("completion.username").compact().value();e=_(e).reject(e=>_.includes(s,e.username)).thru(_.partial(this.completions.find,_,i.term)).forEach(e=>{Vue.set(e,"modifier",i.prefix),Vue.set(e,"completionTerm",i.prefix+e.searchTerm)}),t(e)},e=>{r.markHandled(e),t([])});else if("reviewer"===_get(i,"type"))this.$when(()=>this.completions.assignees.get(s.core.ownerName,s.core.repoName)).then(e=>{const r=_(this.locator.review.people).filter("requestedReviewer").map("completion.username").compact().value();e=_(e).reject(e=>_.includes(r,e.username)).reject(e=>e.userKey===s.core.authorKey).thru(_.partial(this.completions.find,_,i.term)).forEach(e=>{Vue.set(e,"modifier",i.prefix),Vue.set(e,"completionTerm",i.prefix+e.searchTerm)}),t(e)},e=>{r.markHandled(e),t([])});else{const i="("===_access(e,"","charAt","call",[0]);i&&(e=e.slice(1)),Promise.all([this.$when(()=>this.completions.labels.get(s.core.ownerName,s.core.repoName)),this.$when(()=>this.completions.milestones.get(s.core.ownerName,s.core.repoName))]).then(([r,n])=>{t(_.chain(r).reject(e=>e.name in s.labels.$data).concat(_.reject(n,e=>"open"!==e.state||s.milestone===e.label)).thru(_.partial(this.completions.find,_,e)).forEac
1h(e=>{Vue.set(e,"completionTerm",(i?"(":"")+e.searchTerm)}).concat([{type:"modifier",key:"assignee:@",modifier:"assignee:@",label:"assignee:",description:"add an assignee",matchIndex:void 0,completionTerm:"assignee: add an assignee"},{type:"modifier",key:"reviewer:@",modifier:"reviewer:@",label:"reviewer:",description:"request a reviewer",matchIndex:void 0,completionTerm:"reviewer: request a reviewer"}]).value())})}}completeRemoveLabel(e,t){if(!(_get(this,"locator","review","verdict","triage")||_get(this,"locator","review","verdict","push"))||this.$destroyed)return t([]);const s=this.locator.review,i=this._identifyDirective(e);if("assignee"===_get(i,"type"))t(_(this.locator.review.people).filter("assignee").map("completion").compact().thru(_.partial(this.completions.find,_,i.term)).forEach(e=>{Vue.set(e,"modifier",i.prefix),Vue.set(e,"completionTerm",i.prefix+e.searchTerm)}));else if("reviewer"===_get(i,"type"))t(_(this.locator.review.people).filter("requestedReviewer").map("completion").compact().thru(_.partial(this.completions.find,_,i.term)).forEach(e=>{Vue.set(e,"modifier",i.prefix),Vue.set(e,"completionTerm",i.prefix+e.searchTerm)}));else{const i="("===_access(e,"","charAt","call",[0]);i&&(e=e.slice(1));let r=[];r=r.concat(s.labels.list);let n=Promise.resolve();s.milestone&&(n=this.$when(()=>this.completions.milestones.get(s.core.ownerName,s.core.repoName)).then(e=>{let t=_.find(e,e=>e.label===s.milestone);t||(t={type:"milestone",label:s.milestone,searchTerm:s.milestone,matchIndex:void 0}),r.push(t)})),n.then(()=>{const s=_(r).thru(_.partial(this.completions.find,_,e)).forEach(e=>{Vue.set(e,"completionTerm",(i?"(":"")+e.searchTerm)});_.some(this.locator.review.people,"assignee")&&s.push({type:"modifier",key:"assignee:@",modifier:"assignee:@",label:"assignee:",description:"remove an assignee",matchIndex:void 0,completionTerm:"assignee: remove an assignee"}),_.some(this.locator.review.people,"requestedReviewer")&&s.push({type:"modifier",key:"reviewer:@",modifier:"reviewer:@",label:"reviewer:",description:"remove a requested reviewer",matchIndex:void 0,completionTerm:"reviewer: remove a requested reviewer"}),t(s)})}}_identifyDirective(e){if(!e)return;const t=e.indexOf("@");if(-1===t)return;let s,i,r=!1;return 0===t?(i=this.userDirectiveMeaning,s="reviewer"===i?"r:@":"a:@",r=!0):(i=/^(a|assignee):@/.test(e)?"assignee":/^(r|reviewer):@/.test(e)?"reviewer":void 0,s=e.slice(0,t+1)),i?{type:i,bare:r,prefix:s,term:e.slice(t+1)}:void 0}get userDirectiveMeaning(){return c.settings.userDirectiveMeaning||"assignee"}setUserDirectiveMeaning(e,t){c.settings.userDirectiveMeaning!==e&&(Vue.set(c.settings,"userDirectiveMeaning",e),t())}selectLabel(e,t){const s=this._getLabel(e,t);if("@"===s.charAt(s.length-1)){const e=this.$refs.textarea,t=()=>{e.removeEventListener("tribute-replaced",t);const s=e.selectionStart,i=e.value,r=i.slice(0,s-1)+i.slice(s);Vue.set(this.model,"text",r),_.defer(()=>{e.dispatchEvent(new Event("keydown")),e.dispatchEvent(new Event("keyup"))})};e.addEventListener("tribute-replaced",t)}return s}_getLabel(e,t){switch(e.type){case"person":return t+(e.modifier||"@")+e.label;case"milestone":return t+s(e.label);case"label":return t+s(e.name);case"modifier":return t+e.modifier}function s(e){return/(^[@+-])|[ ,.;]/.test(e)?"("+e.replace(/[()\\]/g,e=>"\\"+e)+")":e}}}DraftCommentBody.$vueOptions={props:{suffix:String,placeholder:String}};return _declareVue("DraftCommentBody",DraftCommentBody,"DraftCommentText",{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"relative body",class:e.mode},[s("div",{ref:"sizer",staticClass:"draft sizer relative ui textarea",domProps:{innerHTML:e._s(e.highlightedText)}}),s("tribute",{ref:"tribute",staticClass:"draft position textarea",attrs:{options:e.tributeOptions},scopedSlots:e._u([{key:"emoji",fn:function(e){var t=e.item,i=e.query;return[s("a",{staticClass:"item"},[s("img",{attrs:{src:t.imageUrl}}),s("span",{directives:[{name:"highlight-match",rawName:"v-highlight-match:highlight",value:{item:t.label,query:i},expression:"{item: item.label, query}",arg:"highlight"}]})])]}},{key:"issue",fn:function(t){var i=t.item,r=t.query,n=t.slotData;return[s("a",{staticClass:"item"},[s("span",{directives:[{name:"highlight-match",rawName:"v-highlight-match:highlight",value:{item:i.number,query:r},expression:"{item: item.number, query}",arg:"highlight"}],staticClass:"detail issue number",style:{width:n.maxNumberLength+"ch"}}),s("i",{class:e._f("issueIconClass")(i),attrs:{alt:i.effectiveState+" "+i.type}}),s("avatar-image",{staticClass:"ui user avatar image tiny",attrs:{src:_get(e,"$store","services","avatars","users",i.creatorKey,"scaledAvatarUrl"),fallback:i.creatorKey}}),s("span",{directives:[{name:"highlight-match",rawName:"v-highlight-match:highlight",value:{item:i.title,query:r},expression:"{item: item.title, query}",arg:"highlight"}],staticClass:"issue title"})],1)]}},{key:"label",fn:function(t){var i=t.item,r=t.query;return[s("a",{staticClass:"item"},["label"===i.type?s("span",[s("span",{directives:[{name:"highlight-match",rawName:"v-highlight-match:highlight",value:{item:i.name,query:r.slice("("===r.charAt(0))},expression:"{\n item: item.name,\n query: query.slice(query.charAt(0) === '(')\n }",arg:"highlight"}],staticClass:"ui tag label",style:{"background-color":i.backgroundColor,color:i.color}}),i.description?s("span",{directives:[{name:"highlight-match",rawName:"v-highlight-match:highlight",value:{item:i.description,query:r.slice("("===r.charAt(0))},expression:"{\n item: item.description,\n query: query.slice(query.charAt(0) === '(')\n }",arg:"highlight"}],staticClass:"description"}):e._e()]):"milestone"===i.type?s("span",{staticClass:"milestone"},[s("i",{staticClass:"milestone icon"}),s("span",{directives:[{name:"highlight-match",rawName:"v-highlight-match:highlight",value:{item:i.label,query:r.slice("("===r.charAt(0))},expression:"{\n item: item.label,\n query: query.slice(query.charAt(0) === '(')\n }",arg:"highlight"}]}),i.description?s("span",{directives:[{name:"highlight-match",rawName:"v-highlight-match:highlight",value:{item:i.description,query:r.slice("("===r.charAt(0))},expression:"{\n item: item.description,\n query: query.slice(query.charAt(0) === '(')\n }",arg:"highlight"}],staticClass:"description"}
1):e._e()]):"person"===i.type?s("span",[s("avatar-image",{staticClass:"ui avatar image",attrs:{src:i.avatarUrl,fallback:i.userKey||i.key}}),s("span",{directives:[{name:"highlight-match",rawName:"v-highlight-match:highlight",value:{item:i.label,query:r.slice("reviewer:@"===r.slice(0,10)?10:1)},expression:"{\n item: item.label,\n query: query.slice(query.slice(0, 10) === 'reviewer:@' ? 10 : 1)\n }",arg:"highlight"}]}),i.description?s("span",{directives:[{name:"highlight-match",rawName:"v-highlight-match:highlight",value:{item:i.description,query:r.slice("reviewer:@"===r.slice(0,10)?10:1)},expression:"{\n item: item.description,\n query: query.slice(query.slice(0, 10) === 'reviewer:@' ? 10 : 1)\n }",arg:"highlight"}],staticClass:"description"}):e._e()],1):"modifier"===i.type?s("span",[s("span",{directives:[{name:"highlight-match",rawName:"v-highlight-match:highlight",value:{item:i.label,query:r.slice("("===r.charAt(0))},expression:"{\n item: item.label,\n query: query.slice(query.charAt(0) === '(')\n }",arg:"highlight"}]}),i.description?s("span",{directives:[{name:"highlight-match",rawName:"v-highlight-match:highlight",value:{item:i.description,query:r.slice("("===r.charAt(0))},expression:"{\n item: item.description,\n query: query.slice(query.charAt(0) === '(')\n }",arg:"highlight"}],staticClass:"description"}):e._e()]):e._e()])]}},{key:"person",fn:function(t){var i=t.item,r=t.query;return[s("a",{staticClass:"item"},[s("span",{staticClass:"relative inline-block"},[s("avatar-image",{staticClass:"ui avatar image",attrs:{src:i.avatarUrl,fallback:i.userKey||i.key}}),i.team?s("i",{staticClass:"team icon"}):e._e(),i.agent?s("span",{staticClass:"agent tag"},[s("span",{staticClass:"agent name",style:i.tagColors},[e._v(e._s(i.tagName))])]):e._e()],1),s("span",{directives:[{name:"highlight-match",rawName:"v-highlight-match:highlight",value:{item:i.label,query:r},expression:"{item: item.label, query}",arg:"highlight"}]}),i.description?s("span",{directives:[{name:"highlight-match",rawName:"v-highlight-match:highlight",value:{item:i.description,query:r},expression:"{item: item.description, query}",arg:"highlight"}],staticClass:"description"}):e._e()])]}},{key:"assigneeReviewerToggle",fn:function(t){var i=t.refreshValues;return[s("li",{staticClass:"completions footer"},[s("span",{staticClass:"unobtrusive reset"},[s("a",{class:{active:"assignee"===e.userDirectiveMeaning},on:{mousedown:function(e){e.preventDefault()},click:function(t){return e.setUserDirectiveMeaning("assignee",i)}}},[e._v("assignee")]),e._v("\n   â¢Â  \n "),s("a",{class:{active:"reviewer"===e.userDirectiveMeaning},on:{mousedown:function(e){e.preventDefault()},click:function(t){return e.setUserDirectiveMeaning("reviewer",i)}}},[e._v("reviewer")])])])]}}])},[s("template",{slot:"editor"},[s("textarea",{directives:[{name:"show",rawName:"v-show",value:"write"===e.mode,expression:"mode === 'write'"},{name:"text-model",rawName:"v-text-model:debounce_500_3000",value:e.model.text,expression:"model.text",arg:"debounce_500_3000"},{name:"paste-image",rawName:"v-paste-image",value:e.upload,expression:"upload"}],ref:"textarea",staticClass:"draft display textarea mp-sensitive",class:e.onboarding||"sawWritingArea",attrs:{id:"draft"+e.locator.$key+(e.suffix||""),disabled:e.locator.locked,placeholder:e.placeholder,"no-autosize":""},on:{keydown:e.handleKeyDown,input:e.handleInput,focus:e.handleFocus,blur:e.handleBlur,click:e.handleClick,paste:e.handlePaste}})])],2),s("div",{directives:[{name:"show",rawName:"v-show",value:"preview"===e.mode,expression:"mode === 'preview'"}],ref:"previewArea",staticClass:"ui dimmable draft display position preview textarea",class:{dimmed:e.previewPromise}},[e._m(0),s("div",{directives:[{name:"untrusted-html",rawName:"v-untrusted-html",value:e.enhancedHtmlPreview,expression:"enhancedHtmlPreview"}],staticClass:"markdown-body text"}
1)]),s("animate-fade-in",[e.shouldShowTip?s("div",{staticClass:"tip"},["-top"===e.locator.$key?s("table",{staticClass:"tip-list"},[s("tr",{staticClass:"tip-item"},[s("td",[s("b",[e._v("±label")])]),s("td",[e._v("â¢")]),s("td",[e._v("add/remove label")])]),s("tr",{staticClass:"tip-item"},[s("td",[s("b",[e._v("±@username")])]),s("td",[e._v("â¢")]),s("td",[e._v("add/remove assignee")])]),s("tr",{staticClass:"tip-item"},[s("td"),s("td",[e._v("or")]),s("td",[e._v("(un)request reviewer")])])]):!1!==e.$session.settings.inferDisposition?s("table",{staticClass:"tip-list"},[0===e.locator.stage&&"informing"!==e.locator.draft.disposition?s("tr",{staticClass:"tip-item"},[s("td",[s("b",[e._v("FYI")]),e._v(", Tip")]),s("td",[e._v("â¢")]),s("td",[s("i",{class:e._f("dispositionIconClass")("informing")}),e._v(" Informing")])]):e._e(),"discussing"!==e.locator.draft.disposition?s("tr",{staticClass:"tip-item"},[s("td",[s("b",[e.stage<2?s("span",[e._v("BTW")]):s("span",[e._v("Typo")])]),e._v(",\n Minor, Nit\n ")]),s("td",[e._v("â¢")]),s("td",[s("i",{class:e._f("dispositionIconClass")("discussing")}),e._v(" Discussing")])]):e._e(),"blocking"!==e.locator.draft.disposition?s("tr",{staticClass:"tip-item"},[s("td",[s("b",[e._v("Bug")]),e._v(", Major")]),s("td",[e._v("â¢")]),s("td",[s("i",{class:e._f("dispositionIconClass")("blocking")}),e._v(" Blocking")])]):e._e(),e.locator.stage>=1&&"satisfied"!==e.locator.draft.disposition&&"informing"!==e.locator.draft.disposition?s("tr",{staticClass:"tip-item"},[s("td",[s("b",[e._v("LGTM")]),e._v(", Done")]),s("td",[e._v("â¢")]),s("td",[s("i",{class:e._f("dispositionIconClass")("satisfied")}),e._v(" Satisfied")])]):e._e(),"working"!==e.locator.draft.disposition?s("tr",{staticClass:"tip-item"},[s("td",[s("b",[e._v("Will do")]),e._v(", TODO")]),s("td",[e._v("â¢")]),s("td",[s("i",{class:e._f("dispositionIconClass")("working")}),e._v(" Working")])]):e._e(),"pondering"!==e.locator.draft.disposition?s("tr",{staticClass:"tip-item"},[s("td",[s("b",[e._v("???")])]),s("td",[e._v("â¢")]),s("td",[s("i",{class:e._f("dispositionIconClass")("pondering")}),e._v(" Pondering")])]):e._e()]):e._e()]):e._e()])],1)},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ui simple inverted dimmer"},[t("div",{staticClass:"ui loader"})])}],functional:!1},{scopeId:"data-v-0a9a848d"}),_declareGuides("DraftCommentBody","data-v-0a9a848d",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".draft.display.textarea.sawWritingArea[data-v-0a9a848d]",onboarding:"sawWritingArea",highlight:"bracket",position:"right"}},[s("p",[s("em",[e._v("Write and preview")]),e._v(" your comment hereâit's "),s("em",[e._v("automatically saved")]),e._v(" but\n "),s("em",[e._v("not visible to others")]),e._v(" until you hit\n "),s("span",{staticClass:"ui tiny green dummy button"},[s("i",{staticClass:"publish icon"}),e._v(" Publish")]),e._v(".\n ")]),e._v(" "),s("div",[e._v("\n You can use "),s("em",[s("a",{staticClass:"link",attrs:{target:"_blank",href:"https://guides.github.com/features/mastering-markdown/"}},[e._v("\n GitHub Flavored Markdown\n ")])]),e._v(" as well as some special commands:\n ")]),e._v(" "),s("dl",{staticClass:"wide-55"},[s("dt",[s("kbd",[e._v(":"),s("i",[e._v("emoji")]),e._v(":")])]),s("dd",[e._v("Insert an "),s("em",[e._v("emoji")]),e._v(".")]),e._v(" "),s("dt",[s("kbd",[e._v("@"),s("i",[e._v("user")])])]),e._v(" "),s("dd",[s("em",[e._v("Mention a user")]),e._v(", which will notify them and add the review to their dashboard.\n Mentioning a team will do so for all members.\n ")]),e._v(" "),s("dt",[s("kbd",[e._v("#"),s("i",[e._v("issue")])])]),e._v(" "),s("dd",[s("em",[e._v("Reference an issue")]),e._v(" or pull request.\n "),s("kbd",[s("i",[e._v("owner")]),e._v("/"),s("i",[e._v("repo")]),e._v("#"),s("i",[e._v("issue")])]),e._v("\n works too, but won't get a completions popup.\n ")]),e._v(" "),s("dt",[s("kbd",[e._v("±"),s("i",[e._v("label")])])]),e._v(" "),s("dd",[s("em",[e._v("Add or remove a label")]),e._v(" in the pull request.")]),e._v(" "),s("dt",[s("kbd",[e._v("Â
1±@"),s("i",[e._v("user")])])]),e._v(" "),s("dd",[s("em",[e._v("Assign or unassign a user")]),e._v(" in the pull request. There's also a\n "),s("kbd",[e._v("±reviewer:@"),s("i",[e._v("user")])]),e._v(" variant to "),s("em",[e._v("request or unrequest a reviewer")]),e._v(".")])])])],1)},[]),{DraftCommentBody:DraftCommentBody}},!0,!0,{filename:"src/view/reviews/discussion/draft-comment-body.vue"}),_reviewable.define(["DraftCommentCodeblock"],["truss","Guide","DraftCommentText","bus","debug","textSelectionTracker"],function(e,t,s,i,r,n){"use strict";class DraftCommentCodeblock extends s{constructor(){super(),Vue.set(this,"tipHidden",!0),Vue.set(this,"minHeight",void 0)}created(){this.$observe(()=>this.model.text,()=>{Vue.set(this.model,"empty",_get(this,"model","subject","originalText")?this.model.text===this.model.subject.originalText:!_.trim(this.model.text))}),this.$observe(()=>this.mode,()=>{"preview"===this.mode&&this.preview()})}mounted(){Vue.set(this.model,"textarea",this.$refs.codeEditor),_.delay(()=>{Vue.set(this,"tipHidden",!1)},500),i.draftFocus.react(e=>{this.model.subject.$key===e&&(r.focus&&console.log("codeblock",this.model.subject.$key,"focus requested"),this.resetFocus())},{scope:this})}get deletedCodeblock(){return _get(this,"locator","draft","deletedCodeblocks","last")}get shouldShowTip(){const e=this.locator.draft;return"write"===this.mode&&e&&(e.file||n.hasSelectedCode)&&!this.tipHidden&&!this.model.subject.originalText&&!this.model.text}get selectButtonLabel(){return n.hasSelectedCode?"Accept selection":"Select diff lines"}get multiple(){return this.model.subject.$parent.list.length>1}resetFocus(e=5){return this.$nextTick().then(()=>{if(e&&(this.model.subject.text||"")!==this.model.text)return this.resetFocus(e-1);this.model.textarea.select(0),this.model.textarea.focus()})}handleFocus(e){Vue.set(this.model,"lastFocusTimestamp",Date.now()),this.$emit("focus",e)}handleBlur(e){this.$emit("blur",e)}handleInput(){Vue.set(this.model,"saved",!1)}undelete(){this.deletedCodeblock&&(Vue.set(this.$session.onboarding,"recoveredCodeblock",!0),this.deletedCodeblock.undelete(this.model.subject),this.resetFocus())}select(){if(this.locator.locked)return;const e=n.getSelectedCode();e?(this.model.subject.$set(this.locator.review.state.drafts.makeCodeblock(this.locator.draft,e,this.locator)),this.resetFocus(),n.clearOverride(),i.clearDiffLineSelection()):(document.activeElement instanceof HTMLElement&&document.activeElement.blur(),n.setSelectionHandlesVisible(!0),i.selectDiffLine(_.pick(this.locator,"diff","line","side")))}preview(){_get(this,"$refs","codeEditor","$el","offsetHeight")&&Vue.set(this,"minHeight",this.$refs.codeEditor.$el.offsetHeight)}}return _declareVue("DraftCommentCodeblock",DraftCommentCodeblock,"DraftCommentText",{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"codeblock wrapper"},[s("codeblock-viewer",{attrs:{codeblock:e.model.subject,"show-contents":"preview"===e.mode,"show-index":e.multiple,"min-height":e.minHeight,"max-height":500}}),s("code-editor",{directives:[{name:"show",rawName:"v-show",value:"write"===e.mode,expression:"mode === 'write'"},{name:"text-model",rawName:"v-text-model:debounce_500_3000",value:e.model.text,expression:"model.text",arg:"debounce_500_3000"}],ref:"codeEditor",staticClass:"codeblock editor",attrs:{disabled:!!e.locator.locked,"no-autosize":"",language:e.model.subject.language,"indent-string":e.model.subject.indent,"min-height":53,"max-height":500},on:{focus:e.handleFocus,blur:e.handleBlur,escape:function(t){return e.$emit("escape")},input:e.handleInput}}),s("animate-fade-in",[e.shouldShowTip?s("div",{staticClass:"unobtrusive codeblock tip"},[e.deletedCodeblock?s("span",[s("span",{staticClass:"ui circular mini basic recover button",on:{click:e.undelete}},[s("i",{staticClass:"recover icon"}),e._v("\n Recover "+e._s(e.deletedCodeblock.kind)+"\n ")])]):e._e(),s("span",[s("span",{staticClass:"ui circular mini basic select button",class:{disabled:e.locator.locked},on:{mousedown:e.select}},[s("i",{staticClass:"diff icon"}),s("span",{staticClass:"label"}
1,[e._v(e._s(e.selectButtonLabel))])])])]):e._e()])],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-6e915d2a"}),_declareGuides("DraftCommentCodeblock","data-v-6e915d2a",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".codeblock.editor[data-v-6e915d2a]",onboarding:"sawCodeblockArea",highlight:"bracket",position:"right"}},[s("p",[s("em",[e._v("Write and preview")]),e._v(" your code block hereâit's "),s("em",[e._v("automatically saved")]),e._v(" but\n "),s("em",[e._v("not visible to others")]),e._v(" until you hit\n "),s("span",{staticClass:"ui tiny green dummy button"},[s("i",{staticClass:"publish icon"}),e._v(" Publish")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n To make a "),s("em",[e._v("change suggestion")]),e._v(", "),s("em",[e._v("select diff lines")]),e._v(" before creating the code\n block.\n ")])]),e._v(" "),s("guide",{attrs:{for:".recover.button[data-v-6e915d2a]",onboarding:"recoveredCodeblock",highlight:"under"}},[s("p",[s("em",[e._v("Recover")]),e._v(" the code block most recently deleted from this draft.\n ")])]),e._v(" "),s("guide",{attrs:{for:".select.button[data-v-6e915d2a]",onboarding:"selectedDiffLines",highlight:"under"}},[s("p",[s("em",[e._v("Select lines")]),e._v(" from the diff on which to base a "),s("em",[e._v("suggestion")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n Click once to activate selection mode and select the line to which this discussion is\n attached. After adjusting the selection to taste, click again to pull the selected lines into\n the code snippet and edit away!\n ")])])],1)},[]),{DraftCommentCodeblock:DraftCommentCodeblock}},!0,!0,{filename:"src/view/reviews/discussion/draft-comment-codeblock.vue"}),_reviewable.define(["DraftCommentText"],["truss","bus","corpsman","debug"],function(e,t,s,i){"use strict";class DraftCommentText{constructor(){Vue.set(this,"lastSaveTimestamp",void 0)}created(){this.log("created"),Vue.set(this.model,"saved",!0),this.$when(()=>this.model.secondary&&!this.locator.draft||_get(this,"locator","draft","$ready")).then(()=>{this.$destroyed||!this.locator.draft&&!this.model.secondary||(Vue.set(this.model,"text",this.getDatabaseText()||""),this.log("start autosaving","model:",JSON.stringify(this.model.text)),this.$observe(()=>this.model.text,()=>{this.onboarding&&!this.$session.onboarding[this.onboarding]&&_get(this,"model","text","length")>100&&Vue.set(this.$session.onboarding,this.onboarding,!0),this.autosaveIfNeeded()}),this.$observe(()=>this.getDatabaseText(),()=>{this.autoloadIfNeeded()}))}),this.model.secondary&&this.$observe(()=>_get(this,"locator","review","state","drafts",this.locator.$key),e=>{this.model.subject!==e&&(this.log("syncing subject"),Vue.set(this.model,"subject",e))}),t.saveDraft.react((e,t)=>{e===_get(this,"locator","draft","$key")&&t.push(this.save())},{scope:this}),t.saveAllDrafts.react(e=>{this.model.secondary||(this.log("saveAll requested"),e.push(this.save()))},{scope:this})}beforeDestroy(){this.log("destroyed"),Vue.set(this.model,"destroyed",!0)}getDatabaseText(){return _get(this,"model","subject","markdownBody")||_get(this,"model","subject","suggestedText")}autoloadIfNeeded(){this.$session.user&&!this.$destroyed&&(this.model.text||null)!==(this.getDatabaseText()||null)&&(this.log("autoload","modelText:",JSON.stringify(this.model.text),"dbText:",JSON.stringify(this.getDatabaseText())),this.$when(()=>!this.locator.locked).then(()=>{this.$destroyed||this.load()}).then(()=>{this.$destroyed||_access(this,"","locator","","draft","","requestRender","call",[])}))}load(){this.$destroyed||this.locator.locked||(this.log("load","modelText:",JSON.stringify(this.model.text),"dbText:",JSON.stringify(this.getDatabaseText())),Vue.set(this.model,"text",this.getDatabaseText()||""),Vue.set(this.model,"saved",!0))}autosaveIfNeeded(){this.$session.user&&!this.$destroyed&&(this.model.text||null)!==(this.getDatabaseText()||null)&&(this.log("autosave","modelText:",JSON.stringify(this.model.text),"dbText:",JSON.stringify(this.getDatabaseText())),this.$when(()=>!this.locator.locked).then(()=>{this.$destroyed||this.save()}).then(()=>{this.$destroyed||_access(this,"","locator","","draft","","requestRender","call",[])}))}save(){if(this.$destroyed||this.locator.locked)return Promise.resolve();if(t.flush(),!this.model.subject&&this.model.secondary)return this.createSecondary
1Draft();const e=this.model.text||null;if((this.getDatabaseText()||null)===e)return Promise.resolve();const i=Date.now();return Vue.set(this,"lastSaveTimestamp",i),this.log("save","modelText:",JSON.stringify(this.model.text),"dbText:",JSON.stringify(this.getDatabaseText())),this.model.subject.save(e).then(()=>{i===this.lastSaveTimestamp&&Vue.set(this.model,"saved",!0)}).catch(e=>(this.locator.draft||s.markHandled(e),Promise.reject(e)))}log(){if(i.drafts){const e=["draft",this.locator.$key];this.model.secondary&&e.push("(2nd)"),this.model.subject&&_get(this,"model","subject","$key")!==this.locator.$key&&e.push("codeblock",this.model.subject.$key),console.log(...e,...arguments)}}}return DraftCommentText.$vueOptions={props:{locator:{type:Object,required:!0},model:{type:Object,required:!0},mode:{type:String,required:!0},onboarding:String}},_declareVue("DraftCommentText",DraftCommentText,null,null,{}),{DraftCommentText:DraftCommentText}},!0,!0,{filename:"src/view/reviews/discussion/draft-comment-text.vue"}),_reviewable.define(["DraftComment"],["truss","Guide","session","bus","draftFocusTracker","textSelectionTracker","analytics","corpsman","Uploader","animator","debug","shared","mangler"],function(e,t,s,i,r,n,a,o,l,c,u,d,h){"use strict";class DraftComment{constructor(){Vue.set(this,"draftMode","write"),Vue.set(this,"errors",[]),Vue.set(this,"files",[]),Vue.set(this,"approveInstantSend",void 0),Vue.set(this,"uploader",void 0),Vue.set(this,"body",void 0),Vue.set(this,"models",void 0),Vue.set(this,"designator",this.locator.$key+(this.suffix?" (2nd)":"")),Vue.set(this,"uploadAccept",d.allowedUploadMimeTypes.join(",")),Vue.set(this,"bunnyTip",'Nice, you found the Easter egg! âð¤\nPlease <a class="link" href="mailto:[email protected]?subject=Bunny pictures">send us</a> pictures of your Reviewable plush bunny and we\'ll add them to the pool. ð'),Vue.set(this,"resizeObserver",void 0),Vue.set(this,"lastPreviewHeight",0)}created(){Vue.set(this,"body",{subject:this.locator.draft,secondary:!!this.suffix}),Vue.set(this,"models",{[this.locator.$key]:this.body}),this.$observe(()=>this.files,this.upload),this.$when(()=>_get(this,"locator","draft","$ready")).then(e=>{u.drafts&&console.log("draft",this.designator,"draft model ready"),this.locator.draft?this.setDraftMode("write",!0):u.drafts&&console.log("draft",this.designator,"disappeared")}),i.draftFocus.react((e,t)=>{this.locator.$key===e&&this.suffix===t&&(u.focus&&console.log("draft",this.designator,"focus requested"),this.setDraftMode("write",!0),this.focusDraft())},{scope:this}),i.deleteEmptyDrafts.react(e=>{this.suffix||e&&e===this.lastMousedownEvent||this._deleteIfEmpty()},{scope:this}),i.pushDraftError.react((e,t)=>{this.locator.$key===e&&this.errors.push(t)},{scope:this})}mounted(){u.focus&&!this.suffix&&"auto"===this.focus&&console.log(`draft ${this.designator} mounted, focused draft:`,r.focusedDraftKey),!this.suffix&&"auto"===this.focus&&r.shouldFocus(this.locator.$key,this.suffix)&&(u.focus&&console.log("draft",this.designator,"focus on mount"),this.focusDraft()),r.clearFocus(this.locator.$key),this.$observe(()=>_get(this,"locator","draft","uploading"),(e,t)=>{t&&!e&&this.$refs.coverIcon&&(Vue.set(this.$refs.coverIcon.style,"height",""),anime({targets:this.$refs.coverIcon,opacity:[0,1],duration:.66*c.defaultOptions.duration,easing:c.animeJsEasing}))});if(this.$observe(()=>_get(this,"preview","publicationContent"),async e=>{if(e&&(t=e,_.some(["cmdDraft","topDraft"],e=>!_.isNil(t[e]))||t.drafts.length)){const e=this.$refs.draft.clientHeight-31-25;if(!_get(this,"$refs","preview","$el"))return;if(Vue.set(this.$refs.preview.$el.style,"position","absolute"),await this.$nextTick(),this.$destroyed||!_get(this,"$refs","preview","$el"))return;Vue.set(this.$refs.preview.$el.style,"position",""),Vue.set(this,"lastPreviewHeight",this.$refs.preview.$el.clientHeight),this.lastPreviewHeight>e&&(this.$refs.draft.classList.add("uncapped"),anime({targets:this.$refs.writing,height:[e,this.lastPreviewHeight],easing:c.animeJsEasing,duration:c.defaultOptions.duration,complete:()=>{_get(this,"$refs","writing")&&Vue.set(this.$refs.writing.style,"height","")}}))}else if(this.lastPreviewHeight){if(Vue.set(this.$refs.writing.style,"height",this.lastPreviewHeight+"px"),await this.$nextTick(),this.$destroyed)return;Vue.set(this.$refs.writing.style,"height","");const e=this.$refs.draft.clientHeight-31-25;e<this.lastPreviewHeight&&anime({targets:this.$refs.writing,height:[this.lastPreviewHeight,e],easing:c.animeJsEasing,duration:c.defaultOptions.duration,complete:()=>{_get(this,"$refs","writing")&&_get(this,"$refs","draft")&&(Vue.set(this.$refs.writing.style,"height",""),Vue.set(this,"lastPreviewHeight",0),this.$refs.draft.classList.remove("uncapped"))}})}var t}),this.bottom){const e=_.debounce(()=>{this.bottom&&"preview-all"!==this.draftMode&&requestAnimationFrame(()=>{const e=_get(this,"$refs","writing","scrollHeight");if(e){document.documentElement.style.setProperty("--aux-draft-min-height",e+25+"px")}})},100);Vue.set(this,"resizeObserver",new ResizeObserver(e)),this.$waitForRefs("writing",e=>{this.resizeObserver.observe(e,{box:"border-box"})})}}beforeDestroy(){r.clearLastFocusedDraftScope(this),this.uploader&&this.uploader.destroy(),this.resizeObserver&&this.resizeObserver.disconnect()}get draftSaved(){return _.every(this.models,e=>e.saved||e.destroyed)}get draftEmpty(){return _.every(this.models,e=>e.empty||e.destroyed)}get draftSendable(){return"pondering"!==_get(this,"locator","draft","role")}get lgtbUsed(){return/:lgtb:/i.test(h.removeCodeAndQuotedBlocks(this.body.text))}get pendingPublishOnPush(){return _get(this,"locator","review","state","pendingPublishOnPush")}get effectiveDraftMode(){if(this.pendingPublishOnPush)return this.$emit("reset-preview"),"preview";
1const e=this.bottom&&"preview-all"===this.draftMode&&!_get(this,"preview","publicationPromise")&&!_get(this,"preview","publicationContent");return!this.locator.draft&&!_get(this,"locator","review","state","num","pendingSend")||e?"write":this.draftMode}launchConfetti(){if(!c.defaultOptions.duration)return;const e=document.documentElement,t=this.$refs.partyButton.getBoundingClientRect(),s=e.clientWidth,i=e.clientHeight;confetti({origin:{x:(t.left+t.width/2)/s,y:(t.top+t.height/2)/i},angle:45,drift:-.3,startVelocity:30,particleCount:150,ticks:150,zIndex:1e6})}getCodeblockModel(e){return this.models[e.$key]||Vue.set(this.models,e.$key,{subject:e}),this.models[e.$key]}createCodeblock(){const e=this.locator.draft;if(!e||this.locator.locked)return;Vue.set(this.$session.onboarding,"createdCodeblock",!0);const t=this.locator.review.state.drafts.makeCodeblock(e,n.getSelectedCode(),this.locator),s=this.$newKey();_ref(e,"child","codeblocks").update({[s]:t}),_.defer(()=>{i.draftFocus(s)})}upload(e){_get(e,"length")&&!this.locator.locked&&(this.locator.draft?(Vue.set(s.onboarding,"uploadedFile",!0),this.uploader||Vue.set(this,"uploader",new l(this.locator.draft,this.body.textarea,{updateUploadProgress:e=>{Vue.set(this.$refs.coverIcon.style,"height",1+12*(1-e)+"px")},reportUploadError:e=>this.errors.push(e)})),_.forEach(e,e=>this.uploader.add(e)),Vue.set(this,"files",[])):this.suffix&&this.$refs.draftCommentBody.createSecondaryDraft().then(()=>{this.upload(e)}))}handleFocus(){u.focus&&console.log(`draft ${this.designator} focused`),r.setLastFocusedDraftScope(this);const e=this.locator.review.context.navigation;e.lastVisitedDiscussionKey!==this.locator.$key&&(Vue.set(e,"lastVisitedDiscussionKey",this.locator.$key),Vue.set(e,"missing",null))}handleEscape(){u.drafts&&console.log("draft",this.designator,"escape received"),i.flush(),this._deleteIfEmpty()}_deleteIfEmpty(){this.draftEmpty&&_get(this,"locator","draft","$ready")&&!_get(this,"locator","draft","hasContent")&&(u.drafts&&console.log("draft",this.designator,"empty-delete"),this.deleteDraft())}saveDraft(){if(this.$destroyed)return Promise.resolve();const e=[];return i.saveDraft(this.locator.$key,e),Promise.all(e)}setDraftMode(e,t){t||Vue.set(s.onboarding,"previewedDraft",!0),Vue.set(this,"approveInstantSend",!1),"preview"===e?(u.drafts&&console.log("draft",this.designator,"set mode to preview"),this.saveDraft().then(()=>{Vue.set(this,"draftMode",e),_.defer(()=>r.setLastFocusedDraftScope(this))})):Vue.set(this,"draftMode",e),"preview-all"!==e&&this.$emit("reset-preview")}focusDraft(e){if(this.pendingPublishOnPush)return;let t;u.focus&&console.log("draft",this.designator,"focus now, useLast",!!e),e&&(t=_access(_,"call",[this.models],"","reject","call",["destroyed"],"","maxBy","call",["lastFocusTimestamp"],"","textarea")),t||(t=this.body.textarea),t&&_.defer(()=>{t.focus();const s=document.activeElement;_.defer(()=>{document.activeElement!==s&&this.focusDraft(e)})})}resetDraftMode(){"preview"===this.draftMode&&(this.setDraftMode("write"),this.focusDraft(!0),window.getSelection().removeAllRanges())}toggleDraftMode(){"write"===this.draftMode?this.setDraftMode("preview"):(this.setDraftMode("write"),this.focusDraft(!0))}deleteDraft(){this.uploader&&this.uploader.destroy(),u.drafts&&console.log("draft",this.designator,"delete"),this.saveDraft().then(()=>{Vue.set(s.onboarding,"deletedDraft",!0),this.locator.draft&&this.locator.draft.delete()})}async sendDraft(){const e=this.locator.draft;if(!e||this.draftEmpty||!this.draftSendable||this.locator.locked)return;if(!this.approveInstantSend&&!s.settings.allowInstantSend)return void Vue.set(this,"approveInstantSend",!0);const t=_get(this,"locator","review","userHasDeferred");if(e.uploading)return this.errors.push("Failed to send comment: files still uploading.");Vue.set(this,"approveInstantSend",!1),Vue.set(s.settings,"allowInstantSend",!0),u.drafts&&console.log("draft",this.designator,"send");try{if(await this.saveDraft(),this.locator.locked||!e.hasContent)return;this.locator.lock(),Vue.set(s.onboarding,"sentDraft",!0);const i=this.locator.review;try{await i.state.drafts.send([e],{bumpDeferral:t});const s={};_get(i,"core")&&_.assign(s,{owner:i.core.ownerName,repo:i.core.repoName,pullRequest:i.core.pullRequestId}),a.track("Sent Comment",s)}finally{this.locator.unlock()}}catch(e){o.capture(e,"sendDraft"),i.pushDraftError(this.locator.$key,"Failed to send comment: "+(e.message||e))}}}DraftComment.$vueOptions={props:{locator:{required:!0,type:Object},lastMousedownEvent:MouseEvent,focus:String,suffix:String,bottom:Boolean,preview:Object}};return _declareVue("DraftComment",DraftComment,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{ref:"draft",staticClass:"ui draft comments form error warning"},[s("div",{staticClass:"comment writing area",class:{bottom:e.bottom}},[s("div",{staticClass:"ui draft ribbon label"},[e._v("\n Draft\n ")]),s("div"),s("avatar",{staticClass:"avatar",attrs:{"user-key":_get(e,"$session","user","uid"),display:"picture,popup,search"}}),s("div",{ref:"writing",staticClass:"relative content",class:{dragover:_get(e,"$refs","dropUpload","dropActive")}},[s("form",{staticClass:"viewport",class:e.effectiveDraftMode,on:{dblclick:e.resetDraftMode}},[s("div",{staticClass:"relative"},[s("div",{staticClass:"draft comment mask watermark"}),s("draft-comment-body",{ref:"draftCommentBody",attrs:{locator:e.locator,model:e.body,mode:e.effectiveDraftMode,suffix:e.suffix,bottom:e.bottom,onboarding:"sawWritingArea"},on:{focus:e.handleFocus,escape:e.handleEscape,upload:function(t){return e.upload([{file:t}])}}}),e._l(_get(e,"locator","draft","codeblocks","list"),function(t){return s("draft-comment-codeblock",{key:t.$key,attrs:{locator:e.locator,model:e.getCodeblockModel(t),mode:e.effectiveDraftMode,onboarding:"sawCodeblockArea"},on:{focus:e.handleFocus,escape:e.handleEscape}})}),e.bottom&&"preview-all"===e.effectiveDraftMode?s("publish-preview",{ref:"preview",attrs:{review:e.locator.review,preview:e.preview},on:{retry:function(t){return e.$emit("refresh-preview")}}}
1):e._e()],2)]),e.$session.config.uploadsAllowed?s("div",{staticClass:"droparea"},[s("div")]):e._e()])],1),s("animate-slide-down",[e.approveInstantSend?s("div",{staticClass:"ui warning message"},[s("b",[e._v("Are you sure you want to send this comment immediately?")]),e._v("\n Many people prefer to receive comments batched together.\n Drafts are saved automatically\n and you can send them all later with the\n "),s("span",{staticClass:"ui dummy tiny green button"},[s("i",{staticClass:"publish icon",attrs:{alt:""}}),e._v(" PUBLISH\n ")]),e._v("\n button above. But if you're sure, just hit\n "),s("span",{staticClass:"really send"},[s("i",{staticClass:"send icon",attrs:{alt:"send message"}})]),e._v("\n once more and we won't bother you again.\n ")]):e._e()]),s("animate-slide-down",[e.errors.length?s("div",{staticClass:"ui error message"},[s("i",{staticClass:"close icon",on:{click:function(t){e.errors=[]}}}),s("div",e._l(e.errors,function(t,i){return s("p",{key:i},[e._v(e._s(t.toString()))])}),0)]):e._e()]),s("div",{staticClass:"ui bottom tabular draft menu"},[s("div",{staticClass:"right menu"},[s("span",{ref:"savedIndicator",staticClass:"text draft indicator item",class:{saved:e.draftSaved}},[e._v("\n draft saved\n ")]),s("animate-wipe-right",[e.lgtbUsed?s("div",{ref:"partyButton",staticClass:"ui basic large bunny button item",on:{click:e.launchConfetti}},[s("i",{staticClass:"green party icon"}),s("tippy-dropdown",[s("div",{staticClass:"ui bunny success message segment"},[s("div",{staticClass:"image"}),s("p",[e._v("Nice, you found the Easter egg! âð¤")]),s("p",[e._v("\n Please\n "),s("a",{staticClass:"link",attrs:{href:"mailto:[email protected]?subject=Bunny pictures"}},[e._v("send us")]),e._v("\n pictures of your Reviewable plush bunny and we'll add them to the pool. ð\n ")])])])],1):e._e()]),s("a",{staticClass:"ui basic large markdown button item",attrs:{href:"https://guides.github.com/features/mastering-markdown/",target:"_blank"},on:{mousedown:function(e){e.preventDefault()}}},[s("i",{staticClass:"markdown icon"})]),"-top"!==e.locator.$key?s("div",{staticClass:"ui basic large codeblock button item",class:{disabled:e.locator.locked},on:{click:e.createCodeblock}},[s("i",{staticClass:"create codeblock icon"})]):e._e(),e.$session.config.uploadsAllowed?s("vue-upload-component",{ref:"dropUpload",staticClass:"ui basic large icon upload button relative item",class:{uploading:_get(e,"locator","draft","uploading"),disabled:e.locator.locked},attrs:{"input-id":"dropUpload"+e.locator.$key+(e.suffix||""),drop:!0,accept:e.uploadAccept,disabled:e.locator.locked,multiple:""},model:{value:e.files,callback:function(t){e.files=t},expression:"files"}},[s("i",{staticClass:"progress upload base icon"}),s("i",{ref:"coverIcon",staticClass:"upload cover icon"})]):e._e(),e.bottom?e._e():s("div",{staticClass:"ui basic large icon delete button item",class:{disabled:e.locator.locked},on:{click:e.deleteDraft}},[s("i",{staticClass:"delete draft icon",attrs:{alt:"delete draft"}})]),e.bottom?e._e():s("div",{staticClass:"ui basic large icon send button item",class:{disabled:e.locator.locked||e.draftEmpty||!e.draftSendable},on:{click:e.sendDraft}},[s("i",{staticClass:"send icon",attrs:{alt:"send message"}})]),e.bottom&&_get(this,"locator","review","context","lgtmConfig")?s("div",{staticClass:"lgtm item",class:{disabled:e.locator.locked},on:{click:function(t){return e.locator.tracker.lgtmAndApprove(!0,e.suffix)}}},[s("img",{staticClass:"emoji",attrs:{src:_get(e,"locator","review","context","lgtmConfig","emojiUrl")}})]):e._e()],1),s("a",{staticClass:"write item",class:{active:"write"===e.effectiveDraftMode,disabled:e.pendingPublishOnPush},on:{click:function(t){e.setDraftMode("write"),e.focusDraft(!0)}}},[e._v("\n Write\n ")]),s("a",{staticClass:"preview item",class:{active:"preview"===e.effectiveDraftMode},on:{click:function(t){return t.preventDefault(),e.setDraftMode("preview")}}},[e._v("\n Preview\n ")]),s("a",{directives:[{name:"show",rawName:"v-show",value:e.bottom,expression:"bottom"}],staticClass:"preview all item",class:{active:"preview-all"===e.effectiveDraftMode,disabled:!_get(e,"locator","review","state","num","pendingSend")||e.pendingPublishOnPush},on:{click:function(t){t.preventDefault(),e.setDraftMode("preview-all"),e.$emit("refresh-preview")}}},[s("i",{staticClass:"preview publish icon"}),e._v(" Preview Publish\n ")])])],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-6df8b9c2"}),_declareGuides("DraftComment","data-v-6df8b9c2",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".draft.menu[data-v-6df8b9c2]",group:".write.item[data-v-6df8b9c2], .preview.item[data-v-6df8b9c2]:not(.all)",onboarding:"previewedDraft","hotkey-action":"toggleCurrentDraftPreview()",highlight:"under"}},[s("p",[e._v("\n Switch between "),s("em",[e._v("write and preview modes")]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".preview.all.item[data-v-6df8b9c2]",onboarding:"sawPreviewAllDrafts",highlight:"under"}},[s("p",[e._v("\n Fully "),s("em",[e._v("preview all drafts")]),e._v(" in once place before you send them.\n ")])]),e._v(" "),s("guide",{attrs:{for:".draft.menu .draft.indicator[data-v-6df8b9c2]",onboarding:"sawDraftSaved",highlight:"under"}},[s("p",[e._v("\n Your drafts are "),s("em",[e._v("saved automatically")]),e._v(" whenever you stop typing, and "),s("em",[e._v("synced")]),e._v("\n with any other tabs or browsers you have open on the same review.\n ")])]),e._v(" "),s("guide",{attrs:{for:".draft.menu .markdown.button[data-v-6df8b9c2]",onboarding:"sawMarkdown",highlight:"under"}},[s("p",[e._v("\n Comments support\n "),s("em",[s("a",{staticClass:"link",attrs:{target:"_blank",href:"https://guides.github.com/features/mastering-markdown/"}},[e._v("\n GitHub Flavored Markdown\n ")])]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".draft.menu .codeblock.button[data-v-6df8b9c2]",onboarding:"createdCodeblock",highlight:"under","hotkey-action":"createCodeblockInCurrentDraft()"}},[s("p",[e._v("\n Add a "),s("em",[e._v("code block")]),e._v(" to your comment. To add a "),s("em",[e._v("change suggestion")]),e._v(", select the\n code you want to edit in the diff before clicking the button.\n ")]),e._v(" "),s("p",[e._v("\n Suggestions made in Reviewable don't interoperate with suggestions made via GitHub.\n ")])]),e._v(" "),s("guide",{attrs:{for:".draft.menu .upload.button[data-v-6df8b9c2]",onboarding:"uploadedFile",highlight:"under"}},[s("p",[e._v("\n Upload and "),s("em",[e._v("attach an image")]),e._v(" to your comment, at your current cursor position.\n You can also "),s("em",[e._v("drag and drop")]),e._v(" files onto the draft, and "),s("em",[e._v("paste images")]),e._v("\n from the clipboard.\n ")]),e._v(" "),s("p",[e._v("\n To cancel an upload, just delete the placeholder from your draft.\n ")])]),e._v(" "),s("guide",{attrs:{for:".draft.menu .delete.button[data-v-6df8b9c2]",onboarding:"deletedDraft","hotkey-action":"deleteDraft()"}},[s("p",[s("em",[e._v("Delete")]),e._v(" the draft. You can "),s("em",[e._v("recover")]),e._v("\n it by creating a draft on the same line again.\n ")]),e._v(" "),s("p",[e._v("\n You can also delete an "),s("em",[e._v("empty draft")]),e._v("\n b
1y clicking anywhere outside the input area or hitting\n "),s("span",{staticClass:"cfp-hotkeys-key"},[e._v("Esc")]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".draft.menu .send.button[data-v-6df8b9c2]",onboarding:"sentDraft","hotkey-action":"sendCurrentComment()"}},[s("p",[s("em",[e._v("Immediately send")]),e._v(" the message. Other drafts will not be affected.\n ")]),e._v(" "),s("p",[e._v("\n Note that other people will receive "),s("em",[e._v("one notification for each message")]),e._v("\n sent immediately, so it's usually better to write a bunch and\n "),s("span",{staticClass:"ui tiny green dummy button"},[s("i",{staticClass:"publish icon"}),e._v(" Publish")]),e._v("\n them all at once instead.\n ")])]),e._v(" "),s("guide",{attrs:{for:".lgtm.item[data-v-6df8b9c2]",highlight:"under",onboarding:"sawReviewSummaryLgtm"}},[s("p",[e._v("\n Insert a "),s("img",{attrs:{src:e.config.hostUrl+"/lgtm.png",height:"14"}}),e._v(" (Looks Good To Me) emoji into\n the draft and "),s("em",[e._v("approve the pull request")]),e._v(" when publishing (if allowed).\n ")]),e._v(" "),s("p",[e._v("\n You can "),s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/admincenter#approve-button-output"}},[e._v("\n customize this message")]),e._v(" in the repository settings.\n ")])])],1)},[]),{DraftComment:DraftComment}},!0,!0,{filename:"src/view/reviews/discussion/draft-comment.vue"}),_reviewable.define(["Tribute"],["truss","pageControl"],function(e,t){"use strict";const s=Vue.extend({functional:!0,render(e){return e("span",this.$slots.default)}}),i=Vue.extend({props:{slotFn:Function,refreshValues:Function},render(e){return e("span",this.slotFn({refreshValues:this.refreshValues}))}}),r=[9,13,38,40],n=new Set(["Shift","Control","Alt","Meta","AltGraph","CapsLock","NumLock","ScrollLock","OS","Fn"]);class Tribute{constructor(){Vue.set(this,"tribute",void 0),Vue.set(this,"editorElement",void 0),Vue.set(this,"mutationObserver",void 0),Vue.set(this,"fetchingValues",!1),Vue.set(this,"footerSlots",void 0),Vue.set(this,"footerElements",Object.create(null)),Vue.set(this,"lastCodeCheck",{markdown:null,caretPosition:0,result:!1})}render(e){return e(this.tag,this.$slots.editor.concat(this.$slots.default))}created(){Vue.set(this.options,"collection",_(this.options.collection).castArray().map(this.assignSlotTemplate).map(this.hookToAddClass).value()),Vue.set(this,"footerSlots",_(this.options.collection).filter("footerSlotName").keyBy("trigger").mapValues("footerSlotName").mapValues(e=>_.isString(e)?_.constant(e):e).value()),Vue.set(this,"mutationObserver",new MutationObserver(this.handleTributeItemListChanged))}mounted(){Vue.set(this,"editorElement",this.$slots.editor[0].elm),this.editorElement.addEventListener("keydown",this.interceptInput,!0),this.editorElement.addEventListener("keyup",this.interceptInput,!0),this.editorElement.addEventListener("tribute-replaced",function(){_.defer(()=>this.dispatchEvent(new Event("input")))}),this.flowPanel?this.$observe(()=>!_get(this,"flowPanel","collapsible")||_get(this,"flowPanel","toggle","showing")||_get(this,"flowPanel","toggle","overlaid"),e=>{e?this.createTribute():this.destroyTribute()}):this.createTribute()}beforeDestroy(){this.destroyTribute(),this.footer&&this.footer.$destroy()}createTribute(){if(!this.tribute){Vue.set(this.options,"menuContainer",t.topDialog||document.body),Vue.set(this,"tribute",new window.Tribute(this.options)),this.tribute.attach(this.editorElement);const e=this.tribute.events.shouldDeactivate.bind(this.tribute.events);Vue.set(this.tribute.events,"shouldDeactivate",t=>!(t.isComposing||n.has(t.key)||"Unidentified"===t.key)&&e(t)),this.editorElement.addEventListener("tribute-active-true",e=>{this.mutationObserver.observe(this.tribute.menu.querySelector("ul"),{childList:!0})},{once:!0})}}destroyTribute(){this.tribute&&this.editorElement&&(this.tribute.detach(this.editorElement),Vue.set(this,"tribute",void 0),this.mutationObserver.disconnect())}interceptInput(e){(this.fetchingValues&&_.includes(r,e.keyCode)||this.isInMarkdownCode())&&(e.stopImmediatePropagation(),this.tribute&&(this.tribute.hideMenu(),requestAnimationFrame(()=>{this.tribute&&this.tribute.hideMenu()})))}handleTributeItemListChanged(){const e=_get(this,"footerSlots",_get(this,"tribute","current","collection","trigger")),t=e&&e(this.tribute.current);t&&!this.footerElements[t]&&this.createFooter(t),_.forEach(this.footerElements,(e,s)=>{const i=e.parentNode===this.tributeMenu;s!==t||i||this.tributeMenu.appendChild(e),s!==t&&i&&this.tributeMenu.removeChild(e)})}createFooter(e){const t=new i({parent:this,propsData:{slotFn:this.$scopedSlots[e],refreshValues:this.refreshValues}});t.$mount();const s=t.$el.firstChild;s.addEventListener("mousedown",e=>e.stopImmediatePropagation()),Vue.set(this.footerElements,e,s)}refreshValues(){_get(this,"tribute","current")&&(Vue.set(this.tribute,"currentMentionTextSnapshot",null),this.tribute.showMenuFor(this.tribute.current.element))}hookToAddClass(e){if(e.menuClass||_.isFunction(e.values)){const t=e.values;Vue.set(e,"values",(s,i)=>(e.menuClass&&Vue.set(this.tributeMenu,"className",e.menuClass),_.isFunction(t)?(Vue.
1set(this,"fetchingValues",!0),t(s,e=>{Vue.set(this,"fetchingValues",!1),i(e)})):i(t)))}return e}get tributeMenu(){return this.tribute.menu.querySelector("ul")}assignSlotTemplate(e){return!e.menuItemTemplate&&e.slotName&&Vue.set(e,"menuItemTemplate",t=>{const i=new s;Vue.set(i.$slots,"default",this.$scopedSlots[e.slotName]({item:t.original,query:this.tribute.current.mentionText,slotData:e.slotData})),i.$mount();const r=i.$el.innerHTML;return i.$destroy(),r}),e}isInMarkdownCode(){const e=this.editorElement.value,t=this.editorElement.selectionStart||0;if(this.lastCodeCheck.markdown===e&&this.lastCodeCheck.caretPos===t)return this.lastCodeCheck.result;const s=function(e,t){a.clear();const s=e.lastIndexOf("\n",t-1)+1,i=e.slice(s,t);for(let e=0;e<i.length;e++){if(96!==i.charCodeAt(e))continue;if(e>0&&92===i.charCodeAt(e-1))continue;let t=e+1;for(;t<i.length&&96===i.charCodeAt(t);)t++;const s=t-e;a.set(s,1^(a.get(s)||0)),e=t-1}for(const e of a.values())if(1===e)return!0;return!1}(e,t)||function(e,t){const s=e.slice(0,t),i=s.split("\n");let r=!1,n=null,a=0;for(let e=0;e<i.length;e++){const t=i[e].match(/^ {0,3}(`{3,}|~{3,})(.*)$/);if(!t)continue;const s=t[1],o=s[0],l=s.length;r?o===n&&l>=a&&(r=!1,n=null,a=0):(r=!0,n=o,a=l)}return r}(e,t)||function(e,t){const s=e.slice(0,t),i=s.split("\n"),r=i[i.length-1];if(!/^(\t| {4,})/.test(r))return!1;for(let e=i.length-1;e>=0;e--){const t=i[e];if(/^\s*$/.test(t))break;if(!/^(\t| {4,})/.test(t))return!1}return!0}(e,t);return Vue.set(this,"lastCodeCheck",{markdown:e,caretPos:t,result:s}),s}}const a=new Map;return Tribute.$vueOptions={props:{tag:{type:String,default:"div"},options:{required:!0,type:Object}},inject:{flowPanel:{default:null}}},_declareVue("Tribute",Tribute,null,null,{}),{Tribute:Tribute}},!0,!0,{filename:"src/view/reviews/discussion/tribute.vue"}
1),_reviewable.define(["CommitsControls"],["truss","Guide","corpsman","router","session"],function(e,t,s,i,r){"use strict";const n={combinedCommits:{value:"combinedCommits",label:"Combine commits for review",text:"Each revision may correspond to multiple commits;\n not every commit may be accessible for diffing."},onePerCommit:{value:"onePerCommit",label:"Review each commit separately",text:"Each revision represents one commit;\n recommended only if commits are carefully organized."}};let a=null;class CommitsControls{constructor(){Vue.set(this,"reviewStyleRequestInProgress",!1),Vue.set(this,"compactionRequestInProgress",!1),Vue.set(this,"approveCompaction",!1),Vue.set(this,"reviewStyles",[n.combinedCommits,n.onePerCommit])}mounted(){a===i.path&&_access(this,"","review","","context","","navigation","","visitPanel","call",["-commits"]),a=null}get result(){return _get(this,"review","context","commitsControlsResult")}clearResult(){this.review.context&&Vue.set(this.review.context,"commitsControlsResult",void 0)}get reviewStyle(){return n[this.review.core.revisionSplitStrategy]}set reviewStyle(e){_get(e,"value")&&!this.reviewStyleRequestInProgress&&(this.clearResult(),Vue.set(this,"reviewStyleRequestInProgress",!0),this.review.context.setReviewRevisionSplitStrategy(e.value).catch(e=>{s.capture(e,"saveReviewStyle"),Vue.set(this.review.context,"commitsControl
1sResult",{level:"error",message:e.toString()})}).finally(()=>{Vue.set(this,"reviewStyleRequestInProgress",!1)}))}get canCompact(){return _get(this,"review","verdict","push")&&_.size(this.review.revisions)>1&&_.findLast(_get(this,"review","revisions","list"),"compacted")!==_.last(_get(this,"review","revisions","list"))}async compact(){if(this.canCompact&&!this.compactionRequestInProgress)if(this.approveCompaction||r.settings.allowCompactRevisions){Vue.set(this,"approveCompaction",!1),Vue.set(r.settings,"allowCompactRevisions",!0),this.review.context.acquire();try{Vue.set(this,"compactionRequestInProgress",!0),a=i.path,this.clearResult();const e=this.review.core.ownerName,t=this.review.core.repoName,s=this.review.core.pullRequestId,{numOriginalRevisions:r,numCompactedRevisions:n}=await this.$store.queues.requests.send({action:"compactReview",ownerName:e,repoName:t,prNumber:s},{timeout:864e5});n===r?Vue.set(this.review.context,"commitsControlsResult",{level:"warning",icon:"face meh",message:"Compaction unsuccessful: no revisions eligible for compacting."}
1):Vue.set(this.review.context,"commitsControlsResult",{level:"success",icon:"face happy",message:`Compaction successful: compacted ${r} revisions into ${n}.`})}catch(e){s.markHandled(e),Vue.set(this.review.context,"commitsControlsResult",{level:"error",icon:"face sad",message:`Compaction failed: ${e.message}`})}finally{Vue.set(this,"compactionRequestInProgress",!1),this.review.context.release()}}else Vue.set(this,"approveCompaction",!0)}}CommitsControls.$vueOptions={props:{review:{type:Object,required:!0}}};return _declareVue("CommitsControls",CommitsControls,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"root"},[s("div",[e._v("\n Revision mapping:\n "),s("span",{staticClass:"review-style wrapper"},[s("div",{staticClass:"ui inverted dimmer",class:{active:e.reviewStyleRequestInProgress}},[s("div",{staticClass:"ui loader"})]),s("multiselect",{staticClass:"ui dropdown review-style",attrs:{"track-by":"value",value:"value",label:"label",disabled:!_get(e,"review","context","verdict","push"),options:e.reviewStyles,searchable:!1,"show-labels":!1},scopedSlots:e._u([{key:"option",fn:function(t){var i=t.option;return[s("span",[s("span",{staticClass:"option label"},[e._v(e._s(i.label))]),s("br"),s("span",{staticClass:"option explanation"},[e._v(e._s(i.text))])])]}},{key:"afterList",fn:function(){return[_get(e,"review","revisions","num","hardSnapshotted")?s("div",{staticClass:"ui snapshot warning message"},[s("i",{staticClass:"warning sign icon",attrs:{alt:"warning"}}),e._v("\n Previously reviewed revisions ("+e._s(e.review.revisions.hardSnapshottedRange)+")\n are immutable and won't be affected.\n For best results, set before starting review.\n ")]):e._e()]},proxy:!0}]),model:{value:e.reviewStyle,callback:function(t){e.reviewStyle=t},expression:"reviewStyle"}})],1),s("ui-hold-to-arm-button",{staticClass:"small compact",class:{loading:e.compactionRequestInProgress},attrs:{disabled:!e.canCompact},on:{click:function(t){return e.compact()}}},[s("i",{staticClass:"compact icon"}),e._v("\n Compact "+e._s(_get(e,"review","revisions","list","length"))+"\n revision"+e._s(1===_get(e,"review","revisions","list","length")?"":"s")+"\n ")])],1),s("animate-slide-down",[e.approveCompaction?s("div",{staticClass:"ui low warning special message"},[s("i",{staticClass:"close icon",on:{click:function(t){e.approveCompaction=!1}}}),s("b",[e._v("Are you sure you want to try compacting revisions?")]),e._v(" The process is slightly lossy and\n affects all review participants; please see the\n "),s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/reviews#compacting-revisions"}},[e._v("user manual")]),e._v("\n for details. If you're sure, though, just click the button once more and we won't bother you\n again in the future.\n ")]):e._e()]),s("animate-slide-down",[e.result?s("div",{staticClass:"ui low special message",class:e.result.level},[s("i",{staticClass:"close icon",on:{click:function(t){return e.clearResult()}}}),s("i",{staticClass:"result icon",class:e.result.icon}),e._v("\n "+e._s(e.result.message)+"\n ")]):e._e()])],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-584d4dcc"}
1),_declareGuides("CommitsControls","data-v-584d4dcc",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".dropdown.review-style[data-v-584d4dcc]",onboarding:"selectedReviewStyle",highlight:"bracket"}},[s("p",[e._v("\n Select the "),s("em",[e._v("review style")]),e._v(". Your choice will affect how commits are grouped into\n revisions, and the suggested sequence of diffs to review.\n ")]),e._v(" "),s("p",[e._v("\n This is best "),s("em",[e._v("set once at the beginning")]),e._v(" of a review. An administrator can also set\n the default review style for a repository.\n ")])]),e._v(" "),s("guide",{attrs:{for:".compact.button[data-v-584d4dcc]",onboarding:"compactedRevisions",highlight:"under"}},[s("p",[e._v("\n Try to "),s("em",[e._v("reduce the number of revisions")]),e._v(" in the review by removing ones that are no\n longer necessary. Access to the "),s("em",[e._v("review will be blocked")]),e._v(" until the process completes,\n typically within 10 to 15 seconds. The process is slightly lossy"),e._v(":\n ")]),e._v(" "),s("ul",[s("li",[s("em",[e._v("Discussions may be reassigned")]),e._v(" to an equivalent revision, and
1you may no longer be\n able to display the original diff context.")]),e._v(" "),s("li",[s("em",[e._v("Code blocks may be reassigned")]),e._v(" to an equivalent revision.")]),e._v(" "),s("li",[e._v("Only the "),s("em",[e._v("latest review mark")]),e._v(" from every reviewer is guaranteed to be\n retained.")]),e._v(" "),s("li",[e._v("Matched "),s("em",[e._v("prior revisions may be removed")]),e._v(" for rebased or merged revisions, making\n diffs less useful.")])]),e._v(" "),s("p",[s("em",[e._v("Revision numbers will be retained")]),e._v(", however.\n ")]),e._v(" "),s("p",[s("em",[e._v("If something goes dreadfully wrong")]),e._v(", you can ask admin staff to recover the original\n review from a backup automatically snapshotted at the start, though this will discard any\n changes made in the meantime.\n ")]),e._v(" "),s("p",[e._v("\n Only users with write access to the repository are allowed to compact revisions.\n ")])])],1)},[]),{CommitsControls:CommitsControls}},!0,!0,{filename:"src/view/reviews/files/commits-controls.vue"}),_reviewable.define(["CommitsList"],["truss","Guide","File","router"],function(e,t,s,i){"use strict";class CommitsList{constructor(){}get commitsWithinBounds(){return _access(this,"","file","","diff","","computeCommitsWithinBounds","call",[])}get commitLinkBase(){return this.$session.config.gitHubUrl+"/"+i.params.owner+"/"+i.params.repo+"/commit/"}}CommitsList.$vueOptions={props:{file:{type:s,required:!0}}};return _declareVue("CommitsList",CommitsList,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.file.system?e._e():s("div",{staticClass:"list dropdown-highlight"},[s("i",{staticClass:"grey commit icon dropdown-toggle"}),s("tippy-dropdown",{attrs:{options:{bypassCloseOnClick:!0}}},[s("div",{staticClass:"ui vertical menu"},[_get(e,"commitsWithinBounds","length")?e._l(e.commitsWithinBounds,function(t){return s("a",{key:t.sha,staticClass:"commit item",attrs:{href:e.commitLinkBase+_get(t,"sha")}},[s("span",{staticClass:"sha"},[e._v(e._s(t.sha.slice(0,7)))]),s("span",{staticClass:"title"},[e._v(e._s(t.title))])])}):s("div",{staticClass:"item no hover"},[e._v("\n Diff doesn't cover any commits.\n ")])],2)])],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-c28a9d08"}),_declareGuides("CommitsList","data-v-c28a9d08",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".list[data-v-c28a9d08]",onboarding:"sawCommitsList"}},[s("p",[e._v("Shows the "),s("em",[e._v("list of commits")]),e._v(" for the file "),s("em",[e._v("at the current diff bounds")]),e._v(".")])])],1)},[]),{CommitsList:CommitsList}},!0,!0,{filename:"src/view/reviews/files/commits-list.vue"}),_reviewable.define(["CoverageStats"],["truss","Guide","mangler"],function(e,t,s){"use strict";class CoverageStats{constructor(){}get error(){return s.renderLinks(_.escape(this.rightCoverage.error||_get(this,"leftCoverage","error")))}get errorIcon(){const e=this.rightCoverage.errorLevel||_get(this,"leftCoverage","errorLevel");return"pending"===e?e:"red warning sign"}get showCoverageBars(){const e=this.$session.settings.showCoverageBars;return e||void 0===e}set showCoverageBars(e){Vue.set(this.$session.settings,"showCoverageBars",e)}get formattedLinePercentage(){return this.formatPercentage("linePercentage")}get formattedBranchPercentage(){return this.formatPercentage("branchPercentage")}formatPercentage(e){if(void 0===this.rightCoverage[e])return;const t=this.formatDeltaPercentage(e);if(!this.full)return t;const s=`${(100*this.rightCoverage[e]).toFixed(0)}%`;return t?`${t} (${s})`:s}formatDeltaPercentage(e){if(!this.leftCoverage||this.leftCoverage===this.rightCoverage)return;const t=100*(this.rightCoverage[e]-this.leftCoverage[e]);let s="",i=t.toFixed(1);return"0.0"===i||"-0.0"===i?i="±0":(t>0?(i=`+${i}`,s="text-green"):s="text-red",i.length>4&&(i=i.slice(0,-2))),`<span class="${s}">${i}%</span>`}}CoverageStats.$vueOptions={props:{leftCoverage:Object,rightCoverage:{type:Object,required:!0},full:{type:Boolean,default:!1}}};return _declareVue("CoverageStats",CoverageStats,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("span",{staticClass:"coverage stats dropdown-highlight",class:{full:e.full}},[e.formattedBranchPercentage||e.full&&e.error?s("span",{staticClass:"lines text-grey dropdown-toggle"},[s("i",{staticClass:"coverage icon"}),e.error?s("span",{staticClass:"error"},[s("i",{staticClass:"icon",class:e.errorIcon})]):s("span",{domProps:{innerHTML:e._s(e.formattedBranchPercentage)}}
1)]):e._e(),e.full?s("tippy-dropdown",[e.error?s("div",{staticClass:"ui segment"},[s("p",{directives:[{name:"untrusted-html",rawName:"v-untrusted-html",value:e.error,expression:"error"}],staticClass:"text-grey error"})]):s("div",{staticClass:"ui segment text-grey"},[s("p",[s("span",{staticClass:"legend"},[e._v("Line:")]),s("span",{domProps:{innerHTML:e._s(e.formattedLinePercentage)}})]),s("p",[s("span",{staticClass:"legend"},[e._v("Branch:")]),s("span",{domProps:{innerHTML:e._s(e.formattedBranchPercentage)}})]),s("p",{staticClass:"bars toggle"},[s("ui-toggle-input",{model:{value:e.showCoverageBars,callback:function(t){e.showCoverageBars=t},expression:"showCoverageBars"}},[e._v("\n Show coverage bars\n ")])],1)])]):e._e()],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-a8938c62"}),_declareGuides("CoverageStats","data-v-a8938c62",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".coverage[data-v-a8938c62]",onboarding:"sawCoverageSummary",highlight:"under"}},[s("p",[e._v("\n The "),s("em",[e._v("branchwise code coverage")]),e._v(" at the right diff bound, and the change in coverage\n from the left diff bound. Click to drop down a panel with more details.\n ")]),e._v(" "),s("p",[s("em",[e._v("Per line code coverage")]),e._v(" is displayed as a bar in the gutter:\n ")]),e._v(" "),s("dl",{staticClass:"wide-55"},[s("dt",[s("span",{staticStyle:{"background-color":"var(--coverage-bar-color-full)"}},[e._v("blue")])]),s("dd",[e._v("full coverage")]),e._v(" "),s("dt",[s("span",{staticStyle:{"background-color":"var(--coverage-bar-color-partial)"}},[e._v("light blue")])]),s("dd",[e._v("partial coverage")]),e._v(" "),s("dt",[s("span",{staticStyle:{"background-color":"var(--coverage-bar-color-none)"}},[e._v("yellow")])]),s("dd",[e._v("no coverage")])])]),e._v(" "),s("guide",{attrs:{for:".bars.toggle[data-v-a8938c62]",onboarding:"toggledCoverageBars",highlight:"under"}},[s("p",[e._v("\n Toggle the "),s("em",[e._v("coverage indicator bars")]),e._v(" in the gutter on and off.\n ")])])],1)},[]),{CoverageStats:CoverageStats}},!0,!0,{filename:"src/view/reviews/files/coverage-stats.vue"}),_reviewable.define(["DesignationDetails"],["truss","File","session"],function(e,t,s){"use strict";class DesignationDetails{constructor(){Vue.set(this,"teamMemberships",this.$store.services.teamMemberships)}get needsAuthorization(){return this.$info.user&&!_.includes(this.$info.user.github.scopes,"read:org")}get hasTeams(){return _get(this,"designation","allTeams","length")}get chip(){return this.file.reviewChip}get lastRevisionKey(){return _get(this,"file","review","core","lastRevisionKey")}get designation(){return _get(this,"file","review","designatedReviewers","designations",this.file.$key)}get reviewers(){const e=this.file.review.core.lastRevisionKey,t=!this.designation||this.designation.anyone,s=_get(this,"designation","anyone","omitsBaseChanges"),n={neededLines:[],reviewedLines:[],previousReviewers:{}},a=t=>{const s=_get(this,"file","revisions","latestReviewedBy",t.subjectKey),i=_get(s,"fully","effectiveRevisionKey")===e,r=t.omitBaseChanges&&_get(s,"moduloBaseChanges","effectiveRevisionKey")===e,n=!!i||!!r&&"base",a=i?s.fully:r?s.moduloBaseChanges:null,o=_get(a,"draft"),l=n?`Reviewed at ${a.revisionKey}${o?" (draft)":""} by`:"Not yet reviewed by";return{userKey:t.subjectKey,reviewed:n,revisionKey:_get(a,"revisionKey"),prefix:l,suffix:"",draft:o,teamKeys:[]}},o=e=>{let t=!0,s=!1;const r=_(_get(this,"file","revisions","latestReviewedBy")).map((i,r)=>{if(_get(this,"file","review","people",r,"author")&&!e.includeAuthor)return;if(!this.teamMemberships.isMember(r,e.subjectKey))return;const n=a({subjectKey:r,omitBaseChanges:e.omitBaseChanges});if(!n.reviewed)return;t=t&&"base"===n.reviewed,s=s||n.draft;const o=this.$store.users[r].core.public;return{name:(o.displayName||o.username||"(loading name)")+(n.draft?" (draft)":""),revisionKey:n.revisionKey}}).compact().value();r.length||(t=!1);const n=_(r).groupBy("revisionKey").map((e,t)=>`${i(_.map(e,"name"))} at ${t}`).value(),o=1===r.length,l=r.length?`Reviewed by ${r.length} member${o?"":"s"} of`:"Not yet reviewed by members of",c=r.length?`: ${n.join("; ")}`:null,u=(!this.file.review.userIsAuthor||e.includeAuthor)&&this.teamMemberships.isMember(this.$info.userid,e.subjectKey);return{teamKey:e.subjectKey,allBaseReviews:t,prefix:l,suffix:c,userIsMember:u,omitBaseChanges:e.omitBaseChanges,includeAuthor:e.includeAuthor}},l=new Set;_.forEach(_get(this,"designation","lines"),t=>{const s=_.map(t.teams,o),r=_.map(t.users,a),c=_.filter(r,"reviewed");_.forEach(_get(this,"file","revisions","latestReviewedBy"),(t,i)=>{_.forEach(s,s=>
1{if(_get(this,"file","review","people",i,"author")&&!s.includeAuthor)return;if(!this.teamMemberships.isMember(i,s.teamKey))return;const r=s.omitBaseChanges?"moduloBaseChanges":"fully";if(t[r].effectiveRevisionKey!==e)return;let n=_.find(c,{userKey:i});n||(n=a({subjectKey:i,omitBaseChanges:s.omitBaseChanges}),c.push(n)),n.teamKeys.push(s.teamKey)})}),_.forEach(c,e=>{e.teamKeys.length&&(e.suffix+=", member of "+i(_.map(e.teamKeys,e=>e.replace(/^team:/,"")))),l.add(e.userKey),_.forEach(e.teamKeys,e=>{l.add(e)})}),n.reviewedLines.push({scope:t.scope,fulfilled:t.fulfilled,users:c}),t.fulfilled||n.neededLines.push({scope:t.scope,teams:_.reject(s,e=>this.chip.done&&l.has(e.teamKey)),users:_.reject(r,"reviewed")})}),n.reviewedLines.length&&t||n.reviewedLines.push({scope:"",users:[],teams:[]});const c=_.last(n.reviewedLines),u={scope:"ð±ï¸ author",users:[],teams:[]},d=[];if(_.forEach(_get(this,"file","revisions","latestReviewedBy"),(e,t)=>{if(l.has(t))return;const i=a({subjectKey:t,omitBaseChanges:s});i.reviewed?_get(this,"file","review","people",t,"author")&&!_get(this,"designation","anyone","includeAuthor")?u.users.push(i):c.users.push(i):(Vue.set(i,"prefix",`Previously reviewed at ${e.fully.revisionKey} by`),Vue.set(i,"revisionKey",e.fully.revisionKey),d.push(i))}),u.users.length&&n.reviewedLines.push(u),d.length){const e=_(d).map("revisionKey").maxBy(e=>_.parseInt(e.slice(1)));Vue.set(n,"previousReviewers",{mostRecentRevisionKey:e,mostRecent:_.filter(d,{revisionKey:e}),older:_.reject(d,{revisionKey:e})})}return Vue.set(n,"neededLines",_.filter(n.neededLines,e=>e.users.length||e.teams.length)),Vue.set(n,"reviewedLines",_.filter(n.reviewedLines,e=>e.users.length)),_.includes(n.reviewedLines,c)&&(t||(Vue.set(c,"scope","ðï¸ unsolicited"),r(n.neededLines,"requested"),r(n.reviewedLines,"requested")),!c.scope&&n.reviewedLines.length>1&&Vue.set(c,"scope","⯠and also")),Vue.set(n,"neededLines",_.sortBy(n.neededLines,e=>e.scope||"")),Vue.set(n,"reviewedLines",_.sortBy(n.reviewedLines,e=>e.scope||"")),n}get shouldShowTip(){return!this.file.review.designatedReviewers.present&&!_get(s,"settings","dismissals","designatedReviewersTip")}dismissTip(){Vue.set(s.settings,"dismissals",s.settings.dismissals||{}),Vue.set(s.settings.dismissals,"designatedReviewersTip",!0)}}function i(e){if(e)switch(e.length){case 0:return"";case 1:return e[0];case 2:return e.join(" and ");default:return e.slice(0,-1).join(", ")+", and "+e[e.length-1]}}function r(e,t){const s=_.find(e,e=>!e.scope);s&&Vue.set(s,"scope",t)}DesignationDetails.$vueOptions={props:{file:{type:t,required:!0}}};return _declareVue("DesignationDetails",DesignationDetails,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.chip?s("div",{staticClass:"ui segment wrapper"},[e.chip.done?[s("p",[e._v("\n This file has been "),s("i",{staticClass:"designation done icon",class:{green:e.chip.draftDone}}),e._v("\n sufficiently reviewed at\n "+e._s(e.lastRevisionKey)+e._s(e.reviewers.reviewedLines.length?" by:":".")+"\n ")]),s("designation-lines",{attrs:{lines:e.reviewers.reviewedLines}}),e.reviewers.neededLines.length?[e._m(0),s("designation-lines",{attrs:{lines:e.reviewers.neededLines}})]:e._e()]:[s("p",[e._v("\n This file needs to be reviewed at "+e._s(e.lastRevisionKey)+" by\n "),e.chip.youUnreviewed?s("span",{staticClass:"comma-item"},[s("i",{staticClass:"red designation you icon"}
1),e._v(" you")]):e._e(),e.chip.anyone?s("span",{staticClass:"comma-item"},[s("i",{staticClass:"designation anyone icon",class:{red:e.chip.anyoneUnreviewed,green:e.chip.anyoneDraft}}),e._v(" anyone")]):e._e(),e.chip.others||"others"===e.chip.dominantIcon?s("span",{staticClass:"comma-item"},[s("i",{staticClass:"designation others icon",class:{green:e.chip.othersDraft}}),e._v("\n others")]):e._e(),e._v(e._s(e.reviewers.neededLines.length?":":".")+"\n ")]),s("designation-lines",{attrs:{lines:e.reviewers.neededLines}}),e.reviewers.reviewedLines.length?[e._m(1),s("designation-lines",{attrs:{lines:e.reviewers.reviewedLines}})]:e._e()],e.reviewers.previousReviewers.mostRecentRevisionKey?s("p",{staticClass:"previous"},[e._v("\n Most recently, "+e._s(e.reviewers.previousReviewers.mostRecentRevisionKey)+" was\n "+e._s(e.reviewers.reviewedLines.length?"also":"")+" reviewed by\n "),e._l(e.reviewers.previousReviewers.mostRecent,function(t){return s("span",{key:t.userKey,staticClass:"comma-item"},[s("avatar",{class:{you:t.userKey===e.$info.userid},attrs:{"user-key":t.userKey,display:"picture,name,popup",size:"tiny","popup-prefix":t.prefix,"link-to":"profile"}})],1)}),e._v(".\n ")],2):e._e(),_get(e,"reviewers","previousReviewers","older","length")?s("p",{staticClass:"previous"},[e._v("\n And earlier revisions were "+e._s(e.reviewers.reviewedLines.length?"also":"")+" reviewed by\n "),e._l(e.reviewers.previousReviewers.older,function(t){return s("span",{key:t.userKey,staticClass:"comma-item"},[s("avatar",{class:{you:t.userKey===e.$info.userid},attrs:{"user-key":t.userKey,display:"picture,name,popup",size:"tiny","popup-prefix":t.prefix,"link-to":"profile"}})],1)}),e._v(".\n ")],2):e._e(),e.hasTeams&&!this.$info.user?s("div",{staticClass:"ui warning icon message"},[s("i",{staticClass:"warning sign icon"}),s("div",{staticClass:"content"},[e._v("\n You need to\n "),s("ui-button",{staticClass:"tiny green labeled icon",on:{click:function(t){return e.$session.auth.login(null,"optional")}}},[s("i",{staticClass:"github icon",attrs:{alt:"github"}}),e._v(" sign in\n ")]),e._v("\n to resolve team membership.\n ")],1)]):e._e(),e.hasTeams&&e.needsAuthorization?s("div",{staticClass:"ui warning icon message"},[s("i",{staticClass:"warning sign icon"}),s("div",{staticClass:"content"},[e._v("\n You need to\n "),s("ui-button",{staticClass:"tiny green labeled icon",on:{click:function(t){return e.$session.auth.login(["read:org"],"optional")}}},[s("i",{staticClass:"all organizations icon"}),e._v(" authorize access\n ")]),e._v("\n to resolve team membership.\n ")],1)]):e.hasTeam
1s&&e.teamMemberships.error?s("div",{staticClass:"ui warning icon message"},[s("i",{staticClass:"warning sign icon"}),s("div",{staticClass:"content"},[e._v("\n "+e._s(e.teamMemberships.error)+"\n ")])]):e._e(),"others"!==e.chip.dominantIcon||e.chip.others?e._e():s("div",{staticClass:"ui warning icon message"},[s("i",{staticClass:"warning sign icon"}),s("div",{staticClass:"content"},[e._v("\n This file has been reviewed by all its designated reviewers, yet this appears to be\n insufficient. Please "),_get(e,"file","review","verdict","admin")?e._e():s("span",[e._v("ask an admin to")]),e._v("\n double check the repository's custom review completion condition.\n ")])]),s("animate-wipe-down",[e.shouldShowTip?s("div",{staticClass:"ui unobtrusive icon info message"},[s("i",{staticClass:"close icon",on:{click:e.dismissTip}}),s("i",{staticClass:"tip icon"}),s("div",{staticClass:"content"},[e._v("\n Designate specific reviewers via\n "),s("a",{staticClass:"link",attrs:{href:"https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners"}},[s("code",[e._v("CODEOWNERS")])]),s("br"),e._v("or a\n "),s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/admincenter#completion-condition"}},[e._v("custom review completion condition")]),e._v(".\n ")])]):e._e()])],2):e._e()},staticRenderFns:[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("p",[e._v("It was also designated for review but "),s("i",{staticClass:"unreviewed icon"}),e._v("\n not yet reviewed by:")])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("p",[e._v("It has already been "),s("i",{staticClass:"reviewed icon"}),e._v(" reviewed by:")])}],functional:!1},{scopeId:"data-v-5ea3f697"}),{DesignationDetails:DesignationDetails}},!0,!0,{filename:"src/view/reviews/files/designation-details.vue"}),_reviewable.define(["DesignationLine"],["truss"],function(e){"use strict";class DesignationLine{constructor(){}get allUserTeamKeys(){return _.union(..._.map(this.line.users,"teamKeys"))}get userTeamsPrefix(){return 1===_get(this,"line","users","length")?"member of":_.every(this.line.users,e=>_.isEqual(e.teamKeys,this.allUserTeamKeys))?"all members of":"including members of"}}DesignationLine.$vueOptions={props:{line:{type:Object,required:!0}}};return _declareVue("DesignationLine",DesignationLine,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("li",[e.line.scope?s("div",{staticClass:"scope"},[e._v(e._s(e.line.scope)+"\n "),e.line.fulfilled?s("span",{staticClass:"done"},[e._v("(done)")]):e._e()]):e._e(),e._l(e.line.users,function(t){return s("span",{key:t.userKey,staticClass:"comma-item"},[s("avatar",{class:{you:t.userKey===e.$info.userid,draft:t.draft},attrs:{"user-key":t.userKey,display:"picture,name,popup",size:"tiny","link-to":"profile","popup-prefix":t.prefix,"popup-suffix":t.suffix},scopedSlots:e._u([{key:"after",fn:function(){return["base"===t.reviewed?s("span",{staticClass:"base annotation"}):e._e()]},proxy:!0}],null,!0)})],1)}),e.allUserTeamKeys.length?s("span",{staticClass:"teams"},[e._v("\n ("+e._s(e.userTeamsPrefix)+"\n "),e._l(e.allUserTeamKeys,function(e){return s("avatar",{key:e,staticClass:"comma-item",attrs:{"user-key":e,display:"picture,name,popup",size:"tiny","link-to":"profile"}})}),e._v(")\n ")],2):e._e(),e._l(e.line.teams,function(t){return s("span",{key:t.teamKey,staticClass:"comma-item"},[s("avatar",{class:{you:t.userIsMember,draft:t.draft},attrs:{"user-key":t.teamKey,display:"picture,name,popup",size:"tiny","link-to":"profile","popup-prefix":t.prefix,"popup-suffix":t.suffix},scopedSlots:e._u([{key:"after",fn:function(){return[t.allBaseReviews?s("span",{staticClass:"base annotation"}):e._e()]},proxy:!0}],null,!0)})],1)})],2)},staticRenderFns:[],functional:!1},{scopeId:"data-v-3da64240"}),{DesignationLine:DesignationLine}},!0,!0,{filename:"src/view/reviews/files/designation-line.vue"}),_reviewable.define(["DesignationLines"],["truss"],function(e){"use strict";
1class DesignationLines{constructor(){}}DesignationLines.$vueOptions={props:{lines:{type:Array,required:!0}}};return _declareVue("DesignationLines",DesignationLines,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.lines.length?s("ul",e._l(e.lines,function(e){return s("designation-line",{key:e.scope,attrs:{line:e}})}),1):e._e()},staticRenderFns:[],functional:!1},{scopeId:"data-v-5baf5b92"}),{DesignationLines:DesignationLines}},!0,!0,{filename:"src/view/reviews/files/designation-lines.vue"}),_reviewable.define(["DirectoryRow"],["truss"],function(e){"use strict";class DirectoryRow{constructor(){Vue.set(this,"showFullDirectory",!1),Vue.set(this,"baseLeftIndent",47.17)}get paddingLeft(){return 15*this.row.indent+this.baseLeftIndent}get showingRevisions(){return _get(this,"row","group","review","context","shownMatrixColumns","revisions")}get renderedRevisionColumnCount(){return _get(this,"revisionLayout","renderedRevisionColumnCount")||this.row.numCells-3}}DirectoryRow.$vueOptions={props:{row:{required:!0},revisionLayout:{type:Object}}};return _declareVue("DirectoryRow",DirectoryRow,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("tr",{staticClass:"directory row",on:{mouseover:function(t){e.showFullDirectory=!0},mouseout:function(t){e.showFullDirectory=!1}}},[s("td",{staticClass:"directory cell",attrs:{colspan:3}},[s("span",{staticClass:"placeholder text",style:{"padding-left":e.paddingLeft+"px"}},[e._v(e._s(e.row.path))]),s("span",{staticClass:"live text",style:{left:(e.showFullDirectory?e.baseLeftIndent:e.paddingLeft)+"px"}},[s("animate-wipe-right",{attrs:{duration:"*=0.33"}},[e.row.pathPrefix?s("span",{directives:[{name:"show",rawName:"v-show",value:e.showFullDirectory,expression:"showFullDirectory"}],staticClass:"prefix"},[e._v(e._s(e.row.pathPrefix))]):e._e()]),s("span",{staticClass:"suffix"},[e._v(e._s(e.row.path))])],1)]),e.showingRevisions?s("td",{staticClass:"revisions",attrs:{colspan:e.renderedRevisionColumnCount}}):e._e()])},staticRenderFns:[],functional:!1},{scopeId:"data-v-472d117a"}),{DirectoryRow:DirectoryRow}},!0,!0,{filename:"src/view/reviews/files/directory-row.vue"}),_reviewable.define(["EquivalentCommitsMessage"],["truss"],function(e){"use strict";class EquivalentCommitsMessage{constructor(){}}EquivalentCommitsMessage.$vueOptions={props:{rightBoundRevKey:{type:String,required:!0}}};return _declareVue("EquivalentCommitsMessage",EquivalentCommitsMessage,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"special message"},[s("div",{staticClass:"ui icon message"},[s("i",{staticClass:"info circle icon",attrs:{alt:""}}),s("div",{staticClass:"content"},[e._v("\n Commits that don't affect files in this pull request were added to revision\n "+e._s(e.rightBoundRevKey)+" after it was snapshotted.\n ")])])])},staticRenderFns:[],functional:!1},{}),{EquivalentCommitsMessage:EquivalentCommitsMessage}},!0,!0,{filename:"src/view/reviews/files/equivalent-commits-message.vue"}),_reviewable.define(["FileBaseChangeMessage"],["truss"],function(e){"use strict";class FileBaseChangeMessage{constructor(){}diffBase(){this.diff.$parent.setBounds([null,this.diff.$parent.bounds[1]])}}FileBaseChangeMessage.$vueOptions={props:{diff:{type:Object,required:!0}}};return _declareVue("FileBaseChangeMessage",FileBaseChangeMessage,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"special message"},[s("div",{staticClass:"ui icon message"},[s("span",{staticClass:"icon spacer"},[s("span",{staticClass:"base changes",class:e.diff.baseChange},[s("span",{staticClass:"symbol"},[e._v("â¥")])])]),s("div",{staticClass:"content text-grey"},[s("span",[s("span",[e._v("\n The file's base changed between "+e._s(_get(e,"diff","$parent","bounds",0,"$key"))+" and\n "+e._s(_get(e,"diff","$parent","bounds",1,"$key"))+",\n ")]),"only"===e.diff.baseChange?s("span",[e._v("\n which accounts for all the changes in this diff.\n ")]):"missing"===e.diff.baseChange?s("span",[e._v("\n but some changes may not have been integrated and are not visible in this diff.\n "),s("ui-button",{staticClass:"small basic circular",on:{click:e.diffBase}},[e._v("\n Diff "+e._s(_get(e,"diff","$parent","bounds",1,"$key"))+" against base\n ")])],1):"mixed"===e.diff.baseChange?s("span",[e._v("\n and those changes are reflected in this diff along with extra edits.\
1n ")]):e._e()])])])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-6b08edd3"}),{FileBaseChangeMessage:FileBaseChangeMessage}},!0,!0,{filename:"src/view/reviews/files/file-base-change-message.vue"}),_reviewable.define(["FileBottomButton"],["truss"],function(e){"use strict";class FileBottomButton{constructor(){}handleClick(e){_access(this,"","review","","state","","isLocked","call",[])||this.$emit("click",e)}}FileBottomButton.$vueOptions={props:{review:{type:Object,required:!0}}};return _declareVue("FileBottomButton",FileBottomButton,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"wrapper center-text"},[s("span",{staticClass:"ui file bottom basic button",class:{disabled:_access(e,"","review","","state","","isLocked","call",[])},on:{click:e.handleClick}},[e._t("default")],2)])},staticRenderFns:[],functional:!1},{scopeId:"data-v-a8c0d32c"}),{FileBottomButton:FileBottomButton}},!0,!0,{filename:"src/view/reviews/files/file-bottom-button.vue"}),_reviewable.define(["FileConflictMarkersMessage"],["truss"],function(e){"use strict";class FileConflictMarkersMessage{}return _declareVue("FileConflictMarkersMessage",FileConflictMarkersMessage,null,{render:function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},staticRenderFns:[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"special message"},[s("div",{staticClass:"ui icon message"},[s("i",{staticClass:"red warning sign icon"}),s("div",{staticClass:"content text-grey"},[e._v("\n An unresolved merge conflict was introduced in this diff.\n ")])])])}],functional:!1},{}),{FileConflictMarkersMessage:FileConflictMarkersMessage}},!0,!0,{filename:"src/view/reviews/files/file-conflict-markers-message.vue"}),_reviewable.define(["FileGroupRow"],["truss","Guide","FilesGroup"],function(e,t,s){"use strict";class FileGroupRow{constructor(){}get autoGrouped(){return/^(âº|â¤|â¥|⤥)/.test(this.group.name)}get chip(){return this.group.reviewChip}get lastRevisionKey(){return _get(this,"group","review","core","lastRevisionKey")}get showingRevisions(){return _get(this,"group","review","context","shownMatrixColumns","revisions")}get renderedNumCells(){return this.showingRevisions?3+(_get(this,"revisionLayout","renderedRevisionColumnCount")||this.group.numCells-3):this.group.numCells}ungroup(){Vue.set(this.group.review.context.autoUngrouped,this.group.name,!0)}}FileGroupRow.$vueOptions={props:{group:{type:s,required:!0},revisionLayout:{type:Object}}};return _declareVue("FileGroupRow",FileGroupRow,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("tr",{staticClass:"group row separator",class:{"showing revisions":e.showingRevisions}},[s("td",{staticClass:"group cell",attrs:{colspan:e.renderedNumCells}},[s("toggle-review-mark-button",{staticClass:"group toggle",class:{hidden:!e.group.collapsed},attrs:{"review-mark-style":e.group.reviewMarkStyle,"review-level":e.group.reviewLevel},on:{click:function(t){return e.group.toggleReviewed()}}}),s("span",{staticClass:"collapse toggle",on:{click:function(t){return e.group.toggleCollapsed()}}},[s("i",{staticClass:"group icon",class:e.group.collapsed?"closed":"open"}),s("span",{staticClass:"title"},[e._v(e._s(e.group.name))])]),e.group.collapsed?s("span",[e._v(" ("),s("span",{staticClass:"chip summary dropdown-toggle"},[s("i",{staticClass:"designation icon",class:_get(e,"chip","dominantIcon")}),e._v("\n "+e._s(e.group.diffsDescription)+"\n "),s("tippy-dropdown",[s("div",{staticClass:"ui chip details segment"},[_get(e,"chip","allDone")||_get(e,"chip","allDraftDone")?s("span",[e._v("\n All files in this group have been\n "),s("i",{staticClass:"designation done icon",class:{green:_get(e,"chip","allDraftDone")}}),e._v("\n sufficiently reviewed at "+e._s(e.lastRevisionKey)+".\n ")]):s("span",[e._v("\n "+e._s(_get(e,"chip","someDone")?"Some":"All")+" files in this group need to be reviewed by\n "),e.chip.youUnreviewed?s("span",{staticClass:"list item"},[s("i",{staticClass:"red designation you icon"}
1),e._v(" you")]):e._e(),e.chip.anyone?s("span",{staticClass:"list item"},[s("i",{staticClass:"designation anyone icon",class:{red:e.chip.anyoneUnreviewed}}),e._v("\n anyone")]):e._e(),e.chip.others||"others"===e.chip.dominantIcon?s("span",{staticClass:"list item"},[s("i",{staticClass:"designation others icon"}),e._v("\n others")]):e._e(),e._v("\n at "+e._s(e.lastRevisionKey)+".\n ")])])])],1),e._v(")")]):e.autoGrouped?s("span",[e._v("\n  \n "),s("span",{staticClass:"ungroup"},[s("a",{staticClass:"unobtrusive link",on:{click:e.ungroup}},[e._v("ungroup")])])]):e._e()],1)])},staticRenderFns:[],functional:!1},{scopeId:"data-v-4978a9fe"}),_declareGuides("FileGroupRow","data-v-4978a9fe",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".collapse.toggle[data-v-4978a9fe]",onboarding:"collapsedFileGroup",highlight:"under",position:"left"}},[s("p",[e._v("\n A "),s("em",[e._v("group of files")]),e._v(" determined by the repository's\n "),s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/admincenter#condition-output"}},[e._v("custom review completion condition")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n You can "),s("em",[e._v("collapse")]),e._v(" the group to hide it from the file matrix and get the option to\n "),s("em",[e._v("mark all member files reviewed")]),e._v(" at the same time.\n ")])]),e._v(" "),s("guide",{attrs:{for:".ungroup[data-v-4978a9fe]",onboarding:"ungroupedAutoGroup",highlight:"under",position:"right"}},[s("p",[s("em",[e._v("Break up")]),e._v(" this "),s("em",[e._v("automatically formed group")]),e._v(" of files, putting them back into\n their original groups or the main file list.\n ")]),e._v(" "),s("p",[e._v("\n Reloading the page will automatically regroup.\n ")])])],1)},[]),{FileGroupRow:FileGroupRow}},!0,!0,{filename:"src/view/reviews/files/file-group-row.vue"}),_reviewable.define(["FileHeader"],["truss","Guide","File"],function(e,t,s){"use strict";class FileHeader{constructor(){}get lastShowingDiff(){return _get(this,"file","diff","lastShowing")}}FileHeader.$vueOptions={props:{file:{type:s,required:!0}}};return _declareVue("FileHeader",FileHeader,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("div",{staticClass:"table wrapper"},[s("table",{staticClass:"ui celled collapsing unstackable single files table"},[s("tbody",[s("file-revisions-row",{staticClass:"header row",attrs:{file:e.file,location:"header"}})],1)])]),s("div",{staticClass:"stats-wrapper"},[s("animate-wipe-right",[_get(e,"lastShowingDiff","lineStats","totalDelta")||_get(e,"lastShowingDiff","size","totalDelta")?s("line-stats",{staticClass:"stats",attrs:{stats:_get(e,"lastShowingDiff","lineStats"),size:_get(e,"lastShowingDiff","size")}}):e._e()],1),s("animate-wipe-right",[s("commits-list",{attrs:{file:e.file}})],1),s("animate-wipe-right",[_get(e,"lastShowingDiff","rightCoverage")?s("coverage-stats",{staticClass:"stats",attrs:{"left-coverage":_get(e,"lastShowingDiff","leftCoverage"),"right-coverage":_get(e,"lastShowingDiff","rightCoverage"),full:!0}}):e._e()],1)],1)])},staticRenderFns:[],functional:!1},{scopeId:"data-v-7d8bc700"}),_declareGuides("FileHeader","data-v-7d8bc700",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".filename.cell[data-v-7d8bc700] .path-area",onboarding:"clickedOnFilename",highlight:"under",position:"left"}},[s("p",[e._v("\n The path of the "),s("em",[e._v("file diffed below")]),e._v(". If parts of the path are elided with â¦,\n hover or swipe to reveal the full path.\n ")]),e._v(" "),s("p",[s("span",[s("em",[e._v("Virtual files:")])]),s("br"),e._v(" "),s("span",[s("i",{staticClass:"commit icon"}),e._v(" "),s("strong",[e._v("Commits")]),e._v(": generated by Reviewable for reviewing commit messages.\n ")])]),e._v(" "),s("p",[e._v("\n Clicking the path "),s("em",[e._v("reveals an action menu")]),e._v(" with options to copy the file path,\n open the file in a new tab, view or edit it in G
1itHub, or open in an external editor.\n ")])]),e._v(" "),s("guide",{attrs:{for:".prior.arcs[data-v-7d8bc700]",onboarding:"sawPriorArcs",highlight:"under",position:"top"}},[s("p",[e._v("\n These lines "),s("em",[e._v("connect rebased revisions")]),e._v(" that Reviewable tries to match up using the\n old and new commits' messages.\n ")]),e._v(" "),s("p",[e._v('\n When the review mode is set to "review each commit separately", Reviewable will pair them up\n for diffs.\n ')])])],1)},[]),{FileHeader:FileHeader}},!0,!0,{filename:"src/view/reviews/files/file-header.vue"}),_reviewable.define(["FileMarginNotch"],["truss","Guide","File","session"],function(e,t,s,i){"use strict";class FileMarginNotch{constructor(){Vue.set(this,"ruler",this.$store.services.ruler),Vue.set(this,"margin",i.settings.margin||this.ruler.margin||80),Vue.set(this,"inputSourceIsArrow",!1),Vue.set(this,"debouncedSetMargin",void 0),Vue.set(this,"autoOff",!1)}created(){Vue.set(this,"debouncedSetMargin",_.debounce(e=>{this.setMargin(e)},500)),this.$observe(()=>this.ruler.margin,(e,t)=>{_.isNil(e)||_.toNumber(e)===_.toNumber(t)||Vue.set(this,"margin",this.ruler.margin)})}handleKeyPress(e){this.ruler.auto&&Vue.set(this,"autoOff",!0),"ArrowUp"!==e.key&&"ArrowDown"!==e.key||this.debouncedSetMargin()}setMargin(e){const t=_.isNumber(e)?e:_get(this,"$refs","marginCounter","value"),s=this.ruler.clampMarginSetting(_.toNumber(t));s&&Vue.set(this.ruler,"margin",Vue.set(this,"margin",s))}toggleAuto(){this.ruler.auto?Vue.set(i.settings,"margin",this.margin):(Vue.set(this,"autoOff",!1),Vue.set(i.onboarding,"manipulatedMargin",!0),Vue.set(this.ruler,"margin",null),this.$nextTick().then(()=>{Vue.set(this,"margin",this.ruler.margin)}))}toggleSingleColumn(){Vue.set(i.onboarding,"manipulatedMargin",!0),Vue.set(this.ruler,"singleColumn",!this.ruler.singleColumn)}}FileMarginNotch.$vueOptions={props:{file:{type:s,required:!0}}};return _declareVue("FileMarginNotch",FileMarginNotch,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"notch root"},[s("i",{staticClass:"large dropdown icon",attrs:{alt:"margin notch"}}),s("tippy-dropdown",{attrs:{options:{placement:"bottom"}}},[s("div",{staticClass:"popup group"},[s("div",{staticClass:"ui basic auto button",class:{active:e.ruler.singleColumn},on:{click:e.toggleSingleColumn}},[e._v("\n single\n ")]),s("div",{staticClass:"ui basic auto button",class:{active:e.ruler.auto&&!e.autoOff},on:{click:e.toggleAuto}},[e._v("\n auto\n ")]),s("input",{directives:[{name:"model",rawName:"v-model",value:e.margin,expression:"margin"}],ref:"marginCounter",staticClass:"margin counter",class:{auto:e.ruler.auto},attrs:{type:"number"},domProps:{value:e.margin},on:{keyup:[e.handleKeyPress,function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.setMargin.apply(null,arguments)}],blur:e.setMargin,input:function(t){t.target.composing||(e.margin=t.target.value)}}})])])],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-59abb2d0"}),_declareGuides("FileMarginNotch","data-v-59abb2d0",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{staticClass:"notch guide",attrs:{for:".notch.root[data-v-59abb2d0]",onboarding:"manipulatedMargin"}},[s("p",[e._v("\n Enter a value between 70-200 or use the arrow keys\n to set the "),s("em",[e._v("maximum line length")]),e._v(",\n and hence the width of the diff.\n Any code that runs past this margin will "),s("em",[e._v("wrap to the next line")]),e._v("\n and get marked with a vertical bar.\n ")]),e._v(" "),s("div",[e._v("There are also two override toggles available in a hover menu:")]),e._v(" "),s("dl",{staticClass:"wide-55"},[s("dt",[s("span",{staticClass:"ui tiny basic dummy auto button"},[e._v("auto")])]),e._v(" "),s("dd",[e._v("Set "),s("em",[e._v("automatic line lengths")]),e._v(" based on window width.")]),e._v(" "),s("dt",[s("span",{staticClass:"ui tiny basic dummy auto button"},[e._v("single")])]),e._v(" "),s("dd",[e._v("Use the single column "),s("em",[e._v("unified diff")]),e._v(" mode,\n even if two columns would fit in the window.")
1])]),e._v(" "),s("p",[e._v("\n Settings apply to all "),s("em",[e._v("all files in all reviews")]),e._v(".\n ")])])],1)},[]),{FileMarginNotch:FileMarginNotch}},!0,!0,{filename:"src/view/reviews/files/file-margin-notch.vue"}),_reviewable.define(["FileMatrixBody"],["truss"],function(e){"use strict";class FileMatrixBody{constructor(){}isRowVisible(e){return!!e&&("group"===e.type||!(e.group&&e.group.collapsed))}}FileMatrixBody.$vueOptions={props:{rows:{required:!0},visible:{type:Boolean},revisionLayout:{type:Object}}};return _declareVue("FileMatrixBody",FileMatrixBody,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("progressive-render-list",{tag:"tbody",attrs:{items:e.rows,visible:e.visible,batch:1,isRowVisible:e.isRowVisible},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return["file"!==i.type||i.group.collapsed?"directory"!==i.type||i.group.collapsed?"group"===i.type?s("file-group-row",{key:i.$key,attrs:{group:i.group,revisionLayout:e.revisionLayout}}):"spacer"===i.type?s("tr",{key:i.$key,staticClass:"spacer row"}):e._e():s("directory-row",{key:i.$key,class:{striped:i.striped},attrs:{row:i,revisionLayout:e.revisionLayout}}):s("file-revisions-row",{key:i.$key,class:{striped:i.striped},attrs:{row:i,file:i.file,revisionLayout:e.revisionLayout}})]}}])})},staticRenderFns:[],functional:!1},{scopeId:"data-v-cff1fb64"}),{FileMatrixBody:FileMatrixBody}},!0,!0,{filename:"src/view/reviews/files/file-matrix-body.vue"}),_reviewable.define(["FileMatrixHeader"],["truss","Guide","modifiers","session","Review","dom"],function(e,t,s,i,r,n){"use strict";class FileMatrixHeader{constructor(){Vue.set(this,"selecting",!1),Vue.set(this,"anchorRev",void 0),Vue.set(this,"lastAnchorCache",void 0),Vue.set(this,"lastAnyAnchorCache",void 0),Vue.set(this,"lastRev",void 0)}get shouldShowRevisions(){return _get(this,"review","context","shownMatrixColumns","revisions")}get shouldShowReviewerAvatars(){return _get(this,"review","context","shownMatrixColumns","reviewerAvatars")}get visibleRevisions(){const e=_get(this,"revisionLayout","visibleRevisionKeys");return _(_.isEmpty(e)?_get(this,"review","revisions","keysList"):e).map(e=>_get(this,"review","revisions",e)).compact().value()}get showEllipsis(){return!!_get(this,"revisionLayout","showEllipsis")}get filesDescription(){const e=_get(this,"review","files","showingList","length");return`${e} file${1===e?"":"s"}`}get markReviewedButton(){const e=this.review.files.markReviewedSpec,t=_get(e,"available")||!_get(e,"undoAvailable"),s=_get(e,"reviewMarkStyle"),i=`${s}ed`;return{enabled:_get(e,"available")||_get(e,"undoAvailable"),text:_get(e,"available")?`Mark ${this.filesDescription} as ${i} @ ${e.revKey}`:_get(e,"undoAvailable")?`Undo mark as ${i}`:this.filesDescription,tooltip:_get(e,"available")?null:_get(e,"explanation"),action:t?"markAllReviewed":"undoMarkAllReviewed",icon:t?"unreviewed":"undo",color:_get(e,"available")?"red":"",reviewMarkStyle:t?s:"review"}}activateMarkReviewedButton(){this.markReviewedButton.enabled&&this.review.files[this.markReviewedButton.action]()}openOverlay(){this.review.context.navigation.overlayPanel("fileMatrix")}get gitHubIconOn(){return!s.combinationMod&&s.altOrShift}get externalEditorIconOn(){return s.combinationMod}get newTabIconOn(){return!s.combinationMod&&s.metaOrCtrl}routeUserClick(){if(this.externalEditorIconOn&&!_.some(this.review.files.showingList,"editorLinkUrl"))return void this.$store.services.header.toggleHeaderAndAccountSettings();const e=this.gitHubIconOn?e=>e.system?null:e.githubLinkUrl:this.externalEditorIconOn?e=>e.system?null:e.editorLinkUrl:this.newTabIconOn?e=>e.uri:null;e&&(Vue.set(i.onboarding,"openedAllFilesInNewTabs",!0),_.forEach(this.review.files.showingList,t=>{const s=e(t);s&&window.open(s)}))}_mapRev(e,t){let s;return"last"===t?(t=this.lastAnchorCache[e.$key])||(s=e.revisions.lastReviewedByUser,Vue.set(this.lastAnchorCache,e.$key,t=s&&this.review.revisions[s.$key]||null)):"last-any"===t?(t=this.lastAnyAnchorCache[e.$key])||(s=e.revisions.lastReviewed,Vue.set(this.lastAnyAnchorCache,e.$key,t=s&&this.review.revisions[s.$key]||null)):"last"!==this.anchorRev&&"last-any"!==this.anchorRev||t||(s=e.revisions.nearest[this.review.core.lastRevisionKey],t=s&&this.review.revisions[s.$key]||null),t}_getRevForEvent(e){if(!this.review.revisions||!this.review.files)return;let t;if(/touch/.test(e.type)){const s=e.touches[0];t=document.elementFromPoint(s.clientX,s.clientY)}else t=e.target;let s=_access(n.findClosestElement(t,"th"),"","getAttribute","call",["data-rev-key"]);if(s||(s=_access(n,"","findClosestElement","call",[t,".last.reviewed.revision"],"","getAttribute","call",["data-rev-key"])),s)switch(s){case"base":return null;case"last":case"last-any":case"ellipsis":return s;default:return this.review.revisions[s]}}start(e){if("mousedown"===e.type&&1!==e.which||"touchstart"===e.type&&e.touches.length>1)return;const t=this._getRevForEvent(e);void 0===t||"ellipsis"===t||"last"===t&&!this.$info.userid||(Vue.set(this,"selecting",!0),Vue.set(this,"anchorRev",t),Vue.set(this,"lastAnchorCache",{}),Vue.set(this,"lastAnyAnchorCache",{}),Vue.set(this,"lastRev",t),_.forEach(_get(this,"review","files","list"),e=>{if(!e.diff)return;let s=this._mapRev(e,t),i=this._mapRev(e);e.isCollapsedAndTrivial(_get(i,"$key"))&&(s=i=void 0),e.diff.selectBounds(s,i,"last"===this.anchorRev||"last-any"===this.anchorRev,!0)}),document.addEventListener("mouseup",this._cleanup),document.addEventListener("touchend",this._cleanup),document.addEventListener("mousemove",this._move),document.addEventListener("touchmove",this._move),Vue.set(i.onboarding,"usedFileMatrixHeader",!0))}end(e){"mousedown"===e.type&&1!==e.which||"touchend"===e.type&&e.touches.length||!this.selecting||_.forEach(_get(this,"review","files","list"),e=>{e.diff&&e.diff.commitBounds(!0)})}_move(e){let t=this._getRevForEvent(e);
1if("ellipsis"!==t&&t!==this.lastRev)if(Vue.set(this,"lastRev",t),void 0===t&&this.selecting)Vue.set(this,"selecting",!1),_.forEach(_get(this,"review","files","list"),e=>{e.diff&&Vue.set(e.diff,"selecting",void 0)});else if(void 0!==t){if(this.selecting||Vue.set(this,"selecting",!0),"last"===t&&!this.$info.userid)return;this.anchorRev!==t||"last"!==t&&"last-any"!==t||(t=null),_.forEach(_get(this,"review","files","list"),e=>{if(!e.diff)return;let s=this._mapRev(e,this.anchorRev),i=this._mapRev(e,t);e.isCollapsedAndTrivial(_get(i,"$key"))&&(s=i=void 0),e.diff.selectBounds(s,i,"last"===this.anchorRev||"last-any"===this.anchorRev)})}}_cleanup(){document.removeEventListener("mouseup",this._cleanup),document.removeEventListener("touchend",this._cleanup),document.removeEventListener("mousemove",this._move),document.removeEventListener("touchmove",this._move),Vue.set(this,"selecting",!1),Vue.set(this,"anchorRev",null),Vue.set(this,"lastAnchorCache",{}),Vue.set(this,"lastAnyAnchorCache",{}),_.forEach(_get(this,"review","files","list"),e=>{e.diff&&Vue.set(e.diff,"selecting",void 0)})}}FileMatrixHeader.$vueOptions={props:{review:{type:r,required:!0},revisionLayout:{type:Object},sidebarInline:Boolean}};return _declareVue("FileMatrixHeader",FileMatrixHeader,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("tr",{staticClass:"matrix header separator",class:{selecting:e.selecting,"showing revisions":e.shouldShowRevisions,"sidebar-inline":e.sidebarInline},on:{mousedown:e.start,touchstart:e.start,mouseup:e.end,touchend:e.end}},[s("th",{staticClass:"relative",attrs:{colspan:"3"}},[s("div",{staticClass:"last reviewed revision",class:{disabled:!e.$info.userid,hidden:!e.shouldShowRevisions},attrs:{"data-rev-key":"last"}},[s("i",{staticClass:"cell reviewed icon",class:{disabled:!e.$info.userid},attrs:{alt:"last reviewed by you"}})]),s("div",{staticClass:"last reviewed anyone revision",class:{hidden:!(e.shouldShowRevisions&&e.shouldShowReviewerAvatars)},attrs:{"data-rev-key":"last-any"}},[s("i",{staticClass:"cell participants on icon",attrs:{alt:"last reviewed by anyone"}})]),s("span",{directives:[{name:"tooltip",rawName:"v-tooltip.html",value:e.markReviewedButton.tooltip,expression:"markReviewedButton.tooltip",modifiers:{html:!0}}],staticClass:"review toggle wrapper",class:{accessible:e.review.userIsReviewer||e.review.userIsAuthor}},[s("ui-button",{staticClass:"circular basic relative review toggle outline icon",class:e.markReviewedButton.color,attrs:{disabled:!e.markReviewedButton.enabled},on:{click:e.activateMarkReviewedButton}},["self-review"===e.markReviewedButton.reviewMarkStyle?s("span",{staticClass:"self-review disc"}):e._e(),s("i",{staticClass:"icon",class:e.markReviewedButton.icon})])],1),e.markReviewedButton.text!==e.filesDescription?s("span",{staticClass:"hover text"},[e._v(e._s(e.markReviewedButton.text))]):e._e(),s("span",{staticClass:"idle text"},[s("a",{staticClass:"files description",class:{link:e.newTabIconOn||e.gitHubIconOn||e.externalEditorIconOn},on:{click:e.routeUserClick}},[e._v(e._s(e.filesDescription))]),s("span",{staticClass:"icon-wrapper"},[s("i",{staticClass:"icon",class:{external:e.newTabIconOn,github:e.gitHubIconOn,editor:e.externalEditorIconOn}})])])]),e.shouldShowRevisions?[e._m(0),e.showEllipsis?s("th",{staticClass:"ellipsis",attrs:{"data-rev-key":"ellipsis"},on:{click:function(t){return t.stopPropagation(),e.openOverlay.apply(null,arguments)}}},[s("div",{staticClass:"revision ellipsis",attrs:{alt:"truncated revisions"}},[e._v("â¦")])]):e._e(),e._l(e.visibleRevisions,function(t){return s("th",{key:t.$key,attrs:{"data-rev-key":t.$key}},[s("div",{staticClass:"relative revision",class:{uncaptured:!(t.capturerKey||t.softCapturerKey),obsolete:t.obsolete}},[s("span",[e._v(e._s(t.$key))])])])})]:e._e()],2)},staticRenderFns:[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("th",{attrs:{"data-rev-key":"base"}},[s("div",{staticClass:"revision",attrs:{alt:"base"}},[e._v("â¥")])])}],functional:!1},{scopeId:"data-v-25d89bb6"}),_declareGuides("FileMatrixHeader","data-v-25d89bb6",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".matrix.header[data-v-25d89bb6]",group:"[data-rev-key][data-v-25d89bb6]",onboarding:"usedFileMatrixHeader",highlight:"under",position:"top"}},[s("p",[e._v("\n The file matrix header lists "),s("em",[e._v("all the revisions")]),e._v(" of the review's files. You can\n "),s("em",[e._v("drag")]),e._v(" and click here to "),s("em",[e._v("set the diff bounds for all the files")]),e._v(" at once.\n ")]),e._v(" "),s("div",[e._v("\n Each revision consists of one or more commits and is "),s("em",[e._v("immutable")]),e._v(" (even if the branch\n is rebased). There are also two virtual revisions:\n ")]),e._v(" "),s("dl",[s("dt",[s("i",{staticClass:"participants on icon"})]),s("dd",[e._v("Selects the "),s("em",[e._v("last revision reviewed by\n anyone")]),e._v(" for each file as the left diff bound, or the ⥠base revision if not reviewed\n yet.")]),e._v(" "),s("dt",[s("i",{staticClass:"cell reviewed icon"})]),s("dd",[e._v("Selects the "),s("em",[e._v("last revision you reviewed")]),e._v("\n for each file as the left diff bound, or the ⥠base revision if not reviewed yet.")]),e._v(" "),s("dt",[e._v("â¥")]),s("dd",[e._v("The "),s("em",[e._v("base version")]),e._v(" for a file in the pull request's target branch.\n This may depend on the right diff bound if the pull request was rebased at some point.")]),e._v(" "),s("dt",[s("span",{staticStyle:{display:"flex","line-height":"1"}},[e._v("â¦")])]),s("dd",[e._v("Some revisions\n are "),s("em",[e._v(" hidden to fit the sidebar")]),e._v(". Click to open the full file matrix overlay with all\n revisions visible.")])]),e._v(" "),s("p",[e._v("\n Ital
1icized revisions (e.g., "),s("i",[e._v("r1")]),e._v(") are "),s("em",[e._v("provisional")]),e._v(" and still subject to change by\n the author. Crossed out revisions (e.g., "),s("strike",[e._v("r1")]),e._v(") are "),s("em",[e._v("outdated")]),e._v(" and no\n longer part of the pull request.\n ")],1)]),e._v(" "),s("guide",{attrs:{for:".review.toggle.wrapper[data-v-25d89bb6]",onboarding:"markedAllReviewed"}},[s("p",[s("em",[e._v("Mark all files as reviewed")]),e._v(" up to the revision you're currently reviewing. This only\n works if all files have the same right diff bound and any unreviewed revisions are included.\n ")]),e._v(" "),s("p",[e._v("\n If you recently clicked this button then it lets you "),s("em",[e._v("undo the review marks")]),e._v(" instead.\n ")])]),e._v(" "),s("guide",{attrs:{for:".idle.text a[data-v-25d89bb6]",highlight:"under",onboarding:"openedAllFilesInNewTabs"}},[s("p",[e._v("\n The total "),s("em",[e._v("number of files")]),e._v(" in the file matrix, including inside collapsed groups.\n ")]),e._v(" "),s("p",[e._v("\n If you're holding down a modifier key, then this becomes a link that:\n ")]),e._v(" "),s("table",{staticClass:"hotkeys"},[s("tbody",[s("tr",[s("td",[s("span",{staticClass:"cfp-hotkeys-key"},[e._v(e._s(e.config.mac?"â":"ctrl"))]),e._v(" "),s("i",{staticClass:"mouse icon"})]),e._v(" "),s("td",[e._v("Open all files "),s("em",[e._v("in a new tab")]),e._v(".")])]),e._v(" "),s("tr",[s("td",[s("span",{staticClass:"cfp-hotkeys-key"},[e._v(e._s(e.config.mac?"â¥":"alt"))]),e._v(" "),s("i",{staticClass:"mouse icon"})]),e._v(" "),s("td",[e._v("Open all files at the latest revision's commit "),s("em",[e._v("in GitHub in a new tab")]),e._v(".")])]),e._v(" "),s("tr",[s("td",[s("span",{staticClass:"cfp-hotkeys-key"},[e._v("â§")]),e._v(" "),s("i",{staticClass:"mouse icon"})]),e._v(" "),s("td",[e._v("Open all files "),s("em",[e._v("in GitHub in a new window")]),e._v(".")])]),e._v(" "),s("tr",[s("td",[s("div",[s("span",{staticClass:"cfp-hotkeys-key"},[e._v("\n "+e._s(e.config.mac?"â":"ctrl")+"\n ")]),e._v(" "),s("span",{staticClass:"cfp-hotkeys-key"},[e._v("\n "+e._s(e.config.mac?"â¥":"alt")+"\n ")]),e._v(" "),s("i",{staticClass:"mouse icon"})]),e._v("\n or\n "),s("div",[s("span",{staticClass:"cfp-hotkeys-key"},[e._v("\n "+e._s(e.config.mac?"â":"ctrl")+"\n ")]),e._v(" "),s("span",{staticClass:"cfp-hotkeys-key"},[e._v("â§")]),e._v(" "),s("i",{staticClass:"mouse icon"})])]),e._v(" "),s("td",[e._v("Open all files "),s("em",[e._v("in an exernal editor")]),e._v(".")])])])])])],1)},[]),{FileMatrixHeader:FileMatrixHeader}},!0,!0,{filename:"src/view/reviews/files/file-matrix-header.vue"}),_reviewable.define(["FileMatrixVisualTweaks"],["truss","Guide"],function(e,t){"use strict";class FileMatrixVisualTweaks{constructor(){}get settingsDisabled(){return this.overlaid&&this.$session.settings.showFullMatrixInOverlay}}FileMatrixVisualTweaks.$vueOptions={props:{review:{type:Object,required:!0},overlaid:{type:Boolean}}};return _declareVue("FileMatrixVisualTweaks",FileMatrixVisualTweaks,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"matrix visual tweaks"},[e.$session.onboarding.sawMatrixColumnSettings?e._e():s("span",{staticClass:"unobtrusive"},[e._v("\n adjust what's shown in the file matrix here "),s("i",{staticClass:"icon forward"})]),s("span",{staticClass:"dropdown anchor"},[s("i",{staticClass:"icon matrix columns ui bare icon button dropdown-target"}),s("tippy-dropdown",{attrs:{options:{bypassCloseOnClick:!0}}},[s("div",{staticClass:"ui vertical secondary settings menu"},[s("div",{staticClass:"header item"},[e._v("Show:")]),s("inline-icon-checkbox",{staticClass:"item reviewer",attrs:{"icon-class":"participants",disabled:!e.review.files.reviewerKeys.length||e.settingsDisabled},model:{value:e.$session.settings.showReviewerAvatars,callback:function(t){e.$set(e.$session.settings,"showReviewerAvatars",t)},expression:"$session.settings.showReviewerAvatars"}},[e._v("\n reviewers\n ")]),s("inline-icon-checkbox",{staticClass:"item file state",attrs:{"icon-class":"designation you",disabled:e.settingsDisabled},model:{value:e.$session.settings.showFileStateChips,callback:function(t){e.$set(e.$session.settings,"showFileStateChips",t)},expression:"$session.settings.showFileStateChips"}},[e._v("\n file state boxes\n ")]),s("inline-icon-checkbox",{staticClass:"item revisions",attrs:{"icon-class":"revisions",disabled:e.settingsDisabled},model:{value:e.$session.settings.showMatrixRevisions,callback:function(t){e.$set(e.$session.settings,"showMatrixRevisions",t)},expression:"$session.settings.showMatrixRevisions"}},[e._v("\n revisions\n ")]),s("inline-icon-checkbox",{staticClass:"item stats",attrs:{"icon-class":"stats",disabled:e.settingsDisabled},model:{value:e.$session.settings.showDiffStats,callback:function(t){e.$set(e.$session.settings,"showDiffStats",t)},expression:"$session.settings.showDiffStats"}},[e._v("\n diff stats\n ")]),s("inline-icon-checkbox",{staticClass:"item commits list",attrs:{"icon-class":"commits list",disabled:e.settingsDisabled},model:{value:e.$session.settings.showCommitsList,callback:function(t){e.$set(e.$session.settings,"showCommitsList",t)},expression:"$session.settings.showCommitsList"}},[e._v("\n commits list\n ")]),s("inline-icon-checkbox",{staticClass:"item coverage",attrs:{"icon-class":"coverage",disabled:e.settingsDisabled||!_get(e,"review","context","codeCoverage","reporting")},model:{value:e.$session.settings.showCodeCoverage,callback:function(t){e.$set(e.$session.settings,"showCodeCoverage",t)},expression:"$session.settings.showCodeCoverage"}},[e._v("\n code coverage\n ")]),s("inline-icon-checkbox",{staticClass:"item overlay",attrs:{"icon-class":"overlay"},model:{value:e.$session.settings.showFullMatrixInOverlay,callback:function(t){e.$set(e.$session.settings,"showFullMatrixInOverlay",t)},expression:"$session.settings.showFullMatrixInOverlay"}},[e._v("\n all in overlay\n ")])],1)])],1)])},staticRenderFns:[],functional:!1},{scopeId:"data-v-6d6b4b3e"}),_declareGuides("FileMatrixVisualTweaks","data-v-6d6b4b3e",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".matrix.visual.tweaks[data-v-6d6b4b3e]",onboarding:"sawMatrixColumnSettings"}},[s("p",[s("em",[e._v("Customize which columns to show in the file matrix")]),e._v(",\n and optionally override these in the modal overlay.\n ")])])],1)},[]),{FileMatrixVisualTweaks:FileMatrixVisualTweaks}},!0,!0,{filename:"src/view/reviews/files/file-matrix-visual-tweaks.vue"}),_reviewable.define(["FileMatrix"],["truss","Guide","Review","dom","mangler"],function(e,t,s,i,r){"use strict";const n=32;function a(e,t){return e?_.filter(e.querySelectorAll(t),e=>i.isElementVisible(e)):[]}function o(e,t){return _(e).map(e=>t+u(_access(e,"","closest","call",[".path-area"],"","style","","paddingLeft"))+i.measureElementTextWidth(function(e){const t=e.lastIndexOf("."),s=t>0,i=s?e.slice(0,t):e,n=r.splitTextIntoGraphemes(i);return n.length<12?e:n.slice(0,4).join("")+"â¦"+n.slice(-4).join("")+(s?e.slice(t):"")}(e.textContent||""),e)).filter(_.isFinite).max()}function l(e){if(e)return _(e.querySelectorAll("tbody td.filename.cell.matrix .file-label")).reject(e=>e.querySelector(".file-name")).filter(e=>i.isElementVisible(e)).map(e=>{const t=e.closest("td.filename.cell.matrix");return e.getBoundingClientRect().right-t.getBoundingClientRect().left+u(getComputedStyle(t).paddingRight)}).max()}function c(e){if(!e)return{};const t=e.getBoundingClientRect().left,s=e.querySelector("thead > .matrix.header > th.relative"),r=s?s.getBoundingClientRect().left-t+u(getComputedStyle(s).minWidth):void 0,n=_.filter(e.querySelectorAll("tbody td.directory.cell .placeholder.text"),e=>i.isElementVisible(e.parentElement)),a=_(n).map(e=>e.getBoundingClientRect().right-t).filter(_.isFinite).max(),o=n.length?n[0].parentElement.querySelector(".live.text"):null,l=o?u(getComputedStyle(o).paddingRight):0,c=_.isFinite(a)?a+l:void 0;return{spanningRowWidthFloor:_([r,a]).filter(_.isFinite).max(),spanningRowOccupiedWidth:_([r,c]).filter(_.isFinite).max()}}function u(e){const t=parseFloat(e);return _.isFinite(t)?t:0}function d(e,t){if(_.isFinite(e)&&_.isFinite(t))return Math.floor((e-t)/n)}function h(e,t){const{naturalMainScrollWidth:s,reviewerAvatarWidths:i,filenameCellWidth:r,renderedRevisionColumnCount:a,availableWidth:o}=e,l=t?i.overlapSavings:0,c=s-l,u=s-a*n-l;return{compactReviewerAvatars:t,renderedInlineContentOverflowing:_.isFinite(o)&&s>o,presentationMainScrollWidth:c,mainWidthExcludingFilename:_.isFinite(r)?c-r:void 0,fullFilenameRevisionColumnCapacity:d(o,u),effectiveFilenameCellWidth:r,filenamesTruncated:!1,filenameTextWidth:void 0}}function p(e,t,s){const{filenameCellWidth:i,filenameChromeWidth:r,minimumFilenameCellWidth:a,spanningRowWidthFloor:o,availableWidth:l,renderedRevisionColumnCount:c}=e,u=t.mainWidthExcludingFilename-c*n,h=_.isFinite(u)&&_.isFinite(a)?u+a:void 0,p=d(l,_([o,h]).filter(_.isFinite).max()),v=function(e,t,s){if(!_.isFinite(e))return{filenameTruncationCanGainRevisionColumn:!1};const i=Math.max(0,6-e),r=Math.max(1,Math.ceil(i/2)),n=e>=6?7:6,a=_.isFinite(s)?Math.max(3,s):1/0,o=Math.min(t,a,Math.max(3,Math.min(n,e+r)));return{maximumRevisionColumnCount:o,filenameTruncationCanGainRevisionColumn:_.isFinite(o)&&o>e}}(t.fullFilenameRevisionColumnCapacity,s.naturalRevisionColumnCount,p),m={...t,...v};if(s.inlineSidebarRevisionLayoutEnabled&&!v.filenameTruncationCanGainRevisionColumn)return m;const{availableFilenameCellWidth:g,effectiveTargetFilenameCellWidth:f}=function(e,t,s){const{filenameChromeWidth:i,minimumFilenameCellWidth:r,spanningRowWidthFloor:a,spanningRowOccupiedWidth:o,renderedRevisionColumnCount:l,availableWidth:c}=e,{inlineSidebarRevisionLayoutEnabled:u,sidebarWidthShrinking:d,previousFilenamesTruncated:h,previousFilenameTextWidth:p}=s;
1if(!_.isFinite(c)||!_.isFinite(t.mainWidthExcludingFilename))return{effectiveTargetFilenameCellWidth:0};const v=c-t.mainWidthExcludingFilename,m=t.mainWidthExcludingFilename-l*n,g=_.isFinite(c)&&_.isFinite(m)&&_.isFinite(t.maximumRevisionColumnCount)?c-m-t.maximumRevisionColumnCount*n:void 0,f=u?a-m:o-t.mainWidthExcludingFilename,w=_([f,r,0]).filter(_.isFinite).max(),y=_([u?g:v,w]).filter(_.isFinite).max(),b=_.isFinite(p)?i+p:void 0;return{availableFilenameCellWidth:v,effectiveTargetFilenameCellWidth:d&&h&&_.isFinite(b)?Math.max(w,Math.min(y,b)):y}}(e,m,s);if(!(_.isFinite(g)&&_.isFinite(i)&&f<i))return m;return{...m,effectiveFilenameCellWidth:f,filenamesTruncated:!0,filenameTextWidth:Math.max(0,f-r)}}class FileMatrix{constructor(){Vue.set(this,"statsWidthObserver",void 0),Vue.set(this,"revisionLayoutObserver",void 0),Vue.set(this,"observedRevisionLayoutParent",void 0),Vue.set(this,"sidebarSeeMoreFrame",void 0),Vue.set(this,"maxStatsWidth",0),Vue.set(this,"availableRevisionLayoutWidth",void 0),Vue.set(this,"sidebarWidthShrinking",!1),Vue.set(this,"measuredInlineMatrixContentWidth",void 0),Vue.set(this,"fixedMatrixColumnsWidth",void 0),Vue.set(this,"revisionLayout",{truncated:!1,visibleRevisionKeys:[],showEllipsis:!1,renderedRevisionColumnCount:1,sidebarOverflowing:!1,filenamesTruncated:!1,filenameTextWidth:void 0}),Vue.set(this,"performanceMode",!0),Vue.set(this,"prewarmReady",!1),Vue.set(this,"latchedShowMatrix",!1)}created(){_.forEach({showReviewerAvatars:!1,showFileStateChips:!0,showMatrixRevisions:!0,showDiffStats:!0,showCommitsList:!1,showCodeCoverage:!1,showFullMatrixInOverlay:!0},(e,t)=>{void 0===this.$session.settings[t]&&Vue.set(this.$session.settings,t,e)}),this.$observe(()=>[this.inlineSidebarRevisionLayoutEnabled,this.showMatrix,this.availableRevisionLayoutWidth,this.fixedMatrixColumnsWidth,_.join(_get(this,"review","revisions","keysList")||[],"\0")],()=>{this.syncRevisionLayout()})}mounted(){if(this.$observe(()=>this.showSidebarSeeMore,()=>{this.scheduleSidebarSeeMoreChange()}),Vue.set(this,"statsWidthObserver",new ResizeObserver(()=>{requestAnimationFrame(()=>{if(!this.$refs.stats)return;const e=this.statsWidthShowing?this.$refs.stats.scrollWidth:0;Vue.set(this,"maxStatsWidth",e?Math.max(this.maxStatsWidth,e):0),this.syncRevisionLayoutMetrics()})})),Vue.set(this,"revisionLayoutObserver",new ResizeObserver(()=>{requestAnimationFrame(()=>{this.syncRevisionLayoutMetrics()})})),this.$waitForRefs("stats",e=>{this.statsWidthObserver&&this.statsWidthObserver.observe(e)}),this.$observe(()=>this.statsWidthShowing,e=>{e||Vue.set(this,"maxStatsWidth",0),requestAnimationFrame(()=>{Vue.set(this,"sidebarWidthShrinking",!1),this.syncRevisionLayoutMetrics()})}),this.$waitForRefs("main",e=>{this.revisionLayoutObserver&&this.revisionLayoutObserver.observe(e),this.syncRevisionLayout(),this.$nextTick(()=>{this.syncRevisionLayoutMetrics()})}),this.$observe(()=>[this.showMatrix,this.overlaid,..._.values(_get(this,"review","context","shownMatrixColumns")),..._.map(_get(this,"review","files","groups","list"),"collapsed")],()=>{requestAnimationFrame(()=>{Vue.set(this,"sidebarWidthShrinking",!1),this.syncRevisionLayoutMetrics()})}),!this.showMatrix){const e=()=>{Vue.set(this,"prewarmReady",!0)};window.requestIdleCallback?requestIdleCallback(e):setTimeout(e,3e3)}}beforeDestroy(){this.statsWidthObserver&&this.statsWidthObserver.disconnect(),this.revisionLayoutObserver&&this.revisionLayoutObserver.disconnect(),this.sidebarSeeMoreFrame&&cancelAnimationFrame(this.sidebarSeeMoreFrame),this.$emit("sidebar-see-more-change",!1)}isRowVisible(e){return!!e&&("group"===e.type||!_get(e,"group","collapsed"))}get context(){return this.review.context}get inlineSidebarRevisionLayoutEnabled(){return!this.overlaid&&_get(this,"review","context","shownMatrixColumns","revisions")}scheduleSidebarSeeMoreChange(){this.sidebarSeeMoreFrame&&cancelAnimationFrame(this.sidebarSeeMoreFrame),Vue.set(this,"sidebarSeeMoreFrame",requestAnimationFrame(()=>{Vue.set(this,"sidebarSeeMoreFrame",void 0),this.$emit("sidebar-see-more-change",this.showSidebarSeeMore)}))}computeRevisionLayout(){const e=_get(this,"review","revisions","list")||[],t={truncated:!1,visibleRevisionKeys:_.map(e,"$key"),showEllipsis:!1,renderedRevisionColumnCount:e.length+1};
1if(!this.inlineSidebarRevisionLayoutEnabled||!e.length)return t;if(!_.isFinite(this.availableRevisionLayoutWidth)||!_.isFinite(this.fixedMatrixColumnsWidth))return t;const s=Math.max(3,Math.floor((this.availableRevisionLayoutWidth-this.fixedMatrixColumnsWidth)/n));if(e.length+1<=s)return t;const i=Math.max(1,s-2);return{truncated:!0,visibleRevisionKeys:_(e).takeRight(i).map("$key").value(),showEllipsis:!0,renderedRevisionColumnCount:s}}syncRevisionLayout(){const e=this.computeRevisionLayout();this.revisionLayout.truncated!==e.truncated&&Vue.set(this.revisionLayout,"truncated",e.truncated),this.revisionLayout.showEllipsis!==e.showEllipsis&&Vue.set(this.revisionLayout,"showEllipsis",e.showEllipsis),this.revisionLayout.renderedRevisionColumnCount!==e.renderedRevisionColumnCount&&Vue.set(this.revisionLayout,"renderedRevisionColumnCount",e.renderedRevisionColumnCount),_.isEqual(this.revisionLayout.visibleRevisionKeys,e.visibleRevisionKeys)||this.revisionLayout.visibleRevisionKeys.splice(0,this.revisionLayout.visibleRevisionKeys.length,...e.visibleRevisionKeys)}get showTopPriorArcs(){return this.showMatrix&&this.$session.settings.showMatrixRevisions&&!this.revisionLayout.truncated}get measuredInlineMatrixContentOverflowing(){return _.isFinite(this.availableRevisionLayoutWidth)&&_.isFinite(this.measuredInlineMatrixContentWidth)&&this.measuredInlineMatrixContentWidth>this.availableRevisionLayoutWidth}get sidebarOverflowing(){return!this.overlaid&&this.revisionLayout.sidebarOverflowing}get filenameTruncationEnabled(){return!this.overlaid&&this.revisionLayout.filenamesTruncated}get showSidebarSeeMore(){return!this.overlaid&&this.showMatrix&&(this.revisionLayout.truncated||this.measuredInlineMatrixContentOverflowing)}get showMatrix(){if(this.latchedShowMatrix)return!0;const e=this.review.files,t=_(e.showingList).reject(t=>_get(e,"groups",t.effectiveGroup,"collapsed")).size();return(!this.performanceMode||t>0&&t<200)&&Vue.set(this,"latchedShowMatrix",!0),this.overlaid||this.latchedShowMatrix}get shouldShowDiffStats(){return this.review.files.diffs.ready&&(_get(this,"review","files","diffs","lineStatsSum","totalDelta")||_get(this,"review","files","diffs","sizeSum","increased")||_get(this,"review","files","diffs","sizeSum","decreased"))&&_get(this,"review","context","shownMatrixColumns","diffStats")}get statsWidthShowing(){const e=_get(this,"review","context","shownMatrixColumns");return this.showMatrix&&(this.shouldShowDiffStats||_get(e,"commits")||_get(e,"codeCoverage")&&_get(this,"review","context","codeCoverage","reporting"))}refreshRevisionLayoutObservation(){if(!this.revisionLayoutObserver||!_get(this,"$el"))return;const e=this.$el.parentElement;e!==this.observedRevisionLayoutParent&&(this.observedRevisionLayoutParent&&this.revisionLayoutObserver.unobserve(this.observedRevisionLayoutParent),Vue.set(this,"observedRevisionLayoutParent",e||void 0),e&&this.revisionLayoutObserver.observe(e))}resetRevisionLayoutMetrics(){Vue.set(this,"availableRevisionLayoutWidth",void 0),Vue.set(this,"sidebarWidthShrinking",!1),Vue.set(this,"measuredInlineMatrixContentWidth",void 0),Vue.set(this,"fixedMatrixColumnsWidth",void 0),Vue.set(this.revisionLayout,"sidebarOverflowing",!1),Vue.set(this.revisionLayout,"filenamesTruncated",!1),Vue.set(this.revisionLayout,"filenameTextWidth",void 0)}measureFilenameMetrics(){const e=a(this.$refs.main,"tbody td.filename.cell.matrix .full.truncatable.file-name,tbody td.filename.cell.matrix .file-label > .file-name:not(.middle-truncate):not(.full)"),t=_access(e,"",0,"","closest","call",["td.filename.cell.matrix"])||a(this.$refs.main,"tbody td.filename.cell.matrix")[0],s=_access(t,"","getBoundingClientRect","call",[]),i=_access(t,"","querySelector","call",[".path-area"]),r=_access(t,"","querySelector","call",[".icon-wrapper"]),n=t?u(getComputedStyle(t).paddingRight):0,d=s&&i?i.getBoundingClientRect().left-s.left+(r?r.getBoundingClientRect().width:0)+n:0,h=_([o(e,d),l(this.$refs.main)]).filter(_.isFinite).max();return{filenameCellWidth:_get(s,"width"),filenameChromeWidth:d,minimumFilenameCellWidth:h,...c(this.$refs.main)}}measureMatrixLayout(){const e=this.$el.parentElement,t=e&&getComputedStyle(e),s=_get(e,"clientWidth"),i=_.isFinite(s)?s-parseFloat(_get(t,"paddingLeft"))-parseFloat(_get(t,"paddingRight")):void 0,r=this.statsWidthShowing&&this.$refs.stats?this.$refs.stats.scrollWidth+1:0;return function(e,t,s){const i=e.className;e.classList.remove(...t);try{return s()}finally{Vue.set(e,"className",i)}}(this.$el,["sidebar-name-truncate"],()=>{const e=this.$refs.main.scrollWidth,t=function(e){const t={naturalExpansion:0,overlapSavings:0},[s]=a(e,"tbody .avatars:not(.collapse)");if(!s)return t;const i=getComputedStyle(s),r=u(i.getPropertyValue("--avatars-width")),n=u(i.getPropertyValue("--overlapping-avatars-width")),o=s.getBoundingClientRect().width;return Vue.set(t,"naturalExpansion",Math.max(0,r-o)),Vue.set(t,"overlapSavings",Math.max(0,r-n)),t}(this.$refs.main),s=e+t.naturalExpansion;return{...this.measureFilenameMetrics(),reviewerAvatarWidths:t,naturalMainScrollWidth:s,measuredInlineMatrixContentWidth:s+r,renderedRevisionColumnCount:this.revisionLayout.renderedRevisionColumnCount,availableWidth:i,statsWidth:r}})}computeSidebarPresentation(e){const t=(_get(this,"review","revisions","list")||[]).length+1,s=_.isFinite(e.availableWidth)&&_.isFinite(this.availableRevisionLayoutWidth)?e.availableWidth<this.availableRevisionLayoutWidth||e.availableWidth===this.availableRevisionLayoutWidth&&this.sidebarWidthShrinking:this.sidebarWidthShrinking,i={naturalRevisionColumnCount:t,inlineSidebarRevisionLayoutEnabled:this.inl
1ineSidebarRevisionLayoutEnabled,revisionsTruncated:this.revisionLayout.truncated,sidebarWidthShrinking:s,previousFilenamesTruncated:this.revisionLayout.filenamesTruncated,previousFilenameTextWidth:this.revisionLayout.filenameTextWidth},r=function(e,t){const{reviewerAvatarWidths:s}=e,i=h(e,!1),r=h(e,!0),n=s.overlapSavings&&(i.renderedInlineContentOverflowing||t.revisionsTruncated||r.fullFilenameRevisionColumnCapacity>i.fullFilenameRevisionColumnCapacity&&i.fullFilenameRevisionColumnCapacity<t.naturalRevisionColumnCount);return{...n?r:i,compactReviewerAvatars:n}}(e,i),n=p(e,r,i);return{renderedInlineContentOverflowing:n.renderedInlineContentOverflowing,sidebarPresentationOverflowing:n.compactReviewerAvatars,presentationMainScrollWidth:n.presentationMainScrollWidth,mainWidthExcludingFilename:n.mainWidthExcludingFilename,effectiveFilenameCellWidth:n.effectiveFilenameCellWidth,maximumRevisionColumnCount:n.maximumRevisionColumnCount,filenamesTruncated:n.filenamesTruncated,filenameTextWidth:n.filenameTextWidth}}applySidebarPresentation(e,t){_.isFinite(e.measuredInlineMatrixContentWidth)&&e.measuredInlineMatrixContentWidth>0&&Vue.set(this,"measuredInlineMatrixContentWidth",e.measuredInlineMatrixContentWidth),_.isFinite(e.availableWidth)&&_.isFinite(this.availableRevisionLayoutWidth)&&(e.availableWidth<this.availableRevisionLayoutWidth?Vue.set(this,"sidebarWidthShrinking",!0):e.availableWidth>this.availableRevisionLayoutWidth&&Vue.set(this,"sidebarWidthShrinking",!1)),Vue.set(this.revisionLayout,"sidebarOverflowing",t.sidebarPresentationOverflowing),Vue.set(this.revisionLayout,"filenamesTruncated",t.filenamesTruncated),Vue.set(this.revisionLayout,"filenameTextWidth",t.filenameTextWidth)}applyRevisionColumnMetrics(e,t){const{availableWidth:s,spanningRowWidthFloor:i,renderedRevisionColumnCount:r}=e;if(!this.inlineSidebarRevisionLayoutEnabled)return Vue.set(this,"fixedMatrixColumnsWidth",void 0),void(_.isFinite(s)&&s>0&&Vue.set(this,"availableRevisionLayoutWidth",s));let a=(_.isFinite(t.mainWidthExcludingFilename)&&_.isFinite(t.effectiveFilenameCellWidth)?t.mainWidthExcludingFilename+t.effectiveFilenameCellWidth:t.presentationMainScrollWidth)-r*n;t.filenamesTruncated&&_.isFinite(s)&&(a=Math.max(a,s-t.maximumRevisionColumnCount*n)),_.isFinite(i)&&(a=Math.max(a,i)),_.isFinite(s)&&s>0&&Vue.set(this,"availableRevisionLayoutWidth",s),_.isFinite(a)&&a>0&&Vue.set(this,"fixedMatrixColumnsWidth",a)}syncRevisionLayoutMetrics(){if(this.refreshRevisionLayoutObservation(),!this.showMatrix||this.overlaid||!this.$refs.main)return void this.resetRevisionLayoutMetrics();const e=this.measureMatrixLayout(),t=this.computeSidebarPresentation(e);this.applySidebarPresentation(e,t),this.applyRevisionColumnMetrics(e,t)}}FileMatrix.$vueOptions={props:{review:{type:s,required:!0},overlaid:{type:Boolean}}};return _declareVue("FileMatrix",FileMatrix,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"file matrix",class:{overlaid:e.overlaid,"sidebar-inline":e.inlineSidebarRevisionLayoutEnabled,"sidebar-overflowing":e.sidebarOverflowing,"sidebar-name-truncate":e.filenameTruncationEnabled}},[e.overlaid?s("div",{staticClass:"matrix top controls"},[s("file-matrix-visual-tweaks",{attrs:{review:e.review,overlaid:e.overlaid}})],1):e._e(),s("table",{ref:"main",staticClass:"ui celled collapsing unstackable main files table"},[s("thead",[s("file-matrix-header",{attrs:{review:e.review,revisionLayout:e.revisionLayout,"sidebar-inline":e.inlineSidebarRevisionLayoutEnabled}})],1),e.showMatrix||e.prewarmReady?s("file-matrix-body",{directives:[{name:"show",rawName:"v-show",value:e.showMatrix,expression:"showMatrix"}],attrs:{rows:e.review.files.matrixRows,visible:e.showMatrix,revisionLayout:e.revisionLayout}}):e._e(),e.showMatrix?e._e():s("many-items-warning",{attrs:{context:e.context,itemName:"files",panelKey:"fileMatrix"},on:{"show-all":function(t){e.performanceMode=!1}}})],1),e.showTopPriorArcs?s("div",{staticClass:"top anchor"},[s("div",{staticClass:"top float"},[s("prior-arcs",{attrs:{revisions:e.review.revisions}})],1)]):e._e(),e.showMatrix||e.prewarmReady?s("table",{directives:[{name:"show",rawName:"v-show",value:e.showMatrix,expression:"showMatrix"}],ref:"stats",staticClass:"adjacent stats ui celled collapsing unstackable table"},[s("thead",[s("tr",{staticClass:"row all"},[s("th",{staticClass:"diff stats",class:{collapse:!this.shouldShowDiffStats}},[s("line-stats",{attrs:{stats:e.review.files.diffs.lineStatsSum,size:e.review.files.diffs.sizeSum}})],1)])]),s("progressive-render-list",{tag:"tbody",attrs:{items:e.review.files.matrixRows,visible:e.showMatrix,batch:1,isRowVisible:e.isRowVisible},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return["group"!==i.type&&_get(i,"group","collapsed")?e._e():s("stats-matrix-row",{key:"stats-"+i.$key,attrs:{row:i}})]}}],null,!1,905695299)}
1)],1):e._e()])},staticRenderFns:[],functional:!1},{cssVarsGetter:function(e){return[[!0,{"0f312400be712476":`${e.maxStatsWidth}px`}]]},scopeId:"data-v-0f312400"}),_declareGuides("FileMatrix","data-v-0f312400",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:"a.relative.link.item.overlay[data-v-0f312400]",onboarding:"sawShowFullMatrix",highlight:"bracket"}},[s("p",[e._v("\n Ignore the above toggles and show the full file matrix when in full-screen\n overlay mode.\n ")])])],1)},[]),{FileMatrix:FileMatrix}},!0,!0,{filename:"src/view/reviews/files/file-matrix.vue"}),_reviewable.define(["FileModeChangeMessage"],["truss"],function(e){"use strict";class FileModeChangeMessage{constructor(){}}FileModeChangeMessage.$vueOptions={props:{diff:{type:Object,required:!0}}};return _declareVue("FileModeChangeMessage",FileModeChangeMessage,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"special message"},[s("div",{staticClass:"ui icon message"},[s("i",{staticClass:"cell file mode icon",attrs:{alt:"file mode change"}}),s("div",{staticClass:"content text-grey"},[e._v("\n File mode change:\n "),s("mode-stats",{staticClass:"ui message",attrs:{modeChange:_get(e,"diff","modeChange")}})],1)])])},staticRenderFns:[],functional:!1},{}),{FileModeChangeMessage:FileModeChangeMessage}},!0,!0,{filename:"src/view/reviews/files/file-mode-change-message.vue"}),_reviewable.define(["FileReintroducedMessage"],["truss"],function(e){"use strict";class FileReintroducedMessage{constructor(){}get files(){return _(this.diff.reintroductionsBetweenBounds).map("targetFile").uniqBy("path").value()}get reintroducedRevision(){return _access(_,"","last","call",[this.diff.reintroductionsBetweenBounds],"","revisionKey")}visitFile(e){_access(this,"","diff","","review","","context","","navigation","","visitFile","call",[e])}}FileReintroducedMessage.$vueOptions={props:{diff:{type:Object,required:!0}}};return _declareVue("FileReintroducedMessage",FileReintroducedMessage,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"special message"},[s("div",{staticClass:"ui icon message"},[s("i",{staticClass:"renamed icon",attrs:{alt:""}}),s("div",{staticClass:"content"},[e._v("\n File renamed to\n "),e._l(e.files,function(t){return s("span",{key:t.$key,staticClass:"comma-item"},[s("span",{staticClass:"markdown-body",on:{click:function(s){return e.visitFile(t)}}},[s("code",{staticClass:"link"},[e._v(e._s(t.path))])])])}),e._v(", but recreated at "+e._s(e.reintroducedRevision)+".\n ")],2)])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-246a0beb"}),{FileReintroducedMessage:FileReintroducedMessage}},!0,!0,{filename:"src/view/reviews/files/file-reintroduced-message.vue"}),_reviewable.define(["FileRenamedMessage"],["truss"],function(e){"use strict";class FileRenamedMessage{constructor(){}}FileRenamedMessage.$vueOptions={props:{diff:{type:Object,required:!0}}};return _declareVue("FileRenamedMessage",FileRenamedMessage,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"special message"},[s("div",{staticClass:"ui icon message"},[s("i",{staticClass:"renamed icon",attrs:{alt:""}}),s("div",{staticClass:"content"},[e._v("\n File renamed from\n "),s("span",{staticClass:"markdown-body original"},[s("code",{domProps:{innerHTML:e._s(_get(e,"diff","renamedBetweenBounds","originalPathHtml"))}})]),e._v(" to\n "),s("span",{staticClass:"markdown-body renamed"},[s("code",{domProps:{innerHTML:e._s(_get(e,"diff","renamedBetweenBounds","renamedPathHtml"))}})]),e._v("\n in this diff.\n "),_get(e,"diff","renamedBetweenBounds","reintroduced")?s("span",[e._v("\n (Though a file with the original name was later recreated.)\n ")]):e._e()])])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-51ee0f91"}),{FileRenamedMessage:FileRenamedMessage}},!0,!0,{filename:"src/view/reviews/files/file-renamed-message.vue"}),_reviewable.define(["FileRevertedMessage"],["truss"],function(e){"use strict";class FileRevertedMessage{constructor(){}}FileRevertedMessage.$vueOptions={props:{lastUnkeptRevisionKey:{type:String,required:!0}}};return _declareVue("FileRevertedMessage",FileRevertedMessage,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"special message"},[s("div",{staticClass:"ui icon message"},[s("i",{staticClass:"cell reverted icon",attrs:{alt:""}}),s("div",{staticClass:"content"},[e._v("\n File reverted to base at "+e._s(e.lastUnkeptRevisionKey)+" with no further changes.\n ")])])])},staticRenderFns:[],functional:!1},{}),{FileRevertedMessage:FileRevertedMessage}},!0,!0,{filename:"src/view/reviews/files/file-reverted-message.vue"}),_reviewable.define(["FileReviewerAvatars"],["truss","Guide","File","session"],function(e,t,s,i){"use strict";class FileReviewerAvatars{constructor(){}get shouldShowRevisions(){return _get(this,"file","review","context","shownMatrixColumns","revisions")}get people(){return this.file.review.people}get allReviewers(){return this.file.$parent.reviewerKeys}get reviewers(){return _.map(this.allReviewers,e=>{const t=this._getShader(e);return{userKey:e,shader:t,descriptor:`Reviewed ${t}
1 by ${_get(this,"people",e,"username")||"someone"} at ${_get(this,"file","revisions","latestReviewedBy",e,"fully","revisionKey")||"r??"}`}})}get avatarCount(){return this.allReviewers.length}get avatarGapCount(){return Math.max(0,this.avatarCount-1)}get rootFontSize(){const e=getComputedStyle(document.documentElement);return _.parseInt(e.getPropertyValue("font-size"))}get avatarOverlapWidth(){return.45*this.rootFontSize}get avatarsWidth(){const e=.5*this.rootFontSize;return`${18.2*this.avatarCount+e*this.avatarGapCount+13}px`}get overlappingAvatarsWidth(){return 18.2*this.avatarCount-this.avatarOverlapWidth*this.avatarGapCount+13+"px"}get avatarStyle(){return{"--avatars-width":this.avatarsWidth,"--overlapping-avatars-width":this.overlappingAvatarsWidth,"--avatar-overlap-offset":-this.avatarOverlapWidth+"px"}}_getShader(e){const t=_get(this,"file","revisions","latestReviewedBy",e,"fully","effectiveRevisionKey");return t?t===this.file.review.core.lastRevisionKey?"recently":_.includes(this.file.nextToLatestReviewerKeys,e)?"previously":"before":"never"}diffSinceLastReviewedBy(e){this.shouldShowRevisions&&(Vue.set(i.onboarding,"sawReviewers",!0),this.file.files.diffs.diffSinceLastReviewedBy(e))}}FileReviewerAvatars.$vueOptions={props:{file:{type:s,required:!0}}};return _declareVue("FileReviewerAvatars",FileReviewerAvatars,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"avatars",class:{clickable:e.shouldShowRevisions},style:e.avatarStyle},[e._l(e.reviewers,function(t){var i=t.userKey,r=t.shader,n=t.descriptor;return["never"===r?s("div",{key:i,staticClass:"avatar-spacer"}):s("avatar",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:n,theme:"narrow tooltip"},expression:"{text: descriptor, theme: 'narrow tooltip'}"}],key:i,class:["has",r,"reviewed"],attrs:{userKey:i,size:"tiny",display:"picture"},nativeOn:{click:function(t){return e.diffSinceLastReviewedBy(i)}}})]})],2)},staticRenderFns:[],functional:!1},{scopeId:"data-v-6c8218ba"}),_declareGuides("FileReviewerAvatars","data-v-6c8218ba",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".avatars[data-v-6c8218ba]",onboarding:"sawReviewerAvatars",highlight:"bracket","hotkey-action":"toggleReviewerAvatars()"}},[s("p",[e._v("\n Displays a list of people who "),s("em",[e._v("reviewed each file")]),e._v(" at any point. Hover over an avatar\n to see the "),s("em",[e._v("last revision that individual reviewed")]),e._v(", and click to show the "),s("em",[e._v("diffs\n since their last review")]),e._v(" for "),s("i",[e._v("every")]),e._v(" file (not just the one in the row you clicked\n on).\n ")]),e._v(" "),s("p",[e._v("\n Reviewers who last reviewed a file at an older revision are shown increasingly faded out, per\n the following buckets:\n ")]),s("dl",{staticClass:"wide-80"},[s("dt",[s("em",[e._v("Recently")])]),e._v(" "),s("dd",[e._v("The person has reviewed this file at the latest revision.")]),e._v(" "),s("dt",[s("em",[e._v("Previously")])]),e._v(" "),s("dd",[e._v("\n The person is one of the last people to review this file, at any revision besides the\n latest one.\n ")]),e._v(" "),s("dt",[s("em",[e._v("Before")])]),e._v(" "),s("dd",[e._v("The person has reviewed the file at some point.")]),e._v(" "),s("dt",[s("em",[e._v("Never")])]),e._v(" "),s("dd",[e._v("\n The person has not reviewed this file. Their avatar will be hidden completely.\n ")])]),e._v(" "),s("p")])],1)},[]),{FileReviewerAvatars:FileReviewerAvatars}},!0,!0,{filename:"src/view/reviews/files/file-reviewer-avatars.vue"}),_reviewable.define(["FileRevisionsRow"],["truss","Guide","bus","session","dom","mangler","modifiers"],function(e,t,s,i,r,n,a){"use strict";const o="ellipsis";function l(e,t,s){const i=Math.ceil(s/2),r=s-i;return e.slice(0,i).join("")+"â¦"+(r?e.slice(-r).join(""):"")+t}function c(e,t,s){if(!_.isFinite(t))return;const{baseNameGraphemes:i,extension:a}=function(e){const t=e.lastIndexOf("."),s=t>0,i=s?e.slice(0,t):e;return{baseNameGraphemes:n.splitTextIntoGraphemes(i),extension:s?e.slice(t):""}}(e);if(i.length<12)return;const o=l(i,a,8);if(t<=0)return o;const c=r.measureTextWidth(e,s);if(!_.isFinite(c)||c<=t)return;const u=r.measureTextWidth(o,s);if(!_.isFinite(u)||u>t)return o;let d=o,h=8,p=i.length-1;for(;h<=p;){const e=Math.floor((h+p)/2),n=l(i,a,e),o=r.measureTextWidth(n,s);_.isFinite(o)&&o<=t?(d=n,h=e+1):p=e-1}return d}class FileRevisionsRow{constructor(){Vue.set(this,"fullPathShowing",!1),Vue.set(this,"touchOnly",!1),Vue.set(this,"sticky",!1),Vue.set(this,"filenameFont",void 0)}created(){s.stickyPanel.react(({panelKey:e,sticky:t})=>{this.file.$key===e&&Vue.set(this,"sticky",t)},{scope:this})}mounted(){this.syncFilenameFont()}updated(){this.syncFilenameFont()}syncFilenameFont(){const e=r.getTextMeasurementFont(this.$refs.filenameText);e&&e!==this.filenameFont&&Vue.set(this,"filenameFont",e)}get review(){return _get(this,"row","group","review")}get priorArcsWidth(){return _get(this,"file","revisions","list")?32*this.file.revisions.list.length:0}get middleTruncatedFilename(){const e=_get(this,"file","name");if(!e||!_get(this,"revisionLayout","filenamesTruncated")||!this.filenameFont)return;return c(e,this.revisionLayout.filenameTextWidth-15*this.row.indent,this.filenameFont)}get visibleCells(){const e=_get(this,"file","revisions","cells");if(!e)return[];const t=_get(this,"revisionLayout","visibleRevisionKeys");return _.isEmpty(t)?e:_(e).keyBy("revKey").at(t).compact().value(
1)}get shouldShowRevisions(){return"header"===this.location||_get(this,"file","review","context","shownMatrixColumns","revisions")}get diffBounds(){const e=_get(this,"file","diff","selecting","bounds")||_get(this,"file","diff","bounds");if(_get(e,1))return e}get selectingDiffBounds(){return _get(this,"file","diff","selecting","direct")&&_get(this,"file","diff","selecting","bounds")}get boundsBandOffset(){if(!this.diffBounds)return;const e=this._getRenderedBoundsSlot(this.diffBounds[0]),t=this._getRenderedBoundsSlot(this.diffBounds[1]);return 32*Math.min(e,t)+3}get boundsBandWidth(){if(!this.diffBounds)return;const e=this._getRenderedBoundsSlot(this.diffBounds[0]),t=this._getRenderedBoundsSlot(this.diffBounds[1]);return 32*(Math.abs(t-e)+1)-6-1}get ellipsisRevKey(){if(!(_get(this,"revisionLayout","truncated")&&_get(this,"revisionLayout","showEllipsis")&&this.diffBounds))return null;const e=this.revisionLayout.visibleRevisionKeys||[],t=_get(this,"diffBounds",1,"$key");if(t&&!_.includes(e,t))return t;const s=_get(this,"diffBounds",0,"$key");return s&&!_.includes(e,s)?s:null}get renderedRevisionSlotsByKey(){if(!_get(this,"revisionLayout","truncated"))return;const e=this.revisionLayout.showEllipsis?2:1;return _.fromPairs(_.map(this.revisionLayout.visibleRevisionKeys||[],(t,s)=>[t,e+s]))}_getRenderedBoundsSlot(e){const t=_get(e,"$key");return t?_get(this,"revisionLayout","truncated")?_get(this,"renderedRevisionSlotsByKey",t)||1:_get(this,"file","review","revisions",t,"index")+1:0}get commentsIconOn(){return this.file.commented}get gitHubIconOn(){return!a.combinationMod&&a.altOrShift&&!this.file.system}get externalEditorIconOn(){return a.combinationMod&&!this.file.system}get newTabIconOn(){return!a.combinationMod&&a.metaOrCtrl}get modifierIconOn(){return this.newTabIconOn||this.gitHubIconOn||this.externalEditorIconOn}get shouldShowAvatars(){return this.review.files.reviewerKeys.length&&_get(this,"review","context","shownMatrixColumns","reviewerAvatars")}get shouldShowReviewChips(){return _get(this,"review","context","shownMatrixColumns","reviewChips")}get current(){return"file"===this.row.type&&this.file.$key===_get(this,"file","review","context","navigation","lastVisitedFileKey")}toggleFullPath(e){Vue.set(this,"touchOnly",!0),Vue.set(this,"fullPathShowing","right"===e)}computeArcWidth(e,t){return 32*Math.abs(e-t)}computeArcOffset(e,t){return 32*Math.min(e,t)+16}routeUserClick(){switch(!0){case a.combinationMod:if(this.file.editorLinkUrl)return void window.open(this.file.editorLinkUrl);this.$store.services.header.toggleHeaderAndAccountSettings();break;case a.metaOrCtrl:window.open(this.file.uri);break;case a.altOrShift:this.file.githubLinkUrl&&window.open(this.file.githubLinkUrl);break;default:_access(this,"","review","","context","","navigation","","visitFile","call",[this.file,!0])}}openOverlay(){this.review.context.navigation.overlayPanel("fileMatrix")}_getCellForEvent(e){let t;if(/touch/.test(e.type)){const s=e.touches[0];t=document.elementFromPoint(s.clientX,s.clientY)}else t=e.target;const s=r.findClosestElement(t,"td");if(s&&s.classList.contains("ellipsis"))return o;if(!s)return;const i=_access(s,"","getAttribute","call",["data-index"]);return i?this.file.revisions.cells[_.parseInt(i)]||{}:void 0}start(e){if("mousedown"===e.type&&1!==e.which||"touchstart"===e.type&&e.touches.length>1)return;const t=this._getCellForEvent(e);t&&t!==o&&!t.missing&&(Vue.set(this.file.diff,"selecting",{anchorRev:this.file.review.revisions[t.revKey]||null,direct:!0}),this.file.diff.selectBounds(this.file.diff.selecting.anchorRev),document.addEventListener("mouseup",this._cleanup),document.addEventListener("touchend",this._cleanup),document.addEventListener("mousemove",this._move),document.addEventListener("touchmove",this._move),Vue.set(i.onboarding,"usedRevCells",!0))}end(e){"mousedown"===e.type&&1!==e.which||"touchend"===e.type&&e.touches.length||!_get(this,"file","diff","selecting")||(this.file.diff.commitBounds(),this.file.diff.force("soft"))}_move(e){if(!_get(this,"file","diff","selecting"))return;const t=this._getCellForEvent(e);t!==o&&(t?this.file.diff.selectBounds(this.file.diff.selecting.anchorRev,this.file.review.revisions[t.revKey]||null):this.file.diff.selecting.bounds&&Vue.delete(this.file.diff.selecting,"bounds"))}_cleanup(){this.file.diff&&Vue.set(this.file.diff,"selecting",void 0),document.removeEventListener("mouseup",this._cleanup),document.removeEventListener("touchend",this._cleanup),document.removeEventListener("mousemove",this._move),document.removeEventListener("touchmove",this._move)}}FileRevisionsRow.$vueOptions={props:{row:{},file:{required:!0},location:{type:String,validator:e=>_.includes(["header"],e)},revisionLayout:{type:Object}}};return _declareVue("FileRevisionsRow",FileRevisionsRow,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("tr",{staticClass:"row",class:{nilrange:!e.diffBounds,selecting:e.selectingDiffBounds},on:{mousedown:e.start,touchstart:e.start,mouseup:e.end,touchend:e.end}},["header"===e.location?s("filename-cell",{directives:[{name:"touch",rawName:"v-touch:swipe.left.right",value:e.toggleFullPath,expression:"toggleFullPath",arg:"swipe",modifiers:{left:!0,right:!0}}],ref:"filename",staticClass:"header",class:{fullpath:e.fullPathShowing,nohover:e.touchOnly},attrs:{slot:"filename",file:e.file,sticky:e.sticky},slot:"filename"}):s("td",{staticClass:"filename square cell matrix link",class:{current:e.current},on:{click:function(t){return t.preventDefault(),e.routeUserClick.apply(null,arguments)},mousedown:function(e){if("button"in e&&1!==e.button)return null;e.preventDefault()}}},[s("toggle-file-review-mark-button",{staticClass:"toggle-wrapper",attrs:{file:e.file}}),s("span",{staticClass:"path-area",style:{"padding-left":15*e.row.indent+"px"}},[s("span",{staticClass:"file links"},[s("span",{staticClass:"path-wrapper"},[s("span",{staticClass:"path link",class:{trivial:e.file.trivial},attrs:{lang:""}},[s("span",{staticClass:"file-label"},[e.file.system?s("span",{domProps:{innerHTML:e._s(e.file.segmentedPathHtml)}}):e.middleTruncatedFilename?[s("span",{ref:"filenameText",staticClass:"full truncatable file-name"},[e._v(e._s(e.file.name))]),s("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.file.name,expression:"file.name"}],staticClass:"middle-truncate file-name"},[e._v(e._s(e.middleTruncatedFilename))])]:s("span",{ref:"filenameText",staticClass:"file-name"},[e._v(e._s(e.file.name))]),s("span",{staticClass:"icon-wrapper"},[s("i",{staticClass:"icon",class:{comments:e.commentsIconOn,overridden:e.modifierIconOn}}),s("i",{staticClass:"modifier icon",class:{external:e.newTabIconOn,github:e.gitHubIconOn,editor:e.externalEditorIconOn,some:e.modifierIconOn}}
1)])],2)])])])])],1),"header"===e.location?s("td",{staticClass:"chip cell dropdown-highlight"},[s("i",{staticClass:"designation icon dropdown-toggle",class:_get(e,"file","reviewChip","dominantIcon")}),s("tippy-dropdown",{attrs:{fixed:e.sticky,options:e.sticky?{zIndex:1e6}:{}}},[s("designation-details",{attrs:{file:e.file}})],1)],1):s("td",{staticClass:"reviewers"},[s("file-reviewer-avatars",{class:{collapse:!e.shouldShowAvatars},attrs:{file:e.file}})],1),s("td",{staticClass:"chip square cell dropdown-highlight",class:{collapse:!e.shouldShowReviewChips}},[s("i",{staticClass:"relative designation icon dropdown-toggle",class:_get(e,"file","reviewChip","dominantIcon")}),s("tippy-dropdown",[s("designation-details",{staticClass:"chip details segment",attrs:{file:e.file}})],1)],1),e.shouldShowRevisions?[s("td",{key:"null",staticClass:"revcell",class:{bound:_access(e,"","file","","diff","","isBoundAtKey","call",[null])},attrs:{"data-index":"-1"}},[s("div",{staticClass:"relative base revision"},[s("span",{staticClass:"inner revlabel"},[e._v("â¥")]),e.diffBounds?s("div",{staticClass:"bounds band",style:{left:e.boundsBandOffset+"px",width:e.boundsBandWidth+"px"}}):e._e()])]),_get(e,"revisionLayout","showEllipsis")?s("td",{staticClass:"revcell ellipsis",class:{bound:e.ellipsisRevKey},on:{click:function(t){return t.stopPropagation(),e.openOverlay.apply(null,arguments)}}},[s("div",{staticClass:"relative revision ellipsis",class:{labeled:e.ellipsisRevKey}},[e.ellipsisRevKey?s("span",{staticClass:"inner revlabel"},[e._v(e._s(e.ellipsisRevKey))]):e._e(),s("span",{staticClass:"glyph"},[e._v("â¦")])])]):e._e(),e._l(e.visibleCells,function(t){return s("td",{key:t.revKey,staticClass:"revcell",class:{bound:_access(e,"","file","","diff","","isBoundAtKey","call",[t.revKey]),missing:t.missing,"elide border":t.elideBorder},attrs:{"data-index":t.index}},[s("div",{staticClass:"relative revision",class:t.revisionClass||""},[t.priorAction?s("span",{staticClass:"prior action",class:t.priorAction}):e._e(),t.renamed?s("i",{staticClass:"watermark cell renamed icon",class:{small:t.reverted}}):e._e(),t.reverted?s("i",{staticClass:"watermark cell reverted icon"}):e._e(),t.baseChanges?s("span",{staticClass:"base changes",class:t.baseChanges},[e._v("â¥")]):e._e(),t.reviewedIcon?["self-review"===e.file.reviewMarkStyle?s("span",{staticClass:"cell self-review disc",class:{green:"draft"===t.reviewedIcon},attrs:{alt:"Self-reviewed by you"+("draft"===t.reviewedIcon?" (draft)":"")}}):s("i",{staticClass:"cell reviewed icon",class:{draft:"green",user:""}[t.reviewedIcon]})]:t.missing?e._e():s("span",{staticClass:"inner revlabel"},[e._v(e._s(t.revKey))])],2),"header"===e.location&&t.arcs?s("div",{staticClass:"prior arcs"},e._l(t.arcs,function(i){return s("svg",{style:{left:e.computeArcOffset(t.index,i)+"px"},attrs:{viewBox:"0 0 100 13",preserveAspectRatio:"none",height:"13",width:e.computeArcWidth(t.index,i)}},[s("path",{attrs:{d:"M0 13Q50 0,100 13"}})])}),0):e._e()])})]:e._e()],2)},staticRenderFns:[],functional:!1},{cssVarsGetter:function(e){return[[!0,{"3f5f5aeb616b77bc":e.priorArcsWidth+"px"}]]},scopeId:"data-v-3f5f5aeb"}),_declareGuides("FileRevisionsRow","data-v-3f5f5aeb",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{staticClass:"revisions legend",attrs:{for:".row[data-v-3f5f5aeb]:not(.nilrange)",group:".revcell[data-v-3f5f5aeb]",onboarding:"usedRevCells",highlight:"under",position:"right"}},[s("p",[e._v("\n These cells show the "),s("em",[e._v("evolution and current state")]),e._v(" of the files.\n ")]),e._v(" "),s("p",[s("span",{staticClass:"diff bounds"}),e._v(" are the "),s("em",[e._v("left and right diff bounds")]),e._v("; to set them,\n "),s("em",[e._v("click")]),e._v(" on one desired revision bound and "),s("em",[e._v("drag")]),e._v(" to the other one.\n ")]),e._v(" "),s("div",[e._v("The color tells you what happened to a file at each revision:")]),e._v(" "),s("dl",[s("dt",[s("span",{staticClass:"revision kept"})]),e._v(" "),s("dd",[e._v("File kept unchanged, or not in PR.")]),e._v(" "),s("dt",[s("span",{staticClass:"revision added swatch"})]),s("dd",[e._v("File created.")]),e._v(" "),s("dt",[s("span",{staticClass:"revision modified swatch"})]),s("dd",[e._v("File modified.")]),e._v(" "),s("dt",[s("span",{staticClass:"revision removed swatch"})]),s("dd",[e._v("File deleted.")]),e._v(" "),s("dt",[s("span",{staticClass:"revision kept swatch"},[s("span",{staticClass:"prior action modified"})])]),e._v(" "),s("dd",[e._v("\n The inner color swatch represents the action in relation to the\n "),s("strong",[e._v("rebased")]
1),e._v(" revision.\n See "),s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/files#rebasing"}},[e._v("docs")]),e._v(" for more\n details.\n ")]),e._v(" "),s("dt",[s("i",{staticClass:"watermark cell renamed icon",attrs:{alt:"renamed"}})]),s("dd",[e._v("File renamed.")]),e._v(" "),s("dt",[s("i",{staticClass:"watermark cell reverted icon",attrs:{alt:"reverted"}})]),e._v(" "),s("dd",[e._v("File reverted to base.")]),e._v(" "),s("dt",[s("span",{staticClass:"relative"},[s("span",{staticClass:"base changes mixed"},[e._v("â¥")])])]),e._v(" "),s("dd",[e._v("Base updated and modified in revision.")]),e._v(" "),s("dt",[s("span",{staticClass:"relative"},[s("span",{staticClass:"base changes only"},[e._v("â¥")])])]),e._v(" "),s("dd",[e._v("Base changes only.")]),e._v(" "),s("dt",[s("span",{staticClass:"relative"},[s("span",{staticClass:"base changes missing"},[e._v("â¥")])])]),e._v(" "),s("dd",[e._v("Base changes not reflected in revision.")]),e._v(" "),s("dt",[s("span",{staticStyle:{display:"flex","line-height":"1"}},[e._v("â¦")])]),e._v(" "),s("dd",[e._v("\n Some revisions are "),s("em",[e._v("hidden to fit the sidebar")]),e._v(". Click to open the full file\n matrix. Tooltips show hidden diff bounds.\n ")])]),e._v(" "),s("div",[e._v("Relevant review marks are also displayed:")]),e._v(" "),s("dl",[s("dt",[s("i",{staticClass:"cell reviewed icon",attrs:{alt:"reviewed by you"}})]),e._v(" "),s("dd",[e._v("Last revision reviewed by you.")]),e._v(" "),s("dt",[s("i",{staticClass:"cell reviewed green icon",attrs:{alt:"reviewed by you (draft)"}})]),e._v(" "),s("dd",[e._v("Last revision reviewed by you (draft).")]),e._v(" "),s("dt",[s("span",{staticClass:"relative borderless revision"},[s("span",{staticClass:"cell self-review disc",attrs:{alt:"self-reviewed by you"}})])]),e._v(" "),s("dd",[e._v("Last revision self-reviewed by you.")]),e._v(" "),s("dt",[s("span",{staticClass:"relative borderless revision"},[s("span",{staticClass:"cell self-review disc green",attrs:{alt:"self-reviewed by you (draft)"}})])]),e._v(" "),s("dd",[e._v("Last revision self-reviewed by you (draft).")])])]),e._v(" "),s("guide",{attrs:{for:".filename.cell[data-v-3f5f5aeb]:not(.header) .path-area",onboarding:"clickedOnFilename",highlight:"under",position:"left"}},[s("p",[e._v("\n The path of a "),s("em",[e._v("file in the pull request")]),e._v(".\n ")]),e._v(" "),s("table",{staticClass:"hotkeys"},[s("tbody",[s("tr",[s("td",[s("i",{staticClass:"mouse icon"})]),e._v(" "),s("td",[s("em",[e._v("Jump to the file")]),e._v(".")])]),e._v(" "),s("tr",[s("td",[s("span",{staticClass:"cfp-hotkeys-key"},[e._v(e._s(e.config.mac?"â":"ctrl"))]),e._v(" "),s("i",{staticClass:"mouse icon"})]),e._v(" "),s("td",[e._v("Open the file "),s("em",[e._v("in a new tab")]),e._v(".")])]),e._v(" "),s("tr",[s("td",[s("span",{staticClass:"cfp-hotkeys-key"},[e._v(e._s(e.config.mac?"â¥":"alt"))]),e._v(" "),s("i",{staticClass:"mouse icon"})]),e._v(" "),s("td",[e._v("Open the file at the latest revision's commit "),s("em",[e._v("in GitHub in a new tab")]),e._v(".")])]),e._v(" "),s("tr",[s("td",[s("span",{staticClass:"cfp-hotkeys-key"},[e._v("â§")]),e._v(" "),s("i",{staticClass:"mouse icon"})]),e._v(" "),s("td",[e._v("Open the file "),s("em",[e._v("in GitHub in a new window")]),e._v(".")])]),e._v(" "),s("tr",[s("td",[s("div",[s("span",{staticClass:"cfp-hotkeys-key"},[e._v("\n "+e._s(e.config.mac?"â":"ctrl")+"\n ")]),e._v(" "),s("span",{staticClass:"cfp-hotkeys-key"},[e._v("\n "+e._s(e.config.mac?"â¥":"alt")+"\n ")]),e._v(" "),s("i",{staticClass:"mouse icon"})]),e._v("\n or\n "),s("div",[s("span",{staticClass:"cfp-hotkeys-key"},[e._v("\n "+e._s(e.config.mac?"â":"ctrl")+"\n ")]),e._v(" "),s("span",{staticClass:"cfp-hotkeys-key"},[e._v("â§")]),e._v(" "),s("i",{staticClass:"mouse icon"})])]),e._v(" "),s("td",[e._v("Open the file "),s("em",[e._v("in an exernal editor")]),e._v(".")])])])]),e._v(" "),s("p",[e._v("\n Files in "),s("i",[e._v("italics")]),e._v(" have been hidden from view but will be shown if jumped to.\n ")]),e._v(" "),s("p",[s("span",[s("em",[e._v("Virtual files:")])]),s("br"),e._v(" "),s("span",[s("i",{staticClass:"commit icon"}),e._v(" "),s("strong",[e._v("Commits")]),e._v(": generated by Review
1able for reviewing commit messages.\n ")])])])],1)},[]),{FileRevisionsRow:FileRevisionsRow}},!0,!0,{filename:"src/view/reviews/files/file-revisions-row.vue"}),_reviewable.define(["FileRoot"],["truss","textSelectionTracker","bus"],function(e,t,s){"use strict";class FileRoot{constructor(){Vue.set(this,"selectionHandleTarget",{diff:void 0,line:void 0,side:void 0})}mounted(){s.selectDiffLine.react(e=>{_get(this,"file","diff","current")===e.diff&&Vue.set(this,"selectionHandleTarget",e)},{scope:this}),s.clearDiffLineSelection.react(()=>{Vue.set(this,"selectionHandleTarget",{})},{scope:this})}get fullDiffWidth(){return _.isFinite(this.$store.services.ruler.width.full)?this.$store.services.ruler.width.full+"px":"0px"}get diffRowWidth(){return _.isFinite(this.$store.services.ruler.width.row)?this.$store.services.ruler.width.row+"px":"0px"}get shouldDisplaySelectionHandles(){return t.selectionHandlesVisible&&_get(this,"file","diff","current")&&_get(this,"file","diff","current")===this.selectionHandleTarget.diff}get rightBoundRevKey(){return _get(this,"file","diff","bounds",1,"$key")}get lastUnkeptRevision(){return _get(this,"file","revisions","nearestUnkept",this.review.core.lastRevisionKey)}get lastShowingDiff(){return _get(this,"file","diff","lastShowing")}get messages(){const e={commits:"-commits"===this.file.$key,renamed:!!_get(this,"file","diff","current","renamedBetweenBounds"),reintroduced:!!_get(this,"file","diff","current","reintroductionsBetweenBounds","length"),equivalent:"-commits"===this.file.$key&&!!_get(this,"review","revisions",_get(this,"rightBoundRevKey"),"equivalentCommitShas"),reverted:!!_get(this,"lastUnkeptRevision","reverted"),modeChange:!!_get(this,"file","diff","lastShowing","modeChange"),baseChange:!!_get(this,"file","diff","lastShowing","baseChange"),conflictMarkers:!!_get(this,"file","diff","lastShowing","conflictMarkers")};return Vue.set(e,"any",_.some(e)),e}get shouldDisplayMarkReviewedButton(){return _get(this,"file","diff","current","ready")&&0===this.file.reviewLevel}get shouldDisplayNextFileButton(){return _get(this,"file","diff","current","ready")&&this.file.reviewLevel>0&&_get(this,"review","context","singleFile")&&_get(this,"review","files","num","presented")>1}}FileRoot.$vueOptions={props:{file:{type:Object,required:!0},review:{type:Object,required:!0}}};return _declareVue("FileRoot",FileRoot,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.review.context?s("flow-panel",{staticClass:"file",attrs:{"panel-key":e.file.$key,"accent-color":"--purple-4",dimmed:!_get(e,"file","diff","current","shown"),context:e.review.context},on:{select:function(t){return e.review.context.navigation.selectFile(e.file,!0)}},scopedSlots:e._u([{key:"title",fn:function(){return[s("file-header",{attrs:{file:e.file}})]},proxy:!0},{key:"after-title",fn:function(){return[_get(e,"lastShowingDiff","textual")?s("file-margin-notch",{attrs:{file:e.file}}):e._e()]},proxy:!0},{key:"content",fn:function(){return[s("div",{staticClass:"main content"},[e.messages.commits?s("commits-controls",{attrs:{review:e.review}}):e._e(),s("animate-slide-down-group",[e.messages.renamed?s("file-renamed-message",{key:"fileRenamed",attrs:{diff:e.file.diff.current}}):e._e(),e.messages.reintroduced?s("file-reintroduced-message",{key:"fileReintroduced",attrs:{diff:e.file.diff.current}}):e._e(),e.messages.equivalent?s("equivalent-commits-message",{key:"equivalentCommits",attrs:{rightBoundRevKey:e.rightBoundRevKey}}):e._e(),e.messages.reverted?s("file-reverted-message",{key:"fileReverted",attrs:{lastUnkeptRevisionKey:e.lastUnkeptRevision.$key}}):e._e(),e.messages.commits?s("collapsed-commits-message",{key:"collapsedCommits",attrs:{review:e.review}}):e._e(),e.messages.modeChange?s("file-mode-change-message",{key:"mode",attrs:{diff:_get(e,"file","diff","lastShowing")}}):e._e(),e.messages.baseChange?s("file-base-change-message",{key:"base",attrs:{diff:_get(e,"file","diff","lastShowing")}}):e._e(),e.messages.conflictMarkers?s("file-conflict-markers-message",{key:"conflict"}
1):e._e()],1),e.messages.any?s("div",{staticClass:"ui divider"}):e._e(),s("div",{staticClass:"diff-area"},[e.shouldDisplaySelectionHandles?s("selection-handles",{key:_get(e,"selectionHandleTarget","line"),attrs:{target:e.selectionHandleTarget}}):e._e(),_get(e,"file","diff","current")?s("diff-viewer",{attrs:{"new-diff":e.file.diff.current}}):e._e()],1),e.shouldDisplayMarkReviewedButton?s("file-bottom-button",{attrs:{review:e.review},on:{click:[function(t){return e.$emit("mark-reviewed-and-advance")},function(t){return t.shiftKey?e.$emit("mark-reviewed-and-retreat"):null}]}},[s("mark-reviewed",{attrs:{review:e.review,file:e.file}})],1):e._e(),e.shouldDisplayNextFileButton?s("file-bottom-button",{attrs:{review:e.review},on:{click:function(t){return e.$emit("advance")}}},[s("next-file")],1):e._e()],1)]},proxy:!0}],null,!1,837112819)}):e._e()},staticRenderFns:[],functional:!1},{cssVarsGetter:function(e){return[[!0,{"6ca511d0ec452288":e.fullDiffWidth,"6ca511d04acf8227":e.diffRowWidth}]]},scopeId:"data-v-6ca511d0"}),{FileRoot:FileRoot}},!0,!0,{filename:"src/view/reviews/files/file-root.vue"}),_reviewable.define(["FileTableRuler"],["truss","Review"],function(e,t){"use strict";const s=document.documentElement,i=getComputedStyle(document.documentElement),r=_.parseInt(i.getPropertyValue("--bouncer-buffer"));class FileTableRuler{constructor(){Vue.set(this,"tabWidth",void 0),Vue.set(this,"cellWidth",void 0),Vue.set(this,"singleWidthOffset",0),Vue.set(this,"statsWidth",0),Vue.set(this,"ruler",this.$store.services.ruler)}get allStatsFiles(){return _.reject(this.review.files,e=>e.assimilated||!e.segmentedPath)}get filesToMeasure(){if(_get(this,"review","files","joined")&&void 0!==_get(this,"review","context","singleFile"))return this.review.context.singleFile?_get(this,"review","context","onlyFile","segmentedPath")?[this.review.context.onlyFile]:void 0:_.reject(this.review.files,e=>e.assimilated||!e.segmentedPath)}mounted(){this.$observe(()=>this._elideFilePathsNeedsUpdating,e=>{_get(this,"review","context")&&e&&this._updateStyles()}),_get(this,"review","context")&&this._updateStyles()}updated(){_get(this,"review","context")&&this._updateStyles()}get _elideFilePathsNeedsUpdating(){if(!this.tabWidth||!_get(this,"review","context"))return;return this.tabWidth>this.ruler.windowWidth!==this.review.context.elideFilePaths}_updateStyles(){let e,t;const i=this.$el.getElementsByTagName("td")[0],n=this.$el.getElementsByTagName("th")[1];if(this.$el&&!_.isEmpty(this.filesToMeasure)&&i){Vue.set(this,"cellWidth","none"),Vue.set(this.$el.style,"display","block");try{document.body.classList.add("noelide"),document.body.classList.remove("elide"),this.$el.classList.add("noelide"),this.$el.classList.remove("elide"),e=i.getBoundingClientRect().width,t=n.getBoundingClientRect().width,Vue.set(this,"tabWidth",e+13+32.5+32+2+30+23+12.35+26+2+32*this.review.revisions.num.total+r),Vue.set(this.review.context,"elideFilePaths",this.tabWidth>this.ruler.windowWidth),s.style.setProperty("--file-header-width",`${this.tabWidth}px`),this.review.context.elideFilePaths&&(this.$el.classList.remove("noelide"),this.$el.classList.add("elide"),document.body.classList.remove("noelide"),document.body.classList.add("elide"),e=i.getBoundingClientRect().width)}finally{Vue.set(this.$el.style,"display","")}}else e=t=130,Vue.set(this.review.context,"elideFilePaths",!0);Vue.set(this,"singleWidthOffset",`${e+32+32+13}px`),Vue.set(this,"cellWidth",`${e}px`),Vue.set(this,"statsWidth",`${t}px`)}}FileTableRuler.$vueOptions={props:{review:t}};return _declareVue("FileTableRuler",FileTableRuler,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ruler wrapper"},[s("table",{staticClass:"ui celled collapsing unstackable ruler single table"},[e._m(0),s("tbody",e._l(e.filesToMeasure,function(t){return s("tr",{key:t.$key},[s("td",{staticClass:"filename cell"},[s("div",{staticClass:"wrapper"},[e._m(1,!0),s("span",[s("span",{staticClass:"path",domProps:{innerHTML:e._s(t.segmentedPath)}}),s("i",{staticClass:"dropdown icon"})])])])])}),0)]),s("table",{staticClass:"ui celled collapsing unstackable ruler single table stats"},[s("thead",[s("tr",{staticClass:"row all"},[s("th",[s("line-stats",{attrs:{stats:e.review.files.diffs.lineStatsSum,size:e.review.files.diffs.sizeSum}})],1)])]),s("tbody",e._l(e.allStatsFiles,function(e){return s("tr",{key:e.$key},[s("td",[s("line-stats",{attrs:{stats:_get(e,"diff","current","lineStats"),size:_get(e,"diff","current","size")}})],1)])}),0)])])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("thead",[t("tr",{staticClass:"row all"},[t("th")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("span",{staticClass:"toggle-wrapper"},[t("span",{staticClass:"ui circular icon review toggle button"},[t("i",{staticClass:"reviewed icon"})])])}],functional:!1},{cssVarsGetter:function(e){return[[void 0,{f38b9f362ed614dd:e.statsWidth,f38b9f3602646b64:e.cellWidth,f38b9f3617d3d75b:e.singleWidthOffset}]]},scopeId:"data-v-f38b9f36"}
1),{FileTableRuler:FileTableRuler}},!0,!0,{filename:"src/view/reviews/files/file-table-ruler.vue"}),_reviewable.define(["FilenameCell"],["truss","Guide","File"],function(e,t,s){"use strict";class FilenameCell{constructor(){}get fileUrl(){return window.location.href.replace(/(#.*)?$/,"#file"+this.file.$key)}visitFile(){_access(this,"","file","","review","","context","","navigation","","visitFile","call",[this.file])}openFileNewTab(){window.open(this.file.uri)}checkForMissingLineLink(){Vue.set(this.$session.onboarding,"linkedToFile",!0),this.file.editorLinkUrl||this.$store.services.header.toggleHeaderAndAccountSettings()}get createDraftAvailable(){return this.$session.user&&_get(this,"file","diff","current","rightFileRev")}createDraft(){if(!this.createDraftAvailable)return;const e=this.file.diff.current,t=e.review.revisions[e.rightFileRev.$key];_get(t,"commitSha")&&(Vue.set(this.$session.onboarding,"createdFileComment",!0),e.review.state.drafts.createStarterDraft(e.rightFileRev.original.file.$key,t.$key,!1,0))}}FilenameCell.$vueOptions={props:{file:{type:s,required:!0},indent:{type:Number,default:0},sticky:Boolean}};
1return _declareVue("FilenameCell",FilenameCell,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("td",{staticClass:"filename cell"},[s("div",{staticClass:"wrapper"},[s("toggle-file-review-mark-button",{staticClass:"toggle-wrapper",attrs:{file:e.file}}),s("span",{staticClass:"path-area dropdown",style:{"padding-left":15*e.indent+"px"},attrs:{tabindex:"-1"},on:{mousedown:function(e){if("button"in e&&1!==e.button)return null;e.preventDefault()}}},[s("div",{staticClass:"path-wrapper"},[s("span",{staticClass:"path link",class:{trivial:e.file.trivial},attrs:{lang:""}},[s("span",{staticClass:"ui bare icon settings",domProps:{innerHTML:e._s(e.file.segmentedPathHtml)}}),s("i",{staticClass:"dropdown icon",attrs:{alt:"dropdown menu"}})])]),s("tippy-dropdown",{attrs:{fixed:e.sticky,options:Object.assign({},{offset:[0,5],theme:"dropdown-flat-top"},e.sticky?{zIndex:1e6}:{})}},[s("div",{staticClass:"filename-cell ui segment vertical menu"},[s("copy-button",{staticClass:"item copy address",attrs:{icon:"internal-link",text:e.fileUrl,alt:"copy file link"}},[s("span",[e._v("Copy file link")])]),s("copy-button",{staticClass:"copy address item",attrs:{text:e.file.path,alt:"copy file path"}},[s("span",[e._v("Copy file path")])]),s("a",{staticClass:"item",on:{click:e.openFileNewTab}},[s("i",{staticClass:"external icon",attrs:{alt:"open in new tab"}}),s("span",[e._v("Open in new tab")])]),e.file.system?e._e():s("a",{staticClass:"item",attrs:{href:e.file.editorLinkUrl},on:{click:e.checkForMissingLineLink}},[s("i",{staticClass:"editor icon",attrs:{alt:"open line in editor"}}),s("span",[e._v("Open in editor")])]),e.file.system?e._e():s("div",{staticClass:"ui simple dropdown item"},[s("i",{staticClass:"github icon",attrs:{alt:"github"}}),s("span",[e._v("Open on GitHubâ¦")]),s("div",{staticClass:"github sub menu"},[s("a",{staticClass:"item",class:{disabled:!e.file.githubDiffUrl},attrs:{href:e.file.githubDiffUrl}},[s("span",[e._v("View diff")])]),s("a",{staticClass:"item",class:{disabled:!e.file.githubFileUrl},attrs:{href:e.file.githubFileUrl}},[s("span",[e._v("Open file")])]),s("a",{staticClass:"item",class:{disabled:!e.file.githubEditorLink},attrs:{href:e.file.githubEditorLink}},[s("span",[e._v("Edit file")])])])]),e.createDraftAvailable?s("a",{staticClass:"item",class:{disabled:_access(e,"","file","","review","","state","","isLocked","call",[])},on:{click:e.createDraft}},[s("i",{staticClass:"new discussion icon",attrs:{alt:"start a new discussion"}}),s("span",[e._v("Start a new discussion")])]):e._e()],1)])],1)],1)])},staticRenderFns:[],functional:!1},{scopeId:"data-v-b980a476"}),_declareGuides("FilenameCell","data-v-b980a476",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".filename-cell.ui.segment.vertical.menu[data-v-b980a476]",onboarding:"linkedToFileActions",highlight:"bracket","hotkey-action":"\n copyFileLink(), copyFilePath(), openFileInEditor(), viewDiffOnGitHub(), openFileOnGitHub(),\n editFileOnGitHub()\n "}},[s("p",[s("i",{staticClass:"internal-link icon",attrs:{alt:"copy file link"}}),e._v(" "),s("em",[e._v("Copy the link")]),e._v(" for this file to the clipboard.\n ")]),e._v(" "),s("p",[s("i",{staticClass:"clone icon",attrs:{alt:"copy file path"}}),e._v("\n Copy the "),s("em",[e._v("file path")]),e._v(" to the clipboard.\n ")]),e._v(" "),s("p",[s("i",{staticClass:"external icon",attrs:{alt:"open in new tab"}}),e._v(" Open the file "),s("em",[e._v("in a new tab")]),e._v(".\n ")]),e._v(" "),s("p",[s("i",{staticClass:"editor icon",attrs:{alt:"open line in editor"}}),e._v("\n Open this file in "),s("em",[e._v("an external editor of your choosing")]),e._v(". You can configure this in\n your account settings.\n ")]),e._v(" "),s("p",[s("i",{staticClass:"github icon",attrs:{alt:"open diff in GitHub"}}),e._v(" Open the current file diff in\n "),s("em",[e._v("GitHub")]),e._v("'s' file viewer, diff viewer, or editor.\n ")]),e._v(" "),s("p",[s("i",{staticClass:"new discussion icon",attrs:{alt:"start a new discussion"}}),e._v("\n Start a "),s("em",[e._v("new discussion")]),e._v(" for this file, attached to "),s("em",[e._v("no specific line")]),e._v(". Such\n discussions will be displayed at the top of the file, before the diff.\n ")]),e._v(" "),s("p",[e._v("\n (Some actions are not available for virtual files.)\n ")])])],1)},[]),{FilenameCell:FilenameCell}},!0,!0,{filename:"src/view/reviews/files/filename-cell.vue"}),_reviewable.define(["LineStats"],["truss","Guide"],function(e,t){"use strict";class LineStats{constructor(){}}LineStats.$vueOptions={props:{stats:Object,size:Object}};return _declareVue("LineStats",LineStats,null,{render:function(e,t){var s,i=t._c;return i("span",t._g(t._b({class:["stats",t.data.class,t.data.staticClass],style:[t.data.style,t.data.staticStyle]},"span",((s={})[""+t.parent.$options._scopeId]="",s),!1),t.listeners),[_get(t,"props","stats","changed")?i("span",{staticClass:"lines text-orange"},[t._v("\n ~"+t._s(_get(t,"props","stats","changed"))+"\n ")]):t._e(),_get(t,"props","stats","inserted")?
1i("span",{staticClass:"lines text-green"},[t._v("\n +"+t._s(_get(t,"props","stats","inserted"))+"\n ")]):t._e(),_get(t,"props","stats","deleted")?i("span",{staticClass:"lines text-red"},[t._v("\n -"+t._s(_get(t,"props","stats","deleted"))+"\n ")]):t._e(),_get(t,"props","size","increased")?i("span",{staticClass:"lines text-green"},[t._v("\n +"+t._s(_get(t,"props","size","increased"))+"\n ")]):t._e(),_get(t,"props","size","decreased")?i("span",{staticClass:"lines text-red"},[t._v("\n -"+t._s(_get(t,"props","size","decreased"))+"\n ")]):t._e(),_get(t,"props","stats","unknown")?i("span",{staticClass:"lines text-grey"},[t._v("\n â¦\n ")]):t._e()])},staticRenderFns:[],functional:!0},{scopeId:"data-v-7371c1a0"}),_declareGuides("LineStats","data-v-7371c1a0",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".stats[data-v-7371c1a0]",onboarding:"sawStats",highlight:"under"}},[s("p",[e._v("\n Number of "),s("span",{staticClass:"text-orange"},[e._v("~lines changed")]),e._v(",\n "),s("span",{staticClass:"text-green"},[e._v("+lines or bytes added")]),e._v(", and\n "),s("span",{staticClass:"text-red"},[e._v("-lines or bytes removed")]),e._v(" in a file's (or the review's) current\n diff, or ⦠if not yet known or unable to compute.\n ")])])],1)},[]),{LineStats:LineStats}},!0,!0,{filename:"src/view/reviews/files/line-stats.vue"}),_reviewable.define(["MarkReviewed"],["truss","Guide","modifiers"],function(e,t,s){"use strict";class MarkReviewed{constructor(){Vue.set(this,"modifiers",s)}get messageToDisplay(){return this.review.files.num.currentToReview>1?"goToNext":this.review.files.num.moreToReviewThanCurrent?"diffNext":1===this.review.files.num.currentToReview?"goToConclusion":void 0}}MarkReviewed.$vueOptions={props:{review:{type:Object,required:!0},file:{type:Object,required:!0}}};return _declareVue("MarkReviewed",MarkReviewed,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("span",{staticClass:"toggle and advance button"},[s("span",{staticClass:"ui circular icon relative review toggle button",class:[e.file.reviewMarkStyle,{red:"review"===e.file.reviewMarkStyle}]},["self-review"===e.file.reviewMarkStyle?s("span",{staticClass:"self-review disc"}):e._e(),s("i",{staticClass:"unreviewed icon",attrs:{alt:"self-review"===e.file.reviewMarkStyle?"mark as self-reviewed":"mark as reviewed"}})]),s("span",{staticClass:"contents"},[e._v("\n Mark "+e._s(e.file.reviewMarkStyle)+"ed\n ")]),s("animate-wipe-right",[s("span",{directives:[{name:"show",rawName:"v-show",value:"goToNext"===e.messageToDisplay,expression:"messageToDisplay === 'goToNext'"}],staticClass:"contents"},[e._v("\n  and go to "),s("animate-flip",[e.modifiers.shiftDown?s("span",{key:"prev",staticClass:"prev"},[e._v("prev")]):s("span",{key:"next",staticClass:"next"},[e._v("next")])]),e._v(" file\n ")],1)]),s("animate-wipe-right",[s("span",{directives:[{name:"show",rawName:"v-show",value:"diffNext"===e.messageToDisplay,expression:"messageToDisplay === 'diffNext'"}],staticClass:"contents"},[e._v("\n  and diff next revision\n ")])]),s("animate-wipe-right",[s("span",{directives:[{name:"show",rawName:"v-show",value:"goToConclusion"===e.messageToDisplay,expression:"messageToDisplay === 'goToConclusion'"}],staticClass:"contents"},[e._v("\n  and go to conclusion\n ")])])],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-92a00e30"}),_declareGuides("MarkReviewed","data-v-92a00e30",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".toggle.and.advance.button[data-v-92a00e30]",onboarding:"markFileReviewedAndAdvance",position:"bottom","hotkey-action":"markFileReviewedAndAdvance()"}},[s("p",[s("em",[e._v("Mark file as reviewed")]),e._v(" and advance to the "),s("em",[e._v("next file to review")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n This doesn't mean that you think the file is good to merge,\n just that "),s("em",[e._v("you've looked at it")]),e._v(" and made all the comments you wanted.\n Later, you'll be able to "),s("em",[e._v("easily diff")]),e._v("\n against the "),s("em",[e._v("last revision you reviewed")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n If there are no more files to review at the currently diffed revision,\n this will also automatically "),s("em",[e._v("switch to the next revision to review")]),e._v(".\n ")])])],1)},[]),{MarkReviewed:MarkReviewed}},!0,!0,{filename:"src/view/reviews/files/mark-reviewed.vue"}),_reviewable.define(["ModeStats"],["truss","Guide"],function(e,t){"use strict";class ModeStats{constructor(){}}ModeStats.$vueOptions={props:{modeChange:String}};return _declareVue("ModeStats",ModeStats,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("span",{staticClass:"modes"},[s("span",{staticClass:"lines text-grey"},[e._v("\n "+e._s(_get(e,"modeChange"))+"\n ")])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-61cb0a3b"}),_declareGuides("ModeStats","data-v-61cb0a3b",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".modes[data-v-61cb0a3b]",onboarding:"sawModes",highlight:"under"}},[s("p",[e._v("\n The change in "),s("em",[e._v("file mode")]),e._v(" between the left and right diff bounds, or an\n indication that the file is a symbolic link (symlink).\n ")])])],1)},[]),{ModeStats:ModeStats}},!0,!0,{filename:"src/view/reviews/files/mode-stats.vue"}),_reviewable.define(["NextFile"],["truss"],function(e){"use strict";class NextFile{constructor(){}}return _declareVue("NextFile",NextFile,null,{render:function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},staticRenderFns:[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("span",{staticClass:"contents"},[s("i",{staticClass:"large green next file icon"}),e._v(" Go to next file\n")])}],functional:!1},{scopeId:"data-v-69a74e2f"}),{NextFile:NextFile}},!0,!0,{filename:"src/view/reviews/files/next-file.vue"}),_reviewable.define(["PriorArcs"],["truss","Guide","Revisions"],function(e,t,s){"use strict";const i=32,r=15;class PriorArcs{constructor(){Vue.set(this,"ctx",void 0)}mounted(){Vue.set(this,"ctx",this.$el.getContext("2d")),this.$observe(()=>this.priorRevisionKeys,()=>this.paintArcs())}get priorRevisionKeys(){return _.map(_get(this,"revisions","list"),"priorRevisionKey")}paintArcs(){if(!_get(this,"revisions","list")||this.$destroyed)return;const e=this.computeRuns();if(e.length)try{const t=this.ctx,s=this.revisions.list.length*i;this.$el.setAttribute("width",s),this.$el.setAttribute("height",r),Vue.set(this.$el.style,"width",`${s}
1px`),Vue.set(this.$el.style,"display","block"),t.clearRect(0,0,s,r),Vue.set(t,"strokeStyle","#ddd"),Vue.set(t,"lineWidth",1);for(const s of e){this.drawBracket(s.priorStartIndex,s.priorEndIndex),this.drawBracket(s.startIndex,s.endIndex);const e=(s.priorStartIndex+s.priorEndIndex)/2*i+16,r=(s.startIndex+s.endIndex)/2*i+16;t.beginPath(),t.moveTo(e,10),t.quadraticCurveTo((e+r)/2,0,r,10),t.stroke()}}catch(e){if("can't access dead object"===e.message)return;throw e}else Vue.set(this.$el.style,"display","none")}drawBracket(e,t){const s=this.ctx,r=e*i+1.5,n=(t+1)*i-2.5;s.beginPath(),s.moveTo(r,14),s.lineTo(r,10.5),s.lineTo(n,10.5),s.lineTo(n,14),s.stroke()}computeRuns(){if(!_get(this,"revisions","list"))return[];const e=_.map(this.revisions.list,"index");e.reverse();let t=[];for(;;){const s=this.computeNextChain(e);if(!s)break;t=t.concat(s)}return this.expandRuns(t),t}computeNextChain(e){let t=this.findNextInitialRun(e);if(!t)return;const s=[];for(;t;)s.push(t),t=this.findNextChainedRun(e,t);return s}findNextInitialRun(e){const t={};if(Vue.set(t,"endIndex",_.find(e,e=>_get(this,"revisions","list",e,"priorRevisionKey"))),void 0===t.endIndex)return void e.splice(0,1/0);e.splice(0,_.indexOf(e,t.endIndex)),Vue.set(t,"startIndex",t.endIndex+1);const s=[];for(;t.startIndex>0&&_.includes(e,t.startIndex-1)&&!_.includes(s,t.startIndex-1);){t.startIndex--,_.pull(e,t.startIndex);const i=this.revisions.list[t.startIndex];if(i.priorRevisionKey){const t=this.revisions[i.priorRevisionKey].index;_.includes(e,t)&&s.push(t)}}if(!s.length)return;_.assign(t,{priorStartIndex:_.min(s),priorEndIndex:_.max(s)});const i=_.range(t.priorStartIndex,t.priorEndIndex+1);return _.difference(i,e).length?void 0:(_.pull(e,...i),t)}findNextChainedRun(e,t){const s=_(this.revisions.list).slice(t.priorStartIndex,t.priorEndIndex+1).map("priorRevisionKey").compact().map(e=>this.revisions[e].index).intersection(e).value();if(!s.length)return;const i={startIndex:t.priorStartIndex,endIndex:t.priorEndIndex,priorStartIndex:_.min(s),priorEndIndex:_.max(s)},r=_.range(i.priorStartIndex,i.priorEndIndex+1);return _.difference(r,e).length?void 0:(_.pull(e,...r),i)}expandRuns(e){const t=new Set;for(const s of e)t.add(s.endIndex),t.add(s.priorEndIndex);for(const s of e){do{s.priorStartIndex-=1}while(s.priorStartIndex>=0&&!t.has(s.priorStartIndex));s.priorStartIndex+=1}}}PriorArcs.$vueOptions={props:{revisions:{type:s,required:!0}}};return _declareVue("PriorArcs",PriorArcs,null,{render:function(){var e=this.$createElement;return(this._self._c||e)("canvas",{staticClass:"prior arcs"})},staticRenderFns:[],functional:!1},{scopeId:"data-v-22989926"}),_declareGuides("PriorArcs","data-v-22989926",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".prior.arcs[data-v-22989926]",onboarding:"sawPriorArcs",highlight:"under",position:"top"}},[s("p",[e._v("\n These lines "),s("em",[e._v("connect")]),e._v(" ranges of "),s("em",[e._v("rebased revisions")]),e._v(" that Reviewable tries to\n match up using the old and new commits' messages. You can see individual pairings in each\n file diff's header but they can get too tangled to display here.\n ")]),e._v(" "),s("p",[e._v('\n When the review mode is set to "review each commit separately", Reviewable will pair up\n matching revisions for diffs.\n ')])])],1)},[]),{PriorArcs:PriorArcs}},!0,!0,{filename:"src/view/reviews/files/prior-arcs.vue"}),_reviewable.define(["StatsMatrixRow"],["truss"],function(e){"use strict";class StatsMatrixRow{constructor(){}get diff(){return _get(this,"row","file","diff","current")}get lineStatsProps(){return{stats:_get(this,"diff","lineStats"),size:_get(this,"diff","size")}}get shouldShowDiffStats(){return _get(this,"row","file","review","context","shownMatrixColumns","diffStats")&&!_get(this,"row","file","files","allLineStatsEmpty")}get shouldShowCommitsList(){return _get(this,"row","file","review","context","shownMatrixColumns","commits")}get shouldShowCodeCoverage(){return _get(this,"row","file","review","context","shownMatrixColumns","codeCoverage")}}StatsMatrixRow.$vueOptions={props:{row:{required:!0}}};return _declareVue("StatsMatrixRow",StatsMatrixRow,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;
1return s("tr",{staticClass:"row",class:[e.row.type]},["file"===this.row.type?[s("td",{staticClass:"diff stats",class:{collapse:!e.shouldShowDiffStats}},[s("line-stats",e._b({},"line-stats",e.lineStatsProps,!1))],1),s("td",{staticClass:"commits",class:{collapse:!e.shouldShowCommitsList}},[s("commits-list",{directives:[{name:"show",rawName:"v-show",value:e.diff&&!_get(e,"diff","lineStatsEmpty"),expression:"diff && !~diff.lineStatsEmpty"}],attrs:{file:e.row.file}})],1),void 0!==_get(this,"diff","rightCoverage","branchPercentage")?s("td",{staticClass:"coverage",class:{collapse:!e.shouldShowCodeCoverage}},[s("coverage-stats",{attrs:{"left-coverage":_get(e,"diff","leftCoverage"),"right-coverage":_get(e,"diff","rightCoverage")}})],1):e._e()]:e._e()],2)},staticRenderFns:[],functional:!1},{scopeId:"data-v-5d6c1d17"}),{StatsMatrixRow:StatsMatrixRow}},!0,!0,{filename:"src/view/reviews/files/stats-matrix-row.vue"}),_reviewable.define(["ToggleFileReviewMarkButton"],["truss","File"],function(e,t){"use strict";class ToggleFileReviewMarkButton{constructor(){}}ToggleFileReviewMarkButton.$vueOptions={props:{file:{type:t,required:!0}}};return _declareVue("ToggleFileReviewMarkButton",ToggleFileReviewMarkButton,null,{render:function(e,t){var s;return(0,t._c)("toggle-review-mark-button",t._b({staticClass:"file toggle",class:[t.data.class,t.data.staticClass],style:[t.data.style,t.data.staticStyle],attrs:{"review-mark-style":t.props.file.reviewMarkStyle,"review-level":t.props.file.reviewLevel},on:{click:function(e){return t.props.file.toggleReviewed()}}},"toggle-review-mark-button",((s={})[""+t.parent.$options._scopeId]="",s),!1))},staticRenderFns:[],functional:!0},{}),{ToggleFileReviewMarkButton:ToggleFileReviewMarkButton}},!0,!0,{filename:"src/view/reviews/files/toggle-file-review-mark-button.vue"}),_reviewable.define(["ToggleReviewMarkButton"],["truss","Guide"],function(e,t){"use strict";const s=[{class:"disabled",icon:"unreviewed",alt:"mark as reviewed disabled",selfReviewAlt:"mark as self-reviewed disabled"},{color:"red",icon:"unreviewed",alt:"mark as reviewed",selfReviewAlt:"mark as self-reviewed"},{class:"outline",color:"red",icon:"unreviewed",alt:"mark as reviewed (not recommended)",selfReviewAlt:"mark as self-reviewed (not recommended)"},{class:"outline",color:"green",icon:"reviewed",alt:"mark as reviewed (already reviewed by somebody else)",selfReviewAlt:null},{class:"outline",color:"green",icon:"reviewed",alt:"mark as reviewed (already reviewed later)",selfReviewAlt:"mark as self-reviewed (already self-reviewed later)"},{color:"green",icon:"reviewed",alt:"mark as unreviewed",selfReviewAlt:"mark as not self-reviewed"}];class ToggleReviewMarkButton{constructor(){}get state(){let e=s[_.clamp(_.defaultTo(this.reviewLevel,-1)+1,5)];return"self-review"===this.reviewMarkStyle&&(e={...e,alt:e.selfReviewAlt}),e}get buttonClass(){const e=this.state.color&&("self-review"===this.reviewMarkStyle?`self-review-${this.state.color}`:this.state.color);return[this.state.class,e]}}ToggleReviewMarkButton.$vueOptions={props:{reviewMarkStyle:{type:String,default:"review",validator:_.oneOf("review","self-review")},reviewLevel:Number}};return _declareVue("ToggleReviewMarkButton",ToggleReviewMarkButton,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("span",{on:{click:function(e){e.stopPropagation()},mousedown:function(e){e.stopPropagation()}}},[s("ui-button",{staticClass:"circular icon review toggle",class:[_get(e,"buttonClass"),e.reviewMarkStyle],on:{click:function(t){return e.$emit("click",t)}}},["self-review"===e.reviewMarkStyle?s("span",{staticClass:"self-review disc"}):e._e(),s("i",{staticClass:"icon",class:_get(e,"state","icon"),attrs:{alt:_get(e,"state","alt")}})])],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-e46541ee"}),_declareGuides("ToggleReviewMarkButton","data-v-e46541ee",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".file.toggle .review.toggle[data-v-e46541ee]:not(.disabled)",onboarding:"markedFileReviewed",position:"left","hotkey-action":"toggleCurrentFileReviewed()"}},[s("p",[s("em",[e._v("Mark file as reviewed")]),e._v(" up to its current right diff bound. This doesn't mean that you\n think the file is good to merge, just that "),s("em",[e._v("you've looked at it")
1]),e._v(" and made all the\n comments you wanted.\n ")]),e._v(" "),s("p",[e._v("\n Click on a "),s("span",{staticClass:"ui red label"},[e._v("red")]),e._v(" button to make it\n "),s("span",{staticClass:"ui green label"},[e._v("green")]),e._v(", and you will later be able to "),s("em",[e._v("easily diff")]),e._v("\n against the "),s("em",[e._v("last revision you reviewed")]),e._v(".\n ")]),e._v(" "),s("div",[e._v("The button reflects the current state:")]),e._v(" "),s("dl",{staticClass:"wide-35"},[s("dt",[s("span",{staticClass:"ui circular icon review toggle button red"},[s("i",{staticClass:"unreviewed icon",attrs:{alt:"mark as reviewed"}})])]),e._v(" "),s("dd",[s("em",[e._v("Not reviewed")]),e._v(" at or after right diff bound; click to mark as reviewed.")]),e._v(" "),s("dt",[s("span",{staticClass:"ui circular icon review toggle button green"},[s("i",{staticClass:"reviewed icon",attrs:{alt:"mark as unreviewed"}})])]),e._v(" "),s("dd",[s("em",[e._v("Reviewed by you")]),e._v(" at right diff bound; click to take back your mark.")]),e._v(" "),s("dt",[s("span",{staticClass:"ui circular icon review toggle button self-review self-review-red"},[s("span",{staticClass:"self-review disc"}),e._v(" "),s("i",{staticClass:"unreviewed icon",attrs:{alt:"mark as self-reviewed"}})])]),e._v(" "),s("dd",[s("em",[e._v("Not self-reviewed by you")]),e._v(" at or after right diff bound; click to mark as\n self-reviewed, which usually doesn't count toward review completion.\n ")]),e._v(" "),s("dt",[s("span",{staticClass:"ui circular icon review toggle button self-review self-review-green"},[s("span",{staticClass:"self-review disc"}),e._v(" "),s("i",{staticClass:"unreviewed icon",attrs:{alt:"mark as not self-reviewed"}})])]),e._v(" "),s("dd",[s("em",[e._v("Self-reviewed by you")]),e._v(" at right diff bound; click to take back your mark.")]),e._v(" "),s("dt",[s("span",{staticClass:"ui circular icon review toggle button red outline"},[s("i",{staticClass:"unreviewed icon",attrs:{alt:"mark as reviewed (not recommended)"}})])]),e._v(" "),s("dd",[s("em",[e._v("Not reviewed")]),e._v(" at or after right diff bound; "),s("em",[e._v("marking not advised")]),e._v(" because\n some unreviewed changes are not shown in the current diff or the review is\n "),s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/reviews#deferring-a-review"}},[e._v("deferred")]),e._v(".\n ")]),e._v(" "),s("dt",[s("span",{staticClass:"ui circular icon review toggle button green outline"},[s("i",{staticClass:"reviewed icon",attrs:{alt:"mark as reviewed (already reviewed later or by somebody else)"}})])]),e._v(" "),s("dd",[s("em",[e._v("Reviewed by you or somebody else")]),e._v(" at or after right diff bound; marking\n as reviewed is redundant.")])])]),e._v(" "),s("guide",{attrs:{for:".group.toggle .review.toggle[data-v-e46541ee]",onboarding:"markedFileGroupReviewed",position:"left"}},[s("p",[s("em",[e._v("Mark all files in the group reviewed")]),e._v(" up to their current right diff bound. You can\n only do this if they all have the same right diff bound.\n ")]),e._v(" "),s("p",[e._v("\n The button "),s("em",[e._v("reflects the least reviewed state")]),e._v(" of all the group's files. The semantics\n are the same as the mark reviewed button for individual files.\n ")])])],1)},[]),{ToggleReviewMarkButton:ToggleReviewMarkButton}},!0,!0,{filename:"src/view/reviews/files/toggle-review-mark-button.vue"}),_reviewable.define(["findFlowPanel","FlowPanel"],["truss","Guide","animator","bus","dom","session"],function(e,t,s,i,r,n){"use strict";const a=new WeakMap,o=["position","left","transform","transition"];const l=new class MaxPanelWidthTracker{constructor(){Vue.set(this,"panels",new Set),Vue.set(this,"_debouncedHandleResize",_.debounce(this._handleResize.bind(this),100)),Vue.set(this,"panelObserver",new ResizeObserver(this._debouncedHandleResize)),Vue.set(this,"ruler",void 0)}_handleResize(){if(!this.ruler)throw new Error("Reference to ruler service not found.");const e={diff:null,info:null,matrix:null};this.panels.forEach(t=>{if(!t.expanded)return;const s=_get(t,"$el","clientWidth"),i=null===e[t.type]||s>e[t.type];_.isFinite(s)&&i&&Vue.set(e,t.type,s)}),_.forEach(e,(e,t)=>{e&&this.ruler.updateFlowOffset(e,t)}),e.info&&!e.diff&&this.ruler.updateFlowOffset(e.info,"diff")}
1initializePanel(e){e.sidebar||(this.panels.add(e),!this.ruler&&e.ruler&&Vue.set(this,"ruler",e.ruler),_get(e,"$el")&&this.panelObserver.observe(e.$el))}teardownPanel(e){e.sidebar||(this.panels.delete(e),this.panelObserver.unobserve(e.$el))}},c=getComputedStyle(document.documentElement),u=_.parseInt(c.getPropertyValue("--statusbar-height")),d={diff:"fitted",matrix:"clamped fitted"};class FlowPanel{constructor(){Vue.set(this,"ruler",this.$store.services.ruler),Vue.set(this,"statusbarHeight",u),Vue.set(this,"resizeObserver",void 0),Vue.set(this,"titleWidth",0),Vue.set(this,"active",void 0),Vue.set(this,"teleportTarget",`#${this.panelKey}-content`),Vue.set(this,"flowAnimationReady",!1),Vue.set(this,"overlaid",!1),Vue.set(this,"collapseSaved",!1),Vue.set(this,"stylesheet",new CSSStyleSheet),Vue.set(this,"lastRulesText",void 0),Vue.set(this,"selectionTranslation",null),Vue.set(this,"savedPositioningStyles",null)}created(){Vue.set(document,"adoptedStyleSheets",[...document.adoptedStyleSheets,this.stylesheet]),(this.collapsible||this.sidebar)&&this.context.addPanelToggle(this.panelKey,!this.sidebar,this.sidebar)}updateFlowTransform(){const e=this.getScopedStyleAttributes(this).join("");let t="";switch(this.type){case"diff":t='[type="diff"]';break;case"info":t='[type="info"]:not([inline])';break;case"matrix":t='[type="matrix"]:not([inline])'}const s=this.flowOffset,i=`.panel.root:not(.in-sidebar)${e}${t}`,r=`.header-stacking-layer .panel.bouncer[type='${this.type}']`,n=s-6.5,a=`.panel.root:not(.in-sidebar)${e}[inline][first-in-row]`,o=[];this.expanded?(o.push(`${i} { transform: translateX(${s}px) !important; }`),o.push(`${r} { margin-left: ${n}px !important; }`)):o.push(`${i} { margin-left: ${s}px !important; }`),o.push(`${a} { margin-left: ${s}px !important; }`);const l=o.join("\n");l!==this.lastRulesText&&(Vue.set(this,"lastRulesText",l),this.stylesheet.replaceSync(l),Vue.set(this,"flowAnimationReady",!0))}get flowOffset(){switch(this.type){case"info":return this.ruler.flowOffset.info;case"matrix":return this.ruler.flowOffset.matrix||this.ruler.flowOffset.info;default:return this.ruler.flowOffset.diff}}startSelectionPositioning(){if(null!==this.selectionTranslation||!this.expanded||this.sidebar)return;if(!_get(this,"$el"))return;const e=this.readRenderedTranslation();if(!_.isFinite(e))return;Vue.set(this,"selectionTranslation",e);const t=this.$el.style;Vue.set(this,"savedPositioningStyles",_.map(o,e=>({property:e,value:t.getPropertyValue(e),priority:t.getPropertyPriority(e)}))),this.writePositioningStyles(e,0)}stopSelectionPositioning(){if(null===this.selectionTranslation)return;const e=this.selectionTranslation;if(Vue.set(this,"selectionTranslation",null),!_get(this,"$el"))return;this.writePositioningStyles(0,e);const t=this.$el.style;_.forEach(this.savedPositioningStyles,({property:e,value:s,priority:i})=>{s?t.setProperty(e,s,i):t.removeProperty(e)}),Vue.set(this,"savedPositioningStyles",null)}readRenderedTranslation(){const e=getComputedStyle(this.$el).transform;return e&&"none"!==e?new DOMMatrixReadOnly(e).m41:0}writePositioningStyles(e,t){const s=this.$el.style;s.setProperty("transition","none"),s.setProperty("position","relative"),s.setProperty("left",`${e}px`),s.setProperty("transform",`translateX(${t}px)`,"important"),this.$el.offsetWidth}getScopedStyleAttributes(e){const t=e&&e.$el;return t&&t.nodeType===Node.ELEMENT_NODE?_(t.attributes).map(e=>e.name).filter(e=>/^data-v-\w+$/.test(e)).map(e=>`[${e}]`).value():[]}mounted(){this.bare||(Vue.set(this,"resizeObserver",new ResizeObserver(e=>{requestAnimationFrame(()=>{Vue.set(this,"titleWidth",e[0].borderBoxSize[0].inlineSize)})})),this.$waitForRefs("title",e=>{this.resizeObserver.observe(e,{box:"border-box"})})),l.initializePanel(this),_get(this,"$el")&&a.set(this.$el,this),this.$observe(()=>this.ruler.flowOffset,()=>{this.updateFlowTransform()},{deep:!0}),this.$when(()=>this.expandedReady).then(()=>{this.expanded||this.$el.setAttribute("inline","")})}beforeDestroy(){this.resizeObserver&&this.resizeObserver.disconnect(),l.teardownPanel(this),_get(this,"$el")&&a.delete(this.$el),Vue.set(document,"adoptedStyleSheets",_.filter(d
1ocument.adoptedStyleSheets,e=>e!==this.stylesheet))}handleOverlayContentVisible(e){Vue.set(this,"teleportTarget",e?`#${this.panelKey}-overlay`:`#${this.panelKey}-content`),Vue.set(this,"overlaid",e),Vue.set(this.toggle,"transitioned",e)}handleOverlayVisible(e){Vue.set(this.toggle,"overlaid",e)}handleIntersection(e,t){Vue.set(this,"active",e),this.expanded&&this.updateActivePanel(e)}get fastTransitionDuration(){return s.defaultOptions.duration/2}get reflowKey(){return"diff"===this.type?null:this.panelKey}get fitted(){return _.includes(d[this.type],"fitted")}get clamped(){return this.forceClamped||_.includes(d[this.type],"clamped")}get toggle(){return this.context.toggles[this.panelKey]||{}}get expanded(){return!this.collapsible||this.toggle.showing}get expandedReady(){return void 0!==this.expanded}get transitionInProgress(){return this.reflowStatus.inProgress}get diffPaddingOffset(){return("two"===this.ruler.diffColumns?0:1)+"rem"}showOverlay(){this.collapsible&&!this.toggle.showing&&Vue.set(this.toggle,"overlay",!0)}toggleExpanded(){if(!this.collapsible||this.transitionInProgress)return;Vue.set(n.onboarding,"collapsedPanel",!0);const e=Vue.set(this.toggle,"showing",!this.toggle.showing);this.animateReflow({delay:!e&&s.defaultOptions.duration,enterTargetState:e?()=>this.$el.removeAttribute("inline"):()=>this.$el.setAttribute("inline","")}),this.active&&this.updateActivePanel(e),_.delay(async()=>{if(await this.$when(()=>!this.transitionInProgress),Vue.set(this,"collapseSaved",!0),_.delay(()=>{Vue.set(this,"collapseSaved",!1)},500),!e){const e=document.querySelector(`[data-target-panel="${this.panelKey}"]`);e&&i.trace({from:{element:this.$refs.maximizeIcon,side:"right"},to:{element:e,side:e.getAttribute("data-trace-side")},duration:s.shouldAnimate()?1e3:500})}},s.defaultOptions.duration)}updateActivePanel(e){this.sidebar||(e?(_get(this,"context","review","files",this.panelKey)&&Vue.set(this.context.navigation,"lastVisitedFileKey",this.panelKey),Vue.set(this.context,"activePanelKey",this.panelKey)):(Vue.set(this.context,"activePanelKey",null),Vue.set(this.context,"deactivatedPanelScrollDirection",this.$refs.wrapper.getBoundingClientRect().bottom<=u?1:-1)))}}FlowPanel.$vueOptions={props:{panelKey:{type:String,required:!0},context:{type:Object,required:!0},accentColor:{type:String,default:"--grey-6"},dimmed:Boolean,collapsible:Boolean,bare:Boolean,extra:Boolean,forceClamped:Boolean,sidebar:Boolean,type:{type:String,default:"diff",validator:e=>_.includes(["diff","info","matrix"],e)}},inject:{animateReflow:{default:_.noop},reflowStatus:{default:{inProgress:!1}}},provide:function(){return{flowPanel:this}}};return _declareVue("FlowPanel",FlowPanel,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"panel root",class:{collapsible:e.collapsible,expanded:e.expanded,clamped:e.clamped,fitted:e.fitted,bare:e.bare,extra:e.extra,collapsed:!e.expanded,transition:e.flowAnimationReady,"in-sidebar":e.sidebar},attrs:{type:e.type,"data-reflow-key":e.reflowKey},on:{mousedown:function(t){return e.$emit("select")}}},[s("div",{directives:[{name:"vue-element-spy",rawName:"v-vue-element-spy",value:{callback:e.handleIntersection,context:"panels",watchExit:!0,offset:e.statusbarHeight,shouldSpy:!e.sidebar},expression:"{\n callback: handleIntersection,\n context: 'panels', watchExit: true,\n offset: statusbarHeight,\n shouldSpy: !sidebar\n }"}],ref:"wrapper",staticClass:"panel wrapper",attrs:{"data-panel-key":e.panelKey}},[s("inverted-layers",[e.bare?e._e():s("div",{staticClass:"top panel edge"},[s("div",{ref:"title",staticClass:"panel title"},[s("div",{staticClass:"left filler"}),s("div",{staticClass:"right filler"}),s("div",{staticClass:"panel bouncer ui dimmable",class:{dimmed:e.dimmed||!e.expandedReady},attrs:{type:e.type}},[s("div",{staticClass:"ui simple inverted dimmer"},[s("div",{staticClass:"ui loader"})]),e._t("title",null,{overlaid:e.overlaid})],2),s("animate-fade-in-out",[s("div",{directives:[{name:"show",rawName:"v-show",value:e.expandedReady&&!e.expanded,expression:"expandedReady && !expanded"}],staticClass:"ui bare icon maximize button",on:{click:e.showOverlay}},[s("i",{ref:"maximizeIcon",staticClass:"maximize icon"}
1)])])],1),s("span",{staticClass:"after anchor"},[e.collapsible&&e.expandedReady?s("span",{staticClass:"expand collapse button"},[s("ui-expand-collapse-button",{attrs:{expanded:e.expanded,locked:e.transitionInProgress},on:{click:e.toggleExpanded}}),s("span",{directives:[{name:"show",rawName:"v-show",value:e.collapseSaved,expression:"collapseSaved"}],staticClass:"save notification"},[s("i",{staticClass:"save icon"})])],1):e._e(),s("animate-wipe-right",{attrs:{duration:"/=2",delay:e.expanded?e.fastTransitionDuration:0}},[s("span",{directives:[{name:"show",rawName:"v-show",value:e.expanded,expression:"expanded"}],staticClass:"after title"},[e._t("after-title")],2)])],1)]),e.expandedReady?s("div",{staticClass:"panel outer"},[s("animate-slide-down",{attrs:{duration:"*=1",delay:e.expanded?e.fastTransitionDuration:0}},[s("div",{directives:[{name:"show",rawName:"v-show",value:e.expanded,expression:"expanded"}],staticClass:"panel layer"},[s("div",{staticClass:"decor"},[e._t("decor")],2),s("div",{attrs:{id:e.panelKey+"-content"}}),s("div",{staticClass:"bottom padding"})])])],1):e._e()])],1),s("modal-overlay",{staticClass:"overlay",attrs:{closable:""},on:{"content-visible":e.handleOverlayContentVisible,"overlay-visible":e.handleOverlayVisible},scopedSlots:e._u([{key:"decor",fn:function(){return[s("div",{staticClass:"decor"},[e._t("decor")],2)]},proxy:!0}],null,!0),model:{value:e.toggle.overlay,callback:function(t){e.$set(e.toggle,"overlay",t)},expression:"toggle.overlay"}},[s("h3",{staticClass:"ui center aligned header"},[e._t("title",null,{overlaid:e.overlaid})],2),s("div",{attrs:{id:e.panelKey+"-overlay"}})]),!e.collapsible||e.toggle.shown?s("teleport",{staticClass:"teleporter",attrs:{to:e.teleportTarget,disabled:!e.teleportTarget}},[s("div",{staticClass:"panel content"},[e._t("content",null,{overlaid:e.overlaid}),e.extra?[s("div",{staticClass:"ui panel divider"}),s("ui-details",{staticClass:"basic fluid",attrs:{"is-open":e.toggle.extraSegmentOpen,disabled:e.toggle.extraSegmentDisabled,stealthy:!e.$slots.extra,id:e.panelKey+"-extra"},on:{toggle:function(t){return e.toggle.toggleExtra()}},scopedSlots:e._u([{key:"summary",fn:function(){return[e._t("extra-title")]},proxy:!0}],null,!0)},[e._t("extra")],2)]:e._e()],2)]):e._e()],1)},staticRenderFns:[],functional:!1},{cssVarsGetter:function(e){return[[!0,{a857679af93ba26e:e.diffPaddingOffset,a857679a1c3a3d6e:e.titleWidth+"px",a857679a0b7731dd:`var(${e.accentColor})`,a857679a0b7731dd:`var(${e.accentColor})`,a857679a0b7731dd:`var(${e.accentColor})`}]]},scopeId:"data-v-a857679a"}),_declareGuides("FlowPanel","data-v-a857679a",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".expand.collapse.button[data-v-a857679a]",onboarding:"collapsedPanel"}},[s("p",[s("em",[e._v("Collapse or expand")]),e._v(" the panel. This also sets your "),s("em",[e._v("default state")]),e._v(" for the\n panel when opening any review.\n ")]),e._v(" "),s("p",[e._v("\n Collapsed panels can be "),s("em",[e._v("opened full-screen")]),e._v(" by clicking on their title or on the\n corresponding button in the toolbar.\n ")])])],1)},[]),{findFlowPanel:function(e){const t=r.findClosestElement(e,".panel.root");return t&&a.get(t)||null},FlowPanel:FlowPanel}},!0,!0,{filename:"src/view/reviews/flow-panel.vue"}),_reviewable.define(["ManyItemsWarning"],["truss"],function(e){"use strict";class ManyItemsWarning{constructor(){}}ManyItemsWarning.$vueOptions={props:{context:Object,itemName:{type:String,required:!0},panelKey:{type:String,required:!0}}};return _declareVue("ManyItemsWarning",ManyItemsWarning,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("tbody",[s("tr",{attrs:{colspan:"4"}},[s("td",{staticClass:"ui icon message"},[s("i",{staticClass:"warning sign icon"}),s("div",{staticClass:"content"},[e._v("\n This review has many "+e._s(e.itemName)+", which may reduce performance.\n "),s("div",{staticClass:"actions"},[s("ui-button",{staticClass:"basic circular",on:{click:function(t){return e.$emit("show-all")}}},[s("i",{staticClass:"overflow icon"}),e._v("Show all "+e._s(e.itemName)+"\n ")]),s("ui-button",{staticClass:"basic circular",on:{click:function(t){return e.context.navigation.overlayPanel(e.panelKey)}}},[s("i",{staticClass:"maximize icon"}),e._v("Open in overlay mode\n ")]),s("span",{staticClass:"unobtrusive center-text"},[e._v("\n Reload the page to hide all "+e._s(e.itemName)+" again.\n ")])],1)])])])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-4c5426b2"}),{ManyItemsWarning:ManyItemsWarning}},!0,!0,{filename:"src/view/reviews/many-items-warning.vue"}),_reviewable.define(["MergeButton"],["truss","Guide","shared"],function(e,t,s){"use strict";class MergeButton{constructor(){Vue.set(this,"connector",void 0)}created(){Vue.set(this,"connector",this.$connect(this,{reviewStatus:()=>_ref(this.$store,"child","reviews",_get(this,"review","$key"),"statuses",_get(this,"review","core","lastRevisionKey"),"services",s.reviewableStatusContext),mergeQueue:()=>_ref(this.$store,"child","reviews",_get(this,"review","$key"),"mergeQueue")}))}get shouldOfferOptions(){return this.offerOptions&&_get(this,"review","repository","core","settings","merge")&&"label"!==this.review.repository.core.settings.merge.mechanism}get reviewSettings(){return _get(this,"$store","users","current","state",_get(this,"review","$key"),"settings")}get mergeableWarningColor(){return _get(this,"review","progress","mergeReadinessLevel")>=2&&_get(this,"review","progress","mergeableWarningColor")}get mergeNotReady(){return 3!==_get(this,"review","progress","mergeReadinessLevel")&&!_get(this,"review","progress","protectionBypassed")}get mergeQueueEnabled(){if(_get(this,"connector","at","mergeQueue","ready")&&_access(_ref,"call",[this,"child","review","repository","core","settings","mergeMechanism"],"","ready"))return"label"===_get(this,"review","repository","core","settings","merge","mechanism")?"label":!!this.mergeQueue&&this.mergeQueue.enabled}get mergeFlavor(){return"label"===this.mergeQueueEnabled?"merge":this.mergeQueueEnabled?this.mergeQueue.mergeFlavor:_get(this,"reviewSettings","mergeFlavor")}get deleteBranchOnMerge(){return"label"!==this.mergeQueueEnabled&&(this.mergeQueueEnabled?_get(this,"review","core","head","githubDeletesBranchOnMerge"):_get(this,"reviewSettings","deleteBranchOnMerge"))}merge(){return"label"===this.mergeQueueEnabled?_access(this,"","review","","progress","","addMergeLabel","call",[]):this.mergeQueueEnabled?_access(this,"","review","","progress","","queueMerge","call",[]):_access(this,"","review","","progress","","merge","call",[])}navigateToMergeOptions(){_access(this,"","review","","context","","navigation","","visitPanel","call",["pullRequest",{scrollToExtra:!0}])}}MergeButton.$vueOptions={props:{review:Object,offerOptions:{type:Boolean,default:!1}}};return _declareVue("MergeButton",MergeButton,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"merge wrapper"},[s("span",{staticClass:"ui dimmable green merge buttons",class:{dimmed:void 0===e.mergeQueueEnabled||_get(e,"review","progress","mergeInProgress")}},[s("ui-hold-to-arm-button",{staticClass:"merge",class:{"no-options":!e.offerOptions},attrs:{disabled:e.mergeNotReady},on:{click:function(t){return e.merge()}}},[e.mergeableWarningColor?s("i",{staticClass:"warning sign icon",class:e.mergeableWarningColor,attrs:{alt:e.mergeableWarningColor+" warning sign"}}
1):e._e(),e.mergeQueueEnabled?s("span",[e._v("\n Queue "+e._s(e.mergeFlavor)+"\n "),"merge"!==e.mergeFlavor?s("span",{staticClass:"wide only"},[e._v("merge")]):e._e()]):[s("span",{staticClass:"merge action"},[e._v("Â "),s("animate-flip",["merge"===e.mergeFlavor?s("span",{key:"merge"},[e._v("Merge")]):e._e(),"squash"===e.mergeFlavor?s("span",{key:"squash"},[e._v("Squash")]):e._e(),"rebase"===e.mergeFlavor?s("span",{key:"rebase"},[e._v("Rebase")]):e._e()])],1),s("span",[e._v("Â &Â ")]),s("span",{staticClass:"branch action"},[e._v("Â "),s("animate-flip",[!0===e.deleteBranchOnMerge?s("span",{key:"delete"},[e._v("Delete")]):e._e(),!1===e.deleteBranchOnMerge?s("span",{key:"retain"},[e._v("Retain")]):e._e()])],1),s("span",{staticClass:"wide only"},[e._v("Â Branch")])],s("template",{slot:"fizzled-tip"},[e._v("\n Click and hold to arm, release to merge.\n ")])],2),s("div",{staticClass:"ui simple inverted dimmer"},[s("div",{staticClass:"ui loader",class:{mini:!e.offerOptions}})]),e.shouldOfferOptions?s("ui-button",{staticClass:"navigation",attrs:{disabled:e.mergeNotReady},on:{click:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])||"button"in t&&0!==t.button?null:e.navigateToMergeOptions.apply(null,arguments)}}},[s("i",{staticClass:"icon configure"})]):e._e()],1)])},staticRenderFns:[],functional:!1},{scopeId:"data-v-303e7cd2"}),_declareGuides("MergeButton","data-v-303e7cd2",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".merge.buttons[data-v-303e7cd2]",onboarding:"mergedBranch"}},[s("p",[s("em",[e._v("Merge the pull request")]),e._v("'s branch into its target. To prevent accidental merges, you\n must "),s("em",[e._v("hold down the button")]),e._v(" for a second to arm it before releasing.\n ")]),e._v(" "),s("p",[e._v("\n If the button has a "),s("i",{staticClass:"yellow warning sign icon",attrs:{alt:"yellow warning sign"}}),e._v(" then\n some commit "),s("em",[e._v("checks aren't passing")]),e._v("âmerge with care! If it has a\n "),s("i",{staticClass:"red warning sign icon",attrs:{alt:"red warning sign"}}),e._v(" then some required checks aren't\n passing but you can use an "),s("em",[e._v("admin override")]),e._v(" to merge anyway.\n ")]),e._v(" "),s("p",[e._v("\n If the button is "),s("em",[e._v("disabled")]),e._v(" then you either don't have permission to merge, rebasing\n is not possible, or the branch isn't up to date. (You can update the branch in the Checks\n panel.)\n ")]),e._v(" "),s("p",[e._v("\n If you just want to close the branch, you have to do so via GitHub.\n ")])])],1)},[]),{MergeButton:MergeButton}},!0,!0,{filename:"src/view/reviews/merge-button.vue"}),_reviewable.define(["MergeOptions"],["truss","Guide","animator","session","shared"],function(e,t,s,i,r){"use strict";class MergeOptions{constructor(){Vue.set(this,"bypassed",!1)}created(){this.$when(()=>this.reviewSettings).then(()=>_access(this,"","reviewSettings","","acquireCommitMessage","call",[]))}beforeDestroy(){_access(this,"","reviewSettings","","releaseCommitMessage","call",[])}get dimmed(){return!_get(this,"review","mergeQueue","enabled")&&!(_get(this,"_reviewSettingsRef","ready")&&("rebase"===this.mergeFlavor||void 0!==this.mergeCommitMessage))}get showCommitMessage(){return"rebase"!==this.mergeFlavor&&this.$session.user}get _reviewSettingsRef(){return _ref(this.$store,"child","users","current","state",_get(this,"review","$key"),"settings")}get reviewSettings(){return _get(this,"_reviewSettingsRef","value")}get fastForwardAllowed(){return _get(this,"review","statuses",_get(this,"review","core","lastRevisionKey"),"services",r.mergeableStatusKey,"fastForwardAllowed")}get mergeQueueOverride(){return _get(this,"reviewSettings","mergeQueueOverride")||"normal"}set mergeQueueOverride(e){"normal"===e&&(e=null),this._reviewSettingsRef.update({mergeQueueOverride:e})}get mergeFlavors(){return _get(this,"review","progress","protectionBypassed")?{merge:!0,squash:!0,rebase:!0}:_get(this,"review","core","base","mergeFlavors")}get mergeFlavorsAvailable(){return _(_get(this,"review","core","base","mergeFlavors")).values().some()}get shouldOfferBypass(){return"blocked"===_get(this,"review","progress","mergeable")||!this.mergeFlavorsAvailable}get mergeFlavor(){return _get(this,"reviewSettings","mergeFlavor")}set mergeFlavor(e){if(!_get(this,"review","core","base","mergeFlavors",e)&&!_get(this,"review","progress","protectionBypassed"))return;if(!this.reviewSettings)return;Vue.set(i.onboarding,"toggledMergeFlavor",!0),Vue.set(i.settings,"mergeFlavor",e),this._animateCommitMessageFieldHeight();const t={mergeFlavor:e};_.trim(this.reviewSettings.mergeCommitMessage)||Vue.set(t,"mergeCommitMessage",null),this._reviewSettingsRef.update(t)}_animateCommitMessageFieldHeight(){const e=this.$refs.commitMessageField;if(!s.shouldAnimate()||!e)return;const t=e.offsetHeight;autosize.destroy(e),Vue.set(e.style,"height",`${t}px`),Promise.all([this.$nextTick(),this.$when(()=>!this.dimmed)]).then(()=>{Vue.set(e.style,"overflow","hidden"),Vue.set(e.style,"height","auto");const s=e.scrollHeight;Vue.set(e.style,"height",`${t}px`),e.offsetHeight,Vue.set(e.style,"transition","height var(--transition-duration) var(--anime-easing)"),Vue.set(e.style,"height",`${s}px`),e.addEventListener("transitionend",()=>{Vue.set(e.style,"transition",""),autosize(e)},{once:!0})})}get deleteBranchOnMerge(){return _get(this,"reviewSettings","deleteBranchOnMerge")}set deleteBranchOnMerge(e){!this.githubDeletesBranch&&_get(this,"review","core","head","deleteAllowed")&&(Vue.set(i.onboarding,"toggledBranchDisposition",!0),Vue.set(i.settings,"deleteBranchOnMerge",e),this._reviewSettingsRef.update({deleteBranchOnMerge:e}))}get githubDeletesBranch(){return _get(this,"review","core","head","githubDeletesBranchOnMerge")}get mergeCommitMessage(){return void 0!==_get(this,"reviewSettings","actualMergeCommitMessage")?_get(this,"reviewSettings","actualMergeCommitMessage"):_access(this,"","reviewSettings","","generatedMergeC
1ommitMessageError","","toString","call",[])}set mergeCommitMessage(e){Vue.set(i.onboarding,"editedMergeCommitMessage",!0),e!==_get(this,"reviewSettings","actualMergeCommitMessage")&&this._reviewSettingsRef.update({mergeCommitMessage:e})}}MergeOptions.$vueOptions={props:{review:Object}};return _declareVue("MergeOptions",MergeOptions,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui dimmable form",class:{dimmed:e.dimmed}},[e._m(0),_get(e,"review","mergeQueue")?s("div",{staticClass:"ui merge override field"},[s("label",[e._v("Queueing strategy")]),s("div",{staticClass:"ui grouped inline fields"},[s("div",{staticClass:"field"},[s("ui-radio-input",{attrs:{value:"normal"},model:{value:e.mergeQueueOverride,callback:function(t){e.mergeQueueOverride=t},expression:"mergeQueueOverride"}},[e._v("\n Append (normal)\n ")])],1),s("div",{staticClass:"field"},[s("ui-radio-input",{attrs:{value:"jump",disabled:!_get(e,"review","verdict","admin")},model:{value:e.mergeQueueOverride,callback:function(t){e.mergeQueueOverride=t},expression:"mergeQueueOverride"}},[e._v("\n Jump to front\n ")])],1),s("div",{staticClass:"field"},[s("ui-radio-input",{attrs:{value:"bypass",disabled:!_get(e,"review","mergeQueue","canBypass")},model:{value:e.mergeQueueOverride,callback:function(t){e.mergeQueueOverride=t},expression:"mergeQueueOverride"}},[e._v("\n Bypass (merge directly)\n ")])],1)])]):e._e(),s("animate-wipe-down",[_get(e,"review","mergeQueue","enabled")?e._e():s("div",[s("div",{staticClass:"ui merge style field"},[s("label",[e._v("Merge style")]),s("div",{staticClass:"ui grouped inline fields"},[s("div",{staticClass:"field"},[s("ui-radio-input",{attrs:{value:"merge",disabled:!_get(e,"mergeFlavors","merge")},model:{value:e.mergeFlavor,callback:function(t){e.mergeFlavor=t},expression:"mergeFlavor"}},[e._v("\n Full merge\n ")])],1),s("div",{staticClass:"field"},[s("ui-radio-input",{attrs:{value:"squash",disabled:!_get(e,"mergeFlavors","squash")},model:{value:e.mergeFlavor,callback:function(t){e.mergeFlavor=t},expression:"mergeFlavor"}},[e._v("\n Squash & merge\n ")])],1),s("div",{staticClass:"last field"},[s("ui-radio-input",{attrs:{value:"rebase",disabled:!_get(e,"mergeFlavors","rebase")},model:{value:e.mergeFlavor,callback:function(t){e.mergeFlavor=t},expression:"mergeFlavor"}},[e._v("\n Rebase & merge\n "),e.fastForwardAllowed?s("span",{staticClass:"rebase-is-fast-forward"},[e._v("(fast forward)")]):e._e()])],1)]),e.mergeFlavorsAvailable?e._e():s("div",{staticClass:"ui flavors warning message",class:{lower:e.fastForwardAllowed}},[s("i",{staticClass:"warning sign icon"}),e._v(" All merge styles prohibited in this repository!?\n ")])]),s("div",{staticClass:"ui branch disposition field",staticStyle:{"margin-bottom":"0"}},[s("label",[e._v("Branch disposition after merge")]),s("div",{staticClass:"ui grouped inline fields"},[s("div",{staticClass:"field"},[s("ui-radio-input",{attrs:{value:!0,disabled:!e.githubDeletesBranch&&!_get(e,"review","core","head","deleteAllowed")},model:{value:e.deleteBranchOnMerge,callback:function(t){e.deleteBranchOnMerge=t},expression:"deleteBranchOnMerge"}},[e._v("\n Delete\n ")])],1),s("div",{staticClass:"field"},[s("ui-radio-input",{attrs:{value:!1,disabled:e.githubDeletesBranch},model:{value:e.deleteBranchOnMerge,callback:function(t){e.deleteBranchOnMerge=t},expression:"deleteBranchOnMerge"}},[e._v("\n Retain\n ")])],1)])]),s("animate-wipe-down",[e.showCommitMessage?s("div",{staticClass:"ui commit msg field"},[s("div",{staticStyle:{"margin-top":"1em"}}),s("label",[e._v("Merge commit message")]),s("textarea",{directives:[{name:"text-model",rawName:"v-text-model:debounce_500_1500",value:e.mergeCommitMessage,expression:"mergeCommitMessage",arg:"debounce_500_1500"}],ref:"commitMessageField",staticClass:"mp-sensitive"})]):e._e()])],1)]),s("animate-wipe-down",[e.shouldOfferBypass?s("ui-checkbox-input",{staticClass:"bypass",model:{value:e.review.progress.protectionBypassed,callback:function(t){e.$set(e.review.progress,"protectionBypassed",t)},expression:"review.progress.protectionBypassed"}},[e._v("\n Try to bypass branch protections\n ")]):e._e(
1)],1)],1)},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ui simple inverted dimmer"},[t("div",{staticClass:"ui loader"})])}],functional:!1},{scopeId:"data-v-5d98e78e"}),_declareGuides("MergeOptions","data-v-5d98e78e",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".merge.override.field[data-v-5d98e78e]",onboarding:"selectedMergeQueueOverride",highlight:"bracket"}},[s("p",[e._v("\n Select the strategy for "),s("em",[e._v("queueing the pull request for merging")]),e._v(".\n ")]),e._v(" "),s("p",[s("em",[e._v("Append")]),e._v(" will add the pull request to the merge queue as usual.\n ")]),e._v(" "),s("p",[s("em",[e._v("Jump")]),e._v(" will put the pull request at the front of the queue. This is potentially\n expensive and available to admins only.\n ")]),e._v(" "),s("p",[s("em",[e._v("Bypass")]),e._v(" will avoid the merge queue altogether and merge the pull request directly.\n This is only available to admins, and only if they're allowed to override the relevant branch\n protection / rule.\n ")])]),e._v(" "),s("guide",{attrs:{for:".merge.style.field[data-v-5d98e78e]",onboarding:"toggledMergeFlavor",highlight:"bracket"}},[s("p",[e._v("\n Select the "),s("em",[e._v("merge style")]),e._v(" from among the ones allowed in this repository.\n ")]),e._v(" "),s("p",[s("em",[e._v("Full merge")]),e._v(" will preserve all commits from the source branch and create a new merge\n commit with two parents.\n ")]),e._v(" "),s("p",[s("em",[e._v("Squash & merge")]),e._v(" will combine all commits from the source branch into a single\n merge commit and append it to the target branch.\n ")]),e._v(" "),s("p",[s("em",[e._v("Rebase & merge")]),e._v(" will bring the source branch up to date with the target branch,\n then append all commits from the source branch to the target branch.\n ")]),e._v(" "),s("p",[e._v("\n The selected style will become your default for future merges.\n ")])]),e._v(" "),s("guide",{attrs:{for:".branch.disposition.field[data-v-5d98e78e]",onboarding:"toggledBranchDisposition",highlight:"bracket"}},[s("p",[e._v("\n Select whether to "),s("em",[e._v("delete")]),e._v(" (if possible) or "),s("em",[e._v("retain")]),e._v(" the pull request's\n "),s("em",[e._v("source branch")]),e._v(" after the merge completes.\n ")]),e._v(" "),s("p",[e._v("\n The selected option will become your default for future merges.\n ")])]),e._v(" "),s("guide",{attrs:{for:".commit.msg.field[data-v-5d98e78e]",onboarding:"editedMergeCommitMessage",highlight:"bracket"}},[s("p",[e._v("\n Edit the "),s("em",[e._v("commit message")]),e._v(" for the "),s("em",[e._v("synthetic merge commit")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n Use an "),s("em",[e._v("empty line")]),e._v(" to separate the title (summary) from the message body, as usual in\n "),s("code",[e._v("git")]),e._v(".\n ")])])],1)},[]),{MergeOptions:MergeOptions}},!0,!0,{filename:"src/view/reviews/merge-options.vue"}),_reviewable.define(["MergeQueued"],["truss","Guide","config"],function(e,t,s){"use strict";class MergeQueued{constructor(){Vue.set(this,"estimatedMergeTimestamp",void 0)}get timeRemaining(){const e=_get(this,"mergeQueueEntry","estimatedMergeTimestamp");if(!e)return;const t=Math.max((e-this.$info.nowAtInterval(1e3))/1e3,0),s=Math.floor(t/3600),i=Math.floor(t%3600/60),r=Math.floor(t%60);return(s?`${s}:`:"")+`${s?_.padStart(i,2,"0"):i}:${_.padStart(r,2,"0")}`}get position(){return _get(this,"mergeQueueEntry","position")}get tooltip(){const e=this.$store.services.avatars.users[_get(this,"mergeQueueEntry","enqueuing","userKey")];let t="";e?(t=` by ${e.username}`,e.displayName&&(t+=` (${e.displayName})`)):_get(this,"mergeQueueEntry","enqueuing","user")&&(t=` by ${_get(this,"mergeQueueEntry","enqueuing","user","name")}`);let s="";if(_get(this,"mergeQueueEntry","enqueuing","timestamp")){const e=new Date(this.mergeQueueEntry.enqueuing.timestamp);s=` on ${e.toLocaleDateString()} at ${e.toLocaleTimeString([],{timeStyle:"short"})}`}let i="";_get(this,"mergeQueueEntry","position")&&(i+=` Last seen at #${_get(this,"mergeQueueEntry","position")} in the queue.`);const r=_get(this,"mergeQueueEntry","estimatedMergeTimestamp");if(r){const e=Math.max((r-this.$info.nowAtInterval(3e4))/1e3,0),[t,s]=e>=3600?[Math.round(e/3600),"hour"]:[Math.ceil(e/60),"minute"];i+=` Expected to merge in about ${t} ${s}${n=t,1===n?"":"s"}.`}var n;return`Queued for merge${t}${s}.${i}`}get mergeQueueUrl(){if(!_get(this,"review","core","base")||!this.mergeQueueEntry
1)return;const{owner:e,repo:t,name:i}=this.review.core.base;return`${s.gitHubUrl}/${e}/${t}/queue/${i}`}navigateToMergeOptions(){_access(this,"","review","","context","","navigation","","visitPanel","call",["pullRequest",{scrollToExtra:!0}])}cancelMerge(){this.mergeQueueEntry?this.review.progress.cancelQueuedMerge():this.review.progress.removeMergeLabel()}}MergeQueued.$vueOptions={props:{review:Object,mergeQueueEntry:Object,offerOptions:{type:Boolean,default:!1},offerCancel:{type:Boolean,default:!1}}};return _declareVue("MergeQueued",MergeQueued,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("a",{directives:[{name:"tooltip",rawName:"v-tooltip.bottom.snapshot",value:e.tooltip,expression:"tooltip",modifiers:{bottom:!0,snapshot:!0}}],staticClass:"queued",attrs:{href:e.mergeQueueUrl},on:{click:function(e){e.stopPropagation()}}},[_get(e,"mergeQueueEntry","enqueuing","user")?s("avatar-image",{staticClass:"tiny",attrs:{src:e.mergeQueueEntry.enqueuing.user.scaledAvatarUrl,fallback:e.mergeQueueEntry.enqueuing.user.$userKey}}):s("avatar",{attrs:{"user-key":_get(e,"mergeQueueEntry","enqueuing","userKey"),display:"picture",size:"tiny"}}),s("span",{class:{link:e.mergeQueueUrl}},[e._v("\n Queued "),s("span",{staticClass:"wide only"},[e._v("for merge")]),e.timeRemaining?s("span",{staticClass:"paren"},[e._v(" ("+e._s(e.timeRemaining)+")")]):e.position?s("span",{staticClass:"paren"},[e._v(" (#"+e._s(e.position)+")")]):e._e()])],1),e.offerOptions?s("ui-button",{staticClass:"navigation",on:{click:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])||"button"in t&&0!==t.button?null:e.navigateToMergeOptions.apply(null,arguments)}}},[s("i",{staticClass:"icon configure"})]):e._e(),e.offerCancel?s("ui-hold-to-arm-button",{staticClass:"basic circular dimmable cancel",class:{dimmed:_get(e,"review","progress","mergeInProgress")},on:{click:e.cancelMerge}},[e._v("\n Cancel\n "),s("div",{staticClass:"ui simple inverted dimmer"},[s("div",{staticClass:"ui mini loader"})])]):e._e()],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-523bbb76"}),_declareGuides("MergeQueued","data-v-523bbb76",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".cancel.button[data-v-523bbb76]",onboarding:"canceledQueuedMerge"}},[s("p",[s("em",[e._v("Cancel the pending merge")]),e._v(", removing the pull request from the merge queue.\n ")]),e._v(" "),s("p",[e._v("\n Note that this can be an expensive operation as other pull requests in the queue will need to\n be reordered and retested.\n ")])])],1)},[]),{MergeQueued:MergeQueued}},!0,!0,{filename:"src/view/reviews/merge-queued.vue"}),_reviewable.define(["PublishButton"],["truss","Guide","hotkeys","modifiers"],function(e,t,s,i){"use strict";class PublishButton{constructor(){Vue.set(this,"modifiers",i)}mounted(){this.auxiliary||(s.register("publish",this.publish,this),s.register("sendAll",this.publish,this))}async publish(){await _access(this,"","review","","state","","publish","call",[]),this.$emit("published")}navigateToPublishOptions(){_access(this,"","review","","context","","navigation","","visitPanel","call",["publish",{scrollToExtra:!0}])}next(){_get(this,"review","context")&&!this.pendingPublishOnPush&&(i.shiftDown?this.review.context.navigation.prevChangedFileOrUnrepliedDiscussion(!0):this.review.context.navigation.nextChangedFileOrUnrepliedDiscussion(!0))}get disabled(){return!_get(this,"review","state","num","pendingSend")}get lastEffectiveVotingSanction(){return _get(this,"review","state","lastEffectiveVotingSanction")}get narrowIcon(){switch(_get(this,"review","state","effectiveSanction")){case"approved":return"sanction approved";case"changes_requested":return"sanction blocked"}return null}get publishableDrafts(){const e=_get(this,"review","state","num","publishableDrafts");if(e)return 1===e?`${e} draft`:`${e} drafts`}get blockingIcon(){return _get(this,"review","state","votingSanctionActive")?null:_get(this,"review","state","num","blockingDispositionsIfDraftsSent")?"blocking":_get(this,"review","state","num","workingDispositionsIfDraftsSent")?"working":null}get pendingPublishOnPush(){return _get(this,"review","state","pendingPublishOnPush")}get nextAvailable(){return!this.auxiliary&&(_get(this,"review","tracker","num","unreplied")||this.review.userIsReviewingFiles&&(_get(this,"review","files","num","currentToReview")||_get(this,"review","files","diffs","proposedBoundsNeededToAdvanceReview")))}}PublishButton.$vueOptions={props:{review:Object,auxiliary:Boolean}};return _declareVue("PublishButton",PublishButton,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"publish button wrapper"},[s("span",{staticClass:"ui dimmable publish buttons",class:{dimmed:_get(e,"review","state","busyPublishing")}},[s("ui-hold-to-arm-button",{staticClass:"flex publish main",class:{auxiliary:e.auxiliary,pending:e.pendingPublishOnPush,green:!(e.pendingPublishOnPush||e.nextAvailable)},attrs:{bypassArm:!_get(e,"review","progress","canPossiblyTriggerAutoMerge"),disabled:e.disabled},on:{click:e.publish}},[e.pendingPublishOnPush?e._e():s("i",{staticClass:"publish icon",attrs:{alt:""}}),e.pendingPublishOnPush?e._e():s("span",[e.auxiliary||!_get(e,"$store","services","ruler","narrow")||e.disabled?e._e():s("span",[s("span",[e._v("Â ")]),s("span",{staticClass:"ui count label",class:{red:e.nextAvailable}},[e._v("\n "+e._s(_get(e,"review","state","num","publishableDrafts"))+"\n ")])]),e.narrowIcon?s("span",{directives:[{name:"show",rawName:"v-show",value:!e.auxiliary&&_get(e,"$store","services","ruler","narrow"),expression:"!auxiliary && ~$store.services.ruler.narrow"}]},[s("span",[e._v("Â ")]),s("i",{staticClass:"icon",class:e.narrowIcon}
1)]):e._e()]),e.auxiliary||!_get(e,"$store","services","ruler","narrow")?s("span",[e.pendingPublishOnPush?s("span",{key:"publish-on-push"},[e.auxiliary?e._e():s("span",{staticClass:"waiting"},[e._v("\n waiting for you to push"),s("br")]),s("span",{staticClass:"publish label"},[s("i",{staticClass:"publish icon",attrs:{alt:""}}),e._v("\n Publish now\n ")])]):s("span",{key:"normal=publish"},[s("span",[e._v(" Publish")]),s("animate-wipe-right",[e.auxiliary&&e.publishableDrafts?s("span",{staticClass:"suffix"},[e._v("\n  "+e._s(e.publishableDrafts)+"\n ")]):e._e()]),s("animate-wipe-right",[e.auxiliary||e.disabled?e._e():s("span",{staticClass:"no-overflow suffix"},[s("span",[e._v(" ")]),s("span",{staticClass:"ui count label",class:{red:e.nextAvailable}},[e._v("\n "+e._s(_get(e,"review","state","num","publishableDrafts"))+"\n ")])])]),s("animate-wipe-right",[_get(e,"review","state","publishOnPush")?s("span",{staticClass:"suffix"},[e._v("\n  on push\n ")]):e._e()]),s("animate-wipe-right",[_get(e,"review","state","votingSanctionActive")?s("span",{staticClass:"suffix sanction"},[e._v("\n  &\n "),s("span",{staticClass:"sanction text"},[s("animate-flip",["approved"===e.lastEffectiveVotingSanction?s("span",{key:"approved"},[s("i",{staticClass:"sanction approved icon"}),e._v("\n Approve\n ")]):"changes_requested"===e.lastEffectiveVotingSanction?s("span",{key:"changes_requested"},[s("i",{staticClass:"sanction blocked icon"}),e._v("\n Block\n ")]):e._e()])],1)]):e._e()])],1)]):_get(e,"review","state","publishOnPush")&&!e.pendingPublishOnPush?s("span",[e._v("\n  on push\n ")]):e.pendingPublishOnPush&&!e.auxiliary?s("span",{staticClass:"mini-waiting"},[e._v("\n  push?\n ")]):e._e(),!e.auxiliary&&_get(e,"$store","services","ruler","narrow")||e.pendingPublishOnPush||e.disabled?e._e():s("span",{key:"animated-suffix-icons"},[s("animate-wipe-right",[e.blockingIcon?s("span",{staticClass:"animated-icon"},[s("span",[e._v(" ")]),s("i",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:e.blockingIcon+" disposition after publishing",fixed:!e.auxiliary},expression:"{\n text: `${blockingIcon} disposition after publishing`, fixed: !auxiliary\n }"}],staticClass:"disposition suffix icon",class:e.blockingIcon})]):e._e()]),s("animate-wipe-right",[_get(e,"review","progress","canPossiblyTriggerAutoMerge")?s("span",{staticClass:"animated-icon"},[s("span",[e._v(" ")]),s("i",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:"auto merge enabled",fixed:!e.auxiliary},expression:"{text: 'auto merge enabled', fixed: !auxiliary}"}],staticClass:"automerge suffix icon"})]):e._e()])],1),s("template",{slot:"fizzled-tip"},[e._v("\n Click and hold to arm, release to publish and potentially merge.\n ")])],2),e._m(0),s("animate-wipe-right",[e.auxiliary||e.nextAvailable?e._e():s("ui-button",{staticClass:"wipable navigation",class:{green:!e.pendingPublishOnPush},attrs:{disabled:e.disabled},on:{click:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])||"button"in t&&0!==t.button?null:e.navigateToPublishOptions.apply(null,arguments)}}},[s("i",{staticClass:"icon configure"})])],1),s("div",{staticClass:"or",class:{elided:!e.nextAvailable}}),s("animate-wipe-right",[e.nextAvailable?s("ui-button",{staticClass:"wipable green next",attrs:{disabled:e.pendingPublishOnPush},on:{click:e.next}},[s("span",{staticClass:"contents"},[s("animate-flip",[e.modifiers.shiftDown?s("span",{key:"prev",staticClass:"description"},[e._v("Prev")]):s("span",{key:"next",staticClass:"description"},[e._v("Next")])]),s("i",{staticClass:"forward icon",class:{reversed:e.modifiers.shiftDown}})],1)]):e._e()],1)],1)])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ui simple inverted dimmer"},[t("div",{staticClass:"ui loader"})])}],functional:!1},{scopeId:"data-v-58b12f1e"}),_declareGuides("PublishButton","data-v-58b12f1e",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".main.publish.button[data-v-58b12f1e]",onboarding:"published",highlight:"under","hotkey-action":"publish(), sendAll()"}},[s("p",[s("em",[e._v("Publish all drafts")]),e._v(" and other buffered state changes (review marks, dispositions,\n acknowledgements). This will make them visible to others in Reviewable, and also "),s("em",[e._v("post a\n single, combined message")]),e._v(" to the pull request on GitHub.\n ")]),e._v(" "),s("p",[e._v("\n To set "),s("em",[e._v("approval state")]),e._v(" and see a "),s("em",[e._v("preview")]),e._v(" of the message that will be posted,\n click "),s("em",[s("i",{staticClass:"configure icon",attrs:{alt:"open publish dropdown"}})]),e._v(" or go to the Conclusion\n panel.\n ")])]),e._v(" "),s("guide",{attrs:{for:".next.button[data-v-58b12f1e]",onboarding:"nextUnreviewedFileOrUnrepliedDiscussion",highlight:"under"}},[s("p",[e._v("\n Advance to the "),s("em",[e._v("next item you need to address")]),e._v(", which might be a "),s("em",[e._v("file to\n review")]),e._v(" or an "),s("em",[e._v("unread or unreplied discu
1ssion")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n Once you run out of files to review at the current diff bounds, it will automatically switch\n to the "),s("em",[e._v("next revision to review")]),e._v(" if it would otherwise wrap around to the first/last\n item.\n ")]),e._v(" "),s("p",[e._v("\n Use "),s("span",{staticClass:"cfp-hotkeys-key"},[e._v("â§ + click")]),e._v(" to traverse backwards to the previous item\n instead.\n ")])])],1)},[]),{PublishButton:PublishButton}},!0,!0,{filename:"src/view/reviews/publish-button.vue"}),_reviewable.define(["PublishOnPushStatus"],["truss","corpsman"],function(e,t){"use strict";class PublishOnPushStatus{constructor(){}async cancel(){const e=`publish${this.review.$key}`;t.clearFailure(e);const s=await this.review.state.cancelPublishOnPush();("pushed"===s||"gone"===s&&!_get(this,"review","state","num","pendingSend"))&&t.setFailure(e,"We were unable to cancel the publication since the branch was already pushed, sorry!")}}PublishOnPushStatus.$vueOptions={props:{review:Object}};return _declareVue("PublishOnPushStatus",PublishOnPushStatus,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return _get(e,"review","state")?s("div",{staticClass:"publish on push status"},[e._v("\n Push a commit within "+e._s(e.review.state.publishOnPushTimeout)+" to publish your drafts.\n "),s("ui-button",{staticClass:"cancel basic circular tiny",on:{click:function(t){return e.cancel()}}},[e._v("\n Cancel\n ")])],1):e._e()},staticRenderFns:[],functional:!1},{scopeId:"data-v-71ee9cec"}),{PublishOnPushStatus:PublishOnPushStatus}},!0,!0,{filename:"src/view/reviews/publish-on-push-status.vue"}),_reviewable.define(["PublishOptions"],["truss","Guide"],function(e,t){"use strict";class PublishOptions{constructor(){}get autoReviewerRequestDirectives(){const e=_get(this,"review","state","drafts","directives","autoReviewers");return _.map(e,e=>`${e.op}@${e.username}`).join(", ")}get computingAutoReviewerRequest(){return void 0===_get(this,"review","state","drafts","directives","autoReviewers")}get completionConditionFailed(){return _get(this,"review","state","drafts","completionConditionError")}get userCanControlAutoRequestReviewers(){return(_get(this,"review","verdict","push")||_get(this,"review","verdict","triage"))&&null===_get(this,"review","forcedAutoRequestReviewers")}}PublishOptions.$vueOptions={props:{review:Object,preview:Object}};return _declareVue("PublishOptions",PublishOptions,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"publish options",class:{sanction:e.review.votingSanctionAllowed},on:{click:function(e){e.stopPropagation()}}},[s("div",{staticClass:"ui attached form segment"},[e.review.votingSanctionAllowed&&_get(e,"review","state","effectiveSanction")?s("div",{staticClass:"sanctions"},[s("div",{staticClass:"grouped inline fields"},[s("div",{staticClass:"field"},[s("ui-radio-input",{attrs:{value:"commented"},model:{value:e.review.state.effectiveSanction,callback:function(t){e.$set(e.review.state,"effectiveSanction",t)},expression:"review.state.effectiveSanction"}},[s("i",{staticClass:"sanction commented icon"}),e._v("\n Comment\n "),s("span",{staticClass:"unobtrusive"},[e._v("Submit general feedback without explicit approval.")])])],1),s("div",{staticClass:"field"},[s("ui-radio-input",{attrs:{value:"approved"},model:{value:e.review.state.effectiveSanction,callback:function(t){e.$set(e.review.state,"effectiveSanction",t)},expression:"review.state.effectiveSanction"}},[s("i",{staticClass:"sanction approved icon"}),e._v("\n Approve\n "),s("span",{staticClass:"unobtrusive"},[e._v("Submit feedback and approve merging these changes.")])])],1),s("div",{staticClass:"field"},[s("ui-radio-input",{attrs:{value:"changes_requested"},model:{value:e.review.state.effectiveSanction,callback:function(t){e.$set(e.review.state,"effectiveSanction",t)},expression:"review.state.effectiveSanction"}},[s("i",{staticClass:"sanction blocked icon"}),e._v("\n Request changes\n "),s("span",{staticClass:"unobtrusive"},[e._v("\n Submit feedback that must be addressed before merging.\n ")])])],1)])]):e._e(
1),s("div",{staticClass:"auto request reviewers"},[s("ui-checkbox-input",{attrs:{disabled:!e.userCanControlAutoRequestReviewers},model:{value:e.review.state.effectiveAutoRequestReviewers,callback:function(t){e.$set(e.review.state,"effectiveAutoRequestReviewers",t)},expression:"review.state.effectiveAutoRequestReviewers"}},[e._v("\n Sync requested reviewers\n "),s("span",{staticClass:"unobtrusive"},[e._v("("),e.computingAutoReviewerRequest?s("span",[e._v("â¦")]):e.autoReviewerRequestDirectives?s("span",[e._v(e._s(e.autoReviewerRequestDirectives))]):e.completionConditionFailed?s("span",[e._v("failed to compute")]):s("span",[e._v("no additional updates")]),e._v(")")])])],1),s("div",{staticClass:"publish on push"},[s("ui-checkbox-input",{attrs:{disabled:!e.review.state.canPublishOnPush},model:{value:e.review.state.publishOnPush,callback:function(t){e.$set(e.review.state,"publishOnPush",t)},expression:"review.state.publishOnPush"}},[e._v("\n Publish only after you push a new commit\n ")])],1),e.review.core.autoMerge?s("div",{staticClass:"automerge enabled"},[s("ui-checkbox-input",{attrs:{disabled:!0,checked:!0}},[s("span",{staticClass:"text"},[e._v("Auto-merge enabled for this pull request.")]),s("i",{staticClass:"automerge icon"})])],1):e._e()])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-752bda38"}),_declareGuides("PublishOptions","data-v-752bda38",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".sanctions[data-v-752bda38]",onboarding:"setSanction",highlight:"bracket"}},[s("p",[s("em",[e._v("Select the approval level")]),e._v(" for the review about to be published.\n This approval level will be visible to others and may affect GitHub's and\n Reviewable's "),s("em",[e._v("review completion")]),e._v(" requirements.\n ")]),e._v(" "),s("p",[e._v("\n You can only change the approval level if you have "),s("em",[e._v("write permissions")]),e._v('\n to the repository and are not the pull request\'s author. Also note that if you\n choose "Comment" any previous "Approve" or "Request changes" remains in effect;\n there\'s no way to take back your vote.\n ')])]),e._v(" "),s("guide",{attrs:{for:".auto.request.reviewers[data-v-752bda38]",onboarding:"setAutoRequestReviewers",highlight:"bracket"}},[s("p",[e._v("\n Automatically "),s("em",[e._v("synchronize requested reviewers")]),e._v(" on GitHub with participants who will\n need to "),s("em",[e._v("take action in Reviewable")]),e._v(" to advance the review after you publish.\n ")]),e._v(" "),s("p",[e._v("\n Doing this "),s("em",[e._v("doesn't affect Reviewable")]),e._v(" or its own dashboard, but can help\n surface the pull request and better integrate with other tools. "),s("em",[e._v("Comment directives")]),e._v("\n to add or remove reviewers "),s("em",[e._v("take priority")]),e._v(" over any synced changes.\n ")]),e._v(" "),s("p",[e._v("\n Repository admins can customize which participants' action is required and if desired override\n this toggle in a\n "),s("a",{attrs:{href:"https://docs.reviewable.io/admincenter#completion-condition"}},[e._v("custom review completion condition")]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".publish.on.push[data-v-752bda38]",onboarding:"setPublishOnPush",highlight:"bracket"}},[s("p",[e._v("\n Schedule draft comments to be published once you push a new revision to the pull request's\n source branch.\n ")]),e._v(" "),s("p",[e._v("\n This setting is available to pull request authors only, and only if the repository is\n connected, while the pull request is open, and if there are review comments.\n ")])]),e._v(" "),s("guide",{attrs:{for:".automerge.enabled[data-v-752bda38]",onboarding:"sawAutoMergeWarning"}},[s("p",[e._v("\n Displayed when "),s("em",[e._v("auto-merge is enabled")]),e._v(" for the pull request. If enabled,\n the publish button will include a wand icon and if Reviewable thinks publishing\n "),s("em",[e._v("may trigger an auto-merge")]),e._v(", the publish button will require "),s("em",[e._v("hold to arm")]),e._v("\n when publishing a review.\n ")])])],1)},[]),{PublishOptions:PublishOptions}},!0,!0,{filename:"src/view/reviews/publish-options.vue"}),_reviewable.define(["AdminErrorMessage"],["truss","corpsman"],function(e,t){"use strict";class AdminErrorMessage{constructor(){}get error(){const e=_get(this,"context","repositoryCore","error");
1if(e&&!_get(this,"context","dismissedRepoError"))return{title:"There is a problem with this repository",message:e,clear:()=>{Vue.set(this.context,"dismissedRepoError",!0)}};const s=_get(this,"context","review","lastWebhook");return _get(s,"error")?{title:"Review status update webhook failed",message:s.error,clear:()=>{_ref(s,"child","error").set(null).catch(e=>{t.capture(e,"clear webhook error")})}}:null}}AdminErrorMessage.$vueOptions={props:{context:{type:Object}}};return _declareVue("AdminErrorMessage",AdminErrorMessage,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.error?s("div",{staticClass:"ui webhook bottom inverted large message"},[s("i",{staticClass:"close icon",attrs:{alt:"dismiss"},on:{click:e.error.clear}}),s("i",{staticClass:"warning sign icon",attrs:{alt:"warning"}}),e._v("\n "+e._s(e.error.title)+":\n "),e.error.message.includes("\n")?s("ul",{staticClass:"ui list"},e._l(e.error.message.split("\n"),function(t,i){return s("li",{key:i},[e._v("\n "+e._s(t)+"\n ")])}),0):s("span",[e._v(e._s(e.error.message))])]):e._e()},staticRenderFns:[],functional:!1},{}),{AdminErrorMessage:AdminErrorMessage}}
1,!0,!0,{filename:"src/view/reviews/review/admin-error-message.vue"}),_reviewable.define(["AuthorizeReadOrgMessage"],["truss"],function(e){"use strict";class AuthorizeReadOrgMessage{}return _declareVue("AuthorizeReadOrgMessage",AuthorizeReadOrgMessage,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui bottom inverted large message"},[s("i",{staticClass:"warning sign icon",attrs:{alt:"warning"}}),e._v("\n Please\n "),s("ui-button",{staticClass:"green labeled icon",attrs:{disabled:e.$session.auth.disabled},on:{click:function(t){return e.$session.auth.login(["read:org"],"optional")}}},[s("i",{staticClass:"github icon"}),e._v("\n authorize organization access\n ")]),e._v("\n so that Reviewable can check team memberships when evaluating whether the review is complete.\n")],1)},staticRenderFns:[],functional:!1},{}),{AuthorizeReadOrgMessage:AuthorizeReadOrgMessage}},!0,!0,{filename:"src/view/reviews/review/authorize-read-org-message.vue"}),_reviewable.define(["AuthorizeWorkflowMessage"],["truss","corpsman","session"],function(e,t,s){"use strict";class AuthorizeWorkflowMessage{constructor(){}get reviewHasWorkflowFiles(){return _get(this,"context","review","hasWorkflowFiles")}dismissAdminWorkflowScopePrompt(){this.adminWorkflowScopeDismissalRef.set(!0)}async authorize(){await s.auth.login(["workflow"],"optional");try{await this.context.syncPullRequest("mergeable")}catch(e){t.capture(e,"authorize workflow scope")}}}AuthorizeWorkflowMessage.$vueOptions={props:{context:{required:!0,type:Object},adminWorkflowScopeDismissalRef:{required:!0,type:Object}}};return _declareVue("AuthorizeWorkflowMessage",AuthorizeWorkflowMessage,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui bottom inverted large message"},[e.reviewHasWorkflowFiles?e._e():s("i",{staticClass:"close icon",attrs:{alt:"dismiss"},on:{click:e.dismissAdminWorkflowScopePrompt}}),s("i",{staticClass:"warning sign icon",attrs:{alt:"warning"}}),e._v("\n Please\n "),s("ui-button",{staticClass:"green labeled icon",attrs:{disabled:e.$session.auth.disabled},on:{click:e.authorize}},[s("i",{staticClass:"github icon"}),e._v("\n authorize workflow file access\n ")]),e.reviewHasWorkflowFiles?s("span",[e._v("\n to continue working with this review.\n ")]):s("span",[e._v("\n so that Reviewable can check the mergeability of pull requests that include workflow files.\n ")])],1)},staticRenderFns:[],functional:!1},{}),{AuthorizeWorkflowMessage:AuthorizeWorkflowMessage}},!0,!0,{filename:"src/view/reviews/review/authorize-workflow-message.vue"}),_reviewable.define(["CommandLine"],["truss","Guide","bus","corpsman","debug","session","shared"],function(e,t,s,i,r,n,a){"use strict";const o=new RegExp(`^\\s*(${a.directiveRegex.source}\\s*)*$`,"i");class CommandLine{constructor(){Vue.set(this,"lastMousedownEvent",void 0),Vue.set(this,"cmdDraftModel",void 0),Vue.set(this,"cmdError",void 0)}created(){s.deleteEmptyDrafts.react(e=>{e&&e===this.lastMousedownEvent||this._deleteCmdDraftIfEmpty()},{scope:this}),this.$observe(()=>_get(this,"review","state")&&(!this.cmdDraftModel||this.cmdDraftModel.destroyed),e=>{e&&Vue.set(this,"cmdDraftModel",{subject:this.review.state.drafts["-cmd"],secondary:!0})})}handleCmdEscape(){r.drafts&&console.log("draft","-cmd","escape received"),s.flush(),this._deleteCmdDraftIfEmpty()}handleCmdMousedown(e){Vue.set(this,"lastMousedownEvent",e)}_deleteCmdDraftIfEmpty(){(_get(this,"cmdDraftModel","empty")||_get(this,"cmdDraftModel","destroyed"))&&_get(this,"cmdDraft","$ready")&&!_get(this,"cmdDraft","hasContent")&&(r.drafts&&console.log("draft","-cmd","delete"),this.cmdDraft.delete())}get cmdDraft(){return _get(this,"review","state","drafts","-cmd")}get cmdDraftLocator(){return _get(this,"review","discussions","top","locators","-cmd")}
1get commandSendsComment(){let e=n.settings.commandSendsComment;return void 0===e&&(e=!0),e}set commandSendsComment(e){Vue.set(n.settings,"commandSendsComment",e)}get commandPlaceholder(){return this.commandSendsComment?"+label, -@assignee, /botcmd, etcâ¦":"+label, -@assignee, +reviewer:@user, etcâ¦"}async sendCmd(e){r.drafts&&console.log("draft","-cmd","send"),e&&e.stopPropagation();const t=_get(this,"cmdDraft","markdownBody");if(!t)return;if(!this.commandSendsComment&&!o.test(t))return void Vue.set(this,"cmdError",'You can only apply label, assignee and requested reviewer directives without sending a comment. Please remove other text or switch to "send a comment" mode.');Vue.set(n.settings,"commandSendsComment",this.commandSendsComment),Vue.set(this,"cmdError",null);const a=_get(this,"review","userHasDeferred");try{const e=[];if(s.saveDraft("-cmd",e),await Promise.all(e),!this.cmdDraftLocator||this.cmdDraftLocator.locked)return;if(!_get(this,"cmdDraft","hasContent"))return;this.cmdDraftLocator.lock();try{await this.review.state.drafts.send([this.cmdDraft],{commitComments:this.commandSen
1dsComment,bumpDeferral:a})}finally{this.cmdDraftLocator.unlock()}}catch(e){i.capture(e,"sendCmd"),Vue.set(this,"cmdError",`Failed to send: ${e.message||e}`)}}}CommandLine.$vueOptions={props:{review:Object}};return _declareVue("CommandLine",CommandLine,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("div",{staticClass:"ui dimmable command group",class:{dimmed:_get(e,"review","state","busyPublishing")}},[e._m(0),e.cmdDraftLocator&&e.cmdDraftModel?s("draft-comment-body",{staticClass:"command body",attrs:{locator:e.cmdDraftLocator,model:e.cmdDraftModel,mode:"write",onboarding:"gaveCommand",placeholder:e.commandPlaceholder},on:{send:e.sendCmd,escape:e.handleCmdEscape},nativeOn:{mousedown:function(t){return e.handleCmdMousedown.apply(null,arguments)}}}):e._e(),s("span",{staticClass:"command send buttons"},[s("ui-button",{staticClass:"basic send icon",attrs:{disabled:!_get(e,"cmdDraft","hasContent")},on:{click:e.sendCmd}},[s("i",{staticClass:"icon",class:e.commandSendsComment?"send":"apply"})]),s("ui-button",{staticClass:"basic options icon",attrs:{disabled:!_get(e,"cmdDraft","hasContent")}},[s("i",{staticClass:"dropdown icon"}),s("tippy-dropdown",{attrs:{options:{offset:[-29,0],trigger:_get(e,"cmdDraft","hasContent")?"click":"manual"}}},[s("div",{staticClass:"ui command vertical menu"},[s("a",{staticClass:"item"},[s("ui-radio-input",{attrs:{value:!0},model:{value:e.commandSendsComment,callback:function(t){e.commandSendsComment=t},expression:"commandSendsComment"}},[s("i",{staticClass:"send icon"}),e._v(" Send a comment and apply directives\n ")])],1),s("a",{staticClass:"item"},[s("ui-radio-input",{attrs:{value:!1},model:{value:e.commandSendsComment,callback:function(t){e.commandSendsComment=t},expression:"commandSendsComment"}},[s("i",{staticClass:"apply icon"}),e._v(" Apply directives without sending a comment\n ")])],1)])])],1)],1)],1),s("animate-slide-down",[e.cmdError?s("div",{staticClass:"ui error message"},[s("i",{staticClass:"close icon",on:{click:function(t){e.cmdError=void 0}}}),s("div",[s("p",[e._v(e._s(e.cmdError))])])]):e._e()])],1)},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ui simple inverted dimmer"},[t("div",{staticClass:"ui mini loader"})])}],functional:!1},{scopeId:"data-v-00371f8e"}),_declareGuides("CommandLine","data-v-00371f8e",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".command.group[data-v-00371f8e]",onboarding:"gaveCommand",highlight:"bracket"}},[s("p",[e._v("\n This is a convenient spot for entering\n "),s("em",[s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/discussions#inline-directives"}},[e._v("inline directives")])]),e._v("\n to add or remove labels, assignees, reviewers, etc. Anything entered here will be appended to\n your top level comment and applied when you publish.\n ")]),e._v(" "),s("p",[e._v("\n You can click "),s("i",{staticClass:"send icon"}),e._v(" (or type\n "),s("span",{staticClass:"cfp-hotkeys-key"},[e._v(e._s(e.config.mac?"â":"ctrl")+" + enter")]),e._v(") to "),s("em",[e._v("send your\n directives immediately")]),e._v(", without affecting any other drafts in progress. This is\n particularly useful for sending "),s("em",[e._v("bot commands")]),e._v(" as many bots won't detect them correctly\n when published as part of a larger review.\n ")]),e._v(" "),s("p",[e._v("\n You can also use the dropdown menu to "),s("i",{staticClass:"apply icon"}),e._v(" "),s("em",[e._v("apply your directives")]),e._v("\n instead, without sending a comment. This will only work if the contents of the text box\n consist solely of label, assignee and requested reviewer directives but it's useful if you\n want to keep the main review thread clean and your team doesn't rely on message notifications\n for these updates.\n ")])])],1)},[]),{CommandLine:CommandLine}},!0,!0,{filename:"src/view/reviews/review/command-line.vue"}),_reviewable.define(["ConnectRepoMessage"],["truss"],function(e){"use strict";class ConnectRepoMessage{constructor(){Vue.set(this,"connectPromise",void 0),Vue.set(this,"connectError",void 0)}get repository(){return this.context.repository}get connectRepoLink(){return this.$session.config.gitHubUrl+"/"+this.context.owner+"/"+this.context.repo+"/issues/new?title=Connect+the+repo+to+Reviewable&body=Please+connect+this+repo+at+"+this.$session.config.hostUrlEncoded+"/repositories+so+that+all+PRs+get+linked+to+reviews.+Thanks!"}get broken(){return"broken"===_get(this,"context","repositoryCore","connection")}dismissRepoConnectionWarning(){this.repoConnectionDismissalRef.set(!0)}connectRepository(){Vue.set(this,"connectPromise",this.$store.repositories.toggleConnection(this.repository.owner.login,this.repository.name,this.repository.private,!0).then(()=>{Vue.set(this,"connectPromise",null)}
1).catch(e=>{Vue.set(this,"connectPromise",null),Vue.set(this,"connectError",e)}))}}ConnectRepoMessage.$vueOptions={props:{context:{type:Object,required:!0},repoConnectionDismissalRef:{type:Object,required:!0}}};return _declareVue("ConnectRepoMessage",ConnectRepoMessage,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui connection bottom inverted large message"},[e.broken?e._e():s("i",{staticClass:"close icon",attrs:{alt:"dismiss"},on:{click:e.dismissRepoConnectionWarning}}),s("i",{staticClass:"warning sign icon",attrs:{alt:"warning"}}),e._v("\n This review will only\n "),s("a",{staticClass:"link",attrs:{target:"_blank",href:"https://docs.reviewable.io/admincenter#reviews-in-connected-vs-unconnected-repos"}},[e._v("\n sync with the PR on demand\n ")]),e._v("\n because\n "),e.broken?s("span",[e._v("the repo connection is broken.")]):s("span",[e._v("the repo is not connected.")]),null!==e.repository?s("span",[_get(e,"repository","permissions","admin")?s("span",[s("span",{staticClass:"admin button group"},[s("span",{staticClass:"ui green button",class:{disabled:e.connectPromise},on:{click:e.connectRepository}},[e._v("\n Connect "+e._s(e.context.capitalizedOwner)+"/"+e._s(e.context.capitalizedRepo)+"\n ")]),e.connectError?s("span",{staticClass:"ui pointing left red label"},[e._v("\n "+e._s(e.connectError.toString())+"\n ")]):e._e()]),e.broken?e._e():s("span",[e._v("All PRs will be linked to Reviewable.")])]):s("a",{staticClass:"link",attrs:{target:"_blank",href:e.connectRepoLink}},[e._v("\n Ask an admin to "+e._s(e.broken?"reconnect":"connect")+" the repo.\n ")])]):e._e()])},staticRenderFns:[],functional:!1},{scopeId:"data-v-24a54466"}),{ConnectRepoMessage:ConnectRepoMessage}},!0,!0,{filename:"src/view/reviews/review/connect-repo-message.vue"}),_reviewable.define(["DeferralNotice"],["truss","Guide","pageControl"],function(e,t,s){"use strict";class DeferralNotice{constructor(){}get deferral(){return this.review.deferral}get filesLabelColor(){return this.deferral.numFiles?_get(this,"review","userHasDeferred")?"deferred":"red":""}get discussionsLabelColor(){return this.deferral.numDiscussions?_get(this,"review","userHasDeferred")?"deferred":"red":""}markReviewedAndRead(){(this.deferral.numFiles||this.deferral.numUnread)&&(s.pinUntilSettled(this.$el),this.deferral.numFiles&&this.review.files.markAllReviewed(!0),this.review.tracker.acknowledgeUnread())}undoMarkReviewedAndRead(){this.deferral.undoAvailable&&(s.pinUntilSettled(this.$el),this.deferral.filesUndoAvailable&&this.review.files.undoMarkAllReviewed(),this.review.tracker.undoAcknowledgeUnread())}}DeferralNotice.$vueOptions={props:{review:{type:Object,required:!0}}};return _declareVue("DeferralNotice",DeferralNotice,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui buttons deferral notice"},[s("span",{staticClass:"ui bogus button half",class:{choice:e.deferral.files||e.deferral.discussions}},[s("span",{staticClass:"text"},[e._v("\n defer\n "),e.deferral.files?s("span",[s("i",{staticClass:"files icon"}),s("span",{staticClass:"ui label",class:e.filesLabelColor},[e._v(e._s(e.deferral.numFiles))]),s("span",[e._v(" file"),s("span",{class:{hidden:1===e.deferral.numFiles}},[e._v("s")])])]):e._e(),e.deferral.files&&e.deferral.discussions?s("span",[e._v(" & ")]):e._e(),e.deferral.discussions?s("span",[s("i",{staticClass:"discussions icon"}),s("span",{staticClass:"ui label",class:e.discussionsLabelColor},[e._v("\n "+e._s(e.deferral.numDiscussions)+"\n ")]),s("span",[e._v("\n discussion"),s("span",{class:{hidden:1===e.deferral.numDiscussions}},[e._v("s")])])]):e._e()])]),e.deferral.files||e.deferral.discussions?[s("span",{staticClass:"or"}),s("span",{staticClass:"inline-block relative half nowrap"},[s("ui-button",{staticClass:"mark all",attrs:{disabled:!e.deferral.numFiles&&!e.deferral.numUnread},on:{click:e.markReviewedAndRead}},[s("span",{staticClass:"icons"},[e.deferral.discussions?s("i",{staticClass:"inverted red unread message icon"}):e._e(),e.deferral.files&&e.deferral.discussions?s("span",[e._v(" / ")]):e._e(
1),e.deferral.files?s("i",{staticClass:"inverted red unreviewed icon"}):e._e()]),s("span",{staticClass:"initial text"},[e._v("Mark all")]),e.deferral.discussions?s("span",[e._v(" read")]):e._e(),e.deferral.files&&e.deferral.discussions?s("span",[e._v(" &")]):e._e(),e.deferral.files?s("span",[e._v(" reviewed")]):e._e()]),e.deferral.undoAvailable?s("span",{staticClass:"undo action",on:{click:e.undoMarkReviewedAndRead}},[s("i",{staticClass:"undo icon"}),s("span",{staticClass:"initial text"},[e._v("Undo")])]):e._e()],1)]:e._e()],2)},staticRenderFns:[],functional:!1},{scopeId:"data-v-59b36542"}),_declareGuides("DeferralNotice","data-v-59b36542",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".deferral.notice[data-v-59b36542]",highlight:"bracket",onboarding:"sawReviewSummaryCounters"}},[s("p",[e._v("\n This shows the count of\n "),s("i",{staticClass:"files icon"}),e._v(" "),s("span",{staticClass:"ui red label"},[e._v("1")]),e._v("\n files "),s("em",[e._v("awaiting your review")]),e._v(" and "),s("i",{staticClass:"discussions icon"}),e._v(" "),s("span",{staticClass:"ui red label"},[e._v("1")]),e._v(" discussions "),s("em",[e._v("awaiting your reply")]),e._v(" that you'll be\n "),s("em",[e._v("deferring")]),e._v(" if you publish. Deferred items will not be awaiting your action until the\n review is updated again.\n ")]),e._v(" "),s("p",[e._v("\n You can also quickly\n "),s("em",[e._v("mark the files as reviewed and discussions as read")]),e._v(", or undo such an action. Note\n that marking discussions as read won't necessarily make the red counter go away as some may\n require your reply.\n ")])])],1)},[]),{DeferralNotice:DeferralNotice}},!0,!0,{filename:"src/view/reviews/review/deferral-notice.vue"}),_reviewable.define(["DeprecatedCssVarsMessage"],["truss","safeStorage"],function(e,t){"use strict";class DeprecatedCssVarsMessage{constructor(){}openAccountSettings(){this.$store.services.header.toggleHeaderAndAccountSettings()}dismiss(){Vue.set(this.$store.services.themeManager,"shouldShowOutdatedCSSVarsMessage",!1),t.session.setItem("reviewable:dismissed-deprecated-css-vars-message",!0)}}return _declareVue("DeprecatedCssVarsMessage",DeprecatedCssVarsMessage,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui inverted bottom large message"},[s("i",{staticClass:"close icon",attrs:{alt:"dismiss"},on:{click:e.dismiss}}),e._v("\n We have detected that you are using\n "),e._m(0),e._v(" or\n "),e._m(1),e._v("\n CSS variables in your custom stylesheet. These are deprecated.\n Instead, use the custom red/green replacement settings in the\n "),s("span",{staticClass:"link",on:{click:e.openAccountSettings}},[e._v("account settings")]),e._v(".\n")])},staticRenderFns:[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"inline-block markdown-body"},[s("code",[e._v("--diff-remove")])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"inline-block markdown-body"},[s("code",[e._v("--diff-add")])])}],functional:!1},{scopeId:"data-v-1608f73e"}),{DeprecatedCssVarsMessage:DeprecatedCssVarsMessage}},!0,!0,{filename:"src/view/reviews/review/deprecated-css-vars-message.vue"}),_reviewable.define(["DiffControls"],["truss","Guide","hotkeys","session"],function(e,t,s,i){"use strict";const r=[{value:"unclaimed",label:"Skip files claimed by others",text:"divide work by skipping files reviewed by someone else at an earlier revision."},{value:"unreviewed",label:"Review any unreviewed files",text:"combine efforts and review any files that need reviewing."},{value:"personallyUnreviewed",label:"Review all files personally",text:"ensure that you review every file yourself, ignoring other reviewers."}],n=[{value:"proposed",label:"Automatic",text:"since your last review, but moderated by the review's revision mapping style and your file selection setting above."},{value:"full",label:"All changes",text:"all changes to be merged, between the last revision and its base."},{value:"unreviewedByYou",label:"Unreviewed by you",text:"since your last review until the last revision."},{value:"unreviewedByAnyone",label:"Unreviewed by anyone",text:"since the most recent review by anyone until the last revision."}],a=[{value:"proposed",label:"Automatic",text:"changes since your last self-review, provisional changes, or open discussions."},{value:"full",label:"All changes",text:"all changes to be merged, between the last revision and its base."},{value:"unreviewedByAnyone",label:"Unreviewed by anyone",text:"since the most recent review by anyone until the last revision."}];class DiffControls{constructor(){Vue.set(this,"ruler",this.$store.services.ruler)}mounted(){s.register("setProposedDiffBounds",()=>this.setDiffBounds("proposed"),this),s.register("setProposedRevRanges",()=>this.setDiffBounds("proposed"),this),s.register("setDiffBounds",this.setDiffBounds,this)}get review(){return this.context.review}get reviewOverlapStrategyOptions(){return r}get initialDiffBoundsOptions(){return _get(this,"context","review","userIsReviewer")?n:a}setDiffBounds(e){switch(e){case"proposed":this.review.files.diffs.setProposedBounds();break;case"full":this.review.files.diffs.showFullDiff();break;case"personal":this.review.files.diffs.setPersonallyUnreviewedBounds();break;case"unreviewed":this.review.files.diffs.setUnreviewedBounds();break;default:console.warn("Unknown diff bounds type:",e)}}get reviewOverlapStrategy(){return _.find(this.reviewOverlapStrategyOptions,{value:this.context.stateSettings.reviewOverlapStrategy})}set reviewOverlapStrategy(e){if(!_get(e,"value"))return;const t=this.context.stateSettings;Vue.set(t,"reviewOverlapStrategy",e.value),Vue.set(t,"overlapOtherReviewers","unclaimed"!==e.value),Vue.set(t,"reviewOverlapStrategyAppliedDefault",null),Vue.set(this.$session.settings,"overlapOtherReviewers",t.overlapOtherReviewers),Vue.set(this.$session.settings,"reviewOverlapStrategy",t.reviewOverlapStrategy)}get initialDiffBoundsSettingsKey(){const e=_get(this,"context","review","userIsReviewer")?"Reviewer":_get(this,"context","review","userIsAuthor")?"Author":void 0;return e&&`initialDiffBoundsAs${e}`}get initialDiffBounds(){return _.find(this.initialDiffBoundsOptions,{value:i.settings[this.initialDiffBoundsSettingsKey]||"proposed"})}set initialDiffBounds(e){_get(e,"value")&&this.initialDiffBoundsSettingsKey&&(Vue.set(i.onboarding,"changedInitialBounds",!0),Vue.set(i.settings,this.initialDiffBoundsSettingsKey,e.value))}get tooManyFilesThreshold(){return this.context.tooManyFilesThreshold}set tooManyFilesThreshold(e){Vue.set(i.onboarding,"changedTooManyFilesTreshold",!0),Vue.set(i.settings,"tooManyFilesThreshold",e)}get diffLayout(){return this.ruler.singleColumn?"one":"two"}set diffLayout(e){Vue.set(i.onboarding,"manipulatedMargin",!0),Vue.set(this.ruler,"singleColumn","one"===e)}get marginKind(){return this.ruler.auto?"auto":"manual"}set marginKind(e){Vue.set(i.onboarding,"manipulatedMargin",!0),"auto"===e?Vue.set(this.ruler,"margin",null):Vue.set(i.settings,"margin",this.margin)}get margin(){return this.ruler.auto?this.ruler.margin:i.settings.margin}set margin(e){Vue.set(this.ruler,"margin",e),Vue.set(this,"marginKind","manual")}get reviewerKeys(){return _(_get(this,"review","files","reviewerKeys")).without(this.$info.userid).sortBy(e=>{const t=this.$store.services.avatars.users[e];return _.toLower(_get(t,"displayName")||_get(t,"username"))}
1).value()}diffSinceLastReviewedBy(e){Vue.set(i.onboarding,"sawReviewers",!0),this.review.files.diffs.diffSinceLastReviewedBy(e)}}DiffControls.$vueOptions={props:{context:{required:!0,type:Object}}};return _declareVue("DiffControls",DiffControls,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("flow-panel",{attrs:{"panel-key":"diffControls",collapsible:"",extra:"",context:e.context,type:"info"},scopedSlots:e._u([{key:"title",fn:function(){return[s("span",{staticClass:"title"},[s("i",{staticClass:"diff header icon"}),e._v(" Diffs")])]},proxy:!0},{key:"content",fn:function(t){var i=t.overlaid;return[s("div",{staticClass:"center-text",staticStyle:{"margin-bottom":"1em"}},[s("span",{staticClass:"diffs description"},[s("i",{staticClass:"icon",class:_get(e,"review","files","diffs","description","icon")}),e._v("Â \n "),s("span",{directives:[{name:"untrusted-html",rawName:"v-untrusted-html",value:_get(e,"review","files","diffs","description","text"),expression:"~review.files.diffs.description.text"}]})])]),s("p",[s("ui-button",{staticClass:"wide purple set proposed diffs",class:{disabled:!_get(e,"review","files","diffs","proposedBoundsDifferFromCurrent")},on:{click:function(t){return e.setDiffBounds("proposed")}}},[s("i",{staticClass:"show unreviewed diffs icon",attrs:{alt:""}}),e._v(" "+e._s(_get(e,"review","files","diffs","proposedAction"))+"\n ")]),e._v("\n (file selection:\n "),s("multiselect",{staticClass:"ui wide overlap dropdown",attrs:{"track-by":"value",value:"value",label:"label",options:e.reviewOverlapStrategyOptions,searchable:!1,"show-labels":!1},scopedSlots:e._u([{key:"option",fn:function(t){var i=t.option;return[s("span",[s("b",[e._v(e._s(i.label))]),e._v(": "+e._s(i.text))])]}},{key:"afterList",fn:function(){return[s("div",{staticClass:"ui overlap info message"},[s("i",{staticClass:"info circle icon",attrs:{alt:"info"}}),e._v("\n This choice will only affect you.\n "),_get(e,"review","state","settings","reviewOverlapStrategyAppliedDefault")?
1s("span",[e._v("\n (Currently using\n "+e._s(e._f("capitalize")(e.review.state.settings.reviewOverlapStrategyAppliedDefault))+" default.)\n ")]):e._e()])]},proxy:!0}],null,!0),model:{value:e.reviewOverlapStrategy,callback:function(t){e.reviewOverlapStrategy=t},expression:"reviewOverlapStrategy"}}),e._v("\n )\n ")],1),s("p",[s("span",{staticClass:"diffs button"},[e._v("Show other diffs:")]),s("ui-button",{staticClass:"basic circular set full diffs",class:{disabled:!_get(e,"review","files","diffs","fullBoundsDifferFromCurrent")},on:{click:function(t){return e.setDiffBounds("full")}}},[e._v("\n All changes\n ")]),s("span",{staticClass:"relative"},[s("ui-button",{staticClass:"basic circular set unreviewed diffs",class:{dropped:_get(e,"$refs","unreviewedByTippy","open")}},[e._v("\n Unreviewed byâ¦\n ")]),s("tippy-dropdown",{ref:"unreviewedByTippy",attrs:{options:{offset:[-9.5,8],placement:"bottom",theme:"dropdown-flat-top attached"},fixed:i}},[s("div",{staticClass:"ui reviewers segment fluid vertical menu"},[e.$info.userid&&_get(e,"review","userIsReviewer")?s("a",{staticClass:"item",on:{click:function(t){return e.setDiffBounds("personal")}}},[s("avatar",{attrs:{"user-key":e.$info.userid,display:"picture",size:"tiny"}}),e._v("You\n ")],1):e._e(),s("a",{staticClass:"item",on:{click:function(t){return e.setDiffBounds("unreviewed")}}},[s("span",{staticClass:"relative inline-block"},[s("i",{staticClass:"participants icon"})]),e._v("Anyone\n ")]),e._l(e.reviewerKeys,function(t){return s("a",{key:t,staticClass:"item",on:{click:function(s){return e.diffSinceLastReviewedBy(t)}}},[s("avatar",{attrs:{"user-key":t,display:"picture,name",size:"tiny",fixed:i}})],1)})],2)])],1)],1)]}},{key:"extra-title",fn:function(){return[s("i",{staticClass:"visual tweaks icon"}),e._v(" Preferences\n ")]},proxy:!0},{key:"extra",fn:function(){return[s("div",{staticClass:"ui fluid form"},[s("div",{staticClass:"initial bounds inline field",class:{disabled:!e.initialDiffBoundsSettingsKey}},[s("label",[e._v("Initial diff bounds")]),s("multiselect",{staticClass:"ui wide dropdown",attrs:{"track-by":"value",value:"value",label:"label",options:e.initialDiffBoundsOptions,disabled:!e.initialDiffBoundsSettingsKey,searchable:!1,"show-labels":!1},scopedSlots:e._u([{key:"option",fn:function(t){var i=t.option;return[s("span",[s("b",[e._v(e._s(i.label))]),e._v(": "+e._s(i.text))])]}}]),model:{value:e.initialDiffBounds,callback:function(t){e.initialDiffBounds=t},expression:"initialDiffBounds"}}),_get(e,"context","review","userIsReviewer")?s("span",{staticClass:"as"},[e._v("(as reviewer)")]):_get(e,"context","review","userIsAuthor")?s("span",{staticClass:"as"},[e._v("(as author)")]):e._e()],1),s("div",{staticClass:"single file mode inline field"},[s("label",[e._v("Max diffs displayed")]),s("ui-number-input",{staticClass:"number input",attrs:{min:1,max:999},model:{value:e.tooManyFilesThreshold,callback:function(t){e.tooManyFilesThreshold=t},expression:"tooManyFilesThreshold"}}),e._v(" file diffs\n "),e.tooManyFilesThreshold>50?s("span",[s("i",{staticClass:"orange warning sign icon"}),e._v(" This could make things slow!\n ")]):e._e()],1),s("div",{staticClass:"diff layout inline field"},[s("label",[e._v("Diff layout")]),s("div",{staticClass:"grouped inline fields"},[s("span",{staticClass:"field"},[s("ui-radio-input",{attrs:{value:"one"},model:{value:e.diffLayout,callback:function(t){e.diffLayout=t},expression:"diffLayout"}},[e._v("\n 1 column / unified\n ")])],1),s("span",{staticClass:"field"},[s("ui-radio-input",{attrs:{value:"two"},model:{value:e.diffLayout,callback:function(t){e.diffLayout=t},expression:"diffLayout"}},[e._v("\n 2 columns / side-by-side (if space allows)\n ")])],1)])]),s("div",{staticClass:"line length inline field"},[s("label",[e._v("Line length")]),s("div",{staticClass:"grouped inline fields"},[s("span",{staticClass:"field"},[s("ui-radio-input",{attrs:{value:"auto"},model:{value:e.marginKind,callback:function(t){e.marginKind=t},expression:"marginKind"}},[e._v("\n Auto (fit to window)\n ")])],1),s("span",{staticClass:"field",on:{click:function(t){e.marginKind="manual"}}},[s("ui-radio-input",{attrs:{value:"manual"},model:{value:e.marginKind,callback:function(t){e.marginKind=t},expression:"marginKind"}}),s("ui-number-input",{staticClass:"number input",attrs:{min:e.ruler.minMargin,max:e.ruler.maxMargin},model:{value:e.margin,callback:function(t){e.margin=t},expression:"margin"}}),e._v("\n characters\n ")],1)])]),s("div",{staticClass:"unobtrusive"},[s("i",{staticClass:"tip icon"}),e._v(" Look for "),s("i",{staticClass:"large dropdown icon"}),e._v(" at the top of diffs to\n quickly change some of these settings.\n ")])])]},proxy:!0}])})},staticRenderFns:[],functional:!1},{scopeId:"data-v-67499fe8"}),_declareGuides("DiffControls","data-v-67499fe8",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".set.proposed.diffs.button[data-v-67499fe8]",onboarding:"setProposedRevRanges",highlight:"bracket","hotkey-action":"setProposedDiffBounds(), setProposedRevRanges(), setDiffBounds('proposed')"}},[s("p",[e._v("\n Set the "),s("em",[e._v("diff bounds")]),e._v(" to the "),s("em",[e._v("next set of changes")]),e._v(" that Reviewable thinks you\n should be looking at.\n ")]),e._v(" "),s("p",[e._v("\n If you're a "),s("em",[e._v("reviewer")]),e._v(', this will show the changes since the last time you marked each\n file as reviewed. (If your review style is set to "review each commit separately" then this\n will advance commit by commit.)\n ')]),e._v(" "),s("p",[e._v("\n If you're the "),s("em",[e._v("author")]),e._v(" of the pull request, this will show changes since your last\
1n self-review, then provisional changes, then changes related to unresolved discussions.\n ")])]),e._v(" "),s("guide",{attrs:{for:".dropdown.overlap[data-v-67499fe8]",onboarding:"overlappedOtherReviewers",highlight:"bracket"}},[s("p",[e._v("\n Select the "),s("em",[e._v("overlap strategy")]),e._v(". Your choice will affect how reviews are suggested by\n default and is a personal setting per-review.\n ")]),e._v(" "),s("p",[e._v("\n Changing the option in this review "),s("em",[e._v("will implicitly set the default")]),e._v(" for any future\n reviews.\n ")]),e._v(" "),s("p",[e._v("\n Regardless of which option you select you will still be able to manually diff and review any\n file you want.\n ")])]),e._v(" "),s("guide",{attrs:{for:".set.full.diffs.button[data-v-67499fe8]",onboarding:"showedFullDiff","hotkey-action":"setDiffBounds('full')"}},[s("p",[e._v("\n Set the diff bounds to show "),s("em",[e._v("all the changes")]),e._v(" made in this pull request.\n ")]),e._v(" "),s("p",[e._v("\n These would be the changes applied to the target branch if the pull request were to be merged\n right now.\n ")]),e._v(" "),s("p",[e._v("\n This is equivalent to dragging from ⥠to the last revision in the "),s("em",[e._v("file matrix")]),e._v(" header.\n ")])]),e._v(" "),s("guide",{attrs:{for:".set.unreviewed.diffs.button[data-v-67499fe8]",onboarding:"showedUnreviewedDiff","hotkey-action":"setDiffBounds('personal'), setDiffBounds('unreviewed')"}},[s("p",[e._v("\n Set the diff bounds to show changes since "),s("em",[e._v("somebody reviewed a file")]),e._v(". You can choose\n among "),s("em",[e._v("all reviewers")]),e._v(" (including "),s("em",[e._v("yourself")]),e._v(", if applicable), or diff since the\n latest review by "),s("em",[e._v("anyone")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n You can set the same bounds from the "),s("em",[e._v("file matrix")]),e._v(" by clicking on\n "),s("i",{staticClass:"cell reviewed icon"}),e._v(" (you) or "),s("i",{staticClass:"cell participants on icon"}),e._v(" (anyone) in\n the header, or on a specific reviewer avatar (if showing reviewers is turned on).\n ")])]),e._v(" "),s("guide",{attrs:{for:".diff.layout.field[data-v-67499fe8]",onboarding:"manipulatedDiffLayout",highlight:"bracket"}},[s("p",[e._v("\n Select whether to show diffs using "),s("em",[e._v("one or two columns")]),e._v('. One column diffs are also\n called "unified" and two column diffs "side-by-side" diffs.\n ')]),e._v(" "),s("p",[e._v("\n Note that if you selected two column diffs, Reviewable will automatically "),s("em",[e._v("fall back to\n one column diffs")]),e._v(" if there's not enough horizontal space in the browser window.\n ")]),e._v(" "),s("p",[e._v("\n This setting applies to you on all reviews you visit.\n ")])]),e._v(" "),s("guide",{attrs:{for:".line.length.field[data-v-67499fe8]",onboarding:"manipulatedMargin",highlight:"bracket"}},[s("p",[e._v("\n Select the "),s("em",[e._v("maximum length of each diff line")]),e._v(", sometimes called the margin. You can\n either enter a set "),s("em",[e._v("number of characters")]),e._v(' (within bounds) or go with "auto" to have\n Reviewable '),s("em",[e._v("automatically")]),e._v(" pick a reasonable number based on the window width.\n ")]),e._v(" "),s("p",[e._v("\n Any code that exceeds the set line length will "),s("em",[e._v("wrap to the next line")]),e._v(" and get marked\n with a black vertical bar.\n ")]),e._v(" "),s("p",[e._v("\n This setting applies to you on all reviews you visit.\n ")])]),e._v(" "),s("guide",{attrs:{for:".single.file.mode.field[data-v-67499fe8]",onboarding:"changedTooManyFilesTreshold",highlight:"bracket"}},[s("p",[e._v("\n Set the maximum "),s("em",[e._v("number of diffs to display")]),e._v(" at once on the page. If more diffs than\n that need be presented Reviewable will automatically switch to showing them "),s("em",[e._v("one at a\n time")]),e._v(" to keep performance reasonable.\n ")]),e._v(" "),s("p",[e._v("\n You can set this value according to your preferences and your machine's horsepower. We\n recommend no more than 50.\n ")]),e._v(" "),s("p",[e._v("\n Note that the number of displayed diffs is often "),s("em",[e._v("lower than the number of files")]),e._v(" in\n the review, especially in later rounds.\n ")]),e._v(" "),s("p",[e._v("\n This setting applies to you on all reviews you visit.\n ")])]),e._v(" "),s("guide",{attrs:{for:".initial.bounds.field[data-v-67499fe8]",onboarding:"changedInitialBounds",highlight:"bracket"}},[s("p",[e._v("\n Select the "),s("em",[e._v("diff bounds to apply automatically")]),e._v(" when you load a review page. You can\n set different behaviors based on whether you're the author of the pull request or a reviewer.\n ")]),e._v(" "),s("p",[e._v("\n This only determines the initial bounds â you can "),s("em",[e._v("adjust your diff bounds")]),e._v(" at any\n time. The setting may al
1so be "),s("em",[e._v("overridden")]),e._v(" if you're landing on the review page to see\n a "),s("em",[e._v("specific discussion or revision range")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n This setting applies to you on all reviews you visit.\n ")])])],1)},[]),{DiffControls:DiffControls}},!0,!0,{filename:"src/view/reviews/review/diff-controls.vue"}),_reviewable.define(["DiscussionsTop"],["truss","Guide"],function(e,t){"use strict";class DiscussionsTop{constructor(){}get locatorsList(){return _(_get(this,"context","review","discussions","top","locators","list")).reject("hidden").reject({$key:"-cmd"}).value()}showHiddenDiscussions(){const e=_.filter(this.context.review.discussions.top.parleys,e=>_get(e,"locator","commentExhibitionLevel")<0);this.context.navigation.exhibitParleys(1,e)}createTopDraft(){this.$session.user&&!_access(this,"","context","","review","","state","","isLocked","call",[])&&(Vue.set(this.$session.onboarding,"createdTopDraft",!0),this.context.state.drafts.createStarterDraft(void 0,_.last(this.context.review.revisions.list).$key))}}DiscussionsTop.$vueOptions={props:{context:{type:Object,required:!0}}};return _declareVue("DiscussionsTop",DiscussionsTop,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("flow-panel",{attrs:{panelKey:"topLevelDiscussions",context:e.context,type:"info"},scopedSlots:e._u([{key:"title",fn:function(){return[s("span",{staticClass:"title"},[s("i",{staticClass:"discussions header icon"}),e._v(" Top level discussions")])]},proxy:!0},{key:"content",fn:function(){return[s("div",{staticClass:"top level discussions"},[s("animate-slide-down-group",e._l(e.locatorsList,function(t,i){return s("div",{key:t.$key},[s("discussion-component",{style:{"z-index":e.locatorsList.length-i},attrs:{locator:t}})],1)}),0),s("div",{staticClass:"center-text"},[e.$session.user&&_get(e,"context","review","discussions","top","locators","ready")?s("div",{staticClass:"ui basic circular create top comment icon button",class:{disabled:_access(e,"","context","","review","","state","","isLocked","call",[])},on:{click:e.createTopDraft}},[s("i",{staticClass:"discussion new icon"}),e._v(" Start a new discussion\n ")]):e._e(),_get(e,"context","review","discussions","top","locators","num","hidden")?s("span",{staticClass:"resolved count"},[s("a",{staticClass:"link",on:{click:function(t){return e.showHiddenDiscussions()}}},[e._v("\n + "+e._s(e.context.review.discussions.top.locators.num.hidden)+"\n resolved\n discussion"+e._s(1===e.context.review.discussions.top.locators.num.hidden?"":"s")+"\n ")])]):e._e()])],1)]},proxy:!0}])})},staticRenderFns:[],functional:!1},{scopeId:"data-v-17c708fc"}),_declareGuides("DiscussionsTop","data-v-17c708fc",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".create.top.comment[data-v-17c708fc]",onboarding:"createdTopDraft"}},[s("p",[e._v("\n Start a new "),s("em",[e._v("top-level discussion")]),e._v('\n that\'s not related to a specific file and follows\n normal resolution rules\n (unlike the default "Review discussion").\n ')]),e._v(" "),s("p",[e._v("\n To comment on a specific line in a file, click on a diff instead.\n ")])])],1)},[]),{DiscussionsTop:DiscussionsTop}},!0,!0,{filename:"src/view/reviews/review/discussions-top.vue"}),_reviewable.define(["MergeWarning"],["truss"],function(e){"use strict";class MergeWarning{constructor(){}}MergeWarning.$vueOptions={props:{warning:{type:Object,required:!0}}};return _declareVue("MergeWarning",MergeWarning,null,{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{staticClass:"message"},[e._v("\n "+e._s(e.warning.message)+"\n")])},staticRenderFns:[],functional:!1},{}),{MergeWarning:MergeWarning}},!0,!0,{filename:"src/view/reviews/review/merge-warning.vue"}),_reviewable.define(["PanelHeaderStackingLayer"],["truss","bus","pageControl"],function(e,t,s){"use strict";const i=getComputedStyle(document.documentElement),r=_.parseInt(i.getPropertyValue("--statusbar-height"));class PanelHeaderStackingLayer{constructor(){Vue.set(this,"stickiedPanelKey",void 0),Vue.set(this,"borrowedElement",void 0),Vue.set(this,"parentElement",void 0),Vue.set(this,"panelHeaderPlaceholderElement",void 0),Vue.set(this,"primaryScrollContext",void 0),Vue.set(this,"offset",void 0)}created(){this.$when(()=>s.scrollContexts.primary).then(()=>{this.$destroyed||(Vue.set(this,"primaryScrollContext",s.scrollContexts.primary),Vue.set(this,"offset",this.primaryScrollContext.getLayoutTopOffset()+.33*r),this.$observe(()=>[this.context.activePanelKey,this.primaryScrollContext.height,this.$session.window.visible,s.headerStickyingBypassed],([e])=>{this.unstickyBorrowedElement(),s.headerStickyingBypassed||(e&&this.stickyBorrowedElement(),this.primaryScrollContext.syncScrollContexts())}),this.primaryScrollContext.establishScrollSync(this.$refs.scrollEl))})}stickyBorrowedElement(){const e=`.panel[data-panel-key="${this.context.activePanelKey}"] .panel.bouncer`,s=`.panel[data-panel-key="${this.context.activePanelKey}"] .panel.title`;Vue.set(this,"borrowedElement",document.querySelector(e));const i=document.querySelector(s);if(!(this.$refs.spacer&&this.$refs.placeholder&&this.borrowedElement))return null;const r=this.primaryScrollContext.scrollY(),n=this.borrowedElement.getBoundingClientRect();Vue.set(this.$refs.spacer.style,"height",r+n.top+"px"),Vue.set(this.$refs.placeholder.style,"display","block"),Vue.set(this,"panelHeaderPlaceholderElement",document.createElement("div")),Vue.set(this.panelHeaderPlaceholderElement.style,"width",n.width+"px"),Vue.set(this.panelHeaderPlaceholderElement.style,"display","inline-block"),i?(Vue.set(this,"stickiedPanelKey",this.context.activePanelKey),Vue.set(this,"parentElement",this.borrowedElement.parentElement),i.append(this.panelHeaderPlaceholderElement),this.$refs.placeholder.append(this.borrowedElement),t.stickyPanel({panelKey:this.context.activePanelKey,sticky:!0})):Sentry.captureMessage("Failed to find borrowed element to sticky",{level:"warning",extra:{selector:e}})}unstickyBorrowedElement(){this.borrowedElement&&this.panelHeaderPlaceholderElement&&this.parentElement&&this.$refs.placeholder&&(this.stickiedPanelKey&&t.stickyPanel({panelKey:this.stickiedPanelKey,sticky:!1}),Vue.set(this.$refs.placeholder.style,"display","none"),this.panelHeaderPlaceholderElement.remove(),this.parentElement.append(this.borrowedElement),Vue.set(this,"panelHeaderPlaceholderElement",Vue.set(this,"borrowedElement",Vue.set(this,"parentElement",null))),Vue.set(this,"stickiedPanelKey",null))}}PanelHeaderStackingLayer.$vueOptions={props:{context:{type:Object,required:!0}}};return _declareVue("PanelHeaderStackingLayer",PanelHeaderStackingLayer,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{ref:"scrollEl",staticClass:"header-stacking-layer"},[s("div",{staticClass:"relative header-stacking-flow"},[s("div",{ref:"spacer",staticClass:"spacer"}),s("div",{directives:[{name:"vue-element-spy",rawName:"v-vue-element-spy",value:{callback:function(e,t){return t.toggleAttribute("stuck",e)},watchExit:!0,context:!1,offset:e.offset},expression:"{\n callback: (active, el) => el.toggleAttribute('stuck', active),\n watchExit: true, context: false, offset\n }"}],ref:"placeholder",staticClass:"header-placeholder"})])])},staticRenderFns:[],functional:!1},{cssVarsGetter:function(e){return[[!0,{"586d3152f4719b6a":(_get(e,"primaryScrollContext","height")||0)+"px"}]]},scopeId:"data-v-586d3152"}),{PanelHeaderStackingLayer:PanelHeaderStackingLayer}},!0,!0,{filename:"src/view/reviews/review/panel-header-stacking-layer.vue"}),_reviewable.define(["ParticipantsDispositionCounter"],["truss"],function(e){"use strict";class ParticipantsDispositionCounter{constructor(){}get dispositionCount(){const e=_(this.discussions).filter("dispositionIsDraft").countBy("disposition").value();return _(this.discussions).countBy("disposition").mapValues((t,s)=>({count:t,draftCount:e[s]||0}
1)).value()}get dispositionTotal(){return _.reduce(this.dispositionCount,(e,t)=>e+t.count,0)}get draftDispositionTotal(){return _.reduce(this.dispositionCount,(e,t)=>e+t.draftCount,0)}}ParticipantsDispositionCounter.$vueOptions={props:{discussions:Array,condensed:Boolean,participant:Object}};return _declareVue("ParticipantsDispositionCounter",ParticipantsDispositionCounter,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"disposition-counter"},[_get(e,"discussions","length")?s("div",{ref:"dispositions",staticClass:"dispositions",class:{condensed:e.condensed}},[e.dispositionCount.satisfied?s("div",{staticClass:"disposition wrapper"},[s("i",{staticClass:"circular disposition satisfied icon",class:{green:e.dispositionCount.satisfied.draftCount}}),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.condensed,expression:"!condensed"}],staticClass:"ui label circular"},[e._v("\n "+e._s(e.dispositionCount.satisfied.count)+"\n ")]),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.condensed&&e.dispositionCount.satisfied.draftCount,expression:"!condensed && dispositionCount.satisfied.draftCount"}],staticClass:"ui label circular green"},[e._v("\n "+e._s(e.dispositionCount.satisfied.draftCount)+"\n ")])]):e._e(),e.dispositionCount.uninvolved?s("div",{staticClass:"disposition wrapper"},[s("i",{staticClass:"circular disposition uninvolved icon",class:{green:e.dispositionCount.uninvolved.draftCount}}),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.condensed,expression:"!condensed"}],staticClass:"ui label circular"},[e._v("\n "+e._s(e.dispositionCount.uninvolved.count)+"\n ")]),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.condensed&&e.dispositionCount.uninvolved.draftCount,expression:"!condensed && dispositionCount.uninvolved.draftCount"}],staticClass:"ui label circular green"},[e._v("\n "+e._s(e.dispositionCount.uninvolved.draftCount)+"\n ")])]):e._e(),e.dispositionCount.following?s("div",{staticClass:"disposition wrapper"},[s("i",{staticClass:"circular disposition following icon",class:{green:e.dispositionCount.following.draftCount}}),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.condensed,expression:"!condensed"}],staticClass:"ui label circular"},[e._v("\n "+e._s(e.dispositionCount.following.count)+"\n ")]),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.condensed&&e.dispositionCount.following.draftCount,expression:"!condensed && dispositionCount.following.draftCount"}],staticClass:"ui label circular green"},[e._v("\n "+e._s(e.dispositionCount.following.draftCount)+"\n ")])]):e._e(),e.dispositionCount.mentioned?s("div",{staticClass:"disposition wrapper"},[s("i",{staticClass:"circular disposition mentioned icon",class:{green:e.dispositionCount.mentioned.draftCount}}),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.condensed,expression:"!condensed"}],staticClass:"ui label circular"},[e._v("\n "+e._s(e.dispositionCount.mentioned.count)+"\n ")]),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.condensed&&e.dispositionCount.mentioned.draftCount,expression:"!condensed && dispositionCount.mentioned.draftCount"}],staticClass:"ui label circular green"},[e._v("\n "+e._s(e.dispositionCount.mentioned.draftCount)+"\n ")])]):e._e(),e.dispositionCount.pondering?s("div",{staticClass:"disposition wrapper"},[s("i",{staticClass:"circular disposition pondering icon",class:{green:e.dispositionCount.pondering.draftCount}}),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.condensed,expression:"!condensed"}],staticClass:"ui label circular"},[e._v("\n "+e._s(e.dispositionCount.pondering.count)+"\n ")]),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.condensed&&e.dispositionCount.pondering.draftCount,expression:"!condensed && dispositionCount.pondering.draftCount"}],staticClass:"ui label circular green"},[e._v("\n "+e._s(e.dispositionCount.pondering.draftCount)+"\n ")])]):e._e(),e.dispositionCount.dismissed?s("div",{staticClass:"disposition wrapper"},[s("i",{staticClass:"circular disposition dismissed icon",class:{green:e.dispositionCount.dismissed.draftCount}}),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.condensed,expression:"!condensed"}],staticClass:"ui label circular"},[e._v("\n "+e._s(e.dispositionCount.dismissed.count)+"\n ")]),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.condensed&&e.dispositionCount.dismissed.draftCount,expression:"!condensed && dispositionCount.dismissed.draftCount"}],staticClass:"ui label circular green"},[e._v("\n "+e._s(e.dispositionCount.dismissed.draftCount)+"\n ")])]):e._e(
1),e.dispositionCount.informing?s("div",{staticClass:"disposition wrapper"},[s("i",{staticClass:"circular disposition informing icon",class:{green:e.dispositionCount.informing.draftCount}}),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.condensed,expression:"!condensed"}],staticClass:"ui label circular"},[e._v("\n "+e._s(e.dispositionCount.informing.count)+"\n ")]),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.condensed&&e.dispositionCount.informing.draftCount,expression:"!condensed && dispositionCount.informing.draftCount"}],staticClass:"ui label circular green"},[e._v("\n "+e._s(e.dispositionCount.informing.draftCount)+"\n ")])]):e._e(),e.dispositionCount.discussing?s("div",{staticClass:"disposition wrapper"},[s("i",{staticClass:"circular disposition discussing icon",class:{green:e.dispositionCount.discussing.draftCount}}),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.condensed,expression:"!condensed"}],staticClass:"ui label circular"},[e._v("\n "+e._s(e.dispositionCount.discussing.count)+"\n ")]),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.condensed&&e.dispositionCount.discussing.draftCount,expression:"!condensed && dispositionCount.discussing.draftCount"}],staticClass:"ui label circular green"},[e._v("\n "+e._s(e.dispositionCount.discussing.draftCount)+"\n ")])]):e._e(),e.dispositionCount.working?s("div",{staticClass:"disposition wrapper"},[s("i",{staticClass:"circular disposition working icon",class:{green:e.dispositionCount.working.draftCount}}),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.condensed,expression:"!condensed"}],staticClass:"ui label circular"},[e._v("\n "+e._s(e.dispositionCount.working.count)+"\n ")]),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.condensed&&e.dispositionCount.working.draftCount,expression:"!condensed && dispositionCount.working.draftCount"}],staticClass:"ui label circular green"},[e._v("\n "+e._s(e.dispositionCount.working.draftCount)+"\n ")])]):e._e(),e.dispositionCount.blocking?s("div",{staticClass:"disposition wrapper"},[s("i",{staticClass:"circular disposition blocking icon",class:{green:e.dispositionCount.blocking.draftCount}}),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.condensed,expression:"!condensed"}],staticClass:"ui label circular"},[e._v("\n "+e._s(e.dispositionCount.blocking.count)+"\n ")]),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.condensed&&e.dispositionCount.blocking.draftCount,expression:"!condensed && dispositionCount.blocking.draftCount"}],staticClass:"ui label circular green"},[e._v("\n "+e._s(e.dispositionCount.blocking.draftCount)+"\n ")])]):e._e(),s("div",{directives:[{name:"show",rawName:"v-show",value:e.condensed,expression:"condensed"}],staticClass:"disposition wrapper condensed"},[s("i",{staticClass:"circular disposition hidden icon"}),s("div",{staticClass:"ui label circular condensed"},[e._v("\n "+e._s(e.dispositionTotal)+"\n ")]),s("div",{directives:[{name:"show",rawName:"v-show",value:e.condensed&&e.draftDispositionTotal,expression:"condensed && draftDispositionTotal"}],staticClass:"ui label circular green"},[e._v("\n "+e._s(e.draftDispositionTotal)+"\n ")])])]):e._e()])},staticRenderFns:[],functional:!1},{scopeId:"data-v-348a0622"}),{ParticipantsDispositionCounter:ParticipantsDispositionCounter}},!0,!0,{filename:"src/view/reviews/review/participants-disposition-counter.vue"}),_reviewable.define(["ParticipantsPanelContent"],["truss","Guide","animator","config","session"],function(e,t,s,i,r){"use strict";class ParticipantsPanelContent{constructor(){Vue.set(this,"headers",[{key:"waiting-on",sortKey:"blocker",groups:[e=>e.blocker,"waiting on","not waiting on"]},{key:"participant",sortKey:"username"},{key:"status",sortKey:["dispositionBlocking","sanction","discussing","lgtm"],groups:[e=>"approved"===e.sanction,"approves",e=>"changes_requested"===e.sanction,"blocking",e=>"dismissed"===e.sanction,"dismissed",e=>e.dispositionBlocking,"blocking",e=>e.lgtm,"approves",e=>
1e.discussing,"discussing","no status"]},{key:"role",sortKey:["author","activeOrRequestedReviewer","mentionee","assigned"],groups:[e=>e.author&&e.assigned,"authors",e=>e.author,"authors",e=>e.requestedReviewer&&e.assigned&&e.reviewer,"re-requested reviewers",e=>e.requestedReviewer&&e.reviewer,"re-requested reviewers",e=>e.reviewer&&e.assigned,"reviewers",e=>e.reviewer,"reviewers",e=>e.requestedReviewer&&e.assigned&&!e.requestedTeam,"requested reviewers",e=>e.requestedReviewer&&!e.requestedTeam,"requested reviewers",e=>e.requestedTeam,"requested reviewers",e=>e.mentionee&&e.assigned,"mentionees",e=>e.mentionee,"mentionees",e=>e.assigned,"lurkers","lurkers"]},{key:"contributor",sortKey:"contributor",groups:[e=>e.contributor,"contributor","no commits"]},{key:"last-active",sortKey:"lastUpdateTimeAgoShort",groups:[e=>/just now|hrs?|mins?|\bs/.test(e.lastUpdateTimeAgoShort),"recent",e=>/days?/.test(e.lastUpdateTimeAgoShort),"days ago",e=>/wks?/.test(e.lastUpdateTimeAgoShort),"weeks ago",e=>/mths?|yrs?/.test(e.lastUpdateTimeAgoShort),"long ago","not active"]},{key:"drafts",sortKey:"draftsPending",groups:[e=>e.draftsPending,"drafts pending","no drafts"]},{key:"discussions",sortKey:"dispositions",groups:[e=>_.includes(e.dispositions,"working"),"working",e=>_.includes(e.dispositions,"blocking"),"blocking",e=>_get(e,"dispositions","length"),"other","no discussions"]}]),_.forEach(this.headers,e=>{Vue.set(e,"title",_.replace(e.key,"-"," ")),Vue.set(e,"clicked",!1)}),Vue.set(this,"currentHeader",void 0),Vue.set(this,"participantsIndex",{}),Vue.set(this,"globalThresholds",{participant:{threshold:150,isOver:!0},"last-active":{threshold:75,isOver:!0},discussions:{threshold:0,isOver:!0}}),Vue.set(this,"discussionThresholdOffsetValue",25),Vue.set(this,"panelInitialized",!1)}created(){r.config.slackClientEnabled&&this.$connect(this,{slackWorkspaceId:_ref(this.$store,"child","organizations",_.toLower(this.review.core.ownerName),"slackWorkspace","core","id").annotate({ignorePermissionDenied:!0})})}mounted(){this.$observe(()=>[this.shouldShowHeaders,_get(this,"sortedParticipants","length")],()=>{_get(this,"$refs","hoverTargets")&&(this.shouldShowHeaders?this.$refs.hoverTargets.classList.add("show-all"):this.$refs.hoverTargets.classList.remove("show-all")),this.calculateColumnOverages()}),this.$observe(()=>_get(this,"sortedParticipants","length"),e=>{!this.panelInitialized&&e&&this.$waitForRefs("ref-discussions",e=>{_.delay(()=>{this.calculateColumnOverages(),this.setUpHoverListener(),Vue.set(this,"panelInitialized",!0)},s.defaultOptions.duration+50)})})}calculateColumnOverages(){_.forEach(_.keys(this.globalThresholds),e=>{const t=_access(this,"","$refs","",`ref-${e}`,"",0,"","getBoundingClientRect","call",[],"","width");Vue.set(this.globalThresholds[e],"isOver",t>this.globalThresholds[e].threshold)})}setUpHoverListener(){const e=_.debounce(e=>{if(!_get(this,"$refs","hoverTargets"))return;const t=document.elementsFromPoint(e.clientX,e.clientY);let s=!1;_(this.headers).reject({title:"participant"}).forEach(e=>{const i=this.$refs[`ref-hov-${e.key}`][0];!s&&_.find(t,i)?(s=!0,i.querySelector("span").classList.add("show")):i.querySelector("span").classList.remove("show")})},50);this.$el.addEventListener("mouseleave",()=>{this.$el.removeEventListener("mousemove",e),_get(this,"$refs","hoverTargets")&&(this.$refs.hoverTargets.classList.add("hide-all"),_.delay(()=>{const e=_access(this,"","$refs","","hoverTargets","","querySelector","call",["span.show"]);e&&e.classList.remove("show")},50))}),this.$el.addEventListener("mouseenter",()=>{_get(this,"$refs","hoverTargets")&&this.$refs.hoverTargets.classList.remove("hide-all"),this.$el.addEventListener("mousemove",e)}),_get(this,"$refs","hoverTargets")&&this.shouldShowHeaders&&this.$refs.hoverTargets.classList.add("show-all")}get performanceMode(){return _get(this,"review","people","list","length")>=25}get shouldShowHeaders(){return this.$store.services.ruler.windowWidth>800}get animation(){return s.shouldAnimate()}get canToggleUsernameOrigin(){return!(!r.config.slackBotEnabled&&!this.slackWorkspaceId)&&_.some(this.sortedParticipants,"self.slackUser")}get usernameOrigin(){return this.canToggleUsernameOrigin&&r.settings.usernameOrigin||"github"}set usernameOrigin(e){Vue.set(r.settings,"usernameOrigin",e)}get allUsernamesList(){return _(this.sortedParticipants).map("slack"===this.usernameOrigin?"self.slackUser.handle":"self.username").compact().map(e=>"@"+e).join(", ")}get currentUserParticipant(){const e=_.find(_get(this,"review","people","list"),{$key:this.$info.userid});if(e)return{self:e,current:!0}}get maxDispositionCellWidth(){const e=[];for(const t of _get(this,"review","people","list"))e.push(_.size(_.countBy(t.dispositions)));const t=Math.max(...e);return Vue.set(this.globalThresholds.discussions,"threshold",this.discussionThresholdOffsetValue*t),""+(t?t<=6?2.5:.6*(t-1):1.5)}get sortedParticipants(){const e=_.map(this.review.requestedTeam
1s,e=>{const t=`githubteam:${e.id}`;return{$key:t,username:e.slug,displayName:e.name,scaledAvatarUrl:this.$store.services.avatars.inferGitHubAvatarUrl(t),link:`${i.gitHubUrl}/orgs/${_get(this,"review","core","ownerName")}/teams/${e.slug}`,blocker:!0,blockerReason:"review requested",requestedReviewer:!0,requestedTeam:!0,role:"requested team",status:"no status"}}),t=_(_get(this,"review","people")).reject({$key:this.$info.userid}).reject("passiveBot").reject("duplicate").concat(e).map(e=>this.buildParticipant(e)).sortBy(["weight",e=>this.participantsIndex[e.self.$key]||1/0]).index().forEach((e,t,s)=>{Vue.set(e,"firstInGroup",e.group!==_get(s,t-1,"group")),Vue.set(e,"participants",s)});return Vue.set(this,"participantsIndex",_(t).map(e=>({key:e.self.$key,index:e.index+1})).keyBy("key").mapValues("index").value()),t}buildParticipant(e){const t=_get(this,"currentHeader","groups");let s,i;if(t)for(let r=0;r<t.length;r+=2){const n=_.isString(t[r]),a=n?_.constant(!0):t[r],o=n?t[r]:t[r+1];if(a(e)){s=o,i=r;break}}else i=-this.calculateDefaultWeight(e);return{self:e,group:s,weight:i}}calculateDefaultWeight(e){if(!e)return;let t=0;for(const s of this.headers){const i=_.isArray(s.sortKey)?s.sortKey:[s.sortKey];for(const s of i){if("dispositions"===s&&_get(e,s,"length")){let s=0;_.forEach(e.dispositions,()=>{s+=1}),t+=_.round(2*Math.log(s)+1,1)}e[s]&&t++}}return t}sortParticipantsByKey(e){"participant"!==_get(e,"key")&&(_get(this,"sortedParticipants","length")<=1||(e.clicked?(Vue.set(e,"clicked",!1),Vue.set(this,"currentHeader",void 0)):(this.currentHeader&&Vue.set(this.currentHeader,"clicked",!1),Vue.set(e,"clicked",!0),Vue.set(this,"currentHeader",e))))}}ParticipantsPanelContent.$vueOptions={props:{review:{type:Object,required:!0}}};return _declareVue("ParticipantsPanelContent",ParticipantsPanelContent,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("div",{staticClass:"ui table segment participants"},[s("div",{ref:"hoverTargets",staticClass:"hover-targets row"},e._l(e.headers,function(t){return s("div",{key:t.key,ref:"ref-hov-"+t.key,refInFor:!0,staticClass:"cell",class:t.key},[s("span",[e._v(e._s(t.title))])])}),0),e.currentUserParticipant?s("participants-panel-row",{staticClass:"current",attrs:{participant:e.currentUserParticipant,participants:e.sortedParticipants,thresholds:e.globalThresholds,performance:e.performanceMode,usernameOrigin:e.usernameOrigin}}):e._e(),s("div",{staticClass:"reference row",class:{"use-height":!e.currentUserParticipant}},e._l(e.headers,function(e){return s("div",{key:e.key,ref:"ref-"+e.key,refInFor:!0,staticClass:"cell",class:e.key})}),0),_get(e,"sortedParticipants","length")?s("div",{staticClass:"row wrapper sort-row"},[s("div",{staticClass:"sort row",on:{click:function(e){e.preventDefault()}}},e._l(e.headers,function(t){return s("ui-button",{key:t.key,staticClass:"cell bare icon sort",class:t.key,attrs:{disabled:"participant"!==t.key&&_get(e,"sortedParticipants","length")<=1},on:{click:function(s){return e.sortParticipantsByKey(t)}}},[["participant"===t.key?s("span",{staticClass:"participant header",class:{clicked:t.clicked}},[s("copy-button",{staticClass:"ui bare icon button",attrs:{text:e.allUsernamesList}},[e._v("\n "+e._s(e.globalThresholds.participant.isOver?" all usernames":"usernames")+"\n ")]),e.canToggleUsernameOrigin?[e.globalThresholds.participant.isOver?e._l(["github","slack"],function(t){return s("span",{key:t,staticClass:"username origin toggle"},[s("ui-button",{staticClass:"ui bare icon button",class:{selected:e.usernameOrigin===t},attrs:{disabled:e.usernameOrigin===t},on:{click:function(s){e.usernameOrigin=t}}},[s("i",{staticClass:"icon",class:t})]),s("span",{staticClass:"separator"},[e._v("/")])],1)}):s("ui-button",{staticClass:"ui bare icon button",on:{click:function(t){e.usernameOrigin="github"===e.usernameOrigin?"slack":"github"}}},[s("i",{staticClass:"icon",class:e.usernameOrigin})])]:e._e()],2):s("i",{staticClass:"icon sort",class:{clicked:t.clicked,toggled:t.toggle}})]],2)}),1)]):e._e(),s(e.animation?"transition-group":"div",{tag:"component",attrs:{name:"flip-list",tag:"div"}},e._l(e.sortedParticipants,function(t){return s("participants-panel-row",{key:t.self.$key,attrs:{participant:t,participants:e.sortedParticipants,thresholds:e.globalThresholds,performance:e.performanceMode,usernameOrigin:e.usernameOrigin}})}),1)],1),_get(e,"sortedParticipants","length")?e._e():s("div",{staticClass:"lonely"},[s("span",[e._v("No one's here yet - invite someone to review your PR!")])])])},staticRenderFns:[],functional:!1},{cssVarsGetter:function(e){return[[!0,{"5e95de333275e34a":e.maxDispositionCellWidth}]]},scopeId:"data-v-5e95de33"}),_declareGuides("ParticipantsPanelContent","data-v-5e95de33",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".sort-row[data-v-5e95de33]",onboarding:"sawParticipantsSortBar",highlight:"bracket"}},[s("p",[e._v("\n You can "),s("em",[e._v("copy all usernames")]),e._v(", or a subset of sorted usernames, by clicking the\n "),s("i",{staticClass:"icon clone"}),e._v(" button.\n ")]),e._v(" "),s("p",[e._v("\n If the Slack integration has been configured you can switch between showing/copying\n GitHub usernames and Slack handles by clicking the "),s("i",{staticClass:"icon github"}),e._v(" button\n and "),s("i",{staticClass:"icon slack"}),e._v(" button respectively.\n ")]),e._v(" "),s("p",[e._v("\n You can "),s("em",[e._v("sort participants")]),e._v(" by each category using the\n "),s("i",{staticClass:"icon sort"}),e._v(" button.\n ")])])],1)},[]),{ParticipantsPanelContent:ParticipantsPanelContent}},!0,!0,{filename:"src/view/reviews/review/participants-panel-content.vue"}),_reviewable.define(["ParticipantsPanelRow"],["truss","Guide","animator","session"],function(e,t,s,i){"use strict";class ParticipantsPanelRow{constructor(){Vue.set(this,"showAvatar",!1),Vue.set(this,"options",{placement:"bottom",theme:"dropdown-flat-top cell",trigger:"mouseenter focus",hideOnClick:!1,interactive:!1,delay:[150,null]})}get review(){return this.participant.self.review}
1get offset(){return 1.5*this.$store.services.ruler.viewportHeight}get animation(){return s.shouldAnimate()}get groupUsernames(){return this.participant.firstInGroup?_(this.participants).filter(e=>e.group===this.participant.group).map("slack"===this.usernameOrigin?"self.slackUser.handle":"self.username").compact().map(e=>"@"+e).join(", "):""}get canDismissFromDiscussions(){const e=this.participant.self;return _get(e,"dismissable")||_get(e,"dismissal")}get gitHubChangesRequested(){return"changes_requested"===_get(this,"participant","self","sanction")}get gitHubChangesApproved(){return"approved"===_get(this,"participant","self","sanction")}get displayUsername(){return"slack"===this.usernameOrigin&&_get(this,"participant","self","slackUser","handle")||_get(this,"participant","self","displayName")||_get(this,"participant","self","username")}get slackEnabled(){return!(!i.config.slackBotEnabled&&!_get(this,"$store","organizations",_.toLower(_get(this,"review","core","ownerName")),"slackWorkspace"))}get waitingOnLabel(){if(!_get(this,"participant","self","blocker"))return"not waiting on";const e=_get(this,"participant","self","blockerReason");return e?`waiting on: ${e}`:"waiting on"}cancelDeferral(){this.review.state.clearAndCommitParticipantDeferralUpdates()}dismissFromAllDiscussions(){this.participant.self.dismissable&&this.participant.self.dismiss(!0)}undoDismissFromAllDiscussions(){this.participant.self.dismissal&&this.participant.self.undismiss(!0)}}ParticipantsPanelRow.$vueOptions={props:{participant:{type:Object,required:!0},participants:{type:Array,required:!0},thresholds:{type:Object,required:!0},performance:{type:Boolean},usernameOrigin:{type:String,required:!0}}};return _declareVue("ParticipantsPanelRow",ParticipantsPanelRow,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"row wrapper",class:{"ui segment":e.participant.current}},[s(e.animation&&!e.performance?"animate-wipe-down":"div",{directives:[{name:"vue-element-spy",rawName:"v-vue-element-spy",value:{shouldSpy:e.performance&&!e.showAvatar,callback:function(){return e.showAvatar=!0},offset:e.offset,context:!1},expression:"{\n shouldSpy: performance && !showAvatar,\n callback: () => showAvatar = true,\n offset, context: false\n }"}],tag:"component",attrs:{clamp:!1,duration:"500"}},[e.participant.firstInGroup?s("div",{staticClass:"row line separator"},[s("div",{staticClass:"cell waiting on"}),s("div",{staticClass:"cell participant grouping"},[s("copy-button",{staticClass:"ui bare icon copy button",attrs:{text:e.groupUsernames}},[e._v("\n "+e._s(e.participant.group?e.participant.group:"")+"\n ")])],1),s("div",{staticClass:"spanner cell"})]):e._e()]),s("div",{staticClass:"row"},[s("div",{staticClass:"sliding cell waiting on"},[_get(e,"participant","self","blocker")?s("div",{staticClass:"default"},[s("i",{staticClass:"icon waiting on"})]):s("div",{staticClass:"placeholder"},[s("i",{staticClass:"icon waiting on circular no data"})]),s("tippy-dropdown",{attrs:{options:e.options}},[s("div",{staticClass:"revealed"},[e._v(e._s(e.waitingOnLabel))])])],1),s("div",{staticClass:"sliding cell participant",class:{unauthorized:!1===_get(e,"participant","self","collaborator")&&!_access(e,"","participant","","self","","username","","endsWith","call",["[bot]"])}},[s("div",{staticClass:"default"},[s("div",{staticClass:"user-panel"},[s("div",{staticClass:"username container"},[!e.performance||e.performance&&e.showAvatar?s("avatar",{staticClass:"avatar category",class:{current:e.participant.current},attrs:{"user-key":_get(e,"participant","self","$key"),display:"picture"}}):s("div",{staticClass:"ui avatar image"}),e.participant.current?e._e():s("div",{staticClass:"truncate-text participant name",class:{fallback:"slack"===e.usernameOrigin&&!_get(e,"participant","self","slackUser")}},[s("span",[e._v(e._s(e.displayUsername))])]),s("i",{staticClass:"dropdown icon",attrs:{alt:"user dropdown"}})],1)])]),s("tippy-dropdown",{attrs:{options:Object.assign({},e.options,{interactive:!0,trigger:"click",hideOnClick:!0,delay:[0,null],theme:"dropdown-flat-top"})}},[s("div",{staticClass:"revealed"},[s("div",{staticClass:"ui segment vertical menu"},[s("a",{staticClass:"item button",attrs:{href:_get(e,"participant","self","link")}},[s("i",{staticClass:"icon github"}),s("span",{staticClass:"truncate-text name"},[e._v(e._s(_get(e,"participant","self","username")))])]),e.slackEnabled&&_get(e,"participant","self","slackUser")?s("a",{staticClass:"item button",attrs:{href:e.participant.self.slackUser.profileUrl}},[s("i",{staticClass:"icon slack"}),s("span",{staticClass:"truncate-text name"}
1,[e._v(e._s(e.participant.self.slackUser.handle))])]):e._e(),e.participant.current?s("a",{staticClass:"item button",class:{disabled:!e.review.userHasDeferred},on:{click:e.cancelDeferral}},[s("i",{staticClass:"deferred icon"}),s("i",{staticClass:"slash icon"}),e._v(" Cancel deferral\n ")]):e._e(),e.canDismissFromDiscussions&&!e.participant.current?[_get(e,"participant","self","dismissable")&&!_get(e,"participant","self","dismissal")?s("a",{staticClass:"item button",class:{disabled:_access(e,"","review","","state","","isLocked","call",[])},on:{click:e.dismissFromAllDiscussions}},[s("i",{staticClass:"dismiss icon"}),s("span",[e._v("Dismiss from all discussions")])]):s("a",{staticClass:"item button",class:{disabled:_access(e,"","review","","state","","isLocked","call",[])},on:{click:e.undoDismissFromAllDiscussions}},[s("i",{staticClass:"undo icon"}),s("span",[e._v("Undo dismiss from all discussions")])])]:e._e()],2)])])],1),s("div",{staticClass:"sliding cell status"},["no status"!==_get(e,"participant","self","status")?s("div",{staticClass:"default"},[s("span",{staticClass:"tight icon-row"},[_get(this,"participant","self","sanctionIcon")?s("i",{staticClass:"icon",class:_get(this,"participant","self","sanctionIcon")}):e._e(),_get(e,"participant","self","dispositionBlocking")&&!e.gitHubChangesRequested?s("i",{staticClass:"icon disposition blocking"}):e._e(),_get(e,"participant","self","discussing")?s("i",{staticClass:"icon ongoing discussion"}):e._e()]),_get(e,"participant","self","lgtm")&&!e.gitHubChangesApproved?s("img",{staticClass:"emoji",attrs:{src:"/"+e.participant.self.lgtm+".png"}}):e._e()]):s("div",{staticClass:"placeholder"},[s("i",{staticClass:"icon participant status circular no data"})]),s("tippy-dropdown",{attrs:{options:e.options}},[s("div",{staticClass:"revealed"},[e._v(e._s(_get(e,"participant","self","status")))])])],1),s("div",{staticClass:"sliding cell role"},[s("div",{staticClass:"default"},[s("span",{staticClass:"icon-row"},[_get(e,"participant","self","assignee")?s("i",{staticClass:"assignee left icon"}):e._e(),_get(e,"participant","self","author")&&_get(e,"participant","self","activeReviewer")?s("span",{staticClass:"tight icon-row"},[s("i",{staticClass:"icon author"}),s("i",{staticClass:"icon reviewer",class:{green:_get(e,"participant","self","draftActiveReviewer")}})]):_get(e,"participant","self","author")?s("i",{staticClass:"icon author"}):_get(e,"participant","self","requestedReviewer")&&_get(e,"participant","self","activeReviewer")?s("i",{staticClass:"icon review requested"}):_get(e,"participant","self","activeReviewer")?s("i",{staticClass:"icon reviewer",class:{green:_get(e,"participant","self","draftActiveReviewer")}}):_get(e,"participant","self","requestedReviewer")?s("i",{staticClass:"icon review requested inactive"}):_get(e,"participant","self","mentionee")?s("i",{staticClass:"icon mentionee"}):s("i",{staticClass:"icon passive"}),_get(e,"participant","self","assignee")?s("i",{staticClass:"assignee right icon"}):e._e()])]),s("tippy-dropdown",{attrs:{options:e.options}},[s("div",{staticClass:"revealed"},[e._v(e._s(_get(e,"participant","self","role")))])])],1),s("div",{staticClass:"sliding cell contributor"},[_get(e,"participant","self","contributor")?s("div",{staticClass:"default"},[s("i",{staticClass:"icon commit"})]):s("div",{staticClass:"placeholder"},[s("i",{staticClass:"icon commit circular no data"})]),s("tippy-dropdown",{attrs:{options:e.options}},[s("div",{staticClass:"revealed"},[e._v("\n "+e._s(_get(e,"participant","self","contributor")?"contributor":"no commits")+"\n ")])])],1),s("div",{staticClass:"sliding cell last-active",class:{"is-over":_get(e,"thresholds","last-active","isOver")}},[_get(e,"participant","self","lastUpdateTimeAgoShort")?s("div",{staticClass:"default"},[s("div",[_get(e,"thresholds","last-active","isOver")?s("span",[e._v("\n "+e._s(_get(e,"participant","self","lastUpdateTimeAgoShort"))+"\n ")]):s("span",[e._v("\n "+e._s(_access(e,"","participant","","self","","lastUpdateTimeAgoShort","","replace","call",["ago",""]))+"\n ")])])]):s("div",{staticClass:"placeholder"},[s("i",{staticClass:"icon active circular no data"})]),s("tippy-dropdown",{attrs:{options:e.options}},[s("div",{staticClass:"revealed"},[_get(e,"participant","self","lastUpdateLocalTime")?s("span",{staticClass:"controlled-height"},[e._v("\n "+e._s(e.participant.self.lastUpdateLocalTime)+"\n ")]):s("span",[e._v("no activity")])])])],1
1),s("div",{staticClass:"sliding cell drafts"},[_get(e,"participant","self","draftsPending")?s("div",{staticClass:"default"},[s("i",{staticClass:"icon drafts"})]):s("div",{staticClass:"placeholder"},[s("i",{staticClass:"icon drafts circular no data"})]),s("tippy-dropdown",{attrs:{options:e.options}},[s("div",{staticClass:"revealed"},[_get(e,"participant","self","draftsPending")?s("span",[e._v("drafts pending")]):s("span",[e._v("no drafts pending")])])])],1),s("div",{staticClass:"sliding cell discussions",class:{"is-over":_get(e,"thresholds","discussions","isOver")}},[_get(e,"participant","self","dispositions","length")?s("div",{staticClass:"default"},[s("participants-disposition-counter",{attrs:{discussions:_get(e,"participant","self","discussions"),condensed:!_get(e,"thresholds","discussions","isOver"),participant:e.participant}})],1):s("div",{staticClass:"placeholder"},[s("i",{staticClass:"icon discussions circular no data"})]),s("tippy-dropdown",{attrs:{options:e.options}},[s("div",{staticClass:"revealed"},[e._v("\n "+e._s(_get(e,"participant","self","dispositions","length")?"discussions":"no discussions")+"\n ")])])],1)])],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-2e11b60f"}),_declareGuides("ParticipantsPanelRow","data-v-2e11b60f",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".row.wrapper .row:not(.line.separator) .cell.waiting.on[data-v-2e11b60f]",onboarding:"sawCellWaitingOn","no-tooltip":"",highlight:"bracket"}},[s("p",{staticClass:"center-text"},[e._v("Waiting on")]),e._v(" "),s("hr"),e._v(" "),s("dl",{staticClass:"wide-35"},[s("dt",[s("i",{staticClass:"icon waiting on"})]),e._v(" "),s("dd",[e._v("The user is "),s("em",[e._v("responsible for the next step")]),e._v(" of this review.")]),e._v(" "),s("dt",[s("i",{staticClass:"icon waiting on circular no data"})]),e._v(" "),s("dd",[e._v("The user is "),s("em",[e._v("not being waited on")]),e._v(" in the review.")])])]),e._v(" "),s("guide",{attrs:{for:".row.wrapper .row:not(.line.separator) .cell.participant[data-v-2e11b60f]",onboarding:"sawCellParticipant","no-tooltip":"",highlight:"bracket"}},[s("p",{staticClass:"center-text"},[e._v("Participants")]),e._v(" "),s("hr"),e._v(" "),s("p",[e._v("\n This shows the "),s("em",[e._v("user")]),e._v("'s GitHub avatar, user and display names, and a link to their\n GitHub profile.\n ")]),e._v(" "),s("p",[s("em",[e._v("Dropdown actions")]),e._v(" include:\n "),s("ul",[s("li",[s("em",[e._v("cancel your deferral")]),e._v(" to indicate that you intend to resume the review;")]),e._v(" "),s("li",[s("em",[e._v("dismiss")]),e._v(" the user from "),s("em",{attrs:{em:""}},[e._v("all unresolved discussions")]),e._v(";")]),e._v(" "),s("li",[s("em",[e._v("undo")]),e._v(" all such dismissals (until you publish).")])])]),e._v(" "),s("p",[e._v("\n If a name is "),s("em",[e._v("crossed out")]),e._v(" then that user is not a collaborator on the repository and\n doesn't have access to the review.\n ")])]),e._v(" "),s("guide",{attrs:{for:".row.wrapper .row:not(.line.separator) .cell.status[data-v-2e11b60f]",onboarding:"sawCellStatus","no-tooltip":"",highlight:"bracket"}},[s("p",{staticClass:"center-text"},[e._v("Status")]),e._v(" "),s("hr"),e._v(" "),s("dl",{staticClass:"wide-60"},[s("dt",[s("i",{staticClass:"icon sanction approved"})]),e._v(" "),s("dd",[e._v("The user has "),s("em",[e._v("approved the pull request")]),e._v(".")]),e._v(" "),s("dt",[s("i",{staticClass:"icon sanction blocked"})]),e._v(" "),s("dd",[e._v("The user has "),s("em",[e._v("requested changes")]),e._v(" to the pull request.")]),e._v(" "),s("dt",[s("img",{staticClass:"icon emoji",attrs:{src:"/lgtm.png"}})]),e._v(" "),s("dd",[e._v("The user says 'Everything "),s("em",[e._v("looks good to me")]),e._v("!'.")]),e._v(" "),s("dt",[s("i",{staticClass:"icon disposition blocking"})]),e._v(" "),s("dd",[e._v("The user is "),s("em",[e._v("blocking a discussion")]),e._v(" in the review.")]),e._v(" "),s("dt",[s("i",{staticClass:"icon sanction dismissed"})]),e._v(" "),s("dd",[e._v("The user had their vote "),s("em",[e._v("dismissed")]),e._v(" from the pull request.")]),e._v(" "),s("dt",[s("i",{staticClass:"icon participant status circular no data"})]),e._v(" "),s("dd",[e._v("The user has "),s("em",[e._v("no approval-related status")]),e._v(".")])])]),e._v(" "),s("guide",{attrs:{for:".row.wrapper .row:not(.line.separator) .cell.role[data-v-2e11b60f]",onboarding:"sawCellRole","no-tooltip":"",highlight:"bracket"}},[s("p",{staticClass:"center-text"},[e._v("Role")]),e._v(" "),s("hr"),e._v(" "),s("dl",{staticClass:"wide-35"},[s("dt",[s("i",{staticClass:"icon author"})]),e._v(" "),s("dd",[e._v("The user is the "),s("em",[e._v("author of the pull request")]),e._v(".")]),e._v(" "),s("dt",[s("i",{staticClass:"icon reviewer"})]),e._v(" "),s("dd",[e._v("The user is a "),s("em",[e._v("reviewer")]),e._v(".")]),e._v(" "),s("dt",[s("i",{staticClass:"icon review requested active"})]),e._v(" "),s("dd",[e._v("The user is a "),s("em",[e._v("requested reviewer")]),e._v(" active in the review.")]),e._v(" "),s("dt",[s("i",{staticClass:"icon review requested inactive"})]),e._v(" "),s("dd",[e._v("The user is a "),s("em",[e._v("requested reviewer")]),e._v(" not yet active in the review.")]),e._v(" "),s("dt",[s("i",{staticClass:"icon mentionee"})]),e._v(" "),s("dd",[e._v("The user has only been "),s("em",[e._v("@-mentioned")]),e._v(" in a discu
1ssion.")]),e._v(" "),s("dt",[s("i",{staticClass:"icon passive"})]),e._v(" "),s("dd",[e._v("The user is "),s("em",[e._v("not directly participating")]),e._v(" in the review.")]),e._v(" "),s("dt",[s("i",{staticClass:"icon assignee left"}),e._v(" "),s("i",{staticClass:"icon assignee right"})]),e._v(" "),s("dd",[e._v("The user is "),s("em",[e._v("assigned to this pull request")]),e._v(".")])])]),e._v(" "),s("guide",{attrs:{for:".row.wrapper .row:not(.line.separator) .cell.contributor[data-v-2e11b60f]",onboarding:"sawCellContributor","no-tooltip":"",highlight:"bracket"}},[s("p",{staticClass:"center-text"},[e._v("Contributor")]),e._v(" "),s("hr"),e._v(" "),s("dl",{staticClass:"wide-35"},[s("dt",[s("i",{staticClass:"icon commit"})]),e._v(" "),s("dd",[e._v("The user has "),s("em",[e._v("authored or submitted a commit")]),e._v(" in this pull request.")]),e._v(" "),s("dt",[s("i",{staticClass:"icon commit circular no data"})]),e._v(" "),s("dd",[e._v("The user was "),s("em",[e._v("not involved with commits")]),e._v(" in this pull request.")])])]),e._v(" "),s("guide",{attrs:{for:".row.wrapper .row:not(.line.separator) .cell.last-active[data-v-2e11b60f]",onboarding:"sawCellLastActive","no-tooltip":"",highlight:"bracket"}},[s("p",{staticClass:"center-text"},[e._v("Last active")]),e._v(" "),s("hr"),e._v(" "),s("p",[e._v("The last time that the user "),s("em",[e._v("was active in the review")]),e._v(".")]),e._v(" "),s("dl",{staticClass:"wide-35"},[s("dt",[s("i",{staticClass:"icon active circular no data"})]),e._v(" "),s("dd",[e._v("The user is "),s("em",[e._v("not yet active in the review")]),e._v(".")])])]),e._v(" "),s("guide",{attrs:{for:".row.wrapper .row:not(.line.separator) .cell.drafts[data-v-2e11b60f]",onboarding:"sawCellDrafts","no-tooltip":"",highlight:"bracket"}},[s("p",{staticClass:"center-text"},[e._v("Drafts")]),e._v(" "),s("hr"),e._v(" "),s("dl",{staticClass:"wide-35"},[s("dt",[s("i",{staticClass:"icon drafts"})]),e._v(" "),s("dd",[e._v("The user has "),s("em",[e._v("pending comments drafted")]),e._v(" that are not yet published.")]),e._v(" "),s("dt",[s("i",{staticClass:"icon drafts circular no data"})]),e._v(" "),s("dd",[e._v("The user has "),s("em",[e._v("no pending drafts")]),e._v(".")])])]),e._v(" "),s("guide",{attrs:{for:".row.wrapper .row:not(.line.separator) .cell.discussions[data-v-2e11b60f]",onboarding:"sawCellDiscussions","no-tooltip":"",highlight:"bracket"}},[s("p",{staticClass:"center-text"},[e._v("Discussions")]),e._v(" "),s("hr"),e._v(" "),s("p",[e._v("\n Here is the list of all disposition types in the user's discussions and the\n "),s("em",[e._v("total number of discussions with each disposition in the review")]),e._v(". For a list of\n dispositions, see\n "),s("a",{attrs:{href:"https://docs.reviewable.io/discussions#dispositions-and-resolution",target:"_blank",rel:"noopener noreferrer"}},[e._v("the docs.")])]),e._v(" "),s("dl",{staticClass:"wide-35"},[s("dt",[s("i",{staticClass:"icon discussions circular no data"})]),e._v(" "),s("dd",[e._v("The user is "),s("em",[e._v("not engaged in any discussions")]),e._v(".")])]),e._v(" "),s("p",[e._v("\n If a disposition turns green, you have at least one discussion where you will\n take on that disposition when you publish. Hover over a disposition icon to see\n the number of draft disposition changes you have pending.\n ")])])],1)},[]),{ParticipantsPanelRow:ParticipantsPanelRow}},!0,!0,{filename:"src/view/reviews/review/participants-panel-row.vue"}),_reviewable.define(["ParticipantsPanel"],["truss","Guide","Review"],function(e,t,s){"use strict";class ParticipantsPanel{constructor(){}}ParticipantsPanel.$vueOptions={props:{review:{type:s,required:!0}}};return _declareVue("ParticipantsPanel",ParticipantsPanel,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.review.context?s("flow-panel",{staticClass:"participants",attrs:{panelKey:"participants",collapsible:"",context:e.review.context,type:"info","force-clamped":""},scopedSlots:e._u([{key:"title",fn:function(){return[s("span",{staticClass:"title"},[s("i",{staticClass:"participants header icon"}),e._v(" Participants")])]},proxy:!0},{key:"content",fn:function(t){var i=t.overlaid;return[s("participants-panel-content",{staticClass:"container",class:{overlaid:i},attrs:{review:e.review}})]}}],null,!1,2886556174)}
1):e._e()},staticRenderFns:[],functional:!1},{scopeId:"data-v-580371d2"}),_declareGuides("ParticipantsPanel","data-v-580371d2",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".title[data-v-580371d2], .participants.panel[data-v-580371d2] .panel.title",onboarding:"sawParticipantsPanel",highlight:"bracket"}},[s("p",[e._v("\n The "),s("em",[e._v("participants panel")]),e._v(" lets you quickly track the status of each individual that is\n involved in the review.\n ")]),e._v(" "),s("p",[e._v("\n Every "),s("em",[e._v("information cell")]),e._v(" has contextual help with more details on its\n contents. Some cells may also have a dropdown menu with "),s("em",[e._v("relevant actions")]),e._v(".\n ")])])],1)},[]),{ParticipantsPanel:ParticipantsPanel}},!0,!0,{filename:"src/view/reviews/review/participants-panel.vue"}),_reviewable.define(["PublishPreview"],["truss"],function(e){"use strict";class PublishPreview{constructor(){}get draftList(){const e=[],t=this.preview.publicationContent;return _get(t,"topDraft")&&e.push({type:"topDraft"}),_get(t,"cmdDraft")&&e.push({type:"cmdDraft"}),(_get(t,"topDraft")||_get(t,"cmdDraft"))&&e.push({type:"divider"}),_get(t,"summary","html")&&e.push({type:"summary"}),this.preview.drafts.length&&(e.push({type:"divider"}),_.forEach(this.preview.drafts,(t,s)=>{e.push({type:"draft",draft:t,showDivider:s!==this.preview.drafts.length-1})})),e}visitDiscussion(e,t){t.preventDefault(),_access(this,"","review","","context","","navigation","","visitDiscussion","call",[e])}visitPanel(e,t){t.preventDefault(),_access(this,"","review","","context","","navigation","","visitPanel","call",[e])}}PublishPreview.$vueOptions={props:{review:Object,preview:Object,initialHeight:Number}};return _declareVue("PublishPreview",PublishPreview,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"preview ui bottom segment"},[s("div",{key:"preview-error"},[s("animate-slide-down",{attrs:{appear:""}},[e.preview.publicationHadError?s("div",{staticClass:"ui error message"},[e._v("\n "+e._s(e.preview.publicationError.message)+"\n "),s("span",{staticClass:"ui small button",staticStyle:{"margin-left":"2em"},on:{click:function(t){return e.$emit("retry")}}},[e._v("\n Try again\n ")])]):e._e()])],1),e._l(e.draftList,function(t,i){return["topDraft"===t.type?s("div",{key:"item-"+i,staticClass:"comment link top",on:{click:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])||"button"in t&&0!==t.button?null:e.visitDiscussion("-top",t)}}},[s("div",{staticClass:"markdown-body",attrs:{lang:""},domProps:{innerHTML:e._s(e.preview.publicationContent.topDraft.previewBodyHtml)}})]):"cmdDraft"===t.type?s("div",{key:"item-"+i,staticClass:"comment link",on:{click:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])||"button"in t&&0!==t.button?null:e.visitPanel("pullRequest",t)}}},[s("div",{staticClass:"markdown-body",attrs:{lang:""},domProps:{innerHTML:e._s(e.preview.publicationContent.cmdDraft.previewBodyHtml)}})]):"divider"===t.type?s("div",{key:"item-"+i,staticClass:"ui divider"}):"summary"===t.type?s("div",{key:"item-"+i,staticClass:"markdown-body summary",domProps:{innerHTML:e._s(e.preview.publicationContent.summary.html)}}):"draft"===t.type?s("div",{key:"item-"+i,staticClass:"comment wrapper"},[s("div",{staticClass:"comment link",class:[t.draft.role],on:{click:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"left",37,s.key,["Left","ArrowLeft"])||"button"in s&&0!==s.button?null:e.visitDiscussion(t.draft.$key,s)}}},[t.draft.file?s("div",{staticClass:"meta unobtrusive markdown-body"},[s("code",[e._v(e._s(t.draft.file.path))]),e._v("\n line "+e._s(t.draft.line)+" ["+e._s(t.draft.revisionKey)+"]\n "),t.draft.file.system?e._e():s("span",[e._v("\n ("),s("a",{attrs:{href:t.draft.rawFileLink},on:{click:function(e){e.stopPropagation()}}},[e._v("raw file")]),e._v(")\n ")])]):s("div",{staticClass:"unobtrusive markdown-body"},[e._v("\n a discussion (no related file)\n ")]),t.draft.previewBodyHtml?s("div",{staticClass:"body markdown-body",attrs:{lang:""},domProps:{innerHTML:e._s(t.draft.previewBodyHtml)}}
1):e._e(),e._l(t.draft.codeblocks.list,function(e){return s("codeblock-viewer",{key:e.$key,staticClass:"codeblock",attrs:{codeblock:e,"show-controls":!1,"show-index":t.draft.codeblocks.list.length>1}})}),t.draft.locator?s("discussion-participants",{attrs:{locator:t.draft.locator,bottom:""}}):e._e()],2),t.showDivider?s("div",{staticClass:"ui divider"}):e._e()]):e._e()]})],2)},staticRenderFns:[],functional:!1},{scopeId:"data-v-10213e94"}),{PublishPreview:PublishPreview}},!0,!0,{filename:"src/view/reviews/review/publish-preview.vue"}),_reviewable.define(["PullRequestInfoLine"],["truss"],function(e){"use strict";class PullRequestInfoLine{constructor(){Vue.set(this,"height",void 0),Vue.set(this,"tall",void 0),Vue.set(this,"sizeObserver",void 0)}mounted(){Vue.set(this,"sizeObserver",new ResizeObserver(()=>{requestAnimationFrame(()=>{this.$refs.contents&&(Vue.set(this,"height",this.$refs.contents.scrollHeight),Vue.set(this,"tall",this.height>65),Vue.set(this.$refs.contents.style,"overflow","hidden"),requestAnimationFrame(()=>{this.$refs.contents&&Vue.set(this.$refs.contents.style,"overflow","")}))})})),this.$waitForRefs("contents",e=>{this.sizeObserver.observe(e,{box:"border-box"})})}beforeDestroy(){this.sizeObserver&&this.sizeObserver.disconnect()}get maxHeight(){return this.toggle?this.collapsed?"65px":this.height?`${this.height}px`:"none":"none"}get collapsible(){return!(!this.toggle||!this.tall)}get collapsed(){return!(!this.toggle||!this.tall)&&!!_get(this,"context","stateSettings","collapse",this.toggle)}toggleCollapsed(e){this.collapsible&&(void 0===e&&(e=!this.collapsed),_.set(this.context.stateSettings,`collapse.${this.toggle}`,e))}}PullRequestInfoLine.$vueOptions={props:{icon:{type:String,required:!0},toggle:{type:String},contentToggle:{type:Boolean},context:{type:Object,required:!0}}};return _declareVue("PullRequestInfoLine",PullRequestInfoLine,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"line",class:{collapsed:e.collapsed,"content-toggle":e.contentToggle}},[s("div",{staticClass:"aside",class:{collapsible:e.collapsible},on:{click:function(t){return e.toggleCollapsed()}}},[s("i",{staticClass:"dropdown icon"}),s("i",{staticClass:"icon",class:e.icon})]),s("div",{staticClass:"contents-wrapper",on:{click:function(t){e.contentToggle&&e.toggleCollapsed(!1)}}},[s("div",{ref:"contents",staticClass:"contents"},[e._t("default")],2)]),s("div",{staticClass:"fader"})])},staticRenderFns:[],functional:!1},{cssVarsGetter:function(e){return[[!0,{"38d7ff1868171075":e.maxHeight,"38d7ff185efed183":e.toggle?"var(--transition-duration)":0}]]},scopeId:"data-v-38d7ff18"}),{PullRequestInfoLine:PullRequestInfoLine}},!0,!0,{filename:"src/view/reviews/review/pull-request-info-line.vue"}),_reviewable.define(["PullRequestPanel"],["truss","Guide","config","mangler"],function(e,t,s,i){"use strict";class PullRequestPanel{constructor(){}created(){this.$when(()=>this.context.toggles.pullRequest).then(()=>{this.$observe(()=>this.showReadyForReviewButton||!("open"===_get(this,"review","core","effectiveState")&&_get(this,"review","verdict","push")&&"github"===this.mergeMechanism),e=>{this.context.toggles.pullRequest.lockExtra(e)})})}get review(){return this.context.review}get mergeMechanism(){return _get(this,"review","repository","core","settings","merge","mechanism")}get showReadyForReviewButton(){return"open"===_get(this,"review","core","effectiveState")&&_get(this,"review","draftOnly")}get showBottomAction(){return this.showReadyForReviewButton||"external"!==this.mergeMechanism}get state(){if(_get(this,"review","draftOnly"))return"draft";switch(_get(this,"review","core","effectiveState")){case"merged":return"merged";case"closed":return"closed";case"queued":return"queued";default:return null}}get owner(){return _get(this,"review","core","ownerName")}get repo(){return _get(this,"review","core","repoName")}get prNumber(){return _get(this,"review","core","pullRequestId")}get prLink(){return[s.gitHubUrl,this.owner,this.repo,"pull",this.prNumber].join("/")}get description(){const e=_access(this,"","review","","discussions","","-top","","comments","","prDescription","","htmlBody","","match","call",[/^(<h4\b[\s\S]*?<\/h4>)\s*([\s\S]*)/]),t=_get(e,1)||"",s=_get(e,2)||"";return{title:t,titleHasLink:/<a /.test(t),body:i.enhanceDiscussionComment(_.trim(s),this.owner,this.repo,this.prNumber)}}get numCommits(){return _get(this,"review","core","commitCount")}get numRevisions(){return _get(this,"review","revisions","num","snapshotted")}get numProvisional(){return _get(this,"review","revisions","num","unsnapsh
1otted")}get prLifecycle(){if(!_get(this,"review","timestamps","created"))return;const e=new Date(this.review.timestamps.created),t=_get(this,"review","timestamps","merged")||_get(this,"review","timestamps","closed")||_get(this,"review","mergeQueueEntry","enqueuing","timestamp"),s="open"!==_get(this,"review","core","effectiveState")&&t?new Date(t):null,i=l(e),r=l(s),n=i===r,a=n||!s?` at ${c(e)}`:null,o=n?` at ${c(s)}`:null;return{startDate:i,startTime:a,startTooltip:`Pull request opened on ${i} at ${c(e,!0)}.`,endDate:n?null:r,endTime:o,endTooltip:s?`Pull request ${this.review.core.effectiveState} on ${r} at ${c(s,!0)}.`:null,endIcon:"queued"===_get(this,"review","core","effectiveState")?"pull request queued":this.review.pullRequestIcon};function l(e){return _access(e,"","toLocaleDateString","call",[[],{dateStyle:"medium"}])}function c(e,t){return _access(e,"","toLocaleTimeString","call",[[],{hour:"numeric",minute:"2-digit",timeZoneName:t?"short":void 0}])}}get milestoneLink(){const e=this.$store.services.completions.milestones.get(this.owner,this.repo),t=_.find(e,e=>e.label===_get(this,"review","milestone"));if(t)return`${s.gitHubUrl}/${this.owner}/${this.repo}/milestone/${t.number}`}readyForReview(){if(_get(this,"review","progress","readyForReviewAllowed")&&!_get(this,"review","progress","mergeInProgress"))return _access(this,"","review","","progress","","readyForReview","call",[])}get mergeAvailable(){return 3!==_get(this,"review","progress","mergeReadinessLevel")&&!_get(this,"review","progress","protectionBypassed")}}PullRequestPanel.$vueOptions={props:{context:{required:!0,type:Object}}};return _declareVue("PullRequestPanel",PullRequestPanel,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return _get(e,"review","$ready")&&_get(e,"review","core")&&_get(e,"review","stateReady")?s("flow-panel",{attrs:{"panel-key":"pullRequest",collapsible:"",context:e.context,type:"info",extra:e.showBottomAction,"extra-expandable":!e.showReadyForReviewButton},scopedSlots:e._u([{key:"title",fn:function(){return[s("span",{staticClass:"title"},[s("i",{staticClass:"header icon",class:_get(e,"review","pullRequestIcon")}),e._v(" Pull request\n "),e.state?s("span",{staticClass:"pull request state",class:e.state},[e._v(e._s(e.state))]):e._e()])]},proxy:!0},{key:"content",fn:function(){return[s("div",{staticClass:"relative"},[s("div",{staticClass:"ui comments"},[s("div",{ref:"description",staticClass:"comment"},[s("avatar",{staticClass:"avatar",attrs:{"user-key":_get(e,"review","core","authorKey"),display:"picture,popup"}}),s("div",{staticClass:"content markdown-body text"},[e.description.titleHasLink?[s("div",{staticClass:"pull request title"},[s("div",{directives:[{name:"untrusted-html",rawName:"v-untrusted-html",value:e.description.title,expression:"description.title"}]}),s("a",{staticClass:"pull request link",attrs:{href:e.prLink}},[s("span",{staticClass:"unobtrusive"},[s("i",{staticClass:"github icon"}),e._v("Â \n "),s("span",{staticClass:"inserted-pr-link"},[e._v(e._s(e.owner)+"/"+e._s(e.repo)+" #"+e._s(e.prNumber))])])])])]:[s("div",{staticClass:"pull request title"},[s("a",{staticClass:"pull request link",attrs:{href:e.prLink}},[s("div",{directives:[{name:"untrusted-html",rawName:"v-untrusted-html",value:e.description.title,expression:"description.title"}]}),s("span",{staticClass:"unobtrusive"},[s("i",{staticClass:"github icon"}),e._v("Â \n "),s("span",{staticClass:"inserted-pr-link"},[e._v(e._s(e.owner)+"/"+e._s(e.repo)+" #"+e._s(e.prNumber))])])])])]],2)],1)]),s("div",{staticClass:"infos"},[s("div",{staticClass:"setoff"},[s("pull-request-info-line",{staticClass:"metadata",attrs:{icon:"pull request",toggle:"prDetails",context:e.context}},[s("span",{staticClass:"inline-block"},[s("a",{staticClass:"commits revisions",class:{link:_get(e,"review","files","-commits")},on:{click:function(t){return e.context.navigation.visitFile(_get(e,"review","files","-commits"))}}},[e._v(e._s(e.numCommits)+"Â commit"+e._s(1!==e.numCommits?"s":"")+"\n "),s("span",{staticClass:"in"},[e._v(" in ")]),e._v("\n "+e._s(e.numRevisions)+"Â revision"+e._s(1!==e.numRevisions?"s":""))]),e.numProvisional?s("span",{staticClass:"revisions info"},[e._v("\n (+"+e._s(e.numProvisional)+" provisional)\n ")]):e._e(
1)]),s("span",{staticClass:"inline-block"},[s("review-branch",{attrs:{head:_get(e,"review","core","head"),base:_get(e,"review","core","base"),context:e.context}})],1),e.prLifecycle?s("span",{staticClass:"inline-block"},[e._v("\n ("),s("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.prLifecycle.startTooltip,expression:"prLifecycle.startTooltip"}]},[s("i",{staticClass:"pull request created icon"}),e._v("\n "+e._s(e.prLifecycle.startDate)+e._s(e.prLifecycle.startTime))]),e.prLifecycle.endDate||e.prLifecycle.endTime?s("span",[e._v(",\n "),s("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.prLifecycle.endTooltip,expression:"prLifecycle.endTooltip"}]},[s("i",{staticClass:"icon",class:e.prLifecycle.endIcon}),e._v("\n "+e._s(e.prLifecycle.endDate)+e._s(e.prLifecycle.endTime))])]):e._e(),e._v(")\n ")]):e._e(),s("animate-wipe-down",[_get(e,"review","core","base","changeError")?s("div",{staticClass:"ui error message"},[e._v("\n Failed to change base branch: "+e._s(e.review.core.base.changeError)+"\n ")]):e._e()])],1),s("animate-wipe-down",[_get(e,"review","milestone")?s("pull-request-info-line",{attrs:{icon:"milestone",context:e.context}},[s("a",{staticClass:"github milestone link",attrs:{href:e.milestoneLink}},[e._v(e._s(e.review.milestone))])]):e._e()],1),s("animate-wipe-down",[_get(e,"review","labels","$empty")?e._e():s("pull-request-info-line",{attrs:{icon:"labels",toggle:"prLabels",context:e.context}},[s("span",{staticClass:"labels list"},[e._l(_get(e,"review","labels","list"),function(t){return[s("animate-wipe-right",{key:t.name,attrs:{appear:""}},[s("span",{staticClass:"label wrapper"},[s("a",{staticClass:"github",attrs:{href:t.link}},[s("span",{staticClass:"ui tag label",style:{"background-color":t.backgroundColor,color:t.color}},[e._v("\n "+e._s(t.displayName)+"\n ")])])])])]})],2)])],1),e.$info.userid?s("pull-request-info-line",{staticClass:"command",attrs:{icon:"command",context:e.context}},[s("command-line",{attrs:{review:e.review}})],1):e._e()],1),s("animate-wipe-down",[_get(e,"description","body")?s("pull-request-info-line",{staticClass:"description",attrs:{icon:"description",toggle:"prDescription","content-toggle":"",context:e.context}},[s("div",{directives:[{name:"untrusted-html",rawName:"v-untrusted-html",value:e.description.body,expression:"description.body"}],staticClass:"markdown-body text no-quote"})]):e._e()],1),e._l(_get(e,"review","progress","mergeWarnings"),function(t){return[s("animate-wipe-down",{key:t.key},[s("pull-request-info-line",{attrs:{icon:t.color+" warning sign",context:e.context}},[s("merge-warning",{attrs:{warning:t}})],1)],1)]})],2),e.state?s("div",{staticClass:"pull request mask watermark",class:e.state}):e._e()])]},proxy:!0},{key:"extra-title",fn:function(){return[e.showReadyForReviewButton?[s("ui-button",{staticClass:"dimmable extra ready for review",class:{dimmed:_get(e,"review","progress","mergeInProgress")},attrs:{disabled:!_get(e,"review","progress","readyForReviewAllowed")},on:{click:e.readyForReview}},[s("i",{staticClass:"pull request icon"}),e._v("\n Ready for review\n "),s("div",{staticClass:"ui simple inverted dimmer"},[s("div",{staticClass:"ui loader mini"})])])]:[s("span",{staticClass:"options"},[s("i",{staticClass:"configure icon"}),e._v(" Merge options")]),s("animate-slide-down",{staticClass:"extra button",attrs:{mode:"out-in"}},[_get(e,"review","progress","mergeQueued")?s("merge-queued",{key:"queued",attrs:{review:e.review,"merge-queue-entry":e.review.mergeQueueEntry,"offer-cancel":""}}):s("merge-button",{key:"merge",attrs:{review:e.review}})],1)]]},proxy:!0},{key:"extra",fn:function(){return[e.showReadyForReviewButton?e._e():s("merge-options",{attrs:{review:e.review}})]},proxy:!0}],null,!1,1421728771)}):e._e()},staticRenderFns:[],functional:!1},{scopeId:"data-v-a173aa6a"}),_declareGuides("PullRequestPanel","data-v-a173aa6a",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".comment[data-v-a173aa6a] .pull.request.link",onboarding:"navigatedToPullRequest",highlight:"under"}},[s("p",[e._v("\n The "),s("em",[e._v("pull request repository and number")]),e._v(". Click to navigate to the pull request page\n on GitHub.\n ")])]),e._v(" "),s("guide",{attrs:{for:".commits.revisions[data-v-a173aa6a]",onboarding:"sawRevisionsInfo",highlight:"under"}},[s("p",[e._v("\n The "),s("em",[e._v("total number of commits and revisions")]),e._v(" in the review. Each revision is an\n automatic, immutable capture of "),s("em",[e._v("one or more commits")]),e._v(", depending on the review style\n and number of commits.\n ")]),e._v(" "),s("p",[e._v("\n Click on the link to go to the "),s("em",[e._v("virtual C
1ommits file")]),e._v(", where you can see which commits\n make up each revision and change the review style.\n ")]),s("p",[s("em",[e._v("Provisional")]),e._v(" revisions are tentative, and "),s("em",[e._v("may still change")]),e._v(". They'll become\n permanent when somebody starts reviewing them.\n ")])]),e._v(" "),s("guide",{attrs:{for:".milestone.link[data-v-a173aa6a]",onboarding:"sawMilestone",highlight:"bracket"}},[s("p",[e._v("\n The "),s("em",[e._v("milestone")]),e._v(" for this pull request. Click to navigate to the milestone page on\n GitHub.\n ")]),e._v(" "),s("p",[e._v("\n To "),s("em",[e._v("set or delete the milestone")]),e._v(" type a "),s("kbd",[e._v("±milestone")]),e._v(" directive into any\n comment and send it.\n ")])]),e._v(" "),s("guide",{attrs:{for:".labels.list[data-v-a173aa6a]",onboarding:"sawLabels",highlight:"bracket"}},[s("p",[e._v("\n The "),s("em",[e._v("labels")]),e._v(" for this pull request. Click a label to navigate to the corresponding\n page on GitHub.\n ")]),e._v(" "),s("p",[e._v("\n To "),s("em",[e._v("add or remove labels")]),e._v(" type a "),s("kbd",[e._v("±label")]),e._v(" directive into any comment and send\n it.\n ")])]),e._v(" "),s("guide",{attrs:{for:".ready.for.review.button[data-v-a173aa6a]",onboarding:"markedReadyForReview"}},[s("p",[e._v("\n This pull request is still a "),s("em",[e._v("draft")]),e._v(". Click to tell GitHub that it is now "),s("em",[e._v("ready\n for review")]),e._v(".\n ")]),e._v(" "),s("p",[e._v("\n Once it's ready, the normal "),s("em",[e._v("merge controls and options")]),e._v(" will appear here instead.\n ")])])],1)},[]),{PullRequestPanel:PullRequestPanel}},!0,!0,{filename:"src/view/reviews/review/pull-request-panel.vue"}),_reviewable.define(["ReviewBranch"],["truss","Guide","hotkeys","dom"],function(e,t,s,i){"use strict";class ReviewBranch{constructor(){Vue.set(this,"editing",void 0),Vue.set(this,"name",void 0),Vue.set(this,"gh",void 0),Vue.set(this,"saving",void 0),Vue.set(this,"branches",[])}created(){this.$observe(()=>Boolean(this.editing&&this.gh),e=>{e&&this.fetchBranches()},{precise:!0}),this.$observe(()=>this.base,(e,t)=>{e&&(this.gh&&t&&t.owner===e.owner&&t.repo===e.repo&&t.prNumber===e.prNumber||(Vue.set(this,"gh",this.$session.hubkit(e.owner,e.repo,{prNumber:e.prNumber})),Vue.set(this,"name",e.name)))})}mounted(){s.register("copyHeadBranch",this.copyBranchName,this),s.register("editBaseBranch",this.editBranchName,this)}beforeDestroy(){document.removeEventListener("click",this.quitEditing)}copyBranchName(){_access(this,"","$refs","","copyButton","","click","call",[])}quitEditing(e){1===e.which&&(this.saving||i.findClosestElement(e.target,".edit.branch.action")||(Vue.set(this,"editing",!1),Vue.set(this,"name",this.base.name),document.removeEventListener("click",this.quitEditing)))}editBranchName(){!this.editing&&_get(this,"context","verdict","push")&&(Vue.set(this.$session.onboarding,"editedBaseBranch",!0),Vue.set(this,"editing",!0),document.addEventListener("click",this.quitEditing))}async save(e){if(!this.saving&&e&&this.gh)if(e!==this.base.name){Vue.set(this,"saving",!0);try{await this.base.change(e)}finally{Vue.set(this,"name",this.base.name),Vue.set(this,"saving",!1),Vue.set(this,"editing",!1),document.removeEventListener("click",this.quitEditing)}}else Vue.set(this,"editing",!1)}fetchBranches(){this.gh.request("GET /repos/:owner/:repo/branches").then(e=>{Vue.set(this,"branches",_(e).reject({name:_get(this,"base","name")}).map("name").sort().value())})}}ReviewBranch.$vueOptions={props:{context:{required:!0,type:Object},head:Object,base:Object}};return _declareVue("ReviewBranch",ReviewBranch,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("span",{staticClass:"commits info"},[s("span",[_get(e,"head","html")?s("span",{staticClass:"line unit"},[s("span",{staticClass:"head branch label"},[e.head.url?s("a",{directives:[{name:"untrusted-html",rawName:"v-untrusted-html",value:e.head.html,expression:"head.html"}],staticClass:"link monospace",attrs:{href:e.head.url}}):s("span",{directives:[{name:"untrusted-html",rawName:"v-untrusted-html",value:e.head.html,expression:"head.html"},{name:"tooltip",rawName:"v-tooltip",value:"Branch deleted",expression:"'Branch deleted'"}],staticClass:"monospace deleted"})]),e._v(" "),s("copy-button",{ref:"copyButton",staticClass:"ui bare icon small copy branch button",attrs:{text:e.head.name,alt:"copy head branch name"}}),s("i",{staticClass:"github icon"})],1):s("span",[e._v("an unknown repository")]),e._v(" â\n "),e.editing?s("span",{staticClass:"editor",class:{saving:e.saving}},[s("multiselect",{ref:"branchSelect",staticClass:"ui dropdown relative action edit branch dimmable",class:{dimmed:e.saving},attrs:{"options-limit":100,deselectLabel:"",selectLabel:"",selectedLabel:"",placeholder:"Select a branch",disabled:e.saving,"allow-empty":!1,options:e.branches},on:{select:e.save},scopedSlots:e._u([{key:"clear",fn:function(){return[s("div",{staticClass:"ui simple inverted dimmer"},[s("div",{staticClass:"ui mini loader"})])]},proxy:!0},{key:"noResult",fn:function(){return[s("span",[e._v("No branch found")])]},proxy:!0}],null,!1,3039082999),model:{value:e.name,callback:function(t){e.name=t},expression:"name"}})],1):s("span",[_get(e,"base","html")?s("span",{staticClass:"line unit"},[s("span",{staticClass:"base branch label"},[e.base.url?s("a",{directives:[{name:"untrusted-html",rawName:"v-untrusted-html",value:e.base.html,expression:"base.html"}],staticClass:"link monospace",attrs:{href:e.base.url}}):s("span",{directives:[{name:"untrusted-html",rawName:"v-untrusted-html",value:e.base.html,expression:"base.html"}],staticClass:"monospace deleted"})]),e._v(" "),_get(e,"context","verdict","push")?s("span",{staticClass:"ui small bare icon edit branch button",on:{click:function(t){return t.stopPropagation(),e.editBranchName()}}},[s("i",{staticClass:"edit branch name icon"}
1)]):e._e(),s("i",{staticClass:"github icon"})]):s("span",[e._v("an unknown repository")])])])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-11539794"}),_declareGuides("ReviewBranch","data-v-11539794",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".head.branch[data-v-11539794]",onboarding:"sawHeadBranch",highlight:"under"}},[s("p",[e._v("\n The "),s("em",[e._v("head branch")]),e._v(" for this pull request that holds the "),s("em",[e._v("commits to be merged")]),e._v(".\n If the branch has been deleted it'll be crossed out.\n ")])]),e._v(" "),s("guide",{attrs:{for:".base.branch[data-v-11539794]",onboarding:"sawBaseBranch",highlight:"under"}},[s("p",[e._v("\n The "),s("em",[e._v("base branch")]),e._v(" for this pull request that will "),s("em",[e._v("receive the commits")]),e._v(" when\n they are merged. If the branch has been deleted it'll be crossed out.\n ")])]),e._v(" "),s("guide",{attrs:{for:".copy.branch[data-v-11539794]",onboarding:"copiedHeadBranch","hotkey-action":"copyHeadBranch()"}},[s("p",[s("em",[e._v("Copy")]),e._v(" the pull request's "),s("em",[e._v("head branch name")]),e._v(" to the clipboard.\n ")])]),e._v(" "),s("guide",{attrs:{for:".edit.branch[data-v-11539794]",onboarding:"editedBaseBranch","hotkey-action":"editBaseBranch()"}},[s("p",[s("em",[e._v("Change")]),e._v(" the pull request's "),s("em",[e._v("base branch")]),e._v(", against which the PR is diffed and\n into which it will eventually be merged.\n ")]),e._v(" "),s("p",[e._v("\n Changing the base branch is "),s("em",[e._v("safe")]),e._v(" â you won't lose any discussions or previous\n revisions by doing so.\n ")])])],1)},[]),{ReviewBranch:ReviewBranch}},!0,!0,{filename:"src/view/reviews/review/review-branch.vue"}),_reviewable.define(["ReviewComponent"],["truss","Guide","router","hotkeys","corpsman","bus","draftFocusTracker","debug","textSelectionTracker","dom","safeStorage","session","config"],function(e,t,s,i,r,n,a,o,l,c,u,d,h){"use strict";const p="reviewable:viewed_terms";class ReviewComponent{constructor(){Vue.set(this,"ruler",this.$store.services.ruler),Vue.set(this,"context",{release:_.noop}),Vue.set(this,"trussConnector",void 0),Vue.set(this,"hasSeenLegalBanner",void 0),Vue.set(this,"unsubscribeCSSRules",void 0)}created(){const e=s.params;let t=s.current;const i=t.componentKey;"undefined"!=typeof Worker?/^\d+$/.test(e.pullRequest)?(Vue.set(this,"context",this.$store.services.reviewContext.create(e.owner,e.repo,_.parseInt(e.pullRequest),!e.filePath)),this.context.acquire(),Vue.set(this,"trussConnector",this.$connect(this,{repoConnectionDismissal:()=>_ref(this.$store,"child","users","current","settings","dismissals","repoConnectionPrompt",`${this.context.owner}|${this.context.repo}`),adminWorkflowScopePromptDismissal:()=>_ref(this.$store,"child","users","current","settings","dismissals","adminWorkflowScopePrompt"),publishOnPushTask:()=>_get(this,"review","state","publishOnPushTaskRef")})),s.afterChange(e=>{if(e.componentKey!==i)return;t=e,Vue.set(this.context.navigation,"targetFilePath",e.params.filePath);const s=!e.params.filePath;this.context.fullInterface!==s&&_ref(this,"child","context").update({fullInterface:s}),Vue.set(t,"pageTitle",this.context.pageTitle)},this),this.$observe(()=>this.context.pageTitle,e=>{Vue.set(t,"pageTitle",e)},{scope:this}),this.$when(()=>_get(this,"review","files","diffs","ready")||r.isolated).then(()=>{this.$session.analytics.recordTimings({linkDiscussion:!!this.context.navigation.targetDiscussionKey,error:!!r.isolated})}),window.addEventListener("beforeunload",this._onBeforeUnload,!0),Vue.set(this,"hasSeenLegalBanner",!!u.local.getItem(p))):r.setCondition("badprnumber",e.pullRequest):r.setCondition("badbrowser")}mounted(){this.context.navigation&&(this._registerHotkeys(),this.context.navigation.registerHotkeys(this)),document.addEventListener("mousedown",this._handleMousedown),Vue.set(this,"unsubscribeCSSRules",[this.ruler.subscribeCSSRule("width",".review-component .bottom.message",({scrollContext:e})=>({width:`${e}px`})),this.ruler.subscribeCSSRule("width",".review-component .wrapped.around.panel",({scrollC
1ontext:e})=>({width:`calc(${e}px + 200vw)`}))])}beforeDestroy(){this.ruler.resetFlowOffset(),_.forEach(this.unsubscribeCSSRules,e=>e()),document.removeEventListener("mousedown",this._handleMousedown),this.$store.services.reviewContext.leave(this.context),window.removeEventListener("beforeunload",this._onBeforeUnload,!0)}destroyed(){this.context.release()}get layoutOptimized(){return _.some(this.$store.services.ruler.flowOffset)}get repositoryCore(){return _get(this,"context","repositoryCore")}get review(){return _get(this,"context","review")}get state(){return _get(this,"context","state")}get verdict(){return _get(this,"context","verdict")}get bottomMessageType(){return this.hasSeenLegalBanner||null!==this.$info.userid||!h.privacyUrl&&!h.termsUrl?!d.hasScope("read:org")&&_get(this,"review","state","drafts","completionConditionError")&&"Organization"===_get(this,"context","repository","owner","type")?"authorize-read-org-message":(_get(this,"review","lastWebhook","error")||_get(this,"repositoryCore","error")&&!_get(this,"context","dismissedRepoError"))&&_get(this,"context","repository","permissions","admin")?"admin-error-message":this.$info.userid&&!d.hasScope("workflow")&&_get(this,"trussConnector","ready")&&(_get(this,"review","hasWorkflowFiles")||_get(this,"repositoryCore","hasWorkflowFiles")&&_get(this,"context","repository","permissions","admin")&&_.includes(["active","broken"],this.repositoryCore.connection)&&!this.adminWorkflowScopePromptDismissal&&!this.repositoryCore.settings.mergeMechanism&&this.context.fullInterface)?"authorize-workflow-message":this.context.subscriptionNeededSoon?"subscription-message":this.repositoryCore&&_get(this,"trussConnector","ready")&&("broken"===this.repositoryCore.connection||!this.repoConnectionDismissal)&&"active"!==this.repositoryCore.connection&&"disabled"!==this.repositoryCore.connection&&this.context.fullInterface?"connect-repo-message":this.$store.services.themeManager.shouldShowOutdatedCSSVarsMessage?"deprecated-css-vars-message":null:"terms-message"}get conclusionVisible(){return _get(this,"context","toggles","publish","overlaid")||this.$info.userid&&!this.context.singleFile&&_get(this,"review","discussions","top","locators","ready")}dismissLegal(){Vue.set(this,"hasSeenLegalBanner",!0),u.local.setItem(p,!0)}_registerHotkeys(){i.register("navigate",e=>{const t=e.split("#");s.go({path:t[0],hash:t.length>1?t.slice(1).join("#"):null})},this),i.register("markFileReviewedAndAdvance",this.markFileReviewedAndAdvance,this),i.register("markFileReviewedAndRetreat",this.markFileReviewedAndRetreat,this),i.register("setGlobalReviewed",()=>{const e=_get(this,"review","files");e&&(_get(e,"markReviewedSpec","undoPossible")?e.undoMarkAllReviewed():e.markAllReviewed())},this),i.register("replyToCurrentDiscussion",e=>{const t=this.context.navigation.lastVisitedParley;"discussion"===_get(t,"type")&&t&&this.state&&this.state.drafts.createReplyDraft(t,e)},this),i.register("acknowledgeCurrentDiscussion",()=>{this.state&&_access(this,"","context","","navigation","","lastVisitedParley","","tracker","","takePrimaryAction","call",[])},this),i.register("setCurrentDiscussionDisposition",e=>{if(!this.$truss.info.userid)return;let t=this.context.navigation.lastVisitedParley;"-top"!==_get(t,"$key")&&"-cmd"!==_get(t,"$key")&&("discussion"===_get(t,"type")&&(t=t.tracker,t.draft&&(t=t.draft)),t&&t.setDisposition(e))},this),i.register("toggleCurrentDiscussionOlderComments",()=>{_access(this,"","context","","navigation","","lastVisitedParley","","locator","","reverseCommentExhibitionLevel","call",[])},this),i.register("copyFileLink",()=>{if(!this.context.navigation.lastVisitedFile)return;const e=`file${this.context.navigation.lastVisitedFile.$key}`,t=window.location.href.replace(/(#.*)?$/,"#"+e);navigator.clipboard.writeText(t).catch(e=>{console.log("Unable to copy to clipboard:",e),r.markHandled(e)})},this),i.register("copyDiscussionLink",()=>{if(!this.context.navigation.lastVisitedParley)return;const e=this.context.navigation.lastVisitedParley.$key,t=window.location.href.replace(/(#.*)?$/,"#"+e);navigator.clipboard.writeText(t).catch(e=>{console.log("Unable to copy to clipboard:",e),r.markHandled(e)})},this),i.register("copyFilePath",()=>{let e;this.context.navigation.lastVisitedParley?e=this.context.navigation.lastVisitedParley.locator.filePathAndLine:this.context.navigation.lastVisitedFile&&(e=this.context.navigation.lastVisitedFile.path),e&&navigator.clipboard.writeText(e).catch(e=>{console.log("Unable to copy to clipboard:",e),r.markHandled(e)})},this),i.register("openFileInEditor",()=>{let e;this.context.navigation.lastVisitedParley?e=this.context.navigation.lastVisitedParley.locator.lineLinkUrl:this.context.navigation.lastVisitedFile&&(e=this.context.navigation.lastVisitedFile.editorLinkUrl),e&&window.open(e)},this),i.register("viewDiffOnGitHub",()=>{const e=_get(this,"context","navigation","lastVisitedFile","githubDiffUrl");e&&window.open(e)},this),i.register("openFileOnGitHub",()=>{let e;this.context.navigation.lastVisitedParley?e=this.context.navigation.lastVisitedParley.locator.githubLinkUrl:this.context.navigation.lastVisitedFile&&(e=this.context.navigation.lastVisitedFile.githubFileUrl),e&&window.open(e)},this),i.register("editFileOnGitHub",()=>{let e;this.context.navigation.lastVisitedParley?e=this.context.navigation.lastVisitedParley.locator.githubEditorLink:this.context.navigation.lastVisitedFile&&(e=this.context.navigation.lastVisitedFile.githubEditorLink),e&&window.open(e)},this),i.register("deleteDraft",()=>{a.lastFocusedDraftScope&&!a.lastFocusedDraftScope.$destroyed&&a.lastFocusedDraftScope.deleteDraft()},this),i.register("sendCurrentComment",()=>{a.lastFocusedDraftScope&&!a.lastFocusedDraftScope.$destroyed&&a.lastFocusedDraftScope.sendDraft()},this),i.register("toggleCurrentDraftPreview",()=>{a.lastFocusedDraftScope&&!a.lastFocusedDraftScope.$destroyed&&a.lastFocusedDraftScope.toggleDraftMode()},this),i.register("createCodeblockInCurrentDraft",()=>{a.lastFocusedDraftScope&&!a.lastFocusedDraftScope.$destroyed&&a.lastFocusedDraftScope.createCodeblock()},this),i.register("merge",()=>{_access(this,"","review","","progress","","merge","call",[])},this),i.register("toggleReviewerAvatars",()=>{Vue.set(this.$session.settings,"showReviewerAvatars",!this.$session.settings.showReviewerAvatars)},this)}_onBeforeUnload(e){const t="waiting"===_access(this,"","state","","isLocked","call",[])&&!_get(this,"state","publishOnPushTask");if(_get(this,"state","publishing")||t)return e.preventDefault(),Vue.set(e,"returnValue","")}_markFileReviewedAndMove(e,t){if(e||(e=this.context.navigation.lastVisitedFile),!e)return;Vue.set(this.$session.onboarding,"markFileReviewedAndAdvance",!0),this.context.navigation.anchorOnFile(e);const s=_get(this,"review","files","num","currentToReview")>1,i=_get(this,"review","files","diffs","proposedBoundsAlmostNeededToAdvanceReview");e.toggleReviewed(!0),s?this.$nextTick().then(()=>{_access(this,"","context","","navigation","",t,"call",[])}):i?(this.review.files.diffs.setProposedBounds(),this.$nextTick().then(()=>{_access(this,"","context","","navigation","",t,"call",[])})):this.context.navigation.visitPanel("publish")}markFileReviewedAndAdvance(e){this._markFileReviewedAndMove(e,"nextUnreviewedFile")}markFileReviewedAndRetreat(e){this._markFileReviewedAndMove(e,"prevUnreviewedFile")}advance(e){e&&this.context.navigation.anchorOnFile(e),_access(this,"","context","","navigation","","nextVisibleFile","call",[])}_handleMousedown(e){l.selectionHandlesVisible||this.$store.services.guideDirectory.overlayActive||c.findClosestElement(e.target,".tippy-box")||(o.drafts&&console.log("commanding empty drafts delete"),n.flush(),n.deleteEmptyDrafts(e))}}ReviewComponent.$vueOptions={props:{effectiveSidebarState:String}};return _declareVue("ReviewComponent",ReviewComponent,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"diff-copy-fixer",rawName:"v-diff-copy-fixer"}],staticClass:"review-component-root review-component review-page"},[s("selection-command-palette"),_get(e,"context","ready")&&e.layoutOptimized?e._e():s("div",{staticClass:"ui dimmable dimmed loading box"},[s("div",{staticClass:"ui simple inverted dimmer"},[s("div",{staticClass:"ui text loader"},[e._v(e._s(e.context.loadingMessage))])])]),_get(e,"context","ready")&&_get(e,"review","context")?s("div",{staticClass:"flow faded",class:{in:e.layoutOptimized}},[s("animate-reflow",{attrs:{firstReflow:e.layoutOptimized,duration:150}},[e.context.fullInterface?s("div",{staticClass:"relative",style:{"z-index":(_get(e,"review","files","displayItems","length")||0)+1}},[s("inverted-layers",[s("pull-request-panel",{attrs:{context:e.context}}),s("participants-panel",{attrs:{review:e.review}}),s("checks-panel",{attrs:{review:e.review}}
1),s("diff-controls",{attrs:{context:e.context}}),_get(e,"review","discussions","top","locators","ready")?s("discussions-top",{attrs:{context:e.context}}):e._e()],1)],1):e._e(),s("div",{staticClass:"relative files content",class:{"state ready":_get(e,"review","state"),elide:e.context.elideFilePaths,noelide:!e.context.elideFilePaths,"single-file":e.context.singleFile},attrs:{"data-reflow-key":"all-files"}},[e._l(e.review.files.displayItems,function(t,i){return s("div",{key:t.key,staticClass:"relative",style:{"z-index":e.review.files.displayItems.length-i},attrs:{id:"file"===t.kind?"file"+t.file.$key:""}},["trivialRun"===t.kind?s("trivial-files-message",{attrs:{review:e.review,files:t.files}}):s("file-root",{attrs:{file:t.file,review:e.review},on:{"mark-reviewed-and-advance":function(s){return e.markFileReviewedAndAdvance(t.file)},"mark-reviewed-and-retreat":function(s){return e.markFileReviewedAndRetreat(t.file)},advance:function(s){return e.advance(t.file)}}})],1)}),s("review-summary",{directives:[{name:"show",rawName:"v-show",value:e.conclusionVisible,expression:"conclusionVisible"}],staticClass:"relative",staticStyle:{"z-index":"0"},attrs:{context:e.context}}),e.layoutOptimized?s("file-table-ruler",{attrs:{review:e.review}}):e._e()],2)])],1):e._e(),s("animate-slide-up",[s(e.bottomMessageType,{tag:"component",style:{bottom:"drawer-horizontal"===e.effectiveSidebarState?"36px":"0px"},attrs:{context:e.context,"repo-connection-dismissal-ref":_get(e,"trussConnector","at","repoConnectionDismissal"),"admin-workflow-scope-dismissal-ref":_get(e,"trussConnector","at","adminWorkflowScopePromptDismissal")},on:{"dismiss-legal":e.dismissLegal}})],1),e._m(0)],1)},staticRenderFns:[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"wrapped around panel",staticStyle:{display:"none"}},[s("i",{staticClass:"wrapped around icon",attrs:{alt:""}}),e._v("\n Wrapped Around\n "),s("i",{staticClass:"wrapped around icon",attrs:{alt:""}})])}],functional:!1},{scopeId:"data-v-69a8fd62"}),_declareGuides("ReviewComponent","data-v-69a8fd62",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".review-component-root[data-v-69a8fd62] .chip.cell",onboarding:"clickedOnReviewChip",position:"bottom"}},[s("p",[e._v("\n The icon tells you the "),s("em",[e._v("overall review state of this file")]),e._v(" at the latest revision:\n ")]),e._v(" "),s("dl",[s("dt",[s("i",{staticClass:"designation you icon"})]),e._v(" "),s("dd",[s("em",[e._v("You")]),e._v(" were designated to review this file (possibly via team membership).")]),e._v(" "),s("dt",[s("i",{staticClass:"designation anyone icon"})]),e._v(" "),s("dd",[s("em",[e._v("Anyone")]),e._v(" is welcome to review this file.")]),e._v(" "),s("dt",[s("i",{staticClass:"designation others icon"})]),e._v(" "),s("dd",[s("em",[e._v("Others")]),e._v(" are responsible for reviewing this file.")]),e._v(" "),s("dt",[s("i",{staticClass:"designation done icon"})]),e._v(" "),s("dd",[e._v("The file has been sufficiently "),s("em",[e._v("reviewed")]),e._v(". (Hidden in the file matrix.)")])]),e._v(" "),s("p",[e._v("\n Colors have the following meanings:\n ")]),e._v(" "),s("dl",{staticClass:"wide-45"},[s("dt",[s("span",{staticClass:"ui red lowercase label"},[e._v("red")])]),e._v(" "),s("dd",[s("em",[e._v("Your review is needed")]),e._v(".")]),e._v(" "),s("dt",[s("span",{staticClass:"ui grey lowercase label"},[e._v("grey")])]),e._v(" "),s("dd",[s("em",[e._v("No action")]),e._v(" needed from you.")]),e._v(" "),s("dt",[s("span",{staticClass:"ui green lowercase label"},[e._v("green")])]),e._v(" "),s("dd",[e._v("The state is due to a "),s("em",[e._v("draft")]),e._v(" that you'll need to publish.")])]),e._v(" "),s("p",[e._v("\n You can "),s("em",[e._v("click")]),e._v(" on the icon to "),s("em",[e._v("reveal more details")]),e._v(" about who's been designated\n to review the file and why, who has already reviewed it and at which revision, etc.\n ")])])],1)},[]),{ReviewComponent:ReviewComponent}},!0,!0,{filename:"src/view/reviews/review/review-component.vue"}),_reviewable.define(["ReviewSummary"],["truss","Guide","corpsman","modifiers","router"],function(e,t,s,i,r){"use strict";class ReviewSummary{constructor(){Vue.set(this,"publicationPromise",void 0),Vue.set(this,"publicationContent",void 0),Vue.set(this,"publicationHadError",void 0),Vue.set(this,"publicationError",void 0),Vue.set(this,"drafts",[])}created(){this.$observe(()=>[_get(this,"review","state","effectiveSanction"),_get(this,"review","state","drafts","list"),_get(this,"review","state","drafts","changed"),_get(this,"review","state","trash"),_get(this,"review","state","marks"),_get(this,"review","state","roleChanges"),_get(this,"review","state","dismissals"),_get(this,"review","state","drafts","completionConditionResult"),_get(this,"review","state","drafts","completionConditionError")],()=>{this.resetPreview()},{deep:!0,precise:!0})}get preview(){return{drafts:this.drafts,publicationContent:this.publicationContent,publicationPromise:this.publicationPromise,publicationHadError:this.publicationHadError,publicationError:this.publicationError}}get disabled(){return!_get(this,"review","state","num","pendingSend")}get review(){return this.context.review}
1get locator(){return _get(this,"context","review","discussions","top","locators","-top")}get tracker(){return _get(this,"context","review","tracker","-top")}get showingBottomDraft(){return _get(this,"context","review","state","drafts","-top")}get showDeferralNotice(){return _get(this,"review","deferral","files")||_get(this,"review","deferral","discussions")}get bunnyClass(){const e=!!_get(this,"context","review","state","num","pendingSend");if(!e&&!this.context.allDraftsPublished)return;return`${e?"pending":"published"} ${_get(this,"context","review","userIsAuthor")?"right":"left"}`}get lastReviewsPath(){return this.$store.services.auth.lastReviewsPath}resetPreview(){Vue.set(this,"drafts",[]),Vue.set(this,"publicationContent",null)}async refreshPreview(){if(!_get(this,"review","state"))return;if(!_get(this,"review","state","num","pendingSend"))return void this.resetPreview();Vue.set(this,"publicationHadError",!1);const e=Vue.set(this,"publicationPromise",this.review.state.preview());try{const t=await e;if(e!==this.publicationPromise)return;Vue.set(this,"publicationContent",t),Vue.set(this,"drafts",t.drafts),Vue.set(this,"publicationHadError",!1)}catch(t){if(s.markHandled(t),e!==this.publicationPromise)return;Vue.set(this,"publicationHadError",!0),Vue.set(this,"publicationError",t),this.resetPreview()}finally{e===this.publicationPromise&&Vue.set(this,"publicationPromise",null)}}handlePublish(){document.documentElement.style.setProperty("--aux-draft-min-height",null),this.resetPreview()}navigateToReviews(e){i.externalLinkActive||(e.preventDefault(),r.go({path:this.lastReviewsPath}))}}ReviewSummary.$vueOptions={props:{context:{type:Object,required:!0}}};return _declareVue("ReviewSummary",ReviewSummary,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("flow-panel",{attrs:{"panel-key":"publish",collapsible:"",context:e.context,extra:"",type:"info"},scopedSlots:e._u([{key:"title",fn:function(){return[s("span",{staticClass:"title"},[s("i",{staticClass:"drafts header icon"}),e._v(" Conclusion\n ")])]},proxy:!0},{key:"content",fn:function(){return[s("div",{staticClass:"summary wrapper"},[s("div",{staticClass:"ui discussion segment"},[s("animate-fade-in-out",{attrs:{duration:"*=1.33"}},[_get(e,"context","reviewSummaryPublished")?s("div",{staticClass:"summary published indicator"},[s("div",[e._v("\n Published!\n "),s("i",{staticClass:"review summary published tennis ball icon"}),s("i",{staticClass:"review summary published tennis racquet icon"})])]):e._e()]),_get(e,"context","review","discussions","top","locators","ready")?s("discussion-header",{attrs:{locator:e.locator},scopedSlots:e._u([{key:"title",fn:function(){return[e._v("Review summary")]},proxy:!0}],null,!1,793960299)}):e._e(),_get(e,"context","review","discussions","top","locators","ready")?s("draft-comment",{attrs:{locator:e.locator,suffix:"-bottom",bottom:"",preview:e.preview},on:{"refresh-preview":e.refreshPreview,"reset-preview":e.resetPreview}}):e._e()],1),s("animate-slide-down",[e.showDeferralNotice||_get(e,"review","state","pendingPublishOnPush")?s("div",{staticClass:"bottom action wrapper"},[s("animate-slide-down",{attrs:{mode:"out-in"}},[_get(e,"review","state","pendingPublishOnPush")?s("publish-on-push-status",{key:"status",attrs:{review:e.review}}):e.showDeferralNotice?s("deferral-notice",{key:"defer",attrs:{review:e.review}}):e._e()],1)],1):e._e()])],1)]},proxy:!0},{key:"decor",fn:function(){return[e.bunnyClass?s("div",{directives:[{name:"translucent-on-hover",rawName:"v-translucent-on-hover",value:{targetOpacity:.65},expression:"{targetOpacity: 0.65}"}],staticClass:"publish bunny",class:e.bunnyClass}):e._e()]},proxy:!0},{key:"extra-title",fn:function(){return[s("span",{staticClass:"options"},[s("i",{staticClass:"configure icon"}),s("span",{staticClass:"ample only"},[e._v("Publish options")])]),s("publish-button",{attrs:{review:e.review,auxiliary:""},on:{published:e.handlePublish}}),s("a",{staticClass:"ample only return reviews link",attrs:{href:e.lastReviewsPath},on:{click:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])||"button"in t&&0!==t.button?null:(t.stopPropagation(),e.navigateToReviews.apply(null,arguments))}}},[s("i",{staticClass:"reviews dashboard icon"}),s("span",{staticClass:"link"},[e._v("Review list")])])]},proxy:!0},{key:"extra",fn:function(){return[_get(e,"review","state")?s("publish-options",{attrs:{review:e.review,preview:e.preview}}
1):e._e()]},proxy:!0}])})},staticRenderFns:[],functional:!1},{scopeId:"data-v-7cfa46cf"}),_declareGuides("ReviewSummary","data-v-7cfa46cf",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".summary.wrapper .discussion.header[data-v-7cfa46cf]",highlight:"bracket",onboarding:"sawReviewSummary"}},[s("p",[e._v("\n You can write an optional "),s("em",[e._v("summary")]),e._v(" for this review round here.\n The message with be added to the "),s("em",[e._v("review discussion")]),e._v(", which is always resolved.\n ")]),e._v(" "),s("p",[e._v("\n To comment on a specific line in a file, click on a diff instead.\n ")])])],1)},[]),{ReviewSummary:ReviewSummary}},!0,!0,{filename:"src/view/reviews/review/review-summary.vue"}),_reviewable.define(["SignIn"],["truss"],function(e){"use strict";class SignIn{login(){this.$session.auth.login(null,"optional")}}return _declareVue("SignIn",SignIn,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"show",rawName:"v-show",value:!e.$session.user,expression:"!$session.user"}]},[s("div",{staticClass:"ui buttons"},[s("ui-button",{staticClass:"ui labeled icon green sign in button",attrs:{disabled:e.$session.auth.disabled},on:{click:e.login}},[s("i",{staticClass:"github icon",attrs:{alt:"github"}}),e._v("\n Sign in\n ")])],1)])},staticRenderFns:[],functional:!1},{}),{SignIn:SignIn}},!0,!0,{filename:"src/view/reviews/review/sign-in.vue"}),_reviewable.define(["StatusbarContent"],["truss","Guide"],function(e,t){"use strict";class StatusbarContent{constructor(){Vue.set(this,"longerThanStatusBar",!1)}mounted(){this.$observe(()=>[this.$store.services.ruler.windowWidth,this.context.activePanelKey,this.context.ready],([e,t,s,i]=[],[r,n,a,o]=[])=>{const l=e!==r;(t!==n||l||s!==a)&&_.delay(()=>{!l&&n||this.measureHeaderRowAgainstStatusBar()},350)})}get review(){return this.context.review}get pullRequestTitle(){return _get(this,"review","core","htmlPullRequestTitle")}measureHeaderRowAgainstStatusBar(){if(!_get(this,"$refs","headerRow"))return;Vue.set(this,"longerThanStatusBar",!1);const e=_access(this,"","$refs","","headerRow","","borrowedElement","","querySelector","call",[".table.wrapper table"]);e&&Vue.set(this,"longerThanStatusBar",this.$store.services.ruler.windowWidth<e.getBoundingClientRect().width)}}StatusbarContent.$vueOptions={props:{context:{type:Object,required:!0}}};return _declareVue("StatusbarContent",StatusbarContent,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui large menu status bar segment"},[e.context.fullInterface?s("div",[e.context.ready?s("animate-wipe-right",[s("statusbar-interface",{staticClass:"right menu",attrs:{context:e.context}})],1):e._e()],1):s("div",{staticClass:"right menu complete"},[s("div",{staticClass:"base-review-url item"},[s("a",{staticClass:"ui basic circular icon return button",attrs:{href:e.context.baseReviewUrl}},[s("i",{staticClass:"up icon",attrs:{alt:"return to main review page"}})])]),s("sign-in",{staticClass:"last full bleed item"})],1),s("panel-header-stacking-layer",{ref:"headerRow",attrs:{context:e.context}})],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-660c1dc4"}),_declareGuides("StatusbarContent","data-v-660c1dc4",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".base-review-url.item[data-v-660c1dc4]",onboarding:"returnedToMainPage"}},[e._v("\n Return to the "),s("em",[e._v("main review page")]),e._v(".\n")])],1)},[]),{StatusbarContent:StatusbarContent}},!0,!0,{filename:"src/view/reviews/review/statusbar-content.vue"}),_reviewable.define(["StatusbarInterface"],["truss","session"],function(e,t){"use strict";class StatusbarInterface{constructor(){}get review(){return this.context.review}visit(e){this.context.navigation.visitPanel(e)}navigateToFile(e){e.shiftKey?this.context.navigation.prevUnreviewedFile():this.context.navigation.nextUnreviewedFile()}navigateToDiscussion(e){const t=_get(this,"review","tracker","num","unreplied");e.shiftKey?t?this.context.navigation.prevUnrepliedDiscussion():this.context.navigation.prevUnresolvedDiscussion():t?this.context.navigation.nextUnrepliedDiscussion():this.context.navigation.nextUnresolvedDiscussion()}navigateToDraft(e){e.shiftKey?this.context.navigation.prevDraft():this.context.navigation.nextDraft()}get lastStatus(){return _get(this,"review","statuses",_get(this,"review","core","lastRevisionKey"),"services")}get deferred(){return _get(this,"review","userHasDeferred")}get deferredFileCounterShown(){return!this.review.userIsAuthor&&this.deferred&&!!_get(this,"review","files","num","toReview")}get deferredDiscussionCounterShown(){return this.deferred&&!!_get(this,"review","tracker","num","unreplied")}get mainAction(){return t.user?_get(this,"review","state","num","pendingSend")?"publish":_get(this,"review","progress","mergeQueued")?"mergeQueue":_get(this,"review","progress","mergeReadinessLevel")?"merge":"publish":"signIn"}}StatusbarInterface.$vueOptions={props:{context:{type:Object,required:!0}}};return _declareVue("StatusbarInterface",StatusbarInterface,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"nowrap inline-block statusbar-interface"},[s("animate-wipe-right",["publish"===e.mainAction?s("publish-button",{staticClass:"last full bleed item",attrs:{review:e.review}}
1):e._e()],1),s("animate-wipe-right",["merge"===e.mainAction?s("merge-button",{staticClass:"last full bleed item",attrs:{review:e.review,"offer-options":""}}):e._e()],1),s("animate-wipe-right",["mergeQueue"===e.mainAction?s("merge-queued",{staticClass:"last full bleed item",attrs:{review:e.review,"merge-queue-entry":_get(e,"review","mergeQueueEntry"),"offer-options":""}}):e._e()],1),"signIn"===e.mainAction?s("div",{staticClass:"item ample only to comment"},[s("i",{staticClass:"drafts icon",attrs:{alt:""}}),s("span",{staticClass:"inline-block"},[e._v("to comment,")])]):e._e(),s("sign-in",{staticClass:"last full bleed item"})],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-f86d553e"}),{StatusbarInterface:StatusbarInterface}},!0,!0,{filename:"src/view/reviews/review/statusbar-interface.vue"}),_reviewable.define(["Statusbar"],["truss","Guide","animator","dom"],function(e,t,s,i){"use strict";class Statusbar{constructor(){Vue.set(this,"active",!1),Vue.set(this,"header",this.$store.services.header),Vue.set(this,"tippy",void 0)}mounted(){this.header.registerToggleCallback(this.toggleClickListeners),this.$el.addEventListener("mouseover",this.handleHeaderMouseEnter),this.$el.addEventListener("mouseout",this.handleHeaderMouseLeave),this.$observe(()=>this.header.accountSettings.showing,()=>{Vue.set(this,"active",this.header.accountSettings.showing)}),this.$when(()=>_.some(this.$store.services.ruler.flowOffset)).then(()=>{setTimeout(()=>{this.active||this.header.toggle(!1),this.$el&&(this.$el.removeEventListener("mouseover",this.handleHeaderMouseEnter),this.$el.removeEventListener("mouseout",this.handleHeaderMouseLeave),this.header.showing&&document.addEventListener("click",this.handleHeaderCollapseClick,{capture:!0}))},500)}),this.$waitForRefs("victory",e=>{e.classList.remove("hidden"),Vue.set(this,"tippy",tippy(this.$el,{content:e,trigger:"manual",allowHTML:!0,arrow:!1,animation:!1,placement:"right-start",zIndex:1e6,hideOnClick:!1,offset:[null,-318]})),this.$observe(()=>_get(this,"review","progress","mergeReadinessLevel"),t=>{this.tippy&&this.$session.user&&(3===t?(this.tippy.show(),anime({targets:e,duration:s.defaultOptions.duration,opacity:[0,1],translateX:[90,0],easing:"easeOutQuad"})):anime({targets:e,duration:s.defaultOptions.duration,opacity:0,translateX:[0,90],easing:"easeOutQuad",complete:()=>{this.tippy&&this.tippy.hide()}}))})})}beforeDestroy(){this.$el.removeEventListener("mouseover",this.handleHeaderMouseEnter),this.$el.removeEventListener("mouseout",this.handleHeaderMouseLeave),this.tippy&&(this.tippy.destroy(),Vue.set(this,"tippy",void 0))}get review(){return this.context.review}get state(){return this.context.state}get victoryBunny(){return _.some(_get(this,"review","discussions"),e=>_.size(e.comments)>12)?{image:"/images/6d172f10.victory_bunny_jump.png",class:"jump"}:_(_get(this,"review","files")).reject("reverted").size()>30?{image:"/images/aa0b99c0.victory_bunny_lift.png",class:"lift"}:_.size(_get(this,"review","revisions"))>10?{image:"/images/33fc8867.victory_bunny_race.png",class:"race"}:void 0}get showHeaderAnimationDuration(){return s.shouldAnimate()?this.header.animating?"150":"300":"0"}handleHeaderMouseEnter(){Vue.set(this,"active",!0)}handleHeaderMouseLeave(){Vue.set(this,"active",!1)}toggleClickListeners(e){e?document.addEventListener("click",this.handleHeaderCollapseClick,{capture:!0}):document.removeEventListener("click",this.handleHeaderCollapseClick,{capture:!0})}handleHeaderCollapseClick(e){if(!_get(this,"$refs","header","$el")||this.$store.services.guideDirectory.overlayActive)return;const t=this.$refs.header.$el.contains(e.target);this.header.clearPendingAnimations(),t||i.findClosestElement(e.target,".tippy-wrapper")||_access(document,"","querySelector","call",[".account.dialog"],"","contains","call",[e.target])||_access(document,"","querySelector","call",[".support.menu"],"","contains","call",[e.target])||_access(document,"","querySelector","call",[".multiselect__content-wrapper.editor-templates"],"","contains","call",[e.target])?t&&this.header.accountSettings.showing&&this.header.accountSettings.toggle():this.header.accountSettings.showing?(this.header.toggleHeaderAndAccountSettings(),document.removeEventListener("click",this.handleHeaderCollapseClick,{capture:!0}
1)):this.header.toggle()}}Statusbar.$vueOptions={props:{context:{type:Object,required:!0}}};return _declareVue("Statusbar",Statusbar,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"statusbar-header ui dimmable active",class:{dimmed:!e.context.ready,bare:!e.context.fullInterface,elide:e.context.elideFilePaths,noelide:!e.context.elideFilePaths},style:{"z-index":(_get(e,"review","files","displayItems","length")||0)+2}},[s("div",{staticClass:"bar wrapper"},[s("div",{staticClass:"bunny toggle",on:{click:function(t){return e.header.toggle()}}},[s("span",{staticClass:"logo image"}),s("changelog-notifier")],1),s("animate-wipe-right",{attrs:{duration:e.showHeaderAnimationDuration},on:{complete:function(t){return e.header.concludeAnimation()}}},[e.header.showing?s("app-header",{ref:"header",attrs:{"is-review":""},on:{"logged-out":function(t){return e.header.toggle(!1)}}}):e._e()],1),_get(e,"review","$ready")&&_get(e,"review","core")?s("statusbar-content",{attrs:{context:e.context}}):e._e()],1),s("div",{directives:[{name:"translucent-on-hover",rawName:"v-translucent-on-hover"}],ref:"victory",staticClass:"victory decor hidden"},[s("img",{staticClass:"victory bunny",class:_get(e,"victoryBunny","class"),attrs:{src:_get(e,"victoryBunny","image")}})])])},staticRenderFns:[],functional:!1},{scopeId:"data-v-0e355c74"}),_declareGuides("Statusbar","data-v-0e355c74",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".statusbar-header[data-v-0e355c74] .show.full",onboarding:"showedFullDiff"}},[s("p",[e._v("\n Show the "),s("em",[e._v("full diff")]),e._v(" for "),s("em",[e._v("all the files")]),e._v(" in the review.\n ")])]),e._v(" "),s("guide",{attrs:{for:".statusbar-header[data-v-0e355c74] .review.status",onboarding:"sawReviewStatus",position:"top",highlight:"under"}},[s("p",[e._v("\n This tells you what revisions you're currently reviewing.\n ")]),e._v(" "),s("p",[s("span",{staticClass:"ui red lowercase label"},[e._v("Red")]),e._v("\n counters in the toolbar above are things that\n "),s("em",[e._v("you need to take care of")]),e._v(" to move the review forward.\n ")]),e._v(" "),s("p",[s("span",{staticClass:"ui lowercase label"},[e._v("Gray")]),e._v("\n counters are things "),s("em",[e._v("somebody else")]),e._v("\n needs to look at. The review discussion is complete when\n "),s("em",[e._v("all counters are at zero")]),e._v(" and the status checks green.\n ")])]),e._v(" "),s("guide",{attrs:{for:".statusbar-header[data-v-0e355c74] .mark.all.reviewed.button",onboarding:"markedAllReviewed"}},[s("p",[s("em",[e._v("Mark all files as reviewed")]),e._v("\n up to the revision you're currently reviewing.\n This doesn't mean that you think the files are good to merge,\n just that "),s("em",[e._v("you've looked at them")]),e._v(" and made all the comments you wanted.\n ")]),e._v(" "),s("p",[e._v("\n You can mark files as reviewed "),s("em",[e._v("one-by-one")]),e._v("\n instead with\n "),s("span",{staticClass:"ui circular icon review toggle dummy button red"},[s("i",{staticClass:"unreviewed icon",attrs:{alt:"mark as reviewed"}})]),e._v(",\n which can be helpful in larger reviews.\n ")]),e._v(" "),s("p",[e._v("\n If you didn't mark the last revision, you'll want to click\n "),s("span",{staticClass:"ui tiny purple dummy button"},[s("i",{staticClass:"show unreviewed diffs icon"}),e._v("\n Show unreviewed diffs")]),e._v(", otherwise it may be time to\n "),s("span",{staticClass:"ui tiny green dummy button"},[s("i",{staticClass:"publish icon"}),e._v("\n Publish")]),e._v(" your draft comments and marks.\n ")])]),e._v(" "),s("guide",{attrs:{for:".statusbar-header[data-v-0e355c74] .set.proposed.diffs.button",onboarding:"setProposedRevRanges"}},[s("p",[s("em",[e._v("Set an appropriate diff for all files")]),e._v(" to advance the review.\n ")]),e._v(" "),s("p",[e._v("\n The suggested diffs depend on the review style,\n your previous review marks, and your role in the review,\n but will always be a "),s("em",[e._v("reasonable default choice")]),e._v(".\n You can override them using each file's revision cells or the file matrix.\n ")])]),e._v(" "),s("guide",{attrs:{for:".statusbar-header[data-v-0e355c74] .undo.reviewed",onboarding:"undidMarkAsReviewed",highlight:"under"}},[s("p",[s("em",[e._v("Undo")]),e._v(" the "),s("em",[e._v("draft marks")]),e._v("\n created by the last use of the mark as reviewed button.\n ")])])],1)},[]),{Statusbar:Statusbar}},!0,!0,{filename:"src/view/reviews/review/statusbar.vue"}),_reviewable.define(["SubscriptionMessage"],["truss"],function(e){"use strict";class SubscriptionMessage{constructor(){}}SubscriptionMessage.$vueOptions={props:{context:{type:Object,required:!0}}};return _declareVue("SubscriptionMessage",SubscriptionMessage,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui subscription bottom inverted large message"},[s("i",{staticClass:"warning sign icon",attrs:{alt:"warning"}}),e._v("\n Your\n "),_get(e,"context","coverage","lastWasTrial")?s("span",[e._v("free trial")]):s("span",[e._v("subscription")]),e._v("\n for this organization\n "),_get(e,"context","coverage","trialEndTimestamp")>e.$now?s("span",[e._v("\n will end\n "),e.context.coverage.trialDaysRemaining<=0?s("span",[e._v("\n today.\n ")]):1===e.context.coverage.trialDaysRemaining?s("span",[e._v("\n tomorrow.\n ")]):s("span",[e._v("\n in "+e._s(e.context.coverage.trialDaysRemaining)+" days.\n ")])]):s("span",[e._v("has ended.")]),e._v("\n You (or your manager/lead) need to\n "),s("a",{staticClass:"ui green labeled icon button",attrs:{href:"/admin/"+e.context.capitalizedOwner},on:{click:function(t){_access(e,"","$session","","analytics","","track","call",["Opened Subscription",{from:"review"}])}}},[s("i",{staticClass:"generic card icon",attrs:{alt:""}}),e._v("\n Subscribe\n ")]),_get(e,"context","coverage","trialEndTimestamp")>e.$now?s("span",[e._v("soon")]):s("span",[e._v("now")]),e._v("\n to continue doing reviews in this repository.\n")])},staticRenderFns:[],functional:!1}
1,{scopeId:"data-v-0675f0c9"}),{SubscriptionMessage:SubscriptionMessage}},!0,!0,{filename:"src/view/reviews/review/subscription-message.vue"}),_reviewable.define(["TermsMessage"],["truss"],function(e){"use strict";class TermsMessage{constructor(){}}return _declareVue("TermsMessage",TermsMessage,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui inverted bottom large message"},[s("i",{staticClass:"close icon",attrs:{alt:"dismiss"},on:{click:function(t){return e.$emit("dismiss-legal")}}}),e._v("\n Use of Reviewable is subject to the\n "),e.$session.config.termsUrl?s("span",{staticClass:"comma-item"},[s("a",{staticClass:"link",attrs:{href:e.$session.config.termsUrl}},[s("i",{staticClass:"legal icon",attrs:{alt:""}}),e._v("terms of use")])]):e._e(),e.$session.config.privacyUrl?s("span",{staticClass:"comma-item"},[s("a",{staticClass:"link",attrs:{href:e.$session.config.privacyUrl}},[s("i",{staticClass:"privacy icon",attrs:{alt:""}}),e._v("privacy policy")])]):e._e(),e._v(".\n")])},staticRenderFns:[],functional:!1},{}),{TermsMessage:TermsMessage}},!0,!0,{filename:"src/view/reviews/review/terms-message.vue"}),_reviewable.define(["TrivialFilesMessage"],["truss"],function(e){"use strict";let t=0;class TrivialFilesMessage{constructor(){Vue.set(this,"expanded",this.files.length<=2),Vue.set(this,"panelKey","trivial-file-message-"+t++)}get listedFiles(){return this.expanded?this.files:this.files.slice(0,2)}get numMore(){return this.files.length-this.listedFiles.length}listAllFiles(){Vue.set(this,"expanded",!0)}revealFile(e){Vue.set(this.review.context.navigation,"lastVisitedFileKey",e.$key),Vue.set(e,"nonTrivialLatch",!0)}}TrivialFilesMessage.$vueOptions={props:{review:{type:Object,required:!0},files:{type:Array,required:!0}}};return _declareVue("TrivialFilesMessage",TrivialFilesMessage,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.review.context?s("flow-panel",{attrs:{bare:"",context:e.review.context,panelKey:e.panelKey,type:"diff"},scopedSlots:e._u([{key:"content",fn:function(){return[s("div",{staticClass:"file stub"},[1===e.files.length?s("span",{staticClass:"italic"},[e._v("\n File hidden because it has no changes or you don't need to review it:\n ")]):s("span",{staticClass:"italic"},[e._v("\n Files hidden because they have no changes or you don't need to review them:\n ")]),s("span",{staticClass:"unobtrusive show all"},[e._v("\n ("),s("a",{staticClass:"link",on:{click:function(t){return e.review.files.diffs.showAllFiles()}}},[e._v("show all")]),e._v(")\n ")]),e._l(e.listedFiles,function(t){return s("div",{key:t.$key},[t.system?s("a",{staticClass:"file link",domProps:{innerHTML:e._s(t.segmentedPathHtml)},on:{click:function(s){return e.revealFile(t)}}}):s("a",{staticClass:"file link",on:{click:function(s){return e.revealFile(t)}}},[e._v(e._s(t.path))])])}),e.numMore?s("div",[s("a",{staticClass:"file link",on:{click:function(t){return e.listAllFiles()}}},[e._v("+ "+e._s(e.numMore)+" more")])]):e._e()],2)]},proxy:!0}],null,!1,3926077395)}):e._e()},staticRenderFns:[],functional:!1},{scopeId:"data-v-a379a6aa"}),{TrivialFilesMessage:TrivialFilesMessage}},!0,!0,{filename:"src/view/reviews/review/trivial-files-message.vue"}),_reviewable.define(["Sidebar"],["truss","Guide","modifiers"],function(e,t,s){"use strict";class Sidebar{constructor(){Vue.set(this,"modifiers",s),Vue.set(this,"panelScrollTops",{}),Vue.set(this,"drawerMarkerPlaceholders",{}),Vue.set(this,"fileMatrixSeeMore",!1),Vue.set(this,"discussionMatrixSeeMore",!1)}created(){this.$when(()=>this.context).then(()=>{Vue.set(this.context.toggles.fileMatrix,"showing",!0)})}mounted(){this.$observe(()=>this.collapsed,e=>{e?this.moveDrawerMarkers():this.restoreDrawerMarkers()})}beforeDestroy(){this.restoreDrawerMarkers({removeOrphans:!0})}get collapsed(){return"full"!==this.sidebarState}get sidebarState(){return this.effectiveSidebarState||"full"}get context(){return this.review.context}get matrixSeeMorePanelKey(){return"full"!==this.sidebarState?null:_get(this,"context","toggles","fileMatrix","showing")&&this.fileMatrixSeeMore?"fileMatrix":_get(this,"context","toggles","discu
1ssionMatrix","showing")&&this.discussionMatrixSeeMore?"discussionMatrix":null}openMatrixSeeMore(){this.matrixSeeMorePanelKey&&this.context.navigation.overlayPanel(this.matrixSeeMorePanelKey)}moveDrawerMarkers(){const e=document.getElementById("collapsed-sidebar-drawer");e&&(_.isEmpty(this.drawerMarkerPlaceholders)&&_.forEach(e.querySelectorAll("[drawer-marker], [drawer-marker-ph]"),e=>{e.remove()}),_.forEach(this.$el.querySelectorAll("[drawer-marker]"),t=>{const s=t.getAttribute("drawer-marker");if(!s||this.drawerMarkerPlaceholders[s]||!t.parentNode)return;const i=document.createElement("span");Vue.set(i.style,"display","none"),i.setAttribute("drawer-marker-ph",s),Vue.set(this.drawerMarkerPlaceholders,s,i),t.parentNode.insertBefore(i,t),e.appendChild(t)}))}restoreDrawerMarkers({removeOrphans:e=!1}={}){const t=document.getElementById("collapsed-sidebar-drawer");if(!t)return;const s=t.querySelectorAll("[drawer-marker]");_.forEach(s,t=>{const s=t.getAttribute("drawer-marker"),i=this.drawerMarkerPlaceholders[s];i&&i.parentNode?i.replaceWith(t):e&&t.remove()}),_.forEach(this.drawerMarkerPlaceholders,e=>{e&&e.parentNode&&e.remove()}),Vue.set(this,"drawerMarkerPlaceholders",{})}selectTab(e){if(this.context.toggles[e].showing)this.context.navigation.overlayPanel(e);else{const t=this.$refs.panelScroller,s=_.findKey(this.context.toggles,e=>e.sidebar&&e.showing);if(t&&s){Vue.set(this.panelScrollTops,s,t.scrollTop);const i=this.panelScrollTops[e]||0;requestAnimationFrame(()=>{_get(this,"context","toggles",e,"showing")&&(Vue.set(t,"scrollTop",i),requestAnimationFrame(()=>{_get(this,"context","toggles",e,"showing")&&Vue.set(t,"scrollTop",i)}))})}Vue.set(this.context.toggles[e],"showing",!0)}}visit(e){this.context.navigation.visitPanel(e)}get needsMerge(){return this.review.progress.mergeReadinessLevel>=3&&"queued"!==this.review.core.effectiveState}get numOtherBlockers(){return _(this.review.people).reject("passiveBot").filter("blocker").size()}get statuses(){const e={latest:_get(this,"review","statuses","latest"),numFailing:this.review.userIsAuthor?_(_get(this,"review","statuses","latest")).filter(e=>"error"===e.state||"failure"===e.state).size():0,numUnsuccessful:_(_get(this,"review","statuses","latest")).reject(e=>"success"===e.state||"inprogress"===e.state).size(),numIncomplete:_(_get(this,"review","statuses","latest")).filter(e=>"pending"===e.state||"missing"===e.state).size()};return Vue.set(e,"unsuccesfulDescription",e.numUnsuccessful>e.numIncomplete?"unsuccessful":e.numIncomplete?"incomplete":"deficient"),e}get files(){const e=this.review.files,t="review"===e.reviewMarkStyle&&e.num.currentToReview,s=t&&e.toBeReviewedByUserReady?t:!t&&void 0!==e.num.unreviewed&&e.neutrallyUnreviewedReady?e.num.unreviewed:"?",i="file"+(1===s?"":"s"),r=this.review.userCanDeferFiles&&this.review.userHasDeferred,n=r?' <span class="note">(deferred)</span>':"";return{num:s,selfReview:e.num.selfReviewAttention,red:t&&!r,deferred:t&&r,description:t?` ${i} to review${n}`:` unreviewed ${i}`,tooltip:e.num.currentDescription}}get discussions(){const e=_get(this,"review","tracker","num","unreplied"),t=_get(this,"review","tracker","num","left"),s="discussion"+(1===t?"":"s"),i=this.review.userHasDeferred?' <span class="note">(deferred)</span>':"";return{num:t,red:e&&!this.review.userHasDeferred,deferred:e&&this.review.userHasDeferred,description:e?` ${s} to reply to${i}`:` unresolved ${s}`,tooltip:_get(this,"review","tracker","num","description")}}navigateToFile(e){e.shiftKey?this.context.navigation.prevUnreviewedFile():this.context.navigation.nextUnreviewedFile()}navigateToDiscussion(e){const t=_get(this,"review","tracker","num","unreplied");e.shiftKey?t?this.context.navigation.prevUnrepliedDiscussion():this.context.navigation.prevUnresolvedDiscussion():t?this.context.navigation.nextUnrepliedDiscussion():this.context.navigation.nextUnresolvedDiscussion()}navigateToDraft(e){e.shiftKey?this.context.navigation.prevDraft():this.context.navigation.nextDraft()}handleVisitMatrix(e){"full"!==this.sidebarState?this.context.navigation.overlayPanel(`${e}Matrix`):this.selectTab(`${e}Matrix`)}}Sidebar.$vueOptions={props:{review:{type:Object,required:!0},effectiveSidebarState:String}};return _declareVue("Sidebar",Sidebar,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"sidebar content",class:{collapsed:e.collapsed}},[s("div",{staticClass:"overview"},[s("div",[s("div",{staticClass:"pull request item cell link",attrs:{"drawer-marker":"pullRequest","data-target-panel":"pullRequest","data-trace-side":"left"},on:{click:function(t){return e.visit("pullRequest")}}},[s("i",{staticClass:"icon",class:e.review.pullRequestIcon}),s("span",{staticClass:"content"},[e.review.draftOnly?s("span",{staticClass:"ui leading label",class:{red:e.review.userIsAuthor}},[s("i",{staticClass:"inverted draft icon",class:{red:e.review.userIsAuthor}})]):e.needsMerge?s("span",{staticClass:"ui leading label",class:{red:e.review.userIsAuthor}},[s("i",{staticClass:"inverted merge action icon",class:{red:e.review.userIsAuthor}}
1)]):"open"!==e.review.core.effectiveState?s("span",{staticClass:"pull request state",class:e.review.core.effectiveState},[e._v("\n "+e._s(e.review.core.effectiveState)+"\n ")]):e._e(),s("span",{staticClass:"title"},[e._v(e._s(e.review.core.title))])])])]),s("section",{staticClass:"group"},[s("div",{staticClass:"participants item cell link",attrs:{"drawer-marker":"participants","data-target-panel":"participants","data-trace-side":"left"},on:{click:function(t){return e.visit("participants")}}},[s("i",{staticClass:"participants icon"}),s("span",{staticClass:"content"},[e.$info.userid&&_get(e,"review","people",e.$info.userid,"blocker")?s("span",[e._m(0),s("span",{staticClass:"description"},[e._v("\n waiting on you\n ")])]):s("span",[s("span",{staticClass:"ui leading label"},[e._v(e._s(e.numOtherBlockers))]),s("span",{staticClass:"description"},[e._v("other"+e._s(e._f("plural")(e.numOtherBlockers))+" waited on")])])])]),s("div",{staticClass:"checks item cell link",attrs:{"drawer-marker":"checks","data-target-panel":"checks","data-trace-side":"left"},on:{click:function(t){return e.visit("checks")}}},[s("span",{staticClass:"icon status donut"},[e.statuses.latest?s("statuses-donut",{attrs:{status:e.statuses.latest}}):e._e()],1),s("span",{staticClass:"content"},[e.statuses.numFailing?s("span",[s("span",{staticClass:"ui leading red label"},[e._v(e._s(e.statuses.numFailing))]),s("span",{staticClass:"description"},[e._v("\n failing check"+e._s(e._f("plural")(e.statuses.numFailing))+"\n ")])]):s("span",[s("span",{staticClass:"ui leading label"},[e._v(e._s(e.statuses.numUnsuccessful))]),s("span",{staticClass:"description"},[e._v("\n "+e._s(e.statuses.unsuccesfulDescription)+" check"+e._s(e._f("plural")(e.statuses.numUnsuccessful))+"\n ")])])])]),s("div",{staticClass:"diffs item cell link",attrs:{"drawer-marker":"diffControls","data-target-panel":"diffControls","data-trace-side":"left"},on:{click:function(t){return e.visit("diffControls")}}},[s("i",{staticClass:"diff icon"}),s("span",{staticClass:"content"},["full"===e.sidebarState&&_get(e,"review","files","diffs","description","icon")?s("span",{staticClass:"ui leading label"},[s("i",{staticClass:"inverted icon",class:e.review.files.diffs.description.icon})]):"no diffs"===e.review.files.diffs.description.icon?s("span",{staticClass:"drawer-only ui leading label"},[s("i",{staticClass:"inverted icon",class:e.review.files.diffs.description.icon})]):s("span",{staticClass:"drawer-only ui leading lowercase label",class:{red:e.review.userIsReviewingFiles&&_get(e,"review","files","diffs","proposedBoundsNeededToAdvanceReview")&&!e.files.deferred}},[e._v("\n "+e._s(_get(e,"review","files","markReviewedSpec","revKey")||"r??")+"\n ")]),s("span",{directives:[{name:"untrusted-html",rawName:"v-untrusted-html",value:e.review.files.diffs.description.shortText,expression:"review.files.diffs.description.shortText"}],staticClass:"description"})])])]),s("section",{staticClass:"group"},[s("div",{staticClass:"unreviewed item cell link",attrs:{"drawer-marker":"fileMatrix","data-target-panel":"fileMatrix"},on:{click:function(t){return e.handleVisitMatrix("file")}}},[s("i",{staticClass:"files icon"}),s("span",{staticClass:"content"},[s("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:e.files.tooltip,fixed:!0},expression:"{text: files.tooltip, fixed: true}"}],staticClass:"ui leading file-counter label",class:{red:e.files.red,deferred:e.files.deferred}},[e._v("\n "+e._s(e.files.num)+"\n "),e.files.selfReview?s("span",{staticClass:"self-review disc"}):e._e()]),s("span",{directives:[{name:"untrusted-html",rawName:"v-untrusted-html",value:e.files.description,expression:"files.description"}],staticClass:"description"})]),s("ui-button",{staticClass:"mini basic link",on:{click:function(t){return t.stopPropagation(),e.navigateToFile.apply(null,arguments)}}},[s("animate-flip",[e.modifiers.shiftDown?s("span",{key:"prev",staticClass:"description"},[e._v("Prev")]):s("span",{key:"next",staticClass:"description"},[e._v("Next")])]),s("i",{staticClass:"forward icon",class:{reversed:e.modifiers.shiftDown}}
1)],1)],1),s("div",{staticClass:"unresolved item cell link",attrs:{"drawer-marker":"discussionMatrix","data-target-panel":"discussionMatrix"},on:{click:function(t){return e.handleVisitMatrix("discussion")}}},[s("i",{staticClass:"discussions icon"}),s("span",{staticClass:"content"},[s("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:e.discussions.tooltip,fixed:!0},expression:"{text: discussions.tooltip, fixed: true}"}],staticClass:"ui leading label",class:{red:e.discussions.red,deferred:e.discussions.deferred}},[e._v("\n "+e._s(e.discussions.num)+"\n ")]),s("span",{directives:[{name:"untrusted-html",rawName:"v-untrusted-html",value:e.discussions.description,expression:"discussions.description"}],staticClass:"description"})]),s("ui-button",{staticClass:"mini basic link",on:{click:function(t){return t.stopPropagation(),e.navigateToDiscussion.apply(null,arguments)}}},[s("animate-flip",[e.modifiers.shiftDown?s("span",{key:"prev",staticClass:"description"},[e._v("Prev")]):s("span",{key:"next",staticClass:"description"},[e._v("Next")])]),s("i",{staticClass:"forward icon",class:{reversed:e.modifiers.shiftDown}})],1)],1),s("div",{directives:[{name:"show",rawName:"v-show",value:e.$session.user,expression:"$session.user"}],staticClass:"drafts item cell link",attrs:{"drawer-marker":"publish","data-target-panel":"publish","data-trace-side":"bottom"},on:{click:function(t){return e.visit("publish")}}},[s("i",{staticClass:"drafts icon"}),s("span",{staticClass:"content"},[s("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:_get(e,"context","state","num","description"),fixed:!0},expression:"{text: ~context.state.num.description, fixed: true}"}],staticClass:"ui leading label",class:{red:_get(e,"context","state","num","pending")}},[e._v("\n "+e._s(_get(e,"context","state","num","drafts"))+"\n ")]),s("span",{staticClass:"description"},[e._v("\n draft"+e._s(e._f("plural")(_get(e,"context","state","num","drafts")))+" to publish\n ")])]),s("ui-button",{staticClass:"mini basic link",on:{click:function(t){return t.stopPropagation(),e.navigateToDraft.apply(null,arguments)}}},[s("animate-flip",[e.modifiers.shiftDown?s("span",{key:"prev",staticClass:"description"},[e._v("Prev")]):s("span",{key:"next",staticClass:"description"},[e._v("Next")])]),s("i",{staticClass:"forward icon",class:{reversed:e.modifiers.shiftDown}})],1)],1)])]),s("div",{staticClass:"ui tabular menu"},[s("div",{staticClass:"item",class:{active:_get(e,"context","toggles","fileMatrix","showing")},on:{click:function(t){return e.selectTab("fileMatrix")}}},[s("span",{staticClass:"title"},[s("i",{staticClass:"files icon"}),e._v(" Files\n "),s("i",{staticClass:"maximize icon",class:{hidden:!_get(e,"context","toggles","fileMatrix","showing")}})])]),s("div",{staticClass:"item",class:{active:_get(e,"context","toggles","discussionMatrix","showing")},on:{click:function(t){return e.selectTab("discussionMatrix")}}},[s("span",{staticClass:"title"},[s("i",{staticClass:"discussions icon"}),e._v(" Discussions\n "),s("i",{staticClass:"maximize icon",class:{hidden:!_get(e,"context","toggles","discussionMatrix","showing")}})])])]),s("div",{staticClass:"matrix overflow zone",class:{"see-more-showing":e.matrixSeeMorePanelKey}},[s("file-matrix-visual-tweaks",{directives:[{name:"show",rawName:"v-show",value:_get(e,"context","toggles","fileMatrix","showing"),expression:"~context.toggles.fileMatrix.showing"}],attrs:{review:e.review}}),s("animate-wipe-right",{attrs:{duration:"*=0.33"}},[s("span",{directives:[{name:"show",rawName:"v-show",value:e.matrixSeeMorePanelKey,expression:"matrixSeeMorePanelKey"}],staticClass:"relative see more",on:{click:e.openMatrixSeeMore}},[s("span",{staticClass:"description"},[e._v("See more")]),s("i",{staticClass:"see more icon"})])])],1),s("div",{ref:"panelScroller",staticClass:"fill"},[s("div",{staticClass:"matrix fade zone",class:{"file-matrix-fading":"fileMatrix"===e.matrixSeeMorePanelKey}},[s("flow-panel",{directives:[{name:"show",rawName:"v-show",value:_get(e,"context","toggles","fileMatrix","showing")||_get(e,"context","toggles","fileMatrix","overlay"),expression:"~context.toggles.fileMatrix.showing || ~context.toggles.fileMatrix.overlay"}],attrs:{panelKey:"fileMatrix",context:e.context,bare:"",sidebar:""},scopedSlots:e._u([{key:"title",fn:function(){return[s("span",{staticClass:"title"},[s("i",{staticClass:"files header icon"}),e._v(" Files\n ")])]},proxy:!0},{key:"content",fn:function(t){var i=t.overlaid;return[s("file-matrix",{attrs:{review:e.review,overlaid:i},on:{"sidebar-see-more-change":function(t){e.fileMatrixSeeMore=t}}})]}}])}),s("flow-panel",{directives:[{name:"show",rawName:"v-show",value:_get(e,"context","toggles","discu
1ssionMatrix","showing")||_get(e,"context","toggles","discussionMatrix","overlay"),expression:"~context.toggles.discussionMatrix.showing ||\n ~context.toggles.discussionMatrix.overlay"}],attrs:{panelKey:"discussionMatrix",context:e.context,bare:"",sidebar:""},scopedSlots:e._u([{key:"title",fn:function(){return[s("span",{staticClass:"title"},[s("i",{staticClass:"discussions header icon"}),e._v(" Discussions\n ")])]},proxy:!0},{key:"content",fn:function(t){var i=t.overlaid;return[s("discussion-matrix",{attrs:{review:e.review,overlaid:i},on:{"sidebar-see-more-change":function(t){e.discussionMatrixSeeMore=t}}})]}}])})],1)])])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("span",{staticClass:"ui leading red label"},[t("i",{staticClass:"red inverted waiting on icon"})])}],functional:!1},{scopeId:"data-v-828fa954"}),_declareGuides("Sidebar","data-v-828fa954",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".pull.request.item[data-v-828fa954]",onboarding:"showedPullRequestPanel","hotkey-action":"visit('pullRequest')",highlight:"bracket"}},[s("p",[e._v("\n The "),s("em",[e._v("pull request's title")]),e._v(". The icon indicates the "),s("em",[e._v("state of the pull request")]),e._v(":\n draft, open, merged, or closed.\n ")]),e._v(" "),s("p",[e._v("\n Click to open the panel that displays the relevant details, including the description,\n branches, and labels, as well as merge controls.\n ")])]),e._v(" "),s("guide",{attrs:{for:".participants.item[data-v-828fa954]",onboarding:"showedParticipantsPanel","hotkey-action":"visit('participants')",highlight:"bracket"}},[s("p",[e._v("\n Indicates the "),s("em",[e._v("number of participants")]),e._v(" in the review and whether "),s("em",[e._v("it's your\n turn")]),e._v(" to take action.\n ")]),e._v(" "),s("p",[e._v("\n Click to open the panel that details the state of all participants in the review.\n ")])]),e._v(" "),s("guide",{attrs:{for:".checks.item[data-v-828fa954]",onboarding:"showedReviewStatus","hotkey-action":"visit('checks')",highlight:"bracket"}},[s("div",[e._v("\n The donut shows an overview of the relative proportion of "),s("em",[e._v("GitHub CI checks")]),e._v(" at the\n review's "),s("em",[e._v("latest revision")]),e._v(":\n ")]),e._v(" "),s("dl",{staticClass:"wide-60"},[s("dt",[s("span",{staticClass:"ui green label"},[e._v("green")])]),s("dd",[e._v("Successful")]),e._v(" "),s("dt",[s("span",{staticClass:"ui orange label"},[e._v("orange")])]),s("dd",[e._v("Unsuccessful but not required")]),e._v(" "),s("dt",[s("span",{staticClass:"ui red label"},[e._v("red")])]),s("dd",[e._v("Unsuccessful and required")]),e._v(" "),s("dt",[s("span",{staticClass:"ui grey label"},[e._v("grey")])]),s("dd",[e._v("Pending or in progress")])]),e._v(" "),s("p",[e._v("\n Click to open the checks panel with detailed information on all the status checks.\n ")])]),e._v(" "),s("guide",{attrs:{for:".diffs.item[data-v-828fa954]",onboarding:"showedDiffControls","hotkey-action":"visit('diffControls')",highlight:"bracket"}},[s("p",[e._v("\n Gives a short description of the "),s("em",[e._v("current diff bounds")]),e._v(". If a bound is\n "),s("span",{staticClass:"ui red lowercase label"},[e._v("red")]),e._v(" then you need to "),s("em",[e._v("advance the bounds")]),e._v("\n to continue your review.\n ")]),e._v(" "),s("p",[e._v("\n Click to open the diffs panel, where you can "),s("em",[e._v("set review-wide diff bounds")]),e._v(" and control\n how diffs are presented.\n ")])]),e._v(" "),s("guide",{attrs:{for:".unreviewed.item[data-v-828fa954]",onboarding:"showedFileMatrix","hotkey-action":"visit('fileMatrix'), visitFileMatrix()",highlight:"bracket"}},[s("p",[e._v("\n If the counter is "),s("span",{staticClass:"ui red lowercase label"},[e._v("red")]),e._v(", it shows the number of\n files that "),s("em",[e._v("you still need to review")]),e._v(" at the current diff bounds.\n ")]),e._v(" "),s("p",[e._v("\n If the counter is "),s("span",{staticClass:"ui lowercase label"},[e._v("gray")]),e._v(", it shows the number of files\n that "),s("em",[e._v("other people still need to review")]),e._v(". For reviewers, gray means you have no files\n left to review at the current diff bounds.\n ")]),e._v(" "),s("p",[e._v("\n For authors who aren't designated as reviewers, the counter is always gray. A\n "),s("span",{staticClass:"ui file-counter lowercase label"}
1,[e._v("\n red dot"),s("span",{staticClass:"self-review disc"})]),e._v("\n indicates files left to self-review, until all files have been reviewed.\n ")]),e._v(" "),s("p",[e._v("\n If the counter is gray with a "),s("span",{staticClass:"ui label lowercase deferred"},[e._v("red stripe")]),e._v("\n then it indicates that you've deferred reviewing some files for now, but otherwise works just\n like a "),s("span",{staticClass:"ui red lowercase label"},[e._v("red")]),e._v(" one. These files can still be reviewed\n at any time, and marking a file as reviewed will immediately cancel your deferral.\n ")])]),e._v(" "),s("guide",{attrs:{for:".unreviewed.item .ui.basic.button[data-v-828fa954]",onboarding:"nextUnreviewedFile",highlight:"bracket","hotkey-action":"nextUnreviewedFile(), prevUnreviewedFile()"}},[s("p",[e._v("\n Click to navigate to your "),s("em",[e._v("next file")]),e._v(".\n You can traverse backwards to previously visited files by using\n "),s("span",{staticClass:"cfp-hotkeys-key"},[e._v("⧠+ click")]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".unresolved.item[data-v-828fa954]",onboarding:"showedDiscussionMatrix",highlight:"bracket","hotkey-action":"visit('discussionMatrix')"}},[s("p",[e._v("\n If the counter is "),s("span",{staticClass:"ui red lowercase label"},[e._v("red")]),e._v(", it shows the number of\n "),s("em",[e._v("discussions that you need to respond to")]),e._v(", and clicking navigates between those\n discussions.\n ")]),e._v(" "),s("p",[e._v("\n If the counter is "),s("span",{staticClass:"ui lowercase label"},[e._v("gray")]),e._v(", then you don't have any more\n discussions to respond to, and it shows the number of "),s("em",[e._v("unresolved discussions")]),e._v(" instead\n (and navigates between those).\n ")]),e._v(" "),s("p",[e._v("\n A gray counter with a "),s("span",{staticClass:"ui deferred lowercase label"},[e._v("red stripe")]),e._v(" indicates\n that you've deferred responding to some discussions for now, but otherwise works just like a\n "),s("span",{staticClass:"ui red lowercase label"},[e._v("red")]),e._v(" one. You can also explicitly cancel your\n deferral from the participants panel if you'd like.\n ")]),e._v(" "),s("p",[e._v("\n You can traverse backwards to previously visited discussions by using\n "),s("span",{staticClass:"cfp-hotkeys-key"},[e._v("⧠+ click")]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".unresolved.item .ui.basic.button[data-v-828fa954]",onboarding:"nextUnrepliedDiscussion",highlight:"bracket","hotkey-action":"\n nextUnrepliedDiscussion(), prevUnrepliedDiscussion(),\n nextUnresolvedDiscussion(), prevUnresolvedDiscussion()\n "}},[s("p",[e._v("\n Click to navigate to your "),s("em",[e._v("next discussion")]),e._v(".\n You can traverse backwards to previously visited files by using\n "),s("span",{staticClass:"cfp-hotkeys-key"},[e._v("⧠+ click")]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".drafts.item[data-v-828fa954]",onboarding:"sawReviewSummary",highlight:"bracket","hotkey-action":"visit('publish')"}},[s("p",[e._v("\n The "),s("span",{staticClass:"ui red lowercase label"},[e._v("red")]),e._v(" counter indicates the "),s("em",[e._v("number of\n drafts")]),e._v(" you have in the review, and will also turn red if there are any "),s("em",[e._v("other buffered\n changes")]),e._v(" (review marks, dispositions, or acknowledgements).\n ")]),e._v(" "),s("p",[e._v("\n You can also click to open the conclusion panel, where you can see a\n "),s("em",[e._v("preview")]),e._v(" of your drafts, "),s("em",[e._v("control publishing options")]),e._v(" and\n "),s("span",{staticClass:"ui tiny green dummy button"},[s("i",{staticClass:"publish icon",staticStyle:{"margin-right":"0"},attrs:{alt:""}}),e._v(" "),s("span",{directives:[{name:"show",rawName:"v-show",value:!e.$store.services.ruler.narrow,expression:"!$store.services.ruler.narrow"}],staticClass:"ample only",staticStyle:{"margin-left":"0.6em"}},[e._v("Publish")])]),e._v("\n your review.\n ")])]),e._v(" "),s("guide",{attrs:{for:".drafts.item .ui.basic.button[data-v-828fa954]",onboarding:"nextDraft",highlight:"bracket","hotkey-action":"nextDraft(), prevDraft()"}},[s("p",[e._v("\n Click to navigate to your "),s("em",[e._v("next draft comment")]),e._v(". You can traverse backwards to\n previously visited drafts by using "),s("span",{staticClass:"cfp-hotkeys-key"},[e._v("⧠+ click")]),e._v(".\n ")])])],1)},[]),{Sidebar:Sidebar}},!0,!0,{filename:"src/view/reviews/sidebar.vue"}),_reviewable.define(["StatusesDonut"],["truss","AnimateBase"],function(e,t){"use strict";class StatusesDonut extends t{constructor(){super(),Vue.set(this,"COLORS",["#D95C
15C","#FFA22E","#B0B0B0","#5BBD72"]),Vue.set(this,"SIZE",20),Vue.set(this,"HALF_SIZE",this.SIZE/2),Vue.set(this,"RADIUS",this.HALF_SIZE-3),Vue.set(this,"ARC_FRAG",`A ${this.RADIUS},${this.RADIUS} 0 0,1 `),Vue.set(this,"spans",{gap:0,worse:0,bad:0,neutral:0,good:0}),Vue.set(this,"shapes",[])}mounted(){this.$observe(()=>this.counts,()=>this.performAnimation(),{deep:!0,precise:!0})}get counts(){return _.countBy(_get(this,"status"),e=>{switch(e.state){case"error":case"failure":return e.required?"worse":"bad";case"pending":case"inprogress":case"missing":return"neutral";case"success":return"good"}})}performAnimation(){if(!this.counts)return;const e=_(this.counts).values().sum(),t={worse:e?(this.counts.worse||0)/e:0,bad:e?(this.counts.bad||0)/e:0,neutral:e?(this.counts.neutral||0)/e:0,good:e?(this.counts.good||0)/e:0};Vue.set(t,"gap",!e||_.some(t,e=>1===e)?0:.1),this.anime(this.spans,null,_(this.spans).mapValues((e,s)=>[e,t[s]]).assign({update:this.paintDonut.bind(this)}).value())}paintDonut(){let e=-Math.PI/2;const t=this.spans.gap;_.forEach(["worse","bad","neutral","good"],(s,i)=>{let r=this.spans[s],n="";r&&(r=2*r*Math.PI,r>2*t&&(n=["M ",this.angleToCoords(e+t/2)," "],r>Math.PI&&n.push(this.ARC_FRAG,this.angleToCoords(e+t/2+r/2)," "),n.push(this.ARC_FRAG,this.angleToCoords(e+r-t/2)),n=_(n).flatten().join("")),e+=r),Vue.set(this.shapes,i,n)})}angleToCoords(e){return[this.HALF_SIZE+Math.cos(e)*this.RADIUS,",",this.HALF_SIZE+Math.sin(e)*this.RADIUS]}}StatusesDonut.$vueOptions={props:{status:[Object,Array]}};return _declareVue("StatusesDonut",StatusesDonut,"AnimateBase",{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("svg",{staticClass:"statuses donut",attrs:{width:e.SIZE,height:e.SIZE,viewBox:"0 0 "+e.SIZE+" "+e.SIZE}},e._l(e.shapes,function(t,i){return s("path",{key:i,attrs:{d:t,stroke:e.COLORS[i]}})}),0)},staticRenderFns:[],functional:!1},{scopeId:"data-v-302f6660"}),{StatusesDonut:StatusesDonut}},!0,!0,{filename:"src/view/reviews/statuses-donut.vue"}),_reviewable.define(["SettingsValueEncryption"],["truss","Guide","encryptSettingsFileValue","session"],function(e,t,s,i){"use strict";class SettingsValueEncryption{constructor(){Vue.set(this,"repositoryName",""),Vue.set(this,"plainText",""),Vue.set(this,"encryptedText",""),Vue.set(this,"error",null),Vue.set(this,"busy",!1)}async encrypt(){if(!this.busy){Vue.set(this,"error",null),Vue.set(this,"busy",!0);try{const e=await i.hubkit().request("/repos/:repositoryName",{repositoryName:this.repositoryName});Vue.set(this,"encryptedText",await s(this.plainText,e.id))}catch(e){Vue.set(this,"error",e.toString())}finally{Vue.set(this,"busy",!1)}}}}return _declareVue("SettingsValueEncryption",SettingsValueEncryption,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"encryption"},[e._m(0),e._m(1),s("div",{staticClass:"ui bottom attached form segment"},[s("div",{staticClass:"repository field"},[s("label",[e._v("Settings file repository")]),s("div",{staticClass:"ui input"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.repositoryName,expression:"repositoryName"}],attrs:{type:"text",placeholder:"organization/repository"},domProps:{value:e.repositoryName},on:{input:function(t){t.target.composing||(e.repositoryName=t.target.value)}}})])]),s("div",{staticClass:"input field"},[s("label",[e._v("Settings value")]),s("div",{staticClass:"ui input"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.plainText,expression:"plainText"}],attrs:{type:"text"},domProps:{value:e.plainText},on:{input:function(t){t.target.composing||(e.plainText=t.target.value)}}})])]),s("div",{staticClass:"action"},[s("ui-button",{staticClass:"dimmable encrypt icon",class:{dimmed:e.busy},on:{click:e.encrypt}},[s("i",{staticClass:"encrypt icon"}),e._v(" Encrypt\n "),s("div",{staticClass:"ui simple inverted dimmer"},[s("div",{staticClass:"ui loader"})])]),e.error?s("div",{staticClass:"ui error message"},[e._v(e._s(e.error))]):e._e()],1),s("div",{staticClass:"output field"},[s("label",[e._v("Encrypted value "),s("copy-button",{staticClass:"copy",attrs:{text:e.encryptedText}})],1),s("div",{staticClass:"ui disabled input"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.encryptedText,expression:"encryptedText"}],attrs:{type:"text",disabled:""},domProps:{value:e.encryptedText},on:{input:function(t){t.target.composing||(e.encryptedText=t.target.value)}}})])])])])},staticRenderFns:[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui top attached center aligned relative header"},[s("span",{staticClass:"text"},[e._v("Settings Value Encryptor")])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui attached segment"},[s("div",{staticClass:"ui info message"},[s("i",{staticClass:"tip icon"}),e._v(" Use this form to encrypt a value for\n "),s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/admincenter#file-based-settings"}},[s("code",[e._v("settings.yaml")])]),e._v("\n files. The value is encrypted for the repository the settings file is stored in. To\n provide a value to many repositories encrypt it to the\n "),s("a",{staticClass:"link",attrs:{href:"https://docs.reviewable.io/admincenter#applying-a-settings-yaml-file-to-multiple-repositories"}},[e._v("master repository")]),e._v("\n for the organisation.\n ")])])}],functional:!1},{scopeId:"data-v-755706fe"}),_declareGuides("SettingsValueEncryption","data-v-755706fe",function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"guides"},[s("guide",{attrs:{for:".repository.field[data-v-755706fe]",onboarding:"enteredEncryptionRepository",highlight:"bracket"}},[s("p",[e._v("\n The "),s("em",[e._v("full name")]),e._v(" of the "),s("em",[e._v("repository")]),e._v(" to which the encrypted value will be bound.\n ")]),e._v(" "),s("p",[e._v("\n The encrypted value will only be usable in settings files stored in the given repository.\n However, if it's the master then the settings can be applied to any repository in the\n organization as usual.\n ")])]),e._v(" "),s("guide",{attrs:{for:".input.field[data-v-755706fe]",onboarding:"enteredEncryptionPlainText",highlight:"bracket"}},[s("p",[e._v("\n The "),s("em",[e._v("settings value to encrypt")]),e._v(".\n ")])]),e._v(" "),s("guide",{attrs:{for:".encrypt.button[data-v-755706fe]",onboarding:"encryptedSetting"}},[s("p",[s("em",[e._v("Encrypt")]),e._v(" the given value, binding it to settings stored in the given repository.\n ")]),e._v(" "),s("p",[e._v("\n O
1nce encrypted, you won't be able to recover the original so keep a copy if you need it.\n ")])]),e._v(" "),s("guide",{attrs:{for:".output.field[data-v-755706fe]",onboarding:"sawEncryptedText",highlight:"bracket"}},[s("p",[e._v("\n The "),s("em",[e._v("encrypted value")]),e._v(" that you can paste into your settings file.\n ")])])],1)},[]),{SettingsValueEncryption:SettingsValueEncryption}},!0,!0,{filename:"src/view/settings-value-encryption.vue"}),_reviewable.define(["AvatarImage"],["truss"],function(e){"use strict";class AvatarImage{constructor(){Vue.set(this,"failed",!1)}get srcOrFallback(){if(Vue.set(this,"failed",this.failed||_get(this,"$el","fallbackActivated")||!1),this.failed){return l(o(this.fallback))}return this.src}}window.__setFallbackAvatar=function(e){if(!e.getAttribute("src"))return;const t=e.getAttribute("fallback");t&&(Vue.set(e,"fallbackActivated",!0),Vue.set(e,"src",function(e){return n[e]?n[e]:Vue.set(n,e,l(o(e)))}(t))),Vue.set(e,"onerror",null)};const t=60,s=6,i=(t-s)/2,r=(t-7*s)/2,n=_.create();function a(e){return e^=e<<13,e^=e>>>17,e^=e<<5}function o(e){let t=1;for(let s=0;s<e.length;s++)t=a(t)+e.charCodeAt(s);for(let e=0;e<32;e++){const e=.299*(t>>24&255)+.587*(t>>16&255)+.114*(t>>8&255);let s=0,i=t;for(let e=0;e<28;e++){i=a(i);const t=3&e;i>>>29>t*t/3+(e>>2)/2&&(s+=1)}if(e<200&&s>=8)break;t=a(t)}return t}function l(e){const n=document.createElement("canvas");Vue.set(n,"width",t),Vue.set(n,"height",t);const o=n.getContext("2d");Vue.set(o,"fillStyle","rgba(240, 240, 240, 0.9)"),o.fillRect(0,0,t,t),Vue.set(o,"fillStyle","#"+_.padStart((e>>8&16777215).toString(16),6,"0"));let l=e;for(let e=0;e<28;e++){l=a(l);const t=3&e,n=e>>2;l>>>29>t*t/3+n/2&&(o.fillRect(i+s*t,s*n+r,s,s),o.fillRect(i-s*t,s*n+r,s,s))}return n.toDataURL("png")}AvatarImage.$vueOptions={props:{src:{type:String},fallback:{type:String}}};return _declareVue("AvatarImage",AvatarImage,null,{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("img",{staticClass:"ui user avatar image",attrs:{src:e.srcOrFallback,fallback:e.fallback,onerror:"__setFallbackAvatar(this)"}})},staticRenderFns:[],functional:!1},{scopeId:"data-v-0222bbed"}),{AvatarImage:AvatarImage}},!0,!0,{filename:"src/view/widgets/avatar-image.vue"}),_reviewable.define(["Avatar"],["truss","config"],function(e,t){"use strict";class Avatar{constructor(){Vue.set(this,"shouldPatch",!1)}created(){this.$observe(()=>this.userKey,()=>{if(this.userKey){if(this.githubUser)throw new Error("'user-key' and 'github-user' are mutually exclusive.");this.$store.services.avatars.connectUser(this.userKey)}})}mounted(){if("agent"!==this.userKeyType||!this.displayFlags.picture)return;const e=this.$observe(()=>this.shouldPatch,t=>{t&&(e(),this.$waitForRefs(["avatarFrame","avatarImage"],([e,t])=>{requestAnimationFrame(()=>{const{width:s,height:i}=getComputedStyle(t),r=parseFloat(s),n=parseFloat(i),a=Math.max(r||0,n||0);a&&e.style.setProperty("--agent-tag-scale",a/26)})}))})}get offset(){return 1.5*this.$store.services.ruler.viewportHeight}get displayFlags(){const e={};return _.forEach(this.display.split(","),t=>{Vue.set(e,_.trim(t),!0)}),e}get userKeyType(){return _.startsWith(this.userKey,"github:")?"userid":_.startsWith(this.userKey,"ghagent:")?"agent":_.startsWith(this.userKey,"user:")?"username":_.startsWith(this.userKey,"githubteam:")?"teamid":_.startsWith(this.userKey,"team:")?"teamslug":_.startsWith(this.userKey,"email:")?"email":null}get team(){return"teamid"===this.userKeyType||"teamslug"===this.userKeyType}get user(){if(this.githubUser)return{username:this.githubUser.login,displayName:this.githubUser.name,avatarUrl:this.$store.services.avatars.scaleGitHubAvatarUrl(this.githubUser.avatar_url)};let e=null;switch(this.userKeyType){case"userid":case"agent":return this.$store.services.avatars.users[this.userKey];case"email":return{username:this.userKey.replace(/^email:/,"")};case"username":case"teamslug":e={username:this.userKey.replace(/^(team|user):/,"")};case"teamid":return this.$store.services.completions.people.getUserOrTeam(this.userKey)||e}return null}get tagColors(){const e="agent"===this.userKeyType&&_get(this,"user","tag","color");return this.$store.services.colors.computeAgentTagColors(e)}get detailsLink(){if("profile"!==this.linkTo||!this.user)return;if("userid"===this.userKeyType||"username"===this.userKeyType||this.githubUser)return`${t.gitHubUrl}/${this.user.username}`;const e="teamslug"===this.userKeyType||"teamid"===this.userKeyType?_get(this,"user","username"):void 0;return e?`${t.gitHubUrl}/orgs/${e.replace("/","/teams/")}`:null}get avatarUrl(){let e=_get(this,"user","scaledAvatarUrl")||_get(this,"user","avatarUrl");return e||"teamid"!==this.userKeyType?(e||(e="/images/3c2157dc.mystery.svg"),e):this.$store.services.avatars.inferGitHubAvatarUrl(this.userKey)}get tooltip(){if(!_get(this,"displayFlags","popup")||!this.user)return;let e=this.user.username;return this.popupPrefix&&(e=this.popupPrefix+" "+e),this.user.displayName&&(e+=` (${this.user.displayName})`),this.popupSuffix&&(e+=`${/^[,;:]/.test(this.popupSuffix)?"":" "}${this.popupSuffix}`),e}get secondaryName(){if(_get(this,"displayFlags","name")&&this.user)return this.displayFlags.username?this.user.displayName?` (${this.user.displayName})`:void 0:this.user.displayName||this.user.username}}Avatar.$vueOptions={props:{userKey:String,githubUser:Object,linkTo:String,display:{type:String,required:!0,validator:e=>/^((popup|picture|username|name|search)(\s*,\s*)?)+$/.test(e)},size:String,popupPrefix:String,popupSuffix:String,descriptionSuffix:String,fixed:Boolean}};return _declareVue("Avatar",Avatar,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.userKey||e.githubUser?s("span",{directives:[{name:"vue-element-spy",rawName:"v-vue-element-spy",value:{shouldSpy:e.displayFlags.picture&&!e.shouldPatch,callback:function(){return e.shouldPatch=!0},offset:e.offset,context:!1},expression:"{\n shouldSpy: displayFlags.picture && !shouldPatch,\n callback: () => shouldPatch = true,\n offset, context: false\n }"}],staticClass:"inline-block",attrs:{lang:""}},[s("a",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:e.tooltip,fixed:e.fixed},expression:"{text: tooltip, fixed}"}],staticClass:"avatar-link",class:{hidden:!(e.user||e.avatarUrl),nolink:!e.detailsLink},attrs:{href:e.detailsLink,target:"_blank"}},[e._t("before"),e.displayFlags.picture?s("span",{ref:"avatarFrame",staticClass:"relative inline-block"},[e.shouldPatch?s("avatar-image",{ref:"avatarImage",staticClass:"ui user avatar image",class:e.size,attrs:{src:e.avatarUrl,fallback:e.userKey}}):s("span",{staticClass:"ui user avatar image",class:e.size}),e.team?s("i",{staticClass:"team icon",attrs:{alt:"team"}}
1):e._e(),"agent"===e.userKeyType?s("span",{staticClass:"agent tag"},[s("span",{staticClass:"agent name",style:e.tagColors},[e._v(e._s(_get(e,"user","tag","name")))])]):e._e()],1):e._e(),s("span",{staticClass:"text",class:e.displayFlags.picture?"wide only":""},[e.displayFlags.username?s("span",{staticClass:"user username"},[e._v(e._s(_get(e,"user","username")))]):e._e(),e.secondaryName?s("span",{staticClass:"user name"},[e._v(e._s(e.secondaryName))]):e._e(),e.descriptionSuffix?s("span",[e._v(" "+e._s(e.descriptionSuffix))]):e._e()]),e._t("after")],2),e.displayFlags.search&&e.displayFlags.picture?s("span",[e.displayFlags.username?e._e():s("span",{staticClass:"searchable name"},[e._v(e._s(_get(e,"user","username")))]),e.displayFlags.name?e._e():s("span",{staticClass:"searchable name"},[e._v(e._s(_get(e,"user","displayName")))])]):e._e()]):e._e()},staticRenderFns:[],functional:!1},{scopeId:"data-v-59b04842"}),{Avatar:Avatar}},!0,!0,{filename:"src/view/widgets/avatar.vue"}),_reviewable.define(["BarChart"],["truss"],function(e){"use strict";class BarChart{constructor(){}get max(){return _(this.data).map("value").max()}onClick(e){e.disabled||this.$emit("select",e.key)}}BarChart.$vueOptions={props:{data:Array,selected:String},model:{prop:"selected",event:"select"}};return _declareVue("BarChart",BarChart,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"chart",style:{"--max":e.max,"--num":e.data.length},attrs:{"data-max":e.max}},e._l(e.data,function(t){return s("div",{key:t.key,staticClass:"value",style:{"--value":t.value}},[s("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:t.value},expression:"{text: item.value}"}],staticClass:"bar",class:{disabled:t.disabled,selected:e.selected===t.key},on:{click:function(s){return e.onClick(t)}}}),s("div",{staticClass:"label"},[e._v(e._s(t.label||t.key))])])}),0)},staticRenderFns:[],functional:!1},{scopeId:"data-v-7900a4d5"}),{BarChart:BarChart}},!0,!0,{filename:"src/view/widgets/bar-chart.vue"}),_reviewable.define(["CodeEditor"],["truss","corpsman"],function(e,t){"use strict";const s=_access(navigator,"","userAgent","","match","call",[/Firefox\/(\d+)\./],"",1),i=!(s&&_.parseInt(s)<89);class CodeEditor{constructor(){Vue.set(this,"hljsLoaded",!1),Vue.set(this,"indentRegex",void 0),Vue.set(this,"updateLock",!1),Vue.set(this,"numLines",void 0),Vue.set(this,"ruler",this.$store.services.ruler)}created(){Vue.set(this,"indentRegex",new RegExp(`(^|\n)(${this.indentString})+$`)),this.language&&new Promise((e,t)=>{if(window.hljs)return void e();let s=document.querySelector("script#hljs-script");function i(){s.removeEventListener("load",i),s.removeEventListener("error",r),window.hljs.registerLanguage("terraform",window.hljsDefineTerraform),window.hljs.registerLanguage("vba",window.hljsDefineVba),window.hljs.registerAliases("bazel",{languageName:"python"}),window.hljs.registerAliases("jsonc",{languageName:"json"}),e()}function r(){s.parentNode&&s.parentNode.removeChild(s),t(new Error("Failed to load highlight JS"))}s||(s=document.createElement("script"),Vue.set(s,"id","hljs-script"),Vue.set(s,"type","text/javascript"),document.head.appendChild(s)),s.addEventListener("load",i),s.addEventListener("error",r),Vue.set(s,"src","/js/highlight.min.js")}).then(()=>{Vue.set(this,"hljsLoaded",!0),this.styleCode()},e=>{t.capture(e,"load hljs")})}mounted(){const e=this.$el.value;Object.defineProperty(this.$el,"value",{get:()=>_get(this,"$refs","textarea","value"),set:e=>{_get(this,"$refs","textarea")&&(Vue.set(this.$refs.textarea,"value",e||""),this.computeNumLines(),this.styleCode())}}),Vue.set(this.$el,"value",e),this.computeNumLines()}styleCode(){const e=this.$refs.textarea;if(this.$destroyed||this.updateLock||!e)return;let s;if(this.$nextTick().then(()=>{this.handleScroll()}),this.hljsLoaded&&this.language)try{s=window.hljs.highlight(e.value||"",{language:this.language,ignoreIllegals:!0}).value}catch(e){t.capture(e,"code-editor hljs highlight")}s||(s=_.escape(e.value)),/\n(?:<\/span>)*$/.test(s)&&(s+="\n"),Vue.set(this.$refs.code,"innerHTML",s)}computeNumLines(){const e=_get(this,"$refs","textarea","value");let t=1;if(e)for(let s=0;s<e.length;s++)"\n"===e[s]&&t++;t!==this.numLines&&Vue.set(this,"numLines",t)}focus(){_get(this,"$refs","textarea")&&this.$refs.textarea.focus()}handleInput(){this.computeNumLines(),this.styleCode(),this.$emit("input")}handleFocus(){this.$emit("focus")}handleBlur(){this.$emit("blur")}handleScroll(){this.$destroyed||(Vue.set(this.$refs.codeContainer,"scrollTop",this.$refs.textarea.scrollTop),Vue.set(this.$refs.codeContainer,"scrollLeft",this.$refs.textarea.scrollLeft),this.$refs.lineNumbersContainer&&Vue.set(this.$refs.lineNumbersContainer,"scrollTop",this.$refs.textarea.scrollTop))}handleKeydown(e){if(!e.isComposing&&229!==e.keyCode&&i&&!(e.altKey||e.ctrlKey||e.metaKey))switch(e.key){case"Escape":this.$refs.textarea.blur(),this.$emit("escape");break;case"Tab":e.preventDefault(),e.shiftKey?this.outdent():this.indent();break;case"}":case"]":case")":e.preventDefault(),this.closeDelimiter(e.key);break;case"Home":e.preventDefault(),this.goToBeginningOfLine(e.shiftKey);break;case"Enter":e.preventDefault(),this.insertNewLine();break;case"Backspace":e.preventDefault(),this.backspace()}}handleCut(e){if(this.hasSelection())return;const{startIndex:t,endIndex:s,line:i}=this.findCurrentLine();e.clipboardData.setData("text/plain",i),e.preventDefault();const r=s-t!==i.length&&t>0?-1:0;this.select(t+r,s),this.delete()}handleCopy(e){if(this.hasSelection())return;const{line:t}=this.findCurrentLine();e.clipboardData.setData("text/plain",t),e.preventDefault()}goToBeginningOfLine(e){const{line:t,lineIndex:s,startIndex:i}=this.findCurrentLine(),r=this.findFirstNonBlankIndex(t),n=i+(s===r?0:r);e?this.select(this.getAnchorIndex(),n):this.select(n)}insertNewLine(){this.hasSelection()&&this.delete();const{line:e,lineIndex:t}=this.findCurrentLine();let s="\n"+e.match(/^[ \t]*/)[0].slice(0,t);const i=e[t-1];("{"===i||"["===i||"("===i||("python"===this.language||"bazel"===this.language)&&":"===i)&&(s+=this.indentStr
1ing),this.insertText(s)}backspace(){const e=this.$refs.textarea.value,t=this.getCaretIndex();this.delete(this.hasSelection()||!this.indentRegex.test(e.slice(0,t))?1:this.indentString.length)}indent(){const e=this.$refs.textarea,t=this.indentString.length;if(this.hasSelection()){const{startIndex:s,endIndex:i,lines:r}=this.findSelectedLines(),n=r.replace(/^[ \t]*/gm,e=>e+this.indentString.slice(e.length%t));let a=e.selectionStart,o=e.selectionEnd;const l=e.selectionDirection;a>s&&(a+=t),o+=n.length-r.length,this.select(s,i),this.insertText(n),this.select(a,o,l)}else{const{lineIndex:e}=this.findCurrentLine();this.insertText(this.indentString.slice(e%t))}}outdent(){const e=this.$refs.textarea,t=this.indentString.length;if(this.hasSelection()){const{startIndex:s,endIndex:i,lines:r}=this.findSelectedLines();let n;const a=r.replace(/^[ \t]*/gm,e=>{if(!e.length)return void 0===n&&(n=0),"";const s=e.length%t||t;return void 0===n&&(n=s),e.slice(0,e.length-s)});if(a.length===r.length)return;let o=e.selectionStart,l=e.selectionEnd;const c=e.selectionDirection;o-=n,l+=a.length-r.length,this.select(s,i),this.insertText(a),this.select(o,l,c)}else{const{line:e,startIndex:s,caretIndex:i}=this.findCurrentLine(),r=e.match(/^[ \t]+/);if(r){const e=r[0].length%t||t;this.select(s),this.forwardDelete(e);const n=Math.max(s,i-e);this.select(n)}}}closeDelimiter(e){if(!this.hasSelection()){const{line:e,lineIndex:t}=this.findCurrentLine();this.indentRegex.test(e.slice(0,t))&&this.delete(this.indentString.length,!0)}this.insertText(e)}findCurrentLine(){const e=this.$refs.textarea.value,t=this.getCaretIndex(),s=e.lastIndexOf("\n",t-1)+1,i=e.indexOf("\n",t)+1||e.length;let r=e.slice(s,i);return"\n"!==r.charAt(r.length-1)&&(r+="\n"),{startIndex:s,endIndex:i,caretIndex:t,line:r,lineIndex:t-s}}findSelectedLines(){const e=this.$refs.textarea,t=e.value,s=t.lastIndexOf("\n",e.selectionStart-1)+1;let i=t.indexOf("\n",e.selectionEnd);return-1===i&&(i=t.length),{startIndex:s,endIndex:i,lines:t.slice(s,i)}}findFirstNonBlankIndex(e){let t=0;for(;t<e.length;){const s=e.charAt(t);if(" "!==s&&"\t"!==s)break;t+=1}return t}hasSelection(){const e=this.$refs.textarea;return e&&e.selectionStart!==e.selectionEnd}getCaretIndex(){const e=this.$refs.textarea;return"forward"===e.selectionDirection?e.selectionEnd:e.selectionStart}getAnchorIndex(){const e=this.$refs.textarea;return"forward"===e.selectionDirection?e.selectionStart:e.selectionEnd}select(e,t,s){const i=this.$refs.textarea;void 0===t?i.setSelectionRange(e,e):void 0===s?e<t?i.setSelectionRange(e,t,"forward"):i.setSelectionRange(t,e,"backward"):i.setSelectionRange(e,t,s)}insertText(e){document.execCommand("insertText",!1,e)}delete(e=1,t=!1){e&&(Vue.set(this,"updateLock",!0),_.times(e,()=>{document.execCommand("delete")}),Vue.set(this,"updateLock",!1),t||this.styleCode())}forwardDelete(e=1,t=!1){e&&(Vue.set(this,"updateLock",!0),_.times(e,()=>{document.execCommand("forwardDelete")}),Vue.set(this,"updateLock",!1),t||this.styleCode())}}CodeEditor.$vueOptions={props:{indentString:{type:String,default:" "},language:{type:String},lineNumbers:{type:Boolean},minHeight:{type:Number},maxHeight:{type:Number},disabled:{type:Boolean,default:!1}}};return _declareVue("CodeEditor",CodeEditor,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"wrapper",class:{"has-line-numbers":e.lineNumbers}},[e.lineNumbers?s("div",{ref:"lineNumbersContainer",staticClass:"line-numbers-container"},[s("div",{staticClass:"line-numbers"},e._l(e.numLines,function(t){return s("div",{key:"line-"+t},[e._v(e._s(t))])}),0)]):e._e(),s("div",{staticClass:"code-wrapper"},[s("div",{ref:"codeContainer",staticClass:"code-container"},[s("code",{ref:"code",staticClass:"hljs monospace code area",class:e.language})]),s("textarea",{ref:"textarea",staticClass:"monospace code area mp-sensitive",class:{invisible:e.hljsLoaded||!e.language},attrs:{disabled:e.disabled,spellcheck:"false"},on:{input:e.handleInput,focus:e.handleFocus,blur:e.handleBlur,"&scroll":function(t){return e.handleScroll.apply(null,arguments)},keydown:e.handleKeydown,cut:e.handleCut,copy:e.handleCopy}})])])},staticRenderFns:[],functional:!1},{cssVarsGetter:function(e){return[[!0,{"6691b211be88db78":e.ruler.lineHeight+"px","6691b211eb4db9c0":e.minHeight?e.minHeight+"px":"100%","6691b2111a8b3978":e.maxHeight?e.maxHeight+"px":"100%"}]]},scopeId:"data-v-6691b211"}),{CodeEditor:CodeEditor}},!0,!0,{filename:"src/view/widgets/code-editor.vue"}),_reviewable.define(["CopyButton"],["truss","corpsman"],function(e,t){"use strict";class CopyButton{constructor(){Vue.set(this,"clicked",!1),Vue.set(this,"timeoutHandle",void 0)}click(e){this.clicked&&clearTimeout(this.timeoutHandle),Vue.set(this,"clicked",!1),this.text&&navigator.clipboard.writeText(this.text).then(()=>{Vue.set(this,"clicked",!0),Vue.set(this,"timeoutHandle",setTimeout(()=>{Vue.set(this,"clicked",!1)},1e3))}).catch(e=>{console.log("Unable to copy to clipboard:",e),t.markHandled(e)})}}CopyButton.$vueOptions={props:{text:String,alt:String,icon:String}};return _declareVue("CopyButton",CopyButton,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("a",{staticClass:"copy button",on:{click:e.click}},[s("i",{staticClass:"icon",class:e.clicked?"clone successful":this.icon||"clone",attrs:{alt:e.alt}}),e._t("default")],2)},staticRenderFns:[],functional:!1},{scopeId:"data-v-da296162"}),{CopyButton:CopyButton}},!0,!0,{filename:"src/view/widgets/copy-button.vue"}),_reviewable.define(["InlineIconCheckbox"],["truss"],function(e){"use strict";class InlineIconCheckbox{constructor(){Vue.set(this,"checkedState",this.checked)}handleClick(){this.disabled||(Vue.set(this,"checkedState",!this.checkedState),this.$emit("change",this.checkedState))}}InlineIconCheckbox.$vueOptions={props:{iconClass:{type:String,required:!0},checked:{required:!0},disabled:Boolean},model:{prop:"checked",event:"change"}};return _declareVue("InlineIconCheckbox",InlineIconCheckbox,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("a",{staticClass:"relative link",class:{disabled:e.disabled},on:{click:e.handleClick}},[s("span",{staticClass:"relative"},[s("i",{staticClass:"off icon",class:[e.iconClass]}
1),s("animate-fade-in-out",{attrs:{duration:"*=0.66"}},[s("i",{directives:[{name:"show",rawName:"v-show",value:e.checkedState,expression:"checkedState"}],staticClass:"on icon",class:[e.iconClass]})])],1),s("span",{class:{checked:e.checkedState}},[e._t("default")],2)])},staticRenderFns:[],functional:!1},{scopeId:"data-v-57e3df4a"}),{InlineIconCheckbox:InlineIconCheckbox}},!0,!0,{filename:"src/view/widgets/inline-icon-checkbox.vue"}),_reviewable.define(["InvertedLayers"],["truss"],function(e){"use strict";class InvertedLayers{constructor(){}render(e,t){return e("div",_.map(t.children,(e,s)=>{const i={zIndex:t.children.length-s,position:"relative"};return _get(e,"data","style")?_.assign(e.data.style,i):(Vue.set(e,"data",e.data||{}),Vue.set(e.data,"style",i)),e}))}}return InvertedLayers.$vueOptions={functional:!0},_declareVue("InvertedLayers",InvertedLayers,null,null,{}),{InvertedLayers:InvertedLayers}},!0,!0,{filename:"src/view/widgets/inverted-layers.vue"}),_reviewable.define(["ModalOverlay"],["truss","animator","pageControl"],function(e,t,s){"use strict";class ModalOverlay{constructor(){Vue.set(this,"backdropShowing",!1),Vue.set(this,"contentShowing",!1),Vue.set(this,"visible",!1),Vue.set(this,"resizeObserver",void 0),Vue.set(this,"scrollbarPresent",void 0),Vue.set(this,"clickCaptured",!1)}mounted(){this.$observe(()=>this.open,e=>{e?this.transitionToOpen():this.transitionToClosed()}),Vue.set(this,"resizeObserver",new ResizeObserver(()=>{Vue.set(this,"scrollbarPresent",this.$refs.contents.scrollHeight!==this.$refs.contents.offsetHeight)})),this.resizeObserver.observe(this.$refs.contents)}beforeDestroy(){this.resizeObserver&&this.resizeObserver.disconnect(),document.removeEventListener("mouseup",this.releaseClick),document.removeEventListener("click",this.handleClick),document.removeEventListener("keydown",this.handleKeyDown),s.closeDialog(this.$el)}close(){this.$emit("close",!1)}transitionToOpen(){s.openDialog(this.$el),document.addEventListener("mouseup",this.releaseClick),document.addEventListener("click",this.handleClick),document.addEventListener("keydown",this.handleKeyDown);const e=this.backdropShowing?0:t.defaultOptions.duration/2;Vue.set(this,"backdropShowing",!0),this.$emit("overlay-visible",!0),_.delay(()=>{this.open&&(Vue.set(this,"contentShowing",!0),Vue.set(this,"visible",!0),this.$emit("content-visible",!0))},e)}transitionToClosed(){document.removeEventListener("mouseup",this.releaseClick),document.removeEventListener("click",this.handleClick),document.removeEventListener("keydown",this.handleKeyDown);const e=this.contentShowing?t.defaultOptions.duration/2:0,i=this.$el;Vue.set(this,"contentShowing",!1),_.delay(()=>{this.open||(Vue.set(this,"visible",!1),this.$emit("content-visible",!1),Vue.set(this,"backdropShowing",!1),this.$emit("overlay-visible",!1),_.delay(()=>{this.open||(s.closeDialog(i),this.$emit("closed"))},t.defaultOptions.duration/2))},e)}captureClick(){Vue.set(this,"clickCaptured",!0)}releaseClick(){requestAnimationFrame(()=>{Vue.set(this,"clickCaptured",!1)})}handleClick(e){!this.clickCaptured&&this.open&&this.closable&&e.target===this.$el&&this.close()}handleKeyDown(e){27!==e.keyCode||_.includes(["INPUT","SELECT","TEXTAREA"],document.activeElement.tagName)||(e.preventDefault(),this.open&&this.closable&&s.topDialog===this.$el&&this.close())}}ModalOverlay.$vueOptions={props:{open:Boolean,closable:Boolean},model:{prop:"open",event:"close"}};return _declareVue("ModalOverlay",ModalOverlay,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("dialog",{class:{"backdrop-showing":e.backdropShowing,"content-showing":e.contentShowing}},[e._t("decor"),s("div",{ref:"contents",staticClass:"ui segment contents",on:{mousedown:e.captureClick}},[e.visible?e._t("default",null,{close:e.close}):e._e()],2),e.closable?s("i",{staticClass:"close icon",on:{click:e.close}}):e._e()],2)},staticRenderFns:[],functional:!1},{cssVarsGetter:function(e){return[[!0,{c43ac4baa6bcb660:e.scrollbarPresent?"var(--scrollbar-size)":"0"}]]},scopeId:"data-v-c43ac4ba"}),{ModalOverlay:ModalOverlay}},!0,!0,{filename:"src/view/widgets/modal-overlay.vue"}),_reviewable.define(["Multiselect"],["truss","bus"],function(e,t){"use strict";t.showGuideMap.react(()=>{_get(e,"store","services","guideDirectory","overlayActive")||(_.forEach(document.querySelectorAll(".multiselect--frozen"),e=>e.classList.remove("multiselect--frozen")),_.forEach(document.querySelectorAll(".multiselect--active .multiselect__select"),e=>e.classList.add("multiselect--frozen")))},{scope:null});let s=0;class Multiselect{constructor(){Vue.set(this,"listeners",void 0),Vue.set(this,"dropdownClosedWhenGuideOpened",!1),Vue.set(this,"customDataVAttributes",void 0),Vue.set(this,"rootClassList",void 0),Vue.set(this,"styleSheet",new CSSStyleSheet),Vue.set(this,"uid","uid-"+ ++s),Vue.set(this,"resizeObserver",void 0)}updateStyles(){if(!this.customDataVAttributes||!this.applyDeepStyles)return;const e=getComputedStyle(this.$el),t=this.replicateRootClass?_(this.$vnode.data.staticClass).split(" ").map(e=>`.${e}`).join(""):"",s=_(this.customDataVAttributes).keys().reject(e=>"class"===e).value(),i=`\n ${t}${s.length?`[${_.join(s,"][")}]`:""}[${this.uid}].multiselect__content-wrapper {\n width: calc(${e.width} - 2px);\n font-size: ${e.fontSize};\n }`;this.styleSheet.replaceSync(i)}updated(){this.updateStyles()}beforeDestroy(){Vue.set(document,"adoptedStyleSheets",_.without(document.adoptedStyleSheets,this.styleSheet)),this.resizeObserver&&this.resizeObserver.disconnect()}onClose(e,t,s){s||!this.$store.services.guideDirectory.overlayActive?_.delay(()=>this.$emit("close",e,t),100):Vue.set(this,"dropdownClosedWhenGuideOpened",!0)}created(){Vue.set(this,"listeners",_.assign(this.$listeners,{close:this.onClose})),t.guideMapHidden.react(()=>{this.dropdownClosedWhenGuideOpened&&(Vue.set(this,"dropdownClosedWhenGuideOpened",!1),this.onClose(this.value,this.$attrs.id,!0))},{scope:this})}_getCustomDataVAttributes(e){return _.transform(e.attributes,(e,t)=>{_.startsWith(t.name,"data-v-")&&Vue.set(e,t.name,"")},{})}mounted(){t.closeMultiselects.react(()=>{_get(this,"$refs","multiselect")&&this.$refs.multiselect.deactivate()},{scope:this}),Vue.set(this,"customDataVAttributes",this._getCustomDataVAttributes(this.$el)),Vue.set(this,"rootClassList",this.applyDeepStyles&&this.replicateRootClass&&{class:this.$vnode.data.staticClass}),Vue.set(document,"adoptedStyleSheets",[...document.adoptedStyleSheets,this.styleSheet]),this.updateStyles(),Vue.set(this,"resizeObserver",new ResizeObserver(()=>this.updateStyles())),this.resizeObserver.observe(this.$el)}}Multiselect.$vueOptions={props:{value:null,deselectLabel:{type:String,default:"remove"},selectLabel:{type:String,default:""},applyDeepStyles:{type:Boolean,default:!0},replicateRootClass:{type:Boolean,default:!1}}};return _declareVue("Multiselect",Multiselect,null,{render:function(){var e,t=this,s=t.$createElement;return(t._self._c||s)("vue-multiselect-port",t._g(t._b({ref:"multiselect",attrs:{value:t.value,deselectLabel:t.deselectLabel,selectLabel:t.selectLabel,customDataVAttributes:t.customDataVAttributes,rootClassList:t.rootClassList,"instance-id":(e={},e[t.uid]="",e),id:t.uid},scopedSlots:t._u([t._l(t.$scopedSlots,function(e,s){return{key:s,fn:function(e){return[t._t(s,null,
1null,e)]}}})],null,!0)},"vue-multiselect-port",t.$attrs,!1),t.listeners))},staticRenderFns:[],functional:!1},{}),{Multiselect:Multiselect}},!0,!0,{filename:"src/view/widgets/multiselect.vue"}),_reviewable.define(["OrganizationSelector"],["truss"],function(e){"use strict";class OrganizationSelector{constructor(){}created(){this.$connect(()=>_ref(this.$store,"child","users",this.$info.userid,"dashboardCache","organizations"))}get organizations(){const e=[],t={};this.allOption&&(e.push("all"),Vue.set(t,"all",{name:this.allOption}));const s=this.$store.services.avatars,i=s.users[this.$info.userid];if(i){const r=_.toLower(i.username);e.push(r),Vue.set(t,r,{avatarUrl:s.scaleGitHubAvatarUrl(i.avatarUrl),name:i.username,userKey:this.$info.userid})}const r=_.mapKeys(_get(this,"$store","users",this.$info.userid,"dashboardCache","organizations"),(e,t)=>t.replace(/\s/g,""));return!this.value||r[this.value]||t[this.value]||Vue.set(r,this.value,{name:this.value}),_.assign(t,r),e.push(..._(r).keys().map(_.toLower).sort().value()),{list:e,map:t}}}OrganizationSelector.$vueOptions={props:{value:{type:String},allOption:{type:String}}};return _declareVue("OrganizationSelector",OrganizationSelector,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("multiselect",{staticClass:"ui organizations dropdown",attrs:{value:e.value,placeholder:"Select an organization","allow-empty":!1,options:e.organizations.list,"show-labels":!1},on:{input:function(t){return e.$emit("input",t)}},scopedSlots:e._u([{key:"option",fn:function(t){var i=t.option;return[s("span",["all"===i?s("i",{staticClass:"all repositories icon"}):s("avatar-image",{staticClass:"organization image",attrs:{src:_get(e,"organizations","map",i,"avatarUrl"),fallback:_get(e,"organizations","map",i,"userKey")||i}}),e._v("\n "+e._s(_get(e,"organizations","map",i,"name"))+"\n ")],1)]}},{key:"singleLabel",fn:function(t){var i=t.option;return[s("span",["all"===i?s("i",{staticClass:"all repositories icon"}):s("avatar-image",{staticClass:"organization image",attrs:{src:_get(e,"organizations","map",i,"avatarUrl"),fallback:_get(e,"organizations","map",i,"userKey")||i}}),e._v("\n "+e._s(_get(e,"organizations","map",i,"name"))+"\n ")],1)]}},{key:"afterList",fn:function(){return[e.$session.hasScope("read:org")?e._e():s("ui-button",{staticClass:"green labeled icon show organizations",attrs:{disabled:e.$session.auth.disabled},on:{click:function(t){return e.$session.auth.login(["read:org"],"optional")}}},[s("i",{staticClass:"all organizations icon",attrs:{alt:"World icon"}}),e._v("\n List Organizations\n ")]),s("div",{staticClass:"footer"},[e._v("\n Organization missing? You may need to\n "),s("a",{staticClass:"link",attrs:{href:"https://help.github.com/articles/requesting-organization-approval-for-oauth-apps/"}},[e._v("\n request approval\n ")]),e._v("\n for Reviewable.\n ")])]},proxy:!0},{key:"noResult",fn:function(){return[s("em",[e._v("No matching organizations.")])]},proxy:!0}])})},staticRenderFns:[],functional:!1},{scopeId:"data-v-6792a300"}),{OrganizationSelector:OrganizationSelector}},!0,!0,{filename:"src/view/widgets/organization-selector.vue"}),_reviewable.define(["ProgressiveRenderList"],["truss"],function(e){"use strict";const t=new class ProgressiveRenderCoordinator{constructor(){Vue.set(this,"renderQueue",[]),Vue.set(this,"isScheduling",!1),Vue.set(this,"roundRobinIndex",0)}schedulePrerender(){this.isScheduling||this.runPrerenderCycle()}runPrerenderCycle(){Vue.set(this,"isScheduling",!0),scheduler.postTask(async()=>{let e=!1;if(0!==this.renderQueue.length){for(let t=0;t<this.renderQueue.length;t++){const s=(this.roundRobinIndex+t)%this.renderQueue.length,i=this.renderQueue[s];if(_access(i,"","condition","call",[])){i.step(),e=!0,Vue.set(this,"roundRobinIndex",(s+1)%this.renderQueue.length);break}}e?(await scheduler.yield(),this.runPrerenderCycle()):Vue.set(this,"isScheduling",!1)}else Vue.set(this,"isScheduling",!1)},{priority:"background"}).catch(e=>{Vue.set(this,"isScheduling",!1)})}};function s(e){return e?{...e,data:{...e.data||{},style:{..._get(e,"data","style")||{}}}}:null}function i(e,t){if(!e)return[];const i=_.isArray(e)?e:[e],r=[];for(const e of i){if(!e||!e.tag){t&&r.push(e);continue}const i=s(e);t||Vue.set(i.data.style,"display","none"),r.push(i)}return r}
1class ProgressiveRenderList{constructor(){Vue.set(this,"count",0)}created(){Object.defineProperty(this,"vnodeCache",{value:new WeakMap,writable:!0}),t.renderQueue.push(this);const e=()=>{this.visible?Vue.set(this,"count",(this.items||[]).length):t.schedulePrerender()};this.$observe(()=>this.items,()=>{this.resetCache(),e()},{precise:!0}),this.$observe(()=>this.visible,()=>{e()},{precise:!0})}resetCache(){Vue.set(this,"count",0),Vue.set(this,"vnodeCache",new WeakMap)}condition(){return!this.visible&&this.count<(this.items||[]).length}step(){Vue.set(this,"count",Math.min(this.count+this.batch,(this.items||[]).length))}beforeDestroy(){_.pull(t.renderQueue,this)}render(e){const t=this.$scopedSlots.default;if(!t)return null;const s=this.items||[],r=Math.min(this.count,s.length),n=[];for(let e=0;e<r;e++){const r=s[e],a=this.isRowVisible(r);let o=this.vnodeCache.get(r);if(!o){if(!a)continue;o={original:t({row:r})||null,output:[],lastVisibility:void 0},this.vnodeCache.set(r,o)}o.original&&(o.lastVisibility!==a&&(Vue.set(o,"output",i(o.original,a)),Vue.set(o,"lastVisibility",a)),n.push(...o.output))}return e(this.$vnode.data.tag||"ul",n)}}return ProgressiveRenderList.$vueOptions={props:{items:{default:()=>[],type:Array},visible:{type:Boolean},batch:{type:Number,default:5},isRowVisible:{type:Function,default:e=>!e.hidden}}},_declareVue("ProgressiveRenderList",ProgressiveRenderList,null,null,{}),{ProgressiveRenderList:ProgressiveRenderList}},!0,!0,{filename:"src/view/widgets/progressive-render-list.vue"}),_reviewable.define(["TippyDropdown"],["truss","animator","config","session","pageControl","bus","dom"],function(e,t,s,i,r,n,a){"use strict";const o={bottom:["top"],"bottom-start":["bottom-end","bottom","top-start"],"bottom-end":["bottom-start","bottom","top-end"],top:["bottom"],"top-start":["top-end","top","bottom-start"],"top-end":["top-start","top","bottom-end"]},l=["bypassCloseOnClick","parentTippy","lockHeight"],c=new WeakMap,u=new MutationObserver(e=>{for(const t of e){const e=t.target;if(c.has(e))for(const t of c.get(e))e.classList.contains(t)||e.classList.add(t)}});class TippyDropdown{constructor(){Vue.set(this,"tippy",void 0),Vue.set(this,"open",!1),Vue.set(this,"closing",!1),Vue.set(this,"mountedTarget",void 0),Vue.set(this,"destroying",!1),Vue.set(this,"closeTimer",void 0),Vue.set(this,"locked",!1),Vue.set(this,"placementOverride",void 0),Vue.set(this,"animateOpen",!0),Vue.set(this,"placement",void 0)}mounted(){Vue.set(this,"mountedTarget",this.target||this.$el.parentNode),Vue.set(this,"tippy",tippy(this.mountedTarget,this._mergeOptions())),this._toggleMountedTargetClass("dropdown-target",!0),u.observe(this.mountedTarget,{attributes:!0,attributeFilter:["class"]}),this.$observe(()=>this.options,()=>{if(this.tippy){this.tippy.setProps(this._mergeOptions());const e=_.includes(_get(this,"options","trigger"),"mouseenter")&&!_.includes(_get(this,"options","trigger"),"click");this._toggleMountedTargetClass("hoverable",e)}},{deep:!0}),this.$observe(()=>this.fixed,()=>{if(this.tippy){const e=_get(this,"tippy","props","popperOptions")||{};Vue.set(e,"strategy",this.fixed?"fixed":"absolute"),this.tippy.setProps({popperOptions:e})}}),n.forceTippyUpdate.react(({expectAnimation:e,duration:s}={})=>{_get(this,"tippy","popperInstance")&&(e?_.delay(()=>{_get(this,"tippy","popperInstance")&&this.tippy.popperInstance.update()},(s||t.defaultOptions.duration)+50):this.tippy.popperInstance.update())},{scope:this})}updated(){_.defer(()=>{_get(this,"tippy","popperInstance")&&this.tippy.popperInstance.update()})}beforeDestroy(){Vue.set(this,"destroying",!0),this.tippy&&(this.tippy.hide(),this.tippy.destroy(),Vue.set(this,"tippy",void 0)),this._toggleMountedTargetClass("dropdown-target",!1),this._toggleMountedTargetClass("hoverable",!1),c.delete(this.mountedTarget)}toggle(e){(_.isNil(e)?!this.open:!!e)&&this.tippy?(this._cancelDelayedClose(),this._handleTrigger(),this.tippy.show()):this.close()}close({delay:e,unlessCursorInside:t}={}){this._cancelDelayedClose(),e?Vue.set(this,"closeTimer",_.delay(()=>{this._cancelDelayedClose(),t&&_access(this,"","$refs","","inner","","matches","call",[":hover"])||this.close()},e)):this.tippy&&!this.tippy.state.isDestroyed&&this.tippy.hide()}_cancelDelayedClose(){this.closeTimer&&(clearTimeout(this.closeTimer),Vue.set(this,"closeTimer",void 0))}_handleTrigger(){this.closing&&this.tippy.popperInstance&&this._enter(this.tippy.popperInstance.state.placement),Vue.set(this,"open",!0),_get(this,"options","parentTippy")&&Vue.set(this.options.parentTippy,"locked",!0),this.$emit("opened")}_handleClick({target:e}={}){const t=_get(this,"options","bypassCloseOnClick");if(t){if(_.isBoolean(t))return;const i=_.castArray(t);for(let t of i){if(_.isString(t)&&(t=this.$refs.inner.querySelector(t)),!s.prod&&!_.isElement(t)&&!_.isNil(t))throw new Error(`Bad option passed for bypassCloseOnClick: ${t}.Valid values are selectors or elements.`);if(_access(t,"","contains","call",[e]))return}}if(a.findClosestElement(e,".ui.simple.dropdown.item"))return;this.$refs.inner.querySelector(":scope > .ui.menu, :scope > .multiselect__content-wrapper")&&this.close({delay:100})}_mergeOptions(){const e=()=>this.$store.services.guideDirectory.overlayActive,t=_.defaults({content:this.$refs.wrapper,maxWidth:"none",onTrigger:()=>{this._handleTrigger()},onShow:t=>{Vue.set(this,"placementOverride",void 0),Vue.set(this,"animateOpen",!(i.hidingTooltips||e())),this._toggleMountedTargetClass("dropdown-open",!0),t.setProps({appendTo:r.topDialog||document.body}),t.popper.firstElementChild.classList.add("hideall")},onHide:t=>{if(!this.destroying){if(this.locked)return!1;if(i.hidingTooltips||e()){const e=t.popper.firstElementChild;if(_.some(this.$store.services.guideDirectory.guides,t=>_.some(t.potentialTargets,s=>e.contains(s)||t.groupSelectorSource&&this.mountedTarget.contains(s))))return!1;i.hidingTooltips&&i.dropdownsHiding.push(this)}return!this.open||(this._toggleMountedTargetClass("dropdown-open",!1),i.hidingTooltips||e())?void 0:(Vue.set(this,"placementOverride",t.popperInstance.state.placement),this._exit(t.popperInstance.state.placement),!1)}},onHidden:()=>{Vue.set(this,"open",!1),this.$emit("closed")},onMount:e=>{e.popperInstance&&(this.animateOpen&&this._enter(e.popperInstance.state.placement),e.popper.firstElementChild.classList.remove("hideall"))}},_.omit(this.options,l),{animation:!1,arrow:!1,interactive:!0,offset:[0,0],placement:"bottom-start",theme:"dropdown",trigger:"click",zIndex:999998}),s=o[t.placement];return s&&(t.popperOptions||Vue.set(t,"popperOptions",{}),t.popperOptions.modifiers||Vue.set(t.popperOptions,"modifiers",[]),_(t.popperOptions.modifiers).pullAllBy(e=>"flip"===e.name).push({name:"flip",options:{fallbackPlacements:s}},{name:"preventOverflow",options:{boundary:document.documentElement}},{name:"placement",enabled:!0,phase:"main",fn:({state:e})=>{this.mountedTarget.setAttribute("placement",e.placement)}}
1).value()),this.placementOverride&&Vue.set(t,"placement",this.placementOverride),t}_enter(e){Vue.set(this,"closing",!1),Vue.set(this,"placement",e);const t=this.$refs.wrapper,s=this.$refs.inner;anime.remove(t),anime.remove(s);const i=t.style.height?t.offsetHeight:0;Vue.set(t.style,"height",""),Vue.set(s,"position","relative");const r=t.clientHeight,n=document.createElement("div");_get(this,"tippy","popper")&&(this.tippy.popper.appendChild(n),Vue.set(n.style,"height",`${r}px`),Vue.set(this.tippy.popper.style,"alignItems",_.startsWith(e,"bottom")?"":"flex-end")),Vue.set(t.style,"overflow","hidden"),Vue.set(s,"position","");const a=this._computeDuration();if(anime({targets:t,duration:a,easing:"easeInOutSine",height:[i,r],complete:()=>{n.remove(),_get(this,"tippy","popper")&&Vue.set(this.tippy.popper.style,"alignItems",""),Vue.set(t.style,"height",""),Vue.set(t.style,"overflow",""),_get(this,"options","lockHeight")&&Vue.set(s.style,"minHeight",`${r}px`),this.$emit("complete")}}),_.startsWith(e,"bottom")){const e=s.style.transform.match(/translateY\([^0]+px\)/);anime({targets:s,duration:a,easing:"easeInOutSine",translateY:e?0:[-r,0]})}else Vue.set(s.style,"transform","translateY(0)")}_exit(e){Vue.set(this,"closing",!0);const t=this.$refs.wrapper,s=this.$refs.inner;anime.remove(t),anime.remove(s);const i=t.clientHeight;Vue.set(t.style,"overflow","hidden"),_get(this,"tippy","popper")&&Vue.set(this.tippy.popper.style,"alignItems",_.startsWith(e,"bottom")?"":"flex-end");const r=this._computeDuration();anime({targets:t,duration:r,easing:"easeInOutSine",height:[i,0],complete:()=>{Vue.set(t.style,"height",""),Vue.set(t.style,"overflow",""),_get(this,"tippy","popper")&&Vue.set(this.tippy.popper.style,"alignItems",""),Vue.set(this,"open",!1),Vue.set(this,"closing",!1),Vue.set(this,"placement",void 0),_get(this,"options","parentTippy")&&Vue.set(this.options.parentTippy,"locked",!1),Vue.set(s.style,"minHeight",""),this._toggleMountedTargetClass("dropdown-open",!1),this.tippy&&this.tippy.hide(),this.$emit("complete")}}),_.startsWith(e,"bottom")?anime({targets:s,duration:r,easing:"easeInOutSine",translateY:-i,complete:()=>Vue.set(s.style,"transform","translateY(0)")}):Vue.set(s.style,"transform","translateY(0)")}_computeDuration(){if(!t.defaultOptions.duration)return 0;if(this.options&&"duration"in this.options)return this.options.duration;const e=t.defaultOptions.duration;return _.clamp(e*this.$refs.wrapper.offsetHeight/200,e/2,1.5*e)}_toggleMountedTargetClass(e,t){c.has(this.mountedTarget)||c.set(this.mountedTarget,[]);const s=c.get(this.mountedTarget);_.includes(s,e)!==!!t&&(t?(s.push(e),this.mountedTarget.classList.add(e)):(_.pull(s,e),this.mountedTarget.classList.remove(e)))}}TippyDropdown.$vueOptions={props:{fixed:Boolean,options:Object,target:Object}};return _declareVue("TippyDropdown",TippyDropdown,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("div",{ref:"wrapper",staticClass:"tippy-wrapper"},[s("div",{ref:"inner",staticClass:"dropdown-inner",on:{click:e._handleClick}},[e.open?e._t("default",null,{close:e.close}):e._e()],2)])])},staticRenderFns:[],functional:!1},{}),{TippyDropdown:TippyDropdown}},!0,!0,{filename:"src/view/widgets/tippy-dropdown.vue"}),_reviewable.define(["TwinklingStars"],["truss"],function(e){"use strict";class TwinklingStars{constructor(){Vue.set(this,"skyRect",void 0),Vue.set(this,"stars",[])}mounted(){const e=this.$refs.sky.getBoundingClientRect(),t=e.width*e.height/(200/this.density);for(let s=0;s<t;s++)this.stars.push({index:s,style:{left:_.random(0,e.width,!0)+"px",top:_.random(0,e.height,!0)+"px","--star-size":_.random(this.starSizeRange[0],this.starSizeRange[1],!0)+"px","--twinkle-duration":_.random(1,3)+"s","--twinkle-delay":_.random(0,3)+"s"}})}}TwinklingStars.$vueOptions={props:{density:{type:Number,default:1},starSizeRange:{type:Array,default:()=>[1.5,3]}}};return _declareVue("TwinklingStars",TwinklingStars,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{ref:"sky",staticClass:"sky"},e._l(e.stars,function(e){return s("div",{key:e.index,staticClass:"star",style:e.style})}),0)},staticRenderFns:[],functional:!1},{scopeId:"data-v-a35f779a"}),{TwinklingStars:TwinklingStars}},!0,!0,{filename:"src/view/widgets/twinkling-stars.vue"}),_reviewable.define(["UiButton"],["truss"],function(e){"use strict";class UiButton{constructor(){}}UiButton.$vueOptions={props:{disabled:Boolean}};return _declareVue("UiButton",UiButton,null,{render:function(e,t){var s;return(0,t._c)("span",t._g(t._b({class:["ui","button",t.data.class,t.data.staticClass,{disabled:t.props.disabled}],style:[t.data.style,t.data.staticStyle]},"span",((s={})[""+t.parent.$options._scopeId]="",s),!1),t.listeners),[t._t("default")],2)},staticRenderFns:[],functional:!0},{}),{UiButton:UiButton}},!0,!0,{filename:"src/view/widgets/ui-button.vue"}),_reviewable.define(["UiCheckboxInput"],["truss"],function(e){"use strict";let t=0;class UiCheckboxInput{constructor(){Vue.set(this,"id","ui-checkbox-"+ ++t)}}UiCheckboxInput.$vueOptions={props:{checked:{required:!0},disabled:Boolean},model:{prop:"checked",event:"change"}};return _declareVue("UiCheckboxInput",UiCheckboxInput,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("span",{staticClass:"ui checkbox"},[s("input",{attrs:{type:"checkbox",id:e.id,disabled:e.disabled},domProps:{checked:e.checked},on:{change:function(t){return e.$emit("change",!e.checked)}}}),s("label",{attrs:{for:e.id}},[e._t("default")],2)])},staticRenderFns:[],functional:!1},{}),{UiCheckboxInput:UiCheckboxInput}},!0,!0,{filename:"src/view/widgets/ui-checkbox-input.vue"}
1),_reviewable.define(["UiDetailsGroup"],["truss"],function(e){"use strict";class UiDetailsGroup{constructor(){Vue.set(this,"activeIndex",null),Vue.set(this,"slotNames",[])}mounted(){const e=_.keys(this.$slots),t=_(e).filter(e=>_.startsWith(e,"summary")).map(e=>_.replace(e,"summary-","")).value(),s=_(e).filter(e=>_.startsWith(e,"content")).map(e=>_.replace(e,"content-","")).value(),i=_.filter(e,e=>!(_.startsWith(e,"summary-")||_.startsWith(e,"content-"))),r=_.xor(t,s);if(!_.isEmpty(i))throw new Error(`Invalid slot prefixes found: ${_.join(i,", ")}.\nSlot names should start with 'summary-' or 'content-'`);if(!_.isEmpty(r))throw new Error(`Unmatched slot suffixes found: ${_.join(r,", ")}.\nEnsure each 'summary-' slot has a corresponding 'content-' slot with an identical suffix.`);Vue.set(this,"slotNames",_(this.$slots).keys().filter(e=>_.startsWith(e,"summary-")).map(e=>e.substring(8)).value())}handleToggle(e){Vue.set(this,"activeIndex",this.activeIndex===e?null:e)}}UiDetailsGroup.$vueOptions={props:{}};return _declareVue("UiDetailsGroup",UiDetailsGroup,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui accordion details group"},e._l(e.slotNames,function(t,i){return s("ui-details",{key:i,attrs:{isOpen:e.activeIndex===i},on:{toggle:function(t){return e.handleToggle(i)}},scopedSlots:e._u([{key:"summary",fn:function(){return[e._t("summary-"+t)]},proxy:!0}],null,!0)},[e._t("content-"+t)],2)}),1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-ff030970"}),{UiDetailsGroup:UiDetailsGroup}},!0,!0,{filename:"src/view/widgets/ui-details-group.vue"}),_reviewable.define(["UiDetails"],["truss"],function(e){"use strict";class UiDetails{constructor(){Vue.set(this,"active",!1),Vue.set(this,"closing",!1)}mounted(){this.$observe(()=>this.isOpen,e=>{Vue.set(this,"active",e),e&&this.$nextTick().then(()=>{Vue.set(this.$el,"open",!0)})})}handleToggle(e){this.disabled?e.preventDefault():(this.$el.open&&Vue.set(this,"closing",!0),(this.$el.open||null!==this.isOpen)&&e.preventDefault(),null===this.isOpen&&Vue.set(this,"active",!this.$el.open),this.$emit("toggle"))}complete(){!this.closing||this.isOpen||this.active||Vue.set(this,"closing",Vue.set(this.$el,"open",!1))}}UiDetails.$vueOptions={props:{fluid:Boolean,isOpen:{type:[Boolean,null],default:null},disabled:Boolean,stealthy:Boolean,fixedAnimationDuration:{type:String}}};return _declareVue("UiDetails",UiDetails,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("details",{staticClass:"ui accordion",class:{fluid:e.fluid,disabled:e.disabled,stealthy:e.stealthy}},[s("summary",{staticClass:"title",class:{active:e.active},on:{click:e.handleToggle}},[s("i",{staticClass:"dropdown icon",attrs:{alt:"open dropdown"}}),e._t("summary")],2),s("animate-slide-down",{attrs:{duration:e.fixedAnimationDuration},on:{complete:e.complete}},[e.active?s("div",{staticClass:"active content"},[e._t("default")],2):e._e()])],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-6e30d88b"}),{UiDetails:UiDetails}},!0,!0,{filename:"src/view/widgets/ui-details.vue"}),_reviewable.define(["UiExpandCollapseButton"],["truss"],function(e){"use strict";class UiExpandCollapseButton{constructor(){}}UiExpandCollapseButton.$vueOptions={props:{expanded:Boolean,disabled:Boolean,locked:Boolean}};return _declareVue("UiExpandCollapseButton",UiExpandCollapseButton,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("span",{staticClass:"ui bare icon button",class:[e.expanded?"expanded":"collapsed",{disabled:e.disabled,locked:e.locked}],on:{click:function(t){return e.$emit("click",t)}}},[s("i",{staticClass:"angle up icon"}),s("i",{staticClass:"angle down icon"})])},staticRenderFns:[],functional:!1},{scopeId:"data-v-7cae96d2"}),{UiExpandCollapseButton:UiExpandCollapseButton}},!0,!0,{filename:"src/view/widgets/ui-expand-collapse-button.vue"}),_reviewable.define(["UiHoldToArmButton"],["truss","animator","pageControl"],function(e,t,s){"use strict";class UiHoldToArmButton{constructor(){Vue.set(this,"holdState",null),Vue.set(this,"arming",{percent:0}),Vue.set(this,"tippy",void 0),Vue.set(this,"circleOffset",8),Vue.set(this,"circleRadius",5)}created(){this.$observe(()=>this.disabled,()=>{this.disabled&&this.holdState&&Vue.set(this,"holdState",null)}),document.addEventListener("mousedown",this.clear),document.addEventListener("touchstart",this.clear)}
1beforeDestroy(){document.removeEventListener("mousedown",this.clear),document.removeEventListener("touchstart",this.clear),this.reset()}handleDown(e){if(!this.disabled){if("touchstart"===e.type){if(e.touches.length>1)return;e.preventDefault(),e.stopPropagation()}this.bypassArm?Vue.set(this,"holdState","armed"):(Vue.set(this,"holdState","arming"),anime.remove(this.arming),anime({targets:this.arming,percent:[0,1],easing:"linear",duration:750,update:this.updateArmingAnimation,complete:()=>{"arming"===this.holdState&&Vue.set(this,"holdState","armed")}}))}}handleLeave(e){"arming"!==this.holdState&&"armed"!==this.holdState||this.fizzle()}handleUp(e){this.disabled?this.reset():"arming"===this.holdState?this.fizzle():"armed"===this.holdState&&(this.$emit("click"),this.reset())}clear(e){"fizzled"===this.holdState&&this.reset()}reset(){Vue.set(this,"holdState",null),anime.remove(this.arming),this.tippy&&(this.tippy.hide(),this.tippy.destroy(),Vue.set(this,"tippy",void 0))}fizzle(){this.bypassArm||(Vue.set(this,"holdState","fizzled"),Vue.set(this,"tippy",tippy(this.$el,{content:_.trim(this.$refs.tip.innerHTML),allowHTML:!0,arrow:!0,theme:"tooltip",trigger:"manual",interactive:!0,placement:"bottom",animation:"shift-away",duration:t.defaultOptions.duration,zIndex:1e6,showOnCreate:!0,appendTo:()=>s.topDialog||document.body,popperOptions:{modifiers:[{name:"preventOverflow",options:{boundary:document.documentElement}}]}})),setTimeout(()=>{"fizzled"===this.holdState&&(anime.remove(this.arming),anime({targets:this.arming,percent:0,easing:"linear",duration:225,update:this.updateArmingAnimation}))},750*_.clamp(.3-this.arming.percent,0,1)))}updateArmingAnimation(){if(!this.$refs.arc1||!this.$refs.arc2)return;const e=_.clamp(2*Math.PI*this.arming.percent,0,Math.PI),t=`M 8 3 A 5 5 0 0 1 ${8+5*Math.sin(e)} ${8-5*Math.cos(e)}`;this.$refs.arc1.setAttribute("d",t);const s=_.clamp(2*Math.PI*(this.arming.percent-.5),0,Math.PI),i=`M 8 13 A 5 5 0 0 1 ${8-5*Math.sin(s)} ${8+5*Math.cos(s)}`;this.$refs.arc2.setAttribute("d",i)}}UiHoldToArmButton.$vueOptions={props:{disabled:Boolean,bypassArm:Boolean}};return _declareVue("UiHoldToArmButton",UiHoldToArmButton,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("span",{directives:[{name:"fire-touchenter-touchleave",rawName:"v-fire-touchenter-touchleave"}],staticClass:"ui button",class:[this.holdState,{disabled:e.disabled}],on:{mousedown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])||"button"in t&&0!==t.button?null:e.handleDown.apply(null,arguments)},touchstart:e.handleDown,mouseleave:e.handleLeave,touchleave:e.handleLeave,mouseup:e.handleUp,touchend:e.handleUp,click:function(e){e.stopPropagation(),e.preventDefault()}}},[e.bypassArm?e._e():s("span",[e._t("indicator",function(){return[s("span",{staticClass:"indicator"},[s("svg",{staticClass:"svg circle"},[s("circle",{attrs:{cx:e.circleOffset,cy:e.circleOffset,r:e.circleRadius}})]),s("svg",{staticClass:"svg gauge"},[s("path",{ref:"arc1"}),s("path",{ref:"arc2"})]),s("svg",{staticClass:"svg bloom"},[s("circle",{attrs:{cx:e.circleOffset,cy:e.circleOffset,r:e.circleRadius}})])])]})],2),e._t("default"),s("span",{ref:"tip",staticClass:"tip"},[e._t("fizzled-tip",function(){return[e._v("Click and hold to arm, release to activate.")]})],2)],2)},staticRenderFns:[],functional:!1},{scopeId:"data-v-12417e6b"}),{UiHoldToArmButton:UiHoldToArmButton}},!0,!0,{filename:"src/view/widgets/ui-hold-to-arm-button.vue"}),_reviewable.define(["UiNumberInput"],["truss"],function(e){"use strict";let t=0;class UiNumberInput{constructor(){Vue.set(this,"id","ui-number-"+ ++t)}change(){const e=_.toNumber(this.$refs.input.value);e<this.min?this.$emit("change",this.min):e>this.max?this.$emit("change",this.max):this.$emit("change",e)}updateValue(e){if(this.disabled)return;let t,s=0;const i=()=>{this.$refs.input&&(e>0?this.$refs.input.stepUp():this.$refs.input.stepDown(),t=setTimeout(i,s++>=1?100:400))};i(),document.addEventListener("mouseup",()=>{clearTimeout(t),this.$emit("change",_.toNumber(_get(this,"$refs","input","value")))},{once:!0})}get placesToShow(){return _.toString(this.placeholder||this.max||100).replace(".","").length}}UiNumberInput.$vueOptions={props:{numberValue:{required:!0},disabled:Boolean,min:Number,max:Number,placeholder:[Number,String],step:Number,stacked:Boolean},model:{prop:"numberValue",event:"change"}};return _declareVue("UiNumberInput",UiNumberInput,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"num wrapper",attrs:{tabindex:"-1"},on:{focusin:function(t){return e.$refs.input.focus()}}},[s("label",{attrs:{for:e.id}},[e._t("default")],2),s("div",{staticClass:"ui number",class:{stacked:e.stacked}},[s("div",{staticClass:"ui button decrement",class:{disabled:e.disabled},on:{mousedown:function(t){return e.updateValue(-1)}}},[e._t("decrementIcon",function(){return[s("i",{staticClass:"icon decrement"})]})],2),s("input",{ref:"input",attrs:{type:"number",id:e.id,disabled:e.disabled,min:e.min,max:e.max,placeholder:e.placeholder,step:e.step},domProps:{value:e.numberValue},on:{change:e.change}}),s("div",{staticClass:"ui button increment",class:{disabled:e.disabled},on:{mousedown:function(t){return e.updateValue(1)}}},[e._t("incrementIcon",function(){return[s("i",{staticClass:"icon increment"})]})],2)])])},staticRenderFns:[],functional:!1},{cssVarsGetter:function(e){return[[!0,{"6cdb75be2b393799":e.placesToShow+"rem"}]]},scopeId:"data-v-6cdb75be"}),{UiNumberInput:UiNumberInput}},!0,!0,{filename:"src/view/widgets/ui-number-input.vue"}),_reviewable.define(["UiRadioInput"],["truss"],function(e){"use strict";let t=0;class UiRadioInput{constructor(){Vue.set(this,"id","ui-radio-"+ ++t)}}UiRadioInput.$vueOptions={props:{value:{required:!0},checked:{required:!0},disabled:Boolean},model:{prop:"checked",event:"change"}};return _declareVue("UiRadioInput",UiRadioInput,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("span",{staticClass:"ui radio checkbox"},[s("input",{attrs:{type:"radio",id:e.id,disabled:e.disabled},domProps:{checked:e.checked===e.value},on:{change:function(t){return e.$emit("change",e.value)}}}),s("label",{attrs:{for:e.id}},[e._t("default")],2)])},staticRenderFns:[],functional:!1},{}),{UiRadioInput:UiRadioInput}},!0,!0,{filename:"src/view/widgets/ui-radio-input.vue"}),_reviewable.define(["UiShortOrLongClickButton"],["truss"],function(e){"use strict";class UiShortOrLongClickButton{constructor(){Vue.set(this,"holdState",null),Vue.set(this,"timer",null)}created(){this.$observe(()=>this.disabled,()=>{this.disabled&&this.holdState&&(clearTimeout(this.timer),Vue.set(this,"holdState",null))}),document.addEventListener("mousedown",this.clear),document.addEventListener("touchstart",this.clear)}
1beforeDestroy(){document.removeEventListener("mousedown",this.clear),document.removeEventListener("touchstart",this.clear)}handleDown(e){_get(e,"touches","length")>1||(Vue.set(this,"holdState","short"),Vue.set(this,"timer",setTimeout(()=>{Vue.set(this,"holdState","long")},this.threshold)))}handleLeave(e){clearTimeout(this.timer),"short"!==this.holdState&&"long"!==this.holdState||Vue.set(this,"holdState","fizzled")}handleUp(e){clearTimeout(this.timer),"short"===this.holdState?this.$emit("click"):"long"===this.holdState&&this.$emit("long-click"),_.defer(()=>{Vue.set(this,"holdState",null)})}clear(e){"fizzled"===this.holdState&&Vue.set(this,"holdState",null)}}UiShortOrLongClickButton.$vueOptions={props:{disabled:Boolean,threshold:{type:Number,default:300}}};return _declareVue("UiShortOrLongClickButton",UiShortOrLongClickButton,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("span",{directives:[{name:"fire-touchenter-touchleave",rawName:"v-fire-touchenter-touchleave"}],staticClass:"ui button",class:{disabled:e.disabled},on:{mousedown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])||"button"in t&&0!==t.button?null:e.handleDown.apply(null,arguments)},touchstart:function(t){return t.preventDefault(),e.handleDown.apply(null,arguments)},mouseleave:e.handleLeave,touchleave:e.handleLeave,mouseup:e.handleUp,touchend:function(t){return t.preventDefault(),e.handleUp.apply(null,arguments)},touchcancel:e.handleLeave,click:function(e){e.stopPropagation()}}},[s("transition",{attrs:{name:"scroll",css:!0}},["long"===e.holdState?s("span",{key:"long",staticClass:"long"},[e._t("long")],2):s("span",{key:"short",staticClass:"short"},[e._t("short")],2)]),s("span",{staticClass:"cover"})],1)},staticRenderFns:[],functional:!1},{scopeId:"data-v-05e58dac"}),{UiShortOrLongClickButton:UiShortOrLongClickButton}},!0,!0,{filename:"src/view/widgets/ui-short-or-long-click-button.vue"}),_reviewable.define(["UiToggleInput"],["truss"],function(e){"use strict";let t=0;class UiToggleInput{constructor(){Vue.set(this,"id","ui-toggle-"+ ++t)}}UiToggleInput.$vueOptions={props:{checked:{required:!0},disabled:Boolean},model:{prop:"checked",event:"change"}};return _declareVue("UiToggleInput",UiToggleInput,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("span",{staticClass:"ui toggle checkbox",class:{disabled:e.disabled}},[s("input",{attrs:{type:"checkbox",id:e.id,disabled:e.disabled},domProps:{checked:e.checked},on:{change:function(t){return e.$emit("change",!e.checked)}}}),s("label",{attrs:{for:e.id}},[e._t("default")],2)])},staticRenderFns:[],functional:!1},{}),{UiToggleInput:UiToggleInput}},!0,!0,{filename:"src/view/widgets/ui-toggle-input.vue"}),_reviewable.define(["VueMultiselectPort"],["truss"],function(e){"use strict";class VueMultiselectPort{constructor(){Vue.set(this,"blurPrevented",!1)}preventBlur(){Vue.set(this,"blurPrevented",!0),_.defer(()=>{Vue.set(this,"blurPrevented",!1)})}handleActivate(){this.activate(),this.$refs.dropdown.toggle(!0)}handleDeactivate(){this.blurPrevented?this.$el.focus():(this.deactivate(),this.$refs.dropdown.toggle(!1))}toggle(){this.isOpen?(Vue.set(this,"blurPrevented",!1),this.handleDeactivate()):this.handleActivate()}get hasOptionGroup(){return this.groupValues&&this.groupLabel&&this.groupSelect}get isSingleLabelVisible(){return(this.singleValue||0===this.singleValue)&&(!this.isOpen||!this.searchable)&&!this.visibleValues.length}get isPlaceholderVisible(){return!(this.internalValue.length||this.searchable&&this.isOpen)}get visibleValues(){return this.multiple?this.internalValue.slice(0,this.limit):[]}get singleValue(){return this.internalValue[0]}get deselectLabelText(){return this.showLabels?this.deselectLabel:""}get deselectGroupLabelText(){return this.showLabels?this.deselectGroupLabel:""}get selectLabelText(){return this.showLabels?this.selectLabel:""}get selectGroupLabelText(){return this.showLabels?this.selectGroupLabel:""}get selectedLabelText(){return this.showLabels?this.selectedLabel:""}get inputStyle(){return this.searchable||this.multiple&&this.value&&this.value.length?this.isOpen?{width:"100%"}:{width:"0",position:"absolute",padding:"0"}:""}get contentStyle(){return this.options.length?{display:"inline-block"}:{display:"block"}}get isAbove(){return"above"===this.openDirection||"top"===this.openDirection||"below"!==this.openDirection&&"bottom"!==this.openDirection&&"above"===this.preferredOpenDirection}get showSearchInput(){return this.searchable&&(!this.hasSingleSelectedSlot||!this.visibleSingleValue&&0!==this.visibleSingleValue||this.isOpen)}}VueMultiselectPort.$vueOptions={props:{instanceId:{type:Object},rootClassList:{type:[Boolean,Object]},customDataVAttributes:{type:Object},name:{type:String,default:""},tippyOptions:{type:Object},altMode:{type:Boolean},selectLabel:{type:String,default:"Press enter to select"},selectedLabel:{type:String,default:"Selected"},selectGroupLabel:{type:String,default:"Press enter to select group"},deselectLabel:{type:String,default:"Press enter to remove"},deselectGroupLabel:{type:String,default:"Press enter to deselect group"},showLabels:{type:Boolean,default:!0},limit:{type:Number,default:99999},maxHeight:{type:Number,default:300},limitText:{type:Function,default:e=>`and ${e} more`},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},showNoOptions:{type:Boolean,default:!0},showNoResults:{type:Boolean,default:!0},tabindex:{type:Number,default:0}},mixins:[multiselectMixin,pointerMixin]};return _declareVue("VueMultiselectPort",VueMultiselectPort,null,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"multiselect",class:{"multiselect--active":e.isOpen,"multiselect--disabled":e.disabled,"multiselect--has-options-group":e.hasOptionGroup},attrs:{tabindex:e.searchable?-1:e.tabindex,role:"combobox","aria-owns":"listbox-"+e.id},on:{focus:function(t){return e.handleActivate()},blur:function(t){return e.handleDeactivate()},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])||t.target!==t.currentTarget?null:(t.preventDefault(),e.pointerForward())},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])||t.target!==t.currentTarget?null:(t.preventDefault(),e.pointerBackward())}],keypress:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")&&e._k(t.keyCode,"tab",9,t.key,"Tab")?null:(t.stopPropagation(),t.target!==t.currentTarget?null:e.addPointerElement(t))},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:e.handleDeactivate()}}},[e._t("caret",function(){return[s("div",e._b({staticClass:"multiselect__select",on:{click:function(e){e.stopPropagation(),e.preventDefault()},mousedown:function(t){return t.preventDefault(),t.stopPropagation(),e.toggle.apply(null,arguments)}}},"div",e.customDataVAttributes,!1))]},{toggle:e.toggle}
1),e._t("clear",null,{search:e.search}),s("div",e._b({ref:"tags",staticClass:"multiselect__tags",on:{click:function(e){e.stopPropagation(),e.preventDefault()}}},"div",e.customDataVAttributes,!1),[e._t("selection",function(){return[s("div",e._b({directives:[{name:"show",rawName:"v-show",value:e.visibleValues.length>0,expression:"visibleValues.length > 0"}],staticClass:"multiselect__tags-wrap"},"div",e.customDataVAttributes,!1),[e._l(e.visibleValues,function(t,i){return[e._t("tag",function(){return[s("span",e._b({key:i,staticClass:"multiselect__tag"},"span",e.customDataVAttributes,!1),[s("span",{domProps:{textContent:e._s(e.getOptionLabel(t))}}),s("i",e._b({staticClass:"multiselect__tag-icon",attrs:{tabindex:"1"},on:{keypress:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"enter",13,s.key,"Enter")?null:(s.preventDefault(),e.removeElement(t))},mousedown:function(s){return s.preventDefault(),e.removeElement(t)}}},"i",e.customDataVAttributes,!1))])]},{option:t,search:e.search,remove:e.removeElement})]})],2),e.internalValue&&e.internalValue.length>e.limit?[e._t("limit",function(){return[s("strong",e._b({staticClass:"multiselect__strong",domProps:{textContent:e._s(e.limitText(e.internalValue.length-e.limit))}},"strong",e.customDataVAttributes,!1))]})]:e._e()]},{search:e.search,remove:e.removeElement,values:e.visibleValues,isOpen:e.isOpen}),s("transition",{attrs:{name:"multiselect__loading"}},[e._t("loading",function(){return[s("div",e._b({directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}],staticClass:"multiselect__spinner"},"div",e.customDataVAttributes,!1))]})],2),e.searchable?s("input",e._b({ref:"search",staticClass:"multiselect__input",style:e.inputStyle,attrs:{name:e.name,id:e.id,type:"text",autocomplete:"off",spellcheck:"false",placeholder:e.placeholder,disabled:e.disabled,tabindex:e.tabindex,"aria-controls":"listbox-"+e.id},domProps:{value:e.search},on:{input:function(t){return e.updateSearch(t.target.value)},focus:function(t){return t.preventDefault(),e.handleActivate()},blur:function(t){return t.preventDefault(),e.handleDeactivate()},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:e.handleDeactivate()},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.preventDefault(),e.pointerForward())},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.preventDefault(),e.pointerBackward())},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?null:(t.stopPropagation(),e.removeLastElement())}],keypress:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),t.stopPropagation(),t.target!==t.currentTarget?null:e.addPointerElement(t))}}},"input",e.customDataVAttributes,!1)):e._e(),e.isSingleLabelVisible?s("span",e._b({staticClass:"multiselect__single",on:{mousedown:function(t){return t.preventDefault(),e.toggle.apply(null,arguments)}}},"span",e.customDataVAttributes,!1),[e._t("singleLabel",function(){return[[e._v(e._s(e.currentOptionLabel))]]},{option:e.singleValue})],2):e._e(),e.isPlaceholderVisible?s("span",e._b({staticClass:"multiselect__placeholder",on:{mousedown:function(t){return t.preventDefault(),e.toggle.apply(null,arguments)}}},"span",e.customDataVAttributes,!1),[e._t("placeholder",function(){return[e._v("\n "+e._s(e.placeholder)+"\n ")]})],2):e._e()],2),s("tippy-dropdown",{ref:"dropdown",attrs:{options:Object.assign({},{theme:"dropdown-flat-top",bypassCloseOnClick:!0},e.tippyOptions)}},[s("div",e._b({ref:"list",staticClass:"multiselect__content-wrapper",style:{maxHeight:e.optimizedHeight+"px"},attrs:{tabindex:"-1"},on:{focus:e.handleActivate,click:e.preventBlur,mousedown:function(e){e.preventDefault()}}},"div",Object.assign({},e.customDataVAttributes,e.instanceId,e.rootClassList),!1),[s("animate-slide-x",[e.altMode?s("div",{staticClass:"alt multiselect__content",style:e.contentStyle,attrs:{"slide-direction":"left"}},[e._t("alt")],2):s("ul",e._b({staticClass:"multiselect__content",style:e.contentStyle,attrs:{role:"listbox",id:"listbox-"+e.id}},"ul",e.customDataVAttributes,!1),[e._t("beforeList"),e.multiple&&e.max===e.internalValue.length?s("li",[s("span",e._b({staticClass:"multiselect__option"},"span",e.customDataVAttributes,!1),[e._t("maxElements",function(){return[e._v("\n Maximum of "+e._s(e.max)+" options selected.\n First remove a selected option to select another.\n ")]}
1)],2)]):e._e(),!e.max||e.internalValue.length<e.max?e._l(e.filteredOptions,function(t,i){return s("li",e._b({key:i,staticClass:"multiselect__element",attrs:{id:e.id+"-"+i,role:t&&(t.$isLabel||t.$isDisabled)?null:"option"}},"li",e.customDataVAttributes,!1),[t&&(t.$isLabel||t.$isDisabled)?e._e():s("span",e._b({staticClass:"multiselect__option",class:e.optionHighlight(i,t),attrs:{"data-select":t&&t.isTag?e.tagPlaceholder:e.selectLabelText,"data-selected":e.selectedLabelText,"data-deselect":e.deselectLabelText},on:{click:function(s){return e.select(t)},mouseenter:function(t){return t.target!==t.currentTarget?null:e.pointerSet(i)}}},"span",e.customDataVAttributes,!1),[e._t("option",function(){return[s("span",[e._v(e._s(e.getOptionLabel(t)))])]},{option:t,search:e.search,index:i})],2),t&&(t.$isLabel||t.$isDisabled)?s("span",e._b({staticClass:"multiselect__option",class:e.groupHighlight(i,t),attrs:{"data-select":e.groupSelect&&e.selectGroupLabelText,"data-deselect":e.groupSelect&&e.deselectGroupLabelText},on:{mouseenter:function(t){if(t.target!==t.currentTarget)return null;e.groupSelect&&e.pointerSet(i)},mousedown:function(s){return s.preventDefault(),e.selectGroup(t)}}},"span",e.customDataVAttributes,!1),[e._t("option",function(){return[s("span",[e._v(e._s(e.getOptionLabel(t)))])]},{option:t,search:e.search,index:i})],2):e._e()])}):e._e(),s("li",{directives:[{name:"show",rawName:"v-show",value:e.showNoResults&&0===e.filteredOptions.length&&e.search&&!e.loading,expression:"showNoResults && (filteredOptions.length === 0 && search && !loading)"}]},[s("span",e._b({staticClass:"multiselect__option"},"span",e.customDataVAttributes,!1),[e._t("noResult",function(){return[e._v("\n No elements found. Consider changing the search query.\n ")]},{search:e.search})],2)]),s("li",{directives:[{name:"show",rawName:"v-show",value:e.showNoOptions&&(0===e.options.length||!0===e.hasOptionGroup&&0===e.filteredOptions.length)&&!e.search&&!e.loading,expression:"showNoOptions &&\n ((options.length === 0 ||\n (hasOptionGroup === true && filteredOptions.length === 0)) &&\n !search && !loading)"}]},[s("span",e._b({staticClass:"multiselect__option"},"span",e.customDataVAttributes,!1),[e._t("noOptions",function(){return[e._v("List is empty.")]})],2)]),e._t("afterList")],2)])],1)])],2)},staticRenderFns:[],functional:!1},{}),{VueMultiselectPort:VueMultiselectPort}},!0,!0,{filename:"src/view/widgets/vue-multiselect-port.vue"}),_reviewable.define(["config"],["generatedConfig"],function(e){"use strict";const t=navigator.userAgent,s=navigator.userAgentData&&navigator.userAgentData.platform||navigator.platform||t,i=/Safari\b/.test(t)&&!/Chrome|Chromium|CriOS|FxiOS|Edg|OPR|OPiOS|Android/.test(t),r=_.assign(e,{prod:window.REVIEWABLE_PROD,hostUrl:e.hostUrl||"https://reviewable.io",imageUrl:e.imageUrl||"https://reviewable.io",mac:/Mac|macOS/.test(s),windows:/Win/.test(s),safari:i,firefox:/Firefox/.test(t),legacyIeOrEdge:/\bMSIE\b|\bTrident\/|\bEdge\//.test(t)});return r.safari&&document.documentElement.setAttribute("browser-safari",""),r.firefox&&document.documentElement.setAttribute("browser-firefox",""),Vue.set(r,"hostUrlEncoded",encodeURIComponent(r.hostUrl)),{config:r}},!1,!0,{filename:"src/app/config.js"}),_reviewable.define([],["truss"],function(e){"use strict";const t=["action","auth","connection","process","ui.click","warden"];return window.Reviewable=_.assign(window.Reviewable||{},{showAllComments(){const t=e.store.services.reviewContext.current;_get(t,"review")&&t.navigation.exhibitParleys(2,t.review.discussions.parleys)},hideAllComments(){const t=e.store.services.reviewContext.current;_get(t,"review")&&t.navigation.exhibitParleys(0,t.review.discussions.parleys)},resetSession(){new Promise((e,t)=>{const s=indexedDB.open("firebaseLocalStorageDb");Vue.set(s,"onerror",e=>{t(new Error(`Error opening session database: ${e.target.error}`))}),Vue.set(s,"onsuccess",s=>{const i=s.target.result,r=i.transaction(["firebaseLocalStorage"],"readwrite").objectStore("firebaseLocalStorage").clear();i.close(),Vue.set(r,"onerror",e=>{t(new Error(`Error clearing session store: ${e.target.error}`))}),Vue.set(r,"onsuccess",()=>{e("Reviewable session reset successfully")})})}).then(e=>{console.log(`${e}`)}).catch(e=>{console.error(e.message)})},logBreadcrumbs(){console.log(_(Sentry.getIsolationScope()._breadcrumbs).filter(e=>_.includes(t,e.category)).map(e=>{const t=[new Date(1e3*e.timestamp).toISOString().slice(11),e.category];if(e.message&&t.push(e.message),e.data){let s;try{s=JSON.stringify(e.data)}catch(e){s=`Error: ${e.message}`}t.push(s)}return t.join(" ")}).join("\n"))}}),{}},!1,!0,{filename:"src/app/console_api.js"}),_reviewable.define(["debug"],[],function(){"use strict";const e=window.location.search.match(/[?&]debug=(.*?)(&|$)/),t=e?e[1].split(","):[];return{debug:{bindings:_.includes(t,"bindings"),bounds:_.includes(t,"bounds"),cache:_.includes(t,"cache"),condition:_.includes(t,"condition"),crash:!window.REVIEWABLE_PROD||_.includes(t,"crash"),dashboard:_.includes(t,"dashboard"),dashboardLegacySearch:_.includes(t,"dashboardLegacySearch"),drafts:_.includes(t,"drafts"),firebase:_.includes(t,"firebase"),focus:_.includes(t,"focus"),fps:_.includes(t,"fps"),latency:_.includes(t,"latency"),model:!window.REVIEWABLE_PROD||_.includes(t,"model"),navigation:_.includes(t,"navigation"),permissions:_.includes(t,"permissions"),singleFileMode:_.includes(t,"
1single-file-mode"),stackingContext:_.includes(t,"stacking"),workers:_.includes(t,"workers")}}},!1,!0,{filename:"src/app/debug.js"}),_reviewable.define(["encrypt","encryptSettingsFileValue"],["config"],function(e){"use strict";const t=_get(crypto,"subtle")&&e.publicKey?crypto.subtle.importKey("jwk",e.publicKey,{name:"RSA-OAEP",hash:"SHA-256"},!1,["encrypt"]):void 0,s=new TextEncoder;async function i(i){if(!_get(crypto,"subtle"))throw new Error("Browser does not support encryption");if(!e.publicKey)throw new Error("Encryption not configured for Reviewable");const r=await t,n=await crypto.subtle.encrypt({name:"RSA-OAEP"},r,s.encode(i));return"rsa2:"+(await new Promise((e,t)=>{const s=new FileReader;Vue.set(s,"onload",()=>e(s.result)),Vue.set(s,"onerror",()=>t(s.error)),s.readAsDataURL(new Blob([n]))})).replace(/^.*?,/,"")}return{encrypt:i,encryptSettingsFileValue:async function(e,t){return"encrypted/"+await i(`repo=${t};${e}`)}}},!1,!0,{filename:"src/app/encryption.js"}),_reviewable.define([],["truss","corpsman","config"],function(e,t,s){"use strict";return Vue.set(Hubkit.defaults,"host",s.gitHubApiUrl),Vue.set(Hubkit.defaults,"graphHost",s.gitHubGraphqlApiUrl),Vue.set(Hubkit.defaults,"apiVersion","2022-11-28"),Vue.set(Hubkit.defaults,"fresh",!0),Vue.set(Hubkit.defaults,"onError",function(s){if(!s.status)return Hubkit.RETRY;if(!reviewableHandledErrors.has(s)){if(401===s.status&&(e.store.services.auth.invalidateGitHubToken(),t.markHandled(s)),403===s.status||429===s.status){const i=Hubkit.identify403Error(s);if(_get(i,"quota")&&(t.setCondition("ghquota"),t.markHandled(s),e.info.userid&&(/anonymous|authenticated requests/i.test(s.message)?t.capture(s,"anonymous quota error when signed in"):Sentry.captureMessage("User out of GitHub quota",{level:"debug",extra:{message:s.message,context:"main process"}}))),"account-suspended"===_get(i,"code")){if(t.markHandled(s),/^\/users?\//.test(s.pathPattern||""))return null;t.setCondition("ghsuspended")}}(s.status>=500||401===s.status||403===s.status||429===s.status)&&Vue.set(s,"fingerprint",["Hubkit",""+s.status])}}),e.observe(()=>e.info.userid,e=>{void 0!==e&&Hubkit.defaults.cache.clear()}),{}},!1,!0,{filename:"src/app/hubkit_config.js"}),_reviewable.define(["routes"],[],function(){"use strict";return{routes:[{path:"/",component:"HomePage",pageTitleSuffix:"GitHub Code Reviews Done Right",pageClass:"home-page"},{path:"/repositories",redirect(e){const t=_.split(e.hash,";"),[s,i,r]=_.split(t.shift(),"/"),n={};let a="/admin";return s&&"-"!==s&&(a+=`/${s}`,i&&(a+=`/${i}`),r&&Vue.set(n,"pr",r)),_.includes(t,"annually-billed")&&Vue.set(n,"annually-billed",!0),{path:a,query:_.isEmpty(n)?null:n,hash:null}}},{path:"/admin/:owner?/:repo?",component:"AdminCenter",pageTitle:"Admin Center",pageClass:"admin-
1page",keyParams:["owner","repo"]},{path:"/reviews",component:"Dashboard",pageTitle:"My Reviews",pageClass:"dashboard-page"},{path:"/reviews/:owner",component:"Dashboard",pageTitle:"Reviews",pageClass:"dashboard-page",keyParams:["owner"]},{path:"/reviews/:owner/:repo",component:"Dashboard",pageTitle:"Reviews",pageClass:"dashboard-page",keyParams:["owner","repo"]},{path:"/reviews/:owner/:repo/pull/:pullRequest",redirect(e){const t=e.params;return{path:`/reviews/${t.owner}/${t.repo}/${t.pullRequest}`}}},{path:"/reviews/:owner/:repo/:pullRequest/:filePath*",component:"ReviewComponent",pageClass:"review-page",keyParams:["owner","repo","pullRequest"],pageTitle:"Pull Request Review"},{path:"/goodbye",component:"GoodbyePage",pageTitle:"Goodbye",pageClass:"goodbye-page"},{path:"/difftest",component:"DiffTestPage",pageTitle:"Diff Tester",pageClass:"difftest-page"},{path:"/playground",component:"CompletionConditionPlayground",pageTitle:"Completion Condition Playground",pageClass:"playground-page"},{path:"/encrypt",component:"SettingsValueEncryption",pageTitle:"Settings Value Encryptor",pageClass:"encrypt-page"},{path:"/headless",component:null,pageTitle:"Headless",pageClass:"headless-page"},{path:null,redirect:()=>({path:"/",query:null,hash:null})}]}},!1,!0,{filename:"src/app/routes.js"}),_reviewable.define(["safeStorage"],[],function(){"use strict";function e(e){return{setItem(t,s,i=_.noop){try{window[e].setItem(t,s)}catch(e){i(e)}},getItem(t,s=_.noop){try{return window[e].getItem(t)}catch(e){s(e)}},removeItem(t,s=_.noop){try{window[e].removeItem(t)}catch(e){s(e)}},clear(t=_.noop){try{window[e].clear()}catch(e){t(e)}},key(t,s=_.noop){try{return window[e].key(t)}catch(e){return s(e)}},entries(t=_.noop){let s=0;return{[Symbol.iterator](){return this},next(){try{if(s<window[e].length){const t=window[e].key(s);return s++,{value:[t,window[e][t]],done:!1}}return{done:!0}}catch(e){return t(e),{done:!0}}}}},get length(){throw new Error(`Cannot access length in safeStorage. Use safeStorage.${e}.entries() instead.`)}}}return{safeStorage:{session:e("sessionStorage"),local:e("localStorage")}}},!1,!0,{filename:"src/app/safe_storage.js"}),_reviewable.define([],["generatedConfig"],function(e){"use strict";window.reviewableHandledErrors=new WeakMap,window.addEventListener("unhandledrejection",e=>{const t=e.reason;_.isObject(t)&&(reviewableHandledErrors.has(t)||"Canceled"===t.message)&&e.preventDefault()});const t=[{userAgent:"Trident/"},{message:"Syntax error in regular expression",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0"},{message:"__gCrWeb",prodOnly:!0,externalOnly:!0},{message:"Can't find variable: $B",prodOnly:!0,externalOnly:!0},{message:"ResizeObserver loop limit exceeded",prodOnly:!0,externalOnly:!0},{message:"ResizeObserver loop completed with undelivered notifications",prodOnly:!0,externalOnly:!0},{message:"Non-Error exception captured",prodOnly:!0,externalOnly:!0},{message:"Unexpected end of input",prodOnly:!0,externalOnly:!0},{message:"Promise was rejected because the browsing context is going away"},{message:"Canceled"},{regex:/out of GitHub anonymous request quota/,recoverableOnly:!0},{regex:/Authenticated requests get a higher rate limit/,recoverableOnly:!0},{regex:/API rate limit exceeded for user ID/,recoverableOnly:!0},{regex:/Possible side-effect in debug-evaluate/,recoverableOnly:!0},{regex:/your IP address is not permitted to access this resource/,recoverableOnly:!0},{regex:/(NOT_SUPPORTED_ERR|DOM Exception 9)/,fatalCondition:"badbrowser"},{prop:"networkFailure",fatalCondition:"alloworigin"}];let s=!1;const i=/(^chrome-extension:)|(^chrome:)|(^moz-extension:)|(\/analytics.js\/v1\/)/,r=["api.segment.io","api.mixpanel.com","api.amplitude.com","www.google-analytics.com"],n=window.location.search.match(/[?&]debug=(.*?)(&|$)/),a=n?n[1].split(","):[],o=!window.REVIEWABLE_PROD||_.includes(a,"crash");function l(e,t){if((t=t||new Set).has(e))return"<reference cycle>";t.add(e);try{if(_.isArray(e))for(let s=0;s<e.length;s++)l(e[s],t);else _.isPlainObject(e)&&_.forEach(e,(s,i)=>{/token/i.test(i)&&_.isString(s)?Vue.set(e,i,"[redacted]"):l(s,t)})}catch{}return e}function c(e,t){if(e&&_.isString(e.stack))return e.stack;const s=_.get(t,"exception.values[0]");return s?function(e){const t=_.get(e,"stacktrace.frames")||[];if(!t.length)return;const s=_.compact([e.type,e.value]).join(": ")||"Error";return _([s]).concat(_.map(t.slice().reverse(),e=>{const t=_.compact([e.filename,e.lineno,e.colno]).join(":");return` at ${e.function||"<anonymous>"}${t?` (${t})`:""}`})).join("\n")}(s):void 0}const u=e.hostUrl||"https://reviewable.io",d={dsn:e.sentryDsn||"http://abc@localhost/123",debug:e.sentryDebug,release:`${e.systemBuild||e.build}`,env:e.env,environment:u.replace(/^https?:\/\//,""),sendClientReports:!!e.sentryDsn,sendDefaultPii:!0,integrations:e=>[..._.reject(e,{name:"BrowserSession"}),{name:"DelayedUnhandledRejection",processEvent:(e,t)=>
1_.endsWith(_get(e,"exception","values",0,"mechanism","type"),"onunhandledrejection")?new Promise(s=>{setTimeout(()=>{const i=t.originalException;s(_.isObject(i)&&(reviewableHandledErrors.has(i)||"Canceled"===i.message)?null:e)},0)}):e},Sentry.rewriteFramesIntegration({iteratee:e=>(e.filename&&Vue.set(e,"in_app",/\.app\.js$|\.libs\.js$/i.test(e.filename)),e)}),Sentry.browserTracingIntegration()],tracePropagationTargets:[],tracingOptions:{trackComponents:!1,hooks:["create","mount"],timeout:4e3},tracesSampleRate:.05,normalizeDepth:10,beforeBreadcrumb(e){if(("fetch"===e.category||"xhr"===e.category)&&e.data){if(200===e.data.status_code)return null;const t=e.data.url.replace(/^https?:\/\/([^/]+).*/,"$1");return _.includes(r,t)?null:e}return _.isObject(e.data)&&_.forEach(e.data,(t,s)=>{_.isObject(t)&&Vue.set(e.data,s,JSON.stringify(t))}),e},beforeSend(r,n){if(s)return null;const a=_get(Vue,"prototype","$session","corpsman");Vue.set(r,"extra",r.extra||{}),Vue.set(r,"tags",r.tags||{}),Vue.set(r.tags,"firebase",Truss.FIREBASE_SDK_VERSION);const u=_get(r,"exception","values",0,"stacktrace","frames");if(_.some(u,e=>i.test(e.filename)))return null;Vue.set(r.tags,"source",_get(n,"originalException","extra","workerUrl")||_.some(_get(u,"length")>1?u.slice(1):u,"in_app")||/truss_worker|diff_worker/.test(_access(_,"","head","call",[u],"","filename"))?"app":"external");const d=_.isError(_get(n,"originalException"))?_get(n,"originalException"):void 0;if(_get(d,"skipCapture"))return null;const h=_get(d,"attachments")||_get(r,"extra","attachments");if(h&&(Vue.set(n,"attachments",n.attachments||[]),n.attachments.push(..._(h).compact().map((e,t)=>{let s=!_.isString(e);if(s)try{e=JSON.stringify(e,null,2)}catch(t){s=!1,e="Invalid attachment: "+t}return{filename:`attachment_${t}.${s?"json":"txt"}`,data:e,contentType:s?"application/json":"text/plain"}}).value()),d&&Vue.delete(d,"attachments"),_get(r,"extra")&&Vue.delete(r.extra,"attachments")),d){d.extra&&_.defaults(r.extra,d.extra),d.tags&&_.defaults(r.tags,d.tags),d.fingerprint&&!r.fingerprint&&Vue.set(r,"fingerprint",d.fingerprint);for(const e in d)e in r.extra||_.includes(["name","extra","tags","fingerprint"],e)||!Object.prototype.hasOwnProperty.call(d,e)||Vue.set(r.extra,e,d[e]);r.extra.recoverable&&!_.includes(r.fingerprint,"handled")&&(Vue.set(r,"fingerprint",r.fingerprint||["{{ default }}"]),r.fingerprint.push("handled"));const e=_get(r,"exception","values",0);e&&(Vue.set(e,"mechanism",e.mechanism||{type:"generic"}),Vue.set(e.mechanism,"handled",!!r.extra.recoverable));const s=_access(d,"","message","","match","call",[/ nsresult: "0x[0-9a-f]+ [^"]*"/]);s&&(Vue.set(r.extra,"recoverable",!0),Vue.set(r,"fingerprint",[s[0]])),/XMLHttpRequest Exception 101/.test(d.message)&&Vue.set(r.tags,"source","external");const i=_.find(t,e=>!(e.message&&d.message!==e.message||e.regex&&!e.regex.test(d.message)||e.prop&&!d[e.prop]||e.userAgent&&!_.includes(window.navigator.userAgent,e.userAgent)||e.prodOnly&&!window.REVIEWABLE_PROD||e.externalOnly&&"external"!==r.tags.source||e.recoverableOnly&&!_get(r,"extra","recoverable")));if(i)return!reviewableHandledErrors.has(d)&&i.fatalCondition&&a&&a.setCondition(i.fatalCondition),null}_.isString(r.extra.context)&&_.isNil(r.tags.context)&&Vue.set(r.tags,"context",r.extra.context);const p=!d||_get(r,"extra","recoverable");if(d&&o){const e=p?"hsl(33.3deg, 100%, 59.02%)":"hsl(359.58deg, 74.87%, 62.55%)";console.log(`%câ ${p?"Recoverable":"Unrecoverable"} exception`,`color: white; background-color: ${e}; font-size: 1rem; padding: 2px 8px;`,"\n",{..._.pick(r,"level","tags","fingerprint","extra","breadcrumbs"),attachments:n.attachments},"\n ",d)}if(!p&&a&&(s=!0,Promise.resolve().then(()=>{a.signalCrash(_get(r,"extra","description")||_get(d,"message")||"Unexpected error",r.tags.source,c(d,r))})),e.loggingUrl){const t=_.pick(r,"level","tags","timestamp","message");Vue.set(t,"level",t.level||"error"),r.extra&&Vue.set(t,"extra",r.extra),r.exception&&Vue.set(t,"exception",r.exception),r.breadcrumbs&&Vue.set(t,"breadcrumbs",r.breadcrumbs),fetch(e.loggingUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`)}).catch(e=>console.log("Failed to send log to server:",e))}if(!e.sentryDsn||!window.REVIEWABLE_PROD)return null;if(Vue.set(r,"level",d?r.extra.recoverable?"warning":"error":"info"),!r.user)try{const t=_access(JSON,"","parse","call",[_access(localStorage,"","getItem","call",["reviewable:session::"+e.firebase])||null],"","github");t&&Vue.set(r,"user",{id:`github:${t.id}`,username:t.username,name:t.displayName,email:t.email||null})}catch{}return l(r),r}};window.Vue.config.errorHandler=_.noop,window.Vue.config.warnHandler=function(e,t,s){_.isError(e)||(e=new Error(e)),Vue.config.errorHandler(e,t,s)},Sentry.init(d),Sentry.setTag("firetruss",Truss.VERSION),Sentry.setTag("datastore",e.firebase),Sentry.setTag("env",e.env),Sentry.setTag("mode","/headless"===window.location.pathname?"headless":"interactive");const h=Sentry.captureException;return Vue.set(Sentry,"captureException",function(e,t){return e||(e=new Error("captureException called with no exception: "+e)),h.call(Sentry,e,t)}),{}},!1,!0,{filename:"src/app/sentry_config.js"}),_reviewable.define(["shared"],[],function(){"use strict";return{shared:{reviewableStatusContext:"code-review/reviewable",mergeableStatusKey:" mergeable",approvalStatusKey:" approval",allowedUploadMimeTypes:["image/png","image/jpeg","image/gif","
1image/svg+xml","image/webp","video/matroska","video/mp4","video/quicktime","video/webm"],trialDurationDays:30,retrialTimeoutDays:90,maxContributors:250,stalledDurationDays:14,publishOnPushTimeoutMinutes:30,betaUserKeys:["github:1525","github:1646896","github:68669571","github:7230906","github:269593696","github:231342075"],botUsernameRegex:/^(codex)$/i,copilotReviewerUsername:"copilot-pull-request-reviewer[bot]",copilotReviewerUsernameRegex:/^(copilot|copilot-pull-request-reviewer)(\[bot\])?$/i,commentCodeRegex:/(?:(?<![^\n\r]) {0,3}(?:>(?: {0,4}|\t)(?=[^ \t]|$)|(?:[-+*]|\d{1,9}[.)])(?: {1,4}|\t)(?=[^ \t]|$))*)(?:(`{3,})[^`\r\n]*(?:(?:\r\n|[\n\r])(?:[\s\S]*?(?:\r\n|[\n\r]))?(?<![^\n\r]) {0,3}(?:>(?: {0,4}|\t)(?=[^ \t]|$)|(?:[-+*]|\d{1,9}[.)])(?: {1,4}|\t)(?=[^ \t]|$))*\1`*[ \t]*(?=(?:\r\n|[\n\r])|$)|(?:\r\n|[\n\r])[\s\S]*|$)|(~{3,})[^\r\n]*(?:(?:\r\n|[\n\r])(?:[\s\S]*?(?:\r\n|[\n\r]))?(?<![^\n\r]) {0,3}(?:>(?: {0,4}|\t)(?=[^ \t]|$)|(?:[-+*]|\d{1,9}[.)])(?: {1,4}|\t)(?=[^ \t]|$))*\2~*[ \t]*(?=(?:\r\n|[\n\r])|$)|(?:\r\n|[\n\r])[\s\S]*|$))|(?:(?<=(?<![^\n\r]) {0,3}(?:>(?: {0,4}|\t))*(?:[-+*]|\d{1,9}[.)])(?: {1,4}|\t)[^\r\n]*(?:\r\n|[\n\r]))[ \t]+(?=[^ \t]|$))(?:(`{3,})[^`\r\n]*(?:(?:\r\n|[\n\r])(?:[\s\S]*?(?:\r\n|[\n\r]))?[ \t]*(?=[^ \t]|$)(?:>(?: {0,4}|\t)(?=[^ \t]|$)|(?:[-+*]|\d{1,9}[.)])(?: {1,4}|\t)(?=[^ \t]|$))*\3`*[ \t]*(?=(?:\r\n|[\n\r])|$)|(?:\r\n|[\n\r])[\s\S]*|$)|(~{3,})[^\r\n]*(?:(?:\r\n|[\n\r])(?:[\s\S]*?(?:\r\n|[\n\r]))?[ \t]*(?=[^ \t]|$)(?:>(?: {0,4}|\t)(?=[^ \t]|$)|(?:[-+*]|\d{1,9}[.)])(?: {1,4}|\t)(?=[^ \t]|$))*\4~*[ \t]*(?=(?:\r\n|[\n\r])|$)|(?:\r\n|[\n\r])[\s\S]*|$))|(?<![\\`])(?:\\\\)*(?:\\`)?(`+)(?!`)[\s\S]*?(?<!`)\5(?!`)|(?<![^\n\r])(?: {4}| {0,3}\t)[^\r\n]*(?=(?:\r\n|[\n\r])|$)|<code>(?:(?!<\/?code>)[\s\S])*?<\/code>/gi,directiveRegex:/(?:^|\s)[+-](?:(?:(?!(?:a|assignee|r|reviewer):)[^(\s@+-][^\s,.;]+)|(?:a|assignee|r|reviewer):@[a-z0-9_-]{1,39}(?:\[bot\]|\+[a-z0-9_-]{1,4})?(?![a-z0-9_+\-/])|\(.*?[^\\]\))/gi,mentionLikeDirectiveRegex:/[+-](?:a|assignee|r|reviewer):@[a-z0-9_-]{1,39}(?:\[bot\]|\+[a-z0-9_-]{1,4})?(?![a-z0-9_+\-/])|\/@/gi,mentionRegex:/\B@([a-z0-9_-]{1,39}(?:\[bot\]|\+[a-z0-9_-]{1,4})?)(?![a-z0-9_+\-/])/gi,dispositionKeywords:{informing:["fyi","tip","tips"],discussingInitial:["btw"],discussing:["minor","nit","nits","typo","typos"],blocking:["bug","bugs","major","hold on"],satisfied:["lgtm","done"],working:["working","will do","todo","todos"]},completionConditionInputFlags:["-review.pullRequest.target.headCommitSha","-review.pullRequest.target.branchProtected","-review.pullRequest.mergeability"],lgtbImages:["lgtb/11bee6a21d17c673.jpg","lgtb/12c319c767903d75.jpg","lgtb/15e66b01485179a4.jpg","lgtb/27d9c89250003b2a.jpg","lgtb/406f73593283b3d8.jpg","lgtb/5d22160289dd315a.jpg","lgtb/6759eb96202ccc8e.jpg","lgtb/6e0490386bb37f66.jpg","lgtb/7228c8c08dee581b.jpg","lgtb/756a594c9a2e7824.jpg","lgtb/7629a6bb1b7aa1de.jpg","lgtb/a35ec528170d2302.jpg","lgtb/a78b5408b40a9e5b.jpg","lgtb/b277fecb0d33b2a9.jpg","lgtb/bdaab974a510e324.jpg","lgtb/e7e49f527e2194dd.jpg","lgtb/f099e01b27cbc5b1.jpg","lgtb/fd239d01759e50b5.jpg"]}}},!1,!0,{filename:"src/app/shared_consts.js"}),_reviewable.define([],["truss","corpsman","config"],function(e,t,s){"use strict";const i={peek:"on",connect:"on",set:"set",update:"update",commit:"transaction"};function r(s,i){const r=_get(e,"store","services","auth"),n=Boolean(_get(r,"authFinalizationStarted")),a=s.originalUserId!==e.info.userid;Vue.set(s,"authChangedWhileRunning",s.authChangedWhileRunning||n||a);const o={finalizationStarted:n,operationUserId:s.originalUserId,currentUserId:e.info.userid,userIdChanged:a,authChangedWhileRunning:Boolean(s.authChangedWhileRunning),claimsExpires:_get(e,"info","user","claims","expires")};try{Vue.set(i,"extra",_.assign(i.extra||{},{auth:o}))}catch{}const l=i.code||i.message,c=_(l).toLower().startsWith("permission_denied");return c&&s.authChangedWhileRunning&&t.suppress(i),{authDetails:o,permissionDenied:c}}if(e.intercept("all",{onBefore:t=>{Vue.set(t,"originalUserId",e.info.userid)},onError:(e,t)=>{r(e,t)},onFailure:s=>{_.defer(()=>{let a;const o=s.error||new Error("Operation failed without setting an error"),{authDetail
1s:l,permissionDenied:c}=r(s,o);if(c)if(s.target.annotations.ignorePermissionDenied)t.markHandled(o);else if(!s.authChangedWhileRunning&&e.info.userid&&s.originalUserId===e.info.userid&&"on"!==s.method&&"once"!==s.method&&!1!==s.target.annotations.debugPermissionDenied){const t=n("commit"===s.method?o.committedValue:s.operand);a=e.store.queues.requests.send({action:"debugFirebase",debugFirebase:{claims:{aid:_get(e,"info","user","claims","aid")||null,expires:_get(e,"info","user","claims","expires")||null},method:i[s.method],path:s.target.path,value:t}},{fireAndForget:!0})}if(/github error 401/i.test(o.message)&&(t.markHandled(o),e.store.services.auth.invalidateGitHubToken(/bad credentials/i.test(o.message))),!reviewableHandledErrors.has(o))return(a||Promise.resolve()).then(()=>{Sentry.captureException(o,{extra:{auth:l,firetruss:{method:s.method,opType:s.type,target:s.target.toString(),tries:s.tries,guarded:_get(s,"warden","guarded"),verdict:_get(s,"warden","verdict"),permissionTickets:_get(s,"warden","permissionTickets"),claims:_get(e,"info","user","claims")}}})})})}}),!s.prod){const a=function(){try{document.hidden||e.checkObjectsForRogueProperties()}catch(e){Sentry.captureException(e)}setTimeout(a,1e4)};setTimeout(a,1e4)}function n(e){return _.isNil(e)?"â":_.isObject(e)?_.mapValues(e,n):e}if(s.encryptionEnabled){let o;function l(){o=e.connect(_ref(e,"child","store","system","keyCheck"))}e.intercept("read",{onFailure:i=>{"WRONG_KEY"===i.error.firecrypt&&i.target.isEqual(_ref(e,"child","store","system","keyCheck"))&&(t.markHandled(i.error),s.encryptionAesKey?t.forceUpgrade():e.store.services.auth.logout("stalekey"))}}),s.encryptionAesKey?l():e.observe(()=>e.info.userid,e=>{e&&!o?l():!e&&o&&(o.destroy(),o=null)})}return{}},!1,!0,{filename:"src/app/truss_guards.js"}),_reviewable.define(["truss"],["config","debug","fallBackToDedicatedWorkers"],function(e,t,s){"use strict";t.firebase&&Truss.enableLogging(!0),Truss.connectWorker(window.trussWorker,e.firebaseConfig).catch(Sentry.captureException),Truss.preExpose("configureCompression"),Truss.preExpose("configureEncryption"),Truss.worker.configureCompression(e.compressionEnabled?"deflate":"none"),e.encryptionEnabled?e.encryptionAesKey?Truss.worker.configureEncryption("aes-siv",e.encryptionAesKey).then(()=>{Sentry.addBreadcrumb({category:"auth",message:"Encryption key available"})},Sentry.captureException):Truss.worker.configureEncryption("notready",void 0,void 0,{default:!0}).then(()=>{Sentry.addBreadcrumb({category:"auth",message:"Encryption key unavailable"})},Sentry.captureException):Truss.worker.configureEncryption("none").catch(Sentry.captureException);const i=new Truss(e.firebaseUrl);return i.throttleRemoteDataUpdates(50),Vue.use(Truss.ComponentPlugin,{truss:i}),i.intercept("all",{onBefore:e=>{if(!_get(i,"store","services","warden"))return i.when(()=>_get(i,"store","services","warden")).then(t=>t._beginOperation(e))}}),setTimeout(()=>{void 0===i.info.userid&&s(window.trussWorker)},5e3),window.truss=i,t.model&&i.intercept("write",{onBefore:e=>{console.log(e.method,e.target.path,e.operand)}}),{truss:i}},!1,!0,{filename:"src/app/truss.js"}),_reviewable.define(["fallBackToDedicatedWorkers"],["safeStorage"],function(e){"use strict";let t=!1;return{fallBackToDedicatedWorkers:function(s){if(t||"/headless"===window.location.pathname||!window.SharedWorker||!(s instanceof window.SharedWorker))return;let i=!0;e.local.setItem("reviewable:avoid_shared_worker",Date.now()+864e5,()=>{i=!1}),i&&(t=!0,window.location.reload())}}},!1,!0,{filename:"src/app/worker_fallback.js"}),_reviewable.bootstrap("00_start_bootstrap_timer.js",[],function(){"use strict";try{_access(window,"","performance","","mark","call",["bootstrapStart"])}catch(e){console.error("Failed to start bootstrap timer:",e)}},[]),_reviewable.bootstrap("01_apply_monkeypatches_and_polyfills.js",[],function(){},["src/fixes/patch_anime.js","src/fixes/patch_atob.js","src/fixes/patch_vue_render_watcher.js","src/fixes/install_lodash_mixins.js","src/fixes/polyfill_scheduler.js"]),_reviewable.bootstrap("02_initialize_sentry.js",[],function(){},["src/app/sentry_config.js"]),_reviewable.bootstrap("03_verify_worker.js",[],function(){"use strict";const e=window._reviewable.reportBootstrapError;if(window.reportWorkerError=t=>e(t,"web worker"),window.workerError)throw window.workerError;if(!window.trussWorker||!window.diffWorker)throw new Error("Web workers are not available")},[]),_reviewable.bootstrap("10_initialize_truss.js",["truss"],function(e){"use strict";window._reviewable.mountModels(e)},[]),_reviewable.bootstrap("11_guard_truss.js",[],function(){},["src/app/truss_guards.js"]),_reviewable.bootstrap("20_initialize_vue.js",["corpsman","session","analytics","config","truss","refReadyPlugin","globalHoverDetectionPlugin"],function(e,t,s,i,r,n,a){"use strict";_.assign(t,{corpsman:e,auth:r.store.services.auth,analytics:s,config:i}),Vue.prototype.$session=t,window._reviewable.realizeEager(),window._reviewable.registerFilters(Vue),Vue.use(vueTouchEvents),Vue.use(VueElementSpy),Vue.use(n),Vue.use(a),Vue.component("vue-slider-component",window["vue-slider-component"]),Vue.component("vue-upload-component",VueUploadComponent)},[]),_reviewable.bootstrap("29_stop_bootstrap_timer.js",[],function(){"use strict";setTimeout(()=>{try{_access(window,"","performance","","mark","call",["bootstrapEnd"])}catch(e){console.error("Failed to end bootstrap timer:",e)}},0)},[]),_reviewable.bootstrap("30_request_extra_scopes.js",["truss"],function(e){"use strict";const t=window.location.search.match(/[?&]scopes=(.*?)(&|$)/),s=t?t[1].split(","):[];if(s.length){const t=e.store.services.auth;t.login().then(()=>t.login(s)).catch(e=>{console.error("Failed to request extra GitHub scopes:",e);try{Sentry.captureException(e,{tags:{source:"bootstrap"},extra:{context:"30_request_extra_scopes.js"}})}catch(e){console.error("Failed to report extra-scope error:",e)}})}},[]),_reviewable.bootstrap("35_register_global_hotkeys.js",["bus","hotkeys"],function(e,t){"use strict";function s(s,i,r){let n;if(r){n=["INPUT","SELECT","TEXTAREA"];const t=r;
1r=function(s,i){if(_.includes(n,(s.target||s.srcElement).nodeName.toUpperCase())&&!/(ctrl|command|mod)\+|f\d+/.test(i))return;s.preventDefault();const r={prevented:!1,callback:t};return e.allowHotkey(r),r.prevented?void 0:t.apply(null,arguments)}}return t.add(s,i,r,n)}function i(){e.showGuideMap()}i.allowOnGuideMap=!0,s(["f1","h"],"Toggle guide overlay",i),s(["?","ctrl+/"],"Toggle keyboard shortcuts list",t.toggleCheatSheet),e.allowHotkey.react(e=>{t.helpVisible&&e.callback!==t.toggleCheatSheet&&(e.prevented=!0)},{scope:null})},[]),_reviewable.bootstrap("40_initialize_hubkit.js",[],function(){},["src/app/hubkit_config.js"]),_reviewable.bootstrap("50_start_router.js",["router","routes"],function(e,t){"use strict";e.start(t),new Vue({render:e=>e(Vue.component("AppRoot"))}).$mount("#reviewable-app"),window.reportWorkerError=e=>Sentry.captureException(e),delete window.workerError},[]),_reviewable.bootstrap("60_expose_console_api.js",[],function(){},["src/app/console_api.js"]),_reviewable.bootstrap("65_sync_user_timezone.js",["truss","router"],function(e,t){"use strict";function s(){if(!e.info.userid)return;const t=(new Intl.DateTimeFormat).resolvedOptions().timeZone;_ref(e,"child","store","users",e.info.userid,"timezone").set(t)}e.observe(()=>e.info.userid,s),t.afterChange(s,null)},[]),_reviewable.bootstrap("99_cleanup_registry.js",[],function(){"use strict";delete window._reviewable},[]),_reviewable.define([],[],function(){"use strict";const e=_.setWith,t=_.set;return _.mixin({index:(e,t)=>(t=t||"index",_.forEach(e,(e,s)=>{Vue.set(e,t,s)}),e),onlyOneContains:(e,t,s)=>_.includes(e,s)!==_.includes(t,s),sign:e=>e?e<0?-1:1:0,clamp:(e,t,s)=>(void 0===s&&(s=t,t=void 0),void 0!==t&&(e=Math.max(e,t)),void 0!==s&&(e=Math.min(e,s)),e),chunkBy(e,t,s){if(_.isEmpty(e))return[];s=s||_.constant(1);const i=[];let r=[],n=0;return _.forEach(e,e=>{const a=s(e);n>0&&n+a>t&&(i.push(r),r=[],n=0),r.push(e),n+=a}),n&&i.push(r),i},oneOf(){const e=_.toArray(arguments);return t=>_.includes(e,t)},setWith:(t,s,i,r)=>(_.isArray(s)||(s=(s+"").replace(/~/g,"")),e(t,s,i,r)),set:(e,s,i)=>(_.isArray(s)||(s=(s+"").replace(/~/g,"")),t(e,s,i))}),{}},!1,!0,{filename:"src/fixes/install_lodash_mixins.js"}),_reviewable.define([],[],function(){"use strict";const e=window.anime;return window.anime=function(t){t.begin&&Vue.set(t,"begin",_.once(t.begin));const s=t.done?_.once(t.done):_.noop;if(t.begin||t.done||t.update||t.change){const e=t.complete;Vue.set(t,"complete",i=>{0===t.duration&&Vue.set(i,"currentTime",0),t.begin&&t.begin(i),Vue.set(i,"progress",100),t.update&&t.update(i),t.change&&t.change(i),e&&e(i),s&&s()})}Vue.delete(t,"done");const i=e(t),r=i.finished;return Vue.set(i,"finished",new Promise(e=>{let t;const s=_.delay(()=>{t=setInterval(()=>{_.some(window.anime.running,e=>e===i)||(clearInterval(t),e(i))},50)},i.duration);r.then(()=>{clearTimeout(s),clearInterval(t),e(i)})})),i.finished.then(()=>{s()}),i},_.forOwn(e,(e,t)=>{window.anime[t]=e}),{}},!1,!0,{filename:"src/fixes/patch_anime.js"}),_reviewable.define([],[],function(){"use strict";if(window.atob){const e=window.atob;window.atob=t=>e(t.replace(/-/g,"+").replace(/_/g,"/"))}return{}},!1,!0,{filename:"src/fixes/patch_atob.js"}),_reviewable.define([],[],function(){"use strict";const e=new Vue,t=e.$watch(_.noop,_.noop),s=e._watchers||e._scope.effects,i=Object.getPrototypeOf(s[s.length-1]),r=i.get;return Vue.set(i,"get",function(){try{return r.call(this)}catch(e){if(this.vm._watcher!==this||!Vue.config.errorHandler)throw e;Vue.config.errorHandler(e,this.vm,"uncaught render error")}}),t(),e.$destroy(),{}},!1,!0,{filename:"src/fixes/patch_vue_render_watcher.js"}),_reviewable.define([],[],function(){"use strict";return _.isUndefined(window.scheduler)&&(window.scheduler={}),_.isFunction(window.scheduler.yield)||(window.scheduler.yield=()=>new Promise(e=>setTimeout(e,0))),_.isFunction(window.scheduler.postTask)||(window.scheduler.postTask=async(e,t={})=>new Promise((s,i)=>{setTimeout(async()=>{try{if(_get(t,"signal","aborted"))return void i(new DOMException("Task was aborted","AbortError"));const r=await e();if(_get(t,"signal","aborted"))return void i(new DOMException("Task was aborted","AbortError"));s(r)}catch(e){i(e)}},0)})),{}},!1,!0,{filename:"src/fixes/polyfill_scheduler.js"}),_reviewable.define(["defaultBindings"],[],function(){"use strict";return{defaultBindings:[["f","Show next/latest diffs","setProposedDiffBounds()"],[null,"Diff all changes","setDiffBounds('full')"],[null,"Diff unreviewed changes","setDiffBounds('unreviewed')"],["n","Next unreviewed file","nextUnreviewedFile()"],["p","Previous unreviewed file","prevUnreviewedFile()"],["shift+n","Next changed file","nextChangedFile()"],["shift+p","Previous changed file","prevChangedFile()"],[null,"Next visible file","nextVisibleFile()"],[null,"Previous visible file","prevVisibleFile()"],[null,"Next file","nextFile()"],[null,"Previous file","prevFile
1()"],[null,"First unreviewed file","firstUnreviewedFile()"],[null,"Last unreviewed file","lastUnreviewedFile()"],[null,"First changed file","firstChangedFile()"],[null,"Last changed file","lastChangedFile()"],[null,"First visible file","firstVisibleFile()"],[null,"Last visible file","lastVisibleFile()"],[null,"First file","firstFile()"],[null,"Last file","lastFile()"],["x","Mark file as reviewed / unreviewed","toggleCurrentFileReviewed()"],[null,"Mark file as reviewed and advance","markFileReviewedAndAdvance()"],[null,"Mark file as reviewed and retreat","markFileReviewedAndRetreat()"],["shift+x","Mark all files as reviewed","setGlobalReviewed()"],["j","Next unreplied comment","nextUnrepliedDiscussion()"],["k","Previous unreplied comment","prevUnrepliedDiscussion()"],[null,"Next comment","nextDiscussion()"],[null,"Previous comment","prevDiscussion()"],["shift+j","Next unresolved comment","nextUnresolvedDiscussion()"],["shift+k","Previous unresolved comment","prevUnresolvedDiscussion()"],[null,"Next unresolved comment without draft reply","nextUnresolvedDiscussionWithoutDraft()"],[null,"Previous unresolved comment without draft reply","prevUnresolvedDiscussionWithoutDraft()"],[null,"Next comment with the given disposition","nextDiscussionWithDisposition('blocking')"],[null,"Previous comment with the given disposition","prevDiscussionWithDisposition('mentioned')"],[null,"Next draft","nextDraft()"],[null,"Previous draft","prevDraft()"],[null,"First unreplied comment","firstUnrepliedDiscussion()"],[null,"Last unreplied comment","lastUnrepliedDiscussion()"],[null,"First comment","firstDiscussion()"],[null,"Last comment","lastDiscussion()"],[null,"First unresolved comment","firstUnresolvedDiscussion()"],[null,"Last unresolved comment","lastUnresolvedDiscussion()"],[null,"First unresolved comment without draft reply","firstUnresolvedDiscussionWithoutDraft()"],[null,"Last unresolved comment without draft reply","lastUnresolvedDiscussionWithoutDraft()"],[null,"First comment with the given disposition","firstDiscussionWithDisposition('dismissed')"],[null,"Last comment with the given disposition","lastDiscussionWithDisposition('discussing')"],[null,"First draft","firstDraft()"],[null,"Last draft","lastDraft()"],[".","Next item that needs your attention","nextChangedFileOrUnrepliedDiscussion()"],[",","Previous item that needs your attention","prevChangedFileOrUnrepliedDiscussion()"],[null,"First item that needs your attention","firstChangedFileOrUnrepliedDiscussion()"],[null,"Last item that needs your attention","lastChangedFileOrUnrepliedDiscussion()"],[["r","enter"],"Reply to comment","replyToCurrentDiscussion()"],["y","Accept or acknowledge comment","acknowledgeCurrentDiscussion()"],[null,'Set disposition to "discussing"',"setCurrentDiscussionDisposition('discussing')"],[null,'Set disposition to "satisfied"',"setCurrentDiscussionDisposition('satisfied')"],[null,'Set disposition to "blocking"',"setCurrentDiscussionDisposition('blocking')"],[null,'Set disposition to "working"',"setCurrentDiscussionDisposition('working')"],[null,"Copy current file link","copyFileLink()"],[null,"Copy current discussion link","copyDiscussionLink()"],[null,"Copy current file path","copyFilePath()"],[null,"Open current file in editor","openFileInEditor()"],[null,"View current diff on GitHub","viewDiffOnGitHub()"],[null,"Open current file on GitHub","openFileOnGitHub()"],[null,"Edit current file on GitHub","editFileOnGitHub()"],["mod+shift+o","Show / hide older comments","toggleCurrentDiscussionOlderComments()"],[null,"Show and expand all comments","showHideAllComments(true)"],[null,"Collapse all comments","showHideAllComments(false)"],["mod+shift+p","Toggle draft preview","toggleCurrentDraftPreview()"],["mod+shift+e","Create draft code block","createCodeblockInCurrentDraft()"],[null,"Delete comment","deleteDraft()"],[null,"Publish current comment","sendCurrentComment()"],[null,"Publish all comments","publish()"],[null,"Merge pull request","merge()"],[null,"Show reviewer avatars in file matrix","toggleReviewerAvatars()"],[null,"Go to the file matrix","visit('fileMatrix')"],[null,"Go to the discussion matrix","visit('discussionMatrix')"],[null,"Go to the participants panel","visit('participants')"],[null,"Go to the checks panel","visit('checks')"],[null,"Go to the diffs panel","visit('diffControls')"],[null,"Go to the conclusion panel","visit('publish')"],[null,"Copy head branch name","copyHeadBranch()"],[null,"Edit PR's base branch","editBaseBranch()"],[null,"Return to reviews dashboard","navigate('/reviews')"],[null,"Toggle account settings dropdown","toggleAccountSettings()"],[null,"Pivot the sidebar between vertical and horizontal drawers","adjustSidebar('drawer-vertical', 'drawer-horizontal')"],[null,"Toggle sidebar between the most compact form and horizontal drawer","adjustSidebar('collapsed', 'drawer-horizontal')"],[null,"Toggle the sidebar between docked and full mode","adjustSidebar( 'full', 'drawer-vertical')"],[null,"Toggle the sidebar between its most compact form and full mode","adjustSidebar('full', 'collapsed')"],[null,"Force sidebar open","adjustSidebar('full')"],[null,"Force sidebar docked","adjustSidebar('drawer-vertical')"]]}},!1,!0,{filename:"src/generated/bindings.js"}),_reviewable.define(["generatedConfig"],[],function(){"use strict";return{generatedConfig:{firebase:"reviewable",firebaseUrl:"https://reviewable.firebaseio.com",firebaseConfig:{databaseURL:"https://reviewable.firebaseio.com",apiKey:"AIzaSyDv2EitKktEvCxDdBzDvepaFcsublGUGRI",projectId:"firebase-reviewable"},env:"saas",authHostUrl:"https://api.reviewable.io",gitHubUrl:"https://github.com",gitHubApiUrl:"https://api.github.com",gitHubGistUrl:"https://gist.github.com",gitHubStatusUrl:"https://kctbh9vrtdwd.statuspage.io/api/v2/summary.json",gitHubClientId:"7da38b6fb966259af6d5",mixpanelToken:"",analyticsQueueEnabled:!1,sentryDsn:"https://[email protected]/124660",sentryHeadlessDsn:"https://[email protected]/4511369742123008",sentryDebug:!1,uploadsAllowed:!0,executorAllowed:!0,enrollmentsAllowed:!0,privateReposAllowed:!0,termsUrl:"https://github.com/Reviewable/Reviewable/blob/master/legal/terms.md",privacyUrl:"https://github.com/Reviewable/Reviewable/blob/master/legal/privacy.md",chatUrl:"",dispositionDefaults:{defaultNewDiscussionRole:"blocking",defaultNewAsAuthorDiscussionRole:"discussing",defaultJoinedDiscussionRole:"discussing",defaultJoinedAsAuthorDiscussionRole:"discussing"},publicKey:{kty:"RSA",n:"sPPb2D8fzXNAhrpjMNpqK3jVh5gls8X-lqFZEiizVck67M5W-WbQI7wU_KomkB42ApLtxTMWsTJHA-jc83jcI-lW8YF5kW0MjsOfZK-chHUcw2yPb864CFDPPHxRkkcT7039MfCn-tpdalLtGeOhOpyIelG0wdZbCr-YogWdNOPdzBeTzVfAuYysO29fl4QnZTgIEIZPz0thhrlWjq40TCD688K-ba8tZA3HM2DATIbvEARC48KRkVPcPlFZIAp79RT0rjXQKc1DA1d_k-gTB42kcr9z0fLE7Jx5sONpy3YxYm52P9RBB2-rIMX4hIjVOQKQh00hg2qZbceO7X2q7w",e:"AQAB"},build:7917,compressionEnabled:!0,slackClientEnabled:!0,agentsEnabled:!0}}},!1,!0,{filename:"src/generated/config.js"}),_reviewable.define(["encryptionTree"],[],function(){"use strict";return{encryptionTree:{system:{star:!0,cap:!0,bang:!0,keyCheck:!0,gheVersion:!0},lastExecutionTimestampByContainerName:{$:!0},queues:{github:{$:{payload:!0,statusSyncKey:!0,ref:!0,context:!0,description:!0,target_url:!0,pusher:{name:!0},member:{login:!0},organization:{login:!0},repository:{name:!0,full_name:!0,owner:{login:!0,name:!0}}
1,pull_request:{base:{ref:!0}},check_run:{name:!0,details_url:!0,app:{name:!0},output:{title:!0}},workflow_run:{name:!0,workflow_name:!0,html_url:!0}}},githubStatusSync:{$:!0},githubApprovalSync:{$:!0},githubMergeableSync:{$:!0},githubPullRequestSync:{$:!0},githubRenames:{$:{source:!0,target:!0}},webhooks:{$:!0},slackNotifications:{$:!0},reconciliation:{$:!0},reconciliationRefresh:{$:!0},memberships:{$:!0},analytics:{$:{content:!0}},requests:{$:!0},responses:{$:!0},cron:{$:{checkpointKey:!0,lastResult:!0}},refCleanup:{$:!0},masterRepoUpdate:{$:!0},permissions:{$:!0},publishOnPush:{$:!0}},identities:{$:{name:!0}},organizations:{$:!0},repositories:{$:!0},badConnections:{$:!0},reviews:{$:{core:{ownerName:!0,repoName:!0,branch:!0,branchRepoName:!0,baseBranch:!0,title:!0,stage:!0,error:!0},security:{lowerCaseOwnerName:!0,lowerCaseRepoName:!0},participants:{$:{blockerReason:!0}},requestedTeams:{$:{slug:!0,name:!0}},lastWebhook:{description:!0,pendingUsernames:!0,unreadUsernames:!0,labels:!0,requestedTeams:!0,stage:!0,error:!0},revisions:{$:{commits:{$:{title:!0}},coAuthors:{$:{name:!0,email:!0}}}},files:{$:{path:!0,group:!0}},metaFiles:{$:{path:!0}},designatedReviewers:{$:{scope:!0}},discussions:{$:{summary:{html:!0},comments:{$:{markdownBody:!0,htmlBody:!0,codeblocks:{$:{originalText:!0,suggestedText:!0,language:!0}}}}}},labels:{$:!0},milestone:!0,sentiments:{$:{comments:{$:{emojis:!0}}}},statuses:{$:{services:{$:!0}}},mergeQueueEntry:{status:{services:{$:!0}}}}},reviewIndex:{$:{owner:!0,repo:!0}},archivedReviews:{$:{payload:!0}},subscriptions:{$:{organization:!0,emuSuffix:!0}},rules:{$:!0},memberships:{$:!0},lastPushers:{$:{$:!0}},users:{$:{core:{email:!0,billingEmail:!0,public:{username:!0,displayName:!0,avatarUrl:!0,tag:{name:!0},slackAccounts:{$:!0}}},dashboardCache:{organizations:{$:!0},teams:!0,pushableRepos:!0,watchedPushableRepos:!0,starredPushableRepos:!0,watchedOrStarredPushableRepos:!0},stripe:{trialEndTimestamps:{$:!0}},index:{memberships:{$:!0},extraMentions:{$:!0}},teamMemberships:{$:!0},slackAccounts:{$:!0},slackMessages:{$:!0},settings:{lastDashboardOrganization:!0,lastAdminOrganization:!0,syntaxStylesheetUrl:!0,monospaceFont:{family:!0},lineLinkTemplate:!0,lineLinkEditor:!0,lineLinkWorkspacePath:!0,keyBindingsUrl:!0,dismissals:{repoConnectionPrompt:{$:!0},memberWelcome:{$:!0}},adminOrganization:!0},state:{$:{drafts:{$:{markdownBody:!0,htmlBody:!0,htmlBodies:{$:!0},summaryHtmlBodies:{$:!0},codeblocks:{$:{originalText:!0,suggestedText:!0,language:!0}},deletedCodeblocks:{$:{originalText:!0,suggestedText:!0,language:!0}}}},trash:{$:{$:{markdownBody:!0,htmlBody:!0,htmlBodies:{$:!0},summaryHtmlBodies:{$:!0},codeblocks:{$:{originalText:!0,suggestedText:!0,language:!0}},deletedCodeblocks:{$:{originalText:!0,suggestedText:!0,language:!0}}}}},settings:{mergeCommitMessage:!0}}}}}}}},!1,!0,{filename:"src/generated/encryption_tree.js"}),_reviewable.define(["linguistTable"],[],function(){"use strict";return{linguistTable:{".4dm":"4D",".abap":"ABAP",".abnf":"ABNF",".asc":"AsciiDoc",".ash":"ags",".aidl":"AIDL",".al":"Perl",".alg":"ALGOL",".ampl":"AMPL",".mod":"XML",".g4":"ANTLR",".apl":"APL",".dyalog":"APL",".asl":"ASL",".dsl":"ASL",".asax":"aspx",".ascx":"aspx",".ashx":"aspx",".asmx":"aspx",".aspx":"aspx",".axd":"aspx",".dats":"ATS",".hats":"ATS",".sats":"ATS",".as":"AngelScript",".adb":"Ada",".ada":"Ada",".ads":"Ada",".txt":"help",".afm":"acfm",".agda":"Agda",".ak":"Aiken",".aleo":"Aleo",".als":"Alloy",APKBUILD:"abuild",".OutJob":"altium",".PcbDoc":"altium",".PrjPCB":"altium",".SchDoc":"altium",".angelscript":"AngelScript",".antlers.html":"Antlers",".antlers.php":"Antlers",".antlers.xml":"Antlers",".apacheconf":"ApacheConf",".vhost":"Nginx",".htaccess":"ApacheConf","apache2.conf":"ApacheConf","httpd.conf":"ApacheConf",".cls":"vb6",".apex":"Apex",".trigger":"Shell",".applescript":"AppleScript",".scpt":"AppleScript",".arc":"Arc",".ets":"ArkTS",".asciidoc":"AsciiDoc",".adoc":"AsciiDoc",".aj":"AspectJ",".asm":"m68k",".a51":"Assembly",".i":"SWIG",".inc":"SourcePawn",".nas":"Nasal",".nasm":"Assembly",".s":"gas",".astro":"Astro",".asy":"Asymptote",".aug":"Augeas",".ahk":"AutoHotkey",".ah1":"AutoHotkey",".ah2":"AutoHotkey",".ahkl":"AutoHotkey",".au3":"AutoIt",".awk":"Awk",".auk":"Awk",".gawk":"Awk",".mawk":"Awk",".nawk":"Awk",".b":"Limbo",".bas":"vb6",".baml":"BAML",".bbcode":"BBCode","bird.conf":"BIRD2",".bqn":"BQN",".bal":"Ballerina",".bat":"Batchfile",".cmd":"Batchfile","gradlew.bat":"Batchfile","mvnw.cmd":"Batchfile",".bf":"HyPhy",".befunge":"Befunge",".bend":"Bend",".be":"Berry",".bib":"BibTeX",".bibtex":"BibTeX",".bicep":"Bicep",".bicepparam":"Bicep",".bs":"BrighterScript",".bison":"Bison",".bb":"Clojure",".bbappend":"BitBake",".bbclass":"BitBake",".blade":"Blade",".blade.php":"Blade",".decls":"BlitzBasic",".bmx":"BlitzMax",".blp":"Blueprint",".bsv":"Bluespec",".boo":"Boo",".bpl":"Boogie",".brs":"Brightscript",".browserslistrc":"Browserslist",browserslist:"Browserslist",".bru":"Bru",".bst":"BuildStream",".c":"C",".cats":"C",".h":"objc",".h.in":"C",".idc":"C",".cs":"Smalltalk",".cake":"CoffeeScript",".cs.pp":"csharp",".csx":"csharp",".linq":"csharp",".cpp":"cpp",".c++":"cpp",".cc":"cpp",".cp":"cpp",".cppm":"cpp",".cxx":"cpp",".h++":"cpp",".hh":"Hack",".hpp":"
1cpp",".hxx":"cpp",".inl":"cpp",".ino":"cpp",".ipp":"cpp",".ixx":"cpp",".re":"Reason",".tcc":"cpp",".tpp":"cpp",".txx":"cpp",".chs":"c2hs",".c3":"C3",".cds":"cds",".cil":"CIL",".clp":"CLIPS",".cmake":"CMake",".cmake.in":"CMake","CMakeLists.txt":"CMake",".cob":"COBOL",".cbl":"COBOL",".ccp":"COBOL",".cobol":"COBOL",".cpy":"COBOL",CODEOWNERS:"CODEOWNERS",".dae":"COLLADA",".cql":"CQL",".cson":"CSON",".css":"CSS",".csv":"CSV",".cue":"CUE",".w":"progress",".cabal":"Cabal","cabal.config":"Cabal","cabal.project":"Cabal",".caddyfile":"Caddyfile",Caddyfile:"Caddyfile",".cdc":"Cadence",".cairo":"Cairo",".mligo":"CameLIGO",".cj":"Cangjie",".carbon":"Carbon",".mss":"CartoCSS",".ceylon":"Ceylon",".chpl":"Chapel",".ch":"xBase",".crc32":"Checksums",".md2":"Checksums",".md4":"Checksums",".md5":"Checksums",".sha1":"Checksums",".sha2":"Checksums",".sha224":"Checksums",".sha256":"Checksums",".sha256sum":"Checksums",".sha3":"Checksums",".sha384":"Checksums",".sha512":"Checksums",MD5SUMS:"Checksums",SHA1SUMS:"Checksums",SHA256SUMS:"Checksums","SHA256SUMS.txt":"Checksums",SHA512SUMS:"Checksums","checksums.txt":"Checksums",cksums:"Checksums","md5sum.txt":"Checksums",".ck":"ChucK",".circom":"Circom",".cirru":"Cirru",".clw":"Clarion",".clar":"Clarity",".asp":"asp",".icl":"Clean",".dcl":"Clean",".click":"Click",".clj":"Clojure",".boot":"Clojure",".cl2":"Clojure",".cljc":"Clojure",".cljs":"Clojure",".cljs.hl":"Clojure",".cljscm":"Clojure",".cljx":"Clojure",".hic":"Clojure","riemann.config":"Clojure",".soy":"soy",".clue":"Clue",".conllu":"CoNLL",".conll":"CoNLL",".ql":"CodeQL",".qll":"CodeQL",".coffee":"CoffeeScript","._coffee":"CoffeeScript",".cjsx":"CoffeeScript",".coffee.erb":"CoffeeScript",".iced":"CoffeeScript",Cakefile:"CoffeeScript",".cfm":"ColdFusion",".cfml":"ColdFusion",".cfc":"cfc",".lisp":"NewLisp",".asd":"lisp",".cl":"OpenCL",".l":"Roff",".lsp":"NewLisp",".ny":"lisp",".podsl":"lisp",".sexp":"lisp",".cwl":"cwl",".cook":"Cooklang",".creole":"Creole",".cr":"Crystal",".orc":"Csound",".udo":"Csound",".cu":"Cuda",".cuh":"Cuda",".curry":"Curry",".cy":"Cycript",".cylc":"Cylc","suite.rc":"Cylc",".cyp":"Cypher",".cypher":"Cypher",".pyx":"Cython",".pxd":"Cython",".pxi":"Cython",".d":"Makefile",".di":"D",".d2":"D2",".com":"dcl",".dm":"DM",".dfy":"Dafny",".darcspatch":"dpatch",".dpatch":"dpatch",".dart":"Dart",".das":"Daslang",".dwl":"DataWeave",".dsc":"DenizenScript",".dhall":"Dhall",".diff":"Diff",".patch":"Diff",".dockerfile":"Dockerfile",".containerfile":"Dockerfile",Containerfile:"Dockerfile",Dockerfile:"Dockerfile",".djs":"Dogescript",".env":"Dotenv",".env.ci":"Dotenv",".env.dev":"Dotenv",".env.development":"Dotenv",".env.development.local":"Dotenv",".env.example":"Dotenv",".env.local":"Dotenv",".env.prod":"Dotenv",".env.production":"Dotenv",".env.sample":"Dotenv",".env.staging":"Dotenv",".env.template":"Dotenv",".env.test":"Dotenv",".env.testing":"Dotenv","dune-project":"Dune",".dylan":"Dylan",".dyl":"Dylan",".intr":"Dylan",".lid":"Dylan",".e":"Euphoria",".eml":"email",".mbox":"email",".ebnf":"EBNF",".ecl":"ECLiPSe",".eclxml":"ECL",".ejs":"EJS",".ect":"EJS",".ejs.t":"EJS",".jst":"EJS",".eq":"EQ",".sch":"XML",".brd":"Eagle",Earthfile:"Earthly",".eb":"Easybuild",".html":"HTML",".edge":"Edge",".edgeql":"EdgeQL",".esdl":"EdgeQL",".editorconfig":"EditorConfig",".ex":"Euphoria",".exs":"Elixir","mix.lock":"Elixir",".elm":"Elm",".elv":"Elvish",".el":"cask",".emacs":"cask",".emacs.desktop":"cask",".abbrev_defs":"cask",".gnus":"cask",".spacemacs":"cask",".viper":"cask",Cask:"cask",Eask:"cask","Project.ede":"cask",_emacs:"cask",abbrev_defs:"cask",".em":"EmberScript",".emberscript":"EmberScript",".erl":"Erlang",".app":"Erlang",".app.src":"Erlang",".es":"JavaScript",".escript":"Erlang",".hrl":"Erlang",".xrl":"Erlang",".yrl":"Erlang",Emakefile:"Erlang","rebar.config":"Erlang","rebar.config.lock":"Erlang","rebar.lock":"Erlang",".fs":"GLSL",".fsi":"fsharp",".fsx":"fsharp",".fst":"fstar",".fsti":"fstar",".flf":"FIGfont",".fir":"FIRRTL",".fx":"HLSL",".flux":"FLUX",".fpp":"Fortran",".fppi":"FPP",".factor":"Factor",".factor-boot-rc":"Factor",".factor-rc":"Factor",".fy":"Fancy",".fancypack":"Fancy",Fakefile:"Fancy",".fan":"Fantom",".dsp":"Faust",".fnl":"Fennel",".fbs":"FlatBuffers",".flix":"Flix",".ftl":"FreeMarker",".for":"Fortran",".eam.fs":"Formatted",".fth":"Forth",".4th":"Forth",".f":"Fortran",".forth":"Forth",".fr":"Frege",".frt":"Forth",".f77":"Fortran",".bi":"QuickBASIC",".ftlh":"FreeMarker",".fut":"Futhark",".gaml":"GAML",".gms":"GAMS",".g":"GAP",".gap":"GAP",".gd":"GDScript",".gi":"GAP",".tst":"Scilab",".gdb":"GDB",".gdbinit":"GDB",".gdshader":"GDSha
1der",".gdshaderinc":"GDShader",".ged":"GEDCOM",".glsl":"GLSL",".fp":"GLSL",".frag":"JavaScript",".frg":"GLSL",".fsh":"GLSL",".fshader":"GLSL",".geo":"GLSL",".geom":"GLSL",".glslf":"GLSL",".glslv":"GLSL",".gs":"JavaScript",".gshader":"GLSL",".rchit":"GLSL",".rmiss":"GLSL",".shader":"ShaderLab",".tesc":"GLSL",".tese":"GLSL",".vert":"GLSL",".vrx":"GLSL",".vs":"GLSL",".vsh":"GLSL",".vshader":"GLSL",".gn":"GN",".gni":"GN",".gsc":"GSC",".csc":"GSC",".gsh":"GSC",".gmi":"Gemini",".kid":"Genshi",".po":"pot",".pot":"pot",".feature":"Gherkin",".story":"Gherkin",".gitattributes":"gitattributes",".gitmessage":"commit",COMMIT_EDITMSG:"commit",".gitconfig":"gitconfig",".gitmodules":"gitconfig",".tgitconfig":"gitconfig","config.worktree":"gitconfig",".gleam":"Gleam",".gjs":"gjs",".gts":"gts",".glf":"Glyph",".gno":"Gno",".gp":"Gnuplot",".gnu":"Gnuplot",".gnuplot":"Gnuplot",".p":"progress",".plot":"Gnuplot",".plt":"Prolog",".go":"Go",".gohtml":"gotmpl",".gotmpl":"gotmpl",".html.tmpl":"gotmpl",".tmpl":"gotmpl",".tpl":"Smarty","_helpers.tpl":"gotmpl",".golo":"Golo",".gst":"XML",".gsx":"Gosu",".vark":"Gosu",".grace":"Grace",".gradle":"Gradle",".gf":"gf",".graphql":"GraphQL",".gql":"GraphQL",".graphqls":"GraphQL",".groovy":"Groovy",".grt":"Groovy",".gtpl":"Groovy",".gvy":"Groovy",Jenkinsfile:"Groovy",".gsp":"gsp",".gtkrc":"GtkRC",gtkrc:"GtkRC","gtkrc-2.0":"GtkRC",".cfg":"INI","haproxy.cfg":"HAProxy",".hcl":"HCL",".nomad":"HCL",".tf":"HCL",".tfvars":"HCL",".tofu":"HCL",".workflow":"XML",".hip":"HIP",".hlsl":"HLSL",".cginc":"HLSL",".fxh":"HLSL",".hlsli":"HLSL",".hocon":"HOCON",".scalafix.conf":"HOCON",".scalafmt.conf":"HOCON",".hta":"HTML",".htm":"HTML",".html.hl":"HTML",".xht":"HTML",".xhtml":"HTML",".ecr":"ecr",".html.eex":"eex",".heex":"eex",".leex":"eex",".erb":"erb",".erb.deface":"erb",".rhtml":"erb",".cshtml":"razor",".razor":"razor",".http":"HTTP",".hxml":"HXML",".hack":"Hack",".hhi":"Hack",".php":"PHP",".haml":"Haml",".haml.deface":"Haml",".handlebars":"Handlebars",".hbs":"Handlebars",".hb":"Harbour",".ha":"Hare",".hs":"Haskell",".hs-boot":"Haskell",".hsc":"Haskell",".hx":"Haxe",".hxsl":"Haxe",".q":"q",".hql":"HiveQL",".hc":"HolyC",HOSTS:"INI",hosts:"INI","hosts.txt":"hosts",".hurl":"Hurl",".hy":"Hy",".pro":"QMake",".dlm":"IDL",".ipf":"igor",".il":"ilasm",".ini":"INI",".cnf":"INI",".container":"INI",".dof":"INI",".frm":"vb6",".lektorproject":"INI",".mount":"INI",".network":"INI",".prefs":"INI",".properties":"INI",".service":"INI",".socket":"INI",".target":"INI",".timer":"INI",".url":"INI",".buckconfig":"INI",".coveragerc":"INI",".flake8":"INI",".gitreview":"INI",".pylintrc":"INI","buildozer.spec":"INI",pylintrc:"INI",vlcrc:"INI",".irclog":"irc",".weechatlog":"irc",".ispc":"ISPC",".idr":"Idris",".lidr":"Idris",".gitignore":"ignore",".agignore":"ignore",".atomignore":"ignore",".babelignore":"ignore",".bzrignore":"ignore",".ckignore":"ignore",".coffeelintignore":"ignore",".cvsignore":"ignore",".dockerignore":"ignore",".easignore":"ignore",".eleventyignore":"ignore",".eslint-ignore":"ignore",".eslintignore":"ignore",".ignore":"ignore",".markdownlintignore":"ignore",".nodemonignore":"ignore",".npmignore":"ignore",".prettierignore":"ignore",".rgignore":"ignore",".stylelintignore":"ignore",".vercelignore":"ignore",".vscodeignore":"ignore","gitignore-global":"ignore",gitignore_global:"ignore",".hexpat":"ImHex",".ijm":"ijm",".imba":"Imba",".ni":"i7",".i7x":"i7",".ink":"Ink",".io":"Io",".ik":"Ioke",".thy":"Isabelle",".ijs":"J",".j":"objectivej",".jcl":"JCL",".flex":"JFlex",".jflex":"JFlex",".json":"JSON",".4DForm":"JSON",".4DProject":"JSON",".avsc":"JSON",".geojson":"JSON",".gltf":"JSON",".har":"JSON",".ice":"Slice",".JSON-tmLanguage":"JSON",".json.example":"JSON",".jsonl":"JSON",".mcmeta":"JSON",".sarif":"JSON",".slnlaunch":"JSON",".tact":"Tact",".tfstate":"JSON",".tfstate.backup":"JSON",".topojson":"JSON",".webapp":"JSON",".webmanifest":"JSON",".yy":"Yacc",".yyp":"JSON",".all-contributorsrc":"JSON",".arcconfig":"JSON",".auto-changelog":"JSON",".c8rc":"JSON",".htmlhintrc":"JSON",".imgbotconfig":"JSON",".nycrc":"JSON",".releaserc":"YAML",".secrets.baseline":"JSON",".tern-config":"JSON",".tern-project":"JSON",".watchmanconfig":"JSON","MODULE.bazel.lock":"JSON","Package.resolved":"JSON","Pipfile.lock":"JSON","bun.lock":"JSON","composer.lock":"JSON","deno.lock":"JSON","flake.lock":"JSON","mcmod.info":"JSON",".jsonc":"jsonc",".code-snippets":"jsonc",".code-workspace":"jsonc",".hujson":"jsonc",".sublime-build":"jsonc",".sublime-color-scheme":"jsonc",".sublime-commands":"jsonc",".sublime-completions":"jsonc",".sublime-keymap":"jsonc",".sublime-macro":"jsonc",".sublime-menu":"jsonc",".sublime-mousemap":"jsonc",".sublime-project":"jsonc",".sublime-settings":"jsonc",".sublime-theme":"jsonc",".sublime-workspace":"jsonc",".sublime_metrics":"jsonc",".sublime_session":"jsonc",".tsconfig.json":"jsonc",".babelrc":"jsonc",".devcontainer.json":"jsonc",".eslintrc":"YAML",".eslintrc.json":"jsonc",".jscsrc":"jsonc",".jshintrc":"jsonc",".jslintrc":"jsonc",".oxlintrc.json":"jsonc",".swcrc":"jsonc","api-extractor.json":"jsonc","devcontainer.json":"jsonc","jsconfig.json":"jsonc","language-configuration.json":"jsonc","tsconfig.json":"jsonc","tslint.json":"jsonc",".json5":"JSON5",".jsonld":"JSONLD",".jq":"jq",".jac":"Jac",".jai":"Jai",".janet":"Janet",".java":"Java",".jav":"Java",".jsh":"Java",".jsp":"jsp",".tag":"jsp",".jte":"jte",".js":"JavaScript","._js":"JavaScript",".bones":"JavaScript",".cjs":"JavaScript",".es6":"JavaScript",".jake":"JavaScript",".javascript":"JavaScript",".jsb":"JavaScript",".jscad":"JavaScript",".jsfl":"JavaScript",".jslib":"JavaScript",".jsm":"JavaScript",".jspre":"JavaScript",".jss":"JavaScript",".jsx":"JavaScript",".mjs":"JavaScript",".njs":"JavaScript",".pac":"JavaScript",".sjs":"JavaScript",".ssjs":"JavaScript",".xsjs":"JavaScript",".xsjslib":"JavaScript",Jakefile:"JavaScript",".mps":"mps",".mpl":"mps",".msd":"mps",".jinja":"Jinja",".j2":"Jinja",".jinja2":"Jinja",".jison":"Jison",".ol":"Jol
1ie",".iol":"Jolie",".jsonnet":"Jsonnet",".libsonnet":"Jsonnet",".jl":"Julia",".just":"Just",".JUSTFILE":"Just",".Justfile":"Just",".justfile":"Just",JUSTFILE:"Just",Justfile:"Just",justfile:"Just",".k":"KFramework","kcl.mod":"KCL","kcl.mod.lock":"KCL",".kdl":"KDL",".krl":"KRL",".ksy":"ksy",".kak":"KakouneScript",kakrc:"KakouneScript",".ks":"Kickstart",".kicad_pcb":"pcbnew",".kicad_mod":"pcbnew",".kicad_wks":"pcbnew","fp-lib-table":"pcbnew",".kit":"Kit",".kk":"Koka",".kt":"Kotlin",".ktm":"Kotlin",".kts":"Kotlin",".csl":"XML",".kql":"Kusto",".lfe":"LFE",".ll":"LLVM",".td":"tablegen",".lol":"LOLCODE",".lsl":"LSL",".lslp":"LSL",".lvproj":"LabVIEW",".lvclass":"LabVIEW",".lvlib":"LabVIEW",".lp":"Lambdapi",".langium":"Langium",".lark":"Lark",".lasso":"Lasso",".las":"Lasso",".lasso8":"Lasso",".lasso9":"Lasso",".latte":"Latte",".lean":"lean4",".hlean":"Lean",".leo":"Leo",".less":"Less",".lex":"Lex","Lexer.x":"Lex","lexer.x":"Lex",".ligo":"LigoLANG",".ly":"LilyPond",".ily":"LilyPond",".m":"mathematica",".liquid":"Liquid",".liq":"Liquidsoap",".litcoffee":"litcoffee",".coffee.md":"litcoffee",".lhs":"lhaskell",".ls":"LoomScript","._ls":"LiveScript",Slakefile:"LiveScript",".lobster":"Lobster",".xm":"Logos",".x":"RPC",".xi":"Logos",".lgt":"Logtalk",".logtalk":"Logtalk",".lkml":"LookML",".lookml":"LookML",".lua":"Lua",".fcgi":"Shell",".nse":"Lua",".p8":"Lua",".pd_lua":"Lua",".rbxs":"Lua",".rockspec":"Lua",".wlua":"Lua",".luacheckrc":"Lua",".luau":"Luau",".mumps":"M",".m3u":"M3U",".m3u8":"M3U",".m4":"M4Sugar",".mc":"M4","configure.ac":"M4Sugar",".matlab":"MATLAB",".ms":"gas",".mcr":"MAXScript",".mdx":"MDX",".mlir":"MLIR",".mq4":"MQL4",".mqh":"MQL5",".mq5":"MQL5",".mtml":"MTML",".muf":"MUF",".m2":"Macaulay2",".mak":"Makefile",".make":"Makefile",".makefile":"Makefile",".mk":"Makefile",".mkfile":"Makefile",BSDmakefile:"Makefile",GNUmakefile:"Makefile",Kbuild:"Makefile",Makefile:"Makefile","Makefile.am":"Makefile","Makefile.boot":"Makefile","Makefile.frag":"Makefile","Makefile.in":"Makefile","Makefile.inc":"Makefile","Makefile.pc":"Makefile","Makefile.wat":"Makefile",makefile:"Makefile","makefile.sco":"Makefile",mkfile:"Makefile",".mako":"Mako",".mao":"Mako",".md":"Markdown",".livemd":"Markdown",".markdown":"Markdown",".mdown":"Markdown",".mdwn":"Markdown",".mkd":"Markdown",".mkdn":"Markdown",".mkdown":"Markdown",".ronn":"Markdown",".scd":"SuperCollider",".workbook":"Markdown","contents.lr":"Markdown",".marko":"Marko",".mask":"Mask",".maxpat":"Max",".maxhelp":"Max",".maxproj":"Max",".mxt":"Max",".pat":"Max",".metta":"MeTTa",".moo":"Moocode",".mmd":"Mermaid",".mermaid":"Mermaid","meson.build":"Meson","meson_options.txt":"Meson",".metal":"Metal",".minid":"MiniD",".yaml":"YAML",".yml":"YAML",".mzn":"MiniZinc",".mint":"Mint",".druby":"Mirah",".duby":"Mirah",".mirah":"Mirah",".mo":"Motoko",".mojo":"XML",".monkey":"Monkey",".monkey2":"Monkey",".mbt":"MoonBit","moon.mod":"MoonBit","moon.pkg":"MoonBit",".moon":"MoonScript",".x68":"m68k",".move":"Move",".muse":"Muse",".mustache":"Mustache",".myt":"Myghty",".nasl":"NASL",".ncl":"XML",".neon":"NEON",".nl":"NewLisp",".npmrc":"npmrc",".nsi":"NSIS",".nsh":"NSIS",".nss":"NWScript",".ne":"Nearley",".nearley":"Nearley",".n":"Roff",".axs":"NetLinx",".axi":"NetLinx",".nlogo":"NetLogo",".nf":"Nextflow","nextflow.config":"Nextflow",".nginx":"Nginx",".nginxconf":"Nginx","nginx.conf":"Nginx",".nim":"Nim",".nim.cfg":"Nim",".nimble":"Nim",".nimrod":"Nim",".nims":"Nim","nim.cfg":"Nim",".ninja":"Ninja",".nit":"Nit",".nix":"Nix",".nr":"Roff",".nu":"Nushell",Nukefile:"Nu",".numpy":"NumPy",".numpyw":"NumPy",".numsc":"NumPy",".njk":"Nunjucks",".ml":"sml",".eliom":"OCaml",".eliomi":"OCaml",".ml4":"OCaml",".mli":"OCaml",".mll":"OCaml",".mly":"OCaml",".ob2":"Oberon",".objdump":"ObjDump",".sj":"objectivej",".odin":"Odin",".omgrofl":"Omgrofl",".opa":"Opa",".opal":"Opal",".opencl":"OpenCL",".qasm":"OpenQASM",".scad":"OpenSCAD",".fea":"AFDKO",".ackrc":"opts",".rspec":"opts",".yardopts":"opts",ackrc:"opts","mocha.opts":"opts",".org":"Org",".opy":"OverPy",".overpassql":"OverpassQL",".ox":"Ox",".oxh":"Ox",".oxo":"Ox",".oxygene":"Oxygene",".oz":"Oz",".p4":"P4",".pddl":"PDDL",".aw":"PHP",".ctp":"PHP",".php3":"PHP",".php4":"PHP",".php5":"PHP",".phps":"PHP",".phpt":"PHP",".php_cs":"PHP",".php_cs.dist":"PHP",Phakefile:"PHP",".pls":"PLSQL",".bdy":"PLSQL",".ddl":"SQL",".fnc":"PLSQL",".pck":"PLSQL",".pkb":"PLSQL",".pks":"PLSQL",".plb":"PLSQL",".plsql":"PLSQL",".prc":"SQL",".spc":"PLSQL",".sql":"TSQL",".tpb":"PLSQL",".tps":"PLSQL",".trg":"PLSQL",".vw":"PLSQL",".pgsql":"PLpgSQL",".pov":"povray",".pact":"Pact",".pan":"Pan",".psc":"Papyrus",".parrot":"Parrot",".pasm":"pasm",".pir":"pir",".pas":"Pascal",".dfm":"Pascal",".dpr":"Pascal",".lpr":"Pascal",".pascal":"Pascal",".pp":"Puppet",".pwn":"Pawn",".sma":"Pawn",".pep":"Pep8",".pl":"Raku",".cgi":"Shell",".perl":"Perl",".ph":"Perl",".plx":"Perl",".pm":"xpm",".psgi":"Perl",".t"
1:"Turing",".latexmkrc":"Perl","Makefile.PL":"Perl",Rexfile:"Perl",ack:"Perl",cpanfile:"Perl",latexmkrc:"Perl",".pic":"Pic",".chem":"Pic",".pkl":"Pkl",".pig":"PigLatin",".pike":"Pike",".pmod":"Pike",".puml":"PlantUML",".iuml":"PlantUML",".plantuml":"PlantUML",".pod":"Pod",".pogo":"PogoScript",".polar":"Polar",".pony":"Pony",".por":"Portugol",".pcss":"PostCSS",".postcss":"PostCSS",".ps":"PostScript",".eps":"PostScript",".epsi":"PostScript",".pfa":"PostScript",".pq":"powerquery",".pbt":"PowerBuilder",".sra":"PowerBuilder",".sru":"PowerBuilder",".srw":"PowerBuilder",".ps1":"PowerShell",".psd1":"PowerShell",".psm1":"PowerShell",".praat":"Praat",".prisma":"Prisma",".pde":"Processing",Procfile:"Procfile",".prolog":"Prolog",".yap":"Prolog",".pml":"Promela",".proto":"proto",".jade":"Pug",".pug":"Pug",Modulefile:"Puppet",".pb":"PureBasic",".pbi":"PureBasic",".purs":"PureScript",".arr":"Pyret",".py":"Python",".gyp":"Python",".gypi":"Python",".lmi":"Python",".py3":"Python",".pyde":"Python",".pyi":"Python",".pyp":"Python",".pyt":"Python",".pyw":"Python",".rpy":"renpy",".spec":"Ruby",".tac":"Python",".wsgi":"Python",".xpy":"Python",".gclient":"Python",DEPS:"Python",SConscript:"Python",SConstruct:"Python",wscript:"Python",".qs":"qsharp",".qml":"QML",".qbs":"QML",".pri":"QMake",m3makefile:"Quake",m3overrides:"Quake",".qc":"QuakeC",".qnt":"Quint",".r":"Rez",".rd":"R",".rhistory":"R",".rsx":"R",".Rapp.history":"R",".Rhistory":"R",".Rprofile":"R","expr-dist":"R",".raml":"RAML",".rascript":"RAScript",".rbs":"RBS",".rdoc":"RDoc",".rbbas":"REALbasic",".rbfrm":"REALbasic",".rbmnu":"REALbasic",".rbres":"REALbasic",".rbtbar":"REALbasic",".rbuistate":"REALbasic",".rexx":"REXX",".pprx":"REXX",".rex":"REXX",".qmd":"RMarkdown",".rmd":"RMarkdown",".ron":"RON",".msg":"rosmsg",".action":"rosmsg",".srv":"rosmsg",".rpgle":"RPGLE",".sqlrpgle":"RPGLE",".rnh":"RUNOFF",".rno":"Roff",".rkt":"Racket",".rktd":"Racket",".rktl":"Racket",".scrbl":"Racket",".rl":"Ragel",".6pl":"Raku",".6pm":"Raku",".nqp":"Raku",".p6":"Raku",".p6l":"Raku",".p6m":"Raku",".pl6":"Raku",".pm6":"Raku",".raku":"Raku",".rakumod":"Raku",".rsc":"Rascal",".raw":"raw",".res":"XML",".resi":"ReScript",".inputrc":"inputrc",inputrc:"inputrc",".rei":"Reason",".religo":"ReasonLIGO",".reb":"Rebol",".r2":"Rebol",".r3":"Rebol",".rebol":"Rebol",".red":"Red",".reds":"Redscript",".cw":"Redcode",_redirects:"redirects",".regexp":"regexp",".regex":"regexp",".rs":"XML",".rsh":"RenderScript",".rhai":"Rhai",".ring":"Ring",".riot":"Riot",".robot":"RobotFramework",".resource":"RobotFramework","robots.txt":"robots",".roc":"Roc",".v":"Verilog",".coq":"coq",".roff":"Roff",".1":"Roff",".1in":"Roff",".1m":"Roff",".1x":"Roff",".2":"Roff",".3":"Roff",".3in":"Roff",".3m":"Roff",".3p":"Roff",".3pm":"Roff",".3qt":"Roff",".3x":"Roff",".4":"Roff",".5":"Roff",".6":"Roff",".7":"Roff",".8":"Roff",".9":"Roff",".man":"Roff",".mdoc":"Roff",".me":"Roff",".tmac":"Roff",eqnrc:"Roff",mmn:"Roff",mmt:"Roff",troffrc:"Roff","troffrc-end":"Roff",".rg":"Rouge",".rb":"Ruby",".builder":"Ruby",".eye":"Ruby",".gemspec":"Ruby",".god":"Ruby",".jbuilder":"Ruby",".mspec":"Ruby",".pluginspec":"XML",".podspec":"Ruby",".prawn":"Ruby",".rabl":"Ruby",".rake":"Ruby",".rbi":"Ruby",".rbuild":"Ruby",".rbw":"Ruby",".rbx":"Ruby",".ru":"Ruby",".ruby":"Ruby",".thor":"Ruby",".watchr":"Ruby",".irbrc":"Ruby",".pryrc":"Ruby",".simplecov":"Ruby",Appraisals:"Ruby",Berksfile:"Ruby",Brewfile:"Ruby",Buildfile:"Ruby",Capfile:"Ruby",Dangerfile:"Ruby",Deliverfile:"Ruby",Fastfile:"Ruby",Gemfile:"Ruby",Guardfile:"Ruby",Jarfile:"Ruby",Mavenfile:"Ruby",Podfile:"Ruby",Puppetfile:"Ruby",Rakefile:"Ruby",Snapfile:"Ruby",Steepfile:"Ruby",Thorfile:"Ruby",Vagrantfile:"Ruby",buildfile:"Ruby",".rs.in":"Rust",".sas":"SAS",".scss":"SCSS",".te":"sepolicy",file_contexts:"sepolicy",genfs_contexts:"sepolicy",initial_sids:"sepolicy",port_contexts:"sepolicy",security_classes:"sepolicy",".sip":"SIP",".smt2":"SMT",".smt":"SMT",".z3":"SMT",".sparql":"SPARQL",".rq":"SPARQL",".sqf":"SQF",".hqf":"SQF",".mysql":"SQL",".tab":"SQL",".udf":"SQL",".viw":"SQL",".db2":"SQLPL","ssh-config":"sshconfig",ssh_config:"sshconfig",sshconfig:"sshconfig","sshconfig.snip":"sshconfig","sshd-config":"sshconfig",sshd_config:"sshconfig",".star":"Starlark",".stl":"STL",".ston":"STON",".svg":"SVG",".swg":"SWIG",".swig":"SWIG",".sage":"Sage",".sagews":"Sage",".sail":"Sail",".sls":"Scheme",".sass":"Sass",".scala":"Scala",".kojo":"Scala",".sbt":"Scala",".sc":"SuperCollider",".scaml":"Scaml",".scenic":"Scenic",".scm":"tsq",".sld":"Scheme",".sps":"Scheme",".ss":"Scheme",".sci":"Scilab",".sce":"Scilab",".self":"Self",".sh":"Shell",".bash":"Shell",".bats":"Shell",".command":"Shell",".ksh":"Shell",".pacscript":"Shell",".sbatch":"Shell",".sh.in":"Shell",".slurm":"Shell",".tmux":"Shell",".tool":"Shell",".zsh":"Shell",".zsh-theme":"Shell",".bash_aliases":"Shell",".bash_functions":"Shell",".bash_history":"Shell",".bash_logout":"Shell",".bash_profile":"Shell",".bashrc":"Shell",".cshrc":"Shell",".envrc":"Shell",".flaskenv":"Shell",".kshrc":"Shell",".login":"Shell",".profile":"Shell",".tmux.conf":"Shell",".xinitrc":"Shell",".xsession":"Shell",".zlogin":"Shell",".zlogout":"Shell",".zprofile":"Shell",".zshenv":"Shell",".zshrc":"Shell","9fs":"Shell",PKGBUILD:"Shell",bash_aliases:"Shell",bash_logout:"Shell",bash_profile:"Shell",bashrc:"Shell",cshrc:"Shell",gradlew:"Shell",kshrc:"Shell",login:"Shell",man:"Shell",mvnw:"Shell",profile:"Shell","tmux.conf":"Shell",xinitrc:"Shell",xsession:"Shell",zlogin:"Shell",zlogout:"Shell",zprofile:"Shell",zshenv:"Shell",zshrc:"Shell",".shellcheckrc":"shellcheckrc",".sh-session":"ShellSession",".shen":"Shen",".sieve":"Sieve",".sfv":"sfv",Singularity:"Singularity",".slang":"Slang",".sl":"Slash",".slim":"Slim",".slint":"Slint",".cocci":"SmPL",".smali":"Smali",".st":"StringTemplate",".smithy":"Smithy",".smk":"Snakemake",".snakefile":"Snakemake",Snakefile:"Snakemake",".sol":"Solidity","Android.bp":"Soong",".sp":"SourcePawn",".nut":"Squirrel",".stan":"Stan",".fun":"sml",".sig":"sml",".sml":"sml",".bzl":"Starlark",BUCK:"Starlark",BUILD:"Starlark","BUILD.bazel":"Starlark","MODULE.bazel":"Starlark",Tiltfile:"Starlark",WORKSPACE:"Starlark","WORKSPACE.bazel":"Starlark","WORKSPACE.bzlmod":"Starlark",".do":"Stata",".ado":"Stata",".doh":"Stata",".ihlp":"Stata",".mata":"Stata",".matah":"Stata",".sthlp":"Stata",".styl":"Stylus",".sss":"SugarSS",".surql":"SurrealQL",".svelte":"Svelte",".sw":"XML",".rnw":"Sweave",".swift":"Swift",".sv":"SystemVerilog",".svh":"SystemVerilog",".vh":"SystemVerilog",".tla":"TLA",".tmdl":"TMDL",".toml":"TOML",".toml.example":"TOML","Cargo.lock":"TOML","Cargo.toml.orig":"TOML","Gopkg.lock":"TOML",Pipfile:"TOML","mise.local.lock":"TOML","mise.lock":"TOML","pdm.lock":"TOML","poetry.lock":"TOML","uv.lock":"TOML",".tsv":"TSV",".vcf":"vCard",".tsx":"XML",".txl":"TXL",".talon":"Talon",".tape":"Tape",".tcl":"Tcl",".adp":"Tcl",".sdc":"Tcl",".tcl.in":"Tcl",".tm":"Tcl",".xdc":"Tcl",owh:"Tcl",starfield:"Tcl",".tcsh":"Tcsh",".csh":"Tcsh",".tex":"TeX",".aux":"TeX",".bbx":"TeX",".cbx":"TeX",".dtx":"TeX",".ins":"TeX",".lbx":"TeX",".ltx":"TeX",".mkii":"TeX",".mkiv":"TeX",".mkvi":"TeX",".sty":"TeX",".toc":"TeX",".tea":"Tea",".tl":"tl",".texinfo":"Texinfo",".texi":"Texinfo",".txi":"Texinfo",".TextGrid":"TextGrid",".textile":"Textile",".thrift":"Thrift",".toit":"Toit",".tolk":"Tolk",torrc:"torrc",".tu":"Turing",".ttl":"Turtle",".twig":"Twig",".ts":"XML",".cts":"TypeScript",".mts":"TypeScript",".tsp":"TypeSpec",".typ":"XML",".uno":"Uno",".uc":"ucode",".ur":"UrWeb",".urs":"UrWeb",".vba":"vim",".vbs":"VBScript",".vcl":"VCL",".vhdl":"VHDL",".vhd":"VHDL",".vhf":"VHDL",".vhi":"VHDL",".vho":"VHDL",".vhs":"VHDL",".vht":"VHDL",".vhw":"VHDL",".vala":"Vala",".vapi":"Vala",".vdf":"keyvalues",".vmf":"keyvalues",".vtl":"vtl",".vto":"Vento",".veo":"Verilog",".verse":"Verse",".sd":"vespa",".snip":"SnipMate",".snippet":"SnipMate",".snippets":"SnipMate",".vim":"vim",".vimrc":"vim",".vmb":"vim",".exrc":"vim",".gvimrc":"vim",".nvimrc":"vim",_vimrc:"vim",gvimrc:"vim",nvimrc:"vim",vimrc:"vim",".vb":"vbnet",".vbhtml":"vbnet",".ctl":"vb6",".Dsr":"vb6",".volt":"Volt",".vue":"Vue",".vy":"Vyper",".wdl":"WDL",".wgsl":"WGSL",".wast":"WebAssembly",".wat":"WebAssembly",".wit":"wit",".webidl":"WebIDL",".vtt":"WebVTT",".wgetrc":"wgetrc",".whiley":"Whiley",".mediawiki":"Wikitext",".wiki":"Wikitext",".wikitext":"Wikitext",".mathematica":"mathematica",".cdf":"mathematica",".ma":"mathematica",".mt":"mathematica",".nb":"mathematica",".nbp":"mathematica",".wl":"mathematica",".wls":"mathematica",".wlt":"mathematica",".wlk":"Wollok",".wren":"Wren",".xbm":"xbm",".xpm":"xpm",".x10":"
1X10",".xc":"XC",".XCompose":"XCompose",XCompose:"XCompose",xcompose:"XCompose",".xml":"XML",".adml":"XML",".admx":"XML",".ant":"XML",".axaml":"XML",".axml":"XML",".builds":"XML",".ccproj":"XML",".ccxml":"XML",".clixml":"XML",".cproject":"XML",".cscfg":"XML",".csdef":"XML",".csproj":"XML",".ct":"XML",".depproj":"XML",".dita":"XML",".ditamap":"XML",".ditaval":"XML",".dll.config":"XML",".dotsettings":"XML",".filters":"XML",".fsproj":"XML",".fxml":"XML",".glade":"XML",".gml":"XML",".gmx":"XML",".gpx":"XML",".grxml":"XML",".hzp":"XML",".icls":"XML",".iml":"XML",".ivy":"XML",".jelly":"XML",".jsproj":"XML",".kml":"XML",".launch":"XML",".mdpolicy":"XML",".meta4":"XML",".mjml":"XML",".mm":"XML",".mxml":"XML",".natvis":"XML",".ndproj":"XML",".nproj":"XML",".nuspec":"XML",".odd":"XML",".osm":"XML",".pkgproj":"XML",".proj":"XML",".props":"XML",".ps1xml":"XML",".psc1":"XML",".pt":"XML",".pubxml":"XML",".qhelp":"XML",".rbxmx":"XML",".rdf":"XML",".resx":"XML",".rss":"XML",".scxml":"XML",".sfproj":"XML",".shproj":"XML",".slnx":"XML",".srdf":"XML",".storyboard":"XML",".sublime-snippet":"XML",".targets":"XML",".tml":"XML",".ui":"XML",".urdf":"XML",".ux":"XML",".vbproj":"XML",".vcxproj":"XML",".vsixmanifest":"XML",".vssettings":"XML",".vstemplate":"XML",".vxml":"XML",".wixproj":"XML",".wsdl":"XML",".wsf":"XML",".wxi":"XML",".wxl":"XML",".wxs":"XML",".x3d":"XML",".xacro":"XML",".xaml":"XML",".xib":"XML",".xlf":"XML",".xliff":"XML",".xmi":"XML",".xml.dist":"XML",".xmp":"XML",".xproj":"XML",".xsd":"XML",".xspec":"XML",".xul":"XML",".zcml":"XML",".classpath":"XML",".project":"XML","App.config":"XML","NuGet.config":"XML","Settings.StyleCop":"XML","Web.Debug.config":"XML","Web.Release.config":"XML","Web.config":"XML","packages.config":"XML",".xsp-config":"XPages",".xsp.metadata":"XPages",".xpl":"XProc",".xproc":"XProc",".xquery":"XQuery",".xq":"XQuery",".xql":"XQuery",".xqm":"XQuery",".xqy":"XQuery",".xs":"XS",".xslt":"XSLT",".xsl":"XSLT","xmake.lua":"Xmake",".xojo_code":"Xojo",".xojo_menu":"Xojo",".xojo_report":"Xojo",".xojo_script":"Xojo",".xojo_toolbar":"Xojo",".xojo_window":"Xojo",".xsh":"Xonsh",".xtend":"Xtend",".mir":"YAML",".reek":"YAML",".rviz":"YAML",".sublime-syntax":"YAML",".syntax":"YAML",".yaml-tmlanguage":"YAML",".yaml.sed":"YAML",".yml.mysql":"YAML",".clang-format":"YAML",".clang-tidy":"YAML",".clangd":"YAML",".gemrc":"YAML","CITATION.cff":"YAML","glide.lock":"YAML","pixi.lock":"YAML","yarn.lock":"YAML",".yang":"YANG",".yar":"YARA",".yara":"YARA",".yasnippet":"YASnippet",".y":"Yacc",".yacc":"Yacc",".yul":"Yul",".zap":"ZAP",".xzap":"ZAP",".zil":"ZIL",".mud":"ZIL",".zeek":"Zeek",".bro":"Zeek",".zs":"ZenScript",".zep":"Zephir",".zig":"Zig",".zig.zon":"Zig",".zimpl":"Zimpl",".zmpl":"Zimpl",".zpl":"Zimpl",".zmodel":"Zmodel",".curlrc":"curlrc",_curlrc:"curlrc",crontab:"crontab",".desktop":"desktop",".desktop.in":"desktop",".dircolors":"dircolors",".dir_colors":"dircolors",DIR_COLORS:"dircolors",_dir_colors:"dircolors",_dircolors:"dircolors",dir_colors:"dircolors",".ec":"eC",".eh":"eC",".edn":"edn",".fish":"fish",".hoon":"hoon",".ics":"iCalendar",".ical":"iCalendar",".kv":"kvlang",".mcfunction":"mcfunction",".svx":"mdsvex",".mu":"mupad",".nanorc":"nanorc",nanorc:"nanorc",".nc":"nesC",".ooc":"ooc",".pc":"pkgconf",".pc.in":"pkgconf",".rst":"reStructuredText",".rest":"reStructuredText",".rest.txt":"reStructuredText",".rst.txt":"reStructuredText",".sed":"sed",".templ":"templ",".wisp":"wisp",".prg":"xBase",".prw":"xBase"}}},!1,!0,{filename:"src/generated/linguist_table.js"}),_reviewable.define(["Codeblock"],["session"],function(e){"use strict";const t={m:1e3,cm:900,d:500,cd:400,c:100,xc:90,l:50,xl:40,x:10,ix:9,v:5,iv:4,i:1},s=_.keys(t),i=_.values(t);return{Codeblock:class Codeblock{constructor(){Vue.set(this,"index",void 0),Vue.set(this,"editable",!1)}get locationDiffersFromComment(){return this.originalText&&(this.fileKey||this.revisionKey||void 0!==this.revisionBase||this.line)}get effectiveRevisionKey(){return this.revisionKey||this.parley.revisionKey}get effectiveRevisionBase(){return void 0===this.revisionBase?this.parley.revisionBase:this.revisionBase}get effectiveLine(){return this.line||this.parley.line}get effectiveFile(){return _get(this,"review","files",this.fileKey||this.parley.fileKey,"revisions",this.effectiveRevisionKey,"inferred","file")}get romanIndex(){if(_.isNumber(this.index))return function(e){let t="";for(let r=0;r<s.length;r++)for(;e>=i[r];)e-=i[r],t+=s[r];return t}(this.index+1)}get summarizationText(){return this.originalText&&""===this.suggestedText?this.originalText:this.text}get mappingRequest(){const e=_get(this,"effectiveFile","revisions","nearest",_get(this,"review","core","lastRevisionKey"),"$key");if(e)return{fileKey:this.effectiveFile.$key,line:this.effectiveLine,key:void 0,discussionKey:this.$discussionKey||this.$draftKey,codeblockKey:this.$key,sourceRevisionKey:this.effectiveRevisionKey,sourceRevisionBase:this.effectiveRevisionBase,targetRevisionKey:e,targetRevisionBase:!1}}get lastRevisionLocation(){return _get(this,"effectiveFile","diff","current","mappings",_get(this,"mappingRequest","key"))}get _lineLinkContext(){return{owner:_get(this,"review","core","ownerName"),repo:_get(this,"review","core","repoName"),pr:_get(this,"review","core","pullRequestId"),path:_get(this,"effectiveFile","uriSafePath"),viewSha:_get(this,"lastRevisionLocation","commitSha"),viewLine:_get(this,"lastRevisionLocation","line"),sha:_get(this,"lastRevisionLocation","commitSha"),line:_get(this,"lastRevisionLocation","line")}}get lineLinkUrl(){if(!this.lastRevisionLocation)return;const t=e.computed.compiledLineLinkTemplate;if(!t||e.computed.lineLinkTemplateCompilationError)return null;try{return t(this._lineLinkContext)}catch{return null}}get lineLinkError(){if(this.lastRevisionLocation&&!this.lineLinkUrl){if(e.computed.lineLinkTemplateCompilationError)return`Bad template: ${e.computed.lineLinkTemplateCompilationError}`;if(!e.computed.compiledLineLinkTemplate)return"Please configure the external editor link in your account settings.";try{e.computed.compiledLineLinkTemplate(this._lineLinkContext)}catch(e){return"Bad template: "+e.toString()}}}}}},!1,!0,{filename:"src/model/_abstract/Codeblock.js"}),_reviewable.define(["CompletionConditionContext"],["bus","corpsman"],function(e,t){"use strict";const s=["lodash3","lodash4"],i=/^\s*(?:https?:\/\/[^/?#\s]+\/(?:reviews\/)?)?([^/#?\s]+)\s*\/\s*([^/#?\s]+)(?:\s*(?:#|\/(?:pull\/)?|\s)\s*(\d+)(?:\/[^?#\s]*)?(?:[?#]\S*)?)?\s*$/;return{CompletionConditionContext:class CompletionConditionContext{constructor(){Vue.set(this,"completionInitialized",!1),Vue.set(this,"conditionCode",null),Vue.set(this,"completionInfoPrNumber",null),Vue.set(this,"completionInfo",null),Vue.set(this,"_evaluatePromise",null),Vue.set(this,"evaluating",!1),Vue.set(this,"evaluationOutput",null),Vue.set(this,"ownerName",null),Vue.set(this,"repoName",null),this.$when(()=>void 0!==this.$info.userid).then(()=>this._loadCompletion())}_loadCompletion(){const e=_.debounce(this._evaluateCompletionCondition.bind(this),300);return this.$observe(()=>this.conditionCode,e),this.$observe(()=>this.completionInfo,e),this.$owner&&this.$repo||this.$observe(()=>this.completionInfoPrNumber,e),Promise.all([this._initConditionCode(),this._initCompletionInfo()]).then(()=>{this.active&&Vue.set(this,"completionInitialized",!0)})}_initConditionCode(){return Promise.resolve()}get _parsedDependencies(){return _.find(s,e=>e===_access(this,"","conditionCode","","match","call",[/^\/\/ dependencies: (.*)$/m],"",1))}get dependencies(){return this._parsedDependencies||"lodash4"}_initCompletionInfo(){const e=!!this.$owner&&!!this.$repo;let s;
1if(e)Vue.set(this,"ownerName",this.$owner),Vue.set(this,"repoName",this.$repo),s=this.completionInfoPrNumber;else{const e=_access(this,"","completionInfoPrNumber","","match","call",[i]);e?[,this.ownerName,this.repoName,s]=e:Vue.set(this,"ownerName",Vue.set(this,"repoName",null))}return s=_.isNil(s)?null:_.parseInt(s),Vue.set(this,"completionInfo",null),this.ownerName&&this.repoName&&!_.isNaN(s)?this.$store.queues.requests.send({action:"getReviewState",ownerName:this.ownerName,repoName:this.repoName,prNumber:s,code:this.conditionCode}).then(t=>{this.active&&(Vue.set(this,"completionInfo",t.state),Vue.set(this,"completionInfoPrNumber",e?t.prNumber:`${this.ownerName}/${this.repoName}#${t.prNumber}`),Vue.set(this,"evaluationOutput",{result:""}))},e=>{this.active&&(Vue.set(this,"evaluationOutput",{error:"Unable to load review state: "+e.message}),t.markHandled(e))}):(null!==this.completionInfoPrNumber&&Vue.set(this,"evaluationOutput",{error:`Invalid PR ${e?"number":"reference"}: ${this.completionInfoPrNumber}`}),Promise.resolve())}loadCompletionInfo(){Vue.set(this,"completionInitialized",!1),this._initCompletionInfo().finally(()=>{Vue.set(this,"completionInitialized",!0)})}_evaluateCompletionCondition(){if(!(this.completionInitialized&&this.completionInfo&&this.active&&this.dependencies))return;let t;e.flush(),Vue.set(this,"_evaluatePromise",null),Vue.set(this,"evaluating",!1);try{t=JSON.parse(this.completionInfo)}catch(e){return void Vue.set(this,"evaluationOutput",{error:"Unable to parse review state: "+e.toString()})}if(!_.isPlainObject(t))return void Vue.set(this,"evaluationOutput",{error:"Review state must be an object"});const s=_get(t,"pullRequest","repository");if(!(_.isString(_get(s,"owner"))&&_.trim(s.owner)&&_.isString(_get(s,"name"))&&_.trim(s.name)))return void Vue.set(this,"evaluationOutput",{error:"Review state must include nonempty strings for pullRequest.repository.owner and pullRequest.repository.name."});const r=_.trim(s.owner),n=_.trim(s.name),a=!!this.$owner&&!!this.$repo;let o=this.$owner,l=this.$repo;if(!a&&_.trim(this.completionInfoPrNumber)){const e=this.completionInfoPrNumber.match(i);if(!e)return void Vue.set(this,"evaluationOutput",{error:`Invalid PR reference: ${this.completionInfoPrNumber}. Clear the PR field to use the repository in the review state.`});[,o,l]=e}if(o&&l&&(_.toLower(r)!==_.toLower(o)||_.toLower(n)!==_.toLower(l)))return void Vue.set(this,"evaluationOutput",{error:`Review state is for ${r}/${n}, but\n`+(a?`Admin Center is editing ${o}/${l}.\nUse the Playground at /playground to test against multiple repositories.`:`the PR field specifies ${o}/${l}.\nClear the PR field to use the repository in the review state.`)});Vue.set(this,"evaluating",!0);const c=Vue.set(this,"_evaluatePromise",this.$store.queues.requests.send({action:"evaluate",ownerName:r,repoName:n,type:"completion",code:this.conditionCode,context:`{"review": ${this.completionInfo}, "dependencies": "${this.dependencies}"}`},7500).then(e=>{this.active&&c===this._evaluatePromise&&Vue.set(this,"evaluationOutput",{result:e})},e=>{this.active&&c===this._evaluatePromise&&Vue.set(this,"evaluationOutput",{error:e.message.replace(/^Error: /,"")})}).finally(()=>{this.active&&c===this._evaluatePromise&&(Vue.set(this,"_evaluatePromise",null),Vue.set(this,"evaluating",!1))}))}}}},!1,!0,{filename:"src/model/_abstract/CompletionConditionContext.js"}),_reviewable.define(["Parley"],[],function(){"use strict";return{Parley:class Parley{constructor(){Vue.set(this,"showing",0)}get targeted(){return _get(this,"review","context","navigation","targetDiscussionKey")===this.$key}get current(){return _get(this,"review","context","navigation","lastVisitedDiscussionKey")===this.$key}get file(){return _get(this,"review","files",this.fileKey,"revisions",this.revisionKey,"inferred","file")}get tracker(){return _get(this,"review","tracker",this.$key)}get locator(){const e=this.fileKey?_get(this,"file","diff","current","locators"):_get(this,"review","discussions","top","locators");return _get(e,this.$key)}get discussingWillResolve(){if(_get(this,"review","context","showDiscussions"))return!_get(this,"tracker","resolved")&&_get(this,"tracker","resolvedIf","discussing")}get satisfiedWillResolve(){if(_get(this,"review","context","showDiscussions"))return!this.tracker||!this.tracker.resolved&&_get(this,"tracker","resolvedIf","satisfied")}get blockingWillNewlyPreventResolving(){if(!_get(this,"review","context","showDiscussions"))return;const e=_get(this,"tracker","currentParticipant","disposition");return!e||"blocking"!==e&&"working"!==e}}}},!1,!0,{filename:"src/model/_abstract/Parley.js"}),_reviewable.define(["Memberships"],["session"],function(e){"use strict";return{Memberships:class Memberships{constructor(){e.globalRepoClass||Vue.set(this,"_connector",this.$connect(this,{_userMemberships:()=>_access(_ref,"call",[this.$store,"child","users","current","index","memberships"]),_memberships:()=>_access(_ref,"call",[this.$store,"children","memberships",_get(this,"_userMemberships","$keys")||[]])}))}get list(){return _(this).toArray().compact().sortBy("organization").value()}get welcome(){if(!this.$info.userid||this._connector&&!this._connector.ready)return;if(!_access(_ref,"call",[this.$store,"child","users","current","settings","dismissals","memberWelcome"],"","ready"))return;const t=_get(this,"$store","users","current","settings","dismissals","memberWelcome"),s={memberships:this.list};return e.globalRepoClass?(Vue.set(s,"requiredScopes",["public"===e.globalRepoClass.coverage?"public_repo":"repo","read:org"]),Vue.set(s,"dismissed",_get(t,"*"))):_.isEmpty(this)?Vue.set(s,"requiredScopes",[]):(Vue.set(s,"requiredScopes",[_.every(this,"publicOnly")?"public_repo":"repo","read:org"]),Vue.set(s,"dismissed",_.every(this.$keys,e=>_get(t,e)))),Vue.set(s,"offered",!_.every(s.requiredScopes,t=>e.hasScope(t))),s}dismissWelcome(){if(!this.$info.userid)return;const t=_ref(this.$store,"child","users","current","settings","dismissals","memberWelcome");return e.globalRepoClass?t.update({"*":!0}):t.update(_.mapValues(this,_.constant(!0)))}}}},!1,!0,{filename:"src/model/organizations/memberships.js",modelPath:"/memberships",modelExportName:"Memberships"}),_reviewable.define(["OrganizationCoverage"],["config","shared"],function(e,t){"use strict";const s=864e5;return{OrganizationCoverage:class OrganizationCoverage{get trialDaysRemaining(){if(this.trialEndTimestamp)return Math.round((this.trialEndTimestamp-this.$now)/s)}get trialStatus(){if(this.trialEndTimestamp)return this.trialEndTimestamp>this.$now&&this.lastWasTrial?"active":this.trialEndTimestamp+t.retrialTimeoutDays*s>this.$now?"cooldown":void 0}canUseFeature(t){return"enterprise"===e.env||(!this.subscriptionKey||("active"===this.trialStatus||_get(this,"features",t)))}}}},!1,!0,{filename:"src/model/organizations/organizations.$organization.coverage.js",modelPath:"/organizations/$organization/coverage",modelExportName:"OrganizationCoverage"}),_reviewable.define(["Subscription"],["session"],function(e){"use strict";return{Subscription:class Subscription{get reposCoverage(){return"*"===this.visibility?"all":this.visibility||"all"}get _slaveSubscriptions(){return _.filter(this.$parent,{masterSubscriptionKey:this.$key})}get organizationsCoverage(){return"*"===this.organization?"all organizations":_(this._slaveSubscriptions).map("organization").push(this.organization).sortBy().join(", ")}get expiry(){if(!this.expiryTimestamp)return;const e=this.expiryTimestamp-this.$now;return{duration:e,date:new Date(this.expiryTimestamp),color:e<12096e5?"red":e<24192e5?"yellow":"green"}}get description(){if(this.masterSubscriptionKey)return"Subscribed via "+(_get(this,"$parent",this.masterSubscriptionKey,"stripe","metadata","organization")||"another organization");if(!this.stripe)return;const e=this.stripe.plan;let t=`Subscribed to <strong>${_get(e,"product","name")||e.name} plan</strong>`;const s="true"===e.metadata.flexibleQuantity?this.stripe.quantity:_.parseInt(e.metadata.users);_.isFinite(s)&&(t+=` (${s} contributor${1===s?"":"s"})`);const i=this.invoiceAmount||e.amount;if(i){const s=i/100;t+=` at $${s===Math.floor(s)?s:s.toFixed(2)}/`,e.interval_count>1&&(t+=e.interval_count+" "),t+=e.interval,e.interval_count>1&&(t+="s"),this.discountDescription&&(t+=" with "+_.escape(this.discountDescription))}return t}get discountDescription(){const e=this.stripe.discount;let t="";return _get(e,"coupon")&&(e.coupon.percent_off?t+=e.coupon.percent_off+"%":e.coupon.amount_off&&(t+="$"+e.coupon.amount_off),t+=" off",e.end&&(t+=" until "+new Date(1e3*e.end).toLocaleDateString([],{dateStyle:"medium"}))),t}applySeatConstraints(t){Vue.set(e.onboarding,"setSeatConstraints",!0);const s=[];return this.$store.services.auth.login(["repo"],"popup").then(()=>Promise.all(_.map(t,t=>{const i=t.split(/\s*\/\s*/);if(2!==i.length)return s.push("Unable to parse team reference: "+t),Promise.resolve();const r=_.toLower(i[0]),n=_.toLower(i[1]);return e.hubkit().request("/orgs/:org/teams",{org:r,ifNotFound:null}).then(e=>{if(!e)return void s.push("Unable to find organization: "+i[0]);const r=_.find(e,e=>_.toLower(e.slug)===n);if(r)return r.id;s.push("Unable to find team: "+t)})}))).then(e=>{const i=_ref(this,"child","seatsTeamConstraints");return s.length?Promise.reject(new Error(s.join("\n"))):t.length?
1i.set(_.zipObject(t,e)):i.set(null)})}}}},!1,!0,{filename:"src/model/organizations/subscriptions.$subscriptionKey.js",modelPath:"/subscriptions/$subscriptionKey",modelExportName:"Subscription"}),_reviewable.define(["SubscriptionSeats"],[],function(){"use strict";const e=864e5,t=7776e6;return{SubscriptionSeats:class SubscriptionSeats{get max(){return parseInt(_get(this,"$parent","stripe","plan","metadata","seats")||"0",10)}get current(){const e=this.$now;return _(this).reject(s=>s+t<e).size()}get percentage(){return this.max?Math.round(this.current/this.max*100):0}get color(){return this.percentage>=95?"red":this.percentage>=90?"yellow":"green"}get occupants(){const s=this.$now;return _(this).map((i,r)=>({userKey:r,daysRemaining:Math.ceil((i+t-s)/e)})).reject(e=>e.daysRemaining<=0).sortBy("daysRemaining").value()}}}},!1,!0,{filename:"src/model/organizations/subscriptions.$subscriptionKey.seats.js",modelPath:"/subscriptions/$subscriptionKey/seats",modelExportName:"SubscriptionSeats"}),_reviewable.define(["Subscriptions"],[],function(){"use strict";return{Subscriptions:class Subscriptions{get enterpriseList(){return _(this).filter("expiryTimestamp").reject("masterSubscriptionKey").value()}}}},!1,!0,{filename:"src/model/organizations/subscriptions.js",modelPath:"/subscriptions",modelExportName:"Subscriptions"}),_reviewable.define(["GitHubPullRequestSyncQueue"],["corpsman"],function(e){"use strict";return{GitHubPullRequestSyncQueue:class GitHubPullRequestSyncQueue{async request(t,s,i,r,n,a){const o=_.defaults({owner:t,repo:s,prNumber:i,userKey:this.$info.userid||"*",timestamp:this.$truss.SERVER_TIMESTAMP},r),l=_ref(this,"child",`${_.toLower(t)}|${_.toLower(s)}|${i}|${o.userKey}`);Vue.set(o,_ref(l,"child","_lease","created"),this.$truss.SERVER_TIMESTAMP),n?(Vue.set(o,_ref(l,"child","responseKeys",n),a||!0),await l.update(o),await this.$parent.responses.receive(n,6e4)):l.update(o).catch(t=>{e.markHandled(t),window.REVIEWABLE_PROD&&console.log(t)})}}}},!1,!0,{filename:"src/model/queues/queues.githubPullRequestSync.js",modelPath:"/queues/githubPullRequestSync",modelExportName:"GitHubPullRequestSyncQueue"}),_reviewable.define(["Queues"],[],function(){"use strict";return{Queues:class Queues{}}},!1,!0,{filename:"src/model/queues/queues.js",modelPath:"/queues",modelExportName:"Queues"}),_reviewable.define(["ReconciliationQueue"],["corpsman"],function(e){"use strict";return{ReconciliationQueue:class ReconciliationQueue{async request(t,s,i,r,n={}){const{reviewKey:a,scope:o=this,waitForCompletion:l=!1}=n;if(o.$destroyed)return;const c=_.toLower(t),u=_.toLower(s),d={owner:c,repo:u,securityOwner:Truss.escapeKey(c),securityRepo:Truss.escapeKey(u),prNumber:i,..._.pickBy({userKey:this.$info.userid}),updateCompletion:!0,timestamp:this.$truss.SERVER_TIMESTAMP},h=_ref(this,"child",`${c}|${u}|${i}`),p=[];try{await o.$peek(h,async()=>{let e;await h.commit(t=>{p.push(diffObject(e,t.currentValue,{maxDiffLength:300})),e=t.currentValue,t.update({...d,..._get(t,"currentValue","_lease")?null:{[_ref(h,"child","_lease","created")]:this.$truss.SERVER_TIMESTAMP},..._get(t,"currentValue","_lease","busy")?null:{[_ref(h,"child","_lease","expiry")]:null}})})})}catch(t){if("Timeout"===t.message||"Canceled"===t.message)return;if(!/too many retries|permission_denied|maxretry/i.test(t.message))throw t;this.$store.services.breadcrumbSampler.addBreadcrumb("reconciliation-burst",a,"reconciliation task queue error",{source:"queue",reason:r,errorMessage:t.message,transactionDiffs:p.length,latestTransactionDiff:_.last(p)});try{Vue.set(t,"reason",r),Vue.set(t,"attachments",p)}catch{}e.capture(t,"request reconciliation transaction"),await h.update({...d,[_ref(h,"child","_lease","created")]:this.$truss.SERVER_TIMESTAMP})}return l&&!o.$destroyed&&await o.$peek(h,async()=>{o.$destroyed||await o.$when(()=>!h.value)}),h}}}},!1,!0,{filename:"src/model/queues/queues.reconciliation.js",modelPath:"/queues/reconciliation",modelExportName:"ReconciliationQueue"}),_reviewable.define(["Requests"],["corpsman"],function(e){"use strict";return{Requests:class Requests{send(t,s={}){if(!this.$info.userid)return Promise.reject(new Error("Not signed in"));_.isNumber(s)&&(s={timeout:s}
1),Vue.set(t,"userKey",this.$info.userid);const i=_.startsWith(t.action,"fill"),r=i?function(e){return`${e.action}:${_.toLower(e.ownerName)}`+(e.repoName?`|${_.toLower(e.repoName)}`:"")}(t):this.$newKey();i||Vue.set(t,"_lease",{created:this.$truss.SERVER_TIMESTAMP}),s.timeout>0&&Vue.set(t,"bestBeforeTimeout",s.timeout);const n=_ref(this,"child",r).annotate({disregardWrite:s.disregardWrite}).set(t);return s.fireAndForget?n.catch(t=>{e.markHandled(t),window.REVIEWABLE_PROD&&console.log(t)}):Promise.all([n.catch(e=>Promise.reject(new Error("Firebase error: "+e))),this.$parent.responses.receive(r,s.timeout,t.action)]).then(e=>e[1])}}}},!1,!0,{filename:"src/model/queues/queues.requests.js",modelPath:"/queues/requests",modelExportName:"Requests"}),_reviewable.define(["Responses"],["corpsman"],function(e){"use strict";return{Responses:class Responses{receive(t,s,i){const r=this.$info.userid;if(!r)return Promise.reject(new Error("Not signed in"));if(-1===s)return Promise.resolve();s=s||1e4;const n=i?` (action ${i})`:"";return _ref(this,"child",t).peek(()=>this.$when(()=>this[t],{timeout:s,timeoutMessage:`Request queued${n} but server did not respond`}).then(s=>{switch(this.$info.userid===r&&_ref(this,"child",t).annotate({disregardWrite:!0}).set(null).catch(t=>{e.markHandled(t)}),s.outcome){case"ok":return s.result;case"error":{const e=new Error(s.error),t=e.message.match(/^(?:Error: |Internal error: )*GitHub error (\d{3}) on /);let i;if(t){if(i=`github-${t[1]}`,"403"===t[1]||"429"===t[1]){const t=Hubkit.identify403Error(e);t&&(i+=`-${t.code}`)}}else"Internal error: Review changed repeatedly between prep and transaction"===e.message?i="review-changed":/^This pull request's author is not covered by the subscription for /.test(e.message)&&(i="subscription-author-not-covered");return i&&(Vue.set(e,"fingerprint",["server-response",i]),Vue.set(e,"tags",{serverResponseCode:i})),Promise.reject(e)}default:return Promise.reject(new Error("Internal error"))}})).catch(s=>{if(Vue.set(s,"extra",_.assign(s.extra||{},{requestKey:t,action:i,connected:this.$info.connected},_.pick(this.$store.services.connection,"offline","offlineReason"))),this.$info.userid!==r){const t=new Error("Authenticated user changed");return Vue.set(t,"originalError",s),e.markHandled(t),Promise.reject(t)}return"NO_KEY"===s.firecrypt?(e.markHandled(s),Promise.reject(s)):Promise.reject(s)})}}}},!1,!0,{filename:"src/model/queues/queues.responses.js",modelPath:"/queues/responses",modelExportName:"Responses"}),_reviewable.define(["SlackNotificationsQueue"],[],function(){"use strict";return{SlackNotificationsQueue:class SlackNotificationsQueue{async resetScheduledTasks(){const e=await this.$peek(_ref(this.$store,"child","queues","slackNotifications").query({by:_ref(this.$store,"child","queues","slackNotifications","prKey","userKey"),at:this.$info.userid}));await Promise.all(_.map(e,e=>e.$ref.commit(e=>{const t=e.currentValue;t?_get(t,"_lease","attempts")>0?e.update({[_ref(t,"child","reset")]:!0}):e.update({[_ref(t,"child","scheduled")]:null,[_ref(t,"child","_lease","expiry")]:null,[_ref(t,"child","_lease","attempts")]:null}):e.abort()})))}}}},!1,!0,{filename:"src/model/queues/queues.slackNotifications.js",modelPath:"/queues/slackNotifications",modelExportName:"SlackNotificationsQueue"}),_reviewable.define(["Enrollments"],["session"],function(e){"use strict";return{Enrollments:class Enrollments{toggleEnrollment(t,s){return this.$store.services.auth.login(t?[{public:"public_repo",private:"repo",personal:"repo"}[s]]:[]).then(()=>this.$store.queues.requests.send({action:t?"enroll":"unenroll",type:s})).then(t=>(Vue.set(e.onboarding,"enroll",!0),t))}}}},!1,!0,{filename:"src/model/repositories/enrollments.js",modelPath:"/enrollments",modelExportName:"Enrollments"}),_reviewable.define(["RepositorySettings"],[],function(){"use strict";return{RepositorySettings:class RepositorySettings{get merge(){if(!this.$ready)return;const e=(this.mergeMechanism||"github").replace(/^label:.*$/,"label");return{mechanism:e,label:"label"===e?this.mergeMechanism.replace(/^label:/,""):null}}}}},!1,!0,{filename:"src/model/repositories/repositories.$ownerName.$repoName.core.settings.js",modelPath:"/repositories/$ownerName/$repoName/core/settings",modelExportName:"RepositorySettings"}),_reviewable.define(["RepositoryIssue"],[],function(){"use strict";return{RepositoryIssue:class RepositoryIssue{constructor(){Vue.set(this,"matchIndex",void 0)}get number(){return`#${this.$key}`}get ordinal(){return parseInt(this.$key,10)}get searchTerm(){return`${this.number} ${this.title}`}get completionTerm(){return`${this.number} ${this.title}`}get effectiveState(){return"merged"===this.prState?"closed":this.state}}}},!1,!0,{filename:"src/model/repositories/repositories.$ownerName.$repoName.issues.index.$issueNumber.js",modelPath:"/repositories/$ownerName/$repoName/issues/index/$issueNumber",modelExportName:"RepositoryIssue"}),_reviewable.define(["RepositoryIssues"],[],function(){"use strict";class RepositoryIssues{static get MAX_INITIAL_ISSUES(){return 100}constructor(){Vue.set(this,"_issuesSyncChecked",!1)}get _requestIssuesSyncIfStale(){this._issuesSyncChecked?this.$freezeComputedProperty():this.$info.userid&&_ref(this,"child","lastSyncTimestamp").ready&&(Vue.set(this,"_issuesSyncChecked",!0),this.lastSyncTimestamp&&this.lastSyncTimestamp+864e5>this.$now||this.$store.queues.requests.send({action:"fillIssues",ownerName:this.$ownerName,repoName:this.$repoName},{fireAndForget:!0}))}get list(){return _(this.index).values().compact().sortBy("ordinal").value()}get meta(){const e=_ref(this,"child","index").ready;return{maxNumberLength:_(this.list).map(e=>_get(e,"number","length")).push(0).max(),full:e||this.list&&this.list.length<RepositoryIssues.maxInitialIssues}}}return{RepositoryIssues:RepositoryIssues}},!1,!0,{filename:"src/model/repositories/repositories.$ownerName.$repoName.issues.js",modelPath:"/repositories/$ownerName/$repoName/issues",modelExportName:"RepositoryIssues"}),_reviewable.define(["RepositoriesChild"],[],function(){"use strict";return{RepositoriesChild:class RepositoriesChild{static get $trussMount(){return{path:"/repositories/$ownerName",keysUnsafe:!0}}}}},!1,!0,{filename:"src/model/repositories/repositories.$ownerName.js",modelPath:"/repositories/$ownerName",modelExportName:"RepositoriesChild"}),_reviewable.define(["Repositories"],["session"],function(e){"use strict";return{Repositories:class Repositories{static get $trussMount(){return{path:"/repositories",keysUnsafe:!0}}async toggleConnection(t,s,i,r){const n=[];if(r){n.push("admin:repo_hook",i?"repo":"public_repo");_get(await e.hubkit().graph('\n query($ownerName: String!, $repoName: String!) {\n repository(owner: $ownerName, name: $repoName) {\n defaultBranchRef {\n target {\n ... on Commit {\n file(path: "/.github/workflows/") {oid}\n }\n }\n }\n }\n }\n',{variables:{ownerName:t,repoName:s},ifNotFound:null}),"repository","defaultBranchRef","target","file","oid")&&n.push("workflow")}await this.$store.services.auth.login(n),await this.$store.queues.requests.send({action:r?"connect":"disconnect",ownerName:t,repoName:s},3e4),Vue.set(e.onboarding,"connectedRepo",!0),Vue.set(e.onboarding,"connect",!0)}}}},!1,!0,{filename:"src/model/repositories/repositories.js",modelPath:"/repositories",modelExportName:"Repositories"}),_reviewable.define(["Rules"],[],function(){"use strict";return{Rules:class Rules{}}},!1,!0,{filename:"src/model/repositories/rules.js",modelPath:"/rules",modelExportName:"Rules"}
1),_reviewable.define(["ReviewInitializers"],["CollapseSettings","shared"],function(e,t){"use strict";const s={merge:["merge","squash","rebase"],squash:["squash","merge","rebase"],rebase:["rebase","merge","squash"]};return{ReviewInitializers:class ReviewInitializers{constructor(){Vue.set(this,"review",this.$parent.$parent)}get _userSettingsRef(){return _ref(this.$store,"child","users","current","settings")}get _reviewSettingsRef(){return _ref(this.$store,"child","users","current","state",this.$reviewKey,"settings")}get _repositorySettingsRef(){return _ref(this.$store,"child","repositories",_.toLower(this.$parent.ownerName),_.toLower(this.$parent.repoName),"core","settings")}get _reviewStatusRef(){return _ref(this,"child","review","statuses",this.review.core.lastRevisionKey,"services",t.reviewableStatusContext)}get _initStateVisited(){if(!this.$info.userid||!_get(this,"review","context","showDiscussions"))return;const e=_ref(this.$store,"child","users",this.$info.userid,"state",this.$reviewKey);e.ready&&(_get(e,"value","visited")||e.update({visited:!0}))}get _initReviewOverlapStrategy(){if(!this.$info.userid)return;const e=_access(_ref,"call",[this._reviewSettingsRef,"child","overlapOtherReviewers"]),t=_access(_ref,"call",[this._reviewSettingsRef,"child","reviewOverlapStrategy"]),s=_access(_ref,"call",[this._reviewSettingsRef,"child","reviewOverlapStrategyAppliedDefault"]);if(!_get(e,"ready")||!_get(t,"ready"))return;if(t.value)return _.isBoolean(e.value)||e.set("unclaimed"!==t.value),void this.$freezeComputedProperty();if(_.isBoolean(e.value))return t.set(e.value?"unreviewed":"unclaimed"),void this.$freezeComputedProperty();const i=_access(_ref,"call",[this._repositorySettingsRef,"child","reviewOverlapStrategy"]),r=_ref(this._userSettingsRef,"child","reviewOverlapStrategy"),n=_ref(this._userSettingsRef,"child","overlapOtherReviewers");if(!_get(i,"ready")||!_get(r,"ready")||!_get(n,"ready"))return;let a,o,l=null;r.value?(o=r.value,a="unclaimed"!==r.value):(a=!_.isBoolean(n.value)||n.value,o=a?"unreviewed":"unclaimed"),i.value&&(l=i.value===o?null:"repository",o=i.value,a="unclaimed"!==o),this._reviewSettingsRef.update({[t]:o,[e]:a,[s]:l}),this.$freezeComputedProperty()}get _initCollapseStateSetting(){if(!this.$info.userid)return;const t=_access(_ref,"call",[this._userSettingsRef,"child","collapse"]),s=_access(_ref,"call",[this._reviewSettingsRef,"child","collapse"]);if(!_get(s,"ready")||!_get(t,"ready"))return;const i=_.assign({},t.value,s.value,e.FILE_DEFAULTS);_.isEqual(i,_.toPlainObject(s.value))||s.set(i),this.$freezeComputedProperty()}get _initRevisionSplitStrategy(){const e=this.review.core;if(e.revisionSplitStrategy)return void this.$freezeComputedProperty();if(!(e.ownerName&&e.repoName&&e.pullRequestId))return;const t=_ref(this.$store,"child","repositories",_.toLower(_get(e,"ownerName")),_.toLower(_get(e,"repoName")),"core","settings","revisionSplitStrategy");_get(t,"ready")&&_ref(e,"child","revisionSplitStrategy")[_get(this,"review","verdict","push")?"set":"override"](t.value||"combinedCommits")}get _initMergeFlavor(){const e=_get(this,"review","core","base","mergeFlavors"),t=_access(_ref,"call",[this._userSettingsRef,"child","mergeFlavor"]),i=_access(_ref,"call",[this._reviewSettingsRef,"child","mergeFlavor"]);if(!_get(t,"ready")||!_get(i,"ready")||!_get(this,"review","core","base","permissionsReady"))return;let r=i.value||t.value||"merge";if(s[r]||(r="merge"),this.review.progress.protectionBypassed);else if(_(e).values().some()){const t=s[r];let i=0;for(;!1===e[r=t[i]];)i++}else r=i.value||r;i.value!==r&&i.set(r)}get _initDeleteBranchOnMerge(){const e=_access(_ref,"call",[this._userSettingsRef,"child","deleteBranchOnMerge"]),t=_access(_ref,"call",[this._reviewSettingsRef,"child","deleteBranchOnMerge"]);if(!_get(e,"ready")||!_get(t,"ready")||!_get(this,"review","core","head","permissionsReady"))return;const s=_get(this,"review","core","head","githubDeletesBranchOnMerge")||!!_get(this,"review","core","head","deleteAllowed")&&_.find([t.value,e.value,!1],e=>_.isBoolean(e));t.value!==s&&t.set(s)}get _initUpdateMethod(){const e=_access(_ref,"call",[this._userSettingsRef,"child","updateMethod"]),t=_access(_ref,"call",[this._reviewSettingsRef,"child","updateMethod"]);if(!_get(e,"ready")||!_get(t,"ready"))return;const s=t.value||e.value||"merge";t.value!==s&&t.set(s)}}}},!1,!0,{filename:"src/model/reviews/core/reviews.$reviewKey.core.initializer
1s.js",modelPath:"/reviews/$reviewKey/core/initializers",modelExportName:"ReviewInitializers"}),_reviewable.define(["ReviewCore"],["config","session","corpsman","shared"],function(e,t,s,i){"use strict";const r=["merge","squash","rebase"];return{ReviewCore:class ReviewCore{constructor(){Vue.set(this,"review",this.$parent),Vue.set(this,"_headBranchDetails",{}),Vue.set(this,"_baseBranchDetails",{}),Vue.set(this,"_baseChangeError",void 0),this.$observe(()=>this.$info.userid,()=>{Vue.set(this,"_headBranchDetails",{}),Vue.set(this,"_baseBranchDetails",{})})}get effectiveState(){return"closed"===this.state&&_get(this,"review","integrations","spr","merged")?"merged":"open"===this.state&&_get(this,"review","progress","mergeQueued")?"queued":this.state}get pullRequestAddress(){return`${this.ownerName}/${this.repoName} #${this.pullRequestId}`}get branchesInSameRepo(){return!(!this.baseBranch||!this.branch)&&this.baseBranch.split(":")[0]===this.branch.split(":")[0]}get _basicHead(){if(!this.branch||!this.branchRepoName||void 0===this.branchesInSameRepo)return;const e=this.branch.split(":"),t=this._buildBranch(e[0],this.branchRepoName,e[1]);return Vue.set(t,"branchFromBaseRepo",this.branchesInSameRepo),t}get _basicBase(){if(!(this.baseBranch&&this.repoName&&this.pullRequestId))return;const e=this.baseBranch.split(":"),t=this._buildBranch(e[0],this.repoName,e[1]);return Vue.set(t,"branchFromBaseRepo",!0),t}get _headDetails(){return this._getBranchDetails("head",this._basicHead)}get _baseDetails(){return this._constrainMergeFlavors(this._getBranchDetails("base",this._basicBase))}get base(){if(!(this.baseBranch&&this.repoName&&this.pullRequestId))return;const e={...this._basicBase};return Vue.set(e,"branchFromBaseRepo",!0),_.assign(e,this._baseDetails),Vue.set(e,"prNumber",this.pullRequestId),Object.defineProperty(e,"changeError",{get:()=>this._baseChangeError}),Vue.set(e,"change",async e=>{Vue.set(this,"_baseChangeError",void 0);const s=t.hubkit(this.base.owner,this.base.repo,{prNumber:this.base.prNumber});try{await s.request("PATCH /repos/:owner/:repo/pulls/:prNumber",{body:{base:e}}),await this.review.context.syncPullRequest("baseBranch")}catch(e){Vue.set(this,"_baseChangeError",e.message)}}),_get(this,"review","core","baseBranchDeleted")&&Vue.delete(e,"url"),e}get head(){if(!this.branch||!this.branchRepoName||void 0===this.branchesInSameRepo)return;const e={...this._basicHead};return Vue.set(e,"branchFromBaseRepo",this.branchesInSameRepo),_.assign(e,this._headDetails),_get(this,"review","core","branchDeleted")&&Vue.delete(e,"url"),e}get repoSettingUrl(){if(this.ownerName&&this.repoName&&this.pullRequestId)return`/admin/${this.ownerName}/${this.repoName}?pr=${this.pullRequestId}`}_buildBranch(t,s,i){return{owner:t,repo:s,name:i,html:_.escape(this.branchesInSameRepo?i:s?`${t}/${s}:${i}`:`${t}:${i}`).replace(/[:/]/g,"$&<wbr/>"),url:`${e.gitHubUrl}/${encodeURIComponent(t)}/${encodeURIComponent(s)}/tree/${encodeURIComponent(i)}`}}get htmlPullRequestTitle(){return _access(_.escape(this.title).replace(/`{3}(.*?)`{3}/g,"<code>$1</code> "),"","replace","call",[/`(.*?)`/g,"<code>$1</code> "])}get plainTextPullRequestTitle(){const e=_access(this,"","title","","replace","call",[/`{3}(.*?)`{3}/g,"$1"]);return _access(e,"","replace","call",[/`(.*?)`/g,"$1"])}_getBranchDetails(e,t){const s={mayBeProtected:!0,permissionsReady:!1,permissions:{}};if(!t)return s;const i=this[`_${e}BranchDetails`],r=`${t.owner}/${t.repo}/${t.name}`;return r in i?i[r]:_get(this,"review","context","completeReview")||this.review.progress.complete?(Vue.set(i,r,void 0),void this._fetchBranchDetails(t).then(e=>{Vue.set(i,r,e)})):s}_fetchBranchDetails(e){const i=t.hubkit(e.owner,e.repo,{fresh:!1,onError:e=>{if(401===e.status||404===e.status)return null}}),r={};return Promise.all([e.branchFromBaseRepo&&_get(this,"review","context")?this.$when(()=>_get(this,"review","context","repository")):i.request("GET /repos/:owner/:repo"),i.request("GET /repos/:owner/:repo/branches/:ref",{ref:e.name})]).then(([t,i])=>(s.clearCondition("ghquota"),t&&(Vue.set(r,"mergeFlavors",{merge:t.allow_merge_commit,squash:t.allow_squash_merge,rebase:t.allow_rebase_merge}),Vue.set(r,"mergeFlavorDefaults",{merge:{preferredCommitMessage:t.merge_commit_message||"PR_TITLE",preferredTitle:t.merge_commit_title||"MERGE_MESSAGE"},squash:{preferredCommitMessage:t.squash_merge_commit_message||"COMMIT_MESSAGES",preferredTitle:t.use_squash_pr_title_as_default?"PR_TITLE":t.squash_merge_commit_title||"COMMIT_OR_PR_TITLE"}}),Vue.set(r,"githubDeletesBranchOnMerge",t.delete_branch_on_merge),Vue.set(r,"mayBeProtected",!t.default_branch||e.name===t.default_branch||!i||i.protected),Vue.set(r,"permissions",_.assign({},t.permissions)),Vue.set(r,"deleteAllowed",!r.mayBeProtected&&r.permissions.push)),Vue.set(r,"permissionsReady",!0),r))}_constrainMergeFlavors(e){if(!_get(e,"mergeFlavors"))return e;const t=_get(this,"review","statuses",_get(this,"review","core","lastRevisionKey")),s=_get(t,"services",i.mergeableStatusKey,"allowedMergeFlavors"),n=_get(t,"services",i.reviewableStatusContext,"mergeFlavor"),a=!_get(t,"services",i.mergeableStatusKey,"linearOnly"),o=_(e.mergeFlavors).pickBy().keys().intersection(void 0===s?r:""===s?[]:_.split(s,",")).intersection(n?[n]:r).intersection(a?r:["squash","rebase"]).value(
1);return{...e,mergeFlavorsAvailable:!!o.length,mergeFlavors:_.mapValues(e.mergeFlavors,(e,t)=>_.includes(o,t))}}}}},!1,!0,{filename:"src/model/reviews/core/reviews.$reviewKey.core.js",modelPath:"/reviews/$reviewKey/core",modelExportName:"ReviewCore"}),_reviewable.define(["Review"],["shared"],function(e){"use strict";return{Review:class Review{constructor(){Vue.set(this,"context",void 0),Vue.set(this,"_contextOpsCount",0)}get repository(){return _get(this,"$store","repositories","$data",_.toLower(_get(this,"core","ownerName")),"$data",_.toLower(_get(this,"core","repoName")))}repositoryRef(){return _access(_ref,"call",[this.$store,"child","repositories",_.toLower(_get(this,"core","ownerName")),_.toLower(_get(this,"core","repoName"))])}get state(){return _get(this,"$store","users","current","state",this.$reviewKey)}stateRef(){return _access(_ref,"call",[this.$store,"child","users","current","state",this.$reviewKey])}get stateReady(){return null===this.$info.userid||_access(_ref,"call",[this.$store,"child","users","current","state",this.$reviewKey],"","ready")}get linemapsReady(){return _ref(this.$store,"child","linemaps",this.$reviewKey).ready}get userIsAuthor(){if(!this.$info.userid)return!1;const e=this.$info.user.github,t=_get(this,"core","authorKey");return e.agentKey?e.ownerKey===t&&("author"===e.agentType||"replicant"===e.agentType):this.$info.userid===t}get userIsReviewer(){return!this.userIsAuthor&&(this.$info.userid&&(!this.people[this.$info.userid]||_get(this,"people",this.$info.userid,"reviewer")))}get userIsPotentialReviewer(){return this.$info.userid&&(this.userIsReviewer||_get(this,"verdict","push")&&!this.userIsAuthor)}get userIsReviewingFiles(){return!this.userIsAuthor||("review"===_get(this,"files","reviewMarkStyle")||_.includes(_get(this,"files","reviewMarkUserKeys"),this.$info.userid)||_.some(_get(this,"state","marks"),e=>_.some(e.revisions,"reviewed")))}get userCanDeferFiles(){return!this.userIsAuthor||"review"===_get(this,"files","reviewMarkStyle")}get userHasDeferred(){if(!this.tracker||!this.stateReady||!this.core.lastRevisionKey)return;const e=_get(this,"participants",this.$info.userid);return!(!_get(e,"deferredRevisionKey")||!_get(e,"deferredTimestamp"))&&(e.deferredTimestamp>=this.tracker.lastOrganicPostOrRoleTimestamp&&(!(this.userIsReviewer||this.userIsAuthor&&this.userCanDeferFiles)||e.deferredRevisionKey===this.core.lastRevisionKey))}get deferral(){const e=this.userCanDeferFiles?_get(this,"files","num","toReview"):0,t=this.userCanDeferFiles&&_get(this,"files","markReviewedSpec","undoPossible");return{numFiles:e,numDiscussions:_get(this,"tracker","num","unreplied"),numUnread:_get(this,"tracker","num","unread"),filesUndoAvailable:t,discussionsUndoAvailable:_get(this,"tracker","undoAcknowledgeUnreadPossible"),undoAvailable:t||_get(this,"tracker","undoAcknowledgeUnreadPossible"),files:!(!e&&!t),discussions:!(!_get(this,"tracker","num","unread")&&!_get(this,"tracker","undoAcknowledgeUnreadPossible"))}}get verdict(){if(this.core.ownerName&&this.core.repoName)return this.$store.services.warden.getVerdict(this.core.ownerName,this.core.repoName)}get votingSanctionAllowed(){if(!_ref(this,"child","statuses").ready)return;if(_get(this,"statuses",this.core.lastRevisionKey,"services",e.reviewableStatusContext,"gitHubApprovalsDisabled"))return!1;if(!this.verdict)return;const t=_get(this,"$info","user","github");if(!t)return!1;const s=_get(this,"core","authorKey");return(!t.agentKey||t.ownerKey!==s)&&("open"===_get(this,"core","state")&&!this.userIsAuthor&&this.verdict.push)}get forcedAutoRequestReviewers(){if(!_ref(this,"child","statuses").ready)return;if(!this.verdict)return;if(!this.verdict.push)return!1;const t=_get(this,"statuses",this.core.lastRevisionKey,"services",e.reviewableStatusContext,"autoRequestReviewers");return void 0!==t?t:null}get draftOnly(){return void 0!==this.core.draft?this.core.draft:"draft"===_get(this,"statuses",this.core.lastRevisionKey,"services",e.mergeableStatusKey,"condition")}get pullRequestIcon(){if(this.draftOnly)return"pull request draft";switch(this.core.effectiveState){case"merged":return"pull request closed";case"closed":return"pull request dropped";default:return"pull request"}}}}},!1,!0,{filename:"src/model/reviews/core/reviews.$reviewKey.js",modelPath:"/reviews/$reviewKey",modelExportName:"Review"}),_reviewable.define(["ReviewMergeQueue"],["shared"],function(e){"use strict";return{ReviewMergeQueue:class ReviewMergeQueue{static get $trussMount(){return{path:"/reviews/$reviewKey/mergeQueue",placeholder:null}}get reviewSettings(){return _get(this,"$store","users","current","state",this.$parent.$key,"settings")}get enabled(){return null===this.$info.userid||(this.reviewSettings?"bypass"!==this.reviewSettings.mergeQueueOverride:void 0)}get canBypass(){return _.every(this.$parent.statuses.latest,t=>t.context===e.mergeableStatusKey||"everyone"!==t.required)&&_get(this,"$parent","verdict","admin")}get jumpRequested(){return"jump"===_get(this,"reviewSettings","mergeQueueOverride")}}}},!1,!0,{filename:"src/model/reviews/core/reviews.$reviewKey.mergeQueue.js",modelPath:"/reviews/$reviewKey/mergeQueue",modelExportName:"ReviewMergeQueue"}),_reviewable.define(["ReviewProgress"],["session","analytics","shared","corpsman"],function(e,t,s,i){"use strict";const r=new Set([s.reviewableStatusContext,s.approvalStatusKey,"pullapprove4"]);return{ReviewProgress:class ReviewProgress{constructor(){Vue.set(this,"review",this.$parent),Vue.set(this,"mergeInProgress",!1),Vue.set(this,"protectionBypassed",!1),this.$connect(this,{mergeMechanism:()=>_ref(this.$store,"child","repositories",_.toLower(this.review.core.ownerName)||void 0,_.toLower(this.review.core.repoName)||void 0,"core","settings","mergeMechanism"),hasCompletionCondition:()=>_ref(this.$store,"child","rules",_.toLower(this.review.core.ownerName)||void 0,_.toLower(this.review.core.repoName)||void 0,"hasCompletionCondition")})}get mergeQueued(){return this.review.mergeQueueEntry||_get(this,"review","labels","$data",_get(this,"review","repository","core","settings","merge","label"))}get mergeable(){const e=this.review;if(!_get(e,"context","fullInterface"))return;if(!e.stateReady||_get(e,"state","num","pending"))return!1;if("open"!==_get(e,"core","state"))return!1;if(_get(e,"integrations","spr"))return!1;const t=_get(e,"statuses",e.core.lastRevisionKey);if(!t)return!1;const i=_get(t,"services",s.reviewableStatusContext),r=_get(t,"services",s.mergeableStatusKey);if(_get(r,"branchProtected"))switch(r.condition){case"dirty":case"unknown":case"behind":case"draft":return!1;case"has_hooks":case"clean":case"unstable":return!0;case"blocked":return"success"===_get(i,"state")&&"blocked"}return!_get(e,"core","draft")&&"draft"!==_get(r,"condition")&&(!(!i||"success"!==i.state)&&_.every(t.services,t=>!t.required||(!("non_admins"!==t.required||!_get(e,"verdict","admin"))||"success"===t.state)))}get mergeableWarningColor(){if(this.protectionBypassed)return"red";const e=this.review;if(!e.stateReady||void 0===_get(e,"state","num","pending"))return;if(_get(e,"state","num","pending"))return"red";const t=_get(e,"statuses",e.core.lastRevisionKey);if(!t)return;const i=_get(t,"services",s.mergeableStatusKey);if(_get(i,"branchProtected"))switch(i.condition){case"has_hooks":case"clean":return null;case"unstable":return"yellow";default:return"red"}return _get(e,"core","draft")||"draft"===_get(i,"condition")||"success"!==t.aggregateState?"red":null}get canPossiblyTriggerAutoMerge(){const e=this.review;if("open"!==_get(e,"core","state"))return!1;if(!_get(e,"core","autoMerge")||!_get(e,"state","num","pendingSend"))return;const t=_get(e,"statuses",e.core.lastRevisionKey,"services"),i=_.some(t,e=>e.$key===s.reviewableStatusContext&&e.required),n=this._computeIfReviewMayBeComplete(),a=_(t).filter((e,t)=>
1e.required&&!r.has(t)).every({state:"success"});return(_get(t,s.approvalStatusKey,"minAdditionalApprovalsRequired")||0)-("approved"===_get(e,"state","effectiveSanction")?1:0)<=0&&a&&(!i||n)}_computeIfReviewMayBeComplete(){if(this.hasCompletionCondition)return!0;const e=0===_get(this,"review","files","num","unreviewed"),t=0===_get(this,"review","tracker","num","unresolvedIfDraftsSent"),s=!_get(this,"review","files","commitsFileUnreviewed");return e&&t&&s}get complete(){const e=this.review;if(void 0===_get(e,"core","state"))return;if("open"!==e.core.state)return!1;if(_get(e,"integrations","spr"))return!1;const t=[_get(e,"files","num","unreviewed"),_get(e,"tracker","num","unreplied"),_get(e,"tracker","num","unresolved"),_get(e,"state","num","pending")];return _.some(t,e=>void 0===e)?void 0:!_.some(t)&&null===this.mergeableWarningColor}get mergeReadinessLevel(){if(void 0===this.complete||!_get(this,"review","core","base","permissions"))return;const e=_get(this,"review","statuses",_get(this,"review","core","lastRevisionKey"));let t=0;return _.forEach([()=>(this.complete||this.mergeable)&&_get(this,"review","core","base","permissions","push")&&_get(this,"review","repository","core","settings","merge")&&"external"!==this.review.repository.core.settings.merge.mechanism,()=>void 0!==_get(this,"review","state","settings","mergeFlavor")&&void 0!==_get(this,"review","state","settings","deleteBranchOnMerge"),()=>(this.complete||!0===this.mergeable)&&this.review.core.base.mergeFlavorsAvailable&&("rebase"===this.review.state.settings.mergeFlavor?_get(e,"services",s.mergeableStatusKey,"rebaseAllowed"):!this.review.state.settings.generatedMergeCommitMessageError)],e=>{if(!e())return!1;t++}),t}get mergeWarnings(){const t=this.review;if(!_get(t,"context","fullInterface"))return;const i=_get(t,"statuses",t.core.lastRevisionKey),r=_get(i,"services",s.mergeableStatusKey),n=[];if("blocked"===_get(r,"condition")&&t.hasWorkflowFiles){const s=this.$store.services.avatars,i=_get(t,"context","repositoryCore"),r=_.includes(["active","broken"],_get(i,"connection"));if(!(r?_get(i,"connectorHasWorkflowScope"):e.hasScope("workflow"))){const e=r?s.users[_get(i,"connector")]?`@${s.users[_get(i,"connector")].username}`:"The user who connected the repository":"You";n.push({key:"workflow",color:"red",message:`Mergeability state may not be accurate. ${e} must authorize Reviewable to access workflow files.`})}}return n}get readyForReviewAllowed(){return"open"===_get(this,"review","core","state")&&this.review.draftOnly&&_get(this,"review","verdict","push")}async readyForReview(){const s=`readyForReview${this.review.$key}`;i.clearFailure(s);try{if(!this.readyForReviewAllowed)throw new Error("Pull request cannot be marked ready for review");if(this.mergeInProgress)throw new Error("Update already in progress");await this.$store.services.auth.login(),this._cancelIfDestroyed(),Vue.set(this,"mergeInProgress",!0),this.$store.services.auth.disable();try{await e.hubkit().graph("mutation ($pullRequestId: ID!) {\n markPullRequestReadyForReview(input: {pullRequestId: $pullRequestId}) {\n pullRequest {\n id\n }\n }\n }",{variables:{pullRequestId:this.review.core.nodeId}}),this._cancelIfDestroyed(),_ref(this,"child","review","core","draft").override(!1),this._resyncInactiveRepo(),Vue.set(e.onboarding,"markedReadyForReview",!0),t.track("Ready for Review",{owner:this.review.core.ownerName,repo:this.review.core.repoName,pullRequest:this.review.core.pullRequestId})}finally{this.$store.services.auth.enable(),Vue.set(this,"mergeInProgress",!1)}}catch(e){i.capture(e,e.context),i.setFailure(s,`Failed to mark pull request ready for review: ${e.message}`,{retry:()=>this.review.progress.readyForReview()})}}async _wrapMerge(t){const s=this.$truss.connect(_ref(this,"child","review","core"));i.clearFailure(`merge${this.review.$key}`);try{if(3!==this.mergeReadinessLevel&&!this.protectionBypassed)throw new Error("Pull request not ready to merge yet");if(this.mergeInProgress)throw new Error("Merge already in progress");await this.$store.services.auth.login(),this._cancelIfDestroyed(),Vue.set(e.onboarding,"mergedBranch",!0),Vue.set(this,"mergeInProgress",!0),this.$store.services.auth.disable();try{await t()}finally{this.$store.services.auth.enable(),Vue.set(this,"mergeInProgress",!1)}}catch(e){i.capture(e,e.context);const s=()=>this.review.progress._wrapMerge(t),[r,n]="deleteBranch"===e.context?["Pull request merged but branch not deleted",null]:"queueMerge"===e.context?["Failed to queue pull request for merge",s]:["Failed to merge pull request",s];let a;const o={acquire:()=>{a=this.$truss.connect(_ref(this,"child","review","core"))},release(){a.destroy()}};i.setFailure(`merge${this.review.$key}`,`${r}: ${e.message}`,{retry:n,context:o})}finally{s.destroy()}}async merge(){await this._wrapMerge(async()=>{await this.$peek(_ref(this,"child","review","state","settings"),async()=>{this.review.state.settings.acquireCommitMessage();try{await this.review.state.settings.waitForMergeCommitMessage(),this._cancelIfDestroyed(),await this._mergeHeadToBaseBranch(),this._cancelIfDestroyed(),_get(this,"review","core","head","githubDeletesBranchOnMerge")?_ref(this,"child","review","core","branchDeleted").override(!0):this.review.core.branch&&this.review.state.settings.deleteBranchOnMerge&&await this._deleteHeadBranch()}finally{this.review.state.settings.releaseCommitMessage(),"merged"===this.review.core.state&&(this._resyncInactiveRepo(),t.track("Merged Branch",{owner:this.review.core.ownerName,repo:this.review.core.repoName,pullRequest:this.review.core.pullRequestId,deleted:!!this.review.core.branchDeleted,flavor:this.review.state.settings.mergeFlavor}))}})})}async _mergeHeadToBaseBranch(){const t=this.review.state.settings.mergeFlavor,s=e.hubkit(this.review.core.ownerName,this.review.core.repoName,{prNumber:this.review.core.pullRequestId}),i={merge_method:t};if("rebase"!==t){const e=this._splitCommitMessage();_.assign(i,{commit_title:e.title,commit_message:e.message})}try{await s.request("PUT /repos/:owner/:repo/pulls/:prNumber/merge",{body:i}),this._cancelIfDestroyed(),"merged"!==this.review.core.state&&_ref(this,"child","review","core","state").override("merged")}catch(e){throw Vue.set(e,"context","mergeBranch"),e}}async _deleteHeadBranch(){const t=e.hubkit(this.review.core.head.owner,this.review.core.head.repo);try{await t.request("DELETE /repos/:owner/:repo/git/refs/heads/:ref",{ref:this.review.core.head.name}),this._cancelIfDestroyed(),_ref(this,"child","review","core","branchDeleted").override(!0)}catch(e){if(422===e.status&&/reference does not exist/i.test(e.message))return;throw Vue.set(e,"context","deleteBranch"),e}}async _resyncInactiveRepo(){if(this.$destroyed)return;const e=_ref(this.$store,"child","repositories",_.toLower(_get(this,"review","core","ownerName")),_.toLower(_get(this,"review","core","repoName")),"core","connection");try{const t=await this.$peek(e);if(this._cancelIfDestroyed(),"active"===t)return;this.review.context.syncPullRequest("unconnected")}catch(e){i.markHandled(e)}}_splitCommitMessage(){const e=this.review.state.settings.actualMergeCommitMessage;if(!e)return{title:this.review.core.title,message:""};let t=e.indexOf("\n\n");return t<0&&(t=e.length),{title:e.slice(0,t),message:e.slice(t+2)}}async queueMerge(){await this._wrapMerge(async()=>{const s=!!_get(this,"review","mergeQueue","jumpRequested");try{const i=_get(await e.hubkit().graph("mutation ($pullRequestId: ID!, $jump: Boolean) {\n enqueuePullRequest (input: {pullRequestId: $pullRequestId, jump: $jump}) {\n mergeQueueEntry {\n position, estimatedTimeToMerge\n }\n }\n }",{variables:{pullRequestId:this.review.core.nodeId,jump:s}}),"enqueuePullRequest","mergeQueueEntry"),r=_get(i,"estimatedTimeToMerge");_ref(this,"child","review","mergeQueueEntry").override({enqueuing:{timestamp:this.$now,userKey:this.$info.userid},position:_get(i,"position"),estimatedMergeTimestamp:r?this.$now+1e3*r:null}),this._resyncInactiveRepo(),t.track("Queued Merge",{owner:this.review.core.ownerName,repo:this.review.core.repoName,pullRequest:this.review.core.pullRequestId,jump:s})}catch(e){if(400===e.status&&/pull request is already in the queue/i.test(e.message))return void(_get(this,"review","mergeQueueEntry","enqueuing")||_ref(this,"child","review","mergeQueueEntry","enqueuing").override({timestamp:this.$now}));throw Vue.set(e,"context","queueMerge"),e}})}async cancelQueuedMerge(){if(i.clearFailure(`merge${this.review.$key}`),this.mergeInProgress)throw new Error("Merge already in progress");Vue.set(this,"mergeInProgress",!0),Vue.set(e.onboarding,"canceledQueuedMerge",!0);try{await e.hubkit().graph("mutation ($pullRequestId: ID!) {\n dequeuePullRequest (input: {id: $pullRequestId}) {\n clientMutationId\n }\n }",{variables:{pullRequestId:this.review.core.nodeId}}),_ref(this,"child","review","mergeQueueEntry").override(null),this._resyncInactiveRepo(),t.track("Canceled Queued Merge",{owner:this.review.core.ownerName,repo:this.review.core.repoName,pullRequest:this.review.core.pullRequestId})}catch(e){i.setFailure(`merge${this.review.$key}`,`Failed to cancel pending merge: ${e.message}`)}finally{Vue.set(this,"mergeInProgress",!1)}}async addMergeLabel(){await this._wrapMerge(async()=>{const s=this.review.repository.core.settings.merge.label,i=e.hubkit(this.review.core.ownerName,this.review.core.repoName,{prNumber:this.review.core.pullRequestId});await i.request("POST /repos/:owner/:repo/issues/:prNumber/labels",{body:{labels:[s]}}),_ref(this,"child","review","labels",s).override(!0),this._resyncInactiveRepo(),t.track("Queued Merge",{owner:this.review.core.ownerName,repo:this.review.core.repoName,pullRequest:this.review.core.pullRequestId})})}async removeMergeLabel(){if(i.clearFailure(`merge${this.review.$key}`),this.mergeInProgress)throw new Error("Merge already in progress");Vue.set(this,"mergeInProgress",!0),Vue.set(e.onboarding,"canceledQueuedMerge",!0);try{const s=this.review.repository.core.settings.merge.label,i=e.hubkit(this.review.core.ownerName,this.review.core.repoName,{prNumber:this.review.core.pullRequestId,label:s});await i.request("DELETE /repos/:owner/:repo/issues/:prNumber/labels/:label"),_ref(this,"child","review","labels",s).override(null),this._resyncInactiveRepo(),t.track("Canceled Queued Merge",{owner:this.review.core.ownerName,repo:this.review.core.repoName,pullRequest:this.review.core.pullRequestId})}catch(e){i.setFailure(`merge${this.review.$key}`,`Failed to cancel pending merge: ${e.message}`)}finally{Vue.set(this,"mergeInProgress",!1)}}_cancelIfDestroyed(){if(this.$destroyed)throw new Error("Canceled")}}}},!1,!0,{filename:"src/model/reviews/core/reviews.$reviewKey.progress.js",modelPath:"/reviews/$reviewKey/progress",modelExportName:"ReviewProgress"}),_reviewable.define(["Revision"],["corpsman","config"],function(e,t){"use strict";function s(e){return _.assign({hasFilemap:!!e},_.pick(e,["valid","done","local","writeFailed"]))}return{Revision:class Revision{constructor(){Vue.set(this,"review",this.$parent.$parent),Vue.set(this,"index",void 0),Vue.set(this,"_filemapKeysInProgress",[])}get captured(){return this.capturerKey||this.softCapturerKey}get filemapKey(){if(void 0===this.index||!this.$parent.list)return;return`${_get(this.index?this.$parent.list[this.index-1]:void 0,"commitSha")}-${this.commitSha}`}get filemap(){if(!_get(this,"review","context","diffFiles")||!this.filemapKey)return;const e=_ref(this.$store,"child","filemaps",this.$reviewKey,this.filemapKey);if(!e.ready)return;const t=e.value;if(_get(t,"valid"))return"untrusted"===t.done&&_get(this,"review","verdict","push")&&this._computeAndStoreFilemap("untrusted_upgrade"),t;t&&void 0===t.valid||this._computeAndStoreFilemap(_get(t,"local")?"local_retry":"missing")}get computingFilemap(){return!_.isEmpty(this._filemapKeysInProgress)}_buildBreadcrumbData(e={}){return{revisionKey:this.$key,...e}}async _computeAndStoreFilemap(i="missing"){let r,n,a="started";try{if(await this.$nextTick(),this._cancelIfDestroyed(),_.includes(this._filemapKeysInProgress,this.filemapKey))return;r=this.filemapKey,n=_ref(this.$store,"child","filemaps",this.$reviewKey,r),this.$store.services.breadcrumbSampler.addSampledBreadcrumb("reconciliation-burst",this.$reviewKey,"filemap compute start",this._buildBreadcrumbData({reason:i,filemapKey:r,currentFilemap:s(n.value)})),this._filemapKeysInProgress.push(r);try{const o=()=>{this._cancelIfDestroyed();const e=n.value;return!this.$destroyed&&r===this.filemapKey&&n.ready&&(!e||e.local||!1===e.valid||"untrusted"===e.done&&_get(this,"review","verdict","push"))};if(await this.$when(()=>this.review.core.lastReconciliationTimestamp&&this.review.revisions.list),!o())return void(a="skipped_before_match");const l=await this._matchRenamedFiles();if(!o())return void(a="skipped_after_match");n.override(_.assign({local:!0},l));const c=await this.$when(()=>this.review.verdict);if(!o())return void(a="skipped_before_store");try{await n.set(_.assign({done:!!c.push||"untrusted"},l)),a=c.push?"stored_trusted":"stored_untrusted"}catch(o){n.override(_.assign({local:!0,writeFailed:!0},l)),a="set_failed",this.$store.services.breadcrumbSampler.addBreadcrumb("reconciliation-burst",this.$reviewKey,"filemap set failed",this._buildBreadcrumbData({reason:"set_failed",computeReason:i,filemapKey:r,errorMessage:o.message,filemap:s(n.value),filemapSnapsh
1ot:_get(n,"value")&&_.toPlainObject(n.value)})),c.push&&this.$info.userid&&_.every(l,(e,t)=>_get(this,"review","files",e)&&_get(this,"review","files",t.key))?(Vue.set(o,"extra",_.defaults({recoverable:!0},o.extra)),e.capture(o,"store trusted filemap")):(e.markHandled(o),t.prod||console.error("Silenced error:",o))}}finally{_.pull(this._filemapKeysInProgress,r),this.$store.services.breadcrumbSampler.addSampledBreadcrumb("reconciliation-burst",this.$reviewKey,"filemap compute finish",this._buildBreadcrumbData({reason:i,outcome:a,filemapKey:r,currentFilemap:r?s(n.value):void 0}))}}catch(e){Sentry.captureException(e)}}async _matchRenamedFiles(){const t=this.index?this.review.revisions.list[this.index-1]:void 0,s={owner:this.review.core.ownerName,repo:this.review.core.repoName,files:[]};let i,r;_.forEach(this.review.files,e=>{if(e.system||e.vendored)return;let n=_get(e,"revisions",this.$key);if(!n||n.originalFileKey||"added"!==n.action&&"removed"!==n.action)return;"added"===n.action?i=!0:r=!0;const a={key:e.$key,action:n.action};"removed"===n.action&&t&&e.revisions[t.$key]&&(n=e.revisions[t.$key]),Vue.set(a,"sha",n.fileSha||n.baseFileSha),Vue.set(a,"type",n.type||"blob"),a.sha&&"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"!==a.sha&&s.files.push(a)});try{const e=i&&r?await this.$store.services.diffWorkerBridge.matchRenamedFiles(s):{};return _.mapValues(e,e=>_.pick(e,"key","sha"))}catch(t){Vue.set(t,"extra",_.assign({},t.extra,{description:"Failed to compute filemap for "+this.$key})),e.capture(t,"matchRenamedFiles")}}_isStale(){return this.$parent[this.$key]!==this||this.$destroyed||!this.commitSha}snapshot(e){const t="soft"===e;if(this.capturerKey||t&&this.softCapturerKey)return;const s=t?"softCapturerKey":"capturerKey",i=_ref(this,"child",s);i.commit(e=>{if(this._isStale()||!this.$info.userid||e.currentValue)return e.abort();e.set(this.$info.userid)}).catch(e=>this._handleSnapshotError(t,s,i.path,e));const r=_ref(this,"child","captureTimestamp");r.commit(e=>{if(this._isStale()||!this.$info.userid||e.currentValue)return e.abort();e.set(this.$truss.SERVER_TIMESTAMP)}).catch(e=>this._handleSnapshotError(t,"captureTimestamp",r.path,e))}_handleSnapshotError(t,s,i,r){if(!r)return;const n=t?"soft":"hard";return Vue.set(r,"tags",_.assign({},r.tags,{context:"revision snapshot",snapshotMalleability:n,snapshotProperty:s})),Vue.set(r,"extra",_.assign({},r.extra,{context:"revision snapshot",snapshot:{reviewKey:this.$reviewKey,revisionKey:this.$key,malleability:n,operation:"transaction",property:s,path:i}})),this._isStale()||!this.$info.userid?e.markHandled(r):t&&Vue.set(r.extra,"recoverable",!0),Promise.reject(r)}_cancelIfDestroyed(){if(this.$destroyed)throw new Error("Canceled")}}}},!1,!0,{filename:"src/model/reviews/core/reviews.$reviewKey.revisions.$revisionKey.js",modelPath:"/reviews/$reviewKey/revisions/$revisionKey",modelExportName:"Revision"}),_reviewable.define(["Revisions"],["session"],function(e){"use strict";return{Revisions:class Revisions{constructor(){Vue.set(this,"review",this.$parent),this.$observe(()=>this._revisionsThatNeedSnapshotting,()=>{this._snapshotRevisions()}),Vue.set(this,"_prevLastRevisionKey",void 0),Vue.set(this,"_prevRevisionKeys",void 0),Vue.set(this,"_lastRevisionMissing",!1)}get list(){if(this.$ready)return _(this).sortBy(e=>_.parseInt(e.$key.slice(1))).index().value()}get keysList(){if(this.$ready)return _.map(this.list,"$key");const e=this.review.core.lastRevisionKey;return void 0!==e?_.map(_.range(1,(_.parseInt(_access(e,"","slice","call",[1]))||0)+1),e=>"r"+e):void 0}get num(){const e={total:_.size(this.list),snapshotted:0,hardSnapshotted:0,unsnapshotted:0};return _.forEach(this.list,t=>{t.capturerKey?(e.snapshotted++,e.hardSnapshotted++):t.softCapturerKey?e.snapshotted++:e.unsnapshotted++}),e}get lastCaptured(){return _.findLast(this.list,e=>e.capturerKey||e.softCapturerKey)}get filemapsReady(){if(_get(this,"review","context","diffFiles")&&this.$ready)return _.every(this,"filemap")}get filemapsStored(){if(_get(this,"review","context","diffFiles")&&this.$ready)return _.every(this,e=>e.filemap&&(!e.filemap.local||e.filemap.writeFailed)&&!e.computingFilemap)}get _checkLastRevisionPresent(){const e=this.review.core.lastRevisionKey;e&&!_.isEmpty(this)&&(e===this._prevLastRevisionKey&&_.isEqual(_.keys(this),this._prevRevisionKeys)||(this[e]?this._lastRevisionMissing&&(Sentry.captureMessage("Review missing last revision",{level:"debug",tags:{lastRevisionMissing:!1},extra:{pullRequest:this.review.core.pullRequestAddress,reviewKey:this.review.$key,lastRevisionKey:e,prevLastRevisionKey:this._prevLastRevisionKey,revisions:this,prevRevisionKeys:this._prevRevisionKeys}}),Vue.set(this,"_lastRevisionMissing",!1)):(Sentry.captureMessage("Review missing last revision",{level:"debug",tags:{lastRevisionMissing:!0},extra:{pullRequest:this.review.core.pullRequestAddress,reviewKey:this.review.$key,lastRevisionKey:e,prevLastRevisionKey:this._prevLastRevisionKey,revisions:this,prevRevisionKeys:this._prevRevisionKeys}}),Vue.set(this,"_lastRevisionMissing",!0)),Vue.set(this,"_prevLastRevisionKey",e),Vue.set(this,"_prevRevisionKeys",_.keys(this))))}get arcs(){if(!_get(this,"review","context","diffFiles"))return;const e={};return _.forEach(this.list,t=>{t.priorRevisionKey&&this[t.priorRevisionKey]&&(Vue.set(e,t.$key,e[t.$key]||[]),e[t.$key].push(this[t.priorRevisionKey].index),Vue.set(e,t.priorRevisionKey,e[t.priorRevisionKey]||[]),e[t.priorRevisionKey].push(t.index))}),e}get hardSnapshottedRange(){const e=_.findLast(this.list,e=>e.capturerKey);if(e)return e===_.head(this.list)?"r1":"r1.."+e.$key}get _revisionsThatNeedSnapshotting(){if(!this.$info.userid||!this.$ready)return;const t=e.window.focused,s={};_.forEach(this.review.files,e=>{_.forEach(e.revisions,i=>{const r=this[i.$key];if(!r)return!1;r.capturerKey||(i.draftReviewMark||_.some(i.reviewers,e=>"inferred"!==e)?Vue.set(s,r.$key,"hard"):t&&!r.softCapturerKey&&!this.review.userIsAuthor&&_.includes(_get(e,"diff","bounds"),i)&&Vue.set(s,r.$key,"soft"))})});const i=_get(this,"review","state"),r=this[this.review.core.lastRevisionKey],n=r&&!r.captured;return _.forEach(_get(i,"drafts"),e=>{e.revisionKey?(_get(this,e.revisionKey,"capturerKey")||Vue.set(s,e.revisionKey,"hard"),e.otherRevisionKey&&!_get(this,e.otherRevisionKey,"capturerKey")&&Vue.set(s,e.otherRevisionKey,"hard")):t&&n&&!this.review.userIsAuthor&&Vue.set(s,r.$key,"soft")}),!this.review.userIsAuthor&&t&&_(_get(i,"dismissals")).map("discussionKey").concat(_.keys(_get(i,"roleChanges"))).concat(_.keys(_get(i,"acknowledgements"))).forEac
1h(e=>{const t=_get(this,"review","discussions",e);if(!t)return;const i=_get(this,"review","files",t.fileKey);if(i){const e=this[_get(i,"diff","bounds",1,"$key")];e&&!e.captured&&Vue.set(s,e.$key,"soft")}else n&&Vue.set(s,r.$key,"soft")}),s}_snapshotRevisions(){if(_.isEmpty(this._revisionsThatNeedSnapshotting))return;let e=-1,t=-1;_.forEach(this._revisionsThatNeedSnapshotting,(s,i)=>{const r=this[i];if(r)switch(s){case"hard":e=Math.max(e,r.index);break;case"soft":t=Math.max(t,r.index)}}),e>=0&&_.times(e+1,e=>this.list[e].snapshot("hard")),t>=0&&_.times(t+1,e=>this.list[e].snapshot("soft"))}}}},!1,!0,{filename:"src/model/reviews/core/reviews.$reviewKey.revisions.js",modelPath:"/reviews/$reviewKey/revisions",modelExportName:"Revisions"}),_reviewable.define(["CommentCodeblock"],["Codeblock"],function(e){"use strict";return{CommentCodeblock:class CommentCodeblock extends e{constructor(){super(),Vue.set(this,"review",this.$parent.review)}get parley(){return this.$parent.$parent.discussion}get kind(){return this.originalText?void 0===this.suggestedText?"code quote":"suggestion":"code snippet"}get text(){return void 0===this.suggestedText?this.originalText:this.suggestedText}}}},!1,!0,{filename:"src/model/reviews/discussions/reviews.$reviewKey.discussions.$discussionKey.comments.$commentKey.codeblocks.$codeblockKey.js",modelPath:"/reviews/$reviewKey/discussions/$discussionKey/comments/$commentKey/codeblocks/$codeblockKey",modelExportName:"CommentCodeblock"}),_reviewable.define(["CommentCodeblocks"],[],function(){"use strict";return{CommentCodeblocks:class CommentCodeblocks{constructor(){Vue.set(this,"review",this.$parent.review)}get list(){return _(this).values().sortBy("$key").index().value()}}}},!1,!0,{filename:"src/model/reviews/discussions/reviews.$reviewKey.discussions.$discussionKey.comments.$commentKey.codeblocks.js",modelPath:"/reviews/$reviewKey/discussions/$discussionKey/comments/$commentKey/codeblocks",modelExportName:"CommentCodeblocks"}),_reviewable.define(["Comment"],[],function(){"use strict";return{Comment:class Comment{constructor(){Vue.set(this,"review",this.$parent.review),Vue.set(this,"discussion",this.$parent.discussion),Vue.set(this,"index",void 0)}get timestampTimeAgo(){if(_get(this,"review","context","showDiscussions"))return this.$store.services.computeTimeAgo(this.timestamp)}get timestampLocalTime(){if(_get(this,"review","context","showDiscussions"))return this.$store.services.formatLocalTime(this.timestamp)}get sameTimeAgoAsPreviousComment(){if(!_get(this,"review","context","showDiscussions")||!this.index)return;const e=this.$parent.list[this.index-1];return e&&e.timestampTimeAgo===this.timestampTimeAgo}}}},!1,!0,{filename:"src/model/reviews/discussions/reviews.$reviewKey.discussions.$discussionKey.comments.$commentKey.js",modelPath:"/reviews/$reviewKey/discussions/$discussionKey/comments/$commentKey",modelExportName:"Comment"}),_reviewable.define(["Comments"],["mangler"],function(e){"use strict";return{Comments:class Comments{constructor(){Vue.set(this,"discussion",this.$parent),Vue.set(this,"review",this.discussion.review)}get list(){let e=_.sortBy(this,"timestamp");return e=_.reject(e,{$key:"prDescription"}),_get(this,"review","files","-commits")&&(e=_.reject(e,{provenance:"synthetic"})),_.forEach(e,(e,t)=>{Vue.set(e,"index",t)}),e}get firstNewishComment(){if(!_get(this,"review","context","showDiscussions"))return;if(!this.list&&!this.$info.userid)return;const e=_get(this,"discussion","tracker","currentParticipant","timestamp")||0;return _.find(this.list,t=>t.timestamp>e)}get firstNewComment(){if(!_get(this,"review","context","showDiscussions"))return;if(!this.list&&!this.$info.userid)return;const e=_get(this,"discussion","tracker","currentEffectiveTimestamp")||0;return _.find(this.list,t=>t.timestamp>e)}get firstVisibleComment(){if(_get(this,"review","context","showDiscussions")&&(!_get(this,"discussion","tracker","irrelevant")||this.firstNewComment)){if(this.list&&this.$info.userid){const e=this.firstNewishComment?this.firstNewishComment.index:this.list.length;return this.list[Math.max(0,e-2)]}return _.head(this.list)}}get verificationTimeAgo(){return this.$store.services.computeTimeAgo(_get(this,"discussion","tracker","overall","postOrRoleTimestamp"))}get verificationTimeAgoSameAsLastComment(){return this.verificationTimeAgo===_access(_,"","last","call",[this.list],"","timestampTimeAgo")}quoteLast(t){if(_.isEmpty(this))return;const s=_(this).reject(e=>"synthetic"===e.provenance||e.timestamp>t).maxBy("timestamp");if(!_get(s,"markdownBody"))return;let i;const r=this.$store.services.avatars.users[s.authorKey];return r?(i=r.username,r.displayName&&(i+=" ("+r.displayName+")")):i="somebody","<details><summary><i>Previously, "+i+" wroteâ¦</i></summary><blockquote>\n\n"+e.renderOpenCodeBlocks(e.renderCustomEmojis(s.markdownBody.replace(/^[\n\r]*(.*?)[\
1n\r]*$/g,"$1"),s.$key))+"\n</blockquote></details>\n\n"}}}},!1,!0,{filename:"src/model/reviews/discussions/reviews.$reviewKey.discussions.$discussionKey.comments.js",modelPath:"/reviews/$reviewKey/discussions/$discussionKey/comments",modelExportName:"Comments"}),_reviewable.define(["Discussion"],["Parley"],function(e){"use strict";return{Discussion:class Discussion extends e{constructor(){super(),Vue.set(this,"review",this.$parent.$parent),Vue.set(this,"type","discussion")}get num(){return{commentsByAuthorKey:_(this.comments).groupBy("authorKey").mapValues("length").value()}}get canInlineReply(){return!!_get(this,"comments",this.$key,"nodeId")}}}},!1,!0,{filename:"src/model/reviews/discussions/reviews.$reviewKey.discussions.$discussionKey.js",modelPath:"/reviews/$reviewKey/discussions/$discussionKey",modelExportName:"Discussion"}),_reviewable.define(["Discussions"],[],function(){"use strict";return{Discussions:class Discussions{constructor(){Vue.set(this,"review",this.$parent)}get allParleyCodeblockMappingRequestsByFileKey(){return _(this.$values).flatMap(e=>e.comments.$values).concat(_get(this,"review","state","drafts","$values")||[]).flatMap(e=>_get(e,"codeblocks","list")).map(e=>_get(e,"mappingRequest")).compact().groupBy("fileKey").value()}get parleys(){return _.concat(this.$values,_get(this,"review","state","drafts","$values")||[])}get matrixParleys(){return _.reject(this.parleys,e=>"draft"===e.type&&e.tracker||"-cmd"===e.$key)}get fileIndexByPath(){return _(this.matrixParleys).map("file").orderBy(["index"],["desc"]).keyBy("path").mapValues("index").value()}get matrixRows(){if(!_get(this,"review","context","toggles","discussionMatrix","shown"))return;let e=null,t=!1;return _(this.matrixParleys).map(e=>{const t=e.tracker,s="draft"===e.type?e.sendingWillResolve?"5.Resolved":"3.Unresolved":_get(t,"replied")?_get(t,"read")?!_get(t,"resolved")&&_get(t,"resolvedIf","draftsSent")?"4.Resolved after publishing":_get(t,"resolved")||"-top"===e.$key?"5.Resolved":"3.Unresolved":"2.Unread":"1.To reply";return{type:"parley",parley:e,key:`parley:${e.$key}`,group:s}}).sortBy(e=>["-top"!==e.parley.$key,e.parley.file?_get(this,"fileIndexByPath",e.parley.file.path):-1,e.parley.creationTimestamp||e.parley.timestamp]).groupBy("group").flatMap((e,t)=>[{type:"spacer",group:t,key:`group-spacer:${t}`},{type:"group",group:t,key:`group:${t}`,label:t.replace(/\d+\./,""),numDiscussions:e.length},..._.map(e,(e,s)=>({...e,group:t,striped:!(s%2)}))]).sortBy("group").drop(1).flatMap(s=>{if("parley"===s.type&&s.parley.file&&s.parley.file.path!==e){const i=e=s.parley.file.path;return[{type:"file",path:i,key:`file:${s.group}/${i}`,group:s.group,striped:t},{...s,striped:!t}]}return"parley"===s.type?(t=!t,{...s,striped:!t}):"group"===s.type?(t=!1,e=null,s):"spacer"===s.type?s:void 0}).value()}}}},!1,!0,{filename:"src/model/reviews/discussions/reviews.$reviewKey.discussions.js",modelPath:"/reviews/$reviewKey/discussions",modelExportName:"Discussions"}),_reviewable.define(["TopDiscussions"],[],function(){"use strict";return{TopDiscussions:class TopDiscussions{static get $trussMount(){return{path:"/reviews/$reviewKey/discussions/top",local:!0,hidden:!0}}constructor(){Vue.set(this,"review",this.$parent.$parent)}get parleys(){return _(this.$parent.$values).concat(_get(this,"review","state","drafts","$values")||[]).reject("fileKey").value()}}}},!1,!0,{filename:"src/model/reviews/discussions/reviews.$reviewKey.discussions.top.js",modelPath:"/reviews/$reviewKey/discussions/top",modelExportName:"TopDiscussions"}),_reviewable.define(["TopLocator"],[],function(){"use strict";return{TopLocator:class TopLocator{constructor(){Vue.set(this,"review",this.$parent.review),Vue.set(this,"commentExhibitionLevel",void 0),Vue.set(this,"initiallyHidden",void 0),this.$observe(()=>this.commentExhibitionLevel,(e,t)=>{t<0&&e>=0&&(this.$parent.autoUnhideCounter+=1)})}get discussion(){return _get(this,"review","discussions",this.$key)}get tracker(){return _get(this,"review","tracker",this.$key)}get draft(){return _get(this,"review","state","drafts",this.$key)}get parley(){return this.discussion||this.draft}get timestamp(){return _get(this,"parley","creationTimestamp")||_get(this,"parley","timestamp")}get disposition(){return this.tracker?this.tracker.currentEffectiveDisposition:this.draft?this.draft.dis
1position:void 0}get dispositionIsProvisional(){return!this.draft&&_get(this,"review","state","roleChanges",this.$key)}get dispositionWillResolve(){return this.tracker?!this.tracker.resolved&&_get(this,"tracker","resolvedIf","draftsSent"):!!this.draft&&this.draft.sendingWillResolve}get dispositionWillNewlyPreventResolving(){return("blocking"===this.disposition||"working"===this.disposition)&&_get(this,"parley","blockingWillNewlyPreventResolving")}get viableDispositions(){const e={[this.disposition]:!0,discussing:!0,blocking:!0,working:!0,[this.tracker?"satisfied":"informing"]:!0,pondering:!!this.draft};return this.draft||Vue.set(e,_get(this,"tracker","currentParticipant","disposition")||"uninvolved",!0),e}get stage(){return _access(this,"","review","","state","","drafts","","getDraftStage","call",[this.$key])}get resolutionLevel(){return!!_get(this,"discussion","comments")+!!_get(this,"tracker","resolvedIf","draftsSent")+!(!_get(this,"tracker","resolvedIf","draftsSent")||!_get(this,"tracker","informing"))}get resolutionLevelNeedsPublishing(){return!!_get(this,"discussion","comments")+!!_get(this,"tracker","resolved")+!(!_get(this,"tracker","resolved")||!_get(this,"tracker","informing"))!==this.resolutionLevel}get hidden(){if(this.tracker&&void 0===this.tracker.irrelevant||!_get(this,"review","context"))return;const e=_get(this,"tracker","irrelevant")&&!this.dispositionIsProvisional&&!_get(this,"parley","targeted");return _get(this,"diff","showing")||!this.diff&&this.$parent.ready?(void 0===this.commentExhibitionLevel?Vue.set(this,"commentExhibitionLevel",e?-1:0):!e&&this.commentExhibitionLevel<0&&Vue.set(this,"commentExhibitionLevel",0),void 0===this.initiallyHidden&&Vue.set(this,"initiallyHidden",!!e)):void 0===this.commentExhibitionLevel?e?(Vue.set(this,"commentExhibitionLevel",-1),Vue.set(this,"initiallyHidden",!0)):((this.commentExhibitionLevel<0||void 0===this.commentExhibitionLevel)&&Vue.set(this,"commentExhibitionLevel",0),Vue.set(this,"initiallyHidden",!1)):Vue.set(this,"initiallyHidden",-1===this.commentExhibitionLevel),-1===this.commentExhibitionLevel}get locked(){return _access(this,"","review","","state","","isLocked","call",[this.$key])}reverseCommentExhibitionLevel(){this.commentExhibitionLevel>0?Vue.set(this,"commentExhibitionLevel",0):Vue.set(this,"commentExhibitionLevel",1)}lock(){_access(this,"","review","","state","","lock","call",[[this.$key]])}unlock(){return _access(this,"","review","","state","","unlock","call",[[this.$key]])}}}},!1,!0,{filename:"src/model/reviews/discussions/reviews.$reviewKey.discussions.top.locators.$discussionKey.js",modelPath:"/reviews/$reviewKey/discussions/top/locators/$discussionKey",modelExportName:"TopLocator"}),_reviewable.define(["TopLocators"],[],function(){"use strict";return{TopLocators:class TopLocators{constructor(){Vue.set(this,"top",this.$parent),Vue.set(this,"review",this.top.review),Vue.set(this,"autoUnhideCounter",0)}get _updateLocators(){const e={};_(this.top.parleys).map("$key").push("-cmd").uniq().forEach(t=>{Vue.set(e,t,{active:!0})}),this.$set(e)}get num(){return{hidden:_.countBy(this,e=>e.hidden&&"-top"!==e.$key).true||0}}get ready(){return!(!_.isEmpty(this.top.parleys)&&_.isEmpty(this))&&(!!this["-top"]&&_.every(this,e=>void 0!==e.initiallyHidden))}get list(){return _.sortBy(this,e=>"-top"!==e.$key,e=>e.initiallyHidden,e=>e.timestamp||0)}}}},!1,!0,{filename:"src/model/reviews/discussions/reviews.$reviewKey.discussions.top.locators.js",modelPath:"/reviews/$reviewKey/discussions/top/locators",modelExportName:"TopLocators"}),_reviewable.define(["Tracker"],["session","draftFocusTracker"],function(e,t){"use strict";return{Tracker:class Tracker{constructor(){Vue.set(this,"review",this.$parent.$parent)}get discussion(){return _get(this,"review","discussions",this.$discussionKey)}get draft(){return _get(this,"review","state","drafts",this.$discussionKey)}get effectiveParticipants(){if("-top"!==this.$key)return this.participants;const e=_get(this,"discussion","comments","prDescription","timestamp"),t=this.review.core.pullRequestTimestamp-1,s=_(_get(this,"discussion","comments")).filter({provenance:"synthetic"}).map("timestamp").max();return _.omitBy(this.participants,(i,r)=>r===this.review.core.authorKey&&(_.isMatch(i,{role:"following",roleTimestamp:e,timestamp:s,lastPostTimestamp:s})||_.isMatch(i,{role:"following",roleTimestamp:e,timestamp:e,lastPostTimestamp:e})||_.isMatch(i,{role:"following",roleTimestamp:t,timestamp:t,lastPostTimestamp:t})))}get currentParticipant(){return _get(this,"effectiveParticipants",this.$info.userid)}get currentEffectiveDisposition(){return this.draft?this.draft.dis
1position:null===this.$info.userid?"uninvolved":_get(this,"review","stateReady")&&this.$info.userid?_get(this,"review","state","roleChanges",this.$discussionKey)||_get(this,"currentParticipant","disposition")||"uninvolved":void 0}get currentEffectiveTimestamp(){return this.draft?this.draft.timestamp:Math.max(_get(this,"review","state","acknowledgements",this.$discussionKey)||0,_get(this,"currentParticipant","timestamp")||0)||void 0}get activeParticipants(){return _.filter(this.effectiveParticipants,"active")}_doesWildcardUnrepliedApplyTo(e){const t=_get(this,"activeParticipants",0,"$key")||this.$info.userid;if(e===t)return!1;const s=_get(this,"review","people",t,"author");if(e===this.$info.userid)return this.review.userIsAuthor||s&&this.review.userIsReviewer;const i=_get(this,"review","people",e);return!!(_get(i,"author")||s&&_get(i,"activeOrRequestedReviewer"))}get otherParticipants(){if(_get(this,"review","context","showDiscussions"))return _(this.effectiveParticipants).reject(e=>e.$key===this.$info.userid).sortBy("$key").value()}get otherUnforcedParticipants(){if(_get(this,"review","context","showDiscussions"))return _.reject(this.otherParticipants,"forced")}get otherActiveParticipants(){if(_get(this,"review","context","showDiscussions"))return _.reject(this.activeParticipants,e=>e.$key===this.$info.userid)}get undismissedImpedingParticipants(){return _(this.effectiveParticipants).filter({impeding:!0,dismissable:!0}).reject("dismissal").value()}get unpublishedDismissedParticipants(){return _.filter(this.effectiveParticipants,"dismissal")}get overall(){const e={timestamp:_(this.effectiveParticipants).map("lastPostTimestamp").push(null).max(),roleTimestamp:_(this.effectiveParticipants).reject({$userKey:this.$info.userid}).map("roleTimestamp").max(),unresolvedTimestamp:_(this.effectiveParticipants).reject(e=>_.includes(["following","mentioned","satisfied","informing","dismissed"],e.disposition)).map(e=>e.lastObjectionTimestamp||e.lastPostTimestamp).push(-1).max()};Vue.set(e,"postOrRoleTimestamp",_.max([e.timestamp,e.roleTimestamp]));const t=_access(_,"call",[_get(this,"discussion","comments")],"","reject","call",[{provenance:"synthetic"}],"","reject","call",[{$key:"prDescription"}],"","maxBy","call",["timestamp"],"","timestamp")||0;return Vue.set(e,"organicPostOrRoleTimestamp",_.max([t,e.roleTimestamp])),e}get _unreadUserKeys(){if(!this.overall||!this.review.stateReady||void 0===this.$info.userid)return;if(!this.$info.userid)return[];const e=_.some(this.effectiveParticipants,e=>"informing"===e.disposition),t=_(this.effectiveParticipants).reject(t=>t.forced&&this.resolved&&!e).filter(e=>e.effectivelyActive||"mentioned"===e.effectiveDisposition||e===this.currentParticipant).filter(e=>(e.effectiveTimestamp||0)<this.overall.timestamp).map("$key").value();return!this.currentParticipant&&(this.currentEffectiveTimestamp||"-top"===this.$discussionKey&&(this.review.userIsAuthor||this.review.userIsReviewer)?(this.currentEffectiveTimestamp||0)<this.overall.timestamp:e)&&t.push(this.$info.userid),t}get resolvedIf(){return"-top"===this.$discussionKey?{}:{discussing:this._willBeResolvedIfDispositionChangedTo("discussing",!0),satisfied:this._willBeResolvedIfDispositionChangedTo("satisfied",!0),draftsSent:!!this.currentEffectiveDisposition&&this._willBeResolvedIfDispositionChangedTo(this.currentEffectiveDisposition,!0)}}get _unrepliedUserKeys(){if(!(this._unreadUserKeys&&void 0!==this.$info.userid&&this.review.core&&this.activeParticipants))return;if(!this.$info.userid)return[];const e=_.toArray(this.effectiveParticipants),t=_.clone(this.activeParticipants),s=_get(this,"draft","disposition")||_get(this,"review","state","roleChanges",this.$discussionKey);if(!this.currentParticipant&&s){const i={$key:this.$info.userid,effectiveDisposition:s,effectivelyActive:_.includes(["satisfied","informing","discussing","blocking","working"],s)};e.push(i),i.effectivelyActive&&t.push(i)}{const t=_(e).filter(e=>"working"===e.effectiveDisposition).map("$key").union(this._unreadUserKeys).value();if(t.length)return t}if(_get(this,"resolvedIf","draftsSent")||"-top"===this.$discussionKey)return[];if(1===t.length)return["*"];const i=_.maxBy(e,e=>e.lastPostTimestamp||0).$key;{const t=_(e).filter(e=>e.$key!==i&&"blocking"===e.effectiveDisposition).map("$key").value();if(t.length)return t}{const t=_(e).filter(e=>e.$key!==i&&"discussing"===e.effectiveDisposition).map("$key").value();if(t.length)return t}{const t=_(e).filter(e=>"blocking"===e.effectiveDisposition).map("$key").value();if(t.length)return t}return _access(_,"","find","call",[e,{$key:this.firstAuthorKey}],"","effectivelyActive")?[this.firstAuthorKey]:_.map(t,"$key")}get unrepliedUserKeySet(){return _.keyBy(this._unrepliedUserKeys)}get involved(){if(null===this.$info.userid)return!1;if(!this.$info.userid||!this.currentEffectiveDisposition||!this.unrepliedUserKeySet)return;const e=this.review.people[this.$info.userid],t=this.$info.user.github;return!!(this.unrepliedUserKeySet["*"]&&this._doesWildcardUnrepliedApplyTo(this.$info.userid)&&(this.review.userIsAuthor||_get(e,"activeOrRequestedReviewer")||t.agentKey&&_get(this,"review","people",t.ownerKey,"requestedReviewer")))||"uninvolved"!==this.currentEffectiveDisposition&&("-top"===this.$key?!!(_get(this,"currentParticipant","lastPostTimestamp")||this.draft||_get(e,"author")||_get(e,"activeOrRequestedReviewer")):"following"!==this.currentEffectiveDisposition)}get read(){return!this.$info.userid||!this._unreadUserKeys||!_.includes(this._unreadUserKeys,this.$info.userid)}get resolved(){return"-top"!==this.$discussionKey&&this._willBeResolvedIfDispositionChangedTo()}get verificationNeeded(){if(e.settings.$ready){if(!e.settings.trustButVerify)return!1;if(void 0!==this.$info.userid){if("discussing"!==_get(this,"currentParticipant","disposition"))return!1;if(void 0!==this.resolved&&this.review.stateReady)return!(!this.resolved||this.currentEffectiveTimestamp<this.overall.timestamp)&&!(this.currentEffectiveTimestamp>=this.overall.roleTimestamp)}}}get replied(){if(void 0!==this.$info.userid){if(!this.$info.userid)return!0;
1if(void 0!==this.verificationNeeded){if(this.verificationNeeded)return!1;if(this._unreadUserKeys){if(_.includes(this._unreadUserKeys,this.$info.userid))return!1;if(this.draft||_get(this,"review","state","roleChanges",this.$discussionKey))return!0;if(this._unrepliedUserKeys&&this.unrepliedUserKeySet)return!this.unrepliedUserKeySet[this.$info.userid]&&(!this.unrepliedUserKeySet["*"]||!this._doesWildcardUnrepliedApplyTo(this.$info.userid))}}}}_willBeResolvedIfDispositionChangedTo(e,t){if("pondering"===e)return!1;const s=_.keys(this.effectiveParticipants);e&&!_.includes(s,this.$info.userid)&&s.push(this.$info.userid);let i=0,r=0,n=0;return _.forEach(s,s=>{const a=_get(this,"effectiveParticipants",s);let o=_get(a,t?"effectiveDisposition":"disposition");switch(e&&s===this.$info.userid&&(o=e),o){case"satisfied":case"informing":i++,r++;break;case"discussing":i++;break;case"blocking":case"working":i++,n++}}),Boolean(!i||r&&!n)}get legacyResolved(){if("-top"===this.$discussionKey)return!1;if(1===_get(this,"activeParticipants","length")&&"discussing"===this.activeParticipants[0].role)return!1;let e=!1,t=!1,s=!_.some(this.effectiveParticipants,s=>{switch(s.role){case"following":case"mentioned":case"dismissed":case"withdrawn":return!1;case"satisfied":case"informing":return e=!0,!1;case"discussing":{if(_get(s,"acceptedTimestamp")===Number.MAX_VALUE)return t=!0,!1;const i=_get(s,"acceptedTimestamp")||_get(s,"timestamp")||0,r=this.overall&&(-1===this.overall.unresolvedTimestamp||i>=this.overall.unresolvedTimestamp);return e=e||r,!r}case"blocking":case"working":return!0}});return s&&!e&&t&&(s=!1),s}get informing(){return _.some(this.effectiveParticipants,{effectiveDisposition:"informing"})||"informing"===this.currentEffectiveDisposition}get irrelevant(){return"-top"!==this.$discussionKey&&(void 0!==this.resolvedIf.draftsSent&&void 0!==this.replied&&this.review.stateReady?Boolean(this.resolvedIf.draftsSent&&this.replied&&this.review.stateReady&&!this.draft):void 0)}get replyAction(){return this.overall.timestamp?_get(this,"currentParticipant","lastPostTimestamp")>=_get(this,"overall","timestamp")?"Follow up":"Reply":"Start"}get primaryAction(){if(_get(this,"review","context","showDiscussions")&&_get(this,"review","state")){if("-top"!==this.$discussionKey&&!_get(this,"review","state","roleChanges",this.$discussionKey))if(this.resolved){if("informing"===_get(this,"currentParticipant","disposition"))return _get(this,"otherUnforcedParticipants","length")?"conclude":"retract"}else{if("satisfied"!==_get(this,"currentParticipant","disposition")&&(_get(this,"currentParticipant","active")||this.review.userIsAuthor)&&_get(this,"discussion","satisfiedWillResolve"))return _get(this,"currentParticipant","active")&&!_get(this,"otherUnforcedParticipants","length")?"retract":"resolve";if(this.review.userIsAuthor&&(this.currentEffectiveTimestamp||0)<_get(this,"overall","timestamp")&&!_.some(this.otherActiveParticipants,{disposition:"working"})||"working"===_get(this,"currentParticipant","disposition"))return"done";if("blocking"===_get(this,"currentParticipant","disposition")&&!_.some(this.effectiveParticipants,{disposition:"working"}))return"accept"}return(this.currentEffectiveTimestamp||0)<_get(this,"overall","timestamp")||this.verificationNeeded&&(this.currentEffectiveTimestamp||0)<_get(this,"overall","roleTimestamp")?"acknowledge":this.$info.userid&&"-top"===this.$discussionKey&&!_get(this,"review","draftOnly")&&_get(this,"review","context","lgtmConfig")?_get(this,"review","votingSanctionAllowed")&&"approved"!==_get(this,"review","people",this.$info.userid,"sanction")?"approve":"lgtm":void 0}}get primaryActionIcon(){if(this.primaryAction&&!_.includes(["acknowledge","approve","lgtm"],this.primaryAction))return"disposition satisfied"}get primaryActionImage(){if("approve"===this.primaryAction||"lgtm"===this.primaryAction)return _get(this,"review","context","lgtmConfig","emojiUrl")}get primaryActionLabel(){if("lgtm"!==this.primaryAction)return this.primaryAction}takePrimaryAction(){if(this.primaryAction&&!_access(this,"","review","","state","","isLocked","call",[]))switch(Vue.set(e.onboarding,"acknowledgedDiscussion",!0),this.primaryAction){case"done":this.review.state.drafts.createReplyDraft(this.discussion,"Done.",!0,"satisfied");break;case"conclude":case"retract":case"resolve":case"accept":this.acknowledge("satisfied");break;case"acknowledge":this.acknowledge();break;case"approve":this.lgtmAndApprove(!0);break;case"lgtm":this.lgtmAndApprove()}}async lgtmAndApprove(e,s){await this.$when(()=>_get(this,"review","state")&&_get(this,"review","context","lgtmConfig","text")),e&&_get(this,"review","votingSanctionAllowed")&&Vue.set(this.review.state,"effectiveSanction","approved");const i=_get(this,"review","state","drafts","-top"),r=this.review.context.lgtmConfig.text;if(i){const e=i.markdownBody?i.markdownBody+`\n${r}`:r;i.$update({markdownBody:e}),t.focus(i.$key,s)}else this.review.state.drafts.createReplyDraft(this.review.discussions["-top"],r,!0,void 0,s)}_prepareAcknowledgeUpdates(e){if(!this.$info.userid||_access(this,"","review","","state","","isLocked","call",[]))return;const t={},s=this.overall.postOrRoleTimestamp;return(this.currentEffectiveTimestamp||0)<s&&Vue.set(t,_ref(this,"child","review","state","acknowledgements",this.$discussionKey),s),e&&Vue.set(t,_ref(this,"child","review","state","roleChanges",this.$discussionKey),e),this.draft&&this.draft.timestamp<s&&Vue.set(t,_ref(this,"child","draft","timestamp"),s),_.isEmpty(t)?void 0:{updates:t,timestamp:s}}acknowledge(e){const t=this._prepareAcknowledgeUpdates(e);if(t)return this.review.state.$update(t.updates)}acknowledgeBulk(e){const t=this._prepareAcknowledgeUpdates();if(t)return _.assign(e,t.updates),t.timestamp}undoAcknowledge(e,t){if(!this.$info.userid||_access(this,"","review","","state","","isLocked","call",[]))return;const s={};_get(this,"review","state","acknowledgements",this.$discussionKey)===e&&Vue.set(s,_ref(this,"child","review","state","acknowledgements",this.$discussionKey),null),_get(this,"draft","timestamp")===e&&Vue.set(s,_ref(this,"child","draft","timestamp"),e),_.isEmpty(s)||(t?_.assign(t,s):this.review.state.$update(s))}setDisposition(t){if(this.$info.userid&&!_access(this,"","review","","state","","isLocked","call",[])){if
1(Vue.set(e.onboarding,"setRole",!0),(_get(this,"currentParticipant","disposition")||"uninvolved")===t)t=null;else{if(_.includes(["mentioned","withdrawn",_get(this,"currentParticipant","active")?"following":null],t))return;"informing"===t&&(t="satisfied")}_ref(this,"child","review","state","roleChanges",this.$key).set(t)}}dismissBlocking(){_access(this,"","review","","state","","isLocked","call",[])||_.forEach(this.undismissedImpedingParticipants,e=>{e.dismiss(!1)})}cancelPendingDismissals(){_access(this,"","review","","state","","isLocked","call",[])||_.forEach(this.unpublishedDismissedParticipants,e=>{e.undismiss(!1)})}}}},!1,!0,{filename:"src/model/reviews/discussions/reviews.$reviewKey.tracker.$discussionKey.js",modelPath:"/reviews/$reviewKey/tracker/$discussionKey",modelExportName:"Tracker"}),_reviewable.define(["Participant"],["session"],function(e){"use strict";const t=["satisfied","informing","discussing","blocking","working"],s=["blocking","working"];return{Participant:class Participant{constructor(){Vue.set(this,"tracker",this.$parent.$parent),Vue.set(this,"review",this.tracker.review),Vue.set(this,"_dismissalKey",`${this.$discussionKey}|${this.$userKey}`)}get draft(){if(this.$userKey===this.$info.userid)return _get(this,"review","state","drafts",this.$discussionKey)}get effectiveTimestamp(){return this.$userKey===this.$info.userid?this.tracker.currentEffectiveTimestamp:this.timestamp}get disposition(){if("discussing"===this.role&&this.acceptedTimestamp!==Number.MAX_VALUE){const e=this.acceptedTimestamp||this.timestamp||0;return this.tracker.overall&&(-1===this.tracker.overall.unresolvedTimestamp||e>=this.tracker.overall.unresolvedTimestamp)?this.tracker.legacyResolved?"satisfied":"discussing":"blocking"}return"withdrawn"===this.role?"satisfied":"satisfied"!==this.role||this.tracker.firstAuthorKey||1!==_.size(this.tracker.activeParticipants)||this.lastPostTimestamp!==this.roleTimestamp?this.role:"informing"}get effectiveDisposition(){return this.$userKey===this.$info.userid?this.tracker.currentEffectiveDisposition:this.dismissal?"dismissed":this.disposition}get active(){return _.includes(t,this.disposition)}get effectivelyActive(){return _.includes(t,this.effectiveDisposition)}get impeding(){return _.includes(s,this.disposition)}get dismissable(){if(_get(this,"review","context","showDiscussions"))return this.$userKey===this.$info.userid?this.active&&"dismissed"!==this.tracker.currentEffectiveDisposition&&!_get(this,"draft","defaultDispositionType"):this.effectivelyActive&&_get(this,"review","verdict",_get(this,"review","repository","core","settings","discussionDismissalRestriction")||"push")}get dismissal(){if(_get(this,"review","context","showDiscussions"))return _get(this,"review","state","dismissals",this._dismissalKey)}get effectiveDismisserKey(){return this.dismissal||"dismissed"===this.effectiveDisposition&&!this.dismisserKey?this.$info.userid:this.dismisserKey}dismiss(t){const s={};t?_.forEach(this.review.tracker,e=>{if("-top"===e.$discussionKey)return;const t=_get(e,"participants",this.$userKey);t&&!e.resolved&&t._updateDismissal(s)}):this._updateDismissal(s),_.isEmpty(s)||(Vue.set(e.onboarding,"dismissedParticipant",!0),_ref(this,"child","review","state").update(s))}_updateDismissal(e){this.dismissable&&Vue.set(e,_ref(this,"child","review","state","dismissals",`${this.$discussionKey}|${this.$userKey}`),{discussionKey:this.$discussionKey,targetUserKey:this.$userKey})}undismiss(e){e?_.forEach(this.review.tracker,e=>{if("-top"===e.$discussionKey)return;const t=_get(e,"participants",this.$userKey);_get(t,"dismissal")&&!e.resolved&&t.dismissal.$set(null)}):_access(this,"","dismissal","","$set","call",[null])}}}},!1,!0,{filename:"src/model/reviews/discussions/reviews.$reviewKey.tracker.$discussionKey.participants.$userKey.js",modelPath:"/reviews/$reviewKey/tracker/$discussionKey/participants/$userKey",modelExportName:"Participant"}),_reviewable.define(["Trackers"],[],function(){"use strict";function e(e,t){return!!(e&t)}function t(e,t,s){t&&Vue.set(e,t,(e[t]||0)|s)}return{Trackers:class Trackers{constructor(){Vue.set(this,"review",this.$parent),Vue.set(this,"_undoMemento",null)}get num(){if(!_get(this,"review","stateReady"))return;let e;if(this.$ready)e={unread:_(this).reject("read").size(),unreplied:_(this).reject("replied").size(),involvedUnreplied:_(this).reject("replied").filter("involved").size(),unresolved:_(this).reject("resolved").size()-1,unresolvedIfDraftsSent:_(this).reject("resolvedIf.draftsSent").size()-1+(_get(this,"review","state","num","newUnresolvedDiscussionsIfDraftsSent")||0)};else{const t=this._dashboardCache;if(!t)return;e={unread:t.numUnreadDiscussions,unreplied:t.numUnrepliedDiscussions,involvedUnreplied:t.numInvolvedUnrepliedDiscussions,unresolved:t.numUnresolvedDiscussions,unresolvedIfDraftsSent:t.numUnresolvedDiscussionsIfDraftsSent}}return Vue.set(e,"left",e.unreplied||e.unresolvedIfDraftsSent),e.unreplied?Vue.set(e,"description",`${e.unreplied}
1 discussion${1===e.unreplied?"":"s"} awaiting your response`+(this.review.userHasDeferred?" (deferred)":"")+"."):e.unresolvedIfDraftsSent&&Vue.set(e,"description",`${e.unresolvedIfDraftsSent} unresolved discussion`+(1===e.unresolvedIfDraftsSent?"":"s")+" waiting on response from others."),e}get lastOrganicPostOrRoleTimestamp(){return this.$ready?_(this).map("overall.organicPostOrRoleTimestamp").maxBy():_get(this,"_dashboardCache","lastOrganicPostOrRoleTimestamp")}get currentUserWorking(){return this.$ready?_.some(this,e=>"working"===e.currentEffectiveDisposition):_get(this,"_dashboardCache","currentUserWorking")}get discussionParticipantFlags(){if(!this.$ready){const e=this._dashboardCache;if(!e)return;return _get(e,"discussionParticipantFlags")||{}}const e={};return _.forEach(this,s=>{_.forEach(s.participants,i=>{const r=i.$userKey;("-top"!==s.$key||i.lastPostTimestamp)&&t(e,r,16),(i.effectivelyActive||"-top"===s.$key&&i.lastPostTimestamp)&&t(e,r,1),_.includes(["blocking","working"],i.effectiveDisposition)&&t(e,r,2),"-top"!==s.$key&&"mentioned"===i.disposition&&t(e,r,4)}),"-top"!==s.$key&&t(e,s.firstAuthorKey,8)}),e}get dashboardPeople(){const t=this.discussionParticipantFlags;if(t)return _.mapValues(t,t=>({...e(t,16)&&{inDiscussion:!0},...e(t,1)&&{activeInDiscussion:!0},...e(t,2)&&{discussionBlocking:!0},...e(t,4)&&{currentLocalMentionee:!0},...e(t,8)&&{discussionStarter:!0}}))}get dashboardCacheProjection(){if(!this.$ready||!_get(this,"review","stateReady"))return;const e=this.num;if(!e)return;const t=this.lastOrganicPostOrRoleTimestamp,s=this.discussionParticipantFlags;return{numUnreadDiscussions:e.unread,numUnrepliedDiscussions:e.unreplied,numInvolvedUnrepliedDiscussions:e.involvedUnreplied,numUnresolvedDiscussions:e.unresolved,numUnresolvedDiscussionsIfDraftsSent:e.unresolvedIfDraftsSent,currentUserWorking:this.currentUserWorking,..._.isNumber(t)&&{lastOrganicPostOrRoleTimestamp:t},...!_.isEmpty(s)&&{discussionParticipantFlags:s}}}get _dashboardCache(){if("valid"===_get(this,"review","state","dashboardTrackerCacheValidity"))return _get(this,"review","state","dashboardCache")}acknowledgeUnread(){const e={},t=_(this).map(t=>{if(t.read)return;const s=t.acknowledgeBulk(e);return s?{tracker:t,timestamp:s}:void 0}).compact().value();_.isEmpty(e)||(Vue.set(this,"_undoMemento",t),this.review.state.$update(e))}undoAcknowledgeUnread(){if(!this._undoMemento)return;const e={};_.forEach(this._undoMemento,({tracker:t,timestamp:s})=>{t.undoAcknowledge(s,e)}),Vue.set(this,"_undoMemento",null),_.isEmpty(e)||this.review.state.$update(e)}get undoAcknowledgeUnreadPossible(){return!!this._undoMemento}}}},!1,!0,{filename:"src/model/reviews/discussions/reviews.$reviewKey.tracker.js",modelPath:"/reviews/$reviewKey/tracker",modelExportName:"Trackers"}),_reviewable.define(["DesignatedReviewers"],[],function(){"use strict";return{DesignatedReviewers:class DesignatedReviewers{constructor(){Vue.set(this,"review",this.$parent)}get effectiveValue(){return _get(this,"review","state","drafts","completionConditionResult","designatedReviewers")||this}get present(){return!_.isEmpty(this)}get draftDesignatedReviewers(){return _get(this,"review","state","drafts","completionConditionResult","designatedReviewers")}get designations(){return this.draftDesignatedReviewers?this.prospectiveDesignations:this.currentDesignations}get currentDesignations(){return this._computeDesignations(this)}get prospectiveDesignations(){return this._computeDesignations(this.draftDesignatedReviewers)}get allDesignationsList(){return _([]).concat(_.values(this.currentDesignations)).concat(_.values(this.prospectiveDesignations)).value()}_computeDesignations(e){return _(e).flatMap(e=>{const t=_(e.subjects).split(",").map(e=>{const t=e.match(/^[^a-z]+/i),s=t?t[0]:"",i=_.includes(s,"~"),r=_.includes(s,"+");let n=e.slice(s.length);return _.startsWith(n,"team:")&&(n=n.replace(/^team:/,`team:${this.review.core.ownerName}/`)),{subjectKey:n,omitBaseChanges:i,includeAuthor:r}}).value(),s=_.find(t,{subjectKey:"builtin:anyone"}),i=s&&{...s,includeAuthor:_.some(t,{subjectKey:"builtin:anyone",includeAuthor:!0})}
1,r={users:_.filter(t,e=>_.startsWith(e.subjectKey,"github:")),teams:_.filter(t,e=>_.startsWith(e.subjectKey,"team:")),fulfilled:_.some(t,{subjectKey:"builtin:fulfilled"})};return e.scope&&Vue.set(r,"scope",e.scope),_(e.fileKeys).split(",").filter(e=>this.review.files[e]).map(e=>{const t=this.review.files[e];return t.assimilated?_.last(t.revisions.list).inferred.file.$key:e}).map(e=>({fileKey:e,designation:r,anyoneRecord:i})).value()}).groupBy("fileKey").mapValues(e=>{const t=_.find(e,"anyoneRecord"),s=t&&t.anyoneRecord,i=s&&{...s,includeAuthor:_.some(e,"anyoneRecord.includeAuthor")};return{fileKey:e[0].fileKey,allUsers:_.flatMap(e,"designation.users"),allTeams:_.flatMap(e,"designation.teams"),unfulfilledUsers:_(e).map("designation").reject("fulfilled").flatMap("users").value(),unfulfilledTeams:_(e).map("designation").reject("fulfilled").flatMap("teams").value(),lines:_(e).map("designation").sortBy(e=>e.scope||"ï¿¿").value(),anyone:i,anyoneFulfilled:!!_get(t,"designation","fulfilled")}}).value()}get _connectAllDesignatedUsers(){_(this.allDesignationsList).flatMap("allUsers").forEach(e=>{this.$store.services.avatars.connectUser(e.subjectKey)})}get _allReviewerKeysInFilesWithDesignatedTeams(){return _(this.allDesignationsList).filter(e=>_.some(e.lines,e=>e.teams.length)).flatMap(e=>_get(this,"review","files",e.fileKey,"reviewMarkUserKeys")).sortBy().sortedUniq().value(
1)}get _connectAllReviewersInFilesWithDesignatedTeams(){_.forEach(this._allReviewerKeysInFilesWithDesignatedTeams,e=>{this.$store.services.avatars.connectUser(e)})}get _requestMembershipChecks(){const e=this.review.core.lastRevisionKey,t=this.$store.services.teamMemberships;_.forEach(this.allDesignationsList,s=>{if(!s.allTeams.length)return;const i=this.review.files[s.fileKey];_get(i,"revisions","latestReviewedBy")&&_.forEach(s.lines,s=>{_.forEach(s.teams,s=>{_.forEach(i.revisions.latestReviewedBy,(i,r)=>{if(_get(this,"review","people",r,"author")&&!s.includeAuthor)return;(s.omitBaseChanges?i.moduloBaseChanges.effectiveRevisionKey:i.fully.effectiveRevisionKey)===e&&t.check(r,s.subjectKey)})})})})}}}},!1,!0,{filename:"src/model/reviews/files/reviews.$reviewKey.designatedReviewers.js",modelPath:"/reviews/$reviewKey/designatedReviewers",modelExportName:"DesignatedReviewers"}),_reviewable.define(["Diff"],["session","corpsman"],function(e,t){"use strict";const s={gif:"image/gif",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",webp:"image/webp"},i=new TextEncoder;return{Diff:class Diff{constructor(){Vue.set(this,"file",this.$parent.$parent),Vue.set(this,"review",this.file.review),Vue.set(this,"showing",!1),Vue.set(this,"shown",!1),Vue.set(this,"blocks",void 0),Vue.set(this,"images",void 0),Vue.set(this,"message",void 0),Vue.set(this,"baseChangesMissing",void 0),Vue.set(this,"conflictMarkers",void 0),Vue.set(this,"leftIndent",void 0),Vue.set(this,"rightIndent",void 0),Vue.set(this,"leftLanguage",void 0),Vue.set(this,"rightLanguage",void 0),Vue.set(this,"leftLanguageGuessed",void 0),Vue.set(this,"rightLanguageGuessed",void 0),Vue.set(this,"lineInfos",void 0),Vue.set(this,"lineStats",void 0),Vue.set(this,"linemap",void 0),Vue.set(this,"action",void 0),Vue.set(this,"ignoredErrors",void 0),Vue.set(this,"_acquiredCount",0),Vue.set(this,"_acquisitionHistory",[]),Vue.set(this,"missingShebangLanguage",void 0),Vue.set(this,"_leftCoverageReady",!1),Vue.set(this,"_rightCoverageReady",!1),Vue.set(this,"leftCoverage",void 0),Vue.set(this,"rightCoverage",void 0),Vue.set(this,"renamedBetweenBounds",void 0),this.$observe(()=>this.bounds,this._computeRenamedBetweenBounds)}static makeSpec(e,t,s){const i=e[0],r=e[1];if(!r)return{leftSha:null,rightSha:null};const n={leftRevKey:_get(i,"$key")||null,rightRevKey:_get(r,"$key"),force:t};return i?(Vue.set(n,"leftSha",i.fileSha),Vue.set(n,"leftType",i.type||"blob"),i.baseFileSha!==r.baseFileSha&&(Vue.set(n,"leftBaseSha",i.baseFileSha),Vue.set(n,"rightBaseSha",r.baseFileSha))):(Vue.set(n,"leftSha",r.baseFileSha),Vue.set(n,"leftType",r.type||"blob")),Vue.set(n,"rightSha",r.fileSha),Vue.set(n,"rightType",r.type||"blob"),Vue.set(n,"metaFiles",_get(s,"byRevisionKey",r.$key)||_get(s,"byRevisionKey","other")),n}get ready(){return this.review.stateReady&&(this.message||this.blocks||this.images)&&this.locators.ready&&this._leftCoverageReady&&this._rightCoverageReady}get leftFileRev(){return this.file.revisions[this.leftRevKey]}get rightFileRev(){return this.file.revisions[this.rightRevKey]}get bounds(){return[this.leftFileRev||null,this.rightFileRev]}_modeToString(e){return"120000"===e?"symlink":"100644"===e?"normal":"100755"===e?"executable":e}get modeChange(){const e=this.leftRevKey?_get(this,"leftFileRev","fileMode"):_get(this,"rightFileRev","baseFileMode"),t=_get(this,"rightFileRev","fileMode");return e&&t&&e!==t?this._modeToString(e)+" â "+this._modeToString(t):"120000"===t?this._modeToString(t):void 0}get baseChange(){if("-commits"===this.$fileKey||!this.leftRevKey)return null;const e=this.leftFileRev,t=this.rightFileRev,s=_get(e,"fileMode")!==_get(t,"fileMode"),i=_get(e,"baseFileMode")!==_get(t,"baseFileMode"),r=_get(e,"fileSha")!==_get(t,"fileSha"),n=_get(e,"baseFileSha")!==_get(t,"baseFileSha");if(!n&&!i)return null;if(!this.blocks)return null;const a=_get(t,"fileSha")===_get(t,"baseFileSha")&&!_get(t,"baseFileShaIsInherited")&&_get(t,"fileMode")===_get(t,"baseFileMode")&&!_get(t,"baseFileModeIsInherited")||!(i&&_get(t,"fileMode")!==_get(t,"baseFileMode"))&&!n,o=i&&!s&&_get(t,"fileMode")!==_get(t,"baseFileMode")||n&&
1!r&&_get(t,"fileSha")!==_get(t,"baseFileSha");return a?"only":o||this.baseChangesMissing?"missing":this.review.context?this.review.context.fileDiffer.blocksHaveBaseChangesOnly(this.blocks)?"only":"mixed":void 0}get textual(){return this.blocks&&!this.message}get size(){if("binary"!==_get(this,"message","code")&&"imagediff"!==_get(this,"message","code"))return{};const{leftSize:e,rightSize:t}=this.message,s={};if(_.isNumber(e)&&Vue.set(s,"left",filesize.filesize(e)),_.isNumber(t)&&Vue.set(s,"right",filesize.filesize(t)),s.left&&s.right){const i=t-e;Vue.set(s,"totalDelta",i),0!==i&&(i>0?Vue.set(s,"increased",filesize.filesize(i)):Vue.set(s,"decreased",filesize.filesize(Math.abs(i))),Vue.set(s,"deltaPercent",0===e?"":`(${Math.round(Math.abs(i)/e*100)}%)`))}return s}get nearestUnkeptBoundsCommitShas(){const e=this.review.revisions,t=_get(this,"file","revisions","nearestUnkept",this.leftRevKey,"$key"),s=_get(this,"file","revisions","nearestUnkept",this.rightRevKey,"$key");return[t?_get(e,t,"commitSha"):_get(e,s,"baseCommitSha"),_get(e,s,"commitSha")]}get reintroductionsBetweenBounds(){if(this.rightFileRev)return _(this.file.revisions.list).slice(_get(this,"leftFileRev","index")+1||0,this.rightFileRev.index+1).filter("reintroducedFromRenamedFiles").flatMap(e=>_.map(e.reintroducedFromRenamedFiles,t=>({revisionKey:e.$key,targetFile:t}))).value()}get gitHubFileUrl(){if(!_get(this,"review","core","head"))return;const t=_get(this,"nearestUnkeptBoundsCommitShas",1);return t?`${e.config.gitHubUrl}/${this.review.core.head.owner}/${this.review.core.head.repo}/blob/${t}/${this.file.path}`:void 0}get gitHubDiffUrl(){if(!_get(crypto,"subtle","digest")||!_get(this,"review","core","head"))return;const[t,s]=this.nearestUnkeptBoundsCommitShas;if(!t||!s||t===s)return;const i=`${e.config.gitHubUrl}/${this.review.core.head.owner}/`+this.review.core.head.repo;return this.computeHash(this.file.path,"SHA-256").then(e=>`${i}/compare/${t}...${s}#diff-${e}`)}get gitHubUrl(){return this.gitHubDiffUrl||this.gitHubFileUrl}computeHash(e,t){const s=i.encode(e);return crypto.subtle.digest(t,s).then(e=>{const t=Array.from(new Uint8Array(e));return _.map(t,e=>_.padStart(e.toString(16),2,"0")).join("")})}acquire(e){this._acquisitionHistory.push({action:"acquire",reason:e,timestamp:this.$now}),0!==this._acquiredCount++||this.$destroyed||this._execute()}release(e){if(this._acquisitionHistory.push({action:"release",reason:e,timestamp:this.$now}),--this._acquiredCount<0){const e=new Error("Unmatched diff release");throw Vue.set(e,"extra",{history:this._acquisitionHistory}),e}0===this._acquiredCount&&this.$set(null)}createDraft(t,s,i){if(!this.review.state)return;let r,n,a,o=this[`${s}FileRev`];if("left"!==s||o||(o=this.rightFileRev,r=!0),!o)return;r||(n=this[("left"===s?"right":"left")+"FileRev"]||void 0,a=!n||void 0);const l=o.original,c=_get(n,"original"),u=c&&c.file.$key!==l.file.$key?c.file.$key:void 0;return Vue.set(e.onboarding,"createdLineComment",!0),this.review.state.drafts.createStarterDraft(l.file.$key,l.$key,r,t,u,_get(c,"$key"),a,i)}get _updateMappings(){const e=_(this.locators).flatMap(e=>_.values(e.mappingRequests)).concat(_get(this,"review","discussions","allParleyCodeblockMappingRequestsByFileKey",this.file.$key)).compact().map(e=>(Vue.set(e,"key",`${e.sourceRevisionKey}${e.sourceRevisionBase?"_base":""}@${e.line}-${e.targetRevisionKey}${e.targetRevisionBase?"_base":""}`),e)).uniqBy("key").keyBy("key").value();_ref(this,"child","mappings").set(e)}get lineStatsEmpty(){return!this.size.totalDelta&&!_.some(_.pick(this.lineStats,["changed","inserted","deleted","unknown"]),e=>0!==e)}_execute(){let e;if(Vue.set(this,"_leftCoverageReady",Vue.set(this,"_rightCoverageReady",!0)),!this.leftSha&&!this.rightSha)return void Vue.set(this,"message",{code:"nofile",level:"info"});if(!this.rightFileRev||!this.review.revisions[this.rightRevKey]){const e=this.rightFileRev?"Diff has nonexistent right file rev":"Diff missing right file rev";return void Sentry.captureMessage(e,{extra:{leftRevKey:this.leftRevKey,leftFileRev:this.leftFileRev,rightRevKey:this.rightRevKey,rightFileRev:this.rightFileRev,revisions:this.review.revisions.$ke
1ys,fileRevisions:this.file.revisions.$keys,bounds:_.map(this.$parent.bounds,e=>_get(e,"$key"))}})}e="-commits"===this.file.$key?this.review.context.fileDiffer.generateCommitFileOptions(this.leftSha,this.rightSha):_(this).pick("leftSha","leftBaseSha","leftType","rightSha","rightBaseSha","rightType").assign({decorate:!0,force:"hard"===this.force,file:this.file,filename:this.file.path,metaFiles:_.values(this.metaFiles),captureLinemap:(this.leftFileRev?this.leftFileRev.index:-1)===this.rightFileRev.index-1,captureBasemap:!(!this.leftFileRev||!this.review.files.neededBasemapKeys[`${this.leftSha}_${this.leftBaseSha}-${this.rightSha}_${this.rightBaseSha}`])}).value();if(_get(_access(this,"","file","","path","","match","call",[/\.([^.]+)$/]),1)in s)return this.$info.user?Promise.all([this.leftSha?this.review.context.fileSize.get(this.leftSha):Promise.resolve(0),this.rightSha?this.review.context.fileSize.get(this.rightSha):Promise.resolve(0)]).then(([e,t])=>{Vue.set(this,"message",{code:"imagediff",offerGitHub:!0,leftSize:e,rightSize:t})}).catch(e=>{t.capture(e,"diff._execute (fetching image sizes)"),Vue.set(this,"message",{code:"imagediff",offerGitHub:!0})}):void Vue.set(this,"message",{code:"imagediff",offerGitHub:!0});if(this.file.vendored&&!e.force)return void Vue.set(this,"message",{code:"vendored",offerDiff:!0});const i=this.file.system?"diffText":"diffFiles";if(!this.file.system){Vue.set(this,"_leftCoverageReady",Vue.set(this,"_rightCoverageReady",!1));const e=this.leftRevKey?this.review.revisions[this.leftRevKey].commitSha:this.review.revisions[this.rightRevKey].baseCommitSha,t=this.review.revisions[this.rightRevKey].commitSha;this.review.context.codeCoverage.load(e).then(e=>{Vue.set(this,"_leftCoverageReady",!0),Vue.set(this,"leftCoverage",_get(e,this.$fileKey))}),this.review.context.codeCoverage.load(t).then(e=>{Vue.set(this,"_rightCoverageReady",!0),Vue.set(this,"rightCoverage",_get(e,this.$fileKey))})}this.review.context.fileDiffer.diffFiles(this.file,e,i).then(e=>{const t="added"===e.action?"right":"left",s=e[`${t}Language`],i=e[`${t}LanguageGuessed`];if(!e.message&&(void 0===s||i)&&Math.random()<.1&&(e.missingShebangLanguage?Sentry.captureMessage("Failed to map shebang executable",{tags:{shebangLanguage:e.missingShebangLanguage}}):Sentry.captureMessage("Failed to map language",{tags:{lang:s,ext:this.file.extension?`.${this.file.extension}`:this.file.lowercaseName}})),!this.$destroyed&&(_.forEach(e,(e,t)=>{_.isObject(e)&&(e=Object.freeze(e)),Vue.set(this,t,e)}),e.lineStats||(this.leftSha===this.rightSha||"binary"===_get(e,"message","code")?Vue.set(this,"lineStats",null):Vue.set(this,"lineStats",{unknown:!0,totalDelta:1})),!_get(this,"review","context","overflowOverride")&&this._isBigDiff())){const e=this;Vue.set(this,"message",{code:"bigdiff",level:"warning",offerDiff:!0,get softForceAllowed(){return _get(e,"review","context","overflowOverride")}})}},e=>{t.markHandled(e),Vue.set(this,"message",{code:"text",level:"error",text:""+e.message,softForceAllowed:!1}),Vue.set(this,"lineStats",{unknown:!0,totalDelta:1})})}_isBigDiff(){if(this.message||this.force)return!1;if(_get(this,"lineStats","visible")>2e3)return!0;if(!_get(this,"review","context","singleFile")&&_get(this,"lineStats","visible")>300){let e=0;return _.forEach(_get(this,"review","files"),t=>{_get(t,"diff","current")&&t.diff.current.lineStats&&!t.diff.current.message&&(e+=_get(t,"diff","current","lineStats","visible")||0)}),e+this.lineStats.visible>5e3}return!1}_computeRenamedBetweenBounds(){if(!this.file.history||!_get(this,"rightFileRev","original")||this.leftFileRev&&!this.leftFileRev.original)return void Vue.set(this,"renamedBetweenBounds",void 0);if(!this.leftFileRev&&!this.rightFileRev.baseFileShaIsInherited)return void Vue.set(this,"renamedBetweenBounds",void 0);const e=this.leftFileRev?this.leftFileRev.original.file:_access(_,"call",[this.file.revisions.list],"","slice","call",[0,this.rightFileRev.index+1],"","find","call",["otherOriginalFileKey"],"","otherOriginal","","file"),t=_get(e,"path"),s=this.rightFileRev.original.file.path;if(!t||!s||t===s)return void Vue.set(this,"renamedBetweenBounds",void 0);const i=_get(this,"review","revisions",_get(this,"leftFileRev","$key"),"index")||0,r=_(e.revisions.list).filter(e=>_get(this,"review","revisions",e.$key,"index")>=i).some(e=>!e.assimilated);this.$store.services.diffWorkerBridge.diffText({leftFile:{content:t},rightFile:{content:s},leftBaseFile:{},rightBaseFile:{},language:null,force:!0,decorate:!0}).then(e=>{Vue.set(this,"renamedBetweenBounds",{originalPath:t,renamedPath:s,reintroduced:r,originalPathHtml:e.blocks[0].left.lines[0],renamedPathHtml:e.blocks[0].right.lines[0]})},e=>{Sentry.captureException(e)})}}}},!1,!0,{filename:"src/model/reviews/files/reviews.$reviewKey.files.$fileKey.diff.$diffKey.js",modelPath:"/reviews/$reviewKey/files/$fileKey/diff/$diffKey",modelExportName:"Diff"}),_reviewable.define(["githubEditorLinkTemplate","Locator"],["TopLocator","session","config","corpsman"],function(e,t,s,i){"use strict";const r=({owner:e,repo:t,viewSha:i,path:r,viewLine:n})=>`${s.gitHubUrl}/${e}/${t}/blob/${i}/${r}#L${n}`,n=({owner:e,repo:t,sha:i,path:r,line:n}
1)=>`${s.gitHubUrl}/${e}/${t}/blob/${i}/${r}#L${n}`,a=({owner:e,repo:t,headBranch:i,path:r,pr:n,line:a})=>`${s.gitHubUrl}/${e}/${t}/edit/${i}/${r}?pr=%2F${e}%2F${t}%2Fpull%2F${n}#L${a}`;return{githubEditorLinkTemplate:a,Locator:class Locator extends e{constructor(){super(),Vue.set(this,"diff",this.$parent.$parent),Vue.set(this,"file",this.diff.$parent.$parent)}get mappingRequests(){const e=this.diff.bounds;if(!(this.parley&&this.parley.revisionKey&&e&&this.file.files.joinedOnce))return;const t={},s=_get(this,"file","revisions","nearest",_get(this,"review","core","lastRevisionKey"),"$key");s&&Vue.set(t,"latest",{targetRevisionKey:s,targetRevisionBase:!1});const i=this.file.revisions[this.parley.revisionKey];return!i||void 0===i.index||void 0===_get(e,1,"index")||e[0]&&void 0===e[0].index||(e[0]===e[1]||(e[0]?i.index<=e[0].index:this.parley.revisionBase)||Vue.set(t,"right",{targetRevisionKey:e[1].$key,targetRevisionBase:!1}),e[0]!==e[1]&&i.index>=e[1].index&&(e[0]||!this.parley.revisionBase)||Vue.set(t,"left",{targetRevisionKey:_get(e,0,"$key")||e[1].$key,targetRevisionBase:!e[0]})),_.forEach(t,e=>{_.assign(e,{line:this.parley.line||0,key:void 0,discussionKey:this.$key,sourceRevisionKey:this.parley.revisionKey,sourceRevisionBase:!!this.parley.revisionBase})}),t}get _mappings(){return _.mapValues(this.mappingRequests,e=>_get(this,"diff","mappings",e.key))}get side(){if(this._mappings){if(!this.diff.bounds[1])return"none";if("left"in this._mappings&&"right"in this._mappings){if(!_get(this,"_mappings","left","location")||!_get(this,"_mappings","right","location"))return;return this._mappings.left.location.accuracy>=this._mappings.right.location.accuracy?"left":"right"}return _get(this,"_mappings","left","location")?"left":_get(this,"_mappings","right","location")?"right":void 0}}get line(){return _get(this,"_mappings",this.side,"location","line")}get accuracy(){return _get(this,"_mappings",this.side,"location","accuracy")}get commitSha(){return _get(this,"_mappings",this.side,"location","commitSha")}get groupKey(){if(this.side&&void 0!==this.line)return`${this.side}-${this.line}`}get latestCommitSha(){return _get(this,"_mappings","latest","location","commitSha")}get latestLine(){return _get(this,"_mappings","latest","location","line")}get _lineLinkContext(){return _.assign({},this.file.linkContext,{path:this.file.uriSafePath,viewSha:this.commitSha,viewLine:this.line,sha:this.latestCommitSha,line:this.latestLine})}get lineLink(){if(_.isNumber(this.latestLine))return 0===this.latestLine?"file":`line ${this.commitSha&&this.line||"?"}`}get githubLinkUrl(){if(this.file.system)return null;if(!_.isNumber(this.latestLine))return;const e=this._lineLinkContext.viewSha&&this._lineLinkContext.viewLine?r:n;try{return e(this._lineLinkContext)}catch(e){i.capture(e,"GitHub link URL template")}}get githubEditorLink(){if(this.file.system)return null;try{return a(this._lineLinkContext)}catch{return null}}get lineLinkUrl(){if(!_.isNumber(this.latestLine))return;const e=t.computed.compiledLineLinkTemplate;if(!e||t.computed.lineLinkTemplateCompilationError)return null;try{return e(this._lineLinkContext)}catch{return null}}get filePathAndLine(){if(_.isNumber(this.latestLine))return 0===this.latestLine?this.file.path:`${this.file.path}:${this.latestLine}`}}}},!1,!0,{filename:"src/model/reviews/files/reviews.$reviewKey.files.$fileKey.diff.$diffKey.locators.$discussionKey.js",modelPath:"/reviews/$reviewKey/files/$fileKey/diff/$diffKey/locators/$discussionKey",modelExportName:"Locator"}),_reviewable.define(["Locators"],[],function(){"use strict";return{Locators:class Locators{constructor(){Vue.set(this,"file",this.$parent.file),Vue.set(this,"review",this.file.review),Vue.set(this,"autoUnhideCounter",0)}get _updateLocators(){const e={};_(this.file.parleys).map("$key").uniq().forEach(t=>{Vue.set(e,t,{active:!0})}),this.$set(e)}get grouped(){return _(this.list).filter("groupKey").groupBy("groupKey").value()}get num(){return{hidden:_.countBy(this,"hidden").true||0,grouped:_.mapValues(this.grouped,e=>({hidden:_.countBy(e,"hidden").true||0}))}}get ready(){return!(!_.isEmpty(this.file.parleys)&&_.isEmpty(this))&&_.every(this,e=>void 0!==e.initiallyHidden&&(!this.$parent.textual||e.groupKey))}get list(){return _.sortBy(this,"initiallyHidden",e=>e.timestamp||0)}}}},!1,!0,{filename:"src/model/reviews/files/reviews.$reviewKey.files.$fileKey.diff.$diffKey.locators.js",modelPath:"/reviews/$reviewKey/files/$fileKey/diff/$diffKey/locators",modelExportName:"Locators"}),_reviewable.define(["Mapping"],["corpsman"],function(e){"use strict";return{Mapping:class Mapping{constructor(){Vue.set(this,"diff",this.$parent.$parent),Vue.set(this,"file",this.diff.file),Vue.set(this,"review",this.file.review)}get _identity(){return this.sourceRevisionKey===this.targetRevisionKey&&this.sourceRevisionBase===this.targetRevisionBase||0===this.line}get _spec(){if(!1===this._identity)try{const e={},t=this.file.revisions[this.sourceRevisionKey],s=this.file.revisions[this.targetRevisionKey];if(!t)throw new Error("Missing source rev");if(!s)return this._spec;Vue.set(e,"sign",_.sign(s.index-t.index)||1);const i=t.index+(1===e.sign?1:0),r=s.index+(1===e.sign?1:0);let n;try{n=_.range(i,r,e.sign)}catch(t){throw new Error(`Invalid range: ${i}, ${r}, ${e.sign}`,{cause:t})}return Vue.set(e,"linemapSpecs",_(n).map(e=>{const t=this.file.revisions.list[e-1],s=this.file.revisions.list[e],i={leftSha:this.sourceRevisionBase?t.baseFileSha:t.fileSha,leftType:t.type,rightSha:this.sourceRevisionBase?s.baseFileSha:s.fileSha,rightType:s.type};if(i.leftSha!==i.rightSha)return i}
1).compact().value()),Boolean(this.sourceRevisionBase)!==Boolean(this.targetRevisionBase)&&(Vue.set(e,"flipLastSign",this.targetRevisionBase?1===e.sign:-1===e.sign),e.linemapSpecs.push({leftSha:s.baseFileSha,leftType:s.type,rightSha:s.fileSha,rightType:s.type})),e}catch(t){return this._decorateError(t),e.capture(t,"Mapping._spec"),{error:!0}}}get location(){const t=_get(this,"review","revisions",this.targetRevisionKey,this.targetRevisionBase?"baseCommitSha":"commitSha"),s={line:this.line,accuracy:1,commitSha:t};if(this._identity)return s;if(!this._spec||!this.review.context)return;if(this._spec.error||_.some(this._spec.linemapSpecs,e=>!e.leftSha||!e.rightSha))return{line:0,accuracy:0,commitSha:t};const i=this._spec;return Promise.resolve().then(()=>Promise.all(_.map(i.linemapSpecs,e=>this.review.context.fileDiffer.getLinemap(this.file,e)))).then(e=>{if(this.$destroyed||i!==this._spec)return;let t=i.sign;return _.forEach(e,(r,n)=>{if(!s.line)return!1;i.flipLastSign&&n===e.length-1&&(t=-t);const a=1===t?"leftToRight":"rightToLeft",o=1===t?"left":"right",l=1===t?"right":"left",c=r[a][_.sortedIndexBy(r[a],s.line,e=>_.isNumber(e)?e:e[o+"End"])];if(!c){const t=new Error("Missing block when mapping line");throw Vue.set(t,"extra",{step:n+1,numSteps:e.length,direction:a,location:s,linemap:r,fileKey:this.$fileKey,mappingKey:this.$mappingKey}),t}switch(c.type){case"bottom":Vue.set(s,"line",c[l+"End"]);break;case"bijection":Vue.set(s,"line",s.line-c[o+"Start"]+c[l+"Start"])}s.accuracy*=c.accuracy}),s}).catch(s=>{if(!this.$destroyed&&i===this._spec)return"Canceled"===s.message||/github error/i.test(s.message)||(this._decorateError(s),e.capture(s,"Mapping.location")),{line:0,accuracy:0,commitSha:t}})}_decorateError(e){Vue.set(e,"extra",_.assign({},e.extra,{filePath:this.file.path,fileKey:this.file.$key,reviewKey:this.review.$key,discussionKey:this.discussionKey,codeblockKey:this.codeblockKey,sourceRevKey:this.sourceRevisionKey+(this.sourceRevisionBase?".base":""),targetRevKey:this.targetRevisionKey+(this.targetRevisionBase?".base":""),sourceRevExists:!!this.file.revisions[this.sourceRevisionKey],targetRevExists:!!this.file.revisions[this.targetRevisionKey],fileRevisionKeys:this.file.revisions.$keys.join(" "),sourceLine:this.line,spec:this._spec}))}}}},!1,!0,{filename:"src/model/reviews/files/reviews.$reviewKey.files.$fileKey.diff.$diffKey.mappings.$mappingKey.js",modelPath:"/reviews/$reviewKey/files/$fileKey/diff/$diffKey/mappings/$mappingKey",modelExportName:"Mapping"}),_reviewable.define(["FileDiffs"],["analytics","Diff","debug","session"],function(e,t,s,i){"use strict";function r(e,t,s){return(t=e.revisions.nearestUnkept[_get(t,"$key")]||null)===(s=e.revisions.nearestUnkept[_get(s,"$key")]||null)}function n(e){return e?`[${_get(e,0,"$key")}, ${_get(e,1,"$key")}]`:"undefined"}return{FileDiffs:class FileDiffs{static get $trussMount(){return{path:"/reviews/$reviewKey/files/$fileKey/diff",local:!0,placeholder:null}}constructor(){Vue.set(this,"review",this.$parent.$parent.$parent),Vue.set(this,"file",this.$parent),Vue.set(this,"bounds",void 0),Vue.set(this,"selecting",void 0),Vue.set(this,"current",void 0),Vue.set(this,"postponed",void 0),Vue.set(this,"_force",void 0),Vue.set(this,"_retry",!1),Vue.set(this,"_firstDiffRequested",!1)}setBounds(e,t){t&&this.file.latchVisibility(!1),this.bounds&&e&&this.bounds[0]===e[0]&&this.bounds[1]===e[1]||(s.bounds&&console.log(`setBounds ${this.file.path} ${n(this.bounds)} -> ${n(e)}`),Vue.set(this,"bounds",e))}force(e){Vue.set(this,"_force",e);const t=_get(this,"review","context","navigation","lastVisitedParley");"hard"===e&&_get(t,"file")===this.file&&this.review.context.navigation.visitDiscussion(_get(t,"$key"),_get(t,"tracker","resolved"))}retry(){Vue.set(this,"_retry",!0),this.force(_get(this,"current","force"))}isBoundAtKey(e){return _get(this,"bounds",1)&&((_get(this,"bounds",0,"$key")||null)===e||this.bounds[1].$key===e)}get _resetDiffOnReviewError(){_get(this,"review","core","error")&&(this.current&&(this.current.release("_resetDiffOnReviewError"),Vue.set(this,"current",void 0)),Vue.set(this,"bounds",void 0))}get _initializeDiffBounds(){if(_get(this,"review","context","diffFiles")&&this.review.files.joined&&this.review.$ready&&!_get(this,"review","core","error")){if(s.bounds&&console.log(`_initializeDiffBounds ${this.file.path} ${n(this.bounds)}`),!this.bounds)return this._runFirstStable([this._initializeDiffBoundsForTargetedDiscussion,this._initializeDiffBoundsForTargetedRevision,this._initializeDiffBoundsAsPreferred]);if(this.file.revisions.nearest&&this.bounds[1]){let e=[this.file.revisions.nearest[_get(this,"bounds",0,"$key")]||null,this.file.revisions.nearest[this.bounds[1].$key]||null];(this.bounds[0]&&!e[0]||!e[1])&&(e=void 0),s.bounds&&console.log(`nearestBounds ${n(e)}`),this.setBounds(e)}}}_initializeDiffBoundsForTargetedDiscussion(e){const t=_get(this,"review","context","navigation","targetParley"),s=this.file.revisions.nearest&&t&&(this.file===t.file||this.file===_get(t,"file","revisions",t.revisionKey,"inferred","file"));if(!e||!s)return s;let i=this.file.revisions.nearest[t.revisionKey],r=this.file.revisions.nearest[t.otherRevisionKey];(t.revisionBase||t.otherRevisionBase)&&(r=null),(!r||i&&this.review.revisions[i.$key].index>this.review.revisions[r.$key].index)&&([i,r]=[r,i]),this.setBounds([i,r])}_initializeDiffBoundsForTargetedRevision(e){const t=_get(this,"review","context","navigation","targetBoundsRevisionKeys"),s=!!(t&&this.file.revisions.nearest&&this.review.core);if(!e||!s)return s;let i=_.map(t,e=>"base"!==e&&e?"last"===e?this.file.revisions.nearest[this.review.core.lastRevisionKey]:this.file.revisions[e]:null);_.some(i,e=>
1void 0===e||_get(e,"assimilated"))&&(i=[void 0,void 0]),this.setBounds(i)}_initializeDiffBoundsAsPreferred(e){if(!i.settings.$ready&&null!==this.$info.userid)return!1;const t=this.review.userIsReviewer?"Reviewer":this.review.userIsAuthor?"Author":void 0,r=i.settings[t&&`initialDiffBoundsAs${t}`]||"proposed";let a;switch(r){case"proposed":a=this.proposedBounds;break;case"full":a=this.fullBounds;break;case"unreviewedByYou":a=this.personallyUnreviewedBounds;break;case"unreviewedByAnyone":a=this.unreviewedBounds}const o=!!a;if(!e||!o)return o;s.bounds&&console.log(`_initializeDiffBoundsAsPreferred ${this.file.path} ${r} ${n(this.bounds)} -> ${n(a)}`),this.setBounds(_.clone(a))}_runFirstStable(e){const t=_.find(e,e=>e.call(this,!1));if(t)return this.$nextTick().then(()=>{const s=_.find(e,e=>e.call(this,!1));t===s&&t.call(this,!0)})}selectBounds(e,t,s,i){if(!this.bounds)return;let r,n;if(void 0===e&&void 0===t)r=n=void 0;else{if(void 0===t||e===t&&!s){if(t=this.bounds[1]&&this.review.revisions[this.bounds[1].$key],null===e&&!t){const e=_get(this,"fullBounds",1);t=e&&this.review.revisions[e.$key]}if(e&&t&&e.index>t.index&&(t=this.bounds[0]&&this.review.revisions[this.bounds[0].$key]),!i&&(void 0===t&&(t=e),void 0===t))return void Sentry.captureMessage("Undefined upper bound when selecting range",{extra:{reviewKey:this.review.$key,file:this.file.path,fileKey:this.file.$key,bounds:_.map(this.bounds,e=>void 0===e?"undefined":null===e?"null":e.$key),rev1:_get(e,"$key"),revisions:_.keys(this.review.revisions)}})}if(null===t||e&&t&&e.index>t.index){const s=e;e=t,t=s}if(!t)return;let a=!1;for(let s=_get(e,"index")||0;s<=t.index;s++)if(this.file.revisions[this.review.revisions.list[s].$key]){a=!0;break}r=a?this.file.revisions.nearest[_get(e,"$key")]||null:void 0,n=a?this.file.revisions.nearest[t.$key]||null:void 0}Vue.set(this,"selecting",this.selecting||{}),this.selecting.bounds&&this.selecting.bounds[0]===r&&this.selecting.bounds[1]===n||Vue.set(this.selecting,"bounds",[r,n])}commitBounds(e){_get(this,"selecting","bounds")&&(this.setBounds(this.selecting.bounds,e),Vue.set(this,"selecting",void 0))}get _updateDiff(){if(_get(this,"review","context","diffFiles")&&this.bounds&&_get(this,"review","context","verdict")&&_get(this,"review","revisions","filemapsReady")&&this.review.linemapsReady&&this.review.stateReady&&void 0!==_get(this,"review","context","singleFile"))return _get(this,"review","context","showUI")?this.file.visibilityLatched?void(_get(this,"review","context","singleFile")&&this.file!==_get(this,"review","context","onlyFile")&&!this._force||this.file.assimilated&&(!_get(this,"review","context","singleFile")||this.file!==_get(this,"review","context","onlyFile"))?Vue.set(this,"postponed",!0):(Vue.set(this,"postponed",!1),this._updateCurrentDiff(),Vue.set(this,"_force",void 0),Vue.set(this,"_retry",!1))):(this.$nextTick().then(()=>{this.file.latchVisibility(!0)}),void Vue.set(this,"postponed",!1)):(Vue.set(this,"postponed",!0),Vue.set(this,"_force",void 0),void Vue.set(this,"_retry",!1))}_updateCurrentDiff(){const s=t.makeSpec(this.bounds,this._force,this.review.metaFiles);if(this.current){const e=_.isMatch(this.current,_.pick(s,"leftSha","rightSha","leftBaseSha","rightBaseSha")),t=_.isEqual(_.mapValues(this.current.metaFiles,"path"),_.mapValues(_get(s,"metaFiles"),"path"));if(e&&t&&(!this.current.message||!(this._retry||"hard"===this._force||"soft"===this._force&&this.current.message.softForceAllowed)))return void this.current.$update({leftRevKey:s.leftRevKey,rightRevKey:s.rightRevKey});if(e&&_get(this,"current","message")&&(this.current.blocks||this.current.images))return void Vue.set(this.current,"message",void 0);this.current.release("_updateCurrentDiff")}this._firstDiffRequested||(Vue.set(this,"_firstDiffRequested",!0),e.time("prep"));const i=this.$newKey();_ref(this,"child",i).set(s),Vue.set(this,"current",this[i]),this.current.acquire("_updateCurrentDiff")}get empty(){if(!_get(this,"review","context","fullInterface"))return!1;if(!this.bounds)return;if(!this.bounds[1])return!0;const e=_.range(this.bounds[0]?this.bounds[0].index+1:0,this.bounds[1].index+1);return!_.some(e,e=>{const t=this.file.revisions.list[e];return t&&("kept"!==t.action||t.renamed)})}computeCommitsWithinBounds(){if(_get(this,"bounds",1))return _(this.file.revisions.list).slice(this.bounds[0]?this.bounds[0].index+1:0,this.bounds[1].index+1).map("commits.$values").compact().flatten().sortBy("timestamp").reverse().uniqBy("title").reverse().value(
1)}get authorAutomaticBounds(){if(!this.review.userIsAuthor)return;const e=this.file,t=this.review;if(!(t.stateReady&&_get(t,"context","diffFiles")&&e.revisions&&t.revisions.list&&t.core.lastRevisionKey&&e.files.list))return;if(e.assimilated)return[void 0,void 0];const s=_get(e,"revisions","nearest",t.core.lastRevisionKey);if(void 0===s)return;let i;if(!_.isEmpty(_get(t,"state","marks"))||_.includes(t.files.reviewMarkUserKeys,this.$info.userid)){if(void 0===e.revisions.lastReviewedByUser)return;i=e.revisions.lastReviewedByUser||null}else{const r=t.revisions.lastCaptured;i=_get(r,"$key")===t.core.lastRevisionKey?s:_get(e,"revisions","nearest",_get(r,"$key"))||null}const r=_get(e,"revisions","nearestUnkept",_get(s,"$key"))||null;let n=_get(e,"revisions","nearestUnkept",_get(i,"$key"))||null;const a=_get(e,"revisions","latestReviewedBy",this.$info.userid,"fully");if(n===r&&!_get(a,"draft")){if(!e.parleys)return;let t=null,s=null,a=!1,o=!0;if(_.forEach(e.parleys,i=>{if(!i.tracker&&"draft"===i.type)return;if(!i.tracker||void 0===_get(i,"tracker","resolved"))return o=!1,!1;if(i.tracker.resolved)return;const r=i.revisionBase?null:e.revisions.nearest[i.revisionKey],n=i.otherRevisionBase?null:i.otherRevisionKey?e.revisions.nearest[i.otherRevisionKey]:null;if(void 0===r||void 0===n)return;a=!0;const[l,c]=_.sortBy([r,n],e=>e?e.index:-1);c&&(!s||c.index>s.index)&&(s=c),l&&(!t||l.index>t.index)&&(t=l)}),!o)return;a&&(i=s,n=_get(e,"revisions","nearestUnkept",_get(i,"$key"))||null,n===r&&(i=t))}return[i||null,s]}get proposedBounds(){const e=this.file;if(this.review.userIsAuthor)return this.authorAutomaticBounds;const t=e.$parent.diffs.proposedSpec;if(t&&e.revisions&&void 0!==e.toBeReviewedByUser){if(e.assimilated)return[void 0,void 0];switch(t.rangeType){case"last":{const t=e.revisions[this.review.core.lastRevisionKey];return[t,t]}case"full":{if(this.$info.userid&&this.review.userIsReviewer&&!this.review.userIsAuthor&&!e.toBeReviewedByUser)return[void 0,void 0];if(this.$info.userid&&void 0===e.revisions.lastReviewedByUser)return;const t=[e.revisions.lastReviewedByUser||null,_get(e,"revisions","nearest",this.review.core.lastRevisionKey)];if(void 0===t[1])return;const s=_get(this,"review","revisions",_get(t,0,"$key"),"index")>_get(this,"review","revisions",_get(t,1,"$key"),"index"),i=_get(this,"file","revisions","nearestUnkept",_get(t,1,"$key"))===_get(t,0);return(s||i)&&Vue.set(t,0,t[1]),t}case"single":{if(!e.toBeReviewedByUser||e.revisions.allObsolete)return[void 0,void 0];const s=e.revisions[t.nextRev.$key];if(!s||s.assimilated)return[void 0,void 0];let i=t.nextRev.$key;for(;i;){const t=e.revisions[i];if(!t||t.reviewLevel>=4)break;const s=this.review.revisions[i];if(!s)return;i=s.priorRevisionKey}i||this.review.revisions[t.nextRev.$key].priorRevisionKey||(i=_get(t,"lastCoveredRev","$key"));let r=e.revisions[i]||null;return _get(r,"assimilated")&&(r=null),[r,s]}}}}get proposedBoundsDifferFromCurrent(){return this._doBoundsDifferFromCurrent(this.proposedBounds)}get fullBounds(){return _get(this,"review","context","diffFiles")&&[null,_get(this,"file","revisions","nearest",this.review.core.lastRevisionKey)]}get fullBoundsDifferFromCurrent(){return this._doBoundsDifferFromCurrent(this.fullBounds)}get personallyUnreviewedBounds(){return _get(this,"review","context","diffFiles")&&[this.file.revisions.lastReviewedByUser,_get(this,"file","revisions","nearest",this.review.core.lastRevisionKey)]}get unreviewedBounds(){if(!_get(this,"review","context","diffFiles"))return;return[_get(this,"file","revisions","nearestUnkept",_get(this,"file","revisions","lastReviewed","$key"))||null,_get(this,"file","revisions","nearest",this.review.core.lastRevisionKey)]}_doBoundsDifferFromCurrent(e){return _get(this,"review","context","diffFiles")&&!(this.file.assimilated||!this.bounds||!e||r(this.file,this.bounds[0],e[0])&&r(this.file,this.bounds[1],e[1]))}get lastShowing(){if(_get(this,"review","context","diffFiles"))return _(this).filter("showing").sortBy("$key").last()}}}},!1,!0,{filename:"src/model/reviews/files/reviews.$reviewKey.files.$fileKey.diff.js",modelPath:"/reviews/$reviewKey/files/$fileKey/diff",modelExportName:"FileDiffs"}),_reviewable.define(["FileHistory"],[],function(){"use strict";return{FileHistory:class FileHistory{static get $trussMount(){return{path:"/reviews/$reviewKey/files/$fileKey/history",placeholder:null}}get list(){return _.toArray(this)}}}},!1,!0,{filename:"src/model/reviews/files/reviews.$reviewKey.files.$fileKey.history.js",modelPath:"/reviews/$reviewKey/files/$fileKey/history",modelExportName:"FileHistory"}),_reviewable.define(["File"],["session","githubEditorLinkTemplate"],function(e,t){"use strict";const s="⺠Reverted",i="⤠Only renamed",r="⥠Deleted",n="⤥ Vendored",a={[i]:"â¯1",[r]:"â¯2",[n]:"â¯3",[s]:"â¯4"};function o(e){return e?_(_.toLower(e)).split("").zip(e.split("")).map(e=>_.join(e,"")).join(""):""}return{File:class File{constructor(){Vue.set(this,"review",this.$parent.$parent),Vue.set(this,"files",this.$parent),Vue.set(this,"index",void 0),Vue.set(this,"segmentedPath",void 0),Vue.set(this,"visibilityLatched",!1),Vue.set(this,"_toBeReviewedLatch",!1),Vue.set(this,"nonTrivialLatch",!1)}created(){this.joined&&this.$observe(()=>_get(this,"files",_access(_,"","last","call",[_get(this,"history","list")],"","fileKey"),"group"),e=>{_ref(this,"child","group").override(e)})}get name(){if(!this.path)return"";const e=this.path.lastIndexOf("/");return e>=0?this.path.slice(e+1):this.path}get lowercaseName(){return _.toLower(this.name)||""}get bareName(){if(!this.name)return"";const e=_access(this,"","name","","lastIndexOf","call",["."]);return e>=0?this.name.slice(0,e):this.name}get uriSafePath(){return this.path?_.map(this.path.split("/"),e=>encodeURIComponent(e)).join("/"):""}get linkContext(){return{owner:_get(this,"review","core","head","owner"),repo:_get(this,"review","core","head","repo"),baseOwner:this.review.core.ownerName,baseRepo:this.review.core.repoName,pr:this.review.core.pullRequestId,headBranch:_get(this,"review","core","head","name"),baseBranch:_get(this,"review","core","base","name")}}get _fileLinkContext(){const e=_get(this,"review","revisions",this.review.core.lastRevisionKey,"commitSha");return _.assign({},this.linkContext,{path:this.uriSafePath,viewSha:e,viewLine:1,sha:e,line:1})}get githubLinkUrl(){return this.system?null:_get(this,"diff","current","gitHubUrl")}get githubDiffUrl(){return this.system?null:_get(this,"diff","current","gitHubDiffUrl")}get githubFileUrl(){return this.system?null:_get(this,"diff","current","gitHubFileUrl")}get editorLinkUrl(){const t=e.computed.compiledLineLinkTemplate;if(!t||e.computed.lineLinkTemplateCompilationError)return null;try{return t(this._fileLinkContext)}catch{return null}}get githubEditorLink(){if(this.system)return null;try{return t(this._fileLinkContext)}catch{return null}}get assimilated(){return!this.joined&&_.every(this.revisions,e=>e.assimilated)}get system(){return"-commits"===this.$key}get reverted(){return _get(this,"revisions","lastUnkept","reverted")}get parleys(){if(this.files.parleysByFileKey)return _get(this,"files","parleysByFileKey",this.$key)||[]}get commented(){if(this.parleys&&!_.some(this.parleys,e=>void 0===_get(e,"tracker","resolved")||void 0===_get(e,"tracker","replied")))return _.some(this.parleys,e=>"draft"===e.type||e.targeted||!_get(e,"tracker","resolved")||!_get(e,"tracker","replied"))}get trivial(){if(this.visibilityLatched&&this.nonTrivialLatch)return!1;let e;return(this.commented||!1===_get(this,"diff","empty")&&(this.currentRevisionToBeReviewed||!this.files.anyRevisionsToBeReviewed)||_get(this,"review","context","singleFile")&&this===_get(this,"review","context","onlyFile"))&&(e=!0),e||_.includes([this.commented,_get(this,"diff","empty"),_get(this,"review","context","singleFile")],void 0)||(e=!1),Vue.set(this,"nonTrivialLatch",!!e),void 0!==e?!e:void 0}get cleanlyRenamed(){if(_get(this,"review","context","listFiles"))return _.every(this.revisions,e=>"kept"===e.action||"renamed"===e.action)}get effectiveGroup(){if(!_get(this,"review","context","listFiles")||void 0===this.reverted)return;if(_.startsWith(this.group,"^"))return this.group.slice(1)||null;const e=_get(this,"review","context","autoUngrouped");return this.reverted&&!_get(e,s)?s:this.cleanlyRenamed&&!e[i]?i:this.group?this.group:this.vendored&&!e[n]?n:_get(this,"revisions","lastUnkept","fileSha")||e[r]?null:r}get groupForSorting(){if(!_get(this,"review","context","listFiles"))return;return o(a[this.effectiveGroup]||this.effectiveGroup)}get bareNameForSorting(){if(_get(this,"review","context","listFiles"))return o(this.bareName)}get extension(){return this.name&&this.bareName?this.name.slice(this.bareName.length+1):""}get extensionForSorting(){return this.extension?o(this.extension.replace(/^(h|hh|hpp|hxx|inc)$/,e=>" "+e)):""}get dirNameForSorting(){if(!this.path)return"";const e=this.path.lastIndexOf("/");return e>=0?o(this.path.slice(0,e).replace(/\//g,"\0")):""}get segmentedPathHtml(){return"-commits"===this.$key?'<i class="commit icon"></i><span> Commits</span>':`<span class="segmented">${this.segmentedPath||_.escape(this.path)}</span>`}get uri(){if(!_get(this,"review","context","baseReviewUrl"))return;let e="";return _get(this,"diff","bounds",1)&&(e=`#${_get(this,"diff","bounds",0,"$key")||"base"}..${this.diff.bounds[1].$key}`),`${this.review.context.baseReviewUrl}/${encodeURI(this.path)}${e}`}get reviewMarkStyle(){if(!this.review.userIsAuthor||!this.$info.userid)return"review";
1const e=_get(this,"review","designatedReviewers","designations",this.$key);if(!e)return"self-review";return _.some(e.allUsers,{subjectKey:this.$info.userid})||_get(e,"anyone","includeAuthor")||this.$store.services.teamMemberships.currentUserTeamsLoaded&&_.some(e.allTeams,e=>e.includeAuthor&&this.$store.services.teamMemberships.isMember(this.$info.userid,e.subjectKey))?"review":"self-review"}get designationTargetsReady(){if(!this.$info.userid)return!0;const e=this.review.designatedReviewers;if(void 0===e.designations)return!1;const t=e.currentDesignations||e.designations,s=e.prospectiveDesignations||e.designations,i=[t[this.$key],s[this.$key]];return!_(i).compact().flatMap("unfulfilledTeams").compact().some(e=>!this.review.userIsAuthor||e.includeAuthor)||this.$store.services.teamMemberships.currentUserTeamsLoaded}get toBeReviewedByUser(){if(!this.$info.userid||this.assimilated)return!1;if(this.review.userIsAuthor)return!0;if(!this.review.userIsReviewer)return!1;const e=this.$store.services.teamMemberships;if("-commits"===this.$key)return!0;if("personallyUnreviewed"===this.reviewOverlapStrategy)return!0;if(void 0===this.review.designatedReviewers.designations)return;if(!e.currentUserTeamsLoaded)return;const t=this.review.designatedReviewers.designations[this.$key];return!(t&&!(t.anyone||_.some(t.allUsers,{subjectKey:this.$info.userid})||_.some(t.allTeams,t=>e.isMember(this.$info.userid,t.subjectKey))))&&(!("unreviewed"!==this.reviewOverlapStrategy&&!_get(this,"review","state","settings","overlapOtherReviewers"))||("unclaimed"===this.reviewOverlapStrategy?_.isEmpty(this.reviewerKeys)||_.includes(this.reviewerKeys,this.$info.userid)||!!_get(this,"review","state","marks",this.$key)||_.some(_get(t,"unfulfilledUsers"),{subjectKey:this.$info.userid})||!_.every(_get(t,"unfulfilledTeams"),({subjectKey:t})=>_.some(this.reviewerKeys,s=>e.isMember(s,t)))&&_.some(_get(t,"unfulfilledTeams"),({subjectKey:t})=>e.isMember(this.$info.userid,t)):void 0))}get currentRevisionToBeReviewed(){return this.toBeReviewedByUser&&_get(this,"diff","bounds",1)&&!this.diff.empty&&this.reviewLevelForRevision(_get(this,"diff","bounds",1))<this.getUnreviewedThreshold(_get(this,"diff","bounds",1,"$key"))}get latchedRevisionToBeReviewed(){return this.visibilityLatched||Vue.set(this,"_toBeReviewedLatch",this.currentRevisionToBeReviewed),this._toBeReviewedLatch}get reviewMarkUserKeys(){return _(this.revisions).flatMap(e=>_.keys(e.reviewers)).uniq().value()}get reviewerKeys(){return _.reject(this.reviewMarkUserKeys,e=>_get(this,"review","people",e,"author"))}get nextToLatestReviewerKeys(){const e=_.findLast(this.revisions.list,e=>e!==this.revisions.last&&_.some(e.reviewers,(e,t)=>!_get(this,"review","people",t,"author")));return _(_get(e,"reviewers")).keys().reject(e=>_get(this,"review","people",e,"author")).value()}get reviewLevel(){if(!this.$info.userid||_access(this,"","review","","state","","isLocked","call",[])||!_get(this,"diff","bounds",1))return-1;const e=this.diff.bounds[1],t=this.currentRevisionToBeReviewed?0:this.reviewLevelForRevision(e);if(0===t){if(!this.toBeReviewedByUser||this.diff.empty||this.review.userCanDeferFiles&&this.review.userHasDeferred)return 1;if(this.diff.bounds[0]&&this.revisions.lastReviewedByUser){const e=_get(this,"revisions","nearestUnkept",this.diff.bounds[0].$key);if(_get(e,"index")>this.revisions.lastReviewedByUser.index)return 1}}return t}reviewLevelForRevision(e){return"self-review"===this.reviewMarkStyle?e.personalReviewLevel:void 0!==e.personalReviewLevel&&void 0!==e.reviewLevel?Math.max(e.personalReviewLevel,e.reviewLevel):void 0}getUnreviewedThreshold(e){const t=_get(this,"revisions","nearest",e);if(!t&&"-commits"===this.$key)return;return this.toBeReviewedByUser&&(this.review.userIsAuthor||"personallyUnreviewed"===this.reviewOverlapStrategy||"-commits"===this.$key&&!t.reviewed)?3:2}isCollapsedAndTrivial(e){if(!e||!this.effectiveGroup||this.commented)return!1;if(!_get(this,"files","groups",this.effectiveGroup,"collapsed"))return!1;if(!this.toBeReviewedByUser)return!0;const t=this.revisions.nearest[e];return!t||this.reviewLevelForRevision(t)>=this.getUnreviewedThreshold(t.$key)}get unreviewed(){const e=_get(this,"review","core","lastRevisionKey"),t=_get(this,"revisions","nearest",e);if(t)return this.reviewLevelForRevision(t)<this.getUnreviewedThreshold(e)}get neutrallyUnreviewed(){const e=_get(this,"revisions","nearest",_get(this,"review","core","lastRevisionKey"),"neutrallyReviewed");if(void 0!==e)return!e}get neutrallyUnreviewedByDefault(){const e=_get(this,"revisions","nearest",_get(this,"review","core","lastRevisionKey"),"neutrallyReviewedByDefault");if(void 0!==e)return!e}get neutrallyUnreviewedWithoutDrafts(){const e=_get(this,"review","core","lastRevisionKey");let t=_get(this,"revisions","nearest",e);if(_get(t,"immaterial")&&(t=_get(this,"revisions","nearestUnkept",e)),t)return _.isBoolean(t.reviewed)?!t.reviewed:!t.reviewedByNonAuthor}get currentDesignationTargets(){return this._computeDesignationTargets(_get(this,"review","designatedReviewers","currentDesignations",this.$key))||{you:!1,anyone:!0,others:!1,omitBaseChanges:!1}}get prospectiveDesignationTargets(){return this._computeDesignationTargets(_get(this,"review","designatedReviewers","prospectiveDesignations",this.$key))||this.currentDesignationTargets}_computeDesignationTargets(e){if(!e)return;const t=_.filter(e.unfulfilledUsers,{subjectKey:this.$info.userid}),s=this.$store.services.teamMemberships,i=s.currentUserTeamsLoaded?_.filter(e.unfulfilledTeam
1s,e=>(!this.review.userIsAuthor||e.includeAuthor)&&s.isMember(this.$info.userid,e.subjectKey)):[],r=_.every(t,"omitBaseChanges")&&_.every(i,"omitBaseChanges");return{you:!(!this.$info.userid||!t.length&&!i.length),anyone:!(!e.anyone||e.anyoneFulfilled),others:_.some(e.unfulfilledUsers,e=>e.subjectKey!==this.$info.userid)||!_.isEmpty(e.unfulfilledTeams),omitBaseChanges:r}}get reviewChip(){if(!_get(this,"review","context","listFiles"))return;if(void 0===this.neutrallyUnreviewed||void 0===this.revisions.latestReviewedBy||void 0===this.review.designatedReviewers.designations)return{dominantIcon:"preparing"};const e=_get(this,"review","core","lastRevisionKey"),t=this.review.designatedReviewers.designations[this.$key],s=_get(this,"revisions","latestReviewedBy",this.$info.userid),i=_get(s,"fully","effectiveRevisionKey")===e,r=_get(s,"moduloBaseChanges","effectiveRevisionKey")===e,n=_get(this,"prospectiveDesignationTargets","omitBaseChanges")&&_get(this,"currentDesignationTargets","omitBaseChanges"),a=this.review.state,o=!this.review.stateReady||!this.designationTargetsReady||this.$info.userid&&!_get(a,"drafts","completionConditionResult")&&_get(a,"num","pendingSend"),l=!this.neutrallyUnreviewed,c=l&&this.neutrallyUnreviewedWithoutDrafts,u=_get(this,"prospectiveDesignationTargets","you")&&!(n?r:i),d=_get(this,"prospectiveDesignationTargets","anyone"),h=_get(t,"anyone","omitBaseChanges")?r:(t?t.anyone:this.toBeReviewedByUser)?i:null,p=this.review.userIsReviewer||this.review.userIsAuthor&&_get(t,"anyone","includeAuthor"),v=d&&p&&!1===h,m=d&&p&&_get(this,"currentDesignationTargets","anyone")!==d,g=_get(this,"prospectiveDesignationTargets","others"),f=g&&_get(this,"currentDesignationTargets","others")!==g;return{dominantIcon:o?"preparing":c?"green done":l?"done":u?"red you":v?"red anyone":f?"green others":g?"others":m?"green anyone":d?"anyone":"others",done:l,draftDone:c,youUnreviewed:u,anyone:d,anyoneUnreviewed:v,anyoneDraft:m,others:g,othersDraft:f}}get reviewOverlapStrategy(){return _get(this,"review","state","settings","reviewOverlapStrategy")}get moreRevisionsToReviewLater(){return this.toBeReviewedByUser&&(!_get(this,"diff","bounds",1)||this.diff.bounds[1].index<_get(this,"revisions","lastUnkept","index"))}getNextLikelyFile(){if(void 0===this.index)return;if(!_get(this,"review","context","listFiles")||void 0===_get(this,"review","context","singleFile"))return;const e=_get(this,"files","showingList");if(!e||this.index>=e.length)return;let t=this.index;for(;(t=(t+1)%e.length)!==this.index;){const s=e[t];if(!s.trivial||_get(this,"review","context","singleFile"))return s}return this}buildReviewMarkUpdates(e,t,s){const i=this.revisions.nearestUnkept[t];if(!i)return;const r=i.original,n=[r];_(this.revisions.list).slice(0,i.index+1).filter("otherOriginalFileKey").reverse().forEach(e=>{if(!_.some(n,t=>t.file.$key===e.otherOriginalFileKey)){const t=e.otherOriginal;n.push(t.$parent.nearestUnkeptRaw[t.$key])}});const a={};let o=!1;return r.draftReviewMark&&!0!==e?_.forEach(n,e=>{e.draftReviewMark&&Vue.set(a,e.draftReviewMarkRef,null)}):_get(r,"reviewers",this.$info.userid)&&!0!==e?_.forEach(n,e=>{Vue.set(a,_ref(e,"child","reviewers",this.$info.userid),null)}):_get(r,"reviewers",this.$info.userid)||!1===e||(_.forEach(n,e=>{e.draftReviewMark||(Vue.set(a,e.draftReviewMarkRef,!0),s&&s.push(e))}),o=this.review.userCanDeferFiles&&this.review.userHasDeferred),{updates:a,clearDeferral:o}}toggleReviewed(t,s,i){if(this.reviewLevel<0)return;if(_access(this,"","review","","state","","isLocked","call",[]))return;const r=s?this.review.core.lastRevisionKey:_get(this,"diff","bounds",1,"$key"),n=this.buildReviewMarkUpdates(t,r,i);n&&(Vue.set(e.onboarding,"markedFileReviewed",!0),n.clearDeferral&&this.review.state.clearAndCommitParticipantDeferralUpdates(),_.isEmpty(n.updates)||this.$store.$update(n.updates))}latchVisibility(e){Vue.set(this,"visibilityLatched",e)}}}},!1,!0,{filename:"src/model/reviews/files/reviews.$reviewKey.files.$fileKey.js",modelPath:"/reviews/$reviewKey/files/$fileKey",modelExportName:"File"}),_reviewable.define(["FileRevision"],["corpsman"],function(e){"use strict";return{FileRevision:class FileRevision{constructor(){Vue.set(this,"index",void 0),Vue.set(this,"review",this.$parent.$parent.$parent.$parent),Vue.set(this,"file",this.$parent.$parent),Vue.set(this,"coverage",void 0),Vue.set(this,"inferred",this),Vue.set(this,"secondary",!1),Vue.set(this,"_basemapFetches",{}),this.file.joined&&(this.$observe(()=>_get(this,"original","reviewed"),e=>{_ref(this,"child","reviewed").override(e)}),this.$observe(()=>_get(this,"original","reviewers"),e=>{_ref(this,"child","reviewers").override(e)},{deep:!0}))}get assimilated(){return this.inferred!==this||this.secondary}get reintroducedFromRenamedFiles(){if("added"!==this.action||this.assimilated)return;if(!_get(this.file.revisions.list[this.index-1],"assimilated"))return;const e=_.parseInt(this.$key.slice(1));return _(this.file.files).filter("history").filter(t=>_(t.history).filter(t=>_.parseInt(t.revisionKey.slice(1))<e).find({fileKey:this.file.$key}
1)).value()}get original(){return this.originalFileKey?_get(this,"review","files",this.originalFileKey,"revisions",this.$key):this}get otherOriginal(){return this.otherOriginalFileKey?_get(this,"review","files",this.otherOriginalFileKey,"revisions",this.otherOriginalRevKey):this}get _otherBasemapRevision(){if(this.file.system||this.assimilated)return null;if(!_get(this,"review","revisions","$ready")||!this.$parent.list||void 0===this.index)return;const e=this.review.revisions[this.$revisionKey];if(!e)return;return this.$parent[e.priorRevisionKey]||this.$parent.list[this.index-1]||null}get basemapKey(){if(this._otherBasemapRevision)return`${this._otherBasemapRevision.fileSha}_${this._otherBasemapRevision.baseFileSha}-${this.fileSha}_${this.baseFileSha}`}get basemapNeeded(){if(_get(this,"review","verdict")&&this._baseChangesWorksheet)return this.review.verdict.push&&this._baseChangesWorksheet.needBasemap}get _storedBasemapRef(){if(this.basemapKey)return _ref(this.$store,"child","basemaps",this.$reviewKey,this.basemapKey)}get basemapReady(){if(_get(this,"review","context","diffFiles")&&void 0!==this.basemapNeeded){if(!this.basemapNeeded)return!0;if(this._otherBasemapRevision&&this.basemapKey){if("done"===this._basemapFetches[this.basemapKey])return!0;if(this._storedBasemapRef&&this._storedBasemapRef.ready){if(this._storedBasemapRef.value)return!0;if(this.review.context&&_get(this,"file","diff","bounds"))return(this.file.diff.current||this.file.diff.postponed||void 0===this.file.diff.bounds[0]&&void 0===this.file.diff.bounds[1])&&this._computeBasemap(),!1}}}}_computeBasemap(){if(this._basemapFetches[this.basemapKey])return;const t=this.basemapKey;Vue.set(this._basemapFetches,t,!0),this.review.context.fileDiffer.computeBasemap(this._otherBasemapRevision,this).finally(()=>{Vue.set(this._basemapFetches,t,"done")}).catch(t=>{Vue.set(t,"extra",_.assign(t.extra||{},{reviewKey:this.$reviewKey,fileKey:this.$fileKey,revisionKey:this.$revisionKey,basemapKey:this.basemapKey})),e.capture(t,"compute basemap")})}get reverted(){return this.fileSha===this.baseFileSha&&!this.baseFileShaIsInherited&&this.fileMode===this.baseFileMode&&!this.baseFileModeIsInherited}get _baseChangesWorksheet(){const e={only:!1,missing:!1,mixed:!1,needBasemap:!1},t=this._otherBasemapRevision;if(void 0===t)return;if(null===t)return e;const s=this.fileMode===this.baseFileMode||this.reverted,i=this.fileMode!==t.fileMode,r=this.baseFileMode!==t.baseFileMode,n=this.fileSha===this.baseFileSha||this.reverted,a=this.fileSha!==t.fileSha,o=this.baseFileSha!==t.baseFileSha;if(!o&&!r)return e;if(void 0!==this.reverted){if(Vue.set(e,"only",!!this.reverted||!(r&&!s)&&(!o||null)),Vue.set(e,"missing",!(!r||i||s)||!!o&&(!a&&!n||null)),Vue.set(e,"mixed",!0),Vue.set(e,"needBasemap",!e.missing&&null===e.only||!e.only&&null===e.missing),e.only&&e.missing)throw _.assign(new Error("Internal error: base changes both only and missing"),{extra:{reviewKey:this.$reviewKey,fileKey:this.$fileKey,revisionKey:this.$revisionKey,otherRevKey:t.$key,baseChanges:e,reverted:this.reverted,headModeReverted:s,headModeChanged:i,baseModeChanged:r,headFileReverted:n,headFileChanged:a,baseFileChanged:o}});return e}}get baseChanges(){if(this._baseChangesWorksheet&&(!this._baseChangesWorksheet.needBasemap||_get(this,"_storedBasemapRef","ready")))return this._baseChangesWorksheet.only?"only":this._baseChangesWorksheet.missing||_get(this,"_storedBasemapRef","value","baseChangesMissing")?"missing":_get(this,"_storedBasemapRef","value","baseChangesOnly")?"only":this._baseChangesWorksheet.mixed?"mixed":null}get draftReviewMarkRef(){return _ref(this.$store,"child","users",this.$info.userid,"state",this.$reviewKey,"marks",this.originalFileKey||this.$fileKey,"revisions",this.$key,"reviewed")}get draftReviewMark(){if(_get(this,"review","stateReady"))return!!_get(this,"review","state","marks",this.originalFileKey||this.$fileKey,"revisions",this.$key,"reviewed")}get reviewedAfterDrafts(){if(null===this.$info.userid)return null;const e=_get(this,"review","state","drafts","reviewedFlags");if(!e)return;const t=this.$parent.nearestUnkept[this.$key];if(!t)return null;const s=_get(e,t.originalFileKey||t.$fileKey,t.$key);return void 0!==s?s:null}get commits(){return"kept"===this.action?[]:_get(this,"review","revisions",this.$key,"commits")}get renamed(){return _get(this,"review","revisions",this.$key,"f
1ilemap",_get(this,"original","file","$key"))}get immaterial(){return"kept"===this.action&&!(this.originalFileKey&&this.renamed)}get reviewedByNonAuthor(){return _.some(this.reviewers,(e,t)=>!_get(this,"review","people",t,"author"))}get neutrallyReviewed(){const e=this.reviewedAfterDrafts;return null!==e?e:this.neutrallyReviewedByDefault}get neutrallyReviewedByDefault(){const e=this.immaterial?_get(this,"$parent","nearestUnkept",this.$key):this;if(e){if(_.isBoolean(e.reviewed))return e.reviewed;if(e.reviewedByNonAuthor)return!0;if(e.review.userIsAuthor)return!1;if(void 0!==e.draftReviewMark)return!!e.draftReviewMark}}get markedReviewed(){return this.immaterial?_get(this,"$parent","nearestUnkept",this.$key,"markedReviewed"):!!this.reviewedByNonAuthor||(void 0!==this.draftReviewMark?!!this.draftReviewMark&&!this.review.userIsAuthor:void 0)}get directReviewLevel(){if(void 0!==this.$info.userid){if(this.immaterial)return _get(this,"$parent","nearestUnkept",this.$key,"directReviewLevel");if(_get(this,"reviewers",this.$info.userid))return 5;if(void 0!==this.draftReviewMark)return this.draftReviewMark?4:this.reviewed||void 0===this.reviewed&&this.reviewedByNonAuthor?2:-1}}get personalReviewLevel(){if(void 0!==this.directReviewLevel)return this.directReviewLevel>=4?this.directReviewLevel:_get(this,"$parent","lastReviewedByUser","directReviewLevel")>=4&&this.index<=this.$parent.lastReviewedByUser.index?3:0}get reviewLevel(){if(-1!==this.directReviewLevel)return this.directReviewLevel;if(3===this.personalReviewLevel)return 3;const e=_get(this,"$parent","nearestUnkept",this.$key);return e?!1===e.reviewed?0:this.$parent.lastReviewedIndirectly&&this.index<=this.$parent.lastReviewedIndirectly.index?2:0:void 0}}}},!1,!0,{filename:"src/model/reviews/files/reviews.$reviewKey.files.$fileKey.revisions.$revisionKey.js",modelPath:"/reviews/$reviewKey/files/$fileKey/revisions/$revisionKey",modelExportName:"FileRevision"}),_reviewable.define(["FileRevisions"],[],function(){"use strict";return{FileRevisions:class FileRevisions{constructor(){Vue.set(this,"review",this.$parent.$parent.$parent)}get list(){return _(this).sortBy(e=>_.parseInt(e.$key.slice(1))).index().value()}get last(){return _.last(this.list)}get nearest(){return this._expandNearest()}get nearestUnkept(){return this._expandNearest(e=>"kept"!==e.action||e.originalFileKey&&e.renamed)}get lastUnkept(){return _get(this,"nearestUnkept",_get(this,"review","core","lastRevisionKey"))}get nearestUnkeptRaw(){return this._expandNearest(e=>"kept"!==e.action||e.originalFileKey&&e.renamed,!0)}get lastReviewedIndirectly(){return _.findLast(this.list,e=>!e.assimilated&&e.markedReviewed)}get lastReviewed(){return this.nearestUnkept[_get(this,"lastReviewedIndirectly","$key")]}get allObsolete(){return _.every(this,e=>e.assimilated||_get(this,"review","revisions",e.$key,"obsolete"))}get basemapsReady(){return _.every(this,e=>e.basemapReady)}_expandNearest(e,t){let s=null;const i={};return _.forEach(_get(this,"review","revisions","keysList"),r=>{const n=this[r];!n||!t&&n.assimilated||e&&!e(n)||(s=n),Vue.set(i,r,s)}),i}get lastReviewedByUser(){if(!this.$info.userid)return;if(_.some(this.list,e=>!e.assimilated&&void 0===e.directReviewLevel))return;let e=_.findLast(this.list,e=>!e.assimilated&&e.directReviewLevel>=4)||null;return e&&(e=this.nearestUnkept[e.$key]),e}get lastReviewedByUserExceptDrafts(){if(!this.$info.userid)return;if(_.some(this.list,e=>!e.assimilated&&void 0===e.directReviewLevel))return;const e=_.findLast(this.list,e=>!e.assimilated&&e.directReviewLevel>=5);return e?this.nearestUnkept[e.$key]:null}get latestReviewedBy(){if(!_get(this,"review","context","listFiles")||_.isEmpty(this.review.revisions))return;const e=this.review.revisions[_get(this,"review","core","lastRevisionKey")];if(!e)return;const t={};let s,i,r=!0,n=!0;return _(this.review.revisions.list).slice(0,e.index+1).forEachRight(e=>{const t=this[e.$key];t&&!t.assimilated&&(r&&(s=t),n&&(i=t),t.draftReviewMark&&a(e,this.$info.userid,!0),_.forEach(t.reviewers,(t,s)=>{a(e,s,!1)}),r=!t.immaterial,n=!t.immaterial&&"only"!==t.baseChanges)}),t;function a(e,r,n){const a=Vue.set(t,r,t[r]||{});a.fully||Vue.set(a,"fully",{revisionKey:e.$key,effectiveRevisionKey:s.$key,draft:n}),(!a.moduloBaseChanges||!n&&a.moduloBaseChanges.draft&&i.$key===a.effectiveRevisionKey)&&Vue.set(a,"moduloBaseChanges",{revisionKey:e.$key,effectiveRevisionKey:i.$ke
1y,draft:n})}}get cells(){if(!_get(this,"review","context","diffFiles")||this.$parent.assimilated)return;let e,t,s;const i=_.map(this.review.revisions.list,i=>{const r={revKey:i.$key,index:i.index},n=this[i.$key];return n&&!n.assimilated?(_.assign(r,{revisionClass:n.action,renamed:!!n.renamed,reverted:n.reverted,arcs:_get(this,"review","revisions","arcs",i.$key),priorAction:n.priorAction,baseChanges:n.baseChanges}),n.draftReviewMark&&(t=r),_get(n,"reviewers",this.$info.userid)&&(s=r)):(Vue.set(r,"missing",!0),_get(e,"missing")&&Vue.set(e,"elideBorder",!0)),e=r,r});return s&&Vue.set(s,"reviewedIcon","user"),t&&Vue.set(t,"reviewedIcon","draft"),i}}}},!1,!0,{filename:"src/model/reviews/files/reviews.$reviewKey.files.$fileKey.revisions.js",modelPath:"/reviews/$reviewKey/files/$fileKey/revisions",modelExportName:"FileRevisions"}),_reviewable.define(["FilesDiffs"],["session","analytics","mangler"],function(e,t,s){"use strict";return{FilesDiffs:class FilesDiffs{static get $trussMount(){return{path:"/reviews/$reviewKey/files/diffs",hidden:!0,local:!0}}constructor(){Vue.set(this,"review",this.$parent.$parent),Vue.set(this,"files",this.$parent),Vue.set(this,"lastReviewerKeyHint",void 0),Vue.set(this,"_firstFileDiffTimeRecorded",!1)}get ready(){if(!_get(this,"review","context","diffFiles"))return;if(!this.files.joinedOnce)return!1;let e,s=0;if(_get(this,"review","context","singleFile")?(s=1,e=_get(this,"review","context","onlyFile","diff","current","showing")):e=_.every(this.files,e=>{const t=!(e.assimilated||e.trivial&&e.visibilityLatched);return t&&s++,!t||_get(e,"diff","current","showing")}),!this._firstFileDiffTimeRecorded){const e=_.find(this.files.list,e=>!e.trivial&&_get(e,"diff","current","rightRevKey"));_get(e,"diff","current","showing")&&(t.time("diffFirst"),Vue.set(this,"_firstFileDiffTimeRecorded",!0))}return e&&t.time("diffRest",{numFiles:_.size(this.files),numNonTrivialFiles:s}),e}get lineStatsSum(){if(!_get(this,"review","context","diffFiles"))return;const e={changed:0,inserted:0,deleted:0,totalDelta:0};return _.forEach(this.files,t=>{const s=_get(t,"diff","current","lineStats");s&&(s.changed&&(e.changed+=s.changed),s.inserted&&(e.inserted+=s.inserted),s.deleted&&(e.deleted+=s.deleted),s.totalDelta&&(e.totalDelta+=s.totalDelta),s.unknown&&Vue.set(e,"unknown",!0))}),e}get sizeSum(){if(!_get(this,"review","context","diffFiles"))return;let e=0,t=0;_.forEach(this.files,s=>{const i=_get(s,"diff","current","size");i&&(i.totalDelta>0?e+=i.totalDelta:i.totalDelta<0&&(t+=i.totalDelta))});const s={totalDelta:e+t};return e&&Vue.set(s,"increased",filesize.filesize(e)),t&&Vue.set(s,"decreased",filesize.filesize(Math.abs(t))),s}get proposedSpec(){if(!_get(this,"review","context","diffFiles")||!this.$parent.joinedOnce||void 0===this.$info.userid)return;if(!this.review.revisions.list)return;if(!this.files.toBeReviewedByUserReady)return;if(!_.every(this.files,e=>e.revisions.list))return;if(!this.review.userIsReviewer||"combinedCommits"===_get(this,"review","core","revisionSplitStrategy"))return{rangeType:"full"};const e=this.review.revisions,t=e[this.review.core.lastRevisionKey];if(!t)return;const s=_(this.files).map(s=>{if(s.assimilated||!s.toBeReviewedByUser||s.revisions.allObsolete)return t.index;if(s.revisions.lastReviewedByUser){if(!e[s.revisions.lastReviewedByUser.$key])return-1/0;let i=Math.min(t.index,e[s.revisions.lastReviewedByUser.$key].index);if(i<t.index){const t=_.find(s.revisions.list.slice(s.revisions.lastReviewedByUser.index+1),e=>"kept"!==e.action);if(t&&!e[t.$key])return-1/0;i=(t?e[t.$key].index:e.list.length)-1}return i}const i=_get(s,"revisions","list",0);return i?e[i.$key]?e[i.$key].index-1:-1/0:-1}).min();if(void 0===s||s===-1/0)return;const i=s>=0?e.list[s]:null,r=_.find(e.list.slice(s+1),e=>!e.obsolete);return!r||_.every(this.files,e=>!e.toBeReviewedByUser)?{rangeType:"last"}:{rangeType:"single",lastCoveredRev:i,nextRev:r}}get proposedAction(){if(!_get(this,"review","context","listFiles"))return;const e=_get(this,"review","revisions",this.review.core.lastRevisionKey,"$key");return _.every(this.files,t=>{const s=t.diff;return!_get(s,"proposedBounds")||!s.proposedBounds[0]&&!s.proposedBounds[1]||_get(s,"proposedBounds",0,"$key")===e&&_get(s,"proposedBounds",1,"$key")===e})?"Show latest revision":this.review.userIsAuthor?"Show auto diffs":("onePerCommit"===_get(this,"review","core","revisionSplitStrategy")?"Next":"Show")+" diffs to review"}get proposedBoundsDifferFromCurrent(){if(_get(this,"review","context","diffFiles"))return _.some(this.files,"diff.proposedBoundsDifferFromCurrent")}get proposedBoundsNeededToAdvanceReview(){if(_get(this,"review","context","listFiles"))return this.proposedBoundsDifferFromCurrent&&!this.files.num.currentToReview&&this.files.num.toReview}get proposedBoundsAlmostNeededToAdvanceReview(){if(_get(this,"review","context","listFiles"))return 1===this.files.num.currentToReview&&this.files.num.moreToReviewThanCurrent}setProposedBounds(){Vue.set(e.onboarding,"setProposedRevRanges",!0),this.$when(()=>_.every(this.files,"diff")).then(()=>{_.forEach(this.files,e=>{e.diff.setBounds(_.clone(e.diff.proposedBounds),!0)})})}
1get _shape(){if(!_get(this,"review","context","diffFiles")||!_get(this,"review","revisions","$ready"))return;let e=null,t=null,s=null;const i=[];let r=!!this.$info.userid,n=!0,a=this.files.reviewerKeys,o=!1;const l=_get(_.findLast(this.review.revisions.list,e=>e.capturerKey||e.softCapturerKey),"$key");if(_.forEach(this.files.list,l=>{if(l.assimilated||!_get(l,"diff","bounds"))return;let c=_get(l,"diff","bounds",1,"$key");if(void 0===c||!this.review.revisions[c])return void i.push(l);s!==c&&c&&s&&"mixed"!==s&&(this.review.revisions[c].index<this.review.revisions[s].index?l.revisions.nearest[s].$key===c&&(c=s):_.every(this.files.list.slice(0,l.index),e=>e.assimilated||!_get(e,"diff","bounds")||_.includes(i,e)||e.revisions.nearest[c].$key===s)&&(s=c)),s!==c&&(s=s?"mixed":c);const u=_get(l,"diff","bounds",0,"$key")||"base";u===c?l.trivial||(o=!0):e!==u&&(e=e?"mixed":u),"base"!==u&&t!==u&&(t=t?"mixed":u);const d=l.revisions.nearestUnkept[u];r=r&&(l.revisions.lastReviewedByUser===(d||null)||l.revisions.lastReviewedByUserExceptDrafts===(d||null)),n=n&&l.revisions.lastReviewed===d,a.length&&(a=_.filter(a,e=>(_get(l,"revisions","latestReviewedBy",e,"fully","revisionKey")||"base")===u))}),s&&"mixed"!==s&&"r1"!==s&&"mixed"===e&&t&&"mixed"!==t){const s=_.range(0,this.review.revisions[t].index+1);_.every(this.files,e=>!!e.assimilated||(!(_get(e,"diff","bounds",1)&&!_get(e,"diff","bounds",0))||_.every(s,t=>!e.revisions[this.review.revisions.list[t].$key])))&&(e=t)}const c=1===a.length?a[0]:_.includes(a,this.lastReviewerKeyHint)?this.lastReviewerKeyHint:null;return{leftRevKey:e,leftNonBaseRevKey:t,rightRevKey:s,filesWithNoRightRev:i,lastSnapshottedRevKey:l,leftIsLastReviewedByUser:r,leftIsLastReviewedByAnyone:n,leftLastReviewerKey:c,leftIsLastSnapshotted:e===l,rightIsLastSnapshotted:s===l,nilDiffsPresent:o}}get description(){const e=this.review;if(!this.files.anyDiffsShowing)return{icon:"no diffs",text:"No changes in current diff range.",shortText:" empty diff"};if(!this._shape)return{icon:"reviewing",text:"Review in progress.",shortText:"review in progress"};const t=e.userIsAuthor&&!e.userIsReviewer;let i,r;const n=!this.proposedBoundsNeededToAdvanceReview||!e.userIsReviewingFiles||e.userCanDeferFiles&&e.userHasDeferred?"":"red";if(this._shape.rightRevKey&&"mixed"!==this._shape.rightRevKey&&(r=this._shape.rightRevKey===e.core.lastRevisionKey?{long:`the <b>latest</b> revision (${this._shape.rightRevKey})`,short:o(this._shape.rightRevKey,!0)}:this._shape.rightIsLastSnapshotted&&t?{long:`the <b>last snapshotted</b> revision (${this._shape.lastSnapshottedRevKey})`,short:o(this._shape.lastSnapshottedRevKey,!0)}:{long:`revision <b>${this._shape.rightRevKey}</b>`,short:o(this._shape.rightRevKey,!0)}),this._shape.leftRevKey&&this._shape.leftRevKey!==this._shape.rightRevKey){const e="mixed"===this._shape.leftRevKey;if("base"===this._shape.leftRevKey)i={long:r?"its <b>⥠base</b> revision":"their corresponding <b>⥠base</b> revisions",short:o(null)};else if(this._shape.leftIsLastSnapshotted&&t)i={long:`the <b>last snapshotted</b> revision (${this._shape.lastSnapshottedRevKey})`,short:o(this._shape.lastSnapshottedRevKey)};else if(this._shape.leftIsLastReviewedByUser)i={long:'your <b><i class="last reviewed icon"></i> last reviewed</b> revision'+(e?"s":""),short:'<i class="last reviewed icon"></i> <span class="note">(last reviewed by you)</span>'};else if(this._shape.leftIsLastReviewedByAnyone)i={long:'everyone\'s <b><i class="participants icon"></i> last reviewed</b> revision'+(e?"s":""),short:'<i class="participants icon"></i> <span class="note">(last reviewed by anyone)</span>'};else if(this._shape.leftLastReviewerKey){const t=this.$store.services.avatars,r=this._shape.leftLastReviewerKey,n=`<img class="ui user tiny avatar image" src="${t.inferGitHubAvatarUrl(r)}" fallback="${r}" onerror="${s.fallbackAvatarErrorCallback}"></img>`,a=t.users[r],o=_get(a,"username"),l=_get(a,"displayName")||_get(a,"username");i={long:`${n} ${_.escape(l)}'s <b>last reviewed</b> revision${e?"s":""}`,short:n+' <span class="note">(last <i class="reviewed icon"></i> by '+`${_.escape(o)})</span>`}}else e?r&&(i={long:"various revisions",short:o("r??")}):i={long:`revision <b>${this._shape.leftRevKey}</b>`,short:o(this._shape.leftRevKey)};i&&(Vue.set(i,"long",` against ${i.long}`),Vue.set(i,"short",` vs <span class="left bound">${i.short}</span>`))}r=r||{long:"a mix of revisions",short:o("r??")},Vue.set(r,"short",`<span class="right bound">${r.short}</span>`);const a=i&&this._shape.nilDiffsPresent?" (mostly)":"";return{text:`Reviewing ${r.long}${_get(i,"long")||""}${a}.`,shortText:`${r.short}${_get(i,"short")||""}`};function o(t,s){if(null===t)return'<span class="ui lowercase label">â¥</span> <span class="note">(base)</span>';if(t){let i=`<span class="ui lowercase label ${s?n:""}">${t}</span>`;return t===e.core.lastRevisionKey&&(i+=' <span class="note">(last)</span>'),"r??"===t&&(i+=' <span class="note">(various)</span>'),i}}}get fullBoundsDifferFromCurrent(){return _.some(this.files,e=>e.trivial||_get(e,"diff","fullBoundsDifferFromCurrent"))}showFullDiff(){_get(this,"review","revisions","list")&&_get(this,"review","core","lastRevisionKey")&&this.fullBoundsDifferFromCurrent&&(Vue.set(e.onboarding,"showedFullDiff",!0),this.$when(()=>_.every(this.files,"diff")).then(()=>{_.forEach(this.files,e=>{e.diff.setBounds(_.clone(e.diff.fullBounds),!0),this.$nextTick().then(()=>{Vue.set(e,"nonTrivialLatch",!0)})})}))}setPersonallyUnreviewedBounds(){_get(this,"review","revisions","list")&&_get(this,"review","core","lastRevisionKey")&&(Vue.set(e.onboarding,"showedPersonallyUnreviewedDiff",!0),this.$when(()=>_.every(this.files,"diff")).then(()=>{_.forEach(this.files,e=>{e.diff.setBounds(_.clone(e.diff.personallyUnreviewedBounds),!0)})}))}setUnreviewedBounds(){_get(this,"review","revisions","list")&&_get(this,"review","core","lastRevisionKey")&&(Vue.set(e.onboarding,"showedUnreviewedDiff",!0),this.$when(()=>_.every(this.files,"diff")).then(()=>{_.forEach(this.files,e=>{e.diff.setBounds(_.clone(e.diff.unreviewedBounds),!0)})}))}diffSinceLastReviewedBy(e){Vue.set(this,"lastReviewerKeyHint",e),_.forEach(this.files.list,t=>{if(!t.diff)return;const s=_get(t,"revisions","latestReviewedBy",e,"fully","revisionKey"),i=t.revisions[s]||null;t.diff.setBounds([i,t.revisions.last],!0)})}showAllFiles(){_.forEach(this.files,e=>{Vue.set(e,"visibilityLatched",!0),Vue.set(e,"nonTrivialLatch",!0)})}}}},!1,!0,{filename:"src/model/reviews/files/reviews.$reviewKey.files.diffs.js",modelPath:"/reviews/$reviewKey/files/diffs",modelExportName:"FilesDiffs"}),_reviewable.define(["FilesGroup"],["session"],function(e){"use strict";return{FilesGroup:class FilesGroup{constructor(){Vue.set(this,"files",this.$parent.$parent),Vue.set(this,"review",this.files.$parent),Vue.set(this,"collapsed",void 0),this.$observe(()=>this.review.stateReady&&this.numFiles&&(this.$info.userid?e.settings.$ready:null===this.$info.userid),t=>{t&&(this._default?Vue.set(this,"collapsed",!1):void 0===this.collapsed?this.numFiles>=200?Vue.set(this,"collapsed",!0):(Vue.set(this,"collapsed",_get(this,"review","state","settings","collapse","groups",this.name)),void 0===this.collapsed&&(Vue.set(this,"collapsed",_get(e,"settings","collapse","groups",this.name)),void 0===this.collapsed&&"⤥ Vendored"===this.name?Vue.set(this,"collapsed",!0):Vue.set(this,"collapsed",!1))):this.toggleCollapsed(this.collapsed))})}get _default(){return" "===this.name}get _groupFiles(){if(_get(this,"review","context","listFiles"))return _(this.files.showingList).filter(e=>this._default?!e.effectiveGroup:e.effectiveGroup===this.name).sortBy("dirNameForSorting").value()}get _diffRevKeys(){return _(this._groupFiles).map(e=>
1_get(e,"diff","bounds",1,"$key")).compact().value()}get _highestRevKey(){return _.maxBy(this._diffRevKeys,e=>_.parseInt(e.slice(1)))}get _allDiffsAtSameRev(){return!this._highestRevKey||_.every(this._groupFiles,e=>{let t=_get(e,"diff","bounds",1,"$key");return!t||(t!==this._highestRevKey&&_get(this,"review","revisions",t,"index")<_get(this,"review","revisions",this._highestRevKey,"index")&&_get(e,"revisions","nearest",this._highestRevKey,"$key")===t&&(t=this._highestRevKey),t===this._highestRevKey)})}get reviewLevel(){if(!this._allDiffsAtSameRev)return-1;let e=100;return _.forEach(this._groupFiles,t=>{if(t.reviewLevel<e&&(e=t.reviewLevel),e<0)return!1}),e}get reviewMarkStyle(){return this.review.userIsAuthor?!_.isEmpty(this._groupFiles)&&_.some(this._groupFiles,{reviewMarkStyle:"review"})?"review":"self-review":"review"}get reviewChip(){const e=_(this._groupFiles).map("reviewChip").compact().value(),t=_.some(e,e=>"preparing"===e.dominantIcon),s=_.every(e,"done"),i=_.every(e,"draftDone"),r=_.some(e,"done"),n=_.some(e,"youUnreviewed"),a=_.some(e,"anyone"),o=_.some(e,"anyoneUnreviewed"),l=_.some(e,"anyoneDraft"),c=_.some(e,"others"),u=_.some(e,"othersDraft");return{dominantIcon:t?"preparing":i?"green done":s?"done":n?"red you":o?"red anyone":u?"green others":c?"others":l?"green anyone":a?"anyone":"others",allDone:s,allDraftDone:i,someDone:r,youUnreviewed:n,anyone:a,anyoneUnreviewed:o,others:c,othersDraft:u}}get diffsDescription(){if(!_get(this,"review","context","listFiles"))return;if(!this._diffRevKeys||!this._groupFiles)return;if(!this._diffRevKeys.length)return`${this._groupFiles.length} undiffed file`+(1===this._groupFiles.length?"":"s");if(!this._allDiffsAtSameRev)return`${this._groupFiles.length} files at various revisions`;let e=`${this._diffRevKeys.length} file${1===this._diffRevKeys.length?"":"s"} at ${this._highestRevKey}`;const t=this._groupFiles.length-this._diffRevKeys.length;return t&&(e+=`, and ${t} undiffed file${1===t?"":"s"}`),e}get numFiles(){return _get(this,"_groupFiles","length")}get numCells(){return 4+_get(this,"review","revisions","list","length")}get rows(){if(!_get(this,"review","context","toggles","fileMatrix","shown")||!this.numCells||!_get(this,"review","files","joinedOnce"))return;const e=this._groupFiles;if(!e)return;if(!e.length)return[];const t=[],s=[""];let i=!1;return _.forEach(e,(r,n)=>{for(;!_.startsWith(r.path,_.last(s));)s.pop();let a=_.last(s);for(;r.path!==a+r.name;){const o=_access(r,"","path","","slice","call",[a.length]),l=_.dropRight(o.split("/"),1);l.reverse(),a=a+l.pop()+"/";const c=_.findLastIndex(e.slice(n),e=>_.startsWith(e.path,a)),u=e.slice(n,n+c+1);for(;l.length;){const e=a+l.pop()+"/";if(!_.every(u,t=>_.startsWith(t.path,e)))break;a=e}t.push({type:"directory",striped:i,indent:s.length-1,path:a.slice(_.last(s).length),pathPrefix:_.last(s),numCells:this.numCells,group:this,$key:`group-${this.name}-dir-${a}`}),i=!i,s.push(a)}t.push({type:"file",striped:i,indent:s.length-1,file:r,group:this,$key:`file${r.$key}`}),i=!i}),this._default||t.unshift({type:"spacer",$key:`group-spacer-${this.name}`},{type:"group",group:this,$key:`group-${this.name}`}),t}toggleCollapsed(t){Vue.set(e.onboarding,"collapsedFileGroup",!0),void 0===t&&(t=!this.collapsed),Vue.set(this,"collapsed",t),this.$info.userid&&_ref(this.$store,"child","users","current","state",this.review.$key,"settings","collapse","groups",this.name).set(t),_get(e,"settings","collapse","groups")||_.set(e.settings,"collapse.groups",{}),Vue.set(e.settings.collapse.groups,this.name,t)}toggleReviewed(t){this.reviewLevel<0||_access(this,"","review","","state","","isLocked","call",[])||(Vue.set(e.onboarding,"markedFileGroupReviewed",!0),void 0===t&&(t=this.reviewLevel<4),_.forEach(this._groupFiles,e=>{e.toggleReviewed(t)}))}}}},!1,!0,{filename:"src/model/reviews/files/reviews.$reviewKey.files.groups.$groupName.js",modelPath:"/reviews/$reviewKey/files/groups/$groupName",modelExportName:"FilesGroup"}),_reviewable.define(["FilesGroups"],[],function(){"use strict";return{FilesGroups:class FilesGroups{static get $trussMount(){return{path:"/reviews/$reviewKey/files/groups",hidden:!0,local:!0}}constructor(){Vue.set(this,"review",this.$parent.$parent),Vue.set(this,"files",this.$parent)}get _updateGroups(){if(!_get(this,"review","context","listFiles"))return;if(!_.every(this.files.showingList,e=>void 0!==e.effectiveGroup))return;const e=_(this.files.showingList).map(e=>({name:e.effectiveGroup||" ",nameForSorting:e.groupForSorting})).uniqBy("name").reduce((e,t)=>
1(Vue.set(e,t.name,t),e),{});this.$set(e)}get list(){return _.sortBy(this,"nameForSorting")}get matrixRows(){return _(this.list).flatMap("rows").compact().value()}}}},!1,!0,{filename:"src/model/reviews/files/reviews.$reviewKey.files.groups.js",modelPath:"/reviews/$reviewKey/files/groups",modelExportName:"FilesGroups"}),_reviewable.define(["Files"],["CollapseSettings","dom","session"],function(e,t,s){"use strict";let i,r;const n={};function a(e){return 1===e?"":"s"}return{Files:class Files{constructor(){Vue.set(this,"review",this.$parent),Vue.set(this,"joined",!1),Vue.set(this,"joinedOnce",!1),Vue.set(this,"_markReviewedMarksToUndo",void 0),this.$when(()=>_get(this,"review","context","diffFiles")).then(()=>{this.$destroyed||this.$observe(()=>this._joinedFileHistories,()=>this._syncJoinedFiles())}),this.$observe(()=>_get(this,"$store","users","current","state",this.$reviewKey,"settings","collapse","fileOnly"),e=>{_.forEach(this,e=>{_get(e,"diff","current")&&(e.diff.current.release("collapse setting"),Vue.set(e.diff,"current",void 0))})},{deep:!0,precise:e.FILE_DEFAULTS})}get _controlDiffLifecycle(){const e=!!_get(this,"review","context","diffFiles");if(!_.every(this,t=>!!t.diff===e))return this.$nextTick().then(()=>{const t={};_.forEach(this,s=>{!!s.diff!==e&&(e?Vue.set(t,_ref(s,"child","diff","active"),!0):Vue.set(t,_ref(s,"child","diff"),null))}),_.isEmpty(t)||this.$update(t)})}get byPath(){const e={};return _.forEach(this,t=>{Vue.set(e,t.path,t)}),e}get num(){const e=this.dashboardCacheStatus,t=_get(this,"review","state","dashboardCache"),s="uncertain"===e||"pending"===e,i=s?"neutrallyUnreviewedByDefault":"default"===e?"neutrallyUnreviewedWithoutDrafts":"neutrallyUnreviewed",r=this[`${i}Ready`],n=this.$ref.ready&&r&&this.toBeReviewedByUserReady&&void 0!==this.review.designatedReviewers.designations,o={reviewable:0,unreviewed:0,toReview:0,currentToReview:0,moreToReviewThanCurrent:!1,description:"",currentDescription:"",estimate:!1,presented:0};_.forEach(this,e=>{if(e.assimilated)return;!0!==e.trivial&&o.presented++,o.reviewable++;e[i]&&o.unreviewed++,e.toBeReviewedByUser&&(e.unreviewed&&o.toReview++,e.currentRevisionToBeReviewed&&o.currentToReview++,e.moreRevisionsToReviewLater&&Vue.set(o,"moreToReviewThanCurrent",!0))}),_get(this,"review","context","diffFiles")||"valid"===e||"pending"===e&&!n||this._estimatePotentialRenamePairs(o,i);const l=o.toReview;e&&("valid"===e&&t?(Vue.set(o,"unreviewed",t.numUnreviewedFiles),Vue.set(o,"toReview",t.numFilesToReview)):"uncertain"===e?Vue.set(o,"estimate",!0):"pending"===e&&(n?Vue.set(o,"estimate",!0):_.isNumber(_get(t,"numUnreviewedFiles"))&&_.isNumber(_get(t,"numFilesToReview"))?(Vue.set(o,"unreviewed",t.numUnreviewedFiles),Vue.set(o,"toReview",t.numFilesToReview),Vue.set(o,"estimate",!0)):(Vue.set(o,"unreviewed",void 0),Vue.set(o,"toReview",void 0)))),s&&(l||_get(t,"numFilesToReview"))&&Vue.set(o,"toReview",Math.max(l,_get(t,"numFilesToReview")||0));const c=this.review.userIsAuthor&&"review"!==this.reviewMarkStyle,u=!c&&this.review.userHasDeferred;Vue.set(o,"selfReviewAttention",c&&!!o.toReview&&!!o.unreviewed),Vue.set(o,"toReviewAttention",!c&&!!o.toReview),o.toReview&&!c?Vue.set(o,"description",`${o.toReview} file${a(o.toReview)} to review`+(u?" (deferred)":"")+"."):o.unreviewed?Vue.set(o,"description",`${o.unreviewed} unreviewed file${a(o.unreviewed)}.`):Vue.set(o,"description","All files reviewed at latest revision."),o.currentToReview&&!c?Vue.set(o,"currentDescription",`${o.currentToReview} file${a(o.currentToReview)} to review in current diffs`+(u?" (deferred)":"")+"."):o.unreviewed?Vue.set(o,"currentDescription",`${o.unreviewed} unreviewed file${a(o.unreviewed)} at latest revision.`):Vue.set(o,"currentDescription","All files reviewed at latest revision."),c&&(o.selfReviewAttention&&(o.description+=` ${o.toReview} file${a(o.toReview)} to self-review.`),Vue.set(o,"currentDescription",o.description)),o.estimate&&(o.description+=" (Best-effort count; visit review to refresh.)",o.currentDescription+=" (Best-effort count; visit review to refresh.)");const d=c?o.unreviewed:o.toReview||o.unreviewed;return o.estimate||o.selfReviewAttention?Vue.set(o,"leftEstimate",`${d||0}`):d&&Vue.set(o,"leftEstimate",`${d}`),o}get dashboardCacheStatus(){if(_get(this,"review","context","completeReview"))return null;const e=_get(this,"review","state"),t=e?e.dashboardCacheValidity:_get(this,"review","stateReady")?"missing":void 0;if(!t)return"pending";if("valid"===t)return"valid";if(!this.$ref.ready)return"pending";const s=_.toLower(_get(this,"review","core","ownerName"))||void 0,i=_.toLower(_get(this,"review","core","repoName"))||void 0,r=_ref(this.$store,"child","rules",s,i,"hasCompletionCondition");if(!_get(r,"ready"))return"pending";if(!r.value)return"default";const n=_get(this,"review","state","dashboardCache"),a=_get(this,"review","state","num","pendingSend")>0;let o;o="refresh"===t||"fullInput"===t||("teams"===t?this.$store.services.teamMemberships.currentUserTeamsUnavailable||_get(n,"personalReviewedFlagsDiffer")||_get(n,"personalDesignationsDiffer"):a);return(o?this.neutrallyUnreviewedByDefaultReady:this.neutrallyUnreviewedWithoutDraftsReady)&&this.toBeReviewedByUserReady&&void 0!==this.review.designatedReviewers.designations?o?"uncertain":"default":"pending"}get list(){return _(this).sortBy(e=>!e.system,e=>!!e.assimilated,"groupForSorting","dirNameForSorting","bareNameForSorting","extensionForSorting").index().value(
1)}get showingList(){return _.reject(this.list,"assimilated")}get displayItems(){if(!_get(this,"review","context","listFiles")||void 0===_get(this,"review","context","singleFile")||_get(this,"review","context","overflow","tooManyFiles")&&_get(this,"num","presented")!==_get(this,"review","context","overflow","numPresentedFiles")||!this.joinedOnce||!this.showingList)return;if(_get(this,"review","context","singleFile")){const e=this.review.context.onlyFile;return e?[{kind:"file",file:e,key:e.$key}]:void 0}const e=[];let t=[];for(let s=0;s<this.showingList.length;s++){const i=this.showingList[s];i.trivial?t.push(i):(t.length&&(e.push({kind:"trivialRun",files:t,key:t[0].$key}),t=[]),e.push({kind:"file",file:i,key:i.$key}))}return t.length&&e.push({kind:"trivialRun",files:t,key:t[0].$key}),e}get matrixRows(){return this.groups.matrixRows}get allLineStatsEmpty(){return _(this.matrixRows).map("file.diff.current").every(e=>_get(e,"lineStatsEmpty"))}get basemapsReady(){return _get(this,"review","verdict")&&!this.review.verdict.push||_.every(this,e=>e.revisions.basemapsReady)}get neededBasemapKeys(){return _(this).flatMap("revisions.list").filter(e=>!1===_get(e,"basemapReady")).map("basemapKey").compact().keyBy().value()}get toBeReviewedByUserReady(){return _.every(this,e=>void 0!==e.toBeReviewedByUser)}get neutrallyUnreviewedReady(){return _.every(this,e=>e.assimilated||void 0!==e.neutrallyUnreviewed)}get neutrallyUnreviewedWithoutDraftsReady(){return _.every(this,e=>e.assimilated||void 0!==e.neutrallyUnreviewedWithoutDrafts)}get neutrallyUnreviewedByDefaultReady(){return _.every(this,e=>e.assimilated||void 0!==e.neutrallyUnreviewedByDefault)}get anyRevisionsToBeReviewed(){if(this.joinedOnce&&_get(this,"review","context","listFiles"))return _.some(this.showingList,e=>e.latchedRevisionToBeReviewed)}get anyDiffsShowing(){if(this.joinedOnce&&_get(this,"review","context","listFiles"))return _.some(this.showingList,e=>!e.trivial)}get reviewMarkUserKeys(){return this.$ref.ready?_(this).map("reviewMarkUserKeys").compact().flatten().sortBy().sortedUniq().value(
1):"valid"!==_get(this,"review","state","dashboardCacheValidity")?[]:_access(this,"","review","","state","","dashboardCache","","reviewMarkUserKeys","","split","call",[","])||[]}get commitsFileUnreviewed(){return void 0!==_get(this,"-commits","unreviewed")?this["-commits"].unreviewed:"valid"===_get(this,"review","state","dashboardCacheValidity")?_get(this,"review","state","dashboardCache","commitsFileUnreviewed"):void 0}get reviewerKeys(){return _(this).map("reviewerKeys").compact().flatten().sortBy().sortedUniq().value()}get reviewMarkStyle(){return this.review.userIsAuthor?_get(this,"$ref","ready")||"valid"!==_get(this,"review","state","dashboardCacheValidity")?_(this).reject("assimilated").some({reviewMarkStyle:"review"})?"review":"self-review":_get(this,"review","state","dashboardCache","reviewMarkStyle")||"self-review":"review"}get _unreviewedChangesNotShown(){if(!_get(this,"review","context","diffFiles"))return;const e=_get(this,"diffs","_shape");let t=!1;return _.forEach(this.list,e=>{if(t=1===_get(e,"revisions",_get(e,"diff","bounds",1,"$key"),"reviewLevel"),t)return!1}),!t&&_get(e,"rightRevKey")&&"mixed"!==e.rightRevKey&&(t=_.some(_get(e,"filesWithNoRightRev"),t=>1===_get(t,"revisions",_get(t,"revisions","nearest",e.rightRevKey,"$key"),"reviewLevel"))),t}get markReviewedSpec(){const e=_get(this,"diffs","_shape");if(!e||!this.review.stateReady)return;const t=this.reviewMarkStyle,s=`${t}ed`,i={revKey:"mixed"===e.rightRevKey?null:e.rightRevKey,available:!1,reviewMarkStyle:t},r=_.every(this,e=>{const t=_get(e,"revisions",i.revKey);return!t||t.reviewLevel>=4||e.assimilated});return this.$info.userid?"mixed"===e.rightRevKey?Vue.set(i,"explanation",`You must be reviewing a single revision to mark all files as ${s} at once.`):r?Vue.set(i,"explanation",null):e.rightRevKey===e.leftRevKey?Vue.set(i,"explanation","No changes shown."):this._unreviewedChangesNotShown?Vue.set(i,"explanation",`Some changes before ${i.revKey} that you haven't ${s} are not shown in the current diff.`):(Vue.set(i,"available",!0),Vue.set(i,"explanation","Mark all changes"),e.rightRevKey!==this.review.core.lastRevisionKey&&(i.explanation+=` up to ${i.revKey}`),i.explanation+=` as ${s}`,i.explanation+="."):Vue.set(i,"explanation","You need to sign in to mark files as reviewed."),_.isEmpty(_get(this,"review","state","marks"))&&Vue.set(this,"_markReviewedMarksToUndo",null),Vue.set(i,"undoPossible",this.$info.userid&&this._markReviewedMarksToUndo),Vue.set(i,"undoAvailable",i.undoPossible&&!i.explanation),i}markAllReviewed(e){this.review.stateReady&&(_get(this,"markReviewedSpec","available")||e)&&(Vue.set(this,"_markReviewedMarksToUndo",[]),_(this).reject("assimilated").filter(t=>!e||t.toBeReviewedByUser).forEach(t=>t.toggleReviewed(!0,e,this._markReviewedMarksToUndo)),_.isEmpty(this._markReviewedMarksToUndo)&&Vue.set(this,"_markReviewedMarksToUndo",null),Vue.set(s.onboarding,"markedAllReviewed",!0))}undoMarkAllReviewed(){if(!_get(this,"markReviewedSpec","undoPossible"))return;Vue.set(s.onboarding,"undidMarkAsReviewed",!0);const e={};_.forEach(this._markReviewedMarksToUndo,t=>{Vue.set(e,t.draftReviewMarkRef,null)}),this.$store.$update(e),Vue.set(this,"_markReviewedMarksToUndo",null)}async markFilesReviewed(e,t){if(!_.isArray(e)||!e.length||_.some(e,e=>!_.isString(e)||!_.trim(e)))throw _.assign(new Error("File keys must be a nonempty array of strings."),{code:"invalid_file_keys",details:{fileKeys:e}});const i=_.uniq(e);if(!(_.isNil(t)||_.isString(t)&&_.trim(t)))throw _.assign(new Error("Review revision key must be a nonempty string."),{code:"invalid_review_revision",details:{revisionKey:t}});const r=_.isNil(t)?this.review.core.lastRevisionKey:t;if(!this.review.revisions[r])throw _.assign(new Error(`Review revision not found: ${r}`),{code:"review_revision_not_found",details:{revisionKey:r}});const n=_.reject(i,e=>{const t=this[e];return _get(t,"$parent")===this&&!t.assimilated});if(n.length)throw _.assign(new Error(`Files not found: ${n.join(", ")}`),{code:"files_not_found",details:{fileKeys:n}});const a=_.map(i,e=>this[e]),o=_.map(a,e=>e.buildReviewMarkUpdates(!0,r)),l=_(o).map((e,t)=>
1e?void 0:a[t].$key).compact().value();if(l.length)throw _.assign(new Error(`Files cannot be marked as reviewed at ${r}: `+l.join(", ")),{code:"file_revisions_mark_unavailable",details:{fileKeys:l,revisionKey:r}});const c=_.sumBy(a,e=>{const t=_get(e,"revisions","nearestUnkept",r,"original");return t&&(t.draftReviewMark||_get(t,"reviewers",this.$info.userid))?0:1}),u={};let d=!1;_.forEach(o,e=>{_.assign(u,e.updates),d=d||e.clearDeferral}),d&&this.review.state.clearAndCommitParticipantDeferralUpdates(),_.isEmpty(u)||(Vue.set(s.onboarding,"markedFileReviewed",!0),await this.$store.$update(u));const h=_.sumBy(this.showingList,e=>{const t=_get(e,"revisions","nearestUnkept",r,"original");return t&&(t.draftReviewMark||_get(t,"reviewers",this.$info.userid))?1:0});return{revision:{key:r,headCommitSha:this.review.revisions[r].commitSha},newMarkCount:c,totalMarkCount:h}}get parleysByFileKey(){if(this.joinedOnce&&_get(this,"review","context","showDiscussions"))return _(_get(this,"review","discussions","$values")).concat(_get(this,"review","state","drafts","$values")).filter("fileKey").groupBy(e=>_get(this,e.fileKey,"revisions",e.revisionKey,"inferred","file","$key")).value()}get _joinedFileHistories(){if(!_get(this,"review","context","diffFiles")||!this.$ready||!this.review.revisions.filemapsReady)return;const e={};return _.forEach(this.review.revisions.list,t=>{_.forEach(t.filemap,(s,i)=>{if(!this[i]||!this[s.key])return;if("added"!==_get(this,i,"revisions",t.$key,"action"))return;let r=e[s.key];r?Vue.delete(e,s.key):r=[{revisionKey:"r0",fileKey:s.key}],r.push({revisionKey:t.$key,fileKey:i,action:s.sha===t.filemap[s.key].sha?"kept":"modified"}),Vue.set(e,i,r)})}),_.mapKeys(e,e=>_.map(e,e=>e.revisionKey+e.fileKey).join("-"))}_syncJoinedFiles(){if(this.$destroyed)return;const e=[];this.$nextTick().then(()=>{if(!this.$destroyed){if(_.forEach(this,e=>{e.joined?_get(this,"_joinedFileHistories",e.$key)||e.$override(null):_.forEach(e.revisions,e=>{Vue.set(e,"inferred",e)})}),this._joinedFileHistories)return this.review.revisions.list?(Vue.set(this,"joined",Vue.set(this,"joinedOnce",!0)),_.forEach(this._joinedFileHistories,(t,s)=>{let i,r,n,a=1,o=t[0].fileKey,l=this[o],c=[];const u=this[_.last(t).fileKey],d={path:u.path,joined:!0,history:t,revisions:{}};u.group&&Vue.set(d,"group",u.group),_.forEach(this.review.revisions.list,s=>{let u;const h=t[a];if(s.$key===_get(h,"revisionKey")&&(o=h.fileKey,l=this[o],u=h.action,i=this[_get(s,"filemap",l.$key,"key")],r||(r=i),_.pull(c,l),c.push(i),a++),!l){const e=new Error("Missing source file when joining renamed files");throw Vue.set(e,"extra",{sourceFileKey:o,fileKeys:_.keys(this),rev:s.$key,entry:h}),e}if(r){const e=r.revisions[s.$key];e&&("added"===e.action?r=null:n=e)}let p=_get(i,"revisions",s.$key);p&&"added"!==p.action||(i=null,p=null);const v=l.revisions[s.$key];if(v&&!v.secondary){const t=_get(n,"baseFileSha")||v.baseFileSha,r=_get(n,"baseFileMode")||v.baseFileMode,a={originalFileKey:l.$key,action:u||v.action,type:v.type,fileSha:v.fileSha,baseFileSha:t,baseFileMode:r,fileMode:v.fileMode,baseFileShaIsInherited:t&&!!_get(n,"baseFileSha"),baseFileModeIsInherited:r&&!!_get(n,"baseFileMode"),reviewed:v.reviewed,reviewers:v.reviewers};_get(n,"baseFileSha")&&e.push(_ref(v,"child","baseFileSha").override(n.baseFileSha),_ref(v,"child","baseFileShaIsInherited").override(!0)),_get(n,"baseFileMode")&&e.push(_ref(v,"child","baseFileMode").override(n.baseFileMode),_ref(v,"child","baseFileModeIsInherited").override(!0)),p&&(Vue.set(a,"otherOriginalFileKey",i.$key),Vue.set(a,"otherOriginalRevKey",s.$key)),Vue.set(d.revisions,s.$key,_.pickBy(a,e=>void 0!==e))}c=_.filter(c,e=>{const t=e.revisions[s.$key];return(t===p||"kept"===_get(t,"action"))&&(Vue.set(t,"secondary",!0),!0)})}
1),_ref(this,"child",s).override(d),_ref(this,"child",s,"diff").set({active:!!_get(this,"review","context","diffFiles")}),_.forEach(this[s].revisions,e=>{Vue.set(this[e.originalFileKey].revisions[e.$key],"inferred",e)})}),Promise.all(e)):this._syncJoinedFiles();Vue.set(this,"joined",!1)}})}_estimatePotentialRenamePairs(e,t){if(e.unreviewed<=1&&e.toReview<=1)return;let s=[];if(_.forEach(this,e=>{const i=e[t];!1===(void 0===i?void 0:!i)&&_.forEach(e.revisions,t=>{"added"===t.action?s.push({file:e,revKey:t.$key,action:!0,byUser:e.toBeReviewedByUser}):"removed"===t.action&&s.push({file:e,revKey:t.$key,action:!1,byUser:e.toBeReviewedByUser})})}),s.length<=1)return;let i=0,r=0;function n(e){let t=[];for(;s.length>0;){const n=s.shift(),a=_.find(s,t=>t.file!==n.file&&t.revKey===n.revKey&&t.action!==n.action&&(!e||n.byUser===t.byUser));a?(i++,(n.byUser||a.byUser)&&r++,s=_.reject(s,e=>e.file===n.file||e.file===a.file),t=_.reject(t,e=>e.file===n.file||e.file===a.file)):t.push(n)}s=t}e.toReview>1&&n(!0),n(!1),i&&(e.unreviewed>1&&Vue.set(e,"unreviewed",Math.max(1,e.unreviewed-i)),e.toReview>1&&Vue.set(e,"toReview",Math.max(1,e.toReview-r)),Vue.set(e,"estimate",!0))}get _segmentFiles(){if(_get(this,"review","context","listFiles")&&_get(this,"review","context","showUI"))try{_(this.list).reject("assimilated").groupBy("lowercaseName").forEach(e=>{const t=this._splitSegments(e);this._distinguishSegments(t,0),_.forEach(t,e=>{this._assignSegmentedPath(e)})})}finally{i&&i.remove(),i=null,r=null}}_splitSegments(e){return _.map(e,e=>{const t=_.map(_access(e,"","path","","split","call",["/"]),(t,s,i)=>({file:e,part:t,elided:s!==i.length-1}));return t.length>1&&_.assign(t[t.length-2],{elided:!1,secondary:!0}),t})}_distinguishSegments(e,t){if(!(_.size(e)<=1))for(;;){const s=_.groupBy(e,e=>_get(e,t,"part"));if(1!==_.size(s)||!_.some(e,e=>t+1<e.length)){_.forEach(e,e=>{e[t]&&(Vue.set(e[t],"elided",!1),Vue.set(e[t],"secondary",!1))}),_.size(s)>1&&_.forEach(s,e=>{this._distinguishSegments(e,t)});break}t++}}_assignSegmentedPath(e){Vue.set(e[0].file,"segmentedPath",_(e).transform((e,t)=>{const s=_.last(e);s&&s.elided&&t.elided?s.part+="/"+t.part:e.push(t)}).map(e=>{const s=_.escape(e.part);if(e.elided){let e=`<span class="secondary elided segment">${s}</span>`;return e=`<span style="width:${function(e){let s=n[e];if(!s){i||(i=document.createElement("table"),Vue.set(i,"className","ui celled collapsing unstackable single files table"),Vue.set(i,"innerHTML",'<tbody><tr><td class="filename cell"><span class="path"></span></td></tr></tbody>'),document.body.appendChild(i),r=i.querySelector(".path"));const a=document.createElement("template");Vue.set(a,"innerHTML",e);const o=a.content.firstElementChild;r.appendChild(o),Vue.set(n,e,s=o.getBoundingClientRect().width),t.clearChildren(r)}return s}(e)}px" `+e.slice(6),`<span class="secondary segment elision">â¦</span>${e}`}return e.secondary?`<span class="secondary segment">${_.escape(e.part)}</span>`:`<span class="segment">${_.escape(e.part)}</span>`}).join('<span class="secondary segment separator">/</span>'))}}}},!1,!0,{filename:"src/model/reviews/files/reviews.$reviewKey.files.js",modelPath:"/reviews/$reviewKey/files",modelExportName:"Files"}),_reviewable.define(["Filemap"],["config","corpsman"],function(e,t){"use strict";return{Filemap:class Filemap{get review(){return _get(this,"$store","reviews",this.$reviewKey)}get valid(){if(_get(this,"review","files")&&this.$parent.possibleFilemapKeys&&!_get(this,"review","core","error"))return _.includes(this.$parent.possibleFilemapKeys,this.$filemapKey)&&_.every(this,(e,t)=>_.includes(["done","local","writeFailed"],t)||this.review.files[e.key])}get _deleteInvalidFilemap(){if(!1===this.valid&&_get(this,"review","verdict","push")){const s=_(this).omit("done","local","writeFailed").pickBy(e=>_.isObject(e)).mapValues(e=>_.pick(e,"key","sha")).value(),i=_(s).pickBy(e=>_get(e,"key")&&!_get(this,"review","files",e.key)).mapValues(e=>e.key).value();this.$store.services.breadcrumbSampler.addSampledBreadcrumb("reconciliation-burst",this.$reviewKey,"invalid filemap deleted",_.assign({filemapKey:this.$filemapKey,reason:"invalid_deleted",valid:this.valid,possibleFilemapKeys:this.$parent.possibleFilemapKeys,filemapSnapsh
1ot:_.toPlainObject(this),entries:s,missingReferents:i},_.pick(this,["done","local","writeFailed"]))),this.$set(null).catch(s=>{_get(this,"review","verdict","push")?Sentry.captureException(s):(t.markHandled(s),e.prod||console.error("Silenced error:",s))})}}}}},!1,!0,{filename:"src/model/reviews/maps/filemaps.$reviewKey.$filemapKey.js",modelPath:"/filemaps/$reviewKey/$filemapKey",modelExportName:"Filemap"}),_reviewable.define(["FilemapsGroup"],[],function(){"use strict";return{FilemapsGroup:class FilemapsGroup{get review(){return _get(this,"$store","reviews",this.$reviewKey)}get possibleFilemapKeys(){const e=_.map(_get(this,"review","revisions"),"filemapKey");if(e.length&&_.every(e))return e}}}},!1,!0,{filename:"src/model/reviews/maps/filemaps.$reviewKey.js",modelPath:"/filemaps/$reviewKey",modelExportName:"FilemapsGroup"}),_reviewable.define(["Labels"],["config"],function(e){"use strict";return{Labels:class Labels{static get $trussMount(){return{path:"/reviews/$reviewKey/labels",keysUnsafe:!0}}constructor(){Vue.set(this,"review",this.$parent)}get list(){const t=this.$store.services.completions.labels.get(_get(this,"review","core","ownerName"),_get(this,"review","core","repoName"));return _(this.$data).keys().map(e=>_get(t,e)||{name:e,type:"label",searchTerm:_.toLower(e),matchIndex:void 0,completionTerm:void 0,displayName:e}).compact().map(t=>(Vue.set(t,"link",`${e.gitHubUrl}/${this.review.core.ownerName}/${this.review.core.repoName}/labels/${t.name}`),t)).sortBy("searchTerm").value()}get commentsOnlyInReviewable(){return _.some(this.$data,(e,t)=>"comments only in reviewable"===_.toLower(t))}}}},!1,!0,{filename:"src/model/reviews/metadata/reviews.$reviewKey.labels.js",modelPath:"/reviews/$reviewKey/labels",modelExportName:"Labels"}),_reviewable.define(["ReviewMetaFiles"],[],function(){"use strict";return{ReviewMetaFiles:class ReviewMetaFiles{get byRevisionKey(){const e={};return _(this).flatMap(e=>_.keys(e.revisions)).forEach(t=>{Vue.set(e,t,_(this).map(e=>{const s=e.revisions[t]||e.revisions.other;if(s)return{path:e.path,sha:s}}).compact().keyBy("sha").value())}),e}}}},!1,!0,{filename:"src/model/reviews/metadata/reviews.$reviewKey.metaFiles.js",modelPath:"/reviews/$reviewKey/metaFiles",modelExportName:"ReviewMetaFiles"}),_reviewable.define(["SANCTION_ICONS","Person"],["config","shared"],function(e,t){"use strict";const s={approved:"sanction approved",changes_requested:"sanction blocked",dismissed:"sanction dismissed"};return{SANCTION_ICONS:s,Person:class Person{constructor(){Vue.set(this,"review",this.$parent.$parent),this.$store.services.avatars.connectUser(this.$userKey)}get involvedList(){if(!_get(this,"review","tracker","$ready"))return;const e=_(this.review.tracker).map("participants").flatMap(_.values).filter({$key:this.$userKey}).value();return[..._(e).filter({$discussionKey:"-top"}).filter("lastPostTimestamp").value(),..._.reject(e,{$discussionKey:"-top"})]}get discussions(){if(this.involvedList)return _.map(this.involvedList,e=>({disposition:e.effectiveDisposition,dispositionIsDraft:e.effectiveDisposition!==e.disposition}))}get dispositions(){return _.map(this.discussions,"disposition")}get dispositionBlocking(){return this.discussions?_.some(this.discussions,e=>"blocking"===e.disposition||"working"===e.disposition):"valid"===_get(this,"review","state","dashboardTrackerCacheValidity")?!!this.discussionBlocking:void 0}get _user(){return this.$store.services.avatars.users[this.$userKey]}get mentionee(){if(this.author||!this.localMentionee&&!this.currentLocalMentionee)return!1;if(this.discussionStarter)return!1;if(void 0!==this.$info.userid){if(this.$userKey===this.$info.userid){if(!_get(this,"review","stateReady"))return;if(_.some(_get(this,"review","state","drafts"),e=>!_get(this,"review","discussions",e.$draftKey)))return!1}return!0}}get reviewer(){if(this.author)return!1;if(this.marker||this.requestedReviewer)return!0;if(void 0!==this.$info.userid){if(this.$userKey===this.$info.userid){if(!_get(this,"review","stateReady"))return;if(!_.isEmpty(_get(this,"review","state","marks")))return!0}if(void 0!==this.mentionee)return!this.mentionee}}
1get activeReviewer(){if(void 0!==this.reviewer){if(!this.reviewer)return!1;if(this.marker||this.activeInDiscussion)return!0;if(void 0!==this.$info.userid){if(this.$userKey===this.$info.userid){if(!_get(this,"review","stateReady"))return;if(!_.isEmpty(_get(this,"review","state","drafts")))return!0;if(!_.isEmpty(_get(this,"review","state","marks")))return!0}return!1}}}get draftActiveReviewer(){if(void 0===this.reviewer||void 0===this.activeReviewer)return;if(this.$userKey!==this.$info.userid)return!1;const e=(this.localMentionee||this.currentLocalMentionee)&&!this.discussionStarter;return this.activeReviewer&&!this.marker&&(!this.activeInDiscussion||this.author||e)}get activeOrRequestedReviewer(){return this.activeReviewer||this.requestedReviewer}get collaborator(){const e=_get(this,"review","context","repository","private");if(void 0===e)return;const t=this.$store.services.completions.people,s=this.review.core.ownerName,i=this.review.core.repoName;if(this.repositoryForbidden)return!1;if(!e)return!0;const r=this.agentOwnerKey||this.$key,n=t.getCollaboratorsIndex(s,i),a=this.$store.services.completions.assignees.getIndex(s,i);return n&&a?_.isEmpty(n)||!!n[r]||!!a[r]:void 0}get completion(){const e=this._user;if(!e)return;const t=/^ghagent:/.test(this.$userKey),s=this.$store.services.colors.computeAgentTagColors(t&&_get(e,"tag","color"));return{type:"person",nodeId:e.nodeId,key:e.username,label:e.username,userKey:this.$userKey,username:_.toLower(e.username),description:e.displayName,avatarUrl:e.scaledAvatarUrl,searchTerm:_.toLower(e.username+(e.displayName?" "+e.displayName:"")),matchIndex:void 0,completionTerm:void 0,modifier:void 0,...t&&{agent:t,tagName:_get(e,"tag","name"),tagColors:s}}}get name(){return _get(this,"_user","name")}get displayName(){return _get(this,"_user","displayName")}get scaledAvatarUrl(){return _get(this,"_user","scaledAvatarUrl")}get username(){return _get(this,"_user","username")}get nodeId(){return _get(this,"_user","nodeId")}get link(){if(this.username&&!/\+/.test(this.username))return`${e.gitHubUrl}/${this.username}`}get agentOwnerKey(){return this.$store.services.completions.people.parseAgentOwnerKey(this.$userKey)}get avatarClass(){return this.$userKey.replace(":","-")}get lastUpdateTimeAgo(){return this.$store.services.computeTimeAgo(this.lastUpdateTimestamp)}get lastUpdateTimeAgoShort(){return this.$store.services.computeTimeAgo(this.lastUpdateTimestamp,{short:!0})}get lastUpdateLocalTime(){return this.$store.services.formatLocalTime(this.lastUpdateTimestamp)}get dashboardIcon(){return this.author?"author":this.sanction&&"commented"!==this.sanction?s[this.sanction]:void 0!==this.dispositionBlocking?this.dispositionBlocking?"disposition blocking":this.lgtm?"lgtm":null:void 0}get sanctionIcon(){return s[this.sanction]}get dashboardTooltip(){return`${this.blocker?"Waiting on":this.author?"Created by":"Being reviewed by"} ${this.name}.`}get lgtm(){if(void 0!==this.forcedLgtm)return!!this.forcedLgtm&&"lgtm";const e=_get(this,"review","revisions",_get(this,"review","core","lastRevisionKey")),t=_get(e,"captureTimestamp")||_get(e,"commitTimestamp");for(const e of _.values(this.emojis).reverse()){if("lgtm_cancel"===e.label)return!1;if("lgtm_strong"===e.label)return"lgtm_strong";if("lgtm"===e.label)return e.timestamp>=t&&"lgtm"}}get dismissable(){return _.some(this.involvedList,e=>e.dismissable&&!_get(e,"tracker","resolved"))}get dismissal(){return _access(_,"","find","call",[this.involvedList,"dismissal"],"","dismissal")}get contributor(){return this.commitAuthor||this.committer}get role(){let e;return e=this.author?"author":this.requestedReviewer&&this.activeReviewer?"requested reviewer (active)":this.activeReviewer?"reviewer":this.requestedReviewer?"requested reviewer (not yet active)":this.mentionee?"mentionee":"lurker",this.assignee&&(e+="Â & assignee"),e}get discussing(){if(!this.discussions&&"valid"!==_get(this,"review","state","dashboardTrackerCacheValidity"))return;return(this.discussions?this.discussions.length:!!this.inDiscussion)&&!this.dispositionBlocking&&"approved"!==this.sanction&&!this.lgtm}get status(){const e=[];return"dismissed"===this.sanction&&e.push("dismissed"),this.discussing&&e.push("discussing"),(this.dispositionBlocking||"changes_requested"===this.sanction)&&e.push("blocking"),(this.lgtm||"approved"===this.sanction)&&e.push("approved"),e.length||e.push("no status"),e.join(", ").replace(/(.*),/gm,"$1Â &")}get bot(){if(this._user)return/(\[bot\]|-bot)$/i.test(this.username)||/\(bot\)$/i.test(this.displayName||"")||t.botUsernameRegex.test(this.username)}get passiveBot(){if(void 0!==this.bot)return this.bot&&!this.contributor&&_(this.dispositions).without("following").isEmpty()&&(this.discussing||"no status"===this.status)}get slackUser(){const e=_get(this,"review","core","ownerName");return this.$store.services.completions.people.getSlackUser(e,this.$userKey)}dismiss(){_access(this,"","review","","state","","isLocked","call",[])||this.involvedList[0].dismiss(!0)}undismiss(){_access(this,"","review","","state","","isLocked","call",[])||this.dismissal&&this.involvedList[0].undismiss(!0)}}}},!1,!0,{filename:"src/model/reviews/metadata/reviews.$reviewKey.people.$userKey.js",modelPath:"/reviews/$reviewKey/people/$userKey",modelExportName:"Person"}),_reviewable.define(["People"],["config","shared"],function(e,t){"use strict";const s="https://github.com"===e.gitHubUrl?"github:19864447":null;return{People:class People{static get $trussMount(){return{path:"/reviews/$reviewKey/people",local:!0}}constructor(){Vue.set(this,"review",this.$parent),this.$observe(()=>_get(this,"review","verdict","pull")&&_get(this,this.$info.userid,"currentLocalMentionee")&&!_get(this,this.$info.userid,"localMentionee"),e=>{e&&_ref(this,"child","review","participants",this.$info.userid,"localMentionee").set(!0)})}get _updateChildren(){if(!_ref(this,"child","review","participants").ready)return;const e=_get(this,"review","statuses",this.review.core.lastRevisionKey,"services",t.reviewableStatusContext),i=[this.review.participants,this.review.userIsAuthor?{[this.$info.userid]:{author:!0}}:{},_(this.review.discussions).map("comments").flatMap(_.values).reject({provenance:"synthetic"}).keyBy("authorKey").mapValues(_.constant({commenter:!0}
1)).value(),_get(this,"review","tracker","dashboardPeople")||{},_(this.review.files.reviewMarkUserKeys).keyBy().mapValues(_.constant({marker:!0})).value(),_.mapValues(this.review.sentiments.emojisByUserKey,e=>({emojis:e})),_(_get(e,"lgtms")).split(",").compact().keyBy().mapValues(_.constant({forcedLgtm:!0})).value(),_(this.review.revisions).flatMap("commits").flatMap(_.values).filter("authorKey").keyBy("authorKey").mapValues(_.constant({commitAuthor:!0})).value(),_(this.review.revisions).flatMap("commits").flatMap(_.values).filter("committerKey").reject({committerKey:s}).keyBy("committerKey").mapValues(_.constant({committer:!0})).value()],r={};_.forEach(i,e=>{_.forEach(e,(e,t)=>{Vue.set(r,t,r[t]||{}),_.assign(r[t],e)})});const n=_get(this,"review","core","authorKey");n&&_.forEach(r,(e,t)=>{_get(this,"$store","services","avatars","users",t,"authorFor")===n&&Vue.set(e,"author",!0)}),void 0!==_get(e,"lgtms")&&_.forEach(r,e=>{Vue.set(e,"forcedLgtm",e.forcedLgtm||!1)}),_(r).map((e,t)=>({userKey:t,username:_get(this,"$store","services","avatars","users",t,"username")})).filter("username").groupBy("username").filter(e=>e.length>1).map(e=>_.map(e,"userKey")).forEach(e=>{const t={};_.forEach(e,e=>{_.assign(t,r[e])}),_.forEach(e,(e,s)=>{Vue.set(r,e,{...t,duplicate:s>0})})}),this.$set(r)}get list(){return _.sortBy(this,"$key")}get completions(){return _(this).map("completion").compact().sortBy("username").value()}get usernameIndex(){return _(this).map("completion").compact().keyBy("username").value()}}}},!1,!0,{filename:"src/model/reviews/metadata/reviews.$reviewKey.people.js",modelPath:"/reviews/$reviewKey/people",modelExportName:"People"}),_reviewable.define(["Sentiments"],[],function(){"use strict";return{Sentiments:class Sentiments{get emojisByUserKey(){let e=0;const t=this.$store.services.completions.emojis.map;return _.mapValues(this,s=>_(s.comments).sortBy("timestamp").flatMap(s=>{const i=[],r=_.toLower(s.emojis);for(const n of r.split(" "))n in t&&i.push({url:t[n],label:n,index:++e,timestamp:s.timestamp});return i}).value())}}}},!1,!0,{filename:"src/model/reviews/metadata/reviews.$reviewKey.sentiments.js",modelPath:"/reviews/$reviewKey/sentiments",modelExportName:"Sentiments"}),_reviewable.define(["Status"],[],function(){"use strict";return{Status:class Status{get aggregateState(){return"help"===this.combinedState?_get(this,"summaries","combinedState"):this.combinedState}get aggregateFailureRequired(){return _.includes(["error","failure"],this.aggregateState)?"help"!==this.combinedState||Boolean(_get(this,"summaries","hasRequiredFailure")):null}}}},!1,!0,{filename:"src/model/reviews/metadata/reviews.$reviewKey.statuses.$revisionKey.js",modelPath:"/reviews/$reviewKey/statuses/$revisionKey",modelExportName:"Status"}),_reviewable.define(["Service"],["corpsman","mangler","shared","session"],function(e,t,s,i){"use strict";const r=[s.mergeableStatusKey,"default",s.reviewableStatusContext,s.approvalStatusKey];return{Service:class Service{constructor(){Vue.set(this,"review",this.$parent.$parent.$parent.$parent),Vue.set(this,"index",void 0),Vue.set(this,"codeownersLines",void 0),Vue.set(this,"error",void 0),this.$observe(()=>_get(this,"review","context","completeReview")?this.codeownersFileSha:null,t=>{t&&(Vue.set(this,"codeownersLines",void 0),i.hubkit(this.review.core.ownerName,this.review.core.repoName).request("GET /repos/:owner/:repo/git/blobs/:fileSha",{fileSha:t,immutable:!0,media:"raw"}).then(e=>{this.codeownersFileSha===t&&(Vue.set(this,"codeownersLines",_.split(e,/\r\n|\r|\n/)),Vue.set(this,"error",void 0))},t=>{e.markHandled(t),Vue.set(this,"error","Error loading CODEOWNERS file: "+t.message)}))},{precise:!0})}get specialType(){switch(this.context){case s.reviewableStatusContext:return"reviewable";case s.mergeableStatusKey:return"mergeable";case s.approvalStatusKey:return"approval"}}get fullName(){if(this.uniqueName)return this.uniqueName;let e=this.context;return this.workflow&&this.$parent.workflowQualifiers[this.workflow]&&(e=`${this.workflow} / ${e}`),this.app&&this.$parent.appQualifiers[this.app]&&(e=`${this.app} / ${e}`),this.$parent.duplicateNames[e]&&(e+=` (${this.index})`),e}get fullDescription(){let e=this.description||this.state;if(this.context&&!_.includes(r,this.context)){const t=_.indexOf(_.toLower(e),_.toLower(this.context));(-1===t||t>5)&&(e=`${this.fullName} â ${e}`)}return e}get structuredDescription(){if(!this.descriptionIsMarkdown||!this.description)return null;const e=_.indexOf(this.description,"\n");return{intro:this.description.slice(0,e),html:t.renderMarkdown(this.description.slice(e+1))}}get timestampTimeAgo(){return this.$store.services.computeTimeAgo(this.timestamp)}get timestampLocalTime(){return this.$store.services.formatLocalTime(this.timestamp)}get needsPreFormat(){return this.context===s.reviewableStatusContext&&_.startsWith(this.description,"Review check error:")}get sortKey(){switch(this.$key){case s.reviewableStatusContext:return" 1";case s.mergeableStatusKey:return" 2";case s.approvalStatusKey:return" 3";default:return this.$key}}get neededCodeownersRows(){if(!this.codeownersLines)return;let e=-1;return _(this.codeownersNeededIndexes).split(",").map(_.parseInt).sortBy().sortedUniq().flatMap(t=>{let s=this.codeownersLines[t];if(!s)return;const[i,...r]=_.split(s,/\s+/),n=_(r).map(e=>{_.startsWith(e,"@")&&(e=e.slice(1));return`${_.includes(e,"@")?"email":_.includes(e,"/")?"team":"user"}:${e}`}
1).uniq().value();let a=t,o="";for(;--a>e&&(s=this.codeownersLines[a],!/^\s*$/.test(s));)_.startsWith(this.codeownersLines[a],"#")&&(o=s.replace(/^#\s*/,"")+" "+o);return e=t,[o?{comment:o,index:t}:null,{pattern:i,entityKeys:n,index:t}]}).compact().value()}}}},!1,!0,{filename:"src/model/reviews/metadata/reviews.$reviewKey.statuses.$revisionKey.services.$contextKey.js",modelPath:"/reviews/$reviewKey/statuses/$revisionKey/services/$contextKey",modelExportName:"Service"}),_reviewable.define(["StatusServices"],[],function(){"use strict";return{StatusServices:class StatusServices{get duplicateNames(){return _(this).flatMap(e=>{const{context:t,workflow:s,app:i}=e;return[t,s&&`${s} / ${t}`,i&&(s?`${i} / ${s} / ${t}`:`${i} / ${t}`)]}).compact().push("<empty>","<unknown>").groupBy().pickBy(e=>e.length>1).mapValues(_.constant(!0)).value()}get workflowQualifiers(){const e=_(this).map("workflow").compact().uniq().value(),t=_.groupBy(this,"workflow");return _(e).filter(s=>_.some(t[s],e=>this.duplicateNames[e.context])||e.length>1&&!_.every(t[s],e=>_.startsWith(e.context,s))).keyBy().mapValues(_.constant(!0)).value()}get appQualifiers(){const e=_.groupBy(this,"app");return _(this).map("app").compact().uniq().filter(t=>_.some(e[t],e=>{const{context:t,workflow:s}=e;return this.duplicateNames[s?`${s} / ${t}`:t]})).keyBy().mapValues(_.constant(!0)).value()}get list(){return _(this).sortBy("context","workflow","app").index().value()}}}},!1,!0,{filename:"src/model/reviews/metadata/reviews.$reviewKey.statuses.$revisionKey.services.js",modelPath:"/reviews/$reviewKey/statuses/$revisionKey/services",modelExportName:"StatusServices"}),_reviewable.define(["StatusSummaries"],[],function(){"use strict";return{StatusSummaries:class StatusSummaries{get combinedState(){return _(this).pickBy((e,t)=>!("sNyQ9ooO2v"===t&&"pending"===e.state)).map("state").compact().sortBy(e=>"inprogress"===e?"review-in-progress":e).head()||null}get hasRequiredFailure(){return _.some(this,e=>e.req&&_.includes(["error","failure"],e.state))}}}},!1,!0,{filename:"src/model/reviews/metadata/reviews.$reviewKey.statuses.$revisionKey.summaries.js",modelPath:"/reviews/$reviewKey/statuses/$revisionKey/summaries",modelExportName:"StatusSummaries"}),_reviewable.define(["Statuses"],[],function(){"use strict";return{Statuses:class Statuses{get latest(){return _.sortBy(_get(this,this.$parent.core.lastRevisionKey,"services"),"state","sortKey")}get grouped(){return _.groupBy(this.latest,e=>"success"===e.state?"successful":e.required?"required":"optional")}}}},!1,!0,{filename:"src/model/reviews/metadata/reviews.$reviewKey.statuses.js",modelPath:"/reviews/$reviewKey/statuses",modelExportName:"Statuses"}),_reviewable.define(["AssigneesService"],[],function(){"use strict";return{AssigneesService:class AssigneesService{constructor(){Vue.set(this,"_assignees",{}),Vue.set(this,"_usersIndex",{}),this.$observe(()=>this.$info.userid,e=>{Vue.set(this,"_assignees",{})})}connect(e,t){this.$parent._connectCache(_ref(this.$store,"child","repositories",_.toLower(e),_.toLower(t),"cache","assignees"),1,e=>_(e).map(e=>this.$parent._convertUserToPerson(e)).sortBy("username").value(),s=>{const i=_.keyBy(s,"userKey");Vue.set(this._assignees,this._makeKey(e,t),{list:s,index:i}),_.assign(this._usersIndex,i),_.assign(this._usersIndex,_.keyBy(s,e=>`user:${e.username}`))})}get(e,t){return _get(this,"_assignees",this._makeKey(e,t),"list")}getIndex(e,t){return _get(this,"_assignees",this._makeKey(e,t),"index")}getUser(e){return this._usersIndex[_.toLower(e)]}_makeKey(e,t){return`${_.toLower(e)}|${_.toLower(t)}`}}}},!1,!0,{filename:"src/model/services/completions/services.completions.assignees.js",modelPath:"/services/completions/assignees",modelExportName:"AssigneesService"}),_reviewable.define(["EmojisService"],["config"],function(e){"use strict";return{EmojisService:class EmojisService{constructor(){Vue.set(this,"map",{...githubEmojis.urls,"+1":"https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png?v8",lgtm:`${e.hostUrl}/lgtm.png`,lgtm_strong:`${e.hostUrl}/lgtm_strong.png`,lgtm_cancel:`${e.hostUrl}/lgtm_cancel.png`}),Vue.set(this,"emojisToNames",_(githubEmojis.emojis).pickBy(e=>
1!_.startsWith(e,"http")).invert().value()),Vue.set(this,"emojisRegex",new RegExp(`${_(this.emojisToNames).keys().map(_.escapeRegExp).join("|")}`,"gu"))}get list(){return _.map(this.map,(e,t)=>({type:"emoji",label:t,searchTerm:t,imageUrl:e,matchIndex:void 0,completionTerm:t}))}replaceEmojiShortcodesWithUnicode(e){return e.replace(/:(\w+):/,(e,t)=>githubEmojis.emojis[t]||e)}normalizeEmojiName(e){return e.replace(/\\([_+-])/g,"$1")}}}},!1,!0,{filename:"src/model/services/completions/services.completions.emojis.js",modelPath:"/services/completions/emojis",modelExportName:"EmojisService"}),_reviewable.define(["IssuesService"],["RepositoryIssues"],function(e){"use strict";return{IssuesService:class IssuesService{constructor(){Vue.set(this,"_issues",{})}fetch(t,s,i){if(!this.$info.userid)return;t=_.toLower(t),s=_.toLower(s);const r=this._initIssuesEntry(t,s);if(i?r._fullListConnector:r._initialListConnector)return;const n=_ref(this.$store,"child","repositories",t,s,"issues","index");i||r._initialListConnector?i&&!r._fullListConnector&&(Vue.set(r,"_fullListConnector",this.$connect(n)),r._initialListConnector&&(r._initialListConnector.destroy(),Vue.delete(r,"_initialListConnector")),_.forEach(r._individualConnectors,e=>{e.destroy()}),r._individualConnectors.clear()):Vue.set(r,"_initialListConnector",this.$connect(n.query({by:"$key",to:"A",last:e.MAX_INITIAL_ISSUES})))}fetchOne(e,t,s){if(!this.$info.userid)return;e=_.toLower(e),t=_.toLower(t),s=_.parseInt(s);const i=this._initIssuesEntry(e,t);if(i._fullListConnector||i._individualConnectors.has(s))return;const r=_ref(this.$store,"child","repositories",e,t,"issues","index");i._individualConnectors.set(s,this.$connect(_ref(r,"child",s)))}get(e,t){return this._issues[`${_.toLower(e)}|${_.toLower(t)}`]}_initIssuesEntry(e,t){const s=`${e}|${t}`;let i=this._issues[s];if(!i){const r=this.$store;i=Vue.set(this._issues,s,{get list(){return _get(r,"repositories","$data",e,"$data",t,"issues","list")||[]},get meta(){return _get(r,"repositories","$data",e,"$data",t,"issues","meta")||{}},get index(){return _get(r,"repositories","$data",e,"$data",t,"issues","index")||{}},_individualConnectors:new Map}),this.$connect(_access(_ref,"call",[this.$store,"child","repositories",e,t,"issues","lastSyncTimestamp"]))}return i}}}},!1,!0,{filename:"src/model/services/completions/services.completions.issues.js",modelPath:"/services/completions/issues",modelExportName:"IssuesService"}),_reviewable.define(["Completions"],["corpsman"],function(e){"use strict";const t=/UnknownError|DataError|QuotaExceededError|invalid security context|not allow mutations/;async function s(s,i="_connectCache"){if(s)try{return await s}catch(s){if(!s||!t.test(s.toString()))throw s;e.capture(s,i)}}let i;try{i=idbKeyval.createStore("reviewable","completions-cache")}catch(t){e.capture(t,"create completions-cache store")}return{Completions:class Completions{constructor(){Vue.set(this,"_connectedPaths",new Set),Vue.set(this,"_unobserves",[]),Vue.set(this,"_connectors",[]),Vue.set(this,"_serverHashes",{}),Vue.set(this,"_serverCaches",{}),this.$observe(()=>this.$info.userid,(e,t)=>{t&&null===e&&(this._connectedPaths.clear(),i&&s(idbKeyval.clear(i),"clear completions cache").catch(e=>{Sentry.captureException(e,{extra:{context:"clear completions cache"}})}),_.forEach(this._unobserves,e=>{e()}),Vue.set(this,"_unobserves",[]),_.forEach(this._connectors,e=>{e.destroy()}),Vue.set(this,"_connectors",[]),Vue.set(this,"_serverHashes",{}),Vue.set(this,"_serverCaches",{}))})}find(e,t,s){s=s||5,t.length>30&&(t=t.slice(0,30));const i=new RegExp(t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&"),"i"),r=[],n=[];return _.forEach(e,e=>{if(!e)return;const t=e.searchTerm.search(i);if(-1!==t&&!(r[t]>=s)){if(Vue.set(e,"matchIndex",t),n.push(e),t>=r.length){const e=_.last(r);for(let s=r.length-1;s<=t;s++)Vue.set(r,s,e)}for(let e=t;e<r.length;e++)Vue.set(r,e,(r[e]||0)+1);return!(r[0]>=s)&&void 0}}),_(n).sortBy("matchIndex").slice(0,s).value()}async _connectCache(e,t,r,n){const a=e.toString();try{if(this._connectedPaths.has(a))return;this._connectedPaths.add(a),Vue.delete(this._serverHashes,a),Vue.delete(this._serverCaches,a);
1const o=this.$store.services.warden,l=o.getRequirement(e);if(_get(l,"needsPermission")){if(!(await this.$when(()=>o.getVerdict(l.owner,l.repo)))[l.level])return n([]),void(i&&await s(idbKeyval.del(a,i)))}let c;this._connectors.push(this.$connect(this._serverHashes,{[a]:_ref(e,"child","hash")}));const u=await s(i&&idbKeyval.get(a,i));u&&u.version===t&&(c=u.hash,n(u.list)),this._unobserves.push(this.$observe(()=>this._serverHashes[a],async o=>{try{if(o&&o!==c){if(this._serverCaches[a]||this._connectors.push(this.$connect(this._serverCaches,{[a]:e})),await this.$when(()=>e.ready),!this._connectedPaths.has(a))return;const l=await async function(e){if(/^[[{]/.test(e))return e;const t=atob(e),s=new Uint8Array(t.length);for(let e=0;e<t.length;e++)Vue.set(s,e,t.charCodeAt(e));const i=new DecompressionStream("gzip"),r=new Response(s).body.pipeThrough(i);return await new Response(r).text()}(this._serverCaches[a].value);if(!this._connectedPaths.has(a))return;const u={hash:o,version:t,list:r(JSON.parse(l))};c=o,n(u.list),i&&await s(idbKeyval.set(a,u,i))}}catch(e){Sentry.captureException(e,{extra:{context:"_connectCache",path:a}})}}))}catch(e){Sentry.captureException(e,{extra:{context:"_connectCache",path:a}})}}_convertUserToPerson(e){const t=this.$store.services.avatars,s=_.toLower(e.login+(e.name?" "+e.name:"")),i=`github:${e.databaseId}`,r=e.avatarUrl?t.scaleGitHubAvatarUrl(e.avatarUrl):t.inferGitHubAvatarUrl(i);return{type:"person",nodeId:e.id,key:e.login,label:e.login,username:_.toLower(e.login),userKey:i,avatarUrl:r,description:e.name,searchTerm:s,matchIndex:void 0,completionTerm:void 0,_slackUser:e.slackUser}}_convertTeamToPerson(e){const t=this.$store.services.avatars,s=`githubteam:${e.databaseId}`,i=e.avatarUrl?t.scaleGitHubAvatarUrl(e.avatarUrl):t.inferGitHubAvatarUrl(s);
1return{type:"person",key:e.combinedSlug,label:e.combinedSlug,team:!0,username:_.toLower(e.combinedSlug),userKey:s,avatarUrl:i,displayName:e.name,description:e.description,searchTerm:e.combinedSlug+(e.description?" "+e.description:""),matchIndex:void 0,completionTerm:void 0}}}}},!1,!0,{filename:"src/model/services/completions/services.completions.js",modelPath:"/services/completions",modelExportName:"Completions"}),_reviewable.define(["LabelsService"],[],function(){"use strict";return{LabelsService:class LabelsService{constructor(){Vue.set(this,"_labels",{})}connect(e,t){this.$parent._connectCache(_ref(this.$store,"child","repositories",_.toLower(e),_.toLower(t),"cache","labels"),1,e=>_(e).map(e=>this.convertGitHubLabel(e)).sortBy("label").value(),s=>{Vue.set(this._labels,this._makeKey(e,t),_.keyBy(s,"name"))})}get(e,t){return this._labels[this._makeKey(e,t)]}convertGitHubLabel(e){return(e={type:"label",nodeId:e.id,key:e.name,name:e.name,searchTerm:_.toLower(e.name),color:e.color,description:e.description,matchIndex:void 0,completionTerm:void 0,displayName:this.$parent.emojis.replaceEmojiShortcodesWithUnicode(e.name)}).description&&(e.searchTerm+=" "+_.toLower(e.description)),_.assign(e,this.$store.services.colors.computeLabelColors(e.color)),e}_makeKey(e,t){if(e&&t)return`${_.toLower(e)}|${_.toLower(t)}`}}}},!1,!0,{filename:"src/model/services/completions/services.completions.labels.js",modelPath:"/services/completions/labels",modelExportName:"LabelsService"}),_reviewable.define(["MilestonesService"],[],function(){"use strict";return{MilestonesService:class MilestonesService{constructor(){Vue.set(this,"_milestones",{}),this.$observe(()=>this.$info.userid,e=>{Vue.set(this,"_milestones",{})})}connect(e,t){this.$parent._connectCache(_ref(this.$store,"child","repositories",_.toLower(e),_.toLower(t),"cache","milestones"),1,e=>_(e).map(e=>this._convertRawMilestone(e)).sortBy("label").value(),s=>{Vue.set(this._milestones,this._makeKey(e,t),s)})}get(e,t){return this._milestones[this._makeKey(e,t)]}_makeKey(e,t){return`${_.toLower(e)}|${_.toLower(t)}`}_convertRawMilestone(e){return{type:"milestone",nodeId:e.id,key:`m${e.number}`,label:e.title,description:e.description,number:e.number,searchTerm:e.title+" "+e.description,state:_.toLower(e.state),matchIndex:void 0,completionTerm:void 0}}}}},!1,!0,{filename:"src/model/services/completions/services.completions.milestones.js",modelPath:"/services/completions/milestones",modelExportName:"MilestonesService"}),_reviewable.define(["PeopleService"],["corpsman"],function(e){"use strict";const t={nobrace:!0,noext:!0,noglobstar:!0,nocomment:!0,nonegate:!0,nocase:!0,preserveMultipleSlashes:!0,optimizationLevel:0,platform:"linux"};return{PeopleService:class PeopleService{constructor(){this.$observe(()=>this.$info.userid,()=>{this._reset()},{immediate:!0})}_reset(){Vue.set(this,"_people",{}),Vue.set(this,"_members",{}),Vue.set(this,"_teams",{}),Vue.set(this,"_collaborators",{}),Vue.set(this,"_usersIndex",{}),Vue.set(this,"_slackUsersIndex",{}),Vue.set(this,"_agents",void 0),Vue.set(this,"_agentsByRepo",{}),Vue.set(this,"_agentsPromise",void 0),Vue.set(this,"_agentsLoadId",(this._agentsLoadId||0)+1),void 0!==this.$info.userid&&this._loadAgentsOnce()}async connectOrganization(e,t){try{const s=_.toLower(e),i=this._makeRepoKey(e,t);this._connectMembers(e),this._connectTeams(e),this._connectCollaborators(e,t);const r=this.$info.userid;if(await this.$when(()=>r!==this.$info.userid||this._members[s]&&this._teams[s]&&this._collaborators[i]&&this._agents),r!==this.$info.userid)return;Vue.set(this._people,i,_(this._members[s]).concat(this._collaborators[i].list,this._getAllowedAgents(e,t)).sortBy("username").sortedUniqBy("username").concat(this._teams[s]).value())}catch(e){Sentry.captureException(e,{extra:{context:"connectOrganization"}})}}async connectPersonal(e,t){try{const s=this._makeRepoKey(e,t);this._connectCollaborators(e,t);const i=this.$info.userid;if(await this.$when(()=>i!==this.$info.userid||this._collaborators[s]&&this._agents),i!==this.$info.userid)return;Vue.set(this._people,s,_(this._collaborators[s].list).concat(this._getAllowedAgents(e,t)).sortBy("username").sortedUniqBy("username").value())}catch(e){Sentry.captureException(e,{extra:{context:"connectPersonal"}})}}get(e,t){return _get(this,"_people",this._makeRepoKey(e,t))}getAgents(e,t){if(this._agents)return this._getAllowedAgents(e,t)}parseAgentOwnerKey(e){const t=e.match(/^ghagent:(\d+)-\d+$/);if(t)return`github:${t[1]}`}getCollaborators(e,t){return _get(this,"_collaborators",this._makeRepoKey(e,t),"list")}getCollaboratorsIndex(e,t){return _get(this,"_collaborators",this._makeRepoKey(e,t),"index")}getUserOrTeam(e){return this._usersIndex[_.toLower(e)]}getSlackUser(e,t){return this._slackUsersIndex[this._makeMemberKey(e,t)]}_connectMembers(e){this.$parent._connectCache(_ref(this.$store,"child","organizations",_.toLower(e),"cache","members"),1,e=>_(e).map(e=>this.$parent._convertUserToPerson(e)).sortBy("username").value(),t=>{Vue.set(this._members,this._makeOrgKey(e),t),_.forEach(t,t=>
1{Vue.set(this._usersIndex,t.userKey,t),Vue.set(this._usersIndex,`user:${t.username}`,t),t._slackUser&&Vue.set(this._slackUsersIndex,this._makeMemberKey(e,t.userKey),t._slackUser)})})}_connectTeams(e){this.$parent._connectCache(_ref(this.$store,"child","organizations",_.toLower(e),"cache","teams"),1,e=>_(e).map(e=>this.$parent._convertTeamToPerson(e)).sortBy("username").value(),t=>{Vue.set(this._teams,this._makeOrgKey(e),t),_.assign(this._usersIndex,_.keyBy(t,"userKey")),_.assign(this._usersIndex,_.keyBy(t,e=>`team:${e.username}`))})}_connectCollaborators(e,t){this.$parent._connectCache(_ref(this.$store,"child","repositories",_.toLower(e),_.toLower(t),"pushOnlyCache","collaborators"),1,e=>_(e).map(e=>this.$parent._convertUserToPerson(e)).sortBy("username").value(),s=>{const i={};_.assign(i,_.keyBy(s,"userKey")),_.assign(i,_.keyBy(s,e=>`user:${e.username}`)),_.assign(this._usersIndex,i),Vue.set(this._collaborators,this._makeRepoKey(e,t),{index:i,list:s})})}_loadAgentsOnce(){if(this._agents)return;if(this._agentsPromise)return this._agentsPromise;const e=this._agentsLoadId;return Vue.set(this,"_agentsPromise",(async()=>{if(!this.$info.userid)return void this._setAgents(e,[]);const t=await this.$peek(_ref(this.$store,"child","users","current","index","agents"))||{},s=_(t).pickBy(e=>"active"===e).keys().value(),i=_(await Promise.all(_.map(s,async e=>{const[t,s]=await Promise.all([this.$peek(_ref(this.$store,"child","users",e,"core","public")),this.$peek(_ref(this.$store,"child","users",e,"agent"))]);return this._convertAgentToPerson(e,t,s)}))).compact().sortBy("username").value();this._setAgents(e,i)})().catch(t=>{this._setAgents(e,[]),Sentry.captureException(t,{extra:{context:"load people completion agents"}})}).finally(()=>{e===this._agentsLoadId&&Vue.set(this,"_agentsPromise",void 0)})),this._agentsPromise}_setAgents(e,t){e===this._agentsLoadId&&(Vue.set(this,"_agents",t),Vue.set(this,"_agentsByRepo",{}),_.forEach(t,e=>{Vue.set(this._usersIndex,e.userKey,e),Vue.set(this._usersIndex,`user:${e.username}`,e)}))}_convertAgentToPerson(e,t,s){if(!t||!t.username||!s)return;const i=this.$store.services.avatars,r=_get(s,"ownerKey")||this.parseAgentOwnerKey(e),n=_.toLower(t.username),a=t.avatarUrl?i.scaleGitHubAvatarUrl(t.avatarUrl):i.inferGitHubAvatarUrl(r),o=this.$store.services.colors;return{type:"person",key:t.username,label:t.username,username:n,userKey:e,avatarUrl:a,description:t.displayName,searchTerm:_.toLower(t.username+(t.displayName?" "+t.displayName:"")),matchIndex:void 0,completionTerm:void 0,agent:!0,tagName:_get(t,"tag","name"),tagColors:o.computeAgentTagColors(_get(t,"tag","color")),repositoriesGlob:_get(s,"settings","repositoriesGlob")}}_getAllowedAgents(t,s){const i=this._makeRepoKey(t,s);return this._agentsByRepo[i]?this._agentsByRepo[i]:Vue.set(this._agentsByRepo,i,_.filter(this._agents,i=>{const r=i.repositoriesGlob;if(!r)return!0;const n=`${t}/${s}`;return _(_.trim(r)).split(/\s*,\s*/).compact().some(t=>{try{return this._matchRepo(n,t)}catch(t){return e.capture(t,"matchRepo"),!1}})}))}_makeOrgKey(e){return _.toLower(e)}_makeRepoKey(e,t){return`${_.toLower(e)}|${_.toLower(t)}`}_makeMemberKey(e,t){return`${_.toLower(e)}|${t}`}validateRepoGlob(e){if(/[{}]|[?*+@!]\(|\*\*/.test(e))throw new Error("Extended glob patterns not supported")}_matchRepo(e,s){return this.validateRepoGlob(s),minimatch.minimatch(e,s,t)}}}},!1,!0,{filename:"src/model/services/completions/services.completions.people.js",modelPath:"/services/completions/people",modelExportName:"PeopleService"}),_reviewable.define(["Playground"],["CompletionConditionContext"],function(e){"use strict";return{Playground:class Playground extends e{}}},!1,!0,{filename:"src/model/services/playground/services.playground.$pageKey.js",modelPath:"/services/playground/$pageKey",modelExportName:"Playground"}),_reviewable.define(["Playgrounds"],[],function(){"use strict";return{Playgrounds:class Playgrounds{create(){const e=this.$newKey();return _ref(this,"child",e).set({active:!0}),this[e]}}}},!1,!0,{filename:"src/model/services/playground/services.playground.js",modelPath:"/services/playground",modelExportName:"Playgrounds"}),_reviewable.define(["PullRequest"],["session","shared"],function(e,t){"use strict";return{PullRequest:class PullRequest{constructor(){Vue.set(this,"firstShowingInCategory",void 0),Vue.set(this,"striped",void 0),Vue.set(this,"_basicConnector",void 0),Vue.set(this,"_connector",void 0),Vue.set(this,"_reviewKeyConnector",this.$connect({reviewKey:()=>_ref(this._repositoryRef,"child","pullRequests",this.number)})),this.$when(()=>this.wanted).then(()=>{Vue.set(this,"_basicConnector",this.$connect({connection:()=>_ref(this._repositoryRef,"child","core","connection"),core:()=>_ref(this._reviewRef,"child","core")}))}),this.$when(()=>_get(this,"_basicConnector","at","core","ready")&&!_get(this,"_reviewRef","value","core","error")&&_.isBoolean(this.tooManyFiles)).then(()=>{Vue.set(this,"_connector",this.$connect({participants:()=>_ref(this._reviewRef,"child","participants"),tracker:()=>{const e=this._dashboardTrackerNeeded;if(void 0!==e)return _ref(this._reviewRef,"child",e?"tracker":"core")},designatedReviewers:()=>{const e=this._dashboardFilesNeeded;if(void 0!==e)return _ref(this._reviewRef,"child",e?"designatedReviewers":"core")},files:()=>{const e=this._dashboardFilesNeeded;if(void 0!==e)return _ref(this._reviewRef,"child",e?"files":"core")},spr:()=>_ref(this._reviewRef,"child","integrations","spr"),combinedState:()=>_ref(this._statusRef,"child","combinedState"),stateSummaries:()=>_ref(this._statusRef,"child","summaries"),reviewState:()=>_ref(this._statusRef,"child","services",t.reviewableStatusContext,"state"),reviewLgtms:()=>_ref(this._statusRef,"child","services",t.reviewableStatusContext,"lgtms"),mergeable:()=>_ref(this._statusRef,"child","services",t.mergeableStatusKey),userState:()=>this._userStateRef,repositorySettings:()=>_ref(this._repositoryRef,"child","core","settings")}))}),this.$when(()=>_.some(_get(this,"review","people"),e=>null===e.dashboardIcon)).then(()=>{this.$connect({lastRevisionCaptureTimestamp:()=>_ref(this._lastRevisionRef,"child","captureTimestamp"),lastRevisionCommitTimestamp:()=>_ref(this._lastRevisionRef,"child","commitTimestamp"),emojis:()=>_ref(this._reviewRef,"child","sentiments")})}),this.$when(()=>_get(this,"review","progress","mergeInProgress")).then(()=>{this.$connect({mergeQueueEntry:()=>_ref(this._reviewRef,"child","mergeQueueEntry"),labels:()=>_ref(this._reviewRef,"child","labels")})})}get _repositoryRef(){return _access(_ref,"call",[this.$store,"child","repositories",_.toLower(this.owner),_.toLower(this.repo)],"","annotate","call",[{needsAuth:!0}])}get _reviewRef(){return _access(_ref,"call",[this.$store,"child","reviews",_get(this,"_reviewKeyConnector","data","reviewKey")],"","annotate","call",[{needsAuth:!0}])}get review(){return _get(this,"_reviewRef","value")}get _lastRevisionRef(){return _access(_ref,"call",[this._reviewRef,"child","revisions",_get(this,"review","core","lastRevisionKey")])}get _statusRef(){return _access(_ref,"call",[this._reviewRef,"child","statuses",_get(this,"review","core","lastRevisionKey")])}get _userStateRef(){return _access(_ref,"call",[this.$store,"child","users","current","state",_get(this,"_reviewKeyConnector","data","reviewKey")],"","annotate","call",[{needsAuth:!0}])}get verdict(){if(this.owner&&this.repo)return this.$store.services.warden.getVerdict(this.owner,this.repo)}get connection(){return _get(this,"_basicConnector","data","connection")}get repositorySettings(){return _get(this,"_connector","data","repositorySettings")}get userState(){return _get(this,"_connector","data","userState")}get reviewCreated(){if(_get(this,"_reviewKeyConnector","ready"))return Boolean(_get(this,"_reviewKeyConnector","data","reviewKey"))}get archived(){return Boolean(this.reviewCreated&&_get(this,"_basicConnector","at","core","ready")&&!this.review)}get broken(){return Boolean(_get(this,"review","core","error"))}get tooManyFiles(){if(_get(this,"review","core"))return!!_.isNumber(this.review.core.fileCount)&&this.review.core.fileCount>250}get _dashboardFilesNeeded(){if(this.tooManyFiles)return!1;const e=_get(this,"review","state");if(!e){if(!_get(this,"review","stateReady"))return;return!0}const t=e.dashboardCacheValidity;return t?"valid"!==t:void 0}get _dashboardTrackerNeeded(){const e=_get(this,"review","state");if(!e){if(!_get(this,"review","stateReady"))return;return!0}const t=e.dashboardTrackerCacheValidity;if(t)return"valid"!==t}get localReady(){return Boolean(!1===this.reviewCreated||_get(this,"_connector","ready")||this.archived||this.broken)}get ready(){return this.localReady&&this.$freezeComputedProperty(),this.localReady}get wanted(){if(this.owner&&this.repo){if(!1===_access(this,"","$store","","services","","warden","","getVerdict","call",[this.owner,this.repo],"","pull"))return!1;if(void 0!==this.reviewCreated)return!!this.alwaysWanted||Boolean((!this.stale||this.$parent.$parent.showingStale)&&(this.reviewCreated||e.settings.effectiveShowUnconnectedPullRequests))}}get notConnected(){return Boolean(_get(this,"_basicConnector","at","connection","ready")&&"active"!==_get(this,"_basicConnector","data","connection"))}get reviewLink(){if(this.owner&&this.repo&&this.number)return`/reviews/${this.owner}/${this.repo}/${this.number}`}get mergeLabelApplied(){return _(this.labels).map("name").includes(_get(this,"repositorySettings","merge","label"))}get merged(){return Boolean("merged"===this.state||"merged"===_get(this,"review","core","state")||_get(this,"review","integrations","spr","merged"))}get closed(){return Boolean("closed"===this.state||"closed"===_get(this,"review","core","state")||this.merged)}get _mergeLabel(){const e=_get(this,"review","repository","core","settings","merge","label");if(!e||_get(this,"labels",e)||!_get(this,"review","labels","$data",e))return;const t=this.$store.services.completions.labels;return t.connect(this.owner,this.repo),_access(t,"","get","call",[this.owner,this.repo],"",e)}get labelsList(){return _(this.labels).toArray().concat(this._mergeLabel||[]).sortBy("searchTerm").value()}get combinedState(){return _get(this,"_statusRef","value","aggregateState")}get visualCheckState(){return"inprogress"===this.combinedState&&(_get(this,"review","files","num","leftEstimate")||_get(this,"review","tracker","num","left")||_get(this,"userState","num","pending"))?null:"success"!==this.combinedState||_get(this,"_connector","data","reviewState")?this.combinedState:null}get visualCheckFailureRequired(){return _get(this,"_statusRef","value","aggregateFailureRequired")}get reviewComplete(){return Boolean(this.localReady&&!this.closed&&_get(this,"review","progress","complete"))}get displayKind(){if(this.localReady){if(_get(this,"review","state","pendingPublishOnPush"))return"pending";if(this.archived)return"archived";if(this.closed)return"closed";if(this.mergeQueueEntry||this.mergeLabelApplied||_get(this,"review","progress","mergeQueued"))return"queued";if(this.broken)return"broken";if(this.reviewComplete){if(void 0===_get(this,"review","progress","mergeReadinessLevel"))return;if(_get(this,"review","progress","mergeReadinessLevel")>=2)return"complete"}return this.review?"counters":"none"}}
1get _requestedTeamsArray(){return _(this.requestedTeams).values().sortBy("$teamKey").value()}get importantUsers(){if(!_get(this,"_reviewKeyConnector","at","reviewKey","ready"))return;let e;return e=this._reviewKeyConnector.data.reviewKey&&_get(this,"_connector","ready")?_(_get(this,"review","people","list")).filter(e=>(e.activeReviewer||e.dashboardIcon||e.blocker||e.author)&&!e.passiveBot).map(e=>(this.$store.services.avatars.connectUser(e.$userKey),e)).value():_([this.author]).concat(_.values(_.isEmpty(this.requestedReviewers)?this.assignees:this.requestedReviewers)).concat(_.values(this.reviewers)).uniqBy("$userKey").value(),_(e).concat(this._requestedTeamsArray||[]).sortBy(e=>e.blocker?0:1,e=>e.author?0:1,e=>e.bot?1:0,"$key").value()}get _blockingUserKeys(){if(_get(this,"_reviewKeyConnector","at","reviewKey","ready"))return this._reviewKeyConnector.data.reviewKey?_(_get(this,"review","people","list")).filter("blocker").map("$userKey").value():_.isEmpty(this.requestedReviewers)?_.isEmpty(this.assignees)?[]:_.keys(this.assignees):_.keys(this.requestedReviewers)}get _userIsAssignee(){return Boolean(_get(this,"assignees",this.$info.userid))}get _userIsRequestedReviewer(){return Boolean(_get(this,"requestedReviewers",this.$info.userid))}get _userIsActiveReviewer(){return this._userIsRequestedReviewer||_get(this,"review","people",this.$info.userid,"activeOrRequestedReviewer")}get _userIsAuthor(){if(!this.$info.userid)return!1;const e=_get(this,"author","$userKey"),t=this.$info.user.github;return Boolean(e===this.$info.userid||t.agentKey&&t.ownerKey===e&&"author"===t.agentType)}get _userIsBlocking(){return!this.closed&&!(this.mergeQueueEntry||this.mergeLabelApplied)&&_.includes(this._blockingUserKeys,this.$info.userid)}get _userIsWorking(){return _get(this,"review","tracker","currentUserWorking")}get _userHasUnread(){return _get(this,"review","tracker","num","involvedUnreplied")&&!_get(this,"review","userHasDeferred")}get category(){return this._userIsBlocking?"1.blocking":this._userHasUnread?"2.unread":this.closed||this.mergeQueueEntry||this.mergeLabelApplied?"9.concluded":this._userIsWorking||_get(this,"userState","num","pending")&&!this.archived?"3.working":this._userIsActiveReviewer?"4.reviewing":this._userIsAssignee?"5.assigned":this._userIsAuthor?"6.created":this.fetchedCategory}get secondarySortPriority(){return _.isEqual(this._blockingUserKeys,[this.$info.userid])?-1:0}get condition(){const e=!this.review||"success"===_get(this,"_connector","data","reviewState")||this.closed,t=_.includes(["error","failure"],this.combinedState)&&!this.closed,s=_.some(this._blockingUserKeys,e=>e===_get(this,"author","$userKey")||_get(this,"review","people",e,"author")),i=_([this.draft?"draft":this.closed?this.merged?"merged":"closed":"open","counters"===this.displayKind&&(_get(this,"userState","num","pending")||_get(this,"review","files","num","toReviewAttention")&&!_get(this,"review","userHasDeferred")||_get(this,"review","files","num","selfReviewAttention")&&_get(this,"review","userIsReviewingFiles")||_get(this,"review","tracker","num","unreplied")&&!_get(this,"review","userHasDeferred"))?"red":"","counters"===this.displayKind&&_get(this,"review","userHasDeferred")&&(_get(this,"review","files","num","toReviewAttention")||_get(this,"review","tracker","num","unreplied"))?"deferred":"",this._userIsAuthor||this._userIsAssignee||this._userIsRequestedReviewer?"mine":"",this.private?"private":"public",this.starred?"starred":"",this.watched?"watched":"",e?"":"needs:review",t?"needs:fix":"",e&&"success"===this.combinedState&&!this.closed?"needs:merge":"",t||!e&&s?"needs:author":"",e||s&&!(this._blockingUserKeys.length>1)&&_.isEmpty(this.requestedTeams)?"":"needs:reviewer",_.includes(this._blockingUserKeys,this.$info.userid)||this.requestsUserTeam?"needs:me":"",this._userIsAuthor?"am:author":"",this._userIsAssignee?"am:assigned":"",this._userIsRequestedReviewer?"am:requested":"",`by:${_.toLower(this.author.username)}`,_.map(this.importantUsers,e=>e.username?`with:${_.toLower(e.username)}`:e.slug?[`with:${_.toLower(e.slug)}`,`with:${_.toLower(e.slug).split("/")[1]}
1`]:void 0)]).flattenDeep().compact().value(),r=_.map(this.labelsList,e=>"label:"+e.searchTerm);return i.concat(r)}get showing(){if(!this.wanted)return!1;return _.every(this.$parent.$parent.querySegments,e=>{if(e.text){const t=e.text;return _.includes(_.toLower(this.title),t)||_.includes(_.toLower(`${this.owner}/${this.repo}`),t)||_.startsWith(this.number.toString(),t)||_.includes(_.toLower(_get(this,"author","name")),t)||_.some(this.importantUsers,e=>_.includes(_.toLower(_get(e,"name")),t))||_.includes(_.toLower(_get(this,"milestone","title")),t)||_.includes(_.toLower(_get(this,"milestone","description")),t)||_.some(this.labels,e=>_.includes(e.searchTerm,t))}return(e.plus?_.intersection(e.tokens,this.condition).length:!_.difference(e.tokens,this.condition).length)?e.plus:e.minus})}}}},!1,!0,{filename:"src/model/services/pullRequests/services.pullRequests.$listKey.items.$prKey.js",modelPath:"/services/pullRequests/$listKey/items/$prKey",modelExportName:"PullRequest"}),_reviewable.define(["PullRequestsList"],["session","config","corpsman","debug","analytics","safeStorage","shared","SANCTION_ICONS"],function(e,t,s,i,r,n,a,o){"use strict";const l={APPROVED:"approved",CHANGES_REQUESTED:"changes_requested",DISMISSED:"dismissed"},c="https://github.com"===t.gitHubUrl?10137:1,u={},d="\n id, number, title, url, state, createdAt, updatedAt, closedAt, baseRefName, headRefName,\n #field(PullRequest, isDraft)\n author {\n login, avatarUrl,\n ... on User {databaseId, name}\n ... on Bot {databaseId}\n ... on Mannequin {databaseId}\n },\n repository {\n name, isPrivate, isArchived, viewerHasStarred, viewerSubscription, owner {login},\n defaultBranchRef {name}\n },\n reviewRequests (first: 100) {\n nodes {\n requestedReviewer {\n ... on User {login, name, avatarUrl, databaseId}\n ... on Bot {login, avatarUrl, databaseId}\n ... on Mannequin {login, avatarUrl, databaseId}\n #scope(read:org) {\n ...on Team {combinedSlug, name, avatarUrl, databaseId}\n #}\n }\n }\n },\n latestOpinionatedReviews (first: 100, writersOnly: true) {\n nodes {\n state,\n author {\n login, avatarUrl,\n ... on User {name, databaseId}\n ... on Bot {databaseId}\n ... on Mannequin {databaseId}\n }\n }\n },\n assignees (first: 100) {nodes {login, name, avatarUrl, databaseId}},\n labels (first: 100) {nodes {name, color}},\n milestone {title, description},\n #exists(PullRequest.mergeQueueEntry) {\n mergeQueueEntry {\n enqueuedAt, estimatedTimeToMerge, position\n enqueuer {\n login, avatarUrl,\n ... on User {databaseId, name}\n ... on Bot {databaseId}\n ... on Mannequin {databaseId}\n }\n }\n #}\n",h=`\n query ($owner: String!, $repo: String!, $number: Int!) {\n repository (owner: $owner, name: $repo) {\n pullRequest (number: $number) {\n ${d}\n }\n }\n }\n`,p=_.parseInt(new URLSearchParams(window.location.search).get("queryChunkSize"))||8;class PullRequestsQuery{constructor(e,t,s){Vue.set(this,"query",e),Vue.set(this,"index",t),Vue.set(this,"advanced",s),Vue.set(this,"fetchSize",100),Vue.set(this,"lastCursor",null),Vue.set(this,"numFetched",0),Vue.set(this,"finished",!1),Vue.set(this,"incomplete",!1)}get parameters(){const e=this.index;return`$q${e}: String!, $q${e}First: Int!, $q${e}After: String`}get variables(){const e=this.index,t={[`q${e}`]:this.query,[`q${e}First`]:this.fetchSize};return this.lastCursor&&Vue.set(t,`q${e}After`,this.lastCursor),t}get gqlFragment(){const e=this.index;return`\n q${e}: search (type: ${this.advanced?"ISSUE_ADVANCED":"ISSUE"}, query: $q${e}, first: $q${e}First, after: $q${e}After) {\n pageInfo {hasNextPage, endCursor},\n issueCount,\n nodes {\n ... on PullRequest {\n ${d}\n }\n }\n }\n `.replace(/\s+/g," ")}process(e){const t=e[`q${this.index}`];return this.fetchSize>8&&(e===u||_.some(_get(t,"nodes"),_.isNil))?(i.dashboard&&console.log("Bad query result, splitting:",this.query),void Vue.set(this,"fetchSize",Math.
1ceil(this.fetchSize/2))):_get(t,"nodes")?(this.numFetched+=t.nodes.length,_.some(t.nodes,_.isNil)&&Vue.set(this,"incomplete",!0),t.pageInfo.hasNextPage?(Vue.set(this,"lastCursor",t.pageInfo.endCursor),Vue.set(this,"fetchSize",100)):(Vue.set(this,"finished",!0),Vue.set(this,"incomplete",this.incomplete||t.issueCount>this.numFetched)),t.nodes):(Vue.set(this,"incomplete",!0),void Vue.set(this,"finished",!0))}}class SpecificPullRequestQuery{constructor(e,t,s,i){Vue.set(this,"owner",e),Vue.set(this,"repo",t),Vue.set(this,"prNumber",s),Vue.set(this,"index",i),Vue.set(this,"finished",!1),Vue.set(this,"incomplete",!1)}get parameters(){const e=this.index;return`$q${e}Owner: String!, $q${e}Repo: String!, $q${e}Number: Int!`}get variables(){const e=this.index;return{[`q${e}Owner`]:this.owner,[`q${e}Repo`]:this.repo,[`q${e}Number`]:this.prNumber}}get gqlFragment(){const e=this.index;return`\n q${e}: repository (owner: $q${e}Owner, name: $q${e}Repo) {\n pullRequest (number: $q${e}Number) {\n ${d}\n }\n }\n `.replace(/\s+/g," ")}process(e){Vue.set(this,"finished",!0);const t=_get(e,`q${this.index}`,"pullRequest")||{};return Vue.set(t,"mentionKey",`${this.owner}|${this.repo}|${this.prNumber}`),[t]}}return{PullRequestsList:class PullRequestsList{constructor(){if(Vue.set(this,"_connectionCheckConnectors",{}),Vue.set(this,"numQueries",0),Vue.set(this,"_lastRefreshTimestamp",0),Vue.set(this,"_lastSuccessfulRefreshTimestamp",0),Vue.set(this,"_active",0),Vue.set(this,"_stats",null),Vue.set(this,"_closedHorizonDays",3),Vue.set(this,"showingStale",!1),Vue.set(this,"query",""),Vue.set(this,"warnings",[]),Vue.set(this,"restrictedOrganizations",[]),Vue.set(this,"_openExtraMentionsConnector",void 0),Vue.set(this,"_cacheConnector",void 0),"global"===this.$key)this.$observe(()=>[e.settings.showPullRequestsFromPushableRepos,e.settings.showPullRequestsFromStarredReposOnly,e.settings.showPullRequestsFromWatchedReposOnly,e.settings.showPullRequestsFromConnectedReposOnly],(e,t)=>{(_get(e,0)||_get(t,0))&&this.refresh(!0)},{deep:!0,precise:!0});else{const e=this.$key.match(/^(.*?)\/(.*?)\/(.*?)$/);e?Vue.set(this,"_pullRequestAddress",{owner:e[1],repo:e[2],number:_.parseInt(e[3])}):/^[^/]+\/[^/]+$/.test(this.$key)?Vue.set(this,"_scopeTerm",Vue.set(this,"_fullRepoTerm",`repo:${this.$key}`)):Vue.set(this,"_scopeTerm",Vue.set(this,"_orgTerm",`org:${_.toLower(this.$key)}`))}}get querySegments(){let e=_.toLower(this.query);if(!e)return;return e=e.replace(/"(.*?)"/g,e=>e.replace(/\s/g,"Å")),_(e).split(/\s+/).map(e=>{if(!e)return;const t="+"===(e=e.replace(new RegExp("Å","g")," ")).charAt(0),s="-"===e.charAt(0);if(t||s){return{plus:t,minus:s,tokens:e.slice(1).replace(/"/g,"").split(",")}}return{text:e}}).compact().value()}get _extraMentionsRef(){return _ref(this.$store,"child","users",this.$info.userid,"index","extraMentions")}get _connectExtraMentions(){this._extraMentionsRef&&(this._openExtraMentionsConnector||Vue.set(this,"_openExtraMentionsConnector",this.$connect({result:this._extraMentionsRef.query({by:_ref(this._extraMentionsRef,"child","prKey","closedTimestamp"),at:null})})))}acquire(){this._active++,1===this._active&&this.refresh()}release(){if(!this._active)throw new Error("Releasing inactive PR list");this._active--}get active(){return this._active}get empty(){return!(_get(this,"list","length")||this.error||_get(this,"warnings","length")||_get(this,"restrictedOrganizations","length"))}get type(){return"global"===this.$key?"personal":this._fullRepoTerm?"repo":this._orgTerm?"org":"pr"}
1_invalidate(){this.$update({state:"invalid"}),Vue.set(this,"_lastRefreshTimestamp",0)}get staleCount(){return _(this.items).filter(t=>t.stale&&(e.settings.effectiveShowUnconnectedPullRequests||t.reviewCreated)).size()}get mayHaveMoreClosedResults(){return!this._pullRequestAddress}get list(){if(this.listReady)return _(this.items).filter("ready").filter("wanted").sortBy("category","secondarySortPriority","createdAt").value()}get listReady(){const e=this.items&&_.every(this.items,e=>!1===e.wanted||e.ready);return e&&this.$freezeComputedProperty(),e}get hiddenItemsStillLoading(){return _.some(this.items,e=>e.wanted&&!e.showing&&!e.ready)}get showingList(){if(this.listReady)return _.filter(this.list,"showing")}get _stripeList(){let e,t=!0;_.forEach(this.showingList,s=>{Vue.set(s,"firstShowingInCategory",e!==s.category),s.firstShowingInCategory&&(t=!0),Vue.set(s,"striped",t),e=s.category,t=!t})}raiseClosedHorizon(){Vue.set(e.onboarding,"showMoreConcludedPullRequests",!0),this._closedHorizonDays<7?Vue.set(this,"_closedHorizonDays",7):this._closedHorizonDays+=7,this.refresh(!0)}get closedHorizonWeeks(){return Math.floor(this._closedHorizonDays/7)}refresh(e){e&&this._invalidate(),this._active&&("invalid"===this.state||"fetching"!==this.state&&"refreshing"!==this.state&&(Date.now()-this._lastRefreshTimestamp>=6e4||this.$parent.refreshFirstList))&&this._doRefresh()}get stateMessage(){return"invalid"===this.state?"Resuming session":this.numQueries?`Running ${this.numQueries} queries`:_.every(this.items,"verdict")?"Loading data":"Obtaining permissions"}get lastUpdateTimeAgo(){if(!this._lastSuccessfulRefreshTimestamp)return;const e=this.$store.services.computeTimeAgo(this._lastSuccessfulRefreshTimestamp);return"just now"===e?"<1 minute ago":e}_doRefresh(){if(!this._active||!e.settings.$ready||void 0===this.$info.user)return void this._invalidate();const t=Vue.set(this,"_lastRefreshTimestamp",Date.now()),r="global"===this.$key&&e.settings.showPullRequestsFromPushableRepos;this.$update({state:"ready"===this.state||"incomplete"===this.state?"refreshing":"fetching"}),this._runQueries().then(({pullRequests:e,incomplete:s,warnings:n})=>{i.dashboard&&console.log("Queries complete",{destroyed:this.$destroyed,refreshTimestamp:t,lastRefreshTimestamp:this._lastRefreshTimestamp}),this.$destroyed||t<this._lastRefreshTimestamp||(this.$update({items:_.keyBy(e,"key")}),Vue.set(this,"_lastSuccessfulRefreshTimestamp",this._lastRefreshTimestamp),this.$when(()=>this.listReady).then(()=>{this._cancelIfDestroyed(),this.$update({state:s?"incomplete":"ready",error:null})}),Vue.set(this,"restrictedOrganizations",[]),Vue.set(this,"warnings",_.reject(n,e=>{const t=e.match(/the `([^`]+)` organization has enabled OAuth App access restrictions/);if(t)return this.restrictedOrganizations.push(t[1]),!0})),this.restrictedOrganizations.sort(),this._recordAnalytics(r))}).catch(e=>{this.$destroyed||(s.capture(e,"fetchPullRequests"),403===e.status&&(e.message+=" Note that the review list refreshes automatically, so you don't need to reload the page manually."),t>=this._lastRefreshTimestamp&&this.$update({state:"error",error:e.toString()}))})}_runQueries(){Vue.set(this,"numQueries",0);const r=e.hubkit();if(this._pullRequestAddress)return this._querySpecificPullRequest(r).finally(()=>{Vue.set(this,"numQueries",0)}).then(e=>({pullRequests:this._cleanPullRequests(e),incomplete:_.some(e,"incomplete"),warnings:_(e).flatMap("warnings").compact().uniq().value()}));const a=`reviewable:prlist::${t.firebase}::${this.$key}`,o=this._closedHorizonDays;if(!this.items&&3===o)try{const e=n.local.getItem(a);if(e){const{refreshTimestamp:t,pullRequests:s,incomplete:r,warnings:n}=JSON.parse(e);return Vue.set(this,"_lastRefreshTimestamp",t),i.dashboard&&console.log("Loaded cached query results",{refreshTimestamp:t,pullRequests:s,incomplete:r,warnings:n}),Promise.resolve({pullRequests:s,incomplete:r,warnings:n})}}catch(e){s.capture(e,"load cached pull request list")}Vue.set(this.$parent,"refreshFirstList",!1);const l=[];return this.$when(()=>void 0!==this.$parent.advancedSearchAvailable).then(()=>
1{if(this.$info.userid&&(l.push(this._queryInvolvesUser(r)),l.push(this._loadExtraMentionsIndex().then(e=>this._queryExtraMentions(e,r))),e.hasScope("read:org")&&l.push(this.$store.services.gitHubCache.querySubjectAndCache("teams",this._queryTeams.bind(this,r)))),this._fullRepoTerm)l.push(this._querySpecificRepo(r),this._checkRepoExists(r));else if(e.settings.showPullRequestsFromPushableRepos&&this.$info.userid){const t=e.settings.showPullRequestsFromWatchedReposOnly,s=e.settings.showPullRequestsFromStarredReposOnly,i=t&&s?"watchedOrStarredPushableRepos":t?"watchedPushableRepos":s?"starredPushableRepos":"pushableRepos";l.push(this.$store.services.gitHubCache.querySubjectAndCache(i,this._queryRepos.bind(this,r)))}return Promise.all(l)}).finally(()=>{Vue.set(this,"numQueries",0)}).then(e=>{const t=this._cleanPullRequests(e),r=_.some(e,"incomplete"),l=_(e).flatMap("warnings").compact().uniq().value();if(3===o)try{const e={refreshTimestamp:this._lastRefreshTimestamp,pullRequests:t,incomplete:r,warnings:l},s=JSON.stringify(e);n.local.setItem(a,s),i.dashboard&&console.log("Stored query results in cache",_.assign({size:s.length},e))}catch(e){s.capture(e,"save cached pull request list")}return{pullRequests:t,incomplete:r,warnings:l}})}_querySpecificPullRequest(e){return i.dashboard&&console.log("Querying specific PR"),this.numQueries++,e.graph(h,{variables:this._pullRequestAddress,media:"shadow-cat-preview+json",ifNotFound:null}).then(e=>{this._cancelIfDestroyed();const t=this._convertPullRequest(_get(e,"repository","pullRequest"));if(!t){const e=[[]];return Vue.set(e[0],"warnings","Pull request not found."),e}return Vue.set(t,"alwaysWanted",!0),[t]})}_queryInvolvesUser(t){return i.dashboard&&console.log('Running "involves" query'),this._fetchPullRequests(t,[["involves:"+e.user.github.username]],this._scopeTerm,"7.involved")}_querySpecificRepo(e){return i.dashboard&&console.log("Running specific repo query"),this._fetchPullRequests(e,[[this._fullRepoTerm]])}_checkRepoExists(e){return i.dashboard&&console.log("Checking that this repository exists"),e.request("/repos/:fullName",{fullName:this.$key}).then(()=>[])}_loadExtraMentionsIndex(){return i.dashboard&&console.log("Loading extra mentions"),Promise.all([this.$when(()=>_get(this,"_openExtraMentionsConnector","ready")).then(()=>this._openExtraMentionsConnector.data.result),this.$when(()=>this._extraMentionsRef).then(()=>{if(!this.$destroyed&&this._extraMentionsRef)return this.$peek(this._extraMentionsRef.query({by:_ref(this._extraMentionsRef,"child","prKey","closedTimestamp"),from:this.$now-24*this._closedHorizonDays*60*60*1e3}))})]).then(([e,t])=>_({}).assign(e,t).pickBy(e=>_get(e,"owner")&&e.repo&&e.prNumber).value())}_queryExtraMentions(e,t){this._cancelIfDestroyed();let r=0;const n=_(e).map(e=>new SpecificPullRequestQuery(e.owner,e.repo,e.prNumber,r++)).compact().value();if(_.isEmpty(n))return Promise.resolve();i.dashboard&&console.log("Running extra mentions bulk request:",n.length,"queries");const a=[],o=[];return this._runPullRequestsQueries(t,n,50,a,o,{ignoreNotFound:!0}).then(()=>{i.dashboard&&console.log("Extra mentions request completed"),this._cancelIfDestroyed();const[t,r]=_.partition(a,({mentionKey:t})=>e[t]);if(r.length){i.dashboard&&console.log(`Unexpected mentions fetched: ${_.map(r,"mentionKey")}`);const t=new Error("Unexpected extra mentions fetched");Vue.set(t,"extra",{unexpectedNodes:r,extraMentions:e}),s.capture(t,"_queryExtraMentions sanity check")}const[n,l]=_.partition(t,"id");let c=_(n).reject(e=>e.repository.isArchived).map(e=>this._convertPullRequest(e,"7.involved")).value();return Promise.all([..._.map(c,t=>{const i=e[t.mentionKey];if("open"===t.state!=!i.closedTimestamp){const e="open"===t.state?null:t.closedAt;return _ref(i,"child","closedTimestamp").annotate({debugPermissionDenied:!1}).set(e).catch(e=>(s.markHandled(e),i.$ref.peek().then(t=>{t&&s.capture(e,"updateClosedTimestamp")},e=>{s.capture(e,"updateClosedTimestamp error handler")})))}}),..._.map(l,({mentionKey:t})=>{if(o.length)return;const s=e[t];return i.dashboard&&console.log(`Deleting missing extra mention: ${t}`),s.$ref.set(null)})]).then(()=>
1{if(this._scopeTerm){const e=this.$key.replace("/","|")+"|";c=_.filter(c,t=>_.startsWith(t.key,e))}return Vue.set(c,"warnings",_.uniq(o)),c})},e=>(i.dashboard&&console.log("Extra mentions request failed",e),401===e.status?[]:(Vue.set(e,"extra",e.extra||{}),Vue.set(e.extra,"queries",_.map(n,"query")),Promise.reject(e))))}_queryTeams(e,t){return this._cancelIfDestroyed(),_get(t,"length")?(i.dashboard&&console.log(`Running "team" and "team-review-requested" queries for ${t.length} teams`),this._fetchPullRequests(e,[_.map(t,e=>`team:${e}`),_.map(t,e=>`team-review-requested:${e}`)],this._scopeTerm,"8.team").then(e=>{const s=new Set(t);return _.forEach(e,e=>{_.some(e.requestedTeams,e=>s.has(e.slug))&&Vue.set(e,"requestsUserTeam",!0)}),e})):Promise.resolve([])}_queryRepos(e,t){if(this._cancelIfDestroyed(),!_get(t,"length"))return Promise.resolve([]);if(this._orgTerm){const e=this._orgTerm.replace(/^org:/,"")+"/";t=_.filter(t,t=>_.startsWith(t,e))}return this._filterConnectedRepos(t).then(t=>{if(t.length<=250)return i.dashboard&&console.log(`Running ${t.length} repo queries`),this._fetchPullRequests(e,[_.map(t,e=>`repo:${e}`)]);const s={};_.forEach(t,e=>{Vue.set(s,e,!0)});const r=_(t).map(e=>"user:"+e.split("/")[0]).uniq().value();return i.dashboard&&console.log(`Running ${r.length} repo queries by owner`),this._fetchPullRequests(e,[r],null,null,e=>s[_.toLower(`${e.owner}/${e.repo}`)])})}_filterConnectedRepos(t){if(!e.settings.showPullRequestsFromConnectedReposOnly)return _.forEach(this._connectionCheckConnectors,e=>{e.destroy()}),Vue.set(this,"_connectionCheckConnectors",{}),Promise.resolve(t);const s=e.settings.showPullRequestsFromWatchedReposOnly,r=e.settings.showPullRequestsFromStarredReposOnly,n={};return _.forEach(t,e=>{if(Vue.set(n,e,!0),this._connectionCheckConnectors[e])return;const[t,i]=e.split("/");Vue.set(this._connectionCheckConnectors,e,this.$connect(_ref(this.$store,"child","repositories",t,i,"core","connection").annotate({userRepo:!(s||r||this._orgTerm)})))}),Vue.set(this,"_connectionCheckConnectors",_.pickBy(this._connectionCheckConnectors,(e,t)=>(n[t]||e.destroy(),n[t]))),this._cancelIfDestroyed(),i.dashboard&&console.log("Loading connection flags"),this.$when(()=>_.every(this._connectionCheckConnectors,"ready")).then(()=>(this._cancelIfDestroyed(),_.filter(t,e=>{const t=_get(this,"_connectionCheckConnectors",e,"data","_");return"active"===t||"broken"===t})))}_cleanPullRequests(e){const s=_(e).flatten().compact().groupBy("key").map(e=>{const t=_(e).sortBy("fetchedCategory").head();return Vue.set(t,"requestsUserTeam",_.some(e,"requestsUserTeam")),t}).sortBy("createdAt").value(),i=this._closedHorizonDays<7?_(s).reject({state:"open"}).map("updatedAt").compact().sortBy().slice(-10).head():0,r=this.$now-24*a.stalledDurationDays*60*60*1e3;return _.chain(s).reject(e=>"open"!==e.state&&e.updatedAt<i).forEach(e=>{this._pullRequestAddress||Vue.set(e,"stale","open"===e.state&&e.updatedAt<r)}).filter(e=>!t.coveredRepoClasses||_.find(t.coveredRepoClasses,t=>!("*"!==t.organization&&t.organization!==_.toLower(e.owner)||t.visibility&&"*"!==t.visibility&&t.visibility!==(e.private?"private":"public")))).value()}_recordAnalytics(t){if("global"!==this.$key&&!this._scopeTerm)return;const s={numReviews:_.size(this.items),includesPrivate:e.hasScope("repo"),includesPushableRepos:t,listType:this.type};"global"===this.$key&&(Vue.set(s,"numDistinctOwners",_(this.items).map(e=>e.url.replace(/\/[^/]+\/issues\/.*/,"")).uniq().size()),Vue.set(s,"numDistinctRepos",_(this.items).map(e=>e.url.replace(/\/issues\/.*/,"")).uniq().size())),_.isEqual(this._stats,s)||(Vue.set(this,"_stats",_.clone(s)),Math.random()<.25&&r.track("Listed Open Reviews",s))}_fetchPullRequests(e,t,s,r,n){r=r||"xtra";const a=this.$parent.advancedSearchAvailable?this._formAdvancedQueries(t,s):this._formLegacyQueries(t,s);i.dashboard&&console.log("Running bulk GraphQL request:",a.length,"queries");const o=[],l=[];return this._runPullRequestsQueries(e,a,p,o,l).then(()=>{i.dashboard&&console.log("Bulk GraphQL request completed"),this._cancelIfDestroyed();const e=_(o).compact().reject(e=>e.repository.isArchived).map(e=>
1this._convertPullRequest(e,r)).filter(n||_.constant(!0)).value();return Vue.set(e,"incomplete",_.some(a,"incomplete")),Vue.set(e,"warnings",_.uniq(l)),e},e=>(i.dashboard&&console.log("Bulk GraphQL request failed",e),401===e.status?[]:(Vue.set(e,"extra",e.extra||{}),Vue.set(e.extra,"queries",_.map(a,"query")),Promise.reject(e))))}_formLegacyQueries(e,t){const s=202-(t?t.length+1:0);return _(e).flatMap(e=>{const i=_.chunkBy(e,s,e=>e.length+1);return t&&_.forEach(i,e=>e.push(t)),i}).flatMap(e=>{e.push("type:pr");const t="closed:>"+new Date(this.$now-24*this._closedHorizonDays*60*60*1e3).toISOString().replace(/\.\d{3}Z$/,"Z");return[e.concat("state:open"),e.concat("state:closed",t)]}).map((e,t)=>new PullRequestsQuery(e.join(" "),t)).value()}_formAdvancedQueries(e,t){let s=`(${_(e).flatten().join(" OR ")}) AND is:pr`;t&&(s+=` AND ${t}`);return s+=` AND (is:open OR ${"closed:>"+new Date(this.$now-24*this._closedHorizonDays*60*60*1e3).toISOString().replace(/\.\d{3}Z$/,"Z")})`,[new PullRequestsQuery(s,0,!0)]}_runPullRequestsQueries(e,t,s,r,n,{ignoreNotFound:a}={}){const o=[];return this.numQueries+=t.length,Promise.all(_(t).chunk(s).map(t=>e.graph(`\n query (${_.map(t,"parameters").join(", ")}) {\n ${_.map(t,"gqlFragment").join(",\n")}\n }\n `,{variables:_.assign({},..._.map(t,"variables")),allPages:!1,media:"shadow-cat-preview+json",onError:e=>{const t=_(e.errors).reject(e=>a&&"NOT_FOUND"===e.type).map("message").value();return e.status>=500?(o.push(...t),u):(n.push(...t),e.data||null)}}).then(e=>{e||(i.dashboard&&console.log("Rejected nil response to query"),e=u);let s=!1;_.forEach(t,t=>{const i=t.process(e);i&&r.push(...i),t.finished&&(s=!0)}),s&&n.push(...o)})).value()).then(()=>{if((t=_.reject(t,"finished")).length)return i.dashboard&&console.log("Fetching extra page of bulk request:",t.length,"queries"),this._runPullRequestsQueries(e,t,s,r,n)})}_convertPullRequest(e,t){if(!e)return;n("latestOpinionatedReviews");const s=_(_get(e,"latestOpinionatedReviews","nodes")).map(e=>({userKey:`github:${_get(e,"author","databaseId")||c}`,sanction:l[e.state]})).filter("sanction").keyBy("userKey").mapValues("sanction").value(),i=_.pick(e,"title","number","milestone","url");Vue.set(i,"owner",e.repository.owner.login),Vue.set(i,"repo",e.repository.name),Vue.set(i,"key",`${_.toLower(i.owner)}|${_.toLower(i.repo)}|${i.number}`),e.mentionKey&&Vue.set(i,"mentionKey",e.mentionKey),Vue.set(i,"state",_.toLower(e.state)),Vue.set(i,"draft",e.isDraft),Vue.set(i,"private",e.repository.isPrivate),Vue.set(i,"headBranch",e.headRefName),e.repository.defaultBranchRef&&e.baseRefName!==e.repository.defaultBranchRef.name&&Vue.set(i,"baseBranch",e.baseRefName),Vue.set(i,"createdAt",new Date(e.createdAt).getTime()),Vue.set(i,"updatedAt",new Date(e.updatedAt).getTime()),Vue.set(i,"closedAt",new Date(e.closedAt).getTime()),Vue.set(i,"starred",e.repository.viewerHasStarred),Vue.set(i,"watched","SUBSCRIBED"===e.repository.viewerSubscription),Vue.set(i,"author",this._convertUser(e.author,s,{author:!0})),n("assignees"),Vue.set(i,"assignees",_(e.assignees.nodes).map(e=>this._convertUser(e,s,{blocker:!0})).keyBy("$userKey").value()),n("reviewRequests"),Vue.set(i,"requestedReviewers",_(e.reviewRequests.nodes).map("requestedReviewer").filter("login").map(e=>this._convertUser(e,s,{blocker:!0})).keyBy("$userKey").value()),Vue.set(i,"requestedTeams",_(e.reviewRequests.nodes).map("requestedReviewer").filter("combinedSlug").map(e=>this._convertTeam(e)).keyBy("$teamKey").value()),Vue.set(i,"reviewers",_(e.latestOpinionatedReviews.nodes).map("author").filter("login").map(e=>this._convertUser(e,s,{})).keyBy("$userKey").value());const r=this.$store.services.completions.labels;if(n("labels"),Vue.set(i,"labels",_(e.labels.nodes).map(e=>r.convertGitHubLabel(e)).keyBy("name").value()),e.mergeQueueEntry){const t=e.mergeQueueEntry;Vue.set(i,"mergeQueueEntry",{enqueuing:{timestamp:Date.parse(t.enqueuedAt)}}),t.enqueuer&&Vue.set(i.mergeQueueEntry.enqueuing,"user",this._convertUser(t.enqueuer,{},{})),t.estimatedTimeToMerge&&Vue.set(i.mergeQueueEntry,"estimatedMergeTimestamp",this.$n
1ow+1e3*t.estimatedTimeToMerge),t.position&&Vue.set(i.mergeQueueEntry,"position",t.position)}return Vue.set(i,"fetchedCategory",t),i;function n(t){if(_.some(_get(e,t,"nodes"),_.isNil))throw new Error(`Invalid data received from GitHub (${t})`)}}_convertUser(e,s,{author:i,blocker:r}){let n,l;if(e)n={username:e.login,name:e.login,avatarUrl:e.avatarUrl},e.name&&(n.name+=` (${e.name})`),e.databaseId&&(l=Vue.set(n,"$userKey",`github:${e.databaseId}`),Vue.set(n,"avatarClass",`github-${e.databaseId}`));else{const e="https://github.com"===t.gitHubUrl?`https://avatars0.githubusercontent.com/u/${c}?s=460&v=4`:`${t.gitHubUrl}/avatars/u/${c}?s=460&v=4`;n={name:"ghost (Deleted user)",$userKey:`github:${c}`,avatarUrl:e}}Vue.set(n,"scaledAvatarUrl",this.$store.services.avatars.scaleGitHubAvatarUrl(n.avatarUrl)),Vue.set(n,"blocker",r),Vue.set(n,"author",i),Vue.set(n,"bot",e&&(/(\[bot\]|-bot)$/i.test(e.login)||/\(bot\)$/i.test(e.name||"")||a.botUsernameRegex.test(e.login))),Vue.set(n,"sanction",s[l]);const u=i?"Created by":"Waiting on";return i?Vue.set(n,"dashboardIcon","author"):n.sanction&&Vue.set(n,"dashboardIcon",o[n.sanction]),Vue.set(n,"dashboardTooltip",`${u} ${n.name}.`),n}_convertTeam(e){const t={slug:e.combinedSlug,name:e.combinedSlug,avatarUrl:e.avatarUrl,$teamKey:`team:${e.databaseId}`,avatarClass:`team-${e.databaseId}`,dashboardIcon:"team"};return e.name&&(t.name+=` (${e.name})`),Vue.set(t,"scaledAvatarUrl",this.$store.services.avatars.scaleGitHubAvatarUrl(t.avatarUrl)),Vue.set(t,"blocker",!0),Vue.set(t,"dashboardTooltip",`Waiting on ${t.name}.`),t}_cancelIfDestroyed(){if(this.$destroyed)throw new Error("Canceled")}}}},!1,!0,{filename:"src/model/services/pullRequests/services.pullRequests.$listKey.js",modelPath:"/services/pullRequests/$listKey",modelExportName:"PullRequestsList"}),_reviewable.define(["PullRequestsService"],["session","config","debug","corpsman","safeStorage","router"],function(e,t,s,i,r,n){"use strict";return{PullRequestsService:class PullRequestsService{constructor(){Vue.set(this,"advancedSearchAvailable",void 0),Vue.set(this,"refreshFirstList",!1);const a=n.afterChange(e=>{"dashboard-page"===e.pageClass&&Vue.set(this,"refreshFirstList",!0),a()},null);this.$observe(()=>this.$info.userid,e=>{if(!e&&void 0!==e){this.$set(null);try{const e=`reviewable:prlist::${t.firebase}`,i=[];for(const[t]of r.local.entries())_.startsWith(t,e)&&i.push(t);for(const e of i)r.local.removeItem(e,e=>{throw e});s.dashboard&&console.log(`Cleared ${i.length} cached PR lists`)}catch(e){i.capture(e,"clear cached pull request lists")}}}),this.$observe(()=>e.settings.$ready,e=>{e&&this._refreshAll()},{precise:!0}),this.$observe(()=>_get(this,"$info","user","github","scopes"),(e,t)=>{(_.onlyOneContains(e,t,"repo")||_.onlyOneContains(e,t,"read:org"))&&this._refreshAll()}),s.dashboardLegacySearch?Vue.set(this,"advancedSearchAvailable",!1):"https://github.com"===t.gitHubUrl?Vue.set(this,"advancedSearchAvailable",!0):this.$when(()=>!_.isEmpty(this)&&_get(this,"$store","system","gheVersion")).then(()=>{const[e,t]=_(this.$store.system.gheVersion).split(".").map(_.parseInt).value();Vue.set(this,"advancedSearchAvailable",e>3||3===e&&t>=18)}).catch(e=>{i.capture(e,"check if advanced search available"),Vue.set(this,"advancedSearchAvailable",!1)}),setInterval(()=>{_.forEach(this,e=>{e.refresh()})},1e3)}list(e,t){const s=this._makeKey(e,t);this[s]||_ref(this,"child",s).set({state:"invalid"});const i=this[s];return i.acquire(),i}listUrl(e){this[e]||_ref(this,"child",e).set({state:"invalid"});const t=this[e];return t.acquire(),t}_refreshAll(){_.forEach(this,e=>{e.refresh(!0)})}_makeKey(e,t){if(!e)return"global";let s=_.toLower(e);return t&&(s+="/"+_.toLower(t)),s}}}},!1,!0,{filename:"src/model/services/pullRequests/services.pullRequests.js",modelPath:"/services/pullRequests",modelExportName:"PullRequestsService"}),_reviewable.define(["RepositoriesGroup"],["session","config","corpsman","analytics"],function(e,t,s,i){"use strict";const r=36e5;return{RepositoriesGroup:class RepositoriesGroup{constructor(){Vue.set(this,"showAllRepos",!1),Vue.set(this,"autoConnectInProgress",null),Vue.set(this,"autoConnectError",null),Vue.set(this,"subscriptionError",null),Vue.set(this,"subscriptionSettings",{}),Vue.set(this,"subscriptionSettingsChanged",!1),Vue.set(this,"checkingOut",!1),Vue.set(this,"repos",void 0),Vue.set(this,"reposFetching",!1),Vue.set(this,"reposStale",!1),Vue.set(this,"reposFetchError",null),Vue.set(this,"canLoadMoreRepos",!1),Vue.set(this,"reposTruncated",!1),this.$when(()=>"organization"===this.type).then(()=>
1{if(this.$destroyed)return;const e=_get(this,"$info","user","claims","aid");Vue.set(this,"_permissions",[this.$store.services.warden.permissions.acquire({owner:this.$owner,userid:this.$info.userid,agentid:e,level:"own"}),this.$store.services.warden.permissions.acquire({owner:this.$owner,userid:this.$info.userid,agentid:e,level:"member"})])}),Vue.set(this,"_connector",this.$connect(this,{autoConnect:_ref(this.$store,"child","organizations",this.$owner,"autoConnect"),coverage:_ref(this.$store,"child","organizations",this.$owner,"coverage"),lastPrivateCompletionConditionRunTimestamp:_ref(this.$store,"child","organizations",this.$owner,"lastPrivateCompletionConditionRunTimestamp"),prototypeRepository:_ref(this.$store,"child","organizations",this.$owner,"prototypeRepository"),hasMasterRepository:_ref(this.$store,"child","organizations",this.$owner,"masterRepository","hasMasterRepository"),slackWorkspace:_ref(this.$store,"child","organizations",this.$owner,"slackWorkspace","core")})),this.$when(()=>_access(this,"","$store","","services","","warden","","permissions","","get","call",[{owner:this.$owner,userid:this.$info.userid,agentid:_get(this,"$info","user","claims","aid")}],"","verdictAcquired")&&_access(this,"","$store","","services","","warden","","permissions","","get","call",[{userid:this.$info.userid,agentid:_get(this,"$info","user","claims","aid"),userRepo:!0}],"","verdictAcquired")).then(()=>{this.$destroyed||this.$connect(this,{masterRepositoryName:_ref(this.$store,"child","organizations",this.$owner,"masterRepository","name").annotate({ignorePermissionDenied:!0})})}),Vue.set(this,"_subscriptionConnector",null),this.$observe(()=>this.subscriptionAccessible,e=>{this.$destroyed||(e&&!this._subscriptionConnector?Vue.set(this,"_subscriptionConnector",this.$connect(_ref(this.$store,"child","subscriptions",this.coverage.subscriptionKey))):!1===e&&this._subscriptionConnector&&(this._subscriptionConnector.destroy(),Vue.set(this,"_subscriptionConnector",null)))}),this.$observe(()=>this.$store.services.reposManager.fetchScopes,()=>{Vue.set(this,"reposStale",!0)},{deep:!0})}beforeDestroy(){this._permissions&&_.forEach(this._permissions,e=>{e.release()})}get subscriptionAccessible(){if("enterprise"===t.env)return!1;if(_.isBoolean(this.userIsOwner)&&_.isBoolean(this.userIsMember)){if(!this.userIsOwner&&!this.userIsMember)return!1;if(this._connector.at.coverage.ready)return!!_get(this,"coverage","subscriptionKey")&&(this.userIsOwner||_get(this,"coverage","subscriberKey")===this.$info.userid&&this.userIsMember)}}get ready(){return void 0!==this.subscriptionAccessible&&(!this.subscriptionAccessible||_get(this,"_subscriptionConnector","ready"))}get userIsOwner(){return _access(this,"","$store","","services","","warden","","getVerdict","call",[this.$owner],"","own")}get userIsMember(){return _access(this,"","$store","","services","","warden","","getVerdict","call",[this.$owner],"","member")}async fetchRepos(t=!1){if(this.reposFetching)return;Vue.set(this,"reposFetching",!0);const i=`${"organization"===this.type?"org":"user"}:${this.$owner} fork:true sort:updated`;try{let s;do{Vue.set(this,"reposStale",!1),s=await e.hubkit().graph("\n query ($searchQuery: String!, $first: Int!, $after: String) {\n search (query: $searchQuery, type: REPOSITORY, first: $first, after: $after) {\n repositoryCount,\n pageInfo {hasNextPage, endCursor},\n nodes {\n ... on Repository {\n name, isPrivate, isArchived, viewerPermission\n }\n }\n }\n }\n",{variables:{searchQuery:i,first:t?100:50},allPages:t})}while(this.reposStale);Vue.set(this,"repos",_(s.search.nodes).map(e=>[_.toLower(e.name),{name:e.name,private:e.isPrivate,archived:e.isArchived,permissions:{admin:"ADMIN"===e.viewerPermission}}]).sortBy(0).fromPairs().value()),Vue.set(this,"reposFetchError",null);const r=s.search.repositoryCount>_.size(this.repos);Vue.set(this,"canLoadMoreRepos",!t&&r),Vue.set(this,"reposTruncated",t&&r)}catch(e){s.capture(e,"fetchOrgRepos"),Vue.set(this,"reposFetchError",e.toString())}finally{Vue.set(this,"reposFetching",!1)}}get someCanAdmin(){return!!_.some(this.repos,"permissions.admin")||!!this.canLoadMoreRepos&&void 0}get hasNonAdminRepos(){return!_.every(this.repos,"permissions.admin")}get visibleRepositories(){return _.filter(this.repos,e=>e.permissions.admin||this.showAllRepos)}get subscription(){if("enterprise"===t.env)return;const e=_.find(this.$store.subscriptions,{organization:this.$owner});return _get(e,"masterSubscriptionKey")?null:e}get coveredBySubscription(){if("enterprise"!==t.env)return!!_get(this,"coverage","subscriptionKey")||!!_.find(this.$store.subscriptions,{organization:this.$owner})}get viewPastInvoicesAllowed(){if("enterprise"!==t.env)return!(this.coveredBySubscription||!_get(this,"coverage","customerId"))&&(this.userIsOwner||_get(this,"coverage","subscriberKey")===this.$info.userid&&this.userIsMember)}get subscriptionDescription(){let e=_get(this,"subscription","description");if(!e&&this.coveredBySubscription&&(e="Subscription active"),"active"===_get(this,"coverage","trialStatus")){e=(e?`${e},`:"Free")+" Business trial in progress";const t=Math.round((this.coverage.trialEndTimestamp-this.$info.nowAtInterval(r))/864e5);e+=t>0?` (ending in ${t} day${t>=2?"s":""})`:" (ending soon)"}return`${e||"No subscription: reviews in public repositories only"}.`}get promotionDescription(){return _get(this,"subscription","discountDescription")}get _saasOrg(){return"enterprise"!==t.env&&"organization"===this.type}get editSubscriptionAllowed(){return this._saasOrg&&!!this.subscription&&(this.userIsOwner||this.subscription.subscriberKey===this.$info.userid&&this.userIsMember)}get ranPrivateCompletionConditionRecently(){return this.lastPrivateCompletionConditionRunTimestamp>this.$now-2592e6}toggleAutoConnect(){_get(this,"_connector","at","autoConnect","ready")&&!this.autoConnectInProgress&&_access(this,"","$store","","services","","warden","","getVerdict","call",[this.$owner],"","own")&&(_get(this,"autoConnect","connectorKey")?this._connector.at.autoConnect.set(null):Vue.set(this,"autoConnectInProgress",this.$store.services.auth.login(["admin:org_hook","admin:repo_hook","repo"]).then(()=>(Vue.set(this,"autoConnectError",null),this.$store.queues.requests.send({action:"backfillConnections",ownerName:this.$owner}))).catch(e=>{s.capture(e,"toggleAutoConnect"),Vue.set(this,"autoConnectError",e.toString())}).finally(()=>{Vue.set(this,"autoConnectInProgress",null)})))}async checkout(e,t){Vue.set(this,"subscriptionError",null),Vue.set(this,"checkingOut",!0),i.track("Checking out",{priceId:e,quantity:t,organization:this.login});try{Vue.set(document,"location",await this.$store.queues.requests.send({action:"checkout",priceId:e,quantity:t,ownerName:this.login}))}catch(e){Vue.set(this,"subscriptionError",e.message),Vue.set(this,"checkingOut",!1)}}saveSubscriptionSettings(){const{contributorTeamId:e,extraOrganizations:t,subscriberKey:s}=this.subscriptionSettings;return Vue.set(this,"subscriptionError",null),this.$store.queues.requests.send({action:"updateSubscriptionSettings",ownerName:this.login,contributorTeamId:_.parseInt(e)||null,extraOrganizations:_.compact(_.trim(t).split(/\s*,\s*/)),subscriberKey:s||null}).then(()=>{Vue.set(this,"subscriptionSettingsChanged",!1)},e=>{Vue.set(this,"subscriptionError",e.message)})}}}},!1,!0,{filename:"src/model/services/reposManager/services.reposManager.$owner.js",modelPath:"/services/reposManager/$owner",modelExportName:"RepositoriesGroup"}),_reviewable.define(["ListedRepository"],["corpsman"],function(e){"use strict";return{ListedRepository:class ListedRepository{static get $trussMount(){return{path:"/services/reposManager/$owner/repositories/$repo",placeholder:null}}constructor(){Vue.set(this,"connecting",!1),Vue.set(this,"error",null);const e=_ref(this.$store,"child","repositories",this.$owner,this.$repo).annotate({userRepo:!0});Vue.set(this,"_connector",this.$connect(this,{core:_ref(e,"child","core"),openPullRequestsCount:_ref(e,"child","current","openPullRequestsCount")}
1))}get ready(){return _get(this,"_connector","at","core","ready")}get disabled(){return"disabled"===_get(this,"core","connection")}get isConnected(){const e=_get(this,"core","connection");return"active"===e||"broken"===e||this.connecting}async toggleConnection(t){Vue.set(this,"connecting",!0);try{await this.$store.repositories.toggleConnection(this.$owner,this.$repo,t,"active"!==_get(this,"core","connection")&&"broken"!==_get(this,"core","connection")),Vue.set(this,"error",null)}catch(t){e.capture(t,"toggleConnection"),Vue.set(this,"error",t.toString())}finally{Vue.set(this,"connecting",!1)}}}}},!1,!0,{filename:"src/model/services/reposManager/services.reposManager.$owner.repositories.$repo.js",modelPath:"/services/reposManager/$owner/repositories/$repo",modelExportName:"ListedRepository"}),_reviewable.define(["ListedRepositorySettings"],["encrypt","session","corpsman","analytics","config","bus","CompletionConditionContext","shared"],function(e,t,s,i,r,n,a,o){"use strict";const l={reviewableBadge:"pullRequest",badgePullRequestLocation:"bottom",revisionSplitStrategy:"combinedCommits",lgtmText:":lgtm:",discussionDismissalRestriction:"push",gitHubStatusUpdates:"accessed"};return{ListedRepositorySettings:class ListedRepositorySettings extends a{static get $trussMount(){return{path:"/services/reposManager/$owner/repositories/$repo/settings",placeholder:null}}constructor(){super(),Vue.set(this,"owner",this.$parent.$parent.$parent),Vue.set(this,"_loaded",!1),Vue.set(this,"_private",void 0),Vue.set(this,"_settingsFileExists",void 0),Vue.set(this,"current",null),Vue.set(this,"_original",null),Vue.set(this,"_originalConditionCode",null),Vue.set(this,"conditionExample",null),Vue.set(this,"commentBadgeUsername",null),Vue.set(this,"loadError",null),Vue.set(this,"saveError",null),Vue.set(this,"saving",!1),Vue.set(this,"_ruleConnector",null);const e=_ref(this.$store,"child","repositories",this.$owner,this.$repo).annotate({userRepo:!0});Vue.set(this,"_coreConnector",this.$connect(this,{core:_ref(e,"child","core")})),t.hubkit().graph('\n query ($owner: String!, $repo: String!) {\n repository (owner: $owner, name: $repo) {\n isPrivate,\n defaultBranchRef {\n target {\n ... on Commit {\n file(path: "/.reviewable/") {oid}\n }\n }\n }\n }\n }\n',{variables:{owner:this.$owner,repo:this.$repo},onError:e=>{if(404===e.status&&_get(e,"data","repository"))return e.data}}).then(e=>{if(!this.$destroyed)return Vue.set(this,"_private",e.repository.isPrivate),Vue.set(this,"_settingsFileExists",!!_get(e,"repository","defaultBranchRef","target","file")),Promise.all([this._connectRule(),this._loadSettings()])}).then(()=>{Vue.set(this,"_loaded",!0)}).catch(e=>{this.$destroyed||(s.capture(e,"repoSettings.load"),Vue.set(this,"loadError",e.toString()))})}_loadSettings(){const e=_ref(this.$store,"child","repositories",this.$owner,this.$repo,"core").annotate({userRepo:!0});return e.peek(e=>{if(!e)return this.$store.queues.requests.send({action:"initRepoSettings",ownerName:this.$owner,repoName:this.$repo})}).then(()=>_ref(e,"child","settings").peek(e=>{if(Vue.set(this,"current",_.defaultsDeep({},_.cloneDeep(e),l)),Vue.set(this,"_original",_.cloneDeep(this.current)),_get(this,"current","coverage","headers")&&(this.areCodeCoverageFetchHeadersAllowed()?Vue.set(this.current.coverage,"headers",_.mapValues(_get(this,"current","coverage","headers"),_.constant("********"))):Vue.delete(this.current.coverage,"headers")),"organization"===this.owner.type&&this.current.commentBadgeUserKey)return t.hubkit().request("GET /user/:id",{id:this.current.commentBadgeUserKey.replace(/^github:/,"")}).then(e=>{e?Vue.set(this,"commentBadgeUsername",e.login):Vue.set(this.current,"commentBadgeUserKey",null)});Vue.delete(this.current,"commentBadgeUserKey")}))}get reviewableBadgeNoneAllowed(){return"enterprise"===r.env||this._private||this.owner.coveredBySubscription||_get(this,"owner","coverage","trialEndTimestamp")>this.$now}get badgeConditionAllowed(){return this.reviewableBadgeNoneAllowed&&"none"!==_get(this,"current","reviewableBadge")}areCodeCoverageFetchHeadersAllowed(){return"enterprise"===r.env||this._private}_initConditionCode(){return _ref(this.$store,"child","rules",this.$owner,this.$repo,"reviewCompletion").annotate({userRepo:!0}).peek(e=>{this.active&&Vue.set(this,"_originalConditionCode",Vue.set(this,"conditionCode",e||""))})}_connectRule(){const e=_ref(this.$store,"child","rules",this.$owner,this.$repo);return Vue.set(this,"_ruleConnector",this.$connect(this,{_rule:e})),this.$when(()=>this._ruleConnector.ready)}
1get dependencies(){if(_get(this,"_ruleConnector","ready"))return this._parsedDependencies||_get(this,"_rule","reviewCompletionDependencies")||(_get(this,"_rule","reviewCompletion")?"lodash3":"lodash4")}get settingsFileEffective(){if(void 0!==this._settingsFileExists&&this._coreConnector.at.core.ready)return this._settingsFileExists&&"active"===_get(this,"core","connection")}get ready(){return this._loaded&&void 0!==this.settingsFileEffective&&this.owner._connector.at.hasMasterRepository.ready}get settingsFileSource(){if(_.toLower(this.owner.masterRepositoryName)===this.$repo)return"the master repository (this repository)";const e=[];return this.settingsFileEffective&&e.push("this repository"),this.owner.hasMasterRepository&&e.push("the master repository"+(this.owner.masterRepositoryName?` (<strong>${this.owner.masterRepositoryName}</strong>)`:"")),_.join(e," and ")}get settingsFileUrl(){const e=["# Reviewable settings file. Read the docs at https://docs.reviewable.io/admincenter#file-based-settings"],t=_.mapValues(this.current,(e,t)=>l[t]===e?void 0:e);if(t.reviewableBadge||t.badgeCondition){if(e.push("badge:"),t.reviewableBadge){const s="pullRequest"===t.reviewableBadge?`description-${t.badgePullRequestLocation}`:t.reviewableBadge;e.push(` location: ${s}`)}this.commentBadgeUsername&&e.push(` commenter: ${this.commentBadgeUsername}`),t.badgeCondition&&e.push(` when: ${t.badgeCondition}`)}return t.revisionSplitStrategy&&e.push(`default-review-style: ${_.kebabCase(t.revisionSplitStrategy)}`),t.reviewOverlapStrategy&&e.push(`default-review-overlap-strategy: ${_.kebabCase(t.reviewOverlapStrategy)}`),t.lgtmText&&e.push(`approval-text: ${JSON.stringify(t.lgtmText)}`),t.discussionDismissalRestriction&&e.push(`discussion-dismissal-restriction: ${t.discussionDismissalRestriction}`),t.gitHubStatusUpdates&&(e.push("github-status:"),e.push(` updates: ${t.gitHubStatusUpdates}`)),(_get(t,"coverage","urlTemplate")||_get(t,"coverage","headers"))&&(e.push("coverage:"),t.coverage.urlTemplate&&e.push(` url: ${JSON.stringify(t.coverage.urlTemplate)}`),t.coverage.headers&&(r.publicKey?e.push(" # WARNING: The UI managed settings this settings file was generated from had",' # custom headers configured. You\'ll need to add these manually in a "headers:"',` # object here after encrypting the values at ${r.hostUrl}/encrypt.`):(e.push(" headers:"),_.forEach(t.coverage.headers,(t,s)=>{e.push(` ${JSON.stringify(s)}: ${JSON.stringify(t)}`)})))),e.push(""),`data:application/yaml;charset=utf-8,${encodeURIComponent(_.join(e,"\n"))}`}get conditionFileUrl(){const e=_.join([`// Test this completion condition in the playground: ${r.hostUrl}/playground`,...this._parsedDependencies?[]:[`// dependencies: ${this.dependencies}`],this.conditionCode],"\n\n");return`data:text/javascript;charset=utf-8,${encodeURIComponent(e)}`}get completionConditionRequiresUpgrade(){return this._private&&!1===_access(this,"","owner","","coverage","","canUseFeature","call",["completionCondition"])}save(){if(!this._loaded||!this.completionInitialized||this.saving)return Promise.reject(new Error("Not ready to save settings."));n.flush(),Vue.set(this,"saveError",null);const a=[],l=this._originalConditionCode!==this.conditionCode,c=this._original.gitHubStatusUpdates!==this.current.gitHubStatusUpdates,u=""===_.trim(this.conditionCode)?null:this.conditionCode,d=_.clone(this.current);if("pullRequest"===d.reviewableBadge&&Vue.set(d,"reviewableBadge",null),"bottom"===d.badgePullRequestLocation&&Vue.set(d,"badgePullRequestLocation",null),d.badgeCondition&&"none"!==d.reviewableBadge||Vue.set(d,"badgeCondition",null),Vue.delete(d,"commentBadgeUserKey"),"combinedCommits"===d.revisionSplitStrategy&&Vue.set(d,"revisionSplitStrategy",null),d.lgtmText&&":lgtm:"!==d.lgtmText||Vue.set(d,"lgtmText",null),"push"===d.discussionDismissalRestriction&&Vue.set(d,"discussionDismissalRestriction",null),"accessed"===d.gitHubStatusUpdates&&Vue.set(d,"gitHubStatusUpdates",null),_get(d,"coverage","urlTemplate")||Vue.set(d,"coverage",null),_get(d,"coverage","headers")&&!this.areCodeCoverageFetchHeadersAllowed()&&Vue.set(d.coverage,"headers",null),a.push(Prom
1ise.all(_.map(_get(d,"coverage","headers"),(t,s)=>{if("********"===t){const e=_access(_,"","values","call",[_get(this,"_original","coverage","headers")],"",0);e?Vue.set(d.coverage.headers,s,e):Vue.delete(d.coverage.headers,s)}else{if(t&&r.publicKey)return e(t).then(e=>{Vue.set(d.coverage.headers,s,e)});t?Vue.set(d.coverage.headers,s,t):Vue.delete(d.coverage.headers,s)}})).then(()=>{d.coverage&&_.isEmpty(_get(d,"coverage","headers"))&&Vue.set(d.coverage,"headers",null)})),d.mergeFlavors&&Vue.set(d,"mergeFlavors",_.mapValues(d.mergeFlavors,e=>e?null:e)),"organization"===this.owner.type&&this.commentBadgeUsername&&"comment"===d.reviewableBadge){const e=t.hubkit(),s=this.commentBadgeUsername;a.push(Promise.all([e.request("/users/:username",{username:s,ifNotFound:null}),e.request("/orgs/:org/members/:username",{org:this.$owner,username:s,boolean:!0,ifNotFound:!1,onError:e=>{if(401===e.status)return!1}})]).then(([e,t])=>{if(!e)return Promise.reject(new Error(`User ${s} not found.`));if(!t)return Promise.reject(new Error(`Unable to verify that user ${s} is a member of ${this.$owner}; you may need to make the membership public.`));const i=`github:${e.id}`;return _ref(this.$store,"child","users",i,"core","public").peek(e=>{if(!e)return Promise.reject(new Error(`User ${this.commentBadgeUsername} has not signed in to Reviewable.`));Vue.set(d,"commentBadgeUserKey",i)})}))}return Vue.set(this,"saving",!0),Promise.all(a).then(()=>{const e={},t=[],s=_ref(this.$store,"child","rules",this.$owner),r=_ref(this.$store,"child","repositories",this.$owner);if(Vue.set(e,_ref(r,"child",this.$repo,"core","settings"),d),l){const t=/^\/\/ inputs:/m.test(u)?_access(u,"","match","call",[/^\/\/ inputs: (.*)$/m],"",1):_(o.completionConditionInputFlags).filter(e=>"-"===e[0]).reject(e=>new RegExp(`\\b${_.escapeRegExp(_(e).split(".").last())}\\b`).test(u)).join(" ");Vue.set(e,_ref(s,"child",this.$repo,"reviewCompletionInputs"),t||null),Vue.set(e,_ref(s,"child",this.$repo,"reviewCompletionDependencies"),this.dependencies),Vue.set(e,_ref(s,"child",this.$repo,"reviewCompletion"),u)}if(l||c&&"never"!==d.gitHubStatusUpdates){const s=this.$newKey();Vue.set(e,_ref(this.$store,"child","queues","requests",s),{action:"reconcile",userKey:this.$info.userid,ownerName:this.$owner,repoName:this.$repo}
1),t.push(this.$store.queues.responses.receive(s,15e3,"reconcile"))}return t.push(this.$store.$ref.update(e)),i.track("Customized review completion",{owner:this.$owner,repo:this.$repo}),Promise.all(t)}).catch(e=>{s.capture(e,"repoSettings.save"),Vue.set(this,"saveError",e.toString())}).finally(()=>{Vue.set(this,"saving",!1)})}}}},!1,!0,{filename:"src/model/services/reposManager/services.reposManager.$owner.repositories.$repo.settings.js",modelPath:"/services/reposManager/$owner/repositories/$repo/settings",modelExportName:"ListedRepositorySettings"}),_reviewable.define(["OwnerRepositories"],[],function(){"use strict";return{OwnerRepositories:class OwnerRepositories{static get $trussMount(){return{path:"/services/reposManager/$owner/repositories",keysUnsafe:!0}}}}},!1,!0,{filename:"src/model/services/reposManager/services.reposManager.$owner.repositories.js",modelPath:"/services/reposManager/$owner/repositories",modelExportName:"OwnerRepositories"}),_reviewable.define(["ReposManager"],["router","session","config","corpsman","analytics"],function(e,t,s,i,r){"use strict";return{ReposManager:class ReposManager{static get $trussMount(){return{path:"/services/reposManager",keysUnsafe:!0}}constructor(){Vue.set(this,"_active",!1),Vue.set(this,"_fetchSerial",0),Vue.set(this,"ready",!1),Vue.set(this,"fetchError",void 0),Vue.set(this,"fetchScopes",void 0),Vue.set(this,"_fetchUser",void 0),Vue.set(this,"_connector",void 0),Vue.set(this,"_permissions",void 0)}activate(){this._active||(Vue.set(this,"_active",!0),Vue.set(this,"_connector",this.$connect(this,{enrollments:()=>_ref(this.$store,"child","users","current","enrollments"),enterpriseLicenseAdmin:()=>_ref(this.$store,"child","users","current","enterpriseLicenseAdmin")})),"enterprise"===s.env&&(this.$when(()=>this.$info.userid||!this._active).then(()=>{this._active&&Vue.set(this,"_permissions",[this.$store.services.warden.permissions.acquire({userid:this.$info.userid,agentid:_get(this,"$info","user","claims","aid"),level:"siteAdmin"})])}),this.$when(()=>this.enterpriseLicenseAdmin||this.isSiteAdmin||!this._active).then(()=>{this._active&&!("subscriptions"in this)&&this.$connect(this,{subscriptions:_ref(this.$store,"child","subscriptions")})})),this.refresh())}deactivate(){this._active&&(Vue.set(this,"_active",!1),this._connector.destroy(),Vue.set(this,"_connector",null),Vue.set(this,"ready",!1),Vue.set(this,"fetchError",null),this._permissions&&_.forEach(this._permissions,e=>{e.release()}),Vue.set(this,"_permissions",void 0),this.$set(null))}get isSiteAdmin(){return _access(this,"","$store","","services","","warden","","getVerdict","call",["!"],"","siteAdmin")}refresh(){if(void 0===this.$info.user)return;Vue.set(this,"_fetchUser",this.$info.user),Vue.set(this,"fetchScopes",this._getFetchScopes());const s=++this._fetchSerial;this.$info.user?this._active&&Promise.all([this._fetchGroupedRepositories(),this._fetchOrganizations()]).then(()=>{this._active&&s===this._fetchSerial&&(Vue.set(this,"ready",!0),Vue.set(this,"fetchError",null),r.time("list"),e.hash||r.recordTimings({subscriptionLink:!1}),r.track("Listed Repositories",{numOwners:_.size(this.$data),includesPrivate:t.hasScope("repo")}))}).catch(e=>{i.capture(e,"refresh repositories list"),this._active&&s===this._fetchSerial&&(Vue.set(this,"ready",!0),Vue.set(this,"fetchError",e.toString()))}):this.$set(null)}_getFetchScopes(){return _(_get(this,"$info","user","github","scopes")).intersection(["public_repo","repo","read:org"]).sortBy().value()}get list(){let e=_.toArray(this.$data);return s.coveredRepoClasses&&!_.find(s.coveredRepoClasses,{organization:"*"})&&(e=_.filter(e,e=>_.find(s.coveredRepoClasses,{organization:_.toLower(e.login)}))),e=_.orderBy(e,["type",e=>_.toLower(e.login)],["desc","asc"]),e}get _refreshWhenRelevantScopesChanged(){(this.$info.user!==this._fetchUser||this._active&&!_.isEqual(this.fetchScopes,this._getFetchScopes()))&&this.refresh()}_fetchGroupedRepositories(){return t.user?t.hubkit().graph("\n query ($after: String) {\n viewer {\n repositories (affiliations: [COLLABORATOR], first: 100, after: $after) {\n pageInfo {hasNextPage, endCursor},\n nodes {\n owner {__typename, login, avatarUrl}\n }\n }\n }\n }\n").then(e=>{if(!this._active||!t.user)return;const s=e.viewer.repositories.nodes;s.length&&Sentry.captureMessage("Fetched collaborator repos",{level:"debug",extra:{count:s.length}}),_(s).map("owner").reject({__typename:"User"}
1).uniqBy("login").forEach(e=>{_ref(this,"child",_.toLower(e.login)).update({login:e.login,type:"organization",avatarUrl:this.$store.services.avatars.scaleGitHubAvatarUrl(e.avatarUrl)})})}):Promise.resolve()}_fetchOrganizations(){const e=t.user;if(!e)return Promise.resolve();const s=e.github.username,i=e.github.id;return this.$store.services.gitHubCache.refreshUserOrganizations().catch(e=>{if(403===e.status||404===e.status)return[];throw e}).then(r=>{if(this._active&&t.user===e)return _ref(this,"child",_.toLower(s)).update({login:s,type:"person"}),_.forEach(r,e=>{_ref(this,"child",_.toLower(e.login)).update({login:e.login,type:"organization",avatarUrl:this.$store.services.avatars.scaleGitHubAvatarUrl(e.avatarUrl)})}),t.hubkit().request("GET /user/:userid",{userid:i,fresh:!1})}).then(i=>{i&&this._active&&t.user===e&&_ref(this,"child",_.toLower(s),"avatarUrl").set(this.$store.services.avatars.scaleGitHubAvatarUrl(i.avatar_url))})}}}},!1,!0,{filename:"src/model/services/reposManager/services.reposManager.js",modelPath:"/services/reposManager",modelExportName:"ReposManager"}),_reviewable.define(["CodeCoverage"],["config","corpsman","mangler"],function(e,t,s){"use strict";return{CodeCoverage:class CodeCoverage{constructor(){Vue.set(this,"context",this.$parent),Vue.set(this,"_coverages",{}),Vue.set(this,"reporting",void 0)}load(i){if(this._coverages[i])return this._coverages[i];const r=this.context.owner,n=this.context.repo,a=this.context.pullRequestNumber;let o,l="error",c=!1;const u=_ref(this.$store,"child","repositories",r,n,"core","settings","coverage");return Vue.set(this._coverages,i,u.peek().then(l=>{if(Vue.set(this,"reporting",!0),!_get(l,"urlTemplate"))return void Vue.set(this,"reporting",!1);if(this.$destroyed)return;const u={owner:r,repo:n,pr:a,commitSha:i};let d;try{d=s.renderUserTemplate(l.urlTemplate,u)}catch(e){return t.markHandled(e),void(o=`Failed to evaluate URL template: ${e.message}`)}return this.$when(()=>!l.headers||"enterprise"===e.env||this.context.repository).then(t=>l.headers&&("enterprise"===e.env||t.private)?this.$when(()=>this.$store.services.warden.getSecret(r,n)).then(t=>{const s=new URL("/coverage",e.authHostUrl);return Vue.set(s,"search",new URLSearchParams({owner:r,repo:n,pr:a,userKey:this.$info.userid,secret:t,commitSha:i})),fetch(s)}).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.text()}).then(e=>({data:e})):(c=!!l.headers,fetch(d).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.text()}).then(e=>({data:e}))))}).then(e=>{if(!this.$destroyed)try{if(e)return this._processCoverageResponse(e)}catch(e){return Promise.reject(e)}},e=>{t.markHandled(e),o=`Failed to fetch coverage data${c?" (ignored headers in public repo)":""}: ${e.message}`}).catch(e=>{t.markHandled(e),o=`Failed to process coverage report: ${e.message}`,e.level&&(l=e.level)}).then(e=>{if(!this.$destroyed&&this.context.review)return o&&(e=_.mapValues(_get(this,"context","review","files"),_.constant({error:o,errorLevel:l})),Vue.delete(this._coverages,i)),e}))}_processCoverageResponse(e){if(this.$destroyed)return;let t=e.data;if(_.isString(t)&&(t=JSON.parse(t)),!t)throw new Error("No data received");if(t.error){const e=new Error(""+t.error);throw t.level&&Vue.set(e,"level",t.level),e}const s=this._parseCodecovV1(t)||this._parseCodecovV2(t);if(!s)throw new Error("Unsupported coverage JSON structure");return s}_parseCodecovV1(e){if(!(e=e.coverage||_get(e,"commit","report","files")))return;const t=_get(this,"context","review","files","byPath"),s={};return _.forEach(e,(e,i)=>{e.l&&(e=e.l);let r=0,n=0,a=0,o=0;e=_.mapValues(e,e=>{if(0===e)return n++,o++,"none";if(_.isNumber(e)&&e>0)return r++,n++,a++,o++,"full";const t=_.isString(e)&&e.match(/^(\d+)\/(\d+)$/);if(t){const e=_.parseInt(t[1]),s=_.parseInt(t[2]);return e&&r++,n++,a+=e,o+=s,e?e===s?"full":"partial":"none"}return null});const l=_get(t,i);l&&Vue.set(s,l.$key,{lines:e,linePercentage:r/n,branchPercentage:a/o})}),s}_parseCodecovV2(e){const t=e.report.files;if(!t)return;const s=_get(this,"context","review","files","byPath"),i={};return _.forEach(t,e=>{const t=s[e.name];if(!t)return;const r={};let n=0,a=0,o=0,l=0;_.forEach(e.line_coverage,([e,t])=>
1{if(null===t)return;let s;switch(t){case 0:s="full",n++,a++,o++,l++;break;case 1:s="none",a++,l++;break;case 2:s="partial",n++,a++,o++,l+=2;break;default:throw new Error(`Unexpected coverage record: [${e}, ${t}]`)}Vue.set(r,`${e}`,s)}),Vue.set(i,t.$key,{lines:r,linePercentage:n/a,branchPercentage:o/l})}),i}}}},!1,!0,{filename:"src/model/services/reviewContext/services.reviewContext.$pageKey.codeCoverage.js",modelPath:"/services/reviewContext/$pageKey/codeCoverage",modelExportName:"CodeCoverage"}),_reviewable.define(["DiscussionSummaries"],["corpsman","mangler"],function(e,t){"use strict";return{DiscussionSummaries:class DiscussionSummaries{constructor(){Vue.set(this,"context",this.$parent),Vue.set(this,"_activeTask",null),Vue.set(this,"_failedTaskKeys",Object.create(null)),Vue.set(this,"_failedTaskKeysQueue",[]),Vue.set(this,"_debouncedStarterDrafts",Object.create(null)),Vue.set(this,"_pendingStarterDrafts",Object.create(null)),Vue.set(this,"_averageSummarizationDuration",0),Vue.set(this,"_publishWaitCount",0),Vue.set(this,"_starterDraftQueueDebouncers",Object.create(null)),Vue.set(this,"_throttleBlockedUntil",0),Vue.set(this,"_throttleTimeoutHandle",null),Vue.set(this,"_recoveredStarterDraftQueue",!1)}get review(){return this.context.review}get naturalLanguage(){return this.$store.services.naturalLanguage}get queueEnabled(){return!(!this.$info.userid||!_get(this,"review","stateReady"))}get runningEnabled(){return!!(this.queueEnabled&&_get(this,"context","verdict","pull")&&this.naturalLanguage.ready)}get activeDiscussionKey(){return _get(this,"_activeTask","parleyKey")}get _summarizeNextSubject(){this._recoverStarterDraftQueue(),!this.runningEnabled||this._activeTask||this.$destroyed||this._shouldThrottle()||(Vue.set(this,"_activeTask",this._selectNextTask()),this._runActiveTask())}queueStarterDraft(e,t,s=e.summaryInputHash){if(!(this.$info.userid&&t&&this.review&&this._starterDraftNeedsSummaryForHash(e,t)))return this.discardStarterDraft(e.$key);const i=this._draftTaskKey(e.$key,s);if(this._hasFailedTaskKey(i))return this.discardStarterDraft(e.$key);const r=this._debouncedStarterDrafts[e.$key]||this._pendingStarterDrafts[e.$key];if(this._activeTask&&this._activeTask.key===i)return;if(r&&r.key===i)return;const n=r?r.queuedAt:Date.now();Vue.delete(this._pendingStarterDrafts,e.$key),Vue.set(this._debouncedStarterDrafts,e.$key,{type:"draft",parleyKey:e.$key,bodyHash:t,summaryInputHash:s,key:i,queuedAt:n}),this._debounceStarterDraft(e.$key)}async waitForStarterDraftSummaries(e,t=5e3){if(!this.queueEnabled)return{numDrafts:0,timedOut:!1};_.forEach(e,e=>{this._flushStarterDraftDebounce(e.$key)});const s=_(e).map("$key").filter(e=>this._shouldWaitForStarterDraftSummary(_get(this,"review","state","drafts",e))).value(
1);if(!s.length)return{numDrafts:0,timedOut:!1};this._publishWaitCount++;try{return await this.$when(()=>_.every(s,e=>!this._shouldWaitForStarterDraftSummary(_get(this,"review","state","drafts",e))),{timeout:t}),{numDrafts:s.length,timedOut:!1}}catch(e){if("Timeout"===e.message||"Canceled"===e.message)return{numDrafts:s.length,timedOut:"Timeout"===e.message};throw e}finally{this._publishWaitCount--}}_debounceStarterDraft(e){let t=this._starterDraftQueueDebouncers[e];t||(t=Vue.set(this._starterDraftQueueDebouncers,e,_.debounce(()=>this._enqueueStarterDraft(e),5e3))),t()}_enqueueStarterDraft(e){if(Vue.delete(this._starterDraftQueueDebouncers,e),this.$destroyed)return void Vue.delete(this._debouncedStarterDrafts,e);const t=this._debouncedStarterDrafts[e];t&&(Vue.set(this._pendingStarterDrafts,e,t),Vue.delete(this._debouncedStarterDrafts,e))}_flushStarterDraftDebounce(e){const t=this._starterDraftQueueDebouncers[e];t&&t.flush()}discardStarterDraft(e){const t=this._starterDraftQueueDebouncers[e];t&&(t.cancel(),Vue.delete(this._starterDraftQueueDebouncers,e)),Vue.delete(this._debouncedStarterDrafts,e),Vue.delete(this._pendingStarterDrafts,e)}_recoverStarterDraftQueue(){this.queueEnabled&&!this._recoveredStarterDraftQueue&&(Vue.set(this,"_recoveredStarterDraftQueue",!0),_.forEach(_get(this,"review","state","drafts"),e=>{const t=_get(e,"bodyHash");if(!t||!this._starterDraftNeedsSummaryForHash(e,t))return;const s=e.summaryInputHash,i=this._draftTaskKey(e.$key,s);this._hasFailedTaskKey(i)||this._pendingStarterDrafts[e.$key]||Vue.set(this._pe
1ndingStarterDrafts,e.$key,{type:"draft",parleyKey:e.$key,bodyHash:t,summaryInputHash:s,key:i,queuedAt:_get(e,"timestamp")||Date.now()})}))}async _runActiveTask(){const t=this._activeTask;if(t)try{switch(t.type){case"draft":await this._runDraftTask(t);break;case"discussion":await this._runDiscussionTask(t);break;default:throw new Error(`Unknown discussion summaries task type: ${t.type}`)}}catch(s){"Canceled"===_get(s,"message")||this.$destroyed||(this._rememberFailedTaskKey(t.key),e.capture(s,`summarize ${t.type}`))}finally{this._activeTask===t&&Vue.set(this,"_activeTask",null)}}_rememberFailedTaskKey(e){this._failedTaskKeys[e]||(Vue.set(this._failedTaskKeys,e,!0),this._failedTaskKeysQueue.push(e),this._failedTaskKeysQueue.length>1e3&&Vue.delete(this._failedTaskKeys,this._failedTaskKeysQueue.shift()))}_hasFailedTaskKey(e){return!!this._failedTaskKeys[e]}_selectNextTask(){let e,t;return _.forEach(this._pendingStarterDrafts,t=>{const s=_get(this,"review","state","drafts",t.parleyKey);this._starterDraftNeedsSummaryForHash(s,t.bodyHash)&&s.summaryInputHash===t.summaryInputHash?this._hasFailedTaskKey(t.key)?Vue.delete(this._pendingStarterDrafts,t.parleyKey):e&&e.queuedAt<=t.queuedAt||(e=t):Vue.delete(this._pendingStarterDrafts,t.parleyKey)}),e?(Vue.delete(this._pendingStarterDrafts,e.parleyKey),e):(_.forEach(_get(this,"review","discussions"),e=>{if(!e||"-top"===e.$key)return;const s=_get(e,"comments","list",0);if(!s||!this._discussionNeedsSummary(e,s))return;const i={type:"discussion",parleyKey:e.$key,commentKey:s.$key,key:this._discussionTaskKey(e.$key,s.$key),priority:this._discussionPriority(e.$key)};this._hasFailedTaskKey(i.key)||t&&t.priority<=i.priority||(t=i)}),t)}async _runDraftTask(e){const t=_get(this,"review","state","drafts",e.parleyKey);if(!t||t.bodyHash!==e.bodyHash||t.summaryInputHash!==e.summaryInputHash||!this._starterDraftNeedsSummaryForHash(t,e.bodyHash))return;const s=await this._summarizeSubject(t),i=_get(this,"review","state","drafts",e.parleyKey);i&&i.bodyHash===e.bodyHash&&i.summaryInputHash===e.summaryInputHash&&this._starterDraftNeedsSummaryForHash(i,e.bodyHash)&&await _ref(i,"child","summaryHtmlBodies",e.bodyHash).set(s)}async _runDiscussionTask(e){const t=_get(this,"review","discussions",e.parleyKey),s=t&&_get(t,"comments",e.commentKey);if(!(t&&s&&this._discussionNeedsSummary(t,s)))return;const i=await this._summarizeSubject(s),r=_get(this,"review","discussions",e.parleyKey),n=r&&_get(r,"comments",e.commentKey);r&&n&&this._discussionNeedsSummary(r,n)&&await _ref(r,"child","summary").commit(t=>{t.currentValue?t.abort():t.set({html:i,summarizerUserKey:this.$info.userid,commentKey:e.commentKey})})}async _summarizeSubject(e){const t=Date.now();try{return await this.naturalLanguage.summarize(e)}finally{this._recordSummarizationDuration(Date.now()-t)}}_recordSummarizationDuration(e){Vue.set(this,"_averageSummarizationDuration",this._averageSummarizationDuration?.5*e+.5*this._averageSummarizationDuration:e);const t=Math.round(1*this._averageSummarizationDuration);t?(Vue.set(this,"_throttleBlockedUntil",Date.now()+t),this._scheduleThrottleRelease()):this._clearThrottle()}_shouldThrottle(){return!(this._publishWaitCount||!this._throttleBlockedUntil)&&(!(Date.now()>=this._throttleBlockedUntil)||(this._clearThrottle(),!1))}_scheduleThrottleRelease(){this._throttleTimeoutHandle&&clearTimeout(this._throttleTimeoutHandle);const e=this._throttleBlockedUntil-Date.now();e<=0?this._clearThrottle():Vue.set(this,"_throttleTimeoutHandle",setTimeout(()=>{this._clearThrottle()},e))}_clearThrottle(){this._throttleTimeoutHandle&&(clearTimeout(this._throttleTimeoutHandle),Vue.set(this,"_throttleTimeoutHandle",null)),Vue.set(this,"_throttleBlockedUntil",0)}_starterDraftNeedsSummary(e){return!!e&&this._starterDraftNeedsSummaryForHash(e,e.bodyHash)}_shouldWaitForStarterDraftSummary(e){if(!e)return!1;const t=_get(e,"bodyHash");if(!this._starterDraftNeedsSummaryForHash(e,t))return!1;const s=this._draftTaskKey(e.$key,e.summaryInputHash);if(!this.runningEnabled||this._hasFailedTaskKey(s))return!1;if(this._activeTask&&this._activeTask.key===s)return!0;
1const i=this._pendingStarterDrafts[e.$key];return!(!i||i.key!==s)}_starterDraftNeedsSummaryForHash(e,t){return this._isStarterDraftCandidate(e,t)&&!this._hasDraftSummary(e,t)}_isStarterDraftCandidate(e,t){return!(!e||!t)&&("-top"!==e.$key&&"-cmd"!==e.$key&&(!_get(this,"review","discussions",e.$key)&&this.naturalLanguage.needsSummary(e)))}_hasDraftSummary(e,t){return!!(e&&t&&_get(e,"summaryHtmlBodies",t))}_discussionNeedsSummary(e,t){return!(!e||"-top"===e.$key||e.summary)&&(!(!t||!this.naturalLanguage.needsSummary(t))&&this._canWriteDiscussionSummary(e,t))}_canWriteDiscussionSummary(e,t){if(_get(this,"context","verdict","push"))return!0;const s=e.tracker;return _get(this,"context","verdict","pull")&&s&&_get(s,"firstAuthorKey")===this.$info.userid&&_get(t,"authorKey")===this.$info.userid}_draftTaskKey(e,t){return`draft:${e}:${t}`}_discussionTaskKey(e,t){return`discussion:${e}:${t}`}_discussionPriority(e){return t.hash(`${this.context.$pageKey}:${e}`)}}}},!1,!0,{filename:"src/model/services/reviewContext/services.reviewContext.$pageKey.discussionSummaries.js",modelPath:"/services/reviewContext/$pageKey/discussionSummaries",modelExportName:"DiscussionSummaries"}),_reviewable.define(["FileDiffer"],["config","corpsman"],function(e,t){"use strict";const s={leftToRight:[{type:"bijection",leftStart:1,rightStart:1,accuracy:1}],rightToLeft:[{type:"bijection",leftStart:1,rightStart:1,accuracy:1}]},i=document.createElement("span");function r(e){return e?(Vue.set(i,"innerHTML",e),i.textContent):""}return{FileDiffer:class FileDiffer{constructor(){Vue.set(this,"_processedLinemapCache",{}),Vue.set(this,"_runningBasemaps",{})}get review(){return this.$parent.review}diffFiles(e,s,i){Vue.set(s,"owner",this.review.core.ownerName),Vue.set(s,"repo",this.review.core.repoName);const r=_get(this,"review","context","navigation","targetParley"),n=_get(r,"file");let a;Vue.set(s,"required",!s.decorate||_get(this,"review","context","overflowOverride")||n===e||_get(n,"revisions",_get(r,"revisionKey"),"inferred","file")===e),Vue.set(s,"revealedQuals",_(_get(this,"review","state","settings","collapse","fileOnly")).pickBy(e=>!1===e).keys().value());const o=`${s.leftSha}-${s.rightSha}`,l=_ref(this.$store,"child","linemaps",this.review.$key,o);if(s.captureLinemap&&(s.leftSha||s.rightSha)&&s.leftSha!==s.rightSha&&!this._processedLinemapCache[o]){const e=this.$when(()=>l.ready).then(()=>{Vue.set(s,"captureLinemap",!l.value)});a=e.then(()=>this.$store.services.diffWorkerBridge[i](s));const t=e.then(()=>s.captureLinemap?a.then(e=>s.stubLinemap?this._stubLinemap(e,s):e.linemap):Promise.resolve(l.value)).then(e=>{if(e)return this._storeLinemap(l,e),this._processLinemap(e);const t=new Error("Internal error: no linemap received from worker.");return Vue.set(t,"tryAgain",!s.force),Promise.reject(t)}).catch(e=>(Vue.delete(this._processedLinemapCache,o),Promise.reject(e)));t.catch(_.noop),Vue.set(this._processedLinemapCache,o,t)}else Vue.set(s,"captureLinemap",!1),a=this.$store.services.diffWorkerBridge[i](s);e.system&&(a=a.then(e=>(this._detectMetadataChanges(e),e)));const c=`${s.leftSha}_${s.leftBaseSha}-${s.rightSha}_${s.rightBaseSha}`;if(s.captureBasemap&&!this._runningBasemaps[c]){const e=a.catch(e=>(s.force||Vue.set(e,"tryAgain",!0),Promise.reject(e))).then(e=>this._storeBasemap(c,e)).finally(()=>{Vue.delete(this._runningBasemaps,c)});e.catch(_.noop),Vue.set(this._runningBasemaps,c,e)}return a.then(async e=>{const i=e.message;if(this.$destroyed||!this.$info.user||"binary"!==_get(i,"code")||void 0!==i.leftSize&&void 0!==i.rightSize)return e;try{const[t,r]=await Promise.all(_.map(["left","right"],e=>{if(void 0!==i[`${e}Size`])return i[`${e}Size`];const t=s[`${e}Sha`];return t?this.review.context.fileSize.get(t):0}));return{...e,message:{...i,leftSize:t,rightSize:r}}}catch(s){return t.capture(s,"fileDiffer.diffFiles (fetching binary sizes)"),e}})}_storeLinemap(s,i){this.$destroyed||this.$when(()=>_get(this,"review","verdict")).then(r=>{if(r.push&&s.ready&&!s.value)return s.set(i).catch(s=>{_get(this,"review","verdict","push")?(Vue.set(s,"extra",_.defaults({recoverable:!0},s.extra)),t.capture(s,"store trusted linemap")):(t.markHandled(s),e.prod||console.error("Silenced error:",s))})})}getLinemap(e,{leftSha:i,leftType:r,rightSha:n,rightType:a}){if(i===n)return Promise.resolve(s);const o=i+"-"+n;return Promise.resolve().then(()=>
1{if(this.$destroyed)return;const t=this._processedLinemapCache[o];if(t)return t;let s,l;const c=_get(this,"$store","linemaps",this.review.$key,o);return c?s=Vue.set(this._processedLinemapCache,o,Promise.resolve(this._processLinemap(c))):"-commits"===e.$key?(l=this.diffFiles(e,this.generateCommitFileOptions(i,n,!0),"diffText"),s=this._processedLinemapCache[o]):(l=this.diffFiles(e,{leftSha:i,leftType:r||"blob",rightSha:n,rightType:a||"blob",decorate:!1,force:!0,captureLinemap:!0},"diffFiles"),s=this._processedLinemapCache[o]),Promise.all([l,s]).then(([,e])=>e)}).catch(s=>s.tryAgain?this.getLinemap(e,{leftSha:i,leftType:r,rightSha:n,rightType:a}):(this.$destroyed&&t.markHandled(s),Promise.reject(s)))}_processLinemap(e,t){return{leftToRight:_(e).filter(e=>"leftStart"in e).sortBy("leftEnd").value(),rightToLeft:_(e).filter(e=>"rightStart"in e).sortBy("rightEnd").value()}}_reformatRevisionMessage(e){return e.replace(/^(New commits in r\d+)( \(same as [^)]*\))? at (\d{4}-\d\d-\d\d \d\d:\d\d:\d\dZ)/,(e,t,s,i)=>{const r=new Date(i.replace(/ /g,"T"));return isNaN(r)?(Sentry.captureMessage("Invalid date in commits file",{extra:{pr:this.review.core.pullRequestAddress,reviewKey:this.review.$key,zdate:i}}),e):t+(s||"")+" on "+r.toLocaleDateString()+" at "+r.toLocaleTimeString([],{timeStyle:"short"})})}generateCommitFileContents(e){if(!e)return{content:null};const t=this.review.discussions["-top"].comments;return{content:`${_(_get(this,"review","revisions",e,"nonObsoleteRevisionKeys")||"").split(",").map(e=>_get(t,e,"markdownBody")).compact().map(e=>this._reformatRevisionMessage(e)).join("\n")}`}}generateCommitFileOptions(e,t,s=!1){const i=_.find(_get(this,"review","files","-commits","revisions"),t=>t.fileSha===e),r=_.find(_get(this,"review","files","-commits","revisions"),e=>e.fileSha===t),n=this.generateCommitFileContents(_get(i,"$key")),a=this.generateCommitFileContents(_get(r,"$key"));s||(s=(i?i.index:-1)===r.index-1);const o=s&&(this._syntheticCommitShasDifferFromRevisionCommitShas(n,_get(i,"$key"))||this._syntheticCommitShasDifferFromRevisionCommitShas(a,_get(r,"$key")));return{leftFile:n,rightFile:a,leftBaseFile:{content:null},rightBaseFile:{content:null},leftSha:e,rightSha:t,decorate:!0,filename:"commits.txt",captureLinemap:s,stubLinemap:o}}_syntheticCommitShasDifferFromRevisionCommitShas(e,t){if(!e.content)return;const s=/^- ([0-9a-f]{7})/gm,i=[];let r;for(;r=s.exec(e.content);)i.push(r[1]);return _.last(i)!==_access(this,"","review","","revisions","",t,"","commitSha","","slice","call",[0,7])}_detectMetadataChanges(e){Vue.set(e,"blocks",_.flatMap(e.blocks,e=>{if("keep"===e.op||!e.left.lines||!e.right.lines)return e;const t=new Set;let s=!1;if(_.forEach(e.right.lines,(i,n)=>{i=r(i);const a=r(e.left.lines[n]);if(!a)return;const o=i.match(/, probably rebased from (r\d+):$/);o?(s=!1,new RegExp(`^New commits in ${o[1]} `).test(a)&&(s=!0,t.add(n))):s&&/^- [0-9a-f]{7}/.test(a)&&/^- [0-9a-f]{7}/.test(i)&&a.slice(11)===i.slice(11)&&t.add(n)}),!t.size)return e;if(t.size===e.right.lines.length)return Vue.set(e.quals,"metadata",!0),e;const i=Math.max(e.left.lines.length,e.right.lines.length),n=[];for(let s=0;s<i;s++){const i=t.has(s);let r=_.last(n);_get(r,"quals","metadata")!==i&&(r={op:e.op,quals:_.clone(e.quals),left
1:{range:[e.left.range[0]+s,0],lines:[]},right:{range:[e.right.range[0]+s,0],lines:[]}},i&&Vue.set(r.quals,"metadata",!0),n.push(r)),Vue.set(r.left.range,1,e.left.range[0]+s),r.left.lines.push(e.left.lines[s]),Vue.set(r.right.range,1,e.right.range[0]+s),r.right.lines.push(e.right.lines[s])}return n}))}_stubLinemap(e,s){const i={b0:{type:"bottom",accuracy:0,leftStart:1,leftEnd:e.lineInfos.left.length,rightStart:null,rightEnd:0},b1:{type:"bottom",accuracy:0,leftStart:null,leftEnd:0,rightStart:1,rightEnd:e.lineInfos.right.length}},r=new Error("Synthetic file commit SHAs differ from revision commit SHAs"),n={leftFileSha:s.leftSha,rightFileSha:s.rightSha,leftFile:s.leftFile.content,rightFile:s.rightFile.content,revisions:_.mapValues(this.review.revisions,e=>e.commitSha)};return t.capture(r,n),i}computeBasemap(e,s){const i=`${e.fileSha}_${e.baseFileSha}-${s.fileSha}_${s.baseFileSha}`;return this._runningBasemaps[i]||this.diffFiles(e.file,{leftSha:e.fileSha,leftBaseSha:e.baseFileSha,leftType:e.type||"blob",rightSha:s.fileSha,rightBaseSha:s.baseFileSha,rightType:s.type||"blob",decorate:!1,force:!0,captureBasemap:!0},"diffFiles"),this._runningBasemaps[i].catch(i=>i.tryAgain?this.computeBasemap(e,s):(this.$destroyed&&t.markHandled(i),_get(i,"extra","recoverable")&&Vue.set(i.extra,"recoverable",!1),Promise.reject(i)))}_storeBasemap(s,i){if(i.blocks)return Promise.resolve(this.$destroyed?_get(this,"review","verdict"):this.$when(()=>_get(this,"review","verdict"))).then(r=>{if(!_get(r,"push"))return;const n=this.review.$key,a=this.blocksHaveBaseChangesOnly(i.blocks),o=i.baseChangesMissing;return _ref(this.$store,"child","basemaps",n,s).set({baseChangesOnly:a,baseChangesMissing:o}).catch(i=>{this.$store.services.breadcrumbSampler.addBreadcrumb("reconciliation-burst",n,"basemap store failed",{basemapKey:s,errorMessage:i.message,baseChangesOnly:a,baseChangesMissing:o}),_get(this,"review","verdict","push")?(Vue.set(i,"extra",_.defaults({recoverable:!0},i.extra)),t.capture(i,"store basemap")):(t.markHandled(i),e.prod||console.error("Silenced error:",i))})})}blocksHaveBaseChangesOnly(e){return _.every(e,e=>"keep"===e.op||e.quals.base)}}}},!1,!0,{filename:"src/model/services/reviewContext/services.reviewContext.$pageKey.fileDiffer.js",modelPath:"/services/reviewContext/$pageKey/fileDiffer",modelExportName:"FileDiffer"}),_reviewable.define(["FileSize"],["session"],function(e){"use strict";return{FileSize:class FileSize{constructor(){Vue.set(this,"context",this.$parent),Vue.set(this,"_sizes",{}
1),Vue.set(this,"_fileShasQueue",[]),Vue.set(this,"_fetchQueue",_.debounce(this._fetchQueue.bind(this),0))}get(e){return this._sizes[e]?this._sizes[e]:(this._fileShasQueue.push(e),this._fetchQueue(),this.$when(()=>this._sizes[e]))}_fetchQueue(){const t={owner:this.context.owner,repo:this.context.repo},s=e.hubkit(),i=_(this._fileShasQueue).uniq().chunkBy(100).value();Vue.set(this,"_fileShasQueue",[]),_.forEach(i,e=>{const i=(({fragments:e})=>`\n query ($owner: String!, $repo: String!) {\n repository (owner: $owner, name: $repo) {\n ${e}\n }\n }\n`)({fragments:_.map(e,e=>(({sha:e})=>`sha_${e}: object (oid: "${e}") {... on Blob {byteSize}}`)({sha:e})).join("\n")});s.graph(i,{variables:t}).then(t=>{_.forEach(e,e=>{Vue.set(this._sizes,e,Promise.resolve(_get(t,"repository",`sha_${e}`,"byteSize")||0))})},t=>{const s=Promise.reject(t);s.catch(_.noop),_.forEach(e,e=>{Vue.set(this._sizes,e,s)})})})}}}},!1,!0,{filename:"src/model/services/reviewContext/services.reviewContext.$pageKey.fileSize.js",modelPath:"/services/reviewContext/$pageKey/fileSize",modelExportName:"FileSize"}),_reviewable.define(["ReviewContext"],["router","analytics","corpsman","session","truss","config","debug","pageControl","bindTruss"],function(e,t,s,i,r,n,a,o,l){"use strict";const c="Optimizing layout";function u(e){const t=e.filemapKey;let s;if(t){const i=_ref(e.$store,"child","filemaps",e.$reviewKey,t);i.ready&&(s=i.value)}return _.assign({revKey:e.$key,filemapKey:t,hasFilemap:!!s,computingFilemap:e.computingFilemap},_.pick(s,["valid","done","local","writeFailed"]))}class PanelToggle{constructor(e,t,s,i){Vue.set(this,"_settingKey",e),Vue.set(this,"_onboardingKey",t),Vue.set(this,"_context",s),Vue.set(this,"_sidebar",i),Vue.set(this,"_showing",void 0),Vue.set(this,"_shown",!1),Vue.set(this,"_overlay",!1),Vue.set(this,"_overlaid",!1),Vue.set(this,"_transitioned",!1),Vue.set(this,"_extraSegmentOpen",!1),Vue.set(this,"_extraSegmentLockedClosed",!1)}get ready(){return void 0!==this._showing}get showing(){return this._showing}set showing(e){e&&this.sidebar&&_.forEach(this._context.toggles,e=>{e.sidebar&&Vue.set(e,"showing",!1)}),Vue.set(this,"_showing",!!e),e&&Vue.set(this,"_shown",!0),_.isBoolean(e)&&(this.sidebar||_.set(i.settings,this._settingKey,e),this._onboardingKey&&Vue.set(i.onboarding,this._onboardingKey,!0))}get overlay(){return this._overlay}set overlay(e){Vue.set(this,"_overlay",!!e),e&&Vue.set(this,"_shown",!0)}get overlaid(){return this._overlaid}set overlaid(e){Vue.set(this,"_overlaid",e)}get shown(){return this._shown}get transitioned(){return this._transitioned}set transitioned(e){Vue.set(this,"_transitioned",e)}get sidebar(){return this._sidebar}setDefaultShowing(e){this.sidebar?Vue.set(this,"showing",e?"auto":null):this._context.$when(()=>i.settings.$ready||null===r.info.userid).then(()=>{void 0===this._showing&&(!1===_.get(i.settings,this._settingKey)?Vue.set(this,"showing",null):Vue.set(this,"showing",e?"auto":null))})}toggleExtra(e){this._extraSegmentLockedClosed||(void 0===e&&(e=!this._extraSegmentOpen),Vue.set(this,"_extraSegmentOpen",e))}lockExtra(e){Vue.set(this,"_extraSegmentLockedClosed",e),e&&Vue.set(this,"_extraSegmentOpen",!1)}get extraSegmentOpen(){return this._extraSegmentOpen}get extraSegmentDisabled(){return this._extraSegmentLockedClosed}}return{ReviewContext:class ReviewContext{constructor(){Vue.set(this,"_active",0),Vue.set(this,"_connector",void 0),Vue.set(this,"_loadedWithUser",!!this.$info.userid),Vue.set(this,"_fetchTokens",{}),Vue.set(this,"repository",void 0),Vue.set(this,"listFiles",!0),Vue.set(this,"diffFiles",!0),Vue.set(this,"showDiscussions",!0),Vue.set(this,"completeReview",!0),Vue.set(this,"showUI",!0),Vue.set(this,"elideFilePaths",void 0),Vue.set(this,"onlyFile",void 0),Vue.set(this,"overflowOverride",!1),Vue.set(this,"toggles",{fileMatrix:new PanelToggle("showFileMatrix","showedFileMatrix",this)}),this.toggles.fileMatrix.setDefaultShowing(!0),Vue.set(this,"numRunningDiffTransitions",0),Vue.set(this,"baseReviewUrl",void 0),Vue.set(this,"_initialPullRequestSyncDone",!1),Vue.set(this,"autoUngrouped",{}),Vue.set(this,"reviewSummaryPublished",!1),Vue.set(this,"allDraftsPublished",!1),Vue.set(this,"activePanelKey",null),Vue.set(this,"deactivatedPanelScrollDirection",void 0),Vue.set(this,"dismissedRepoError",!1),Vue.set(this,"commitsControl
1sResult",void 0),Vue.set(this,"stateSettings",{}),Vue.set(this,"_unbindStateSettings",void 0),Vue.set(this,"_requestReconciliationCount",0),Vue.set(this,"requestReconciliationDebounced",_.debounce(this.requestReconciliationDebounced.bind(this),500))}_logReadyTransition(e,t){_get(this,"review","revisions","list")&&this.$store.services.breadcrumbSampler.addSampledBreadcrumb("reconciliation-burst",this.review.$key,"ready transition",{source:"observer",observedState:"filemaps_and_basemaps_ready",done:e,wereDone:t,filemapsReady:_get(this,"review","revisions","filemapsReady"),filemapsStored:_get(this,"review","revisions","filemapsStored"),basemapsReady:_get(this,"review","files","basemapsReady"),lastReconciliationTimestamp:_get(this,"review","core","lastReconciliationTimestamp"),revisions:_.map(_get(this,"review","revisions","list"),u)})}acquire(){this._active++,1===this._active&&this._initialize()}release(){this._active--,this._active||(this._unbindStateSettings&&(this._unbindStateSettings(),Vue.set(this,"_unbindStateSettings",void 0)),this.$set(null))}_initialize(){Vue.set(this,"baseReviewUrl",`/reviews/${encodeURIComponent(this.capitalizedOwner)}/${encodeURIComponent(this.capitalizedRepo)}/${encodeURIComponent(this.pullRequestNumber)}`),this._complainIfSlowVerdict(),Vue.set(this,"_connector",this.$connect(this,{repositoryCore:()=>_ref(this._repositoryRef,"child","core"),repositoryProtection:()=>_ref(this._repositoryRef,"child","protection"),coverage:()=>_ref(this.$store,"child","organizations",this.owner,"coverage"),reviewKey:()=>_ref(this._repositoryRef,"child","pullRequests",this.pullRequestNumber),review:()=>_access(_ref,"call",[this.$store,"child","reviews",this.reviewKey],"","annotate","call",[{context:this}]),state:()=>_access(_ref,"call",[this.$store,"child","users","current","state",this.reviewKey]),filemaps:()=>this.review?_access(_ref,"call",[this.$store,"child","filemaps",this.reviewKey]):null,linemaps:()=>this.review?_access(_ref,"call",[this.$store,"child","linemaps",this.reviewKey]):null,basemaps:()=>this.review?_access(_ref,"call",[this.$store,"child","basemaps",this.reviewKey]):null})),Vue.set(this,"_unbindStateSettings",l(()=>_access(_ref,"call",[this.$store,"child","users","current","state",this.reviewKey,"settings"]),this.stateSettings,{})),window.REVIEWABLE_PROD||this.$when(()=>this._connector.at.reviewKey.ready).then(()=>{console.log("reviewKey",this.reviewKey)}),this.$when(()=>this.$info.userid).then(()=>{const e="reviewable/demo"==`${this.owner}/${this.repo}`&&1===this.pullRequestNumber;Vue.set(i.onboarding,e?"demoReview":"ownReview",!0)});let e=0;this.$intercept("write",{onAfter:t=>{if("override"===t.method)return;const i=_.some(t.targets,e=>e.test(_get(this,"review","$path")+"/$*"))&&!_.every(t.targets,e=>{const t=_access(_ref,"call",[this,"child","review","participants"],"","path");return e.test(t+`/${this.$info.userid}/draftsPending`)||e.test(t+`/${this.$info.userid}/lastUpdateTimestamp`)}),n=_.some(t.targets,e=>e.test(_get(this,"review","state","$path")+"/$*")),a=_get(this,"review","state")&&_.some(t.targets,e=>e.test(_ref(this,"child","review","state","settings","reviewOverlapStrategy").path));if((i||a)&&this._connector.at.review.ready){const e=(i?"review affected":"overlap settings affected")+` [${_(t.targets).map("path").join(", ")}]`;if(this.requestReconciliationDebounced(e),t.target.annotations.reconciliationPromises){const e=this.requestReconciliationDebounced.flush();t.target.annotations.reconciliationPromises.push(e)}}if(this.$info.userid&&(i||n)&&Date.now()-e>3e4){e=Date.now();const t=_ref(this,"child","review","participants",this.$info.userid,"lastUpdateTimestamp").annotate({disregardWrite:!0}),i=this.$info.userid,n=()=>this.$when(()=>_get(this,"verdict","pull")&&this.$info.userid===i).then(()=>t.set(r.SERVER_TIMESTAMP)).catch(e=>_get(this,"verdict","pull")&&this.$info.userid===i?Promise.reject(e):(s.markHandled(e),this.$info.userid===i?n():void 0));n()}}}),this.$observe(()=>_get(this,"review","revisions","filemapsStored")&&_get(this,"review","files","basemapsReady"),(e,t)=>{!e||t||this.$destroyed||(this._logReadyTransition(e,t),this.$when(()=>this._initialPullRequestSyncDone).then(()=>this.requestReconciliationDebounced("filemaps and basemaps ready")))}),this.$observe(()=>_get(this,"verdict","pull")&&_get(this,"review","stateReady")&&this.$info.userid?!(_.isEmpty(_get(this,"review","state","marks"))&&_.isEmpty(_get(this,"review","state","drafts"))&&_.isEmpty(_get(this,"review","state","roleChanges"))&&_.isEmpty(_get(this,"review","state","dismissals"))):void 0,e=>{if(!_.isBoolean(e)||!this.$info.userid)return;const t=_ref(this,"child","review","participants",this.$info.userid,"draftsPending");
1t.set(e||null).catch(i=>{if(s.markHandled(i),this.$info.userid)return t.set(e||null)})},{precise:!0}),this.$observe(()=>this.singleFile?this.onlyFile:null,e=>{e&&e.$key===this.activePanelKey&&Vue.set(this,"activePanelKey",null)}),this.$observe(()=>this.$info.userid,e=>{null===e&&o.closeAllDialogs()}),this.$observe(()=>_get(this,"repositoryCore","connector"),e=>{this.$store.services.avatars.connectUser(e)})}get _repositoryRef(){return _access(_ref,"call",[this.$store,"child","repositories",this.owner,this.repo])}get verdict(){return this.$store.services.warden.getVerdict(this.owner,this.repo)}_complainIfSlowVerdict(){let e,t=_.noop;t=this.$observe(()=>this.$info.connected,s=>{if(s){if(e)return;e=setTimeout(()=>{t(),e&&clearTimeout(e),e=null,this.verdict||this.$destroyed||Sentry.captureMessage("Timeout obtaining permissions")},5e3)}else e&&clearTimeout(e),e=null})}get loadingMessage(){return void 0===this.$info.userid?"Resuming session":this.verdict?(t.time("perm"),!(_get(this,"_connector","at","review","ready")&&_get(this,"_connector","at","filemaps","ready")&&_get(this,"_connector","at","linemaps","ready")&&_get(this,"_connector","at","basemaps","ready"))||this._loadedWithUser&&this.$info.userid&&!_get(this,"_connector","at","state","ready")?"Loading review":_get(this,"_connector","data","review")?(t.time("fetch",{singleFilePage:!this.fullInterface,signedIn:!!this.$info.userid}),_get(this,"review","revisions","filemapsReady")?_get(this,"review","files","basemapsReady")?this.showUI&&!_.every(this.toggles,"ready")?"Applying personal settings":this.showUI&&!_.some(this.$store.services.ruler.flowOffset)?c:null:"Looking for base changes":"Mapping renamed files"):"Creating review"):"Checking permissions"}get ready(){const e=null===this.loadingMessage||this.loadingMessage===c;return e&&this.$freezeComputedProperty(),e}get pageTitle(){const e=[];return this.review&&e.push(_get(this,"review","core","plainTextPullRequestTitle")),_get(this,"review","userIsReviewingFiles")&&_get(this,"review","files","num","toReview")>0&&e.push(`${_get(this,"review","files","num","toReview")} to review`),_get(this,"review","tracker","num","unreplied")>0&&e.push(`${this.review.tracker.num.unreplied} unreplied`),e.join(" - ")}get subscriptionNeededSoon(){return"enterprise"!==n.env&&this.reviewKey&&_get(this,"repository","private")&&(!this.repository.owner||"User"!==this.repository.owner.type)&&this._connector.ready&&!_get(this,"coverage","subscriptionKey")&&(!_get(this,"coverage","lastWasTrial")||this.coverage.trialDaysRemaining<8)}get tooManyFilesThreshold(){if(i.settings.$ready||null===r.info.userid)return i.settings.tooManyFilesThreshold||50}get overflow(){if(this.overflowOverride||!this.fullInterface)return null;if(!this.tooManyFilesThreshold)return;if(void 0===_get(this,"review","files","num","presented"))return;const e=_.pickBy({tooManyFiles:_get(this,"review","files","num","presented")>(a.singleFileMode?1:this.tooManyFilesThreshold),diffsThrottled:_.some(_get(this,"review","files"),e=>"throttled"===_get(e,"diff","current","message","code")),bigDiffs:_.some(_get(this,"review","files"),e=>!e.trivial&&"bigdiff"===_get(e,"diff","current","message","code"))});return Object.defineProperty(e,"size",{value:_.size(e)}),e.tooManyFiles&&Vue.set(e,"numPresentedFiles",_get(this,"review","files","num","presented")),Vue.set(e,"expected",e.tooManyFiles&&1===e.size&&1===this.tooManyFilesThreshold),e.size?e:null}overrideOverflow(){this.fullInterface&&(Vue.set(this,"overflowOverride",!0),_get(this,"review","files")&&_.forEach(this.review.files,e=>{e.diff.force("soft")}))}get singleFile(){if(void 0!==this.overflow)return!this.fullInterface||!!_get(this,"overflow","tooManyFiles")}get _initOnlyFile(){if(void 0===this.singleFile)return;const e=this.navigation.targetFile&&this.onlyFile!==this.navigation.targetFile;if(this.singleFile){if(!this.onlyFile||e){if(!_get(this,"review","files","joined")||!_get(this,"review","$ready"))return;if(this.fullInterface){if(_get(this,"navigation","lastVisitedFile","assimilated")||Vue.set(this,"onlyFile",this.navigation.lastVisitedFile),!this.onlyFile||e){if(!this.review.stateReady)return;Vue.set(this,"onlyFile",this.navigation.targetFile)}if(!this.onlyFile){if(_.every(this.review.files.list,e=>!_get(e,"diff","bounds",1)))return;Vue.set(this,"onlyFile",_.find(this.review.files.list,e=>!e.assimilated&&_get(e,"diff","bounds",1)))}this.onlyFile||Vue.set(this,"onlyFile",_.find(this.review.files.list,e=>!e.assimilated))}else Vue.set(this,"onlyFile",_.find(this.review.files.list,e=>!e.assimilated&&e.path===this.navigation.targetFilePath))}else if(this.onlyFile.assimilated){const e=_.findLast(this.onlyFile.revisions.list,e=>e.inferred!==e);Vue.set(this,"onlyFile",e?e.inferred.file:null)}}else Vue.set(this,"onlyFile",null)}get lgtmConfig(){if(!_get(this,"_connector","at","repositoryCore","ready"))return;const e=_get(this,"_connector","data","repositoryCore","settings","lgtmText")||":lgtm:";if("none"===_.trim(_.toLower(e)))return null;const t={text:e},s=_get(t.text.match(/^:(.*?):/),1),i=this.$store.services.completions.emojis.map;return Vue.set(t,"emojiUrl",s&&i[s]||i.lgtm),t}addPanelToggle(e,t=!0,s=!1){if(this.toggles[e])return Vue.set(this.toggles[e],"_sidebar",s),void(s&&Vue.set(this.toggles[e],"showing",this.toggles[e].showing));Vue.set(this.toggles,e,new PanelToggle(`panelToggles.${e}`,null,this,s)).setDefaultShowing(t)}syncPullRequest(e){if(!this.$info.user)return Promise.resolve();if(_.isNaN(this.pullRequestNumber))return Promise.resolve();let t=!1;const s={updateReview:!0};switch(e){case"resplit":Vue.set(s,"rewriteSoftRevisions",!0);break;case"mergeable":case"baseBranch":break;case"unconnected":t=!0;break;default:_.assign(s,{syncComments:!0,syncStatus:!0})}const i=t?void 0:this.$newKey();return this.$store.queues.githubPullRequestSync.request(this.capitalizedOwner,this.capitalizedRepo,this.pullRequestNumber,s,i,e||"backfill")}async requestReconciliation(e){await this._queueReconciliationTask(e,!0)}async requestReconciliationDebounced(e){await this._queueReconciliationTask(e)}async _queueReconciliationTask(e,t=!1){if(e+=` (${++this._requestReconciliationCount})`,this.$destroyed)return;if(await this.$when(()=>_get(this,"review","core","ownerName")&&_get(this,"review","core","repoName")&&_get(this,"review","core","pullRequestId")),this.$destroyed||!(_get(this,"review","core","ownerName")&&_get(this,"review","core","repoName")&&_get(this,"review","core","pullRequestId")))return;const s=_.toLower(this.review.core.ownerName),i=_.toLower(this.review.core.repoName);return this.$store.queues.reconciliation.request(s,i,this.review.core.pullRequestId,e,{reviewKey:_get(this,"review","$key"),scope:this,waitForCompletion:t})}setReviewRevisionSplitStrategy(e){if(!e)return Promise.reject(new Error("No review style selected."));if(!_get(this,"verdict","push"))return Promise.reject(new Error("You don't have push permissions for this repo."));Vue.set(i.onboarding,"selectedReviewStyle",!0);return _ref(this,"child","_connector","at","review","core","revisionSplitStrategy").commit(t=>{t.currentValue===e?t.cancel():t.set(e)}).then(e=>{if("set"===e.outcome)return this.syncPullRequest("resplit").then(()=>{_.forEach(_get(this,"review","files"),e=>{e.diff&&e.diff.setBounds(null,!0)})})})}get _checkIfNotAllowed(){if(!1===_get(this,"verdict","pull")||null===this.repository?s.setCondition("notallowed"):s.clearCondition("notallowed"),_get(this,"verdict","pull"))if(this.$info.userid){if(!_get(this,"_connector","at","repositoryCore","ready")||this._getRenamedRepository())return;this._fetchOnceForCurrentUser("syncPullRequest")&&(s.clearCondition("notcreated"),this.syncPullRequest().then(()=>{Vue.set(this,"_initialPullRequestSyncDone",!0)},e=>{if(this._active){if(!this.review)return s.setCondition("notcreated",e.message),s.markHandled(e),void this.$when(()=>!s.condition).then(()=>{Vue.delete(this._fetchTokens,"syncPullRequest")});if(/license/i.test(e.message))return s.setCondition("badlicense",e.message),void s.markHandled(e);Vue.set(this,"_initialPullRequestSyncDone",!0)}s.capture(e,"review syncPullRequest")}))}else this._fetchOnceForCurrentUser("anonReviewMissing")&&this.$when(()=>_get(this,"_connector","at","reviewKey","ready")&&(!this.reviewKey||_get(this,"_connector","at","review","ready"))).then(()=>{!this._active||this.$info.userid||this.review||s.setCondition("notcreated","please sign in to create this review")})}_fetchOnceForCurrentUser(e){if(void 0===this.$info.user)return null;const t=_get(this,"$info","user","github","accessToken")||"anonymous";return this._fetchTokens[e]===t?null:(Vue.set(this._fetchTokens,e,t),t)}_fetchingCurrentUser(e,t){return this._fetchTokens[e]===t}get _fetchRepository(){const e=this._fetchOnceForCurrentUser("repository");e&&(Vue.set(this,"repository",void 0),i.hubkit(this.owner,this.repo).request("GET /repos/:owner/:repo",{onError:e=>{if(401===e.status||404===e.status)return null}}).then(t=>{this._fetchingCurrentUser("repository",e)&&(Vue.set(this,"repository",t),s.clearCondition("ghquota"))},t=>{if(this._fetchingCurrentUser("repository",e)&&403!==t.status&&429!==t.status)throw t}))}get _fetchCompletions(){if(!this.showUI)return;if(!_get(this,"_connector","at","repositoryCore","ready")||this._getRenamedRepository())return;const e=this._fetchOnceForCurrentUser("completions");if(!e)return;const t=this.$store.services.completions;t.labels.connect(this.owner,this.repo),t.milestones.connect(this.owner,this.repo),this.$info.userid&&
1(this.$store.queues.requests.send({action:"fillRepositoryCache",ownerName:this.owner,repoName:this.repo},{fireAndForget:!0}),t.assignees.connect(this.owner,this.repo),t.issues.fetch(this.owner,this.repo),this.$when(()=>this.repository).then(()=>{this._fetchingCurrentUser("completions",e)&&this.$info.userid&&("User"===this.repository.owner.type?t.people.connectPersonal(this.owner,this.repo):(t.people.connectOrganization(this.owner,this.repo),_.includes(_get(this,"$info","user","github","scopes"),"read:org")&&this.$store.queues.requests.send({action:"fillOrganizationCache",ownerName:this.owner},{fireAndForget:!0})))}))}get _checkReviewError(){_get(this,"review","core","error")?s.setCondition("badreview",this.review.core):s.clearCondition("badreview")}_getRenamedRepository(){const e=_get(this,"repositoryCore","renamed");return!e||_.toLower(e.ownerName)===this.owner&&_.toLower(e.repoName)===this.repo?null:e}get _checkRepositoryRenamed(){const t=this._getRenamedRepository();t&&e.go({path:`/reviews/${t.ownerName}/${t.repoName}/${this.pullRequestNumber}`},{replace:!0})}get shownMatrixColumns(){const e=this.toggles.fileMatrix.transitioned&&i.settings.showFullMatrixInOverlay;return{reviewerAvatars:i.settings.showReviewerAvatars||e,reviewChips:i.settings.showFileStateChips||e,revisions:i.settings.showMatrixRevisions||e,diffStats:i.settings.showDiffStats||e,commits:i.settings.showCommitsList||e,codeCoverage:i.settings.showCodeCoverage||e}}}}},!1,!0,{filename:"src/model/services/reviewContext/services.reviewContext.$pageKey.js",modelPath:"/services/reviewContext/$pageKey",modelExportName:"ReviewContext"}),_reviewable.define(["ReviewNavigation"],["animator","bus","debug","draftFocusTracker","hotkeys","modifiers","pageControl","session","router"],function(e,t,s,i,r,n,a,o,l){"use strict";function c(...e){s.navigation&&console.log(...e)}return{ReviewNavigation:class ReviewNavigation{constructor(){if(Vue.set(this,"context",this.$parent),Vue.set(this,"lastVisitedFileKey",void 0),Vue.set(this,"lastVisitedDiscussionKey",void 0),Vue.set(this,"_lastSyncedDiscussionKey",void 0),Vue.set(this,"targetDiscussionKey",void 0),Vue.set(this,"targetFileKey",void 0),Vue.set(this,"targetFilePath",void 0),Vue.set(this,"targetBoundsRevisionKeys",void 0),Vue.set(this,"missing",void 0),l.params.filePath&&this._syncTargetFilePath(l.params.filePath),l.hash){const e=this._cleanHashMetadata(l.hash);if(/^(file|gh)?-[\w-]+$/.test(e)){if(_.startsWith(e,"file-")){const t=e.replace(/^file/,"");c("detected URL link to file",t),this.visitFileKey(t)}else c("detected URL link to discussion",e),this.visitDiscussion(e,!0);l.go({hash:null},{replace:!0})}else{const t=e.match(/^(r\d+|base)?\.\.(r\d+|last)$/);t&&(c("detected URL link to diff bounds",t[1],t[2]),Vue.set(this,"targetBoundsRevisionKeys",[t[1]||null,t[2]]),this.$when(()=>this.context.review).then(()=>{this.context.review.files.diffs.showAllFiles()}),l.go({hash:null},{replace:!0}))}}l.afterSettled((e,t)=>{const s=_get(this,"context","review","core");if(!s)return;if(new RegExp(`^/reviews/${_.escapeRegExp(s.ownerName)}/${_.escapeRegExp(s.repoName)}/${s.pullRequestId}(?:/|$)`,"i").test(e.path)){if(e.hash&&e.hash!==t.hash){const t=this._cleanHashMetadata(e.hash);if(!t||"-"===t)return;this.visitDiscussion(t,!0),l.go({hash:null},{replace:!0})}e.params.filePath!==t.params.filePath&&this._syncTargetFilePath(e.params.filePath)}},this),this.$observe(()=>this.lastVisitedDiscussionKey,()=>{!l.hash||this.lastVisitedDiscussionKey||this.targetDiscussionKey||this.context.singleFile&&!this.context.fullInterface||l.go({hash:null},{replace:!0})}),this.$observe(()=>this.lastVisitedFile,e=>{e&&(_.delay(()=>{this.$destroyed||e.$key!==this.lastVisitedFileKey||this._activateFile(e)},50),this.$observe(()=>this.lastVisitedParley,e=>{if(!this.lastVisitedDiscussionKey||e)return;const t=_(document.getElementsByClassName("discussion item")).map(e=>e.hasAttribute("id")?e.getAttribute("id").replace(/^discussion/,""):null).compact().value();let s=_.indexOf(t,this.lastVisitedDiscussionKey);s>=0&&(s--,s<0&&(s+=t.length),Vue.set(this,"lastVisitedDiscussionKey",t[s]))}))})}_cleanHashMetadata(e){if(!/:/.test(e))return e;const t=e.replace(/:.*/,"");return l.go({hash:"-"===t?null:t||null},{replace:!0}),t}_syncTargetFilePath(e){Vue.set(this,"targetFilePath",e),e&&!this.context.fullInterface&&this.$when(()=>_get(this,"review","files","joined")).then(()=>
1{if(this.$destroyed||this.targetFilePath!==e)return;const t=_.find(this.review.files.list,{path:e});t&&!t.assimilated&&(Vue.set(this.context,"onlyFile",t),Vue.set(this,"lastVisitedFileKey",t.$key))})}get review(){return this.context.review}get state(){return this.context.state}get lastVisitedFile(){return _get(this,"review","files",this.lastVisitedFileKey)}get lastVisitedParley(){return _get(this,"review","discussions",this.lastVisitedDiscussionKey)||_get(this,"review","state","drafts",this.lastVisitedDiscussionKey)}get targetParley(){if(_get(this,"review","stateReady"))return _get(this,"review","discussions",this.targetDiscussionKey)||_get(this,"state","drafts",this.targetDiscussionKey)}get targetFile(){return _get(this,"review","files",this.targetFileKey)||_get(this,"targetParley","file")}get _syncLastVisitedFileKey(){this.context.onlyFile?this.lastVisitedFileKey&&this.lastVisitedFileKey!==this.context.onlyFile.$key&&Vue.set(this,"lastVisitedFileKey",null):_get(this,"lastVisitedParley","$key")===this.lastVisitedDiscussionKey&&_get(this,"lastVisitedParley","$key")!==this._lastSyncedDiscussionKey&&_get(this,"lastVisitedParley","file")&&this.lastVisitedFileKey!==_get(this,"lastVisitedParley","file","$key")&&(Vue.set(this,"lastVisitedFileKey",this.lastVisitedParley.file.$key),Vue.set(this,"_lastSyncedDiscussionKey",this.lastVisitedParley.$key))}selectFile(e,t){this.lastVisitedFileKey!==e.$key&&(Vue.set(this,"lastVisitedFileKey",e.$key),_get(this,"lastVisitedParley","file")!==e&&Vue.set(this,"lastVisitedDiscussionKey",null),t&&Vue.set(this,"missing",null))}anchorOnFile(e){Vue.set(this,"lastVisitedFileKey",e.$key),Vue.set(this,"lastVisitedDiscussionKey",null),Vue.set(this,"missing",null)}exhibitParleys(e,t){c(`exhibit ${_.size(t)} discussions at level ${e}`),e>=0&&_(t).map("file").compact().forEach(e=>{e.trivial&&(c(`revealing file "${e.path}" (${e.$key})`),Vue.set(e,"nonTrivialLatch",!0))}),_.forEach(t,t=>{t.locator?(c(`exhibiting discussion ${t.$key}`),Vue.set(t.locator,"commentExhibitionLevel",e)):(c(`waiting to exhibit discussion ${t.$key}`),this.$when(()=>t.locator).then(()=>{c(`exhibiting postponed discussion ${t.$key}`),Vue.set(t.locator,"commentExhibitionLevel",e)}))})}_getFileOrDiscussionItemKeys(e,t){const s=s=>_.filter(s,s=>{if(/^discussion/.test(s))return t(s.replace(/^discussion/,""));if(/^file/.test(s)){const t=_get(this,"review","files",s.replace(/^file/,""));return t&&e(t)}});let i,r;return this.context.singleFile?(i=[..._.map(document.querySelectorAll(".top.discussions .discussion.item"),e=>e.getAttribute("id")),..._.map(this.review.files.showingList,e=>`file${e.$key}`)],r=[..._.map(this.review.discussions.top.parleys,e=>`discussion${e.$key}`),..._.map(this.review.files.showingList,e=>`file${e.$key}`)],this.context.onlyFile&&(i.splice(_.indexOf(i,"file"+this.context.onlyFile.$key)+1,0,..._.map(document.querySelectorAll(`#file${this.context.onlyFile.$key} .discussion.item`),e=>e.getAttribute("id"))),r.push(..._.map(this.context.onlyFile.parleys,e=>`discussion${e.$key}`)))):(i=_(document.querySelectorAll(".discussion.item, .files.content > *")).map(e=>e.getAttribute("id")).unshift(_get(this,"review","state","drafts","-cmd")?"discussion-cmd":null,"discussion-top").compact().uniq().value(),r=[..._.map(this.review.discussions.parleys,e=>`discussion${e.$key}`),..._.map(this.review.files.showingList,e=>`file${e.$key}`)]),{itemKeys:i,allItemKeys:r,matchingItemKeys:s(i),matchingAllItemKeys:s(r)}}async _findAndVisitFileOrDiscussion(t,s,i,{reverse:r=!1,resetCurrent:n=!1,onWraparound:a=null,allowWraparoundRetry:o=!0}={}){if(c(`navigate to${s?" a file":""}${i?" a discussion":""}`),!_get(this,"review","files"))return c("navigate files not ready, ignoring"),!1;s=(s||_.noop).bind(this),i=(i||_.noop).bind(this);const l=this._getFileOrDiscussionItemKeys(s,i),{matchingItemKeys:u,matchingAllItemKeys:d}=l;let{itemKeys:h}=l;const p=_.difference(d,u),v=!d.length;if(t&&p.length){const{numParleys:e,numFiles:r}=_(p).countBy(e=>/^discussion/.test(e)?"numParleys":/^file/.test(e)?"numFiles":null).defaults({numParleys:0,numFiles:0}
1).value();Vue.set(this,"missing",{descriptor:t,numParleys:e,numFiles:r,filePredicate:s,discussionPredicate:i}),c(`missing ${r} files and ${e} discussions`)}else c("no missing items"),Vue.set(this,"missing",null);r&&h.reverse(),c("navigate item keys",h);let m=null;n||(this.lastVisitedDiscussionKey&&"-"!==this.lastVisitedDiscussionKey?m="discussion"+this.lastVisitedDiscussionKey:this.lastVisitedFileKey&&(m="file"+this.lastVisitedFileKey)),c("navigate current key",m);let g,f,w=r?0:1/0;if(m&&h.length){let e=_.indexOf(h,m);if(i&&r&&this.context.singleFile&&/^file/.test(m)&&!_.includes(h,"discussion"+this.lastVisitedDiscussionKey)){for(;/^discussion/.test(h[(e-1)%h.length]);)e=(e-1)%h.length;/^discussion/.test(h[e])&&(e=(e-1)%h.length)}e=(e+1)%h.length,h=h.slice(e).concat(h.slice(0,e)),w=(h.length-e)%h.length}const y=_.find(h,(e,t)=>{if(g=t,/^discussion/.test(e))return i(e.replace(/^discussion/,""));if(/^file/.test(e)){const t=_get(this,"review","files",e.replace(/^file/,""));if(!t)return;return s(t)||this.context.singleFile&&this.context.onlyFile!==t&&_.some(_.defaults({},this.review.discussions,_get(this,"state","drafts")),e=>{const s=_get(this,"review","files",e.fileKey,"revisions",e.revisionKey,"inferred","file");return!(!s||s.$key!==t.$key||!i(e.$key))&&(f=i,!0)})}});c("navigate target key",y,f?"(delayed discussion predicate)":"");const b=!!y&&g>=w;if(o&&a&&(b||v)){c("navigate invoking wraparound hook",b?"[wrapped]":"",v?"[empty]":"");if(await a({descriptor:t,filePredicate:s,discussionPredicate:i,candidateSetEmpty:v,extraItemKeys:p,matchingAllItemKeys:d,matchingItemKeys:u,reverse:r,resetCurrent:n,wrappedAround:b}))return this._findAndVisitFileOrDiscussion(t,s,i,{reverse:r,resetCurrent:n,onWraparound:a,allowWraparoundRetry:!1})}if(b){const t=!!e.defaultOptions.duration,s=document.querySelector(".wrapped.around");s&&(Vue.set(s.style,"display","block"),anime({targets:s,opacity:[1,t?0:1],scale:[1,t?.8:1],duration:500,easing:"easeInSine",complete(){Vue.set(s.style,"display","none")}}))}return/^discussion/.test(y)?(this.visitDiscussion(y.replace(/^discussion/,"")),!0):!!/^file/.test(y)&&(this.visitFile(this.review.files[y.replace(/^file/,"")],!0,t,f,r),!0)}async visitFileKey(e){await this.$when(()=>_get(this,"review","files")),this.review.files[e]&&(Vue.set(this,"targetFileKey",e),await this.$when(()=>_get(this,"review","files","diffs","ready")&&0===this.context.numRunningDiffTransitions),await this.visitFile(this.review.files[e],!0),Vue.set(this,"targetFileKey",void 0))}async visitFile(t,s,i,r,u){if(c("navigate to file",_get(t,"$key"),`(${_get(t,"path")}
1)`,_get(t,"assimilated")?"[assimilated]":"",!s&&n.externalLinkActive?"[external]":""),t&&!t.assimilated)if(s||Vue.set(o.onboarding,"clickedOnFilename",!0),s||!n.externalLinkActive)if(_.forEach(this.context.toggles,e=>{Vue.set(e,"overlay",!1)}),Vue.set(this,"lastVisitedDiscussionKey",null),this.context.singleFile)if(this.context.fullInterface)if(Vue.set(this.context,"onlyFile",t),Vue.set(this,"lastVisitedFileKey",this.context.onlyFile.$key),t.diff&&t.diff.force("soft"),c("navigate in single file mode",t.diff?"(diff forced)":""),r){c("navigate waiting for diff to be shown"),await this.$when(()=>_get(this,"context","onlyFile","diff","current","shown"));const e=_.map(document.querySelectorAll(`#file${this.context.onlyFile.$key} .discussion.item`),e=>e.getAttribute("id").replace(/^discussion/,""));if(i){const t=_.difference(_(this.context.onlyFile.parleys).map("$key").filter(r).value(),_.filter(e,r));if(t.length){const e=t.length;Vue.set(this,"missing",{descriptor:i,numParleys:e,numFiles:0,filePredicate:_.noop,discussionPredicate:r}),c(`missing 0 files and ${e} discussions after moving to next file`)}}u&&e.reverse();const t=_.find(e,r);c("navigate to delayed discussion, keys",e,"; found",t),t&&this.visitDiscussion(t)}else{const t=document.querySelector(".files.content");e.scrollPage(t.getBoundingClientRect().top+a.scrollContexts.primary.scrollY()-this.$store.services.ruler.scrollOffset)}else l.go({path:`${this.context.baseReviewUrl}/${encodeURI(t.path)}`,hash:null},{replace:!0})&&(Vue.set(this.context,"onlyFile",t),Vue.set(this,"lastVisitedFileKey",this.context.onlyFile.$key));else Vue.set(t,"nonTrivialLatch",!0),this._activateFile(t),c("navigate file activated"),_.defer(()=>{this.$destroyed||this.visitPanel(t.$key)});else window.open(t.uri)}async visitDiscussion(e,s){if(c("navigate to discussion",e),e){if("-cmd"===e)return Vue.set(this,"lastVisitedDiscussionKey","-cmd"),await this.visitPanel("pullRequest");if(await this.$when(()=>_get(this,"review","discussions")),_(this.review.discussions.parleys).map("$key").includes(e)){if("-top"===e&&!document.getElementById("discussion-top"))return this.visitPanel("publish"),void Vue.set(this,"lastVisitedDiscussionKey",e);if(Vue.set(this,"targetDiscussionKey",e),_.forEach(this.context.toggles,e=>{Vue.set(e,"overlay",!1)}),await this.$when(()=>_get(this,"review","files","diffs","ready")&&0===this.context.numRunningDiffTransitions&&(1===_get(this,"review","discussions",e,"showing")||1===_get(this,"review","state","drafts",e,"showing"))),i.clearLastFocusedDraftScope(),_.defer(()=>{t.scrollToAndEmphasizeDiscussion(e)}),s){_.isNumber(s)||(s=2);const t=_get(this,"review","discussions",e)||_get(this,"review","state","drafts",e);_get(t,"locator")&&Vue.set(t.locator,"commentExhibitionLevel",s)}}}}overlayPanel(e){const t=this.context.toggles[e];t&&(Vue.set(t,"overlay",!0),c("opening overlay for",e))}async visitPanel(t,{scrollToExtra:s=!1}={}){const i=_.find(this.$store.services.guideDirectory.guides,e=>_.includes(e.hotkeyActions,`visit('${t}')`));i&&Vue.set(o.onboarding,i.onboardingKey,!0);const r=this.context.toggles[t];if(_get(r,"sidebar"))return this.overlayPanel(t);
1const n=document.querySelector(`[data-panel-key=${t}]`),l=s&&document.getElementById(`${t}-extra`)||n;if(s&&r.toggleExtra(!0),r&&!r.showing||null===_get(n,"offsetParent"))return Vue.set(r,"overlay",!0),void(s&&_.delay(async()=>{const s=document.querySelector(`.overlay[open] #${t}-extra`),i=document.querySelector(".overlay[open] .ui.segment.contents");s&&i&&anime({targets:i,scrollTop:s.getBoundingClientRect().top,duration:e.defaultOptions.duration,easing:e.animeJsEasing})},2*e.defaultOptions.duration));l&&(c("navigate scrolling to",l),await e.scrollPage(l.getBoundingClientRect().top+a.scrollContexts.primary.scrollY()-this.$store.services.ruler.scrollOffset),n.parentElement.classList.contains("file")&&_get(this,"review","files",t)&&this.selectFile(this.review.files[t]),_.delay(()=>{const t=n.getElementsByClassName("panel bouncer")[0];e.shouldAnimate()&&anime.timeline({targets:t}).add({duration:.33*e.defaultOptions.duration,scaleX:1.3,easing:"easeOutQuad"}).add({duration:e.defaultOptions.duration,scaleX:1,easing:"easeOutBounce"})},e.defaultOptions.duration))}_activateFile(e){this.$when(()=>e.diff).then(()=>e.diff.force("soft"));const t=e.getNextLikelyFile();t&&this.$when(()=>t.diff).then(()=>t.diff.force("soft"))}_isFileUnreviewed(e){return _get(this,"review","files","num","toReview")?e.currentRevisionToBeReviewed:e.neutrallyUnreviewed}_isFileChanged(e){return!_get(e,"diff","current")||!_get(e,"diff","empty")}_isFileVisible(e){return!(e.assimilated||e.trivial)}_isDiscussionKeyUnreplied(e){const t=_get(this,"review","tracker",e);return t&&!t.replied}_isDiscussionKeyUnresolved(e){if("-top"===e)return!1;const t=_get(this,"review","tracker",e);return t?!_get(t,"resolvedIf","draftsSent"):!_get(this,"state","drafts",e,"sendingWillResolve")}_isDiscussionKeyUnresolvedWithoutDraft(e){if("-top"===e)return!1;const t=_get(this,"review","tracker",e);return t&&!_get(t,"resolvedIf","draftsSent")&&!_get(this,"state","drafts",e)}_isDiscussionDisposition(e,t){const s=_get(this,"review","tracker",e);return s&&s.currentEffectiveDisposition===t}_getNavigators(){return{UnreviewedFile:{target:"unreviewed file[s]",methods:["next","prev"],condition:()=>_get(this,"review","stateReady")&&_get(this,"review","core","lastRevisionKey")&&(_get(this,"review","files","num","toReview")||_get(this,"review","files","num","unreviewed")),onboardingKey:"nextUnreviewedFile",fileSelector:()=>this._isFileUnreviewed},ChangedFile:{target:"changed file[s]",fileSelector:()=>this._isFileChanged},VisibleFile:{target:"visible file[s]",methods:["next"],fileSelector:()=>this._isFileVisible},File:{target:"file[s]",fileSelector:()=>_.constant(!0)},UnrepliedDiscussion:{target:"unreplied discussion[s]",methods:["next","prev"],condition:()=>_get(this,"review","tracker","num","unreplied"),onboardingKey:"nextUnrepliedDiscussion",discu
1ssionSelector:()=>this._isDiscussionKeyUnreplied},UnresolvedDiscussion:{target:"unresolved discussion[s]",methods:["next","prev"],condition:()=>_get(this,"review","tracker","num","unresolvedIfDraftsSent"),onboardingKey:"nextUnresolvedDiscussion",discussionSelector:()=>this._isDiscussionKeyUnresolved},UnresolvedDiscussionWithoutDraft:{target:"unresolved discussion[s] with no draft",condition:()=>_get(this,"review","tracker","num","unresolvedIfDraftsSent"),onboardingKey:"nextUnresolvedDiscussion",discussionSelector:()=>this._isDiscussionKeyUnresolvedWithoutDraft},DiscussionWithDisposition:{target:e=>`discussion[s] where you're ${e}`,discussionSelector:e=>_.partialRight(this._isDiscussionDisposition,e)},Discussion:{target:"discussion[s]",discussionSelector:()=>_.constant(!0)},Draft:{target:"draft[s]",methods:["next","prev"],condition:()=>_get(this,"state","num","drafts"),onboardingKey:"nextDraft",discussionSelector:()=>e=>e in this.state.drafts},ChangedFileOrUnrepliedDiscussion:{target:"changed file[s] or unreplied discussion[s]",methods:["next","prev"],onboardingKey:"nextUnreviewedFileOrUnrepliedDiscussion",onWraparound:e=>{if(e)return async()=>!!this.review.userIsReviewingFiles&&(!!_get(this,"review","files","diffs","proposedBoundsNeededToAdvanceReview")&&(c("navigate advancing to proposed bounds"),this.review.files.diffs.setProposedBounds(),await this.$nextTick(),await this.$nextTick(),!0))},fileSelector:()=>_get(this,"review","stateReady")&&this.review.userIsReviewingFiles&&this.review.core.lastRevisionKey&&_get(this,"review","files","num","toReview")?e=>e.currentRevisionToBeReviewed:null,discussionSelector:()=>_get(this,"review","tracker","num","unreplied")?this._isDiscussionKeyUnreplied:null}}}registerHotkeys(e){r.register("visitFileMatrix",()=>this.visitPanel("fileMatrix"),e),r.register("visit",e=>this.visitPanel(e),e),r.register("showHideAllComments",e=>{this.review&&this.exhibitParleys(e?2:0,this.review.discussions.parleys)},e),r.register("toggleCurrentFileReviewed",e=>{this.lastVisitedFile&&this.lastVisitedFile.toggleReviewed(e)},e);const t=[{label:"next",reverse:!1,resetCurrent:!1},{label:"prev",reverse:!0,resetCurrent:!1},{label:"first",reverse:!1,resetCurrent:!0},{label:"last",reverse:!0,resetCurrent:!0}];_.forEach(this._getNavigators(),(s,i)=>{for(const n of t){const t=async(...e)=>{try{if(!this.review||s.condition&&!s.condition())return;s.onboardingKey&&Vue.set(o.onboarding,s.onboardingKey,!0),await this._findAndVisitFileOrDiscussion(_.isFunction(s.target)?s.target(...e):s.target,s.fileSelector&&s.fileSelector(...e)||null,s.discussionSelector&&s.discussionSelector(...e)||null,{reverse:n.reverse,resetCurrent:n.resetCurrent,onWraparound:s.onWraparound&&s.onWraparound(...e)||null})}catch(e){Sentry.captureException(e,{extra:{context:"navigate"}})}},a=`${n.label}${i}`;r.register(a,t,e),_.includes(s.methods,n.label)&&!_.has(this,a)&&Object.defineProperty(this,a,{get:_.constant(t),enumerable:!1})}})}}}},!1,!0,{filename:"src/model/services/reviewContext/services.reviewContext.$pageKey.navigation.js",modelPath:"/services/reviewContext/$pageKey/navigation",modelExportName:"ReviewNavigation"}),_reviewable.define(["ReviewContexts"],[],function(){"use strict";return{ReviewContexts:class ReviewContexts{constructor(){Vue.set(this,"current",void 0)}create(e,t,s,i){const r=e,n=t;e=_.toLower(e),t=_.toLower(t);let a=_.find(this,{owner:e,repo:t,pullRequestNumber:s});if(a)a.$ref.update({fullInterface:i,_claims:a._claims+1});else{const o=this.$newKey();_ref(this,"child",o).set({owner:e,repo:t,capitalizedOwner:r,capitalizedRepo:n,pullRequestNumber:s,fullInterface:i,_claims:1}),a=this[o]}return Vue.set(this,"current",a)}leave(e){e._claims&&e.$ref.update({_claims:e._claims-1}),this.current!==e||e._claims||Vue.set(this,"current",void 0)}}}},!1,!0,{filename:"src/model/services/reviewContext/services.reviewContext.js",modelPath:"/services/reviewContext",modelExportName:"ReviewContexts"}),_reviewable.define(["AuthService"],["config","safeStorage","session","corpsman","analytics","bus"],function(e,t,s,i,r,n){"use strict";const a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_-",o="oauth_secret";const l=new class AuthStorage{constructor(e){Vue.set(this,"_key",e),Vue.set(this,"_data",void 0)}set(t){Vue.set(this,"_data",t),this._store(this._key,t,"localStorage"),this._store(this._key,t,"sessionStorage"),this._store("reviewable:signedin::"+e.firebase,!0,"localStorage")}get(){return this._data||Vue.set(this,"_data",this._retrieve(this._key,"localStorage")),this._data||Vue.set(this,"_data",this._retrieve(this._key,"sessionStorage")),this._data}_store(e,s,i){const r=t["localStorage"===i?"local":"session"];r&&(s?r.setItem(e,JSON.stringify(s)):r.removeItem(e))}_retrieve(e,t){try{const s=window[t];if(!s)return;let i=s.getItem(e);return i&&(i=JSON.parse(i)),i}catch{}}}("reviewable:session::"+e.firebase);const c=new class PopupController{constructor(){Vue.set(this,"_windowRef",void 0)}get opened(){return this._windowRef&&!this._windowRef.closed}open(e){this.close();let t=1025,s=800,i=0,r=0;window.screen&&(t=Math.min(window.screen.width,t),s=Math.min(window.screen.height,s),i=(window.screen.width-t)/2,r=(window.screen.height-s)/2),Vue.set(this,"_windowRef",window.open(e,"ReviewableAuth","menubar=0,toolbar=0,location=0,status=0,scrollbars=1,width="+t+",height="+s+",left="+i+",top="+r))}close(){if(this.opened)try{this._windowRef.close()}catch{}Vue.set(this,"_windowRef",void 0)}post(e){this.opened&&this._windowRef.postMessage(null,e)}isSource(e){return e.source===this._windowRef}};class AuthFlow{constructor(e){Vue.set(this,"_truss",e),Vue.set(this,"_deferred",function(){const e={};return Vue.set(e,"promise",new Promise((t,s)=>{Vue.set(e,"resolve",t),Vue.set(e,"reject",s)})),e}()),Vue.set(this,"_finished",!1);const t=()=>{Vue.set(this,"_finished",!0)};this._deferred.promise.then(t,t)}get promise(){return this._deferred.promise}get active(){return!this._finished}complete(){this._deferred.resolve()}cancel(){this._deferred.reject(new Error("Canceled"))}}class PopupAuthFlow extends AuthFlow{static start(e,t){return new PopupAuthFlow(e,t)}constructor(e,t){super(e),Vue.set(this,"_popupInterval",void 0),Vue.set(this,"_processMessage",this._processMessage.bind(this)),_.defer(()=>this._openPopup(t))}_openPopup(e){if(c.open(u(e)),!c.opened){const e=new Error("Unable to pop up window");return Vue.set(e,"code","TRANSPORT_UNAVAILABLE"),i.markHandled(e),void this._deferred.reject(e)}window.addEventListener("message",this._processMessage),Vue.set(this,"_popupInterval",setInterval(this._poll.bind(this),250))}_poll(){if(c.opened)try{c.post(e.authHostUrl)}catch{this._cleanup();const e=new Error("Unable to communicate with popup window");Vue.set(e,"code","TRANSPORT_UNAVAILABLE"),this._deferred.reject(e)}else{this._cleanup();const e=new Error("User cancelled");Vue.set(e,"code","USER_CANCELLED"),this._deferred.reject(e)}}_processMessage(t){if(t.origin===e.authHostUrl&&c.isSource(t)){if(this._cleanup(),t.data.error){const e=new Error(t.data.error);return Vue.set(e,"code",t.data.code),void this._deferred.reject(e)}l.set(t.data.extra),this._truss.authenticate(t.data.v5Token).then(this._deferred.resolve,this._deferred.reject)}}_cleanup(){c.close(),clearInterval(this._popupInterval),window.removeEventListener("message",this._processMessage)}}class RedirectAuthFlow extends AuthFlow{static start(e,s){const i=(r=50,_.times(r,()=>a.charAt(function(e){if(!window.crypto||!window.crypto.getRandomValues)return _.random(e-1);{const t=new Uint8Array(1);for(;;)if(window.crypto.getRandomValues(t),t[0]<e)return t[0]}}(54))).join(""));var r;return t.local.setItem(o,i),window.location.href=u(_.assign({redirect:!0,secret:i},s)),new RedirectAuthFlow(s)}static finish(e){const s=new URL(window.location.href);let r;try{r=decodeURIComponent(_.trimStart(s.hash,"#"))}catch{}if(/^auth=/.test(r)){const n=r.match(/^auth=(.*?)(?:&secret=(.*?))?(?:&(.*))?$/);Vue.set(s,"hash",n[3]?`#${_.trimStart(n[3],"#")}`:""),window.history.replaceState(null,"",s.href);if(t.local.getItem(o)===n[2]){const t=JSON.parse(n[1]);t.error?"USER_CANCELLED"!==t.code&&i.setFailure("auth","Unable to sign in: "+t.error,{icon:"auth"}):(l.set(t.extra),e.authenticate(t.v5Token).catch(e=>{"USER_CANCELLED"!==e.code&&i.setFailure("auth","Unable to sign in: "+t.error,{icon:"auth"})}))}}t.local.removeItem(o)}constructor(e,t){super(e)}}function u(t){let s=e.authHostUrl+"/auth";const i=[];return t.scope&&i.push("scope="+encodeURIComponent(t.scope)),t.redirect&&i.push("origin="+encodeURIComponent(window.location.href)),t.secret&&i.push("secret="+encodeURIComponent(t.secret)),i.length&&(s+="?"+i.join("&")),s}return{AuthService:class AuthService{constructor(){Vue.set(this,"_flow",void 0),Vue.set(this,"_lastSignedUpUid",void 0),Vue.set(this,"_invalidationPending",!1),Vue.set(this,"_disabledCounter",0),Vue.set(this,"_lastReviewsPath",void 0),Vue.set(this,"_lastReviewsPathUserId",void 0),Vue.set(this,"_expiryFinalizationStarted",!1),RedirectAuthFlow.finish(this.$truss),this.$intercept("certify",{onBefore:e=>this._decorateUser(e.operand)}),this.$observe(()=>this.$info.user,(e,t)=>{this._updateUser(e,t)}),this.$observe(()=>this.expiryPhase,e=>{"finalizing"!==e&&"expired"!==e||this.finalizeExpiredAuth(e)}),this.$observe(()=>_get(this,"$info","user","github","scopes"),(e,t)=>{(_.onlyOneContains(e,t,"repo")||_.onlyOneContains(e,t,"read:org"))&&this.$store.queues.requests.send({action:"syncOwnerships",force:!!t},{fireAndForget:!0})})}get disabled(){return Boolean(this._disabledCounter)}get authFinalizationStarted(){return this._expiryFinalizationStarted}get _interactiveExpiryUser(){const e=_get(this,"$info","user");if(e&&!e.enterpriseGuest&&!_get(e,"github","agentKey")&&!_get(e,"claims","aid"))return e}get expiryRemaining(){const e=this._interactiveExpiryUser;if(e&&_get(e,"claims","expires"))return e.claims.expires-this.$info.nowAtInterval(6e4)}get expiryPhase(){if(!this._interactiveExpiryUser)return;const e=this.expiryRemaining;return!e||e<0?"expired":e<=9e5?"finalizing":e<=6048e5?"warning":void 0}async _decorateUser(t){if(!t)return void(e.encryptionEnabled&&!e.encryptionAesKey&&(Sentry.addBreadcrumb({category:"auth",message:"Releasing encryption key"}),await Truss.worker.configureEncryption("notready"),Sentry.addBreadcrumb({category:"auth",message:"Encryption key released"})));const s=l.get();if(!t.github){if(!_get(s,"github","scopes"))return this.logout("missingExtra",!0);if(Vue.set(t,"github",s.github),t.github.agentKey){if(t.github.agentKey!==t.claims.aid)return this.logout("mismatchedExtra",!0)}else if(`github:${t.github.id}`!==t.uid)return this.logout("mismatchedExtra",!0)}if(_get(s,"lastDashboardOrganization")&&(Vue.set(this,"_lastReviewsPath",`/reviews/${s.lastDashboardOrganization}
1`),Vue.set(this,"_lastReviewsPathUserId",t.uid)),t.enterpriseGuest||Vue.set(t,"enterpriseGuest",s.enterpriseGuest),t.missiveIdentityDigest||Vue.set(t,"missiveIdentityDigest",s.missiveIdentityDigest),e.hasEmuSuffixes){if(!_.isArray(s.emuSuffixes))return this.logout("missingExtra",!0);Vue.set(t,"emuSuffixes",s.emuSuffixes)}if(!t.claims.expires||t.claims.expires<this.$now)return this.logout("expiredLogout",!0);if(t.github.baseScopes||(Vue.set(t.github,"baseScopes",t.github.scopes),Vue.set(t.github,"baseScopesString",t.github.scopes.join(",")),Vue.set(t.github,"scopes",function(e){const t=[];return _.forEach(e,e=>{switch(e){case"user":t.push("user:email","user:follow");break;case"repo":t.push("public_repo","repo_deployment","repo:status","notifications");break;case"write:repo_hook":t.push("read:repo_hook");break;case"admin:repo_hook":t.push("write:repo_hook","read:repo_hook");break;case"write:org":t.push("read:org");break;case"admin:org":t.push("write:org","read:org");break;case"write:public_key":t.push("read:public_key");break;case"admin:public_key":t.push("write:public_key","read:public_key")}}),Object.seal(_.union(e,t))}(t.github.baseScopes))),e.encryptionEnabled&&!e.encryptionAesKey){if(!_get(s,"encryptionAesKey"))return this.logout("missingExtra",!0);try{await Truss.worker.configureEncryption("aes-siv",s.encryptionAesKey,e.encryptionKeyCheckValue),Sentry.addBreadcrumb({category:"auth",message:"Encryption key acquired"})}catch(e){if(void 0!==this.$info.user||"WRONG_KEY"!==e.firecrypt)throw e;await this.logout("stalekey",!0)}}}_updateUser(e,t){if(e===t)return;Vue.set(this,"_expiryFinalizationStarted",!1);const n=_.cloneDeep(e);if(_get(n,"github","accessToken")&&Vue.set(n.github,"accessToken","[redacted]"),Sentry.addBreadcrumb({category:"auth",data:n}),(e&&!t||!e&&t)&&i.clearCondition("ghquota"),e){e.enterpriseGuest&&this.checkEnterpriseUpgradeEligibility(),i.setTag("auth","authed"),i.clearFailure("auth"),Vue.set(s.onboarding,"signedIn",!0),Sentry.setUser({id:e.uid,username:e.github.username,name:e.github.displayName,email:e.github.email||null});const t=_ref(this.$store,"child","users",e.uid);_ref(t,"child","timestamp").peek(s=>{s||this._lastSignedUpUid===e.uid||(s=this.$now,r.alias(e.uid),r.track("Signed up"),Vue.set(this,"_lastSignedUpUid",e.uid),_ref(t,"child","timestamp").set(s)),r.identify(e.uid,{avatar:e.github.profileImageURL||null,email:e.github.email||null,name:e.github.displayName||e.github.username,username:e.github.username,createdAt:s})}),_.startsWith(e.uid,"github:")&&this.$store.queues.requests.send({action:"syncCustomer"},{fireAndForget:!0}),i.clearCondition("autherror")}else i.setTag("auth","unauthed"),Sentry.setUser(),r.identify(),l.set(null);_get(this,"_flow","active")&&this._flow.complete()}updateExtra(e){l.set(_.assign(l.get()||{},e))}setExtra(e){l.set(e)}refresh(e="optional"){return this.login(null,e,{force:!0})}async login(t,s,r={}){Sentry.addBreadcrumb({category:"auth",message:"Login",data:{extraScopes:t,flowType:s,loginOptions:r}});const n={rememberMe:!0};if(t){if(!this.$info.userid)throw new Error("Cannot request extra auth scopes before signing in");let s=_.difference(t,this.$info.user.github.scopes);if(!s.length)return;if(this.$store.services.headless.auth.active){if(await this.$store.services.headless.auth.refreshNow("missing-scopes",{resetPermissions:!0}),s=_.difference(t,this.$info.user.github.scopes),!s.length)return;const i=`${e.hostUrl}/?scopes=${s.join(",")}`;throw _.assign(new Error(`Agents cannot request additional GitHub authorization scopes. Have a human authorize those scopes at ${i} before retrying.`),{code:"headless_extra_scopes_required",details:{authorizationUrl:i,missingScopes:s}})}Vue.set(n,"scope",_.union(t,this.$info.user.github.baseScopes,["user:email"]).join(",")),Vue.set(n,"login",this.$info.user.github.username)}else{if(this.$info.userid&&!r.force&&!this.$store.services.warden.permissions.authStale)return;if(_get(this,"_flow","active"))return this._flow.promise}if(this.$store.services.headless.auth.active){if(this.$store.services.warden.permissions.authStale&&(await this.$store.services.headless.auth.refreshStalePermissions(),!this.$store.services.warden.permissions.authStale))return;throw _.assign(new Error("Agents cannot start an interactive GitHub authorization flow."),{code:"headless_auth_flow_unavailable"})}const a=e.legacyIeOrEdge||"redirect"===s||/(^|;)\s*reviewable_auth_method\s*=\s*redirect\s*(;|$)/.test(document.cookie);if(a&&"popup"===s)return;const o=a?RedirectAuthFlow:PopupAuthFlow;if(this.disabled)return await this.$when(()=>!this.disabled),this.login(t,s,r);_get(this,"_flow","active")&&this._flow.cancel(),this.disable(),i.clearFailure("auth");try{Vue.set(this,"_flow",o.start(this.$truss,n)),await this._flow.promise}catch(e){if(i.markHandled(e),"TRANSPORT_UNAVAILABLE"===e.code&&o!==RedirectAuthFlow){
1if("popup"!==s)try{Vue.set(this,"_flow",RedirectAuthFlow.start(this.$truss,n)),await this._flow.promise}catch(e){l(e)}}else l(e)}finally{this.enable(),i.clearCondition("samlerror")}function l(e){if("USER_CANCELLED"!==e.code||t){const s="Unable to "+(t?"authorize":"sign in")+": "+e.message;i.setFailure("auth",s,{icon:"auth"})}if("optional"!==s)throw e}}finalizeExpiredAuth(e){if(this._expiryFinalizationStarted||!this.$info.userid)return;Vue.set(this,"_expiryFinalizationStarted",!0),Sentry.addBreadcrumb({category:"auth",message:"Finalizing expired auth",data:{reason:e}});const t=[];try{n.flush(),n.saveAllDrafts(t),n.deleteEmptyDrafts()}catch(e){i.capture(e,"flush and save drafts before auth expiry logout")}_.forEach(t,e=>{Promise.resolve(e).catch(e=>{i.capture(e,"save draft before auth expiry logout")})}),this.logout(e,!0)}async logout(e,t){if(Sentry.addBreadcrumb({category:"auth",message:"Logout",data:{tag:e,forced:t}}),this.disabled&&!t)return await this.$when(()=>!this.disabled),this.logout(e);Vue.set(s.onboarding,"signedOut",!0),i.clearCondition("autherror"),await this.$nextTick(),await this.$truss.unauthenticate(),this._flow&&this._flow.complete()}get shouldShowLogin(){return null===this.$info.user||void 0===this.$info.user&&"autherror"===i.condition}disable(){this._disabledCounter++}enable(){this._disabledCounter--}invalidateGitHubToken(e,t=null){this._invalidationPending||!e&&!this.$info.user||(Vue.set(this,"_invalidationPending",!0),_.defer(async()=>{try{await this.logout("tokenLogout")}catch(e){i.capture(e,"failed tokenLogout")}Vue.set(this,"_invalidationPending",!1),await this.$nextTick(),_get(t,"error")?i.setCondition(t.error,t.org):i.setCondition("autherror","Your GitHub authorization is no longer valid. Please sign in again to reauthorize.")},100))}async checkEnterpriseUpgradeEligibility(){if(!_get(this,"$info","user","claims","aid"))try{const e=await this.$store.queues.requests.send({action:"checkEnterpriseSeats"});_get(e,"expires")&&this.updateExtra({enterpriseGuest:!1}),_get(e,"v5Token")&&await this.$truss.authenticate(e.v5Token)}catch(e){i.capture(e,"checkEnterpriseSeats")}}get lastReviewsPath(){return this._lastReviewsPathUserId===this.$info.userid&&this._lastReviewsPath||"/reviews"}set lastReviewsPath(e){Vue.set(this,"_lastReviewsPath",e),Vue.set(this,"_lastReviewsPathUserId",this.$info.userid)}}}},!1,!0,{filename:"src/model/services/services.auth.js",modelPath:"/services/auth",modelExportName:"AuthService"}),_reviewable.define(["AvatarsService"],["config"],function(e){"use strict";const t="https://github.com"===e.gitHubUrl?/(https:\/\/avatars.*\.githubusercontent\.com\/[^?]*)(\?)?/:new RegExp(`(${e.gitHubUrl}/avatars/[^?]*)(\\?)?`);return{AvatarsService:class AvatarsService{constructor(){Vue.set(this,"users",{}),Vue.set(this,"_avatarUrlCache",{})}inferGitHubAvatarUrl(t){if(!/^github(team)?:/.test(t))return;return`${"https://github.com"===e.gitHubUrl?"https://avatars.githubusercontent.com":`${e.gitHubUrl}/avatars`}/${_.startsWith(t,"githubteam:")?"t":"u"}/${t.replace(/.*:/,"")}?s=60&`}scaleGitHubAvatarUrl(e){if(!e)return;let s=this._avatarUrlCache[e];return s||Vue.set(this._avatarUrlCache,e,s=e.replace(t,"$1?s=60&")),s}connectUser(e){/^(github|ghagent):/.test(e)&&(e in this.users||this.$connect(this.users,{[e]:_ref(this.$store,"child","users",e,"core","public")}))}}}},!1,!0,{filename:"src/model/services/services.avatars.js",modelPath:"/services/avatars",modelExportName:"AvatarsService"}),_reviewable.define(["BreadcrumbSampler"],[],function(){"use strict";const e=3e5;return{BreadcrumbSampler:class BreadcrumbSampler{constructor(){Vue.set(this,"_bucketsByScopeKey",{}),Vue.set(this,"_nextBucketCleanup",0)}_normalizeData(e){if(!_.isNil(e))return _.isArray(e)?_(e).map(e=>this._normalizeData(e)).compact().value():_.isPlainObject(e)?_(e).map(e=>this._normalizeData(e)).pickBy(e=>void 0!==e).value():e}_buildBreadcrumbData(e,t){return this._normalizeData({sampleCount:t,...e})}_addBreadcrumb(e,t,s,i){return Sentry.addBreadcrumb({category:e,message:t,data:this._buildBreadcrumbData(s,i)}),!0}_cleanupBuckets(t){t<this._nextBucketCleanup||(Vue.set(this,"_nextBucketCleanup",t+e),_.forOwn(this._bucketsByScopeKey,(s,i)=>{t-s.startedAt>=e&&Vue.delete(this._bucketsByScopeKey,i)}))}addBreadcrumb(e,t,s,i={}){return this._addBreadcrumb(e,s,i)}addSampledBreadcrumb(t,s,i,r={}){const n=Date.now();this._cleanupBuckets(n);const a=`${t}|${s||"unknown"}|${i}`;let o=this._bucketsByScopeKey[a];return(!o||n-o.startedAt>=e)&&(o=Vue.set(this._bucketsByScopeKey,a,{startedAt:n,count:0})),!(o.count>=10)&&(o.count+=1,this._addBreadcrumb(t,i,r,o.count))}}}},!1,!0,{filename:"src/model/services/services.breadcrumbSampler.js",modelPath:"/services/breadcrumbSampler",modelExportName:"BreadcrumbSampler"}),_reviewable.define(["ChangelogService"],["config","corpsman","session"],function(e,t,s){"use strict";const i=["fix","upd","new"],r=new RegExp(_([/^<sub>(?<year>\d\d\d\d) - (?<month>\d\d)(?<suffix>.*?)<\/sub>.*$/,/^<sub>.*(?<releaseDate>\d\d\d\d-\d\d-\d\d) <!-- enterprise (?<releaseVersion>\d+\.\d+) --><\/sub>.*$/,/^-\s*(?:<kbd>)?(?<type>.*?)(?:\s*(?:<i>)?\((?<env>.*?)\)(?:<\/i>)?)?\s*:\s*(?:<\/kbd>)?\s*(?<title>.*?)(?:\s*<!-- (?<stream>.*?)(?: (?<version>\d+))? -->)?$(?<body>(?:\n {0,2}>(?: .*|))*)?/]).map(e=>`(?:${e.source})`).join("|"),"gm"),n="enterprise"===e.env?_(e.systemBuild).split(".").map(_.parseInt).value():[4743,7616],a=new Intl.DateTimeFormat("en-US",{month:"long",year:"numeric"});return{ChangelogService:class ChangelogService{constructor(){Vue.set(this,"fetched",null),Vue.set(this,"displayed",!1),Vue.set(this,"_items",[]),Vue.set(this,"_renders",new Map),Vue.set(this,"_fetching",!1),Vue.set(this,"_rendering",0),Vue.set(this,"error",void 0),"/headless"!==window.location.pathname&&("undefined"==typeof requestIdleCallback?setTimeout(()=>this.fetch(2e4),5e3):requestIdleCallback(()=>this.fetch(2e4)))}get _initLastSeen(){this.$info.userid&&s.settings.$ready&&this._items.length&&!_get(s,"settings","changelog","lastSeen")&&this._items.length&&this.markSeen()}markSeen(){!this.error&&this._items.length&&_.set(s.settings,"changelog.lastSeen",{server:_(this._items).filter({kind:"change",stream:"server"}).find("version").version,client:_(this._items).filter({kind:"change",stream:"client"}).find("version").version})}get busy(){return this._fetching||this._rendering}get importanceThreshold(){return _get(s,"settings","changelog","importanceThreshold")||("enterprise"===e.env?2:4)}set importanceThreshold(e){Vue.set(s.onboarding,"changedImportanceThreshold",!0),_.set(s.settings,"changelog.importanceThreshold",e)}get availabilityThreshold(){if("enterprise"===e.env)return _get(s,"settings","changelog","availabilityThreshold")||3}set availabilityThreshold(t){"enterprise"===e.env&&(Vue.set(s.onboarding,"changedAvailabilityThreshold",!0),_.set(s.settings,"changelog.availabilityThreshold",t))}get availableChanges(){if("saas"===e.env)return _.find(this._items,e=>"change"===e.kind&&e.importance>=this.importanceThreshold&&e.version>_get(s,"settings","changelog","lastSeen",e.stream))?"installed":null;if("enterprise"===e.env){return[null,"upcoming","released","installed"][_access(_,"","find","call",[this._items,(e,t)=>"divider"===e.kind&&e.availability>=this.availabilityThreshold&&_(this._items).slice(t+1).takeWhile({kind:"change"}).some(e=>e.importance>=this.importanceThreshold&&e.version>_get(s,"settings","changelog","lastSeen",e.stream))],"","availability")||0]}}get displayedItems(){if(!this.availableChanges&&!this.displayed)return this.$last
1ComputedValue;let t;switch(e.env){case"saas":t=_.filter(this._items,e=>"divider"===e.kind||"change"===e.kind&&e.importance>=this.importanceThreshold);break;case"enterprise":{let e=!1;t=_.filter(this._items,t=>{switch(t.kind){case"divider":return e=t.availability>=this.availabilityThreshold,e;case"change":return e&&t.importance>=this.importanceThreshold}});break}}return t=_.reject(t,(e,t,s)=>"divider"===e.kind&&"divider"===_get(s,t+1,"kind")),this._insertRibbon(t,e=>e.version>_get(s,"settings","changelog","lastSeen",e.stream),"new","New changes"),this._insertRibbon(t,e=>e.version<=_get(s,"settings","changelog","lastSeen",e.stream),"old","Previously seen changes"),t}_insertRibbon(e,t,s,i){let r=_.findIndex(e,e=>"change"===e.kind&&t(e));"divider"===_get(e,r-1,"kind")&&(r-=1),r>=0&&e.splice(r,0,{kind:"ribbon",style:s,title:i})}async fetch(e){if(!this._fetching&&"all"!==this.fetched){Vue.set(this,"error",null);try{Vue.set(this,"_fetching",!0);const t={};e&&Vue.set(t,"Range",`bytes=0-${e}`);const s=await fetch("https://raw.githubusercontent.com/Reviewable/Reviewable/refs/heads/master/CHANGELOG.md",{headers:t});if(!s.ok)throw new Error(`HTTP ${s.status}`);const i=_.parseInt(s.headers.get("content-length"));Vue.set(this,"fetched",!e||i<e?"all":"some"),this._parse(await s.text())}catch(e){t.capture(e,"fetch changelog"),Vue.set(this,"error",e.message)}finally{Vue.set(this,"_fetching",!1)}}}_parse(t){Vue.set(this,"_items",[]);for(const s of t.matchAll(r))if(s.groups.year&&s.groups.month)switch(e.env){case"saas":{const e=a.format(new Date(_.parseInt(s.groups.year),_.parseInt(s.groups.month)-1));this._items.push({kind:"divider",title:`${e}${s.groups.suffix}`});break}case"enterprise":this._items.length||this._items.push({kind:"divider",title:"Upcoming",availability:1})}else if(s.groups.releaseDate&&s.groups.releaseVersion&&"enterprise"===e.env){const e=_(s.groups.releaseVersion).split(".").map(_.parseInt).value(),t=n[0]>=e[0]&&n[1]>=e[1]?3:2,i=`Release ${s.groups.releaseVersion} (${s.groups.releaseDate})`,r=2===t?"ð¤ not yet installed on your instance":null;this._items.push({kind:"divider",title:i,affix:r,availability:t})}else if(s.groups.type&&s.groups.title&&this._items.length){const t=_.toLower(s.groups.type);if(_.includes(i,t)&&(!s.groups.env||s.groups.env===e.env)){const e=s.groups.stream,r=s.groups.version&&_.parseInt(s.groups.version),n=_.indexOf(i,t)+2,a=_.toUpper(s.groups.title[0])+s.groups.title.slice(1),o=_.trim(s.groups.body),l={kind:"change",type:t,stream:e,version:r,importance:n,title:a,body:o};Object.defineProperty(l,"html",{get:()=>this._renders.get(a)}),this._items.push(l)}}"all"!==this.fetched&&this._items.pop()}get _renderChanges(){return(async()=>{const e=_.filter(this.displayedItems,e=>"change"===e.kind&&!this._renders.has(e.title));if(!e.length)return;const i=_.map(e,e=>`- ${e.title}\n${e.body.replace(/^ {0,2}(?=>[ \n])/gm," ")}\n`).join("\n");_.forEach(e,e=>{this._renders.set(e.title,null)}),Vue.set(this,"_rendering",this._rendering+1);try{const t=await s.hubkit().request("POST /markdown",{body:{text:i}}),r=(new DOMParser).parseFromString(t,"text/html").querySelector("ul");_(e).zip(r.children).forEach(([e,t])=>this._renders.set(e.title,_.trim(t.innerHTML)))}catch(s){t.capture(s,"render changelog"),Vue.set(this,"error",s.message),_.forEach(e,e=>{this._renders.delete(e.title)})}finally{Vue.set(this,"_rendering",this._rendering-1)}})()}}}},!1,!0,{filename:"src/model/services/services.changelog.js",modelPath:"/services/changelog",modelExportName:"ChangelogService"}),_reviewable.define(["ColorsService"],[],function(){"use strict";const e={color:"#fff",backgroundColor:"#7a6aa6"};return{ColorsService:class ColorsService{computeLabelColors(e){e=e.replace(/^#/,""),this._computeContrast("ffffff",e)<.02&&(e=this._convertRgbColorToHex(_.map(this._convertHexColorToRgb(e),e=>.98*e)));const t=`#${e}`,s=this._convertRgbColorToHex(_.map(this._convertHexColorToRgb(e),e=>.2*e));return{color:"#"+(this._computeContrast("ffffff",e)>this._computeContrast(s,e)?"ffffff":s),backgroundColor:t}}computeAgentTagColors(t){return t?this.computeLabelColors(t):e}_convertHexColorToRgb(e){return[parseInt(e.slice(0,2),16)/255,parseInt(e.slice(2,4),16)/255,parseInt(e.slice(4,6),16)/255]}_convertRgbColorToHex(e){return _.map(e,e=>("0"+Math.round(255*e).toString(16)).slice(-2)).join("")}_computeLuminance(e){const t=this._convertHexColorToRgb(e);return.299*t[0]+.587*t[1]+.114*t[2]}_computeContrast(e,t){const s=this._computeLuminance(e),i=this._computeLuminance(t);return Math.abs(s-i)}}}},!1,!0,{filename:"src/model/services/services.colors.js",modelPath:"/services/colors",modelExportName:"ColorsService"}),_reviewable.define(["Connection"],["corpsman"],function(e){"use strict";return{Connection:class Connection{constructor(){Vue.set(this,"_connectedHistory",[]),Vue.set(this,"_writes",{outstanding:0,late:0,veryLate:0,stalled:0}),Vue.set(this,"_verdictLatenessLevel",0),Vue.set(this,"_connectedWarningLevel",0),Vue.set(this,"_clearOutstandingWrites",!1),Vue.set(this,"_lastPingTimestamp",0),Vue.set(this,"_lastBounceTimestamp",0),Vue.set(this,"_workingOffline",!1),Vue.set(this,"_connectedTimestamp",0),this.$observe(()=>this.$info.connected,e=>
1{void 0!==e&&(e&&Vue.set(this,"_connectedTimestamp",this.$now),Sentry.addBreadcrumb({category:"connection",message:e?"Connected":"Disconnected"}))},{precise:!0}),this._watchWithDelay(()=>this.$info.connected,{0:e=>{this._connectedHistory.push(e?"c":"d"),e&&Vue.set(this,"_connectedWarningLevel",0)},2e3:e=>{e||Vue.set(this,"_connectedWarningLevel",1)},4e3:e=>{e||Vue.set(this,"_connectedWarningLevel",2)},5e3:e=>{e||Vue.set(this,"_connectedWarningLevel",3)}}),this.$intercept("write",{onBefore:e=>{e.onSlow(0,e=>{e.target.annotations.disregardWrite||(this._writes.outstanding+=e.ready?-1:1,this._writes.outstanding||Vue.set(this,"_clearOutstandingWrites",!1))}),e.onSlow(1500,e=>{this._writes.late+=e.ready?-1:1}),e.onSlow(5e3,e=>{this._writes.veryLate+=e.ready?-1:1}),e.onSlow(25e3,e=>{e.ready||this._pingDatastore()}),e.onSlow(3e4,e=>{e.ready||this._bounceConnection()}),e.onSlow(45e3,e=>{this._writes.stalled+=e.ready?-1:1})}}),this._watchWithDelay(()=>this.$info.connected&&!_get(this,"$store","services","warden","permissions","allVerdictsAcquired"),{0:e=>{e||Vue.set(this,"_verdictLatenessLevel",0)},5e3:e=>{e&&Vue.set(this,"_verdictLatenessLevel",1)},1e4:e=>{e&&Vue.set(this,"_verdictLatenessLevel",2)},15e3:e=>{e&&Vue.set(this,"_verdictLatenessLevel",3)}}),this.$observe(()=>this.offline,(e,t)=>{e&&!t&&Sentry.addBreadcrumb({category:"connection",message:"Offline"}),!e&&t&&Sentry.addBreadcrumb({category:"connection",message:"Online"})},{precise:!0}),this.$observe(()=>this.forcedOffline,e=>{e&&Sentry.captureMessage("Forced offline",{extra:{writes:this._writes,verdictLatenessLevel:this._verdictLatenessLevel,lastConnectedTimestamp:this._lastConnectedTimestamp,now:this.$now,connectedHistory:this._connectedHistory.join(""),reason:this.offlineReason,clearOutstandingWrites:this._clearOutstandingWrites}})})}get _draftConditionWarningLevel(){const e=_get(this,"$store","services","reviewContext","current","review");return _get(e,"state","drafts","completionConditionError")?1:0}get offline(){if(this._workingOffline||e.locked)return!1;const t=this._connectedWarningLevel>=3||this._verdictLatenessLevel>=3||this._writes.stalled>0||this._clearOutstandingWrites&&this._writes.outstanding>0;return t&&Vue.set(this,"_clearOutstandingWrites",!0),t}get forcedOffline(){return this.offline&&this.$info.connected&&this._connectedTimestamp+5e3<this.$info.nowAtInterval(1e3)&&(this._verdictLatenessLevel>=3||this._writes.stalled>0)}get offlineReason(){const e=[];return this._connectedWarningLevel>=3&&e.push("no connection to Firebase"),this._writes.outstanding&&e.push(`${this._writes.outstanding} pending write${this._writes.outstanding>1?"s":""}`+(this._writes.stalled?` (${this._writes.stalled} stalled)`:"")),this._verdictLatenessLevel>=3&&e.push("waiting on permission checks"),e.join(", ")}workOffline(){Vue.set(this,"_workingOffline",!0)}get writesPending(){return this._writes.outstanding}_pingDatastore(){if(e.locked)return;const t=this.$now;this.$info.connected&&this._lastPingTimestamp+3e4<t&&(Vue.set(this,"_lastPingTimestamp",t),_ref(this.$store,"child","system","ping").set(1).catch(t=>{e.markHandled(t)}))}_bounceConnection(){if(e.locked)return;const t=this.$now;this.$info.connected&&this._lastBounceTimestamp+6e4<t&&(Vue.set(this,"_lastBounceTimestamp",t),Truss.bounceConnection())}get _writeLatenessLevel(){return this._writes.veryLate?2:this._writes.late?1:0}get warningLevel(){return Math.max(this._connectedWarningLevel,this._verdictLatenessLevel,this._writeLatenessLevel,this._draftConditionWarningLevel)}get warningExplanation(){let e="";if(this._connectedWarningLevel&&(e+="No connection to Firebase.\n"),this._verdictLatenessLevel&&(e+="Waiting for permissions.\n"),this._writeLatenessLevel&&(e+="Incomplete writes.\n"),this._draftConditionWarningLevel){const t=_get(this,"$store","services","reviewContext","current","review");e+=`Error evaluating completion condition: ${_get(t,"state","drafts","completionConditionError")}\n`}return e}_watchWithDelay(e,t){let s=[];this.$observe(e,e=>{_.forEach(s,e=>{clearTimeout(e)}),s=[],_.forEach(t,(t,i)=>{(i=_.parseInt(i))?s.push(setTimeout(_.partial(t,e),i)):t(e)}
1)},{precise:!0})}}}},!1,!0,{filename:"src/model/services/services.connection.js",modelPath:"/services/connection",modelExportName:"Connection"}),_reviewable.define(["Context"],[],function(){"use strict";return{Context:class Context{constructor(){this.$truss.intercept("read",{onBefore:this._bindContext.bind(this),onAfter:this._unbindContext.bind(this)})}async _bindContext(e){const t=e.target.annotations.context;t&&(await this.$when(()=>!(_get(e,"target","value","context")&&e.target.value.context!==t),{timeout:1e3}),e.ended||Vue.set(e,"unwatchContext",this.$observe(()=>e.target.value,s=>{if(e.unwatchContext&&_.isObject(s)&&s.context!==t){if(s.context&&s.context!==t)throw new Error(`Conflicting contexts set for ${e.target}`);Vue.set(s,"context",t),s._contextOpsCount++}})))}_unbindContext(e){if(!e.unwatchContext)return;e.unwatchContext(),Vue.delete(e,"unwatchContext");const t=e.target.value;_.isObject(t)&&! --t._contextOpsCount&&Vue.set(t,"context",void 0)}}}},!1,!0,{filename:"src/model/services/services.context.js",modelPath:"/services/context",modelExportName:"Context"}),_reviewable.define(["DiffWorkerBridge"],["session","config","Region","fallBackToDedicatedWorkers"],function(e,t,s,i){"use strict";if(!window.diffWorker)try{const e=window.SharedWorker||window.Worker;e&&(window.diffWorker=new e("/js/74b56292.diff_worker.js"))}catch(e){Sentry.captureException(e)}return{DiffWorkerBridge:class DiffWorkerBridge{constructor(){Vue.set(this,"queuedDiffs",[]),Vue.set(this,"calls",{}),Vue.set(this,"workerResponded",!1),Vue.set(this,"_releaseDiffFilesDebounced",_.debounce(this._releaseDiffFiles));const e=window.diffWorker;e&&(Vue.set(this,"port",e.port||e),Vue.set(this.port,"onmessage",this._onmessage.bind(this)));const t=_.once(()=>{setTimeout(()=>{this.workerResponded||i(e)},5e3)});this.$observe(()=>this.$info.userid,e=>{void 0!==e&&(this._resetCache(),t())})}_rejectNoWorker(){return Promise.reject(new Error("Your browser doesn't appear to support web workers; please use a more modern one."))}_onmessage(s){const i=this.calls[s.data.id];if(i)if(("result"in s.data||"error"in s.data)&&Vue.set(this,"workerResponded",!0),"result"in s.data)_.forEach(_get(s,"data","result","ignoredErrors"),e=>{Sentry.captureMessage("Worker "+e)}),i.resolve(s.data.result);else if("error"in s.data){if(/GitHub error.* (403|429)$/i.test(s.data.error)){const t=Hubkit.identify403Error(s.data.error);_get(t,"error")?Vue.set(s.data,"error",t.error):_get(t,"quota")&&(e.user?(Sentry.captureMessage("User out of GitHub quota",{level:"debug",extra:{message:s.data.error,context:"diff worker"}}),Vue.set(s.data,"error","Sorry, you've run out of GitHub API quota for now.")):Vue.set(s.data,"error","Sorry, you've run out of GitHub anonymous request quota. You'll need to sign in to continue working."))}else/GitHub error.* 401$/i.test(s.data.error)&&this.$store.services.auth.invalidateGitHubToken();const t=new Error(s.data.error);s.data.stack&&Vue.set(t,"stack",s.data.stack),i.reject(t)}else i.reject(new Error(`Invalid reply from differ: ${s.data}`));else t.prod||console.log("Unmatched reply from differ: ",s.data)}_releaseDiffFiles(){let e=_.sortBy(this.queuedDiffs,e=>{if(Vue.set(e,"required",e.options.required||!_.isEmpty(e.options.locatedDiscussionKeys)),e.required)return 0;const t=e.options.file;return t&&(t.assimilated||t.trivial)?1/0:1+(t.index||0)});Vue.set(this,"queuedDiffs",[]);const t=Date.now();let s=0;const i=()=>{if(Date.now()>t+1e4)return _.forEach(e,e=>{this.calls[e.id].resolve({message:{code:"throttled",level:"warning",softForceAllowed:!0}})}),void(e=[]);for(;e.length&&(s<5||e[0].required);){const t=e.shift();s++;const r=()=>{s--,i()};this.calls[t.id].promise.then(r,r).catch(Sentry.captureException),this.port&&this.port.postMessage({method:"diffFiles",id:t.id,arguments:[t.options]})}};i()}_allocateCall(){const e=_.uniqueId();Vue.set(this.calls,e,{}),Vue.set(this.calls[e],"promise",new Promise((t,s)=>{Vue.set(this.calls[e],"resolve",t),Vue.set(this.calls[e],"reject",s)}));const t=()=>{Vue.delete(this.calls,e)};return this.calls[e].promise.then(t,t).catch(Sentry.captureException),this.port||this.calls[e].reject(new Error("Browser does not support Web Workers")),e}_send(e){const t=this._allocateCall();return this.port&&this.port.postMessage({method:e,id:t,arguments:_.toArray(arguments).slice(1)}),this.calls[t].promise}diffFiles(e){if(!window.diffWorker)return this._rejectNoWorker();const t=this._allocateCall();
1return Vue.set(e,"regionParams",{sentinelLines:s.SENTINEL_LINES,minHiddenLines:s.MIN_HIDDEN_LINES,revealedQuals:e.revealedQuals}),Vue.delete(e,"revealedQuals"),this._fillOptions(e).then(()=>(this.queuedDiffs.push({id:t,options:e}),this._releaseDiffFilesDebounced(),this.calls[t].promise))}diffText(e){return window.diffWorker?this._send("diffText",e):this._rejectNoWorker()}highlightCode(e){return window.diffWorker?this._send("highlightCode",e):this._rejectNoWorker()}matchRenamedFiles(e){return window.diffWorker?this._fillOptions(e).then(()=>this._send("matchRenamedFiles",e)):this._rejectNoWorker()}getContextLines(e,t,s,i,r){if(!window.diffWorker)return this._rejectNoWorker();const n={owner:e,repo:t,sha:s,type:i,lineNumber:r};return this._fillOptions(n).then(()=>this._send("getContextLines",n))}_resetCache(){if(window.diffWorker)return this._send("resetCache")}_fillOptions(s){return Vue.set(s,"host",Hubkit.defaults.host),Vue.set(s,"graphHost",Hubkit.defaults.graphHost),Vue.set(s,"apiVersion",Hubkit.defaults.apiVersion),"https://github.com"!==t.gitHubUrl?this.$when(()=>_get(this,"$store","system","gheVersion")).then(t=>{Vue.set(s,"gheVersion",t),e.user&&Vue.set(s,"token",e.user.github.accessToken)}):(e.user&&Vue.set(s,"token",e.user.github.accessToken),Promise.resolve())}}}},!1,!0,{filename:"src/model/services/services.diffWorkerBridge.js",modelPath:"/services/diffWorkerBridge",modelExportName:"DiffWorkerBridge"}),_reviewable.define(["GitHubCacheService"],["debug","session"],function(e,t){"use strict";return{GitHubCacheService:class GitHubCacheService{constructor(){Vue.set(this,"_organizationsPromise",null),Vue.set(this,"_caches",{teams:{location:"dashboardCache",fetchFn:this._fetchAllUserTeams},pushableRepos:{location:"dashboardCache",fetchFn:this._fetchPushableRepoNames.bind(this,"/user/repos")},watchedPushableRepos:{location:"dashboardCache",fetchFn:this._fetchPushableRepoNames.bind(this,"/user/subscriptions")},starredPushableRepos:{location:"dashboardCache",fetchFn:this._fetchPushableRepoNames.bind(this,"/user/starred")},watchedOrStarredPushableRepos:{location:"dashboardCache",fetchFn:this._fetchWatchedOrStarredPushableRepoNames}}),this.$observe(()=>this.$info.userid,e=>{e||(_.forEach(this._caches,e=>{Vue.set(e,"refreshed",!1),Vue.set(e,"fetchInProgress",null),e.connector&&e.connector.destroy(),Vue.set(e,"connector",null)}),Vue.set(this,"_organizationsPromise",null))}),this.$observe(()=>t.hasScope("read:org"),e=>{e&&Vue.set(this,"_organizationsPromise",null)})}getRef(e){const t=this._caches[e];if(!t)throw new Error(`Unknown cache name: ${e}`);if(this.$info.userid)return _ref(this.$store,"child","users",this.$info.userid,t.location,e)}async querySubjectAndCache(t,s,i){const r=this._caches[t];if(!r)throw new Error(`Unknown cache name: ${t}`);if(await this.$when(()=>this.$info.userid),r.connector||Vue.set(r,"connector",this.$connect(this.getRef(t))),await this.$when(()=>!this.$info.userid||this.getRef(t).ready),!this.$info.userid)throw new Error("Canceled");const n=this.getRef(t).value,a=_.isString(n)?n.split(" "):n,o=s(a);if(r.refreshed)return o;if(!r.fetchInProgress){e.cache&&console.log(`Refreshing ${t} cache`);const s=Vue.set(r,"fetchInProgress",(async()=>{try{let n=await r.fetchFn(i);if(_.isEqual(n,[])&&(n=void 0),_.isEqual(n,a))return a;if(e.cache&&console.log(`Cache miss for ${t}:`,n),!this.$info.userid)throw new Error("Canceled");const o=(_.isArray(n)?n.join(" "):n)||null;return this.getRef(t).set(o).then(()=>{Vue.set(r,"refreshed",!0),s===r.fetchInProgress&&Vue.set(r,"fetchInProgress",null)}),n}catch(e){throw s===r.fetchInProgress&&Vue.set(r,"fetchInProgress",null),e}})())}const l=await r.fetchInProgress;return l===a?o:s(l)}_fetchAllUserTeams(s){return s=s||t.hubkit(),e.cache&&console.log("Fetching teams"),s.request("GET /user/teams",{media:"jean-grey-preview+json",ifNotFound:[]}).then(t=>(e.cache&&console.log("Running team ancestors query"),Promise.all(_(t).map("node_id").chunkBy(100).map(e=>
1s.graph("\n query ($ids: [ID!]!) {\n nodes (ids: $ids) {\n ... on Team {\n combinedSlug,\n ancestors (first: 100) {\n nodes {\n combinedSlug\n }\n }\n }\n }\n }\n",{variables:{ids:e}})).value()))).then(e=>{const t=_.flatMap(e,"nodes");return _(t).flatMap("ancestors.nodes").map("combinedSlug").concat(_.map(t,"combinedSlug")).value()})}_fetchPushableRepoNames(e,s){return(s=s||t.hubkit()).request(`GET ${e}`).then(e=>_(e).filter(e=>_get(e,"permissions","push")).map(e=>_.toLower(e.full_name)).sortBy().value())}_fetchWatchedOrStarredPushableRepoNames(e){return e=e||t.hubkit(),Promise.all([e.request("GET /user/subscriptions"),e.request("GET /user/starred")]).then(([e,t])=>_(e).concat(t).filter(e=>_get(e,"permissions","push")).map(e=>_.toLower(e.full_name)).sortBy().sortedUniq().value())}async refreshUserOrganizations(){if(await this.$nextTick(),this.$info.userid)return this._organizationsPromise||Vue.set(this,"_organizationsPromise",t.hubkit().graph("\n query ($after: String) {\n viewer {\n organizations (first: 100, after: $after) {\n pageInfo {hasNextPage, endCursor},\n nodes {\n avatarUrl(size: 60), name, login\n }\n }\n }\n }").then(e=>{if(!this.$info.userid)return;const t=_get(e,"viewer","organizations","nodes")||[];return _ref(this.$store,"child","users",this.$info.userid,"dashboardCache","organizations").set(_(t).keyBy(e=>_.toLower(e.login)).mapValues(e=>_.pick(e,"name","avatarUrl")).value()),t},e=>{throw Vue.set(this,"_organizationsPromise",null),e})),this._organizationsPromise}}}},!1,!0,{filename:"src/model/services/services.gitHubCache.js",modelPath:"/services/gitHubCache",modelExportName:"GitHubCacheService"}),_reviewable.define(["GitHubStatus"],["config","corpsman"],function(e,t){"use strict";return{GitHubStatus:class GitHubStatus{constructor(){Vue.set(this,"severity",void 0),Vue.set(this,"message",void 0),Vue.set(this,"url",void 0),Vue.set(this,"timestamp",void 0),e.gitHubStatusUrl&&(this._queryStatus(),setInterval(this._queryStatus.bind(this),6e4))}get timestampTimeAgo(){return this.$store.services.computeTimeAgo(this.timestamp)}get worthReporting(){return this.severity&&this.message&&"none"!==this.severity}_queryStatus(){fetch(e.gitHubStatusUrl).then(e=>{if(!e.ok)throw _.assign(new Error(e.statusText),{status:e.status});return e.json()}).then(e=>{if(!_get(e,"status"))throw new Error("No status in response");Vue.set(e.status,"indicator",e.status.indicator||"none"),"none"!==e.status.indicator||this.severity&&"none"!==this.severity||Vue.set(e.status,"indicator",null),Vue.set(this,"url",e.page.url),Vue.set(this,"message",this._composeBody(e)),Vue.set(this,"timestamp",this._inferTimestamp(e)),Vue.set(this,"severity",e.status.indicator)}).catch(s=>{t.markHandled(s),e.prod||console.log(s)})}_composeBody(e){let t="";return e.status.description&&(t+=e.status.description+"\n\n"),t+=_.trim(_.map(e.incidents,e=>{let t=e.name;return _get(e,"incident_updates","length")&&(t+=": "+e.incident_updates[0].body),t}).join("\n\n").replace(/<\s*br\s*\/>/g,"\n\n").replace(/\n\n+/g,"\n\n")),t}_inferTimestamp(e){let t=_(e.incidents).map(e=>new Date(e.updated_at).getTime()).max();return void 0===t&&(t=Date.now()),t}}}},!1,!0,{filename:"src/model/services/services.gitHubStatus.js",modelPath:"/services/gitHubStatus",modelExportName:"GitHubStatus"}),_reviewable.define(["GuideDirectory"],["session","dom"],function(e,t){"use strict";const s=["a[href]","button","label[for]",'[contenteditable="true"]','[role="button"]','[role="checkbox"]','[role="link"]','[role="menuitem"]','[role="option"]','[role="switch"]','[tabindex]:not([tabindex="-1"])',".button",".checkbox",".dropdown",".dropdown-target",".dropdown-toggle",".item",".link",".multiselect",".multiselect__option",".multiselect__select",".multiselect__tags",".toggle"].join(","),i=['[aria-disabled="true"]',"[disabled]",".disabled",".multiselect--disabled"].join(",");window.CSS.registerProperty({name:"--guide",syntax:"<custom-ident>",inherits:!0,initialValue:"none"});const r=new CSSStyleSheet;Vue.set(document,"adoptedStyleSheets",[...document.adoptedStyleSheets,r]);function n(e){return getComputedStyle(e).getPropertyValue("--guide").trim()}function a(e){return!(e.which&&1!==e.which||void 0!==e.button&&0!==e.button)}function o(e){return 2===e.which||1===e.button}function l(e){return e.matches&&e.matches('input, select, textarea, [contenteditable="true"], .multiselect, .multiselect__option')}function c(e){return e.matches&&e.matches('a[href], [role="link"]')}function u(e,t){return t&&(e===t||t.contains(e))}function d(e){return!(!e||!e.matches)&&e.matches(s)}return{GuideDirectory:class GuideDirectory{constructor(){Vue.set(this,"guides",[]),Vue.set(this,"guideIndex",new Map),Vue.set(this,"focus",null),Vue.set(this,"overlayActive",!1),Vue.set(this,"_updateSelectorsStylesheet",_.debounce(this._updateSelectorsStylesheet,50)),Vue.set(this,"_handleOnboardingInteraction",this._handleOnboardingInteraction.bind(this)),document.addEventListener("mousedown",this._handleOnboardingInteraction,!0),document.addEventListener("click",this._handleOnboardingInteraction,!0),document.addEventListener("auxclick",this._handleOnboardingInteraction,!0),document.addEventListener("input",this._handleOnboardingInteraction,!0),document.addEventListener("change",this._handleOnboardingInteraction,!0)}_updateSelectorsStylesheet(){const e=new Set,t=_.filter(this.guides,"selectorSource");_.forEach(t,t=>{if(e.has(t.selectorSource))throw new Error(`Duplicate guide selector: ${t.selectorSource}`);e.add(t.selectorSource)}),r.replaceSync(_.map(t,e=>`${e.selectorSource} {--guide: ${e.id};}`).join("\n"))}register(e){this.guides.push(e),this.guideIndex.set(e.id,e),this._updateSelectorsStylesheet()}unregister(e){_.pull(this.guides,e),this.guideIndex.delete(e.id),this._updateSelectorsStylesheet(),this.focus&&this.focus.guide===e&&Vue.set(this,"focus",null)}resolveTarget(e){if(!(e=t.getElementFromNode(e)))return;let s=e,i=this.guideIndex.get(n(s));!i&&t.findClosestElement(e,".multiselect__content")&&(s=document.querySelector(".multiselect--active"),s&&(i=this.guideIndex.get(n(s))));let r=i&&t.findClosestElement(s,i.selectorSource);return r&&r.matches(".multiselect--active")&&(r=document.querySelector(".multiselect__content")),r&&i.groupSelector(r).length?{guide:i,target:r}:void 0}_handleOnboardingInteraction(s){const r=t.getElementFromNode(s.target);if(!r||t.findClosestElement(r,".guide.overlay"))return;const n=t.getEventPath(s);if("click"===s.type&&!a(s)||"auxclick"===s.type&&!o(s)||"mousedown"===s.type&&!function(e,t){return(a(e)||o(e))&&_.some(t,c)}(s,n))return;const h=this.resolveTarget(r);
1if(!h)return;const p=h.guide;p.onboardingKey&&"never"!==p.clickOnboard&&!e.onboarding[p.onboardingKey]&&(function(e){return _.some(e,e=>e.disabled||e.matches&&e.matches(i))}(n)||("always"===p.clickOnboard||function(e,t,s){if("input"===e.type||"change"===e.type){const e=_.find(t,l);return e&&u(e,s)}const i=_.find(t,d);return i&&u(i,s)}(s,n,h.target))&&Vue.set(e.onboarding,p.onboardingKey,!0))}}}},!1,!0,{filename:"src/model/services/services.guideDirectory.js",modelPath:"/services/guideDirectory",modelExportName:"GuideDirectory"}),_reviewable.define(["Header"],["config","hotkeys","router"],function(e,t,s){"use strict";class AnimatedTogglable{constructor(e,t=!1){Vue.set(this,"_model",e),Vue.set(this,"showing",t),Vue.set(this,"animating",!1),Vue.set(this,"_toggleCallback",_.noop)}registerToggleCallback(e){Vue.set(this,"_toggleCallback",e)}toggle(e){if(!this._model)throw new Error("Must attach model to AnimatedTogglable.");return this.animating||(Vue.set(this,"showing",_.isNil(e)?!this.showing:!!e),Vue.set(this,"animating",!0),_.defer(()=>{this._toggleCallback(this.showing)})),this._model.$when(()=>!this.animating,{timeout:1500}).catch(()=>{Vue.set(this,"animating",!1)})}concludeAnimation(){Vue.set(this,"animating",!1)}}return{Header:class Header extends AnimatedTogglable{constructor(){super(null,!0),Vue.set(this,"_model",this),Vue.set(this,"showing",!0),Vue.set(this,"animating",!1),Vue.set(this,"accountSettings",new AnimatedTogglable(this)),t.register("toggleAccountSettings",_.bind(this.universalToggleAccountSettings,this),"universal")}universalToggleAccountSettings(){"review-page"===s.current.pageClass?this.toggleHeaderAndAccountSettings():this.accountSettings.toggle()}toggleHeaderAndAccountSettings(t){this.animating||this.accountSettings.animating||(this.accountSettings.showing?this.accountSettings.toggle(t).then(()=>this.toggle(t)).catch(s=>{e.prod||console.error(s),this.toggle(t),this.clearPendingAnimations()}):this.showing?this.accountSettings.toggle(t):this.toggle(t).then(()=>this.accountSettings.toggle(t)).catch(s=>{e.prod||console.error(s),this.accountSettings.toggle(t),this.clearPendingAnimations()}))}clearPendingAnimations(){Vue.set(this,"animating",Vue.set(this.accountSettings,"animating",!1))}cleanupState(){this.clearPendingAnimations(),this._toggleCallback(!1)}}}},!1,!0,{filename:"src/model/services/services.header.js",modelPath:"/services/header",modelExportName:"Header"}),_reviewable.define(["HeadlessAuthService"],["config","corpsman","safeStorage"],function(e,t,s){"use strict";const i=3e5,r=`reviewable:headlessAuthError::${e.firebase}`;return{HeadlessAuthService:class HeadlessAuthService{constructor(){Vue.set(this,"_apiToken",null),Vue.set(this,"_expires",null),Vue.set(this,"_refreshPromise",null),Vue.set(this,"_refreshResettingPermissions",!1),Vue.set(this,"_refreshRetryDelay",1e3),Vue.set(this,"_refreshTimeout",null),this.$observe(()=>this.$info.connected,(e,t)=>{e&&!1===t&&this._refreshAfterResume("reconnect")}),window.addEventListener("focus",()=>this._refreshAfterResume("focus")),window.addEventListener("online",()=>this._refreshAfterResume("online")),document.addEventListener("visibilitychange",()=>{document.hidden||this._refreshAfterResume("visibility")})}get active(){return!!this._apiToken}async authenticate(e){Sentry.setTag("mode","headless"),Vue.set(this,"_apiToken",e);try{if(!(window.SharedWorker&&window.trussWorker instanceof window.SharedWorker))throw _.assign(new Error("Reviewable headless requests require SharedWorker support."),{code:"headless_shared_worker_required"});const t=await this._fetchAuthenticationWithPrimaryRetries(e);await this._applyAuthentication(t)}catch(e){throw this._clearRefresh(),Vue.set(this,"_expires",null),t.capture(e,"authenticate agent"),e}}async ensureReady(){await this._maybeRefresh("ensure-ready"),await this.waitForSessionResumed(),await this.refreshStalePermissions(),this.checkReady()}checkReady(){if(!this.$info.userid)throw this._getSharedAuthenticationError()||_.assign(new Error("Headless client is not authenticated"),{code:"headless_not_authenticated"});const e=this._getBlockedClientState();if(e)throw _.assign(new Error(e.message),_.pick(e,"code","details","reload","stack"))}async _maybeRefresh(e,t={}){if(!this._apiToken||!this._expires)return;if(this._refreshPromise)return await this._refreshPromise;return this._expires-this.$now>i&&(t.onlyWithinSafetyWindow||this.$info.userid)?void 0:await this.refreshNow(e,_.pick(t,"resetPermissions"))}async refreshNow(e="manual",s={}){if(!this._apiToken)return;for(;this._refreshPromise;){const e=this._refreshResettingPermissions;
1if(await this._refreshPromise,!s.resetPermissions||e)return}Vue.set(this,"_refreshResettingPermissions",!!s.resetPermissions);const i=this._fetchAndApplyAuthentication(s).catch(s=>{throw this._storeSharedAuthenticationError(s),t.capture(s,`refresh agent authentication (${e})`),this._isAuthenticationRetryable(s)?this._scheduleRefreshRetry():this._clearRefresh(),s}).finally(()=>{this._refreshPromise===i&&(Vue.set(this,"_refreshPromise",null),Vue.set(this,"_refreshResettingPermissions",!1))});return Vue.set(this,"_refreshPromise",i),await this._refreshPromise}async refreshStalePermissions(){if(this.$store.services.warden.permissions.authStale){await this.refreshNow("auth-stale",{resetPermissions:!0});try{await this.$when(()=>!this.$store.services.warden.permissions.authStale,{timeout:5e3})}catch(e){if(!/timeout/i.test(e.toString()))throw e}}}async waitForSessionResumed(){try{await this.$when(()=>this.$info.userid,{timeout:5e3})}catch(e){if(!/timeout/i.test(e.toString()))throw e;const t=this._getSharedAuthenticationError();if(t)throw t;throw _.assign(new Error("Timeout resuming session"),{code:"session_timeout"})}}_refreshAfterResume(e){this._maybeRefresh(e,{onlyWithinSafetyWindow:!0}).catch(_.noop)}async _fetchAuthenticationWithPrimaryRetries(e,t={}){let s;for(let i=0;i<=3;i++)try{return await this._fetchAuthentication(e,t)}catch(e){if(s=e,!this._isAuthenticationRetryable(e))break}throw s}async _fetchAuthentication(t,s={}){const i={Authorization:`Bearer ${t}`},r={method:"POST",cache:"no-store",headers:i};s.resetPermissions&&(Vue.set(i,"Content-Type","application/json"),Vue.set(r,"body",JSON.stringify({resetPermissions:!0})));const n=await fetch(`${e.authHostUrl}/auth_agent`,r),{body:a,parseError:o,responseBody:l}=await this._readResponseBody(n);if(!n.ok)throw this._makeAuthenticationError(n,a,l);if(o)throw _.assign(new Error(`Unable to parse agent authentication response: ${o.message}`),{code:"invalid_authentication_response",responseBody:l,status:n.status});if(!(_get(a,"extra","github","agentKey")&&_get(a,"extra","github","ownerKey")&&_get(a,"extra","github","agentType")&&a.expires&&a.v5Token))throw _.assign(new Error("Invalid authentication response received"),{code:"invalid_authentication_response",responseBody:l,status:n.status});return a}async _readResponseBody(e){const t=await e.text();if(!t)return{body:{},responseBody:t};try{return{body:JSON.parse(t),responseBody:t}}catch(e){return{body:{},parseError:e,responseBody:t}}}_makeAuthenticationError(e,t,s){const i=t.error||`Agent authentication failed with HTTP ${e.status}`;return _.assign(new Error(i),{responseBody:s,status:e.status,...t.code&&{code:t.code}})}_isAuthenticationRetryable(e){return e.status?408===e.status||429===e.status||e.status>=500:!e.code}async _applyAuthentication(e){Vue.set(this,"_expires",e.expires),this.$store.services.auth.setExtra(e.extra),await this.$truss.authenticate(e.v5Token),s.local.removeItem(r),this._scheduleRefresh(e.expires)}async _fetchAndApplyAuthentication(e={}){const t=await this._fetchAuthentication(this._apiToken,e);await this._applyAuthentication(t)}_getBlockedClientState(){if(t.upgrade)return{code:"client_upgrade_required",message:"Reviewable needs to upgrade before headless requests can continue.",reload:!0};if(t.crash)return{code:"client_crashed",details:{reason:t.crash,source:t.crashSource},message:"Reviewable crashed while handling a headless request.",reload:!0,stack:t.crashStack};if(t.maintenance){const e=this._getConditionMessage(t.maintenance)||"Review
1able is in maintenance mode.";return{code:"maintenance_mode",details:{message:e},message:e}}if(!t.isolated)return null;const{condition:e,conditionData:s}=t,i=this._isReviewBusy(),r=i?s.error:this._getConditionMessage(s)||`Reviewable is blocked by condition: ${e}.`;return{code:i?"review_busy":"client_isolated",details:{condition:e,message:r},message:r}}_getConditionMessage(e){if(_.isString(e))return e;if(_.isObject(e)){if(_.isString(e.error))return e.error;if(_.isString(e.message))return e.message}return _.isNil(e)?null:""+e}_isReviewBusy(){return"badreview"===t.condition&&/^Review busy:/.test(_get(t,"conditionData","error"))}_scheduleRefresh(e){this._clearRefresh(),Vue.set(this,"_refreshRetryDelay",1e3);const t=Math.min(e-this.$now-i,864e5);t<=0||Vue.set(this,"_refreshTimeout",setTimeout(()=>{this.refreshNow("scheduled").catch(_.noop)},t))}_scheduleRefreshRetry(){this._clearRefresh();const e=this._refreshRetryDelay;Vue.set(this,"_refreshRetryDelay",Math.min(2*this._refreshRetryDelay,3e5)),Vue.set(this,"_refreshTimeout",setTimeout(()=>
1{this.refreshNow("scheduled").catch(_.noop)},e))}_clearRefresh(){this._refreshTimeout&&clearTimeout(this._refreshTimeout),Vue.set(this,"_refreshTimeout",null)}_storeSharedAuthenticationError(e){const t=_.assign({code:e.code||"agent_authentication_refresh_failed",message:e.message||""+e},_.pick(e,"details","reload","responseBody","stack","status"));s.local.setItem(r,JSON.stringify(t))}_getSharedAuthenticationError(){const e=s.local.getItem(r);if(!e)return null;try{const t=JSON.parse(e);return _.assign(new Error(t.message||"Agent authentication refresh failed"),t)}catch{return s.local.removeItem(r),_.assign(new Error("Agent authentication refresh failed"),{code:"agent_authentication_refresh_failed",responseBody:e})}}}}},!1,!0,{filename:"src/model/services/services.headless.auth.js",modelPath:"/services/headless/auth",modelExportName:"HeadlessAuthService"}),_reviewable.define(["HeadlessService"],["config","corpsman","session"],function(e,t,s){"use strict";const i=["satisfied","discussing","blocking","working"],r=["informing","discussing","blocking","working"],n=[{name:"head",revisionBase:!1,fileShaField:"fileSha",commitShaField:"commitSha",equivalentShasField:"equivalentCommitShas"},{name:"base",revisionBase:!0,fileShaField:"baseFileSha",commitShaField:"baseCommitSha",equivalentShasField:"equivalentBaseCommitShas"}],a=new Map;return{HeadlessService:class HeadlessService{constructor(){Vue.set(this,"_review",null)}async authenticate(e){return await this.auth.authenticate(e),this._listPublicMethods()}getClientBuild(){return e.build}async whoAmI(){await this.auth.ensureReady();const e=this.$info.userid,t=await this.$peek(_ref(this.$store,"child","users",e,"core","public"));return this._serializeUser(e,t)}async resolveReviewReference(e){if(await this.auth.ensureReady(),(e=this._normalizeReviewReference(e)).prNumber)return _.pick(e,"owner","repo","prNumber");const t=`${e.owner}/${e.repo}/${e.headOwner||e.owner}:${e.branch}`,s=a.get(t);if(s){const e=await s,i=await this.$peek(_ref(this.$store,"child","repositories",e.owner,e.repo,"pullRequests",e.prNumber));if("open"===(i&&await this.$peek(_ref(this.$store,"child","reviews",i,"core","state"))))return e;a.delete(t)}const i=this._resolveBranchReviewReference(e).catch(e=>{throw a.delete(t),e});return a.set(t,i),await i}async _resolveBranchReviewReference(e){const t=s.hubkit(e.owner,e.repo),i=`${e.headOwner||e.owner}:${e.branch}`,r=await t.request("GET /repos/:owner/:repo/pulls",{body:{head:i,state:"all"},ifNotFound:[]});if(!r.length)throw _.assign(new Error(`No pull request found for branch ${i}.`),{code:"review_branch_not_found",details:e});const n=_.filter(r,{state:"open"}),a=1===n.length?n:r;if(1!==a.length)throw _.assign(new Error(`Multiple pull requests match branch ${i}: `+_(r).map(e=>`#${e.number}`).join(", ")+". Use a pull request number to choose one."),{code:"review_branch_ambiguous",details:{branch:e,pullRequests:_.map(r,e=>_.pick(e,"number","state","title"))}});const o=this._normalizeReviewReference(e);return{owner:o.owner,repo:o.repo,prNumber:a[0].number}}async loadReview(e){if(await this.auth.ensureReady(),e=this._normalizeReviewReference(e),this._review){if(_.isMatch(this._review.context,{owner:e.owner,repo:e.repo,pullRequestNumber:e.prNumber}))return void await this._checkReviewReady();throw new Error("Internal error: attempt to load multiple reviews in one headless tab.")}const s=this.$store.services.reviewContext.create(e.owner,e.repo,e.prNumber,!1);Vue.set(s,"showUI",!1),s.acquire();try{await this.$when(()=>s.ready||_get(s,"verdict","error")||t.isolated,{timeout:15e3})}catch(e){if(!/timeout/i.test(e.toString()))throw e}if(_get(s,"verdict","error"))throw _.assign(new Error(`Unable to obtain permission to access review: ${s.verdict.error}`),{code:"review_permission_failed",permissionError:s.verdict.error});if(await this.auth.ensureReady(),!s.ready||!s.review)throw _.assign(new Error(`Review didn't finish loading in time: ${s.loadingMessage}`),{code:"review_not_ready",loadingMessage:s.loadingMessage});Vue.set(this,"_review",s.review);const i=this.$connect(this,{publishOnPushTask:()=>_get(this,"_review","state","publishOnPushTaskRef")});await this.$when(()=>i.ready,{timeout:15e3})}async listDiscussions(e){if(await this._checkReviewReady(),"+needs:me"===(e=_.trim(e||"")))return _.reject(this._review.discussions.$ke
1ys,e=>this._review.discussions[e].tracker.replied);if("+draft"===e)return _(this._review.state.drafts.publishable).map(e=>"-cmd"===e.$key?"-top":e.$key).uniq().value();if(e)throw _.assign(new Error(`Unsupported discussion query: ${e}`),{code:"invalid_discussions_query",details:{query:e,supportedQueries:["+needs:me","+draft"]}});const t=_(this._review.state.drafts.list).filter("hasContent").reject(e=>"-cmd"===e.$key||_get(this,"_review","discussions",e.$key)).map("$key").value();return _.uniq(this._review.discussions.$keys.concat(t))}async listRevisions(){return await this._checkReviewReady(),await this._waitForRevisionsReady(),_.map(this._review.revisions.list,e=>({key:e.$key,headCommitSha:e.commitSha,baseCommitSha:e.baseCommitSha}))}async listFiles(e){if(await this._checkReviewReady(),(e=_.trim(e||""))&&!_.includes(["+needs:me"],e))throw _.assign(new Error(`Unsupported file query: ${e}`),{code:"invalid_files_query",details:{query:e,supportedQueries:["+needs:me"]}});await this._waitForRevisionsReady(),await this._waitForFileStatusReady();const t=_.map(this._review.files.showingList,e=>this._serializeFile(e));return"+needs:me"===e?_.filter(t,"needsMyReview"):t}async viewFile(e,t){await this._checkReviewReady(),await this._waitForRevisionsReady();const s=_.isNil(t)?this._review.core.lastRevisionKey:t;if(!this._review.revisions[s])throw _.assign(new Error(`Review revision not found: ${s}`),{code:"review_revision_not_found",details:{revisionKey:s}});await this._waitForFileStatusReady();const i=this._getFile(e),r=_get(i,"history","list")||[],n=_(i.revisions.latestReviewedBy).map((e,t)=>{const s=e.fully;return{...this._serializeUser(t),draft:s.draft,revision:{key:s.effectiveRevisionKey,headCommitSha:this._review.revisions[s.effectiveRevisionKey].commitSha}}}).sortBy("userKey").value(),a={..._.omit(this._serializeFile(i),"myLastReviewMark","renamed"),lastReviewMarks:n,renames:_(r).tail().map((e,t)=>({fromPath:this._review.files[r[t].fileKey].path,toPath:this._review.files[e.fileKey].path,revision:{key:e.revisionKey,headCommitSha:this._review.revisions[e.revisionKey].commitSha}})).value()};if(!i.system)return a;
1if("-commits"===e)return await this.$when(()=>_get(this,"_review","discussions","-top","comments","$ready"),{timeout:15e3}),{...this._review.context.fileDiffer.generateCommitFileContents(s),...a};throw new Error(`Internal error: unsupported virtual file ${e}.`)}async markFilesReviewed(e,t){return await this._checkReviewReady(),await this._waitForRevisionsReady(),await this._waitForJoinedFilesReady(),this._checkReviewUnlocked(),this._review.files.markFilesReviewed(e,t)}async viewDiscussion(e){await this._checkReviewReady(),await this._waitForRevisionsReady(),await this._waitForJoinedFilesReady();const t=_.includes(this._review.discussions.$keys,e)?this._review.discussions[e]:void 0,s=_.includes(this._review.state.drafts.$keys,e)?this._review.state.drafts[e]:void 0,i="-top"===e?_.filter(this._review.state.drafts.publishable,e=>"-top"===e.$key||"-cmd"===e.$key):_.compact([s]);if(await this._waitForDraftLocationsReady(i),t)return this._serializeDiscussion(t);if(!s||!s.hasContent)throw _.assign(new Error(`Discussion not found: ${e}`),{code:"discussion_not_found",details:{discussionKey:e}});return this._serializeDiscussion(s)}async createDiscussion({markdownBody:e,disposition:t="discussing",location:s}={}){if(await this._checkReviewReady(),!_.isString(e)||!_.trim(e))throw _.assign(new Error("Discussion must include nonempty markdownBody."),{code:"invalid_discussion_comment"});if(!_.includes(r,t))throw _.assign(new Error(`Invalid discussion disposition "${t}". Expected one of: ${r.join(", ")}.`),{code:"invalid_disposition",details:{validDispositions:r}});await this._waitForRevisionsReady();let i={};_.isUndefined(s)||(await this._waitForJoinedFilesReady(),i=this._resolveLocation(s)),this._checkReviewUnlocked();const n=this._review.state.drafts.getOrCreateStarterDraft(i.fileKey,i.revisionKey||this._review.core.lastRevisionKey,i.revisionBase,i.line);if(!n)throw _.assign(new Error("Unable to create discussion draft."),{code:"discussion_create_failed"});return await n.save(e),await n.setDisposition(t),await this._waitForDraftLocationsReady([n]),this._serializeDiscussion(n)}async deleteDiscussionDraft(e){await this._checkReviewReady();const t=_("-cmd"===e?[]:"-top"===e?["-top","-cmd"]:[e]).filter(e=>_.includes(this._review.state.drafts.$keys,e)).map(e=>this._review.state.drafts[e]).value();if(_.isEmpty(t)){if("-cmd"!==e&&_.includes(this._review.discussions.$keys,e))throw _.assign(new Error(`Draft not found for discussion ${e}.`),{code:"draft_not_found",details:{discussionKey:e}});throw _.assign(new Error(`Discussion ${e} not found.`),{code:"discussion_not_found",details:{discussionKey:e}})}this._checkReviewUnlocked(),await Promise.all(_.map(t,e=>e.delete(!0)))}async replyToDiscussion(e,t){await this._checkReviewReady(),this._checkReviewUnlocked();const s=this._getDiscussion(e),r=t.markdownBody||"";if(!_.trim(r))throw _.assign(new Error("Reply comment must include markdownBody."),{code:"invalid_reply_comment"});if(t.disposition&&!_.includes(i,t.disposition))throw _.assign(new Error(`Invalid reply disposition "${t.disposition}". Expected one of: ${i.join(", ")}.`),{code:"invalid_disposition",details:{validDispositions:i}});const n=_get(this,"_review","state","drafts",e);return n&&await n.delete(!0),this._checkReviewUnlocked(),await this._review.state.drafts.createReplyDraft(s,r,!0,t.disposition),{replaced:!!n,status:this._serializeDiscussionStatus(s.tracker)}}async acknowledgeDiscussion(e,t){if(await this._checkReviewReady(),this._checkReviewUnlocked(),t&&!_.includes(i,t))throw _.assign(new Error(`Invalid acknowledgement disposition "${t}". Expected one of: ${i.join(", ")}.`),{code:"invalid_disposition",details:{validDispositions:i}});const s=this._getDiscussion(e);return await s.tracker.acknowledge(t),{status:this._serializeDiscussionStatus(s.tracker)}}async publishReview({publishOnPush:e=!1}={}){await this._checkReviewReady();const t=this._review.state;if(t.publishing)throw _.assign(new Error("A publication is already in progress for this review."),{code:"review_publish_in_progress",details:{state:this._serializeReviewState()}});if(e&&!t.canPublishOnPush)throw _.assign(new Error("Publish-on-push is not available for you in this review."),{code:"review_publish_on_push_unavailable",details:{stage:"headless",publication:this._serializePublicationState()}});e&&this._checkNoPublishOnPushTask();const s=_get(await t.publish({includeActionSummary:!0,publishOnPush:e,throwErrors:!0}),"actionSummary")||null;if(!e&&t.publishOnPushTask&&await this._waitForPublishOnPushPublication(t),!e&&_get(t,"num","pendingSend"))throw _.assign(new Error("Review publication did not complete."),{code:"review_publish_incomplete",details:{state:this._serializeReviewState()}});return{actionSummary:s,state:this._serializeReviewState()}}async getReviewState(){return await this._checkReviewReady(),await this._waitForFileStatusReady(),this._serializeReviewState()}async cancelPublishOnPush(){if(await this._checkReviewReady(),!this._review.state.publishOnPushTask)return{canceled:!1,reason:"not_queued",state:this._serializeReviewState()};const e=await this._review.state.cancelPublishOnPush();return{canceled:!e,reason:e||void 0,state:this._serializeReviewState()}}async _checkReviewReady(){if(await this.auth.ensureReady(),!this._review)throw _.assign(new Error("No review is loaded in this headless tab."),{code:"review_not_loaded"});if(!this._review.context||!0!==this._review.context.ready){const e=_get(this,"_review","context","loadingMessage");throw _.assign(new Error(`Review isn't ready: ${e}`),{code:"review_not_ready",loadingMessage:e})}}_checkReviewUnlocked(){const e=this._review.state;if(e.publishing||e.isLocked())throw _.assign(new Error("Review cannot be changed while publishing or waiting for publish on push."),{code:"review_locked",details:{state:this._serializeReviewState()}})}_checkNoPublishOnPushTask(){if(this._review.state.publishOnPushTask)throw _.assign(new Error("A publish-on-push publication is already queued or being processed for this review. Publish it now or cancel it before modifying drafts or queueing another publication."),{code:"review_publish_on_push_queued",details:{publication:this._serializePublicationState()}})}async _waitForPublishOnPushPublication(e){const t="Timed out waiting for queued publish-on-push publication to finish.";try{await this.$when(()=>!e.publishOnPushTask,{timeout:12e4,timeoutMessage:t})}catch(e){if(e.message!==t)throw e;throw _.assign(e,{code:"review_publish_on_push_timeout",details:{state:this._serializeReviewState()}})}}_normalizeReviewReference(e){return{...e,owner:_.toLower(e.owner),repo:_.toLower(e.repo),...e.headOwner&&{headOwner:_.toLower(e.headOwner)}}}
1_getDiscussion(e){if(!_.includes(this._review.discussions.$keys,e))throw _.assign(new Error(`Discussion not found: ${e}`),{code:"discussion_not_found",details:{discussionKey:e}});return this._review.discussions[e]}_getFile(e){const t=this._review.files[e];if(_get(t,"$parent")!==this._review.files||t.assimilated)throw _.assign(new Error(`File not found: ${e}`),{code:"file_not_found",details:{fileKey:e}});return t}_resolveLocation(e){const t=_get(e,"file","key"),s=_get(e,"revision","key"),i=_get(e,"revision","side"),r=_get(e,"revision","commitSha"),a=_get(e,"line");if(!_.isString(t)||!_.trim(t)||void 0!==s&&(!_.isString(s)||!_.trim(s))||void 0!==i&&!_.some(n,{name:i})||void 0!==r&&(!_.isString(r)||!_.trim(r))||void 0===r&&(void 0===s||void 0===i)||void 0!==a&&(!_.isInteger(a)||a<=0))throw _.assign(new Error("Location must include a file key, an optional positive line, and either a commit SHA or a revision key with side."),{code:"invalid_location",details:{location:e}});const o=this._getFile(t),l=s?[this._review.revisions[s]]:[...this._review.revisions.list].reverse();for(const e of l){if(!e)continue;const t=_get(o,"revisions",e.$key);if(t)for(const s of n){if(i&&i!==s.name)continue;const n=_get(t,s.fileShaField);if(!o.system&&(!n||s.revisionBase&&"added"===t.action||!s.revisionBase&&"removed"===t.action))continue;if(r){const t=_(e[s.equivalentShasField]).split(",").map(_.trim).compact().unshift(e[s.commitShaField]).value();if(!_.includes(t,r))continue}const l=t.original;return{fileKey:l.file.$key,revisionKey:l.$key,revisionBase:s.revisionBase,line:a||0}}}const c=s?`revision ${s}`:`commit ${r}`;throw _.assign(new Error(`Location not found for file ${t} at ${c}.`),{code:"location_not_found",details:this._stripUndefined({fileKey:t,revisionKey:s,side:i,commitSha:r})})}async _waitForRevisionsReady(){await this.$when(()=>{const e=this._review.revisions,t=this._review.core.lastRevisionKey;return t&&e[t]&&_.size(e.list)===_.size(e)},{timeout:15e3})}async _waitForJoinedFilesReady(){await this.$when(()=>{const e=this._review.files;return e.joined&&e.showingList&&_.every(e.showingList,e=>e.revisions.list)},{timeout:15e3})}async _waitForFileStatusReady(){await this._waitForJoinedFilesReady(),await this.$when(()=>{const e=this._review.files;return!(!e.toBeReviewedByUserReady||!e.neutrallyUnreviewedReady)&&_.every(e.showingList,e=>void 0!==e.unreviewed&&void 0!==e.neutrallyUnreviewedWithoutDrafts&&void 0!==e.revisions.latestReviewedBy)},{timeout:15e3})}async _waitForDraftLocationsReady(e){await this.$when(()=>_.every(e,e=>!!(!e.fileKey||e.file&&this._getLocationCommitSha(e.revisionKey,e.revisionBase))&&_.every(e.codeblocks.list,t=>!(t.fileKey||e.fileKey)||!(!t.effectiveFile||!this._getLocationCommitSha(t.effectiveRevisionKey,t.effectiveRevisionBase)))),{timeout:15e3})}_serializeDiscussion(e){const t=e.tracker,s=this._review.state.drafts[e.$key],i="-top"===e.$key?this._serializeTopDraft():s?this._serializeDraft(s):null,r=new URL(this._review.context.baseReviewUrl,window.location.origin);return Vue.set(r,"hash",e.$key),this._stripUndefined({comments:_.map(_get(e,"comments","list")||[],e=>this._serializeComment(e)),draft:i,key:e.$key,location:this._serializeLocation(e.file,e.revisionKey,e.revisionBase,e.line),participants:t?this._serializeParticipants(t):void 0,status:t?this._serializeDiscussionStatus(t):void 0,url:"discussion"===e.type?r.href:void 0})}_serializeDiscussionStatus(e){return this._stripUndefined({currentDisposition:e.currentEffectiveDisposition,read:!(!e.currentEffectiveTimestamp||!e.read),replied:e.replied,resolved:e.resolved,resolvedIfDraftsSent:e.resolvedIf.draftsSent})}_serializeParticipants(e){return _(e.effectiveParticipants||{}).map(e=>this._stripUndefined({active:e.effectivelyActive,disposition:e.effectiveDisposition,anyAuthor:e.forced||void 0,lastPostTimestamp:e.lastPostTimestamp,lastReadTimestamp:e.timestamp,...this._serializeUser(e.$key)})).sortBy("userKey").value()}_serializeComment(e){return this._stripUndefined({author:this._serializeUser(e.authorKey),codeblocks:this._serializeCodeblocks(_get(e,"codeblocks","list")),draftTimestamp:e.draftTimestamp,key:e.$key,markdownBody:e.markdownBody,provenance:e.provenance,timestamp:e.timestamp})}_serializeDraft(e){if(e)return this._stripUndefined({codeblocks:this._serializeCodeblocks(_get(e,"codeblocks","list")),commentKey:e.commentKey,discussionKey:e.$key,disposition:e.disposition,dispositionSetManually:e.dispositionSetManually,markdownBody:e.markdownBody,sendingWillResolve:e.sendingWillResolve,timestamp:e.timestamp})}
1_serializeTopDraft(){const e=this._review.state.drafts["-top"],t=this._review.state.drafts["-cmd"],s=e||t;return s?{...this._serializeDraft(s),discussionKey:"-top",markdownBody:_([e,t]).compact().map(e=>e.getMarkdownBodyForPublication()).compact().join("\n\n")}:null}_serializeFile(e){const t=_get(e,"revisions","latestReviewedBy",this.$info.userid,"fully");return this._stripUndefined({group:e.effectiveGroup||void 0,key:e.$key,myLastReviewMark:t&&{draft:t.draft,revision:{key:t.effectiveRevisionKey,headCommitSha:this._review.revisions[t.effectiveRevisionKey].commitSha}},needsMyReview:!!(this._review.userIsReviewingFiles&&e.toBeReviewedByUser&&e.unreviewed),path:_get(e,"path"),renamed:_get(e,"history","list","length")>1||void 0,reviewed:!e.neutrallyUnreviewedWithoutDrafts,reviewedIfDraftsSent:!e.neutrallyUnreviewed,virtual:e.system||void 0})}_serializeLocation(e,t,s,i){if(!e||!t)return;const r=this._serializeRevision(t,s);return r?this._stripUndefined({file:this._serializeFileReference(e),line:i||void 0,revision:r}):void 0}_getLocationCommitSha(e,t){return _get(this,"_review","revisions",e,t?"baseCommitSha":"commitSha")}_serializeReviewState(){const e=this._review.state;return{discussions:_.pick(this._review.tracker.num,"unread","unreplied","unresolved","unresolvedIfDraftsSent"),drafts:{acknowledgements:e.num.acknowledgements,dismissals:e.num.dismissals,dispositionChanges:e.num.roleChanges,comments:e.num.publishableDrafts,marks:e.num.marks},files:_.pick(this._review.files.num,"toReview","unreviewed"),publication:this._serializePublicationState(),pullRequest:this._serializePullRequestState()}}_serializePublicationState(){return{queued:!!this._review.state.publishOnPushTask}}_serializePullRequestState(){return this._stripUndefined({sourceBranch:_get(this,"_review","core","branch"),targetBranch:_get(this,"_review","core","baseBranch")})}_serializeCodeblocks(e){const t=_.map(e,e=>this._stripUndefined({key:e.$key,language:e.language,location:this._serializeLocation(e.effectiveFile,e.effectiveRevisionKey,e.effectiveRevisionBase,e.effectiveLine),originalText:e.originalText,suggestedText:e.suggestedText}));return _.isEmpty(t)?void 0:t}_serializeFileReference(e){if(e)return this._stripUndefined({key:e.$key,path:_get(e,"path")})}_serializeRevision(e,t){if(!e)return;const s=this._getLocationCommitSha(e,t);return s?{key:e,commitSha:s}:void 0}_serializeUser(e,t=_get(this,"_review","people",e)){return this._stripUndefined({..._.pick(t,"username","displayName"),agent:/^ghagent:/.test(e),bot:_get(t,"bot"),userKey:e})}_stripUndefined(e){return _.omitBy(e,_.isUndefined)}_listPublicMethods(){const e=[];for(const t of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))"constructor"!==t&&!/^[$_]/.test(t)&&_.isFunction(this[t])&&e.push(t);return _.sortBy(e)}}}},!1,!0,{filename:"src/model/services/services.headless.js",modelPath:"/services/headless",modelExportName:"HeadlessService"}),_reviewable.define(["Services"],[],function(){"use strict";const e=1440,t=30.4368*e,s=525948.48;return{Services:class Services{static get $trussMount(){return{path:"/services",local:!0}}computeTimeAgo(i,{short:r=!1}={}){if(!i)return null;const n=Math.floor((this.$info.nowAtInterval(6e4)-i)/6e4);let a,o;return n<1?r?"now":"just now":(n<60?(a=n,o=r?"min":"minute"):n<e?(a=n/60,o=r?"hr":"hour"):n<10080?(a=n/e,o="day"):n<t?(a=n/10080,o=r?"wk":"week"):n<s?(a=n/t,o=r?"mth":"month"):(a=n/s,o=r?"yr":"year"),"day"===o&&1===a?r?"1 day":"yesterday":`${Math.floor(a)} ${o}${a>=2?"s":""} ago`)}formatLocalTime(e){return e?new Date(e).toLocaleString([],{dateStyle:"medium",timeStyle:"short"}):null}}}},!1,!0,{filename:"src/model/services/services.js",modelPath:"/services",modelExportName:"Services"}),_reviewable.define(["MissiveService"],["router","animator","config","analytics"],function(e,t,s,i){"use strict";const r={"background-color":"#fff","bubble-dark-color":"hsl(0deg, 0%, 50.2%)","bubble-light-color":"hsl(0deg, 0%, 94.9%)","light-text-color":"#fff","text-color":"#34363a"},n={"background-color":"#161616","bubble-dark-color":"hsl(0deg, 0%, 50.2%)","bubble-light-color":"#808080","light-text-color":"#7b7c7f","text-color":"#ffffffd9"};return{MissiveService:class MissiveService{constructor(){Vue.set(this,"_opened",!1),Vue.set(this,"_variables",_.assign({"font-family":"DroidSans, Roboto, sans-serif","font-size":"13px","opened-border-radius":"5px","transition-duration":t.defaultOptions.duration+"ms",width:"450px",margin:"10px"},r)),s.chatUrl||"/headless"===window.location.pathname||this._initialize()}_initialize(){window.MissiveChatConfig={id:"236a42af-a112-4637-9ad6-fa228db5ae9b",chat:{hidden:!0,variables:this._variables},visitor:{requireEmail:"enterprise"!==s.env},meta:{instance:s.enterpriseIds||(s.prod?"reviewable.io":"dev")},onReady:()=>{this._handleRouteChange(),this._handleUserChange()},onOpen:()=>{i.track("Opened Chatroom"),Vue.set(this,"_opened",!0),window.MissiveChat.showButton(),document.documentElement.setAttribute("chat-open","")}};const r=document.createElement("script");Vue.set(r,"async",!0),Vue.set(r,"src","https://webchat.missiveapp.c
1om/"+window.MissiveChatConfig.id+"/missive.js"),document.head.appendChild(r),e.afterChange(()=>{this._handleRouteChange()},this),this.$observe(()=>this.$info.userid,()=>{this._handleRouteChange(),this._handleUserChange()}),this.$observe(()=>t.defaultOptions.duration,()=>{this._handleAnimationChange()})}_handleRouteChange(){const t=window.MissiveChat;if(!t||void 0===this.$info.userid)return;"home-page"===e.current.pageClass||this._opened?(t.showButton(),document.documentElement.setAttribute("chat-open","")):t.hideButton(),"enterprise"!==s.env&&t.addMeta({page:window.location.pathname})}_handleUserChange(){if("enterprise"===s.env)return;const e=window.MissiveChat,t=this.$info.user;e&&void 0!==t&&(t?t.github&&(e.setUser({name:t.github.displayName||t.github.username,email:t.github.email,digest:t.missiveIdentityDigest}),e.addMeta({username:t.github.username})):(e.setUser({}),e.addMeta({username:null})))}_handleAnimationChange(){this._updateVariables({"transition-duration":t.defaultOptions.duration+"ms"})}_updateVariables(e){const t=window.MissiveChat;if(_.assign(this._variables,e),t)try{t.setVariables(this._variables),this._opened&&t.showButton()}catch{}}applyTheme(e){s.chatUrl||this._updateVariables("dark"===e?n:r)}}}},!1,!0,{filename:"src/model/services/services.missive.js",modelPath:"/services/missive",modelExportName:"MissiveService"}),_reviewable.define(["NaturalLanguageService"],["corpsman","mangler"],function(e,t){"use strict";const{ELEMENT_NODE:s,TEXT_NODE:i}=window.Node,r=[[9728,10175],[11008,11263],[127744,129791]],n=/^(blockquote|dd|details|div|dl|dt|h[1-6]|hr|li|ol|p|pre|section|summary|table|tbody|td|tfoot|th|thead|tr|ul)$/i,a=/(```[\s\S]*?```|~~~[\s\S]*?~~~|`[\s\S]*?`|(^|\n)(?: {4}|\t)[^\n]*|<code>[\s\S]*?<\/code>)|<details\b[\s\S]*?<\/details>
1|<!--[\s\S]*?-->|<\/?[a-z][\w:-]*(?:\s+(?:[^"'<>]|"[^"]*"|'[^']*')*)?\s*\/?>/gi,o=/^\s*\*\(Reviewable was \[unable\]\([^)]+\) to map \[this GitHub inline comment thread\]\([^)]+\) to the right spot \u2014 sorry!\)\*\s*/i;return{NaturalLanguageService:class NaturalLanguageService{constructor(){Vue.set(this,"ready",!1),Vue.set(this,"_languageDetector",void 0),Vue.set(this,"_languageDetectorPromise",void 0),Vue.set(this,"_summarizers",Object.create(null)),Vue.set(this,"_summarizerPromises",Object.create(null)),Vue.set(this,"_connector",this.$connect({summarizerKillSwitch:_ref(this.$store,"child","system","summarizerKillSwitch")})),this._warm()}_getExpectedInputLanguages(){return _(["en",...navigator.languages||[],navigator.language]).compact().map(e=>{e=_.trim(e).replace(/[^a-z-].*/i,"");try{return Intl.getCanonicalLocales(e)[0]}catch{}}).compact().uniq().value()}_buildSubjectText(e){const t="\n\n"+_(e.codeblocks).map(e=>e.summarizationText).compact().map(e=>"```\n"+e+"\n```\n").join("\n");return(e.markdownBody||"")+t}_computeSummaryInputText(e){const t=this._cleanSummaryInputText(this._buildSubjectText(e));return this._normalizeWhitespace(t)}_cleanSummaryInputText(e){return e.replace(o,"").replace(a,(e,t)=>t?e:" ")}_normalizeWhitespace(e){return _.trim(e.replace(/\r\n/g,"\n").replace(/\r/g,"\n").replace(/\u2028|\u2029/g,"\n").replace(/[ \t\f\v]+/g," ").replace(/ *\n+ */g,"\n").replace(/\n{3,}/g,"\n\n"))}_stripCode(e){return e.replace(/\r\n/g,"\n").replace(/\r/g,"\n").replace(/\u2028|\u2029/g,"\n").replace(/```[\s\S]*?```|~~~[\s\S]*?~~~|`[\s\S]*?`|(^|\n) {4}.*?(\n|$)|<code>[\s\S]*?<\/code>/g,"")}_isLikelyTitleCase(e,t){if(!this._isEnglishLanguage(t))return!1;const s=(e.match(/\b[a-zA-Z]+\b/g)||[]).length;if(s<=3)return!1;return(e.match(/\b[A-Z][a-zA-Z]*\b/g)||[]).length/s>.6}_recoverTitleCaseSummary(e,t){const s=Object.create(null);return t.replace(/[a-zA-Z][a-zA-Z0-9_]*/g,e=>{/[A-Z]/.test(e)&&Vue.set(s,_.toLower(e),e)}),e.replace(/[a-zA-Z][a-zA-Z0-9_]*/g,e=>s[_.toLower(e)]||_.toLower(e))}_isEnglishLanguage(e){return/^en(-.*)?$/.test(e)}_extractLeadingIndicator(e){const t=_.trimStart(_get(e,"htmlBody"));if(!t)return;const a=document.createElement("template");Vue.set(a,"innerHTML",t);const o=_.find(a.content.childNodes,e=>e.nodeType!==i||_.trim(e.textContent));if(!o)return;function l(e){return _.find(_.map(e.childNodes,e=>{if(e.nodeType!==i||_.trim(e.textContent))return c(e)}))}function c(e){if(e.nodeType===i){const t=function(e){const t=e=>void 0!==e&&_.some(r,([t,s])=>e>=t&&e<=s);let s=e.codePointAt(0);if(!t(s))return"";let i=s>65535?2:1;for(s=e.codePointAt(i),s>=65038&&s<=65039&&(i+=1);8205===e.codePointAt(i);){const r=i;if(s=e.codePointAt(i+1),!t(s))break;if(i+=1+(s>65535?2:1),s=e.codePointAt(i),s>=65038&&s<=65039&&(i+=1),i===r)break}return e.slice(0,i)}(_.trimStart(e.textContent));if(!t)return;return document.createTextNode(t)}if(e.nodeType!==s)return;const t=_.toLower(e.tagName);if("g-emoji"===t)return e;if("img"===t){const t=_.toLower(e.getAttribute("data-canonical-src")||e.getAttribute("src")||"");if(!_.startsWith(t,"https://img.shields.io/badge/")&&!_.startsWith(t,"https://www.gstatic.com/codereviewagent/"))return;return e}const a=l(e);return a?n.test(t)?a:(e.replaceChildren(a),e):void 0}const u=o.nodeType===s&&/^(p|div)$/i.test(o.tagName)?l(o):c(o);var d;return u?{html:function(e){const t=document.createElement("div");return t.appendChild(e),t.innerHTML}(u),inline:(d=u,d.nodeType===i||d.nodeType===s&&"img"!==_.toLower(d.tagName))}:void 0}_prependLeadingIndicatorHtml(e,t){return t?t.inline&&/^<p>/i.test(e)?e.replace(/^<p>/i,e=>`${e}${t.html} `):`<p>${t.html}</p>\n${e}`:e}
1_renderSummary(e,s){let i,r=t.renderMarkdown(e);for(;i=r.match(/^<p><(em|strong)>([\s\S]*)<\/\1><\/p>\n?$/);)r=`<p>${i[2]}</p>\n`;return this._prependLeadingIndicatorHtml(r,this._extractLeadingIndicator(s))}_capitalizeSummaryStart(e){return e.replace(/^([^a-zA-Z0-9]*)([a-z])/,(e,t,s)=>`${t}${_.toUpper(s)}`)}_endSummaryWithPunctuation(e){return e.replace(/(.)([\s*_~]*)$/,(e,t,s)=>/[.?!]/.test(t)?e:`${t}.${s}`)}_normalizeSummary(e,t){return(e=_.trim(e))&&this._isEnglishLanguage(t)?this._endSummaryWithPunctuation(this._capitalizeSummaryStart(e)):e}needsSummary(e){return this._computeSummaryInputText(e).length>100}computeSummaryInputHash(e){return t.hash(this._computeSummaryInputText(e))}async _determineAvailabilities(e=this._getExpectedInputLanguages()){if(!window.LanguageDetector||!window.Summarizer||!window.LanguageDetector.availability||!window.Summarizer.availability||_get(this,"$store","system","summarizerKillSwitch"))return{languageDetector:"unavailable",summarizer:"unavailable"};const t=await Promise.all([_access(window,"","LanguageDetector","","availability","call",[{expectedInputLanguages:e}])||"unavailable",_access(window,"","Summarizer","","availability","call",[{type:"headline",expectedInputLanguages:e}])||"unavailable"]);return{languageDetector:t[0],summarizer:t[1]}}async summarize(e){const t=this._getExpectedInputLanguages(),s=await this._determineAvailabilities(t);if(!_.every(s,e=>"available"===e))throw _.assign(new Error("Summarization not ready"),{extra:s});const i=this._computeSummaryInputText(e),r=this._stripCode(i),n=await this._getLanguageDetector(t),a=await n.detect(r),{detectedLanguage:o,confidence:l=0}=a[0]||{};if(!o||"und"===o||l<.6)throw _.assign(new Error("Summarization language not detected with sufficient confidence"),{extra:{language:o||"und",confidence:l.toFixed(3),text:i}});let c=await this._summarizeText(i,o,{expectedInputLanguages:t,textNoCodeLength:r.length});if(!c)throw new Error("Empty summarization result");return this._isLikelyTitleCase(c,o)&&(c=this._recoverTitleCaseSummary(c,i)),this._renderSummary(this._normalizeSummary(c,o),e)}async _summarizeText(e,t,s={}){let i;try{i=await this._getSummarizer(t)}catch(i){throw this._addSummarizationErrorExtra(i,e,t,s),i}try{return await i.summarize(e)}catch(r){if(!("UnknownError"===r.name&&"Failed to count tokens."===r.message||"AbortError"===r.name))throw this._addSummarizationErrorExtra(r,e,t,s),r;i.destroy(),i===this._summarizers[t]&&(Vue.delete(this._summarizers,t),Vue.delete(this._summarizerPromises,t));try{const s=this._getSummarizerOptions(t),r=await _access(window,"","Summarizer","","availability","call",[_.omit(s,"sharedContext")])||"unavailable";if("available"!==r)throw _.assign(new Error("Summarization not ready"),{extra:{summarizer:r}});return i=await this._getSummarizer(t),await i.summarize(e)}catch(i){throw this._addSummarizationErrorExtra(i,e,t,{...s,retryAfterRecoverableError:!0,originalErrorName:r.name,originalErrorMessage:r.message}),i}}}_addSummarizationErrorExtra(e,t,s,i){if(e)try{Vue.set(e,"extra",_.assign(e.extra||{},{language:s,textLength:t.length,...i}))}catch{}}async _warm(){try{await this.$when(()=>this.$info.userid&&this._connector.at.summarizerKillSwitch.ready&&!_get(this,"$store","system","summarizerKillSwitch"));const e=this._getExpectedInputLanguages(),t=await this._determineAvailabilities(e);if(_(t).values().includes("unavailable"))return;if(_.every(t,e=>"available"===e))await this._warmModels(e);else{if(!navigator.userActivation)return;await this._warmWhenUserActivated(e)}Vue.set(this,"ready",!0)}catch(t){e.capture(t||new Error("Nil exception when loading summarizer"),"load language detector and summarizer")}}_warmModels(e){return Promise.all([this._getLanguageDetector(e),this._getSummarizer("en",{expectedInputLanguages:e,outputLanguage:"en"})])}_warmWhenUserActivated(e){return new Promise((t,s)=>{const i=["keydown","mousedown","pointerdown","pointerup","touchend"],r=()=>{navigator.userActivation.isActive&&(_.forEach(i,e=>{window.removeEventListener(e,r,!0)}),this._warmModels(e).then(t,s))};_.forEach(i,e=>{window.addEventListener(e,r,!0)})})}async _getLanguageDetector(e){return this._languageDetector?this._languageDetector:(this._languageDetectorPromise||Vue.set(this,"_languageDetectorPromise",(async()=>Vue.set(this,"_languageDetector",await window.LanguageDetector.create({expectedInputLanguages:e})))().catch(e=>{throw Vue.set(this,"_languageDetectorPromise",void 0),e})),this._languageDetectorPromise)}async _getSummarizer(e,t={}){return this._summarizers[e]?this._summarizers[e]:(this._summarizerPromises[e]||Vue.set(this._summarizerPromises,e,(async()=>Vue.set(this._summarizers,e,await window.Summarizer.create(this._getSummarizerOptions(e,t))))().catch(t=>{if(Vue.delete(this._summarizerPromises,e),"InvalidStateError"===t.name&&_.startsWith(t.message,"The device is unable to create a session to run the model."))throw _.assign(new Error("Summarization not ready"),{extra:{summarizer:"unavailable",summarizerCreationErrorName:t.name,summarizerCreationErrorMessage:t.message}});throw t})),this._summarizerPromises[e])}_getSummarizerOptions(e,t={}){return{type:"headline",sharedContext:"Write a headline in sentence case (only capitalize the first word).",expectedInputLanguages:t.expectedInputLanguages||[e],outputLanguage:t.outputLanguage||e}}}}},!1,!0,{filename:"src/model/services/services.naturalLanguage.js",modelPath:"/services/naturalLanguage",modelExportName:"NaturalLanguageService"}),_reviewable.define(["loadDefaultMonospaceFont","Ruler"],["session","bus","corpsman","pageControl"],function(e,t,s,i){"use strict";const r=200,n=_.range(r,75,-5),a=_.range(r,35,-5),o=6.5,l=["Review
1able Mono","Liberation Mono"],c=_.join(_.map(l,e=>`'${e}'`),", "),u=document.documentElement,d=getComputedStyle(u),h=2*_.parseInt(d.getPropertyValue("--diff-padding")),p=CSS.supports("text-size-adjust","none")||CSS.supports("-webkit-text-size-adjust","none")||CSS.supports("-moz-text-size-adjust","none");function v(e){const t=document.createElement("span");t.setAttribute("class","monospace"),Vue.set(t,"textContent",new Array(e+1).join("x")),document.body.appendChild(t);const s=t.getBoundingClientRect();return document.body.removeChild(t),s}function m(){return Promise.any(_.map(l,e=>new FontFaceObserver(e).load(null,36e5).catch(e=>{throw s.markHandled(e),e}))).then(_.constant(!0),_.constant(!1))}return{loadDefaultMonospaceFont:m,Ruler:class Ruler{constructor(){Vue.set(this,"_currentMargin",void 0),Vue.set(this,"_pixelsPerChar",void 0),Vue.set(this,"_diffColumns",void 0),Vue.set(this,"_fontFamily",void 0),Vue.set(this,"_fontSize",void 0),Vue.set(this,"_fontWeight",void 0),Vue.set(this,"_fontHeight",void 0),Vue.set(this,"_defaultFontLoaded",!1),Vue.set(this,"_cachedMaxPanelWidth",void 0),Vue.set(this,"flowOffset",{diff:void 0,info:void 0,matrix:void 0}),Vue.set(this,"width",{window:void 0,full:void 0,row:void 0,diff:void 0,bigColumn:void 0,scrollContext:void 0,sidebar:void 0}),Vue.set(this,"stylesheets",{width:{key:"width",subscribers:new Map,ref:new CSSStyleSheet,_last:null}}),Vue.set(this,"lineHeight",void 0),Vue.set(this,"gutter",30),Vue.set(this,"scrollOffset",49),Vue.set(this,"viewportHeight",u.clientHeight),Vue.set(this,"screenWidth",void 0),Vue.set(this,"maxPanelWidth",{diff:845,info:845,matrix:845}),Vue.set(this,"minMargin",70),Vue.set(this,"maxMargin",r),Vue.set(this,"_liveScrollContextWidth",void 0),Vue.set(this,"_liveSidebarWidth",void 0),_.forEach(this.stylesheets,(e,t)=>{Vue.set(document,"adoptedStyleSheets",[...document.adoptedStyleSheets,e.ref]),this.$observe(()=>this[t],()=>{this.updateCSSRules(e)},{deep:!0})}),Vue.set(this,"_throttledUpdateWindowDimensions",_.throttle(this.updateWindowDimensions,16.7)),Vue.set(this,"_throttledUpdateScreenWidth",_.throttle(this.updateScreenWidth,16.7)),window.screen&&window.screen.addEventListener&&window.screen.addEventListener("change",()=>{this._throttledUpdateScreenWidth()}),window.addEventListener("resize",()=>{this._throttledUpdateWindowDimensions(),this._throttledUpdateScreenWidth()}),window.addEventListener("focus",()=>{this.updateScreenWidth()}),document.addEventListener("visibilitychange",()=>{this.updateScreenWidth()}),this.updateWindowDimensions(),this.updateScreenWidth(),m().then(e=>{Vue.set(this,"_defaultFontLoaded",e)})}subscribeCSSRule(e,t,s){const i=this.stylesheets[e];return i.subscribers.set(t,s),this.updateCSSRules(i),()=>this.unsubscribe(t,i)}unsubscribe(e,t){t.subscribers.delete(e)}updateCSSRules(e){const t=[];for(const[s,i]of e.subscribers.entries()){const r=i(this[e.key]),n=`${s} { ${_(r).toPairs().map(([e,t])=>`${e}: ${t}`).join("; ")} }`;t.push(n)}const s=t.join("\n");s!==e._last&&(Vue.set(e,"_last",s),e.ref.replaceSync(s))}get margin(){return this._currentMargin}set margin(t){Vue.set(e.settings,"margin",t)}get auto(){return!e.settings.margin}get singleColumn(){return e.settings.forceSingleColumn}set singleColumn(t){if(t===e.settings.forceSingleColumn)return;const s=this.diffColumns;i.bypassHeaderStickying(()=>s===this.diffColumns),Vue.set(e.settings,"forceSingleColumn",t)}get diffColumns(){return this._diffColumns}get windowWidth(){return this.width.window}get narrow(){return this.width.window<1024}resetFlowOffset(){Vue.set(this,"flowOffset",{diff:void 0,info:void 0,matrix:void 0})}setSidebarProportions([e,t]=[]){Vue.set(this,"_liveScrollContextWidth",e),Vue.set(this,"_liveSidebarWidth",t),_.forEach(this.flowOffset,(e,t)=>this.updateFlowOffset(null,t))}updateFlowOffset(e,s){if(!_.includes(["diff","info","matrix"],s))throw new Error('Invalid panel type. Must be one of: "diff", "info", or "matrix"');if(e&&Vue.set(this.maxPanelWidth,s,e),_.isFinite(this._liveScrollContextWidth)&&_.isFinite(this.maxPanelWidth[s]))if(this.maxPanelWidth[s]>this._liveScrollContextWidth)Vue.set(this.flowOffset,s,o);else{const e=this._liveScrollContextWidth-this.maxPanelWidth[s],t=e>0?e/2:0;Vue.set(this.flowOffset,s,Math.max(o,t))}t.forceTippyUpdate({expectAnimation:!0,duration:150})}clampMarginSetting(t){return _.isFinite(t)?_.clamp(t,70,r):e.settings.margin}_marginToWidth(e,t){const s=t*this._pixelsPerChar;switch(e){case"one":return 15+s+h+o;case"two":return 30+2*s+h+o}}getDiffLayoutMarginAndColumns(e,t){let s,i=e;if(i){let e;
1this.singleColumn||(e=this._marginToWidth("two",i)<t,s="two"),e||(s="one")}else{if(!this.singleColumn){const e=_.find(n,e=>this._marginToWidth("two",e)<t);e&&(i=e,s="two")}i||(i=_.find(a,e=>this._marginToWidth("one",e)<t)||80,s="one",this.windowWidth<768&&!p&&(i=_.last(a)))}return[i,s]}get _pickBestMargin(){if(!this._pixelsPerChar||!this._liveScrollContextWidth||void 0===this.$info.userid)return;const[t,s]=this.getDiffLayoutMarginAndColumns(e.settings.margin,this._liveScrollContextWidth);Vue.set(this,"_currentMargin",t),Vue.set(this,"_diffColumns",s)}get _extrapolateWidths(){if(this._currentMargin)if(Vue.set(this.width,"diff",v(this._currentMargin).width+.13),Vue.set(this.width,"row",this.width.diff*("one"===this._diffColumns?1:2)+30),Vue.set(this.width,"full","one"===this._diffColumns?this.width.row-15:this.width.row),e.settings.margin)Vue.set(this.width,"bigColumn",this.width.diff);else{const e=v(160).width+.13;Vue.set(this.width,"bigColumn",Math.min(e,2*this.width.diff-75))}}get _selectFont(){if(void 0===this.$info.userid)return;const t=e.settings.monospaceFont;Vue.set(this,"_fontFamily",_get(t,"family")||null),Vue.set(this,"_fontSize",_get(t,"size")||null),Vue.set(this,"_fontWeight",_get(t,"weight")||null),Vue.set(this,"_fontHeight",parseFloat(_get(t,"height"))||null)}get _updateFontStyles(){if(void 0===this._fontFamily||void 0===this._fontSize)return;const e=this._fontFamily?`${this._fontFamily}, ${c}`:c,t=this._fontSize?this._fontSize:"89%",s=this._fontWeight?this._fontWeight:"400",i=this._fontHeight?this._fontHeight:this._fontFamily?"1.2":"1.35";if(u.style.setProperty("--monospace-family",e),u.style.setProperty("--monospace-size",t),u.style.setProperty("--monospace-weight",s),this._fontFamily||this._defaultFontLoaded){const e=2e3,t=v(e);Vue.set(this,"lineHeight",t.height*i),u.style.setProperty("--line-height",`${this.lineHeight}px`),Vue.set(this,"_pixelsPerChar",t.width/e)}}updateWindowDimensions(){Vue.set(this,"viewportHeight",u.clientHeight),Vue.set(this.width,"window",u.clientWidth),_access(i,"","scrollContexts","","primary","","getScrollbarPresent","call",[])&&(this.width.window-=17)}updateScreenWidth(){Vue.set(this,"screenWidth",_.isInteger(_get(window,"screen","width"))&&_get(window,"screen","width")>0&&_get(window,"screen","width")<=1e4?_get(window,"screen","width"):void 0)}}}},!1,!0,{filename:"src/model/services/services.ruler.js",modelPath:"/services/ruler",modelExportName:"Ruler"}),_reviewable.define(["TeamMembershipsService"],["session"],function(e){"use strict";const t=new Set,s=[2166136261,3339675911,2338845033,2891336453];return{TeamMembershipsService:class TeamMembershipsService{constructor(){this._reset(),this.$observe(()=>this.$info.userid,()=>{this.$info.userid?this._loadCurrentUserTeams():this._reset()})}_reset(){Vue.set(this,"error",null),Vue.set(this,"needsAuthorization",!1),Vue.set(this,"_currentUserTeams",t),Vue.set(this,"_currentUserTeamsHash",void 0),Vue.set(this,"_currentUserTeamsUnavailable",!1),Vue.set(this,"_memberships",{found:new Set,checked:new Set}),Vue.set(this,"_queue",[])}get currentUserTeamsLoaded(){return this._currentUserTeams!==t}get currentUserTeamsHash(){if(this.currentUserTeamsLoaded)return this._currentUserTeamsHash}get currentUserTeamsUnavailable(){return this._currentUserTeamsUnavailable}isMember(e,t){return this._checkTeamSlugKey(t),!!e&&(t=_.toLower(t),e===this.$info.userid?this._currentUserTeams.has(t):this._memberships.found.has(`${e}|${t}`))}check(e,t){if(this._checkTeamSlugKey(t),!e)throw new Error("Missing user key");if(e===this.$info.userid)return;const s=`${e}|${t=_.toLower(t)}`;this._memberships.checked.has(s)||(this._memberships.checked.add(s),this._queue.push({userKey:e,teamSlugKey:t}))}get _refresh(){if(!_.includes(_get(this,"$info","user","github","scopes"),"read:org"))return;if(!this._queue.length)return;let t=0;const s=_.map(this._queue,({userKey:e,teamSlugKey:s})=>this._generateQuery(++t,e,s));return Vue.set(this,"_queue",[]),Promise.all(s).then(t=>Promise.all(_(t).chunkBy(25).map(t=>{const s=_.assign({},..._.map(t,"variables")),i=`query (${_(s).map((e,t)=>`$${t}: String!`).join(", ")}) {${_(t).map("query").join("\n")}}`;return e.hubkit().graph(i,{variables:s})}
1).value())).then(e=>{_.forEach(e,e=>{_.forEach(e,(e,t)=>{if(!/^q\d+$/.test(t)||!e.team)return;const s="team:"+_.toLower(e.team.combinedSlug);_.forEach(e.team.members.nodes,e=>{const t=`github:${e.databaseId}|${s}`;this._memberships.found.add(t),this._memberships.checked.add(t)})})})}).catch(e=>{Vue.set(this,"error","Error checking team memberships: "+e.message)})}_generateQuery(e,t,s){const[i,r]=s.replace(/^team:/,"").split("/");return this.$when(()=>_ref(this.$store,"child","users",t,"core","public").ready).then(()=>{const s=this.$store.users[t].core.public.username;if(s)return{query:`q${e}: repositoryOwner(login: $owner${e}) {\n ...on Organization {\n team(slug: $slug${e}) {\n combinedSlug\n members(query: $username${e}, first: 100) {\n nodes { databaseId }\n }\n }\n }\n }`,variables:{[`owner${e}`]:i,[`slug${e}`]:r,[`username${e}`]:s}}})}_loadCurrentUserTeams(){if(!this.$info.userid)return;const e=this.$info.userid;
1return this.$store.services.gitHubCache.querySubjectAndCache("teams",async t=>{const i=new Set(_.map(t,e=>`team:${_.toLower(e)}`)),r=function(e){if(!e.length)return null;const t=e.sort().join(",");return _.map(s,e=>{let s=e;for(let e=0;e<t.length;e++)s=Math.imul(s^t.charCodeAt(e),16777619);return _.padStart((s>>>0).toString(16),8,"0")}).join("")}(Array.from(i));this.$info.userid===e&&(Vue.set(this,"_currentUserTeamsHash",r),Vue.set(this,"_currentUserTeams",i))}).catch(t=>{this.$info.userid===e&&(Vue.set(this,"error","Error resolving teams: "+t.message),Vue.set(this,"_currentUserTeamsUnavailable",!0))})}_checkTeamSlugKey(e){if(!_.startsWith(e,"team:"))throw new Error("Only slug team keys accepted: "+e)}}}},!1,!0,{filename:"src/model/services/services.teamMemberships.js",modelPath:"/services/teamMemberships",modelExportName:"TeamMembershipsService"}),_reviewable.define(["ThemeManager"],["animator","config","safeStorage","session"],function(e,t,s,i){"use strict";const r=document.documentElement,n=new Option,a=["light","dark","colorblind"],o="color-scheme",l={light:"dark",system:["light","dark"]};function c(e){const t=r.getAttribute(o);return _(t).split(" ").reject(t=>_.includes(function(e){if(_.has(l,e)){const t=l[e];return _.isArray(t)?t:[t]}const t=_.findKey(l,t=>_.isArray(t)?_.includes(t,e):t===e);return t?[t]:[]}(e),t)).push(e).uniq().compact().join(" ")}function u(e){return function(e){let[t,s,i]=e;t/=255,s/=255,i/=255;const r=Math.max(t,s,i),n=Math.min(t,s,i);let[a,o,l]=[NaN,0,(n+r)/2];const c=r-n;if(0!==c){switch(o=0===l||1===l?0:(r-l)/Math.min(l,1-l),r){case t:a=(s-i)/c+(s<i?6:0);break;case s:a=(i-t)/c+2;break;case i:a=(t-s)/c+4}a*=60}return o<0&&(a+=180,o=Math.abs(o)),a>=360&&(a-=360),[a,100*o,100*l]}(_.map(function(e){const{style:t}=n;return Vue.set(t,"color",e),t.color}(e).match(/\d+/g),Number))}return{ThemeManager:class ThemeManager{constructor(){Vue.set(this,"colorSchemes",["system","light","dark"]),Vue.set(this,"mediaWatcher",void 0),Vue.set(this,"handleSystemSchemeUpdate",_.bind(this._handleSystemSchemeUpdate,this)),Vue.set(this,"updateColorblindScheme",_.bind(this._updateColorblindScheme,this)),Vue.set(this,"defaultRed","#e75859"),Vue.set(this,"defaultGreen","#5bbd72"),Vue.set(this,"defaultRedReplacement",this.defaultRed),Vue.set(this,"defaultGreenReplacement","#5b6fbe"),Vue.set(this,"shouldShowOutdatedCSSVarsMessage",void 0),this.$observe(()=>i.settings.colorScheme,e=>{e&&this.applyColorScheme(e)}),this.$observe(()=>i.settings.a11y,e=>{e&&this._updateColorblindScheme(e.colorblind)})}get redReplacement(){return _get(i,"settings","a11y","colorblind")?(i.settings.a11y.redReplacement||Vue.set(i.settings.a11y,"redReplacement",this.defaultRedReplacement),i.settings.a11y.redReplacement):this.defaultRed}get greenReplacement(){return _get(i,"settings","a11y","colorblind")?(i.settings.a11y.greenReplacement||Vue.set(i.settings.a11y,"greenReplacement",this.defaultGreenReplacement),i.settings.a11y.greenReplacement):this.defaultGreen}get redReplacementActive(){return _get(i,"settings","a11y","colorblind")&&_get(i,"settings","a11y","redReplacement")!==this.defaultRed}get greenReplacementActive(){return _get(i,"settings","a11y","colorblind")&&_get(i,"settings","a11y","greenReplacement")!==this.defaultGreen}applyColorScheme(e,{remove:t=!1}={}){let i;_.includes(e,"system")?(Vue.set(this,"mediaWatcher",matchMedia("(prefers-color-scheme: dark)")),this.mediaWatcher.addEventListener("change",this.handleSystemSchemeUpdate),e=this.mediaWatcher.matches?"dark":"light"):this.mediaWatcher&&_.includes(l.system,e)&&(this.mediaWatcher.removeEventListener("change",this.handleSystemSchemeUpdate),Vue.set(this,"mediaWatcher",null)),i=t?function(e){const t=r.getAttribute(o);return _(t).split(" ").pull(e).join(" ")}(e):c(e);const n=this.mediaWatcher?_.replace(i,/dark|light/,"system"):i;s.local.setItem("reviewable:color_scheme_setting",n),this._updateRootScheme(i)}updateColorReplacement(e,t){const s=u(t||this[`${e}Replacement`]);this._setDiffColorReplacementVariables(e,s),t&&Vue.set(i.settings.a11y,`${e}Replacement`,t)}_handleSystemSchemeUpdate(e){e.matches?this._updateRootScheme("dark"):this._updateRootScheme("light")}_updateRootScheme(s){const i=r.getAttribute(o);if(!_(s).split(" ").every(e=>_.includes(a,e))){if(!t.prod)throw new Error(`Applied stylesheet must be one of ${_.join(a," ")}`);s=function(e){return _(e).split(" ").filter(e=>_.includes(a,e)).join(" ")}(s)}(function(e,t){const s=_.difference(_.split(e," "),_.split(t," "));return!_.includes(s,"colorblind")&&_.some(s,e=>"light"===e||"dark"===e)})(i,s)&&e.disableTransitions(),r.style.setProperty("color-scheme",s),r.setAttribute(o,s),this.$store.services.missive.applyTheme(function(e){return _(e).split(" ").find(e=>_.includes(["light","dark"],e))}(s)),_.delay(()=>{e.enableTransitions()},50)}_updateColorblindScheme(e){this.applyColorScheme("colorblind",{remove:!e}),_.forEach(["red","green"],t=>{e?this.$nextTick().then(()=>{this.updateColorReplacement(t)}):document.documentElement.style.setProperty(`--diff-${"red"===t?"remove":"add"}-color-hsl`,null)})}_setDiffColorReplacementVariables(e,[t,s,i]){document.documentElement.style.setProperty(`--diff-${"red"===e?"remove":"add"}-color-hsl`,`${t}deg, ${s}%, ${i}%`)}}}},!1,!0,{filename:"src/model/services/services.themeManager.js",modelPath:"/services/themeManager",modelExportName:"ThemeManager"}),_reviewable.define(["UsersService"],["config","session","shared"],function(e,t,s){"use strict";return{UsersService:class UsersService{constructor(){Vue.set(this,"_usernamesCache",Object.create(null))}_lookupGitHubUsername(i){if(i=_.toLower(i),/\+/.test(i))return Promise.resolve(null);"https://github.com"===e.gitHubUrl&&s.copilotReviewerUsernameRegex.test(i)&&(i=s.copilotReviewerUsername);let r=this._usernamesCache[i];return r||Vue.set(this._usernamesCache,i,r=t.hubkit().request("/users/:username",{username:i,ifNotFound:null}).then(e=>_get(e,"id")?{userKey:`github:${e.id}`,nodeId:e.node_id,actorType:e.type}:null)),r}lookupUsername(e){const t=`user:${e=_.toLower(e)}`,s=this.$store.services.completions.people.getUserOrTeam(t)||this.$store.services.completions.assignees.getUser(t);if(s){const e=_.pick(s,"userKey","nodeId","agent");return s.agent||Vue.set(e,"actorType","User"),Promise.resolve(e)}return this._lookupGitHubUsername(e)}}}},!1,!0,{filename:"src/model/services/services.users.js",modelPath:"/services/users",modelExportName:"UsersService"}),_reviewable.define(["Warden"],["config","truss","encryptionTree","corpsman"],function(e,t,s,i){"use strict";class Requirement{constructor(e,t){Vue.set(this,"_path",e),Vue.set(this,"_deduce",t)}match(e){let t;return _.forEach(e.targets,e=>{const s=e.match(this._path);if(s&&(t=this._deduce(s)),t)return!1}),this._fillParams(t,e)}matchRef(e){const t=e.match(this._path);return this._fillParams(t&&this._deduce(t))}_fillParams(e,t){if(e)return e.owner&&Vue.set(e,"owner",_.toLower(e.owner)),e.repo&&Vue.set(e,"repo",_.toLower(e.repo)),Vue.set(e,"needsPermission",!(!e.userRepo&&!e.owner)),e.needsPermission&&!e.level&&Vue.set(e,"level","pull"),t&&_.defaults(e,..._.map(t.targets,"annotations")),(e.userRepo||e.owner&&!e.repo)&&Vue.set(e,"needsAuth",!0),e}}class OperationWarden{constructor(e,t,s,i){Vue.set(this,"_warden",e),Vue.set(this,"_operation",t),Vue.set(this,"_params",s),Vue.set(this,"_fallbackPermission",
1null),Vue.set(this,"_finalizers",[]),i&&this._finalizers.push(i),s&&(this._requestPermission(),s.userRepo&&this._requestFallbackPermission())}get guarded(){return!!this._params}get needsAuth(){return _get(this,"_params","needsAuth")}get needsPermission(){return _get(this,"_params","needsPermission")}get verdict(){if(this._params.needsPermission)return this._warden.getVerdict(this._params.owner,this._params.repo)}get permissionTickets(){const e=this._warden.$store.queues.permissions,{owner:t,repo:s}=this._params,i=this._warden.$info.userid,r=_get(this,"_warden","$info","user","claims","aid");return{public:_get(e,`${t}|${s}|*`),personal:_get(e,`${t}|${s||"!"}|${r||i}`),bulk:r?void 0:_get(e,`^|^|${i}`)}}destroy(){this._permission&&(this._permission.release(),Vue.set(this,"_permission",null)),this._fallbackPermission&&(this._fallbackPermission.release(),Vue.set(this,"_fallbackPermission",null));for(const e of this._finalizers)e()}_requestPermission(){this._finalizers.push(this._warden.$observe(()=>({userid:this._warden.$info.userid,agentid:_get(this,"_warden","$info","user","claims","aid")}),({userid:e,agentid:t})=>{void 0===e||this._params.userid===e&&this._params.agentid===t||(this._permission&&(this._permission.release(),Vue.set(this,"_permission",null),this._fallbackPermission&&(this._fallbackPermission.release(),Vue.set(this,"_fallbackPermission",null)),Vue.set(this._params,"userid",null),Vue.set(this._params,"agentid",null)),this._params.needsAuth&&!e||this._params.needsPermission&&(Vue.set(this._params,"userid",e),Vue.set(this._params,"agentid",t),Vue.set(this,"_permission",this._warden.permissions.acquire(this._params))))}))}_requestFallbackPermission(){this._finalizers.push(this._warden.$observe(()=>this._bulkVerdictMissingRepo,e=>{e&&!this._fallbackPermission&&this._params.userid&&Vue.set(this,"_fallbackPermission",this._warden.permissions.acquire({...this._params,userRepo:!1}))}))}get _bulkVerdictMissingRepo(){const e=this.permissionTickets.bulk;if(!e||_get(e,"verdict","error"))return!1;const t=_get(e,"verdicts");if(!t)return!1;const s=_get(e,"scopes");return(!s||s===this._warden.$info.user.github.baseScopesString)&&void 0===_get(t,this._params.owner,this._params.repo)}waitForPermission(){return this._params?new Promise((e,s)=>{let i;const r=this._warden.$observe(()=>({verdict:this.verdict,userid:this._warden.$info.userid}),({verdict:r,userid:n})=>{if(this._params.needsAuth&&!n)return;const a=!this._params.needsPermission||_get(r,this._params.level)||_get(r,"own");this._operation.ended||!a&&!_get(r,"error")||(a?e():/SAML enforcement/.test(r.error)?(t.store.services.auth.invalidateGitHubToken(null,{error:"samlerror",org:this._params.owner}),e()):/OAuth token lost/.test(r.error)?(t.store.services.auth.logout("token-lost",!0),e()):s(new Error(`Permission check for ${this._params.owner}/${this._params.repo||"!"} failed: ${r.error}`)),i())},{deep:!0});i=()=>{_.pull(this._finalizers,i),r(),s(new Error("Connection discarded"))},this._finalizers.push(i)}):Promise.resolve()}static createIfNeeded(e,t,s){const i=e.reviewKeyRepoMap.sniff(t);if(i||s)return new OperationWarden(e,t,s,i)}}return{Warden:class Warden{constructor(){Vue.set(this,"_PERMISSION_REQUIREMENTS",_.map([["/system/maintenance/switch",e=>({})],["/system/maintenance",e=>({needsAuth:!0})],["/users/$userKey/core/public/$*",e=>({})],["/users/$userKey/$*",e=>({needsAuth:!0})],["/memberships/$itemKey/$*",e=>({needsAuth:!0})],["/subscriptions/$subId/$*",e=>({needsAuth:!0})],["/queues/reconciliation/$prKey/$*",e=>{const t=e.$prKey.match(/(.*?)\|(.*?)\|\d+/);return t?{owner:t[1],repo:t[2]}:{}}],["/queues/publishOnPush",e=>({needsAuth:!0})],["/repositories/$owner/$repo/protection/$*",e=>({owner:e.$owner,repo:e.$repo,level:"admin"})],["/repositories/$owner/$repo/cache/$*",e=>({owner:e.$owner,repo:e.$repo,level:"pull"})],["/repositories/$owner/$repo/pushOnlyCache/$*",e=>({owner:e.$owner,repo:e.$repo,level:"push"})],["/repositories/$owner/$repo/$*",e=>({owner:e.$owner,repo:e.$repo})],["/reviews/$reviewKey/$*",e=>this.reviewKeyRepoMap.lookup(e.$reviewKey)],["/filemaps/$reviewKey/$*",e=>this.reviewKeyRepoMap.lookup(e.$reviewKey)],["/linemaps/$reviewKey/$*",e=>this.reviewKeyRepoMap.lookup(e.$reviewKey)],["/basemaps/$reviewKey/$*",e=>this.reviewKeyRepoMap.lookup(e.$reviewKey)],["/rules/$owner/$repo/hasCompletionCondition",e=>({owner:e.$owner,repo:e.$repo,level:"pull"})],["/rules/$owner/$repo/$*",e=>({owner:e.$owner,repo:e.$repo,level:"admin"})],["/organizations/$owner/autoConnect/$*",e=>({owner:e.$owner,level:"member"})],["/organizations/$owner/prototypeRepository/$*",e=>({owner:e.$owner,level:"own"})],["/organizations/$owner/masterRepository/hasMasterRepository",e=>({owner:e.$owner,level:"member"})],["/organizations/$owner/coverage/$*",e=>({owner:e.$owner,level:"member"})],["/organizations/$owner/lastPrivateCompletionConditionRunTimestamp",e=>({owner:e.$owner,level:"member"})],["/organizations/$owner/cache/$*",e=>({owner:e.$owner,level:"member"})],["/organizations/$owner/slackWorkspace/core",e=>({owner:e.$owner,level:"member"})]],e=>
1new Requirement(e[0],e[1]))),this.$intercept("all",{onBefore:this._beginOperation.bind(this),onAfter:this._endOperation.bind(this),onError:this._retryOperation.bind(this)})}getVerdict(t,s){t=_.toLower(t),s=_.toLower(s);const i=this.$info.userid,r=_get(this,"$info","user","claims","aid");if(!t)return;let n=[];if(s&&"!"!==s){const r=e.encryptionEnabled&&!e.encryptionAesKey?{pull:!1,push:!1,admin:!1}:_get(this,"$store","queues","permissions",`${t}|${s}|*`,"verdict");(null===i||_get(r,"pull"))&&n.push(r)}if(s&&"!"!==s||i||n.push("!"===t?{siteAdmin:!1}:{own:!1}),i){const e=_get(this,"$store","queues","permissions",`${t}|${s||"!"}|${r||i}`);if(!e||e.scopes&&e.scopes!==this.$info.user.github.baseScopesString||n.push(e.verdict),s&&"!"!==s&&!r){const e=_get(this,"$store","queues","permissions",`^|^|${i}`);if(e&&(!e.scopes||e.scopes===this.$info.user.github.baseScopesString)){const i=_get(e,"verdict","error");n.push(i?{error:i}:_get(e,"verdicts",t,s))}}}switch(n=_.compact(n),n.length){case 0:return;case 1:return n[0];default:{const e={};for(const t of n)for(const s in t)Vue.set(e,s,e[s]||t[s]);return _.size(e)>1&&Vue.delete(e,"error"),e}}}getSecret(e,t){e=_.toLower(e),t=_.toLower(t);const s=this.$info.userid,i=_get(this,"$info","user","claims","aid");if(e&&t&&s)return _get(this,"$store","queues","permissions",`${e}|${t}|${i||s}`,"secret")}getRequirement(e){for(const t of this._PERMISSION_REQUIREMENTS){const s=t.matchRef(e);if(s)return s}}_beginOperation(t){if("read"!==t.type&&"write"!==t.type)return;let s;for(const e of t.targets)if(s=e.annotations.permissionRequirement,s)break;if(!s)for(const e of this._PERMISSION_REQUIREMENTS)if(s=e.match(t),s)break;if(e.encryptionEnabled&&!e.encryptionAesKey&&_.some(t.targets,e=>this._isEncrypted(e))&&(s||(s={}),Vue.set(s,"needsAuth",!0)),Vue.set(t,"warden",OperationWarden.createIfNeeded(this,t,s)),_get(t,"warden","guarded"))return t.warden.waitForPermission().then(()=>this._adoptCurrentAuth(t));this._adoptCurrentAuth(t)}_retryOperation(e){const t=_.toLower(e.error.code||e.error.message);if("permission_denied"===t&&this._isAuthSentinelRead(e))return this._handleAuthSentinelDenied(e);if(this._shouldRefreshHeadlessAuth(e,t))return this._refreshHeadlessAuthForPermissionDenied(e);return _get(e,"warden","guarded")&&"read"===e.type&&e.tries<=3&&("permission_denied"===t&&!e.target.annotations.ignorePermissionDenied||e.warden.needsAuth&&!this.$info.userid)?(Sentry.addBreadcrumb({category:"warden",message:`Retrying ${e.method} on ${e.target.toString()} (try ${e.tries})`}),new Promise(t=>{setTimeout(t,150*(e.tries-1))}).then(()=>e.warden.waitForPermission()).then(()=>this._adoptCurrentAuth(e))):void 0}_adoptCurrentAuth(e){return Vue.set(e,"originalUserId",this.$info.userid),Vue.set(e,"authChangedWhileRunning",!1),!0}_isAuthSentinelRead(e){return"read"===e.type&&"/system/maintenance"===e.target.path}_isPermissionTicketRead(e){return"read"===e.type&&_.startsWith(e.target.path,"/queues/permissions/")}_shouldRefreshHeadlessAuth(e,t){return!("permission_denied"!==t||"read"!==e.type||e.headlessAuthRefreshed||!this.$store.services.headless.auth.active)&&(!!this._isPermissionTicketRead(e)||_get(e,"warden","guarded")&&(e.warden.needsAuth||e.warden.needsPermission))}_refreshHeadlessAuthForPermissionDenied(e){Vue.set(e,"headlessAuthRefreshed",!0),Sentry.addBreadcrumb({category:"warden",message:"Refreshing headless auth after permission denied",data:{method:e.method,target:e.target.path,tries:e.tries}});const t=this._isPermissionTicketRead(e)?"permission-ticket-denied":"permission-denied";return this.$store.services.headless.auth.refreshNow(t).then(()=>this._adoptCurrentAuth(e),t=>(i.markHandled(e.error),i.markHandled(t),!1))}_handleAuthSentinelDenied(e){i.markHandled(e.error),Sentry.addBreadcrumb({category:"warden",message:"Auth sentinel permission denied",data:{method:e.method,tries:e.tries}});const t=this.$store.services.headless.auth;return t.active?!e.authSentinelRefreshed&&(Vue.set(e,"authSentinelRefreshed",!0),t.refreshNow("auth-sentinel").then(()=>this._adoptCurrentAuth(e),_.constant(!1))):(this.$store.services.auth.finalizeExpiredAuth("auth-sentinel"),!1)}_endOperation(e){e.warden&&e.warden.destroy()}_isEncrypted(e){if("/"===e.path)return!1;let t=s;for(const s of e.path.slice(1).split("/")){if(t=t[s]||t.$,!t)return!1;if(!0===t)return!0}return!0}}}},!1,!0,{filename:"src/model/services/warden/services.warden.js",modelPath:"/services/warden",modelExportName:"Warden"}),_reviewable.define(["Permission"],["corpsman"],function(e){"use strict";return{Permission:class Permission{constructor(){Vue.set(this,"_useCount",0),Vue.set(this,"_destroyed",!1),Vue.set(this,"_unwatches",[]),Vue.set(this,"_connector",null),Vue.set(this,"_verdictOverride",null),Vue.set(this,"_intervalHandle",null),Vue.set(this,"_retryTimeoutHandle",null),Vue.set(this,"_verdictPaths",[]),Vue.set(this,"_verdictAcquired",!1),Vue.set(this,"_retryTimeout",5e3)}get warden(){return this.$parent.$parent}get verdictAcquired(){return this._verdictAcquired}get authStale(){if(!this.ticket.userKey||!this.$info.user)return!1;if(this.$store.services.auth.disabled)return this.authStale;const e=_ref(this.ticketRef,"child","scopes").value;return e&&e!==this.$info.user.github.baseScopesString}
1get _type(){if(this.ticket)return"!"===this.ticket.repoName?"org":"*"!==this.ticket.ownerName&&"^"!==this.ticket.ownerName||this.ticket.repoName!==this.ticket.ownerName?"repo":"allrepos"}acquire(e){_.some(this._verdictPaths,t=>_.isEqual(t,e))||this._verdictPaths.push(e),this._useCount||(this._unwatches.push(this._watchVerdict()),this._updateTicket(),Vue.set(this,"_intervalHandle",setInterval(this._updateTicket.bind(this),288e5)),Vue.set(this,"_connector",this.$truss.connect(this.ticketRef)),this._unwatches.push(this._watchTicket())),this._useCount++}release(){if(! --this._useCount){clearInterval(this._intervalHandle),clearTimeout(this._retryTimeoutHandle);for(const e of this._unwatches)e();this.ticket.userKey&&!this.$info.userid?this._connector.destroy():this.warden.verdictCache.push(this._connector),this.$set(null)}}_watchVerdict(){const e=_ref(this.ticketRef,"child","verdict"),t=_ref(this.ticketRef,"child","verdicts");return this.$observe(()=>e.value||t.value,e=>{if(e){if(Vue.set(this,"_verdictAcquired",!0),e.$overridden)return;Vue.set(this,"_verdictOverride",null),_.some(this._verdictPaths,t=>!1===_.get(e,t))?this.options.resetOnNegativeVerdict?(this.options.$update({resetOnNegativeVerdict:!1}),this._resetTicket()):this.options.clearNegativeVerdict&&!_.some(e)&&(Vue.set(this,"_verdictOverride","org"===this._type?{member:!1,own:!1}:{pull:!1,push:!1,admin:!1}),this._clearTicket()):e.error&&(Vue.set(this,"_verdictOverride",{error:e.error}),this._clearTicket())}else this._overrideVerdict()},{deep:!0})}_watchTicket(){return this.$observe(()=>this.ticketRef.value,e=>{!this.ticketRef.ready||e||this._verdictOverride||this._updateTicket()})}_updateTicket(){Sentry.addBreadcrumb({category:"warden",message:"Pinged permission ticket "+this.ticketRef.path});const t=_.clone(this.ticket);Vue.set(t,"timestamp",this.$truss.SERVER_TIMESTAMP),t.userKey&&Vue.set(t,_ref(this.ticketRef,"child","_lease","created"),this.$truss.SERVER_TIMESTAMP),this.ticketRef.update(t).catch(s=>{(t.userKey&&this.$info.userid!==t.userKey||t.agentKey&&_get(this,"$info","user","claims","aid")!==t.agentKey)&&e.markHandled(s)}),this.ticketRef.ready&&_get(this,"ticketRef","value","_lease")||this._verdictOverride||(Vue.set(this,"_retryTimeoutHandle",setTimeout(()=>{this.$destroyed||this.ticketRef.ready&&_get(this,"ticketRef","value","_lease")||this._verdictOverride||(Sentry.addBreadcrumb({category:"warden",message:"Timed out permission ticket waiting on lease"}),this._clearTicket(),this._updateTicket())},this._retryTimeout)),Vue.set(this,"_retryTimeout",_.min([2*this._retryTimeout,6e4])))}_clearTicket(){Sentry.addBreadcrumb({category:"warden",message:"Cleared permission ticket "+this.ticketRef.path}),this.ticketRef.set(null),this._overrideVerdict()}_resetTicket(){Sentry.addBreadcrumb({category:"warden",message:"Reset permission ticket "+this.ticketRef.path}),Vue.set(this,"_verdictOverride",null),_ref(this.ticketRef,"child","_lease").set(null),this._updateTicket()}_overrideVerdict(){this._verdictOverride?_ref(this.ticketRef,"child","verdict").override(this._verdictOverride):Vue.set(this,"_verdictAcquired",!1)}}}},!1,!0,{filename:"src/model/services/warden/services.warden.permissions.$permissionKey.js",modelPath:"/services/warden/permissions/$permissionKey",modelExportName:"Permission"}),_reviewable.define(["Permissions"],["config","corpsman"],function(e,t){"use strict";const s=/^[\w.-]+$/;function i(e,t,s,i,r){const n=r?"^":e||"!",a=r?"^":t||"!";return{ownerKey:n,repoKey:a,ticketKey:`${n}|${a}|${i||s||"*"}`}}return{Permissions:class Permissions{constructor(){this.$observe(()=>this.authStale,e=>{e?t.setCondition("authstale"):t.clearCondition("authstale")})}acquire({owner:t,repo:r,userid:n,agentid:a,level:o,userRepo:l}){if(t&&!s.test(t))throw new Error("Invalid user or organization name: "+t);if(r&&!s.test(r))throw new Error("Invalid repository name: "+r);const{ownerKey:c,repoKey:u,ticketKey:d}=i(t,r,n,a,l);if(!this[d]){const t={ownerName:c,repoName:u};n&&Vue.set(t,"userKey",n),a&&Vue.set(t,"agentKey",a);const s=_ref(this.$store,"child","queues","permissions",d);_ref(this,"child",d).set({ticket:t,ticketRef:s,options:{resetOnNegativeVerdict:!!n,clearNegativeVerdict:!n&&!e.encryptionEnabled&&!!r}})}return this[d].acquire(l?[t,r,o]:o),this[d]}get({owner:e,repo:t,userid:s,agentid:r,userRepo:n}
1){const{ticketKey:a}=i(e,t,s,r,n);return this[a]}get allVerdictsAcquired(){return _.every(this,"verdictAcquired")}get authStale(){return _.some(this,"authStale")}}}},!1,!0,{filename:"src/model/services/warden/services.warden.permissions.js",modelPath:"/services/warden/permissions",modelExportName:"Permissions"}),_reviewable.define(["ReviewKeyRepoMap"],[],function(){"use strict";return{ReviewKeyRepoMap:class ReviewKeyRepoMap{constructor(){Vue.set(this,"_activeRepos",{}),Vue.set(this,"_map",{})}sniff(e){if("read"!==e.type)return;const t=e.target.match("/repositories/$owner/$repo/pullRequests/$*")||e.target.match("/repositories/$owner/$repo");if(!t)return;const s=`${t.$owner}|${t.$repo}`;return s in this._activeRepos?this._activeRepos[s].count++:Vue.set(this._activeRepos,s,{count:1,owner:t.$owner,repo:t.$repo,unwatch:this.$observe(()=>_get(this,"$store","repositories","$data",t.$owner,"$data",t.$repo,"pullRequests"),()=>this._updateMap(t.$owner,t.$repo),{deep:!0})}),this._unsniff.bind(this,s)}_unsniff(e){--this._activeRepos[e].count||(this._activeRepos[e].unwatch(),Vue.delete(this._activeRepos,e))}_updateMap(e,t){_.forEach(_get(this,"$store","repositories","$data",e,"$data",t,"pullRequests"),s=>{Vue.set(this._map,s,{owner:e,repo:t})})}lookup(e){if(e in this._map)return _.clone(this._map[e]);for(const t in this._activeRepos){const s=this._activeRepos[t],i=_get(this,"$store","repositories","$data",s.owner,"$data",s.repo,"pullRequests");for(const t in i)if(i[t]===e)return{owner:s.owner,repo:s.repo}}}}}},!1,!0,{filename:"src/model/services/warden/services.warden.reviewKeyRepoMap.js",modelPath:"/services/warden/reviewKeyRepoMap",modelExportName:"ReviewKeyRepoMap"}),_reviewable.define(["VerdictCache"],[],function(){"use strict";return{VerdictCache:class VerdictCache{constructor(){Vue.set(this,"_connectors",[]),this.$observe(()=>this.$info.userid,(e,t)=>{(void 0!==e&&!e||e&&t&&e!==t)&&this._flush()})}push(e){for(;this._connectors.length>=20;)this._connectors.shift().destroy();this._connectors.push(e)}_flush(){for(const e of this._connectors)e.destroy();Vue.set(this,"_connectors",[])}}}},!1,!0,{filename:"src/model/services/warden/services.warden.verdictCache.js",modelPath:"/services/warden/verdictCache",modelExportName:"VerdictCache"}),_reviewable.define(["System"],["config","corpsman"],function(e,t){"use strict";return{System:class System{constructor(){e.build&&this.$connect(_ref(this,"child","minClientBuild")),this.$connect({maintenance:_ref(this,"child","maintenance"),maintenanceSwitch:_ref(this,"child","maintenance","switch")})}get _minClientBuildCheck(){e.build&&this.minClientBuild&&e.build<this.minClientBuild&&t.forceUpgrade()}get _maintenanceSwitchCheck(){_get(this,"maintenance","switch")&&t.enterMaintenance(this.maintenance)}}}},!1,!0,{filename:"src/model/system/system.js",modelPath:"/system",modelExportName:"System"}),_reviewable.define(["UserCorePublic"],[],function(){"use strict";return{UserCorePublic:class UserCorePublic{get key(){return this.$userKey}get name(){let e=this.username;return this.displayName&&(e+=` (${this.displayName})`),e}get scaledAvatarUrl(){return this.$store.services.avatars.scaleGitHubAvatarUrl(this.avatarUrl)}}}},!1,!0,{filename:"src/model/users/users.$userKey.core.public.js",modelPath:"/users/$userKey/core/public",modelExportName:"UserCorePublic"}),_reviewable.define(["Acknowledgements"],[],function(){"use strict";return{Acknowledgements:class Acknowledgements{constructor(){Vue.set(this,"state",this.$parent)}gatherUpdates(e,t){Vue.set(e,this.$ref,null),_.forEach(this,(s,i)=>{if(!_get(this,"state","review","discussions",i)||_.includes(t,i)||"-top"===i&&_.includes(t,"-cmd"))return;const r=_ref(this,"child","state","review","tracker",i,"participants",this.$info.userid);if(e[r])return;const n=_get(this,"state","review","tracker",i,"currentParticipant","timestamp")||null;Vue.set(e,_ref(r,"child","timestamp"),Math.max(s,n)),Vue.set(e,_ref(r,"child","forced"),null);const a=r.value;e[_ref(r,"child","role")]||_get(a,"active")||"following"===_get(a,"disposition")||(Vue.set(e,_ref(r,"child","role"),"following"),Vue.set(e,_ref(r,"child","roleTimestamp"),this.$truss.SERVER_TIMESTAMP),Vue.set(e,_ref(r,"child","dismisserKey"),null))})}}}},!1,!0,{filename:"src/model/users/users.$userKey.state.$reviewKey.acknowledgements.js",modelPath:"/users/$userKey/state/$reviewKey/acknowledgements",modelExportName:"Acknowledgements"}),_reviewable.define(["Dismissals"],[],function(){"use strict";return{Dismissals:class Dismissals{constructor(){Vue.set(this,"state",this.$parent)}gatherUpdates(e,t){Vue.set(e,this.$ref,null),_.forEach(this,t=>{this.applyDismissal(t,e,!1)})}applyDismissal(e,t,s){if(!e)return;if(e.targetUserKey===this.$info.userid)return;
1if(!_get(this,"state","review","discussions",e.discussionKey))return;const i=_get(this,"state","review","tracker",e.discussionKey,"participants",e.targetUserKey);_.includes(["satisfied","informing","discussing","blocking","working"],_get(i,"disposition"))&&(_.assign(t,{[_ref(i,"child","role")]:"dismissed",[_ref(i,"child","roleTimestamp")]:this.$truss.SERVER_TIMESTAMP,[_ref(i,"child","dismisserKey")]:this.$info.userid}),s&&Vue.set(t,_ref(this,"child",e.$key),null))}}}},!1,!0,{filename:"src/model/users/users.$userKey.state.$reviewKey.dismissals.js",modelPath:"/users/$userKey/state/$reviewKey/dismissals",modelExportName:"Dismissals"}),_reviewable.define(["DraftCodeblock"],["Codeblock"],function(e){"use strict";return{DraftCodeblock:class DraftCodeblock extends e{constructor(){super(),Vue.set(this,"editable",!0)}get review(){return this.$parent.review}get parley(){return this.$parent.$parent}get kind(){return this.originalText?this.originalText===this.suggestedText?"code quote":"suggestion":"code snippet"}get text(){return this.suggestedText}get hasContent(){return this.originalText?this.originalText!==this.suggestedText:_.trim(this.suggestedText)}save(e){const t={timestamp:this.$truss.SERVER_TIMESTAMP,[_ref(this,"child","parley","codeblocks",this.$key,"suggestedText")]:e};return this.parley.$update(t)}delete(){const e={[this.$ref]:null};return this.hasContent&&Vue.set(e,_ref(this,"child","parley","deletedCodeblocks",this.$newKey()),this),this.parley.$update(e)}}}},!1,!0,{filename:"src/model/users/users.$userKey.state.$reviewKey.drafts.$draftKey.codeblocks.$codeblockKey.js",modelPath:"/users/$userKey/state/$reviewKey/drafts/$draftKey/codeblocks/$codeblockKey",modelExportName:"DraftCodeblock"}),_reviewable.define(["DraftCodeblocks"],[],function(){"use strict";return{DraftCodeblocks:class DraftCodeblocks{get review(){return this.$parent.review}get list(){return _(this).values().sortBy("$key").index().value()}}}},!1,!0,{filename:"src/model/users/users.$userKey.state.$reviewKey.drafts.$draftKey.codeblocks.js",modelPath:"/users/$userKey/state/$reviewKey/drafts/$draftKey/codeblocks",modelExportName:"DraftCodeblocks"}),_reviewable.define(["DeletedCodeblock"],[],function(){"use strict";return{DeletedCodeblock:class DeletedCodeblock{get review(){return this.$parent.review}get parley(){return this.$parent.$parent}get kind(){return this.originalText?this.originalText===this.suggestedText?"code quote":"suggestion":"code snippet"}undelete(e){return this.parley.$update({[this.$ref]:null,[e.$ref]:this})}}}},!1,!0,{filename:"src/model/users/users.$userKey.state.$reviewKey.drafts.$draftKey.deletedCodeblocks.$deletionKey.js",modelPath:"/users/$userKey/state/$reviewKey/drafts/$draftKey/deletedCodeblocks/$deletionKey",modelExportName:"DeletedCodeblock"}),_reviewable.define(["DeletedCodeblocks"],[],function(){"use strict";return{DeletedCodeblocks:class DeletedCodeblocks{get review(){return this.$parent.review}get last(){return _(this).values().maxBy("$key")}}}},!1,!0,{filename:"src/model/users/users.$userKey.state.$reviewKey.drafts.$draftKey.deletedCodeblocks.js",modelPath:"/users/$userKey/state/$reviewKey/drafts/$draftKey/deletedCodeblocks",modelExportName:"DeletedCodeblocks"}),_reviewable.define(["Draft"],["Parley","config","debug","session","corpsman","mangler","linguistTable","shared"],function(e,t,s,i,r,n,a,o){"use strict";const l=({delimiter:e,file:t,line:s,revisionKey:i,reviewUrl:r,rawFileUrl:n,codeQuote:a,quoteBody:o,body:l,codeblocks:c})=>`${e}\n*[\`${t.path}\`${s?` line ${s}`:""} at ${i}](${r})${n?` ([raw file](${n}))`:""}:*\n${a}${o}${l}${c}\n`,c=({delimiter:e,reviewUrl:t,quoteBody:s,body:i,codeblocks:r})=>`${e}\n*[a discussion](${t}) (no related file):*\n${s}${i}${r}\n`,u=({quoteBody:e,body:t,codeblocks:s})=>`${e}${t}${s}\n`,d=({delimiter:e,file:t,line:s,revisionKey:i,reviewUrl:r,quoteBody:n,body:a,codeblocks:o})=>`${e}\n*[\`${t.path}\`${s?` line ${s}`:""} at ${i}](${r}):*\n${n}${a}${o}\n`,h=({body:e,codeblocks:t,fingerprint:s})=>`${e}${t}\n\x3c!-- Reviewable comment ${s} --\x3e\n\x3c!-- Sent from Reviewable.io --\x3e\n`;let p=100;setInterval(()=>{p<100&&p++},1e3);return{Draft:class Draft extends e{constructor(){super(),Vue.set(this,"type","draft"),Vue.set(this,"state",this.$parent.state),Vue.set(this,"uploading",void 0),Vue.set(this,"previewBodyHash",void 0),Vue.set(this,"previewCommentHash",void 0),Vue.set(this,"_lastSummaryInputHash",void 0),Vue.set(this,"_renderPromise",void 0),Vue.set(this,"_renderBodyH
1ash",void 0),Vue.set(this,"_requestedRenderBodyHash",void 0),Vue.set(this,"_requestRenderDebounced",_.debounce(()=>{const e=this._requestedRenderBodyHash;Vue.set(this,"_requestedRenderBodyHash",void 0),!this.$destroyed&&e&&this.render().catch(e=>{r.markHandled(e)})},5e3))}get review(){return this.state.review}get _deleteIfPreviouslyPublished(){_get(this,"review","discussions",this.$key,"comments",this.commentKey)&&(s.drafts&&console.log("draft",this.$key,"purge already published"),this.$set(null))}get disposition(){return this.role}get dispositionSetManually(){return this.roleSetManually}get previewBodyHtml(){return _get(this,"htmlBodies",this.previewBodyHash)}setDisposition(e){if(this.disposition===e&&this.dispositionSetManually)return;Vue.set(i.onboarding,"setRole",!0);const t=_get(this,"tracker","currentParticipant","disposition")||"uninvolved",s=_get(this,"state","roleChanges",this.$key);if("informing"===e&&this.tracker?e="satisfied":"satisfied"!==e||this.tracker||(e="informing"),!_.includes(["satisfied","informing","discussing","blocking","working","pondering","dismissed"],e))return;const r=s&&e!==t&&"pondering"!==e?e:null;return _ref(this,"child","state").update({[_ref(this,"child","role")]:e,[_ref(this,"child","roleSetManually")]:!0,[_ref(this,"child","state","roleChanges",this.$key)]:r})}get sendingWillResolve(){if(_get(this,"review","context","showDiscussions"))return this.tracker?_get(this,"tracker","resolvedIf","draftsSent"):"discussing"===this.role&&this.discussingWillResolve||"satisfied"===this.role&&this.satisfiedWillResolve||"following"===this.role||"informing"===this.role}setDefaultDisposition(e){this.defaultDispositionSettingKey&&(Vue.set(i.onboarding,"setDefaultRole",!0),Vue.set(i.settings,this.defaultDispositionSettingKey,e))}get defaultDispositionType(){if(!_get(this,"review","context","showDiscussions"))return;let e;return this.tracker?_get(this,"tracker","currentParticipant","active")||(e="Joined"):e="New",e&&this.review.userIsAuthor&&(e+="AsAuthor"),e}get defaultDispositionSettingKey(){if(_get(this,"review","context","showDiscussions"))return this.defaultDispositionType?`default${this.defaultDispositionType}DiscussionRole`:void 0}get fingerprint(){return this.commentKey+":"+this.bodyHash}get commentHash(){const e=_.map(this.codeblocks,e=>e.originalText+e.suggestedText).join(",");return n.hash(this.bodyHash+e)}get _startsNewDiscussion(){return!(!this.$ready||"-top"===this.$key||"-cmd"===this.$key||_get(this,"review","discussions",this.$key))}get summaryInputHash(){return this.$store.services.naturalLanguage.computeSummaryInputHash(this)}get _invalidateSummaryHtmlBodies(){if(!this._startsNewDiscussion)return;const e=this._lastSummaryInputHash;this.summaryInputHash!==e&&(Vue.set(this,"_lastSummaryInputHash",this.summaryInputHash),void 0!==e&&_get(this,"summaryHtmlBodies")&&_ref(this,"child","summaryHtmlBodies").set(null))}get _queueStarterDraftSummary(){if(_get(this,"review","context"))return this._startsNewDiscussion&&_get(this,"bodyHash")?void this.review.context.discussionSummaries.queueStarterDraft(this,this.bodyHash,this.summaryInputHash):this.review.context.discussionSummaries.discardStarterDraft(this.$key)}get rawFileLink(){if(this.review&&!_get(this,"file","system"))return`${t.gitHubUrl}/${this.review.core.ownerName}/${this.review.core.repoName}/blob/${_get(this,"review","revisions",this.revisionKey,this.revisionBase?"baseCommitSha":"commitSha")}/${_get(this,"review","files",this.fileKey,"path")}#L${this.line}`}get hasContent(){return _.trim(this.markdownBody)||_.some(this.codeblocks,e=>e.hasContent)}get replyTo(){return _get(this,"review","discussions",this.$key,"comments",this.$key,"nodeId")}save(e){Vue.set(this,"_renderPromise",Vue.set(this,"_renderBodyHash",void 0));const t={timestamp:this.$truss.SERVER_TIMESTAMP,markdownBody:e,bodyHash:n.hash(e),htmlBody:null,htmlBodies:null};return this.roleSetManually||"top"===this.$draftKey||Vue.set(t,"role",this.$parent.inferDisposition(this.$key,e)),this.$update(t).then(()=>{Sentry.addBreadcrumb({category:"process",message:"Saved draft",data:{draftKey:this.$key,hashKey:t.bodyHash}})})}delete(e){if(_access(this,"","state","","isLocked","call",[this.$key]))return;this._requestRenderDebounced.cancel();const t={};if(Vue.set(t,this.$ref,null),!e&&this.hasContent){const e=this.$parent.makeDraftLocationKey(this,this.$key);Vue.set(t,_ref(this,"child","state","trash",e),{[this.$key]:this})}return this.state.$update(t)}render(){const e=this.markdownBody||"",t=this.bodyHash||n.hash(e);
1this._requestedRenderBodyHash===t&&Vue.set(this,"_requestedRenderBodyHash",void 0);let s=t===this.bodyHash?Promise.resolve():this.$update(e?{markdownBody:e,bodyHash:t}:{bodyHash:t});return _.trim(e)?t&&this._renderPromise&&this._renderBodyHash===t?this._renderPromise:_get(this,"htmlBodies",t)?s:p<=0?s.then(()=>Promise.reject(new Error("Markdown rendering throttled to avoid triggering burst quota limits on GitHub. Please try again in a little while."))):(p--,Vue.set(this,"_renderBodyHash",t),Vue.set(this,"_renderPromise",s=s.then(()=>{if(!this.$destroyed)return i.hubkit().request("POST /markdown",{body:{text:n.cleanNewlines(n.renderCustomEmojis(e,this.commentKey)),mode:"gfm",context:this.review.core.ownerName+"/"+this.review.core.repoName}})}).then(s=>{if(!this.$destroyed)return s?(s=n.unrenderTaskListCheckboxes(s),s=n.removeClipboardButton(s),s=n.renderVideo(s)):/^\s*$/.test(e)||(s=`<code>${_.escape(e)}</code>`),_ref(this,"child","htmlBodies",t).set(s)}).then(()=>{Sentry.addBreadcrumb({category:"process",message:"Rendered draft",data:{draftKey:this.$key,hashKey:t,currentHashKey:n.hash(this.markdownBody)}})}).catch(e=>(this._renderPromise===s&&Vue.set(this,"_renderPromise",Vue.set(this,"_renderBodyHash",null)),Promise.reject(e))))):s}requestRender(){const e=this.markdownBody||"";if(!_.trim(e))return;const t=this.bodyHash||n.hash(e);_get(this,"htmlBodies",t)||t&&this._renderPromise&&this._renderBodyHash===t||this._requestedRenderBodyHash!==t&&(Vue.set(this,"_requestedRenderBodyHash",t),this._requestRenderDebounced())}get rawDirectives(){if(!_get(this,"review","context","completeReview"))return;const e={labels:[],assignees:[],reviewers:[],mentions:[]},t=n.removeCodeAndQuotedBlocks(this.markdownBody);if(!t)return e;_.forEach(t.match(o.directiveRegex),t=>{const s=t=t.replace(/^\s/,""),i=t.charAt(0);t=t.replace(/^[+-]/,""),/^(a|assignee):@/.test(t)?e.assignees.push({username:t.slice(t.indexOf("@")+1),op:i,token:s}):/^(r|reviewer):@/.test(t)?e.reviewers.push({username:t.slice(t.indexOf("@")+1),op:i,token:s}):("("===t.charAt(0)&&(t=t.slice(1,-1).replace(/\\(.)/g,"$1")),e.labels.push({name:t,op:i,token:s}))});const s="-cmd"===this.$key?"-top":this.$key;return _.forEach(t.replace(o.mentionLikeDirectiveRegex,"").match(o.mentionRegex),t=>{e.mentions.push({draftKey:s,username:t.slice(1)})}),e}getMarkdownBodyForPublication(){return this.markdownBody?n.renderOpenCodeBlocks(n.cleanNewlines(n.renderCustomEmojis(this.markdownBody.replace(/\n+$/,""),this.commentKey))):""}_getCodeblocksMarkdownForPublication(){const e=_.filter(this.codeblocks,e=>_.trim(e.suggestedText));if(_.isEmpty(e))return"";const t=_.size(e)>1;return"\n\n"+_.map(e,e=>{let s="";const i=e.effectiveFile;e.fileKey&&(s=` (from ${i.path})`);const r=_access(i,"","path","","replace","call",[/.*\//,""]),n=_access(i,"","path","","replace","call",[/.*(?=\.)/,""]),o=a[r]||a[n]||"",l=e.suggestedText.replace(/\n+$/,""),c=t?` (${e.romanIndex})`:"";return`\n\n_${_.capitalize(e.kind)}${c}${s}:_\n\`\`\`${o}\n${l}\n\`\`\``}).join("\n\n")}async renderForPublication({publishAll:e=!1,inlineReply:s=!1}={}){if(!this.hasContent)return;const i=/^>/m.test(this.markdownBody),r=`${window.location.protocol+"//"+window.location.host}/reviews/${this.review.core.ownerName}/${this.review.core.repoName}/${this.review.core.pullRequestId}#${this.$key}:${this.fingerprint}`,n=_get(this,"review","files",this.fileKey);let a="";if(n&&this.revisionKey){const e=_get(this,"review","revisions",this.revisionKey),s=_get(e,this.revisionBase?"baseCommitSha":"commitSha");s&&(a=`${t.gitHubUrl}/${this.review.core.ownerName}/${this.review.core.repoName}/blob/${s}/${n.uriSafePath}`,this.line&&(a+=`#L${this.line}`))}const o={reviewUrl:r,rawFileUrl:a,revisionKey:this.revisionKey,discussionKey:this.$key,fingerprint:this.fingerprint,line:this.line,file:n,body:this.getMarkdownBodyForPublication()||"",quoteBody:i?"":this._quoteLastComment()||"",codeQuote:"",codeblocks:this._getCodeblocksMarkdownForPublication()||"",delimiter:e?"___":""};return i||o.quoteBody||Vue.set(o,"codeQuote",await this._quoteCode()||""),(s?h:_get(this,"file","system")?d:_get(this,"fileKey")?l:e?c:u)(o)}_quoteLastComment(){return _access(this,"","review","","discussions","",this.$key,"","comments","","quoteLast","call",[this.timestamp])}_quoteCode(){const e=_get(this,"review","files",this.fileKey),t=_get(e,"revisions",this.revisionKey),s=_get(t,this.revisionBase?"baseFileSha":"fileSha");return!s||e.system?Promise.resolve():Promise.resolve().then(()=>this.$store.services.diffWorkerBridge.getContextLines(this.review.core.ownerName,this.review.core.repoName,s,t.type||"blob",this.line)).then(t=>{if(!t)return;const s=_access(e,"","path","","replace","call",[/.*\//,""]),i=_access(e,"","path","","replace","call",[/.*(?=\.)/,""]);return("```"+(a[s]||a[i]||"")+"\n"+(t=t.replace(/\n+$/,"")+"\n")+"```").replace(/^/gm,"> ")+"\n\n"}).catch(e=>{r.capture(e,"_quoteCode")})}commit(e,t,s){if(!s||t&&"-cmd"===this.$key&&this.$parent["-top"])return void Vue.set(e,_ref(this,"child","state","drafts",this.$key),null);const i=this.$truss.SERVER_TIMESTAMP,r=this.review,a="-cmd"===this.$key?"-top":this.$key,o=_get(r,"discu
1ssions",a),l=_get(r,"tracker",a),c=_get(l,"currentParticipant"),u=_(_get(o,"comments")).reject({provenance:"synthetic"}).map("timestamp").max()||null;let d=Math.max("-cmd"===this.$key?null:this.timestamp,_get(c,"timestamp")||null,this.state.acknowledgements[a]||null,"-top"===a&&_(_get(o,"comments")).map("timestamp").min()||null);(!d||d>=u)&&(d=i);const h={authorKey:this.$info.userid,markdownBody:_.trim(this.markdownBody)||null,htmlBody:_get(this,"htmlBodies",this.bodyHash)||null,timestamp:i,draftTimestamp:this.timestamp};if(t&&"-top"===this.$key){const e=this.$parent["-cmd"];if(_get(e,"markdownBody")){Vue.set(h,"markdownBody",_.trim(_.join([h.markdownBody||"",_.trim(e.markdownBody)],"\n\n"))||null);const t=_get(e,"htmlBodies",e.bodyHash);Vue.set(h,"htmlBody",h.htmlBody&&t?_.join([h.htmlBody,t],"\n\n"):null)}}if("-top"!==a&&(Vue.set(h,"roleChange",_get(c,"role")===this.role?"none":this.role),this.dispositionSetManually&&Vue.set(h,"roleChangedManually",!0)),_.forEach(this.codeblocks,e=>{(e.originalText||e.suggestedText)&&(Vue.set(h,"codeblocks",h.codeblocks||{}),Vue.set(h.codeblocks,e.$key,_.pick(e,"originalText","suggestedText","language","indent","fileKey","revisionKey","revisionBase","line")),e.originalText===e.suggestedText&&Vue.delete(h.codeblocks[e.$key],"suggestedText"),"suggestion"===e.kind&&e.originalText&&!e.suggestedText&&Vue.set(h.codeblocks[e.$key],"suggestedText",""))}),o){const t=_get(o,"comments",this.commentKey);if(t&&!t.provenance&&_.isMatch(t,_.omit(h,"timestamp")))return;
1Vue.set(e,_ref(r,"child","discussions",a,"comments",this.commentKey),h)}else{const t=Vue.set(e,_ref(r,"child","discussions",a),{timestamp:i,comments:{}});this.fileKey&&Vue.set(t,"fileKey",this.fileKey),this.revisionKey&&Vue.set(t,"revisionKey",this.revisionKey),this.revisionBase&&Vue.set(t,"revisionBase",this.revisionBase),this.line&&Vue.set(t,"line",this.line),this.otherFileKey&&Vue.set(t,"otherFileKey",this.otherFileKey),this.otherRevisionKey&&Vue.set(t,"otherRevisionKey",this.otherRevisionKey),this.otherRevisionBase&&Vue.set(t,"otherRevisionBase",this.otherRevisionBase),Vue.set(t.comments,this.commentKey,h);const s=this.summaryHtmlBodies&&_get(this,"summaryHtmlBodies",this.bodyHash);if(s&&Vue.set(t,"summary",{html:s,summarizerUserKey:this.$info.userid,commentKey:this.commentKey}),Vue.set(e,_ref(r,"child","tracker",a,"firstAuthorKey"),this.$info.userid),!this.review.userIsAuthor&&!_get(l,"participants",r.core.authorKey)){const t=_ref(r,"child","tracker",a,"participants",r.core.authorKey);e[_ref(t,"child","role")]||_.assign(e,{[_ref(t,"child","role")]:"following",[_ref(t,"child","forced")]:!0,[_ref(t,"child","roleTimestamp")]:i})}}const p={timestamp:d,lastPostTimestamp:i,role:this.role,roleTimestamp:i};"dismissed"===this.role&&Vue.set(p,"dismisserKey",this.$info.userid),"-top"===a?Vue.set(p,"role","following"):"discussing"===this.disposition&&Vue.set(p,"acceptedTimestamp",Number.MAX_VALUE);const v=_get(l,"participants",r.core.authorKey);this.$info.userid!==r.core.authorKey&&this.review.userIsAuthor&&_get(v,"forced")&&Vue.set(e,_ref(r,"child","tracker",a,"participants",r.core.authorKey),null),Vue.set(e,_ref(r,"child","tracker",a,"participants",this.$info.userid),p),Vue.set(e,_ref(this,"child","state","drafts",this.$key),null);const m=this.$store.services.completions.emojis,g=n.removeCodeAndQuotedBlocks(this.markdownBody).replace(/\bhttps?:\/\/.*?\/(\s|$)/g,""),f=_.map(g.match(/:[^\s:]+:/g)||[],e=>m.normalizeEmojiName(_.toLower(e.replace(/:/g,""))));for(const[e]of g.matchAll(m.emojisRegex))f.push(m.emojisToNames[e]);f.length&&Vue.set(e,_ref(r,"child","sentiments",this.$info.userid,"comments",this.commentKey),{emojis:f.join(" "),timestamp:i}),this.state.roleChanges[this.$key]&&null!==e[_ref(this,"child","state","roleChanges")]&&Vue.set(e,_ref(this,"child","state","roleChanges",this.$key),null),this.state.acknowledgements[this.$key]&&null!==e[_ref(this,"child","state","acknowledgements")]&&Vue.set(e,_ref(this,"child","state","acknowledgements",this.$key),null),null!==e[_ref(this,"child","state","dismissals")]&&_(this.state.dismissals).filter({discussionKey:this.$key}).forEach(t=>{this.state.dismissals.applyDismissal(t,e,!0)})}}}},!1,!0,{filename:"src/model/users/users.$userKey.state.$reviewKey.drafts.$draftKey.js",modelPath:"/users/$userKey/state/$reviewKey/drafts/$draftKey",modelExportName:"Draft"}),_reviewable.define(["UserReviewStateDrafts"],["config","corpsman","debug","session","mangler","draftFocusTracker","shared"],function(e,t,s,i,r,n,a){"use strict";const o=_.mapValues(a.dispositionKeywords,e=>new RegExp(`^((>( [^\\n]*|)|\\s*)\\n)*(${_(e).map(_.escapeRegExp).join("|")})\\b`,"i"));function l(e){return e&&e.replace(/\+.*/,"")}function c(e){return _.toLower(l(e))}function u(t){return!/\+/.test(t)&&("https://github.com"===e.gitHubUrl&&a.copilotReviewerUsernameRegex.test(c(t)))}function d(e){if(/\+/.test(e))return;const t=c(e);return u(t)?"copilot":t}function h(e){return"Bot"===e.actorType||"copilot"===d(e.username)||/\[bot\]$/i.test(l(e.username))}function p(e,t){if(_.isEmpty(t))return!0;const s=c(e);return _.some(t,e=>_.endsWith(s,"_"+_.toLower(e)))}function v(e){return _(e).mapValues(e=>_.pick(e,["fileKeys","subjects","scope"])).pickBy(e=>e.fileKeys&&e.subjects).value()}class GraphQlBuilder{constructor(e){Vue.set(this,"_type",e),Vue.set(this,"_body",[]),Vue.set(this,"_variables",{})}addVariable(e,t,s,i){Vue.set(this._variables,e,{type:t,value:s,minGheVersion:i})}addField(e){this._body.push(e)}build(){const e=_(this._variables).map(({type:e,minGheVersion:t},s)=>t?null:`$${s}: ${e}`).compact().join(", ")+_(this._variables).map(({type:e,minGheVersion:t},s)=>t?` #ghe(${t}) {, $${s}: ${e} #}`:null).compact().join("");return{query:this._body.length?`${this._type} (${e}) { ${_.join(this._body,"\n")} }`:null,variables:_.mapValues(this._variables,"value")}}}return{UserReviewStateDrafts:class UserReviewStateDrafts{constructor(){Vue.set(this,"state",this.$parent),Vue.set(this,"_directivesPromise",Vue.set(this,"_completionConditionPromise",Vue.set(this,"_autoReviewerDirectivesPromise",Promise.reject(new Error("not yet computed"))))),this._directivesPromise.catch(_.noop),Vue.set(this,"directives",void 0),Vue.set(this,"_directivesError",void 0),Vue.set(this,"completionConditionResult",void 0),Vue.set(this,"_completionConditionError",void 0),Vue.set(this,"_completionConditionPending",!1),Vue.set(this,"_conditionStateSeq",0),Vue.set(this,"_evaluatedConditionStateSeq",-1),Vue.set(this,"_expectedConditionInputAdvanceSeq",void 0),Vue.set(this,"_conditionInputsReady",!1),Vue.set(this,"_autoReviewerDirectivesError",void 0),Vue.set(this,"_autoReviewerDirectivesSource",void 0),Vue.set(this,"_autoReviewerDirectivesCompletionResult",void 0),this.$nextTick().then(()=>
1{if(this.$destroyed)return;const e=_.throttle(async()=>{if(!this.$destroyed&&!this.state.isLocked()&&this._conditionStateSeq!==this._evaluatedConditionStateSeq){s.condition&&console.log("EVALUATE draft condition",this._conditionStateSeq);try{await this._evaluatePublishableCompletionCondition()}catch(e){t.markHandled(e)}}},3e3,{leading:!0,trailing:!0}),i=e=>{e&&this._conditionStateSeq&&_get(this,"state","dashboardCache")&&_ref(this,"child","state","dashboardCache","stale").set(!0).catch(e=>{t.capture(e,"mark dashboard cache stale")}),this._conditionStateSeq+=1,Vue.set(this,"_expectedConditionInputAdvanceSeq",void 0)},r=()=>{this._conditionInputsReady&&!this.state.isLocked()&&this._conditionStateSeq!==this._evaluatedConditionStateSeq&&e()};this.$observe(()=>this.rawDirectives,async()=>{try{await this._analyzePublishableDirectives()}catch(e){t.markHandled(e)}},{precise:!0,deep:!0}),this.$observe(()=>({conditionInputHash:_get(this,"review","core","conditionInputHash")||"legacy",conditionInputFullHash:_get(this,"review","core","conditionInputFullHash")||"core-only",filemapsReady:_get(this,"review","revisions","filemapsReady"),filemaps:_get(this,"$store","filemaps",this.$reviewKey),basemapsReady:_get(this,"review","files","basemapsReady"),basemaps:_get(this,"$store","basemaps",this.$reviewKey)||!0,reviewUpdatesForCompletionCondition:this._reviewUpdatesForCompletionCondition,reviewOverlapStrategy:_get(this,"state","settings","reviewOverlapStrategy")}),async(e,t)=>{if(Vue.set(this,"_conditionInputsReady",_.every(e)),!this._conditionInputsReady)return;const n=!t||!_.isEqual(_.omit(e,["conditionInputHash","conditionInputFullHash"]),_.omit(t,["conditionInputHash","conditionInputFullHash"])),a=t&&(e.conditionInputHash!==t.conditionInputHash||e.conditionInputFullHash!==t.conditionInputFullHash),o=e.conditionInputHash===_get(this,"completionConditionResult","projectedConditionInputHash")&&e.conditionInputFullHash===(_get(this,"completionConditionResult","projectedConditionInputFullHash")||"core-only");n||!a||!o||(Vue.set(this,"_expectedConditionInputAdvanceSeq",void 0),this._completionConditionPending)?(i(n),s.condition&&console.log("OBSERVE condition state",this._conditionStateSeq,diffObject(t,e,{maxDiffLength:300})),r()):s.condition&&console.log("ACCEPT projected condition state",this._conditionStateSeq,diffObject(t,e,{maxDiffLength:300}))},{precise:!0,deep:!0}),this.$observe(()=>({locked:this.state.isLocked(),hasPublishOnPushTask:!!this.state.publishOnPushTask}),(e,t)=>{_get(t,"locked")&&!e.locked&&(_get(t,"hasPublishOnPushTask")&&0===this.state.num.pendingSend&&Vue.set(this,"_expectedConditionInputAdvanceSeq",this._conditionStateSeq),r())},{precise:!0}),this.$observe(()=>{const e=_get(this,"completionConditionResult","refreshTimestamp");return _.isNumber(e)&&e<=this.$info.nowAtInterval(1e3)?e:null},e=>{e&&(this._conditionStateSeq+=1,Vue.set(this,"_expectedConditionInputAdvanceSeq",void 0),r())},{precise:!0}),this.$observe(()=>[this.directives,this.completionConditionResult,_get(this,"review","labels","commentsOnlyInReviewable")],async()=>{if(this.directives&&this.completionConditionResult){s.condition&&console.log("INFER auto reviewer directives");try{await this._inferPublishableAutoReviewerDirectives()}catch(e){t.markHandled(e)}}},{precise:!0})})}get review(){return this.state.review}get completionConditionError(){return this._directivesError||this._completionConditionError||this._autoReviewerDirectivesError}get list(){const e=_.groupBy(this,"fileKey");let t=[];return e[void 0]&&(t=t.concat(_.sortBy(e[void 0],e=>{if("-top"===e.$key)return-1;const t=_get(this,"review","discussions",e.$key);return t?t.timestamp:e.creationTimestamp||e.timestamp}))),_.forEach(_get(this,"review","files","list"),s=>{t=t.concat(_.sortBy(e[s.$key],e=>{const t=_get(this,"review","revisions",e.revisionKey);return t?t.index:1/0},"line"))}),t}get publishable(){const e=this.state.isLocked();return _.filter(this.list,t=>t.hasContent&&"pondering"!==t.role&&(!e||this.state.isLocked(t.$key)))}get rawDirectives(){if(_get(this,"review","context","completeReview")&&_.every(this.publishable,"rawDirectives"))return this._gatherRawDirectives(this.publishable)}get reviewedFlags(){if(this.completionConditionResult)return _(this.completionConditionResult.reviewedFlags).groupBy("fileKey").mapValues(e=>
1_(e).keyBy("revKey").mapValues("reviewed").value()).value()}createStarterDraft(e,t,s,i,r,a,o,l){const c=_.find(this,r=>_.isMatch(r,{fileKey:e,revisionKey:t,revisionBase:s,line:i})&&!r.hasContent);if(!c){const n=this.$newKey();return this._createDraft(n,this._makeDraft(e,t,s,i,r,a,o,this.inferDisposition(n),void 0,void 0,l),!1,void 0,!0),this[n]}n.focus(c.$key)}getOrCreateStarterDraft(e,t,s,i){const r=_.find(this,r=>r._startsNewDiscussion&&_.isMatch(r,{fileKey:e,revisionKey:t,revisionBase:s,line:i})&&!r.hasContent);if(r)return r;const n=this.$newKey();return this._createDraft(n,this._makeDraft(e,t,s,i,void 0,void 0,void 0,this.inferDisposition(n)),!1,void 0,!0),this[n]}createReplyDraft(e,t,s,r,n){let a;Vue.set(i.onboarding,"createdReply",!0),"-top"===e.$key?r="following":r?a=!0:_get(this,"state","roleChanges",e.$key)?(r=_get(this,"state","roleChanges",e.$key),a=!0):r=this.inferDisposition(e.$key,t);const o=this._makeDraft(e.fileKey,e.revisionKey,e.revisionBase,e.line,e.otherFileKey,e.otherRevisionKey,e.otherRevisionBase,r,a,t);return"-top"===e.$key&&Vue.delete(o,"codeblocks"),this._createDraft(e.$key,o,s,n,!0)}createCmdDraft(e){if(this["-cmd"])return;const t=this._makeDraft(void 0,void 0,void 0,void 0,void 0,void 0,void 0,"following",!0,e);this._createDraft("-cmd",t,!0)}_createDraft(e,t,s,i,r){if(!this.$info.userid||this[e]||_access(this,"","state","","isLocked","call",[]))return;const a={},o=this.makeDraftLocationKey(t,e),l=_get(this,"state","trash",o);if(!s&&!t.markdownBody&&_.isEmpty(t.codeblocks)&&l){const e=_(l).values().sortBy("$key").last();_.assign(t,e),Vue.set(t,"timestamp",this.$truss.SERVER_TIMESTAMP),Vue.set(a,_ref(this,"child","state","trash",o,e.$key),null)}Vue.set(a,_ref(this,"child",e),t);const c=this.state.$update(a);return r&&n.focus(e,i),c}_makeDraft(e,t,s,i,r,n,a,o,l,c,u){const d={commentKey:this.$newKey(),role:o,timestamp:this.$truss.SERVER_TIMESTAMP,creationTimestamp:this.$truss.SERVER_TIMESTAMP};if(_.isUndefined(l)||Vue.set(d,"roleSetManually",l),_.isUndefined(t)||Vue.set(d,"revisionKey",t),_.isUndefined(s)||Vue.set(d,"revisionBase",s),_.isUndefined(e)||Vue.set(d,"fileKey",e),_.isUndefined(i)||Vue.set(d,"line",i),_.isUndefined(r)||Vue.set(d,"otherFileKey",r),_.isUndefined(n)||Vue.set(d,"otherRevisionKey",n),_.isUndefined(a)||Vue.set(d,"otherRevisionBase",a),c&&Vue.set(d,"markdownBody",c),u){const e=this.makeCodeblock(d,u);e&&Vue.set(d,"codeblocks",{[this.$newKey()]:e})}return d}makeCodeblock(e,t,s){let i;if(t)i={originalText:t.text,suggestedText:t.text,indent:t.indent||" "},t.language&&Vue.set(i,"language",t.language),t.fileKey!==e.fileKey&&Vue.set(i,"fileKey",t.fileKey),t.revisionKey!==e.revisionKey&&Vue.set(i,"revisionKey",t.revisionKey),!!t.revisionBase!=!!e.revisionBase&&Vue.set(i,"revisionBase",!!t.revisionBase),t.lineNumber!==e.line&&Vue.set(i,"line",t.lineNumber);else if(s){i={indent:" "};const e=s.side;if(e&&"none"!==e){const t=s.diff[`${e}Indent`],r=s.diff[`${e}Language`];t&&Vue.set(i,"indent",t),r&&Vue.set(i,"language",r)}}return i}makeDraftLocationKey(e,t){return _get(this,"review","tracker",t)?t:e.fileKey?e.fileKey+"-"+e.revisionKey.replace(".","_")+(e.revisionBase?"b":"")+"-"+e.line:"-top"===(t||e.$key)?"detached":"detached-extra"}getDraftStage(e){const t=_get(this,"review","discussions",e);return t?(_get(t,"num","commentsByAuthorKey",this.$info.userid)||0)+1:0}inferDisposition(t,s){const r=this.getDraftStage(t);if(s&&!1!==i.settings.inferDisposition)if(o.informing.test(s)){if(0===r)return"informing"}else if(o.discussingInitial.test(s)){if(r<2)return"discussing"}else{if(o.discussing.test(s))return"discussing";if(o.blocking.test(s))return"blocking";if(o.satisfied.test(s)){if(r>=1)return"satisfied"}else{if(o.working.test(s))return"working";if(/^((>( [^\n]*|)|\s*)\n)*(\?\?\?)/i.test(s))return"pondering"}}const n=_get(this,"review","tracker",t,"currentParticipant");if(_get(n,"active"))return n.disposition;const a="default"+(r?"Joined":"New")+(this.review.userIsAuthor?"AsAuthor":"")+"DiscussionRole";let l=i.settings[a]||e.dispositionDefaults[a];return r||"satisfied"!==l||(l="informing"),l}async _composeActionsSummary(){this._cancelIfDestroyed(),await this.$when(()=>this.state.$ready&&_get(this,"review","$ready"));const e=_.compact([this._composeFilesReviewedSummary(),this._composeCommentsMadeSummary(),this._composeDiscussionsRes
1olvedSummary(),this._composeDismissalsSummary()]);if(!e.length)return;const t=1===e.length?e[0]:2===e.length?e.join(/ and /.test(e[0])?", and ":" and "):`${e.slice(0,-1).join(", ")}, and ${_.last(e)}`;return`> @${this.$info.user.github.username} ${t}.`}_composeFilesReviewedSummary(){const e=[];let t=this.state.num.marks;t&&this.state.marks["-commits"]&&(t-=1),t&&e.push(`${t} file${1===t?"":"s"}`);const s=this.state.num.marks===this.state.num.fullMarks?"":"partially ",i=_get(this,"review","core","lastRevisionKey");if(_get(this,"state","marks","-commits","revisions",i,"reviewed")&&e.push("all commit messages"),e.length)return`${s}reviewed ${e.join(" and ")}`}_composeCommentsMadeSummary(){const e=this.state.num.publishableDrafts;if(e)return`made ${e} comment${1===e?"":"s"}`}_composeDiscussionsResolvedSummary(){const e=_(this.review.tracker).reject({$discussionKey:"-top"}).filter(e=>e&&!e.resolved&&_get(e,"resolvedIf","draftsSent")).size();if(e)return`resolved ${e} discussion${1===e?"":"s"}`}_composeDismissalsSummary(){const e=_(this.state.dismissals).values().uniqBy("discussionKey").size();if(!e)return;const t=_(this.state.dismissals).map("targetUserKey").uniq().map(e=>_get(this,"$store","services","avatars","users",e,"username")).compact().sortBy().map(e=>"@"+e).value();let s;switch(t.length){case 0:s="participants";break;case 1:case 2:s=t.join(" and ");break;default:s=t.slice(0,-1).join(", ")+`, and ${_.last(t)}`}return`dismissed ${s} from ${1===e?"a discussion":`${e} discussions`}`}_assembleReviewUpdatesForCompletionCondition(e,t,s){if(!_(t.overrides).concat(s).every("ref"))return;const i=_ref(this,"child","review").path+"/",r=new RegExp("^"+_.escapeRegExp(i)+"discussions/[^/]+$"),n=new RegExp("^"+_.escapeRegExp(i)+"discussions/[^/]+/comments/[^/]+$");try{return _(t.overrides).concat(s).map(e=>[e.ref.toString(),e.value]).fromPairs().assign(e).pickBy((e,t)=>_.startsWith(t,i)).mapValues((e,t)=>{if(r.test(t)){const t=_.omit(e,"summary");return _get(e,"comments")&&Vue.set(t,"comments",_.mapValues(e.comments,e=>_.pick(e,["authorKey","timestamp"]))),t}return n.test(t)?_.pick(e,["authorKey","timestamp"]):e}).mapKeys((e,t)=>t.slice(i.length)).value()}catch(e){throw Vue.set(e,"extra",{directiveOverrides:t.overrides,lateOverrides:s}),e}}get _reviewUpdatesForCompletionCondition(){if(_get(this,"review","context","completeReview")&&this._finalUpdatesOnPublish&&this.directives&&this.state.lateOverridesOnPublish)return this._assembleReviewUpdatesForCompletionCondition(this._finalUpdatesOnPublish,this.directives,this.state.lateOverridesOnPublish)}
1async _getPublishableConditionResult(){if(this._conditionStateSeq===this._evaluatedConditionStateSeq)try{return await this._completionConditionPromise}catch{}return this._evaluatePublishableCompletionCondition()}_evaluatePublishableCompletionCondition({waitForDashboardCache:e=!1,additionalReviewUpdates:s,usePersistedDeferral:i=!1}={}){const r=Vue.set(this,"_evaluatedConditionStateSeq",this._conditionStateSeq),n=this.review.core.conditionInputHash,a=this.review.core.conditionInputFullHash,o=this.review.core.lastReconciliationTimestamp,l=this._expectedConditionInputAdvanceSeq===r;let c=this._reviewUpdatesForCompletionCondition;i&&(c=_.omit(c,[`participants/${this.$info.userid}/deferredRevisionKey`,`participants/${this.$info.userid}/deferredTimestamp`])),_.isEmpty(s)||(c={...c,...s}),Vue.set(this,"_completionConditionPending",!0);const u=Vue.set(this,"_completionConditionPromise",(async()=>{try{const i=await this._evaluateCompletionCondition(c),d=()=>_get(this,"review","$ready")&&u===this._completionConditionPromise&&r===this._conditionStateSeq&&n===_get(this,"review","core","conditionInputHash")&&a===_get(this,"review","core","conditionInputFullHash"),h=!n||i.conditionInputHash===n;let p=d()&&h;if(p&&(Vue.set(this,"completionConditionResult",i),Vue.set(this,"_completionConditionError",void 0)),"error"===i.state)throw new Error(i.fullDescription);let m=!1;if(!p&&d()&&!h&&(l||await new Promise(e=>setTimeout(e,1e4)),p=d(),p)){if(!l){const e=new Error("Personal completion condition input failed to converge");Vue.set(e,"extra",{reviewKey:this.review.$key,storedConditionInputHash:n,resultConditionInputHash:i.conditionInputHash,storedConditionInputFullHash:a,resultConditionInputFullHash:i.conditionInputFullHash,lastReconciliationTimestamp:_get(this,"review","core","lastReconciliationTimestamp"),conditionStateSeq:r}),t.capture(e,"accept mismatched personal completion condition result")}Vue.set(this,"completionConditionResult",i),Vue.set(this,"_completionConditionError",void 0),m=!l}if(p&&i.conditionInputHash){const t=i.projectedConditionInputFullHash||null,r=i.projectedConditionInputHash&&(i.projectedConditionInputHash!==n||t!==(a||null)),l=v(i.designatedReviewers||this.review.designatedReviewers),c=_.some(l,e=>/(^|,)[^a-zA-Z,]*team:/.test(e.subjects)),u=this._cacheDashboardDataWhenReady(d,{...n&&{conditionInputHash:n},...a&&{conditionInputFullHash:a},...i.projectedConditionInputHash&&{projectedConditionInputHash:i.projectedConditionInputHash},...i.projectedConditionInputFullHash&&{projectedConditionInputFullHash:i.projectedConditionInputFullHash},...r&&_.isNumber(o)&&{projectionBaseReconciliationTimestamp:o},hasReviewedFlags:!_.isEmpty(i.reviewedFlags),hasDesignatedReviewers:!_.isEmpty(l),hasTeamDesignatedReviewers:c,personalReviewedFlagsDiffer:!_.isEqual(i.reviewedFlags||[],(s=this.review,_(s.files).reject("assimilated").flatMap(e=>_(e.revisions).filter(e=>_.isBoolean(e.reviewed)).map(t=>({fileKey:t.originalFileKey||e.$key,revKey:t.$key,reviewed:t.reviewed})).value()).sortBy("fileKey","revKey").value())),personalDesignationsDiffer:!_.isEqual(l,v(this.review.designatedReviewers)),...i.refreshTimestamp&&{conditionRefreshTimestamp:i.refreshTimestamp},...m&&{stale:!0}});e&&await u}return i}catch(e){throw u===this._completionConditionPromise&&Vue.set(this,"_completionConditionError",e.message),e}finally{u===this._completionConditionPromise&&Vue.set(this,"_completionConditionPending",!1)}var s})());return u}async _cacheDashboardDataWhenReady(e,s){if(this.$destroyed)return;const r={};let n;try{n=await this.$when(()=>{if(!e())return!0;const t=this.$store.services.teamMemberships;if(t.currentUserTeamsUnavailable)return r;const n=this.review.files.neutrallyUnreviewedReady,a=this.review.files.toBeReviewedByUserReady,o=!s.hasTeamDesignatedReviewers||t.currentUserTeamsLoaded,l=this.review.tracker.dashboardCacheProjection;if(!(n&&a&&o&&l&&i.settings.$ready))return!1;const{unreviewed:c,toReview:u}=_get(this,"review","files","num")||{};return!(!_.isNumber(c)||!_.isNumber(u))&&{numUnreviewedFiles:c,numFilesToReview:u,reviewMarkUserKeys:this.review.files.reviewMarkUserKeys.join(",")||null,reviewMarkStyle:this.review.files.reviewMarkStyle,commitsFileUnreviewed:!!_get(this,"review","files","-commits","unreviewed"),...l,trustButVerify:!!i.settings.trustButVerify,...s.hasTeamDesignatedReviewers&&{currentUserTeamsHash:this.$store.services.teamMemberships.currentUserTeamsHash}}})}catch(e){return void(this.$destroyed||t.capture(e,"wait to save dashboard cache"))}if(e()&&n!==r)try{await _ref(this,"child","state","dashboardCache").set({ver
1sion:this.state.dashboardCacheVersion,...s,...n})}catch(e){t.capture(e,"save dashboard cache")}}async _refreshPublishableCompletionConditionAfterSend(e){let s;await this.$truss.waitForThrottledRemoteDataUpdates(),this._cancelIfDestroyed(),await this.$when(()=>this._conditionInputsReady),this._cancelIfDestroyed();const i=_get(e,"submittedAt"),r=_.toLower(_get(e,"state")),n=Date.parse(i);if(i&&_.isFinite(n)&&_.includes(["approved","changes_requested","commented"],r)){const e=_get(this,"review","participants",this.$info.userid,"sanction");"commented"===r&&e&&"commented"!==e||(s={[`participants/${this.$info.userid}/sanction`]:r,[`participants/${this.$info.userid}/sanctionTimestamp`]:n})}try{do{this._conditionStateSeq===this._evaluatedConditionStateSeq&&(this._conditionStateSeq+=1),Vue.set(this,"_expectedConditionInputAdvanceSeq",this._conditionStateSeq),await this._evaluatePublishableCompletionCondition({waitForDashboardCache:!0,additionalReviewUpdates:s,usePersistedDeferral:!0})}while(this._conditionStateSeq!==this._evaluatedConditionStateSeq)}catch(e){t.markHandled(e),this._conditionStateSeq===this._evaluatedConditionStateSeq&&(this._conditionStateSeq+=1)}}async _evaluateCompletionCondition(e){this._cancelIfDestroyed();const{ownerName:t,repoName:s}=this.review.core;t&&s||Sentry.captureMessage("Missing repository identity for evaluate request (drafts)",{extra:{ownerName:t,repoName:s,reviewCore:this.review.core}});try{return await this.$store.queues.requests.send({action:"evaluate",type:"completion-publish",reviewKey:this.review.$key,ownerName:t,repoName:s,prNumber:this.review.core.pullRequestId,context:JSON.stringify({reviewUpdates:e})},{timeout:7500,disregardWrite:!0})}catch(e){throw Vue.set(e,"message",e.message.replace(/^Error:/,"Failed to execute custom review completion condition:")),e}}async _composeIssueReviewSummary(e){this._cancelIfDestroyed();let t="> *[Reviewable]($REVIEW_URL)* status: ";if(e.completed&&(t+="<span>:shipit:</span> complete! "),t+=e.descriptionIsMarkdown?e.shortDescription||_.trim(e.description).match(/^[^\r\n]*/)[0]:e.description,!_.isEmpty(e.pendingReviewers)){const s=_(e.pendingReviewers).map((e,t)=>({index:_.parseInt(t),username:e.username})).sortBy("index").value(),i=s.length;t+=" (waiting on "+_.map(s,(e,t)=>(t?i>1&&t===i-1?2===i?" and ":", and ":", ":"")+e.username).join("")+")"}return t+=".",t}async _inferAutoReviewerDirectives(e,t){this._cancelIfDestroyed();const s=!_get(this,"review","labels","commentsOnlyInReviewable"),i=_access(this,"","review","","statuses","",a.reviewableStatusContext,"","pendingReviewers","","split","call",[","])||[],r=this.$store.services.avatars;for(const e of i)r.connectUser(e);const n=_get(this,"review","core","authorKey");r.connectUser(n),await this.$when(()=>_.every(i,e=>r.users[e])&&(!n||r.users[n]),{timeout:5e3});const o=_(e.reviewers).map(e=>d(e.username)).compact().value(),l=_(i).map(e=>d(r.users[e].username)).compact().value(),u=_(t.pendingReviewers).map(e=>d(e.username)).compact().value(),h=d(r.users[n].username),p=_(_get(this,"review","people")).filter("requestedReviewer").map(e=>d(e.username)).compact().value();s&&_.pull(p,c(this.$store.users.current.core.public.username));const v=_(u).difference(p).difference(o).pull(h).sortBy().value(),m=_(l).difference(u).difference(o).intersection(p).sortBy().value();Vue.set(e,"autoReviewers",_.compact(await Promise.all(_(v).map(e=>({username:e,op:"+"})).concat(_.map(m,e=>({username:e,op:"-"}))).map(async({username:e,op:t})=>{const s=await this.$store.services.users.lookupUsername(e);if(!s)throw new Error(`No such user when auto-requesting reviewers: @${e}`);if(_.includes(["User","Bot"],s.actorType))return{username:e,op:t,..._.pick(s,"userKey","nodeId","actorType")}}).value()))),Vue.set(e,"autoReviewersOverrides",_.map(e.autoReviewers,e=>({ref:_ref(this,"child","review","participants",e.userKey,"requestedReviewer"),value:"+"===e.op||null,expectedWebhook:"pull_request"})))}async _decorateDirectivesWithAutoInferredReviewers(e,t=this.completionConditionResult){try{if(e===this._autoReviewerDirectivesSource&&t===this._autoReviewerDirectivesCompletionResult)return await this._autoReviewerDirectivesPromise}catch{}if(e===this.directives&&t===this.completionConditionResult)return this._inferPublishableAutoReviewerDirectives();const s={...e};return await this._inferAutoReviewerDirectives(s,t),s}_inferPublishableAutoReviewerDirectives(){const e=this.directives,t=this.completionConditionResult,s={...e};Vue.set(this,"_autoReviewerDirectivesSource",e),Vue.set(this,"_autoReviewerDirectivesCompletionResult",t);const i=(async()=>{try{return await this._inferAutoReviewerDirectives(s,t),i===this._autoReviewerDirectivesPromise&&e===this.directives&&t===this.completionConditionResult?(Vue.set(e,"autoReviewers",s.autoReviewers),Vue.set(e,"autoReviewersOverrides",s.autoReviewersOverrides),Vue.set(this,"_autoReviewerDirectivesError",void 0),e):s}catch(s){throw i===this._autoReviewerDirectivesPromise&&e===this.directives&&t===this.completionConditionResult&&Vue.set(this,"_autoReviewerDirectivesError",s.message),s}})();return Vue.set(this,"_autoReviewerDirectivesPromise",i),i}
1_delayCurrentUserRequest(e){const t={username:_.toLower(this.$store.users.current.core.public.username),op:"+"};return!![..._.remove(e.reviewers,t),...this.state.effectiveAutoRequestReviewers?_.remove(e.autoReviewers,t):[]].length}async _composeIssueSummary(e){const[t,s]=await Promise.all([this._composeActionsSummary(),this._composeIssueReviewSummary(e)]);this._cancelIfDestroyed();let n=[t||">",s].join("\n>\n");return n=n.replace("$REVIEW_URL",window.location.href.replace(/[?#].*/,"")),i.hubkit().request("POST /markdown",{body:{text:r.renderCustomEmojis(n),mode:"gfm",context:`${this.review.core.ownerName}/${this.review.core.repoName}`}})}async preview(e){if(Sentry.addBreadcrumb({category:"process",message:"Preview - render drafts"}),await Promise.all(_.map(e,e=>{const t=e.render();return Vue.set(e,"previewBodyHash",e.bodyHash),Vue.set(e,"previewCommentHash",e.commentHash),t})),this._cancelIfDestroyed(),_.some(e,"$destroyed"))throw new Error("Canceled");Sentry.addBreadcrumb({category:"process",message:"Preview - analyzing directives"});const t=await this._getDirectives(e);if(this._cancelIfDestroyed(),!this._areDraftsRenderedForPreview(e))return Sentry.addBreadcrumb({category:"process",message:"Preview - drafts changed, looping"}),this.preview(e);Sentry.addBreadcrumb({category:"process",message:"Preview - evaluating condition"});const s=await this._getPublishableConditionResult(),[i,r]=await Promise.all([this._composeIssueSummary(s),this._decorateDirectivesWithAutoInferredReviewers(t,s)]);if(this._cancelIfDestroyed(),_.some(e,"$destroyed"))throw new Error("Canceled");if(!this._areDraftsRenderedForPreview(e))return Sentry.addBreadcrumb({category:"process",message:"Preview - drafts changed, looping"}),this.preview(e);const n={summary:{html:i},autoReviewerRequests:r.autoReviewers,drafts:_.clone(e)};return Vue.set(n,"topDraft",_access(_,"","remove","call",[n.drafts,{$key:"-top"}],"",0)),Vue.set(n,"cmdDraft",_access(_,"","remove","call",[n.drafts,{$key:"-cmd"}],"",0)),Sentry.addBreadcrumb({category:"process",message:"Preview - complete"}),n}_areDraftsRenderedForPreview(e){return _.every(e,e=>e.markdownBody?e.bodyHash===e.previewBodyHash&&e.htmlBodies[e.previewBodyHash]:e.hasContent)}get changed(){return!_.every(this,e=>e.commentHash===e.previewCommentHash)}async send(e,{commitComments:t=!0,bumpDeferral:r=!1,publishNow:n=!1,publishOnPush:a=this.state.publishOnPush}={}){const o=this.review;if(!o||!this.$info.userid)throw new Error("No review or user");const l=e===this.publishable,c=l&&a&&this.state.canPublishOnPush,u=!!this.review.state.publishOnPushTask;if(l&&a&&!c)throw _.assign(new Error("Publish-on-push is not available for you in this review."),{code:"review_publish_on_push_unavailable",details:{stage:"send"}});if(l){if(!t)throw new Error("Internal error: publishing must always commit comments");_.forEach(this.list,e=>{e.hasContent||(s.drafts&&console.log("draft",e.locator.$key,"delete empty on send"),e.$set(null))})}if(!(e.length||l&&this.state.num.pendingSend))return;if(_.some(e,"uploading"))throw new Error("File attachments are still uploading.");const d=_get(o,"revisions",o.core.lastRevisionKey,"commitSha");if(!d)throw _.assign(new Error("Internal error: model missing last revision"),{extra:{lastRevisionKey:o.core.lastRevisionKey,revisions:o.revisions}});const h=o.context;let p,v;h.acquire();try{const s=t&&!o.labels.commentsOnlyInReviewable;let a=null;(s||_.some(e,e=>_get(e,"rawDirectives","labels","length")))&&(a=_get(h,"repository","private")?"repo":"public_repo"),a&&!i.hasScope(a)&&(await this.$store.services.auth.login([a]),this._cancelIfDestroyed()),this.$store.services.auth.disable();const m=i.hubkit(o.core.ownerName,o.core.repoName,{number:o.core.pullRequestId}),[g,f]=await Promise.all([s?this._selectUnpostedDrafts(e,m):[],this._getDirectives(e),..._.map(e,e=>e.render())]);let w=f;try{this._cancelIfDestroyed(),Sentry.addBreadcrumb({category:"process",message:"Publishing comments",data:{numDrafts:e.length,numUnpostedDrafts:g.length,gitHubPostRequested:s}}),l&&(p=await this._getPublishableConditionResult(),w=await this._decorateDirectivesWithAutoInferredReviewers(w,p));const i=[...l&&this.state.lateOverridesOnPublish||[],...w.overrides||[],...this.state.effectiveAutoRequestReviewers&&w.autoReviewersOverrides||[]],a=_(i).map("expectedWebhook").compact().uniq().value(
1),f=_.includes(a,"pull_request"),y=this._delayCurrentUserRequest(w);Sentry.addBreadcrumb({category:"process",message:"Analyzed directives",data:{directives:w,requestCurrentUser:y}});const b=await h.discussionSummaries.waitForStarterDraftSummaries(e);b.numDrafts&&Sentry.addBreadcrumb({category:"process",message:"Waited for starter draft summaries",data:{...b,reason:"before gathering final updates"}});let C=l?this._finalUpdatesOnPublish:this._gatherFinalUpdates(e,w,{},!1,t);if(!l&&r){const e=_get(o,"participants",this.$info.userid,"deferredRevisionKey");e&&this.state.gatherDeferredUpdates(C,e)}if(a.length&&(C={...C,..._(a).keyBy(e=>_ref(o,"child","syncNeeded",this.$info.userid,"webhooks",e)).mapValues(_.constant(this.$truss.SERVER_TIMESTAMP)).value()}),v=s?await this._postIssueComment(g,p,l,y,d,w,C,f,c,n,m):await this._prepareGraphQlAndPublish(null,null,y,w,C,g,f,!0,l,c,n,m),c&&!u&&!this.review.state.publishOnPushTask)throw _.assign(new Error("Publish-on-push publication was not queued."),{code:"review_publish_on_push_not_queued",details:{stage:"send"}});if(this.review.state.publishOnPushTask)return;if(this._cancelIfDestroyed(),this._applyOverrides(i),_.isEmpty(C))Sentry.addBreadcrumb({category:"process",message:"Nothing to commit, done"});else{Sentry.addBreadcrumb({category:"process",message:"Committing comments",data:{fingerprints:_.map(e,"fingerprint")}});const t=[],s=setTimeout(()=>{Sentry.captureMessage("Publishing update took too long",{level:"debug",extra:{attachments:[C]}})},15e3);
1await this.$store.$ref.annotate({reconciliationPromises:t}).update(C),clearTimeout(s),Sentry.addBreadcrumb({category:"process",message:"Comments committed"}),await Promise.all(t),Sentry.addBreadcrumb({category:"process",message:"Reconciliation queued; done"});const i=_.includes(["active","broken"],_get(o,"repository","core","connection")),r=_get(o,"repository","core","settings","badgeCondition");o.core&&!i?h.syncPullRequest("unconnected"):o.core&&"published"===r&&!f&&this.$store.queues.requests.send({action:"updatePullRequest",ownerName:o.core.ownerName,repoName:o.core.repoName,prNumber:o.core.pullRequestId},{fireAndForget:!0})}}finally{this.$store.services.auth.enable()}l&&await this._refreshPublishableCompletionConditionAfterSend(v)}finally{this.$destroyed||await this.$nextTick(),h.release()}}async _selectUnpostedDrafts(e,t){if(!_.some(e,"postingAttempted"))return e;const s=this.review.core,i=new RegExp(`\\(https?://[^/]+/reviews/${s.ownerName}/${s.repoName}/${s.pullRequestId}#[^:)]+:([^)]+)\\)`,"gi"),[r,n,a]=await Promise.all([t.request("GET /repos/:owner/:repo/issues/:number/comments",{ifNotFound:[]}),t.request("GET /repos/:owner/:repo/pulls/:number/reviews",{ifNotFound:[]}),t.request("GET /repos/:owner/:repo/pulls/:number/comments",{ifNotFound:[]})]),o={};return _.forEach([...r,...n,...a],e=>{e.user&&"github:"+e.user.id===this.$info.userid&&(e.body.replace(/<!-- Reviewable comment (\S+) -->/g,(e,t)=>(Vue.set(o,t,!0),e)),e.body.replace(i,(e,t)=>(_(t).split(",").forEach(e=>{Vue.set(o,e,!0)}),e)))}),_.reject(e,e=>o[e.fingerprint])}async _getDirectives(e){if(e===this.publishable)try{return await this._directivesPromise}catch{return this._analyzePublishableDirectives()}return this._analyzeDirectives(this._gatherRawDirectives(e),!1)}_analyzePublishableDirectives(){return this.rawDirectives?(Vue.set(this,"_directivesPromise",(async()=>{try{const e=!_get(this,"review","labels","commentsOnlyInReviewable");Vue.set(this,"directives",await this._analyzeDirectives(this.rawDirectives,e))}catch(e){throw Vue.set(this,"_directivesError",e.message),e}return Vue.set(this,"_directivesError",void 0),this.directives})()),this._directivesPromise):Promise.resolve()}async _analyzeDirectives(e,t){const s={labels:[],assignees:[],reviewers:[],mentions:[],overrides:[]},[,i,r]=await Promise.all([this._filterLabelsAndMilestones(e,s),this._getUserMap(e),_get(e,"mentions","length")?this._getValidMentioneeUsernames():null]);return this._filterAssigneesAndReviewers(e,i,t,s),this._filterMentions(e,i,r,s),s}_gatherRawDirectives(e){const t={labels:[],assignees:[],reviewers:[],mentions:[]};return _.forEach(_.sortBy(e,"timestamp"),e=>{e.rawDirectives&&_.forEach(t,(s,i)=>{Vue.set(t,i,t[i].concat(e.rawDirectives[i]))})}),t}async _filterLabelsAndMilestones(e,t){if(this._cancelIfDestroyed(),_.isEmpty(e.labels))return;Vue.set(i.onboarding,"usedLabels",!0);const s=_get(this,"review","core","ownerName"),r=_get(this,"review","core","repoName"),n=this.$store.services.completions;n.labels.connect(s,r),n.milestones.connect(s,r);let[a,o]=await Promise.all([this.$when(()=>n.labels.get(s,r)),this.$when(()=>n.milestones.get(s,r))]);a=_.keyBy(a,e=>_.toLower(e.name)),o=_.keyBy(o,e=>_.toLower(e.label)),_(e.labels).slice().reverse().uniqBy("name").reverse().forEach(e=>{const s=_.toLower(e.name);o[s]?(t.labels.push({milestone:!0,nodeId:o[s].nodeId,op:e.op,token:e.token}),t.overrides.push({ref:_ref(this,"child","review","milestone"),value:"+"===e.op?e.name:null,expectedWebhook:"pull_request"})):a[s]&&(t.labels.push({label:!0,nodeId:a[s].nodeId,op:e.op,token:e.token}),t.overrides.push({ref:_ref(this,"child","review","labels",e.name),value:"+"===e.op||null,expectedWebhook:"pull_request"}))})}async _getUserMap(e){const t={},s=_get(this,"review","core","ownerName"),i=_get(this,"review","core","repoName");await this.$when(()=>this.$store.services.completions.people.getAgents(s,i)),this._cancelIfDestroyed();const r=_(e.mentions).map("username").difference(_(e.assignees).concat(e.reviewers).map("username").value()).value();return await Promise.all(_(["assignees","reviewers","mentions"]).flatMap(t=>_.map(e[t],"username")).compact().uniq().map(async e=>{const s=_get(this,"review","people","usernameIndex",_.toLower(e)),i=s?{..._.pick(s,"userKey","nodeId"),actorType:_get(this,"$store","services","avatars","users",s.userKey,"actorType")}:await this.$store.services.users.lookupUsername(e);
1if(i&&(s||i.agent||_.includes(["User","Bot"],i.actorType)))Vue.set(t,e,i);else if(!_.includes(r,e)){if(i)throw new Error(`Unsupported account type when processing directives: @${e}`);throw new Error(`No such user when processing directives: @${e}`)}}).value()),t}async _getAssigneeUsernames(){this._cancelIfDestroyed();const e=this.$store.services.completions.assignees,t=_get(this,"review","core","ownerName"),s=_get(this,"review","core","repoName");e.connect(t,s);const i=await this.$when(()=>e.get(t,s));return _.map(i,"username")}async _getValidMentioneeUsernames(){const e=_get(this,"review","core","ownerName"),t=_get(this,"review","core","repoName"),[s,i]=await Promise.all([this._getAssigneeUsernames(),this.$when(()=>this.$store.services.completions.people.getAgents(e,t))]);this._cancelIfDestroyed();const r=_(this.review.people).filter(e=>/^ghagent:/.test(e.$key)&&!e.repositoryForbidden).map("completion.username").compact().value();return _(s).concat(_.map(i,"username"),r).uniq().value()}_filterAssigneesAndReviewers(e,t,s,i){s&&_get(this,"review","participants",this.$info.userid,"requestedReviewer")&&i.overrides.push({ref:_ref(this,"child","review","participants",this.$info.userid,"requestedReviewer"),value:!1,expectedWebhook:"pull_request_review"}),_.forEach(["assignees","reviewers"],s=>{_(e[s]).slice().reverse().uniqBy("username").reverse().forEach(e=>{const r=t[e.username];i[s].push({username:e.username,nodeId:r.nodeId,op:e.op,token:e.token,actorType:r.actorType});const n={assignees:"assignee",reviewers:"requestedReviewer"}[s];i.overrides.push({ref:_ref(this,"child","review","participants",r.userKey,n),value:"+"===e.op||null,expectedWebhook:"pull_request"})})})}_filterMentions(e,t,s,i){const r=_get(this,"$info","user","emuSuffixes"),n=_get(this,"review","context","repository","private");_(e.mentions).filter(e=>p(e.username,r)).filter(e=>t[e.username]).reject(e=>t[e.username].userKey===this.$info.userid).reject(e=>(n||/^ghagent:/.test(t[e.username].userKey))&&!_.includes(s,_.toLower(e.username))).uniqBy(e=>`${t[e.username].userKey};${e.draftKey}`).forEach(e=>{const{userKey:s}=t[e.username],r=!!_get(this,"review","tracker",e.draftKey),n=_ref(this,"child","review","tracker",e.draftKey,"participants",s),a=n.value,o=!0===_get(a,"forced");i.mentions.push({draftKey:e.draftKey,userKey:s,inReply:r,forced:o}),r&&_get(a,"disposition")&&"following"!==a.disposition||(i.overrides.push({ref:_ref(n,"child","role"),value:"mentioned"},{ref:_ref(n,"child","roleTimestamp"),value:this.$truss.SERVER_TIMESTAMP},{ref:_ref(n,"child","dismisserKey"),value:null}),o&&i.overrides.push({ref:_ref(n,"child","forced"),value:null}))})}async _prepareDirectives(e,t,s){await this._validateDirectives(e),await Promise.all([this._prepareLabelDirectives(e,t,s),this._prepareMilestoneDirective(e,t,s),this._prepareAssigneeDirectives(e,t,s),this._prepareReviewerDirectives(e,t,s)])}async _validateDirectives(e){this._validateNoAgentAssigneesOrReviewers(e);const t=!_.isEmpty(e.assignees),s=!_.isEmpty(e.reviewers),i=t||s||!_.isEmpty(e.labels),r=_get(this,"review","verdict","push")||_get(this,"review","verdict","triage");if(i&&!r){const t=_.map([...e.assignees,...e.reviewers,...e.labels],"token"),s=Error("Sorry, you don't have permission to set labels, reviewers or assignees in this repository. You'll need to escape the following directives with `...`: "+t.join(", "));throw Vue.set(s,"fingerprint",["no_label_assignee_permissions"]),s}const n=await(t?this._getAssigneeUsernames():null),a=_get(this,"$info","user","emuSuffixes"),o=_(e.assignees).filter({op:"+"}).map("username").filter(e=>!p(e,a)||!_.includes(n,_.toLower(e))).value(),l=_(e.reviewers).filter({op:"+"}).map("username").reject(e=>u(e)||p(e,a)).value(),c=o.length?`Invalid assignees: ${o.join(", ")}. `:"",d=l.length?`Invalid reviewers: ${l.join(", ")}. `:"";if(c||d){const e=Error(c+d);throw Vue.set(e,"fingerprint",["bad_assignees_reviewers"]),e}}_validateNoAgentAssigneesOrReviewers(e){_.forEach(["assignees","reviewers"],t=>{const s=_.find(e[t],e=>_.includes(e.username,"+"));if(!s)return;const i=Error(`You can't ${"assignees"===t?"assign agents":"request agents as reviewers"} with inline directives. Mention agents with @${s.username} instead.`);throw Vue.set(i,"fingerprint",["agent_assignee_reviewer_directive"]),i})}async _prepareLabelDirectives(e,t,s){const r=_(e.labels).filter("label").groupBy("op").value();_.isEmpty(r)||(Vue.set(i.onboarding,"usedLabels",!0),_.forEach([["-","removedLabelIds","removeLabelsFromLabelable"],["+","addedLabelIds","addLabelsToLabelable"]],([e,s,i])=>{const n=_.map(r[e],"nodeId");n.length&&(t.addVariable(s,"[ID!]!",n),t.addField(`\n ${i}(input: {\n labelableId: $pullRequestId,\n labelIds: $${s}\n }) { clientMutationId }`))}))}async _prepareMilestoneDirective(e,t,s){const r=_.find(e.labels,"milestone");if(!r)return;let n;if(Vue.set(i.onboarding,"usedMilestone",!0),"+"===r.op)n=r.nodeId;else{_get(await s.request("GET /repos/:owner/:repo/issues/:number"),"milestone","node_id")===r.nodeId&&(n=null)}void 0!==n&&(t.addVariable("milestoneId","ID",n),t.addField("\n updatePullRequest(input: {\n pullRequestId: $pullRequestId,\n milestoneId: $milestoneId\n }) { clientMutationId }"))}async _prepareAssigneeDirectives(e,t,s){if(!e.assignees.length)return;const i=new Set(_(this.review.people).pickBy("assignee").map("nodeId").value()),r=_.clone(i);if(_.forEach(e.assignees,e=>{"+"===e.op?i.add(e.nodeId):i.delete(e.nodeId)}),i.size>10)throw new Error("Cannot have more than 10 assignees");if(_.isEqual(i,r))return;const n=_.filter(e.assignees,e=>"-"===e.op&&!i.has(e.nodeId)),a=_.filter(e.assignees,e=>"+"===e.op&&i.has(e.nodeId));_.forEach([[n,"removedAssigneeIds","removeAssigneesFromAssignable"],[a,"addedAssigneeIds","addAssigneesToAssignable"]],([e,s,i])=>{e.length&&(t.addVariable(s,"[ID!]!",_.map(e,"nodeId")),t.addField(`\n ${i}(input: {\n assignableId: $pullRequestId,\n assigneeIds: $${s}\n }) { clientMutationId }`))})}async _prepareReviewerDirectives(e,t,s){const i=[...e.reviewers,...this.state.effectiveAutoRequestReviewers&&e.autoReviewers||[]];if(!i.length)return;let r,n,a,o,l=_.some(i,h);if(_.some(i,{op:"-"})){const e=await s.request("GET /repos/:owner/:repo/pulls/:number/requested_reviewers");r=_(e.users).reject({type:"Bot"}).map("node_id").value(),n=_(e.users).filter({type:"Bot"}
1).map("node_id").value(),l=l||!!n.length,a=_.map(e.teams,"node_id"),o=!1,_.forEach(i,e=>{const t=h(e)?n:r;"+"===e.op?_.includes(t,e.nodeId)||t.push(e.nodeId):_.pull(t,e.nodeId)})}else r=_(i).reject(h).map("nodeId").value(),n=_(i).filter(h).map("nodeId").value(),a=[],o=!0;t.addVariable("reviewerUserIds","[ID!]!",r),l&&t.addVariable("reviewerBotIds","[ID!]!",n,"3.19"),t.addVariable("reviewerTeamIds","[ID!]!",a),t.addVariable("requestReviewUnion","Boolean!",o),t.addField(`\n requestReviewsByDirective: requestReviews(input: {\n pullRequestId: $pullRequestId,\n userIds: $reviewerUserIds,\n ${l?"#ghe(3.19) {\n botIds: $reviewerBotIds,\n #}":""}\n teamIds: $reviewerTeamIds,\n union: $requestReviewUnion\n }) { clientMutationId }`)}_findInReplyMentions(e){return _.filter(e.mentions,e=>{if(!e.inReply)return!1;const t=_get(this,"review","tracker",e.draftKey,"participants",e.userKey);return!_get(t,"disposition")||"following"===t.disposition})}async _executeInReplyMentions(e){await Promise.all(_.map(e,async e=>{try{await _ref(this,"child","review","tracker",e.draftKey,"participants",e.userKey).update({role:"mentioned",roleTimestamp:this.$truss.SERVER_TIMESTAMP,dismisserKey:null,...e.forced&&{forced:null}})}catch(s){const i=_get(this,"review","tracker",e.draftKey,"participants",e.userKey);if(!_get(i,"disposition")||"following"===i.disposition)throw s;t.markHandled(s)}}))}async _publishOnPush(e,t,s,i,r,n){const a=this.$newKey();_get(t,"body")&&(t.body+=`\n\x3c!-- Reviewable submission ${a} --\x3e`);const o=this.$info.user.github.ownerKey||this.$info.userid,l=this.review.core;await this.review.state.publishOnPushTaskRef.commit(c=>{if(c.currentValue&&"expired"!==c.currentValue.status)throw new Error("Publish on push is already scheduled");c.set({owner:l.ownerName,repo:l.repoName,securityOwner:Truss.escapeKey(_.toLower(l.ownerName)),securityRepo:Truss.escapeKey(_.toLower(l.repoName)),prNumber:l.pullRequestId,userKey:this.$info.userid,pushKey:_.map([l.ownerName,l.repoName,l.pullRequestId,o],_.toLower).join("|"),scheduledRevisionKey:l.lastRevisionKey,query:e||null,queryVariables:t?JSON.stringify(t):null,mentions:_(s).groupBy("draftKey").mapValues(e=>_(e).map("userKey").join(",")).value(),updates:JSON.stringify(i),fingerprint:a,draftKeys:_(r).map("$key").join(",")||null,willTriggerPullRequestChange:n||null,_lease:{created:this.$truss.SERVER_TIMESTAMP}})})}async _prepareGraphQlAndPublish(e,t,s,i,r,n,a,o,l,c,u,d){const h=new Set;let p,v,m;for(;;){let g,f;if(o){const r=this.review.core.nodeId;if(!r)throw new Error("Review out of sync, please reload the page.");const n=new GraphQlBuilder("mutation");if(n.addVariable("pullRequestId","ID!",r),await this._prepareDirectives(i,n,d),e?(n.addVariable("event","PullRequestReviewEvent!",e.event),p||(n.addVariable("commitSha","GitObjectID!",e.commitSha),n.addVariable("body","String!",t),n.addField(`\n addPullRequestReview(input: {\n pullRequestId: $pullRequestId,\n commitOID: $commitSha,\n body: $body,\n ${e.inlineReplies.length?"":"event: $event"}\n }) { pullRequestReview { id, state, submittedAt } }`)),e.inlineReplies.length&&(_.forEach(e.inlineReplies,({replyTo:e,body:t},s)=>{h.has(s)||(n.addVariable(`replyBody${s}`,"String!",t),n.addVariable(`replyTo${s}`,"ID!",e),n.addField(`\n comment${s}: addPullRequestReviewComment(input: {\n pullRequestId: $pullRequestId,\n body: $replyBody${s},\n inReplyTo: $replyTo${s}\n }) { clientMutationId }`))}),n.addField("\n submitPullRequestReview(input: {\n pullRequestId: $pullRequestId,\n event: $event\n }) { pullRequestReview { id, state, submittedAt } }"))):t&&(n.addVariable("body","String!",t),n.addField("\n addComment(input: {\n subjectId: $pullRequestId,\n body: $body\n }){ clientMutationId }")),s){const e=this.$store.users.current.core.public,t=e.nodeId||(await this.$store.services.users.lookupUsername(e.username)).nodeId;n.addVariable("currentUserId","ID!",t),n.addField("\n requestCurrentUser: requestReviews(input: {\n pullRequestId: $pullRequestId,\n userIds: [$currentUserId],\n union: true\n }) { clientMutationId }")}({query:g,variables:f}=n.build()),v=this._findInReplyMentions(i)}if(this.review.state.publishOnPushTask){if(!u)throw _.assign(new Error("A publish-on-push publication is already queued for this review."),{code:"review_publish_on_push_queued",details:{stage:"send"}});if("pushed"===await this.review.state.cancelPublishOnPush())return}else if(c&&l)return void await this._publishOnPush(g,f,v,r,n,a);if(!o||!g)return;Sentry.addBreadcrumb({category:"process",message:"Posting comments to GitHub",data:{queryChars:g.length,inlineReplies:_.size(_get(e,"inlineReplies")),succeededComments:h.size}}
1);try{const e=await d.graph(g,{variables:f,timeout:3e4});m=_.get(e,"submitPullRequestReview.pullRequestReview")||_.get(e,"addPullRequestReview.pullRequestReview")||m}catch(s){m=_.get(s,"data.submitPullRequestReview.pullRequestReview")||_.get(s,"data.addPullRequestReview.pullRequestReview")||m,p=_get(s,"data","addPullRequestReview","pullRequestReview","id")||p;if(_.some(s.errors,e=>"RESOURCE_LIMITS_EXCEEDED"===e.type)){const r=new Set(h);_.forEach(s.data,(e,t)=>{const s=t.match(/^comment(\d+)$/);s&&e&&h.add(_.parseInt(s[1]))});const n=_.mapValues(f,e=>_.size(JSON.stringify(e)));if(Sentry.addBreadcrumb({category:"process",message:"GitHub resource limit exceeded while posting comments",data:{queryChars:g.length,variableChars:_(n).values().sum(),largestVariables:_(n).toPairs().sortBy(1).reverse().take(5).fromPairs().value(),bodyChars:_.size(t),inlineReplies:_.size(_get(e,"inlineReplies")),inlineReplyChars:_.sumBy(_get(e,"inlineReplies"),"body.length"),succeededComments:_(h).toArray().sortBy().join(", "),prevSucceededComments:_(r).toArray().sortBy().join(", "),directives:{assignees:_.size(i.assignees),autoReviewers:_.size(i.autoReviewers),labels:_.size(i.labels),reviewers:_.size(i.reviewers)}}}),h.size>r.size){Sentry.captureMessage("Resuming inline replies after resource limits exceeded");continue}}if(_get(e,"inlineReplies","length")&&p)try{await d.graph("\n mutation($reviewId: ID!) {\n deletePullRequestReview(input: {\n pullRequestReviewId: $reviewId\n }) { clientMutationId }\n }",{variables:{reviewId:p}})}catch(e){if(/non-pending pull request review/.test(e.message)&&1===_get(s,"errors","length")&&"submitPullRequestReview"===_get(s,"errors",0,"path",0))break;s.message+=` (${e.message})`}throw/one pending review per pull request/.test(s.message)&&(Vue.set(s,"message","You must submit or cancel your pending review on GitHub first."),Vue.set(s,"skipCapture",!0)),s}break}return await this._executeInReplyMentions(v),m}get numInlineReplies(){return _(this).filter(e=>e.hasContent&&e.replyTo).size()}async _postIssueComment(e,s,i,r,n,o,l,c,u,d,h){const p=this.review,v=_.find(e,{$key:"-top"}),m=_.find(e,{$key:"-cmd"}),g=[],f=[];try{let[,w]=await Promise.all([Promise.all(_(e).reject({$key:"-top"}).reject({$key:"-cmd"}).map(async e=>{const{replyTo:t}=e,s=await e.renderForPublication({publishAll:i,inlineReply:!!t});
1s&&(t?f.push({body:s,replyTo:t}):g.push(s))}).value()),i?Promise.all([this._composeActionsSummary(),this._composeIssueReviewSummary(s)]):Promise.resolve()]);this._cancelIfDestroyed(),w=_.compact(w);const y=!_.isEmpty(e)||i&&(1!==w.length||this.state.votingSanctionActive),b={host:window.location.protocol+"//"+window.location.host,review:p,topComment:_([_access(v,"","getMarkdownBodyForPublication","call",[]),_access(m,"","getMarkdownBodyForPublication","call",[])]).compact().join("\n\n"),comments:g.join("")},C=p.core;let k=`${b.host}/reviews/${C.ownerName}/${C.repoName}/${C.pullRequestId}`;const $=_([_get(v,"fingerprint"),_get(m,"fingerprint")]).compact().join(",");$&&(k+=`#-:${$}`),Vue.set(b,"reviewedFiles",w.join("\n").replace("$REVIEW_URL",k));const S=(({topComment:e,reviewedFiles:t,comments:s})=>`${e}\n\n${t}\n\n${s}\n\n\x3c!-- Sent from Reviewable.io --\x3e\n`)(b);let R;if(Sentry.addBreadcrumb({category:"process",message:"Posting comments",data:{fingerprints:_.map(e,"fingerprint")}}),u&&i||await this.$update(_(e).keyBy(e=>_ref(e,"child","postingAttempted").toString()).mapValues(_.constant(!0)).value()),i){let s=this.state.effectiveSanction;if(!s&&(await this.$when(()=>this.state.effectiveSanction,{timeout:15e3,timeoutMessage:"Timed out waiting for the review's sanction state to load before publishing."}),this._cancelIfDestroyed(),s=this.state.effectiveSanction,!s))throw new Error("Internal error: the review's sanction state reverted before publishing.");const v={approved:"APPROVE",changes_requested:"REQUEST_CHANGES",commented:"COMMENT"}[s];R=await this._prepareGraphQlAndPublish({commitSha:n,inlineReplies:f,event:v},S,r,o,l,e,c,y,i,u,d,h);const m=_get(p,"statuses",p.core.lastRevisionKey,"services",a.mergeableStatusKey);if(("approved"===s||"changes_requested"===s)&&_get(m,"branchProtected")){const e=m.condition;let s=1e3;const i=async()=>{try{const t=await h.request("/repos/:owner/:repo/pulls/:number");m.$ready&&e===m.condition&&(_.isBoolean(t.mergeable)?t.mergeable_state&&"unknown"!==t.mergeable_state&&await _ref(m,"child","condition").override(_.toLower(t.mergeable_state)):s<5e3&&(await new Promise(e=>{setTimeout(e,s),s*=2}),await i()))}catch(e){t.markHandled(e)}};i()}}else R=await this._prepareGraphQlAndPublish(f.length?{commitSha:n,inlineReplies:f,event:"COMMENT"}:null,S,r,o,l,e,c,y,i,u,d,h);return R}catch(e){throw 404===e.status&&(e.message+=` (The ${p.core.ownerName} organization may need to authorize Reviewable as an accepted third party application.)`),e}}_gatherFinalUpdates(e,t,s,i,r){return _.forEach(t.mentions,e=>{if(e.inReply)return;const t=_ref(this,"child","review","tracker",e.draftKey,"participants",e.userKey);_.assign(s,{[_ref(t,"child","role")]:"mentioned",[_ref(t,"child","roleTimestamp")]:this.$truss.SERVER_TIMESTAMP,...e.forced&&{[_ref(t,"child","forced")]:null}})}),_.forEach(e,e=>{e.commit(s,i,r)}),s}get _finalUpdatesOnPublish(){if(!_get(this,"review","context","completeReview"))return;if(!this.state.updatesOnPublish||!this.directives||!this.publishable)return;if(!_.every(this.publishable,e=>e.review))return;const e=_.clone(this.state.updatesOnPublish);return this._gatherFinalUpdates(this.publishable,this.directives,e,!0,!0)}_applyOverrides(e){_.forEach(e,e=>{(e.value===this.$truss.SERVER_TIMESTAMP?Math.abs(e.ref.value-this.$now)>1e4:e.ref.value!==e.value)&&e.ref.override(e.value)})}_cancelIfDestroyed(){if(this.$destroyed)throw new Error("Canceled")}}}},!1,!0,{filename:"src/model/users/users.$userKey.state.$reviewKey.drafts.js",modelPath:"/users/$userKey/state/$reviewKey/drafts",modelExportName:"UserReviewStateDrafts"}),_reviewable.define(["UserReviewState"],["session","bus","analytics","corpsman","shared"],function(e,t,s,i,r){"use strict";const n=1e3,a=6e4,o=[1,2,3];function l(e){return"blocking"===e||"working"===e}return{UserReviewState:class UserReviewState{constructor(){Vue.set(this,"_lockedDraftKeys",{}),Vue.set(this,"_locked",!1),Vue.set(this,"publishing",!1)}get review(){return _get(this,"$store","reviews",this.$reviewKey)}reviewRef(){return _access(_ref,"call",[this.$store,"child","reviews",this.$reviewKey])}get dashboardCacheVersion(){return 3}get dashboardCacheValidity(){const e=this.review;if(_get(e,"context","completeReview"))return;if(null!==this.$info.userid&&!this.$ref.ready)return;const t=this.dashboardCache;if(!t||!_.includes(o,t.version))return"missing";if(_get(e,"userIsAuthor")&&t.hasDesignatedReviewers&&!t.reviewMarkStyle)return"missing";if(_get(t,"stale"))return"stale";const s=_get(e,"core","conditionInputHash"),i=_get(e,"core","conditionInputFullHash")||null,r=_get(t,"conditionInputFullHash")||null,a=_get(t,"projectedConditionInputHash"),l=_get(t,"projectedConditionInputFullHash")||null,c=(!(a&&(a!==t.conditionInputHash||l!==r))||_.isNumber(_get(t,"projectionBaseReconciliationTimestamp"))&&t.projectionBaseReconciliationTimestamp===_get(e,"core","lastReconciliationTimestamp"))&&t.conditionInputHash===s,u=a===s;if(!c&&!u)return"input";if(!(c&&r===i)&&!(u&&l===i))return"fullInput";if(_.isNumber(_get(t,"conditionRefreshTimestamp"))&&t.conditionRefreshTimestamp<=this.$info.nowAtInterval(n))return"refresh";if(t.hasTeamDesignatedReviewers){const e=this.$store.services.teamMemberships;if(e.currentUserTeamsUnavailable)return"teams";if(!e.currentUserTeamsLoaded)return;if((_get(t,"currentUserTeamsHash")||null)!==e.currentUserTeamsHash)return"teams"}return"valid"}get dashboardTrackerCacheValidity(){const t=this.dashboardCacheValidity;if("valid"!==t)return t;const s=this.dashboardCache;return s?s.version!==this.dashboardCacheVersion?"missing":e.settings.$ready?s.trustButVerify!==!!e.settings.trustButVerify?"settings":"valid":void 0:"missing"}
1get busyPublishing(){return this.publishing||"waiting"===this.isLocked()}get num(){const e=_.keys(this.drafts),t=_get(this,"marks","num")||{filesReviewed:0,filesFullyReviewed:0},s={drafts:_.size(this.drafts),publishableDrafts:_(this.drafts).reject(e=>"pondering"===e.role||!e.hasContent).size(),marks:t.filesReviewed,fullMarks:t.filesFullyReviewed,roleChanges:_(this.roleChanges).keys().difference(e).size(),acknowledgements:_(this.acknowledgements).keys().difference(e).size(),dismissals:_.size(this.dismissals),newUnresolvedDiscussionsIfDraftsSent:_(this.drafts).reject(e=>_get(this,"review","tracker",e.$key)||_.includes(["pondering","informing","satisfied","following","withdrawn"],e.role)).size(),blockingDispositionsIfDraftsSent:this._countDispositionIfDraftsSent("blocking"),workingDispositionsIfDraftsSent:this._countDispositionIfDraftsSent("working")};this.drafts["-top"]&&this.drafts["-cmd"]&&(s.drafts-=1,this.drafts["-top"].hasContent&&this.drafts["-cmd"].hasContent&&(s.publishableDrafts-=1));const i=void 0===s.marks?1:s.marks;return Vue.set(s,"pending",s.drafts+i+s.roleChanges+s.acknowledgements+s.dismissals),Vue.set(s,"pendingSend",s.publishableDrafts+i+s.roleChanges+s.acknowledgements+s.dismissals),Vue.set(s,"description",function(){const e=[];for(let t=0;t<arguments.length;t+=2){const s=arguments[t],i=arguments[t+1];void 0===s?e.push(`some ${i}s`):t&&!s||e.push(`${s||"No"} ${i}${1===s?"":"s"}`)}return e.join(", ").replace(/, (?=[^,]*$)/," and ")}(s.publishableDrafts,"draft",s.marks,"review mark",s.roleChanges,"disposition change",s.acknowledgements,"acknowledgement",s.dismissals,"dismissal")),s.description&&(s.description+=" to send."),s}_countDispositionIfDraftsSent(e){return 0+_(_get(this,"review","tracker")).filter({currentEffectiveDisposition:e}).size()+_(this.drafts).reject(e=>!e.hasContent||_get(this,"review","tracker",e.$key)).filter({disposition:e}).size()}get effectiveSanction(){if(void 0!==_get(this,"review","votingSanctionAllowed")){if(!this.review.votingSanctionAllowed)return"commented";if(this.sanction)return this.sanction;if(this.review.draftOnly)return"commented";if(_.some(this.drafts,e=>l(e.disposition))||_.some(this.roleChanges,e=>l(e)))return"changes_requested";if(_get(this,"review","files","num")&&!_.some(this.review.tracker,e=>!e.currentEffectiveDisposition))return this.review.files.num.toReview||!this.review.userIsReviewer&&"changes_requested"!==_get(this,"review","people",this.$info.userid,"sanction")||!_.every(this.review.tracker,e=>!l(e.currentEffectiveDisposition))?"commented":"approved"}}set effectiveSanction(t){Vue.set(e.onboarding,"setSanction",!0),_ref(this,"child","sanction").set(t)}get lastEffectiveVotingSanction(){return"approved"===this.effectiveSanction||"changes_requested"===this.effectiveSanction?this.effectiveSanction:this.lastEffectiveVotingSanction}get votingSanctionActive(){return this.num.pendingSend&&("approved"===this.effectiveSanction||"changes_requested"===this.effectiveSanction)}get effectiveAutoRequestReviewers(){if(_get(this,"review","verdict")){if(!this.review.verdict.push&&!this.review.verdict.triage)return!1;if(void 0!==_get(this,"review","forcedAutoRequestReviewers"))return _.isBoolean(this.review.forcedAutoRequestReviewers)?this.review.forcedAutoRequestReviewers:(void 0===this.autoRequestReviewers&&void 0!==e.settings.autoRequestReviewers&&_ref(this,"child","autoRequestReviewers").set(e.settings.autoRequestReviewers),this.autoRequestReviewers||!1)}}set effectiveAutoRequestReviewers(t){Vue.set(e.onboarding,"setAutoRequestReviewers",!0),Vue.set(e.settings,"autoRequestReviewers",t),_ref(this,"child","autoRequestReviewers").set(t)}async _withLockedDrafts(e){const s=[];t.saveAllDrafts(s),t.deleteEmptyDrafts(),await Promise.all(s);const i=_.map(this.drafts.publishable,"$key");this.lock(i),Vue.set(this,"_locked",!0);try{return await e(this.drafts.publishable)}finally{this.unlock(i),Vue.set(this,"_locked",!1)}}preview(){return _get(this,"num","pendingSend")?(this.$store.services.auth.disable(),this._withLockedDrafts(t=>{if(_get(this,"num","pendingSend"))return Vue.set(e.onboarding,"sawPreviewAllDrafts",!0),Sentry.addBreadcrumb({category:"process",message:"Previewing comments",data:{numDrafts:t.length}}),this.drafts.preview(t)}).finally(()=>{this.$store.services.auth.enable()})):Promise.resolve()}async publish(t={}){const{includeActionSummary:r=!1,throwErrors:n=!1}=t;if(this.publishing){if(n)throw _.assign(new Error("A publication is already in progress."),{code:"review_publish_in_progress"});return}const a=_.has(t,"publishOnPush"),o=a?t.publishOnPush:this.publishOnPush,l=_.has(t,"publishNow")?t.publishNow:!(a&&!1!==o||!this.publishOnPushTask),c=!l&&o&&this.canPublishOnPush,u=this.review.context;u.acquire(),Vue.set(this,"publishing",!0);const d=`publish${this.review.$key}`;i.clearFailure(d);let h=null,p=!1;try{if(!l&&o&&!c)throw _.assign(new Error("Publish-on-push is not available for you in this review."),{code:"review_publish_on_push_unavailable",details:{stage:"publish"}});await this.$store.services.auth.login();const t=Date.now();let i;return await this._withLockedDrafts(async t=>{if(_get(this,"num","pendingSend")){if(h=r&&await this.drafts._composeActionsSummary()||null,p=!0,i=_(this.num).pick("drafts","marks","roleChanges","acknowledgements","dismissals").mapKeys((e,t)=>`num${_.toUpper(t[0])}${t.slice(1)}`).value(),Vue.set(e.onboarding,"published",!0),this.review.userIsAuthor||Vue.set(e.onboarding,"publishedAsReviewer",!0),this.review.userCanDeferFiles&&_get(this,"review","files","num","toReview")>0||_get(this,"review","tracker","num","unreplied")>0){const e=this.review.revisions[_get(this,"review","core","lastRevisionKey")];if(!e)throw new Error("Internal error: inconsistent review revisions state");e.snapshot("hard")}await this.drafts.send(t,{publishNow:l,publishOnPush:c})}}),p?(_get(this,"review","core")&&_.assign(i,{owner:this.review.core.ownerName,repo:this.review.core.repoName,pullRequest:this.review.core.pullRequestId}),Vue.set(i,"latency",Date.now()-t),this.publishOnPushTask||(s.track("Published Comments",i),_get(this,"review","context")&&(Vue.set(this.review.context,"reviewSummaryPublished",!0),Vue.set(this.review.context,"allDraftsPublished",!0)),_.delay(()=>{_get(this,"review","context")&&Vue.set(this.review.context,"reviewSummaryPublished",!1)},4e3)),{actionSummary:h}):{actionSummary:h}}catch(e){if(i.capture(e,"publish"),_.some(e.errors,e=>
1"RESOURCE_LIMITS_EXCEEDED"===e.type)?i.setFailure(d,"Publishing throttled by GitHub; please try again later.",{context:u}):i.setFailure(d,`Failed to publish review: ${e.message||e}`,{context:u,retry:()=>{_get(u,"review","state")?u.review.state.publish({publishOnPush:c}):i.setFailure(d,"Review not available, please retry publishing manually")}}),n)throw e}finally{u.release(),Vue.set(this,"publishing",!1)}}get updatesOnPublish(){if(!_get(this,"review","context","completeReview")||!this.$info.userid)return;const e={},t=_.map(this.drafts.publishable,"$key");return _access(this,"","marks","","gatherUpdates","call",[e]),_access(this,"","roleChanges","","gatherUpdates","call",[e,t]),_access(this,"","acknowledgements","","gatherUpdates","call",[e,t]),_access(this,"","dismissals","","gatherUpdates","call",[e,t]),this.gatherDeferredUpdates(e,this.review.core.lastRevisionKey),Vue.set(e,_ref(this,"child","sanction"),null),e}get lateOverridesOnPublish(){if(!_get(this,"review","context","completeReview")||!this.$info.userid)return;const e=[];return this.votingSanctionActive&&e.push({ref:_ref(this,"child","review","participants",this.$info.userid,"sanction"),value:this.effectiveSanction,expectedWebhook:"pull_request_review"}),e}get canPublishOnPush(){return"active"===_get(this,"review","context","repositoryCore","connection")&&(!!_get(this,"review","userIsAuthor")&&("author"===_get(this,"$info","user","github","agentType")||"open"===_get(this,"review","core","effectiveState")&&!_(_get(this,"review","people")).filter("activeReviewer").filter({passiveBot:!1}).isEmpty()))}get publishOnPush(){return this.canPublishOnPush&&!1!==e.settings.publishOnPush}set publishOnPush(t){Vue.set(e.settings,"publishOnPush",t)}get publishOnPushTaskRef(){return this.$info.userid?_get(this,"review","core")?_ref(this.$store,"child","queues","publishOnPush",`${_.toLower(_get(this,"review","core","ownerName"))}|${_.toLower(_get(this,"review","core","repoName"))}|${_get(this,"review","core","pullRequestId")}|${this.$info.userid}`):void 0:null}get publishOnPushTask(){const e=_get(this,"publishOnPushTaskRef","value");return"expired"===_get(e,"status")?void 0:e}get pendingPublishOnPush(){return"waiting"===this.isLocked()?this.$lastComputedValue:!!this.publishOnPushTask&&!this.publishOnPushTask.status&&!this.publishOnPushTask.pushed}get publishOnPushTimeout(){const e=_get(this,"publishOnPushTask","_lease"),t=_get(e,"expiry")||_get(e,"created")&&e.created+r.publishOnPushTimeoutMinutes*a,s=t?Math.max(t-this.$info.nowAtInterval(n),0):0,i=Math.floor(s/a),o=Math.floor(s%a/n);return _([i,o]).map(e=>_.padStart(e,2,"0")).join(":")}async cancelPublishOnPush(){let e;return await this.publishOnPushTaskRef.commit(t=>{e=t.currentValue?"expired"!==t.currentValue.status&&(t.currentValue.status||t.currentValue.pushed)?"pushed":null:"gone",e?t.abort():t.set(null)}),e}gatherDeferredUpdates(e,t){if(!this.num.pendingSend)return;const s=_ref(this,"child","review","participants",this.$info.userid);(this.review.userCanDeferFiles&&_get(this,"review","files","num","toReview")>0||_get(this,"review","tracker","num","unreplied")>0)&&(Vue.set(e,_ref(s,"child","deferredRevisionKey"),t),Vue.set(e,_ref(s,"child","deferredTimestamp"),this.$truss.SERVER_TIMESTAMP))}clearAndCommitParticipantDeferralUpdates(){Vue.set(e.onboarding,"continuedReview",!0);const t=_ref(this,"child","review","participants",this.$info.userid);t.update({[_ref(t,"child","deferredRevisionKey")]:null,[_ref(t,"child","deferredTimestamp")]:null}),_access(this,"","review","","revisions","",_get(this,"review","core","lastRevisionKey"),"","snapshot","call",["soft"])}isLocked(e){return this.publishOnPushTask?this.publishOnPushTask.status||this.publishOnPushTask.pushed?"waiting":"locked":!!(e?this._lockedDraftKeys[e]:this._locked||_.some(this._lockedDraftKeys))&&"waiting"}lock(e){_.forEach(e,e=>{Vue.set(this._lockedDraftKeys,e,(this._lockedDraftKeys[e]||0)+1)})}unlock(e){_.forEach(e,e=>{Vue.set(this._lockedDraftKeys,e,this._lockedDraftKeys[e]-1)})}}}},!1,!0,{filename:"src/model/users/users.$userKey.state.$reviewKey.js",modelPath:"/users/$userKey/state/$reviewKey",modelExportName:"UserReviewState"}
1),_reviewable.define(["Mark"],[],function(){"use strict";return{Mark:class Mark{constructor(){Vue.set(this,"state",this.$parent.$parent)}addUpdate(e){const t=this.state.review;t.files[this.$key]&&_.forEach(this.revisions,s=>{s.reviewed&&Vue.set(e,_ref(t,"child","files",this.$key,"revisions",s.$key,"reviewers",this.$info.userid),this.$truss.SERVER_TIMESTAMP)})}}}},!1,!0,{filename:"src/model/users/users.$userKey.state.$reviewKey.marks.$fileKey.js",modelPath:"/users/$userKey/state/$reviewKey/marks/$fileKey",modelExportName:"Mark"}),_reviewable.define(["MarkRevision"],["corpsman"],function(e){"use strict";return{MarkRevision:class MarkRevision{constructor(){Vue.set(this,"state",this.$parent.$parent.$parent.$parent),Vue.set(this,"_repairPromise",null)}get file(){return _get(this,"state","review","files",this.$fileKey)}get _detectAndRepairBadMark(){if(_get(this,"state","review","core","error")||!_get(this,"file","revisions","nearestUnkeptRaw"))return;const e=_get(this,"file","revisions",this.$revisionKey);e&&"kept"!==e.action?Vue.set(this,"_repairPromise",null):this._repairPromise||Vue.set(this,"_repairPromise",this._validateAndRepairMark())}async _validateAndRepairMark(){let t=!1;const s=this.$observe(()=>!!_get(this,"state","review","core","error"),e=>{e&&(t=!0)}),i=()=>t||!!_get(this,"state","review","core","error");try{for(;!this.$destroyed&&this.reviewed;){if(_get(this,"state","review","core","error")&&await this.$when(()=>!_get(this,"state","review","core","error")),this.$destroyed||!this.reviewed)return;const s=_get(this,"file","revisions",this.$revisionKey);if(s&&"kept"!==s.action)return;t=!1;try{if(await this._attemptMarkRepair(i))return}catch(t){if(!_.startsWith(_.toLower(t.code||t.message),"permission_denied"))throw t;if(i()&&e.markHandled(t),await this.$truss.waitForThrottledRemoteDataUpdates(),!i())throw t;e.markHandled(t)}}}catch(t){if(!this.$destroyed)throw t;e.markHandled(t)}finally{s()}}async _attemptMarkRepair(t){let s=!0;try{await this.$ref.annotate({ignorePermissionDenied:!0}).commit(e=>{if(!e.currentValue)return e.abort();e.set(e.currentValue)})}catch(t){if(!_.startsWith(_.toLower(t.code||t.message),"permission_denied"))throw t;e.markHandled(t),s=!1}if(await this.$truss.waitForThrottledRemoteDataUpdates(),this.$destroyed||!this.reviewed)return!0;if(t())return!1;const i=_get(this,"file","revisions",this.$revisionKey);if(i&&"kept"!==i.action)return!0;const r=i?"kept":"missing";if(s)return this._captureRepairMessage("Review mark only appeared invalid locally","warning",{repairType:r}),!0;let n=_get(this,"state","review","revisions",this.$revisionKey,"$key");if(!n){const e=_.parseInt(this.$revisionKey.slice(1));n=_.findLast(_get(this,"state","review","revisions","keysList"),t=>_.parseInt(t.slice(1))<e)}const a=_get(this,"file","revisions","nearestUnkeptRaw",n,"$key"),o={[this.$ref]:null};a&&Vue.set(o,_ref(this.$parent,"child",a),{reviewed:!0});const l=await this.$parent.$ref.commit(e=>{if(t()||!_.has(e.currentValue,this.$revisionKey))return e.abort();e.update(o)});return!t()&&("abort"===l.outcome||this._captureRepairMessage("Repaired review mark","error",{repairType:r,targetRevisionKey:a}),!0)}_captureRepairMessage(e,t,s){Sentry.captureMessage(e,{level:t,tags:{repairType:s.repairType},extra:_.assign({context:"review mark repair",reviewKey:this.$reviewKey,userKey:this.$userKey,fileKey:this.$fileKey,revisionKey:this.$revisionKey,reviewRevisionKeys:_get(this,"state","review","revisions","keysList"),fileRevisionKeys:_.map(_get(this,"file","revisions","list"),"$key")},s)})}}}},!1,!0,{filename:"src/model/users/users.$userKey.state.$reviewKey.marks.$fileKey.revisions.$revisionKey.js",modelPath:"/users/$userKey/state/$reviewKey/marks/$fileKey/revisions/$revisionKey",modelExportName:"MarkRevision"}),_reviewable.define(["Marks"],[],function(){"use strict";return{Marks:class Marks{constructor(){Vue.set(this,"state",this.$parent)}get num(){const e=_get(this,"state","review","files"),t=_(this).map("revisions").flatMap(_.values).filter("reviewed").value();if(!_get(e,"$ready"))return{total:_.size(this),filesReviewed:t.length?void 0:0,filesFullyReviewed:t.length?void 0:0};const s=s=>_(t).map(t=>_get(e,t.$fileKey,"revisions",t.$revisionKey)).compact().reject("secondary").filter(s||_.constant(!0)).map(e=>e.inferred.file.$key).uniq().size();return{total:_.size(this),filesReviewed:s(),filesFullyReviewed:s(e=>e===e.$parent.lastUnkept)}}gatherUpdates(e){Vue.set(e,this.$ref,null),_.forEach(this,t=>{t.addUpdate(e)})}}}},!1,!0,{filename:"src/model/users/users.$userKey.state.$reviewKey.marks.js",modelPath:"/users/$userKey/state/$reviewKey/marks",modelExportName:"Marks"}),_reviewable.define(["RoleChanges"],[],function(){"use strict";return{RoleChanges:class RoleChanges{constructor(){Vue.set(this,"state",this.$parent)}gatherUpdates(e,t){Vue.set(e,this.$ref,null),_.forEach(this,(s,i)=>
1{if(!_get(this,"state","review","discussions",i)||_.includes(t,i)||"-top"===i||"-cmd"===i)return;const r=_ref(this,"child","state","review","tracker",i,"participants",this.$info.userid);e[r]||e[_ref(r,"child","role")]||(Vue.set(e,_ref(r,"child","role"),s),Vue.set(e,_ref(r,"child","roleTimestamp"),this.$truss.SERVER_TIMESTAMP),Vue.set(e,_ref(r,"child","acceptedTimestamp"),"discussing"===s?Number.MAX_VALUE:null),Vue.set(e,_ref(r,"child","lastObjectionTimestamp"),null),Vue.set(e,_ref(r,"child","dismisserKey"),"dismissed"===s?this.$info.userid:null),Vue.set(e,_ref(r,"child","forced"),null))})}}}},!1,!0,{filename:"src/model/users/users.$userKey.state.$reviewKey.roleChanges.js",modelPath:"/users/$userKey/state/$reviewKey/roleChanges",modelExportName:"RoleChanges"}),_reviewable.define(["CollapseSettings"],[],function(){"use strict";class CollapseSettings{get fileOnly(){return _.pick(this,_.keys(CollapseSettings.FILE_DEFAULTS))}}return Vue.set(CollapseSettings,"FILE_DEFAULTS",{whitespace:!0}),{CollapseSettings:CollapseSettings}},!1,!0,{filename:"src/model/users/users.$userKey.state.$reviewKey.settings.collapse.js",modelPath:"/users/$userKey/state/$reviewKey/settings/collapse",modelExportName:"CollapseSettings"}),_reviewable.define(["UserReviewStateSettings"],["session","corpsman","shared"],function(e,t,s){"use strict";const i=/^Co-Authored-By: (.*)$/gm;return{UserReviewStateSettings:class UserReviewStateSettings{constructor(){Vue.set(this,"_needCommitMessage",0),Vue.set(this,"_fetchCommitsPromise",void 0),Vue.set(this,"_fetchCommitsError",void 0),Vue.set(this,"_commitMessages",void 0)}acquireCommitMessage(){this._needCommitMessage++}releaseCommitMessage(){this._needCommitMessage--,this._needCommitMessage||(Vue.set(this,"_fetchCommitsPromise",void 0),Vue.set(this,"_fetchCommitsError",void 0))}get _mergeFlavorDefaults(){const e=_get(this,"$parent","review","core","base");if(_get(e,"permissionsReady"))return _get(e,"mergeFlavorDefaults",this.mergeFlavor)}get _reviewStatusRef(){const e=this.$parent.review;return _ref(e,"child","statuses",_get(e,"core","lastRevisionKey"),"services",s.reviewableStatusContext)}get _updateCommits(){const s=_get(this,"$parent","review");if(!this._needCommitMessage||this._fetchCommitsPromise||!_get(s,"core","$ready")||"COMMIT_MESSAGES"!==_get(this,"_mergeFlavorDefaults","preferredCommitMessage"))return;if(!_get(this,"_reviewStatusRef","ready")||_get(this,"reviewStatusRef","value","defaultSquashCommitMessage"))return;const r=e.hubkit(s.core.ownerName,s.core.repoName,{review:s});Vue.set(this,"_fetchCommitsPromise",r.request("GET /repos/:owner/:repo/pulls/{review.core.pullRequestId}/commits").then(e=>{Vue.set(this,"_commitMessages",_.map(e,({commit:{message:e}})=>{const[t,...s]=e.replace(i,"").split("\n\n");return{summary:t,description:s.join("\n\n")}}))},e=>{t.capture(e,"fetching commits to describe merge"),t.markHandled(e),Vue.set(this,"_fetchCommitsError",e)}))}_computeCoAuthorsTrailer(){const e=_get(this,"$parent","review","revisions","list"),t={};return _.forEach(e,({coAuthors:e,obsolete:s})=>{s||_.forEach(e,({userKey:e,name:s,email:i})=>{const r=e||s+i;_.has(t,r)||e===_get(this,"$parent","review","core","authorKey")||Vue.set(t,r,`Co-Authored-By: ${s}${i?` <${i}>`:""}`)})}),_.values(t).join("\n")}get generatedMergeCommitMessageError(){return"squash"===this.mergeFlavor?this._fetchCommitsError:void 0}waitForMergeCommitMessage(){return"rebase"===this.mergeFlavor?Promise.resolve():this.$when(()=>void 0!==this.actualMergeCommitMessage||this.generatedMergeCommitMessageError).then(()=>{if(void 0!==this.actualMergeCommitMessage)return this.actualMergeCommitMessage;if(this.generatedMergeCommitMessageError)throw this.generatedMergeCommitMessageError;throw new Error("neither commit message nor error found")})}get generatedMergeCommitMessage(){if(!this.mergeFlavor||!this._mergeFlavorDefaults)return;if(!this._needCommitMessage)return this.$lastComputedValue;if(_get(this.$parent.review,"core","$ready"))switch(this.mergeFlavor){case"merge":if(!_get(this,"_reviewStatusRef","ready"))return;return _get(this,"_reviewStatusRef","value","defaultMergeCommitMessage")?this._reviewStatusRef.value.defaultMergeCommitMessage:this._computeMergeCommitMessage();case"squash":if(!_get(this,"_reviewStatusRef","ready"))return;if(_get(this,"_reviewStatusRef","value","defaultSquashCommitMessage"))return this._reviewStatusRef.value.defaultSquashCommitMessage;if(!_get(this,"_commitMessages","length")&&"COMMIT_MESSAGES"===this._mergeFlavorDefaults.preferredCommitMessage)return;return this._computeMergeCommitMessage();case"rebase":return""}}get actualMergeCommitMessage(){return void 0!==this.mergeCommitMessage?this.mergeCommitMessage:this.generatedMergeC
1ommitMessage}_buildCommitMessages(e){return 1===_get(e,"length")?e[0].description:_.map(e,e=>_.trim(`* ${_get(e,"summary")}\n\n${e.description}`)).join("\n\n")}_buildTitle(e){const t=this.$parent.review;return 1===_get(e,"length")?`${e[0].summary} (#${_get(t,"core","pullRequestId")})`:`${t.core.title} (#${t.core.pullRequestId})`}_computeMergeCommitMessage(){const e=this.$parent.review,t=_.trim(_access(e,"","discussions","","-top","","comments","","prDescription","","markdownBody","","replace","call",[/^\s*#+.*?\n\n/,""],"","replace","call",[i,""])),s=`Merge pull request #${e.core.pullRequestId}`+(e.core.branch?` from ${e.core.branch.replace(":","/")}`:""),r={PR_TITLE:this._buildTitle(),PR_BODY:t,COMMIT_MESSAGES:this._buildCommitMessages(this._commitMessages),COMMIT_OR_PR_TITLE:this._buildTitle(this._commitMessages),MERGE_MESSAGE:s,BLANK:""},{preferredTitle:n,preferredCommitMessage:a}=this._mergeFlavorDefaults,o=r[n],l=r[a],c=this._computeCoAuthorsTrailer();return`${o}${l?"\n\n"+l:""}${c?"\n\n"+c:""}`}}}},!1,!0,{filename:"src/model/users/users.$userKey.state.$reviewKey.settings.js",modelPath:"/users/$userKey/state/$reviewKey/settings",modelExportName:"UserReviewStateSettings"}),_reviewable.define(["Users"],[],function(){"use strict";return{Users:class Users{get current(){return this[this.$info.userid]}currentRef(){return _ref(this,"child",this.$info.userid)}}}},!1,!0,{filename:"src/model/users/users.js",modelPath:"/users",modelExportName:"Users"}),_reviewable.define(["analytics"],["truss","router","config","corpsman","debug","session"],function(e,t,s,i,r,n){"use strict";let a,o,l=!1,c=e.newKey(),u=[],d={};const h=!!_get(window,"performance","getEntriesByName"),p={createdAt:"$created",email:"$email",firstName:"$first_name",lastName:"$last_name",name:"$name",username:"$username"};let v;function m(e){return h?_access(window,"","performance","","getEntriesByName","call",[e],"",0,"","startTime"):void 0}function g(e){if(!e.length)return void console.log("no data");const t=_.map(_.range(e[0].length),t=>_(e).map(e=>e[t].length).max());_.forEach(e,e=>{console.log(_.map(e,(e,s)=>_.padStart(e,t[s])).join(" "))})}window.mixpanel&&s.mixpanelToken&&(window.mixpanel.init(s.mixpanelToken,{autotrack:!1,persistence:"localStorage",track_pageview:!1,property_blacklist:["$created","$email","$first_name","$last_name","$name","$username","avatar","email"]}),v=window.mixpanel,v.unregister("mp_lib"));return{analytics:_declareVue("AnalyticsSingleton",class AnalyticsSingleton{created(){t.afterChange(e=>{if(o!==t.path){const s=_.assign({title:e.pageTitle||"Reviewable",windowWidth:document.documentElement.clientWidth,windowHeight:document.documentElement.clientHeight},_.mapValues(e.params,e=>_.isString(e)?_.toLower(e):e));this.page(e.pageClass,s),o=t.path}},null),t.beforeChange(()=>{a=Date.now(),u=[],d={}},null)}track(r,a){if(a=a||{},_.assign(a,{path:t.path,build:s.build}),Sentry.addBreadcrumb({category:"action",message:r,data:_.clone(a)}),s.analyticsQueueEnabled){const t={type:"track",event:r,properties:_.clone(a),sentAt:new Date(e.now).toISOString(),context:{active:!0,userAgent:window.navigator.userAgent}};e.when(()=>s.encryptionEnabled&&!s.encryptionAesKey?n.user:void 0!==n.user).then(()=>{n.user?(Vue.set(t,"userId",n.user.uid),Vue.set(t.context,"traits",{avatar:n.user.github.profileImageURL||null,email:n.user.github.email||null,name:n.user.github.displayName||null,username:n.user.github.username})):Vue.set(t,"anonymousId",c),_ref(e,"child","store","queues","analytics",e.newKey()).set({content:JSON.stringify(t)}).catch(e=>{i.markHandled(e),console.warn("Failed to enqueue analytics event:",e.toString())})})}v&&e.when(()=>void 0!==n.user).then(()=>{v.track(r,a),v.people.increment(r),v.people.set(`Last ${r}`,new Date(e.now))})}page(e,t){return t=t||{},this.track(`Viewed ${e} Page`,t)}identify(t,s){if(v)if(t){v.identify(t);const e=_.mapKeys(s,(e,t)=>p[t]||t);if(Vue.set(e,"id",t),e.$created&&Vue.set(e,"$created",new Date(e.$created)),e.$name){const t=e.$name.split(/\s+/);!e.$first_name&&t.length&&Vue.set(e,"$first_name",t[0]),!e.$last_name&&t.length>1&&Vue.set(e,"$last_name",t.slice(1).join(" "))}else(e.$first_name||e.$last_name)&&Vue.set(e,"$name",e.$first_name+(e.$first_name?" ":"")+e.$last_name);v.people.set(e)}else v.reset();t||(c=e.newKey())}alias(e){v&&v.alias(e)}time(e,t){Vue.nextTick(()=>{!_.find(u,{name:e})&&window.performance&&(_.assign(d,t),u.push({name:e,timestamp:window.performance.now()}))})}recordTimings(e){Vue.nextTick(()=>{let i=a;if(!l){const e=_access(window,"","performance","","getEntriesByType","call",["navigation"],"",0);if(!e)return void(l=!0);u.splice(0,0,{name:"connect",timestamp:e.requestStart},{name:"load",timestamp:e.domContentLoadedEventStart},{name:"init",timestamp:m("bootstrapStart")},{name:"boot",timestamp:m("bootstrapEnd")}),i=e.fetchStart,l=!0}if(!u.length||!i)return;const n=_.isEmpty(d)?"":`(${_(d).map((e,t)=>`${t}=${e}`).sortBy().join(", ")})`;let o=i;_.forEach(u,e=>{d[e.name]||(Vue.set(d,e.name,Vue.set(e,"duration",e.timestamp-o)),o=e.timestamp)}),Vue.set(d,d.load?"extLatency":"intLatency",o-i),Vue.set(d,"page",t.current.pageClass),_.assign(d,e),s.prod&&Math.random()<(l?.05:.25)&&this.track("Loaded Page",d),r.latency&&(console.log("\n### Page load latency:"),g(function(){const e=_access(window,"","performance","","getEntriesByType","call",["navigation"],"",0),t=_(u).map("timestamp").max()-e.requestStart;return _(u).map(({name:e,duration:t})=>[`${e}:`,`${(t/1e3).toFixed(2)}s`]).push(["=== Total:",`${(t/1e3).toFixed(2)}
1s`]).value()}()),console.log(n),console.log("\n### Component latency:"),g(_(performance.getEntriesByType("measure")).groupBy("name").mapValues(e=>_(e).map("duration").sum()).map((e,t)=>({name:t,duration:e})).sortBy("duration").slice(-10).reverse().map(({name:e,duration:t})=>[`${e.replace(/^vue /,"")}:`,`${(t/1e3).toFixed(2)}s`]).value()),console.log("\n### Computed properties latency:"),Truss.computedPropertyStats.log()),a=null})}},null)}},!1,!0,{filename:"src/plumbing/analytics.js"}),_reviewable.define(["animator"],["truss","session","pageControl"],function(e,t,s){"use strict";const i=new CSSStyleSheet;Vue.set(document,"adoptedStyleSheets",[...document.adoptedStyleSheets,i]);return{animator:_declareVue("AnimatorSingleton",class AnimatorSingleton{constructor(){Vue.set(this,"defaultOptions",{duration:300,easing:"swing"}),Vue.set(this,"animeJsEasing","easeInOutSine"),Vue.set(this,"prefersReducedMotion",null),Vue.set(this,"transitionsEnabled",!0),Vue.set(this,"animeEnabled",!0)}created(){e.observe(()=>[this.shouldAnimate(),this.transitionsEnabled,this.animeEnabled],([e,t,s])=>{e||(t=!1,s=!1),Vue.set(this.defaultOptions,"duration",s?300:0),t?(document.body.classList.remove("no-transitions"),i.replaceSync("")):(document.body.classList.add("no-transitions"),i.replaceSync("\n *, *::after, *::before, *::backdrop {\n transition: none !important;\n animation-name: none !important;\n }\n"))});const t=window.matchMedia("(prefers-reduced-motion: reduce)");t.addEventListener?t.addEventListener("change",()=>this.updatePrefersReducedMotion()):t.addListener&&t.addListener(e=>this.updatePrefersReducedMotion()),this.updatePrefersReducedMotion()}updatePrefersReducedMotion(){Vue.set(this,"prefersReducedMotion",window.matchMedia("(prefers-reduced-motion: reduce)").matches)}enableTransitions(){Vue.set(this,"transitionsEnabled",!0),Vue.set(this,"animeEnabled",!0)}disableTransitions(e){Vue.set(this,"transitionsEnabled",!1),Vue.set(this,"animeEnabled",!!e)}shouldAnimate(){const e=t.settings.animation;return e||_.isNil(e)&&!this.prefersReducedMotion}scrollPage(e){const t=_get(s,"scrollContexts","primary","$refs","container");if(t)return new Promise(s=>{anime({targets:t,scrollTop:e,duration:this.defaultOptions.duration,easing:this.animeJsEasing,complete:s})});window.scrollTo({top:0,left:0,behavior:this.shouldAnimate()?"smooth":"instant"})}},null)}},!1,!0,{filename:"src/plumbing/animator.js"}),_reviewable.define(["bindTruss"],["truss","config","debug"],function(e,t,s){"use strict";function i(e,t,s){if(!_.isNil(e)){for(const n in e){if(!a(e,n))continue;const o=t&&a(t,n);s.deep&&_.isObject(e[n])&&o&&_.isObject(t[n])?i(e[n],t[n],s):!_.isNil(t)&&(!s.overwrite&&o||_.isEqualWith(t[n],e[n],r))||s.setter(t,n,e[n])}if(s.prune)for(const i in t)a(t,i)&&!a(e,i)&&s.setter(t,i)}}function r(e,t){const s=_.isNil(e)||_.isObject(e)&&_.isEmpty(e),i=_.isNil(t)||_.isObject(t)&&_.isEmpty(t);if(s&&i)return!0;if(_.isObject(e)&&_.isObject(t)){for(const s in e)if(a(e,s)&&!_.isEqualWith(e[s],t[s],r))return!1;for(const s in t)if(a(t,s)&&!a(e,s))return!1;return!0}}function n(e){if(!_.isNil(e))for(const t of Object.getOwnPropertyNames(e)){const s=Object.getOwnPropertyDescriptor(e,t);if("value"in s||!s.get||!s.set)throw new Error("Bound object has a raw property: "+t);const i=e[t];_.isObject(i)&&n(i)}}function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}return{bindTruss:function(r,a,o){const l=[],c=[],u=new Vue({data:{synced:!1,localObject:a}});let d,h=!1;_.isFunction(r)||(r=_.constant(r)),s.bindings&&console.log(`${r} intializing binding ${JSON.stringify(o)}`),Object.defineProperty(a,"$ready",{get:()=>u.synced,configurable:!0}),l.push(()=>u.$destroy()),l.push(e.observe(()=>_get(d=r(),"path"),()=>{s.bindings&&console.log(`${r} path changed to ${_get(d,"path")}`);for(const e of c)e(),h=!1;c.splice(0),d&&(s.bindings&&console.log(`${r} activating binding`),c.push(e.observe(()=>d.ready,t=>{s.bindings&&console.log(`${r} ready changed to ${t}, synced ${u.synced}`),t!==u.synced&&(t&&!h&&(s.bindings&&console.log(`${r} starting observers`),c.push(e.observe(()=>d.value,()=>{!function(){if(!d||!d.ready)return;s.bindings&&console.log(`${r} sync to local`);i(d.value,a,{overwrite:!0,prune:u.synced,deep:!o.shallow,setter:(e,t,s)=>{_.isNil(s)?Vue.delete(e,t):(_.isObject(s)&&(s=JSON.parse(JSON.stringify(s))),Vue.set(e,t,s))}})}()},{deep:!0,precise:!0,immediate:!0})),c.push(e.observe(()=>u.localObject,()=>{!function(){if(!d||!d.ready)return;s.bindings&&console.log(`${r} sync to remote`);const e={};i(a,d.value,{overwrite:!0,prune:u.synced,deep:!o.shallow,setter:(t,s,i)=>{void 0===i&&(i=null),e[(t?t.$ref:d).child(s)]=i}}),_.isEmpty(e)||d.update(e)}()},{deep:!0,precise:!0,immediate:!0})),h=!0),u.synced=t)})))},{precise:!0}));const p=t.prod?null:setInterval(n.bind(a),1e4);return function(){p&&clearInterval(p);for(const e of l)e();for(const e of c)e();h=!1,delete a.$ready}}}},!1,!0,{filename:"src/plumbing/bindTruss.js"}),_reviewable.define(["bus"],["truss"],function(e){"use strict";const t=["flush","saveDraft","saveAllDrafts","deleteEmptyDrafts","pushDraftError","draftFocus","showGuideMap","guideMapHidden","expandAllFilesRegions","allowHotkey","selectDiffLine","clearDiffLineSelection","releaseSelection","closeMultiselects","stickyPanel","scrollToAndEmphasizeDiscussion","forceTippyUpdate","trace"];class BusSingleton{created(){for(const e of t)Object.defineProperty(this[e],"react",{value:this._react.bind(this,e)})}_emit(e){this.$emit.apply(this,arguments)}
1_react(e,t,s){const i=()=>{this.$off(e,t)};this.$on(e,t);const r=_get(s,"scope");if(r)if(r instanceof Vue||r.$truss)r.$on("hook:beforeDestroy",i);else{if(!r.$id||!r.$on)throw new Error(`Unable to recognize scope type for event "${e}": ${r}`);r.$on("$destroy",i)}else if(void 0===r)throw new Error("Must provide scope or explicitly set as null");return i}}for(const e of t)Object.defineProperty(BusSingleton.prototype,e,{value:_.partial(BusSingleton.prototype._emit,e)});return{bus:_declareVue("BusSingleton",BusSingleton,null)}},!1,!0,{filename:"src/plumbing/bus.js"}),_reviewable.define(["corpsman"],["truss","animator","bus","router"],function(e,t,s,i){"use strict";const r=["notallowed","notcreated"];return{corpsman:_declareVue("CorpsmanSingleton",class CorpsmanSingleton{constructor(){Vue.set(this,"tags",{}),Vue.set(this,"crash",!1),Vue.set(this,"upgrade",!1),Vue.set(this,"maintenance",!1),Vue.set(this,"crashSource",void 0),Vue.set(this,"crashStack",void 0),Vue.set(this,"condition",void 0),Vue.set(this,"conditionData",void 0),Vue.set(this,"isolated",void 0),Vue.set(this,"failures",{})}get locked(){return this.crash||this.upgrade||this.maintenance}created(){i.afterChange((e,t)=>{e.href!==t.href&&this.clearCondition()},this),this.$observe(()=>this.$info.userid,(e,t)=>{void 0!==t&&Vue.set(this,"failures",{})}),this.$observe(()=>_get(this,"$info","user","github","accessToken"),e=>{e&&_.includes(r,this.condition)&&this.clearCondition()})}_updateSentryTags(){_.forEach(this.tags,(e,t)=>{Sentry.setTag(t,_.isArray(e)?e.join(" "):e)})}setTag(e,t){Vue.set(this.tags,e,t),this._updateSentryTags()}_stopTheWorld(e){e?_.delay(Truss.suspend,e):Truss.suspend(),i.beforeChange(e=>{e.preventDefault()},this),s.allowHotkey.react(e=>{Vue.set(e,"prevented",!0)},{scope:this})}capture(e,t){if(_.isNil(e))return;if(_get(reviewableHandledErrors.get(e),"suppressed"))return;this.markHandled(e);const s=_.assign(e.extra||{},{recoverable:!0}),i={};t&&(Vue.set(s,"context",t),Vue.set(i,"context",t)),Sentry.captureException(e,{extra:s,tags:i,fingerprint:["{{ default }}",t]})}markHandled(e){if(!_.isNil(e)){if(!_.isObject(e)){const t=new Error("Internal error: error is not an object");return reviewableHandledErrors.set(t,{}),void Sentry.captureException(t,{extra:{recoverable:!0,value:e,stack:_get(e,"stack")}})}reviewableHandledErrors.has(e)||reviewableHandledErrors.set(e,{});try{Vue.set(e,"handled",!0)}catch{}}}suppress(e){this.markHandled(e),_.isObject(e)&&Vue.set(reviewableHandledErrors.get(e),"suppressed",!0)}signalCrash(e,t,s){this.locked||(Vue.set(this,"crash",e),Vue.set(this,"crashSource",t),Vue.set(this,"crashStack",s),this._stopTheWorld())}forceUpgrade(){this.locked||(Vue.set(this,"upgrade",!0),this._stopTheWorld(550))}enterMaintenance(e){this.locked||(Vue.set(this,"maintenance",e||{}),this._stopTheWorld(550))}setCondition(e,s){Vue.set(this,"condition",e),Vue.set(this,"conditionData",s),Vue.set(this,"isolated",!0),t.scrollPage(0)}clearCondition(e){e&&this.condition!==e||(Vue.set(this,"condition",null),Vue.set(this,"conditionData",null),Vue.set(this,"isolated",!1))}setFailure(e,t,s={}){const i=Vue.set(this.failures,e,{key:e,message:t,icon:"",...s,active:!0,retrying:!1});s.retry&&Vue.set(i,"retry",async()=>{Vue.set(i,"retrying",!0),await s.retry(),Vue.set(i,"retrying",!1)}),s.context&&s.context.acquire()}clearFailure(e){const t=this.failures[e];t&&(t.active&&t.context&&t.context.release(),Vue.set(t,"active",!1))}},null)}},!1,!0,{filename:"src/plumbing/corpsman.js"}),_reviewable.define(["dom"],["truss"],function(e){"use strict";return{dom:_declareVue("DomSingleton",class DomSingleton{constructor(){Vue.set(this,"textMeasurementContexts",new Map),Vue.set(this,"textWidthMeasurements",new lrucache.LRUCache({max:4096}))}getElementFromNode(e){return e?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null}findClosestElement(e,...t){let s=this.getElementFromNode(e);for(const e of t){if(!s)return null;s=s.closest(e)}return s}getAncestorsAndSelf(e){const t=[];for(let s=this.getElementFromNode(e);s;s=s.parentElement)t.push(s);return t}getEventPath(e){const t=e.composedPath?e.composedPath():this.getAncestorsAndSelf(e.target);return _(t).map(e=>
1this.getElementFromNode(e)).compact().uniq().value()}isElementVisible(e){if(!e)return!1;const t=getComputedStyle(e);return"hidden"!==t.visibility&&"0"!==t.opacity&&"none"!==t.display&&!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}getTextMeasurementFont(e){if(!e)return;const t=getComputedStyle(e);return[t.fontStyle,t.fontVariant,t.fontWeight,`${t.fontSize}/${t.lineHeight}`,t.fontFamily].join(" ")}measureTextWidth(e,t){if(!t)return;const s=`${t}\0${e}`,i=this.textWidthMeasurements.get(s);if(void 0!==i)return i;let r=this.textMeasurementContexts.get(t);r||(r=document.createElement("canvas").getContext("2d"),Vue.set(r,"font",t),this.textMeasurementContexts.set(t,r));const n=r.measureText(e).width;return this.textWidthMeasurements.set(s,n),n}measureElementTextWidth(e,t){return this.measureTextWidth(e,this.getTextMeasurementFont(t))}clearChildren(e){for(;e.firstChild;)e.removeChild(e.firstChild)}},null)}},!1,!0,{filename:"src/plumbing/dom.js"}),_reviewable.define(["hotkeys"],["truss","defaultBindings","bus","session"],function(e,t,s,i){"use strict";const r={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},n=[[/(?:"((?:\\.|[^"])*)"|'((?:\\.|[^'])*)')/,"STRING",e=>{Vue.set(e,"value",(e.match[1]||e.match[2]||"").replace(/\\(?:u([0-9a-fA-F]{4})|x([0-9a-fA-F]{2})|([0-3][0-7]{0,2}|[0-7]{1,2})|(.))/g,(...e)=>{let t=e[1]||e[2];return t?String.fromCharCode(parseInt(t,16)):e[3]?String.fromCharCode(parseInt(e[3],8)):(t=e[4],Object.prototype.hasOwnProperty.call(r,t)?r[t]:t)}))}],[/null/,"NULL",e=>Vue.set(e,"value",null)],[/true|false/,"BOOL",e=>Vue.set(e,"value","true"===e.match[0])],[/([_a-zA-Z][_a-zA-Z0-9]*)\(/,"FUNC",e=>Vue.set(e,"value",e.match[1])],[/[+-]?(?:(0x[0-9a-fA-F]+|0[0-7]+)|((?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)(?:[eE][+-]?[0-9]+)?|NaN|Infinity))/,"NUM",e=>{Vue.set(e,"value",e.match[1]?parseInt(e.match[0],10):parseFloat(e.match[0]))}],[/\)/,"RPAREN"],[/;/,"SEMI"],[/,/,"COMMA"],[/\s+/,null]];class Lexer{constructor(){Vue.set(this,"_tokenRegExp",void 0),Vue.set(this,"_rules",_.map(n,e=>[e[0].source,e[1],e[2]]))}_compile(){if(!this._tokenRegExp){const e=[];let t=0;_.forEach(this._rules,s=>{let i=s[0];const r=i.replace(/\\.|\[(?:\\.|[^\]])*\]|(\((?!\?[!:=]))|./g,(e,t)=>t?".":"").length;Vue.set(s,3,r+1);i=i.replace(/\\\D|\[(?:\\.|[^\]])*\]|\\(\d+)|./g,(e,s)=>{if(!s)return e;const i=parseInt(s,10);return i>0&&i<=r?"\\"+(i+t+1):parseInt(s,8)}),t+=r+1,e.push(i)}),Vue.set(this,"_tokenRegExp",new RegExp("("+e.join(")|(")+")","g"))}return this._tokenRegExp}lex(e){const t=[];let s;const i=this._compile();let r=0;for(;s=i.exec(e);){if(s.index!==r)throw new Error(`Unexpected character found ${e.charAt(r)} at index ${r}.`);r+=s[0].length;const i={type:void 0,value:s[0],match:void 0,offset:r};let n=1,a=0,o=this._rules[a];for(;!s[n];)n+=o[3],o=this._rules[++a];if(Vue.set(i,"type",o[1]),Vue.set(i,"match",s.slice(n,n+o[3])),Vue.set(i.match,o[3]-1,i.match[o[3]-1]),o[2]&&o[2].call(this,i),0===s[0].length)throw new Error(`Rule at index ${n} matched the empty string.`);i.type&&t.push(i)}if(e.length!==r)throw new Error(`Unexpected character found ${e.charAt(r)} at index ${r}.`);return t}}class Hotkey{constructor(e,t,s,i,r,n,a,o){Vue.set(this,"combo",e),Vue.set(this,"description",t),Vue.set(this,"callback",s),Vue.set(this,"allowIn",i),Vue.set(this,"persistent",r),Vue.set(this,"expression",n),Vue.set(this,"sequences",a),Vue.set(this,"statements",o)}}const a=_declareVue("HotkeysSingleton",class HotkeysSingleton{constructor(){Vue.set(this,"list",[]),Vue.set(this,"helpVisible",!1),Vue.set(this,"callbacks",Object.create(null)),Vue.set(this,"lexer",void 0),Vue.set(this,"successfullyAppliedCustomBindings",!1),Vue.set(Mousetrap.prototype,"stopCallback",function(e,t){return!t.classList.contains("mousetrap")&&"true"===t.contentEditable})}created(){this.$observe(()=>_get(i,"settings","keyBindingsUrl"),e=>{e&&/^https?:\/\//.test(e)?fetch(_.trim(e)).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status} ${e.statusText}`);return e.text()}).then(e=>{try{this.bindKeys(JSON.parse(e)),Vue.set(this,"successfullyAppliedCustomBindings",!0)}catch(t){console.log("Failed to apply custom key bindings:",t.toString(),"\n",e)}},e=>{console.log("Failed to load custom key bindings:",e.message)}):(this.bindDefaultKeys(),Vue.set(this,"successfullyAppliedCustomBindings",!1))})}register(e,t,s,i){if(_.isString(s)&&(i=s,s=void 0),s instanceof Vue&&!s._isMounted)throw new Error(`Scoped hotkey callback must be registered from mounted() or later: ${e}`);if(this._handleRegistration(e,t,i),s){if(!(s instanceof Vue||s.$truss))throw new Error(`Unable to re
1cognize scope type for function "${e}: ${s}`);s.$on("hook:beforeDestroy",()=>this._removeCallback(e))}}_handleRegistration(e,t,s="review-page"){if(this.callbacks[e])throw new Error("Hotkey callback already registered: "+e);Vue.set(this.callbacks,e,{callback:t,context:s})}_removeCallback(e){Vue.delete(this.callbacks,e)}isAvailableInContext(e,t){return _.every(e,({functionName:e})=>!!this.callbacks[e]&&(t===this.callbacks[e].context||"universal"===this.callbacks[e].context))}trigger(e,t){this.callbacks[e]?this.callbacks[e].callback.apply(null,t):console.log("Hotkey function is not found or not accessible yet: ",e)}purgeHotkeys(){let e=this.list.length;for(;e--;){const t=this.list[e];t&&!t.persistent&&this.del(t)}}toggleCheatSheet(e){Vue.set(this,"helpVisible",!0===e||!1===e?e:!this.helpVisible)}add(e,t,s,i,r,n,a){let o=["INPUT","SELECT","TEXTAREA"];const l=["CHECKBOX","RADIO"];void 0===r&&(r=!0);const c=s;_.isArray(i)||(i=[]),i=_.map(i,e=>_.toUpper(e)),o=_.filter(o,e=>!_.includes(i,e)),s=function(e){const t=_.toUpper(e.target.nodeName),s=_.toUpper(e.target.type);(e.target.classList.contains("mousetrap")||!_.includes(o,t)||"INPUT"===t&&_.includes(l,s))&&c(...arguments)},Mousetrap.bind(e,s),e=_.isArray(e)?e:[e];const u=_.map(e,e=>{const t=_.map(e.split(/[\s]/),this._symbolize);return Vue.set(t,"source",e),t}),d=new Hotkey(e,t,s,i,r,n,u,a);if(r)this.list.push(d);else{let e=0;for(;e<this.list.length&&!this.list[e].persistent;e++);this.list.splice(e,0,d)}return d}del(e){const t=e instanceof Hotkey?e.combo:e;if(Mousetrap.unbind(t),_.isArray(t)){let e=!0;return _.forEachRight(t,t=>{e=this.del(t)&&e}),e}const s=this.list.indexOf(this._getHotkey(t));if(s>-1){const e=this.list[s].combo;return e.length>1?e.splice(e.indexOf(t),1):this.list.splice(s,1),!0}return!1}_getHotkey(e){return _.find(this.list,t=>_.includes(t.combo,e))||!1}_symbolize(e){const t={command:"â",shift:"â§",left:"â",right:"â",up:"â",down:"â",return:"â©",backspace:"â«",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",f13:"F13",f14:"F14",f15:"F15",f16:"F16",f17:"F17",f18:"F18",f19:"F19"};return(e=_.map(e.split("+"),e=>("mod"===e&&(e=window.navigator&&_.includes(window.navigator.platform,"Mac")?"command":"ctrl"),t[e]||e))).join(" + ")}bindDefaultKeys(){this.bindKeys(t)}bindKeys(e){this.purgeHotkeys(),_.forEach(e,e=>{if((e=_.clone(e))[0]){if(e[2]){if(_.isString(e[2])){const t=e[2];if("toggleCheatSheet()"===t)return;Vue.set(e,5,t);const i=Vue.set(e,6,this._parseExpression(t));Vue.set(e,2,(e,t)=>{const r=e.target||e.srcElement;if("TEXTAREA"===r.nodeName.toUpperCase()&&!/(ctrl|command|mod|alt)\+|f\d+/.test(t))return;if(13===e.keyCode&&("BUTTON"===r.nodeName.toUpperCase()||"A"===r.nodeName.toUpperCase()&&r.getAttribute("href")))return;e.preventDefault();const n={prevented:!1};s.allowHotkey(n),n.prevented||_.forEach(i,({functionName:e,args:t})=>{this.trigger(e,t)})})}}else Vue.set(e,2,_.noop);_.isString(e[0])?Vue.set(e,0,[e[0]]):Vue.set(e,0,_.clone(e[0])),_.some(e[0],e=>/(ctrl|command|mod|alt)\+/.test(e))&&Vue.set(e,3,["TEXTAREA"]),Vue.set(e,4,!1),this.add(...e)}})}get _lexer(){return this.lexer||Vue.set(this,"lexer",new Lexer),this.lexer}_parseExpression(e){const t=this._lexer.lex(e);return this._parseTokens(t)}_parseTokens(e){const t=[];let s=0;for(;s<e.length;){const i=e[s];if("FUNC"===i.type){let r=s+1;const n=[];let a=e[r];for(;r<e.length&&_.includes(["STRING","NUM","NULL","BOOL"],a.type)&&(n.push(a.value),a=e[++r],!(r<e.length)||"RPAREN"!==a.type&&"COMMA"===a.type);)a=e[++r];if(r>=e.length||"RPAREN"!==a.type)throw new Error(`Expected ')' instead found ${JSON.stringify(a.match[0])}.`);t.push({functionName:i.value,args:n}),s=r+1}else{if("SEMI"!==i.type)throw new Error(`Unexpected token ${JSON.stringify(i.match[0])}.`);s++}}if(s!==e.length)throw new Error("Unexpected token, expected EOF.");return t}},null);return{hotkeys:a}},!1,!0,{filename:"src/plumbing/hotkeys.js"}),_reviewable.define(["modifiers"],["truss","config"],function(e,t){"use strict";return{modifiers:_declareVue("ModifiersSingleton",class ModifiersSingleton{constructor(){Vue.set(this,"buttons",[]),Vue.set(this,"modKeys",[]),Vue.set(this,"externalKeyActive",!1),Vue.set(this,"externalButtonActive",!1),Vue.set(this,"externalClassToggled",!1),Vue.set(this,"metaDown",!1),Vue.set(this,"ctrlDown",!1),Vue.set(this,"altDown",!1),Vue.set(this,"shiftDown",!1)}created(){t.mac?(this.modKeys.push("Meta"),t.safari||this.modKeys.push("Shift")):this.modKeys.push("Control","Shift"),document.addEventListener("keydown",this.detectModKey),document.addEventListener("keyup",this.detectModKey),document.addEventListener("mousemove",this.sniffModKey),document.addEventListener("mousedown",this.detectButton),document.addEventListener("click",this.modifyClick,!0)}detectModKey(e){this.setKeyFlags(e);const t=_.includes(this.modKeys,e.key)&&"keydown"===e.type;this.externalKeyActive!==t&&(Vue.set(this,"externalKeyActive",t),_.delay(this.updateExter
1nalClass,100))}sniffModKey(e){this.setKeyFlags(e),this.externalKeyActive&&!(this.metaDown||this.shiftDown||this.ctrlDown)&&(Vue.set(this,"externalKeyActive",!1),_.delay(this.updateExternalClass,100))}setKeyFlags(e){if(Vue.set(this,"shiftDown",e.shiftKey),Vue.set(this,"altDown",e.altKey),Vue.set(this,"ctrlDown",e.ctrlKey),Vue.set(this,"metaDown",e.metaKey),!e.ctrlKey&&!e.metaKey&&(e.shiftKey||e.altKey)){const e=document.activeElement,t=_access(e,"","tagName","","toLowerCase","call",[]);("textarea"===t||"input"===t&&"text"===_get(e,"type"))&&Vue.set(this,"shiftDown",Vue.set(this,"altDown",Vue.set(this,"ctrlDown",Vue.set(this,"metaDown",!1))))}}detectButton(e){Vue.set(this.buttons,e.which,"mousedown"===e.type)}modifyClick(e){_.every(this.buttons,(e,t)=>2===t?e:!e)&&(Vue.set(this,"externalButtonActive",!0),_.defer(()=>{Vue.set(this,"externalButtonActive",!1)})),Vue.set(this,"buttons",[])}updateExternalClass(){this.externalKeyActive!==this.externalClassToggled&&(Vue.set(this,"externalClassToggled",this.externalKeyActive),document.documentElement.classList.toggle("external-link-active",this.externalClassToggled))}get externalLinkActive(){return this.externalKeyActive||this.externalButtonActive}get metaOrCtrl(){return this.metaDown||this.ctrlDown}get altOrShift(){return this.altDown||this.shiftDown}get combinationMod(){return this.metaOrCtrl&&this.altOrShift}},null)}},!1,!0,{filename:"src/plumbing/modifiers.js"}),_reviewable.define(["pageControl"],["truss"],function(e){"use strict";const t=document.documentElement;return{pageControl:_declareVue("PageControlSingleton",class PageControlSingleton{constructor(){Vue.set(this,"scrollC
1ontexts",{}),Vue.set(this,"lastActive",void 0),Vue.set(this,"openDialogs",[]),Vue.set(this,"guidesGroup",void 0),Vue.set(this,"pinned",!1),Vue.set(this,"headerStickyingBypassed",!1),Vue.set(this,"normalizeViewOnLayoutSettled",_.debounce(this._normalizeViewOnLayoutSettled,50))}registerScrollContext(e,t){return Vue.set(this.scrollContexts,e,t)}unregisterScrollContext(e){Vue.delete(this.scrollContexts,e)}getViewportDimensions(e={}){const s={top:0,left:0,right:t.clientWidth,bottom:t.clientHeight};return e.top&&(s.top+=e.top),e.bottom&&(s.bottom+=e.bottom),e.left&&(s.left+=e.left),e.right&&(s.right+=e.right),Vue.set(s,"width",s.right-s.left),Vue.set(s,"height",s.bottom-s.top),s}openDialog(e){if(_.includes(this.openDialogs,e))return;this.openDialogs.push(e);const t=this._getGuidesGroup();t.contains(e)||e.appendChild(t),e.showModal()}closeDialog(e){if(!_.includes(this.openDialogs,e))return;_.pull(this.openDialogs,e);const t=this._getGuidesGroup();(_.findLast(this.openDialogs,e=>!t.contains(e))||document.body).appendChild(t),e.close()}closeAllDialogs(){_.forEach(this.openDialogs,e=>this.closeDialog(e))}getLayoutTopOffset(){const e=_.keys(this.scrollContexts)[0];if(!e)throw new Error("No scroll contexts established.");return this.scrollContexts[e].getLayoutTopOffset()}pinUntilSettled(e){this.pinned||(Vue.set(this,"pinned",!0),_.forEach(this.scrollContexts,t=>t.pin(e)),Vue.set(this,"headerStickyingBypassed",!0),this.normalizeViewOnLayoutSettled())}_normalizeViewOnLayoutSettled(){this.pinned&&(_.forEach(this.scrollContexts,e=>e.unpin()),Vue.set(this,"pinned",!1),Vue.set(this,"headerStickyingBypassed",!1))}bypassHeaderStickying(e){Vue.set(this,"headerStickyingBypassed",!0),this.$nextTick().then(()=>{e()&&Vue.set(this,"headerStickyingBypassed",!1)})}get topDialog(){return _.last(this.openDialogs)}_getGuidesGroup(){if(this.guidesGroup||Vue.set(this,"guidesGroup",document.getElementById("guides-group")),!this.guidesGroup)throw new Error("No guides group established.");return this.guidesGroup}},null)}},!1,!0,{filename:"src/plumbing/pageControl.js"}),_reviewable.define(["router"],["truss"],function(e){"use strict";return{router:_declareVue("RouterSingleton",class RouterSingleton{constructor(){Vue.set(this,"started",!1),Vue.set(this,"current",this.makeEmptyRoute()),Vue.set(this,"path",""),Vue.set(this,"query",{}),Vue.set(this,"hash",""),Vue.set(this,"params",{}),Vue.set(this,"pageTitle",void 0),Vue.set(this,"pageTitleSuffix",void 0),Vue.set(this,"pageClass",void 0),Vue.set(this,"keyParams",void 0),Vue.set(this,"componentKey",void 0),Vue.set(this,"component",void 0),Vue.set(this,"hooks",{before:[],after:[],afterSettled:[]}),Vue.set(this,"patterns",void 0),Vue.set(this,"fallbackRoute",void 0),Vue.set(this,"lastHistoryUrl",void 0)}start(e){if(this.started)throw new Error("Router already started");if(!_.size(e))throw new Error("Router routes must be provided to start().");const t=_.filter(e,e=>null===e.path);if(t.length>1)throw new Error("Router routes may include at most one fallback route with path: null.");Vue.set(this,"fallbackRoute",t[0]);const s=_.reject(e,e=>null===e.path);if(_.find(s,e=>!_.isString(e.path)))throw new Error("Router route paths must be strings or null.");if(_.find(e,e=>e.keyParams&&(!e.pageClass||!_.isArray(e.keyParams)||!_.every(e.keyParams,_.isString))))throw new Error("Router route keyParams must be an array of strings on a pageClass route.");if(_.find(e,e=>_.has(e,"redirect")&&!_.isFunction(e.redirect)))throw new Error("Router route redirects must be functions.");if(_.find(e,e=>e.redirect&&(_.has(e,"component")||_.has(e,"pageClass"))))throw new Error("Router routes cannot both redirect and declare pageClass or component.");if(_.find(e,e=>!(e.redirect||_.has(e,"component")&&_.isString(e.pageClass))))throw new Error("Router routes must have pageClass and component unless they redirect.");Vue.set(this,"started",!0),Vue.set(this,"patterns",_.map(s,e=>_.assign({},e,{pattern:new URLPattern({pathname:e.path,baseURL:window.location.origin})}))),window.addEventListener("popstate",()=>this._handlePopState()),window.addEventListener("hashchange",()=>this._handleHashChange()),document.addEventListener("click",e=>this._handleDocumentClick(e)),this._commitUrl(window.location.href,{replace:!0,initial:!0})}beforeChange(e,t){return this._addHook(this.hooks.before,e,t)}afterChange(e,t){return this._addHook(this.hooks.after,e,t)}afterSettled(e,t){return this._addHook(this.hooks.afterSettled,e,t)}go(e={},t={}){if(_.has(e,"url")&&(_.has(e,"path")||_.has(e,"query")||_.has(e,"hash")))throw new Error("router.go: url is mutually exclusive with path, query, and hash");const s=_.has(e,"url")?this._resolveUrl(e.url):this._buildUrl(e);return s.origin!==window.location.origin?(t.replace?window.location.replace(s.href):window.location.href=s.href,!1):this._commitUrl(s.href,t)}_addHook(e,t,s){const i={callback:t,scope:s};e.push(i);const r=()=>_.pull(e,i);if(s){if(!(s instanceof Vue||s.$truss))throw new Error("Unable to re
1cognize router hook scope");s.$on("hook:beforeDestroy",r)}return r}_resolveUrl(e){return new URL(e,window.location.href)}_buildUrl({path:e,query:t,hash:s}={}){const i=new URL(window.location.href);return void 0!==e&&Vue.set(i,"pathname",e||"/"),void 0!==t&&(Vue.set(i,"search",""),t&&this._writeQuery(i,t)),void 0!==s&&Vue.set(i,"hash",s?`#${_.trimStart(s,"#")}`:""),i}_writeQuery(e,t){const s=[];_.forEach(t,(e,t)=>{_.isArray(e)?_.forEach(e,e=>this._addQueryPart(s,t,e)):this._addQueryPart(s,t,e)}),Vue.set(e,"search",s.join("&"))}_addQueryPart(e,t,s){if(_.isNil(s)||!1===s)return;const i=encodeURIComponent(t);!0===s?e.push(i):e.push(`${i}=${encodeURIComponent(s)}`)}_commitUrl(e,t={}){const s=this._resolveUrl(e);this._normalizePathname(s);const i=this._resolveRoute(s),r="-"===this._decodeHash(s);if(r&&(Vue.set(s,"hash",""),Vue.set(i,"hash",""),Vue.set(i,"href",s.href)),i.redirect)return this.go(i.redirect(i),_.assign({},t,{replace:!0}));if(!t.initial&&s.href===this.current.href)return t.replace&&window.location.href!==s.href&&(window.history.replaceState(null,"",s.href),Vue.set(this,"lastHistoryUrl",s.href)),!0;const n=this.current,a={from:n,to:i,defaultPrevented:!1,preventDefault(){Vue.set(this,"defaultPrevented",!0)}};if(!t.initial){for(const e of this.hooks.before.slice())e.callback(a);if(a.defaultPrevented){const e=this.lastHistoryUrl||n.href;return t.pop?window.history.pushState(null,"",e):t.restoreOnCancel&&window.history.replaceState(null,"",e),!1}}t.initial?(t.replace||r)&&window.history.replaceState(null,"",s.href):window.history[t.replace||r?"replaceState":"pushState"](null,"",s.href),Vue.set(this,"lastHistoryUrl",s.href),this._setRoute(i);for(const e of this.hooks.after.slice())e.callback(i,n);return this._scheduleSettledHooks(i,n),!0}_normalizePathname(e){e.pathname.length>1&&Vue.set(e,"pathname",e.pathname.replace(/\/+$/,""))}_scheduleSettledHooks(e,t){const s=this.hooks.afterSettled.slice();s.length&&Vue.nextTick(()=>{if(this.current===e)for(const i of _.intersection(s,this.hooks.afterSettled))i.callback(e,t)})}_resolveRoute(e){const t=this._matchRoute(e)||this._fallbackRoute();return Vue.set(t,"query",this._readQuery(e.search)),Vue.set(t,"hash",this._decodeHash(e)),"-"===t.hash&&Vue.set(t,"hash",""),Vue.set(t,"path",this._decodeURIComponent(e.pathname)),Vue.set(t,"href",e.href),Vue.set(t,"current",t),Vue.set(t,"componentKey",this._makeComponentKey(t)),t}_makeComponentKey(e){if(!e.pageClass)return;const t=_(e.keyParams).map(t=>e.params[t]).reject(_.isNil).value().join("/");return t?`${e.pageClass}:${t}`:e.pageClass}_matchRoute(e){for(const t of this.patterns){const s=t.pattern.exec(e.href);if(!s)continue;const i=_.mapValues(s.pathname.groups,e=>_.isNil(e)?e:this._decodeURIComponent(e));return _.assign({},_.omit(t,"pattern"),{params:i})}}_fallbackRoute(){if(!this.fallbackRoute)throw new Error("Router could not match route and has no fallback.");return _.assign({},this.fallbackRoute,{params:{}})}_readQuery(e){const t={};for(const s of _.trimStart(e,"?").split("&")){if(!s)continue;const e=s.replace(/\+/g,"%20"),i=e.indexOf("="),r=-1===i?e:e.substring(0,i),n=this._tryDecodeURIComponent(r);if(_.isUndefined(n))continue;const a=-1===i||this._tryDecodeURIComponent(e.substring(i+1));_.has(t,n)?(_.isArray(t[n])||Vue.set(t,n,[t[n]]),t[n].push(a)):Vue.set(t,n,a)}return t}_decodeHash(e){return this._decodeURIComponent(_.trimStart(e.hash,"#"))}_decodeURIComponent(e){const t=this._tryDecodeURIComponent(e);return _.isUndefined(t)?e:t}_tryDecodeURIComponent(e){try{return decodeURIComponent(e)}catch{return}}_setRoute(e){Vue.set(this,"current",e),Vue.set(this,"path",e.path),Vue.set(this,"query",e.query),Vue.set(this,"hash",e.hash),Vue.set(this,"params",e.params),Vue.set(this,"pageTitle",e.pageTitle),Vue.set(this,"pageTitleSuffix",e.pageTitleSuffix),Vue.set(this,"pageClass",e.pageClass),Vue.set(this,"keyParams",e.keyParams),Vue.set(this,"componentKey",e.componentKey),Vue.set(this,"component",e.component)}makeEmptyRoute(){return{params:{},query:{},hash:"",path:"",href:window.location.href}}_handlePopState(){window.location.href!==this.current.href&&this._commitUrl(window.location.href,{replace:!0,pop:!0})}_handleHashChange(){window.location.href!==this.current.href&&this._commitUrl(window.location.href,{replace:!0,restoreOnCancel:!0})}_handleDocumentClick(e){if(e.defaultPrevented||0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;const t=_get(e,"target","closest")&&e.target.closest("a[href]");if(!t||t.target||t.hasAttribute("download"))return;const s=this._resolveUrl(t.getAttribute("href"));s.origin===window.location.origin&&(e.preventDefault(),this.go({url:s.href}))}},null)}},!1,!0,{filename:"src/plumbing/router.js"}),_reviewable.define(["session"],["truss","config","bindTruss","mangler","shared"],function(e,t,s,i,r){"use strict";function n(e){for(const t in e)Vue.delete(e,t)}return{session:_declareVue("SessionSingleton",class SessionSingleton{constructor(){Vue.set(this,"settings",{}),Vue.set(this,"onboarding",{}),Vue.set(this,"computed",{}),Vue.set(this,"window",{focused:document.hasFocus(),visible:!document.hidden}),Vue.set(this,"globalRepoClass",_.find(t.coveredRepoClasses,{organization:"*"})),Vue.set(this,"corpsman",void 0),Vue.set(this,"auth",void 0),Vue.set(this,"analytics",void 0),Vue.set(this,"config",void 0),Vue.set(this,"hidingTooltips",!1),Vue.set(this,"rateLimit",void 0),Vue.set(this,"dropdownsHiding",[])}created(){Object.defineProperties(this,{user:{get(){return this.$info.user}}}),Object.defineProperties(this.settings,{effectiveShowUnconnectedPullRequests:{get(){return void 0===this.showUnconnectedPullRequests||this.showUnconnectedPullRequests},set(e){Vue.set(this,"showUnconnectedPullRequests",e)}}}),this.$observe(()=>this.settings.lineLinkTemplate,e=>{if(!e)return Vue.set(this.computed,"compiledLineLinkTemplate",null),void Vue.set(this.computed,"lineLinkTemplateCompilationError",null);try{Vue.set(this.computed,"compiledLineLinkTemplate",t=>i.renderUserTemplate(e,t)),Vue.set(this.computed,"lineLinkTemplateCompilationError",null);const t=e.match(/(example\.com|Distro-Name|c:)?\/directory\/with\/repos/);if(t)throw new Error(`replace "${t[0]}" with your repositories root to enable external editor links`);this.computed.compiledLineLinkTemplate({owner:"",repo:"",baseOwner:"",baseRepo:"",pr:"",headBranch:"",baseBranch:"",path:"",viewSha:1,viewLine:1,sha:1,line:1})}catch(e){Vue.set(this.computed,"lineLinkTemplateCompilationError","Hint: "+e.message+".")}}),this.$when(()=>this.settings.$ready||null===this.$info.userid).then(()=>{this.settings.colorScheme||Vue.set(this.settings,"colorScheme","system"),this.settings.a11y||Vue.set(this.settings,"a11y",{})}),this.$intercept("connect",{onBefore:e=>{if(e.target.match("/users/$userKey/settings")||e.target.match("/users/$userKey/onboarding"))return new Promise(e=>{setTimeout(e,10)})}}),this.$observe(()=>this.$info.user,e=>{e?this.hubkit().request("/rate_limit").then(e=>{Vue.set(this,"rateLimit",e)}
1,_.noop):(n(this.settings),n(this.onboarding),Vue.set(this,"rateLimit",void 0))}),s(()=>_ref(this.$store,"child","users","current","settings"),this.settings,{shallow:!0}),s(()=>_ref(this.$store,"child","users","current","onboarding"),this.onboarding,{shallow:!0}),this.$connect({settings:()=>_ref(this.$store,"child","users","current","settings"),onboarding:()=>_ref(this.$store,"child","users","current","onboarding")}),"https://github.com"!==t.gitHubUrl&&(this.$connect(_ref(this.$store,"child","system","gheVersion")),Vue.set(Hubkit.defaults,"onRequest",e=>this.$when(()=>_get(this,"$store","system","gheVersion")).then(t=>{Vue.set(e,"gheVersion",t)}))),window.addEventListener("focus",()=>{Vue.set(this.window,"focused",!0)}),window.addEventListener("blur",()=>{Vue.set(this.window,"focused",!1)}),document.addEventListener("visibilitychange",()=>{Vue.set(this.window,"visible",!document.hidden)})}hubkit(e,t,s){if(void 0!==this.user&&(!this.user||this.user.github))return s=s||{},this.user&&Vue.set(s,"token",this.user.github.accessToken),e&&Vue.set(s,"owner",e),t&&Vue.set(s,"repo",t),Vue.set(s,"scopes",this.user?this.user.github.scopes:[]),_.has(s,"autoQueryRateLimit")||Vue.set(s,"autoQueryRateLimit",!0),new Hubkit(s)}hasScope(e){return void 0===this.$info.user||_.includes(_get(this,"$info","user","github","scopes"),e)}async hideAllTooltips(){Vue.set(this,"hidingTooltips",!0),Vue.set(this,"dropdownsHiding",[]),tippy.hideAll(),await this.$when(()=>_.every(this.dropdownsHiding,e=>!e.open)),await this.$nextTick(),Vue.set(this,"hidingTooltips",!1);const e=this.dropdownsHiding.length;return Vue.set(this,"dropdownsHiding",[]),e}get userHasBetaAccess(){return"saas"===t.env&&_.includes(r.betaUserKeys,this.$info.userid)}},null)}},!1,!0,{filename:"src/plumbing/session.js"}),_reviewable.define(["capitalize"],[],function(){"use strict";return{capitalize:function(e){return _.capitalize(e)}}},!1,!0,{filename:"src/view/filters/capitalize.js",filterName:"capitalize",filterExportName:"capitalize"}),_reviewable.define(["dispositionIconClass"],[],function(){"use strict";return{dispositionIconClass:function(e){return"icon disposition "+(e||"uninvolved")}}},!1,!0,{filename:"src/view/filters/dispositionIconClass.js",filterName:"dispositionIconClass",filterExportName:"dispositionIconClass"}),_reviewable.define(["fullDate"],[],function(){"use strict";return{fullDate:function(e){return e.toLocaleDateString([],{dateStyle:"full"})}}},!1,!0,{filename:"src/view/filters/fullDate.js",filterName:"fullDate",filterExportName:"fullDate"}),_reviewable.define(["issueIconClass"],[],function(){"use strict";return{issueIconClass:function(e){const t="issue"===e.type?"issue":"pr"===e.type?"pull request":"";return`${"open"===e.effectiveState?"green":"closed"===e.effectiveState?"purple":"dropped"===e.effectiveState?"red":""} ${e.effectiveState} ${t} icon`}}},!1,!0,{filename:"src/view/filters/issueIconClass.js",filterName:"issueIconClass",filterExportName:"issueIconClass"}),_reviewable.define(["plural"],[],function(){"use strict";return{plural:function(e){return 1===e?"":"s"}}},!1,!0,{filename:"src/view/filters/plural.js",filterName:"plural",filterExportName:"plural"}),_reviewable.define(["shortDateTime"],[],function(){"use strict";return{shortDateTime:function(e){return e.toLocaleString([],{dateStyle:"short",timeStyle:"short"})}}},!1,!0,{filename:"src/view/filters/shortDateTime.js",filterName:"shortDateTime",filterExportName:"shortDateTime"}),_reviewable.define(["statusIconClass"],[],function(){"use strict";return{statusIconClass:function(e,t){return(e||"pending")+" status check icon"+(!1===t?" optional":"")}}},!1,!0,{filename:"src/view/filters/statusIconClass.js",filterName:"statusIconClass",filterExportName:"statusIconClass"}),_reviewable.define(["globalHoverDetectionPlugin"],[],function(){"use strict";const e={name:"globalHoverDetection",hasHover:!1,install:function(){Object.defineProperty(Vue.prototype,"$hoverDetect",{get:()=>e})}};let t=0;return document.addEventListener("touchstart",()=>{t=Date.now(),document.body&&document.body.classList.remove("has-hover"),e.hasHover=!1}),document.addEventListener("mousemove",()=>{Date.now()-t>=500&&document.body&&(document.body.classList.add("has-hover"),e.hasHover=!0)}),{globalHoverDetectionPlugin:e}},!1,!0,{filename:"src/view/plugins/globalHoverDetectionPlugin.js"}),_reviewable.define(["refReadyPlugin"],["config"],function(e){"use strict";const t=e=>e.$el||e;return{refReadyPlugin:{name:"refReady",install(){Object.defineProperty(Vue.prototype,"$waitForRefs",{value:this.waitForRefs})},waitForRefs(s,i,r){let n=50,a=!1;const o=Date.now(),l=this.$options.name||_get(this,"$vnode","tag")||"Unknown Component",c=_.isArray(s)?s:[s],u=()=>{if(this.$destroyed)return;n=Math.min(2*n,_get(r,"maxPollInterval")||1e3);if(_.every(c,e=>this.$refs[e])){const e=_.flatMap(c,e=>{return s=this.$refs[e],_.isArray(s)?_.map(s,t):t(s);var s});i(_.isArray(s)?e:e[0])}else if(setTimeout(()=>{this.$nextTick().then(u)},n),!e.prod&&!a&&Date.now()-o>2e3){const e=_.filter(c,e=>!this.$refs[e]);console.warn(`Timeout: Refs in ${l} not found within 2000ms. Make sure these refs exist in the template: [${e.join(", ")}].`),a=!0}};u()}}}},!1,!0,{filename:"src/view/plugins/refReadyPlugin.js"}),_reviewable.define(["diffCopyUtils"],["truss","textSelectionTracker","dom"],function(e,t,s){"use strict";const i=/language-(.*) cont/;return{diffCopyUtils:_declareVue("DiffCopyUtilsSingleton",class DiffCopyUtilsSingleton{constructor(){Vue.set(this,"multiRangeSupportDetected",void 0)}getChildTextNode(e,{getLast:t=!1,trim:s=!0}
1={}){if(!e)return;const i=document.createNodeIterator(e,NodeFilter.SHOW_TEXT),r=[];let n;for(;n=i.nextNode();)(!s||""!==_.trim(n.textContent)&&3===n.nodeType)&&r.push(n);return t?_.last(r):_.head(r)}getDiffWidthElementFromNode(e,t,i){if(e){if(_.isElement(e)){const r="two"===i?`.${t}`:"";return s.findClosestElement(e,`.wrapper ${r}.diffwidth`)||e.querySelector(`.wrapper ${r}.diffwidth`)}return this.getDiffWidthElementFromNode(e.parentElement)}}handleSelectionEdgeCase(e,t,s){if(!e)return;const i="left"===t?"right":"left";if(e.matches&&e.matches(".collapsed.wrapper")){const i=this.getLastValidFromCollapsed(e,t,s);return this.handleSelectionEdgeCase(i,t,s)}e.matches&&!e.matches(".line.content.diffwidth")&&(e=e.querySelector(".line.content.diffwidth")||e);const r=_get(e,"classList");if(_access(r,"","contains","call",["empty"])||_access(r,"","contains","call",["blank"])){const i=this.getLastValidFromBlank(e,t,s);return this.handleSelectionEdgeCase(i,t,s)}if(_access(r,"","contains","call",[i])){const r=this.getLastValidOnSameSide(e,i,s);return this.handleSelectionEdgeCase(r,t,s)}return e}getLastValidFromCollapsed(e,t,{findAnchor:s=!1}={}){let i,r;s?(i=this.getClosestPopulatedExpandedRegion(e.parentElement,{findAnchor:!0}),r=_get(i,"firstElementChild")):(i=this.getClosestPopulatedExpandedRegion(e.parentElement),r=_get(i,"lastElementChild"));return _access(r,"","querySelector","call",[`.wrapper .diffwidth.${t}:not(.discussions)`])||_access(r,"","querySelector","call",[".wrapper .diffwidth:not(.discussions)"])}getLastValidOnSameSide(e,t,{findAnchor:i=!1}={}){if(_get(e,"classList")&&!_access(e,"","classList","","contains","call",[t]))return e;const r=s.findClosestElement(e,".diff.line");let n;return n=_access(r,"",i?"nextElementSibling":"previousElementSibling","","querySelector","call",[".diffwidth.wrapper"]),n?this.getLastValidOnSameSide(n,t,{findAnchor:i}):void 0}getLastValidFromBlank(e,t,{findAnchor:i=!1}={}){let r;const n=s.findClosestElement(e,".diff.line");r=i?_get(n,"nextElementSibling")||_access(this,"","getClosestPopulatedExpandedRegion","call",[s.findClosestElement(n,".expanded.region"),{findAnchor:!0}],"","firstElementChild"):n.previousElementSibling;const a=_access(r,"","querySelector","call",[`.diffwidth.${t}:not(.discussions)`])||_access(r,"","querySelector","call",[".diffwidth:not(.discussions)"]);return _access(a,"","classList","","contains","call",["empty"])||_access(a,"","querySelector","call",[`.wrapper .diffwidth.line.${t}.blank`])?this.getLastValidFromBlank(r,t,{findAnchor:i}):a}getClosestPopulatedExpandedRegion(e,{findAnchor:t=!1}={}){if(!e)return;const s=t?"next":"previous";if(_access(e,"",`${s}ElementSibling`,"","matches","call",[".expanded.region"]))return _get(e,`${s}ElementSibling`);const i=_access(e,"",`${s}ElementSibling`,"","querySelector","call",[".expanded.region"]);return i||this.getClosestPopulatedExpandedRegion(_get(e,`${s}ElementSibling`),{findAnchor:t})}extractSelectedText(e,t){const s={side:e,cleanNewlines:!0};if("discussion"===s.side){const e=this._extractFragment(".markdown-body.text"),t=e.textContent,s=document.createElement("div");s.appendChild(e);const i=s.innerHTML;return s.remove(),{"text/html":i,"text/plain":t}}if(_.startsWith(s.side,"codeblock")){const e=this._extractFragment(".line");return{"text/plain":this._convertCodeblockFragmentToText(e,s)}}return t||(t=this._convertDiffFragmentToLines(this._extractFragment(".line.content"),s)),{"text/plain":this._convertDiffLinesToText(t,s)}}_extractFragment(e){const t=window.getSelection(),i=document.createDocumentFragment();for(let r=0;r<t.rangeCount;r++){const n=t.getRangeAt(r).cloneRange();if(n.collapsed)continue;for(;n.endContainer!==n.startContainer&&n.endContainer!==n.commonAncestorContainer&&(n.endOffset===n.endContainer.length||n.endOffset===_get(n,"endContainer","childNodes","length"));)n.setEndAfter(n.endContainer);const a=n.commonAncestorContainer.parentNode,o="code"===_.toLower(a.nodeName),l=o&&"pre"===_.toLower(a.parentNode.nodeName);let c=n.cloneContents();if(!o&&n.startContainer.nodeType===Node.ELEMENT_NODE&&n.startContainer===n.endContainer){const e=n.startContainer.cloneNode(!1);e.append(c),c=e}if(!o&&c.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&c.firstChild===c.lastChild&&c.firstChild.nodeType===Node.TEXT_NODE){const t=_access(s,"","findClosestElement","call",[n.startContainer,e],"","cloneNode","call",[!1]);if(!t)continue;t.append(c.firstChild),c=t}if(c.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=c.querySelectorAll(e);if(t.length){i.append(...t);continue}}if(l&&"pre"!==_.toLower(_get(c,"firstChild","nodeName"))){const e=document.createElement("code");e.appendChild(c);const t=document.createElement("pre");t.appendChild(e),i.append(t)}else if(o&&"code"!==_.toLower(_get(c,"firstChild","nodeName"))){const e=document.createElement("code");e.appendChild(c),i.append(e)}else i.append(c)}return i}_convertDiffFragmentToLines(e,{side:t}){const s=".line.content:not(.zero)"+(t?":not(."+("left"===t?"right":"left")+")":"");let i=e.querySelectorAll(s);return i.length||(i=[e]),i}_convertDiffLinesToText(e,{keepTrailing:t,cleanNewlines:s}
1){e.forEach(e=>{_access(e,"","classList","","contains","call",["zero"])||(_access(e,"","classList","","contains","call",["blank"])?Vue.set(e,"textContent",""):this._cleanCodeSpecialClasses(e,t))});let i=_(e).reject(e=>_access(e,"","classList","","contains","call",["empty-line"])).map("textContent").join("\n");return s&&e.length>1&&!_.endsWith(i,"\n")&&(i+="\n"),i}_convertCodeblockFragmentToText(e,{side:t,keepTrailing:s,cleanNewlines:i}){const r=".line"+(t?":not(."+("codeblock-add"===t?"remove":"add")+")":"");let n=e.querySelectorAll(r);n.length||(n=[e]),n.forEach(e=>{this._cleanCodeSpecialClasses(e,s)});let a=_(n).map("textContent").join("\n");return i&&n.length>1&&!_.endsWith(a,"\n")&&(a+="\n"),a}_cleanCodeSpecialClasses(e,t){e.querySelectorAll(".tab").forEach(e=>e.replaceWith(document.createTextNode("\t"))),t||(e.querySelectorAll(".after-indent").forEach(e=>e.remove()),e.querySelectorAll(".trailing").forEach(e=>e.remove()),e.querySelectorAll(".no-newline").forEach(e=>e.remove()))}captureSelection(e,s,i,r,n){try{const a=this.extractSelectedText(i,n);a["text/plain"]?t.overrideSelectedText(a,e,s,i,r):t.clearOverride()}catch(e){if(!/Permission denied/.test(e.toString()))throw e;t.clearOverride()}}adjustSelection(e,s){const i=window.getSelection();if(!i.rangeCount||i.isCollapsed)return;const{lines:r,selectedLanguage:n}=this._findDiffLinesContainingSelection();return this._trimLinesWithEmptySelection(r),this._adjustSelectionFromLines(r,e,s),t.setSublanguage(n),r}_findDiffLinesContainingSelection(){const e=window.getSelection(),t=new Set,r=[];for(let n=0;n<e.rangeCount;n++){const a=e.getRangeAt(n);if(a.collapsed||!a.commonAncestorContainer)continue;const o=document.createTreeWalker(a.commonAncestorContainer,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,e=>{if(!a.intersectsNode(e))return NodeFilter.FILTER_REJECT;const t=e.nodeType===Node.TEXT_NODE?e.parentNode:e,i=s.findClosestElement(t,".line.content");if(!i)return NodeFilter.FILTER_SKIP;const r=getComputedStyle(i);return"none"===r.getPropertyValue("user-select")||"none"===r.getPropertyValue("-webkit-user-select")?NodeFilter.FILTER_REJECT:e.nodeType===Node.TEXT_NODE||e===i?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});do{const e=o.currentNode;if(e.nodeType===Node.TEXT_NODE){const n=s.findClosestElement(e,".line.content"),a=_access(n,"","querySelector","call",[".cont"],"","classList","","value"),o=_access(i,"","exec","call",[a],"",1);r.push(o||"root_lang"),n&&t.add(n)}else e.nodeType===Node.ELEMENT_NODE&&e.classList.contains("line")&&e.classList.contains("content")&&t.add(e)}while(o.nextNode())}const n=_.toArray(t);n.sort(this.documentOrderComparator);return{lines:n,selectedLanguage:1===_.uniq(r).length&&"root_lang"!==r[0]?r[0]:void 0}}_trimLinesWithEmptySelection(e){const t=window.getSelection();if(e.length){const s=t.getRangeAt(0),i=s.startContainer;i.nodeType!==Node.TEXT_NODE||s.startOffset!==i.textContent.length||!e[0].contains(i)||i.nextSibling||i.parentNode!==e[0]&&i.parentNode.nextSibling||e.shift()}if(e.length){const s=t.getRangeAt(t.rangeCount-1),i=s.endContainer,r=_.last(e);(i===r&&0===s.endOffset||i.nodeType===Node.TEXT_NODE&&0===s.endOffset&&r.contains(i)&&!i.previousSibling&&(i.parentNode===r||!i.parentNode.previousSibling))&&e.pop()}for(;e.length&&""===e[0].textContent;)e.shift();for(;e.length&&""===_.last(e).textContent;)e.pop()}_buildAllowedRangesFrom(e){const t=e.commonAncestorContainer.nodeType===Node.ELEMENT_NODE?e.commonAncestorContainer:e.commonAncestorContainer.parentNode,s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode:t=>e.intersectsNode(t)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),i=[];let r,n=null,a=0;function o(e,t){if(!n)return;const s=document.createRange();s.setStart(n,a),s.setEnd(e,t),s.collapsed||i.push(s),n=null}function l(e){let t=e.nodeType===Node.TEXT_NODE?e.parentElement:e;for(;t;){if("none"===getComputedStyle(t).userSelect)return!1;t=t.parentElement}return!0}for(;r=s.nextNode();)l(r)?(n||(n=r,a=r===e.startContainer?e.startOffset:0),r===e.endContainer&&o(r,e.endOffset)):o(r,0);return n&&o(n,n.length),i}
1_supportsMultipleRanges(e=window.getSelection()){if(_.isBoolean(this.multiRangeSupportDetected))return this.multiRangeSupportDetected;if(!_get(e,"rangeCount"))return!1;const t=document.createRange();t.setStart(document.body,0),t.setEnd(document.body,0);const s=e.rangeCount,i=[];for(let t=0;t<e.rangeCount;t++)i.push(e.getRangeAt(t).cloneRange());try{e.addRange(t);const i=e.rangeCount;return Vue.set(this,"multiRangeSupportDetected",i>s)}catch{return Vue.set(this,"multiRangeSupportDetected",!1)}finally{e.removeAllRanges();for(const t of i)e.addRange(t)}}_adjustSelectionFromLines(e,t,s){const i=window.getSelection();if(e.length){if(i.setBaseAndExtent){const r=i.getRangeAt(0),n=i.getRangeAt(i.rangeCount-1);let a=r.startContainer,o=r.startOffset,l=n.endContainer,c=n.endOffset;const u=_.last(e);if(!s&&e[0].contains(r.startContainer)||(a=e[0],o=0),!s&&u.contains(n.endContainer)||(u.lastChild.nodeType===Node.TEXT_NODE?(l=u.lastChild,c=u.lastChild.textContent.length):(l=u,c=u.childNodes.length)),"forward"===t?i.setBaseAndExtent(a,o,l,c):i.setBaseAndExtent(l,c,a,o),this._supportsMultipleRanges(i)){const e=i.getRangeAt(0).cloneRange(),t=this._buildAllowedRangesFrom(e);if(t.length){i.removeAllRanges();for(const e of t)i.addRange(e)}}}}else i.removeAllRanges()}getSelectionDirection(){const e=window.getSelection();if(!e.rangeCount||e.isCollapsed)return;if(e.anchorNode===e.focusNode)return e.anchorOffset>e.focusOffset?"backward":"forward";let t=e.anchorNode.compareDocumentPosition(e.focusNode);if(t&Node.DOCUMENT_POSITION_CONTAINED_BY){let s;for(let i=0;i<e.rangeCount&&(s=e.getRangeAt(i).startContainer,t=s.compareDocumentPosition(e.focusNode),!(t&0===Node.DOCUMENT_POSITION_CONTAINED_BY));i++);}return t&Node.DOCUMENT_POSITION_PRECEDING?"backward":"forward"}getLineNumber(e){return _.parseInt(_access(s,"","findClosestElement","call",[_.last(e),"[data-line-number]"],"","getAttribute","call",["data-line-number"]))||null}documentOrderComparator(e,t){if(e===t)return 0;const s=e.compareDocumentPosition(t);return s&(Node.DOCUMENT_POSITION_FOLLOWING|Node.DOCUMENT_POSITION_CONTAINED_BY)?-1:s&(Node.DOCUMENT_POSITION_PRECEDING|Node.DOCUMENT_POSITION_CONTAINS)?1:0}},null)}},!1,!0,{filename:"src/view/reviews/diff/diffCopyUtils.js"}),_reviewable.define(["Region"],[],function(){"use strict";let e,t,s,i;const r={CONTENT:1,WHITESPACE:2,BASE:4,METADATA:8};class Region{constructor(e,t,s,i){Vue.set(this,"visible",e),Vue.set(this,"start",t),Vue.set(this,"end",s),Vue.set(this,"lines",i),Vue.set(this,"leftDecls",null),Vue.set(this,"rightDecls",null),Vue.set(this,"leftDecl",null),Vue.set(this,"rightDecl",null),Vue.set(this,"leftDeclContinued",!1),Vue.set(this,"rightDeclContinued",!1),Vue.set(this,"hasResolved",!1),e||this.computeStats()}getLines(){return this.lines.slice(this.start,this.end)}computeStats(){const e=this.getLines();Vue.set(this,"numLines",e.length),Vue.set(this,"whitespaceChanges",_.some(e,e=>e.mods&r.WHITESPACE)),Vue.set(this,"baseChanges",_.some(e,e=>e.mods&r.BASE)),Vue.set(this,"metadataChanges",_.some(e,e=>e.mods&r.METADATA))}computeHunkDeclaration(e){Vue.set(this,"leftDecl",null),Vue.set(this,"rightDecl",null);const t=this.lines[this.end];if(Vue.set(this,"leftDecls",_get(t,"leftDecls")),Vue.set(this,"rightDecls",_get(t,"rightDecls")),t){if(this.leftDecls){const s=_.find(this.leftDecls,e=>!_.includes(t.ids,e.lineId));s&&(Vue.set(this,"leftDecl",s),Vue.set(this,"leftDeclContinued",!!e[s.lineId]),Vue.set(e,s.lineId,this))}if(this.rightDecls){const s=_.find(this.rightDecls,e=>!_.includes(t.ids,e.lineId));s&&(Vue.set(this,"rightDecl",s),Vue.set(this,"rightDeclContinued",!!e[s.lineId]),Vue.set(e,s.lineId,this))}Vue.set(this,"sameDecl",!this.leftDecl||!this.rightDecl||this.leftDecl.html===this.rightDecl.html),this.sameDecl&&Vue.set(this,"leftDeclContinued",Vue.set(this,"rightDeclContinued",this.leftDeclContinued||this.rightDeclContinued))}}mimic(e){Vue.set(this,"start",e.start),Vue.set(this,"end",e.end),Vue.set(this,"hasResolved",!1),this.computeStats()}split(r,n){const a=[];let o=new Region(!0,this.start,this.start,this.lines),l=0;for(let t=this.start;t<this.end;t++){if(r(this.lines[t],t)){const r=!a.length&&o.end-o.start===l;l>=(r?i:s)&&(o.end-=l-(r?0:e),o.start<o.end&&a.push(o),a.push(new Region(!1,o.end,o.end+l-(r?1:2)*e,this.lines)),o=new Region(!0,t-e,t,this.lines)),l=0}else l++;o.end++}const c=!a.length&&o.end-o.start===l,u=1===this.start&&this.end===this.lines.length;return l>=(c?u?0:t:i)?(o.end-=l-(c?0:e),o.start<o.end&&a.push(o),a.push(new Region(!1,o.end,o.end+l-e,this.lines))):a.push(o),1!==a.length||a[0].visible?"after"!==n||a[0].visible?"before"!==n||_.last(
1a).visible?Vue.set(this,"end",this.start):(this.mimic(_.last(a)),a.pop()):(this.mimic(a[0]),a.shift()):a.pop(),a}}function n(r,n){e=Vue.set(Region,"SENTINEL_LINES",r),t=Vue.set(Region,"MIN_HIDDEN_LINES",n),s=2*e+t,i=e+t}return n(3,8),Vue.set(Region,"temporarilySuppressSentinelLines",function(s){const i=e;n(0,t);try{s()}finally{n(i,t)}}),Vue.set(Region,"MOD",r),{Region:Region}},!1,!0,{filename:"src/view/reviews/diff/region.js"}),_reviewable.define(["textSelectionTracker"],["truss"],function(e){"use strict";return{textSelectionTracker:_declareVue("TextSelectionTrackerSingleton",class TextSelectionTrackerSingleton{constructor(){Vue.set(this,"text",void 0),Vue.set(this,"diff",void 0),Vue.set(this,"discussion",void 0),Vue.set(this,"sublanguage",void 0),Vue.set(this,"side",void 0),Vue.set(this,"lineNumber",void 0),Vue.set(this,"locked",!1),Vue.set(this,"clearPending",!1),Vue.set(this,"selectionRect",void 0),Vue.set(this,"palettePosition",void 0),Vue.set(this,"paletteHidden",!1),Vue.set(this,"paletteQuoteAllowed",!0),Vue.set(this,"selectionHandlesVisible",!1)}overrideSelectedText(e,t,s,i,r){Vue.set(this,"text",e),Vue.set(this,"diff",t),Vue.set(this,"discussion",s),Vue.set(this,"side",i),Vue.set(this,"lineNumber",r)}clearOverride(){this.locked?Vue.set(this,"clearPending",!0):(Vue.set(this,"text",void 0),Vue.set(this,"diff",void 0),Vue.set(this,"discussion",void 0),Vue.set(this,"side",void 0),Vue.set(this,"lineNumber",void 0),Vue.set(this,"clearPending",!1))}lockOverride(){Vue.set(this,"locked",!0)}unlockOverride(){Vue.set(this,"locked",!1),this.clearPending&&this.clearOverride()}clearIfDiffDestroyed(){_get(this,"diff","$destroyed")&&(Vue.set(this,"locked",!1),this.clearOverride())}setPaletteHidden(t,s){Vue.set(this,"paletteQuoteAllowed",s&&!!e.info.user),Vue.set(this,"paletteHidden",t)}setPaletteLocation(e,t){Vue.set(this,"selectionRect",e),Vue.set(this,"palettePosition",t)}setSelectionHandlesVisible(e){Vue.set(this,"selectionHandlesVisible",e)}getSelectedText(...e){if(this.clearIfDiffDestroyed(),this.diff)return;const t=this.text||{"text/plain":window.getSelection().toString()};for(const s of e)if(t[s])return t[s]}setSublanguage(e){Vue.set(this,"sublanguage",e)}get hasSelectedCode(){return!(!this.text||!this.diff)}getSelectedCode(){if(this.clearIfDiffDestroyed(),this.text&&this.diff){const e=this.side?this.side:"right",t=this.sublanguage||this.diff[`${e}Language`],s=this.diff[`${e}Indent`];let i=!1,r=_get(this,"diff",`${this.side}FileRev`,"original");return r||(i=!0,r=this.diff.rightFileRev.original),{text:this.text["text/plain"].replace(/(\r|\n|\r\n|\u2028|\u2029)$/,""),language:t,indent:s,fileKey:r.file.$key,revisionKey:r.$key,revisionBase:i,lineNumber:this.lineNumber}}}},null)}},!1,!0,{filename:"src/view/reviews/diff/textSelectionTracker.js"}),_reviewable.define(["draftFocusTracker"],["truss","bus","debug"],function(e,t,s){"use strict";return{draftFocusTracker:_declareVue("DraftFocusTrackerSingleton",class DraftFocusTrackerSingleton{constructor(){Vue.set(this,"focusedDraftKey",null),Vue.set(this,"focusedSuffix",null),Vue.set(this,"lastFocusedDraftScope",null)}focus(e,i){Vue.set(this,"focusedDraftKey",e),Vue.set(this,"focusedSuffix",i),s.focus&&console.log("focus draft",e,i),t.draftFocus(e,i)}shouldFocus(e,t){return this.focusedDraftKey===e&&(t?t===this.focusedSuffix:!this.focusedSuffix)}clearFocus(e){this.focusedDraftKey===e&&(Vue.set(this,"focusedDraftKey",null),Vue.set(this,"focusedSuffix",null),s.focus&&console.log("clear draft focus"))}setLastFocusedDraftScope(e){Vue.set(this,"lastFocusedDraftScope",e)}clearLastFocusedDraftScope(e){e&&this.lastFocusedDraftScope!==e||Vue.set(this,"lastFocusedDraftScope",null)}},null)}},!1,!0,{filename:"src/view/reviews/discussion/draftFocusTracker.js"}),_reviewable.define(["mangler"],["truss","config","shared"],function(e,t,s){"use strict";const i=/<a (.*?)href="https?:\/\/[^"/]*\/([\w.-]+)\/([\w.-]+)\/pull\/(\d+)"/g,r=/\s*(?:<hr\b[^>]*>\s*)?(<p\b(?![\s\S]*<p\b)[^>]*>[\s\S]*?<\/p>)\s*$/i,n=/(?:helpful|useful)\?\s+react\s+with\s+ð.*?ð/i,a=/{{\s*([A-Za-z_][A-Za-z0-9_]*)\s*}}/g,o=new Intl.Segmenter(void 0,{granularity:"grapheme"}),l="__setFallbackAvatar(this)",c=window.markdownit({html:!1,breaks:!0,linkify:!0});c.linkify.set({urlAuth:!0});const u=new TurndownService({bulletListMarker:"-",codeBlockStyle:"fenced",headingStyle:"atx"});u.use(TurndownPluginGfmService.gfm),u.addRule("enhanced-issue-copy",{filter:e=>_access(e,"","classList","","contains","call",["enhanced-issue-link"]),replacement:(e,t)=>
1{const s=_access(t,"","getElementsByClassName","call",["issue-shorthand"],"",0)||t;return s===t&&t.querySelectorAll("img.avatar").forEach(e=>e.remove()),s.textContent}});window.__setCanonicalSrc=function(e){const t=e.getAttribute("src"),s=e.getAttribute("data-canonical-src");t!==s&&(e.setAttribute("src",s),_access(e,"","parentNode","","getAttribute","call",["href"])===t&&e.parentNode.setAttribute("href",s))};return{mangler:_declareVue("ManglerSingleton",class ManglerSingleton{constructor(){Vue.set(this,"enhanceDiscussionComment",_.flow(this.removeReactionFooters,this.renderIssueLinks,this.pointPullRequestLinksToReviews,this.rebaseGitHubLinks,this.injectBrokenImageFallbacks))}splitTextIntoGraphemes(e){return Array.from(o.segment(e),({segment:e})=>e)}hash(e){e=e||"";let t=5381;for(let s=0;s<e.length;s++)t=(t<<5)-t+e.charCodeAt(s)|0;return"b"+t.toString(36)}renderUserTemplate(e,t){const s=e.replace(a,"");if(/{{|}}/.test(s))throw new Error("Unsupported template placeholder");return e.replace(a,(e,s)=>{if(!Object.prototype.hasOwnProperty.call(t,s)||void 0===t[s])throw new Error(`Missing context item: ${s}`);return null===t[s]?"":`${t[s]}`})}renderCustomEmojis(e,i){let r=0;if(i)for(let e=0;e<i.length;e++)r+=i.charCodeAt(e);const n=s.lgtbImages[r%s.lgtbImages.length];return function(e,t){let i="",r=0;for(const n of e.matchAll(s.commentCodeRegex))i+=t(e.slice(r,n.index))+n[0],r=n.index+n[0].length;return i+t(e.slice(r))}(e,e=>e.replace(/:(lgtm(|_strong|_cancel)):/gi,(e,s)=>`<img class="emoji" title="${e}" alt="${e}" align="absmiddle" src="${t.imageUrl}/${_.toLower(s)}.png" height="20" width="61"/>`).replace(/:lgtb:/gi,()=>`<img title="Looks Good to Bunny" alt=":lgtb:" src="${t.imageUrl}/${n}" height="200"/>`))}cleanNewlines(e){return e.replace(/\r\n/g,"\n").replace(/\r/g,"\n").replace(/\u2028|\u2029/g,"\n")}renderMarkdown(e){return c.render(_.trim(e||""))}renderLinks(e){return e.replace(/(!?)\[([^\]]+)\]\(([^)]+)\)/g,(e,t,s,i)=>t?e:`<a href="${i}" class="link" rel="noopener noreferrer">${s}</a>`)}findLastOpenCodeBlockFence(e){const t=/^ {0,3}(`{3,}|~{3,})(.*)/gm;let s,i;for(;s=t.exec(e);){const e=s[1],t=s[2]||"";i?i[0]===e[0]&&e.length>=i.length&&/^ *$/.test(t)&&(i=null):"~"!==e[0]&&/`/.test(t)||(i=e)}return i}renderOpenCodeBlocks(e){const t=this.findLastOpenCodeBlockFence(e);return t&&(e=e.replace(/\n*$/,`\n${t}\n`)),e}unrenderTaskListCheckboxes(e){return e.replace(/<input(?= )([^>]* type=['"]?checkbox['"]?(?= |>)[^>]*)>/gi,(e,t)=>_(t).split(" ").map(e=>_.toLower(_.trim(e).replace(/=(''|"")$/,""))).includes("checked")?'<i class="checked checkbox icon"></i>':'<i class="empty checkbox icon"></i>').replace(/<span class="handle[\s\S]*?<\/span>/g,"")}removeCodeAndQuotedBlocks(e){return e?e.replace(/\r\n/g,"\n").replace(/\r/g,"\n").replace(/\u2028|\u2029/g,"\n").replace(s.commentCodeRegex,"").replace(/(^|\n)\s*> [\s\S]*?(\n\s*(?=\n)|$)/g,"").replace(/(\[([^\\\]](\\.)?)*\])\([^)]*\)/g,"$1"):""}removeClipboardButton(e){return e.replace(/<div class="snippet-clipboard-content position-relative">/g,"").replace(/<div class="zeroclipboard-container[\s\S]*?<\/div>\s*<\/div>/g,"")}removeReactionFooters(e){return e?e.replace(r,(e,t)=>n.test(t)?"":e):e}renderVideo(e){return e.replace(/<a(.*?)href="http(.*?)(\.mp4|\.mov|\.qt)"(.*?)>(.*?)<\/a>/g,e=>{let t;const s=e.match(/"http(.*?)(\.mp4|\.mov|\.qt)"/);s&&(t=s[0].split("/").pop().replace('"',""));return`<details class="details-reset border rounded-2" open="">\n <summary class="px-3 py-2 border-bottom">\n <i class="video icon"></i>\n <span class="m-1" aria-label="Video description ${t}">\n ${t}\n </span>\n <span class="dropdown-caret"></span>\n </summary>\n <video class="d-block rounded-bottom-2 width-fit"\n muted="muted" controls="controls" src=${s}></video>\n </details>`})}instrumentDiscussionComment(e,t){const s=new Set;e.$observe(t,t=>{_.forEach(this.findPullRequestLinks(t),({owner:t,repo:i,prNumber:r})=>{const n=_ref(e.$store,"child","repositories",t,i,"pullRequests",r);s.has(n.path)||(s.add(n.path),e.$connect(n))})})}renderIssueLinks(e){return e?e.replace(/<a ((?:.*?)href="https?:\/\/[^"/]*\/([^/]+)\/([^/]+)\/(?:pull|issues)\/(\d+)"(?:.*?))>(.*?)<\/a>/g,this._enhanceIssueMatch).replace(/<a ((?:.*?)href="https?:\/\/[^"]*\/reviews\/([^/]+)\/([^/]+)\/(\d+)"(?:.*?))>(.*?)<\/a>/g,this._enhanceIssueMatch):e}
1_enhanceIssueMatch(e,t,s,i,r,n){if(!/^([\w-]+\/[\w-]+)?#\d+$/.test(n))return e;this.$store.services.completions.issues.fetchOne(s,i,r);const a=_access(this,"","$store","","services","","completions","","issues","","get","call",[s,i],"","index","",r);if(a){this.$store.services.avatars.connectUser(a.creatorKey);const e=_get(this,"$store","services","avatars","users",a.creatorKey,"scaledAvatarUrl");n=(e?`<img class="ui tiny user avatar image" src="${e}" fallback="${a.creatorKey}" onerror="${l}">`:"")+`<i class="${this.$options._base.options.filters.issueIconClass(a)}"></i> `+`<span class="issue-title">${_.escape(a.title)}</span> `+`<span class="issue-shorthand">${n}</span>`,/issue-link/.test(t)?t=t.replace(/issue-link/g,"enhanced-issue-link"):t+=' class="enhanced-issue-link"'}return`<a ${t}>${n}</a>`}findPullRequestLinks(e){const t=[];if(e)for(const s of e.matchAll(i))t.push({owner:_.toLower(s[2]),repo:_.toLower(s[3]),prNumber:_.parseInt(s[4])});return t}pointPullRequestLinksToReviews(t){return t?t.replace(i,(t,s,i,r,n)=>_ref(e,"child","store","repositories",_.toLower(i),_.toLower(r),"pullRequests",_.parseInt(n)).value?`<a ${s}href="${location.origin}/reviews/${i}/${r}/${n}"`:t):t}rebaseGitHubLinks(e){return e?e.replace(/<a (?:.*?)href="\/([^/]+)\/([^/]+)\/commit/g,e=>e.replace(/href="/,`href="${t.gitHubUrl}`)):e}convertHtmlToMarkdown(e){return e?u.turndown(e):e}get brokenImageErrorCallback(){return"__setCanonicalSrc(this)"}get fallbackAvatarErrorCallback(){return l}injectBrokenImageFallbacks(e){if(!e)return e;return e.replace(/<img [^>]*data-canonical-src=/g,e=>e.replace(/data-canonical-src=/g,`onerror="${this.brokenImageErrorCallback}" data-canonical-src=`))}},null)}},!1,!0,{filename:"src/view/reviews/discussion/mangler.js"}),_reviewable.define(["Uploader"],["config","truss"],function(e,t){"use strict";const s={".mov":"video/quicktime"};return{Uploader:class Uploader{constructor(e,s,i){Vue.set(this,"_draft",e),Vue.set(this,"_textarea",s),Vue.set(this,"_progress",i),Vue.set(this,"_uploads",[]),Vue.set(this,"_unwatch",t.observe(()=>this._draft.markdownBody,()=>{this._checkTextForSlugs()}))}add(t){if(e.uploadsAllowed&&_get(t,"file"))return this._uploads.push(t),this._updateMimeType(t),this._insertSlug(t),this._upload(t),t}_insertSlug(e){this._textarea.setSelectionRange(this._textarea.selectionEnd,this._textarea.selectionEnd);let t=this._textarea.value,s="",i="",r="",n="";t&&(s=t.slice(0,this._textarea.selectionStart),i=t.slice(this._textarea.selectionEnd)),s&&!_.endsWith(s,"\n")&&(r="\n"),i&&_.startsWith(i,"\n")||(n="\n"),/^image\//.test(e.file.type)&&(r+="!");let a=0;do{e.file.name?(Vue.set(e,"slugName",e.file.name.replace(/[*_/()[\]<>]/g,"\\$&")),a&&Vue.set(e,"slugName",e.slugName.replace(/(\.[^.]*)?$/,` copy ${a}$&`))):Vue.set(e,"slugName","â-"+(a+1)),Vue.set(e,"slugRegex",new RegExp("(!?)\\["+e.slugName.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")+"\\]\\([^)]*\\)")),a++}while(e.slugRegex.test(t));e.file.name||Vue.set(e.file,"name",e.slugName),t=s+r+"["+e.slugName+"](Preparing...)"+n+i;const o=t.length-i.length;Vue.set(this._textarea,"value",t),this._textarea.model&&Vue.set(this._textarea.model,"text",t),this._textarea.setSelectionRange(o,o)}_checkTextForSlugs(){const e=this._textarea.value;_.every(this._uploads,t=>t.slugRegex.test(e))||_.forEach(_.clone(this._uploads),t=>{t.slugRegex.test(e)||this.cancel(t)})}_updateSlug(e,t){let s=this._textarea.value;const i=s.match(e.slugRegex);if(!i)return void this.cancel(e);let r=this._textarea.selectionStart,n=this._textarea.selectionEnd;n<=i.index||(r>=i.index+i[0].length?(r-=s.length+1,n-=s.length+1):r=n=i.index+i[0].length-s.length-1);const a=t?`$1[${e.slugName.replace(/\$/,"$$")}](${t.replace(/\$/,"$$")})`:"";s=s.replace(e.slugRegex,a),Vue.set(this._textarea,"value",s),this._textarea.model&&Vue.set(this._textarea.model,"text",s),r<0&&(r+=s.length+1),n<0&&(n+=s.length+1),this._textarea.setSelectionRange(r,n)}_updateMimeType(e){if(!e.file.type){const t=e.file.name.match(/\.(mov)$/),i=e.file.name;Vue.set(e,"file",e.file.slice(0,e.file.size,s[_get(t,0)]||"application/octet-stream")),Vue.set(e.file,"name",i)}}_upload(e){Vue.set(e,"size",e.file.size),Vue.set(e,"loaded",0),this._updateProgress(),Promise.resolve().then(()=>t.store.queues.requests.send({action:"upload",type:e.file.type,fileName:e.file.name,size:e.file.size,ownerName:this._draft.review.core.ownerName})).then(t=>{if(e.done)return;this._updateSlug(e,"Uploading...");const s=_(t.upload.form||{}).defaults({file:e.file}).reduce((e,t,s)=>t?(_.isDate(t)&&(t=t.toISOString()),_.isString(t)?e.append(s,t):t instanceof window.Blob||t.flashId&&t.name&&t.size?e.append(s,t,t.name):e.append(s,t),e):e,new FormData);return new Promise((i,r)=>{const n=new XMLHttpRequest;n.open(_.toUpper(t.upload.method),t.upload.url),_.forEach(t.upload.headers,(e,t)=>n.setRequestHeader(t,e)),Vue.set(n.upload,"onprogress",t=>{Vue.set(e,"size",t.total),Vue.set(e,"loaded",t.loaded),this._updateProgress()}),Vue.set(n,"onload",()=>{n.status>=200&&n.status<300?i():r(new Error(`Error: ${n.status} ${n.statusText}`))}),Vue.set(n,"onerror",()=>r(new Error(n.statusText||"Network error"))),n.send(s)}).then(()=>{e.done||this._updateSlug(e,t.download.url.replace(/[()]/g,e=>"%"+e.charCodeAt(0).toString(16)))},t=>{if(!e.done)return Promise.reject(t)})}).catch(t=>{this.cancel(e,`Failed to upload ${e.file.name}: ${t.message.replace(/^Error: /,"")}`)}).finally(()=>{Vue.set(e,"done",!0),this._updateProgress()})}_updateProgress(){let e=0,t=0,s=!0;_.forEach(this._uploads,i=>{i.done||(s=!1),e+=i.size,t+=i.loaded}),Vue.set(this._draft,"uploading",!s),s?Vue.set(this,"_uploads",[]):this._progress.updateUploadProgress(t/e)}destroy(){this._unwatch(),_.forEach(_.clone(this._uploads),e=>{this.cancel(e)})}cancel(e,t){e.done||(Vue.set(e,"done",!0),e.uploadPromise&&e.uploadPromise.abort(),this._updateSlug(e,null),_.pull(this._uploads,e),this._progress.reportUploadError(t||"Aborted upload of "+e.file.name),this._updateProgress())}}}},!1,!0,{filename:"src/view/reviews/discussion/Uploader.js"}),function(){function e(){window._reviewable.run()}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}(); 2//# sourceMappingURL=fa471dd8.app.js.map
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.