-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathchunk-RN5QURGB.js
2 lines (2 loc) · 79.8 KB
/
chunk-RN5QURGB.js
1
2
import{a as Ue,b as ze,c as qe,d as Je,f as Ze,g as tn}from"./chunk-IE5R4FUJ.js";import{a as $e}from"./chunk-QDRJUJZO.js";import{b as Mt}from"./chunk-IUBBKFGF.js";import{a as Dt,b as He,c as Ne,d as Ae,e as We,f as Lt}from"./chunk-BFFABMML.js";import{a as Rt,b as jt}from"./chunk-Z2EVLKY2.js";import{a as Ee,b as Be}from"./chunk-SBGTKGAT.js";import{b as Fe,f as Re,g as je,t as De}from"./chunk-PBIPOVA6.js";import{a as Ke,b as Xe}from"./chunk-ZEWFEKQO.js";import{b as At,c as Ge,d as Qe,e as Ye,g as Wt}from"./chunk-PLK467K7.js";import{a as Ht,b as Nt}from"./chunk-CKVNK6TM.js";import{a as Le,b as $t}from"./chunk-ZRFPTSRT.js";import{f as Ft,g as Pt}from"./chunk-SPZX4ZIV.js";import{e as dt,f as mt,h as ut}from"./chunk-XMS2QGS2.js";import{a as Ot,b as Vt}from"./chunk-VUGLQQQX.js";import{f as _t,g as st}from"./chunk-DL6SABIV.js";import{n as pt,t as rt}from"./chunk-JR4OZW53.js";import{a as kt,b as Pe,c as ct}from"./chunk-4JHZ4AP3.js";import{$ as E,Ab as x,Ba as r,Bb as k,Cb as gt,Cd as Ve,D as le,Db as M,E as ae,Ea as m,Ga as xt,Ha as ce,Hc as I,Ia as O,Ib as xe,Ja as c,Jc as S,Ka as Tt,Lb as ge,Ld as Bt,Ma as L,Na as H,Nb as Xt,Nc as Z,Nd as X,O as pe,Oa as _,Pa as s,Qa as f,Qb as Se,Qc as yt,S as P,Sc as ke,T as et,Ta as R,Ua as F,Uc as K,Va as B,W as $,Wa as l,Wc as tt,Yb as ve,Zb as he,_ as w,_b as be,ba as bt,bb as de,cb as me,d as ne,db as h,eb as v,fb as T,gb as j,ha as _e,hc as Ie,hd as Gt,ia as qt,ib as nt,ic as Te,jb as it,kb as ot,lb as ue,lc as ye,m as ie,ma as se,mb as Ce,nb as fe,nd as Qt,oc as we,od as Me,pb as lt,qa as p,qb as Y,qd as Oe,sb as z,sd as wt,tb as Kt,td as Et,v as oe,wd as A,xa as Jt,ya as re,yb as at,yd as St,za as It,zb as d}from"./chunk-YDUZY7N5.js";import{f as gn,h as Sn,j as ee}from"./chunk-TWZW5B45.js";var en=gn((Yt,Zt)=>{"use strict";(function(e,o){typeof define=="function"&&define.amd?define([],o):typeof Yt<"u"?o():(o(),e.FileSaver={})})(Yt,function(){"use strict";function e(C,g){return typeof g>"u"?g={autoBom:!1}:typeof g!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),g={autoBom:!g}),g.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(C.type)?new Blob(["\uFEFF",C],{type:C.type}):C}function o(C,g,y){var b=new XMLHttpRequest;b.open("GET",C),b.responseType="blob",b.onload=function(){u(b.response,g,y)},b.onerror=function(){console.error("could not download file")},b.send()}function t(C){var g=new XMLHttpRequest;g.open("HEAD",C,!1);try{g.send()}catch{}return 200<=g.status&&299>=g.status}function n(C){try{C.dispatchEvent(new MouseEvent("click"))}catch{var g=document.createEvent("MouseEvents");g.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),C.dispatchEvent(g)}}var i=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,a=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=i.saveAs||(typeof window!="object"||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(C,g,y){var b=i.URL||i.webkitURL,V=document.createElement("a");g=g||C.name||"download",V.download=g,V.rel="noopener",typeof C=="string"?(V.href=C,V.origin===location.origin?n(V):t(V.href)?o(C,g,y):n(V,V.target="_blank")):(V.href=b.createObjectURL(C),setTimeout(function(){b.revokeObjectURL(V.href)},4e4),setTimeout(function(){n(V)},0))}:"msSaveOrOpenBlob"in navigator?function(C,g,y){if(g=g||C.name||"download",typeof C!="string")navigator.msSaveOrOpenBlob(e(C,y),g);else if(t(C))o(C,g,y);else{var b=document.createElement("a");b.href=C,b.target="_blank",setTimeout(function(){n(b)})}}:function(C,g,y,b){if(b=b||open("","_blank"),b&&(b.document.title=b.document.body.innerText="downloading..."),typeof C=="string")return o(C,g,y);var V=C.type==="application/octet-stream",D=/constructor/i.test(i.HTMLElement)||i.safari,W=/CriOS\/[\d]+/.test(navigator.userAgent);if((W||V&&D||a)&&typeof FileReader<"u"){var N=new FileReader;N.onloadend=function(){var Q=N.result;Q=W?Q:Q.replace(/^data:[^;]*;/,"data:attachment/file;"),b?b.location.href=Q:location=Q,b=null},N.readAsDataURL(C)}else{var G=i.URL||i.webkitURL,ft=G.createObjectURL(C);b?b.location=ft:location.href=ft,b=null,setTimeout(function(){G.revokeObjectURL(ft)},4e4)}});i.saveAs=u.saveAs=u,typeof Zt<"u"&&(Zt.exports=u)})});var te=Sn(en());var vn="text/csv;charset=UTF-8",hn=".csv",bn="text/json;charset=UTF-8",In=".json",Tn=["Item","Items","Surplus","Inputs","Outputs","Targets","Belts","Belt","Wagons","Wagon","Recipe","Machines","Machine","Modules","Beacons","Power","Pollution"],nn=(()=>{class e{constructor(){this.itemsSvc=P(kt),this.recipeSvc=P(Bt),this.recipesSvc=P(ct),this.settingsSvc=P(X),this.itemsState=this.itemsSvc.settings,this.recipesState=this.recipesSvc.settings,this.columnsState=this.settingsSvc.columnsState,this.data=this.recipesSvc.adjustedDataset}stepsToCsv(t){let n=t.map(u=>this.stepToJson(u,t)),i=Tn.filter(u=>n.some(C=>C[u]!=null)),a=n.map(u=>i.map(C=>u[C]).join(","));a.unshift(i.join(",")),a.unshift(`"${window.location.href}"`),this.saveAsCsv(a.join(`\r
`),"factoriolab_list")}flowToJson(t){this.saveAsJson(JSON.stringify(t),"factoriolab_flow")}saveAsCsv(t,n){(0,te.saveAs)(new Blob([t],{type:vn}),n+hn)}saveAsJson(t,n){(0,te.saveAs)(new Blob([t],{type:bn}),n+In)}stepToJson(t,n){let i=this.columnsState(),a=this.itemsState(),u=this.recipesState(),C=this.data(),g={};if(t.itemId!=null){g.Item=t.itemId;let y=a[t.itemId];t.items!=null&&(g.Items="="+t.items.sub(t.surplus??S.zero).toString()),t.surplus!=null&&(g.Surplus="="+t.surplus.toString()),i.belts.show&&(t.belts!=null&&(g.Belts="="+t.belts.toString()),g.Belt=y.beltId),i.wagons.show&&(t.wagons!=null&&(g.Wagons="="+t.wagons.toString()),g.Wagon=y.wagonId)}if(t.recipeId!=null){g.Recipe=t.recipeId;let y=C.adjustedRecipe[t.recipeId],b=u[t.recipeId],V=Object.keys(y.in).map(D=>{let W=n.find(N=>N.itemId===D);return[D,W?.parents?.[t.id]?.toString()??""]}).filter(D=>D[1]).map(D=>`${D[0]}:${D[1]}`).join(",");if(V&&(g.Inputs=`"${V}"`),b.machineId!=null){let D=C.machineEntities[b.machineId],W=this.recipeSvc.allowsModules(y,D);i.machines.show&&(t.machines!=null&&(g.Machines="="+t.machines.toString()),g.Machine=b.machineId,W&&b.modules!=null&&(g.Modules=`"${b.modules.filter(yt("count","id")).map(N=>`${N.count.toString()} ${N.id}`).join(",")}"`)),i.beacons.show&&W&&(g.Beacons=`"${Z(b.beacons?.map(N=>`${Z(N.count?.toString(),"")} ${Z(N.id,"")} (${Z(N.modules?.filter(yt("count","id")).map(G=>`${G.count.toString()} ${G.id}`).join(","),"")})`).join(","),"")}"`),i.power.show&&t.power!=null&&(g.Power="="+t.power.toString()),i.pollution.show&&t.pollution!=null&&(g.Pollution="="+t.pollution.toString())}}if(t.outputs!=null){let y=t.outputs,b=Object.keys(y).map(V=>`${V}:${y[V].toString()}`).join(",");g.Outputs=`"${b}"`}if(t.parents!=null){let y=t.parents,b=Object.keys(y).map(V=>n.find(D=>D.id===V)).filter(ke).filter(yt("recipeId")).map(V=>`${V.recipeId}:${y[V.id].toString()}`).join(",");g.Targets=`"${b}"`}return g}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275prov=pe({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var on=(()=>{class e{transform(t){return t}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275pipe=$({name:"asStep",type:e,pure:!0,standalone:!0})}}return e})();var ln={[St.Chest]:{[A.Capacity0]:[{id:I.Inserter,value:S(.83)},{id:I.LongHandedInserter,value:S(1.2)},{id:I.FastInserter,value:S(2.31)},{id:I.BulkInserter,value:S(4.62)}],[A.Capacity2]:[{id:I.Inserter,value:S(1.67)},{id:I.LongHandedInserter,value:S(2.4)},{id:I.FastInserter,value:S(4.62)},{id:I.BulkInserter,value:S(9.23)}],[A.Capacity7]:[{id:I.Inserter,value:S(2.5)},{id:I.LongHandedInserter,value:S(3.6)},{id:I.FastInserter,value:S(6.92)},{id:I.BulkInserter,value:S(27.69)}]},[St.ExpressTransportBelt]:{[A.Capacity0]:[{id:I.Inserter,value:S(.83)},{id:I.LongHandedInserter,value:S(1.2)},{id:I.FastInserter,value:S(2.31)},{id:I.BulkInserter,value:S(4.44)}],[A.Capacity2]:[{id:I.Inserter,value:S(1.64)},{id:I.LongHandedInserter,value:S(2.35)},{id:I.FastInserter,value:S(4.44)},{id:I.BulkInserter,value:S(7.74)}],[A.Capacity7]:[{id:I.Inserter,value:S(2.43)},{id:I.LongHandedInserter,value:S(3.46)},{id:I.FastInserter,value:S(6.43)},{id:I.BulkInserter,value:S(13.85)}]},[St.FastTransportBelt]:{[A.Capacity0]:[{id:I.Inserter,value:S(.83)},{id:I.LongHandedInserter,value:S(1.2)},{id:I.FastInserter,value:S(2.31)},{id:I.BulkInserter,value:S(4.44)}],[A.Capacity2]:[{id:I.Inserter,value:S(1.64)},{id:I.LongHandedInserter,value:S(2.35)},{id:I.FastInserter,value:S(4.44)},{id:I.BulkInserter,value:S(7.06)}],[A.Capacity7]:[{id:I.Inserter,value:S(2.37)},{id:I.LongHandedInserter,value:S(3.33)},{id:I.FastInserter,value:S(6)},{id:I.BulkInserter,value:S(10.91)}]},[St.TransportBelt]:{[A.Capacity0]:[{id:I.Inserter,value:S(.83)},{id:I.LongHandedInserter,value:S(1.2)},{id:I.FastInserter,value:S(2.31)},{id:I.BulkInserter,value:S(4.44)}],[A.Capacity2]:[{id:I.Inserter,value:S(1.64)},{id:I.LongHandedInserter,value:S(2.35)},{id:I.FastInserter,value:S(4.44)},{id:I.BulkInserter,value:S(5.71)}],[A.Capacity7]:[{id:I.Inserter,value:S(2.25)},{id:I.LongHandedInserter,value:S(3.1)},{id:I.FastInserter,value:S(5.29)},{id:I.BulkInserter,value:S(6.79)}]}};var an=(()=>{class e{transform(t,n){if(t!=null){let i=ln[n.inserterTarget][n.inserterCapacity]?.find(a=>a.value.gt(t)||a.id===I.BulkInserter);return i==null?null:{id:i.id,value:t.div(i.value)}}return null}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275pipe=$({name:"inserterSpeed",type:e,pure:!0,standalone:!0})}}return e})();var pn=(()=>{class e{transform(t){return t==null?"":" ".repeat(4-t.length)+t}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275pipe=$({name:"leftPad",type:e,pure:!0,standalone:!0})}}return e})();var q=(()=>{class e{static transform(t,n){if(n==null)return t.toFraction();if(n===-2)return Math.round(t.mul(S(100n)).toNumber()).toString();let a=t.toPrecision(n).toString();if(n>0){let u=S(1,Math.pow(10,n));t.gt(S.zero)&&t.lt(u)&&(a=`<${a}`);let C=a.split(".");if(C.length>1){if(C[1].length<n){let g=n-C[1].length;return a+"0".repeat(g)}}else return t.isInteger()?a+" ".repeat(n+1):a+"."+"0".repeat(n)}return a}transform(t,n){return e.transform(t,n)}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275pipe=$({name:"rate",type:e,pure:!0,standalone:!0})}}return e})();var _n=(()=>{class e{transform(t,n,i){return i===I.Pumpjack?`${q.transform(t.mul(S(100n)),n!=null?Math.max(n-2,0):n)}%`:q.transform(t,n)}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275pipe=$({name:"machineRate",type:e,pure:!0,standalone:!0})}}return e})();var sn=(()=>{class e{transform(t,n,i){switch(i){case Gt.GW:return`${q.transform(t.div(S(1000000n)),n)} GW`;case Gt.MW:return`${q.transform(t.div(S(1000n)),n)} MW`;default:return`${q.transform(t,n)} kW`}}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275pipe=$({name:"power",type:e,pure:!0,standalone:!0})}}return e})();var rn=(()=>{class e{constructor(){this.recipesSvc=P(ct),this.routerSvc=P(Mt),this.data=this.recipesSvc.adjustedDataset}transform(t,n){return ee(this,null,function*(){let i=t;if(i.recipeId){let a=this.data().adjustedRecipe[i.recipeId];a?.flags.has("technology")&&t.items&&(i=K(t,{items:t.items.div(a.effects.productivity)}))}return this.routerSvc.stepHref(i,n,this.data().hash)})}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275pipe=$({name:"stepHref",type:e,pure:!0,standalone:!0})}}return e})();var vt=(()=>{class e{static transform(t){return t.itemId??t.recipeObjectiveId??t.recipeId??t.id}transform(t){return e.transform(t)}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275pipe=$({name:"stepId",type:e,pure:!0,standalone:!0})}}return e})();function En(e,o){if(e&1&&(_(0,"div",13),f(1,"i"),d(2,"iconSmClass"),s()),e&2){let t=o.$implicit;p(),O(x(2,2,t.value))}}function Bn(e,o){if(e&1&&f(0,"lab-tooltip",16),e&2){let t=l().$implicit;m("id",t.value)}}function kn(e,o){if(e&1&&(_(0,"div",14),f(1,"i"),d(2,"iconSmClass"),_(3,"div",15),v(4),s(),r(5,Bn,1,1,"ng-template",null,0,M),s()),e&2){let t=o.$implicit,n=h(6);m("pTooltip",n),p(),O(x(2,4,t.value)),p(3),j(" ",t.label," ")}}function Mn(e,o){if(e&1&&f(0,"lab-tooltip",16),e&2){let t=l();m("id",t)}}function On(e,o){if(e&1){let t=F();_(0,"p-dropdown",10),B("onChange",function(i){w(t);let a=l(2);return E(a.setBelt(i.value))}),r(1,En,3,4,"ng-template",11)(2,kn,7,6,"ng-template",12)(3,Mn,1,1,"ng-template",null,0,M),s()}if(e&2){let t=h(4),n=l(2);m("pTooltip",t)("ngModel",o)("options",n.options().belts)}}function Vn(e,o){if(e&1){let t=F();_(0,"lab-input-number",8),d(1,"translate"),B("setValue",function(i){w(t);let a=l();return E(a.setStack(i))}),s(),r(2,On,5,3,"p-dropdown",9)}if(e&2){let t,n,i=o,a=l();m("pTooltip",x(1,5,"beltOverlay.stackTooltip"))("value",(t=i==null?null:i.stack)!==null&&t!==void 0?t:a.rational.one)("minimum",a.rational.one)("maximum",a.maximum()),p(2),c((n=i.beltId)?2:-1,n)}}var un=(()=>{class e extends We{constructor(){super(...arguments),this.settingsSvc=P(X),this.setValue=_e(),this.maximum=Jt(S.zero),this.settings=Jt(void 0),this.options=this.settingsSvc.options,this.rational=S}show(t,n,i){this.settings.set(K(i)),this.maximum.set(n),this._show(t)}setStack(t){this.settings.update(n=>K(n,{stack:t}))}setBelt(t){this.settings.update(n=>K(n,{beltId:t}))}save(){let t=this.settings();t!=null&&this.setValue.emit(t)}static{this.\u0275fac=(()=>{let t;return function(i){return(t||(t=bt(e)))(i||e)}})()}static{this.\u0275cmp=et({type:e,selectors:[["lab-belt-overlay"]],outputs:{setValue:"setValue"},standalone:!0,features:[It,lt],decls:10,vars:7,consts:[["tooltip",""],["appendTo","body",3,"onHide"],[1,"d-flex","flex-column","gap-2"],[1,"d-flex","flex-column"],[1,"p-inputgroup"],[1,"d-flex","gap-2"],["pButton","","pRipple","","type","button","icon","fa-solid fa-check",1,"p-button-outlined","p-button-sm","flex-grow-1",3,"click","label"],["pButton","","pRipple","","type","button","icon","fa-solid fa-xmark",1,"p-button-outlined","p-button-sm","p-button-secondary","flex-grow-1",3,"click","label"],["width","3rem","tooltipPosition","top",3,"setValue","pTooltip","value","minimum","maximum"],["labDropdownBase","icon",3,"pTooltip","ngModel","options"],["labDropdownBase","icon",3,"onChange","pTooltip","ngModel","options"],["pTemplate","selectedItem"],["pTemplate","item"],[1,"d-flex"],[1,"d-flex","align-items-center","py-2","w-100","h-100",3,"pTooltip"],[1,"ms-3","text-truncate"],["type","belt",3,"id"]],template:function(n,i){if(n&1&&(_(0,"p-overlayPanel",1),B("onHide",function(){return i.onHide()}),_(1,"div",2)(2,"div",3)(3,"div",4),r(4,Vn,3,7),s()(),_(5,"div",5)(6,"button",6),d(7,"translate"),B("click",function(){return i.hide()}),s(),_(8,"button",7),d(9,"translate"),B("click",function(){return i.hide(!0)}),s()()()()),n&2){let a;p(4),c((a=i.settings())?4:-1,a),p(2),m("label",x(7,3,"ok")),p(2),m("label",x(9,5,"cancel"))}},dependencies:[ut,dt,mt,st,_t,pt,Pt,Ft,Ne,He,Vt,Ot,Dt,$t,$e,Lt,rt],encapsulation:2,changeDetection:0})}}return e})();var Ut=class e{static{this.value=S(1n,3n)}transform(o){return o==null?e.value.toFraction():e.value.toPrecision(o).toString()}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275pipe=$({name:"precisionExample",type:e,pure:!0,standalone:!0})}};var jn=()=>({width:"400px"}),Dn=()=>({"400px":"100vw"});function $n(e,o){e&1&&(_(0,"tr")(1,"th"),v(2),d(3,"translate"),s(),_(4,"th"),v(5),d(6,"translate"),s(),_(7,"th"),v(8),d(9,"translate"),s(),_(10,"th"),v(11),d(12,"translate"),s()()),e&2&&(p(2),T(x(3,4,"columns.visibility")),p(3),T(x(6,6,"columns.decimals")),p(3),T(x(9,8,"columns.fractions")),p(3),T(x(12,10,"columns.example")))}function Ln(e,o){if(e&1){let t=F();_(0,"td")(1,"p-inputNumber",7),ot("ngModelChange",function(i){w(t);let a=l().$implicit,u=l();return it(u.editValue[a.value].precision,i)||(u.editValue[a.value].precision=i),E(i)}),s()(),_(2,"td",8)(3,"p-checkbox",9),B("onChange",function(i){w(t);let a=l().$implicit,u=l();return E(u.changeFraction(i.checked,a.value))}),s()(),_(4,"td"),v(5),d(6,"precisionExample"),s()}if(e&2){let t=l().$implicit,n=l();p(),m("min",0)("size",1)("showButtons",!0)("disabled",!n.editValue[t.value].show),nt("ngModel",n.editValue[t.value].precision),p(2),m("ngModel",n.editValue[t.value].precision==null)("binary",!0)("disabled",!n.editValue[t.value].show),p(2),j(" ",x(6,9,n.editValue[t.value].precision)," ")}}function Hn(e,o){e&1&&(_(0,"td",6)(1,"div",10),v(2),d(3,"translate"),s()()),e&2&&(p(2),T(x(3,1,"columns.notApplicable")))}function Nn(e,o){if(e&1){let t=F();_(0,"tr")(1,"td")(2,"p-checkbox",5),d(3,"translate"),ot("ngModelChange",function(i){let a=w(t).$implicit,u=l();return it(u.editValue[a.value].show,i)||(u.editValue[a.value].show=i),E(i)}),s()(),r(4,Ln,7,11)(5,Hn,4,3,"td",6),s()}if(e&2){let t=o.$implicit,n=l();p(2),nt("ngModel",n.editValue[t.value].show),m("binary",!0)("label",x(3,5,t.label))("disabled",t.disabled),p(2),c(n.columnsInf[t.value].hasPrecision?4:5)}}function An(e,o){if(e&1){let t=F();_(0,"button",14),d(1,"translate"),B("click",function(){w(t);let i=l(2);return E(i.reset())}),s()}e&2&&m("label",x(1,1,"reset"))}function Wn(e,o){if(e&1){let t=F();r(0,An,2,3,"button",11),_(1,"button",12),d(2,"translate"),B("click",function(){w(t);let i=l();return E(i.hide())}),s(),_(3,"button",13),d(4,"translate"),B("click",function(){w(t);let i=l();return E(i.hide(!0))}),s()}if(e&2){let t=l();c(t.modified?0:-1),p(),m("label",x(2,3,"ok")),p(2),m("label",x(4,5,"cancel"))}}var Cn=(()=>{class e extends Ae{constructor(){super(...arguments),this.preferencesSvc=P(Et),this.settingsSvc=P(X),this.columnOptions=this.settingsSvc.columnOptions,this.editValue=Me,this.columnsInf=Qt}get modified(){return Object.keys(this.editValue).some(t=>this.editValue[t].precision!==wt.columns[t].precision||this.editValue[t].show!==wt.columns[t].show)}initEdit(t){this.editValue=Object.keys(t).filter(n=>Qt[n]!=null).reduce((n,i)=>(n[i]=K(t[i]),n),{})}open(t){this.initEdit(t),this.show()}changeFraction(t,n){this.editValue[n].precision=t?null:1}reset(){this.initEdit(wt.columns)}save(){let t=this.editValue;this.preferencesSvc.apply({columns:t})}static{this.\u0275fac=(()=>{let t;return function(i){return(t||(t=bt(e)))(i||e)}})()}static{this.\u0275cmp=et({type:e,selectors:[["lab-columns"]],standalone:!0,features:[It,lt],decls:6,vars:15,consts:[["appendTo","body",3,"visibleChange","onHide","visible","modal","dismissableMask","draggable","resizable","focusOnShow","breakpoints","header"],["responsiveLayout","scroll","styleClass","p-datatable-sm",3,"value"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[3,"ngModelChange","ngModel","binary","label","disabled"],["colspan","3",1,"text-center"],["styleClass","w-100","inputStyleClass","text-end",1,"w-100",3,"ngModelChange","min","size","showButtons","disabled","ngModel"],[1,"text-center"],[3,"onChange","ngModel","binary","disabled"],[1,"p-2"],["pButton","","pRipple","","type","button","icon","fa-solid fa-rotate-left",1,"p-button-outlined",3,"label"],["pButton","","pRipple","","type","button","icon","fa-solid fa-check",1,"p-button-outlined",3,"click","label"],["pButton","","pRipple","","type","button","icon","fa-solid fa-xmark",1,"p-button-outlined","p-button-secondary",3,"click","label"],["pButton","","pRipple","","type","button","icon","fa-solid fa-rotate-left",1,"p-button-outlined",3,"click","label"]],template:function(n,i){n&1&&(_(0,"p-dialog",0),d(1,"translate"),ot("visibleChange",function(u){return it(i.visible,u)||(i.visible=u),u}),B("onHide",function(){return i.onHide()}),_(2,"p-table",1),r(3,$n,13,12,"ng-template",2)(4,Nn,6,7,"ng-template",3),s(),r(5,Wn,5,7,"ng-template",4),s()),n&2&&(ce(Y(13,jn)),nt("visible",i.visible),m("modal",!0)("dismissableMask",!0)("draggable",!1)("resizable",!1)("focusOnShow",!1)("breakpoints",Y(14,Dn))("header",x(1,11,"columns.header")),p(2),m("value",i.columnOptions()))},dependencies:[ut,dt,mt,st,_t,pt,jt,Rt,Be,Ee,Nt,Ht,Wt,At,Ut,rt],styles:["th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{width:115px}[_nghost-%COMP%] .p-dialog-content{padding-bottom:1rem}"],changeDetection:0})}}return e})();var Un=["stepsTable"],zt=(e,o)=>o.id,J=(e,o)=>o.key,zn=()=>[25,50,100,1e3],fn=()=>[],qn=(e,o,t,n,i,a,u,C,g,y,b,V,D)=>({items:e,itemId:o,belts:t,beltId:n,wagons:i,wagonId:a,machines:u,machineId:C,recipeId:g,recipeObjectiveId:y,percent:b,percentOnDest:!0,destId:V,inputs:D}),Jn=(e,o,t,n,i,a,u,C,g,y,b,V,D,W)=>({items:e,itemId:o,belts:t,beltId:n,wagons:i,wagonId:a,machines:u,machineId:C,recipeId:g,recipeObjectiveId:y,percent:b,destId:V,destRecipeObjectiveId:D,destIsRecipe:!0,outputs:W}),Kn=(e,o)=>({items:e,itemId:o}),Xn=(e,o,t,n,i,a,u,C,g,y,b,V,D)=>({items:e,itemId:o,belts:t,beltId:n,wagons:i,wagonId:a,machines:u,machineId:C,recipeId:g,recipeObjectiveId:y,percent:b,destId:V,destRecipeObjectiveId:D,destIsRecipe:!0}),Gn=(e,o,t,n,i,a,u,C,g)=>({items:e,itemId:o,belts:t,beltId:n,wagons:i,wagonId:a,percent:u,destId:C,destRecipeObjectiveId:g,destIsRecipe:!0}),Qn=(e,o,t,n,i,a,u,C,g,y,b,V,D)=>({items:e,itemId:o,belts:t,beltId:n,wagons:i,wagonId:a,machines:u,machineId:C,recipeId:g,recipeObjectiveId:y,percent:b,percentOnDest:!0,destId:V,destRecipeObjectiveId:D}),Ct=(e,o)=>({value:e,itemId:o}),Yn=(e,o)=>({columnSettings:e,totals:o,type:"belt"}),Zn=(e,o)=>({columnSettings:e,totals:o}),ti=(e,o,t)=>({columnSettings:e,totals:o,modulesTotals:t,type:"machine"}),ei=(e,o,t)=>({columnSettings:e,totals:o,modulesTotals:t,type:"beacon"});function ni(e,o){if(e&1){let t=F();_(0,"button",38),d(1,"translate"),B("click",function(){w(t);let i=l(2);return E(i.exportSvc.stepsToCsv(i.steps()))}),s()}e&2&&m("label",x(1,1,"steps.downloadAsCsv"))}function ii(e,o){if(e&1){let t=F();_(0,"button",41),d(1,"translate"),B("click",function(){w(t);let i=l(3);return E(i.resetChecked())}),s()}e&2&&m("pTooltip",x(1,1,"steps.checkedUndoTooltip"))}function oi(e,o){if(e&1&&(_(0,"th")(1,"div",39),f(2,"i",40),r(3,ii,2,3,"button",30),s()()),e&2){let t=l(2);p(3),c(t.settings().checkedItemIds.size||t.settings().checkedRecipeIds.size||t.settings().checkedObjectiveIds.size?3:-1)}}function li(e,o){e&1&&(_(0,"th"),v(1),d(2,"translate"),s()),e&2&&(p(),T(x(2,1,"options.column.tree")))}function ai(e,o){e&1&&f(0,"p-sortIcon",29)}function pi(e,o){if(e&1){let t=F();_(0,"button",41),d(1,"translate"),B("click",function(i){w(t);let a=l(2);return E(a.resetExcludedItems(i))}),s()}e&2&&m("pTooltip",x(1,1,"steps.itemsUndoTooltip"))}function _i(e,o){e&1&&f(0,"p-sortIcon",42)}function si(e,o){if(e&1){let t=F();_(0,"button",41),d(1,"translate"),B("click",function(i){w(t);let a=l(3);return E(a.resetBelts(i))}),s()}e&2&&m("pTooltip",x(1,1,"steps.beltsUndoTooltip"))}function ri(e,o){if(e&1&&(_(0,"th",31)(1,"div",28)(2,"span"),v(3),d(4,"translate"),s(),r(5,_i,1,0,"p-sortIcon",42)(6,si,2,3,"button",30),s()()),e&2){let t=l(2);p(3),T(x(4,3,"options.column.belts")),p(2),c(t.focus()?-1:5),p(),c(t.itemsModified().belts?6:-1)}}function ci(e,o){e&1&&f(0,"p-sortIcon",43)}function di(e,o){if(e&1){let t=F();_(0,"button",41),d(1,"translate"),B("click",function(i){w(t);let a=l(3);return E(a.resetWagons(i))}),s()}e&2&&m("pTooltip",x(1,1,"steps.wagonsUndoTooltip"))}function mi(e,o){if(e&1&&(_(0,"th",32)(1,"div",28)(2,"span"),v(3),d(4,"translate"),s(),r(5,ci,1,0,"p-sortIcon",43)(6,di,2,3,"button",30),s()()),e&2){let t=l(2);p(3),T(x(4,3,t.dispRateInfo().wagonsLabel)),p(2),c(t.focus()?-1:5),p(),c(t.itemsModified().wagons?6:-1)}}function ui(e,o){e&1&&f(0,"p-sortIcon",34)}function Ci(e,o){if(e&1){let t=F();_(0,"button",41),d(1,"translate"),B("click",function(i){w(t);let a=l(2);return E(a.resetMachines(i))}),s()}e&2&&m("pTooltip",x(1,1,"steps.machinesUndoTooltip"))}function fi(e,o){if(e&1){let t=F();_(0,"button",41),d(1,"translate"),B("click",function(){w(t);let i=l(3);return E(i.resetBeacons())}),s()}e&2&&m("pTooltip",x(1,1,"steps.beaconsUndoTooltip"))}function xi(e,o){if(e&1&&(_(0,"th",35)(1,"div",28)(2,"span"),v(3),d(4,"translate"),s(),r(5,fi,2,3,"button",30),s()()),e&2){let t=l(2);p(3),T(x(4,2,"options.column.beacons")),p(2),c(t.recipesModified().beacons?5:-1)}}function gi(e,o){e&1&&f(0,"p-sortIcon",45)}function Si(e,o){if(e&1&&(_(0,"th",36)(1,"div",44)(2,"span"),v(3),d(4,"translate"),s(),r(5,gi,1,0,"p-sortIcon",45),s()()),e&2){let t=l(2);p(3),T(x(4,2,"options.column.power")),p(2),c(t.focus()?-1:5)}}function vi(e,o){e&1&&f(0,"p-sortIcon",46)}function hi(e,o){if(e&1&&(_(0,"th",37)(1,"div",44)(2,"span"),v(3),d(4,"translate"),s(),r(5,vi,1,0,"p-sortIcon",46),s()()),e&2){let t=l(2);p(3),T(x(4,2,t.dispRateInfo().pollutionLabel)),p(2),c(t.focus()?-1:5)}}function bi(e,o){e&1&&f(0,"th")}function Ii(e,o){if(e&1){let t=F();_(0,"tr")(1,"td",22)(2,"div",23)(3,"button",24),d(4,"translate"),B("click",function(){w(t);let i=l(),a=h(14);return E(a.open(i.columnsState()))}),s(),r(5,ni,2,3,"button",25),s()()(),_(6,"tr",26),f(7,"th"),r(8,oi,4,1,"th")(9,li,3,3,"th"),_(10,"th",27)(11,"div",28)(12,"span"),v(13),d(14,"translate"),s(),r(15,ai,1,0,"p-sortIcon",29)(16,pi,2,3,"button",30),s()(),r(17,ri,7,5,"th",31)(18,mi,7,5,"th",32),_(19,"th",33)(20,"div",28)(21,"span"),v(22),d(23,"translate"),s(),r(24,ui,1,0,"p-sortIcon",34)(25,Ci,2,3,"button",30),s()(),r(26,xi,6,4,"th",35)(27,Si,6,4,"th",36)(28,hi,6,4,"th",37)(29,bi,1,0,"th"),s()}if(e&2){let t=l();p(3),m("label",x(4,16,"steps.columnSettings")),p(2),c(t.steps().length?5:-1),p(3),c(!t.focus()&&t.columnsState().checkbox.show?8:-1),p(),c(!t.focus()&&t.columnsState().tree.show?9:-1),p(4),T(x(14,18,t.dispRateInfo().itemsLabel)),p(2),c(t.focus()?-1:15),p(),c(t.settings().excludedItemIds.size?16:-1),p(),c(t.columnsState().belts.show?17:-1),p(),c(t.columnsState().wagons.show?18:-1),p(4),T(x(23,20,"options.column.machines")),p(2),c(t.focus()?-1:24),p(),c(t.recipesModified().machines?25:-1),p(),c(t.columnsState().beacons.show?26:-1),p(),c(t.columnsState().power.show?27:-1),p(),c(t.columnsState().pollution.show?28:-1),p(),c(t.columnsState().link.show?29:-1)}}function Ti(e,o){if(e&1&&f(0,"div",48),e&2){let t=o.$implicit,n=l();m("id","step_"+n.id+"_"+t.label)}}function yi(e,o){if(e&1){let t=F();_(0,"td",51)(1,"div",56)(2,"p-checkbox",57),B("onChange",function(i){w(t);let a=l(),u=l(2);return E(u.changeStepChecked(a,i.checked))}),s()()()}if(e&2){let t=l();p(2),m("binary",!0)("ngModel",t.checked)}}function wi(e,o){if(e&1&&f(0,"div",64),e&2){let t=o.$implicit,n=o.$index,i=o.$count;xt("trail",t)("last",n===i-1)}}function Ei(e,o){if(e&1&&(L(0,wi,1,4,"div",63,Tt),f(2,"div",59)),e&2){let t=l(2),n=l(2);H(n.stepTree()[t.id])}}function Bi(e,o){if(e&1&&f(0,"lab-tooltip",67),e&2){let t=l(3);m("id",t.itemId)}}function ki(e,o){if(e&1){let t=F();_(0,"button",65),d(1,"iconSmClass"),B("click",function(){w(t);let i=l(2),a=l(2);return E(a.changeItemExcluded(i.itemId,!a.settings().excludedItemIds.has(i.itemId)))}),f(2,"i",66),r(3,Bi,1,1,"ng-template",null,6,M),s()}if(e&2){let t=h(4),n=l(2),i=l(2);xt("hover-active",i.settings().excludedItemIds.has(n.itemId)),m("icon",x(1,4,n.itemId))("pTooltip",t)}}function Mi(e,o){if(e&1&&(_(0,"span"),v(1),s()),e&2){let t=l(3);p(),j("#",t.recipeObjectiveId,"")}}function Oi(e,o){if(e&1&&f(0,"lab-tooltip",69),e&2){let t=l(4);m("id",t.recipeId)("adjustedRecipe",t.recipe)}}function Vi(e,o){if(e&1&&r(0,Oi,1,2,"lab-tooltip",69),e&2){let t=l(3);c(t.recipeId?0:-1)}}function Fi(e,o){if(e&1&&(_(0,"i",68),d(1,"iconSmClass"),r(2,Mi,2,1,"span")(3,Vi,1,1,"ng-template",null,6,M),s()),e&2){let t=h(4),n=l(2);O(k(1,4,n.recipeId,"recipe")),m("pTooltip",t),p(2),c(n.recipeObjectiveId!=null?2:-1)}}function Pi(e,o){if(e&1&&(_(0,"td",52)(1,"div",58),r(2,Ei,3,0,"div",59),_(3,"div",60),r(4,ki,5,6,"button",61)(5,Fi,5,7,"i",62),s()()()),e&2){let t,n=l(),i=l(2),a=h(1);p(2),c(!a.sortField&&((t=i.stepTree()[n.id])!=null&&t.length)?2:-1),p(2),c(n.itemId&&n.recipeObjectiveId==null?4:5)}}function Ri(e,o){if(e&1&&(_(0,"span",71),v(1),d(2,"rate"),s()),e&2){let t=l(2),n=l(2);p(),j("(+",k(2,1,t.surplus,n.columnsState().items.precision),") ")}}function ji(e,o){if(e&1&&f(0,"lab-tooltip",67),e&2){let t=l(3);m("id",t.itemId)}}function Di(e,o){if(e&1){let t=F();_(0,"button",65),d(1,"iconSmClass"),B("click",function(){w(t);let i=l(2),a=l(2);return E(a.changeItemExcluded(i.itemId,!a.settings().excludedItemIds.has(i.itemId)))}),f(2,"i",66),r(3,ji,1,1,"ng-template",null,6,M),s()}if(e&2){let t=h(4),n=l(2),i=l(2);xt("hover-active",i.settings().excludedItemIds.has(n.itemId)),m("icon",x(1,4,n.itemId))("pTooltip",t)}}function $i(e,o){if(e&1&&(_(0,"td",70),r(1,Ri,3,4,"span",71),_(2,"span",72),v(3),d(4,"rate"),s()(),_(5,"td",73)(6,"div",28)(7,"span",74),v(8),s(),r(9,Di,5,6,"button",61),s()()),e&2){let t,n=l(),i=l(2);p(),c(n.surplus&&n.surplus.nonzero()?1:-1),p(2),T(k(4,4,n.items.sub((t=n.surplus)!==null&&t!==void 0?t:i.rational.zero),i.columnsState().items.precision)),p(5),T(i.data().itemEntities[n.itemId].name),p(),c(!i.preferences().hideDuplicateIcons||!i.columnsState().tree.show?9:-1)}}function Li(e,o){e&1&&f(0,"td",35)}function Hi(e,o){if(e&1&&(_(0,"span"),v(1),s()),e&2){let t=l(4);p(),T(t.stack)}}function Ni(e,o){if(e&1){let t=F();_(0,"button",76),B("click",function(i){w(t);let a=h(6);l();let u=fe(0),C=l(2);return E(a.show(i,u,C))}),_(1,"i",77),d(2,"iconSmClass"),r(3,Hi,2,1,"span"),s(),f(4,"i",78),s(),_(5,"lab-belt-overlay",79,7),B("setValue",function(i){w(t);let a=l(3),u=l(2),C=l(2);return E(C.changeBelts(u,i,a.defaultBeltId))}),s()}if(e&2){l();let t=h(4),n=l(),i=l(),a=l(4);m("pTooltip",t),p(),O(x(2,4,n)),p(2),c(i.stack!=null&&i.stack.gt(a.rational.one)?3:-1)}}function Ai(e,o){if(e&1&&(_(0,"div",49),f(1,"i"),d(2,"iconSmClass"),s()),e&2){let t=l().$implicit;p(),O(x(2,2,t.value))}}function Wi(e,o){if(e&1&&r(0,Ai,3,4,"div",49),e&2){let t=o.$implicit;c(t?0:-1)}}function Ui(e,o){if(e&1&&f(0,"lab-tooltip",85),e&2){let t=l().$implicit,n=l(2);m("id",t.value)("type",n)}}function zi(e,o){if(e&1&&(_(0,"div",83),f(1,"i"),d(2,"iconSmClass"),_(3,"div",84),v(4),s(),r(5,Ui,1,2,"ng-template",null,6,M),s()),e&2){let t=o.$implicit,n=h(6);m("pTooltip",n),p(),O(x(2,4,t.value)),p(3),j(" ",t.label," ")}}function qi(e,o){if(e&1){let t=F();_(0,"p-dropdown",80),B("onChange",function(i){w(t);let a=l(3),u=l(2),C=l(2);return E(C.itemsSvc.updateEntityField(u.itemId,"beltId",i.value,a.defaultBeltId))}),r(1,Wi,1,1,"ng-template",81)(2,zi,7,6,"ng-template",82),s()}if(e&2){let t=l(),n=h(4),i=l(),a=l(5);m("pTooltip",n)("ngModel",i)("options",t==="belt"?a.options().belts:a.options().pipes)}}function Ji(e,o){if(e&1&&f(0,"lab-tooltip",85),e&2){let t=l(),n=l();m("id",n)("type",t)}}function Ki(e,o){if(e&1&&(ue(0),r(1,Ni,7,6)(2,qi,3,3,"p-dropdown",75)(3,Ji,1,2,"ng-template",null,6,M)),e&2){let t=l(4),n=l(2),i=Ce(n.data().itemEntities[t.itemId].stack);p(),c(n.data().flags.has("beltStack")&&i&&i.gt(n.rational.one)?1:2)}}function Xi(e,o){if(e&1&&f(0,"lab-tooltip",86),e&2){let t=l(2);m("id",t)}}function Gi(e,o){if(e&1&&(_(0,"i",68),d(1,"iconClass"),r(2,Xi,1,1,"ng-template",null,6,M),s()),e&2){let t=h(3),n=l();O(x(1,3,n)),m("pTooltip",t)}}function Qi(e,o){if(e&1&&(_(0,"td",70)(1,"span",72),v(2),d(3,"rate"),s()(),_(4,"td",73)(5,"div",28),r(6,Ki,5,2)(7,Gi,4,5,"i",62),s()()),e&2){let t,n=o,i=l(3),a=l(2);p(2),T(k(3,2,i.belts,a.columnsState().belts.precision)),p(4),c((t=a.data().beltIds.includes(n)?"belt":a.data().pipeIds.includes(n)?"pipe":null)?6:7,t)}}function Yi(e,o){if(e&1&&r(0,Qi,8,5),e&2){let t;c((t=o.beltId)?0:-1,t)}}function Zi(e,o){e&1&&f(0,"td",35)}function to(e,o){if(e&1&&r(0,Yi,1,1)(1,Zi,1,0,"td",35),e&2){let t,n=l(),i=l(2);c((t=n.itemId&&n.belts&&i.itemsState()[n.itemId])?0:1,t)}}function eo(e,o){if(e&1&&(_(0,"div",49),f(1,"i"),d(2,"iconSmClass"),s()),e&2){let t=l().$implicit;p(),O(x(2,2,t.value))}}function no(e,o){if(e&1&&r(0,eo,3,4,"div",49),e&2){let t=o.$implicit;c(t?0:-1)}}function io(e,o){if(e&1&&f(0,"lab-tooltip",85),e&2){let t=l().$implicit,n=l();m("id",t.value)("type",n)}}function oo(e,o){if(e&1&&(_(0,"div",83),f(1,"i"),d(2,"iconSmClass"),_(3,"div",84),v(4),s(),r(5,io,1,2,"ng-template",null,6,M),s()),e&2){let t=o.$implicit,n=h(6);m("pTooltip",n),p(),O(x(2,4,t.value)),p(3),j(" ",t.label," ")}}function lo(e,o){if(e&1&&f(0,"lab-tooltip",85),e&2){let t=l(),n=l();m("id",n)("type",t)}}function ao(e,o){if(e&1){let t=F();_(0,"p-dropdown",80),B("onChange",function(i){w(t);let a=l(4),u=l(2);return E(u.itemsSvc.updateEntityField(a.itemId,"wagonId",i.value,u.itemsState()[a.itemId].defaultWagonId))}),r(1,no,1,1,"ng-template",81)(2,oo,7,6,"ng-template",82)(3,lo,1,2,"ng-template",null,6,M),s()}if(e&2){let t=h(4),n=l(),i=l(5);m("pTooltip",t)("ngModel",n)("options",o==="cargo-wagon"?i.options().cargoWagons:i.options().fluidWagons)}}function po(e,o){if(e&1&&(_(0,"td",70)(1,"span",72),v(2),d(3,"rate"),s()(),_(4,"td",73)(5,"div",28),r(6,ao,5,3,"p-dropdown",75),s()()),e&2){let t,n=o,i=l(3),a=l(2);p(2),T(k(3,2,i.wagons,a.columnsState().wagons.precision)),p(4),c((t=a.data().cargoWagonIds.includes(n)?"cargo-wagon":a.data().fluidWagonIds.includes(n)?"fluid-wagon":null)?6:-1,t)}}function _o(e,o){if(e&1&&r(0,po,7,5),e&2){let t,n=l(2),i=l(2);c((t=i.itemsState()[n.itemId].wagonId)?0:-1,t)}}function so(e,o){e&1&&f(0,"td",35)}function ro(e,o){if(e&1&&r(0,_o,1,1)(1,so,1,0,"td",35),e&2){let t=l();c(t.itemId&&t.wagons?0:1)}}function co(e,o){if(e&1&&(_(0,"span",72),v(1),d(2,"machineRate"),s()),e&2){let t=l(),n=l(),i=l(2);p(),T(gt(2,1,n.machines,i.columnsState().machines.precision,t))}}function mo(e,o){e&1&&R(0)}function uo(e,o){if(e&1&&r(0,mo,1,0,"ng-container",89),e&2){l(3);let t=h(17);m("ngTemplateOutlet",t)}}function Co(e,o){if(e&1&&(_(0,"div",49),f(1,"i"),d(2,"iconSmClass"),s()),e&2){let t=l().$implicit;p(),O(x(2,2,t.value))}}function fo(e,o){if(e&1&&r(0,Co,3,4,"div",49),e&2){let t=o.$implicit;c(t?0:-1)}}function xo(e,o){if(e&1&&f(0,"lab-tooltip",91),e&2){let t=l().$implicit;m("id",t.value)}}function go(e,o){if(e&1&&(_(0,"div",83),f(1,"i"),d(2,"iconSmClass"),_(3,"div",84),v(4),s(),r(5,xo,1,1,"ng-template",null,6,M),s()),e&2){let t=o.$implicit,n=h(6);m("pTooltip",n),p(),O(x(2,4,t.value)),p(3),j(" ",t.label," ")}}function So(e,o){if(e&1&&f(0,"lab-tooltip",91),e&2){let t=l(3);m("id",t)}}function vo(e,o){if(e&1){let t=F();_(0,"p-dropdown",90),B("onChange",function(i){w(t);let a=l(3),u=l(2);return E(a.recipeObjectiveId?u.objectivesSvc.updateEntityField(a.recipeObjectiveId,"machineId",i.value,a.recipeSettings.defaultMachineId):u.recipesSvc.updateEntityField(a.recipeId,"machineId",i.value,a.recipeSettings.defaultMachineId))}),r(1,fo,1,1,"ng-template",81)(2,go,7,6,"ng-template",82)(3,So,1,1,"ng-template",null,6,M),s()}if(e&2){let t=h(4),n=l(2),i=l();m("pTooltip",t)("options",i.recipeSettings.machineOptions)("ngModel",n)}}function ho(e,o){if(e&1){let t=F();_(0,"p-inputNumber",92,8),d(2,"translate"),B("onBlur",function(){let i;w(t);let a=h(1),u=l(3),C=l(2);return E(u.recipeObjectiveId?C.objectivesSvc.updateEntityField(u.recipeObjectiveId,"overclock",C.rational((i=a.value)!==null&&i!==void 0?i:100),u.recipeSettings.defaultOverclock):C.recipesSvc.updateEntityField(u.recipeId,"overclock",C.rational((i=a.value)!==null&&i!==void 0?i:100),u.recipeSettings.defaultOverclock))}),s()}if(e&2){let t=l(3);m("min",1)("max",250)("step",10)("maxFractionDigits",2)("size",3)("pTooltip",x(2,7,"steps.overclockTooltip"))("ngModel",t.recipeSettings.overclock)}}function bo(e,o){if(e&1&&f(0,"lab-tooltip",94),e&2){let t=l(2);m("id",t)}}function Io(e,o){if(e&1&&(_(0,"div",28)(1,"i",93),d(2,"iconSmClass"),r(3,bo,1,1,"ng-template",null,6,M),s()()),e&2){let t=h(4),n=l();p(),O(x(2,3,n)),m("pTooltip",t)}}function To(e,o){if(e&1&&(_(0,"div",49),f(1,"i"),d(2,"iconSmClass"),s()),e&2){let t=o.$implicit;p(),O(x(2,2,t.value))}}function yo(e,o){if(e&1&&f(0,"lab-tooltip",94),e&2){let t=l().$implicit;m("id",t.value)}}function wo(e,o){if(e&1&&(_(0,"div",83),f(1,"i"),d(2,"iconSmClass"),_(3,"div",84),v(4),s(),r(5,yo,1,1,"ng-template",null,6,M),s()),e&2){let t=o.$implicit,n=h(6);m("pTooltip",n),p(),O(x(2,4,t.value)),p(3),j(" ",t.label," ")}}function Eo(e,o){if(e&1&&f(0,"lab-tooltip",94),e&2){let t=l(2);m("id",t)}}function Bo(e,o){if(e&1){let t=F();_(0,"p-dropdown",80),B("onChange",function(i){w(t);let a=l(4),u=l(2);return E(a.recipeObjectiveId?u.objectivesSvc.updateEntityField(a.recipeObjectiveId,"fuelId",i.value,a.recipeSettings.fuelId):u.recipesSvc.updateEntityField(a.recipeId,"fuelId",i.value,a.recipeSettings.defaultFuelId))}),r(1,To,3,4,"ng-template",81)(2,wo,7,6,"ng-template",82)(3,Eo,1,1,"ng-template",null,6,M),s()}if(e&2){let t,n=h(4),i=l(),a=l(3);m("pTooltip",n)("ngModel",i)("options",(t=a.recipeSettings.fuelOptions)!==null&&t!==void 0?t:Y(3,fn))}}function ko(e,o){if(e&1&&r(0,Io,5,5,"div",28)(1,Bo,5,4,"p-dropdown",75),e&2){let t=l(3);c(t.recipe.flags.has("burn")?0:t.recipeSettings.machineId?1:-1)}}function Mo(e,o){if(e&1&&(_(0,"div",49),f(1,"i"),d(2,"iconSmClass"),s()),e&2){let t=o.$implicit;p(),O(x(2,2,t.value))}}function Oo(e,o){if(e&1&&f(0,"lab-tooltip",97),e&2){let t=l().$implicit;m("id",t.value)}}function Vo(e,o){if(e&1&&(_(0,"div",83),f(1,"i"),d(2,"iconSmClass"),_(3,"div",84),v(4),s(),r(5,Oo,1,1,"ng-template",null,6,M),s()),e&2){let t=o.$implicit,n=h(6);m("pTooltip",t.value!=="module"?n:void 0),p(),O(x(2,4,t.value)),p(3),j(" ",t.label," ")}}function Fo(e,o){if(e&1){let t=F();_(0,"p-dropdown",96),d(1,"translate"),B("onChange",function(i){w(t);let a=l(5),u=l(2);return E(u.changeModulesBeacons(a,{modules:[{id:i.value,count:u.rational.one}]}))}),r(2,Mo,3,4,"ng-template",81)(3,Vo,7,6,"ng-template",82),s()}if(e&2){let t,n=l(2),i=l(3);m("pTooltip",x(1,3,"settings.modifierTooltip"))("ngModel",n[0].id)("options",(t=i.recipeSettings.moduleOptions)!==null&&t!==void 0?t:Y(5,fn))}}function Po(e,o){if(e&1&&(_(0,"i",77),d(1,"iconSmClass"),_(2,"span"),v(3),s()()),e&2){let t=o.$implicit;O(x(1,3,t.id)),p(3),T(t.count)}}function Ro(e,o){if(e&1&&f(0,"lab-tooltip",97),e&2){let t=l().$implicit;m("id",t.id)}}function jo(e,o){if(e&1&&r(0,Ro,1,1,"lab-tooltip",97),e&2){let t=o.$implicit;c(t.id?0:-1)}}function Do(e,o){if(e&1&&L(0,jo,1,1,null,null,zt),e&2){let t=l(3);H(t)}}function $o(e,o){if(e&1){let t=F();_(0,"button",98),B("click",function(i){w(t);let a=h(5),u=l(),C=l(),g=l(3);return E(a.show(i,C,u,g.recipeId))}),L(1,Po,4,5,"i",99,zt),f(3,"i",78),s(),_(4,"lab-modules-overlay",79,9),B("setValue",function(i){w(t);let a=l(5),u=l(2);return E(u.changeModulesBeacons(a,{modules:i}))}),s(),r(6,Do,2,0,"ng-template",null,6,M)}if(e&2){let t=h(7),n=l(2);m("pTooltip",t),p(),H(n)}}function Lo(e,o){if(e&1&&r(0,Fo,4,6,"p-dropdown",95)(1,$o,8,1),e&2){let t=o;c(t.modules!==!0&&(t.modules!=null&&t.modules.isOne())?0:t.modules!=null?1:-1)}}function Ho(e,o){if(e&1&&r(0,Lo,2,1),e&2){let t,n=l(2),i=l(3);c((t=i.data().machineEntities[n])?0:-1,t)}}function No(e,o){if(e&1&&(_(0,"div",28)(1,"span",74),v(2),s(),r(3,uo,1,1,"ng-container")(4,vo,5,3,"p-dropdown",87)(5,ho,3,9,"p-inputNumber",88)(6,ko,2,1)(7,Ho,1,1),s()),e&2){let t,n,i=l(2),a=l(2);p(2),T(i.recipe.name),p(),c(!a.preferences().hideDuplicateIcons||i.itemId!=null&&i.itemId!==i.recipeId?3:-1),p(),c(i.recipe.flags.has("hideProducer")?-1:4),p(),c(a.data().flags.has("overclock")?5:-1),p(),c((t=i.recipeSettings==null?null:i.recipeSettings.fuelId)?6:-1,t),p(),c((n=i.recipeSettings==null?null:i.recipeSettings.modules)?7:-1,n)}}function Ao(e,o){if(e&1&&(_(0,"td",70),r(1,co,3,5,"span",72),s(),_(2,"td",73),r(3,No,8,6,"div",28),s()),e&2){let t=l(),n=l(2);p(),c(t.machines&&t.machines.nonzero()&&!n.data().machineEntities[o].hideRate?1:-1),p(2),c(t.recipeId&&t.recipe&&t.recipeSettings?3:-1)}}function Wo(e,o){e&1&&R(0)}function Uo(e,o){if(e&1&&(f(0,"td"),_(1,"td",73),r(2,Wo,1,0,"ng-container",89),s()),e&2){l();let t=h(17);p(2),m("ngTemplateOutlet",t)}}function zo(e,o){if(e&1&&(f(0,"lab-tooltip",103),d(1,"translate")),e&2){let t=l(4);m("id",t.recipeId)("adjustedRecipe",t.recipe)("action",x(1,3,"steps.selectRecipesTooltip"))}}function qo(e,o){e&1&&(v(0),d(1,"translate")),e&2&&j(" ",x(1,1,"steps.selectRecipesTooltip")," ")}function Jo(e,o){if(e&1&&r(0,zo,2,5,"lab-tooltip",103)(1,qo,2,3),e&2){let t=l(3);c(t.recipeId?0:1)}}function Ko(e,o){if(e&1&&(_(0,"span"),v(1),s()),e&2){let t=l(5);p(),j("#",t.recipeObjectiveId,"")}}function Xo(e,o){if(e&1&&(_(0,"div",49)(1,"i"),d(2,"iconSmClass"),r(3,Ko,2,1,"span"),s()()),e&2){let t=l(4);p(),O(k(2,3,t.recipeId,"recipe")),p(2),c(t.recipeObjectiveId?3:-1)}}function Go(e,o){e&1&&f(0,"i",104)}function Qo(e,o){if(e&1&&r(0,Xo,4,6,"div",49)(1,Go,1,0,"i",104),e&2){let t=l(3);c(t.recipeId?0:1)}}function Yo(e,o){if(e&1&&f(0,"lab-tooltip",106),e&2){let t=l().$implicit;m("id",t.value)}}function Zo(e,o){if(e&1&&(_(0,"div",105),f(1,"i"),d(2,"iconSmClass"),_(3,"div",84),v(4),s(),r(5,Yo,1,1,"ng-template",null,6,M),s()),e&2){let t=o.$implicit,n=h(6);m("pTooltip",n),p(),O(k(2,4,t.value,"recipe")),p(3),j(" ",t.label," ")}}function tl(e,o){if(e&1){let t=F();_(0,"p-multiSelect",101),ot("ngModelChange",function(i){let a=w(t);return it(a.recipesEnabled,i)||(a.recipesEnabled=i),E(i)}),B("onPanelHide",function(){let i=w(t),a=l(4);return E(a.changeRecipesIncluded(i.recipeIds,i.recipesEnabled))}),r(1,Jo,2,1,"ng-template",null,6,M)(3,Qo,2,1,"ng-template",102)(4,Zo,7,7,"ng-template",82),s()}if(e&2){let t=o,n=h(2);nt("ngModel",t.recipesEnabled),m("options",t.recipeOptions)("pTooltip",n)}}function el(e,o){if(e&1&&r(0,tl,5,3,"p-multiSelect",100),e&2){let t,n=l(),i=l(2);c((t=i.stepDetails()[n.id])?0:-1,t)}}function nl(e,o){if(e&1&&(_(0,"i",109),d(1,"iconSmClass"),_(2,"span"),v(3),s()()),e&2){let t=l().$implicit;O(x(1,3,t.id)),p(3),T(t.total)}}function il(e,o){if(e&1&&(_(0,"i",77),d(1,"iconSmClass"),_(2,"span"),v(3),s()()),e&2){let t=o.$implicit;O(x(1,3,t.id)),p(3),T(t.count)}}function ol(e,o){if(e&1&&(_(0,"div",49)(1,"i",77),d(2,"iconSmClass"),_(3,"span"),v(4),s()(),r(5,nl,4,5,"i",108),L(6,il,4,5,"i",99,zt),s()),e&2){let t=o.$implicit;p(),O(x(2,4,t.id)),p(3),T(t.count),p(),c(t.total?5:-1),p(),H(t.modules)}}function ll(e,o){e&1&&f(0,"lab-tooltip",110),e&2&&m("id",o)}function al(e,o){if(e&1&&r(0,ll,1,1,"lab-tooltip",110),e&2){let t,n=l(3);c((t=n.recipeSettings.beacons==null||n.recipeSettings.beacons[0]==null?null:n.recipeSettings.beacons[0].id)?0:-1,t)}}function pl(e,o){if(e&1){let t=F();_(0,"button",107),B("click",function(i){w(t);let a=h(5),u=l(2);return E(a.show(i,u.recipeSettings.beacons))}),L(1,ol,8,6,"div",49,Tt),f(3,"i",78),s(),_(4,"lab-beacons-overlay",79,10),B("setValue",function(i){w(t);let a=l(2),u=l(2);return E(u.changeModulesBeacons(a,{beacons:i}))}),s(),r(6,al,1,1,"ng-template",null,6,M)}if(e&2){let t=h(7),n=l(2);m("pTooltip",t),p(),H(n.recipeSettings.beacons)}}function _l(e,o){if(e&1&&(_(0,"td",53),r(1,pl,8,1),s()),e&2){let t=l();p(),c(t.recipeId&&t.recipeSettings&&t.recipeSettings.beacons&&t.recipeSettings.beacons.length?1:-1)}}function sl(e,o){if(e&1&&(_(0,"span",72),v(1),d(2,"power"),s()),e&2){let t=l(2),n=l(2);p(),T(gt(2,1,t.power,n.columnsState().power.precision,n.effectivePowerUnit()))}}function rl(e,o){if(e&1&&(_(0,"td",54),r(1,sl,3,5,"span",72),s()),e&2){let t=l();p(),c(t.power&&t.power.nonzero()?1:-1)}}function cl(e,o){if(e&1&&(_(0,"span",72),v(1),d(2,"rate"),s()),e&2){let t=l(2),n=l(2);p(),T(k(2,1,t.pollution,n.columnsState().pollution.precision))}}function dl(e,o){if(e&1&&(_(0,"td",54),r(1,cl,3,4,"span",72),s()),e&2){let t=l();p(),c(t.pollution&&t.pollution.nonzero()?1:-1)}}function ml(e,o){if(e&1){let t=F();_(0,"button",114),d(1,"translate"),B("click",function(){w(t);let i=l(2),a=l(2);return E(a.resetStep(i))}),s()}e&2&&m("pTooltip",x(1,1,"steps.stepUndoTooltip"))}function ul(e,o){if(e&1&&(_(0,"td",55)(1,"div",49)(2,"a",111),d(3,"stepHref"),d(4,"async"),f(5,"button",112),d(6,"translate"),s(),r(7,ml,2,3,"button",113),s()()),e&2){let t=l(),n=l(2);p(2),m("queryParams",x(4,6,k(3,3,t,n.routerSvc.zipConfig()))),p(3),m("pTooltip",x(6,8,"steps.openNewTabTooltip")),p(2),c(t.recipeId&&n.stepsModified().recipes[t.recipeId]||t.itemId&&n.stepsModified().items[t.itemId]||t.recipeObjectiveId&&n.stepsModified().objectives[t.recipeObjectiveId]?7:-1)}}function Cl(e,o){if(e&1){let t=F();_(0,"tr")(1,"td",47),f(2,"div",48),L(3,Ti,1,1,"div",48,zt),_(5,"div",49)(6,"button",50),d(7,"translate"),B("click",function(){let i=w(t),a=l().expanded,u=l();return E(u.expandRow(i,a))}),s()()(),r(8,yi,3,2,"td",51)(9,Pi,6,2,"td",52)(10,$i,10,7)(11,Li,1,0,"td",35)(12,to,2,1)(13,ro,2,1)(14,Ao,4,2)(15,Uo,3,1)(16,el,1,1,"ng-template",null,5,M)(18,_l,2,1,"td",53)(19,rl,2,1,"td",54)(20,dl,2,1,"td",54)(21,ul,8,10,"td",55),s()}if(e&2){let t,n=o,i=l().expanded,a=l();p(2),m("id","step_"+n.id),p(),H(a.stepDetails()[n.id].tabs),p(3),xt("fa-rotate-90",i),m("pTooltip",x(7,15,i?"steps.hideDetails":"steps.showDetails"))("pRowToggler",n),p(2),c(!a.focus()&&a.columnsState().checkbox.show?8:-1),p(),c(!a.focus()&&a.columnsState().tree.show?9:-1),p(),c(n.itemId&&n.items?10:11),p(2),c(a.columnsState().belts.show?12:-1),p(),c(a.columnsState().wagons.show?13:-1),p(),c((t=n.recipeSettings==null?null:n.recipeSettings.machineId)?14:15,t),p(4),c(a.columnsState().beacons.show?18:-1),p(),c(a.columnsState().power.show?19:-1),p(),c(a.columnsState().pollution.show?20:-1),p(),c(a.columnsState().link.show?21:-1)}}function fl(e,o){if(e&1&&(r(0,Cl,22,17,"tr"),d(1,"asStep")),e&2){let t,n=o.$implicit;c((t=x(1,1,n))?0:-1,t)}}function xl(e,o){if(e&1&&(_(0,"a",121),f(1,"span",122),_(2,"span",123),v(3),d(4,"translate"),s()()),e&2){let t=o.$implicit,n=l(3);m("id",t.id),p(),O(n.stepDetailIcon[t.label]),p(2),T(x(4,4,"options.stepDetailTab."+t.label))}}function gl(e,o){e&1&&R(0)}function Sl(e,o){if(e&1&&(_(0,"tr",120),r(1,gl,1,0,"ng-container",89),_(2,"td",124),v(3),d(4,"translate"),s()()),e&2){l(4);let t=h(9);p(),m("ngTemplateOutlet",t),p(2),j(" ",x(4,2,"steps.sources")," ")}}function vl(e,o){e&1&&R(0)}function hl(e,o){if(e&1&&r(0,vl,1,0,"ng-container",125),e&2){let t=l().$implicit,n=l(2),i=l(2),a=h(11);m("ngTemplateOutlet",a)("ngTemplateOutletContext",at(2,qn,[n.items==null?null:n.items.mul(t.value),n.itemId,n.belts==null?null:n.belts.mul(t.value),i.itemsState()[n.itemId].beltId,n.wagons==null?null:n.wagons.mul(t.value),i.itemsState()[n.itemId].wagonId,t.step==null?null:t.step.machines,t.step==null||t.step.recipeSettings==null?null:t.step.recipeSettings.machineId,t.step==null?null:t.step.recipeId,t.step==null?null:t.step.recipeObjectiveId,t.value,n.itemId,t.inputs]))}}function bl(e,o){if(e&1&&r(0,hl,1,16,"ng-container"),e&2){let t=l(2);c(t.itemId?0:-1)}}function Il(e,o){e&1&&R(0)}function Tl(e,o){if(e&1&&(_(0,"tr",120),r(1,Il,1,0,"ng-container",89),_(2,"td",124),v(3),d(4,"translate"),s()()),e&2){l(4);let t=h(9);p(),m("ngTemplateOutlet",t),p(2),j(" ",x(4,2,"steps.destinations")," ")}}function yl(e,o){e&1&&R(0)}function wl(e,o){if(e&1&&r(0,yl,1,0,"ng-container",125),e&2){let t,n=l().$implicit,i=l(2),a=l(2),u=h(11);m("ngTemplateOutlet",u)("ngTemplateOutletContext",at(2,Jn,[i.items==null?null:i.items.mul(n.value),i.itemId,i.belts==null?null:i.belts.mul(n.value),a.itemsState()[i.itemId].beltId,i.wagons==null?null:i.wagons.mul(n.value),a.itemsState()[i.itemId].wagonId,a.stepDetails()[i.id].outputs.length===1?i.machines==null?null:i.machines.mul(n.value):null,a.stepDetails()[i.id].outputs.length===1?i.recipeSettings==null?null:i.recipeSettings.machineId:null,i.recipeId,i.recipeObjectiveId,n.value,(t=a.stepById()[n.key])==null?null:t.recipeId,(t=a.stepById()[n.key])==null?null:t.recipeObjectiveId,n.key===""]))}}function El(e,o){if(e&1&&r(0,wl,1,17,"ng-container"),e&2){let t=l(2);c(t.itemId?0:-1)}}function Bl(e,o){if(e&1&&(r(0,Sl,5,4,"tr",120),L(1,bl,1,1,null,null,Tt),r(3,Tl,5,4,"tr",120),L(4,El,1,1,null,null,J),d(6,"keyvalue")),e&2){let t=l(),n=l(2);c(n.stepDetails()[t.id].outputs.length?0:-1),p(),H(n.stepDetails()[t.id].outputs),p(2),c(t.parents?3:-1),p(),H(k(6,2,t.parents,n.trackSvc.sortByValue))}}function kl(e,o){e&1&&R(0)}function Ml(e,o){e&1&&R(0)}function Ol(e,o){if(e&1&&r(0,Ml,1,0,"ng-container",125),e&2){let t=l(),n=l().$implicit,i=l(4);l(2);let a=h(11);m("ngTemplateOutlet",a)("ngTemplateOutletContext",z(2,Kn,t.items.mul(o).div(i.recipe.effects.productivity),n.key))}}function Vl(e,o){if(e&1&&r(0,Ol,1,5,"ng-container"),e&2){let t,n=l().$implicit,i=l(4);c((t=o.items&&(i.outputs==null?null:i.outputs[n.key]))?0:-1,t)}}function Fl(e,o){if(e&1&&r(0,Vl,1,1),e&2){let t,n=o.$implicit,i=l(6);c((t=i.stepByItemEntities()[n.key])?0:-1,t)}}function Pl(e,o){if(e&1&&(_(0,"tr",120),r(1,kl,1,0,"ng-container",89),_(2,"td",124),v(3),d(4,"translate"),s()(),L(5,Fl,1,1,null,null,J),d(7,"keyvalue")),e&2){let t=l(3),n=l(2),i=h(9);p(),m("ngTemplateOutlet",i),p(2),j(" ",x(4,2,"steps.depletion")," "),p(2),H(k(7,4,t.outputs,n.trackSvc.sortByValue))}}function Rl(e,o){e&1&&R(0)}function jl(e,o){e&1&&R(0)}function Dl(e,o){if(e&1&&r(0,jl,1,0,"ng-container",125),e&2){let t=o,n=l(),i=l(),a=l().$implicit,u=l(4),C=l(2),g=h(11);m("ngTemplateOutlet",g)("ngTemplateOutletContext",at(2,Xn,[i.items==null?null:i.items.mul(n),a.key,i.belts==null?null:i.belts.mul(n),C.itemsState()[i.itemId].beltId,i.wagons==null?null:i.wagons.mul(n),C.itemsState()[i.itemId].wagonId,t.step==null||t.step.machines==null?null:t.step.machines.mul(n),t.step==null||t.step.recipeSettings==null?null:t.step.recipeSettings.machineId,t.step==null?null:t.step.recipeId,t.step==null?null:t.step.recipeObjectiveId,n,u.recipeId,u.recipeObjectiveId]))}}function $l(e,o){e&1&&R(0)}function Ll(e,o){if(e&1&&r(0,$l,1,0,"ng-container",125),e&2){let t=l(),n=l(),i=l().$implicit,a=l(4),u=l(2),C=h(11);m("ngTemplateOutlet",C)("ngTemplateOutletContext",at(2,Gn,[n.items==null?null:n.items.mul(t),i.key,n.belts==null?null:n.belts.mul(t),u.itemsState()[n.itemId].beltId,n.wagons==null?null:n.wagons.mul(t),u.itemsState()[n.itemId].wagonId,t,a.recipeId,a.recipeObjectiveId]))}}function Hl(e,o){if(e&1&&r(0,Dl,1,16,"ng-container")(1,Ll,1,12,"ng-container"),e&2){let t,n=l(),i=l(7);c((t=i.stepDetails()[n.id].outputs.length===1&&i.stepDetails()[n.id].outputs[0])?0:1,t)}}function Nl(e,o){if(e&1&&r(0,Hl,2,1),e&2){let t,n=o,i=l(5);c((t=n.itemId&&(n.parents==null?null:n.parents[i.id]))?0:-1,t)}}function Al(e,o){if(e&1&&r(0,Nl,1,1),e&2){let t,n=o.$implicit,i=l(6);c((t=i.stepByItemEntities()[n.key])?0:-1,t)}}function Wl(e,o){if(e&1&&(_(0,"tr",120),r(1,Rl,1,0,"ng-container",89),_(2,"td",124),v(3),d(4,"translate"),s()(),L(5,Al,1,1,null,null,J),d(7,"keyvalue")),e&2){let t=l(3),n=l(2),i=h(9);p(),m("ngTemplateOutlet",i),p(2),j(" ",x(4,2,"steps.inputs")," "),p(2),H(k(7,4,t.recipe.in,n.trackSvc.sortByValue))}}function Ul(e,o){e&1&&R(0)}function zl(e,o){e&1&&R(0)}function ql(e,o){e&1&&R(0)}function Jl(e,o){e&1&&R(0)}function Kl(e,o){if(e&1&&r(0,Jl,1,0,"ng-container",125),e&2){let t=o,n=l(),i=l().$implicit,a=l(3),u=l(2),C=h(11);m("ngTemplateOutlet",C)("ngTemplateOutletContext",at(2,Qn,[n.items==null?null:n.items.mul(t),i.key,n.belts==null?null:n.belts.mul(t),u.itemsState()[n.itemId].beltId,n.wagons==null?null:n.wagons.mul(t),u.itemsState()[n.itemId].wagonId,a.machines,a.recipeSettings==null?null:a.recipeSettings.machineId,a.recipeId,a.recipeObjectiveId,t,i.key,a.recipeObjectiveId]))}}function Xl(e,o){if(e&1&&r(0,Kl,1,16,"ng-container"),e&2){let t,n=l().$implicit,i=l(3);c((t=o.itemId&&(i.outputs==null?null:i.outputs[n.key]))?0:-1,t)}}function Gl(e,o){if(e&1&&r(0,Xl,1,1),e&2){let t,n=o.$implicit,i=l(5);c((t=i.stepByItemEntities()[n.key])?0:-1,t)}}function Ql(e,o){if(e&1&&(r(0,Pl,8,7)(1,Wl,8,7),d(2,"keyvalue"),_(3,"tr",120),r(4,Ul,1,0,"ng-container",89),_(5,"td",124),v(6),d(7,"translate"),s()(),_(8,"tr",120),r(9,zl,1,0,"ng-container",89),_(10,"td",126)(11,"span",72),v(12),d(13,"rate"),s()(),_(14,"td",127)(15,"div",49),f(16,"i",128),s()(),f(17,"td",22),s(),_(18,"tr",120),r(19,ql,1,0,"ng-container",89),_(20,"td",124),v(21),d(22,"translate"),s()(),L(23,Gl,1,1,null,null,J),d(25,"keyvalue")),e&2){let t=l(2),n=l(2),i=h(9);c(n.data().flags.has("miningDepletion")&&t.recipe.flags.has("mining")?0:-1),p(),c(x(2,8,t.recipe.in).length?1:-1),p(3),m("ngTemplateOutlet",i),p(2),j(" ",x(7,10,"steps.time")," "),p(3),m("ngTemplateOutlet",i),p(3),T(k(13,12,t.recipe.time,n.columnsState().items.precision)),p(7),m("ngTemplateOutlet",i),p(2),j(" ",x(22,15,"steps.outputs")," "),p(2),H(k(25,17,t.recipe.out,n.trackSvc.sortByValue))}}function Yl(e,o){if(e&1&&r(0,Ql,26,20),e&2){let t=l();c(t.recipe?0:-1)}}function Zl(e,o){e&1&&R(0)}function ta(e,o){if(e&1&&(r(0,Zl,1,0,"ng-container",125),d(1,"rate")),e&2){let t=l(),n=l(),i=l().$implicit;l();let a=h(28),u=l(2),C=l(2);m("ngTemplateOutlet",a)("ngTemplateOutletContext",z(5,Ct,k(1,2,n.items.mul(t).div(u.machines),C.columnsState().items.precision),i.key))}}function ea(e,o){e&1&&R(0)}function na(e,o){if(e&1&&(r(0,ea,1,0,"ng-container",125),d(1,"rate")),e&2){let t=l(3),n=l();l(2);let i=h(28),a=l(2),u=l(2);m("ngTemplateOutlet",i)("ngTemplateOutletContext",z(5,Ct,k(1,2,n.belts.mul(t).div(a.machines),u.columnsState().belts.precision),o))}}function ia(e,o){if(e&1&&r(0,na,2,8,"ng-container"),e&2){let t,n=l(4).$implicit,i=l(5);c((t=i.itemsState()[n.key].beltId)?0:-1,t)}}function oa(e,o){if(e&1&&(_(0,"td"),r(1,ia,1,1),s()),e&2){let t=l(2);p(),c(t.belts?1:-1)}}function la(e,o){e&1&&R(0)}function aa(e,o){if(e&1&&(r(0,la,1,0,"ng-container",125),d(1,"rate")),e&2){let t=o;l(6);let n=h(28);m("ngTemplateOutlet",n)("ngTemplateOutletContext",z(5,Ct,k(1,2,t.value,1),t.id))}}function pa(e,o){if(e&1&&(r(0,aa,2,8,"ng-container"),d(1,"inserterSpeed")),e&2){let t,n=l(2),i=l(),a=l(4),u=l(2);c((t=k(1,1,i.items.mul(n).div(a.machines).div(u.dispRateInfo().value),u.settings()))?0:-1,t)}}function _a(e,o){if(e&1&&(_(0,"td"),r(1,pa,2,4),s()),e&2){let t=l(2),n=l().$implicit,i=l(5);p(),c(i.data().itemEntities[n.key].stack&&t.items?1:-1)}}function sa(e,o){if(e&1&&(_(0,"tr")(1,"td"),r(2,ta,2,8,"ng-container"),s(),r(3,oa,2,1,"td")(4,_a,2,1,"td"),s()),e&2){let t=l(),n=l(6);p(2),c(t.items?2:-1),p(),c(n.columnsState().belts.show?3:-1),p(),c(n.data().flags.has("inserterEstimation")?4:-1)}}function ra(e,o){if(e&1&&r(0,sa,5,3,"tr"),e&2){let t,n=o,i=l(4);c((t=n.parents==null?null:n.parents[i.id])?0:-1,t)}}function ca(e,o){if(e&1&&r(0,ra,1,1),e&2){let t,n=o.$implicit,i=l(5);c((t=i.stepByItemEntities()[n.key])?0:-1,t)}}function da(e,o){e&1&&f(0,"i",131)}function ma(e,o){if(e&1&&f(0,"lab-tooltip",106),e&2){let t=l(4);m("id",t.recipeId)}}function ua(e,o){if(e&1&&f(0,"lab-tooltip",91),e&2){let t=l();m("id",t)}}function Ca(e,o){if(e&1&&(_(0,"div",28)(1,"i",68),d(2,"iconClass"),r(3,ma,1,1,"ng-template",null,6,M),s(),_(5,"i",68),d(6,"iconClass"),r(7,ua,1,1,"ng-template",null,6,M),s()()),e&2){let t=h(4),n=l(3);p(),O(k(2,6,n.recipeId,"recipe")),m("pTooltip",t),p(4),O(x(6,9,o)),m("pTooltip",t)}}function fa(e,o){e&1&&R(0)}function xa(e,o){if(e&1&&(r(0,fa,1,0,"ng-container",125),d(1,"rate")),e&2){let t=o;l(5);let n=h(28);m("ngTemplateOutlet",n)("ngTemplateOutletContext",z(5,Ct,k(1,2,t.value,1),t.id))}}function ga(e,o){if(e&1&&(r(0,xa,2,8,"ng-container"),d(1,"inserterSpeed")),e&2){let t,n=l(2),i=l(6);c((t=k(1,1,n,i.settings()))?0:-1,t)}}function Sa(e,o){if(e&1&&(_(0,"td"),r(1,ga,2,4),s()),e&2){let t=l(2).$implicit,n=l(5);p(),c(n.data().itemEntities[t.key].stack?1:-1)}}function va(e,o){e&1&&R(0)}function ha(e,o){if(e&1&&(r(0,va,1,0,"ng-container",125),d(1,"rate")),e&2){let t=o,n=l(2);l(2);let i=h(28),a=l(4);m("ngTemplateOutlet",i)("ngTemplateOutletContext",z(5,Ct,k(1,2,n.div(a.beltSpeed()[t]),a.columnsState().belts.precision),t))}}function ba(e,o){if(e&1&&(_(0,"td"),r(1,ha,2,8,"ng-container"),s()),e&2){let t,n=l(2).$implicit,i=l(5);p(),c((t=i.itemsState()[n.key].beltId)?1:-1,t)}}function Ia(e,o){e&1&&R(0)}function Ta(e,o){if(e&1&&(_(0,"tr"),r(1,Sa,2,1,"td")(2,ba,2,1,"td"),_(3,"td"),r(4,Ia,1,0,"ng-container",125),d(5,"rate"),s()()),e&2){let t=l().$implicit;l();let n=h(28),i=l(4);p(),c(i.data().flags.has("inserterEstimation")?1:-1),p(),c(i.columnsState().belts.show?2:-1),p(2),m("ngTemplateOutlet",n)("ngTemplateOutletContext",z(7,Ct,k(5,4,o.mul(i.dispRateInfo().value),i.columnsState().items.precision),t.key))}}function ya(e,o){if(e&1&&r(0,Ta,6,10,"tr"),e&2){let t,n=o.$implicit,i=l(3);c((t=n.value.div(i.recipe.time))?0:-1,t)}}function wa(e,o){if(e&1&&f(0,"lab-tooltip",67),e&2){let t=l().itemId;m("id",t)}}function Ea(e,o){if(e&1&&(_(0,"div",44)(1,"span",72),v(2),s(),_(3,"i",68),d(4,"iconClass"),r(5,wa,1,1,"ng-template",null,6,M),s()()),e&2){let t=o.value,n=o.itemId,i=h(6);p(2),T(t),p(),O(x(4,4,n)),m("pTooltip",i)}}function Ba(e,o){if(e&1&&(_(0,"div",28)(1,"table",130),L(2,ca,1,1,null,null,J),d(4,"keyvalue"),s(),r(5,da,1,0,"i",131),d(6,"keyvalue"),_(7,"table",130)(8,"tr")(9,"td",126)(10,"span",72),v(11),d(12,"rate"),s()(),_(13,"td"),r(14,Ca,9,11,"div",28),s()(),_(15,"tr")(16,"td",126)(17,"span",72),v(18),d(19,"rate"),s()(),_(20,"td"),f(21,"i",128),s()()(),f(22,"i",131),_(23,"table",130),L(24,ya,1,1,null,null,J),d(26,"keyvalue"),s(),r(27,Ea,7,6,"ng-template",null,12,M),s()),e&2){let t,n=l(2),i=l(2);p(2),H(k(4,4,n.recipe.in,i.trackSvc.sortByValue)),p(3),c(x(6,7,n.recipe.in).length?5:-1),p(6),T(k(12,9,i.rational.one,i.columnsState().machines.precision)),p(3),c((t=n.recipeSettings==null?null:n.recipeSettings.machineId)?14:-1,t),p(4),T(k(19,12,i.dispRateInfo().value,i.columnsState().machines.precision)),p(6),H(k(26,15,n.recipe.out,i.trackSvc.sortByValue))}}function ka(e,o){e&1&&(f(0,"small",129),d(1,"translate")),e&2&&m("innerHTML",x(1,1,"steps.inserterCountInfo"),se)}function Ma(e,o){if(e&1&&(_(0,"tr",120),f(1,"td"),_(2,"td",22),r(3,Ba,29,18,"div",28)(4,ka,2,3,"small",129),s()()),e&2){let t=l(),n=l(2);p(3),c(t.recipeId&&t.recipe&&t.machines?3:-1),p(),c(n.data().flags.has("inserterEstimation")?4:-1)}}function Oa(e,o){e&1&&(_(0,"tr",120),f(1,"td"),_(2,"td",132),v(3," This functionality has been moved. The recipe icon in the machines column now opens a multiselect dropdown to select enabled recipes. "),s()())}function Va(e,o){if(e&1){let t=F();_(0,"tr",115)(1,"td",116)(2,"a",117),f(3,"button",118),s()(),_(4,"td",22)(5,"p-tabMenu",119,11),d(7,"stepId"),B("activeItemChange",function(i){let a=w(t),u=l(2);return E(u.setActiveItem(a,i))}),r(8,xl,5,6,"ng-template",82),s()()(),r(9,Bl,7,5)(10,Yl,1,1)(11,Ma,5,2,"tr",120)(12,Oa,4,0,"tr",120)}if(e&2){let t,n=o,i=h(6),a=l(2);p(2),m("relativeTo",a.route)("fragment",n.id),p(3),m("model",a.stepDetails()[n.id].tabs)("activeItem",a.activeItem[x(7,5,n)]),p(4),c((t=i.activeItem==null?null:i.activeItem.label)===a.StepDetailTab.Item?9:t===a.StepDetailTab.Recipe?10:t===a.StepDetailTab.Machine?11:t===a.StepDetailTab.Recipes?12:-1)}}function Fa(e,o){if(e&1&&(r(0,Va,13,7),d(1,"asStep")),e&2){let t,n=o.$implicit;c((t=x(1,1,n))?0:-1,t)}}function Pa(e,o){e&1&&(_(0,"tr")(1,"td",22)(2,"div",56)(3,"span"),v(4),d(5,"translate"),s()()()()),e&2&&(p(4),T(x(5,1,"steps.emptyMessage")))}function Ra(e,o){if(e&1&&r(0,Pa,6,3,"tr"),e&2){let t=l();c(t.focus()?0:-1)}}function ja(e,o){e&1&&f(0,"td",35)}function Da(e,o){e&1&&f(0,"td")}function $a(e,o){e&1&&f(0,"td")}function La(e,o){if(e&1&&r(0,Da,1,0,"td")(1,$a,1,0,"td"),e&2){let t=l(2);c(t.columnsState().checkbox.show?0:-1),p(),c(t.columnsState().tree.show?1:-1)}}function Ha(e,o){if(e&1&&(f(0,"td"),r(1,La,2,2)),e&2){let t=l();p(),c(t.focus()?-1:1)}}function Na(e,o){e&1&&R(0)}function Aa(e,o){if(e&1&&f(0,"lab-tooltip",67),e&2){let t=l(2).itemId;m("id",t)}}function Wa(e,o){if(e&1&&f(0,"lab-tooltip",134),e&2){let t=l(3).beltId;m("id",t)}}function Ua(e,o){if(e&1&&(_(0,"td",126)(1,"span",72),v(2),d(3,"rate"),s()(),_(4,"td",127)(5,"div",49)(6,"i",68),d(7,"iconClass"),r(8,Wa,1,1,"ng-template",null,6,M),s()()()),e&2){let t=h(9),n=l(2),i=n.belts,a=n.beltId,u=l();p(2),T(k(3,4,i,u.columnsState().belts.precision)),p(4),O(x(7,7,a)),m("pTooltip",t)}}function za(e,o){if(e&1&&f(0,"lab-tooltip",135),e&2){let t=l(4).wagonId;m("id",t)}}function qa(e,o){if(e&1&&(_(0,"i",68),d(1,"iconClass"),r(2,za,1,1,"ng-template",null,6,M),s()),e&2){let t=h(3),n=l(3).wagonId;O(x(1,3,n)),m("pTooltip",t)}}function Ja(e,o){if(e&1&&f(0,"lab-tooltip",136),e&2){let t=l(4).wagonId;m("id",t)}}function Ka(e,o){if(e&1&&(_(0,"i",68),d(1,"iconClass"),r(2,Ja,1,1,"ng-template",null,6,M),s()),e&2){let t=h(3),n=l(3).wagonId;O(x(1,3,n)),m("pTooltip",t)}}function Xa(e,o){if(e&1&&(_(0,"td",126)(1,"span",72),v(2),d(3,"rate"),s()(),_(4,"td",127)(5,"div",49),r(6,qa,4,5,"i",62)(7,Ka,4,5,"i",62),s()()),e&2){let t=l(2),n=t.wagons,i=t.wagonId,a=l();p(2),T(k(3,2,n,a.columnsState().wagons.precision)),p(4),c(a.data().cargoWagonIds.includes(i)?6:7)}}function Ga(e,o){if(e&1&&(_(0,"span",72),v(1),d(2,"machineRate"),s()),e&2){let t=l(2),n=t.machines,i=t.machineId,a=l();p(),T(gt(2,1,n,a.columnsState().machines.precision,i))}}function Qa(e,o){e&1&&(_(0,"div"),v(1),d(2,"translate"),s()),e&2&&(p(),j(" ",x(2,1,"steps.inputs")," "))}function Ya(e,o){if(e&1&&(_(0,"span"),v(1),s()),e&2){let t=l(2).recipeObjectiveId;p(),j("#",t,"")}}function Za(e,o){if(e&1&&f(0,"lab-tooltip",106),e&2){let t=l(2).recipeId;m("id",t)}}function tp(e,o){if(e&1&&f(0,"lab-tooltip",91),e&2){let t=l(2).machineId;m("id",t)}}function ep(e,o){e&1&&f(0,"i",137)}function np(e,o){e&1&&f(0,"i",137)}function ip(e,o){if(e&1&&(_(0,"span"),v(1),s()),e&2){let t=l(4).destRecipeObjectiveId;p(),j("#",t,"")}}function op(e,o){if(e&1&&f(0,"lab-tooltip",85),e&2){let t=l(4),n=t.destId,i=t.destIsRecipe;m("id",n)("type",i?"recipe":"item")}}function lp(e,o){if(e&1&&(_(0,"i",68),d(1,"iconClass"),r(2,ip,2,1,"span")(3,op,1,2,"ng-template",null,6,M),s()),e&2){let t=h(4),n=l(3),i=n.destId,a=n.destRecipeObjectiveId,u=n.destIsRecipe;O(k(1,4,i,u?"recipe":"item")),m("pTooltip",t),p(2),c(a?2:-1)}}function ap(e,o){e&1&&(_(0,"span"),v(1),d(2,"translate"),s()),e&2&&(p(),j(" ",x(2,1,"steps.outputs")," "))}function pp(e,o){if(e&1&&(r(0,ep,1,0,"i",137),_(1,"span",72),v(2),d(3,"rate"),d(4,"leftPad"),s(),r(5,np,1,0,"i",137)(6,lp,5,7,"i",62)(7,ap,3,3,"span")),e&2){let t=l(2),n=t.percent,i=t.percentOnDest,a=t.destId,u=t.outputs;c(i?0:-1),p(2),j("",x(4,8,k(3,5,n,-2)),"%"),p(3),c(i?-1:5),p(),c(a?6:-1),p(),c(u?7:-1)}}function _p(e,o){if(e&1&&(r(0,Na,1,0,"ng-container",89),_(1,"td",126)(2,"span",72),v(3),d(4,"rate"),s()(),_(5,"td",127)(6,"div",49)(7,"i",68),d(8,"iconClass"),r(9,Aa,1,1,"ng-template",null,6,M),s()()(),r(11,Ua,10,9)(12,Xa,8,5),_(13,"td",126),r(14,Ga,3,5,"span",72),s(),_(15,"td",133)(16,"div",28),r(17,Qa,3,3,"div"),_(18,"i",68),d(19,"iconClass"),r(20,Ya,2,1,"span")(21,Za,1,1,"ng-template",null,13,M),s(),_(23,"i",68),d(24,"iconClass"),r(25,tp,1,1,"ng-template",null,14,M),s(),r(27,pp,8,10),s()()),e&2){let t=h(10),n=h(22),i=h(26),a=l(),u=a.items,C=a.itemId,g=a.belts,y=a.beltId,b=a.wagons,V=a.wagonId,D=a.machines,W=a.machineId,N=a.recipeId,G=a.recipeObjectiveId,ft=a.percent,Q=a.inputs,ht=l(),xn=h(9);m("ngTemplateOutlet",xn),p(3),T(k(4,17,u,ht.columnsState().items.precision)),p(4),O(x(8,20,C)),m("pTooltip",t),p(4),c(ht.columnsState().belts.show&&g&&y?11:-1),p(),c(ht.columnsState().wagons.show&&b&&V?12:-1),p(2),c(D&&D.nonzero()&&!ht.data().machineEntities[W].hideRate?14:-1),p(3),c(Q?17:-1),p(),O(k(19,22,N,"recipe")),m("pTooltip",n),p(2),c(G?20:-1),p(3),O(x(24,25,W)),m("pTooltip",i),p(4),c(ft?27:-1)}}function sp(e,o){if(e&1&&(_(0,"tr",120),r(1,_p,28,27),s()),e&2){let t=o.itemId;p(),c(t?1:-1)}}function rp(e,o){e&1&&f(0,"td")}function cp(e,o){e&1&&f(0,"td")}function dp(e,o){e&1&&R(0)}function mp(e,o){e&1&&R(0)}function up(e,o){e&1&&R(0)}function Cp(e,o){e&1&&R(0)}function fp(e,o){if(e&1&&(_(0,"td",138)(1,"span",72),v(2),d(3,"power"),s()()),e&2){let t=l(3);p(2),T(gt(3,1,t.totals().power,t.columnsState().power.precision,t.effectivePowerUnit()))}}function xp(e,o){if(e&1&&(_(0,"td",138)(1,"span",72),v(2),d(3,"rate"),s()()),e&2){let t=l(3);p(2),T(k(3,1,t.totals().pollution,t.columnsState().pollution.precision))}}function gp(e,o){e&1&&f(0,"td")}function Sp(e,o){if(e&1&&(_(0,"tr"),f(1,"td"),r(2,rp,1,0,"td")(3,cp,1,0,"td"),_(4,"td",35),v(5),d(6,"translate"),s(),r(7,dp,1,0,"ng-container",125)(8,mp,1,0,"ng-container",125)(9,up,1,0,"ng-container",125)(10,Cp,1,0,"ng-container",125)(11,fp,4,5,"td",138)(12,xp,4,4,"td",138)(13,gp,1,0,"td"),s()),e&2){l();let t=h(2),n=l();p(2),c(n.columnsState().checkbox.show?2:-1),p(),c(n.columnsState().tree.show?3:-1),p(2),j(" ",x(6,14,"steps.total")," "),p(2),m("ngTemplateOutlet",t)("ngTemplateOutletContext",z(16,Yn,n.columnsState().belts,n.totals().belts)),p(),m("ngTemplateOutlet",t)("ngTemplateOutletContext",z(19,Zn,n.columnsState().wagons,n.totals().wagons)),p(),m("ngTemplateOutlet",t)("ngTemplateOutletContext",Kt(22,ti,n.columnsState().machines,n.totals().machines,n.totals().modules)),p(),m("ngTemplateOutlet",t)("ngTemplateOutletContext",Kt(26,ei,n.columnsState().beacons,n.totals().beacons,n.totals().beaconModules)),p(),c(n.columnsState().power.show?11:-1),p(),c(n.columnsState().pollution.show?12:-1),p(),c(n.columnsState().link.show?13:-1)}}function vp(e,o){if(e&1&&(_(0,"div",140)(1,"span",72),v(2),d(3,"rate"),s()()),e&2){let t=o.$implicit,n=l(2).columnSettings;p(2),T(k(3,1,t.value,n.precision))}}function hp(e,o){if(e&1&&f(0,"lab-tooltip",85),e&2){let t=l(2).$implicit,n=l(2).type;m("id",t.key)("type",n)}}function bp(e,o){if(e&1&&(_(0,"i",145),d(1,"iconClass"),r(2,hp,1,2,"ng-template",null,6,M),s()),e&2){let t=h(3),n=l().$implicit;O(x(1,3,n.key)),m("pTooltip",t)}}function Ip(e,o){if(e&1&&f(0,"lab-tooltip",106),e&2){let t=l(2).$implicit;m("id",t.key)}}function Tp(e,o){if(e&1&&(_(0,"i",145),d(1,"iconClass"),r(2,Ip,1,1,"ng-template",null,6,M),s()),e&2){let t=h(3),n=l().$implicit;O(k(1,3,n.key,"recipe")),m("pTooltip",t)}}function yp(e,o){if(e&1&&r(0,bp,4,5,"i",144)(1,Tp,4,6,"i",144),e&2){let t=o.$implicit,n=l(4);c(n.data().itemEntities[t.key]?0:1)}}function wp(e,o){if(e&1&&f(0,"lab-tooltip",97),e&2){let t=l().$implicit;m("id",t.key)}}function Ep(e,o){if(e&1&&(_(0,"div",146)(1,"span",72),v(2),s()(),_(3,"i",145),d(4,"iconClass"),r(5,wp,1,1,"ng-template",null,6,M),s()),e&2){let t=o.$implicit,n=h(6);p(2),T(t.value),p(),O(k(4,4,t.key,"item")),m("pTooltip",t.key!=="module"?n:void 0)}}function Bp(e,o){if(e&1&&(_(0,"td",139),L(1,vp,4,4,"div",140,J),d(3,"keyvalue"),s(),_(4,"td",141)(5,"div",49)(6,"div",142),L(7,yp,2,1,null,null,J),d(9,"keyvalue"),s(),_(10,"div",143),L(11,Ep,7,7,null,null,J),d(13,"keyvalue"),s()()()),e&2){let t=l(),n=t.totals,i=t.modulesTotals,a=l(2);p(),H(k(3,0,n,a.trackSvc.sortByValue)),p(6),H(k(9,3,n,a.trackSvc.sortByValue)),p(4),H(k(13,6,i,a.trackSvc.sortByValue))}}function kp(e,o){if(e&1&&r(0,Bp,14,9),e&2){let t=o.columnSettings;c(t.show?0:-1)}}function Mp(e,o){if(e&1&&r(0,Sp,14,30,"tr")(1,kp,1,1,"ng-template",null,15,M),e&2){let t=l();c(t.focus()?-1:0)}}var Qs=(()=>{class e{constructor(){this.document=P(Se),this.route=P(ye),this.ref=P(xe),this.contentSvc=P(Fe),this.exportSvc=P(nn),this.itemsSvc=P(kt),this.machinesSvc=P(Pe),this.objectivesSvc=P(De),this.preferencesSvc=P(Et),this.recipeSvc=P(Bt),this.recipesSvc=P(ct),this.routerSvc=P(Mt),this.settingsSvc=P(X),this.trackSvc=P(Je),this.focus=qt(!1),this.selectedId=qt(),this.stepsTable=re.required("stepsTable"),this.itemsState=this.itemsSvc.settings,this.itemsModified=this.itemsSvc.itemsModified,this.machinesState=this.machinesSvc.settings,this.recipesModified=this.objectivesSvc.recipesModified,this.stepsModified=this.objectivesSvc.stepsModified,this.stepTree=this.objectivesSvc.stepTree,this.stepDetails=this.objectivesSvc.stepDetails,this.stepById=this.objectivesSvc.stepById,this.stepByItemEntities=this.objectivesSvc.stepByItemEntities,this.effectivePowerUnit=this.objectivesSvc.effectivePowerUnit,this.totals=this.objectivesSvc.totals,this.settings=this.settingsSvc.settings,this.dispRateInfo=this.settingsSvc.displayRateInfo,this.beltSpeed=this.settingsSvc.beltSpeed,this.options=this.settingsSvc.options,this.columnsState=this.settingsSvc.columnsState,this.data=this.recipesSvc.adjustedDataset,this.preferences=this.preferencesSvc.state,this._steps=this.objectivesSvc.steps,this.steps=ge(()=>{let t=[...this._steps()];if(!this.focus())return t;let i=this.selectedId();return t.filter(a=>a.id===i)}),this.activeItemsEffect=Xt(()=>{let t=this.steps(),n=this.stepDetails();this.setActiveItems(t,n)}),this.toggleEffect=Xt(()=>{let t=this.focus(),n=this.steps()[0];t&&n&&(this.stepsTable().toggleRow(n),this.expandRow(n,!1))}),this.sortSteps$=new ne(null),this.activeItem={},this.stepDetailTab=Oe("stepDetailTab"),this.stepDetailIcon=je,this.ItemId=I,this.StepDetailTab=Re,this.ObjectiveUnit=Ve,this.rational=S,ie([this.sortSteps$.pipe(ae()),Te(this._steps)]).pipe(Ie()).subscribe(([[t,n],i])=>{this.sortSteps(t,n,i)})}ngOnInit(){this.route.fragment.pipe(le(),oe(t=>t!=null)).subscribe(t=>{this.fragmentId=t})}ngAfterViewInit(){this.loadFragmentId()}loadFragmentId(){if(this.fragmentId)try{let t=this.fragmentId,[n,i,a]=t.split("_"),u=this.steps(),C=this.stepDetails(),g=u.find(b=>b.id===i);if(g==null||!C[g.id].tabs.length)return;this.stepsTable().toggleRow(g),setTimeout(()=>{if(a){let b=this.document.querySelector(`#${t}`);b&&b.click()}else this.document.querySelector(`#${t}`)?.scrollIntoView()},10)}catch{}}sortSteps(t,n,i){if(n?.order==null||n.field==null)return;let a=n.order,u=n.field;if(t!=null&&t.field===u&&t.order!==a&&a===-1&&this.stepsTable!=null){n.data?.sort((C,g)=>i.indexOf(C)-i.indexOf(g)),this.stepsTable().sortOrder=0,this.stepsTable().sortField="",this.stepsTable().reset(),this.sortSteps$.next(null);return}n.data?.sort((C,g)=>(C[u]??S(0n)).sub(g[u]??S(0n)).toNumber()*a)}setActiveItems(t,n){t.forEach(i=>{this.updateActiveItem(i,n,!1)})}expandRow(t,n){n||this.updateActiveItem(t,this.stepDetails(),!0)}updateActiveItem(t,n,i){let a=vt.transform(t),u=this._getActiveItem(t,a,n,i);if(u){let C=vt.transform(t);this.activeItem[C]=u}}_getActiveItem(t,n,i,a){let u=this.activeItem[n],C=i[t.id];if(C==null)return null;if(u!=null){let y=C.tabs.find(b=>b.label===u.label);if(y!=null)return y}if(u==null&&!a)return null;let g=this.stepDetailTab();if(g){let y=C.tabs.find(b=>b.label===g);if(y!=null)return y}return C.tabs[0]}setActiveItem(t,n){if(n==null)return;let i=vt.transform(t);this.activeItem[i]=n,this.stepDetailTab.set(n.label)}resetStep(t){t.itemId&&this.itemsSvc.resetId(t.itemId),t.recipeObjectiveId?this.objectivesSvc.updateEntity(t.recipeObjectiveId,{machineId:void 0,fuelId:void 0,modules:void 0,beacons:void 0,overclock:void 0}):t.recipeId&&this.recipesSvc.resetId(t.recipeId)}changeItemExcluded(t,n){let i=tt(t,n,this.settings().excludedItemIds);this.settingsSvc.apply({excludedItemIds:i})}changeRecipesIncluded(t,n){let i=tt(t,!0,this.settings().excludedRecipeIds);i=tt(n,!1,i),this.settingsSvc.updateField("excludedRecipeIds",i,this.settings().defaultExcludedRecipeIds)}changeModulesBeacons(t,n){let i=t.recipeSettings;if(t.recipeId==null||i?.machineId==null)return;let a=t.recipeObjectiveId??t.recipeId,u=t.recipeObjectiveId!=null?this.objectivesSvc.updateEntity.bind(this.objectivesSvc):this.recipesSvc.updateEntity.bind(this.recipesSvc),C=this.data().machineEntities[i.machineId],g=this.machinesState()[i.machineId];n.modules&&(n.modules=this.recipeSvc.dehydrateModules(n.modules,Z(i.moduleOptions,[]),this.settings().moduleRankIds,C.modules,g.modules)),n.beacons&&(n.beacons=this.recipeSvc.dehydrateBeacons(n.beacons,g.beacons)),u(a,n)}changeBelts(t,n,i){t.itemId!=null&&(this.itemsSvc.updateEntityField(t.itemId,"stack",n.stack,S.one),this.itemsSvc.updateEntityField(t.itemId,"beltId",n.beltId,i))}changeStepChecked(t,n){if(t.itemId!=null){let i=tt(t.itemId,n,this.settings().checkedItemIds);this.settingsSvc.apply({checkedItemIds:i})}else if(t.recipeObjectiveId!=null){let i=tt(t.recipeObjectiveId,n,this.settings().checkedObjectiveIds);this.settingsSvc.apply({checkedObjectiveIds:i})}else if(t.recipeId!=null){let i=tt(t.recipeId,n,this.settings().checkedRecipeIds);this.settingsSvc.apply({checkedRecipeIds:i})}}resetChecked(){this.settingsSvc.apply({checkedItemIds:new Set,checkedObjectiveIds:new Set,checkedRecipeIds:new Set})}resetExcludedItems(t){this.settingsSvc.apply({excludedItemIds:new Set}),t.stopImmediatePropagation()}resetBelts(t){this.itemsSvc.resetFields("beltId"),t.stopImmediatePropagation()}resetWagons(t){this.itemsSvc.resetFields("wagonId"),t.stopImmediatePropagation()}resetMachines(t){let n=["machineId","overclock","modules","beacons"];this.objectivesSvc.resetFields(...n),this.recipesSvc.resetFields(...n),t.stopImmediatePropagation()}resetBeacons(){this.objectivesSvc.resetFields("beacons"),this.recipesSvc.resetFields("beacons")}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275cmp=et({type:e,selectors:[["lab-steps"]],viewQuery:function(n,i){n&1&&de(i.stepsTable,Un,5),n&2&&me()},inputs:{focus:[1,"focus"],selectedId:[1,"selectedId"]},standalone:!0,features:[lt],decls:15,vars:10,consts:[["stepsTable",""],["emptyCol2",""],["leftPad",""],["detailRow",""],["columnsDlg",""],["recipesSelect",""],["tooltip",""],["beltPicker",""],["overclockInput",""],["modulePicker",""],["beaconsOverlay",""],["expandTabMenu",""],["machineValueCell",""],["tooltipObj",""],["tooltipMach",""],["totalCell",""],["dataKey","id","styleClass","p-datatable-sm",3,"rowsChange","sortFunction","rowTrackBy","value","customSort","rowExpandMode","defaultSortOrder","paginator","rows","rowsPerPageOptions","showCurrentPageReport"],["pTemplate","header"],["pTemplate","body"],["pTemplate","rowexpansion"],["pTemplate","emptymessage"],["pTemplate","footer"],["colspan","100"],[1,"d-flex","gap-2","py-2"],["pButton","","pRipple","","type","button","icon","fa-solid fa-table-columns",1,"p-button-outlined",3,"click","label"],["pButton","","pRipple","","type","button","icon","fa-solid fa-file-arrow-down",1,"p-button-outlined",3,"label"],[1,"column-header-row"],["colspan","2","pSortableColumn","items"],[1,"d-flex","align-items-center"],["field","items"],["pButton","","pRipple","","type","button","icon","fa-solid fa-rotate-left",1,"ms-2","p-button-text","p-button-rounded",3,"pTooltip"],["colspan","2","pSortableColumn","belts"],["colspan","2","pSortableColumn","wagons"],["colspan","2","pSortableColumn","machines"],["field","machines"],["colspan","2"],["pSortableColumn","power"],["pSortableColumn","pollution"],["pButton","","pRipple","","type","button","icon","fa-solid fa-file-arrow-down",1,"p-button-outlined",3,"click","label"],[1,"d-flex","align-items-center","justify-content-center"],[1,"fa-solid","fa-square-check"],["pButton","","pRipple","","type","button","icon","fa-solid fa-rotate-left",1,"ms-2","p-button-text","p-button-rounded",3,"click","pTooltip"],["field","belts"],["field","wagons"],[1,"d-flex","align-items-center","justify-content-end"],["field","power"],["field","pollution"],[1,"w-0","px-0","px-sm-1"],[1,"fragment",3,"id"],[1,"d-flex"],["pButton","","pRipple","","type","button","icon","fa-solid fa-angle-right",1,"p-button-text","p-button-rounded","transition-ease",3,"click","pTooltip","pRowToggler"],[1,"px-0","px-sm-2"],[1,"overflow-hidden","px-0","px-sm-1","py-0"],["colspan","2",1,"px-0","px-sm-2"],[1,"px-0","px-sm-2","text-end"],[1,"w-0","px-0","ps-sm-1"],[1,"d-flex","justify-content-center"],[3,"onChange","binary","ngModel"],[1,"d-flex","align-items-center","links"],[1,"indent"],[1,"icon"],["pButton","","pRipple","","type","button",1,"hover-action","p-button-text",3,"hover-active","icon","pTooltip"],[3,"class","pTooltip"],[1,"connect",3,"trail","last"],[1,"connect"],["pButton","","pRipple","","type","button",1,"hover-action","p-button-text",3,"click","icon","pTooltip"],[1,"hover-icon","fa-solid","fa-eye-slash"],[3,"id"],[3,"pTooltip"],["type","recipe",3,"id","adjustedRecipe"],[1,"w-0","px-0","px-sm-2","text-end"],[1,"monospace","error-text"],[1,"monospace"],[1,"px-0","pe-sm-2"],[1,"find-text"],["labDropdownBase","icon",3,"pTooltip","ngModel","options"],["pButton","","pRipple","","type","button",1,"hover-action","p-button-text",3,"click","pTooltip"],[1,"p-button-icon"],[1,"hover-icon","fa-solid","fa-gear"],[3,"setValue"],["labDropdownBase","icon",3,"onChange","pTooltip","ngModel","options"],["pTemplate","selectedItem"],["pTemplate","item"],[1,"d-flex","align-items-center","py-2","w-100","h-100",3,"pTooltip"],[1,"ms-3","text-truncate"],[3,"id","type"],["type","pipe",3,"id"],["labDropdownBase","icon",3,"pTooltip","options","ngModel"],["suffix","%","inputStyleClass","text-end",3,"min","max","step","maxFractionDigits","size","pTooltip","ngModel"],[4,"ngTemplateOutlet"],["labDropdownBase","icon",3,"onChange","pTooltip","options","ngModel"],["type","machine",3,"id"],["suffix","%","inputStyleClass","text-end",3,"onBlur","min","max","step","maxFractionDigits","size","pTooltip","ngModel"],[1,"padded",3,"pTooltip"],["type","fuel",3,"id"],["labDropdownBase","icon","labNoDrag","",3,"pTooltip","ngModel","options"],["labDropdownBase","icon","labNoDrag","",3,"onChange","pTooltip","ngModel","options"],["type","module",3,"id"],["pButton","","pRipple","","type","button",1,"hover-action","modules","p-button-text",3,"click","pTooltip"],[1,"p-button-icon",3,"class"],["inputId","enabled-recipes","styleClass","icon","appendTo","body","scrollHeight","40vh","panelStyleClass","tooltip",3,"ngModel","options","pTooltip"],["inputId","enabled-recipes","styleClass","icon","appendTo","body","scrollHeight","40vh","panelStyleClass","tooltip",3,"ngModelChange","onPanelHide","ngModel","options","pTooltip"],["pTemplate","selectedItems"],["type","recipe",3,"id","adjustedRecipe","action"],[1,"fa-solid","fa-flask-vial"],[1,"d-flex","align-items-center","p-2","w-100","h-100",3,"pTooltip"],["type","recipe",3,"id"],["pButton","","pRipple","","type","button",1,"hover-action","icons","p-button-text","flex-column",3,"click","pTooltip"],[1,"p-button-icon","sum",3,"class"],[1,"p-button-icon","sum"],["type","beacon",3,"id"],["target","_blank","routerLink",".",1,"text-decoration-none",3,"queryParams"],["pButton","","pRipple","","type","button","icon","fa-solid fa-arrow-up-right-from-square","tooltipPosition","left",1,"p-button-text","p-button-rounded",3,"pTooltip"],["pButton","","pRipple","","type","button","icon","fa-solid fa-rotate-left","tooltipPosition","left",1,"p-button-text","p-button-rounded",3,"pTooltip"],["pButton","","pRipple","","type","button","icon","fa-solid fa-rotate-left","tooltipPosition","left",1,"p-button-text","p-button-rounded",3,"click","pTooltip"],[1,"detail","tabs"],[1,"px-1"],["routerLink",".","queryParamsHandling","preserve",1,"text-decoration-none",3,"relativeTo","fragment"],["pButton","","pRipple","","type","button","icon","fa-solid fa-link",1,"p-button-text","p-button-rounded"],[3,"activeItemChange","model","activeItem"],[1,"detail"],[1,"p-menuitem-link",3,"id"],[1,"p-menuitem-icon"],[1,"p-menuitem-text"],["colspan","100",1,"fw-bold"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"w-0","text-end"],[1,"ps-0"],[1,"lab-icon","time"],[3,"innerHTML"],[1,"mw-0"],[1,"fa-solid","fa-arrow-right","mx-3"],["colspan","100",1,"py-4"],["colspan","100",1,"p-0"],["type","belt",3,"id"],["type","cargo-wagon",3,"id"],["type","fluid-wagon",3,"id"],[1,"m-1","p-2","fa-solid","fa-arrow-right"],[1,"text-end","inherit"],[1,"w-0","text-end","inherit"],[1,"py-2","icon-height"],[1,"ps-0","inherit"],[1,"d-flex","flex-column","justify-content-center"],[1,"modules-column"],[1,"d-block",3,"class","pTooltip"],[1,"d-block",3,"pTooltip"],[1,"p-2","icon-height","text-end"]],template:function(n,i){if(n&1){let a=F();_(0,"p-table",16,0),B("rowsChange",function(C){return w(a),E(i.preferencesSvc.apply({rows:C}))})("sortFunction",function(C){return w(a),E(i.sortSteps$.next(C))}),r(2,Ii,30,22,"ng-template",17)(3,fl,2,3,"ng-template",18)(4,Fa,2,3,"ng-template",19)(5,Ra,1,1,"ng-template",20)(6,ja,1,0,"ng-template",null,1,M)(8,Ha,2,1,"ng-template",null,2,M)(10,sp,2,1,"ng-template",null,3,M)(12,Mp,3,1,"ng-template",21),s(),f(13,"lab-columns",null,4)}n&2&&m("rowTrackBy",i.trackSvc.trackStep)("value",i.steps())("customSort",!0)("rowExpandMode",i.focus()?"single":"multiple")("defaultSortOrder",-1)("paginator",!i.focus()&&!i.preferences().disablePaginator)("rows",i.preferences().rows)("rowsPerPageOptions",Y(9,zn))("showCurrentPageReport",!0)},dependencies:[he,ut,dt,mt,be,ve,we,st,_t,pt,jt,Rt,Pt,Ft,Nt,Ht,Xe,Ke,Wt,At,Ge,Ye,Qe,ze,Ue,Ot,Vt,on,Ze,un,Cn,Dt,Le,$t,an,pn,_n,tn,qe,sn,q,rn,vt,Lt,rt],styles:[".links[_ngcontent-%COMP%]{height:50px}.links[_ngcontent-%COMP%] .connect[_ngcontent-%COMP%]{position:relative;margin-left:16px;height:100vh}.links[_ngcontent-%COMP%] .connect.last[_ngcontent-%COMP%], .links[_ngcontent-%COMP%] .connect.trail[_ngcontent-%COMP%]{border-left:2px dotted var(--text-color-secondary)}.links[_ngcontent-%COMP%] .connect.last[_ngcontent-%COMP%]:not(.trail){margin-bottom:50vh;height:50vh}.links[_ngcontent-%COMP%] .connect[_ngcontent-%COMP%] + .connect[_ngcontent-%COMP%]{margin-left:24px}@media (max-width: 1199.98px){.links[_ngcontent-%COMP%] .connect[_ngcontent-%COMP%]{margin-left:8px}.links[_ngcontent-%COMP%] .connect[_ngcontent-%COMP%] + .connect[_ngcontent-%COMP%]{margin-left:16px}}.links[_ngcontent-%COMP%] .indent[_ngcontent-%COMP%]{margin-left:0;border-top:2px dotted var(--text-color-secondary);width:8px}.links[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px}[_nghost-%COMP%] .p-dropdown:not(:is(:hover, :focus, .ng-invalid)), [_nghost-%COMP%] .p-inputtext:not(:is(:hover, :focus, .ng-invalid)), [_nghost-%COMP%] .p-multiselect:not(:is(:hover, :focus, .ng-invalid)){border-color:transparent;background-color:transparent}tr.detail[_ngcontent-%COMP%]{background-color:var(--surface-ground)}tr.detail.tabs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{border-bottom-color:transparent}[_nghost-%COMP%] tr.detail .p-tabmenu .p-tabmenu-nav .p-tabmenuitem:not(.p-highlight) .p-menuitem-link{background-color:transparent}.icon-height[_ngcontent-%COMP%]{min-height:32px}.modules-column[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;margin:auto}.fragment[_ngcontent-%COMP%]{position:absolute;top:-10rem;visibility:hidden}.column-header-row[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{height:48px}"],changeDetection:0})}}return e})();export{en as a,nn as b,Qs as c};