@spinnaker/titus 0.5.27 → 0.5.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"angular";import{module as t}from"angular";import{InstanceInformation as n,getAllTargetGroups as r,InstanceStatus as a,VpcReader as s,ServerGroupSecurityGroupsRemoved as i,SecurityGroupSelector as o,AWSProviderSettings as l,SubnetSelectField as c,ServerGroupCapacity as u,ServerGroupLoadBalancers as d,ServerGroupSecurityGroups as m,MetricAlarmChart as p,TargetMetricFields as g,TargetTrackingAdditionalSettings as h,AlarmConfigurer as f,StepPolicyAction as v,ScalingPolicyAdditionalSettings as y,PolicyTypeSelectionModal as b,AmazonLoadBalancersTag as C}from"@spinnaker/amazon";import{HelpContentsRegistry as E,CollapsibleSection as w,LabeledValueList as S,LabeledValue as k,CopyToClipboard as N,LinkWithClipboard as A,ReactInject as G,AccountService as T,ReactInjector as I,FirewallLabels as D,ConfirmationModalService as x,InstanceWriter as P,overridableComponent as O,InstanceDetailsHeader as L,InstanceActions as M,InstanceInsights as F,ConsoleOutputLink as z,InstanceLinks as j,useData as B,InstanceReader as R,SETTINGS as V,InstanceDetailsPane as W,Spinner as H,RecentHistoryService as Z,ClusterState as U,UrlBuilder as q,Registry as J,StageConstants as K,NameUtils as X,ExecutionDetailsSection as Y,AccountTag as Q,Markdown as $,RenderOutputFile as _,StageFailureMessage as ee,DeployingIntoManagedClusterWarning as te,AccountSelectInput as ne,RegionSelectField as re,HelpField as ae,ServerGroupDetailsField as se,DeploymentStrategySelector as ie,ServerGroupNamePreview as oe,SpelNumberInput as le,ValidationMessage as ce,FormValidator as ue,FormikFormField as de,TextInput as me,SelectInput as pe,LayoutProvider as ge,MapEditorInput as he,PlatformHealthOverrideInput as fe,useFormInputValueMapper as ve,robotToHuman as ye,ChecklistInput as be,CheckboxInput as Ce,CACHE_INITIALIZER_SERVICE as Ee,LOAD_BALANCER_READ_SERVICE as we,SECURITY_GROUP_READER as Se,setMatchingResourceSummary as ke,SubnetReader as Ne,NumberInput as Ae,SpinFormik as Ge,ReactSelectInput as Te,ResponsiveFieldLayout as Ie,TetheredSelect as De,StageConfigField as xe,MapEditor as Pe,ExecutionDetailsTasks as Oe,TaskMonitor as Le,ReactModal as Me,DeployInitializer as Fe,WizardModal as ze,WizardPage as je,noop as Be,TaskMonitorWrapper as Re,ModalClose as Ve,PlatformHealthOverride as We,UserVerification as He,MinMaxDesiredChanges as Ze,ModalHeader as Ue,ModalBody as qe,ModalFooter as Je,ServerGroupReader as Ke,DesiredCapacity as Xe,CurrentCapacity as Ye,showModal as Qe,Overridable as $e,confirmNotManaged as _e,TaskMonitorModal as et,withErrorBoundary as tt,TaskExecutor as nt,SubmitButton as rt,SERVER_GROUP_WRITER as at,TextAreaInput as st,ClusterTargetBuilder as it,ServerGroupWarningMessageService as ot,ApplicationNameValidator as lt,CloudProviderRegistry as ct,DeploymentStrategyRegistry as ut}from"@spinnaker/core";import*as dt from"react";import mt,{useMemo as pt}from"react";import{UISref as gt}from"@uirouter/react";import{UIRouterContextComponent as ht}from"@uirouter/react-hybrid";import ft,{sortBy as vt,get as yt,chain as bt,xor as Ct,isUndefined as Et,intersection as wt,set as St,union as kt,cloneDeep as Nt,flatten as At,isEqual as Gt,defaultsDeep as Tt}from"lodash";import It from"@uirouter/angularjs";import{DockerImageUtils as Dt,DockerImageAndTagSelector as xt}from"@spinnaker/docker";import{$q as Pt}from"ngimport";import{Field as Ot,Form as Lt}from"formik";import Mt from"react-select";import{Subject as Ft}from"rxjs";import{Modal as zt}from"react-bootstrap";import{react2angular as jt}from"react2angular";import Bt from"pretty-ms";const Rt={"titus.deploy.runtimeLimitSecs":"<p>Maximum amount of time (in seconds) a batch job is allowed to run</p>","titus.deploy.retries":"<p>Number of times to retry this job</p>","titus.deploy.propertyFile":"<p>(Optional) Configures the name to the file used to pass in properties to later stages in the Spinnaker pipeline. The file must be saved into the /logs directory during execution</p>","titus.deploy.iamProfile":"AWS IAM instance profile to assign to this service","titus.deploy.capacityGroup":"Used by Titus to ensure capacity guarantees, defaults to the application name if not provided","titus.deploy.command":"<p>(Optional) Defines one or more custom commands. If multiple commands are defined, they must be comma delimited with no spaces: <b>cmd1,cmd2</b></p>","titus.deploy.entrypoint":"<p>(Optional) Defines one or more entrypoints. If multiple entrypoints are defined, they must be comma delimited with no spaces: <b>entry1,entry2</b></p>","titus.deploy.migrationPolicy":"Defines how the tasks for this job will be migrated during an infrastructure change","titus.deploy.network":"Amount of networking bandwidth to allocate in Mbps","titus.deploy.gpu":"Number of GPUs to use. WARNING: only use if directed by Titus team, otherwise leave at 0","titus.deploy.softConstraints":"Soft constraints are enforced on a best efforts basis. For example, if tasks can’t be perfectly balanced across zones, the best available balance is achieved without keeping the tasks pending for execution.","titus.deploy.hardConstraints":"Constraints must be met and tasks will not be launched if constraint can’t be perfectly met","titus.deploy.efs":"if completed, allows you to specify an EFS volume to attach to each Task that gets created for the Job","titus.deploy.mountPoint":"(Required) A valid directory to mount the volume, e.g, <samp>/efs</samp>. Invalid locations are <samp>/</samp>, <samp>/data</samp>, and <samp>/logs</samp> as these are reserved directories.","titus.deploy.efsId":"(Required) The EFS file system ID, e.g. <samp> fs-0208c74b</samp>.","titus.deploy.efsRelativeMountPoint":"(Optional) Relative dir within FS ID, e.g. <samp>/dirInVol</samp>","titus.job.waitForCompletion":"if unchecked, marks the stage as successful right away without waiting for the job to complete","titus.bake.fromGitTrigger":"If checked, gets git details from the specified git trigger.","titus.bake.repositoryUrl":"Url to the git repository containing the code to create the Docker image from, <samp>ssh://git@stash.corp.netflix.com:7999/SPKR/orca.git</samp> or <samp>ssh://git@github.com/spinnaker/orca.git</samp>","titus.bake.repositoryHash":"(Optional) The hashcode to the git commit for the image","titus.bake.repositoryBranch":"(Optional) The branch in git to build the image from","titus.bake.repositoryDirectory":"(Optional) If specified, will build the image from the Dockerfile contained in this directory. Default to project root.","titus.bake.imageOrganization":"(Optional) The organization to which this image belongs to, e.g. <samp>spinnaker</samp> for <samp>spinnaker/igor</samp>Defaults to none.","titus.bake.imageName":"(Optional) The name for the image, e.g. <samp>igor</samp> for <samp>spinnaker/igor</samp>Defaults to [git project name].[git repo name].","titus.bake.tags":"(Optional) Comma separated. By default, the <samp>latest</samp> tag is updated. Adds additional tags to label this image <samp>1.0.0-unstable,1.0.0-rc1</samp>","titus.bake.buildParameters":"(Optional) Build time variables to be passed to the Docker image. These are the set of values passed to --build-args in the command line.","titus.serverGroup.subnet":"The subnet selection determines the VPC in which your container will run. Options vary by account and region. The most common are: \n <ul>\n <li><b>titus</b>: instances will be restricted to internal clients with their own NAT gateways</li>\n <li><b>internal</b> instances will be restricted to internal clients (i.e. require VPN access)</li>\n <li><b>external</b> instances will be publicly accessible and running in VPC</li>\n </ul>\n ","titus.serverGroup.traffic":'\n <p>Enables the "inService" scaling process, which is used by Spinnaker and discovery services to determine if the server group is enabled.</p>\n <p>Will be automatically enabled when any non "custom" deployment strategy is selected.</p>',"titus.deploy.imageId":"This value has been manually overridden. To edit this value, please update the <b><i>imageId</i></b> attribute in the stage JSON. Spinnaker expects this to follow the <b><i>name:tag</i></b> format, or the <b><i>imageName</i></b> directly from Jenkins","titus.deploy.securityGroups":"AWS Security Groups to assign to this service. Security groups are set only if <samp>Allocate IP?</samp> has been selected and are assigned to the Titus AWS Elastic Network Interface.","titus.job.capacityGroup":"Capacity Group will default to application name if not specified.","titus.job.securityGroups":"AWS Security Groups to assign to this job","titus.autoscaling.cooldown":"\n <p>The amount of time, in seconds, after a scaling activity completes where previous trigger-related scaling\n activities can influence future scaling events.</p>\n <p>For scale out policies, while the cooldown period is in effect, the capacity that has been added by the\n previous scale out event that initiated the cooldown is calculated as part of the desired capacity for the next\n scale out. The intention is to continuously (but not excessively) scale out. For example, an alarm triggers a\n step scaling policy to scale out an Amazon ECS service by 2 tasks, the scaling activity completes successfully,\n and a cooldown period of 5 minutes starts. During the Cooldown period, if the alarm triggers the same policy\n again but at a more aggressive step adjustment to scale out the service by 3 tasks, the 2 tasks that were added\n in the previous scale out event are considered part of that capacity and only 1 additional task is added to the desired count.</p>\n <p>For scale in policies, the cooldown period is used to block subsequent scale in requests until it has expired.\n The intention is to scale in conservatively to protect your application's availability. However, if another\n alarm triggers a scale out policy during the cooldown period after a scale in, Application Auto Scaling scales\n out your scalable target immediately.</p>\n ","titus.autoscaling.scaleIn.cooldown":"\n <p>The amount of time, in seconds, after a scale in activity completes before another scale in activity can start.</p>\n <p>The cooldown period is used to block subsequent scale in requests until it has expired. The intention is to scale\n in conservatively to protect your application's availability. However, if another alarm triggers a scale out policy\n during the cooldown period after a scale in, Application Auto Scaling scales out your scalable target immediately.</p>\n ","titus.autoscaling.scaleOut.cooldown":"\n <p>The amount of time, in seconds, after a scale out activity completes before another scale out activity can start.</p>\n <p>While the cooldown period is in effect, the capacity that has been added by the previous scale out event that\n initiated the cooldown is calculated as part of the desired capacity for the next scale out. The intention is to\n continuously (but not excessively) scale out.</p>\n ","titus.disruptionbudget.description":'\n <p>\n The Job Disruption Budget is part of the job descriptor, and defines the behavior of how containers of the\n job can be relocated.\n <a href="http://manuals.test.netflix.net/view/titus-docs/mkdocs/master/disruption_budget/" target="_blank">\n Read the full documentation\n </a>\n </p>\n '};Object.keys(Rt).forEach((e=>E.register(e,Rt[e])));const Vt=({containerIp:e,host:t,instancePort:n,ipv6Address:r})=>dt.createElement(w,{heading:"DNS",defaultExpanded:!0},dt.createElement(S,{className:"dl-horizontal dl-narrow"},e&&dt.createElement(k,{label:"Container IP",value:dt.createElement(dt.Fragment,null,e,dt.createElement(N,{text:e,toolTip:"Copy container IP to clipboard"}))}),r&&dt.createElement(k,{label:"Container IPv6",value:dt.createElement(A,{text:r,url:`http://${r}:${n}`})}),dt.createElement(k,{label:"Host IP",value:t}))),Wt=({instance:e,titusUiEndpoint:t})=>{const{id:r,jobId:a}=e;return mt.createElement(w,{heading:"Instance Information",defaultExpanded:!0},mt.createElement("dl",{className:"dl-horizontal dl-narrow"},mt.createElement(n,{account:e.account,availabilityZone:e.availabilityZone,instanceType:e.instanceType,launchTime:e.launchTime,provider:e.provider,region:e.region,serverGroup:e.serverGroup}),mt.createElement(k,{label:"Job Id",value:mt.createElement("a",{href:`${t}jobs/${a}`,target:"_blank"},a)}),mt.createElement(k,{label:"Instance Id",value:mt.createElement(A,{text:r,url:`${t}jobs/${a}/tasks/${r}`})})))};class Ht extends G{get titusServerGroupTransformer(){return this.$injector.get("titusServerGroupTransformer")}get titusServerGroupCommandBuilder(){return this.$injector.get("titusServerGroupCommandBuilder")}get titusServerGroupConfigurationService(){return this.$injector.get("titusServerGroupConfigurationService")}get titusSecurityGroupReader(){return this.$injector.get("titusSecurityGroupReader")}initialize(e){this.$injector=e}}const Zt=new Ht;class Ut extends mt.Component{constructor(e){super(e),this.state={}}componentDidMount(){this.configureSecurityGroups(this.props)}configureSecurityGroups(e){const{app:t,serverGroup:n}=e,{region:r}=n;if(t.securityGroupsIndex&&n.accountDetails){const e=n.securityGroups.map((e=>Zt.titusSecurityGroupReader.resolveIndexedSecurityGroup(t.securityGroupsIndex,{account:n.accountDetails.awsAccount,region:r},e)));this.setState({securityGroups:e})}else T.listAllAccounts("titus").then((e=>{const t=e.find((e=>e.name===n.account));t&&t.awsAccount&&I.securityGroupReader.getAllSecurityGroups().then((e=>{const a=e[t.awsAccount].aws[r],s=n.securityGroups.map((e=>a.find((t=>t.id===e)))).filter((e=>e)).map((e=>({account:t.awsAccount,name:e.name,id:e.id,vpcId:e.vpcId})));this.setState({securityGroups:s})}))}))}componentWillReceiveProps(e){this.configureSecurityGroups(e)}render(){const{serverGroup:e}=this.props,{securityGroups:t}=this.state,n=!t&&(e.securityGroups||[]).length;return mt.createElement(w,{heading:D.get("Firewalls"),outerDivClassName:""},mt.createElement("ul",null,n&&e.securityGroups.map((e=>mt.createElement("li",{key:e},"..."))),mt.createElement(ht,null,mt.createElement(mt.Fragment,null,vt(t,"name").map((t=>mt.createElement("li",{key:t.name},mt.createElement(gt,{to:"^.firewallDetails",params:{name:t.name,accountId:t.account,region:e.region,vpcId:t.vpcId,provider:"aws"}},mt.createElement("a",null,t.name," (",t.id,")")))))))))}}const qt=(e,t,n)=>e.map((e=>{var r;const a=t.find((t=>(t.name===e.name||t.name===e.targetGroupName)&&t.account===n)),s="traffic-port"===(null==a?void 0:a.healthCheckPort)||!(null==a?void 0:a.healthCheckPort);return{...e,name:null==a?void 0:a.name,healthCheckPath:a?`:${s?null==a?void 0:a.port:a.healthCheckPort}${(null==a?void 0:a.healthCheckPath)||""}`:void 0,healthCheckProtocol:null==(r=null==a?void 0:a.healthCheckProtocol)?void 0:r.toLowerCase()}})),Jt=(e,t,n)=>{const a=(e||[]).filter((e=>"Unknown"!==e.state)),s=r(t);return a.map((e=>{if("TargetGroup"===e.type){const t=qt(e.targetGroups,s,n);return{...e,targetGroups:t}}return e}))},Kt=(e,t)=>()=>{const n={application:t,title:`Terminating ${e.id}`,onTaskComplete:()=>{I.$state.includes("**.instanceDetails",{id:e.id})&&I.$state.go("^")}};x.confirm({header:`Really terminate ${e.id}?`,buttonText:`Terminate ${e.id}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>{const n={cloudProvider:"titus"};return e.serverGroup&&(n.serverGroupName=e.serverGroup),P.terminateInstance(e,t,n)}})},Xt=(e,t)=>()=>{const n={application:t,title:`Terminating ${e.id} and shrinking server group`,onTaskComplete:()=>{I.$state.includes("**.instanceDetails",{instanceId:e.id})&&I.$state.go("^")}};x.confirm({header:`Really terminate ${e.id} and shrink ${e.serverGroup}?`,buttonText:`Terminate ${e.id} and shrink ${e.serverGroup}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>P.terminateInstancesAndShrinkServerGroups([{cloudProvider:e.cloudProvider,instanceIds:[e.id],account:e.account,region:e.region,serverGroup:e.serverGroup,instances:[e]}],t)})},Yt=(e,t)=>()=>{const n={application:t,title:`Enabling ${e.id} in discovery`};x.confirm({header:`Really enable ${e.id} in discovery?`,buttonText:`Enable ${e.id}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>P.enableInstanceInDiscovery(e,t)})},Qt=(e,t)=>()=>{const n={application:t,title:`Disabling ${e.id} in discovery`};x.confirm({header:`Really disable ${e.id} in discovery?`,buttonText:`Disable ${e.id}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>P.disableInstanceInDiscovery(e,t)})},$t=(e,t)=>{const n=[{label:"Terminate",triggerAction:Kt(e,t)},{label:"Terminate and Shrink Server Group",triggerAction:Xt(e,t)}],r=(e.health||[]).filter((e=>"Discovery"===e.type));r.length&&"OutOfService"===r[0].state&&n.push({label:"Enable in Discovery",triggerAction:Yt(e,t)});return(r||[]).some((e=>"Up"===e.state||"Down"===e.state))&&n.push({label:"Disable in Discovery",triggerAction:Qt(e,t)}),n},_t=O((({account:e,actions:t,app:n,baseIpAddress:r,environment:s,healthMetrics:i,instance:o,instanceId:l,instancePort:c,loading:u,moniker:d,serverGroup:m,region:p})=>{var g,h,f;const v=`ssh -t ${null==e?void 0:e.bastionHost} 'titus-ssh -region ${p} ${l}'`;return dt.createElement("div",{className:"details-panel"},dt.createElement("div",{className:"header"},dt.createElement(L,{healthState:o.healthState,instanceId:l,loading:u,sshLink:v,standalone:n.isStandalone}),dt.createElement("div",{className:"actions"},dt.createElement(M,{actions:t}),Boolean(null==(g=null==o?void 0:o.insightActions)?void 0:g.length)&&dt.createElement(F,{analytics:!0,insights:o.insightActions,instance:o}))),dt.createElement("div",{className:"content"},dt.createElement(Wt,{instance:o,titusUiEndpoint:o.titusUiEndpoint}),dt.createElement(a,{healthMetrics:i,healthState:o.healthState,metricTypes:["TargetGroup"],privateIpAddress:o.privateIpAddress}),dt.createElement(Vt,{containerIp:null==(h=o.placement)?void 0:h.containerIp,host:null==(f=o.placement)?void 0:f.host,instancePort:c,ipv6Address:o.ipv6Address}),dt.createElement("div",{className:"collapsible-section"},dt.createElement(Ut,{app:n,serverGroup:m})),dt.createElement(w,{heading:"Console Output"},dt.createElement(z,{instance:o})),dt.createElement(j,{address:r,application:n,instance:o,environment:s,moniker:d})))}),"titus.instance.details.content"),en=({app:e,environment:t,instance:n,moniker:r})=>{var a,s,i;const{instanceId:o}=n,l=e.serverGroups.data.find((e=>e.instances.some((e=>e.id===o)))),{account:c,region:u}=l,d=()=>(Z.addExtraDataToLatest("instances",{account:c,region:u,serverGroup:l.name}),Promise.all([R.getInstanceDetails(c,u,o).then((e=>({...e,account:c,region:u}))),T.getAccountDetails(c)])),m=e=>{const[t,n]=e,r=((null==n?void 0:n.regions)||[]).find((e=>e.name===u));return[{titusUiEndpoint:null==r?void 0:r.endpoint,...t},n]},{result:[p,g],status:h}=B((()=>e.isStandalone?d().then((e=>m(e))):e.serverGroups.ready().then(d).then((e=>m(e)))),[{},{}],[o,l]),f=$t(p,e),v=Jt(p.health,e.loadBalancers.data,g.awsAccount),y="PENDING"===h,b=(null==(a=e.attributes)?void 0:a.instancePort)||V.defaultInstancePort||"80",C=(null==(s=p.placement)?void 0:s.containerIp)||(null==(i=null==p?void 0:p.placement)?void 0:i.host);return y?dt.createElement(W,null,dt.createElement("div",{className:"horizontal center middle"},dt.createElement(H,{size:"small"}))):(null==p?void 0:p.id)?dt.createElement(_t,{account:g,actions:f,app:e,baseIpAddress:C,environment:t,healthMetrics:v,instance:p,instanceId:n.instanceId,instancePort:b,moniker:r,loading:y,serverGroup:l,region:u}):dt.createElement("div",{className:"details-panel"},dt.createElement("div",{className:"header"},dt.createElement(W,null,dt.createElement("div",{className:"header-text horizontal middle"},dt.createElement("h3",{className:"horizontal middle space-between flex-1"},n.instanceId)))),dt.createElement("div",{className:"content"},dt.createElement("div",{className:"content-section"},dt.createElement("div",{className:"content-body text-center"},dt.createElement("h3",null,"Instance not found.")))))};t("spinnaker.titus.pipeline.stage.cloneServerGroup.executionDetails.controller",[It]).controller("titusCloneServerGroupExecutionDetailsCtrl",["$scope","$stateParams","executionDetailsSectionService",function(e,t,n){e.configSections=["cloneServerGroupConfig","taskStatus"];const r=()=>{const n=r["kato.tasks"][0].resultObjects;e.detailsSection=t.details;const r=e.stage.context||{},a=[];r&&r["kato.tasks"]&&r["kato.tasks"].length&&n&&n.length&&function(e){const s=ft.find(n,e);s&&ft.forEach(s[e],(e=>{if(e.includes(":")){const[n,s]=e.split(":"),i={type:"serverGroups",application:r.application,serverGroup:s,account:r.credentials,region:n,provider:"titus",project:t.project};i.href=q.buildFromMetadata(i),a.push(i)}}))}("serverGroupNames"),e.deployed=a};this.overrideFiltersForUrl=e=>U.filterService.overrideFiltersForUrl(e);const a=()=>n.synchronizeSection(e.configSections,r);a(),e.$on("$stateChangeSuccess",a)}]);t("spinnaker.titus.pipeline.stage.cloneServerGroupStage",["spinnaker.titus.pipeline.stage.cloneServerGroup.executionDetails.controller"]).config((function(){J.pipeline.registerStage({provides:"cloneServerGroup",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupStage.html",executionDetailsUrl:"titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupExecutionDetails.html",executionStepLabelUrl:"titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupStepLabel.html",validators:[{type:"requiredField",fieldName:"targetCluster",fieldLabel:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"region"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusCloneServerGroupStageCtrl",["$scope",function(e){const t=e.stage;e.viewState={accountsLoaded:!1},T.listAccounts("titus").then((t=>{e.accounts=t,e.viewState.accountsLoaded=!0})),this.cloneTargets=K.TARGET_LIST,t.target=t.target||this.cloneTargets[0].val,t.application=e.application.name,t.cloudProvider="titus",t.cloudProviderType="titus",t.viewState={mode:"editPipeline"},t.isNew&&e.application.attributes.platformHealthOnlyShowOverride&&e.application.attributes.platformHealthOnly&&(t.interestingHealthProviderNames=["Titus"]),!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),this.targetClusterUpdated=()=>{if(t.targetCluster){const e=X.parseServerGroupName(t.targetCluster);t.stack=e.stack,t.freeFormDetails=e.freeFormDetails}else t.stack="",t.freeFormDetails=""},e.$watch("stage.targetCluster",this.targetClusterUpdated),this.removeCapacity=()=>{delete t.capacity},ft.has(t,"useSourceCapacity")||(t.useSourceCapacity=!0),this.toggleSuspendedProcess=e=>{t.suspendedProcesses=t.suspendedProcesses||[];const n=t.suspendedProcesses.indexOf(e);-1===n?t.suspendedProcesses.push(e):t.suspendedProcesses.splice(n,1)},this.processIsSuspended=e=>t.suspendedProcesses&&t.suspendedProcesses.includes(e),this.onRedBlackFieldChange=(e,n)=>{ft.set(t,e,n)}}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupStage.html",'<div ng-controller="titusCloneServerGroupStageCtrl as cloneServerGroupStageCtrl">\n <div ng-if="!pipeline.strategy">\n <div ng-if="viewState.loading">\n <h4 class="text-center">\n <span us-spinner="{radius:20, width:6, length: 12}"></span>\n </h4>\n </div>\n <div ng-if="!viewState.loading">\n <account-region-cluster-selector\n application="application"\n component="stage"\n accounts="accounts"\n single-region="true"\n cluster-field="targetCluster"\n >\n </account-region-cluster-selector>\n </div>\n </div>\n <stage-config-field label="Target">\n <target-select model="stage" options="cloneServerGroupStageCtrl.cloneTargets"></target-select>\n </stage-config-field>\n <div>\n <div class="form-group">\n <div class="col-md-3 sm-label-right">Capacity</div>\n <div class="col-md-9 radio">\n <label>\n <input\n type="radio"\n ng-model="stage.useSourceCapacity"\n ng-value="true"\n ng-click="cloneServerGroupStageCtrl.removeCapacity()"\n id="useSourceCapacityTrue"\n />\n Copy the capacity from the current server group\n <help-field key="serverGroupCapacity.useSourceCapacityTrue"></help-field>\n </label>\n </div>\n <div class="col-md-9 col-md-offset-3 radio">\n <label>\n <input type="radio" ng-model="stage.useSourceCapacity" ng-value="false" id="useSourceCapacityFalse" />\n Let me specify the capacity\n <help-field key="serverGroupCapacity.useSourceCapacityFalse"></help-field>\n </label>\n </div>\n </div>\n <div class="form-group">\n <div class="col-md-2 col-md-offset-3">Min</div>\n <div class="col-md-2">Max</div>\n <div class="col-md-2">Desired</div>\n </div>\n <div class="form-group">\n <div class="col-md-2 col-md-offset-3">\n <input\n type="number"\n ng-disabled="stage.useSourceCapacity"\n class="form-control input-sm"\n ng-model="stage.capacity.min"\n min="0"\n max="{{stage.capacity.max}}"\n required\n />\n </div>\n <div class="col-md-2">\n <input\n type="number"\n ng-disabled="stage.useSourceCapacity"\n class="form-control input-sm"\n ng-model="stage.capacity.max"\n min="{{stage.capacity.min}}"\n required\n />\n </div>\n <div class="col-md-2">\n <input\n type="number"\n ng-disabled="stage.useSourceCapacity"\n class="form-control input-sm"\n ng-model="stage.capacity.desired"\n min="{{stage.capacity.min}}"\n max="{{stage.capacity.max}}"\n required\n />\n </div>\n </div>\n </div>\n <stage-config-field label="Traffic" help-key="titus.serverGroup.traffic">\n <div class="checkbox">\n <label>\n <input\n type="checkbox"\n ng-click="cloneServerGroupStageCtrl.toggleSuspendedProcess(\'AddToLoadBalancer\')"\n ng-checked="!cloneServerGroupStageCtrl.processIsSuspended(\'AddToLoadBalancer\')"\n />\n Send client requests to new instances\n </label>\n </div>\n </stage-config-field>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n <deployment-strategy-selector\n label-columns="3"\n field-columns="6"\n command="stage"\n on-field-change="cloneServerGroupStageCtrl.onRedBlackFieldChange"\n ></deployment-strategy-selector>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupExecutionDetails.html",'<div ng-controller="titusCloneServerGroupExecutionDetailsCtrl">\n <execution-details-section-nav sections="configSections"></execution-details-section-nav>\n <div class="step-section-details" ng-if="detailsSection === \'cloneServerGroupConfig\'">\n <div class="row">\n <div class="col-md-9">\n <dl class="dl-narrow dl-horizontal">\n <dt>Account</dt>\n <dd><account-tag account="stage.context.credentials"></account-tag></dd>\n <dt>Region</dt>\n <dd>{{stage.context.region}}</dd>\n <dt>Cluster</dt>\n <dd>{{stage.context.targetCluster}}</dd>\n <dt>Server Group</dt>\n <dd>{{stage.context.source.serverGroupName}}</dd>\n <dt ng-if="!stage.context.useSourceCapacity && stage.context.capacity">Capacity</dt>\n <dd ng-if="!stage.context.useSourceCapacity && stage.context.capacity">\n Min: {{stage.context.capacity.min}} / Desired: {{stage.context.capacity.desired}} / Max:\n {{stage.context.capacity.max}}\n </dd>\n </dl>\n </div>\n </div>\n <stage-failure-message stage="stage" message="stage.failureMessage"></stage-failure-message>\n\n <div class="row" ng-if="deployed.length">\n <div class="col-md-12">\n <div class="well alert alert-info">\n <strong>Deployed:</strong>\n <a\n ng-repeat="serverGroup in deployed"\n ng-click="$event.stopPropagation(); deployDetailsCtrl.overrideFiltersForUrl(serverGroup);"\n ng-href="{{serverGroup.href}}"\n >\n {{serverGroup.serverGroup}}\n </a>\n </div>\n </div>\n </div>\n </div>\n\n <div class="step-section-details" ng-if="detailsSection === \'taskStatus\'">\n <div class="row">\n <execution-step-details item="stage"></execution-step-details>\n </div>\n </div>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupStepLabel.html",'<span class="task-label"> Clone Server Group: {{step.context.source.serverGroupName}} ({{step.context.region}}) </span>\n')}]);t("spinnaker.titus.pipeline.stage.destroyAsgStage",[]).config((function(){J.pipeline.registerStage({provides:"destroyServerGroup",alias:"destroyAsg",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/destroyAsg/destroyAsgStage.html",executionStepLabelUrl:"titus/src/pipeline/stages/destroyAsg/destroyAsgStepLabel.html",accountExtractor:e=>[e.context.credentials],configAccountExtractor:e=>[e.credentials],validators:[{type:"targetImpedance",message:"This pipeline will attempt to destroy a server group without deploying a new version into the same cluster."},{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusDestroyAsgStageCtrl",["$scope",function(e){const t=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),e.regions=["us-east-1","us-west-1","eu-west-1","us-west-2"],e.targets=K.TARGET_LIST,t.regions=t.regions||[],t.cloudProvider="titus",!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),!t.regions.length&&e.application.defaultRegions.titus&&t.regions.push(e.application.defaultRegions.titus),t.target||(t.target=e.targets[0].val)}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/destroyAsg/destroyAsgStage.html",'<div ng-controller="titusDestroyAsgStageCtrl as destroyAsgStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Target">\n <target-select model="stage" options="targets"></target-select>\n </stage-config-field>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/destroyAsg/destroyAsgStepLabel.html",'<span class="task-label"> Destroy Server Group: {{step.context.serverGroupName}} ({{step.context.region}}) </span>\n')}]);t("spinnaker.titus.pipeline.stage.disableAsgStage",[]).config((function(){J.pipeline.registerStage({provides:"disableServerGroup",alias:"disableAsg",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/disableAsg/disableAsgStage.html",executionStepLabelUrl:"titus/src/pipeline/stages/disableAsg/disableAsgStepLabel.html",validators:[{type:"targetImpedance",message:"This pipeline will attempt to disable a server group without deploying a new version into the same cluster."},{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusDisableAsgStageCtrl",["$scope",function(e){const t=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),e.targets=K.TARGET_LIST,t.regions=t.regions||[],t.cloudProvider="titus",t.isNew&&e.application.attributes.platformHealthOnlyShowOverride&&e.application.attributes.platformHealthOnly&&(t.interestingHealthProviderNames=["Titus"]),!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),!t.regions.length&&e.application.defaultRegions.titus&&t.regions.push(e.application.defaultRegions.titus),t.target||(t.target=e.targets[0].val)}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/disableAsg/disableAsgStage.html",'<div ng-controller="titusDisableAsgStageCtrl as disableAsgStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Target">\n <target-select model="stage" options="targets"></target-select>\n </stage-config-field>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/disableAsg/disableAsgStepLabel.html",'<span class="task-label"> Disable Server Group: {{step.context.serverGroupName}} ({{step.context.region}}) </span>\n')}]);t("spinnaker.titus.pipeline.stage.disableClusterStage",[]).config((function(){J.pipeline.registerStage({provides:"disableCluster",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/disableCluster/disableClusterStage.html",executionConfigSections:["disableClusterConfig","taskStatus"],validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"remainingEnabledServerGroups",fieldLabel:"Keep [X] enabled Server Groups"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusDisableClusterStageCtrl",["$scope",function(e){const t=this,n=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),t.reset=()=>{t.accountUpdated(),t.resetSelectedCluster()},n.regions=n.regions||[],n.cloudProvider="titus",n.isNew&&e.application.attributes.platformHealthOnlyShowOverride&&e.application.attributes.platformHealthOnly&&(n.interestingHealthProviderNames=["Titus"]),!n.credentials&&e.application.defaultCredentials.titus&&(n.credentials=e.application.defaultCredentials.titus),!n.regions.length&&e.application.defaultRegions.titus&&n.regions.push(e.application.defaultRegions.titus),void 0===n.remainingEnabledServerGroups&&(n.remainingEnabledServerGroups=1),t.pluralize=function(e,t){return 1===t?e:e+"s"},void 0===n.preferLargerOverNewer&&(n.preferLargerOverNewer="false"),n.preferLargerOverNewer=n.preferLargerOverNewer.toString()}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/disableCluster/disableClusterStage.html",'<div ng-controller="titusDisableClusterStageCtrl as disableClusterStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Disable Options">\n <div class="form-inline">\n Keep the\n <input\n type="number"\n min="0"\n required\n ng-model="stage.remainingEnabledServerGroups"\n class="form-control input-sm"\n style="width: 50px"\n />\n <select class="form-control input-sm" ng-model="stage.preferLargerOverNewer" style="width: 100px">\n <option value="true">largest</option>\n <option value="false">newest</option>\n </select>\n {{disableClusterStageCtrl.pluralize(\'server group\', stage.remainingEnabledServerGroups)}} enabled.\n </div>\n </stage-config-field>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n</div>\n')}]);t("spinnaker.titus.pipeline.stage.enableAsgStage",[]).config((function(){J.pipeline.registerStage({provides:"enableServerGroup",alias:"enableAsg",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/enableAsg/enableAsgStage.html",executionStepLabelUrl:"titus/src/pipeline/stages/enableAsg/enableAsgStepLabel.html",validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusEnableAsgStageCtrl",["$scope",function(e){const t=this,n=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),t.reset=()=>{t.accountUpdated(),t.resetSelectedCluster()},e.targets=K.TARGET_LIST,n.regions=n.regions||[],n.cloudProvider="titus",n.isNew&&e.application.attributes.platformHealthOnlyShowOverride&&e.application.attributes.platformHealthOnly&&(n.interestingHealthProviderNames=["Titus"]),!n.credentials&&e.application.defaultCredentials.titus&&(n.credentials=e.application.defaultCredentials.titus),!n.regions.length&&e.application.defaultRegions.titus&&n.regions.push(e.application.defaultRegions.titus),n.target||(n.target=e.targets[0].val),e.$watch("stage.credentials",e.accountUpdated)}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/enableAsg/enableAsgStage.html",'<div ng-controller="titusEnableAsgStageCtrl as enableAsgStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Target">\n <target-select model="stage" options="targets"></target-select>\n </stage-config-field>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/enableAsg/enableAsgStepLabel.html",'<span class="task-label"> Enable Server Group: {{step.context.serverGroupName}} ({{step.context.region}}) </span>\n')}]);e.module("spinnaker.titus.pipeline.stage.findAmiStage",[]).config((function(){J.pipeline.registerStage({provides:"findImage",alias:"findAmi",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/findAmi/findAmiStage.html",validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"selectionStrategy",fieldLabel:"Server Group Selection"},{type:"requiredField",fieldName:"credentials"}]})})).controller("titusFindAmiStageCtrl",["$scope",function(t){const n=t.stage;t.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(e){t.accounts=e,t.state.accounts=!0})),t.selectionStrategies=[{label:"Largest",val:"LARGEST",description:"When multiple server groups exist, prefer the server group with the most instances"},{label:"Newest",val:"NEWEST",description:"When multiple server groups exist, prefer the newest"},{label:"Oldest",val:"OLDEST",description:"When multiple server groups exist, prefer the oldest"},{label:"Fail",val:"FAIL",description:"When multiple server groups exist, fail"}],n.regions=n.regions||[],n.cloudProvider="titus",n.selectionStrategy=n.selectionStrategy||t.selectionStrategies[0].val,e.isUndefined(n.onlyEnabled)&&(n.onlyEnabled=!0),!n.credentials&&t.application.defaultCredentials.titus&&(n.credentials=t.application.defaultCredentials.titus),!n.regions.length&&t.application.defaultRegions.titus&&n.regions.push(t.application.defaultRegions.titus),t.$watch("stage.credentials",t.accountUpdated)}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/findAmi/findAmiStage.html",'<div ng-controller="titusFindAmiStageCtrl as findAmiCtrl" class="form-horizontal">\n <account-region-cluster-selector\n application="application"\n component="stage"\n accounts="accounts"\n show-all-regions="true"\n >\n </account-region-cluster-selector>\n <stage-config-field label="Server Group Selection">\n <ui-select ng-model="stage.selectionStrategy" class="form-control input-sm">\n <ui-select-match placeholder="None">{{$select.selected.label}}</ui-select-match>\n <ui-select-choices repeat="strategy.val as strategy in selectionStrategies | filter: $select.search">\n <strong ng-bind-html="strategy.label | highlight: $select.search"></strong>\n <div ng-bind-html="strategy.description"></div>\n </ui-select-choices>\n </ui-select>\n </stage-config-field>\n <stage-config-field label="Server Group Filters">\n <label class="checkbox-inline">\n <input type="checkbox" ng-model="stage.onlyEnabled" />\n Only consider enabled Server Groups\n </label>\n </stage-config-field>\n</div>\n')}]);t("spinnaker.titus.pipeline.stage.resizeAsgStage",[]).config((function(){J.pipeline.registerStage({provides:"resizeServerGroup",alias:"resizeAsg",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/resizeAsg/resizeAsgStage.html",executionConfigSections:["resizeServerGroupConfig","taskStatus"],executionStepLabelUrl:"titus/src/pipeline/stages/resizeAsg/resizeAsgStepLabel.html",accountExtractor:e=>[e.context.credentials],configAccountExtractor:e=>[e.credentials],validators:[{type:"targetImpedance",message:"This pipeline will attempt to resize a server group without deploying a new version into the same cluster."},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"action"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusResizeAsgStageCtrl",["$scope",function(e){const t=e.stage;e.viewState={accountsLoaded:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.viewState.accountsLoaded=!0})),e.resizeTargets=K.TARGET_LIST,e.scaleActions=[{label:"Scale Up",val:"scale_up"},{label:"Scale Down",val:"scale_down"},{label:"Scale to Cluster Size",val:"scale_to_cluster"},{label:"Scale to Exact Size",val:"scale_exact"}],e.resizeTypes=[{label:"Percentage",val:"pct"},{label:"Incremental",val:"incr"}],t.capacity=t.capacity||{},t.regions=t.regions||[],t.target=t.target||e.resizeTargets[0].val,t.action=t.action||e.scaleActions[0].val,t.resizeType=t.resizeType||e.resizeTypes[0].val,t.action||"exact"!==t.resizeType||(t.action="scale_exact"),t.cloudProvider="titus",t.isNew&&e.application.attributes.platformHealthOnlyShowOverride&&e.application.attributes.platformHealthOnly&&(t.interestingHealthProviderNames=["Titus"]),!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),!t.regions.length&&e.application.defaultRegions.titus&&t.regions.push(e.application.defaultRegions.titus),this.updateResizeType=function(){"scale_exact"===t.action?(t.resizeType="exact",delete t.scalePct,delete t.scaleNum):(t.capacity={},"pct"===t.resizeType?delete t.scaleNum:(t.resizeType="incr",delete t.scalePct,t.scaleNum=t.scaleNum||0))}}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/resizeAsg/resizeAsgStage.html",'<div ng-controller="titusResizeAsgStageCtrl as resizeAsgStageCtrl">\n <div ng-if="!pipeline.strategy">\n <div ng-if="!viewState.accountsLoaded">\n <h4 class="text-center">\n <span us-spinner="{radius:20, width:6, length: 12}"></span>\n </h4>\n </div>\n <div ng-if="viewState.accountsLoaded">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n </div>\n <stage-config-field label="Target">\n <target-select model="stage" options="resizeTargets"></target-select>\n </stage-config-field>\n <stage-config-field label="Action" help-key="pipeline.config.resizeAsg.action">\n <select\n class="form-control input-sm"\n required\n ng-model="stage.action"\n ng-change="resizeAsgStageCtrl.updateResizeType()"\n ng-options="a.val as a.label for a in scaleActions"\n >\n <option>Select an action...</option>\n </select>\n </stage-config-field>\n <div ng-if="stage.action !== \'scale_exact\'">\n <stage-config-field label="{{stage.action === \'scale_to_cluster\' ? \'Additional Capacity\' : \'Type\'}}">\n <select\n class="form-control input-sm"\n required\n ng-model="stage.resizeType"\n ng-change="resizeAsgStageCtrl.updateResizeType()"\n ng-options="t.val as t.label for t in resizeTypes"\n >\n <option>Select an action...</option>\n </select>\n </stage-config-field>\n <div class="form-group" ng-if="stage.resizeType === \'pct\'">\n <div class="col-md-9 col-md-offset-3">\n <label class="col-md-2 sm-label-right" style="margin-left: 0; padding-left: 0">Resize Percentage</label>\n\n <div class="col-md-2">\n <input type="number" min="0" ng-model="stage.scalePct" class="form-control input-sm" />\n </div>\n </div>\n <div class="col-md-9 col-md-offset-3">\n <em class="subinput-note"\n >This is the percentage by which the target server group\'s capacity will be increased</em\n >\n </div>\n </div>\n <div class="form-group" ng-if="stage.resizeType === \'incr\'">\n <div class="col-md-9 col-md-offset-3">\n <label class="col-md-2 sm-label-right" style="margin-left: 0; padding-left: 0">Resize-by Amount</label>\n\n <div class="col-md-2">\n <input type="number" min="0" ng-model="stage.scaleNum" class="form-control input-sm" />\n </div>\n </div>\n\n <div class="col-md-9 col-md-offset-3">\n <em class="subinput-note"\n >This is the exact amount by which the target server group\'s capacity will be increased</em\n >\n </div>\n </div>\n </div>\n <div class="form-group" ng-if="stage.action === \'scale_exact\'">\n <div class="col-md-9 col-md-offset-3 small">\n <div class="col-md-9">\n <div class="col-md-3 col-md-offset-3">Min</div>\n <div class="col-md-3">Max</div>\n <div class="col-md-3">Desired</div>\n </div>\n </div>\n <div class="col-md-9 col-md-offset-3">\n <label class="col-md-2 sm-label-right small" style="margin-left: 0; padding-left: 0">Match Capacity</label>\n\n <div class="col-md-9">\n <div class="col-md-3">\n <input type="number" ng-model="stage.capacity.min" class="form-control input-sm" />\n </div>\n <div class="col-md-3">\n <input type="number" ng-model="stage.capacity.max" class="form-control input-sm" />\n </div>\n <div class="col-md-3">\n <input type="number" ng-model="stage.capacity.desired" class="form-control input-sm" />\n </div>\n </div>\n </div>\n\n <div class="col-md-9 col-md-offset-3">\n <em class="subinput-note">This is the exact amount to which the target server group will be scaled</em>\n </div>\n </div>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/resizeAsg/resizeAsgStepLabel.html",'<span class="task-label"> Resize Server Group: {{step.context.serverGroupName}} ({{step.context.region}}) </span>\n')}]);class tn extends mt.Component{constructor(e){super(e),this.mounted=!1,this.state={}}componentDidMount(){this.mounted=!0,this.setEndpoint()}setEndpoint(){const{context:e}=this.props.stage;T.getAccountDetails(e.credentials).then((t=>{const n=t.regions.find((t=>t.name===e.cluster.region)).endpoint;this.mounted&&this.setState({titusUiEndpoint:n})}))}formatEntryPoint(e,t){return e&&Array.isArray(e)&&e.length>0?1===e.length?e[0]:JSON.stringify(e):t}componentWillUnmount(){this.mounted=!1}componentWillReceiveProps(){this.setEndpoint()}render(){const{stage:e,current:t,name:n}=this.props,{titusUiEndpoint:r}=this.state,{context:a}=e,{cluster:s}=a,{resources:i,env:o,entryPoint:l,entryPointList:c}=s,u=s?yt(a["deploy.jobs"],s.region,[])[0]:null,d=yt(a,"jobStatus.completionDetails.taskId"),m=this.formatEntryPoint(c,l);return mt.createElement(Y,{name:n,current:t},mt.createElement("div",{className:"row"},mt.createElement("div",{className:"col-md-9"},mt.createElement(S,{className:"dl-narrow dl-horizontal"},mt.createElement(k,{label:"Account",value:mt.createElement(Q,{account:a.credentials})}),s&&mt.createElement(mt.Fragment,null,mt.createElement(k,{label:"Image",value:s.imageId}),m&&mt.createElement(k,{label:"Entrypoint",value:m})),u&&mt.createElement(k,{label:"Titus Job Id",value:mt.createElement($,{message:`[${u}](${r}jobs/${u})`})}),d&&mt.createElement(k,{label:"Titus Task Id",value:mt.createElement($,{message:`[${d}](${r}jobs/${u}/tasks/${d})`})}),i&&Object.keys(i)&&mt.createElement(k,{label:"Resources",value:mt.createElement("ul",{className:"nostyle"},Object.keys(i).map((e=>mt.createElement("li",{key:e},e,": ",i[e]))))})))),o&&Object.keys(o)&&mt.createElement("div",{className:"row"},mt.createElement("div",{className:"col-md-12"},mt.createElement("h5",{style:{marginBottom:0,paddingBottom:"5px"}},"Environment Variables"),mt.createElement(S,null,Object.keys(o).map((e=>mt.createElement(k,{key:e,label:e,value:o[e]})))))),a.propertyFileContents&&mt.createElement("div",{className:"row"},mt.createElement("div",{className:"col-md-12"},mt.createElement("h5",{style:{marginBottom:"0px",paddingBottom:"5px"}},"Property File"),mt.createElement(_,{outputFileObject:a.propertyFileContents}))),mt.createElement(ee,{stage:e,message:e.failureMessage||yt(a,"completionDetails.message")}),d&&mt.createElement("div",{className:"row"},mt.createElement("div",{className:"col-md-12"},mt.createElement("div",{className:"well alert alert-info"},mt.createElement("a",{target:"_blank",href:`${r}jobs/${u}/tasks/${d}/logs`},"View Execution Logs"),mt.createElement("br",null),mt.createElement("a",{target:"_blank",href:`${r}jobs/${u}/tasks/${d}/logs/archived?file=stdout&view=Finished&open=true`},"Stdout"),mt.createElement("br",null),mt.createElement("a",{target:"_blank",href:`${r}jobs/${u}/tasks/${d}/logs/archived?file=stderr&view=Finished&open=true`},"Stderr")))))}}tn.title="runJobConfig";class nn extends mt.Component{constructor(e){super(e),this.state={availableGroups:[],removedGroups:[],loaded:!1},this.credentials={},this.vpcs=[],this.securityGroups={},this.clearRemoved=()=>{this.setState({removedGroups:[]})}}getCredentials(){return this.credentials[this.props.command.credentials]}getAwsAccount(){return this.getCredentials().awsAccount}getRegion(){return this.props.command.region||(this.props.command.cluster?this.props.command.cluster.region:null)}getVpcId(){const e=this.getCredentials(),t=this.vpcs.find((t=>t.name===e.awsVpc&&t.account===e.awsAccount&&t.region===this.getRegion()&&"aws"===t.cloudProvider));return t?t.id:null}getRegionalSecurityGroups(){const e=this.securityGroups[this.getAwsAccount()]||{aws:{}};return bt(e.aws[this.getRegion()]).filter({vpcId:this.getVpcId()}).sortBy("name").value()}refreshSecurityGroups(e){return I.cacheInitializer.refreshCache("securityGroups").then((()=>I.securityGroupReader.getAllSecurityGroups().then((t=>{this.securityGroups=t,e||this.configureSecurityGroupOptions()}))))}configureSecurityGroupOptions(){let e=this.getRegionalSecurityGroups();const t=this.state.availableGroups.length?this.state.availableGroups:e;let n,r=this.props.groupsToEdit;if(e&&this.props.groupsToEdit){const a=r.map((e=>{const n=t.find((t=>t.id===e));return n?n.name:e})),s=a.map((t=>{const n=e.find((e=>e.id===t||e.name===t));return n?n.name:null})).map((t=>e.find((e=>e.name===t)))).filter((e=>e)),i=s.map((e=>e.name));n=Ct(a,i),r=s.map((e=>e.id)),this.props.onChange(r)}e=e.sort(((e,t)=>e.name.localeCompare(t.name))),this.setState({availableGroups:e,loaded:!0,removedGroups:n})}componentDidMount(){const e=T.getCredentialsKeyedByAccount("titus").then((e=>{this.credentials=e})),t=I.securityGroupReader.getAllSecurityGroups().then((e=>{this.securityGroups=e})),n=s.listVpcs().then((e=>this.vpcs=e));Pt.all([e,t,n]).then((()=>this.configureSecurityGroupOptions()))}componentWillReceiveProps(e){this.props.account===e.account&&this.props.region===e.region||this.configureSecurityGroupOptions()}render(){const{command:e,hideLabel:t,groupsToEdit:n,amazonAccount:r}=this.props,{availableGroups:a,loaded:s,removedGroups:l}=this.state,c=D.get("firewalls");return s?mt.createElement("div",{className:"clearfix"},mt.createElement(i,{removed:l,onClear:this.clearRemoved}),mt.createElement(o,{command:e,hideLabel:t,availableGroups:a,groupsToEdit:n,refresh:()=>this.refreshSecurityGroups(),onChange:this.props.onChange,helpKey:"titus.deploy.securityGroups"}),r&&void 0!==e.credentials&&mt.createElement("div",{className:"small "+(t?"":"col-md-offset-3 col-md-9")},"Uses ",c," from the Amazon account ",mt.createElement(Q,{account:r}))):null}}const rn=V.providers.titus||{defaults:{}};rn&&(rn.resetToOriginal=V.resetToOriginal);const an=e=>e&&!e.includes("${");class sn extends mt.Component{constructor(e){super(e),this.accountUpdated=e=>{const{setFieldValue:t,values:n}=this.props.formik;n.credentials=e,n.credentialsChanged(n),t("account",e),t("credentials",e);const r=n.backingData.credentialsKeyedByAccount[e];t("containerAttributes",{...n.containerAttributes,"titusParameter.agent.assignIPv6Address":"test"===r.environment?"true":"false"})},this.regionUpdated=e=>{const{values:t,setFieldValue:n}=this.props.formik;t.region=e,t.regionChanged(t),n("region",e)},this.navigateToLatestServerGroup=()=>{const{values:e}=this.props.formik,{latestServerGroup:t}=this.state,n={provider:e.selectedProvider,accountId:t.account,region:t.region,serverGroup:t.name},{$state:r}=I;r.is("home.applications.application.insight.clusters")?r.go(".serverGroup",n):r.go("^.serverGroup",n)},this.stackChanged=e=>{const{formik:t}=this.props;t.setFieldValue("stack",e),t.values.clusterChanged(t.values)},this.strategyChanged=(e,t)=>{e.onStrategyChange(e,t),this.props.formik.setFieldValue("strategy",t.key)},this.dockerValuesChanged=e=>{Object.keys(e).forEach((t=>{this.props.formik.setFieldValue(t,e[t])}))},this.onStrategyFieldChange=(e,t)=>{this.props.formik.setFieldValue(e,t)},this.onSubnetChange=()=>{const{setFieldValue:e,values:t}=this.props.formik;t.subnetChanged(t),e("subnetType",t.subnetType)};const{values:t,setFieldValue:n}=this.props.formik;if(t.imageId&&!t.imageId.includes("${")){const{digest:e,organization:r,repository:a,tag:s}=Dt.splitImageId(t.imageId);n("digest",e),n("organization",r),n("repository",a),n("tag",s)}this.state={...this.getStateFromProps(e)}}getStateFromProps(e){const{app:t}=e,{values:n}=e.formik,r=X.getClusterName(t.name,n.stack,n.freeFormDetails),a=!t.clusters.find((e=>e.name===r)),s=t.serverGroups.data.filter((e=>e.cluster===r&&e.account===n.credentials&&e.region===n.region)).sort(((e,t)=>e.createdTime-t.createdTime)),i=s.length?s.pop():null;return{namePreview:r,createsNewCluster:a,latestServerGroup:i}}validate(e){const t={};var n,r;return n=e.stack,an(n)&&!/^([\w.]+|\${[^}]+})*$/.test(n)&&(t.stack="Only dot(.) and underscore(_) special characters are allowed in the Stack field."),r=e.freeFormDetails,an(r)&&!/^([\w.^~-]+|\${[^}]+})*$/.test(r)&&(t.freeFormDetails="Only dot(.), underscore(_), caret (^), tilde (~), and dash(-) special characters are allowed in the Detail field."),e.viewState.disableImageSelection||e.imageId||(t.imageId="Image is required."),e.resourceSummary&&(t.resourceSummary={id:"Cluster is managed"}),t}componentWillReceiveProps(e){this.setState(this.getStateFromProps(e))}render(){var e,t,n;const{app:r,formik:a}=this.props,{errors:s,setFieldValue:i,values:o}=a,{createsNewCluster:u,latestServerGroup:d,namePreview:m}=this.state,p=o.backingData.accounts,g=o.viewState.readOnlyFields||{},h=o.imageId&&"${trigger.properties.imageName}"!==o.imageId,f=[].concat(null==(e=rn.defaults)?void 0:e.subnetType).concat(null==(t=l.defaults)?void 0:t.subnetType).filter((e=>!!e));return mt.createElement("div",{className:"container-fluid form-horizontal"},mt.createElement(te,{app:r,formik:a}),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},"Account"),mt.createElement("div",{className:"col-md-7"},mt.createElement(ne,{value:o.credentials,onChange:e=>this.accountUpdated(e.target.value),readOnly:g.credentials,accounts:p,provider:"titus"}),void 0!==o.credentials&&mt.createElement("div",{className:"small"},"Uses resources from the Amazon account"," ",mt.createElement(Q,{account:o.backingData.credentialsKeyedByAccount[o.credentials]&&o.backingData.credentialsKeyedByAccount[o.credentials].awsAccount})))),mt.createElement(re,{readOnly:g.region,labelColumns:3,component:o,field:"region",account:o.credentials,regions:o.backingData.filtered.regions,onChange:this.regionUpdated}),mt.createElement(c,{application:r,component:o,field:"subnetType",helpKey:"titus.serverGroup.subnet",labelColumns:3,onChange:this.onSubnetChange,region:o.region,subnets:o.backingData.filtered.subnetPurposes,defaultSubnetTypes:f,recommendedSubnetTypes:null==(n=rn.serverGroups)?void 0:n.recommendedSubnets,showSubnetWarning:!0}),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},"Stack ",mt.createElement(ae,{id:"aws.serverGroup.stack"})),mt.createElement("div",{className:"col-md-7"},mt.createElement("input",{type:"text",className:"form-control input-sm no-spel",value:o.stack||"",onChange:e=>this.stackChanged(e.target.value)}))),s.stack&&mt.createElement("div",{className:"form-group row slide-in"},mt.createElement("div",{className:"col-sm-9 col-sm-offset-2 error-message"},mt.createElement("span",null,s.stack))),mt.createElement(se,{app:r,formik:a}),!o.viewState.disableImageSelection&&mt.createElement(xt,{specifyTagByRegex:!1,account:o.credentials,digest:o.digest,imageId:o.imageId,organization:o.organization,registry:o.registry,repository:o.repository,tag:o.tag,showRegistry:!1,deferInitialization:o.deferredInitialization,onChange:this.dockerValuesChanged}),o.viewState.disableImageSelection&&h&&mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"Image")," ",mt.createElement(ae,{id:"titus.deploy.imageId"})),mt.createElement("div",{className:"col-md-7 sp-padding-xs-yaxis"},o.imageId)),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"Entrypoint")),mt.createElement("div",{className:"col-md-7"},mt.createElement(Ot,{type:"text",className:"form-control input-sm no-spel",name:"entryPoint"}))),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},"Traffic ",mt.createElement(ae,{id:"titus.serverGroup.traffic"})),mt.createElement("div",{className:"col-md-7"},mt.createElement("div",{className:"checkbox"},mt.createElement("label",null,mt.createElement("input",{type:"checkbox",checked:o.inService,onChange:e=>i("inService",e.target.checked),disabled:""!==o.strategy&&"custom"!==o.strategy})," ","Send client requests to new instances")))),!o.viewState.disableStrategySelection&&o.selectedProvider&&mt.createElement(ie,{command:o,onFieldChange:this.onStrategyFieldChange,onStrategyChange:this.strategyChanged}),!o.viewState.hideClusterNamePreview&&mt.createElement(oe,{createsNewCluster:u,latestServerGroupName:null==d?void 0:d.name,mode:o.viewState.mode,namePreview:m,navigateToLatestServerGroup:this.navigateToLatestServerGroup}))}}const on=[{label:"Read and Write",value:"RW"},{label:"Read Only",value:"RO"},{label:"Write Only",value:"WO"}];class ln extends mt.Component{validate(e){const t={};return e.resources||(t.resources="CPU is required."),e.resources||(t.resources="Memory is required."),e.resources||(t.resources="Disk is required."),e.resources||(t.resources="Network is required."),t}render(){const{setFieldValue:e,values:t}=this.props.formik;return mt.createElement("div",{className:"clearfix"},mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"CPU(s)")),mt.createElement("div",{className:"col-md-8"},mt.createElement(le,{value:t.resources.cpu,onChange:n=>e("resources",{...t.resources,cpu:n}),required:!0}))),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"Memory (MB)")),mt.createElement("div",{className:"col-md-8"},mt.createElement(le,{value:t.resources.memory,onChange:n=>e("resources",{...t.resources,memory:n}),required:!0}))),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"Disk (MB)")),mt.createElement("div",{className:"col-md-8"},mt.createElement(le,{value:t.resources.disk,onChange:n=>e("resources",{...t.resources,disk:n}),required:!0}))),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"Network (Mbps)"),mt.createElement(ae,{id:"titus.deploy.network"})),mt.createElement("div",{className:"col-md-8"},mt.createElement(le,{value:t.resources.networkMbps,onChange:n=>e("resources",{...t.resources,networkMbps:n}),required:!0}))),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"Gpu"),mt.createElement(ae,{id:"titus.deploy.gpu"})),mt.createElement("div",{className:"col-md-8"},mt.createElement(le,{value:t.resources.gpu,onChange:n=>e("resources",{...t.resources,gpu:n})}))),mt.createElement("hr",null),mt.createElement("h4",null,mt.createElement("b",null,"Elastic File System Options ",mt.createElement(ae,{id:"titus.deploy.efs"}))),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"Mount Permission "),mt.createElement(ae,{id:"titus.deploy.mountPermissions"})),mt.createElement("div",{className:"col-md-8"},mt.createElement(Mt,{value:t.efs.mountPerm,clearable:!1,options:on,onChange:n=>e("efs",{...t.efs,mountPerm:n.value})}))),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"Mount Point "),mt.createElement(ae,{id:"titus.deploy.mountPoint"})),mt.createElement("div",{className:"col-md-8"},mt.createElement("input",{type:"text",className:"form-control input-sm no-spel",value:t.efs.mountPoint,onChange:n=>e("efs",{...t.efs,mountPoint:n.target.value})}))),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"EFS ID "),mt.createElement(ae,{id:"titus.deploy.efsId"})),mt.createElement("div",{className:"col-md-8"},mt.createElement("input",{type:"text",className:"form-control input-sm no-spel",value:t.efs.efsId,onChange:n=>e("efs",{...t.efs,efsId:n.target.value})})),mt.createElement("div",{className:"col-md-offset-3 col-md-8"})),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"EFS Relative Mount Point "),mt.createElement(ae,{id:"titus.deploy.efsRelativeMountPoint"})),mt.createElement("div",{className:"col-md-8"},mt.createElement("input",{type:"text",className:"form-control input-sm no-spel",value:t.efs.efsRelativeMountPoint,onChange:n=>e("efs",{...t.efs,efsRelativeMountPoint:n.target.value})}))))}}function cn(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}function un(e){const{label:t,help:n,input:r,actions:a,validation:s={}}=e,{hidden:i,messageNode:o,category:l}=s,c=!Et(t)||!Et(n);return mt.createElement("div",{className:"TitusMapLayout flex-container-v"},c&&mt.createElement("h4",null,t," ",n),mt.createElement("div",{className:"flex-container-h baseline margin-between-lg TitusMapLayout_Contents"},r," ",a),!i&&mt.createElement(ce,{message:o,type:l}))}cn(".TitusMapLayout_Contents * {\n -webkit-box-flex: 1;\n -ms-flex: auto;\n flex: auto;\n}\n");const dn=["disableIncreaseDesired","disableDecreaseDesired"];cn(".ServerGroupParameters .StandardFieldLayout_Label {\n min-width: 160px;\n}\n");const mn=[{label:"System Default",value:"systemDefault"},{label:"Self Managed",value:"selfManaged"}];function pn(e){const t=kt(dn,Object.keys(e.value)),n=ve(e,(e=>Object.entries(e).filter((([e,t])=>!0===t)).map((([e,t])=>e))),(e=>t.reduce(((t,n)=>(t[n]=e.includes(n),t)),{}))),r=t.map((e=>({label:ye(e),value:e})));return mt.createElement(be,{...n,options:r})}function gn(e){const t=ve(e,(e=>"true"===e),((e,t)=>t.target.checked?"true":"false"));return mt.createElement(Ce,{...t})}const hn=e=>{const{awsAccount:t,setDefaultIamProfile:n,...r}=e;return mt.createElement("div",{className:"flex-container-h baseline margin-between-md"},mt.createElement(me,{...r}),e.value?mt.createElement(mt.Fragment,null,mt.createElement("span",null,"in"),mt.createElement(Q,{account:t})):mt.createElement("button",{className:"link",style:{whiteSpace:"nowrap"},onClick:n},"Apply default value"))};class fn extends mt.Component{constructor(e){super(e)}validate(e){const t=new ue(e);t.field("iamProfile","IAM Instance Profile").required();const n=t.validateForm();return wt(Object.keys(e.constraints.soft),Object.keys(e.constraints.hard)).forEach((e=>{St(n,`constraints.soft.${e}`,`Constraint '${e}' must be either soft or hard, not both.`),St(n,`constraints.hard.${e}`,`Constraint '${e}' must be either soft or hard, not both.`)})),Object.keys(e.env||{}).filter((e=>!e.startsWith("__MapEditorDuplicateKey"))).forEach((e=>{e.match(/^[A-Za-z_].*/)?e.match(/[A-Za-z_][a-zA-Z0-9_]*$/)||St(n,`env.${e}`,"Environment variable names must contain only letter, numbers, or underscores"):St(n,`env.${e}`,"Environment variable names must start with a letter or underscore")})),n}render(){const{app:e}=this.props,{setFieldValue:t,values:n}=this.props.formik,r=()=>t("iamProfile",n.viewState.defaultIamProfile);return mt.createElement("div",{className:"ServerGroupParameters"},mt.createElement(de,{name:"iamProfile",label:"IAM Instance Profile",help:mt.createElement(ae,{id:"titus.deploy.iamProfile"}),input:e=>{var t;return mt.createElement(hn,{...e,awsAccount:null==(t=n.backingData.credentialsKeyedByAccount[n.credentials])?void 0:t.awsAccount,setDefaultIamProfile:r})}}),mt.createElement(de,{name:"capacityGroup",label:"Capacity Group",help:mt.createElement(ae,{id:"titus.deploy.capacityGroup"}),input:e=>mt.createElement(me,{...e})}),mt.createElement(de,{name:"migrationPolicy.type",label:"Migration Policy",help:mt.createElement(ae,{id:"titus.deploy.migrationPolicy"}),input:e=>mt.createElement(pe,{options:mn,...e})}),mt.createElement(de,{name:"serviceJobProcesses",label:"Service Job Processes",input:e=>mt.createElement(pn,{...e})}),mt.createElement(de,{name:"containerAttributes['titusParameter.agent.assignIPv6Address']",label:"Associate IPv6 Address (Recommended)",help:mt.createElement(ae,{id:"serverGroup.ipv6"}),input:e=>mt.createElement(gn,{...e})}),mt.createElement("hr",null),mt.createElement(ge,{value:un},mt.createElement(de,{name:"constraints.soft",label:"Soft Constraints ",help:mt.createElement(ae,{id:"titus.deploy.softConstraints"}),input:e=>mt.createElement(he,{allowEmptyValues:!0,...e})}),mt.createElement(de,{name:"constraints.hard",label:"Hard Constraints",help:mt.createElement(ae,{id:"titus.deploy.hardConstraints"}),input:e=>mt.createElement(he,{allowEmptyValues:!0,...e})}),mt.createElement("hr",null),mt.createElement(de,{name:"labels",label:"Job Attributes",input:e=>mt.createElement(he,{allowEmptyValues:!0,...e})}),mt.createElement(de,{name:"containerAttributes",label:"Container Attributes",input:e=>mt.createElement(he,{allowEmptyValues:!0,...e})}),mt.createElement(de,{name:"env",label:"Environment Variables",input:e=>mt.createElement(he,{allowEmptyValues:!0,...e})})),e.attributes.platformHealthOnlyShowOverride&&mt.createElement(de,{name:"interestingHealthProviderNames",label:"Task Completion",input:e=>mt.createElement(fe,{...e,platformHealthType:"Titus"})}))}}const vn={availabilityPercentageLimit:{percentageOfHealthyContainers:95},ratePercentagePerInterval:{intervalMs:6e5,percentageLimitPerInterval:5},containerHealthProviders:[{name:"eureka"}],timeWindows:[{days:["Monday","Tuesday","Wednesday","Thursday","Friday"],hourlyTimeWindows:[{startHour:10,endHour:16}],timeZone:"PST"}]},yn=e=>{const t=Nt(vn);return e.attributes&&e.attributes.platformHealthOnly&&(t.containerHealthProviders=[]),t};class bn{constructor(e,t,n){this.cacheInitializer=e,this.loadBalancerReader=t,this.securityGroupReader=n}configureZones(e){e.backingData.filtered.regions=e.backingData.credentialsKeyedByAccount[e.credentials].regions}configureSubnets(e){const t={dirty:{}},n=e.backingData.filtered;if(null===e.region)return t;const r=this.getCredentials(e);n.subnetPurposes=bt(e.backingData.subnets).filter({account:r.awsAccount,region:e.region}).reject({target:"elb"}).reject({purpose:null}).uniqBy("purpose").value();const a=e.subnetType||"titus (vpc0)",s=bt(e.backingData.subnets).filter({account:r.awsAccount,region:e.region,purpose:a}).map((e=>e.id)).value();return e.containerAttributes["titusParameter.agent.subnets"]=s.join(","),t}attachEventHandlers(e){e.credentialsChanged=e=>{const t={dirty:{}},n=e.backingData;if(this.configureZones(e),e.credentials){e.registry=n.credentialsKeyedByAccount[e.credentials].registry,n.filtered.regions=n.credentialsKeyedByAccount[e.credentials].regions;const t=n.credentialsKeyedByAccount[e.credentials].accountId;e.containerAttributes["titusParameter.agent.accountId"]=t,n.filtered.regions.some((t=>t.name===e.region))||(e.region=null,e.regionChanged(e))}else e.region=null;return e.viewState.dirty={...e.viewState.dirty||{},...t.dirty},this.configureLoadBalancerOptions(e),this.configureSecurityGroupOptions(e),this.configureSubnets(e),ke(e),t},e.regionChanged=e=>(this.configureLoadBalancerOptions(e),this.configureSecurityGroupOptions(e),this.configureSubnets(e),ke(e),{}),e.clusterChanged=e=>{e.moniker=X.getMoniker(e.application,e.stack,e.freeFormDetails),ke(e)},e.subnetChanged=e=>this.configureSubnets(e)}configureCommand(e){return e.viewState.accountChangedStream=new Ft,e.viewState.regionChangedStream=new Ft,e.viewState.groupsRemovedStream=new Ft,e.viewState.dirty={},e.onStrategyChange=(e,t)=>{""!==t.key&&"custom"!==t.key&&(e.inService=!0)},e.image=e.viewState.imageId,Pt.all([T.getCredentialsKeyedByAccount("titus"),this.securityGroupReader.getAllSecurityGroups(),s.listVpcs(),Ne.listSubnets(),T.getCredentialsKeyedByAccount("aws")]).then((([t,n,r,a,s])=>{var i,o;const l={credentialsKeyedByAccount:t,securityGroups:n,vpcs:r};Object.keys(t).forEach((e=>{const n=t[e].awsAccount,r=s[n].accountId;t[e].accountId=r})),l.credentialsKeyedByAccount=t,e.credentials&&(e.containerAttributes["titusParameter.agent.accountId"]=l.credentialsKeyedByAccount[e.credentials].accountId),l.images=[],l.accounts=Object.keys(t),l.subnets=a,l.filtered={},e.credentials.includes("${")?l.filtered.regions=[{name:e.region}]:l.filtered.regions=null!=(o=null==(i=t[e.credentials])?void 0:i.regions)?o:[],e.backingData=l,l.filtered.securityGroups=this.getRegionalSecurityGroups(e);let c=Pt.when();if(e.securityGroups&&e.securityGroups.length){const t=l.filtered.securityGroups.map((e=>e.id));wt(e.securityGroups,t).length<e.securityGroups.length&&(c=this.refreshSecurityGroups(e,!1))}return Pt.all([this.refreshLoadBalancers(e),c]).then((()=>{this.attachEventHandlers(e)}))}))}getVpcId(e){const t=this.getCredentials(e),n=e.backingData.vpcs.find((n=>n.name===t.awsVpc&&n.account===t.awsAccount&&n.region===this.getRegion(e)&&"aws"===n.cloudProvider));return n?n.id:null}getRegionalSecurityGroups(e){const t=e.backingData.securityGroups[this.getAwsAccount(e)]||{aws:{}};return bt(t.aws[this.getRegion(e)]).filter({vpcId:this.getVpcId(e)}).sortBy("name").value()}configureSecurityGroupOptions(e){const t=e.backingData.filtered.securityGroups;if(e.credentials.includes("${")||e.region&&e.region.includes("${"))e.backingData.filtered.securityGroups=e.securityGroups.map((e=>({name:e,id:e})));else{const n=this.getRegionalSecurityGroups(e),r="string"==typeof e.securityGroups&&e.securityGroups.includes("${");if(t&&e.securityGroups&&!r){const r=e.securityGroups.map((e=>{const n=t.find((t=>t.id===e));return n?n.name:e})),a=e.securityGroups.map((e=>{const n=t.find((t=>t.id===e||t.name===e));return n?n.name:null})).map((e=>n.find((t=>t.name===e)))).filter((e=>e)),s=a.map((e=>e.name)),i=Ct(r,s);e.securityGroups=a.map((e=>e.id)),i.length&&(e.viewState.dirty.securityGroups=i)}e.backingData.filtered.securityGroups=n.sort(((t,n)=>e.securityGroups.includes(t.id)?-1:e.securityGroups.includes(n.id)?1:t.name.localeCompare(n.name)))}}refreshSecurityGroups(e,t){return this.cacheInitializer.refreshCache("securityGroups").then((()=>this.securityGroupReader.getAllSecurityGroups().then((n=>{e.backingData.securityGroups=n,t||this.configureSecurityGroupOptions(e)}))))}getCredentials(e){return e.backingData.credentialsKeyedByAccount[e.credentials]}getAwsAccount(e){return this.getCredentials(e).awsAccount}getRegion(e){return e.region||(e.cluster?e.cluster.region:null)}getTargetGroupNames(e){const t=this.getLoadBalancerMap(e).filter((e=>"classic"!==e.loadBalancerType));return At(t.map((e=>e.targetGroups.filter((e=>"ip"===e.targetType))))).map((e=>e.name)).sort()}getLoadBalancerMap(e){return bt(e.backingData.loadBalancers).map("accounts").flattenDeep().filter({name:this.getAwsAccount(e)}).map("regions").flattenDeep().filter({name:this.getRegion(e)}).map("loadBalancers").flattenDeep().value()}configureLoadBalancerOptions(e){const t=e.targetGroups||[];if(e.credentials.includes("${")||e.region&&e.region.includes("${"))e.targetGroups=t,e.backingData.filtered.targetGroups=t;else{const n=this.getTargetGroupNames(e);if(t&&e.targetGroups){const r=wt(n,t),a=Ct(r,t);e.targetGroups=wt(n,r),a&&a.length>0?e.viewState.dirty.targetGroups=a:delete e.viewState.dirty.targetGroups}e.backingData.filtered.targetGroups=n}}refreshLoadBalancers(e){return this.loadBalancerReader.listLoadBalancers("aws").then((t=>{e.backingData.loadBalancers=t,this.configureLoadBalancerOptions(e)}))}}bn.$inject=["cacheInitializer","loadBalancerReader","securityGroupReader"];t("spinnaker.titus.serverGroup.configure.service",[Ee,we,Se]).service("titusServerGroupConfigurationService",bn);const Cn=[{field:"availabilityPercentageLimit",label:"Availability Percentage Limit",value:0,description:"\n Lets you specify the required percentage of tasks in a healthy state.\n Tasks will not be terminated by the eviction service if this limit would be violated.\n ",defaultValues:vn.availabilityPercentageLimit,fieldComponent:e=>mt.createElement(de,{name:"disruptionBudget.availabilityPercentageLimit.percentageOfHealthyContainers",label:"Percentage of Healthy Containers",input:t=>mt.createElement("div",null,mt.createElement(Ae,{...t,disabled:e.isDisabled}),mt.createElement(ae,{expand:!0,content:"0.0-100.0 (double)"}))})},{field:"relocationLimit",label:"Relocation Limit",value:1,description:"\n Lets you specify the maximum number of times a task can be relocated.\n Should only be used with batch tasks, which have a maximum execution time.\n ",defaultValues:{limit:1},fieldComponent:()=>mt.createElement(de,{name:"disruptionBudget.relocationLimit.limit",label:"Limit",input:e=>mt.createElement("div",null,mt.createElement(Ae,{...e}),mt.createElement(ae,{expand:!0,content:"(tasks)"}))})},{field:"unhealthyTasksLimit",label:"Unhealthy Tasks Limit",value:2,description:"\n Lets you specify the maximum allowed amount of tasks in an unhealthy state.\n Tasks will not be terminated by the eviction service if this limit would be violated.\n ",defaultValues:{limitOfUnhealthyContainers:1},fieldComponent:()=>mt.createElement(de,{name:"disruptionBudget.unhealthyTasksLimit.limitOfUnhealthyContainers",label:"Limit of Unhealthy Containers",input:e=>mt.createElement("div",null,mt.createElement(Ae,{...e}),mt.createElement(ae,{expand:!0,content:"(integer)"}))})},{field:"selfManaged",label:"Self Managed",value:3,description:"\n Requires that you orchestrate custom termination logic.\n If the containers are not terminated within the configured amount of time,\n the system default migration policy is used instead.\n ",defaultValues:{relocationTimeMs:864e5},fieldComponent:()=>mt.createElement(de,{name:"disruptionBudget.selfManaged.relocationTimeMs",label:"Relocation Time",input:e=>mt.createElement("div",null,mt.createElement(Ae,{...e}),mt.createElement(ae,{expand:!0,content:"(milliseconds)"}))})}],En=[{field:"rateUnlimited",label:"Unlimited",value:0,description:"\n No limits on how many containers in a job may be relocated, provided the other disruption budget constraints\n are not violated.\n ",defaultValues:!0},{field:"ratePercentagePerInterval",label:"Rate Percentage Per Interval",value:1,description:"\n Percentage of containers that can be relocated within a time interval.\n ",defaultValues:vn.ratePercentagePerInterval,fieldComponent:e=>mt.createElement(mt.Fragment,null,mt.createElement(de,{name:"disruptionBudget.ratePercentagePerInterval.intervalMs",label:"Interval",input:t=>mt.createElement("div",null,mt.createElement(Ae,{...t,disabled:e.isDisabled}),mt.createElement(ae,{expand:!0,content:"(milliseconds)"}))}),mt.createElement(de,{name:"disruptionBudget.ratePercentagePerInterval.percentageLimitPerInterval",label:"Percentage Per Interval",input:t=>mt.createElement("div",null,mt.createElement(Ae,{...t,disabled:e.isDisabled}),mt.createElement(ae,{expand:!0,content:"0.0-100.0 (double)"}))}))},{field:"ratePerInterval",label:"Rate Per Interval",value:2,description:"\n Limit number of relocations within a given time interval.\n ",defaultValues:{intervalMs:6e4,limitPerInterval:2},fieldComponent:()=>mt.createElement(mt.Fragment,null,mt.createElement(de,{name:"disruptionBudget.ratePerInterval.intervalMs",label:"Interval",input:e=>mt.createElement("div",null,mt.createElement(Ae,{...e}),mt.createElement(ae,{expand:!0,content:"(milliseconds)"}))}),mt.createElement(de,{name:"disruptionBudget.ratePerInterval.limitPerInterval",label:"Limit Per Interval",input:e=>mt.createElement("div",null,mt.createElement(Ae,{...e}),mt.createElement(ae,{expand:!0,content:"(tasks)"}))}))}],wn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];class Sn extends mt.Component{constructor(e){super(e),this.configureNewWindow=()=>{this.setState({addingNewWindow:!0})},this.addNewWindow=e=>{const{values:t,setFieldValue:n}=this.props.formik,{days:r,startHour:a,endHour:s,timeZone:i}=e,o={days:r,hourlyTimeWindows:[{startHour:a,endHour:s}],timeZone:i};n("disruptionBudget.timeWindows",t.disruptionBudget.timeWindows.concat(o)),this.setState({addingNewWindow:!1})},this.CurrentWindows=()=>{const{disruptionBudget:e}=this.props.formik.values,{isDisabled:t}=this.props;if(!e)return null;const{timeWindows:n}=e;return mt.createElement("div",{className:"sp-formItem"},mt.createElement("div",{className:"sp-formItem__left"}),mt.createElement("div",{className:"sp-formItem__right"},n.map(((e,n)=>e.hourlyTimeWindows.map(((r,a)=>mt.createElement("div",{className:"sp-margin-l-yaxis sp-margin-m-right",style:{display:"inline-block"},key:`${n}.${a}`},mt.createElement("div",{key:`${n}.${a}`,className:"horizontal center top sp-padding-m-yaxis sp-padding-s-xaxis",style:{backgroundColor:"var(--color-dovegray)",borderRadius:"4px"}},mt.createElement("div",{className:"sp-padding-m-right",style:{color:"var(--color-text-on-dark)",fontSize:"12px"}},mt.createElement("div",null,mt.createElement("b",null,e.days.map((e=>e.substr(0,3))).join(", "))),mt.createElement("div",null,mt.createElement("em",null,r.startHour,":00 - ",r.endHour,":00 ",e.timeZone))),!t&&mt.createElement("a",{className:"clickable",style:{color:"var(--color-text-on-dark)"},onClick:()=>this.removeWindow(n,a)},mt.createElement("span",{className:"glyphicon glyphicon-remove"}))))))))))},this.NewWindowComponent=()=>this.state.addingNewWindow?mt.createElement(Ge,{initialValues:{days:[],startHour:10,endHour:16,timeZone:yt(this.props.formik.values.disruptionBudget,"timeWindows[0].timeZone","PST")},onSubmit:this.addNewWindow,render:e=>mt.createElement(mt.Fragment,null,mt.createElement(de,{name:"days",label:"Define a New Window",input:e=>mt.createElement(be,{...e,stringOptions:wn})}),mt.createElement(de,{name:"startHour",label:"Start",input:t=>mt.createElement("div",null,mt.createElement(Ae,{...t,min:0,max:e.values.endHour}),mt.createElement(ae,{expand:!0,content:"hour (0-24)"}))}),mt.createElement(de,{name:"endHour",label:"End",input:t=>mt.createElement("div",null,mt.createElement(Ae,{...t,min:e.values.startHour,max:23}),mt.createElement(ae,{expand:!0,content:"hour (0-24)"}))}),mt.createElement(de,{name:"timeZone",label:"Timezone",input:e=>mt.createElement(Te,{...e,clearable:!1,stringOptions:["PST","UTC"]})}),mt.createElement("div",{className:"sp-formItem"},mt.createElement("div",{className:"sp-formItem__left"}),mt.createElement("div",{className:"sp-formItem__right sp-margin-l-bottom"},mt.createElement("button",{className:"primary",type:"submit",onClick:()=>this.addNewWindow(e.values)}," ","Add Window"))))}):mt.createElement("div",{className:"sp-formItem"},mt.createElement("div",{className:"sp-formItem__left"}),mt.createElement("div",{className:"sp-formItem__right sp-margin-l-bottom"},mt.createElement("a",{className:"button primary",onClick:this.configureNewWindow},mt.createElement("i",{className:"fas fa-plus-circle"})," Define New Window"))),this.state={addingNewWindow:!1}}removeWindow(e,t){const{values:n,setFieldValue:r}=this.props.formik,{timeWindows:a}=n.disruptionBudget,s=a[e];if(1===s.hourlyTimeWindows.length)r("disruptionBudget.timeWindows",a.filter((e=>e!==s)));else{const n=s.hourlyTimeWindows[t];r(`disruptionBudget.timeWindows[${e}].hourlyTimeWindows`,s.hourlyTimeWindows.filter((e=>e!==n)))}}render(){const{CurrentWindows:e,NewWindowComponent:t}=this,{isDisabled:n}=this.props;return mt.createElement(mt.Fragment,null,mt.createElement(e,null),!n&&mt.createElement(t,null))}}const kn=()=>mt.createElement("p",null,"The Job Disruption Budget is part of the job descriptor, and defines the behavior of how containers of the job can be relocated."," ",mt.createElement("a",{href:"http://manuals.test.netflix.net/view/titus-docs/mkdocs/master/disruption_budget/",target:"_blank"},"Read the full documentation"));class Nn extends mt.Component{constructor(e){super(e),this.timeWindowOptions=[{field:"timeWindows",label:"Anytime",value:0,defaultValues:void 0},{field:"timeWindows",label:"Specific Time Windows",value:1,defaultValues:vn.timeWindows}],this.toggleUseDefault=()=>{this.state.usingDefault||this.setToDefaultBudget(),this.setState({usingDefault:!this.state.usingDefault})},this.componentDidUpdate=e=>{this.props.onStageChange&&!Gt(e.formik.values.disruptionBudget,this.props.formik.values.disruptionBudget)&&this.props.onStageChange(this.props.formik.values.disruptionBudget)},this.optionTypeChanged=(e,t)=>{t.filter((t=>t!==e)).forEach((e=>this.props.formik.setFieldValue("disruptionBudget."+e.field,void 0))),this.props.formik.setFieldValue("disruptionBudget."+e.field,e.defaultValues)},this.policyTypeChanged=e=>this.optionTypeChanged(e,Cn),this.rateTypeChanged=e=>this.optionTypeChanged(e,En),this.timeWindowsChanged=e=>{this.props.formik.setFieldValue("disruptionBudget."+e.field,e.defaultValues)};const{disruptionBudget:t}=e.formik.values;this.state={usingDefault:!t||Gt(t,yn(e.app))},this.state.usingDefault&&this.setToDefaultBudget()}setToDefaultBudget(){this.props.formik.setFieldValue("disruptionBudget",yn(this.props.app))}getSelectionFromFields(e){const{disruptionBudget:t}=this.props.formik.values;return t?e.find((e=>!!t[e.field])):e[0]}getTimeWindowSelection(){return yt(this.props.formik.values,"disruptionBudget.timeWindows")?this.timeWindowOptions.find((e=>e.defaultValues)):this.timeWindowOptions.find((e=>!e.defaultValues))}toggleHealthProvider(e){const{values:t,setFieldValue:n}=this.props.formik,r=t.disruptionBudget.containerHealthProviders,a=r.find((t=>t.name===e));n("disruptionBudget.containerHealthProviders",a?r.filter((e=>e!==a)):r.concat({name:e}))}render(){var e;const{runJobView:t}=this.props,{usingDefault:n}=this.state,r=this.props.formik.values.disruptionBudget||yn(this.props.app),a=this.getSelectionFromFields(Cn),s=a.fieldComponent,i=this.getSelectionFromFields(En),o=null==i?void 0:i.fieldComponent,l=this.getTimeWindowSelection(),c=(null!=(e=r.containerHealthProviders)?e:[]).map((e=>e.name)),u=!!r.selfManaged,d=!t||t&&!n;return mt.createElement(ge,{value:Ie},mt.createElement("div",{className:"form-horizontal sp-margin-l-xaxis"},!t&&mt.createElement(kn,null),mt.createElement(de,{name:"usingDefault",input:()=>mt.createElement(Ce,{checked:n,onChange:this.toggleUseDefault,text:mt.createElement("b",null,"Use Netflix Defaults")}),layout:t?({input:e})=>mt.createElement(mt.Fragment,null,e):void 0}),d&&mt.createElement("div",{style:{opacity:n?.5:1}},mt.createElement("div",{className:"sp-formGroup"},mt.createElement("div",{className:"groupHeader"},mt.createElement(de,{name:"policyType",label:"Policy",input:e=>mt.createElement("div",null,mt.createElement(De,{...e,menuContainerStyle:{height:"300px"},className:"Select-menu-long",style:{width:"300px"},disabled:n,clearable:!1,onChange:this.policyTypeChanged,value:a,options:Cn}),mt.createElement(ae,{expand:!0,content:"A job policy defines container relocation rules and constraints"}))})),mt.createElement("div",{className:"sp-formItem"},mt.createElement("p",null,a.description)),s&&mt.createElement(s,{isDisabled:n})),!u&&mt.createElement("div",null,mt.createElement("div",{className:""+(r.rateUnlimited?"":"sp-formGroup")},mt.createElement("div",{className:""+(r.rateUnlimited?"":"groupHeader")},mt.createElement(de,{name:"rates",label:"Rates",input:e=>mt.createElement(De,{...e,style:{width:"300px"},disabled:n,clearable:!1,onChange:this.rateTypeChanged,value:i,options:En})})),mt.createElement("div",{className:"sp-formItem"},mt.createElement("p",null,i.description)),o&&mt.createElement(o,{isDisabled:n})),mt.createElement("div",{className:""+(r.timeWindows?"sp-formGroup":"")},mt.createElement("div",{className:""+(r.timeWindows?"groupHeader":"")},mt.createElement(de,{name:"timeWindows",label:"When Can Disruption Occur?",input:e=>mt.createElement(De,{...e,style:{width:"300px"},disabled:n,clearable:!1,onChange:this.timeWindowsChanged,value:l,options:this.timeWindowOptions})})),r.timeWindows&&mt.createElement(Sn,{isDisabled:n,formik:this.props.formik})),mt.createElement(de,{name:"healthProviders",label:"Container Health Provider",input:()=>mt.createElement("div",null,mt.createElement(Ce,{checked:c.includes("eureka"),onChange:()=>this.toggleHealthProvider("eureka"),text:"Discovery",disabled:n}))})))))}}class An extends mt.Component{constructor(e){super(e),this.credentialsKeyedByAccount={},this.defaultIamProfile="",this.state={credentials:[],regions:[],loaded:!1},this.accountChanged=e=>{St(this.props.stage,"account",e),this.stageFieldChanged("credentials",e),this.setRegistry(e),this.updateRegions(e);const t="test"===this.credentialsKeyedByAccount[e].environment?"true":"false";this.associateIPv6AddressChanged(t)},this.dockerChanged=e=>{const{imageId:t,...n}=e;Object.assign(this.props.stage,n),t?this.props.stage.cluster.imageId=t:delete this.props.stage.cluster.imageId,this.props.stageFieldUpdated(),this.forceUpdate()},this.stageFieldChanged=(e,t)=>{St(this.props.stage,e,t),this.props.stageFieldUpdated(),this.forceUpdate()},this.mapChanged=(e,t)=>{this.stageFieldChanged(e,t)},this.groupsChanged=e=>{this.stageFieldChanged("cluster.securityGroups",e),this.forceUpdate()},this.associateIPv6AddressChanged=e=>{const t={...this.props.stage.cluster.containerAttributes||{},"titusParameter.agent.assignIPv6Address":e};this.mapChanged("cluster.containerAttributes",t)},this.disruptionBudgetChanged=e=>{const{stage:t,stageFieldUpdated:n}=this.props;t.cluster.disruptionBudget=e,n()};const{application:t,stage:n}=e;n.cluster=n.cluster||{},n.waitForCompletion=void 0===n.waitForCompletion||n.waitForCompletion,n.cluster.imageId&&!n.cluster.imageId.includes("${")&&Object.assign(n,Dt.splitImageId(n.cluster.imageId)),!n.credentials&&t.defaultCredentials.titus&&(n.credentials=t.defaultCredentials.titus),n.cluster.capacity||(n.cluster.capacity={min:1,max:1,desired:1});const r=rn.defaults.iamProfile||"{{application}}InstanceProfile";this.defaultIamProfile=r.replace("{{application}}",t.name);const a={application:t.name,containerAttributes:{},env:{},labels:{},resources:{cpu:1,disk:1e4,gpu:0,memory:512,networkMbps:128},retries:0,runtimeLimitSecs:3600,securityGroups:[]};n.isNew&&(a.iamProfile=this.defaultIamProfile),Tt(n.cluster,a),n.cloudProvider=n.cloudProvider||"titus",n.deferredInitialization=!0}setRegistry(e){e&&(this.props.stage.registry=this.credentialsKeyedByAccount[e].registry)}updateRegions(e){let t;e?(t=this.credentialsKeyedByAccount[e].regions,t.map((e=>e.name)).every((e=>e!==this.props.stage.cluster.region))&&(delete this.props.stage.cluster.region,this.props.stageFieldUpdated())):t=[],this.setState({regions:t})}componentDidMount(){const{stage:e}=this.props;T.getCredentialsKeyedByAccount("titus").then((t=>{this.credentialsKeyedByAccount=t;const n=Object.keys(t);e.credentials=e.credentials||n[0],this.setRegistry(e.credentials),this.updateRegions(e.credentials),this.setState({credentials:n,loaded:!0});const r="test"===this.credentialsKeyedByAccount[e.credentials].environment&&void 0===e.cluster.containerAttributes["titusParameter.agent.assignIPv6Address"]?"true":"false";this.associateIPv6AddressChanged(r)}))}render(){var e,t;const{application:n,stage:r}=this.props,{credentials:a,loaded:s,regions:i}=this.state,o=(this.credentialsKeyedByAccount[r.credentials]||{awsAccount:""}).awsAccount,l=(null==(e=r.cluster.entryPointList)?void 0:e.length)?r.cluster.entryPointList.join(","):r.cluster.entryPoint,c=(null==(t=r.cluster.cmdList)?void 0:t.length)?r.cluster.cmdList.join(","):r.cluster.cmd;return mt.createElement("div",{className:"form-horizontal"},mt.createElement("div",{className:"form-group"},mt.createElement("label",{className:"col-md-3 sm-label-right"},mt.createElement("span",{className:"label-text"},"Account")),mt.createElement("div",{className:"col-md-5"},mt.createElement(ne,{value:r.credentials,onChange:e=>this.accountChanged(e.target.value),accounts:a,provider:"titus"}),void 0!==r.credentials&&mt.createElement("div",{className:"small"},"Uses resources from the Amazon account ",mt.createElement(Q,{account:o})))),mt.createElement(re,{labelColumns:3,fieldColumns:5,component:r.cluster,field:"region",account:r.credentials,regions:i,onChange:e=>this.stageFieldChanged("region",e)}),mt.createElement(xt,{specifyTagByRegex:!1,account:r.credentials,digest:r.digest,imageId:r.cluster.imageId,organization:r.organization,registry:r.registry,repository:r.repository,tag:r.tag,showRegistry:!1,onChange:this.dockerChanged,deferInitialization:r.deferredInitialization}),mt.createElement(xe,{label:"CPU(s)"},mt.createElement(le,{value:r.cluster.resources.cpu,onChange:e=>this.stageFieldChanged("cluster.resources.cpu",e),required:!0})),mt.createElement(xe,{label:"Memory (MB)"},mt.createElement(le,{onChange:e=>this.stageFieldChanged("cluster.resources.memory",e),value:r.cluster.resources.memory,required:!0})),mt.createElement(xe,{label:"Disk (MB)"},mt.createElement(le,{onChange:e=>this.stageFieldChanged("cluster.resources.disk",e),value:r.cluster.resources.disk,required:!0})),mt.createElement(xe,{label:"Network (Mbps)",helpKey:"titus.deploy.network"},mt.createElement(le,{onChange:e=>this.stageFieldChanged("cluster.resources.networkMbps",e),value:r.cluster.resources.networkMbps,required:!0})),mt.createElement(xe,{label:"GPU(s)",helpKey:"titus.deploy.gpu"},mt.createElement(le,{onChange:e=>this.stageFieldChanged("cluster.resources.gpu",e),value:r.cluster.resources.gpu,required:!0})),mt.createElement(xe,{label:"Entrypoint(s)",helpKey:"titus.deploy.entrypoint"},mt.createElement("input",{type:"text",className:"form-control input-sm",value:l,onChange:e=>this.stageFieldChanged("cluster.entryPointList",e.target.value.split(","))})),mt.createElement(xe,{label:"Command(s)",helpKey:"titus.deploy.command"},mt.createElement("input",{type:"text",className:"form-control input-sm",value:c,onChange:e=>this.stageFieldChanged("cluster.cmdList",e.target.value.split(","))})),mt.createElement(xe,{label:"Runtime Limit (Seconds)",helpKey:"titus.deploy.runtimeLimitSecs"},mt.createElement(le,{value:r.cluster.runtimeLimitSecs,onChange:e=>this.stageFieldChanged("cluster.runtimeLimitSecs",e),min:1,required:!0})),mt.createElement(xe,{label:"Retries",helpKey:"titus.deploy.retries"},mt.createElement(le,{onChange:e=>this.stageFieldChanged("cluster.retries",e),value:r.cluster.retries,min:0,required:!0})),mt.createElement(xe,{label:"Property File",helpKey:"titus.deploy.propertyFile"},mt.createElement("input",{type:"text",className:"form-control input-sm",onChange:e=>this.stageFieldChanged("propertyFile",e.target.value),value:r.propertyFile})),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-9 col-md-offset-1"},mt.createElement("div",{className:"checkbox"},mt.createElement("label",null,mt.createElement("input",{type:"checkbox",checked:r.showAdvancedOptions,onChange:e=>this.stageFieldChanged("showAdvancedOptions",e.target.checked)}),mt.createElement("strong",null,"Show Advanced Options"))))),mt.createElement("div",{className:""+(!0===r.showAdvancedOptions?"collapse.in":"collapse")},mt.createElement("div",{className:"form-group"},mt.createElement("label",{className:"col-md-3 sm-label-right"},mt.createElement("span",{className:"label-text"},"IAM Instance Profile")," ",mt.createElement(ae,{id:"titus.deploy.iamProfile"})),mt.createElement("div",{className:"col-md-4"},mt.createElement("input",{type:"text",className:"form-control input-sm",value:r.cluster.iamProfile,placeholder:this.defaultIamProfile,required:!0,onChange:e=>this.stageFieldChanged("cluster.iamProfile",e.target.value)}),!r.isNew&&!r.cluster.iamProfile&&mt.createElement("a",{className:"small clickable",onClick:()=>this.stageFieldChanged("cluster.iamProfile",this.defaultIamProfile)},"Use suggested default")),mt.createElement("div",{className:"col-md-1 small",style:{whiteSpace:"nowrap",paddingLeft:"0px",paddingTop:"7px"}},"in ",mt.createElement(Q,{account:o}))),mt.createElement(xe,{label:"Capacity Group",fieldColumns:4,helpKey:"titus.job.capacityGroup"},mt.createElement("input",{type:"text",className:"form-control input-sm",value:r.cluster.capacityGroup||"",onChange:e=>this.stageFieldChanged("cluster.capacityGroup",e.target.value)})),mt.createElement(xe,{label:D.get("Firewalls"),helpKey:"titus.job.securityGroups"},(!r.credentials||!r.cluster.region)&&mt.createElement("div",null,"Account and region must be selected before ",D.get("firewalls")," can be added"),s&&r.credentials&&r.cluster.region&&mt.createElement(nn,{account:r.credentials,region:r.cluster.region,command:r,amazonAccount:o,hideLabel:!0,groupsToEdit:r.cluster.securityGroups,onChange:this.groupsChanged})),mt.createElement(xe,{label:"Associate IPv6 Address (Recommended)",helpKey:"serverGroup.ipv6"},mt.createElement(gn,{value:r.cluster.containerAttributes["titusParameter.agent.assignIPv6Address"],onChange:e=>this.associateIPv6AddressChanged(e.target.value)})),mt.createElement(xe,{label:"Disruption Budget",helpKey:"titus.disruptionbudget.description"},mt.createElement(Ge,{initialValues:r.cluster,onSubmit:()=>{},render:e=>mt.createElement(Nn,{formik:e,app:n,runJobView:!0,onStageChange:this.disruptionBudgetChanged})})),mt.createElement(xe,{label:"Job Attributes (optional)"},mt.createElement(Pe,{model:r.cluster.labels,allowEmpty:!0,onChange:e=>this.mapChanged("cluster.labels",e)})),mt.createElement(xe,{label:"Container Attributes (optional)"},mt.createElement(Pe,{model:r.cluster.containerAttributes,allowEmpty:!0,onChange:e=>this.mapChanged("cluster.containerAttributes",e)})),mt.createElement(xe,{label:"Environment Variables (optional)"},mt.createElement(Pe,{model:r.cluster.env,allowEmpty:!0,onChange:e=>this.mapChanged("cluster.env",e)}))),mt.createElement(xe,{label:"Wait for results",helpKey:"titus.job.waitForCompletion"},mt.createElement("input",{type:"checkbox",className:"input-sm",name:"waitForCompletion",checked:r.waitForCompletion,onChange:e=>this.stageFieldChanged("waitForCompletion",e.target.checked)})))}}J.pipeline.registerStage({provides:"runJob",useBaseProvider:!0,restartable:!0,key:"runJob",cloudProvider:"titus",providesFor:["aws","titus"],component:An,executionDetailsSections:[tn,Oe],accountExtractor:e=>[e.context.credentials],configAccountExtractor:e=>[e.credentials],supportsCustomTimeout:!0,validators:[{type:"requiredField",fieldName:"cluster.iamProfile"},{type:"requiredField",fieldName:"cluster.imageId"},{type:"requiredField",fieldName:"credentials"},{type:"requiredField",fieldName:"cluster.region"},{type:"requiredField",fieldName:"cluster.resources.cpu"},{type:"requiredField",fieldName:"cluster.resources.gpu"},{type:"requiredField",fieldName:"cluster.resources.memory"},{type:"requiredField",fieldName:"cluster.resources.disk"},{type:"requiredField",fieldName:"cluster.runtimeLimitSecs"}]});t("spinnaker.titus.pipeline.stage.scaleDownClusterStage",[]).config((function(){J.pipeline.registerStage({provides:"scaleDownCluster",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/scaleDownCluster/scaleDownClusterStage.html",executionConfigSections:["scaleDownClusterConfig","taskStatus"],accountExtractor:e=>[e.context.credentials],configAccountExtractor:e=>[e.credentials],validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"remainingFullSizeServerGroups",fieldLabel:"Keep [X] full size Server Groups"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}],strategy:!0})})).controller("titusScaleDownClusterStageCtrl",["$scope",function(e){const t=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),t.regions=t.regions||[],t.cloudProvider="titus",!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),!t.regions.length&&e.application.defaultRegions.titus&&t.regions.push(e.application.defaultRegions.titus),void 0===t.remainingFullSizeServerGroups&&(t.remainingFullSizeServerGroups=1),void 0===t.allowScaleDownActive&&(t.allowScaleDownActive=!1),this.pluralize=function(e,t){return 1===t?e:e+"s"},void 0===t.preferLargerOverNewer&&(t.preferLargerOverNewer="false"),t.preferLargerOverNewer=t.preferLargerOverNewer.toString()}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/scaleDownCluster/scaleDownClusterStage.html",'<div ng-controller="titusScaleDownClusterStageCtrl as scaleDownClusterStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Scale Down Options">\n <div class="form-inline">\n <p>\n Keep the\n <input\n type="number"\n min="0"\n required\n ng-model="stage.remainingFullSizeServerGroups"\n class="form-control input-sm"\n style="width: 50px"\n />\n <select class="form-control input-sm" ng-model="stage.preferLargerOverNewer" style="width: 100px">\n <option value="true">largest</option>\n <option value="false">newest</option>\n </select>\n {{scaleDownClusterStageCtrl.pluralize(\'server group\', stage.remainingFullSizeServerGroups)}} at current size.\n </p>\n <p>The remaining server groups will be scaled down to zero instances.</p>\n </div>\n </stage-config-field>\n <div class="form-group">\n <div class="col-md-offset-3 col-md-6 checkbox">\n <label>\n <input type="checkbox" ng-model="stage.allowScaleDownActive" />\n Allow scale down of active server groups\n </label>\n </div>\n </div>\n</div>\n')}]);t("spinnaker.titus.pipeline.stage.shrinkClusterStage",[]).config((function(){J.pipeline.registerStage({provides:"shrinkCluster",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/shrinkCluster/shrinkClusterStage.html",accountExtractor:e=>[e.context.credentials],configAccountExtractor:e=>[e.credentials],validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"shrinkToSize",fieldLabel:"shrink to [X] Server Groups"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusShrinkClusterStageCtrl",["$scope",function(e){const t=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),t.regions=t.regions||[],t.cloudProvider="titus",!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),!t.regions.length&&e.application.defaultRegions.titus&&t.regions.push(e.application.defaultRegions.titus),void 0===t.shrinkToSize&&(t.shrinkToSize=1),void 0===t.allowDeleteActive&&(t.allowDeleteActive=!1),this.pluralize=function(e,t){return 1===t?e:e+"s"},void 0===t.retainLargerOverNewer&&(t.retainLargerOverNewer="false"),t.retainLargerOverNewer=t.retainLargerOverNewer.toString()}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/shrinkCluster/shrinkClusterStage.html",'<div ng-controller="titusShrinkClusterStageCtrl as shrinkClusterStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Shrink Options">\n <div class="form-inline">\n Shrink to\n <input\n type="number"\n min="0"\n required\n ng-model="stage.shrinkToSize"\n class="form-control input-sm"\n style="width: 50px"\n />\n {{shrinkClusterStageCtrl.pluralize(\'server group\', stage.shrinkToSize)}}, keeping the\n <select class="form-control input-sm" ng-model="stage.retainLargerOverNewer" style="width: 100px">\n <option value="true">largest</option>\n <option value="false">newest</option>\n </select>\n </div>\n </stage-config-field>\n <div class="form-group">\n <div class="col-md-offset-3 col-md-6 checkbox">\n <label>\n <input type="checkbox" ng-model="stage.allowDeleteActive" />\n Allow deletion of active server groups\n </label>\n </div>\n </div>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n</div>\n')}]);t("spinnaker.titus.react",[]).run(["$injector",function(e){Zt.initialize(e)}]);t("spinnaker.titus.securityGroup.reader",[]).factory("titusSecurityGroupReader",(function(){return{resolveIndexedSecurityGroup:function(e,t,n){return e[t.awsAccount][t.region][n]}}}));e.module("spinnaker.titus.serverGroupCommandBuilder.service",[]).factory("titusServerGroupCommandBuilder",["$q",function(t){function n(e){return(rn.defaults.iamProfile||"{{application}}InstanceProfile").replace("{{application}}",e.name)}function r(e,r){const a=(r=r||{}).account||rn.defaults.account,s=r.region||rn.defaults.region,i=r.zone||rn.defaults.zone,o=n(e),l={application:e.name,credentials:a,region:s,zone:i,network:"default",inService:!0,resources:{cpu:1,networkMbps:128,disk:1e4,memory:512,gpu:0},efs:{mountPerm:"RW"},strategy:"",capacity:{min:1,max:1,desired:1},targetHealthyDeployPercentage:100,env:{},labels:{},containerAttributes:{"titusParameter.agent.assignIPv6Address":"true"},cloudProvider:"titus",selectedProvider:"titus",iamProfile:o,constraints:{hard:{},soft:{}},serviceJobProcesses:{},viewState:{defaultIamProfile:o,useSimpleCapacity:!0,usePreferredZones:!0,mode:r.mode||"create"},securityGroups:[],imageId:r.imageId,migrationPolicy:{type:"systemDefault"},digest:"",organization:"",tag:"",registry:"",repository:""};return t.when(l)}return{buildNewServerGroupCommand:r,buildNewServerGroupCommandForPipeline:function(){return t.when({viewState:{requiresTemplateSelection:!0}})},buildServerGroupCommandFromExisting:function(e,r,a){a=a||"clone";const s=X.parseServerGroupName(r.name),i="test"===r.awsAccount,o=r.containerAttributes&&void 0!==r.containerAttributes["titusParameter.agent.assignIPv6Address"]?r.containerAttributes["titusParameter.agent.assignIPv6Address"]:i?"true":"false",l={...r.containerAttributes,"titusParameter.agent.assignIPv6Address":o},c={application:e.name,disruptionBudget:r.disruptionBudget,strategy:"",stack:s.stack,freeFormDetails:s.freeFormDetails,account:r.account,credentials:r.account,region:r.region,env:r.env,labels:r.labels,containerAttributes:l,entryPoint:r.entryPoint,iamProfile:r.iamProfile,capacityGroup:r.capacityGroup,migrationPolicy:r.migrationPolicy?r.migrationPolicy:{type:"systemDefault"},securityGroups:r.securityGroups||[],constraints:{hard:r.constraints&&r.constraints.hard||{},soft:r.constraints&&r.constraints.soft||{}},serviceJobProcesses:Object.assign({},r.serviceJobProcesses),inService:!r.disabled,source:{account:r.account,region:r.region,asgName:r.name},resources:{cpu:r.resources.cpu,gpu:r.resources.gpu,memory:r.resources.memory,disk:r.resources.disk,networkMbps:r.resources.networkMbps},targetGroups:r.targetGroups,capacity:{min:r.capacity.min,max:r.capacity.max,desired:r.capacity.desired},targetHealthyDeployPercentage:100,cloudProvider:"titus",selectedProvider:"titus",viewState:{defaultIamProfile:n(e),useSimpleCapacity:r.capacity.min===r.capacity.max,mode:a},organization:"",tag:"",digest:"",registry:"",repository:""};return r.efs?c.efs={mountPoint:r.efs.mountPoint,mountPerm:r.efs.mountPerm,efsId:r.efs.efsId}:c.efs={mountPerm:"RW"},"editPipeline"!==a&&(c.imageId=r.image.dockerImageName+":"+(r.image.dockerImageVersion?r.image.dockerImageVersion:r.image.dockerImageDigest)),t.when(c)},buildServerGroupCommandFromPipeline:function(t,a){const s=Nt(a),i={account:s.account,imageId:s.imageId,region:s.region};return r(t,i).then((function(r){r.constraints={hard:a.constraints&&a.constraints.hard||a.hardConstraints&&a.hardConstraints.reduce(((e,t)=>St(e,t,"true")),{})||{},soft:a.constraints&&a.constraints.soft||a.softConstraints&&a.softConstraints.reduce(((e,t)=>St(e,t,"true")),{})||{}},delete s.hardConstraints,delete s.softConstraints;const i={disableImageSelection:!0,useSimpleCapacity:a.capacity.min===a.capacity.max,mode:"editPipeline",submitButtonLabel:"Done",defaultIamProfile:n(t)},o={region:s.region,credentials:s.account,iamProfile:s.iamProfile,viewState:i};s.strategy=s.strategy||"";return e.extend({},r,s,o)}))}}}]);t("spinnaker.serverGroup.configure.titus",["spinnaker.titus.serverGroup.configure.service"]);const Gn=class extends mt.Component{constructor(e){super(e),this._isUnmounted=!1,this.templateSelected=()=>{this.setState({requiresTemplateSelection:!1}),this.configureCommand()},this.onTaskComplete=()=>{this.props.application.serverGroups.refresh(),this.props.application.serverGroups.onNextRefresh(null,this.onApplicationRefresh)},this.onApplicationRefresh=()=>{if(this._isUnmounted)return;const{command:e}=this.props,{taskMonitor:t}=this.state,n=t.task.execution.stages.find((e=>"cloneServerGroup"===e.type));if(n&&n.context["deploy.server.groups"]){const t=n.context["deploy.server.groups"][e.region];if(t){const n={serverGroup:t,accountId:e.credentials,region:e.region,provider:"titus"};let r="^.^.^.clusters.serverGroup";I.$state.includes("**.clusters.serverGroup")&&(r="^.serverGroup"),I.$state.includes("**.clusters.cluster.serverGroup")&&(r="^.^.serverGroup"),I.$state.includes("**.clusters")&&(r=".serverGroup"),I.$state.go(r,n)}}},this.configureCommand=()=>{const{command:e}=this.props;Zt.titusServerGroupConfigurationService.configureCommand(e).then((()=>{Zt.titusServerGroupConfigurationService.configureSubnets(e),e.credentials.includes("${")||(e.registry=(e.backingData.credentialsKeyedByAccount[e.credentials]||{}).registry),this.setState({loaded:!0,requiresTemplateSelection:!1})}))},this.submit=e=>{const t="editPipeline"===e.viewState.mode||"createPipeline"===e.viewState.mode;let n=e;e.disruptionBudget.timeWindows&&!e.disruptionBudget.timeWindows.length&&delete e.disruptionBudget.timeWindows,Gt(yn(this.props.application),e.disruptionBudget)&&(n={...e,disruptionBudget:void 0}),t?this.props.closeModal&&this.props.closeModal(n):this.state.taskMonitor.submit((()=>I.serverGroupWriter.cloneServerGroup(n,this.props.application)))},this.getLoadBalancerNote=e=>mt.createElement("div",{className:"form-group small",style:{marginTop:"20px"}},mt.createElement("div",{className:"col-md-8 col-md-offset-3"},mt.createElement("p",null,"Only target groups with target type ",mt.createElement("em",null,"ip")," are supported in Titus. It is not possible to re-use target groups of target type ",mt.createElement("em",null,"instance")," used by Amazon instances."," "),void 0!==e.backingData&&void 0!==e.backingData.credentialsKeyedByAccount&&void 0!==e.credentials&&mt.createElement("p",null,"Uses target groups from the Amazon account"," ",mt.createElement(Q,{account:e.backingData.credentialsKeyedByAccount[e.credentials]&&e.backingData.credentialsKeyedByAccount[e.credentials].awsAccount})))),this.getSecurityGroupNote=e=>{const t=e.backingData&&e.backingData.credentialsKeyedByAccount&&e.backingData.credentialsKeyedByAccount[e.credentials]&&e.backingData.credentialsKeyedByAccount[e.credentials].awsAccount;return t&&void 0!==e.credentials?mt.createElement("div",{className:"form-group small"},mt.createElement("div",{className:"col-md-9 col-md-offset-3"},"Uses ",D.get("firewalls")," from the Amazon account ",mt.createElement(Q,{account:t}))):null};const t=yt(e,"command.viewState.requiresTemplateSelection",!1);t||this.configureCommand(),this.state={firewallsLabel:D.get("Firewalls"),loaded:!1,requiresTemplateSelection:t,taskMonitor:new Le({application:e.application,title:"Creating your server group",modalInstance:Le.modalInstanceEmulation((()=>this.props.dismissModal())),onTaskComplete:this.onTaskComplete})}}static show(e){return Me.show(Gn,e,{dialogClassName:"wizard-modal modal-lg"})}componentWillUnmount(){this._isUnmounted=!0,this.refreshUnsubscribe&&this.refreshUnsubscribe()}render(){const{application:e,command:t,dismissModal:n,title:r}=this.props,{loaded:a,taskMonitor:s,requiresTemplateSelection:i}=this.state;return i?mt.createElement(Fe,{application:e,cloudProvider:"titus",command:t,onDismiss:n,onTemplateSelected:this.templateSelected}):mt.createElement(ze,{heading:r,initialValues:t,loading:!a,taskMonitor:s,dismissModal:n,closeModal:this.submit,submitButtonLabel:t.viewState.submitButtonLabel,render:({formik:t,nextIdx:n,wizard:r})=>mt.createElement(mt.Fragment,null,mt.createElement(je,{label:"Basic Settings",wizard:r,order:n(),render:({innerRef:n})=>mt.createElement(sn,{ref:n,formik:t,app:e})}),mt.createElement(je,{label:"Resources",wizard:r,order:n(),render:({innerRef:e})=>mt.createElement(ln,{ref:e,formik:t})}),mt.createElement(je,{label:"Capacity",wizard:r,order:n(),render:({innerRef:e})=>mt.createElement(u,{ref:e,formik:t})}),mt.createElement(je,{label:"Load Balancers",wizard:r,order:n(),note:this.getLoadBalancerNote(t.values),render:({innerRef:e})=>mt.createElement(d,{ref:e,formik:t,hideLoadBalancers:!0,targetGroupTypeHelpText:"ip"})}),mt.createElement(je,{label:D.get("Firewalls"),wizard:r,order:n(),note:this.getSecurityGroupNote(t.values),render:({innerRef:e})=>mt.createElement(m,{ref:e,formik:t})}),mt.createElement(je,{label:"Job Disruption Budget",wizard:r,order:n(),render:({innerRef:n})=>mt.createElement(Nn,{ref:n,formik:t,app:e})}),mt.createElement(je,{label:"Advanced Settings",wizard:r,order:n(),render:({innerRef:n})=>mt.createElement(fn,{ref:n,formik:t,app:e})}))})}};let Tn=Gn;Tn.defaultProps={closeModal:Be,dismissModal:Be};const{useState:In,useEffect:Dn,useMemo:xn}=mt;function Pn(e){const t=e.errors.capacity||{},{min:n,max:r,desired:a}=t;return[n,r,a].find((e=>!!e))}function On({formik:e,serverGroup:t,toggleMode:n}){Dn((()=>{e.setFieldValue("capacity.min",e.values.capacity.desired),e.setFieldValue("capacity.max",e.values.capacity.desired)}),[e.values.capacity.desired]);const r=Pn(e);return mt.createElement("div",null,mt.createElement("p",null,"Sets min, max, and desired instance counts to the same value."),mt.createElement("p",null,"To allow autoscaling, use the"," ",mt.createElement("a",{className:"clickable",onClick:n},"Advanced Mode"),"."),mt.createElement("div",{className:"form-group row"},mt.createElement("div",{className:"col-md-3 sm-label-right"},"Current size"),mt.createElement("div",{className:"col-md-4"},mt.createElement("div",{className:"horizontal middle"},mt.createElement("input",{type:"number",className:"NumberInput form-control",value:t.capacity.desired,disabled:!0}),mt.createElement("div",{className:"sp-padding-xs-xaxis"},"instances")))),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},"Resize to"),mt.createElement("div",{className:"col-md-4"},mt.createElement("div",{className:"horizontal middle"},mt.createElement(de,{name:"capacity.desired",input:e=>mt.createElement(Ae,{...e,min:0}),layout:({input:e})=>mt.createElement(mt.Fragment,null,e),touched:!0,onChange:()=>{}}),mt.createElement("div",{className:"sp-padding-xs-xaxis"},"instances")))),!!r&&mt.createElement("div",{className:"col-md-offset-3 col-md-9"},mt.createElement(ce,{message:r,type:"error"})),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},"Changes"),mt.createElement("div",{className:"col-md-9 sm-control-field"},mt.createElement(Ze,{current:t.capacity,next:e.values.capacity}))))}function Ln({formik:e,serverGroup:t,toggleMode:n}){const{min:r,max:a}=e.values.capacity||{},s=({value:e})=>mt.createElement("div",{className:"col-md-2"},mt.createElement("input",{className:"NumberInput form-control",type:"number",disabled:!0,value:e})),i=Pn(e);return mt.createElement("div",null,mt.createElement("p",null,"Sets up auto-scaling for this server group."),mt.createElement("p",null,"To disable auto-scaling, use the"," ",mt.createElement("a",{className:"clickable",onClick:n},"Simple Mode"),"."),mt.createElement("div",{className:"form-group bold"},mt.createElement("div",{className:"col-md-2 col-md-offset-3"},"Min"),mt.createElement("div",{className:"col-md-2"},"Max"),mt.createElement("div",{className:"col-md-2"},"Desired")),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},"Current"),mt.createElement(s,{value:t.capacity.min}),mt.createElement(s,{value:t.capacity.max}),mt.createElement(s,{value:t.capacity.desired})),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},"Resize to"),mt.createElement("div",{className:"col-md-2"},mt.createElement(de,{name:"capacity.min",input:e=>mt.createElement(Ae,{...e,min:0,max:a}),layout:({input:e})=>mt.createElement(mt.Fragment,null,e),touched:!0})),mt.createElement("div",{className:"col-md-2"},mt.createElement(de,{name:"capacity.max",input:e=>mt.createElement(Ae,{...e,min:r}),layout:({input:e})=>mt.createElement(mt.Fragment,null,e),touched:!0})),mt.createElement("div",{className:"col-md-2"},mt.createElement(de,{name:"capacity.desired",input:e=>mt.createElement(Ae,{...e,min:r,max:a}),layout:({input:e})=>mt.createElement(mt.Fragment,null,e),touched:!0}))),!!i&&mt.createElement("div",{className:"col-md-offset-3 col-md-9"},mt.createElement(ce,{message:i,type:"error"})),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},"Changes"),mt.createElement("div",{className:"col-md-9 sm-control-field"},mt.createElement(Ze,{current:t.capacity,next:e.values.capacity}))))}function Mn(e){const{min:t,max:n,desired:r}=e.capacity,a={};return t>n?a.min=a.max="Min cannot be larger than Max":r<t?a.desired=a.min="Desired cannot be smaller than Min":r>n&&(a.desired=a.max="Desired cannot be larger than Max"),Object.keys(a).length?{capacity:a}:{}}function Fn(e){const{serverGroup:t,application:n,dismissModal:r}=e,a=xn((()=>{const{min:e,max:n,desired:r}=t.capacity;return r!==n||r!==e}),[]),[s,i]=In(a),o=n.attributes&&n.attributes.platformHealthOnlyShowOverride,[l,c]=In(),u=((e,t)=>{const n=Le.modalInstanceEmulation((()=>t()));return pt((()=>new Le({modalInstance:n,...e})),[e.application,e.title])})({application:n,title:`Resizing ${t.name}`,onTaskComplete:()=>n.getDataSource("serverGroups").refresh(!0)},r),d=e=>u.submit((()=>I.serverGroupWriter.resizeServerGroup(t,n,e))),m={capacity:t.capacity};return mt.createElement(mt.Fragment,null,mt.createElement(Re,{monitor:u}),mt.createElement(Ge,{initialValues:m,validate:Mn,onSubmit:d,render:e=>mt.createElement(mt.Fragment,null,mt.createElement(Ve,{dismiss:r}),mt.createElement(zt.Header,null,mt.createElement(zt.Title,null,"Resize ",t.name)),mt.createElement(zt.Body,null,mt.createElement(Lt,{className:"form-horizontal"},s?mt.createElement(Ln,{formik:e,serverGroup:t,toggleMode:()=>i(!1)}):mt.createElement(On,{formik:e,serverGroup:t,toggleMode:()=>i(!0)}),o&&mt.createElement(We,{interestingHealthProviderNames:e.values.interestingHealthProviderNames,platformHealthType:"Titus",showHelpDetails:!0,onChange:t=>e.setFieldValue("interestingHealthProviderNames",t||void 0)}))),mt.createElement(zt.Footer,null,mt.createElement(He,{account:t.account,onValidChange:c}),mt.createElement("button",{className:"btn btn-default",onClick:r},"Cancel"),mt.createElement("button",{type:"submit",disabled:!l||!e.isValid,className:"btn btn-primary",onClick:()=>d(e.values)},"Submit")))}))}class zn extends Error{}class jn extends zn{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Bn extends zn{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Rn extends zn{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Vn extends zn{}class Wn extends zn{constructor(e){super(`Invalid unit ${e}`)}}class Hn extends zn{}class Zn extends zn{constructor(){super("Zone is an abstract class")}}const Un="numeric",qn="short",Jn="long",Kn={year:Un,month:Un,day:Un},Xn={year:Un,month:qn,day:Un},Yn={year:Un,month:Jn,day:Un},Qn={year:Un,month:Jn,day:Un,weekday:Jn},$n={hour:Un,minute:Un},_n={hour:Un,minute:Un,second:Un},er={hour:Un,minute:Un,second:Un,timeZoneName:qn},tr={hour:Un,minute:Un,second:Un,timeZoneName:Jn},nr={hour:Un,minute:Un,hour12:!1},rr={hour:Un,minute:Un,second:Un,hour12:!1},ar={hour:Un,minute:Un,second:Un,hour12:!1,timeZoneName:qn},sr={hour:Un,minute:Un,second:Un,hour12:!1,timeZoneName:Jn},ir={year:Un,month:Un,day:Un,hour:Un,minute:Un},or={year:Un,month:Un,day:Un,hour:Un,minute:Un,second:Un},lr={year:Un,month:qn,day:Un,hour:Un,minute:Un},cr={year:Un,month:qn,day:Un,hour:Un,minute:Un,second:Un},ur={year:Un,month:qn,day:Un,weekday:qn,hour:Un,minute:Un},dr={year:Un,month:Jn,day:Un,hour:Un,minute:Un,timeZoneName:qn},mr={year:Un,month:Jn,day:Un,hour:Un,minute:Un,second:Un,timeZoneName:qn},pr={year:Un,month:Jn,day:Un,weekday:Jn,hour:Un,minute:Un,timeZoneName:Jn},gr={year:Un,month:Jn,day:Un,weekday:Jn,hour:Un,minute:Un,second:Un,timeZoneName:Jn};function hr(e){return void 0===e}function fr(e){return"number"==typeof e}function vr(e){return"number"==typeof e&&e%1==0}function yr(){try{return"undefined"!=typeof Intl&&Intl.DateTimeFormat}catch(e){return!1}}function br(){return!hr(Intl.DateTimeFormat.prototype.formatToParts)}function Cr(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function Er(e,t,n){if(0!==e.length)return e.reduce(((e,r)=>{const a=[t(r),r];return e&&n(e[0],a[0])===e[0]?e:a}),null)[1]}function wr(e,t){return t.reduce(((t,n)=>(t[n]=e[n],t)),{})}function Sr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function kr(e,t,n){return vr(e)&&e>=t&&e<=n}function Nr(e,t=2){return e.toString().length<t?("0".repeat(t)+e).slice(-t):e.toString()}function Ar(e){return hr(e)||null===e||""===e?void 0:parseInt(e,10)}function Gr(e){if(!hr(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function Tr(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function Ir(e){return e%4==0&&(e%100!=0||e%400==0)}function Dr(e){return Ir(e)?366:365}function xr(e,t){const n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?Ir(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Pr(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function Or(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return 4===t||3===r?53:52}function Lr(e){return e>99?e:e>60?1900+e:2e3+e}function Mr(e,t,n,r=null){const a=new Date(e),s={hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(s.timeZone=r);const i=Object.assign({timeZoneName:t},s),o=yr();if(o&&br()){const e=new Intl.DateTimeFormat(n,i).formatToParts(a).find((e=>"timezonename"===e.type.toLowerCase()));return e?e.value:null}if(o){const e=new Intl.DateTimeFormat(n,s).format(a);return new Intl.DateTimeFormat(n,i).format(a).substring(e.length).replace(/^[, \u200e]+/,"")}return null}function Fr(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-r:r)}function zr(e){const t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new Hn(`Invalid unit value ${e}`);return t}function jr(e,t,n){const r={};for(const a in e)if(Sr(e,a)){if(n.indexOf(a)>=0)continue;const s=e[a];if(null==s)continue;r[t(a)]=zr(s)}return r}function Br(e,t){const n=Math.trunc(e/60),r=Math.abs(e%60),a=n>=0&&!Object.is(n,-0)?"+":"-",s=`${a}${Math.abs(n)}`;switch(t){case"short":return`${a}${Nr(Math.abs(n),2)}:${Nr(r,2)}`;case"narrow":return r>0?`${s}:${r}`:s;case"techie":return`${a}${Nr(Math.abs(n),2)}${Nr(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Rr(e){return wr(e,["hour","minute","second","millisecond"])}const Vr=/[A-Za-z_+-]{1,256}(:?\/[A-Za-z_+-]{1,256}(\/[A-Za-z_+-]{1,256})?)?/;function Wr(e){return JSON.stringify(e,Object.keys(e).sort())}const Hr=["January","February","March","April","May","June","July","August","September","October","November","December"],Zr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ur=["J","F","M","A","M","J","J","A","S","O","N","D"];function qr(e){switch(e){case"narrow":return Ur;case"short":return Zr;case"long":return Hr;case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Jr=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Kr=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Xr=["M","T","W","T","F","S","S"];function Yr(e){switch(e){case"narrow":return Xr;case"short":return Kr;case"long":return Jr;case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Qr=["AM","PM"],$r=["Before Christ","Anno Domini"],_r=["BC","AD"],ea=["B","A"];function ta(e){switch(e){case"narrow":return ea;case"short":return _r;case"long":return $r;default:return null}}function na(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const ra={D:Kn,DD:Xn,DDD:Yn,DDDD:Qn,t:$n,tt:_n,ttt:er,tttt:tr,T:nr,TT:rr,TTT:ar,TTTT:sr,f:ir,ff:lr,fff:dr,ffff:pr,F:or,FF:cr,FFF:mr,FFFF:gr};class aa{static create(e,t={}){return new aa(e,t)}static parseFormat(e){let t=null,n="",r=!1;const a=[];for(let s=0;s<e.length;s++){const i=e.charAt(s);"'"===i?(n.length>0&&a.push({literal:r,val:n}),t=null,n="",r=!r):r||i===t?n+=i:(n.length>0&&a.push({literal:!1,val:n}),n=i,t=i)}return n.length>0&&a.push({literal:r,val:n}),a}static macroTokenToFormatOpts(e){return ra[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(e,Object.assign({},this.opts,t)).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,Object.assign({},this.opts,t)).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,Object.assign({},this.opts,t)).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,Object.assign({},this.opts,t)).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Nr(e,t);const n=Object.assign({},this.opts);return t>0&&(n.padTo=t),this.loc.numberFormatter(n).format(e)}formatDateTimeFromString(e,t){const n="en"===this.loc.listingMode(),r=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar&&br(),a=(t,n)=>this.loc.extract(e,t,n),s=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",i=()=>n?function(e){return Qr[e.hour<12?0:1]}(e):a({hour:"numeric",hour12:!0},"dayperiod"),o=(t,r)=>n?function(e,t){return qr(t)[e.month-1]}(e,t):a(r?{month:t}:{month:t,day:"numeric"},"month"),l=(t,r)=>n?function(e,t){return Yr(t)[e.weekday-1]}(e,t):a(r?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),c=t=>{const n=aa.macroTokenToFormatOpts(t);return n?this.formatWithSystemDefault(e,n):t},u=t=>n?function(e,t){return ta(t)[e.year<0?0:1]}(e,t):a({era:t},"era");return na(aa.parseFormat(t),(t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return i();case"d":return r?a({day:"numeric"},"day"):this.num(e.day);case"dd":return r?a({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return r?a({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?a({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return o("short",!0);case"LLLL":return o("long",!0);case"LLLLL":return o("narrow",!0);case"M":return r?a({month:"numeric"},"month"):this.num(e.month);case"MM":return r?a({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return o("short",!1);case"MMMM":return o("long",!1);case"MMMMM":return o("narrow",!1);case"y":return r?a({year:"numeric"},"year"):this.num(e.year);case"yy":return r?a({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?a({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?a({year:"numeric"},"year"):this.num(e.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(t)}}))}formatDurationFromString(e,t){const n=e=>{switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"M":return"month";case"y":return"year";default:return null}},r=aa.parseFormat(t),a=r.reduce(((e,{literal:t,val:n})=>t?e:e.concat(n)),[]);return na(r,(e=>t=>{const r=n(t);return r?this.num(e.get(r),t.length):t})(e.shiftTo(...a.map(n).filter((e=>e)))))}}class sa{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class ia{get type(){throw new Zn}get name(){throw new Zn}get universal(){throw new Zn}offsetName(e,t){throw new Zn}formatOffset(e,t){throw new Zn}offset(e){throw new Zn}equals(e){throw new Zn}get isValid(){throw new Zn}}let oa=null;class la extends ia{static get instance(){return null===oa&&(oa=new la),oa}get type(){return"local"}get name(){return yr()?(new Intl.DateTimeFormat).resolvedOptions().timeZone:"local"}get universal(){return!1}offsetName(e,{format:t,locale:n}){return Mr(e,t,n)}formatOffset(e,t){return Br(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"local"===e.type}get isValid(){return!0}}const ca=RegExp(`^${Vr.source}$`);let ua={};const da={year:0,month:1,day:2,hour:3,minute:4,second:5};let ma={};class pa extends ia{static create(e){return ma[e]||(ma[e]=new pa(e)),ma[e]}static resetCache(){ma={},ua={}}static isValidSpecifier(e){return!(!e||!e.match(ca))}static isValidZone(e){try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}static parseGMTOffset(e){if(e){const t=e.match(/^Etc\/GMT([+-]\d{1,2})$/i);if(t)return-60*parseInt(t[1])}return null}constructor(e){super(),this.zoneName=e,this.valid=pa.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get universal(){return!1}offsetName(e,{format:t,locale:n}){return Mr(e,t,n,this.name)}formatOffset(e,t){return Br(this.offset(e),t)}offset(e){const t=new Date(e),n=(c=this.name,ua[c]||(ua[c]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:c,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),ua[c]),[r,a,s,i,o,l]=n.formatToParts?function(e,t){const n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){const{type:t,value:a}=n[e],s=da[t];hr(s)||(r[s]=parseInt(a,10))}return r}(n,t):function(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n),[,a,s,i,o,l,c]=r;return[i,a,s,o,l,c]}(n,t);var c;let u=+t;const d=u%1e3;return u-=d>=0?d:1e3+d,(Pr({year:r,month:a,day:s,hour:24===i?0:i,minute:o,second:l,millisecond:0})-u)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let ga=null;class ha extends ia{static get utcInstance(){return null===ga&&(ga=new ha(0)),ga}static instance(e){return 0===e?ha.utcInstance:new ha(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new ha(Fr(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${Br(this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Br(this.fixed,t)}get universal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class fa extends ia{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get universal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function va(e,t){let n;if(hr(e)||null===e)return t;if(e instanceof ia)return e;if("string"==typeof e){const r=e.toLowerCase();return"local"===r?t:"utc"===r||"gmt"===r?ha.utcInstance:null!=(n=pa.parseGMTOffset(e))?ha.instance(n):pa.isValidSpecifier(r)?pa.create(e):ha.parseSpecifier(r)||new fa(e)}return fr(e)?ha.instance(e):"object"==typeof e&&e.offset&&"number"==typeof e.offset?e:new fa(e)}let ya=()=>Date.now(),ba=null,Ca=null,Ea=null,wa=null,Sa=!1;class ka{static get now(){return ya}static set now(e){ya=e}static get defaultZoneName(){return ka.defaultZone.name}static set defaultZoneName(e){ba=e?va(e):null}static get defaultZone(){return ba||la.instance}static get defaultLocale(){return Ca}static set defaultLocale(e){Ca=e}static get defaultNumberingSystem(){return Ea}static set defaultNumberingSystem(e){Ea=e}static get defaultOutputCalendar(){return wa}static set defaultOutputCalendar(e){wa=e}static get throwOnInvalid(){return Sa}static set throwOnInvalid(e){Sa=e}static resetCaches(){La.resetCache(),pa.resetCache()}}let Na={};function Aa(e,t={}){const n=JSON.stringify([e,t]);let r=Na[n];return r||(r=new Intl.DateTimeFormat(e,t),Na[n]=r),r}let Ga={};let Ta={};let Ia=null;function Da(e,t,n,r,a){const s=e.listingMode(n);return"error"===s?null:"en"===s?r(t):a(t)}class xa{constructor(e,t,n){if(this.padTo=n.padTo||0,this.floor=n.floor||!1,!t&&yr()){const t={useGrouping:!1};n.padTo>0&&(t.minimumIntegerDigits=n.padTo),this.inf=function(e,t={}){const n=JSON.stringify([e,t]);let r=Ga[n];return r||(r=new Intl.NumberFormat(e,t),Ga[n]=r),r}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return Nr(this.floor?Math.floor(e):Tr(e,3),this.padTo)}}class Pa{constructor(e,t,n){let r;if(this.opts=n,this.hasIntl=yr(),e.zone.universal&&this.hasIntl?(r="UTC",n.timeZoneName?this.dt=e:this.dt=0===e.offset?e:Ti.fromMillis(e.ts+60*e.offset*1e3)):"local"===e.zone.type?this.dt=e:(this.dt=e,r=e.zone.name),this.hasIntl){const e=Object.assign({},this.opts);r&&(e.timeZone=r),this.dtf=Aa(t,e)}}format(){if(this.hasIntl)return this.dtf.format(this.dt.toJSDate());{const e=function(e){const t="EEEE, LLLL d, yyyy, h:mm a";switch(Wr(wr(e,["weekday","era","year","month","day","hour","minute","second","timeZoneName","hour12"]))){case Wr(Kn):return"M/d/yyyy";case Wr(Xn):return"LLL d, yyyy";case Wr(Yn):return"LLLL d, yyyy";case Wr(Qn):return"EEEE, LLLL d, yyyy";case Wr($n):return"h:mm a";case Wr(_n):return"h:mm:ss a";case Wr(er):case Wr(tr):return"h:mm a";case Wr(nr):return"HH:mm";case Wr(rr):return"HH:mm:ss";case Wr(ar):case Wr(sr):return"HH:mm";case Wr(ir):return"M/d/yyyy, h:mm a";case Wr(lr):return"LLL d, yyyy, h:mm a";case Wr(dr):return"LLLL d, yyyy, h:mm a";case Wr(pr):return t;case Wr(or):return"M/d/yyyy, h:mm:ss a";case Wr(cr):return"LLL d, yyyy, h:mm:ss a";case Wr(ur):return"EEE, d LLL yyyy, h:mm a";case Wr(mr):return"LLLL d, yyyy, h:mm:ss a";case Wr(gr):return"EEEE, LLLL d, yyyy, h:mm:ss a";default:return t}}(this.opts),t=La.create("en-US");return aa.create(t).formatDateTimeFromString(this.dt,e)}}formatToParts(){return this.hasIntl&&br()?this.dtf.formatToParts(this.dt.toJSDate()):[]}resolvedOptions(){return this.hasIntl?this.dtf.resolvedOptions():{locale:"en-US",numberingSystem:"latn",outputCalendar:"gregory"}}}class Oa{constructor(e,t,n){this.opts=Object.assign({style:"long"},n),!t&&Cr()&&(this.rtf=function(e,t={}){const{base:n,...r}=t,a=JSON.stringify([e,r]);let s=Ta[a];return s||(s=new Intl.RelativeTimeFormat(e,t),Ta[a]=s),s}(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,n="always",r=!1){const a={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===n&&s){const n="days"===e;switch(t){case 1:return n?"tomorrow":`next ${a[e][0]}`;case-1:return n?"yesterday":`last ${a[e][0]}`;case 0:return n?"today":`this ${a[e][0]}`}}const i=Object.is(t,-0)||t<0,o=Math.abs(t),l=1===o,c=a[e],u=r?l?c[1]:c[2]||c[1]:l?a[e][0]:e;return i?`${o} ${u} ago`:`in ${o} ${u}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class La{static fromOpts(e){return La.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,n,r=!1){const a=e||ka.defaultLocale,s=a||(r?"en-US":function(){if(Ia)return Ia;if(yr()){const e=(new Intl.DateTimeFormat).resolvedOptions().locale;return Ia=e&&"und"!==e?e:"en-US",Ia}return Ia="en-US",Ia}()),i=t||ka.defaultNumberingSystem,o=n||ka.defaultOutputCalendar;return new La(s,i,o,a)}static resetCache(){Ia=null,Na={},Ga={},Ta={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:n}={}){return La.create(e,t,n)}constructor(e,t,n,r){const[a,s,i]=function(e){const t=e.indexOf("-u-");if(-1===t)return[e];{let n;const r=e.substring(0,t);try{n=Aa(e).resolvedOptions()}catch(e){n=Aa(r).resolvedOptions()}const{numberingSystem:a,calendar:s}=n;return[r,a,s]}}(e);this.locale=a,this.numberingSystem=t||s||null,this.outputCalendar=n||i||null,this.intl=function(e,t,n){return yr()?n||t?(e+="-u",n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`),e):e:[]}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||yr()&&"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(e=!0){const t=yr()&&br(),n=this.isEnglish(),r=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return t||n&&r||e?!t||n&&r?"en":"intl":"error"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?La.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone(Object.assign({},e,{defaultToEN:!0}))}redefaultToSystem(e={}){return this.clone(Object.assign({},e,{defaultToEN:!1}))}months(e,t=!1,n=!0){return Da(this,e,n,qr,(()=>{const n=t?{month:e,day:"numeric"}:{month:e},r=t?"format":"standalone";return this.monthsCache[r][e]||(this.monthsCache[r][e]=function(e){const t=[];for(let n=1;n<=12;n++){const r=Ti.utc(2016,n,1);t.push(e(r))}return t}((e=>this.extract(e,n,"month")))),this.monthsCache[r][e]}))}weekdays(e,t=!1,n=!0){return Da(this,e,n,Yr,(()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=function(e){const t=[];for(let n=1;n<=7;n++){const r=Ti.utc(2016,11,13+n);t.push(e(r))}return t}((e=>this.extract(e,n,"weekday")))),this.weekdaysCache[r][e]}))}meridiems(e=!0){return Da(this,void 0,e,(()=>Qr),(()=>{if(!this.meridiemCache){const e={hour:"numeric",hour12:!0};this.meridiemCache=[Ti.utc(2016,11,13,9),Ti.utc(2016,11,13,19)].map((t=>this.extract(t,e,"dayperiod")))}return this.meridiemCache}))}eras(e,t=!0){return Da(this,e,t,ta,(()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Ti.utc(-40,1,1),Ti.utc(2017,1,1)].map((e=>this.extract(e,t,"era")))),this.eraCache[e]}))}extract(e,t,n){const r=this.dtFormatter(e,t).formatToParts().find((e=>e.type.toLowerCase()===n));return r?r.value:null}numberFormatter(e={}){return new xa(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Pa(e,this.intl,t)}relFormatter(e={}){return new Oa(this.intl,this.isEnglish(),e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||yr()&&new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Ma(...e){const t=e.reduce(((e,t)=>e+t.source),"");return RegExp(`^${t}$`)}function Fa(...e){return t=>e.reduce((([e,n,r],a)=>{const[s,i,o]=a(t,r);return[Object.assign(e,s),n||i,o]}),[{},null,1]).slice(0,2)}function za(e,...t){if(null==e)return[null,null];for(const[n,r]of t){const t=n.exec(e);if(t)return r(t)}return[null,null]}function ja(...e){return(t,n)=>{const r={};let a;for(a=0;a<e.length;a++)r[e[a]]=Ar(t[n+a]);return[r,null,n+a]}}const Ba=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Ra=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,9}))?)?)?/,Va=RegExp(`${Ra.source}${Ba.source}?`),Wa=RegExp(`(?:T${Va.source})?`),Ha=ja("weekYear","weekNumber","weekDay"),Za=ja("year","ordinal"),Ua=RegExp(`${Ra.source} ?(?:${Ba.source}|(${Vr.source}))?`),qa=RegExp(`(?: ${Ua.source})?`);function Ja(e,t,n){const r=e[t];return hr(r)?n:Ar(r)}function Ka(e,t){return[{year:Ja(e,t),month:Ja(e,t+1,1),day:Ja(e,t+2,1)},null,t+3]}function Xa(e,t){return[{hour:Ja(e,t,0),minute:Ja(e,t+1,0),second:Ja(e,t+2,0),millisecond:Gr(e[t+3])},null,t+4]}function Ya(e,t){const n=!e[t]&&!e[t+1],r=Fr(e[t+1],e[t+2]);return[{},n?null:ha.instance(r),t+3]}function Qa(e,t){return[{},e[t]?pa.create(e[t]):null,t+1]}const $a=/^-?P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})(?:[.,](-?\d{1,9}))?S)?)?)$/;function _a(e){const[t,n,r,a,s,i,o,l,c]=e,u="-"===t[0],d=e=>e&&u?-e:e;return[{years:d(Ar(n)),months:d(Ar(r)),weeks:d(Ar(a)),days:d(Ar(s)),hours:d(Ar(i)),minutes:d(Ar(o)),seconds:d(Ar(l)),milliseconds:d(Gr(c))}]}const es={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function ts(e,t,n,r,a,s,i){const o={year:2===t.length?Lr(Ar(t)):Ar(t),month:Zr.indexOf(n)+1,day:Ar(r),hour:Ar(a),minute:Ar(s)};return i&&(o.second=Ar(i)),e&&(o.weekday=e.length>3?Jr.indexOf(e)+1:Kr.indexOf(e)+1),o}const ns=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function rs(e){const[,t,n,r,a,s,i,o,l,c,u,d]=e,m=ts(t,a,r,n,s,i,o);let p;return p=l?es[l]:c?0:Fr(u,d),[m,new ha(p)]}const as=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,ss=/^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,is=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function os(e){const[,t,n,r,a,s,i,o]=e;return[ts(t,a,r,n,s,i,o),ha.utcInstance]}function ls(e){const[,t,n,r,a,s,i,o]=e;return[ts(t,o,n,r,a,s,i),ha.utcInstance]}const cs=Ma(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Wa),us=Ma(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Wa),ds=Ma(/(\d{4})-?(\d{3})/,Wa),ms=Ma(Va),ps=Fa(Ka,Xa,Ya),gs=Fa(Ha,Xa,Ya),hs=Fa(Za,Xa),fs=Fa(Xa,Ya);const vs=Ma(/(\d{4})-(\d\d)-(\d\d)/,qa),ys=Ma(Ua),bs=Fa(Ka,Xa,Ya,Qa),Cs=Fa(Xa,Ya,Qa);const Es={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},ws=Object.assign({years:{months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},Es),Ss=Object.assign({years:{months:12,weeks:52.1775,days:365.2425,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:30.436875/7,days:30.436875,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},Es),ks=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Ns=ks.slice(0).reverse();function As(e,t,n=!1){const r={values:n?t.values:Object.assign({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy};return new Is(r)}function Gs(e,t,n,r,a){const s=e[a][n],i=t[n]/s,o=!(Math.sign(i)===Math.sign(r[a]))&&0!==r[a]&&Math.abs(i)<=1?function(e){return e<0?Math.floor(e):Math.ceil(e)}(i):Math.trunc(i);r[a]+=o,t[n]-=o*s}function Ts(e,t){Ns.reduce(((n,r)=>hr(t[r])?n:(n&&Gs(e,t,n,t,r),r)),null)}class Is{constructor(e){const t="longterm"===e.conversionAccuracy||!1;this.values=e.values,this.loc=e.loc||La.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?Ss:ws,this.isLuxonDuration=!0}static fromMillis(e,t){return Is.fromObject(Object.assign({milliseconds:e},t))}static fromObject(e){if(null==e||"object"!=typeof e)throw new Hn("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new Is({values:jr(e,Is.normalizeUnit,["locale","numberingSystem","conversionAccuracy","zone"]),loc:La.fromObject(e),conversionAccuracy:e.conversionAccuracy})}static fromISO(e,t){const[n]=function(e){return za(e,[$a,_a])}(e);if(n){const e=Object.assign(n,t);return Is.fromObject(e)}return Is.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Hn("need to specify a reason the Duration is invalid");const n=e instanceof sa?e:new sa(e,t);if(ka.throwOnInvalid)throw new Rn(n);return new Is({invalid:n})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new Wn(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const n=Object.assign({},t,{floor:!1!==t.round&&!1!==t.floor});return this.isValid?aa.create(this.loc,n).formatDurationFromString(this,e):"Invalid Duration"}toObject(e={}){if(!this.isValid)return{};const t=Object.assign({},this.values);return e.includeConfig&&(t.conversionAccuracy=this.conversionAccuracy,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=Tr(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toJSON(){return this.toISO()}toString(){return this.toISO()}valueOf(){return this.as("milliseconds")}plus(e){if(!this.isValid)return this;const t=Ds(e),n={};for(const e of ks)(Sr(t.values,e)||Sr(this.values,e))&&(n[e]=t.get(e)+this.get(e));return As(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const t=Ds(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=zr(e(this.values[n],n));return As(this,{values:t},!0)}get(e){return this[Is.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return As(this,{values:Object.assign(this.values,jr(e,Is.normalizeUnit,[]))})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n}={}){const r={loc:this.loc.clone({locale:e,numberingSystem:t})};return n&&(r.conversionAccuracy=n),As(this,r)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Ts(this.matrix,e),As(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map((e=>Is.normalizeUnit(e)));const t={},n={},r=this.toObject();let a;Ts(this.matrix,r);for(const s of ks)if(e.indexOf(s)>=0){a=s;let e=0;for(const t in n)e+=this.matrix[t][s]*n[t],n[t]=0;fr(r[s])&&(e+=r[s]);const i=Math.trunc(e);t[s]=i,n[s]=e-i;for(const e in r)ks.indexOf(e)>ks.indexOf(s)&&Gs(this.matrix,r,e,t,s)}else fr(r[s])&&(n[s]=r[s]);for(const e in n)0!==n[e]&&(t[a]+=e===a?n[e]:n[e]/this.matrix[a][e]);return As(this,{values:t},!0).normalize()}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=-this.values[t];return As(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(const t of ks)if(this.values[t]!==e.values[t])return!1;return!0}}function Ds(e){if(fr(e))return Is.fromMillis(e);if(Is.isDuration(e))return e;if("object"==typeof e)return Is.fromObject(e);throw new Hn(`Unknown duration argument ${e} of type ${typeof e}`)}const xs="Invalid Interval";class Ps{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new Hn("need to specify a reason the Interval is invalid");const n=e instanceof sa?e:new sa(e,t);if(ka.throwOnInvalid)throw new Bn(n);return new Ps({invalid:n})}static fromDateTimes(e,t){const n=Ii(e),r=Ii(t),a=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?Ps.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null:Ps.invalid("missing or invalid end"):Ps.invalid("missing or invalid start")}(n,r);return null==a?new Ps({start:n,end:r}):a}static after(e,t){const n=Ds(t),r=Ii(e);return Ps.fromDateTimes(r,r.plus(n))}static before(e,t){const n=Ds(t),r=Ii(e);return Ps.fromDateTimes(r.minus(n),r)}static fromISO(e,t){const[n,r]=(e||"").split("/",2);if(n&&r){const e=Ti.fromISO(n,t),a=Ti.fromISO(r,t);if(e.isValid&&a.isValid)return Ps.fromDateTimes(e,a);if(e.isValid){const n=Is.fromISO(r,t);if(n.isValid)return Ps.after(e,n)}else if(a.isValid){const e=Is.fromISO(n,t);if(e.isValid)return Ps.before(a,e)}}return Ps.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds"){if(!this.isValid)return NaN;const t=this.start.startOf(e),n=this.end.startOf(e);return Math.floor(n.diff(t,e).get(e))+1}hasSame(e){return!!this.isValid&&this.e.minus(1).hasSame(this.s,e)}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return!!this.isValid&&this.s>e}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)}set({start:e,end:t}={}){return this.isValid?Ps.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Ii).filter((e=>this.contains(e))).sort(),n=[];let{s:r}=this,a=0;for(;r<this.e;){const e=t[a]||this.e,s=+e>+this.e?this.e:e;n.push(Ps.fromDateTimes(r,s)),r=s,a+=1}return n}splitBy(e){const t=Ds(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let n,r,{s:a}=this;const s=[];for(;a<this.e;)n=a.plus(t),r=+n>+this.e?this.e:n,s.push(Ps.fromDateTimes(a,r)),a=r;return s}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return!!this.isValid&&+this.e==+e.s}abutsEnd(e){return!!this.isValid&&+e.e==+this.s}engulfs(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)}equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,n=this.e<e.e?this.e:e.e;return t>n?null:Ps.fromDateTimes(t,n)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,n=this.e>e.e?this.e:e.e;return Ps.fromDateTimes(t,n)}static merge(e){const[t,n]=e.sort(((e,t)=>e.s-t.s)).reduce((([e,t],n)=>t?t.overlaps(n)||t.abutsStart(n)?[e,t.union(n)]:[e.concat([t]),n]:[e,n]),[[],null]);return n&&t.push(n),t}static xor(e){let t=null,n=0;const r=[],a=e.map((e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}])),s=Array.prototype.concat(...a).sort(((e,t)=>e.time-t.time));for(const e of s)n+="s"===e.type?1:-1,1===n?t=e.time:(t&&+t!=+e.time&&r.push(Ps.fromDateTimes(t,e.time)),t=null);return Ps.merge(r)}difference(...e){return Ps.xor([this].concat(e)).map((e=>this.intersection(e))).filter((e=>e&&!e.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:xs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:xs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:xs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:xs}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:xs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):Is.invalid(this.invalidReason)}mapEndpoints(e){return Ps.fromDateTimes(e(this.s),e(this.e))}}class Os{static hasDST(e=ka.defaultZone){const t=Ti.local().setZone(e).set({month:12});return!e.universal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return pa.isValidSpecifier(e)&&pa.isValidZone(e)}static normalizeZone(e){return va(e,ka.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:n=null,outputCalendar:r="gregory"}={}){return La.create(t,n,r).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:n=null,outputCalendar:r="gregory"}={}){return La.create(t,n,r).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:n=null}={}){return La.create(t,n,null).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:n=null}={}){return La.create(t,n,null).weekdays(e,!0)}static meridiems({locale:e=null}={}){return La.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return La.create(t,null,"gregory").eras(e)}static features(){let e=!1,t=!1,n=!1,r=!1;if(yr()){e=!0,t=br(),r=Cr();try{n="America/New_York"===new Intl.DateTimeFormat("en",{timeZone:"America/New_York"}).resolvedOptions().timeZone}catch(e){n=!1}}return{intl:e,intlTokens:t,zones:n,relative:r}}}function Ls(e,t){const n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Is.fromMillis(r).as("days"))}function Ms(e,t,n,r){let[a,s,i,o]=function(e,t,n){const r=[["years",(e,t)=>t.year-e.year],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const n=Ls(e,t);return(n-n%7)/7}],["days",Ls]],a={};let s,i;for(const[o,l]of r)if(n.indexOf(o)>=0){s=o;let n=l(e,t);i=e.plus({[o]:n}),i>t?(e=e.plus({[o]:n-1}),n-=1):e=i,a[o]=n}return[e,a,i,s]}(e,t,n);const l=t-a,c=n.filter((e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0));0===c.length&&(i<t&&(i=a.plus({[o]:1})),i!==a&&(s[o]=(s[o]||0)+l/(i-a)));const u=Is.fromObject(Object.assign(s,r));return c.length>0?Is.fromMillis(l,r).shiftTo(...c).plus(u):u}const Fs={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},zs={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},js=Fs.hanidec.replace(/[\[|\]]/g,"").split("");function Bs({numberingSystem:e},t=""){return new RegExp(`${Fs[e||"latn"]}${t}`)}function Rs(e,t=(e=>e)){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(-1!==e[n].search(Fs.hanidec))t+=js.indexOf(e[n]);else for(const e in zs){const[n,a]=zs[e];r>=n&&r<=a&&(t+=r-n)}}return parseInt(t,10)}return t}(e))}}function Vs(e){return e.replace(/\./,"\\.?")}function Ws(e){return e.replace(/\./,"").toLowerCase()}function Hs(e,t){return null===e?null:{regex:RegExp(e.map(Vs).join("|")),deser:([n])=>e.findIndex((e=>Ws(n)===Ws(e)))+t}}function Zs(e,t){return{regex:e,deser:([,e,t])=>Fr(e,t),groups:t}}function Us(e){return{regex:e,deser:([e])=>e}}const qs={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};let Js=null;function Ks(e,t){if(e.literal)return e;const n=aa.macroTokenToFormatOpts(e.val);if(!n)return e;const r=aa.create(t,n).formatDateTimeParts((Js||(Js=Ti.fromMillis(1555555555555)),Js)).map((e=>function(e,t,n){const{type:r,value:a}=e;if("literal"===r)return{literal:!0,val:a};const s=n[r];let i=qs[r];return"object"==typeof i&&(i=i[s]),i?{literal:!1,val:i}:void 0}(e,0,n)));return r.includes(void 0)?e:r}function Xs(e,t,n){const r=function(e,t){return Array.prototype.concat(...e.map((e=>Ks(e,t))))}(aa.parseFormat(n),e),a=r.map((t=>function(e,t){const n=Bs(t),r=Bs(t,"{2}"),a=Bs(t,"{3}"),s=Bs(t,"{4}"),i=Bs(t,"{6}"),o=Bs(t,"{1,2}"),l=Bs(t,"{1,3}"),c=Bs(t,"{1,6}"),u=Bs(t,"{1,9}"),d=Bs(t,"{2,4}"),m=Bs(t,"{4,6}"),p=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},g=(g=>{if(e.literal)return p(g);switch(g.val){case"G":return Hs(t.eras("short",!1),0);case"GG":return Hs(t.eras("long",!1),0);case"y":return Rs(c);case"yy":return Rs(d,Lr);case"yyyy":return Rs(s);case"yyyyy":return Rs(m);case"yyyyyy":return Rs(i);case"M":return Rs(o);case"MM":return Rs(r);case"MMM":return Hs(t.months("short",!0,!1),1);case"MMMM":return Hs(t.months("long",!0,!1),1);case"L":return Rs(o);case"LL":return Rs(r);case"LLL":return Hs(t.months("short",!1,!1),1);case"LLLL":return Hs(t.months("long",!1,!1),1);case"d":return Rs(o);case"dd":return Rs(r);case"o":return Rs(l);case"ooo":return Rs(a);case"HH":return Rs(r);case"H":return Rs(o);case"hh":return Rs(r);case"h":return Rs(o);case"mm":return Rs(r);case"m":case"q":return Rs(o);case"qq":return Rs(r);case"s":return Rs(o);case"ss":return Rs(r);case"S":return Rs(l);case"SSS":return Rs(a);case"u":return Us(u);case"a":return Hs(t.meridiems(),0);case"kkkk":return Rs(s);case"kk":return Rs(d,Lr);case"W":return Rs(o);case"WW":return Rs(r);case"E":case"c":return Rs(n);case"EEE":return Hs(t.weekdays("short",!1,!1),1);case"EEEE":return Hs(t.weekdays("long",!1,!1),1);case"ccc":return Hs(t.weekdays("short",!0,!1),1);case"cccc":return Hs(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Zs(new RegExp(`([+-]${o.source})(?::(${r.source}))?`),2);case"ZZZ":return Zs(new RegExp(`([+-]${o.source})(${r.source})?`),2);case"z":return Us(/[a-z_+-/]{1,256}?/i);default:return p(g)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return g.token=e,g}(t,e))),s=a.find((e=>e.invalidReason));if(s)return{input:t,tokens:r,invalidReason:s.invalidReason};{const[e,n]=function(e){return[`^${e.map((e=>e.regex)).reduce(((e,t)=>`${e}(${t.source})`),"")}$`,e]}(a),s=RegExp(e,"i"),[i,o]=function(e,t,n){const r=e.match(t);if(r){const e={};let t=1;for(const a in n)if(Sr(n,a)){const s=n[a],i=s.groups?s.groups+1:1;!s.literal&&s.token&&(e[s.token.val[0]]=s.deser(r.slice(t,t+i))),t+=i}return[r,e]}return[r,{}]}(t,s,n),[l,c]=o?function(e){let t;return t=hr(e.Z)?hr(e.z)?null:pa.create(e.z):new ha(e.Z),hr(e.q)||(e.M=3*(e.q-1)+1),hr(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),hr(e.u)||(e.S=Gr(e.u)),[Object.keys(e).reduce(((t,n)=>{const r=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(n);return r&&(t[r]=e[n]),t}),{}),t]}(o):[null,null];if(Sr(o,"a")&&Sr(o,"H"))throw new Vn("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:s,rawMatches:i,matches:o,result:l,zone:c}}}const Ys=[0,31,59,90,120,151,181,212,243,273,304,334],Qs=[0,31,60,91,121,152,182,213,244,274,305,335];function $s(e,t){return new sa("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function _s(e,t,n){const r=new Date(Date.UTC(e,t-1,n)).getUTCDay();return 0===r?7:r}function ei(e,t,n){return n+(Ir(e)?Qs:Ys)[t-1]}function ti(e,t){const n=Ir(e)?Qs:Ys,r=n.findIndex((e=>e<t));return{month:r+1,day:t-n[r]}}function ni(e){const{year:t,month:n,day:r}=e,a=ei(t,n,r),s=_s(t,n,r);let i,o=Math.floor((a-s+10)/7);return o<1?(i=t-1,o=Or(i)):o>Or(t)?(i=t+1,o=1):i=t,Object.assign({weekYear:i,weekNumber:o,weekday:s},Rr(e))}function ri(e){const{weekYear:t,weekNumber:n,weekday:r}=e,a=_s(t,1,4),s=Dr(t);let i,o=7*n+r-a-3;o<1?(i=t-1,o+=Dr(i)):o>s?(i=t+1,o-=Dr(t)):i=t;const{month:l,day:c}=ti(i,o);return Object.assign({year:i,month:l,day:c},Rr(e))}function ai(e){const{year:t,month:n,day:r}=e,a=ei(t,n,r);return Object.assign({year:t,ordinal:a},Rr(e))}function si(e){const{year:t,ordinal:n}=e,{month:r,day:a}=ti(t,n);return Object.assign({year:t,month:r,day:a},Rr(e))}function ii(e){const t=vr(e.year),n=kr(e.month,1,12),r=kr(e.day,1,xr(e.year,e.month));return t?n?!r&&$s("day",e.day):$s("month",e.month):$s("year",e.year)}function oi(e){const{hour:t,minute:n,second:r,millisecond:a}=e,s=kr(t,0,23)||24===t&&0===n&&0===r&&0===a,i=kr(n,0,59),o=kr(r,0,59),l=kr(a,0,999);return s?i?o?!l&&$s("millisecond",a):$s("second",r):$s("minute",n):$s("hour",t)}const li="Invalid DateTime";function ci(e){return new sa("unsupported zone",`the zone "${e.name}" is not supported`)}function ui(e){return null===e.weekData&&(e.weekData=ni(e.c)),e.weekData}function di(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Ti(Object.assign({},n,t,{old:n}))}function mi(e,t,n){let r=e-60*t*1e3;const a=n.offset(r);if(t===a)return[r,t];r-=60*(a-t)*1e3;const s=n.offset(r);return a===s?[r,a]:[e-60*Math.min(a,s)*1e3,Math.max(a,s)]}function pi(e,t){const n=new Date(e+=60*t*1e3);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function gi(e,t,n){return mi(Pr(e),t,n)}function hi(e,t){const n=Object.keys(t.values);-1===n.indexOf("milliseconds")&&n.push("milliseconds"),t=t.shiftTo(...n);const r=e.o,a=e.c.year+t.years,s=e.c.month+t.months+3*t.quarters,i=Object.assign({},e.c,{year:a,month:s,day:Math.min(e.c.day,xr(a,s))+t.days+7*t.weeks}),o=Is.fromObject({hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),l=Pr(i);let[c,u]=mi(l,r,e.zone);return 0!==o&&(c+=o,u=e.zone.offset(c)),{ts:c,o:u}}function fi(e,t,n,r,a){const{setZone:s,zone:i}=n;if(e&&0!==Object.keys(e).length){const r=t||i,a=Ti.fromObject(Object.assign(e,n,{zone:r,setZone:void 0}));return s?a:a.setZone(i)}return Ti.invalid(new sa("unparsable",`the input "${a}" can't be parsed as ${r}`))}function vi(e,t,n=!0){return e.isValid?aa.create(La.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function yi(e,{suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:r,includeZone:a=!1,spaceZone:s=!1,format:i="extended"}){let o="basic"===i?"HHmm":"HH:mm";return t&&0===e.second&&0===e.millisecond||(o+="basic"===i?"ss":":ss",n&&0===e.millisecond||(o+=".SSS")),(a||r)&&s&&(o+=" "),a?o+="z":r&&(o+="basic"===i?"ZZZ":"ZZ"),vi(e,o)}const bi={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Ci={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Ei={ordinal:1,hour:0,minute:0,second:0,millisecond:0},wi=["year","month","day","hour","minute","second","millisecond"],Si=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ki=["year","ordinal","hour","minute","second","millisecond"];function Ni(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new Wn(e);return t}function Ai(e,t){for(const t of wi)hr(e[t])&&(e[t]=bi[t]);const n=ii(e)||oi(e);if(n)return Ti.invalid(n);const r=ka.now(),a=t.offset(r),[s,i]=gi(e,a,t);return new Ti({ts:s,zone:t,o:i})}function Gi(e,t,n){const r=!!hr(n.round)||n.round,a=(e,a)=>{e=Tr(e,r||n.calendary?0:2,!0);return t.loc.clone(n).relFormatter(n).format(e,a)},s=r=>n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r);if(n.unit)return a(s(n.unit),n.unit);for(const e of n.units){const t=s(e);if(Math.abs(t)>=1)return a(t,e)}return a(0,n.units[n.units.length-1])}class Ti{constructor(e){const t=e.zone||ka.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new sa("invalid input"):null)||(t.isValid?null:ci(t));this.ts=hr(e.ts)?ka.now():e.ts;let r=null,a=null;if(!n){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,a]=[e.old.c,e.old.o];else{const e=t.offset(this.ts);r=pi(this.ts,e),n=Number.isNaN(r.year)?new sa("invalid input"):null,r=n?null:r,a=n?null:e}}this._zone=t,this.loc=e.loc||La.create(),this.invalid=n,this.weekData=null,this.c=r,this.o=a,this.isLuxonDateTime=!0}static local(e,t,n,r,a,s,i){return hr(e)?new Ti({ts:ka.now()}):Ai({year:e,month:t,day:n,hour:r,minute:a,second:s,millisecond:i},ka.defaultZone)}static utc(e,t,n,r,a,s,i){return hr(e)?new Ti({ts:ka.now(),zone:ha.utcInstance}):Ai({year:e,month:t,day:n,hour:r,minute:a,second:s,millisecond:i},ha.utcInstance)}static fromJSDate(e,t={}){const n=(r=e,"[object Date]"===Object.prototype.toString.call(r)?e.valueOf():NaN);var r;if(Number.isNaN(n))return Ti.invalid("invalid input");const a=va(t.zone,ka.defaultZone);return a.isValid?new Ti({ts:n,zone:a,loc:La.fromObject(t)}):Ti.invalid(ci(a))}static fromMillis(e,t={}){if(fr(e))return e<-864e13||e>864e13?Ti.invalid("Timestamp out of range"):new Ti({ts:e,zone:va(t.zone,ka.defaultZone),loc:La.fromObject(t)});throw new Hn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(fr(e))return new Ti({ts:1e3*e,zone:va(t.zone,ka.defaultZone),loc:La.fromObject(t)});throw new Hn("fromSeconds requires a numerical input")}static fromObject(e){const t=va(e.zone,ka.defaultZone);if(!t.isValid)return Ti.invalid(ci(t));const n=ka.now(),r=t.offset(n),a=jr(e,Ni,["zone","locale","outputCalendar","numberingSystem"]),s=!hr(a.ordinal),i=!hr(a.year),o=!hr(a.month)||!hr(a.day),l=i||o,c=a.weekYear||a.weekNumber,u=La.fromObject(e);if((l||s)&&c)throw new Vn("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Vn("Can't mix ordinal dates with month/day");const d=c||a.weekday&&!l;let m,p,g=pi(n,r);d?(m=Si,p=Ci,g=ni(g)):s?(m=ki,p=Ei,g=ai(g)):(m=wi,p=bi);let h=!1;for(const e of m){hr(a[e])?a[e]=h?p[e]:g[e]:h=!0}const f=(d?function(e){const t=vr(e.weekYear),n=kr(e.weekNumber,1,Or(e.weekYear)),r=kr(e.weekday,1,7);return t?n?!r&&$s("weekday",e.weekday):$s("week",e.week):$s("weekYear",e.weekYear)}(a):s?function(e){const t=vr(e.year),n=kr(e.ordinal,1,Dr(e.year));return t?!n&&$s("ordinal",e.ordinal):$s("year",e.year)}(a):ii(a))||oi(a);if(f)return Ti.invalid(f);const v=d?ri(a):s?si(a):a,[y,b]=gi(v,r,t),C=new Ti({ts:y,zone:t,o:b,loc:u});return a.weekday&&l&&e.weekday!==C.weekday?Ti.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${C.toISO()}`):C}static fromISO(e,t={}){const[n,r]=function(e){return za(e,[cs,ps],[us,gs],[ds,hs],[ms,fs])}(e);return fi(n,r,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[n,r]=function(e){return za(function(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[ns,rs])}(e);return fi(n,r,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[n,r]=function(e){return za(e,[as,os],[ss,os],[is,ls])}(e);return fi(n,r,t,"HTTP",t)}static fromFormat(e,t,n={}){if(hr(e)||hr(t))throw new Hn("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:a=null}=n,s=La.fromOpts({locale:r,numberingSystem:a,defaultToEN:!0}),[i,o,l]=function(e,t,n){const{result:r,zone:a,invalidReason:s}=Xs(e,t,n);return[r,a,s]}(s,e,t);return l?Ti.invalid(l):fi(i,o,n,`format ${t}`,e)}static fromString(e,t,n={}){return Ti.fromFormat(e,t,n)}static fromSQL(e,t={}){const[n,r]=function(e){return za(e,[vs,bs],[ys,Cs])}(e);return fi(n,r,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Hn("need to specify a reason the DateTime is invalid");const n=e instanceof sa?e:new sa(e,t);if(ka.throwOnInvalid)throw new jn(n);return new Ti({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ui(this).weekYear:NaN}get weekNumber(){return this.isValid?ui(this).weekNumber:NaN}get weekday(){return this.isValid?ui(this).weekday:NaN}get ordinal(){return this.isValid?ai(this.c).ordinal:NaN}get monthShort(){return this.isValid?Os.months("short",{locale:this.locale})[this.month-1]:null}get monthLong(){return this.isValid?Os.months("long",{locale:this.locale})[this.month-1]:null}get weekdayShort(){return this.isValid?Os.weekdays("short",{locale:this.locale})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Os.weekdays("long",{locale:this.locale})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.universal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1}).offset||this.offset>this.set({month:5}).offset)}get isInLeapYear(){return Ir(this.year)}get daysInMonth(){return xr(this.year,this.month)}get daysInYear(){return this.isValid?Dr(this.year):NaN}get weeksInWeekYear(){return this.isValid?Or(this.weekYear):NaN}resolvedLocaleOpts(e={}){const{locale:t,numberingSystem:n,calendar:r}=aa.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(ha.instance(e),t)}toLocal(){return this.setZone(ka.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:n=!1}={}){if((e=va(e,ka.defaultZone)).equals(this.zone))return this;if(e.isValid){let r=this.ts;if(t||n){const t=e.offset(this.ts),n=this.toObject();[r]=gi(n,t,e)}return di(this,{ts:r,zone:e})}return Ti.invalid(ci(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){return di(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=jr(e,Ni,[]);let n;!hr(t.weekYear)||!hr(t.weekNumber)||!hr(t.weekday)?n=ri(Object.assign(ni(this.c),t)):hr(t.ordinal)?(n=Object.assign(this.toObject(),t),hr(t.day)&&(n.day=Math.min(xr(n.year,n.month),n.day))):n=si(Object.assign(ai(this.c),t));const[r,a]=gi(n,this.o,this.zone);return di(this,{ts:r,o:a})}plus(e){if(!this.isValid)return this;return di(this,hi(this,Ds(e)))}minus(e){if(!this.isValid)return this;return di(this,hi(this,Ds(e).negate()))}startOf(e){if(!this.isValid)return this;const t={},n=Is.normalizeUnit(e);switch(n){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0}if("weeks"===n&&(t.weekday=1),"quarters"===n){const e=Math.ceil(this.month/3);t.month=3*(e-1)+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?aa.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):li}toLocaleString(e=Kn){return this.isValid?aa.create(this.loc.clone(e),e).formatDateTime(this):li}toLocaleParts(e={}){return this.isValid?aa.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO(e={}){return this.isValid?`${this.toISODate(e)}T${this.toISOTime(e)}`:null}toISODate({format:e="extended"}={}){let t="basic"===e?"yyyyMMdd":"yyyy-MM-dd";return this.year>9999&&(t="+"+t),vi(this,t)}toISOWeekDate(){return vi(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,format:r="extended"}={}){return yi(this,{suppressSeconds:t,suppressMilliseconds:e,includeOffset:n,format:r})}toRFC2822(){return vi(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return vi(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return vi(this,"yyyy-MM-dd")}toSQLTime({includeOffset:e=!0,includeZone:t=!1}={}){return yi(this,{includeOffset:e,includeZone:t,spaceZone:!0})}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():li}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t=Object.assign({},this.c);return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",n={}){if(!this.isValid||!e.isValid)return Is.invalid(this.invalid||e.invalid,"created by diffing an invalid DateTime");const r=Object.assign({locale:this.locale,numberingSystem:this.numberingSystem},n),a=(o=t,Array.isArray(o)?o:[o]).map(Is.normalizeUnit),s=e.valueOf()>this.valueOf(),i=Ms(s?this:e,s?e:this,a,r);var o;return s?i.negate():i}diffNow(e="milliseconds",t={}){return this.diff(Ti.local(),e,t)}until(e){return this.isValid?Ps.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;if("millisecond"===t)return this.valueOf()===e.valueOf();{const n=e.valueOf();return this.startOf(t)<=n&&n<=this.endOf(t)}}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Ti.fromObject({zone:this.zone}),n=e.padding?this<t?-e.padding:e.padding:0;return Gi(t,this.plus(n),Object.assign(e,{numeric:"always",units:["years","months","days","hours","minutes","seconds"]}))}toRelativeCalendar(e={}){return this.isValid?Gi(e.base||Ti.fromObject({zone:this.zone}),this,Object.assign(e,{numeric:"auto",units:["years","months","days"],calendary:!0})):null}static min(...e){if(!e.every(Ti.isDateTime))throw new Hn("min requires all arguments be DateTimes");return Er(e,(e=>e.valueOf()),Math.min)}static max(...e){if(!e.every(Ti.isDateTime))throw new Hn("max requires all arguments be DateTimes");return Er(e,(e=>e.valueOf()),Math.max)}static fromFormatExplain(e,t,n={}){const{locale:r=null,numberingSystem:a=null}=n;return Xs(La.fromOpts({locale:r,numberingSystem:a,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,n={}){return Ti.fromFormatExplain(e,t,n)}static get DATE_SHORT(){return Kn}static get DATE_MED(){return Xn}static get DATE_FULL(){return Yn}static get DATE_HUGE(){return Qn}static get TIME_SIMPLE(){return $n}static get TIME_WITH_SECONDS(){return _n}static get TIME_WITH_SHORT_OFFSET(){return er}static get TIME_WITH_LONG_OFFSET(){return tr}static get TIME_24_SIMPLE(){return nr}static get TIME_24_WITH_SECONDS(){return rr}static get TIME_24_WITH_SHORT_OFFSET(){return ar}static get TIME_24_WITH_LONG_OFFSET(){return sr}static get DATETIME_SHORT(){return ir}static get DATETIME_SHORT_WITH_SECONDS(){return or}static get DATETIME_MED(){return lr}static get DATETIME_MED_WITH_SECONDS(){return cr}static get DATETIME_MED_WITH_WEEKDAY(){return ur}static get DATETIME_FULL(){return dr}static get DATETIME_FULL_WITH_SECONDS(){return mr}static get DATETIME_HUGE(){return pr}static get DATETIME_HUGE_WITH_SECONDS(){return gr}}function Ii(e){if(Ti.isDateTime(e))return e;if(e&&e.valueOf&&fr(e.valueOf()))return Ti.fromJSDate(e);if(e&&"object"==typeof e)return Ti.fromObject(e);throw new Hn(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const Di=({dismissModal:e,serverGroup:t})=>{const{result:n,status:r,error:a}=B((()=>Ke.getScalingActivities(t)),[],[t.id]),s="PENDING"===r;return dt.createElement(dt.Fragment,null,dt.createElement(Ue,null,`Scaling activities for ${t.name}`),dt.createElement(qe,null,dt.createElement("div",{className:"flex-1 heading-3"},s&&dt.createElement("div",{className:"horizontal center sp-margin-xl-yaxis"},dt.createElement(H,null)),!s&&Boolean(a)&&dt.createElement("div",{className:"horizontal center sp-margin-xl-yaxis"},dt.createElement("h4",null,`There was an error loading scaling activities for ${t.name}. Please try again later.`)),!s&&!a&&!Boolean(n.length)&&dt.createElement("div",{className:"horizontal center sp-margin-xl-yaxis"},dt.createElement("h4",null,`No scaling activities found for ${t.name}.`)),!s&&!a&&Boolean(n.length)&&dt.createElement("div",{className:"middle sp-margin-xl-yaxis"},n.map(((e,t)=>{var n;return dt.createElement("div",{key:`${t}-${e.jobId}`,className:"sp-margin-xl-yaxis"},dt.createElement("p",{className:"clearfix"},dt.createElement("span",{className:`label label-${"KillInitiated"!==e.jobState?"success":"danger"} pull-left`},e.jobState),dt.createElement("span",{className:"label label-default pull-right"},(e=>{const t=new Date(e);return Ti.fromJSDate(t).toFormat("yyyy-MM-dd HH:mm:ss ZZZZ")})(e.date))),dt.createElement("p",null,`${e.reasonMessage} Desired capacity is ${(null==(n=e.capacity)?void 0:n.desired)||"unknown"}.`))}))))),dt.createElement(Je,{primaryActions:dt.createElement("button",{className:"btn btn-primary",onClick:e},"Close")}))};var xi=Object.defineProperty,Pi=Object.getOwnPropertyDescriptor;let Oi=class extends mt.Component{render(){const{serverGroup:e,app:t}=this.props,{capacity:n}=e,r=e.instances.length,a=n.min===n.max;return mt.createElement(mt.Fragment,null,mt.createElement("dl",{className:"dl-horizontal dl-narrow"},mt.createElement(Xe,{capacity:n,simpleMode:a}),mt.createElement(Ye,{currentCapacity:r}),e.capacityGroup&&mt.createElement(mt.Fragment,null,mt.createElement("dt",null,"Cap. Group"),mt.createElement("dd",null,e.capacityGroup))),mt.createElement("div",null,mt.createElement("a",{className:"clickable",onClick:()=>_e(e,t).then((n=>{n&&Me.show(Fn,{serverGroup:e,application:t})}))},"Resize Server Group")),mt.createElement("div",null,mt.createElement("a",{className:"clickable",onClick:()=>Qe(Di,{serverGroup:e},{maxWidth:"1000px"})},"View Scaling Activities")))}};Oi=((e,t,n,r)=>{for(var a,s=r>1?void 0:r?Pi(t,n):t,i=e.length-1;i>=0;i--)(a=e[i])&&(s=(r?a(t,n,s):a(s))||s);return r&&s&&xi(t,n,s),s})([$e("titus.serverGroup.CapacityDetailsSection")],Oi);const Li=({config:e,serverGroup:t,unit:n,updateUnit:r})=>{const[a,s]=dt.useState({alarmName:null,alarmArn:null,metricName:null,namespace:null,statistic:"Average",dimensions:[],period:60,threshold:e.targetValue,comparisonOperator:"GreaterThanThreshold",okactions:[],insufficientDataActions:[],alarmActions:[],evaluationPeriods:null,alarmDescription:null,unit:null});dt.useEffect((()=>{(()=>{const t=null==e?void 0:e.customizedMetricSpecification,n={...a,dimensions:null==t?void 0:t.dimensions,metricName:null==t?void 0:t.metricName,namespace:null==t?void 0:t.namespace,statistic:null==t?void 0:t.statistic,threshold:null==e?void 0:e.targetValue};s(n)})()}),[e]);return dt.createElement(p,{alarm:a,onChartLoaded:e=>{n&&r(e.unit)},serverGroup:t})},Mi={buildAlarm:(e,t)=>{const n=null==e?void 0:e.alarms[0];return{comparisonOperator:n.comparisonOperator,region:t,dimensions:n.dimensions,disableEditingDimensions:n.disableEditingDimensions,evaluationPeriods:n.evaluationPeriods,metricName:n.metricName,namespace:n.namespace,period:n.period,statistic:n.statistic,threshold:n.threshold,unit:n.unit}},buildStepPolicy:(e,t,n)=>({cooldown:n||600,estimatedInstanceWarmup:null,metricAggregationType:"Average",stepAdjustments:e.stepAdjustments.map((e=>{const n={scalingAdjustment:Math.abs(e.scalingAdjustment)};return void 0!==e.metricIntervalUpperBound&&(n.metricIntervalUpperBound=e.metricIntervalUpperBound+t),void 0!==e.metricIntervalLowerBound&&(n.metricIntervalLowerBound=e.metricIntervalLowerBound+t),n}))}),buildNewCommand:(e,t,n)=>{const r={adjustmentType:"Step"===e?n.adjustmentType:null,cloudProvider:t.cloudProvider,credentials:t.account,jobId:t.id,name:n.id,region:t.region,scalingPolicyID:n.id,serverGroupName:t.name};return"Step"===e&&(r.alarm=Mi.buildAlarm(n,t.region),r.minAdjustmentMagnitude=n.minAdjustmentMagnitude||1,r.step=Mi.buildStepPolicy(n,r.alarm.threshold,n.cooldown)),"TargetTracking"===e&&(r.targetTrackingConfiguration={...n.targetTrackingConfiguration}),r},prepareCommandForUpsert:(e,t)=>{const n=Nt(e);return"PercentChangeInCapacity"!==n.adjustmentType&&delete n.minAdjustmentMagnitude,n.step?n.step.stepAdjustments.forEach((e=>{t&&(e.scalingAdjustment=0-e.scalingAdjustment,delete n.step.estimatedInstanceWarmup),void 0!==e.metricIntervalLowerBound&&(e.metricIntervalLowerBound-=n.alarm.threshold),void 0!==e.metricIntervalUpperBound&&(e.metricIntervalUpperBound-=n.alarm.threshold)})):t&&(e.simple.scalingAdjustment=0-e.simple.scalingAdjustment),n}},Fi=({app:e,closeModal:t,dismissModal:n,policy:r,serverGroup:a})=>{var s;const[i,o]=dt.useState(Boolean(null==(s=r.targetTrackingConfiguration)?void 0:s.customizedMetricSpecification)),[l,c]=dt.useState({});dt.useEffect((()=>{const e=Mi.buildNewCommand("TargetTracking",a,r);c(e)}),[]);const u=r.id?"Update":"Create";return dt.createElement(et,{closeModal:t,dismissModal:n,title:`${u} scaling policy`,application:e,description:`${u} scaling policy for ${a.name}`,initialValues:l,mapValuesToTask:()=>({application:e,job:[{type:"upsertScalingPolicy",...l}]}),render:()=>dt.createElement("div",{className:"modal-body"},dt.createElement("h4",{className:"section-heading"},"Target Metric"),dt.createElement(g,{allowDualMode:!1,cloudwatch:!0,command:l,isCustomMetric:i,serverGroup:a,toggleMetricType:e=>o("custom"===e),updateCommand:c}),dt.createElement("h4",{className:"section-heading"},"Additional Settings"),dt.createElement(h,{command:l,cooldowns:!0,policyName:r.policyName,updateCommand:c}))})},zi=({app:e,closeModal:t,dismissModal:n,policy:r,serverGroup:a})=>{var s,i,o;const[l,c]=dt.useState({});dt.useEffect((()=>{const e=Mi.buildNewCommand("Step",a,r);c(e)}),[]);const u=(null==(s=r.stepAdjustments)?void 0:s.length)?r.stepAdjustments[0].scalingAdjustment:r.scalingAdjustment,[d,m]=dt.useState("ExactCapacity"===l.adjustmentType?"Set to":u>0?"Add":"Remove"),p="ExactCapacity"===l.adjustmentType||"ChangeInCapacity"===l.adjustmentType?"instances":"percent of group",g=r.id?"Edit":"Create",h=0===(null==(o=null==(i=null==l?void 0:l.alarm)?void 0:i.comparisonOperator)?void 0:o.indexOf("Greater"))?"max":"min",b=e=>{const t=Nt(l);t.step.stepAdjustments=e,(e=>{const t="min"===h?"metricIntervalLowerBound":"metricIntervalUpperBound",n="metricIntervalLowerBound"===t?"metricIntervalUpperBound":"metricIntervalLowerBound",r=e.stepAdjustments;(r||[]).forEach(((e,a)=>{r.length>a+1&&(r[a+1][n]=e[t])})),delete r[r.length-1][t]})(t.step),c(t)},C=(e,t)=>{m(e);const n="instances"!==t?"PercentChangeInCapacity":"Set to"===e?"ExactCapacity":"ChangeInCapacity";c({...l,adjustmentType:n})};return dt.createElement(et,{closeModal:t,dismissModal:n,title:`${g} scaling policy`,application:e,description:`${g} scaling policy for ${a.name}`,initialValues:l,mapValuesToTask:()=>{const t=Mi.prepareCommandForUpsert(l,"Remove"===d);return{application:e,job:[{type:t.type||"upsertScalingPolicy",...t}]}},render:()=>{var e,t,n;return dt.createElement("div",null,dt.createElement("h4",{className:"section-heading"},"Conditions"),dt.createElement("div",{className:"section-body"},dt.createElement("p",null,dt.createElement("b",null,"Note:"),' metrics must be sent to Amazon CloudWatch before they can be used in auto scaling. If you do not see a metric below, click "Configure available metrics" in the server group details to set up forwarding from Atlas to CloudWatch.'),dt.createElement(f,{alarm:l.alarm,multipleAlarms:Boolean((null==(e=null==r?void 0:r.alarms)?void 0:e.length)>1),serverGroup:a,stepAdjustments:l.step.stepAdjustments,stepsChanged:b,updateAlarm:e=>c({...l,alarm:e})})),dt.createElement("h4",{className:"section-heading"},"Actions"),dt.createElement("div",{className:"section-body"},!(null==(t=l.alarm)?void 0:t.metricName)&&dt.createElement("h4",{className:"text-center"},"Select a metric"),(null==(n=l.alarm)?void 0:n.metricName)&&dt.createElement(v,{adjustmentType:p,adjustmentTypeChanged:C,alarm:l.alarm,isMin:"min"===h,operator:d,step:l.step,stepsChanged:b})),dt.createElement(y,{command:l,isInstanceType:"instances"===p,isNew:Boolean(!r.policyARN),operator:d,updateCommand:c}))}})};t("titus.servergroup.details.capacitydetailssection",[]).component("titusCapacityDetailsSection",jt(tt(Oi,"titusCapacityDetailsSection"),["serverGroup","app"]));var ji=Object.defineProperty,Bi=Object.getOwnPropertyDescriptor;let Ri=class extends mt.Component{render(){if(!this.props.serverGroup||!this.props.serverGroup.image)return null;const{serverGroup:{image:e,entryPoint:t,iamProfile:n,resources:r}}=this.props;return mt.createElement(S,{className:"horizontal-when-filters-collapsed"},e.dockerImageName&&mt.createElement(k,{label:"Image Name",value:e.dockerImageName}),e.dockerImageVersion&&mt.createElement(k,{label:"Image Version",value:e.dockerImageVersion}),t&&mt.createElement(k,{label:"Entrypoint",value:t}),n&&mt.createElement(k,{label:"IAM Profile",value:n}),mt.createElement(k,{label:"CPU(s)",value:r.cpu}),mt.createElement(k,{label:"Memory",value:`${r.memory} MB`}),mt.createElement(k,{label:"Disk",value:`${r.disk} MB`}),mt.createElement(k,{label:"Network",value:`${r.networkMbps} Mbps`}),mt.createElement(k,{label:"GPU(s)",value:r.gpu}))}};Ri=((e,t,n,r)=>{for(var a,s=r>1?void 0:r?Bi(t,n):t,i=e.length-1;i>=0;i--)(a=e[i])&&(s=(r?a(t,n,s):a(s))||s);return r&&s&&ji(t,n,s),s})([$e("titus.serverGroup.launchConfigSection")],Ri);t("titus.servergroup.details.launchConfigSection",[]).component("titusLaunchConfigSection",jt(tt(Ri,"titusLaunchConfigSection"),["serverGroup"]));class Vi extends mt.Component{static show(e){return Me.show(Vi,e)}submit(e,t){const{application:n,serverGroup:r}=this.props,a={type:"upsertDisruptionBudget",cloudProvider:"titus",credentials:r.account,region:r.region,jobId:r.id,disruptionBudget:e.disruptionBudget};t.submit((()=>nt.executeTask({job:[a],application:n,description:`Update Disruption Budget for ${r.name}`})))}render(){const{application:e,command:t,dismissModal:n}=this.props,r=new Le({application:e,title:"Updating Job Disruption Budget",modalInstance:Le.modalInstanceEmulation((()=>n())),onTaskComplete:()=>e.serverGroups.refresh()});return mt.createElement(mt.Fragment,null,mt.createElement(Re,{monitor:r}),mt.createElement(Ge,{initialValues:t,onSubmit:e=>this.submit(e,r),render:t=>mt.createElement(mt.Fragment,null,mt.createElement(Ve,{dismiss:n}),mt.createElement(zt.Header,null,mt.createElement(zt.Title,null,"Update Disruption Budget")),mt.createElement(zt.Body,null,mt.createElement(Nn,{formik:t,app:e})),mt.createElement(zt.Footer,null,mt.createElement("button",{className:"btn btn-default",onClick:n,type:"button"},"Cancel"),mt.createElement(rt,{onClick:()=>this.submit(t.values,r),isDisabled:!t.isValid,isFormSubmit:!0,submitting:!1,label:"Update Budget"})))}))}}class Wi extends mt.Component{constructor(){super(...arguments),this.SectionHeading=({budget:e,options:t,label:n})=>{const r=t.find((t=>!!e[t.field]));return r?mt.createElement("div",null,mt.createElement("div",{className:"bold"},n),r.label," ",mt.createElement(ae,{content:r.description})):null},this.Policy=({budget:e})=>{const{ParentheticalDuration:t}=this;return e.availabilityPercentageLimit?mt.createElement("div",null,mt.createElement("div",{className:"bold"},"Percentage of Healthy Containers"),e.availabilityPercentageLimit.percentageOfHealthyContainers," percent"):e.relocationLimit?mt.createElement("div",null,mt.createElement("div",{className:"bold"},"Limit"),e.relocationLimit.limit," task",1!==e.relocationLimit.limit&&"s"):e.unhealthyTasksLimit?mt.createElement("div",null,mt.createElement("div",{className:"bold"},"Limit of Unhealthy Containers"),e.unhealthyTasksLimit.limitOfUnhealthyContainers," container",1!==e.unhealthyTasksLimit.limitOfUnhealthyContainers&&"s"):e.selfManaged?mt.createElement("div",null,mt.createElement("div",{className:"bold"},"Relocation Time"),e.selfManaged.relocationTimeMs>0&&mt.createElement(t,{durationMs:e.selfManaged.relocationTimeMs}),0===e.selfManaged.relocationTimeMs&&"0 ms (immediate)"):null},this.ParentheticalDuration=({durationMs:e})=>mt.createElement("span",null,e," ms",e>1e3&&` (${Bt(e)})`),this.Rate=({budget:e})=>{const{ParentheticalDuration:t}=this;return e.ratePerInterval?mt.createElement(mt.Fragment,null,mt.createElement("div",null,mt.createElement("div",{className:"bold"},"Interval"),mt.createElement(t,{durationMs:e.ratePerInterval.intervalMs})),mt.createElement("div",null,mt.createElement("div",{className:"bold"},"Limit"),e.ratePerInterval.limitPerInterval," task",1!==e.ratePerInterval.limitPerInterval&&"s")):e.ratePercentagePerInterval?mt.createElement(mt.Fragment,null,mt.createElement("div",null,mt.createElement("div",{className:"bold"},"Interval"),mt.createElement(t,{durationMs:e.ratePercentagePerInterval.intervalMs})),mt.createElement("div",null,mt.createElement("div",{className:"bold"},"Percentage per Interval"),e.ratePercentagePerInterval.percentageLimitPerInterval," percent")):null},this.groupedDays=e=>{const t=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=e.sort(((e,n)=>t.indexOf(e)-t.indexOf(n))),r=[],a=[];return t.slice(t.indexOf(n[0])).forEach((e=>{n.includes(e)?a.push(e):a.length&&(r.push(this.toDayRangeString(a)),a.length=0)})),a.length&&r.push(this.toDayRangeString(a)),r.join(", ")},this.TimeWindows=({budget:e})=>{const{groupedDays:t}=this,n=e.timeWindows&&e.timeWindows.length>0;return mt.createElement(mt.Fragment,null,mt.createElement("div",{className:"bold"},"When can disruption occur?"),mt.createElement("div",null,n&&e.timeWindows.map(((e,n)=>e.hourlyTimeWindows.map(((r,a)=>mt.createElement("div",{key:`${n}.${a}`},t(e.days),", ",r.startHour,":00 - ",r.endHour,":00 ",e.timeZone))))),!n&&"Any time"))},this.editBudget=()=>{const{app:e,serverGroup:t}=this.props;Zt.titusServerGroupCommandBuilder.buildServerGroupCommandFromExisting(e,t).then((n=>{Vi.show({command:n,application:e,serverGroup:t})}))}}toDayRangeString(e){return e.length?1===e.length?e[0].substr(0,3):`${e[0].substr(0,3)}-${e[e.length-1].substr(0,3)}`:null}render(){const{Policy:e,SectionHeading:t,Rate:n,TimeWindows:r}=this,a=this.props.serverGroup,s=!a.migrationPolicy||"SystemDefault"===a.migrationPolicy.type,i=yn(this.props.app),o=a.disruptionBudget||i,l=!s&&Gt(o,i);return mt.createElement(mt.Fragment,null,mt.createElement(kn,null),l&&mt.createElement("div",null,"(default policy)"),mt.createElement("div",{className:"bottom-border"},mt.createElement(t,{budget:o,options:Cn,label:"Policy"}),mt.createElement(e,{budget:o})),mt.createElement("div",{className:"bottom-border"},mt.createElement(t,{budget:o,options:En,label:"Rate"}),mt.createElement(n,{budget:o})),mt.createElement(r,{budget:o}),mt.createElement("div",{className:"sp-margin-l-top"},mt.createElement("a",{className:"clickable",onClick:this.editBudget},"Edit Disruption Budget")))}}t("spinnaker.titus.disruptionbudget.section",[]).component("titusDisruptionBudgetSection",jt(tt(Wi,"titusDisruptionBudgetSection"),["serverGroup","app"]));t("spinnaker.titus.serverGroup.details.rollback.controller",[at]).controller("titusRollbackServerGroupCtrl",["$scope","$uibModalInstance","serverGroupWriter","application","serverGroup","previousServerGroup","disabledServerGroups","allServerGroups",function(e,t,n,r,a,s,i,o){e.serverGroup=a,e.disabledServerGroups=i.sort(((e,t)=>t.name.localeCompare(e.name))),e.allServerGroups=o.sort(((e,t)=>t.name.localeCompare(e.name))),e.verification={};const l=a.capacity.desired;let c,u="EXPLICIT";if(0===o.length&&a.entityTags){const t=yt(a,"entityTags.creationMetadata.value.previousServerGroup");t&&(u="PREVIOUS_IMAGE",e.previousServerGroup={name:t.name,imageName:t.imageName},t.imageId&&t.imageId!==t.imageName&&(e.previousServerGroup.imageId=t.imageId))}c=l<10?100:l<20?90:95,e.command={rollbackType:u,rollbackContext:{imageId:s?s.imageId:void 0,rollbackServerGroupName:a.name,restoreServerGroupName:s?s.name:void 0,targetHealthyRollbackPercentage:c,delayBeforeDisableSeconds:0},targetGroups:a.targetGroups,securityGroups:a.securityGroups},e.minHealthy=function(e){return Math.ceil(l*e/100)},r&&r.attributes&&(r.attributes.platformHealthOnlyShowOverride&&r.attributes.platformHealthOnly&&(e.command.interestingHealthProviderNames=["Titus"]),e.command.platformHealthOnlyShowOverride=r.attributes.platformHealthOnlyShowOverride),this.isValid=function(){const t=e.command;return!!e.verification.verified&&("PREVIOUS_IMAGE"===u||void 0!==t.rollbackContext.restoreServerGroupName)},e.taskMonitor=new Le({application:r,title:"Rollback "+a.name,modalInstance:t}),this.rollback=function(){if(!this.isValid())return;e.taskMonitor.submit((function(){return n.rollbackServerGroup(a,r,e.command)}))},this.cancel=function(){t.dismiss()},this.label=function(e){if(!e)return"";if(!e.buildInfo||!e.buildInfo.images)return e.name;let t=e.buildInfo.images[0];return t.indexOf("/")>0&&(t=t.substring(t.indexOf("/")+1)),e.name+" ("+t+")"},this.group=function(e){return e.isDisabled?"Disabled Server Groups":"Enabled Server Groups"}}]);class Hi extends mt.Component{constructor(e){super(e),this.handleClick=()=>{this.setState({showSelection:!0})},this.typeSelected=e=>{this.setState({typeSelection:e,showSelection:!1,showModal:!0}),"step"===e&&this.createStepPolicy(),"targetTracking"===e&&this.createTargetTrackingPolicy()},this.showModalCallback=()=>{this.setState({showSelection:!1,showModal:!1,typeSelection:null})},this.state={showSelection:!1,showModal:!1,typeSelection:null,awsAccount:null},T.getAccountDetails(e.serverGroup.account).then((e=>{this.setState({awsAccount:e.awsAccount})}))}createStepPolicy(){const{serverGroup:e,application:t}=this.props,n={app:t,policy:Zt.titusServerGroupTransformer.constructNewStepScalingPolicyTemplate(e),serverGroup:e};Me.show(zi,n,{dialogClassName:"wizard-modal modal-lg"})}createTargetTrackingPolicy(){const{serverGroup:e,application:t}=this.props,n={app:t,policy:Zt.titusServerGroupTransformer.constructNewTargetTrackingPolicyTemplate(e),serverGroup:e};Me.show(Fi,n,{dialogClassName:"wizard-modal modal-lg"})}render(){const{min:e,max:t}=this.props.serverGroup.capacity;return mt.createElement("div",null,this.state.awsAccount?mt.createElement("a",{className:"clickable",onClick:this.handleClick},"Create new scaling policy"):null,this.state.showSelection&&mt.createElement(b,{warnOnMinMaxCapacity:e===t,typeSelectedCallback:this.typeSelected,showCallback:this.showModalCallback}))}}t("spinnaker.titus.serverGroup.details.scaling.policy.button",[]).component("titusCreateScalingPolicyButton",jt(tt(Hi,"titusCreateScalingPolicyButton"),["application","serverGroup"]));const Zi=O((()=>null),"titus.serverGroup.details.customScaling");t("spinnaker.application.titus.serverGroup.customScaling.component",[]).component("titusCustomScalingPolicy",jt(tt(Zi,"titusCustomScalingPolicy"),["application","serverGroup"]));t("spinnaker.titus.scalingPolicy.module",["spinnaker.titus.serverGroup.details.scaling.policy.button","spinnaker.application.titus.serverGroup.customScaling.component"]);const Ui=e=>{const{application:t,serverGroup:n}=e,{region:r,id:a,account:s,cloudProvider:i}=n,o=(l=n.serviceJobProcesses,Object.keys(l).reduce(((e,t)=>(l[t]&&e.push(t),e)),[]));var l;return mt.createElement(et,{...e,title:`Modify Service Job Processes for ${n.name}`,description:`Update Service Job Processes for ${n.name}`,initialValues:{serviceJobProcesses:o},render:()=>mt.createElement(mt.Fragment,null,mt.createElement(de,{label:"Service Job Processes",name:"serviceJobProcesses",input:e=>mt.createElement(be,{...e,options:Object.keys(n.serviceJobProcesses).map((e=>({value:e,label:ye(e)})))})}),mt.createElement(de,{label:"Reason",name:"reason",input:e=>mt.createElement(st,{...e,rows:3,placeholder:"(Optional) anything that might be helpful to explain the reason for this change; HTML is okay"})})),mapValuesToTask:({serviceJobProcesses:e,reason:o})=>({job:[{type:"updateJobProcesses",serviceJobProcesses:Object.keys(n.serviceJobProcesses).reduce(((t,n)=>(t[n]=!!e.includes(n),t)),{}),reason:o,region:r,jobId:a,credentials:s,cloudProvider:i}],application:t.name})})};class qi extends mt.Component{constructor(){super(...arguments),this.toggleServiceJobProcesses=()=>{const{app:e,serverGroup:t}=this.props;Me.show(Ui,{application:e,serverGroup:t})}}render(){const{serviceJobProcesses:e}=this.props.serverGroup;return mt.createElement(mt.Fragment,null,mt.createElement("ul",{className:"scaling-processes"},Object.keys(e).map((t=>mt.createElement("li",{key:t},mt.createElement("span",{style:{visibility:e[t]?"visible":"hidden"},className:"fa fa-check small"}),mt.createElement("span",{className:e[t]?"":"text-disabled"},ye(t)," "))))),mt.createElement("a",{className:"clickable",onClick:this.toggleServiceJobProcesses},"Edit Service Job Processes"))}}t("spinnaker.titus.servicejobprocesses.section",[]).component("titusServiceJobProcessesSection",jt(tt(qi,"titusServiceJobProcessesSection"),["serverGroup","app"]));t("spinnaker.titus.serverGroup.details.packageDetails.component",[]).component("titusPackageDetailsSection",jt(tt((({buildInfo:e})=>{var t,n;const r=e.jenkins||{},a=Boolean(Object.keys(r).length),{commitId:s,host:i,name:o,number:l,version:c}=r,u=`${i}job/${o}/${l}`;return dt.createElement(w,{heading:"Package"},!a&&dt.createElement("div",null,"No package information available."),a&&dt.createElement(S,{className:"horizontal-when-filters-collapsed"},o&&dt.createElement(k,{label:"Job",value:o}),(null==(t=e.docker)?void 0:t.image)&&dt.createElement(k,{label:"Image Name",value:null==(n=e.docker)?void 0:n.image}),l&&dt.createElement(k,{label:"Build",value:l}),s&&dt.createElement(k,{label:"Commit",value:s.substring(0,8)}),c&&dt.createElement(k,{label:"Version",value:c}),i&&dt.createElement(k,{label:"Build Link",value:dt.createElement("a",{target:"_blank",href:u},u)})))}),"titusPackageDetailsSection"),["buildInfo"]));t("spinnaker.titus.serverGroup.details.securityGroups.component",[]).component("titusSecurityGroups",jt(tt(Ut,"titusSecurityGroups"),["app","serverGroup"]));e.module("spinnaker.serverGroup.details.titus.controller",[It,"spinnaker.titus.serverGroupCommandBuilder.service","spinnaker.titus.disruptionbudget.section",at,"spinnaker.titus.serverGroup.details.rollback.controller","spinnaker.titus.servicejobprocesses.section","spinnaker.titus.scalingPolicy.module","spinnaker.titus.serverGroup.details.securityGroups.component","spinnaker.titus.serverGroup.details.packageDetails.component"]).controller("titusServerGroupDetailsCtrl",["$scope","$state","$templateCache","$interpolate","app","serverGroup","titusServerGroupCommandBuilder","$uibModal","serverGroupWriter","awsServerGroupTransformer",function(t,n,r,a,s,i,o,l,c,u){const d=s;function m(){const n=ft.find(d.serverGroups.data,(function(e){return e.name===i.name&&e.account===i.accountId&&e.region===i.region}));return Ke.getServerGroup(d.name,i.accountId,i.region,i.name).then((function(r){t.state.loading=!1,r.account=i.accountId,T.getAccountDetails(r.account).then((e=>{r.apiEndpoint=ft.filter(e.regions,{name:r.region})[0].endpoint})),t.buildInfo=r.buildInfo,e.extend(r,n),t.serverGroup=r;const a=t.serverGroup.labels;var s;delete a.name,delete a.source,delete a.spinnakerAccount,delete a[""],Object.keys(a).forEach((e=>{e.startsWith("titus.")&&delete a[e]})),t.labels=a,(s=r).scalingPolicies=(s.scalingPolicies||[]).map((e=>{const{policy:t}=e,{stepPolicyDescriptor:n,targetPolicyDescriptor:r}=t,a=n?"StepScaling":"TargetTrackingScaling";if(n){const t=n.alarmConfig;t.period=t.periodSec,t.namespace=t.metricNamespace,t.disableEditingDimensions=!0,"NFLX/EPIC"!==t.metricNamespace||t.dimensions||(t.dimensions=[{name:"AutoScalingGroupName",value:s.name}]),t.dimensions||(t.dimensions=[]);const r=ft.cloneDeep(n.scalingPolicy);return r.cooldown=r.cooldownSec,r.policyType=a,r.alarms=[t],r.id=e.id,r.stepAdjustments&&r.stepAdjustments.forEach((e=>{e.metricIntervalUpperBound=ft.get(e,"metricIntervalUpperBound",e.MetricIntervalUpperBound),e.metricIntervalLowerBound=ft.get(e,"metricIntervalLowerBound",e.MetricIntervalLowerBound)})),r}{const{customizedMetricSpecification:n}=r;return void 0===n.dimensions&&(n.dimensions=[]),t.id=e.id,t.targetTrackingConfiguration=t.targetPolicyDescriptor,t.targetTrackingConfiguration.scaleOutCooldown=t.targetTrackingConfiguration.scaleOutCooldownSec,t.targetTrackingConfiguration.scaleInCooldown=t.targetTrackingConfiguration.scaleInCooldownSec,t}})).map((e=>u.transformScalingPolicy(e))),ft.isEmpty(t.serverGroup)?p():g()}),p)}function p(){t.$$destroyed||n.go("^",{allowModalToStayOpen:!0},{location:"replace"})}this.application=s,t.gateUrl=V.gateUrl,t.state={loading:!0},m().then((()=>{t.$$destroyed||s.serverGroups.onRefresh(t,m)})).catch((()=>{})),T.getAccountDetails(i.accountId).then((e=>{const n=e.awsAccount;t.titusUiEndpoint=ft.filter(e.regions,{name:i.region})[0].endpoint,T.getAccountDetails(n).then((e=>{this.awsAccountId=e.accountId,this.env=e.environment}))}));const g=()=>{this.entityTagTargets=it.buildClusterTargets(t.serverGroup)};this.destroyServerGroup=function(){const e=t.serverGroup,r={application:d,title:"Destroying "+e.name,onTaskComplete:function(){n.includes("**.serverGroup",a)&&n.go("^")}},a={name:e.name,accountId:e.account,region:e.region},i={header:"Really destroy "+e.name+"?",buttonText:"Destroy "+e.name,account:e.account,taskMonitorConfig:r,platformHealthOnlyShowOverride:s.attributes.platformHealthOnlyShowOverride,platformHealthType:"Titus",submitMethod:function(){return c.destroyServerGroup(e,d,{cloudProvider:"titus",serverGroupName:e.name,region:e.region})}};ot.addDestroyWarningMessage(s,e,i),_e(e,s).then((e=>e&&x.confirm(i)))},this.disableServerGroup=function(){const e=t.serverGroup,n={application:d,title:"Disabling "+e.name},r={header:"Really disable "+e.name+"?",buttonText:"Disable "+e.name,account:e.account,taskMonitorConfig:n,platformHealthOnlyShowOverride:s.attributes.platformHealthOnlyShowOverride,platformHealthType:"Titus",submitMethod:function(){return c.disableServerGroup(e,d,{cloudProvider:"titus",serverGroupName:e.name,region:e.region,zone:e.zones[0]})}};ot.addDisableWarningMessage(s,e,r),_e(e,s).then((e=>e&&x.confirm(r)))},this.enableServerGroup=()=>{_e(i,s).then((e=>{if(!e)return;if(!this.isRollbackEnabled())return void this.showEnableServerGroupModal();const t={header:"Rolling back?",body:"Spinnaker provides an orchestrated rollback feature to carefully restore a different version of this\n server group. Do you want to use the orchestrated rollback?",buttonText:"Yes, take me to the rollback settings modal",cancelButtonText:"No, I just want to enable the server group"};x.confirm(t).then((()=>new Promise((e=>setTimeout(e,500))))).then((()=>this.rollbackServerGroup())).catch((({source:e})=>{"footer"===e&&this.showEnableServerGroupModal()}))}))},this.resizeServerGroup=()=>{_e(i,s).then((e=>{e&&Me.show(Fn,{serverGroup:t.serverGroup,application:d})}))},this.showEnableServerGroupModal=()=>{const e=t.serverGroup,n={application:d,title:"Enabling "+e.name},r={header:"Really enable "+e.name+"?",buttonText:"Enable "+e.name,account:e.account,taskMonitorConfig:n,platformHealthOnlyShowOverride:s.attributes.platformHealthOnlyShowOverride,platformHealthType:"Titus",submitMethod:function(){return c.enableServerGroup(e,d,{cloudProvider:"titus",serverGroupName:e.name,region:e.region,zone:e.zones[0]})}};x.confirm(r)},this.cloneServerGroup=function(){Zt.titusServerGroupCommandBuilder.buildServerGroupCommandFromExisting(d,t.serverGroup).then((e=>{const t=`Clone ${i.name}`;Tn.show({title:t,application:d,command:e})}))},this.isRollbackEnabled=function(){const e=t.serverGroup;return!e.isDisabled||d.getDataSource("serverGroups").data.some((t=>t.cluster===e.cluster&&t.region===e.region&&t.account===e.account&&!1===t.isDisabled))},this.rollbackServerGroup=function(){let e,n=t.serverGroup,r=s.getDataSource("serverGroups").data.filter((e=>e.cluster===n.cluster&&e.region===n.region&&e.account===n.account));n.isDisabled&&(e=n,n=ft.orderBy(r.filter((t=>t.name!==e.name&&!t.isDisabled)),["instanceCounts.total","createdTime"],["desc","desc"])[0]),r=r.filter((e=>e.name!==n.name)),1!==r.length||e||(e=r[0]),_e(n,s).then((t=>{t&&l.open({templateUrl:"titus/src/serverGroup/details/rollback/rollbackServerGroup.html",controller:"titusRollbackServerGroupCtrl as ctrl",resolve:{serverGroup:()=>n,previousServerGroup:()=>e,disabledServerGroups:()=>{const e=ft.find(d.clusters,{name:n.cluster,account:n.account});return ft.filter(e.serverGroups,{isDisabled:!0,region:n.region})},allServerGroups:()=>r,application:()=>d}})}))}}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/rollback/rollbackServerGroup.html",'<div modal-page class="confirmation-modal">\n <task-monitor monitor="taskMonitor"></task-monitor>\n <form role="form">\n <modal-close dismiss="$dismiss()"></modal-close>\n <div class="modal-header">\n <h4 class="modal-title">Rollback {{serverGroup.name}}</h4>\n </div>\n <div class="modal-body confirmation-modal">\n <div class="row">\n <div class="col-sm-3 sm-label-right">Restore to</div>\n <div class="col-sm-7">\n <ui-select\n ng-model="command.rollbackContext.restoreServerGroupName"\n class="form-control input-sm"\n ng-if="command.rollbackType === \'EXPLICIT\'"\n >\n <ui-select-match placeholder="Select...">{{ctrl.label($select.selected)}}</ui-select-match>\n <ui-select-choices group-by="ctrl.group" repeat="serverGroup.name as serverGroup in allServerGroups">\n <span ng-bind-html="ctrl.label(serverGroup)"></span>\n </ui-select-choices>\n </ui-select>\n <div ng-if="command.rollbackType === \'PREVIOUS_IMAGE\'" style="margin-top: 5px">\n {{ previousServerGroup.name }} <span class="small">(no longer deployed)</span><br />\n <span class="small">\n <strong>Image</strong>: {{ previousServerGroup.imageName}}\n <span ng-if="previousServerGroup.imageId">({{ previousServerGroup.imageId }})</span><br />\n </span>\n </div>\n </div>\n </div>\n\n <div class="row" ng-if="command.platformHealthOnlyShowOverride">\n <div class="col-sm-10 col-sm-offset-1">\n <platform-health-override\n command="command"\n platform-health-type="\'Titus\'"\n show-help-details="true"\n field-columns="12"\n >\n </platform-health-override>\n </div>\n </div>\n\n <task-reason command="command"></task-reason>\n\n <div class="row">\n <div class="col-sm-11 col-sm-offset-1">\n Wait\n <input\n placeholder="0"\n min="0"\n type="number"\n ng-model="command.rollbackContext.delayBeforeDisableSeconds"\n class="form-control input-sm inline-number"\n />\n seconds before disabling <em>{{ ctrl.label(serverGroup) }}</em>.\n </div>\n </div>\n\n <div class="row">\n <div class="col-sm-11 col-sm-offset-1">\n Consider rollback successful when\n <input\n type="number"\n min="0"\n max="100"\n ng-model="command.rollbackContext.targetHealthyRollbackPercentage"\n class="form-control input-sm inline-number"\n />\n percent of instances are healthy.\n </div>\n </div>\n\n <div class="row">\n <div class="col-sm-4 sm-label-right">Rollback Operations</div>\n </div>\n <div class="row" ng-if="command.rollbackType === \'EXPLICIT\'">\n <div class="col-sm-11 col-sm-offset-1">\n <ol>\n <li>Enable <em>{{ command.rollbackContext.restoreServerGroupName || \'previous server group\' }}</em></li>\n <li>\n Resize <em>{{ command.rollbackContext.restoreServerGroupName || \'previous server group\' }}</em> to [\n <strong>min</strong>: {{serverGroup.capacity.desired}}, <strong>max</strong>: {{ serverGroup.capacity.max\n }}, <strong>desired</strong>: {{ serverGroup.capacity.desired }} ]<br />(minimum capacity pinned at\n {{serverGroup.capacity.desired}} to prevent autoscaling down during rollback)\n </li>\n\n <li ng-if="command.rollbackContext.targetHealthyRollbackPercentage < 100">\n Wait for at least {{minHealthy(command.rollbackContext.targetHealthyRollbackPercentage)}} instances to\n report as healthy\n </li>\n <li>Disable {{ serverGroup.name }}</li>\n <li>\n Restore minimum capacity of\n <em>{{ command.rollbackContext.restoreServerGroupName || \'previous server group\' }}</em> [\n <strong>min</strong>: {{ serverGroup.capacity.min }} ]\n </li>\n </ol>\n <p>This rollback will affect server groups in {{ serverGroup.account }} ({{ serverGroup.region }}).</p>\n </div>\n </div>\n <div class="row" ng-if="command.rollbackType === \'PREVIOUS_IMAGE\'">\n <div class="col-sm-11 col-sm-offset-1">\n <ol>\n <li>\n Deploy <em>{{ previousServerGroup.imageId }}</em> [ <strong>min</strong>:\n {{serverGroup.capacity.desired}}, <strong>max</strong>: {{ serverGroup.capacity.max }},\n <strong>desired</strong>: {{ serverGroup.capacity.desired }} ]<br />(minimum capacity pinned at\n {{serverGroup.capacity.desired}} to prevent autoscaling down during deploy)\n </li>\n <li ng-if="command.rollbackContext.targetHealthyRollbackPercentage < 100">\n Wait for at least {{minHealthy(command.rollbackContext.targetHealthyRollbackPercentage)}} instances to\n report as healthy\n </li>\n <li>Disable <em>{{ serverGroup.name }}</em></li>\n <li>\n Restore minimum capacity of <em>new server group</em> [ <strong>min</strong>: {{ serverGroup.capacity.min\n }} ]\n </li>\n </ol>\n <p>This rollback will affect server groups in {{ serverGroup.account }} ({{ serverGroup.region }}).</p>\n </div>\n </div>\n </div>\n <aws-footer\n action="ctrl.rollback()"\n cancel="ctrl.cancel()"\n is-valid="ctrl.isValid()"\n account="serverGroup.account"\n verification="verification"\n ></aws-footer>\n </form>\n</div>\n')}]);t("spinnaker.titus.serverGroup.transformer",[]).factory("titusServerGroupTransformer",["$q",function(e){return{convertServerGroupCommandToDeployConfiguration:function(e){const t=ft.defaults({backingData:[],viewState:[]},e);return"clone"!==e.viewState.mode&&delete t.source,t.account=t.credentials,t.efs.mountPoint&&t.efs.efsId&&t.efs.mountPerm||delete t.efs,delete t.viewState,delete t.backingData,delete t.selectedProvider,t},normalizeServerGroup:function(e){return T.getCredentialsKeyedByAccount("titus").then((t=>(e.account&&t[e.account]&&(e.awsAccount=t[e.account].awsAccount),e)))},constructNewStepScalingPolicyTemplate:function(e){return{alarms:[{namespace:"NFLX/EPIC",metricName:"",threshold:50,statistic:"Average",comparisonOperator:"GreaterThanThreshold",evaluationPeriods:1,disableEditingDimensions:!0,dimensions:[{name:"AutoScalingGroupName",value:e.name}],period:60}],adjustmentType:"ChangeInCapacity",stepAdjustments:[{scalingAdjustment:1,metricIntervalLowerBound:0}],cooldown:300}},constructNewTargetTrackingPolicyTemplate:function(e){return{alarms:[],targetTrackingConfiguration:{targetValue:null,disableScaleIn:!1,customizedMetricSpecification:{namespace:"NFLX/EPIC",metricName:"",dimensions:[{name:"AutoScalingGroupName",value:e.name}]},scaleInCooldown:300,scaleOutCooldown:300}}}}}]);lt.registerValidator("titus",new class{validateSpecialCharacters(e,t){/^[a-zA-Z_0-9.]*$/g.test(e)||t.push("Only dot(.) and underscore(_) special characters are allowed.")}validateLength(e,t,n){if(e.length>250)n.push("The maximum length for an application in Titus is 250 characters.");else if(e.length>240)if(e.length>=248)t.push(`You will not be able to include a stack or detail field for clusters or ${D.get("firewalls")}.`);else{const n=248-e.length;t.push(`If you plan to include a stack or detail field for clusters, you will only\n have ~${n} characters to do so.`)}}validate(e=""){const t=[],n=[];return e&&e.length&&(this.validateSpecialCharacters(e,n),this.validateLength(e,t,n)),{warnings:t,errors:n}}});cn('.cloud-provider-logo .icon-titus {\n -webkit-mask-image: url("data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22 standalone%3D%22no%22%3F%3E%3Csvg width%3D%2247px%22 height%3D%2240px%22 viewBox%3D%220 0 47 40%22 version%3D%221.1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E %3Cg transform%3D%22translate(1.000000%2C 1.000000)%22%3E %3Cpath d%3D%22M30.8746%2C26.4746 C27.6746%2C26.4746 25.0746%2C23.8746 25.0746%2C20.6746 C25.0746%2C17.4746 27.6746%2C14.8746 30.8746%2C14.8746 C34.0746%2C14.8746 36.6746%2C17.4746 36.6746%2C20.6746 C36.5746%2C23.8746 34.0746%2C26.4746 30.8746%2C26.4746 M14.2746%2C26.4746 C11.0746%2C26.4746 8.4746%2C23.8746 8.4746%2C20.6746 C8.4746%2C17.4746 11.0746%2C14.8746 14.2746%2C14.8746 C17.4746%2C14.8746 20.0746%2C17.4746 20.0746%2C20.6746 C20.0746%2C23.8746 17.4746%2C26.4746 14.2746%2C26.4746 M38.6746%2C18.0746 L38.6746%2C2.1746 L37.5746%2C2.1746 L37.5746%2C7.5746 L34.8746%2C7.5746 C32.4746%2C3.1746 27.8746%2C0.1746 22.5746%2C0.1746 C17.2746%2C0.1746 12.6746%2C3.1746 10.2746%2C7.5746 L7.0746%2C7.5746 L7.0746%2C2.1746 L5.9746%2C2.1746 L5.9746%2C17.9746 C2.7746%2C17.9746 0.1746%2C20.5746 0.1746%2C23.7746 C0.1746%2C26.9746 2.7746%2C29.5746 5.9746%2C29.5746 C6.1746%2C29.5746 6.3746%2C29.4746 6.4746%2C29.4746 L6.4746%2C37.6746 L38.4746%2C37.6746 L38.4746%2C29.5746 C41.6746%2C29.5746 44.2746%2C26.9746 44.2746%2C23.7746 C44.3746%2C20.5746 41.7746%2C18.0746 38.6746%2C18.0746%22 id%3D%22Fill-1%22 fill%3D%22%23000000%22%3E%3C%2Fpath%3E %3Cpath d%3D%22M30.8746%2C26.4746 C27.6746%2C26.4746 25.0746%2C23.8746 25.0746%2C20.6746 C25.0746%2C17.4746 27.6746%2C14.8746 30.8746%2C14.8746 C34.0746%2C14.8746 36.6746%2C17.4746 36.6746%2C20.6746 C36.5746%2C23.8746 34.0746%2C26.4746 30.8746%2C26.4746 L30.8746%2C26.4746 Z M14.2746%2C26.4746 C11.0746%2C26.4746 8.4746%2C23.8746 8.4746%2C20.6746 C8.4746%2C17.4746 11.0746%2C14.8746 14.2746%2C14.8746 C17.4746%2C14.8746 20.0746%2C17.4746 20.0746%2C20.6746 C20.0746%2C23.8746 17.4746%2C26.4746 14.2746%2C26.4746 L14.2746%2C26.4746 Z M38.6746%2C18.0746 L38.6746%2C2.1746 L37.5746%2C2.1746 L37.5746%2C7.5746 L34.8746%2C7.5746 C32.4746%2C3.1746 27.8746%2C0.1746 22.5746%2C0.1746 C17.2746%2C0.1746 12.6746%2C3.1746 10.2746%2C7.5746 L7.0746%2C7.5746 L7.0746%2C2.1746 L5.9746%2C2.1746 L5.9746%2C17.9746 C2.7746%2C17.9746 0.1746%2C20.5746 0.1746%2C23.7746 C0.1746%2C26.9746 2.7746%2C29.5746 5.9746%2C29.5746 C6.1746%2C29.5746 6.3746%2C29.4746 6.4746%2C29.4746 L6.4746%2C37.6746 L38.4746%2C37.6746 L38.4746%2C29.5746 C41.6746%2C29.5746 44.2746%2C26.9746 44.2746%2C23.7746 C44.3746%2C20.5746 41.7746%2C18.0746 38.6746%2C18.0746 L38.6746%2C18.0746 Z%22 id%3D%22Stroke-3%22 stroke%3D%22%23000000%22 stroke-width%3D%222.349%22%3E%3C%2Fpath%3E %3C%2Fg%3E%3C%2Fsvg%3E");\n mask-image: url("data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22 standalone%3D%22no%22%3F%3E%3Csvg width%3D%2247px%22 height%3D%2240px%22 viewBox%3D%220 0 47 40%22 version%3D%221.1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E %3Cg transform%3D%22translate(1.000000%2C 1.000000)%22%3E %3Cpath d%3D%22M30.8746%2C26.4746 C27.6746%2C26.4746 25.0746%2C23.8746 25.0746%2C20.6746 C25.0746%2C17.4746 27.6746%2C14.8746 30.8746%2C14.8746 C34.0746%2C14.8746 36.6746%2C17.4746 36.6746%2C20.6746 C36.5746%2C23.8746 34.0746%2C26.4746 30.8746%2C26.4746 M14.2746%2C26.4746 C11.0746%2C26.4746 8.4746%2C23.8746 8.4746%2C20.6746 C8.4746%2C17.4746 11.0746%2C14.8746 14.2746%2C14.8746 C17.4746%2C14.8746 20.0746%2C17.4746 20.0746%2C20.6746 C20.0746%2C23.8746 17.4746%2C26.4746 14.2746%2C26.4746 M38.6746%2C18.0746 L38.6746%2C2.1746 L37.5746%2C2.1746 L37.5746%2C7.5746 L34.8746%2C7.5746 C32.4746%2C3.1746 27.8746%2C0.1746 22.5746%2C0.1746 C17.2746%2C0.1746 12.6746%2C3.1746 10.2746%2C7.5746 L7.0746%2C7.5746 L7.0746%2C2.1746 L5.9746%2C2.1746 L5.9746%2C17.9746 C2.7746%2C17.9746 0.1746%2C20.5746 0.1746%2C23.7746 C0.1746%2C26.9746 2.7746%2C29.5746 5.9746%2C29.5746 C6.1746%2C29.5746 6.3746%2C29.4746 6.4746%2C29.4746 L6.4746%2C37.6746 L38.4746%2C37.6746 L38.4746%2C29.5746 C41.6746%2C29.5746 44.2746%2C26.9746 44.2746%2C23.7746 C44.3746%2C20.5746 41.7746%2C18.0746 38.6746%2C18.0746%22 id%3D%22Fill-1%22 fill%3D%22%23000000%22%3E%3C%2Fpath%3E %3Cpath d%3D%22M30.8746%2C26.4746 C27.6746%2C26.4746 25.0746%2C23.8746 25.0746%2C20.6746 C25.0746%2C17.4746 27.6746%2C14.8746 30.8746%2C14.8746 C34.0746%2C14.8746 36.6746%2C17.4746 36.6746%2C20.6746 C36.5746%2C23.8746 34.0746%2C26.4746 30.8746%2C26.4746 L30.8746%2C26.4746 Z M14.2746%2C26.4746 C11.0746%2C26.4746 8.4746%2C23.8746 8.4746%2C20.6746 C8.4746%2C17.4746 11.0746%2C14.8746 14.2746%2C14.8746 C17.4746%2C14.8746 20.0746%2C17.4746 20.0746%2C20.6746 C20.0746%2C23.8746 17.4746%2C26.4746 14.2746%2C26.4746 L14.2746%2C26.4746 Z M38.6746%2C18.0746 L38.6746%2C2.1746 L37.5746%2C2.1746 L37.5746%2C7.5746 L34.8746%2C7.5746 C32.4746%2C3.1746 27.8746%2C0.1746 22.5746%2C0.1746 C17.2746%2C0.1746 12.6746%2C3.1746 10.2746%2C7.5746 L7.0746%2C7.5746 L7.0746%2C2.1746 L5.9746%2C2.1746 L5.9746%2C17.9746 C2.7746%2C17.9746 0.1746%2C20.5746 0.1746%2C23.7746 C0.1746%2C26.9746 2.7746%2C29.5746 5.9746%2C29.5746 C6.1746%2C29.5746 6.3746%2C29.4746 6.4746%2C29.4746 L6.4746%2C37.6746 L38.4746%2C37.6746 L38.4746%2C29.5746 C41.6746%2C29.5746 44.2746%2C26.9746 44.2746%2C23.7746 C44.3746%2C20.5746 41.7746%2C18.0746 38.6746%2C18.0746 L38.6746%2C18.0746 Z%22 id%3D%22Stroke-3%22 stroke%3D%22%23000000%22 stroke-width%3D%222.349%22%3E%3C%2Fpath%3E %3C%2Fg%3E%3C%2Fsvg%3E");\n}\n');const Ji="spinnaker.titus";t("spinnaker.titus",["spinnaker.titus.react","spinnaker.titus.securityGroup.reader","spinnaker.serverGroup.details.titus.controller","spinnaker.titus.serverGroupCommandBuilder.service","spinnaker.serverGroup.configure.titus","spinnaker.titus.serverGroup.transformer","spinnaker.titus.pipeline.stage.findAmiStage","spinnaker.titus.pipeline.stage.enableAsgStage","spinnaker.titus.pipeline.stage.disableAsgStage","spinnaker.titus.pipeline.stage.destroyAsgStage","spinnaker.titus.pipeline.stage.resizeAsgStage","spinnaker.titus.pipeline.stage.cloneServerGroupStage","spinnaker.titus.pipeline.stage.disableClusterStage","spinnaker.titus.pipeline.stage.shrinkClusterStage","spinnaker.titus.pipeline.stage.scaleDownClusterStage","titus.servergroup.details.capacitydetailssection","titus.servergroup.details.launchConfigSection"]).config((()=>{ct.registerProvider("titus",{name:"Titus",logo:{path:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABGCAY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OLdc3kWeSW1yWmTzqavwcnNraHaqeoQQBhbOO7qCPYJbJkiDAhiMITiF/cH+E48kpikY4UVCPjaIBA3dU57jxhkWkRs6UX9SbRt9ywMKu0okW8Q+dZ2dO1gnqNOcXKJWpr7t3v+38Gs9AgpWxz9DDp+NQ//ryOkTXttBm0VcMXNPfDqGRR8lMQmcHdnE8A9rs9hEOQ6kGzN5pm5JNTLJa2gILm1k9lckrxPXU7uhxhcAJf22sTltZf4I2LQnsWJTuDGr3HPH+lLN9Gkpag2O64P4oS8gze1udD146D2wP8H5JyTFz+hnOcAAAAASUVORK5CYII="},serverGroup:{transformer:"titusServerGroupTransformer",detailsTemplateUrl:"titus/src/serverGroup/details/serverGroupDetails.html",detailsController:"titusServerGroupDetailsCtrl",CloneServerGroupModal:Tn,commandBuilder:"titusServerGroupCommandBuilder",configurationService:"titusServerGroupConfigurationService",skipUpstreamStageCheck:!0,checkForImageProviders:!0,TargetTrackingChart:Li,UpsertStepPolicyModal:zi,UpsertTargetTrackingModal:Fi},securityGroup:{reader:"titusSecurityGroupReader",useProvider:"aws"},loadBalancer:{LoadBalancersTag:C,incompatibleLoadBalancerTypes:[{type:"classic",reason:"Classic Load Balancers cannot be used with Titus as they do not have IP based target groups."}],useProvider:"aws"},instance:{details:en}})})),ut.registerProvider("titus",["custom","redblack","monitored"]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/serverGroupDetails.html",'<div class="details-panel" ng-class="{ disabled: serverGroup.isDisabled }">\n <div class="header" ng-if="state.loading">\n <div class="close-button">\n <a class="btn btn-link" ui-sref="^">\n <span class="glyphicon glyphicon-remove"></span>\n </a>\n </div>\n <h4 class="text-center">\n <span us-spinner="{radius:20, width:6, length: 12}"></span>\n </h4>\n </div>\n\n <div class="header" ng-if="!state.loading">\n <div class="close-button">\n <a class="btn btn-link" ui-sref="^">\n <span class="glyphicon glyphicon-remove"></span>\n </a>\n </div>\n <div class="header-text horizontal middle">\n <cloud-provider-logo provider="serverGroup.type" height="\'36px\'" width="\'36px\'"></cloud-provider-logo>\n <h3 class="horizontal middle space-between flex-1" select-on-dbl-click>\n {{serverGroup.name}}\n <render-if-feature feature="entityTags">\n <entity-notifications\n entity="serverGroup"\n application="ctrl.application"\n placement="bottom"\n h-offset-percent="90%"\n entity-type="serverGroup"\n page-location="details"\n on-update="ctrl.application.serverGroups.refresh()"\n ></entity-notifications>\n </render-if-feature>\n </h3>\n </div>\n <div>\n <div class="actions" ng-class="{ insights: serverGroup.insightActions.length > 0 }">\n <div class="dropdown" uib-dropdown dropdown-append-to-body>\n <button type="button" class="btn btn-sm btn-primary dropdown-toggle" uib-dropdown-toggle>\n Server Group Actions <span class="caret"></span>\n </button>\n <ul class="dropdown-menu" uib-dropdown-menu role="menu">\n <li><a href ng-if="ctrl.isRollbackEnabled()" ng-click="ctrl.rollbackServerGroup()">Rollback</a></li>\n <li role="presentation" class="divider" ng-if="ctrl.isRollbackEnabled()"></li>\n <li><a href ng-click="ctrl.resizeServerGroup()">Resize</a></li>\n <li><a href ng-if="!serverGroup.isDisabled" ng-click="ctrl.disableServerGroup()">Disable</a></li>\n <li><a href ng-if="serverGroup.isDisabled" ng-click="ctrl.enableServerGroup()">Enable</a></li>\n <li><a href ng-click="ctrl.destroyServerGroup()">Destroy</a></li>\n <li><a href ng-click="ctrl.cloneServerGroup()">Clone</a></li>\n <add-entity-tag-links\n component="serverGroup"\n application="ctrl.application"\n entity-type="serverGroup"\n owner-options="ctrl.entityTagTargets"\n on-update="ctrl.application.serverGroups.refresh"\n ></add-entity-tag-links>\n </ul>\n </div>\n <div class="dropdown" ng-if="serverGroup.insightActions.length > 0" uib-dropdown dropdown-append-to-body>\n <button type="button" class="btn btn-sm btn-default dropdown-toggle" uib-dropdown-toggle>\n Insight <span class="caret"></span>\n </button>\n <ul class="dropdown-menu" uib-dropdown-menu role="menu">\n <li\n ng-repeat="action in serverGroup.insightActions"\n analytics-on="click"\n analytics-category="Insight Menu (Server Group)"\n analytics-event="{{action.label}} clicked"\n analytics-label="{{serverGroup.account}}/{{serverGroup.region}}/{{serverGroup.name}}"\n >\n <a target="_blank" href="{{action.url}}">{{action.label}}</a>\n </li>\n </ul>\n </div>\n <div class="clearfix"></div>\n </div>\n </div>\n </div>\n <div class="content" ng-if="!state.loading">\n <div class="band band-info" ng-if="serverGroup.isDisabled">Job is Disabled</div>\n <managed-resource-details-indicator\n ng-if="!state.loading && serverGroup.isManaged"\n resource-summary="serverGroup.managedResourceSummary"\n application="ctrl.application"\n ></managed-resource-details-indicator>\n <server-group-running-tasks-details\n server-group="serverGroup"\n application="ctrl.application"\n ></server-group-running-tasks-details>\n <collapsible-section heading="Server Group Information" expanded="true">\n <dl class="dl-horizontal dl-narrow">\n <dt>Created</dt>\n <dd>{{serverGroup.createdTime | timestamp}}</dd>\n <dt>In</dt>\n <dd>\n <account-tag account="serverGroup.account" pad="right"></account-tag>\n {{serverGroup.region}}\n </dd>\n <dt>Job Id</dt>\n <dd><a href="{{titusUiEndpoint}}jobs/{{serverGroup.id}}" target="_blank">{{serverGroup.id}}</a></dd>\n <entity-source metadata="serverGroup.entityTags.creationMetadata"></entity-source>\n </dl>\n </collapsible-section>\n <collapsible-section heading="Capacity" expanded="true">\n <titus-capacity-details-section\n app="ctrl.application"\n server-group="serverGroup"\n ></titus-capacity-details-section>\n </collapsible-section>\n <collapsible-section heading="Health" expanded="true" ng-if="serverGroup.instanceCounts.total > 0">\n <dl class="dl-horizontal dl-narrow" ng-if="serverGroup">\n <dt>Tasks</dt>\n <dd>\n <health-counts container="serverGroup.instanceCounts" class="pull-left"></health-counts>\n </dd>\n </dl>\n </collapsible-section>\n <collapsible-section heading="Launch Configuration">\n <titus-launch-config-section server-group="serverGroup"></titus-launch-config-section>\n </collapsible-section>\n\n <titus-security-groups\n app="ctrl.application"\n server-group="serverGroup"\n class="collapsible-section"\n style="display: block"\n ></titus-security-groups>\n\n <collapsible-section heading="Service Job Processes">\n <titus-service-job-processes-section\n app="ctrl.application"\n server-group="serverGroup"\n ></titus-service-job-processes-section>\n </collapsible-section>\n\n <collapsible-section heading="Scaling Policies">\n <scaling-policy-summary\n ng-repeat="policy in serverGroup.scalingPolicies"\n policy="policy"\n server-group="serverGroup"\n application="ctrl.application"\n ></scaling-policy-summary>\n <titus-create-scaling-policy-button\n server-group="serverGroup"\n application="ctrl.application"\n ></titus-create-scaling-policy-button>\n <div ng-if="ctrl.awsAccountId">\n <config-bin-link\n application="ctrl.application"\n aws-account-id="ctrl.awsAccountId"\n cluster-name="serverGroup.cluster"\n region="serverGroup.region"\n env="ctrl.env"\n cloud-provider="\'titus\'"\n ></config-bin-link>\n </div>\n <titus-custom-scaling-policy\n application="ctrl.application"\n server-group="serverGroup"\n ></titus-custom-scaling-policy>\n </collapsible-section>\n <titus-package-details-section build-info="buildInfo"></titus-package-details-section>\n <collapsible-section heading="Job Disruption Budget">\n <titus-disruption-budget-section\n app="ctrl.application"\n server-group="serverGroup"\n ></titus-disruption-budget-section>\n </collapsible-section>\n <collapsible-section heading="Job Attributes">\n <div ng-if="!serverGroup.labels">No job attributes associated with this server group</div>\n <dl ng-if="labels">\n <dt ng-repeat-start="(key, val) in labels">{{key}}</dt>\n <dd ng-repeat-end>{{val}}</dd>\n </dl>\n </collapsible-section>\n <collapsible-section heading="Container Attributes">\n <div ng-if="!serverGroup.containerAttributes">No container attributes associated with this server group</div>\n <dl ng-if="serverGroup.containerAttributes">\n <dt ng-repeat-start="(key, val) in serverGroup.containerAttributes">{{key}}</dt>\n <dd ng-repeat-end>{{val}}</dd>\n </dl>\n </collapsible-section>\n <collapsible-section heading="Environment Variables">\n <div ng-if="!serverGroup.env">No environment variables associated with this server group</div>\n <dl ng-if="serverGroup.env">\n <dt ng-repeat-start="(key, val) in serverGroup.env">{{key}}</dt>\n <dd ng-repeat-end>{{val}}</dd>\n </dl>\n </collapsible-section>\n </div>\n</div>\n')}]);export{Ji as TITUS_MODULE,Oi as TitusCapacityDetailsSection,en as TitusInstanceDetails,Vt as TitusInstanceDns,Wt as TitusInstanceInformation,rn as TitusProviderSettings,Ht as TitusReactInject,Zt as TitusReactInjector,Fn as TitusResizeServerGroupModal,Di as TitusScalingActivitiesModal,Ut as TitusSecurityGroupsDetailsSection,Li as TitusTargetTrackingChart,zi as TitusUpsertScalingPolicyModal,Fi as TitusUpsertTargetTrackingModal,qt as applyTargetGroupInfoToHealthMetric,$t as buildTaskActions,Jt as extractHealthMetrics};
|
|
1
|
+
import*as e from"angular";import{module as t}from"angular";import{InstanceInformation as n,getAllTargetGroups as r,InstanceStatus as a,VpcReader as s,ServerGroupSecurityGroupsRemoved as i,SecurityGroupSelector as o,AWSProviderSettings as l,SubnetSelectField as c,ServerGroupCapacity as u,ServerGroupLoadBalancers as d,ServerGroupSecurityGroups as m,MetricAlarmChart as p,TargetMetricFields as g,TargetTrackingAdditionalSettings as h,AlarmConfigurer as f,StepPolicyAction as v,ScalingPolicyAdditionalSettings as y,PolicyTypeSelectionModal as b,AmazonLoadBalancersTag as C}from"@spinnaker/amazon";import{HelpContentsRegistry as E,CollapsibleSection as w,LabeledValueList as S,LabeledValue as k,CopyToClipboard as N,LinkWithClipboard as A,ReactInject as G,AccountService as T,ReactInjector as I,FirewallLabels as D,ConfirmationModalService as x,InstanceWriter as P,overridableComponent as O,InstanceDetailsHeader as L,InstanceActions as M,InstanceInsights as F,ConsoleOutputLink as z,InstanceLinks as j,useData as B,InstanceReader as R,SETTINGS as V,InstanceDetailsPane as W,Spinner as H,RecentHistoryService as Z,ClusterState as U,UrlBuilder as q,Registry as J,StageConstants as K,NameUtils as X,ExecutionDetailsSection as Y,AccountTag as Q,Markdown as $,RenderOutputFile as _,StageFailureMessage as ee,DeployingIntoManagedClusterWarning as te,AccountSelectInput as ne,RegionSelectField as re,HelpField as ae,ServerGroupDetailsField as se,DeploymentStrategySelector as ie,ServerGroupNamePreview as oe,SpelNumberInput as le,ValidationMessage as ce,FormValidator as ue,FormikFormField as de,TextInput as me,SelectInput as pe,LayoutProvider as ge,MapEditorInput as he,PlatformHealthOverrideInput as fe,useFormInputValueMapper as ve,robotToHuman as ye,ChecklistInput as be,CheckboxInput as Ce,CACHE_INITIALIZER_SERVICE as Ee,LOAD_BALANCER_READ_SERVICE as we,SECURITY_GROUP_READER as Se,setMatchingResourceSummary as ke,SubnetReader as Ne,NumberInput as Ae,SpinFormik as Ge,ReactSelectInput as Te,ResponsiveFieldLayout as Ie,TetheredSelect as De,StageConfigField as xe,MapEditor as Pe,ExecutionDetailsTasks as Oe,TaskMonitor as Le,ReactModal as Me,DeployInitializer as Fe,WizardModal as ze,WizardPage as je,noop as Be,TaskMonitorWrapper as Re,ModalClose as Ve,PlatformHealthOverride as We,UserVerification as He,MinMaxDesiredChanges as Ze,ModalHeader as Ue,ModalBody as qe,ModalFooter as Je,ServerGroupReader as Ke,DesiredCapacity as Xe,CurrentCapacity as Ye,showModal as Qe,Overridable as $e,confirmNotManaged as _e,TaskMonitorModal as et,withErrorBoundary as tt,TaskExecutor as nt,SubmitButton as rt,SERVER_GROUP_WRITER as at,TextAreaInput as st,ClusterTargetBuilder as it,ServerGroupWarningMessageService as ot,ApplicationNameValidator as lt,CloudProviderRegistry as ct,DeploymentStrategyRegistry as ut}from"@spinnaker/core";import*as dt from"react";import mt,{useMemo as pt}from"react";import{UISref as gt}from"@uirouter/react";import{UIRouterContextComponent as ht}from"@uirouter/react-hybrid";import ft,{sortBy as vt,get as yt,chain as bt,xor as Ct,isUndefined as Et,intersection as wt,set as St,union as kt,cloneDeep as Nt,flatten as At,isEqual as Gt,defaultsDeep as Tt}from"lodash";import It from"@uirouter/angularjs";import{DockerImageUtils as Dt,DockerImageAndTagSelector as xt}from"@spinnaker/docker";import{$q as Pt}from"ngimport";import{Field as Ot,Form as Lt}from"formik";import Mt from"react-select";import{Subject as Ft}from"rxjs";import{Modal as zt}from"react-bootstrap";import{react2angular as jt}from"react2angular";import Bt from"pretty-ms";const Rt={"titus.deploy.runtimeLimitSecs":"<p>Maximum amount of time (in seconds) a batch job is allowed to run</p>","titus.deploy.retries":"<p>Number of times to retry this job</p>","titus.deploy.propertyFile":"<p>(Optional) Configures the name to the file used to pass in properties to later stages in the Spinnaker pipeline. The file must be saved into the /logs directory during execution</p>","titus.deploy.iamProfile":"AWS IAM instance profile to assign to this service","titus.deploy.capacityGroup":"Used by Titus to ensure capacity guarantees, defaults to the application name if not provided","titus.deploy.command":"<p>(Optional) Defines one or more custom commands. If multiple commands are defined, they must be comma delimited with no spaces: <b>cmd1,cmd2</b></p>","titus.deploy.entrypoint":"<p>(Optional) Defines one or more entrypoints. If multiple entrypoints are defined, they must be comma delimited with no spaces: <b>entry1,entry2</b></p>","titus.deploy.migrationPolicy":"Defines how the tasks for this job will be migrated during an infrastructure change","titus.deploy.network":"Amount of networking bandwidth to allocate in Mbps","titus.deploy.gpu":"Number of GPUs to use. WARNING: only use if directed by Titus team, otherwise leave at 0","titus.deploy.softConstraints":"Soft constraints are enforced on a best efforts basis. For example, if tasks can’t be perfectly balanced across zones, the best available balance is achieved without keeping the tasks pending for execution.","titus.deploy.hardConstraints":"Constraints must be met and tasks will not be launched if constraint can’t be perfectly met","titus.deploy.efs":"if completed, allows you to specify an EFS volume to attach to each Task that gets created for the Job","titus.deploy.mountPoint":"(Required) A valid directory to mount the volume, e.g, <samp>/efs</samp>. Invalid locations are <samp>/</samp>, <samp>/data</samp>, and <samp>/logs</samp> as these are reserved directories.","titus.deploy.efsId":"(Required) The EFS file system ID, e.g. <samp> fs-0208c74b</samp>.","titus.deploy.efsRelativeMountPoint":"(Optional) Relative dir within FS ID, e.g. <samp>/dirInVol</samp>","titus.job.waitForCompletion":"if unchecked, marks the stage as successful right away without waiting for the job to complete","titus.bake.fromGitTrigger":"If checked, gets git details from the specified git trigger.","titus.bake.repositoryUrl":"Url to the git repository containing the code to create the Docker image from, <samp>ssh://git@stash.corp.netflix.com:7999/SPKR/orca.git</samp> or <samp>ssh://git@github.com/spinnaker/orca.git</samp>","titus.bake.repositoryHash":"(Optional) The hashcode to the git commit for the image","titus.bake.repositoryBranch":"(Optional) The branch in git to build the image from","titus.bake.repositoryDirectory":"(Optional) If specified, will build the image from the Dockerfile contained in this directory. Default to project root.","titus.bake.imageOrganization":"(Optional) The organization to which this image belongs to, e.g. <samp>spinnaker</samp> for <samp>spinnaker/igor</samp>Defaults to none.","titus.bake.imageName":"(Optional) The name for the image, e.g. <samp>igor</samp> for <samp>spinnaker/igor</samp>Defaults to [git project name].[git repo name].","titus.bake.tags":"(Optional) Comma separated. By default, the <samp>latest</samp> tag is updated. Adds additional tags to label this image <samp>1.0.0-unstable,1.0.0-rc1</samp>","titus.bake.buildParameters":"(Optional) Build time variables to be passed to the Docker image. These are the set of values passed to --build-args in the command line.","titus.serverGroup.subnet":"The subnet selection determines the VPC in which your container will run. Options vary by account and region. The most common are: \n <ul>\n <li><b>titus</b>: instances will be restricted to internal clients with their own NAT gateways</li>\n <li><b>internal</b> instances will be restricted to internal clients (i.e. require VPN access)</li>\n <li><b>external</b> instances will be publicly accessible and running in VPC</li>\n </ul>\n ","titus.serverGroup.traffic":'\n <p>Enables the "inService" scaling process, which is used by Spinnaker and discovery services to determine if the server group is enabled.</p>\n <p>Will be automatically enabled when any non "custom" deployment strategy is selected.</p>',"titus.deploy.imageId":"This value has been manually overridden. To edit this value, please update the <b><i>imageId</i></b> attribute in the stage JSON. Spinnaker expects this to follow the <b><i>name:tag</i></b> format, or the <b><i>imageName</i></b> directly from Jenkins","titus.deploy.securityGroups":"AWS Security Groups to assign to this service. Security groups are set only if <samp>Allocate IP?</samp> has been selected and are assigned to the Titus AWS Elastic Network Interface.","titus.job.capacityGroup":"Capacity Group will default to application name if not specified.","titus.job.securityGroups":"AWS Security Groups to assign to this job","titus.autoscaling.cooldown":"\n <p>The amount of time, in seconds, after a scaling activity completes where previous trigger-related scaling\n activities can influence future scaling events.</p>\n <p>For scale out policies, while the cooldown period is in effect, the capacity that has been added by the\n previous scale out event that initiated the cooldown is calculated as part of the desired capacity for the next\n scale out. The intention is to continuously (but not excessively) scale out. For example, an alarm triggers a\n step scaling policy to scale out an Amazon ECS service by 2 tasks, the scaling activity completes successfully,\n and a cooldown period of 5 minutes starts. During the Cooldown period, if the alarm triggers the same policy\n again but at a more aggressive step adjustment to scale out the service by 3 tasks, the 2 tasks that were added\n in the previous scale out event are considered part of that capacity and only 1 additional task is added to the desired count.</p>\n <p>For scale in policies, the cooldown period is used to block subsequent scale in requests until it has expired.\n The intention is to scale in conservatively to protect your application's availability. However, if another\n alarm triggers a scale out policy during the cooldown period after a scale in, Application Auto Scaling scales\n out your scalable target immediately.</p>\n ","titus.autoscaling.scaleIn.cooldown":"\n <p>The amount of time, in seconds, after a scale in activity completes before another scale in activity can start.</p>\n <p>The cooldown period is used to block subsequent scale in requests until it has expired. The intention is to scale\n in conservatively to protect your application's availability. However, if another alarm triggers a scale out policy\n during the cooldown period after a scale in, Application Auto Scaling scales out your scalable target immediately.</p>\n ","titus.autoscaling.scaleOut.cooldown":"\n <p>The amount of time, in seconds, after a scale out activity completes before another scale out activity can start.</p>\n <p>While the cooldown period is in effect, the capacity that has been added by the previous scale out event that\n initiated the cooldown is calculated as part of the desired capacity for the next scale out. The intention is to\n continuously (but not excessively) scale out.</p>\n ","titus.disruptionbudget.description":'\n <p>\n The Job Disruption Budget is part of the job descriptor, and defines the behavior of how containers of the\n job can be relocated.\n <a href="http://manuals.test.netflix.net/view/titus-docs/mkdocs/master/disruption_budget/" target="_blank">\n Read the full documentation\n </a>\n </p>\n '};Object.keys(Rt).forEach((e=>E.register(e,Rt[e])));const Vt=({containerIp:e,host:t,instancePort:n,ipv6Address:r})=>dt.createElement(w,{heading:"DNS",defaultExpanded:!0},dt.createElement(S,{className:"dl-horizontal dl-narrow"},e&&dt.createElement(k,{label:"Container IP",value:dt.createElement(dt.Fragment,null,e,dt.createElement(N,{text:e,toolTip:"Copy container IP to clipboard"}))}),r&&dt.createElement(k,{label:"Container IPv6",value:dt.createElement(A,{text:r,url:`http://${r}:${n}`})}),dt.createElement(k,{label:"Host IP",value:t}))),Wt=({instance:e,titusUiEndpoint:t})=>{const{id:r,jobId:a}=e;return mt.createElement(w,{heading:"Instance Information",defaultExpanded:!0},mt.createElement("dl",{className:"dl-horizontal dl-narrow"},mt.createElement(n,{account:e.account,availabilityZone:e.availabilityZone,instanceType:e.instanceType,launchTime:e.launchTime,provider:e.provider,region:e.region,serverGroup:e.serverGroup}),mt.createElement(k,{label:"Job Id",value:mt.createElement("a",{href:`${t}jobs/${a}`,target:"_blank"},a)}),mt.createElement(k,{label:"Instance Id",value:mt.createElement(A,{text:r,url:`${t}jobs/${a}/tasks/${r}`})})))};class Ht extends G{get titusServerGroupTransformer(){return this.$injector.get("titusServerGroupTransformer")}get titusServerGroupCommandBuilder(){return this.$injector.get("titusServerGroupCommandBuilder")}get titusServerGroupConfigurationService(){return this.$injector.get("titusServerGroupConfigurationService")}get titusSecurityGroupReader(){return this.$injector.get("titusSecurityGroupReader")}initialize(e){this.$injector=e}}const Zt=new Ht;class Ut extends mt.Component{constructor(e){super(e),this.state={}}componentDidMount(){this.configureSecurityGroups(this.props)}configureSecurityGroups(e){const{app:t,serverGroup:n}=e,{region:r}=n;if(t.securityGroupsIndex&&n.accountDetails){const e=n.securityGroups.map((e=>Zt.titusSecurityGroupReader.resolveIndexedSecurityGroup(t.securityGroupsIndex,{account:n.accountDetails.awsAccount,region:r},e)));this.setState({securityGroups:e})}else T.listAllAccounts("titus").then((e=>{const t=e.find((e=>e.name===n.account));t&&t.awsAccount&&I.securityGroupReader.getAllSecurityGroups().then((e=>{const a=e[t.awsAccount].aws[r],s=n.securityGroups.map((e=>a.find((t=>t.id===e)))).filter((e=>e)).map((e=>({account:t.awsAccount,name:e.name,id:e.id,vpcId:e.vpcId})));this.setState({securityGroups:s})}))}))}componentWillReceiveProps(e){this.configureSecurityGroups(e)}render(){const{serverGroup:e}=this.props,{securityGroups:t}=this.state,n=!t&&(e.securityGroups||[]).length;return mt.createElement(w,{heading:D.get("Firewalls"),outerDivClassName:""},mt.createElement("ul",null,n&&e.securityGroups.map((e=>mt.createElement("li",{key:e},"..."))),mt.createElement(ht,null,mt.createElement(mt.Fragment,null,vt(t,"name").map((t=>mt.createElement("li",{key:t.name},mt.createElement(gt,{to:"^.firewallDetails",params:{name:t.name,accountId:t.account,region:e.region,vpcId:t.vpcId,provider:"aws"}},mt.createElement("a",null,t.name," (",t.id,")")))))))))}}const qt=(e,t,n)=>e.map((e=>{var r;const a=t.find((t=>(t.name===e.name||t.name===e.targetGroupName)&&t.account===n)),s="traffic-port"===(null==a?void 0:a.healthCheckPort)||!(null==a?void 0:a.healthCheckPort);return{...e,name:null==a?void 0:a.name,healthCheckPath:a?`:${s?null==a?void 0:a.port:a.healthCheckPort}${(null==a?void 0:a.healthCheckPath)||""}`:void 0,healthCheckProtocol:null==(r=null==a?void 0:a.healthCheckProtocol)?void 0:r.toLowerCase()}})),Jt=(e,t,n)=>{const a=(e||[]).filter((e=>"Unknown"!==e.state)),s=r(t);return a.map((e=>{if("TargetGroup"===e.type){const t=qt(e.targetGroups,s,n);return{...e,targetGroups:t}}return e}))},Kt=(e,t)=>()=>{const n={application:t,title:`Terminating ${e.id}`,onTaskComplete:()=>{I.$state.includes("**.instanceDetails",{id:e.id})&&I.$state.go("^")}};x.confirm({header:`Really terminate ${e.id}?`,buttonText:`Terminate ${e.id}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>{const n={cloudProvider:"titus"};return e.serverGroup&&(n.serverGroupName=e.serverGroup),P.terminateInstance(e,t,n)}})},Xt=(e,t)=>()=>{const n={application:t,title:`Terminating ${e.id} and shrinking server group`,onTaskComplete:()=>{I.$state.includes("**.instanceDetails",{instanceId:e.id})&&I.$state.go("^")}};x.confirm({header:`Really terminate ${e.id} and shrink ${e.serverGroup}?`,buttonText:`Terminate ${e.id} and shrink ${e.serverGroup}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>P.terminateInstancesAndShrinkServerGroups([{cloudProvider:e.cloudProvider,instanceIds:[e.id],account:e.account,region:e.region,serverGroup:e.serverGroup,instances:[e]}],t)})},Yt=(e,t)=>()=>{const n={application:t,title:`Enabling ${e.id} in discovery`};x.confirm({header:`Really enable ${e.id} in discovery?`,buttonText:`Enable ${e.id}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>P.enableInstanceInDiscovery(e,t)})},Qt=(e,t)=>()=>{const n={application:t,title:`Disabling ${e.id} in discovery`};x.confirm({header:`Really disable ${e.id} in discovery?`,buttonText:`Disable ${e.id}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>P.disableInstanceInDiscovery(e,t)})},$t=(e,t)=>{const n=[{label:"Terminate",triggerAction:Kt(e,t)},{label:"Terminate and Shrink Server Group",triggerAction:Xt(e,t)}],r=(e.health||[]).filter((e=>"Discovery"===e.type));r.length&&"OutOfService"===r[0].state&&n.push({label:"Enable in Discovery",triggerAction:Yt(e,t)});return(r||[]).some((e=>"Up"===e.state||"Down"===e.state))&&n.push({label:"Disable in Discovery",triggerAction:Qt(e,t)}),n},_t=O((({account:e,actions:t,app:n,baseIpAddress:r,environment:s,healthMetrics:i,instance:o,instanceId:l,instancePort:c,loading:u,moniker:d,serverGroup:m,region:p})=>{var g,h,f;const v=`ssh -t ${null==e?void 0:e.bastionHost} 'titus-ssh -region ${p} ${l}'`;return dt.createElement("div",{className:"details-panel"},dt.createElement("div",{className:"header"},dt.createElement(L,{healthState:o.healthState,instanceId:l,loading:u,sshLink:v,standalone:n.isStandalone}),dt.createElement("div",{className:"actions"},dt.createElement(M,{actions:t}),Boolean(null==(g=null==o?void 0:o.insightActions)?void 0:g.length)&&dt.createElement(F,{analytics:!0,insights:o.insightActions,instance:o}))),dt.createElement("div",{className:"content"},dt.createElement(Wt,{instance:o,titusUiEndpoint:o.titusUiEndpoint}),dt.createElement(a,{healthMetrics:i,healthState:o.healthState,metricTypes:["TargetGroup"],privateIpAddress:o.privateIpAddress}),dt.createElement(Vt,{containerIp:null==(h=o.placement)?void 0:h.containerIp,host:null==(f=o.placement)?void 0:f.host,instancePort:c,ipv6Address:o.ipv6Address}),dt.createElement("div",{className:"collapsible-section"},dt.createElement(Ut,{app:n,serverGroup:m})),dt.createElement(w,{heading:"Console Output"},dt.createElement(z,{instance:o})),dt.createElement(j,{address:r,application:n,instance:o,environment:s,moniker:d})))}),"titus.instance.details.content"),en=({app:e,environment:t,instance:n,moniker:r})=>{var a,s,i;const{instanceId:o}=n,l=e.serverGroups.data.find((e=>e.instances.some((e=>e.id===o)))),{account:c,region:u}=l,d=()=>(Z.addExtraDataToLatest("instances",{account:c,region:u,serverGroup:l.name}),Promise.all([R.getInstanceDetails(c,u,o).then((e=>({...e,account:c,region:u}))),T.getAccountDetails(c)])),m=e=>{const[t,n]=e,r=((null==n?void 0:n.regions)||[]).find((e=>e.name===u));return[{titusUiEndpoint:null==r?void 0:r.endpoint,...t},n]},{result:[p,g],status:h}=B((()=>e.isStandalone?d().then((e=>m(e))):e.serverGroups.ready().then(d).then((e=>m(e)))),[{},{}],[o,l]),f=$t(p,e),v=Jt(p.health,e.loadBalancers.data,g.awsAccount),y="PENDING"===h,b=(null==(a=e.attributes)?void 0:a.instancePort)||V.defaultInstancePort||"80",C=(null==(s=p.placement)?void 0:s.containerIp)||(null==(i=null==p?void 0:p.placement)?void 0:i.host);return y?dt.createElement(W,null,dt.createElement("div",{className:"horizontal center middle"},dt.createElement(H,{size:"small"}))):(null==p?void 0:p.id)?dt.createElement(_t,{account:g,actions:f,app:e,baseIpAddress:C,environment:t,healthMetrics:v,instance:p,instanceId:n.instanceId,instancePort:b,moniker:r,loading:y,serverGroup:l,region:u}):dt.createElement("div",{className:"details-panel"},dt.createElement("div",{className:"header"},dt.createElement(W,null,dt.createElement("div",{className:"header-text horizontal middle"},dt.createElement("h3",{className:"horizontal middle space-between flex-1"},n.instanceId)))),dt.createElement("div",{className:"content"},dt.createElement("div",{className:"content-section"},dt.createElement("div",{className:"content-body text-center"},dt.createElement("h3",null,"Instance not found.")))))};t("spinnaker.titus.pipeline.stage.cloneServerGroup.executionDetails.controller",[It]).controller("titusCloneServerGroupExecutionDetailsCtrl",["$scope","$stateParams","executionDetailsSectionService",function(e,t,n){e.configSections=["cloneServerGroupConfig","taskStatus"];const r=()=>{const n=r["kato.tasks"][0].resultObjects;e.detailsSection=t.details;const r=e.stage.context||{},a=[];r&&r["kato.tasks"]&&r["kato.tasks"].length&&n&&n.length&&function(e){const s=ft.find(n,e);s&&ft.forEach(s[e],(e=>{if(e.includes(":")){const[n,s]=e.split(":"),i={type:"serverGroups",application:r.application,serverGroup:s,account:r.credentials,region:n,provider:"titus",project:t.project};i.href=q.buildFromMetadata(i),a.push(i)}}))}("serverGroupNames"),e.deployed=a};this.overrideFiltersForUrl=e=>U.filterService.overrideFiltersForUrl(e);const a=()=>n.synchronizeSection(e.configSections,r);a(),e.$on("$stateChangeSuccess",a)}]);t("spinnaker.titus.pipeline.stage.cloneServerGroupStage",["spinnaker.titus.pipeline.stage.cloneServerGroup.executionDetails.controller"]).config((function(){J.pipeline.registerStage({provides:"cloneServerGroup",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupStage.html",executionDetailsUrl:"titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupExecutionDetails.html",executionStepLabelUrl:"titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupStepLabel.html",validators:[{type:"requiredField",fieldName:"targetCluster",fieldLabel:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"region"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusCloneServerGroupStageCtrl",["$scope",function(e){const t=e.stage;e.viewState={accountsLoaded:!1},T.listAccounts("titus").then((t=>{e.accounts=t,e.viewState.accountsLoaded=!0})),this.cloneTargets=K.TARGET_LIST,t.target=t.target||this.cloneTargets[0].val,t.application=e.application.name,t.cloudProvider="titus",t.cloudProviderType="titus",t.viewState={mode:"editPipeline"},t.isNew&&e.application.attributes.platformHealthOnlyShowOverride&&e.application.attributes.platformHealthOnly&&(t.interestingHealthProviderNames=["Titus"]),!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),this.targetClusterUpdated=()=>{if(t.targetCluster){const e=X.parseServerGroupName(t.targetCluster);t.stack=e.stack,t.freeFormDetails=e.freeFormDetails}else t.stack="",t.freeFormDetails=""},e.$watch("stage.targetCluster",this.targetClusterUpdated),this.removeCapacity=()=>{delete t.capacity},ft.has(t,"useSourceCapacity")||(t.useSourceCapacity=!0),this.toggleSuspendedProcess=e=>{t.suspendedProcesses=t.suspendedProcesses||[];const n=t.suspendedProcesses.indexOf(e);-1===n?t.suspendedProcesses.push(e):t.suspendedProcesses.splice(n,1)},this.processIsSuspended=e=>t.suspendedProcesses&&t.suspendedProcesses.includes(e),this.onRedBlackFieldChange=(e,n)=>{ft.set(t,e,n)}}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupStage.html",'<div ng-controller="titusCloneServerGroupStageCtrl as cloneServerGroupStageCtrl">\n <div ng-if="!pipeline.strategy">\n <div ng-if="viewState.loading">\n <h4 class="text-center">\n <span us-spinner="{radius:20, width:6, length: 12}"></span>\n </h4>\n </div>\n <div ng-if="!viewState.loading">\n <account-region-cluster-selector\n application="application"\n component="stage"\n accounts="accounts"\n single-region="true"\n cluster-field="targetCluster"\n >\n </account-region-cluster-selector>\n </div>\n </div>\n <stage-config-field label="Target">\n <target-select model="stage" options="cloneServerGroupStageCtrl.cloneTargets"></target-select>\n </stage-config-field>\n <div>\n <div class="form-group">\n <div class="col-md-3 sm-label-right">Capacity</div>\n <div class="col-md-9 radio">\n <label>\n <input\n type="radio"\n ng-model="stage.useSourceCapacity"\n ng-value="true"\n ng-click="cloneServerGroupStageCtrl.removeCapacity()"\n id="useSourceCapacityTrue"\n />\n Copy the capacity from the current server group\n <help-field key="serverGroupCapacity.useSourceCapacityTrue"></help-field>\n </label>\n </div>\n <div class="col-md-9 col-md-offset-3 radio">\n <label>\n <input type="radio" ng-model="stage.useSourceCapacity" ng-value="false" id="useSourceCapacityFalse" />\n Let me specify the capacity\n <help-field key="serverGroupCapacity.useSourceCapacityFalse"></help-field>\n </label>\n </div>\n </div>\n <div class="form-group">\n <div class="col-md-2 col-md-offset-3">Min</div>\n <div class="col-md-2">Max</div>\n <div class="col-md-2">Desired</div>\n </div>\n <div class="form-group">\n <div class="col-md-2 col-md-offset-3">\n <input\n type="number"\n ng-disabled="stage.useSourceCapacity"\n class="form-control input-sm"\n ng-model="stage.capacity.min"\n min="0"\n max="{{stage.capacity.max}}"\n required\n />\n </div>\n <div class="col-md-2">\n <input\n type="number"\n ng-disabled="stage.useSourceCapacity"\n class="form-control input-sm"\n ng-model="stage.capacity.max"\n min="{{stage.capacity.min}}"\n required\n />\n </div>\n <div class="col-md-2">\n <input\n type="number"\n ng-disabled="stage.useSourceCapacity"\n class="form-control input-sm"\n ng-model="stage.capacity.desired"\n min="{{stage.capacity.min}}"\n max="{{stage.capacity.max}}"\n required\n />\n </div>\n </div>\n </div>\n <stage-config-field label="Traffic" help-key="titus.serverGroup.traffic">\n <div class="checkbox">\n <label>\n <input\n type="checkbox"\n ng-click="cloneServerGroupStageCtrl.toggleSuspendedProcess(\'AddToLoadBalancer\')"\n ng-checked="!cloneServerGroupStageCtrl.processIsSuspended(\'AddToLoadBalancer\')"\n />\n Send client requests to new instances\n </label>\n </div>\n </stage-config-field>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n <deployment-strategy-selector\n label-columns="3"\n field-columns="6"\n command="stage"\n on-field-change="cloneServerGroupStageCtrl.onRedBlackFieldChange"\n ></deployment-strategy-selector>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupExecutionDetails.html",'<div ng-controller="titusCloneServerGroupExecutionDetailsCtrl">\n <execution-details-section-nav sections="configSections"></execution-details-section-nav>\n <div class="step-section-details" ng-if="detailsSection === \'cloneServerGroupConfig\'">\n <div class="row">\n <div class="col-md-9">\n <dl class="dl-narrow dl-horizontal">\n <dt>Account</dt>\n <dd><account-tag account="stage.context.credentials"></account-tag></dd>\n <dt>Region</dt>\n <dd>{{stage.context.region}}</dd>\n <dt>Cluster</dt>\n <dd>{{stage.context.targetCluster}}</dd>\n <dt>Server Group</dt>\n <dd>{{stage.context.source.serverGroupName}}</dd>\n <dt ng-if="!stage.context.useSourceCapacity && stage.context.capacity">Capacity</dt>\n <dd ng-if="!stage.context.useSourceCapacity && stage.context.capacity">\n Min: {{stage.context.capacity.min}} / Desired: {{stage.context.capacity.desired}} / Max:\n {{stage.context.capacity.max}}\n </dd>\n </dl>\n </div>\n </div>\n <stage-failure-message stage="stage" message="stage.failureMessage"></stage-failure-message>\n\n <div class="row" ng-if="deployed.length">\n <div class="col-md-12">\n <div class="well alert alert-info">\n <strong>Deployed:</strong>\n <a\n ng-repeat="serverGroup in deployed"\n ng-click="$event.stopPropagation(); deployDetailsCtrl.overrideFiltersForUrl(serverGroup);"\n ng-href="{{serverGroup.href}}"\n >\n {{serverGroup.serverGroup}}\n </a>\n </div>\n </div>\n </div>\n </div>\n\n <div class="step-section-details" ng-if="detailsSection === \'taskStatus\'">\n <div class="row">\n <execution-step-details item="stage"></execution-step-details>\n </div>\n </div>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupStepLabel.html",'<span class="task-label"> Clone Server Group: {{step.context.source.serverGroupName}} ({{step.context.region}}) </span>\n')}]);t("spinnaker.titus.pipeline.stage.destroyAsgStage",[]).config((function(){J.pipeline.registerStage({provides:"destroyServerGroup",alias:"destroyAsg",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/destroyAsg/destroyAsgStage.html",executionStepLabelUrl:"titus/src/pipeline/stages/destroyAsg/destroyAsgStepLabel.html",accountExtractor:e=>[e.context.credentials],configAccountExtractor:e=>[e.credentials],validators:[{type:"targetImpedance",message:"This pipeline will attempt to destroy a server group without deploying a new version into the same cluster."},{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusDestroyAsgStageCtrl",["$scope",function(e){const t=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),e.regions=["us-east-1","us-west-1","eu-west-1","us-west-2"],e.targets=K.TARGET_LIST,t.regions=t.regions||[],t.cloudProvider="titus",!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),!t.regions.length&&e.application.defaultRegions.titus&&t.regions.push(e.application.defaultRegions.titus),t.target||(t.target=e.targets[0].val)}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/destroyAsg/destroyAsgStage.html",'<div ng-controller="titusDestroyAsgStageCtrl as destroyAsgStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Target">\n <target-select model="stage" options="targets"></target-select>\n </stage-config-field>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/destroyAsg/destroyAsgStepLabel.html",'<span class="task-label"> Destroy Server Group: {{step.context.serverGroupName}} ({{step.context.region}}) </span>\n')}]);t("spinnaker.titus.pipeline.stage.disableAsgStage",[]).config((function(){J.pipeline.registerStage({provides:"disableServerGroup",alias:"disableAsg",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/disableAsg/disableAsgStage.html",executionStepLabelUrl:"titus/src/pipeline/stages/disableAsg/disableAsgStepLabel.html",validators:[{type:"targetImpedance",message:"This pipeline will attempt to disable a server group without deploying a new version into the same cluster."},{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusDisableAsgStageCtrl",["$scope",function(e){const t=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),e.targets=K.TARGET_LIST,t.regions=t.regions||[],t.cloudProvider="titus",t.isNew&&e.application.attributes.platformHealthOnlyShowOverride&&e.application.attributes.platformHealthOnly&&(t.interestingHealthProviderNames=["Titus"]),!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),!t.regions.length&&e.application.defaultRegions.titus&&t.regions.push(e.application.defaultRegions.titus),t.target||(t.target=e.targets[0].val)}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/disableAsg/disableAsgStage.html",'<div ng-controller="titusDisableAsgStageCtrl as disableAsgStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Target">\n <target-select model="stage" options="targets"></target-select>\n </stage-config-field>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/disableAsg/disableAsgStepLabel.html",'<span class="task-label"> Disable Server Group: {{step.context.serverGroupName}} ({{step.context.region}}) </span>\n')}]);t("spinnaker.titus.pipeline.stage.disableClusterStage",[]).config((function(){J.pipeline.registerStage({provides:"disableCluster",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/disableCluster/disableClusterStage.html",executionConfigSections:["disableClusterConfig","taskStatus"],validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"remainingEnabledServerGroups",fieldLabel:"Keep [X] enabled Server Groups"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusDisableClusterStageCtrl",["$scope",function(e){const t=this,n=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),t.reset=()=>{t.accountUpdated(),t.resetSelectedCluster()},n.regions=n.regions||[],n.cloudProvider="titus",n.isNew&&e.application.attributes.platformHealthOnlyShowOverride&&e.application.attributes.platformHealthOnly&&(n.interestingHealthProviderNames=["Titus"]),!n.credentials&&e.application.defaultCredentials.titus&&(n.credentials=e.application.defaultCredentials.titus),!n.regions.length&&e.application.defaultRegions.titus&&n.regions.push(e.application.defaultRegions.titus),void 0===n.remainingEnabledServerGroups&&(n.remainingEnabledServerGroups=1),t.pluralize=function(e,t){return 1===t?e:e+"s"},void 0===n.preferLargerOverNewer&&(n.preferLargerOverNewer="false"),n.preferLargerOverNewer=n.preferLargerOverNewer.toString()}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/disableCluster/disableClusterStage.html",'<div ng-controller="titusDisableClusterStageCtrl as disableClusterStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Disable Options">\n <div class="form-inline">\n Keep the\n <input\n type="number"\n min="0"\n required\n ng-model="stage.remainingEnabledServerGroups"\n class="form-control input-sm"\n style="width: 50px"\n />\n <select class="form-control input-sm" ng-model="stage.preferLargerOverNewer" style="width: 100px">\n <option value="true">largest</option>\n <option value="false">newest</option>\n </select>\n {{disableClusterStageCtrl.pluralize(\'server group\', stage.remainingEnabledServerGroups)}} enabled.\n </div>\n </stage-config-field>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n</div>\n')}]);t("spinnaker.titus.pipeline.stage.enableAsgStage",[]).config((function(){J.pipeline.registerStage({provides:"enableServerGroup",alias:"enableAsg",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/enableAsg/enableAsgStage.html",executionStepLabelUrl:"titus/src/pipeline/stages/enableAsg/enableAsgStepLabel.html",validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusEnableAsgStageCtrl",["$scope",function(e){const t=this,n=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),t.reset=()=>{t.accountUpdated(),t.resetSelectedCluster()},e.targets=K.TARGET_LIST,n.regions=n.regions||[],n.cloudProvider="titus",n.isNew&&e.application.attributes.platformHealthOnlyShowOverride&&e.application.attributes.platformHealthOnly&&(n.interestingHealthProviderNames=["Titus"]),!n.credentials&&e.application.defaultCredentials.titus&&(n.credentials=e.application.defaultCredentials.titus),!n.regions.length&&e.application.defaultRegions.titus&&n.regions.push(e.application.defaultRegions.titus),n.target||(n.target=e.targets[0].val),e.$watch("stage.credentials",e.accountUpdated)}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/enableAsg/enableAsgStage.html",'<div ng-controller="titusEnableAsgStageCtrl as enableAsgStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Target">\n <target-select model="stage" options="targets"></target-select>\n </stage-config-field>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/enableAsg/enableAsgStepLabel.html",'<span class="task-label"> Enable Server Group: {{step.context.serverGroupName}} ({{step.context.region}}) </span>\n')}]);e.module("spinnaker.titus.pipeline.stage.findAmiStage",[]).config((function(){J.pipeline.registerStage({provides:"findImage",alias:"findAmi",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/findAmi/findAmiStage.html",validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"selectionStrategy",fieldLabel:"Server Group Selection"},{type:"requiredField",fieldName:"credentials"}]})})).controller("titusFindAmiStageCtrl",["$scope",function(t){const n=t.stage;t.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(e){t.accounts=e,t.state.accounts=!0})),t.selectionStrategies=[{label:"Largest",val:"LARGEST",description:"When multiple server groups exist, prefer the server group with the most instances"},{label:"Newest",val:"NEWEST",description:"When multiple server groups exist, prefer the newest"},{label:"Oldest",val:"OLDEST",description:"When multiple server groups exist, prefer the oldest"},{label:"Fail",val:"FAIL",description:"When multiple server groups exist, fail"}],n.regions=n.regions||[],n.cloudProvider="titus",n.selectionStrategy=n.selectionStrategy||t.selectionStrategies[0].val,e.isUndefined(n.onlyEnabled)&&(n.onlyEnabled=!0),!n.credentials&&t.application.defaultCredentials.titus&&(n.credentials=t.application.defaultCredentials.titus),!n.regions.length&&t.application.defaultRegions.titus&&n.regions.push(t.application.defaultRegions.titus),t.$watch("stage.credentials",t.accountUpdated)}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/findAmi/findAmiStage.html",'<div ng-controller="titusFindAmiStageCtrl as findAmiCtrl" class="form-horizontal">\n <account-region-cluster-selector\n application="application"\n component="stage"\n accounts="accounts"\n show-all-regions="true"\n >\n </account-region-cluster-selector>\n <stage-config-field label="Server Group Selection">\n <ui-select ng-model="stage.selectionStrategy" class="form-control input-sm">\n <ui-select-match placeholder="None">{{$select.selected.label}}</ui-select-match>\n <ui-select-choices repeat="strategy.val as strategy in selectionStrategies | filter: $select.search">\n <strong ng-bind-html="strategy.label | highlight: $select.search"></strong>\n <div ng-bind-html="strategy.description"></div>\n </ui-select-choices>\n </ui-select>\n </stage-config-field>\n <stage-config-field label="Server Group Filters">\n <label class="checkbox-inline">\n <input type="checkbox" ng-model="stage.onlyEnabled" />\n Only consider enabled Server Groups\n </label>\n </stage-config-field>\n</div>\n')}]);t("spinnaker.titus.pipeline.stage.resizeAsgStage",[]).config((function(){J.pipeline.registerStage({provides:"resizeServerGroup",alias:"resizeAsg",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/resizeAsg/resizeAsgStage.html",executionConfigSections:["resizeServerGroupConfig","taskStatus"],executionStepLabelUrl:"titus/src/pipeline/stages/resizeAsg/resizeAsgStepLabel.html",accountExtractor:e=>[e.context.credentials],configAccountExtractor:e=>[e.credentials],validators:[{type:"targetImpedance",message:"This pipeline will attempt to resize a server group without deploying a new version into the same cluster."},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"action"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusResizeAsgStageCtrl",["$scope",function(e){const t=e.stage;e.viewState={accountsLoaded:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.viewState.accountsLoaded=!0})),e.resizeTargets=K.TARGET_LIST,e.scaleActions=[{label:"Scale Up",val:"scale_up"},{label:"Scale Down",val:"scale_down"},{label:"Scale to Cluster Size",val:"scale_to_cluster"},{label:"Scale to Exact Size",val:"scale_exact"}],e.resizeTypes=[{label:"Percentage",val:"pct"},{label:"Incremental",val:"incr"}],t.capacity=t.capacity||{},t.regions=t.regions||[],t.target=t.target||e.resizeTargets[0].val,t.action=t.action||e.scaleActions[0].val,t.resizeType=t.resizeType||e.resizeTypes[0].val,t.action||"exact"!==t.resizeType||(t.action="scale_exact"),t.cloudProvider="titus",t.isNew&&e.application.attributes.platformHealthOnlyShowOverride&&e.application.attributes.platformHealthOnly&&(t.interestingHealthProviderNames=["Titus"]),!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),!t.regions.length&&e.application.defaultRegions.titus&&t.regions.push(e.application.defaultRegions.titus),this.updateResizeType=function(){"scale_exact"===t.action?(t.resizeType="exact",delete t.scalePct,delete t.scaleNum):(t.capacity={},"pct"===t.resizeType?delete t.scaleNum:(t.resizeType="incr",delete t.scalePct,t.scaleNum=t.scaleNum||0))}}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/resizeAsg/resizeAsgStage.html",'<div ng-controller="titusResizeAsgStageCtrl as resizeAsgStageCtrl">\n <div ng-if="!pipeline.strategy">\n <div ng-if="!viewState.accountsLoaded">\n <h4 class="text-center">\n <span us-spinner="{radius:20, width:6, length: 12}"></span>\n </h4>\n </div>\n <div ng-if="viewState.accountsLoaded">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n </div>\n <stage-config-field label="Target">\n <target-select model="stage" options="resizeTargets"></target-select>\n </stage-config-field>\n <stage-config-field label="Action" help-key="pipeline.config.resizeAsg.action">\n <select\n class="form-control input-sm"\n required\n ng-model="stage.action"\n ng-change="resizeAsgStageCtrl.updateResizeType()"\n ng-options="a.val as a.label for a in scaleActions"\n >\n <option>Select an action...</option>\n </select>\n </stage-config-field>\n <div ng-if="stage.action !== \'scale_exact\'">\n <stage-config-field label="{{stage.action === \'scale_to_cluster\' ? \'Additional Capacity\' : \'Type\'}}">\n <select\n class="form-control input-sm"\n required\n ng-model="stage.resizeType"\n ng-change="resizeAsgStageCtrl.updateResizeType()"\n ng-options="t.val as t.label for t in resizeTypes"\n >\n <option>Select an action...</option>\n </select>\n </stage-config-field>\n <div class="form-group" ng-if="stage.resizeType === \'pct\'">\n <div class="col-md-9 col-md-offset-3">\n <label class="col-md-2 sm-label-right" style="margin-left: 0; padding-left: 0">Resize Percentage</label>\n\n <div class="col-md-2">\n <input type="number" min="0" ng-model="stage.scalePct" class="form-control input-sm" />\n </div>\n </div>\n <div class="col-md-9 col-md-offset-3">\n <em class="subinput-note"\n >This is the percentage by which the target server group\'s capacity will be increased</em\n >\n </div>\n </div>\n <div class="form-group" ng-if="stage.resizeType === \'incr\'">\n <div class="col-md-9 col-md-offset-3">\n <label class="col-md-2 sm-label-right" style="margin-left: 0; padding-left: 0">Resize-by Amount</label>\n\n <div class="col-md-2">\n <input type="number" min="0" ng-model="stage.scaleNum" class="form-control input-sm" />\n </div>\n </div>\n\n <div class="col-md-9 col-md-offset-3">\n <em class="subinput-note"\n >This is the exact amount by which the target server group\'s capacity will be increased</em\n >\n </div>\n </div>\n </div>\n <div class="form-group" ng-if="stage.action === \'scale_exact\'">\n <div class="col-md-9 col-md-offset-3 small">\n <div class="col-md-9">\n <div class="col-md-3 col-md-offset-3">Min</div>\n <div class="col-md-3">Max</div>\n <div class="col-md-3">Desired</div>\n </div>\n </div>\n <div class="col-md-9 col-md-offset-3">\n <label class="col-md-2 sm-label-right small" style="margin-left: 0; padding-left: 0">Match Capacity</label>\n\n <div class="col-md-9">\n <div class="col-md-3">\n <input type="number" ng-model="stage.capacity.min" class="form-control input-sm" />\n </div>\n <div class="col-md-3">\n <input type="number" ng-model="stage.capacity.max" class="form-control input-sm" />\n </div>\n <div class="col-md-3">\n <input type="number" ng-model="stage.capacity.desired" class="form-control input-sm" />\n </div>\n </div>\n </div>\n\n <div class="col-md-9 col-md-offset-3">\n <em class="subinput-note">This is the exact amount to which the target server group will be scaled</em>\n </div>\n </div>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/resizeAsg/resizeAsgStepLabel.html",'<span class="task-label"> Resize Server Group: {{step.context.serverGroupName}} ({{step.context.region}}) </span>\n')}]);class tn extends mt.Component{constructor(e){super(e),this.mounted=!1,this.state={}}componentDidMount(){this.mounted=!0,this.setEndpoint()}setEndpoint(){const{context:e}=this.props.stage;T.getAccountDetails(e.credentials).then((t=>{const n=t.regions.find((t=>t.name===e.cluster.region)).endpoint;this.mounted&&this.setState({titusUiEndpoint:n})}))}formatEntryPoint(e,t){return e&&Array.isArray(e)&&e.length>0?1===e.length?e[0]:JSON.stringify(e):t}componentWillUnmount(){this.mounted=!1}componentWillReceiveProps(){this.setEndpoint()}render(){const{stage:e,current:t,name:n}=this.props,{titusUiEndpoint:r}=this.state,{context:a}=e,{cluster:s}=a,{resources:i,env:o,entryPoint:l,entryPointList:c}=s,u=s?yt(a["deploy.jobs"],s.region,[])[0]:null,d=yt(a,"jobStatus.completionDetails.taskId"),m=this.formatEntryPoint(c,l);return mt.createElement(Y,{name:n,current:t},mt.createElement("div",{className:"row"},mt.createElement("div",{className:"col-md-9"},mt.createElement(S,{className:"dl-narrow dl-horizontal"},mt.createElement(k,{label:"Account",value:mt.createElement(Q,{account:a.credentials})}),s&&mt.createElement(mt.Fragment,null,mt.createElement(k,{label:"Image",value:s.imageId}),m&&mt.createElement(k,{label:"Entrypoint",value:m})),u&&mt.createElement(k,{label:"Titus Job Id",value:mt.createElement($,{message:`[${u}](${r}jobs/${u})`})}),d&&mt.createElement(k,{label:"Titus Task Id",value:mt.createElement($,{message:`[${d}](${r}jobs/${u}/tasks/${d})`})}),i&&Object.keys(i)&&mt.createElement(k,{label:"Resources",value:mt.createElement("ul",{className:"nostyle"},Object.keys(i).map((e=>mt.createElement("li",{key:e},e,": ",i[e]))))})))),o&&Object.keys(o)&&mt.createElement("div",{className:"row"},mt.createElement("div",{className:"col-md-12"},mt.createElement("h5",{style:{marginBottom:0,paddingBottom:"5px"}},"Environment Variables"),mt.createElement(S,null,Object.keys(o).map((e=>mt.createElement(k,{key:e,label:e,value:o[e]})))))),a.propertyFileContents&&mt.createElement("div",{className:"row"},mt.createElement("div",{className:"col-md-12"},mt.createElement("h5",{style:{marginBottom:"0px",paddingBottom:"5px"}},"Property File"),mt.createElement(_,{outputFileObject:a.propertyFileContents}))),mt.createElement(ee,{stage:e,message:e.failureMessage||yt(a,"completionDetails.message")}),d&&mt.createElement("div",{className:"row"},mt.createElement("div",{className:"col-md-12"},mt.createElement("div",{className:"well alert alert-info"},mt.createElement("a",{target:"_blank",href:`${r}jobs/${u}/tasks/${d}/logs`},"View Execution Logs"),mt.createElement("br",null),mt.createElement("a",{target:"_blank",href:`${r}jobs/${u}/tasks/${d}/logs/archived?file=stdout&view=Finished&open=true`},"Stdout"),mt.createElement("br",null),mt.createElement("a",{target:"_blank",href:`${r}jobs/${u}/tasks/${d}/logs/archived?file=stderr&view=Finished&open=true`},"Stderr")))))}}tn.title="runJobConfig";class nn extends mt.Component{constructor(e){super(e),this.state={availableGroups:[],removedGroups:[],loaded:!1},this.credentials={},this.vpcs=[],this.securityGroups={},this.clearRemoved=()=>{this.setState({removedGroups:[]})}}getCredentials(){return this.credentials[this.props.command.credentials]}getAwsAccount(){return this.getCredentials().awsAccount}getRegion(){return this.props.command.region||(this.props.command.cluster?this.props.command.cluster.region:null)}getVpcId(){const e=this.getCredentials(),t=this.vpcs.find((t=>t.name===e.awsVpc&&t.account===e.awsAccount&&t.region===this.getRegion()&&"aws"===t.cloudProvider));return t?t.id:null}getRegionalSecurityGroups(){const e=this.securityGroups[this.getAwsAccount()]||{aws:{}};return bt(e.aws[this.getRegion()]).filter({vpcId:this.getVpcId()}).sortBy("name").value()}refreshSecurityGroups(e){return I.cacheInitializer.refreshCache("securityGroups").then((()=>I.securityGroupReader.getAllSecurityGroups().then((t=>{this.securityGroups=t,e||this.configureSecurityGroupOptions()}))))}configureSecurityGroupOptions(){let e=this.getRegionalSecurityGroups();const t=this.state.availableGroups.length?this.state.availableGroups:e;let n,r=this.props.groupsToEdit;if(e&&this.props.groupsToEdit){const a=r.map((e=>{const n=t.find((t=>t.id===e));return n?n.name:e})),s=a.map((t=>{const n=e.find((e=>e.id===t||e.name===t));return n?n.name:null})).map((t=>e.find((e=>e.name===t)))).filter((e=>e)),i=s.map((e=>e.name));n=Ct(a,i),r=s.map((e=>e.id)),this.props.onChange(r)}e=e.sort(((e,t)=>e.name.localeCompare(t.name))),this.setState({availableGroups:e,loaded:!0,removedGroups:n})}componentDidMount(){const e=T.getCredentialsKeyedByAccount("titus").then((e=>{this.credentials=e})),t=I.securityGroupReader.getAllSecurityGroups().then((e=>{this.securityGroups=e})),n=s.listVpcs().then((e=>this.vpcs=e));Pt.all([e,t,n]).then((()=>this.configureSecurityGroupOptions()))}componentWillReceiveProps(e){this.props.account===e.account&&this.props.region===e.region||this.configureSecurityGroupOptions()}render(){const{command:e,hideLabel:t,groupsToEdit:n,amazonAccount:r}=this.props,{availableGroups:a,loaded:s,removedGroups:l}=this.state,c=D.get("firewalls");return s?mt.createElement("div",{className:"clearfix"},mt.createElement(i,{removed:l,onClear:this.clearRemoved}),mt.createElement(o,{command:e,hideLabel:t,availableGroups:a,groupsToEdit:n,refresh:()=>this.refreshSecurityGroups(),onChange:this.props.onChange,helpKey:"titus.deploy.securityGroups"}),r&&void 0!==e.credentials&&mt.createElement("div",{className:"small "+(t?"":"col-md-offset-3 col-md-9")},"Uses ",c," from the Amazon account ",mt.createElement(Q,{account:r}))):null}}const rn=V.providers.titus||{defaults:{}};rn&&(rn.resetToOriginal=V.resetToOriginal);const an=e=>e&&!e.includes("${");class sn extends mt.Component{constructor(e){super(e),this.accountUpdated=e=>{const{setFieldValue:t,values:n}=this.props.formik;n.credentials=e,n.credentialsChanged(n),t("account",e),t("credentials",e);const r=n.backingData.credentialsKeyedByAccount[e];t("containerAttributes",{...n.containerAttributes,"titusParameter.agent.assignIPv6Address":"test"===r.environment?"true":"false"})},this.regionUpdated=e=>{const{values:t,setFieldValue:n}=this.props.formik;t.region=e,t.regionChanged(t),n("region",e)},this.navigateToLatestServerGroup=()=>{const{values:e}=this.props.formik,{latestServerGroup:t}=this.state,n={provider:e.selectedProvider,accountId:t.account,region:t.region,serverGroup:t.name},{$state:r}=I;r.is("home.applications.application.insight.clusters")?r.go(".serverGroup",n):r.go("^.serverGroup",n)},this.stackChanged=e=>{const{formik:t}=this.props;t.setFieldValue("stack",e),t.values.clusterChanged(t.values)},this.strategyChanged=(e,t)=>{e.onStrategyChange(e,t),this.props.formik.setFieldValue("strategy",t.key)},this.dockerValuesChanged=e=>{Object.keys(e).forEach((t=>{this.props.formik.setFieldValue(t,e[t])}))},this.onStrategyFieldChange=(e,t)=>{this.props.formik.setFieldValue(e,t)},this.onSubnetChange=()=>{const{setFieldValue:e,values:t}=this.props.formik;t.subnetChanged(t),e("subnetType",t.subnetType)};const{values:t,setFieldValue:n}=this.props.formik;if(t.imageId&&!t.imageId.includes("${")){const{digest:e,organization:r,repository:a,tag:s}=Dt.splitImageId(t.imageId);n("digest",e),n("organization",r),n("repository",a),n("tag",s)}this.state={...this.getStateFromProps(e)}}getStateFromProps(e){const{app:t}=e,{values:n}=e.formik,r=X.getClusterName(t.name,n.stack,n.freeFormDetails),a=!t.clusters.find((e=>e.name===r)),s=t.serverGroups.data.filter((e=>e.cluster===r&&e.account===n.credentials&&e.region===n.region)).sort(((e,t)=>e.createdTime-t.createdTime)),i=s.length?s.pop():null;return{namePreview:r,createsNewCluster:a,latestServerGroup:i}}validate(e){const t={};var n,r;return n=e.stack,an(n)&&!/^([\w.]+|\${[^}]+})*$/.test(n)&&(t.stack="Only dot(.) and underscore(_) special characters are allowed in the Stack field."),r=e.freeFormDetails,an(r)&&!/^([\w.^~-]+|\${[^}]+})*$/.test(r)&&(t.freeFormDetails="Only dot(.), underscore(_), caret (^), tilde (~), and dash(-) special characters are allowed in the Detail field."),e.viewState.disableImageSelection||e.imageId||(t.imageId="Image is required."),e.resourceSummary&&(t.resourceSummary={id:"Cluster is managed"}),t}componentWillReceiveProps(e){this.setState(this.getStateFromProps(e))}render(){var e,t,n;const{app:r,formik:a}=this.props,{errors:s,setFieldValue:i,values:o}=a,{createsNewCluster:u,latestServerGroup:d,namePreview:m}=this.state,p=o.backingData.accounts,g=o.viewState.readOnlyFields||{},h=o.imageId&&"${trigger.properties.imageName}"!==o.imageId,f=[].concat(null==(e=rn.defaults)?void 0:e.subnetType).concat(null==(t=l.defaults)?void 0:t.subnetType).filter((e=>!!e));return mt.createElement("div",{className:"container-fluid form-horizontal"},mt.createElement(te,{app:r,formik:a}),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},"Account"),mt.createElement("div",{className:"col-md-7"},mt.createElement(ne,{value:o.credentials,onChange:e=>this.accountUpdated(e.target.value),readOnly:g.credentials,accounts:p,provider:"titus"}),void 0!==o.credentials&&mt.createElement("div",{className:"small"},"Uses resources from the Amazon account"," ",mt.createElement(Q,{account:o.backingData.credentialsKeyedByAccount[o.credentials]&&o.backingData.credentialsKeyedByAccount[o.credentials].awsAccount})))),mt.createElement(re,{readOnly:g.region,labelColumns:3,component:o,field:"region",account:o.credentials,regions:o.backingData.filtered.regions,onChange:this.regionUpdated}),mt.createElement(c,{application:r,component:o,field:"subnetType",helpKey:"titus.serverGroup.subnet",labelColumns:3,onChange:this.onSubnetChange,region:o.region,subnets:o.backingData.filtered.subnetPurposes,defaultSubnetTypes:f,recommendedSubnetTypes:null==(n=rn.serverGroups)?void 0:n.recommendedSubnets,showSubnetWarning:!0}),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},"Stack ",mt.createElement(ae,{id:"aws.serverGroup.stack"})),mt.createElement("div",{className:"col-md-7"},mt.createElement("input",{type:"text",className:"form-control input-sm no-spel",value:o.stack||"",onChange:e=>this.stackChanged(e.target.value)}))),s.stack&&mt.createElement("div",{className:"form-group row slide-in"},mt.createElement("div",{className:"col-sm-9 col-sm-offset-2 error-message"},mt.createElement("span",null,s.stack))),mt.createElement(se,{app:r,formik:a}),!o.viewState.disableImageSelection&&mt.createElement(xt,{specifyTagByRegex:!1,account:o.credentials,digest:o.digest,imageId:o.imageId,organization:o.organization,registry:o.registry,repository:o.repository,tag:o.tag,showRegistry:!1,deferInitialization:o.deferredInitialization,onChange:this.dockerValuesChanged}),o.viewState.disableImageSelection&&h&&mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"Image")," ",mt.createElement(ae,{id:"titus.deploy.imageId"})),mt.createElement("div",{className:"col-md-7 sp-padding-xs-yaxis"},o.imageId)),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"Entrypoint")),mt.createElement("div",{className:"col-md-7"},mt.createElement(Ot,{type:"text",className:"form-control input-sm no-spel",name:"entryPoint"}))),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},"Traffic ",mt.createElement(ae,{id:"titus.serverGroup.traffic"})),mt.createElement("div",{className:"col-md-7"},mt.createElement("div",{className:"checkbox"},mt.createElement("label",null,mt.createElement("input",{type:"checkbox",checked:o.inService,onChange:e=>i("inService",e.target.checked),disabled:""!==o.strategy&&"custom"!==o.strategy})," ","Send client requests to new instances")))),!o.viewState.disableStrategySelection&&o.selectedProvider&&mt.createElement(ie,{command:o,onFieldChange:this.onStrategyFieldChange,onStrategyChange:this.strategyChanged}),!o.viewState.hideClusterNamePreview&&mt.createElement(oe,{createsNewCluster:u,latestServerGroupName:null==d?void 0:d.name,mode:o.viewState.mode,namePreview:m,navigateToLatestServerGroup:this.navigateToLatestServerGroup}))}}const on=[{label:"Read and Write",value:"RW"},{label:"Read Only",value:"RO"},{label:"Write Only",value:"WO"}];class ln extends mt.Component{validate(e){const t={};return e.resources||(t.resources="CPU is required."),e.resources||(t.resources="Memory is required."),e.resources||(t.resources="Disk is required."),e.resources||(t.resources="Network is required."),t}render(){const{setFieldValue:e,values:t}=this.props.formik;return mt.createElement("div",{className:"clearfix"},mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"CPU(s)")),mt.createElement("div",{className:"col-md-8"},mt.createElement(le,{value:t.resources.cpu,onChange:n=>e("resources",{...t.resources,cpu:n}),required:!0}))),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"Memory (MB)")),mt.createElement("div",{className:"col-md-8"},mt.createElement(le,{value:t.resources.memory,onChange:n=>e("resources",{...t.resources,memory:n}),required:!0}))),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"Disk (MB)")),mt.createElement("div",{className:"col-md-8"},mt.createElement(le,{value:t.resources.disk,onChange:n=>e("resources",{...t.resources,disk:n}),required:!0}))),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"Network (Mbps)"),mt.createElement(ae,{id:"titus.deploy.network"})),mt.createElement("div",{className:"col-md-8"},mt.createElement(le,{value:t.resources.networkMbps,onChange:n=>e("resources",{...t.resources,networkMbps:n}),required:!0}))),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"Gpu"),mt.createElement(ae,{id:"titus.deploy.gpu"})),mt.createElement("div",{className:"col-md-8"},mt.createElement(le,{value:t.resources.gpu,onChange:n=>e("resources",{...t.resources,gpu:n})}))),mt.createElement("hr",null),mt.createElement("h4",null,mt.createElement("b",null,"Elastic File System Options ",mt.createElement(ae,{id:"titus.deploy.efs"}))),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"Mount Permission "),mt.createElement(ae,{id:"titus.deploy.mountPermissions"})),mt.createElement("div",{className:"col-md-8"},mt.createElement(Mt,{value:t.efs.mountPerm,clearable:!1,options:on,onChange:n=>e("efs",{...t.efs,mountPerm:n.value})}))),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"Mount Point "),mt.createElement(ae,{id:"titus.deploy.mountPoint"})),mt.createElement("div",{className:"col-md-8"},mt.createElement("input",{type:"text",className:"form-control input-sm no-spel",value:t.efs.mountPoint,onChange:n=>e("efs",{...t.efs,mountPoint:n.target.value})}))),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"EFS ID "),mt.createElement(ae,{id:"titus.deploy.efsId"})),mt.createElement("div",{className:"col-md-8"},mt.createElement("input",{type:"text",className:"form-control input-sm no-spel",value:t.efs.efsId,onChange:n=>e("efs",{...t.efs,efsId:n.target.value})})),mt.createElement("div",{className:"col-md-offset-3 col-md-8"})),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},mt.createElement("b",null,"EFS Relative Mount Point "),mt.createElement(ae,{id:"titus.deploy.efsRelativeMountPoint"})),mt.createElement("div",{className:"col-md-8"},mt.createElement("input",{type:"text",className:"form-control input-sm no-spel",value:t.efs.efsRelativeMountPoint,onChange:n=>e("efs",{...t.efs,efsRelativeMountPoint:n.target.value})}))))}}function cn(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}function un(e){const{label:t,help:n,input:r,actions:a,validation:s={}}=e,{hidden:i,messageNode:o,category:l}=s,c=!Et(t)||!Et(n);return mt.createElement("div",{className:"TitusMapLayout flex-container-v"},c&&mt.createElement("h4",null,t," ",n),mt.createElement("div",{className:"flex-container-h baseline margin-between-lg TitusMapLayout_Contents"},r," ",a),!i&&mt.createElement(ce,{message:o,type:l}))}cn(".TitusMapLayout_Contents * {\n flex: auto;\n}\n");const dn=["disableIncreaseDesired","disableDecreaseDesired"];cn(".ServerGroupParameters .StandardFieldLayout_Label {\n min-width: 160px;\n}\n");const mn=[{label:"System Default",value:"systemDefault"},{label:"Self Managed",value:"selfManaged"}];function pn(e){const t=kt(dn,Object.keys(e.value)),n=ve(e,(e=>Object.entries(e).filter((([e,t])=>!0===t)).map((([e,t])=>e))),(e=>t.reduce(((t,n)=>(t[n]=e.includes(n),t)),{}))),r=t.map((e=>({label:ye(e),value:e})));return mt.createElement(be,{...n,options:r})}function gn(e){const t=ve(e,(e=>"true"===e),((e,t)=>t.target.checked?"true":"false"));return mt.createElement(Ce,{...t})}const hn=e=>{const{awsAccount:t,setDefaultIamProfile:n,...r}=e;return mt.createElement("div",{className:"flex-container-h baseline margin-between-md"},mt.createElement(me,{...r}),e.value?mt.createElement(mt.Fragment,null,mt.createElement("span",null,"in"),mt.createElement(Q,{account:t})):mt.createElement("button",{className:"link",style:{whiteSpace:"nowrap"},onClick:n},"Apply default value"))};class fn extends mt.Component{constructor(e){super(e)}validate(e){const t=new ue(e);t.field("iamProfile","IAM Instance Profile").required();const n=t.validateForm();return wt(Object.keys(e.constraints.soft),Object.keys(e.constraints.hard)).forEach((e=>{St(n,`constraints.soft.${e}`,`Constraint '${e}' must be either soft or hard, not both.`),St(n,`constraints.hard.${e}`,`Constraint '${e}' must be either soft or hard, not both.`)})),Object.keys(e.env||{}).filter((e=>!e.startsWith("__MapEditorDuplicateKey"))).forEach((e=>{e.match(/^[A-Za-z_].*/)?e.match(/[A-Za-z_][a-zA-Z0-9_]*$/)||St(n,`env.${e}`,"Environment variable names must contain only letter, numbers, or underscores"):St(n,`env.${e}`,"Environment variable names must start with a letter or underscore")})),n}render(){const{app:e}=this.props,{setFieldValue:t,values:n}=this.props.formik,r=()=>t("iamProfile",n.viewState.defaultIamProfile);return mt.createElement("div",{className:"ServerGroupParameters"},mt.createElement(de,{name:"iamProfile",label:"IAM Instance Profile",help:mt.createElement(ae,{id:"titus.deploy.iamProfile"}),input:e=>{var t;return mt.createElement(hn,{...e,awsAccount:null==(t=n.backingData.credentialsKeyedByAccount[n.credentials])?void 0:t.awsAccount,setDefaultIamProfile:r})}}),mt.createElement(de,{name:"capacityGroup",label:"Capacity Group",help:mt.createElement(ae,{id:"titus.deploy.capacityGroup"}),input:e=>mt.createElement(me,{...e})}),mt.createElement(de,{name:"migrationPolicy.type",label:"Migration Policy",help:mt.createElement(ae,{id:"titus.deploy.migrationPolicy"}),input:e=>mt.createElement(pe,{options:mn,...e})}),mt.createElement(de,{name:"serviceJobProcesses",label:"Service Job Processes",input:e=>mt.createElement(pn,{...e})}),mt.createElement(de,{name:"containerAttributes['titusParameter.agent.assignIPv6Address']",label:"Associate IPv6 Address (Recommended)",help:mt.createElement(ae,{id:"serverGroup.ipv6"}),input:e=>mt.createElement(gn,{...e})}),mt.createElement("hr",null),mt.createElement(ge,{value:un},mt.createElement(de,{name:"constraints.soft",label:"Soft Constraints ",help:mt.createElement(ae,{id:"titus.deploy.softConstraints"}),input:e=>mt.createElement(he,{allowEmptyValues:!0,...e})}),mt.createElement(de,{name:"constraints.hard",label:"Hard Constraints",help:mt.createElement(ae,{id:"titus.deploy.hardConstraints"}),input:e=>mt.createElement(he,{allowEmptyValues:!0,...e})}),mt.createElement("hr",null),mt.createElement(de,{name:"labels",label:"Job Attributes",input:e=>mt.createElement(he,{allowEmptyValues:!0,...e})}),mt.createElement(de,{name:"containerAttributes",label:"Container Attributes",input:e=>mt.createElement(he,{allowEmptyValues:!0,...e})}),mt.createElement(de,{name:"env",label:"Environment Variables",input:e=>mt.createElement(he,{allowEmptyValues:!0,...e})})),e.attributes.platformHealthOnlyShowOverride&&mt.createElement(de,{name:"interestingHealthProviderNames",label:"Task Completion",input:e=>mt.createElement(fe,{...e,platformHealthType:"Titus"})}))}}const vn={availabilityPercentageLimit:{percentageOfHealthyContainers:95},ratePercentagePerInterval:{intervalMs:6e5,percentageLimitPerInterval:5},containerHealthProviders:[{name:"eureka"}],timeWindows:[{days:["Monday","Tuesday","Wednesday","Thursday","Friday"],hourlyTimeWindows:[{startHour:10,endHour:16}],timeZone:"PST"}]},yn=e=>{const t=Nt(vn);return e.attributes&&e.attributes.platformHealthOnly&&(t.containerHealthProviders=[]),t};class bn{constructor(e,t,n){this.cacheInitializer=e,this.loadBalancerReader=t,this.securityGroupReader=n}configureZones(e){e.backingData.filtered.regions=e.backingData.credentialsKeyedByAccount[e.credentials].regions}configureSubnets(e){const t={dirty:{}},n=e.backingData.filtered;if(null===e.region)return t;const r=this.getCredentials(e);n.subnetPurposes=bt(e.backingData.subnets).filter({account:r.awsAccount,region:e.region}).reject({target:"elb"}).reject({purpose:null}).uniqBy("purpose").value();const a=e.subnetType||"titus (vpc0)",s=bt(e.backingData.subnets).filter({account:r.awsAccount,region:e.region,purpose:a}).map((e=>e.id)).value();return e.containerAttributes["titusParameter.agent.subnets"]=s.join(","),t}attachEventHandlers(e){e.credentialsChanged=e=>{const t={dirty:{}},n=e.backingData;if(this.configureZones(e),e.credentials){e.registry=n.credentialsKeyedByAccount[e.credentials].registry,n.filtered.regions=n.credentialsKeyedByAccount[e.credentials].regions;const t=n.credentialsKeyedByAccount[e.credentials].accountId;e.containerAttributes["titusParameter.agent.accountId"]=t,n.filtered.regions.some((t=>t.name===e.region))||(e.region=null,e.regionChanged(e))}else e.region=null;return e.viewState.dirty={...e.viewState.dirty||{},...t.dirty},this.configureLoadBalancerOptions(e),this.configureSecurityGroupOptions(e),this.configureSubnets(e),ke(e),t},e.regionChanged=e=>(this.configureLoadBalancerOptions(e),this.configureSecurityGroupOptions(e),this.configureSubnets(e),ke(e),{}),e.clusterChanged=e=>{e.moniker=X.getMoniker(e.application,e.stack,e.freeFormDetails),ke(e)},e.subnetChanged=e=>this.configureSubnets(e)}configureCommand(e){return e.viewState.accountChangedStream=new Ft,e.viewState.regionChangedStream=new Ft,e.viewState.groupsRemovedStream=new Ft,e.viewState.dirty={},e.onStrategyChange=(e,t)=>{""!==t.key&&"custom"!==t.key&&(e.inService=!0)},e.image=e.viewState.imageId,Pt.all([T.getCredentialsKeyedByAccount("titus"),this.securityGroupReader.getAllSecurityGroups(),s.listVpcs(),Ne.listSubnets(),T.getCredentialsKeyedByAccount("aws")]).then((([t,n,r,a,s])=>{var i,o;const l={credentialsKeyedByAccount:t,securityGroups:n,vpcs:r};Object.keys(t).forEach((e=>{const n=t[e].awsAccount,r=s[n].accountId;t[e].accountId=r})),l.credentialsKeyedByAccount=t,e.credentials&&(e.containerAttributes["titusParameter.agent.accountId"]=l.credentialsKeyedByAccount[e.credentials].accountId),l.images=[],l.accounts=Object.keys(t),l.subnets=a,l.filtered={},e.credentials.includes("${")?l.filtered.regions=[{name:e.region}]:l.filtered.regions=null!=(o=null==(i=t[e.credentials])?void 0:i.regions)?o:[],e.backingData=l,l.filtered.securityGroups=this.getRegionalSecurityGroups(e);let c=Pt.when();if(e.securityGroups&&e.securityGroups.length){const t=l.filtered.securityGroups.map((e=>e.id));wt(e.securityGroups,t).length<e.securityGroups.length&&(c=this.refreshSecurityGroups(e,!1))}return Pt.all([this.refreshLoadBalancers(e),c]).then((()=>{this.attachEventHandlers(e)}))}))}getVpcId(e){const t=this.getCredentials(e),n=e.backingData.vpcs.find((n=>n.name===t.awsVpc&&n.account===t.awsAccount&&n.region===this.getRegion(e)&&"aws"===n.cloudProvider));return n?n.id:null}getRegionalSecurityGroups(e){const t=e.backingData.securityGroups[this.getAwsAccount(e)]||{aws:{}};return bt(t.aws[this.getRegion(e)]).filter({vpcId:this.getVpcId(e)}).sortBy("name").value()}configureSecurityGroupOptions(e){const t=e.backingData.filtered.securityGroups;if(e.credentials.includes("${")||e.region&&e.region.includes("${"))e.backingData.filtered.securityGroups=e.securityGroups.map((e=>({name:e,id:e})));else{const n=this.getRegionalSecurityGroups(e),r="string"==typeof e.securityGroups&&e.securityGroups.includes("${");if(t&&e.securityGroups&&!r){const r=e.securityGroups.map((e=>{const n=t.find((t=>t.id===e));return n?n.name:e})),a=e.securityGroups.map((e=>{const n=t.find((t=>t.id===e||t.name===e));return n?n.name:null})).map((e=>n.find((t=>t.name===e)))).filter((e=>e)),s=a.map((e=>e.name)),i=Ct(r,s);e.securityGroups=a.map((e=>e.id)),i.length&&(e.viewState.dirty.securityGroups=i)}e.backingData.filtered.securityGroups=n.sort(((t,n)=>e.securityGroups.includes(t.id)?-1:e.securityGroups.includes(n.id)?1:t.name.localeCompare(n.name)))}}refreshSecurityGroups(e,t){return this.cacheInitializer.refreshCache("securityGroups").then((()=>this.securityGroupReader.getAllSecurityGroups().then((n=>{e.backingData.securityGroups=n,t||this.configureSecurityGroupOptions(e)}))))}getCredentials(e){return e.backingData.credentialsKeyedByAccount[e.credentials]}getAwsAccount(e){return this.getCredentials(e).awsAccount}getRegion(e){return e.region||(e.cluster?e.cluster.region:null)}getTargetGroupNames(e){const t=this.getLoadBalancerMap(e).filter((e=>"classic"!==e.loadBalancerType));return At(t.map((e=>e.targetGroups.filter((e=>"ip"===e.targetType))))).map((e=>e.name)).sort()}getLoadBalancerMap(e){return bt(e.backingData.loadBalancers).map("accounts").flattenDeep().filter({name:this.getAwsAccount(e)}).map("regions").flattenDeep().filter({name:this.getRegion(e)}).map("loadBalancers").flattenDeep().value()}configureLoadBalancerOptions(e){const t=e.targetGroups||[];if(e.credentials.includes("${")||e.region&&e.region.includes("${"))e.targetGroups=t,e.backingData.filtered.targetGroups=t;else{const n=this.getTargetGroupNames(e);if(t&&e.targetGroups){const r=wt(n,t),a=Ct(r,t);e.targetGroups=wt(n,r),a&&a.length>0?e.viewState.dirty.targetGroups=a:delete e.viewState.dirty.targetGroups}e.backingData.filtered.targetGroups=n}}refreshLoadBalancers(e){return this.loadBalancerReader.listLoadBalancers("aws").then((t=>{e.backingData.loadBalancers=t,this.configureLoadBalancerOptions(e)}))}}bn.$inject=["cacheInitializer","loadBalancerReader","securityGroupReader"];t("spinnaker.titus.serverGroup.configure.service",[Ee,we,Se]).service("titusServerGroupConfigurationService",bn);const Cn=[{field:"availabilityPercentageLimit",label:"Availability Percentage Limit",value:0,description:"\n Lets you specify the required percentage of tasks in a healthy state.\n Tasks will not be terminated by the eviction service if this limit would be violated.\n ",defaultValues:vn.availabilityPercentageLimit,fieldComponent:e=>mt.createElement(de,{name:"disruptionBudget.availabilityPercentageLimit.percentageOfHealthyContainers",label:"Percentage of Healthy Containers",input:t=>mt.createElement("div",null,mt.createElement(Ae,{...t,disabled:e.isDisabled}),mt.createElement(ae,{expand:!0,content:"0.0-100.0 (double)"}))})},{field:"relocationLimit",label:"Relocation Limit",value:1,description:"\n Lets you specify the maximum number of times a task can be relocated.\n Should only be used with batch tasks, which have a maximum execution time.\n ",defaultValues:{limit:1},fieldComponent:()=>mt.createElement(de,{name:"disruptionBudget.relocationLimit.limit",label:"Limit",input:e=>mt.createElement("div",null,mt.createElement(Ae,{...e}),mt.createElement(ae,{expand:!0,content:"(tasks)"}))})},{field:"unhealthyTasksLimit",label:"Unhealthy Tasks Limit",value:2,description:"\n Lets you specify the maximum allowed amount of tasks in an unhealthy state.\n Tasks will not be terminated by the eviction service if this limit would be violated.\n ",defaultValues:{limitOfUnhealthyContainers:1},fieldComponent:()=>mt.createElement(de,{name:"disruptionBudget.unhealthyTasksLimit.limitOfUnhealthyContainers",label:"Limit of Unhealthy Containers",input:e=>mt.createElement("div",null,mt.createElement(Ae,{...e}),mt.createElement(ae,{expand:!0,content:"(integer)"}))})},{field:"selfManaged",label:"Self Managed",value:3,description:"\n Requires that you orchestrate custom termination logic.\n If the containers are not terminated within the configured amount of time,\n the system default migration policy is used instead.\n ",defaultValues:{relocationTimeMs:864e5},fieldComponent:()=>mt.createElement(de,{name:"disruptionBudget.selfManaged.relocationTimeMs",label:"Relocation Time",input:e=>mt.createElement("div",null,mt.createElement(Ae,{...e}),mt.createElement(ae,{expand:!0,content:"(milliseconds)"}))})}],En=[{field:"rateUnlimited",label:"Unlimited",value:0,description:"\n No limits on how many containers in a job may be relocated, provided the other disruption budget constraints\n are not violated.\n ",defaultValues:!0},{field:"ratePercentagePerInterval",label:"Rate Percentage Per Interval",value:1,description:"\n Percentage of containers that can be relocated within a time interval.\n ",defaultValues:vn.ratePercentagePerInterval,fieldComponent:e=>mt.createElement(mt.Fragment,null,mt.createElement(de,{name:"disruptionBudget.ratePercentagePerInterval.intervalMs",label:"Interval",input:t=>mt.createElement("div",null,mt.createElement(Ae,{...t,disabled:e.isDisabled}),mt.createElement(ae,{expand:!0,content:"(milliseconds)"}))}),mt.createElement(de,{name:"disruptionBudget.ratePercentagePerInterval.percentageLimitPerInterval",label:"Percentage Per Interval",input:t=>mt.createElement("div",null,mt.createElement(Ae,{...t,disabled:e.isDisabled}),mt.createElement(ae,{expand:!0,content:"0.0-100.0 (double)"}))}))},{field:"ratePerInterval",label:"Rate Per Interval",value:2,description:"\n Limit number of relocations within a given time interval.\n ",defaultValues:{intervalMs:6e4,limitPerInterval:2},fieldComponent:()=>mt.createElement(mt.Fragment,null,mt.createElement(de,{name:"disruptionBudget.ratePerInterval.intervalMs",label:"Interval",input:e=>mt.createElement("div",null,mt.createElement(Ae,{...e}),mt.createElement(ae,{expand:!0,content:"(milliseconds)"}))}),mt.createElement(de,{name:"disruptionBudget.ratePerInterval.limitPerInterval",label:"Limit Per Interval",input:e=>mt.createElement("div",null,mt.createElement(Ae,{...e}),mt.createElement(ae,{expand:!0,content:"(tasks)"}))}))}],wn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];class Sn extends mt.Component{constructor(e){super(e),this.configureNewWindow=()=>{this.setState({addingNewWindow:!0})},this.addNewWindow=e=>{const{values:t,setFieldValue:n}=this.props.formik,{days:r,startHour:a,endHour:s,timeZone:i}=e,o={days:r,hourlyTimeWindows:[{startHour:a,endHour:s}],timeZone:i};n("disruptionBudget.timeWindows",t.disruptionBudget.timeWindows.concat(o)),this.setState({addingNewWindow:!1})},this.CurrentWindows=()=>{const{disruptionBudget:e}=this.props.formik.values,{isDisabled:t}=this.props;if(!e)return null;const{timeWindows:n}=e;return mt.createElement("div",{className:"sp-formItem"},mt.createElement("div",{className:"sp-formItem__left"}),mt.createElement("div",{className:"sp-formItem__right"},n.map(((e,n)=>e.hourlyTimeWindows.map(((r,a)=>mt.createElement("div",{className:"sp-margin-l-yaxis sp-margin-m-right",style:{display:"inline-block"},key:`${n}.${a}`},mt.createElement("div",{key:`${n}.${a}`,className:"horizontal center top sp-padding-m-yaxis sp-padding-s-xaxis",style:{backgroundColor:"var(--color-dovegray)",borderRadius:"4px"}},mt.createElement("div",{className:"sp-padding-m-right",style:{color:"var(--color-text-on-dark)",fontSize:"12px"}},mt.createElement("div",null,mt.createElement("b",null,e.days.map((e=>e.substr(0,3))).join(", "))),mt.createElement("div",null,mt.createElement("em",null,r.startHour,":00 - ",r.endHour,":00 ",e.timeZone))),!t&&mt.createElement("a",{className:"clickable",style:{color:"var(--color-text-on-dark)"},onClick:()=>this.removeWindow(n,a)},mt.createElement("span",{className:"glyphicon glyphicon-remove"}))))))))))},this.NewWindowComponent=()=>this.state.addingNewWindow?mt.createElement(Ge,{initialValues:{days:[],startHour:10,endHour:16,timeZone:yt(this.props.formik.values.disruptionBudget,"timeWindows[0].timeZone","PST")},onSubmit:this.addNewWindow,render:e=>mt.createElement(mt.Fragment,null,mt.createElement(de,{name:"days",label:"Define a New Window",input:e=>mt.createElement(be,{...e,stringOptions:wn})}),mt.createElement(de,{name:"startHour",label:"Start",input:t=>mt.createElement("div",null,mt.createElement(Ae,{...t,min:0,max:e.values.endHour}),mt.createElement(ae,{expand:!0,content:"hour (0-24)"}))}),mt.createElement(de,{name:"endHour",label:"End",input:t=>mt.createElement("div",null,mt.createElement(Ae,{...t,min:e.values.startHour,max:23}),mt.createElement(ae,{expand:!0,content:"hour (0-24)"}))}),mt.createElement(de,{name:"timeZone",label:"Timezone",input:e=>mt.createElement(Te,{...e,clearable:!1,stringOptions:["PST","UTC"]})}),mt.createElement("div",{className:"sp-formItem"},mt.createElement("div",{className:"sp-formItem__left"}),mt.createElement("div",{className:"sp-formItem__right sp-margin-l-bottom"},mt.createElement("button",{className:"primary",type:"submit",onClick:()=>this.addNewWindow(e.values)}," ","Add Window"))))}):mt.createElement("div",{className:"sp-formItem"},mt.createElement("div",{className:"sp-formItem__left"}),mt.createElement("div",{className:"sp-formItem__right sp-margin-l-bottom"},mt.createElement("a",{className:"button primary",onClick:this.configureNewWindow},mt.createElement("i",{className:"fas fa-plus-circle"})," Define New Window"))),this.state={addingNewWindow:!1}}removeWindow(e,t){const{values:n,setFieldValue:r}=this.props.formik,{timeWindows:a}=n.disruptionBudget,s=a[e];if(1===s.hourlyTimeWindows.length)r("disruptionBudget.timeWindows",a.filter((e=>e!==s)));else{const n=s.hourlyTimeWindows[t];r(`disruptionBudget.timeWindows[${e}].hourlyTimeWindows`,s.hourlyTimeWindows.filter((e=>e!==n)))}}render(){const{CurrentWindows:e,NewWindowComponent:t}=this,{isDisabled:n}=this.props;return mt.createElement(mt.Fragment,null,mt.createElement(e,null),!n&&mt.createElement(t,null))}}const kn=()=>mt.createElement("p",null,"The Job Disruption Budget is part of the job descriptor, and defines the behavior of how containers of the job can be relocated."," ",mt.createElement("a",{href:"http://manuals.test.netflix.net/view/titus-docs/mkdocs/master/disruption_budget/",target:"_blank"},"Read the full documentation"));class Nn extends mt.Component{constructor(e){super(e),this.timeWindowOptions=[{field:"timeWindows",label:"Anytime",value:0,defaultValues:void 0},{field:"timeWindows",label:"Specific Time Windows",value:1,defaultValues:vn.timeWindows}],this.toggleUseDefault=()=>{this.state.usingDefault||this.setToDefaultBudget(),this.setState({usingDefault:!this.state.usingDefault})},this.componentDidUpdate=e=>{this.props.onStageChange&&!Gt(e.formik.values.disruptionBudget,this.props.formik.values.disruptionBudget)&&this.props.onStageChange(this.props.formik.values.disruptionBudget)},this.optionTypeChanged=(e,t)=>{t.filter((t=>t!==e)).forEach((e=>this.props.formik.setFieldValue("disruptionBudget."+e.field,void 0))),this.props.formik.setFieldValue("disruptionBudget."+e.field,e.defaultValues)},this.policyTypeChanged=e=>this.optionTypeChanged(e,Cn),this.rateTypeChanged=e=>this.optionTypeChanged(e,En),this.timeWindowsChanged=e=>{this.props.formik.setFieldValue("disruptionBudget."+e.field,e.defaultValues)};const{disruptionBudget:t}=e.formik.values;this.state={usingDefault:!t||Gt(t,yn(e.app))},this.state.usingDefault&&this.setToDefaultBudget()}setToDefaultBudget(){this.props.formik.setFieldValue("disruptionBudget",yn(this.props.app))}getSelectionFromFields(e){const{disruptionBudget:t}=this.props.formik.values;return t?e.find((e=>!!t[e.field])):e[0]}getTimeWindowSelection(){return yt(this.props.formik.values,"disruptionBudget.timeWindows")?this.timeWindowOptions.find((e=>e.defaultValues)):this.timeWindowOptions.find((e=>!e.defaultValues))}toggleHealthProvider(e){const{values:t,setFieldValue:n}=this.props.formik,r=t.disruptionBudget.containerHealthProviders,a=r.find((t=>t.name===e));n("disruptionBudget.containerHealthProviders",a?r.filter((e=>e!==a)):r.concat({name:e}))}render(){var e;const{runJobView:t}=this.props,{usingDefault:n}=this.state,r=this.props.formik.values.disruptionBudget||yn(this.props.app),a=this.getSelectionFromFields(Cn),s=a.fieldComponent,i=this.getSelectionFromFields(En),o=null==i?void 0:i.fieldComponent,l=this.getTimeWindowSelection(),c=(null!=(e=r.containerHealthProviders)?e:[]).map((e=>e.name)),u=!!r.selfManaged,d=!t||t&&!n;return mt.createElement(ge,{value:Ie},mt.createElement("div",{className:"form-horizontal sp-margin-l-xaxis"},!t&&mt.createElement(kn,null),mt.createElement(de,{name:"usingDefault",input:()=>mt.createElement(Ce,{checked:n,onChange:this.toggleUseDefault,text:mt.createElement("b",null,"Use Netflix Defaults")}),layout:t?({input:e})=>mt.createElement(mt.Fragment,null,e):void 0}),d&&mt.createElement("div",{style:{opacity:n?.5:1}},mt.createElement("div",{className:"sp-formGroup"},mt.createElement("div",{className:"groupHeader"},mt.createElement(de,{name:"policyType",label:"Policy",input:e=>mt.createElement("div",null,mt.createElement(De,{...e,menuContainerStyle:{height:"300px"},className:"Select-menu-long",style:{width:"300px"},disabled:n,clearable:!1,onChange:this.policyTypeChanged,value:a,options:Cn}),mt.createElement(ae,{expand:!0,content:"A job policy defines container relocation rules and constraints"}))})),mt.createElement("div",{className:"sp-formItem"},mt.createElement("p",null,a.description)),s&&mt.createElement(s,{isDisabled:n})),!u&&mt.createElement("div",null,mt.createElement("div",{className:""+(r.rateUnlimited?"":"sp-formGroup")},mt.createElement("div",{className:""+(r.rateUnlimited?"":"groupHeader")},mt.createElement(de,{name:"rates",label:"Rates",input:e=>mt.createElement(De,{...e,style:{width:"300px"},disabled:n,clearable:!1,onChange:this.rateTypeChanged,value:i,options:En})})),mt.createElement("div",{className:"sp-formItem"},mt.createElement("p",null,i.description)),o&&mt.createElement(o,{isDisabled:n})),mt.createElement("div",{className:""+(r.timeWindows?"sp-formGroup":"")},mt.createElement("div",{className:""+(r.timeWindows?"groupHeader":"")},mt.createElement(de,{name:"timeWindows",label:"When Can Disruption Occur?",input:e=>mt.createElement(De,{...e,style:{width:"300px"},disabled:n,clearable:!1,onChange:this.timeWindowsChanged,value:l,options:this.timeWindowOptions})})),r.timeWindows&&mt.createElement(Sn,{isDisabled:n,formik:this.props.formik})),mt.createElement(de,{name:"healthProviders",label:"Container Health Provider",input:()=>mt.createElement("div",null,mt.createElement(Ce,{checked:c.includes("eureka"),onChange:()=>this.toggleHealthProvider("eureka"),text:"Discovery",disabled:n}))})))))}}class An extends mt.Component{constructor(e){super(e),this.credentialsKeyedByAccount={},this.defaultIamProfile="",this.state={credentials:[],regions:[],loaded:!1},this.accountChanged=e=>{St(this.props.stage,"account",e),this.stageFieldChanged("credentials",e),this.setRegistry(e),this.updateRegions(e);const t="test"===this.credentialsKeyedByAccount[e].environment?"true":"false";this.associateIPv6AddressChanged(t)},this.dockerChanged=e=>{const{imageId:t,...n}=e;Object.assign(this.props.stage,n),t?this.props.stage.cluster.imageId=t:delete this.props.stage.cluster.imageId,this.props.stageFieldUpdated(),this.forceUpdate()},this.stageFieldChanged=(e,t)=>{St(this.props.stage,e,t),this.props.stageFieldUpdated(),this.forceUpdate()},this.mapChanged=(e,t)=>{this.stageFieldChanged(e,t)},this.groupsChanged=e=>{this.stageFieldChanged("cluster.securityGroups",e),this.forceUpdate()},this.associateIPv6AddressChanged=e=>{const t={...this.props.stage.cluster.containerAttributes||{},"titusParameter.agent.assignIPv6Address":e};this.mapChanged("cluster.containerAttributes",t)},this.disruptionBudgetChanged=e=>{const{stage:t,stageFieldUpdated:n}=this.props;t.cluster.disruptionBudget=e,n()};const{application:t,stage:n}=e;n.cluster=n.cluster||{},n.waitForCompletion=void 0===n.waitForCompletion||n.waitForCompletion,n.cluster.imageId&&!n.cluster.imageId.includes("${")&&Object.assign(n,Dt.splitImageId(n.cluster.imageId)),!n.credentials&&t.defaultCredentials.titus&&(n.credentials=t.defaultCredentials.titus),n.cluster.capacity||(n.cluster.capacity={min:1,max:1,desired:1});const r=rn.defaults.iamProfile||"{{application}}InstanceProfile";this.defaultIamProfile=r.replace("{{application}}",t.name);const a={application:t.name,containerAttributes:{},env:{},labels:{},resources:{cpu:1,disk:1e4,gpu:0,memory:512,networkMbps:128},retries:0,runtimeLimitSecs:3600,securityGroups:[]};n.isNew&&(a.iamProfile=this.defaultIamProfile),Tt(n.cluster,a),n.cloudProvider=n.cloudProvider||"titus",n.deferredInitialization=!0}setRegistry(e){e&&(this.props.stage.registry=this.credentialsKeyedByAccount[e].registry)}updateRegions(e){let t;e?(t=this.credentialsKeyedByAccount[e].regions,t.map((e=>e.name)).every((e=>e!==this.props.stage.cluster.region))&&(delete this.props.stage.cluster.region,this.props.stageFieldUpdated())):t=[],this.setState({regions:t})}componentDidMount(){const{stage:e}=this.props;T.getCredentialsKeyedByAccount("titus").then((t=>{this.credentialsKeyedByAccount=t;const n=Object.keys(t);e.credentials=e.credentials||n[0],this.setRegistry(e.credentials),this.updateRegions(e.credentials),this.setState({credentials:n,loaded:!0});const r="test"===this.credentialsKeyedByAccount[e.credentials].environment&&void 0===e.cluster.containerAttributes["titusParameter.agent.assignIPv6Address"]?"true":"false";this.associateIPv6AddressChanged(r)}))}render(){var e,t;const{application:n,stage:r}=this.props,{credentials:a,loaded:s,regions:i}=this.state,o=(this.credentialsKeyedByAccount[r.credentials]||{awsAccount:""}).awsAccount,l=(null==(e=r.cluster.entryPointList)?void 0:e.length)?r.cluster.entryPointList.join(","):r.cluster.entryPoint,c=(null==(t=r.cluster.cmdList)?void 0:t.length)?r.cluster.cmdList.join(","):r.cluster.cmd;return mt.createElement("div",{className:"form-horizontal"},mt.createElement("div",{className:"form-group"},mt.createElement("label",{className:"col-md-3 sm-label-right"},mt.createElement("span",{className:"label-text"},"Account")),mt.createElement("div",{className:"col-md-5"},mt.createElement(ne,{value:r.credentials,onChange:e=>this.accountChanged(e.target.value),accounts:a,provider:"titus"}),void 0!==r.credentials&&mt.createElement("div",{className:"small"},"Uses resources from the Amazon account ",mt.createElement(Q,{account:o})))),mt.createElement(re,{labelColumns:3,fieldColumns:5,component:r.cluster,field:"region",account:r.credentials,regions:i,onChange:e=>this.stageFieldChanged("region",e)}),mt.createElement(xt,{specifyTagByRegex:!1,account:r.credentials,digest:r.digest,imageId:r.cluster.imageId,organization:r.organization,registry:r.registry,repository:r.repository,tag:r.tag,showRegistry:!1,onChange:this.dockerChanged,deferInitialization:r.deferredInitialization}),mt.createElement(xe,{label:"CPU(s)"},mt.createElement(le,{value:r.cluster.resources.cpu,onChange:e=>this.stageFieldChanged("cluster.resources.cpu",e),required:!0})),mt.createElement(xe,{label:"Memory (MB)"},mt.createElement(le,{onChange:e=>this.stageFieldChanged("cluster.resources.memory",e),value:r.cluster.resources.memory,required:!0})),mt.createElement(xe,{label:"Disk (MB)"},mt.createElement(le,{onChange:e=>this.stageFieldChanged("cluster.resources.disk",e),value:r.cluster.resources.disk,required:!0})),mt.createElement(xe,{label:"Network (Mbps)",helpKey:"titus.deploy.network"},mt.createElement(le,{onChange:e=>this.stageFieldChanged("cluster.resources.networkMbps",e),value:r.cluster.resources.networkMbps,required:!0})),mt.createElement(xe,{label:"GPU(s)",helpKey:"titus.deploy.gpu"},mt.createElement(le,{onChange:e=>this.stageFieldChanged("cluster.resources.gpu",e),value:r.cluster.resources.gpu,required:!0})),mt.createElement(xe,{label:"Entrypoint(s)",helpKey:"titus.deploy.entrypoint"},mt.createElement("input",{type:"text",className:"form-control input-sm",value:l,onChange:e=>this.stageFieldChanged("cluster.entryPointList",e.target.value.split(","))})),mt.createElement(xe,{label:"Command(s)",helpKey:"titus.deploy.command"},mt.createElement("input",{type:"text",className:"form-control input-sm",value:c,onChange:e=>this.stageFieldChanged("cluster.cmdList",e.target.value.split(","))})),mt.createElement(xe,{label:"Runtime Limit (Seconds)",helpKey:"titus.deploy.runtimeLimitSecs"},mt.createElement(le,{value:r.cluster.runtimeLimitSecs,onChange:e=>this.stageFieldChanged("cluster.runtimeLimitSecs",e),min:1,required:!0})),mt.createElement(xe,{label:"Retries",helpKey:"titus.deploy.retries"},mt.createElement(le,{onChange:e=>this.stageFieldChanged("cluster.retries",e),value:r.cluster.retries,min:0,required:!0})),mt.createElement(xe,{label:"Property File",helpKey:"titus.deploy.propertyFile"},mt.createElement("input",{type:"text",className:"form-control input-sm",onChange:e=>this.stageFieldChanged("propertyFile",e.target.value),value:r.propertyFile})),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-9 col-md-offset-1"},mt.createElement("div",{className:"checkbox"},mt.createElement("label",null,mt.createElement("input",{type:"checkbox",checked:r.showAdvancedOptions,onChange:e=>this.stageFieldChanged("showAdvancedOptions",e.target.checked)}),mt.createElement("strong",null,"Show Advanced Options"))))),mt.createElement("div",{className:""+(!0===r.showAdvancedOptions?"collapse.in":"collapse")},mt.createElement("div",{className:"form-group"},mt.createElement("label",{className:"col-md-3 sm-label-right"},mt.createElement("span",{className:"label-text"},"IAM Instance Profile")," ",mt.createElement(ae,{id:"titus.deploy.iamProfile"})),mt.createElement("div",{className:"col-md-4"},mt.createElement("input",{type:"text",className:"form-control input-sm",value:r.cluster.iamProfile,placeholder:this.defaultIamProfile,required:!0,onChange:e=>this.stageFieldChanged("cluster.iamProfile",e.target.value)}),!r.isNew&&!r.cluster.iamProfile&&mt.createElement("a",{className:"small clickable",onClick:()=>this.stageFieldChanged("cluster.iamProfile",this.defaultIamProfile)},"Use suggested default")),mt.createElement("div",{className:"col-md-1 small",style:{whiteSpace:"nowrap",paddingLeft:"0px",paddingTop:"7px"}},"in ",mt.createElement(Q,{account:o}))),mt.createElement(xe,{label:"Capacity Group",fieldColumns:4,helpKey:"titus.job.capacityGroup"},mt.createElement("input",{type:"text",className:"form-control input-sm",value:r.cluster.capacityGroup||"",onChange:e=>this.stageFieldChanged("cluster.capacityGroup",e.target.value)})),mt.createElement(xe,{label:D.get("Firewalls"),helpKey:"titus.job.securityGroups"},(!r.credentials||!r.cluster.region)&&mt.createElement("div",null,"Account and region must be selected before ",D.get("firewalls")," can be added"),s&&r.credentials&&r.cluster.region&&mt.createElement(nn,{account:r.credentials,region:r.cluster.region,command:r,amazonAccount:o,hideLabel:!0,groupsToEdit:r.cluster.securityGroups,onChange:this.groupsChanged})),mt.createElement(xe,{label:"Associate IPv6 Address (Recommended)",helpKey:"serverGroup.ipv6"},mt.createElement(gn,{value:r.cluster.containerAttributes["titusParameter.agent.assignIPv6Address"],onChange:e=>this.associateIPv6AddressChanged(e.target.value)})),mt.createElement(xe,{label:"Disruption Budget",helpKey:"titus.disruptionbudget.description"},mt.createElement(Ge,{initialValues:r.cluster,onSubmit:()=>{},render:e=>mt.createElement(Nn,{formik:e,app:n,runJobView:!0,onStageChange:this.disruptionBudgetChanged})})),mt.createElement(xe,{label:"Job Attributes (optional)"},mt.createElement(Pe,{model:r.cluster.labels,allowEmpty:!0,onChange:e=>this.mapChanged("cluster.labels",e)})),mt.createElement(xe,{label:"Container Attributes (optional)"},mt.createElement(Pe,{model:r.cluster.containerAttributes,allowEmpty:!0,onChange:e=>this.mapChanged("cluster.containerAttributes",e)})),mt.createElement(xe,{label:"Environment Variables (optional)"},mt.createElement(Pe,{model:r.cluster.env,allowEmpty:!0,onChange:e=>this.mapChanged("cluster.env",e)}))),mt.createElement(xe,{label:"Wait for results",helpKey:"titus.job.waitForCompletion"},mt.createElement("input",{type:"checkbox",className:"input-sm",name:"waitForCompletion",checked:r.waitForCompletion,onChange:e=>this.stageFieldChanged("waitForCompletion",e.target.checked)})))}}J.pipeline.registerStage({provides:"runJob",useBaseProvider:!0,restartable:!0,key:"runJob",cloudProvider:"titus",providesFor:["aws","titus"],component:An,executionDetailsSections:[tn,Oe],accountExtractor:e=>[e.context.credentials],configAccountExtractor:e=>[e.credentials],supportsCustomTimeout:!0,validators:[{type:"requiredField",fieldName:"cluster.iamProfile"},{type:"requiredField",fieldName:"cluster.imageId"},{type:"requiredField",fieldName:"credentials"},{type:"requiredField",fieldName:"cluster.region"},{type:"requiredField",fieldName:"cluster.resources.cpu"},{type:"requiredField",fieldName:"cluster.resources.gpu"},{type:"requiredField",fieldName:"cluster.resources.memory"},{type:"requiredField",fieldName:"cluster.resources.disk"},{type:"requiredField",fieldName:"cluster.runtimeLimitSecs"}]});t("spinnaker.titus.pipeline.stage.scaleDownClusterStage",[]).config((function(){J.pipeline.registerStage({provides:"scaleDownCluster",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/scaleDownCluster/scaleDownClusterStage.html",executionConfigSections:["scaleDownClusterConfig","taskStatus"],accountExtractor:e=>[e.context.credentials],configAccountExtractor:e=>[e.credentials],validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"remainingFullSizeServerGroups",fieldLabel:"Keep [X] full size Server Groups"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}],strategy:!0})})).controller("titusScaleDownClusterStageCtrl",["$scope",function(e){const t=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),t.regions=t.regions||[],t.cloudProvider="titus",!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),!t.regions.length&&e.application.defaultRegions.titus&&t.regions.push(e.application.defaultRegions.titus),void 0===t.remainingFullSizeServerGroups&&(t.remainingFullSizeServerGroups=1),void 0===t.allowScaleDownActive&&(t.allowScaleDownActive=!1),this.pluralize=function(e,t){return 1===t?e:e+"s"},void 0===t.preferLargerOverNewer&&(t.preferLargerOverNewer="false"),t.preferLargerOverNewer=t.preferLargerOverNewer.toString()}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/scaleDownCluster/scaleDownClusterStage.html",'<div ng-controller="titusScaleDownClusterStageCtrl as scaleDownClusterStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Scale Down Options">\n <div class="form-inline">\n <p>\n Keep the\n <input\n type="number"\n min="0"\n required\n ng-model="stage.remainingFullSizeServerGroups"\n class="form-control input-sm"\n style="width: 50px"\n />\n <select class="form-control input-sm" ng-model="stage.preferLargerOverNewer" style="width: 100px">\n <option value="true">largest</option>\n <option value="false">newest</option>\n </select>\n {{scaleDownClusterStageCtrl.pluralize(\'server group\', stage.remainingFullSizeServerGroups)}} at current size.\n </p>\n <p>The remaining server groups will be scaled down to zero instances.</p>\n </div>\n </stage-config-field>\n <div class="form-group">\n <div class="col-md-offset-3 col-md-6 checkbox">\n <label>\n <input type="checkbox" ng-model="stage.allowScaleDownActive" />\n Allow scale down of active server groups\n </label>\n </div>\n </div>\n</div>\n')}]);t("spinnaker.titus.pipeline.stage.shrinkClusterStage",[]).config((function(){J.pipeline.registerStage({provides:"shrinkCluster",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/shrinkCluster/shrinkClusterStage.html",accountExtractor:e=>[e.context.credentials],configAccountExtractor:e=>[e.credentials],validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"shrinkToSize",fieldLabel:"shrink to [X] Server Groups"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusShrinkClusterStageCtrl",["$scope",function(e){const t=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),t.regions=t.regions||[],t.cloudProvider="titus",!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),!t.regions.length&&e.application.defaultRegions.titus&&t.regions.push(e.application.defaultRegions.titus),void 0===t.shrinkToSize&&(t.shrinkToSize=1),void 0===t.allowDeleteActive&&(t.allowDeleteActive=!1),this.pluralize=function(e,t){return 1===t?e:e+"s"},void 0===t.retainLargerOverNewer&&(t.retainLargerOverNewer="false"),t.retainLargerOverNewer=t.retainLargerOverNewer.toString()}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/shrinkCluster/shrinkClusterStage.html",'<div ng-controller="titusShrinkClusterStageCtrl as shrinkClusterStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Shrink Options">\n <div class="form-inline">\n Shrink to\n <input\n type="number"\n min="0"\n required\n ng-model="stage.shrinkToSize"\n class="form-control input-sm"\n style="width: 50px"\n />\n {{shrinkClusterStageCtrl.pluralize(\'server group\', stage.shrinkToSize)}}, keeping the\n <select class="form-control input-sm" ng-model="stage.retainLargerOverNewer" style="width: 100px">\n <option value="true">largest</option>\n <option value="false">newest</option>\n </select>\n </div>\n </stage-config-field>\n <div class="form-group">\n <div class="col-md-offset-3 col-md-6 checkbox">\n <label>\n <input type="checkbox" ng-model="stage.allowDeleteActive" />\n Allow deletion of active server groups\n </label>\n </div>\n </div>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n</div>\n')}]);t("spinnaker.titus.react",[]).run(["$injector",function(e){Zt.initialize(e)}]);t("spinnaker.titus.securityGroup.reader",[]).factory("titusSecurityGroupReader",(function(){return{resolveIndexedSecurityGroup:function(e,t,n){return e[t.awsAccount][t.region][n]}}}));e.module("spinnaker.titus.serverGroupCommandBuilder.service",[]).factory("titusServerGroupCommandBuilder",["$q",function(t){function n(e){return(rn.defaults.iamProfile||"{{application}}InstanceProfile").replace("{{application}}",e.name)}function r(e,r){const a=(r=r||{}).account||rn.defaults.account,s=r.region||rn.defaults.region,i=r.zone||rn.defaults.zone,o=n(e),l={application:e.name,credentials:a,region:s,zone:i,network:"default",inService:!0,resources:{cpu:1,networkMbps:128,disk:1e4,memory:512,gpu:0},efs:{mountPerm:"RW"},strategy:"",capacity:{min:1,max:1,desired:1},targetHealthyDeployPercentage:100,env:{},labels:{},containerAttributes:{"titusParameter.agent.assignIPv6Address":"true"},cloudProvider:"titus",selectedProvider:"titus",iamProfile:o,constraints:{hard:{},soft:{}},serviceJobProcesses:{},viewState:{defaultIamProfile:o,useSimpleCapacity:!0,usePreferredZones:!0,mode:r.mode||"create"},securityGroups:[],imageId:r.imageId,migrationPolicy:{type:"systemDefault"},digest:"",organization:"",tag:"",registry:"",repository:""};return t.when(l)}return{buildNewServerGroupCommand:r,buildNewServerGroupCommandForPipeline:function(){return t.when({viewState:{requiresTemplateSelection:!0}})},buildServerGroupCommandFromExisting:function(e,r,a){a=a||"clone";const s=X.parseServerGroupName(r.name),i="test"===r.awsAccount,o=r.containerAttributes&&void 0!==r.containerAttributes["titusParameter.agent.assignIPv6Address"]?r.containerAttributes["titusParameter.agent.assignIPv6Address"]:i?"true":"false",l={...r.containerAttributes,"titusParameter.agent.assignIPv6Address":o},c={application:e.name,disruptionBudget:r.disruptionBudget,strategy:"",stack:s.stack,freeFormDetails:s.freeFormDetails,account:r.account,credentials:r.account,region:r.region,env:r.env,labels:r.labels,containerAttributes:l,entryPoint:r.entryPoint,iamProfile:r.iamProfile,capacityGroup:r.capacityGroup,migrationPolicy:r.migrationPolicy?r.migrationPolicy:{type:"systemDefault"},securityGroups:r.securityGroups||[],constraints:{hard:r.constraints&&r.constraints.hard||{},soft:r.constraints&&r.constraints.soft||{}},serviceJobProcesses:Object.assign({},r.serviceJobProcesses),inService:!r.disabled,source:{account:r.account,region:r.region,asgName:r.name},resources:{cpu:r.resources.cpu,gpu:r.resources.gpu,memory:r.resources.memory,disk:r.resources.disk,networkMbps:r.resources.networkMbps},targetGroups:r.targetGroups,capacity:{min:r.capacity.min,max:r.capacity.max,desired:r.capacity.desired},targetHealthyDeployPercentage:100,cloudProvider:"titus",selectedProvider:"titus",viewState:{defaultIamProfile:n(e),useSimpleCapacity:r.capacity.min===r.capacity.max,mode:a},organization:"",tag:"",digest:"",registry:"",repository:""};return r.efs?c.efs={mountPoint:r.efs.mountPoint,mountPerm:r.efs.mountPerm,efsId:r.efs.efsId}:c.efs={mountPerm:"RW"},"editPipeline"!==a&&(c.imageId=r.image.dockerImageName+":"+(r.image.dockerImageVersion?r.image.dockerImageVersion:r.image.dockerImageDigest)),t.when(c)},buildServerGroupCommandFromPipeline:function(t,a){const s=Nt(a),i={account:s.account,imageId:s.imageId,region:s.region};return r(t,i).then((function(r){r.constraints={hard:a.constraints&&a.constraints.hard||a.hardConstraints&&a.hardConstraints.reduce(((e,t)=>St(e,t,"true")),{})||{},soft:a.constraints&&a.constraints.soft||a.softConstraints&&a.softConstraints.reduce(((e,t)=>St(e,t,"true")),{})||{}},delete s.hardConstraints,delete s.softConstraints;const i={disableImageSelection:!0,useSimpleCapacity:a.capacity.min===a.capacity.max,mode:"editPipeline",submitButtonLabel:"Done",defaultIamProfile:n(t)},o={region:s.region,credentials:s.account,iamProfile:s.iamProfile,viewState:i};s.strategy=s.strategy||"";return e.extend({},r,s,o)}))}}}]);t("spinnaker.serverGroup.configure.titus",["spinnaker.titus.serverGroup.configure.service"]);const Gn=class extends mt.Component{constructor(e){super(e),this._isUnmounted=!1,this.templateSelected=()=>{this.setState({requiresTemplateSelection:!1}),this.configureCommand()},this.onTaskComplete=()=>{this.props.application.serverGroups.refresh(),this.props.application.serverGroups.onNextRefresh(null,this.onApplicationRefresh)},this.onApplicationRefresh=()=>{if(this._isUnmounted)return;const{command:e}=this.props,{taskMonitor:t}=this.state,n=t.task.execution.stages.find((e=>"cloneServerGroup"===e.type));if(n&&n.context["deploy.server.groups"]){const t=n.context["deploy.server.groups"][e.region];if(t){const n={serverGroup:t,accountId:e.credentials,region:e.region,provider:"titus"};let r="^.^.^.clusters.serverGroup";I.$state.includes("**.clusters.serverGroup")&&(r="^.serverGroup"),I.$state.includes("**.clusters.cluster.serverGroup")&&(r="^.^.serverGroup"),I.$state.includes("**.clusters")&&(r=".serverGroup"),I.$state.go(r,n)}}},this.configureCommand=()=>{const{command:e}=this.props;Zt.titusServerGroupConfigurationService.configureCommand(e).then((()=>{Zt.titusServerGroupConfigurationService.configureSubnets(e),e.credentials.includes("${")||(e.registry=(e.backingData.credentialsKeyedByAccount[e.credentials]||{}).registry),this.setState({loaded:!0,requiresTemplateSelection:!1})}))},this.submit=e=>{const t="editPipeline"===e.viewState.mode||"createPipeline"===e.viewState.mode;let n=e;e.disruptionBudget.timeWindows&&!e.disruptionBudget.timeWindows.length&&delete e.disruptionBudget.timeWindows,Gt(yn(this.props.application),e.disruptionBudget)&&(n={...e,disruptionBudget:void 0}),t?this.props.closeModal&&this.props.closeModal(n):this.state.taskMonitor.submit((()=>I.serverGroupWriter.cloneServerGroup(n,this.props.application)))},this.getLoadBalancerNote=e=>mt.createElement("div",{className:"form-group small",style:{marginTop:"20px"}},mt.createElement("div",{className:"col-md-8 col-md-offset-3"},mt.createElement("p",null,"Only target groups with target type ",mt.createElement("em",null,"ip")," are supported in Titus. It is not possible to re-use target groups of target type ",mt.createElement("em",null,"instance")," used by Amazon instances."," "),void 0!==e.backingData&&void 0!==e.backingData.credentialsKeyedByAccount&&void 0!==e.credentials&&mt.createElement("p",null,"Uses target groups from the Amazon account"," ",mt.createElement(Q,{account:e.backingData.credentialsKeyedByAccount[e.credentials]&&e.backingData.credentialsKeyedByAccount[e.credentials].awsAccount})))),this.getSecurityGroupNote=e=>{const t=e.backingData&&e.backingData.credentialsKeyedByAccount&&e.backingData.credentialsKeyedByAccount[e.credentials]&&e.backingData.credentialsKeyedByAccount[e.credentials].awsAccount;return t&&void 0!==e.credentials?mt.createElement("div",{className:"form-group small"},mt.createElement("div",{className:"col-md-9 col-md-offset-3"},"Uses ",D.get("firewalls")," from the Amazon account ",mt.createElement(Q,{account:t}))):null};const t=yt(e,"command.viewState.requiresTemplateSelection",!1);t||this.configureCommand(),this.state={firewallsLabel:D.get("Firewalls"),loaded:!1,requiresTemplateSelection:t,taskMonitor:new Le({application:e.application,title:"Creating your server group",modalInstance:Le.modalInstanceEmulation((()=>this.props.dismissModal())),onTaskComplete:this.onTaskComplete})}}static show(e){return Me.show(Gn,e,{dialogClassName:"wizard-modal modal-lg"})}componentWillUnmount(){this._isUnmounted=!0,this.refreshUnsubscribe&&this.refreshUnsubscribe()}render(){const{application:e,command:t,dismissModal:n,title:r}=this.props,{loaded:a,taskMonitor:s,requiresTemplateSelection:i}=this.state;return i?mt.createElement(Fe,{application:e,cloudProvider:"titus",command:t,onDismiss:n,onTemplateSelected:this.templateSelected}):mt.createElement(ze,{heading:r,initialValues:t,loading:!a,taskMonitor:s,dismissModal:n,closeModal:this.submit,submitButtonLabel:t.viewState.submitButtonLabel,render:({formik:t,nextIdx:n,wizard:r})=>mt.createElement(mt.Fragment,null,mt.createElement(je,{label:"Basic Settings",wizard:r,order:n(),render:({innerRef:n})=>mt.createElement(sn,{ref:n,formik:t,app:e})}),mt.createElement(je,{label:"Resources",wizard:r,order:n(),render:({innerRef:e})=>mt.createElement(ln,{ref:e,formik:t})}),mt.createElement(je,{label:"Capacity",wizard:r,order:n(),render:({innerRef:e})=>mt.createElement(u,{ref:e,formik:t})}),mt.createElement(je,{label:"Load Balancers",wizard:r,order:n(),note:this.getLoadBalancerNote(t.values),render:({innerRef:e})=>mt.createElement(d,{ref:e,formik:t,hideLoadBalancers:!0,targetGroupTypeHelpText:"ip"})}),mt.createElement(je,{label:D.get("Firewalls"),wizard:r,order:n(),note:this.getSecurityGroupNote(t.values),render:({innerRef:e})=>mt.createElement(m,{ref:e,formik:t})}),mt.createElement(je,{label:"Job Disruption Budget",wizard:r,order:n(),render:({innerRef:n})=>mt.createElement(Nn,{ref:n,formik:t,app:e})}),mt.createElement(je,{label:"Advanced Settings",wizard:r,order:n(),render:({innerRef:n})=>mt.createElement(fn,{ref:n,formik:t,app:e})}))})}};let Tn=Gn;Tn.defaultProps={closeModal:Be,dismissModal:Be};const{useState:In,useEffect:Dn,useMemo:xn}=mt;function Pn(e){const t=e.errors.capacity||{},{min:n,max:r,desired:a}=t;return[n,r,a].find((e=>!!e))}function On({formik:e,serverGroup:t,toggleMode:n}){Dn((()=>{e.setFieldValue("capacity.min",e.values.capacity.desired),e.setFieldValue("capacity.max",e.values.capacity.desired)}),[e.values.capacity.desired]);const r=Pn(e);return mt.createElement("div",null,mt.createElement("p",null,"Sets min, max, and desired instance counts to the same value."),mt.createElement("p",null,"To allow autoscaling, use the"," ",mt.createElement("a",{className:"clickable",onClick:n},"Advanced Mode"),"."),mt.createElement("div",{className:"form-group row"},mt.createElement("div",{className:"col-md-3 sm-label-right"},"Current size"),mt.createElement("div",{className:"col-md-4"},mt.createElement("div",{className:"horizontal middle"},mt.createElement("input",{type:"number",className:"NumberInput form-control",value:t.capacity.desired,disabled:!0}),mt.createElement("div",{className:"sp-padding-xs-xaxis"},"instances")))),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},"Resize to"),mt.createElement("div",{className:"col-md-4"},mt.createElement("div",{className:"horizontal middle"},mt.createElement(de,{name:"capacity.desired",input:e=>mt.createElement(Ae,{...e,min:0}),layout:({input:e})=>mt.createElement(mt.Fragment,null,e),touched:!0,onChange:()=>{}}),mt.createElement("div",{className:"sp-padding-xs-xaxis"},"instances")))),!!r&&mt.createElement("div",{className:"col-md-offset-3 col-md-9"},mt.createElement(ce,{message:r,type:"error"})),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},"Changes"),mt.createElement("div",{className:"col-md-9 sm-control-field"},mt.createElement(Ze,{current:t.capacity,next:e.values.capacity}))))}function Ln({formik:e,serverGroup:t,toggleMode:n}){const{min:r,max:a}=e.values.capacity||{},s=({value:e})=>mt.createElement("div",{className:"col-md-2"},mt.createElement("input",{className:"NumberInput form-control",type:"number",disabled:!0,value:e})),i=Pn(e);return mt.createElement("div",null,mt.createElement("p",null,"Sets up auto-scaling for this server group."),mt.createElement("p",null,"To disable auto-scaling, use the"," ",mt.createElement("a",{className:"clickable",onClick:n},"Simple Mode"),"."),mt.createElement("div",{className:"form-group bold"},mt.createElement("div",{className:"col-md-2 col-md-offset-3"},"Min"),mt.createElement("div",{className:"col-md-2"},"Max"),mt.createElement("div",{className:"col-md-2"},"Desired")),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},"Current"),mt.createElement(s,{value:t.capacity.min}),mt.createElement(s,{value:t.capacity.max}),mt.createElement(s,{value:t.capacity.desired})),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},"Resize to"),mt.createElement("div",{className:"col-md-2"},mt.createElement(de,{name:"capacity.min",input:e=>mt.createElement(Ae,{...e,min:0,max:a}),layout:({input:e})=>mt.createElement(mt.Fragment,null,e),touched:!0})),mt.createElement("div",{className:"col-md-2"},mt.createElement(de,{name:"capacity.max",input:e=>mt.createElement(Ae,{...e,min:r}),layout:({input:e})=>mt.createElement(mt.Fragment,null,e),touched:!0})),mt.createElement("div",{className:"col-md-2"},mt.createElement(de,{name:"capacity.desired",input:e=>mt.createElement(Ae,{...e,min:r,max:a}),layout:({input:e})=>mt.createElement(mt.Fragment,null,e),touched:!0}))),!!i&&mt.createElement("div",{className:"col-md-offset-3 col-md-9"},mt.createElement(ce,{message:i,type:"error"})),mt.createElement("div",{className:"form-group"},mt.createElement("div",{className:"col-md-3 sm-label-right"},"Changes"),mt.createElement("div",{className:"col-md-9 sm-control-field"},mt.createElement(Ze,{current:t.capacity,next:e.values.capacity}))))}function Mn(e){const{min:t,max:n,desired:r}=e.capacity,a={};return t>n?a.min=a.max="Min cannot be larger than Max":r<t?a.desired=a.min="Desired cannot be smaller than Min":r>n&&(a.desired=a.max="Desired cannot be larger than Max"),Object.keys(a).length?{capacity:a}:{}}function Fn(e){const{serverGroup:t,application:n,dismissModal:r}=e,a=xn((()=>{const{min:e,max:n,desired:r}=t.capacity;return r!==n||r!==e}),[]),[s,i]=In(a),o=n.attributes&&n.attributes.platformHealthOnlyShowOverride,[l,c]=In(),u=((e,t)=>{const n=Le.modalInstanceEmulation((()=>t()));return pt((()=>new Le({modalInstance:n,...e})),[e.application,e.title])})({application:n,title:`Resizing ${t.name}`,onTaskComplete:()=>n.getDataSource("serverGroups").refresh(!0)},r),d=e=>u.submit((()=>I.serverGroupWriter.resizeServerGroup(t,n,e))),m={capacity:t.capacity};return mt.createElement(mt.Fragment,null,mt.createElement(Re,{monitor:u}),mt.createElement(Ge,{initialValues:m,validate:Mn,onSubmit:d,render:e=>mt.createElement(mt.Fragment,null,mt.createElement(Ve,{dismiss:r}),mt.createElement(zt.Header,null,mt.createElement(zt.Title,null,"Resize ",t.name)),mt.createElement(zt.Body,null,mt.createElement(Lt,{className:"form-horizontal"},s?mt.createElement(Ln,{formik:e,serverGroup:t,toggleMode:()=>i(!1)}):mt.createElement(On,{formik:e,serverGroup:t,toggleMode:()=>i(!0)}),o&&mt.createElement(We,{interestingHealthProviderNames:e.values.interestingHealthProviderNames,platformHealthType:"Titus",showHelpDetails:!0,onChange:t=>e.setFieldValue("interestingHealthProviderNames",t||void 0)}))),mt.createElement(zt.Footer,null,mt.createElement(He,{account:t.account,onValidChange:c}),mt.createElement("button",{className:"btn btn-default",onClick:r},"Cancel"),mt.createElement("button",{type:"submit",disabled:!l||!e.isValid,className:"btn btn-primary",onClick:()=>d(e.values)},"Submit")))}))}class zn extends Error{}class jn extends zn{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Bn extends zn{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Rn extends zn{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Vn extends zn{}class Wn extends zn{constructor(e){super(`Invalid unit ${e}`)}}class Hn extends zn{}class Zn extends zn{constructor(){super("Zone is an abstract class")}}const Un="numeric",qn="short",Jn="long",Kn={year:Un,month:Un,day:Un},Xn={year:Un,month:qn,day:Un},Yn={year:Un,month:Jn,day:Un},Qn={year:Un,month:Jn,day:Un,weekday:Jn},$n={hour:Un,minute:Un},_n={hour:Un,minute:Un,second:Un},er={hour:Un,minute:Un,second:Un,timeZoneName:qn},tr={hour:Un,minute:Un,second:Un,timeZoneName:Jn},nr={hour:Un,minute:Un,hour12:!1},rr={hour:Un,minute:Un,second:Un,hour12:!1},ar={hour:Un,minute:Un,second:Un,hour12:!1,timeZoneName:qn},sr={hour:Un,minute:Un,second:Un,hour12:!1,timeZoneName:Jn},ir={year:Un,month:Un,day:Un,hour:Un,minute:Un},or={year:Un,month:Un,day:Un,hour:Un,minute:Un,second:Un},lr={year:Un,month:qn,day:Un,hour:Un,minute:Un},cr={year:Un,month:qn,day:Un,hour:Un,minute:Un,second:Un},ur={year:Un,month:qn,day:Un,weekday:qn,hour:Un,minute:Un},dr={year:Un,month:Jn,day:Un,hour:Un,minute:Un,timeZoneName:qn},mr={year:Un,month:Jn,day:Un,hour:Un,minute:Un,second:Un,timeZoneName:qn},pr={year:Un,month:Jn,day:Un,weekday:Jn,hour:Un,minute:Un,timeZoneName:Jn},gr={year:Un,month:Jn,day:Un,weekday:Jn,hour:Un,minute:Un,second:Un,timeZoneName:Jn};function hr(e){return void 0===e}function fr(e){return"number"==typeof e}function vr(e){return"number"==typeof e&&e%1==0}function yr(){try{return"undefined"!=typeof Intl&&Intl.DateTimeFormat}catch(e){return!1}}function br(){return!hr(Intl.DateTimeFormat.prototype.formatToParts)}function Cr(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function Er(e,t,n){if(0!==e.length)return e.reduce(((e,r)=>{const a=[t(r),r];return e&&n(e[0],a[0])===e[0]?e:a}),null)[1]}function wr(e,t){return t.reduce(((t,n)=>(t[n]=e[n],t)),{})}function Sr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function kr(e,t,n){return vr(e)&&e>=t&&e<=n}function Nr(e,t=2){return e.toString().length<t?("0".repeat(t)+e).slice(-t):e.toString()}function Ar(e){return hr(e)||null===e||""===e?void 0:parseInt(e,10)}function Gr(e){if(!hr(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function Tr(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function Ir(e){return e%4==0&&(e%100!=0||e%400==0)}function Dr(e){return Ir(e)?366:365}function xr(e,t){const n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?Ir(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Pr(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function Or(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return 4===t||3===r?53:52}function Lr(e){return e>99?e:e>60?1900+e:2e3+e}function Mr(e,t,n,r=null){const a=new Date(e),s={hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(s.timeZone=r);const i=Object.assign({timeZoneName:t},s),o=yr();if(o&&br()){const e=new Intl.DateTimeFormat(n,i).formatToParts(a).find((e=>"timezonename"===e.type.toLowerCase()));return e?e.value:null}if(o){const e=new Intl.DateTimeFormat(n,s).format(a);return new Intl.DateTimeFormat(n,i).format(a).substring(e.length).replace(/^[, \u200e]+/,"")}return null}function Fr(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-r:r)}function zr(e){const t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new Hn(`Invalid unit value ${e}`);return t}function jr(e,t,n){const r={};for(const a in e)if(Sr(e,a)){if(n.indexOf(a)>=0)continue;const s=e[a];if(null==s)continue;r[t(a)]=zr(s)}return r}function Br(e,t){const n=Math.trunc(e/60),r=Math.abs(e%60),a=n>=0&&!Object.is(n,-0)?"+":"-",s=`${a}${Math.abs(n)}`;switch(t){case"short":return`${a}${Nr(Math.abs(n),2)}:${Nr(r,2)}`;case"narrow":return r>0?`${s}:${r}`:s;case"techie":return`${a}${Nr(Math.abs(n),2)}${Nr(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Rr(e){return wr(e,["hour","minute","second","millisecond"])}const Vr=/[A-Za-z_+-]{1,256}(:?\/[A-Za-z_+-]{1,256}(\/[A-Za-z_+-]{1,256})?)?/;function Wr(e){return JSON.stringify(e,Object.keys(e).sort())}const Hr=["January","February","March","April","May","June","July","August","September","October","November","December"],Zr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ur=["J","F","M","A","M","J","J","A","S","O","N","D"];function qr(e){switch(e){case"narrow":return Ur;case"short":return Zr;case"long":return Hr;case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Jr=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Kr=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Xr=["M","T","W","T","F","S","S"];function Yr(e){switch(e){case"narrow":return Xr;case"short":return Kr;case"long":return Jr;case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Qr=["AM","PM"],$r=["Before Christ","Anno Domini"],_r=["BC","AD"],ea=["B","A"];function ta(e){switch(e){case"narrow":return ea;case"short":return _r;case"long":return $r;default:return null}}function na(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const ra={D:Kn,DD:Xn,DDD:Yn,DDDD:Qn,t:$n,tt:_n,ttt:er,tttt:tr,T:nr,TT:rr,TTT:ar,TTTT:sr,f:ir,ff:lr,fff:dr,ffff:pr,F:or,FF:cr,FFF:mr,FFFF:gr};class aa{static create(e,t={}){return new aa(e,t)}static parseFormat(e){let t=null,n="",r=!1;const a=[];for(let s=0;s<e.length;s++){const i=e.charAt(s);"'"===i?(n.length>0&&a.push({literal:r,val:n}),t=null,n="",r=!r):r||i===t?n+=i:(n.length>0&&a.push({literal:!1,val:n}),n=i,t=i)}return n.length>0&&a.push({literal:r,val:n}),a}static macroTokenToFormatOpts(e){return ra[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(e,Object.assign({},this.opts,t)).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,Object.assign({},this.opts,t)).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,Object.assign({},this.opts,t)).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,Object.assign({},this.opts,t)).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Nr(e,t);const n=Object.assign({},this.opts);return t>0&&(n.padTo=t),this.loc.numberFormatter(n).format(e)}formatDateTimeFromString(e,t){const n="en"===this.loc.listingMode(),r=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar&&br(),a=(t,n)=>this.loc.extract(e,t,n),s=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",i=()=>n?function(e){return Qr[e.hour<12?0:1]}(e):a({hour:"numeric",hour12:!0},"dayperiod"),o=(t,r)=>n?function(e,t){return qr(t)[e.month-1]}(e,t):a(r?{month:t}:{month:t,day:"numeric"},"month"),l=(t,r)=>n?function(e,t){return Yr(t)[e.weekday-1]}(e,t):a(r?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),c=t=>{const n=aa.macroTokenToFormatOpts(t);return n?this.formatWithSystemDefault(e,n):t},u=t=>n?function(e,t){return ta(t)[e.year<0?0:1]}(e,t):a({era:t},"era");return na(aa.parseFormat(t),(t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return i();case"d":return r?a({day:"numeric"},"day"):this.num(e.day);case"dd":return r?a({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return r?a({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?a({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return o("short",!0);case"LLLL":return o("long",!0);case"LLLLL":return o("narrow",!0);case"M":return r?a({month:"numeric"},"month"):this.num(e.month);case"MM":return r?a({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return o("short",!1);case"MMMM":return o("long",!1);case"MMMMM":return o("narrow",!1);case"y":return r?a({year:"numeric"},"year"):this.num(e.year);case"yy":return r?a({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?a({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?a({year:"numeric"},"year"):this.num(e.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(t)}}))}formatDurationFromString(e,t){const n=e=>{switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"M":return"month";case"y":return"year";default:return null}},r=aa.parseFormat(t),a=r.reduce(((e,{literal:t,val:n})=>t?e:e.concat(n)),[]);return na(r,(e=>t=>{const r=n(t);return r?this.num(e.get(r),t.length):t})(e.shiftTo(...a.map(n).filter((e=>e)))))}}class sa{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class ia{get type(){throw new Zn}get name(){throw new Zn}get universal(){throw new Zn}offsetName(e,t){throw new Zn}formatOffset(e,t){throw new Zn}offset(e){throw new Zn}equals(e){throw new Zn}get isValid(){throw new Zn}}let oa=null;class la extends ia{static get instance(){return null===oa&&(oa=new la),oa}get type(){return"local"}get name(){return yr()?(new Intl.DateTimeFormat).resolvedOptions().timeZone:"local"}get universal(){return!1}offsetName(e,{format:t,locale:n}){return Mr(e,t,n)}formatOffset(e,t){return Br(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"local"===e.type}get isValid(){return!0}}const ca=RegExp(`^${Vr.source}$`);let ua={};const da={year:0,month:1,day:2,hour:3,minute:4,second:5};let ma={};class pa extends ia{static create(e){return ma[e]||(ma[e]=new pa(e)),ma[e]}static resetCache(){ma={},ua={}}static isValidSpecifier(e){return!(!e||!e.match(ca))}static isValidZone(e){try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}static parseGMTOffset(e){if(e){const t=e.match(/^Etc\/GMT([+-]\d{1,2})$/i);if(t)return-60*parseInt(t[1])}return null}constructor(e){super(),this.zoneName=e,this.valid=pa.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get universal(){return!1}offsetName(e,{format:t,locale:n}){return Mr(e,t,n,this.name)}formatOffset(e,t){return Br(this.offset(e),t)}offset(e){const t=new Date(e),n=(c=this.name,ua[c]||(ua[c]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:c,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),ua[c]),[r,a,s,i,o,l]=n.formatToParts?function(e,t){const n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){const{type:t,value:a}=n[e],s=da[t];hr(s)||(r[s]=parseInt(a,10))}return r}(n,t):function(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n),[,a,s,i,o,l,c]=r;return[i,a,s,o,l,c]}(n,t);var c;let u=+t;const d=u%1e3;return u-=d>=0?d:1e3+d,(Pr({year:r,month:a,day:s,hour:24===i?0:i,minute:o,second:l,millisecond:0})-u)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let ga=null;class ha extends ia{static get utcInstance(){return null===ga&&(ga=new ha(0)),ga}static instance(e){return 0===e?ha.utcInstance:new ha(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new ha(Fr(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${Br(this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Br(this.fixed,t)}get universal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class fa extends ia{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get universal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function va(e,t){let n;if(hr(e)||null===e)return t;if(e instanceof ia)return e;if("string"==typeof e){const r=e.toLowerCase();return"local"===r?t:"utc"===r||"gmt"===r?ha.utcInstance:null!=(n=pa.parseGMTOffset(e))?ha.instance(n):pa.isValidSpecifier(r)?pa.create(e):ha.parseSpecifier(r)||new fa(e)}return fr(e)?ha.instance(e):"object"==typeof e&&e.offset&&"number"==typeof e.offset?e:new fa(e)}let ya=()=>Date.now(),ba=null,Ca=null,Ea=null,wa=null,Sa=!1;class ka{static get now(){return ya}static set now(e){ya=e}static get defaultZoneName(){return ka.defaultZone.name}static set defaultZoneName(e){ba=e?va(e):null}static get defaultZone(){return ba||la.instance}static get defaultLocale(){return Ca}static set defaultLocale(e){Ca=e}static get defaultNumberingSystem(){return Ea}static set defaultNumberingSystem(e){Ea=e}static get defaultOutputCalendar(){return wa}static set defaultOutputCalendar(e){wa=e}static get throwOnInvalid(){return Sa}static set throwOnInvalid(e){Sa=e}static resetCaches(){La.resetCache(),pa.resetCache()}}let Na={};function Aa(e,t={}){const n=JSON.stringify([e,t]);let r=Na[n];return r||(r=new Intl.DateTimeFormat(e,t),Na[n]=r),r}let Ga={};let Ta={};let Ia=null;function Da(e,t,n,r,a){const s=e.listingMode(n);return"error"===s?null:"en"===s?r(t):a(t)}class xa{constructor(e,t,n){if(this.padTo=n.padTo||0,this.floor=n.floor||!1,!t&&yr()){const t={useGrouping:!1};n.padTo>0&&(t.minimumIntegerDigits=n.padTo),this.inf=function(e,t={}){const n=JSON.stringify([e,t]);let r=Ga[n];return r||(r=new Intl.NumberFormat(e,t),Ga[n]=r),r}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return Nr(this.floor?Math.floor(e):Tr(e,3),this.padTo)}}class Pa{constructor(e,t,n){let r;if(this.opts=n,this.hasIntl=yr(),e.zone.universal&&this.hasIntl?(r="UTC",n.timeZoneName?this.dt=e:this.dt=0===e.offset?e:Ti.fromMillis(e.ts+60*e.offset*1e3)):"local"===e.zone.type?this.dt=e:(this.dt=e,r=e.zone.name),this.hasIntl){const e=Object.assign({},this.opts);r&&(e.timeZone=r),this.dtf=Aa(t,e)}}format(){if(this.hasIntl)return this.dtf.format(this.dt.toJSDate());{const e=function(e){const t="EEEE, LLLL d, yyyy, h:mm a";switch(Wr(wr(e,["weekday","era","year","month","day","hour","minute","second","timeZoneName","hour12"]))){case Wr(Kn):return"M/d/yyyy";case Wr(Xn):return"LLL d, yyyy";case Wr(Yn):return"LLLL d, yyyy";case Wr(Qn):return"EEEE, LLLL d, yyyy";case Wr($n):return"h:mm a";case Wr(_n):return"h:mm:ss a";case Wr(er):case Wr(tr):return"h:mm a";case Wr(nr):return"HH:mm";case Wr(rr):return"HH:mm:ss";case Wr(ar):case Wr(sr):return"HH:mm";case Wr(ir):return"M/d/yyyy, h:mm a";case Wr(lr):return"LLL d, yyyy, h:mm a";case Wr(dr):return"LLLL d, yyyy, h:mm a";case Wr(pr):return t;case Wr(or):return"M/d/yyyy, h:mm:ss a";case Wr(cr):return"LLL d, yyyy, h:mm:ss a";case Wr(ur):return"EEE, d LLL yyyy, h:mm a";case Wr(mr):return"LLLL d, yyyy, h:mm:ss a";case Wr(gr):return"EEEE, LLLL d, yyyy, h:mm:ss a";default:return t}}(this.opts),t=La.create("en-US");return aa.create(t).formatDateTimeFromString(this.dt,e)}}formatToParts(){return this.hasIntl&&br()?this.dtf.formatToParts(this.dt.toJSDate()):[]}resolvedOptions(){return this.hasIntl?this.dtf.resolvedOptions():{locale:"en-US",numberingSystem:"latn",outputCalendar:"gregory"}}}class Oa{constructor(e,t,n){this.opts=Object.assign({style:"long"},n),!t&&Cr()&&(this.rtf=function(e,t={}){const{base:n,...r}=t,a=JSON.stringify([e,r]);let s=Ta[a];return s||(s=new Intl.RelativeTimeFormat(e,t),Ta[a]=s),s}(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,n="always",r=!1){const a={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===n&&s){const n="days"===e;switch(t){case 1:return n?"tomorrow":`next ${a[e][0]}`;case-1:return n?"yesterday":`last ${a[e][0]}`;case 0:return n?"today":`this ${a[e][0]}`}}const i=Object.is(t,-0)||t<0,o=Math.abs(t),l=1===o,c=a[e],u=r?l?c[1]:c[2]||c[1]:l?a[e][0]:e;return i?`${o} ${u} ago`:`in ${o} ${u}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class La{static fromOpts(e){return La.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,n,r=!1){const a=e||ka.defaultLocale,s=a||(r?"en-US":function(){if(Ia)return Ia;if(yr()){const e=(new Intl.DateTimeFormat).resolvedOptions().locale;return Ia=e&&"und"!==e?e:"en-US",Ia}return Ia="en-US",Ia}()),i=t||ka.defaultNumberingSystem,o=n||ka.defaultOutputCalendar;return new La(s,i,o,a)}static resetCache(){Ia=null,Na={},Ga={},Ta={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:n}={}){return La.create(e,t,n)}constructor(e,t,n,r){const[a,s,i]=function(e){const t=e.indexOf("-u-");if(-1===t)return[e];{let n;const r=e.substring(0,t);try{n=Aa(e).resolvedOptions()}catch(e){n=Aa(r).resolvedOptions()}const{numberingSystem:a,calendar:s}=n;return[r,a,s]}}(e);this.locale=a,this.numberingSystem=t||s||null,this.outputCalendar=n||i||null,this.intl=function(e,t,n){return yr()?n||t?(e+="-u",n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`),e):e:[]}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||yr()&&"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(e=!0){const t=yr()&&br(),n=this.isEnglish(),r=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return t||n&&r||e?!t||n&&r?"en":"intl":"error"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?La.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone(Object.assign({},e,{defaultToEN:!0}))}redefaultToSystem(e={}){return this.clone(Object.assign({},e,{defaultToEN:!1}))}months(e,t=!1,n=!0){return Da(this,e,n,qr,(()=>{const n=t?{month:e,day:"numeric"}:{month:e},r=t?"format":"standalone";return this.monthsCache[r][e]||(this.monthsCache[r][e]=function(e){const t=[];for(let n=1;n<=12;n++){const r=Ti.utc(2016,n,1);t.push(e(r))}return t}((e=>this.extract(e,n,"month")))),this.monthsCache[r][e]}))}weekdays(e,t=!1,n=!0){return Da(this,e,n,Yr,(()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=function(e){const t=[];for(let n=1;n<=7;n++){const r=Ti.utc(2016,11,13+n);t.push(e(r))}return t}((e=>this.extract(e,n,"weekday")))),this.weekdaysCache[r][e]}))}meridiems(e=!0){return Da(this,void 0,e,(()=>Qr),(()=>{if(!this.meridiemCache){const e={hour:"numeric",hour12:!0};this.meridiemCache=[Ti.utc(2016,11,13,9),Ti.utc(2016,11,13,19)].map((t=>this.extract(t,e,"dayperiod")))}return this.meridiemCache}))}eras(e,t=!0){return Da(this,e,t,ta,(()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Ti.utc(-40,1,1),Ti.utc(2017,1,1)].map((e=>this.extract(e,t,"era")))),this.eraCache[e]}))}extract(e,t,n){const r=this.dtFormatter(e,t).formatToParts().find((e=>e.type.toLowerCase()===n));return r?r.value:null}numberFormatter(e={}){return new xa(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Pa(e,this.intl,t)}relFormatter(e={}){return new Oa(this.intl,this.isEnglish(),e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||yr()&&new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Ma(...e){const t=e.reduce(((e,t)=>e+t.source),"");return RegExp(`^${t}$`)}function Fa(...e){return t=>e.reduce((([e,n,r],a)=>{const[s,i,o]=a(t,r);return[Object.assign(e,s),n||i,o]}),[{},null,1]).slice(0,2)}function za(e,...t){if(null==e)return[null,null];for(const[n,r]of t){const t=n.exec(e);if(t)return r(t)}return[null,null]}function ja(...e){return(t,n)=>{const r={};let a;for(a=0;a<e.length;a++)r[e[a]]=Ar(t[n+a]);return[r,null,n+a]}}const Ba=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Ra=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,9}))?)?)?/,Va=RegExp(`${Ra.source}${Ba.source}?`),Wa=RegExp(`(?:T${Va.source})?`),Ha=ja("weekYear","weekNumber","weekDay"),Za=ja("year","ordinal"),Ua=RegExp(`${Ra.source} ?(?:${Ba.source}|(${Vr.source}))?`),qa=RegExp(`(?: ${Ua.source})?`);function Ja(e,t,n){const r=e[t];return hr(r)?n:Ar(r)}function Ka(e,t){return[{year:Ja(e,t),month:Ja(e,t+1,1),day:Ja(e,t+2,1)},null,t+3]}function Xa(e,t){return[{hour:Ja(e,t,0),minute:Ja(e,t+1,0),second:Ja(e,t+2,0),millisecond:Gr(e[t+3])},null,t+4]}function Ya(e,t){const n=!e[t]&&!e[t+1],r=Fr(e[t+1],e[t+2]);return[{},n?null:ha.instance(r),t+3]}function Qa(e,t){return[{},e[t]?pa.create(e[t]):null,t+1]}const $a=/^-?P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})(?:[.,](-?\d{1,9}))?S)?)?)$/;function _a(e){const[t,n,r,a,s,i,o,l,c]=e,u="-"===t[0],d=e=>e&&u?-e:e;return[{years:d(Ar(n)),months:d(Ar(r)),weeks:d(Ar(a)),days:d(Ar(s)),hours:d(Ar(i)),minutes:d(Ar(o)),seconds:d(Ar(l)),milliseconds:d(Gr(c))}]}const es={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function ts(e,t,n,r,a,s,i){const o={year:2===t.length?Lr(Ar(t)):Ar(t),month:Zr.indexOf(n)+1,day:Ar(r),hour:Ar(a),minute:Ar(s)};return i&&(o.second=Ar(i)),e&&(o.weekday=e.length>3?Jr.indexOf(e)+1:Kr.indexOf(e)+1),o}const ns=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function rs(e){const[,t,n,r,a,s,i,o,l,c,u,d]=e,m=ts(t,a,r,n,s,i,o);let p;return p=l?es[l]:c?0:Fr(u,d),[m,new ha(p)]}const as=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,ss=/^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,is=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function os(e){const[,t,n,r,a,s,i,o]=e;return[ts(t,a,r,n,s,i,o),ha.utcInstance]}function ls(e){const[,t,n,r,a,s,i,o]=e;return[ts(t,o,n,r,a,s,i),ha.utcInstance]}const cs=Ma(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Wa),us=Ma(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Wa),ds=Ma(/(\d{4})-?(\d{3})/,Wa),ms=Ma(Va),ps=Fa(Ka,Xa,Ya),gs=Fa(Ha,Xa,Ya),hs=Fa(Za,Xa),fs=Fa(Xa,Ya);const vs=Ma(/(\d{4})-(\d\d)-(\d\d)/,qa),ys=Ma(Ua),bs=Fa(Ka,Xa,Ya,Qa),Cs=Fa(Xa,Ya,Qa);const Es={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},ws=Object.assign({years:{months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},Es),Ss=Object.assign({years:{months:12,weeks:52.1775,days:365.2425,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:30.436875/7,days:30.436875,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},Es),ks=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Ns=ks.slice(0).reverse();function As(e,t,n=!1){const r={values:n?t.values:Object.assign({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy};return new Is(r)}function Gs(e,t,n,r,a){const s=e[a][n],i=t[n]/s,o=!(Math.sign(i)===Math.sign(r[a]))&&0!==r[a]&&Math.abs(i)<=1?function(e){return e<0?Math.floor(e):Math.ceil(e)}(i):Math.trunc(i);r[a]+=o,t[n]-=o*s}function Ts(e,t){Ns.reduce(((n,r)=>hr(t[r])?n:(n&&Gs(e,t,n,t,r),r)),null)}class Is{constructor(e){const t="longterm"===e.conversionAccuracy||!1;this.values=e.values,this.loc=e.loc||La.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?Ss:ws,this.isLuxonDuration=!0}static fromMillis(e,t){return Is.fromObject(Object.assign({milliseconds:e},t))}static fromObject(e){if(null==e||"object"!=typeof e)throw new Hn("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new Is({values:jr(e,Is.normalizeUnit,["locale","numberingSystem","conversionAccuracy","zone"]),loc:La.fromObject(e),conversionAccuracy:e.conversionAccuracy})}static fromISO(e,t){const[n]=function(e){return za(e,[$a,_a])}(e);if(n){const e=Object.assign(n,t);return Is.fromObject(e)}return Is.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Hn("need to specify a reason the Duration is invalid");const n=e instanceof sa?e:new sa(e,t);if(ka.throwOnInvalid)throw new Rn(n);return new Is({invalid:n})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new Wn(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const n=Object.assign({},t,{floor:!1!==t.round&&!1!==t.floor});return this.isValid?aa.create(this.loc,n).formatDurationFromString(this,e):"Invalid Duration"}toObject(e={}){if(!this.isValid)return{};const t=Object.assign({},this.values);return e.includeConfig&&(t.conversionAccuracy=this.conversionAccuracy,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=Tr(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toJSON(){return this.toISO()}toString(){return this.toISO()}valueOf(){return this.as("milliseconds")}plus(e){if(!this.isValid)return this;const t=Ds(e),n={};for(const e of ks)(Sr(t.values,e)||Sr(this.values,e))&&(n[e]=t.get(e)+this.get(e));return As(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const t=Ds(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=zr(e(this.values[n],n));return As(this,{values:t},!0)}get(e){return this[Is.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return As(this,{values:Object.assign(this.values,jr(e,Is.normalizeUnit,[]))})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n}={}){const r={loc:this.loc.clone({locale:e,numberingSystem:t})};return n&&(r.conversionAccuracy=n),As(this,r)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Ts(this.matrix,e),As(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map((e=>Is.normalizeUnit(e)));const t={},n={},r=this.toObject();let a;Ts(this.matrix,r);for(const s of ks)if(e.indexOf(s)>=0){a=s;let e=0;for(const t in n)e+=this.matrix[t][s]*n[t],n[t]=0;fr(r[s])&&(e+=r[s]);const i=Math.trunc(e);t[s]=i,n[s]=e-i;for(const e in r)ks.indexOf(e)>ks.indexOf(s)&&Gs(this.matrix,r,e,t,s)}else fr(r[s])&&(n[s]=r[s]);for(const e in n)0!==n[e]&&(t[a]+=e===a?n[e]:n[e]/this.matrix[a][e]);return As(this,{values:t},!0).normalize()}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=-this.values[t];return As(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(const t of ks)if(this.values[t]!==e.values[t])return!1;return!0}}function Ds(e){if(fr(e))return Is.fromMillis(e);if(Is.isDuration(e))return e;if("object"==typeof e)return Is.fromObject(e);throw new Hn(`Unknown duration argument ${e} of type ${typeof e}`)}const xs="Invalid Interval";class Ps{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new Hn("need to specify a reason the Interval is invalid");const n=e instanceof sa?e:new sa(e,t);if(ka.throwOnInvalid)throw new Bn(n);return new Ps({invalid:n})}static fromDateTimes(e,t){const n=Ii(e),r=Ii(t),a=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?Ps.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null:Ps.invalid("missing or invalid end"):Ps.invalid("missing or invalid start")}(n,r);return null==a?new Ps({start:n,end:r}):a}static after(e,t){const n=Ds(t),r=Ii(e);return Ps.fromDateTimes(r,r.plus(n))}static before(e,t){const n=Ds(t),r=Ii(e);return Ps.fromDateTimes(r.minus(n),r)}static fromISO(e,t){const[n,r]=(e||"").split("/",2);if(n&&r){const e=Ti.fromISO(n,t),a=Ti.fromISO(r,t);if(e.isValid&&a.isValid)return Ps.fromDateTimes(e,a);if(e.isValid){const n=Is.fromISO(r,t);if(n.isValid)return Ps.after(e,n)}else if(a.isValid){const e=Is.fromISO(n,t);if(e.isValid)return Ps.before(a,e)}}return Ps.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds"){if(!this.isValid)return NaN;const t=this.start.startOf(e),n=this.end.startOf(e);return Math.floor(n.diff(t,e).get(e))+1}hasSame(e){return!!this.isValid&&this.e.minus(1).hasSame(this.s,e)}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return!!this.isValid&&this.s>e}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)}set({start:e,end:t}={}){return this.isValid?Ps.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Ii).filter((e=>this.contains(e))).sort(),n=[];let{s:r}=this,a=0;for(;r<this.e;){const e=t[a]||this.e,s=+e>+this.e?this.e:e;n.push(Ps.fromDateTimes(r,s)),r=s,a+=1}return n}splitBy(e){const t=Ds(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let n,r,{s:a}=this;const s=[];for(;a<this.e;)n=a.plus(t),r=+n>+this.e?this.e:n,s.push(Ps.fromDateTimes(a,r)),a=r;return s}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return!!this.isValid&&+this.e==+e.s}abutsEnd(e){return!!this.isValid&&+e.e==+this.s}engulfs(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)}equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,n=this.e<e.e?this.e:e.e;return t>n?null:Ps.fromDateTimes(t,n)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,n=this.e>e.e?this.e:e.e;return Ps.fromDateTimes(t,n)}static merge(e){const[t,n]=e.sort(((e,t)=>e.s-t.s)).reduce((([e,t],n)=>t?t.overlaps(n)||t.abutsStart(n)?[e,t.union(n)]:[e.concat([t]),n]:[e,n]),[[],null]);return n&&t.push(n),t}static xor(e){let t=null,n=0;const r=[],a=e.map((e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}])),s=Array.prototype.concat(...a).sort(((e,t)=>e.time-t.time));for(const e of s)n+="s"===e.type?1:-1,1===n?t=e.time:(t&&+t!=+e.time&&r.push(Ps.fromDateTimes(t,e.time)),t=null);return Ps.merge(r)}difference(...e){return Ps.xor([this].concat(e)).map((e=>this.intersection(e))).filter((e=>e&&!e.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:xs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:xs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:xs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:xs}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:xs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):Is.invalid(this.invalidReason)}mapEndpoints(e){return Ps.fromDateTimes(e(this.s),e(this.e))}}class Os{static hasDST(e=ka.defaultZone){const t=Ti.local().setZone(e).set({month:12});return!e.universal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return pa.isValidSpecifier(e)&&pa.isValidZone(e)}static normalizeZone(e){return va(e,ka.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:n=null,outputCalendar:r="gregory"}={}){return La.create(t,n,r).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:n=null,outputCalendar:r="gregory"}={}){return La.create(t,n,r).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:n=null}={}){return La.create(t,n,null).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:n=null}={}){return La.create(t,n,null).weekdays(e,!0)}static meridiems({locale:e=null}={}){return La.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return La.create(t,null,"gregory").eras(e)}static features(){let e=!1,t=!1,n=!1,r=!1;if(yr()){e=!0,t=br(),r=Cr();try{n="America/New_York"===new Intl.DateTimeFormat("en",{timeZone:"America/New_York"}).resolvedOptions().timeZone}catch(e){n=!1}}return{intl:e,intlTokens:t,zones:n,relative:r}}}function Ls(e,t){const n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Is.fromMillis(r).as("days"))}function Ms(e,t,n,r){let[a,s,i,o]=function(e,t,n){const r=[["years",(e,t)=>t.year-e.year],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const n=Ls(e,t);return(n-n%7)/7}],["days",Ls]],a={};let s,i;for(const[o,l]of r)if(n.indexOf(o)>=0){s=o;let n=l(e,t);i=e.plus({[o]:n}),i>t?(e=e.plus({[o]:n-1}),n-=1):e=i,a[o]=n}return[e,a,i,s]}(e,t,n);const l=t-a,c=n.filter((e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0));0===c.length&&(i<t&&(i=a.plus({[o]:1})),i!==a&&(s[o]=(s[o]||0)+l/(i-a)));const u=Is.fromObject(Object.assign(s,r));return c.length>0?Is.fromMillis(l,r).shiftTo(...c).plus(u):u}const Fs={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},zs={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},js=Fs.hanidec.replace(/[\[|\]]/g,"").split("");function Bs({numberingSystem:e},t=""){return new RegExp(`${Fs[e||"latn"]}${t}`)}function Rs(e,t=(e=>e)){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(-1!==e[n].search(Fs.hanidec))t+=js.indexOf(e[n]);else for(const e in zs){const[n,a]=zs[e];r>=n&&r<=a&&(t+=r-n)}}return parseInt(t,10)}return t}(e))}}function Vs(e){return e.replace(/\./,"\\.?")}function Ws(e){return e.replace(/\./,"").toLowerCase()}function Hs(e,t){return null===e?null:{regex:RegExp(e.map(Vs).join("|")),deser:([n])=>e.findIndex((e=>Ws(n)===Ws(e)))+t}}function Zs(e,t){return{regex:e,deser:([,e,t])=>Fr(e,t),groups:t}}function Us(e){return{regex:e,deser:([e])=>e}}const qs={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};let Js=null;function Ks(e,t){if(e.literal)return e;const n=aa.macroTokenToFormatOpts(e.val);if(!n)return e;const r=aa.create(t,n).formatDateTimeParts((Js||(Js=Ti.fromMillis(1555555555555)),Js)).map((e=>function(e,t,n){const{type:r,value:a}=e;if("literal"===r)return{literal:!0,val:a};const s=n[r];let i=qs[r];return"object"==typeof i&&(i=i[s]),i?{literal:!1,val:i}:void 0}(e,0,n)));return r.includes(void 0)?e:r}function Xs(e,t,n){const r=function(e,t){return Array.prototype.concat(...e.map((e=>Ks(e,t))))}(aa.parseFormat(n),e),a=r.map((t=>function(e,t){const n=Bs(t),r=Bs(t,"{2}"),a=Bs(t,"{3}"),s=Bs(t,"{4}"),i=Bs(t,"{6}"),o=Bs(t,"{1,2}"),l=Bs(t,"{1,3}"),c=Bs(t,"{1,6}"),u=Bs(t,"{1,9}"),d=Bs(t,"{2,4}"),m=Bs(t,"{4,6}"),p=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},g=(g=>{if(e.literal)return p(g);switch(g.val){case"G":return Hs(t.eras("short",!1),0);case"GG":return Hs(t.eras("long",!1),0);case"y":return Rs(c);case"yy":return Rs(d,Lr);case"yyyy":return Rs(s);case"yyyyy":return Rs(m);case"yyyyyy":return Rs(i);case"M":return Rs(o);case"MM":return Rs(r);case"MMM":return Hs(t.months("short",!0,!1),1);case"MMMM":return Hs(t.months("long",!0,!1),1);case"L":return Rs(o);case"LL":return Rs(r);case"LLL":return Hs(t.months("short",!1,!1),1);case"LLLL":return Hs(t.months("long",!1,!1),1);case"d":return Rs(o);case"dd":return Rs(r);case"o":return Rs(l);case"ooo":return Rs(a);case"HH":return Rs(r);case"H":return Rs(o);case"hh":return Rs(r);case"h":return Rs(o);case"mm":return Rs(r);case"m":case"q":return Rs(o);case"qq":return Rs(r);case"s":return Rs(o);case"ss":return Rs(r);case"S":return Rs(l);case"SSS":return Rs(a);case"u":return Us(u);case"a":return Hs(t.meridiems(),0);case"kkkk":return Rs(s);case"kk":return Rs(d,Lr);case"W":return Rs(o);case"WW":return Rs(r);case"E":case"c":return Rs(n);case"EEE":return Hs(t.weekdays("short",!1,!1),1);case"EEEE":return Hs(t.weekdays("long",!1,!1),1);case"ccc":return Hs(t.weekdays("short",!0,!1),1);case"cccc":return Hs(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Zs(new RegExp(`([+-]${o.source})(?::(${r.source}))?`),2);case"ZZZ":return Zs(new RegExp(`([+-]${o.source})(${r.source})?`),2);case"z":return Us(/[a-z_+-/]{1,256}?/i);default:return p(g)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return g.token=e,g}(t,e))),s=a.find((e=>e.invalidReason));if(s)return{input:t,tokens:r,invalidReason:s.invalidReason};{const[e,n]=function(e){return[`^${e.map((e=>e.regex)).reduce(((e,t)=>`${e}(${t.source})`),"")}$`,e]}(a),s=RegExp(e,"i"),[i,o]=function(e,t,n){const r=e.match(t);if(r){const e={};let t=1;for(const a in n)if(Sr(n,a)){const s=n[a],i=s.groups?s.groups+1:1;!s.literal&&s.token&&(e[s.token.val[0]]=s.deser(r.slice(t,t+i))),t+=i}return[r,e]}return[r,{}]}(t,s,n),[l,c]=o?function(e){let t;return t=hr(e.Z)?hr(e.z)?null:pa.create(e.z):new ha(e.Z),hr(e.q)||(e.M=3*(e.q-1)+1),hr(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),hr(e.u)||(e.S=Gr(e.u)),[Object.keys(e).reduce(((t,n)=>{const r=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(n);return r&&(t[r]=e[n]),t}),{}),t]}(o):[null,null];if(Sr(o,"a")&&Sr(o,"H"))throw new Vn("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:s,rawMatches:i,matches:o,result:l,zone:c}}}const Ys=[0,31,59,90,120,151,181,212,243,273,304,334],Qs=[0,31,60,91,121,152,182,213,244,274,305,335];function $s(e,t){return new sa("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function _s(e,t,n){const r=new Date(Date.UTC(e,t-1,n)).getUTCDay();return 0===r?7:r}function ei(e,t,n){return n+(Ir(e)?Qs:Ys)[t-1]}function ti(e,t){const n=Ir(e)?Qs:Ys,r=n.findIndex((e=>e<t));return{month:r+1,day:t-n[r]}}function ni(e){const{year:t,month:n,day:r}=e,a=ei(t,n,r),s=_s(t,n,r);let i,o=Math.floor((a-s+10)/7);return o<1?(i=t-1,o=Or(i)):o>Or(t)?(i=t+1,o=1):i=t,Object.assign({weekYear:i,weekNumber:o,weekday:s},Rr(e))}function ri(e){const{weekYear:t,weekNumber:n,weekday:r}=e,a=_s(t,1,4),s=Dr(t);let i,o=7*n+r-a-3;o<1?(i=t-1,o+=Dr(i)):o>s?(i=t+1,o-=Dr(t)):i=t;const{month:l,day:c}=ti(i,o);return Object.assign({year:i,month:l,day:c},Rr(e))}function ai(e){const{year:t,month:n,day:r}=e,a=ei(t,n,r);return Object.assign({year:t,ordinal:a},Rr(e))}function si(e){const{year:t,ordinal:n}=e,{month:r,day:a}=ti(t,n);return Object.assign({year:t,month:r,day:a},Rr(e))}function ii(e){const t=vr(e.year),n=kr(e.month,1,12),r=kr(e.day,1,xr(e.year,e.month));return t?n?!r&&$s("day",e.day):$s("month",e.month):$s("year",e.year)}function oi(e){const{hour:t,minute:n,second:r,millisecond:a}=e,s=kr(t,0,23)||24===t&&0===n&&0===r&&0===a,i=kr(n,0,59),o=kr(r,0,59),l=kr(a,0,999);return s?i?o?!l&&$s("millisecond",a):$s("second",r):$s("minute",n):$s("hour",t)}const li="Invalid DateTime";function ci(e){return new sa("unsupported zone",`the zone "${e.name}" is not supported`)}function ui(e){return null===e.weekData&&(e.weekData=ni(e.c)),e.weekData}function di(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Ti(Object.assign({},n,t,{old:n}))}function mi(e,t,n){let r=e-60*t*1e3;const a=n.offset(r);if(t===a)return[r,t];r-=60*(a-t)*1e3;const s=n.offset(r);return a===s?[r,a]:[e-60*Math.min(a,s)*1e3,Math.max(a,s)]}function pi(e,t){const n=new Date(e+=60*t*1e3);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function gi(e,t,n){return mi(Pr(e),t,n)}function hi(e,t){const n=Object.keys(t.values);-1===n.indexOf("milliseconds")&&n.push("milliseconds"),t=t.shiftTo(...n);const r=e.o,a=e.c.year+t.years,s=e.c.month+t.months+3*t.quarters,i=Object.assign({},e.c,{year:a,month:s,day:Math.min(e.c.day,xr(a,s))+t.days+7*t.weeks}),o=Is.fromObject({hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),l=Pr(i);let[c,u]=mi(l,r,e.zone);return 0!==o&&(c+=o,u=e.zone.offset(c)),{ts:c,o:u}}function fi(e,t,n,r,a){const{setZone:s,zone:i}=n;if(e&&0!==Object.keys(e).length){const r=t||i,a=Ti.fromObject(Object.assign(e,n,{zone:r,setZone:void 0}));return s?a:a.setZone(i)}return Ti.invalid(new sa("unparsable",`the input "${a}" can't be parsed as ${r}`))}function vi(e,t,n=!0){return e.isValid?aa.create(La.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function yi(e,{suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:r,includeZone:a=!1,spaceZone:s=!1,format:i="extended"}){let o="basic"===i?"HHmm":"HH:mm";return t&&0===e.second&&0===e.millisecond||(o+="basic"===i?"ss":":ss",n&&0===e.millisecond||(o+=".SSS")),(a||r)&&s&&(o+=" "),a?o+="z":r&&(o+="basic"===i?"ZZZ":"ZZ"),vi(e,o)}const bi={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Ci={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Ei={ordinal:1,hour:0,minute:0,second:0,millisecond:0},wi=["year","month","day","hour","minute","second","millisecond"],Si=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ki=["year","ordinal","hour","minute","second","millisecond"];function Ni(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new Wn(e);return t}function Ai(e,t){for(const t of wi)hr(e[t])&&(e[t]=bi[t]);const n=ii(e)||oi(e);if(n)return Ti.invalid(n);const r=ka.now(),a=t.offset(r),[s,i]=gi(e,a,t);return new Ti({ts:s,zone:t,o:i})}function Gi(e,t,n){const r=!!hr(n.round)||n.round,a=(e,a)=>{e=Tr(e,r||n.calendary?0:2,!0);return t.loc.clone(n).relFormatter(n).format(e,a)},s=r=>n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r);if(n.unit)return a(s(n.unit),n.unit);for(const e of n.units){const t=s(e);if(Math.abs(t)>=1)return a(t,e)}return a(0,n.units[n.units.length-1])}class Ti{constructor(e){const t=e.zone||ka.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new sa("invalid input"):null)||(t.isValid?null:ci(t));this.ts=hr(e.ts)?ka.now():e.ts;let r=null,a=null;if(!n){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,a]=[e.old.c,e.old.o];else{const e=t.offset(this.ts);r=pi(this.ts,e),n=Number.isNaN(r.year)?new sa("invalid input"):null,r=n?null:r,a=n?null:e}}this._zone=t,this.loc=e.loc||La.create(),this.invalid=n,this.weekData=null,this.c=r,this.o=a,this.isLuxonDateTime=!0}static local(e,t,n,r,a,s,i){return hr(e)?new Ti({ts:ka.now()}):Ai({year:e,month:t,day:n,hour:r,minute:a,second:s,millisecond:i},ka.defaultZone)}static utc(e,t,n,r,a,s,i){return hr(e)?new Ti({ts:ka.now(),zone:ha.utcInstance}):Ai({year:e,month:t,day:n,hour:r,minute:a,second:s,millisecond:i},ha.utcInstance)}static fromJSDate(e,t={}){const n=(r=e,"[object Date]"===Object.prototype.toString.call(r)?e.valueOf():NaN);var r;if(Number.isNaN(n))return Ti.invalid("invalid input");const a=va(t.zone,ka.defaultZone);return a.isValid?new Ti({ts:n,zone:a,loc:La.fromObject(t)}):Ti.invalid(ci(a))}static fromMillis(e,t={}){if(fr(e))return e<-864e13||e>864e13?Ti.invalid("Timestamp out of range"):new Ti({ts:e,zone:va(t.zone,ka.defaultZone),loc:La.fromObject(t)});throw new Hn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(fr(e))return new Ti({ts:1e3*e,zone:va(t.zone,ka.defaultZone),loc:La.fromObject(t)});throw new Hn("fromSeconds requires a numerical input")}static fromObject(e){const t=va(e.zone,ka.defaultZone);if(!t.isValid)return Ti.invalid(ci(t));const n=ka.now(),r=t.offset(n),a=jr(e,Ni,["zone","locale","outputCalendar","numberingSystem"]),s=!hr(a.ordinal),i=!hr(a.year),o=!hr(a.month)||!hr(a.day),l=i||o,c=a.weekYear||a.weekNumber,u=La.fromObject(e);if((l||s)&&c)throw new Vn("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Vn("Can't mix ordinal dates with month/day");const d=c||a.weekday&&!l;let m,p,g=pi(n,r);d?(m=Si,p=Ci,g=ni(g)):s?(m=ki,p=Ei,g=ai(g)):(m=wi,p=bi);let h=!1;for(const e of m){hr(a[e])?a[e]=h?p[e]:g[e]:h=!0}const f=(d?function(e){const t=vr(e.weekYear),n=kr(e.weekNumber,1,Or(e.weekYear)),r=kr(e.weekday,1,7);return t?n?!r&&$s("weekday",e.weekday):$s("week",e.week):$s("weekYear",e.weekYear)}(a):s?function(e){const t=vr(e.year),n=kr(e.ordinal,1,Dr(e.year));return t?!n&&$s("ordinal",e.ordinal):$s("year",e.year)}(a):ii(a))||oi(a);if(f)return Ti.invalid(f);const v=d?ri(a):s?si(a):a,[y,b]=gi(v,r,t),C=new Ti({ts:y,zone:t,o:b,loc:u});return a.weekday&&l&&e.weekday!==C.weekday?Ti.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${C.toISO()}`):C}static fromISO(e,t={}){const[n,r]=function(e){return za(e,[cs,ps],[us,gs],[ds,hs],[ms,fs])}(e);return fi(n,r,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[n,r]=function(e){return za(function(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[ns,rs])}(e);return fi(n,r,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[n,r]=function(e){return za(e,[as,os],[ss,os],[is,ls])}(e);return fi(n,r,t,"HTTP",t)}static fromFormat(e,t,n={}){if(hr(e)||hr(t))throw new Hn("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:a=null}=n,s=La.fromOpts({locale:r,numberingSystem:a,defaultToEN:!0}),[i,o,l]=function(e,t,n){const{result:r,zone:a,invalidReason:s}=Xs(e,t,n);return[r,a,s]}(s,e,t);return l?Ti.invalid(l):fi(i,o,n,`format ${t}`,e)}static fromString(e,t,n={}){return Ti.fromFormat(e,t,n)}static fromSQL(e,t={}){const[n,r]=function(e){return za(e,[vs,bs],[ys,Cs])}(e);return fi(n,r,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Hn("need to specify a reason the DateTime is invalid");const n=e instanceof sa?e:new sa(e,t);if(ka.throwOnInvalid)throw new jn(n);return new Ti({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ui(this).weekYear:NaN}get weekNumber(){return this.isValid?ui(this).weekNumber:NaN}get weekday(){return this.isValid?ui(this).weekday:NaN}get ordinal(){return this.isValid?ai(this.c).ordinal:NaN}get monthShort(){return this.isValid?Os.months("short",{locale:this.locale})[this.month-1]:null}get monthLong(){return this.isValid?Os.months("long",{locale:this.locale})[this.month-1]:null}get weekdayShort(){return this.isValid?Os.weekdays("short",{locale:this.locale})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Os.weekdays("long",{locale:this.locale})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.universal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1}).offset||this.offset>this.set({month:5}).offset)}get isInLeapYear(){return Ir(this.year)}get daysInMonth(){return xr(this.year,this.month)}get daysInYear(){return this.isValid?Dr(this.year):NaN}get weeksInWeekYear(){return this.isValid?Or(this.weekYear):NaN}resolvedLocaleOpts(e={}){const{locale:t,numberingSystem:n,calendar:r}=aa.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(ha.instance(e),t)}toLocal(){return this.setZone(ka.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:n=!1}={}){if((e=va(e,ka.defaultZone)).equals(this.zone))return this;if(e.isValid){let r=this.ts;if(t||n){const t=e.offset(this.ts),n=this.toObject();[r]=gi(n,t,e)}return di(this,{ts:r,zone:e})}return Ti.invalid(ci(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){return di(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=jr(e,Ni,[]);let n;!hr(t.weekYear)||!hr(t.weekNumber)||!hr(t.weekday)?n=ri(Object.assign(ni(this.c),t)):hr(t.ordinal)?(n=Object.assign(this.toObject(),t),hr(t.day)&&(n.day=Math.min(xr(n.year,n.month),n.day))):n=si(Object.assign(ai(this.c),t));const[r,a]=gi(n,this.o,this.zone);return di(this,{ts:r,o:a})}plus(e){if(!this.isValid)return this;return di(this,hi(this,Ds(e)))}minus(e){if(!this.isValid)return this;return di(this,hi(this,Ds(e).negate()))}startOf(e){if(!this.isValid)return this;const t={},n=Is.normalizeUnit(e);switch(n){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0}if("weeks"===n&&(t.weekday=1),"quarters"===n){const e=Math.ceil(this.month/3);t.month=3*(e-1)+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?aa.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):li}toLocaleString(e=Kn){return this.isValid?aa.create(this.loc.clone(e),e).formatDateTime(this):li}toLocaleParts(e={}){return this.isValid?aa.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO(e={}){return this.isValid?`${this.toISODate(e)}T${this.toISOTime(e)}`:null}toISODate({format:e="extended"}={}){let t="basic"===e?"yyyyMMdd":"yyyy-MM-dd";return this.year>9999&&(t="+"+t),vi(this,t)}toISOWeekDate(){return vi(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,format:r="extended"}={}){return yi(this,{suppressSeconds:t,suppressMilliseconds:e,includeOffset:n,format:r})}toRFC2822(){return vi(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return vi(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return vi(this,"yyyy-MM-dd")}toSQLTime({includeOffset:e=!0,includeZone:t=!1}={}){return yi(this,{includeOffset:e,includeZone:t,spaceZone:!0})}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():li}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t=Object.assign({},this.c);return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",n={}){if(!this.isValid||!e.isValid)return Is.invalid(this.invalid||e.invalid,"created by diffing an invalid DateTime");const r=Object.assign({locale:this.locale,numberingSystem:this.numberingSystem},n),a=(o=t,Array.isArray(o)?o:[o]).map(Is.normalizeUnit),s=e.valueOf()>this.valueOf(),i=Ms(s?this:e,s?e:this,a,r);var o;return s?i.negate():i}diffNow(e="milliseconds",t={}){return this.diff(Ti.local(),e,t)}until(e){return this.isValid?Ps.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;if("millisecond"===t)return this.valueOf()===e.valueOf();{const n=e.valueOf();return this.startOf(t)<=n&&n<=this.endOf(t)}}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Ti.fromObject({zone:this.zone}),n=e.padding?this<t?-e.padding:e.padding:0;return Gi(t,this.plus(n),Object.assign(e,{numeric:"always",units:["years","months","days","hours","minutes","seconds"]}))}toRelativeCalendar(e={}){return this.isValid?Gi(e.base||Ti.fromObject({zone:this.zone}),this,Object.assign(e,{numeric:"auto",units:["years","months","days"],calendary:!0})):null}static min(...e){if(!e.every(Ti.isDateTime))throw new Hn("min requires all arguments be DateTimes");return Er(e,(e=>e.valueOf()),Math.min)}static max(...e){if(!e.every(Ti.isDateTime))throw new Hn("max requires all arguments be DateTimes");return Er(e,(e=>e.valueOf()),Math.max)}static fromFormatExplain(e,t,n={}){const{locale:r=null,numberingSystem:a=null}=n;return Xs(La.fromOpts({locale:r,numberingSystem:a,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,n={}){return Ti.fromFormatExplain(e,t,n)}static get DATE_SHORT(){return Kn}static get DATE_MED(){return Xn}static get DATE_FULL(){return Yn}static get DATE_HUGE(){return Qn}static get TIME_SIMPLE(){return $n}static get TIME_WITH_SECONDS(){return _n}static get TIME_WITH_SHORT_OFFSET(){return er}static get TIME_WITH_LONG_OFFSET(){return tr}static get TIME_24_SIMPLE(){return nr}static get TIME_24_WITH_SECONDS(){return rr}static get TIME_24_WITH_SHORT_OFFSET(){return ar}static get TIME_24_WITH_LONG_OFFSET(){return sr}static get DATETIME_SHORT(){return ir}static get DATETIME_SHORT_WITH_SECONDS(){return or}static get DATETIME_MED(){return lr}static get DATETIME_MED_WITH_SECONDS(){return cr}static get DATETIME_MED_WITH_WEEKDAY(){return ur}static get DATETIME_FULL(){return dr}static get DATETIME_FULL_WITH_SECONDS(){return mr}static get DATETIME_HUGE(){return pr}static get DATETIME_HUGE_WITH_SECONDS(){return gr}}function Ii(e){if(Ti.isDateTime(e))return e;if(e&&e.valueOf&&fr(e.valueOf()))return Ti.fromJSDate(e);if(e&&"object"==typeof e)return Ti.fromObject(e);throw new Hn(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const Di=({dismissModal:e,serverGroup:t})=>{const{result:n,status:r,error:a}=B((()=>Ke.getScalingActivities(t)),[],[t.id]),s="PENDING"===r;return dt.createElement(dt.Fragment,null,dt.createElement(Ue,null,`Scaling activities for ${t.name}`),dt.createElement(qe,null,dt.createElement("div",{className:"flex-1 heading-3"},s&&dt.createElement("div",{className:"horizontal center sp-margin-xl-yaxis"},dt.createElement(H,null)),!s&&Boolean(a)&&dt.createElement("div",{className:"horizontal center sp-margin-xl-yaxis"},dt.createElement("h4",null,`There was an error loading scaling activities for ${t.name}. Please try again later.`)),!s&&!a&&!Boolean(n.length)&&dt.createElement("div",{className:"horizontal center sp-margin-xl-yaxis"},dt.createElement("h4",null,`No scaling activities found for ${t.name}.`)),!s&&!a&&Boolean(n.length)&&dt.createElement("div",{className:"middle sp-margin-xl-yaxis"},n.map(((e,t)=>{var n;return dt.createElement("div",{key:`${t}-${e.jobId}`,className:"sp-margin-xl-yaxis"},dt.createElement("p",{className:"clearfix"},dt.createElement("span",{className:`label label-${"KillInitiated"!==e.jobState?"success":"danger"} pull-left`},e.jobState),dt.createElement("span",{className:"label label-default pull-right"},(e=>{const t=new Date(e);return Ti.fromJSDate(t).toFormat("yyyy-MM-dd HH:mm:ss ZZZZ")})(e.date))),dt.createElement("p",null,`${e.reasonMessage} Desired capacity is ${(null==(n=e.capacity)?void 0:n.desired)||"unknown"}.`))}))))),dt.createElement(Je,{primaryActions:dt.createElement("button",{className:"btn btn-primary",onClick:e},"Close")}))};var xi=Object.defineProperty,Pi=Object.getOwnPropertyDescriptor;let Oi=class extends mt.Component{render(){const{serverGroup:e,app:t}=this.props,{capacity:n}=e,r=e.instances.length,a=n.min===n.max;return mt.createElement(mt.Fragment,null,mt.createElement("dl",{className:"dl-horizontal dl-narrow"},mt.createElement(Xe,{capacity:n,simpleMode:a}),mt.createElement(Ye,{currentCapacity:r}),e.capacityGroup&&mt.createElement(mt.Fragment,null,mt.createElement("dt",null,"Cap. Group"),mt.createElement("dd",null,e.capacityGroup))),mt.createElement("div",null,mt.createElement("a",{className:"clickable",onClick:()=>_e(e,t).then((n=>{n&&Me.show(Fn,{serverGroup:e,application:t})}))},"Resize Server Group")),mt.createElement("div",null,mt.createElement("a",{className:"clickable",onClick:()=>Qe(Di,{serverGroup:e},{maxWidth:"1000px"})},"View Scaling Activities")))}};Oi=((e,t,n,r)=>{for(var a,s=r>1?void 0:r?Pi(t,n):t,i=e.length-1;i>=0;i--)(a=e[i])&&(s=(r?a(t,n,s):a(s))||s);return r&&s&&xi(t,n,s),s})([$e("titus.serverGroup.CapacityDetailsSection")],Oi);const Li=({config:e,serverGroup:t,unit:n,updateUnit:r})=>{const[a,s]=dt.useState({alarmName:null,alarmArn:null,metricName:null,namespace:null,statistic:"Average",dimensions:[],period:60,threshold:e.targetValue,comparisonOperator:"GreaterThanThreshold",okactions:[],insufficientDataActions:[],alarmActions:[],evaluationPeriods:null,alarmDescription:null,unit:null});dt.useEffect((()=>{(()=>{const t=null==e?void 0:e.customizedMetricSpecification,n={...a,dimensions:null==t?void 0:t.dimensions,metricName:null==t?void 0:t.metricName,namespace:null==t?void 0:t.namespace,statistic:null==t?void 0:t.statistic,threshold:null==e?void 0:e.targetValue};s(n)})()}),[e]);return dt.createElement(p,{alarm:a,onChartLoaded:e=>{n&&r(e.unit)},serverGroup:t})},Mi={buildAlarm:(e,t)=>{const n=null==e?void 0:e.alarms[0];return{comparisonOperator:n.comparisonOperator,region:t,dimensions:n.dimensions,disableEditingDimensions:n.disableEditingDimensions,evaluationPeriods:n.evaluationPeriods,metricName:n.metricName,namespace:n.namespace,period:n.period,statistic:n.statistic,threshold:n.threshold,unit:n.unit}},buildStepPolicy:(e,t,n)=>({cooldown:n||600,estimatedInstanceWarmup:null,metricAggregationType:"Average",stepAdjustments:e.stepAdjustments.map((e=>{const n={scalingAdjustment:Math.abs(e.scalingAdjustment)};return void 0!==e.metricIntervalUpperBound&&(n.metricIntervalUpperBound=e.metricIntervalUpperBound+t),void 0!==e.metricIntervalLowerBound&&(n.metricIntervalLowerBound=e.metricIntervalLowerBound+t),n}))}),buildNewCommand:(e,t,n)=>{const r={adjustmentType:"Step"===e?n.adjustmentType:null,cloudProvider:t.cloudProvider,credentials:t.account,jobId:t.id,name:n.id,region:t.region,scalingPolicyID:n.id,serverGroupName:t.name};return"Step"===e&&(r.alarm=Mi.buildAlarm(n,t.region),r.minAdjustmentMagnitude=n.minAdjustmentMagnitude||1,r.step=Mi.buildStepPolicy(n,r.alarm.threshold,n.cooldown)),"TargetTracking"===e&&(r.targetTrackingConfiguration={...n.targetTrackingConfiguration}),r},prepareCommandForUpsert:(e,t)=>{const n=Nt(e);return"PercentChangeInCapacity"!==n.adjustmentType&&delete n.minAdjustmentMagnitude,n.step?n.step.stepAdjustments.forEach((e=>{t&&(e.scalingAdjustment=0-e.scalingAdjustment,delete n.step.estimatedInstanceWarmup),void 0!==e.metricIntervalLowerBound&&(e.metricIntervalLowerBound-=n.alarm.threshold),void 0!==e.metricIntervalUpperBound&&(e.metricIntervalUpperBound-=n.alarm.threshold)})):t&&(e.simple.scalingAdjustment=0-e.simple.scalingAdjustment),n}},Fi=({app:e,closeModal:t,dismissModal:n,policy:r,serverGroup:a})=>{var s;const[i,o]=dt.useState(Boolean(null==(s=r.targetTrackingConfiguration)?void 0:s.customizedMetricSpecification)),[l,c]=dt.useState({});dt.useEffect((()=>{const e=Mi.buildNewCommand("TargetTracking",a,r);c(e)}),[]);const u=r.id?"Update":"Create";return dt.createElement(et,{closeModal:t,dismissModal:n,title:`${u} scaling policy`,application:e,description:`${u} scaling policy for ${a.name}`,initialValues:l,mapValuesToTask:()=>({application:e,job:[{type:"upsertScalingPolicy",...l}]}),render:()=>dt.createElement("div",{className:"modal-body"},dt.createElement("h4",{className:"section-heading"},"Target Metric"),dt.createElement(g,{allowDualMode:!1,cloudwatch:!0,command:l,isCustomMetric:i,serverGroup:a,toggleMetricType:e=>o("custom"===e),updateCommand:c}),dt.createElement("h4",{className:"section-heading"},"Additional Settings"),dt.createElement(h,{command:l,cooldowns:!0,policyName:r.policyName,updateCommand:c}))})},zi=({app:e,closeModal:t,dismissModal:n,policy:r,serverGroup:a})=>{var s,i,o;const[l,c]=dt.useState({});dt.useEffect((()=>{const e=Mi.buildNewCommand("Step",a,r);c(e)}),[]);const u=(null==(s=r.stepAdjustments)?void 0:s.length)?r.stepAdjustments[0].scalingAdjustment:r.scalingAdjustment,[d,m]=dt.useState("ExactCapacity"===l.adjustmentType?"Set to":u>0?"Add":"Remove"),p="ExactCapacity"===l.adjustmentType||"ChangeInCapacity"===l.adjustmentType?"instances":"percent of group",g=r.id?"Edit":"Create",h=0===(null==(o=null==(i=null==l?void 0:l.alarm)?void 0:i.comparisonOperator)?void 0:o.indexOf("Greater"))?"max":"min",b=e=>{const t=Nt(l);t.step.stepAdjustments=e,(e=>{const t="min"===h?"metricIntervalLowerBound":"metricIntervalUpperBound",n="metricIntervalLowerBound"===t?"metricIntervalUpperBound":"metricIntervalLowerBound",r=e.stepAdjustments;(r||[]).forEach(((e,a)=>{r.length>a+1&&(r[a+1][n]=e[t])})),delete r[r.length-1][t]})(t.step),c(t)},C=(e,t)=>{m(e);const n="instances"!==t?"PercentChangeInCapacity":"Set to"===e?"ExactCapacity":"ChangeInCapacity";c({...l,adjustmentType:n})};return dt.createElement(et,{closeModal:t,dismissModal:n,title:`${g} scaling policy`,application:e,description:`${g} scaling policy for ${a.name}`,initialValues:l,mapValuesToTask:()=>{const t=Mi.prepareCommandForUpsert(l,"Remove"===d);return{application:e,job:[{type:t.type||"upsertScalingPolicy",...t}]}},render:()=>{var e,t,n;return dt.createElement("div",null,dt.createElement("h4",{className:"section-heading"},"Conditions"),dt.createElement("div",{className:"section-body"},dt.createElement("p",null,dt.createElement("b",null,"Note:"),' metrics must be sent to Amazon CloudWatch before they can be used in auto scaling. If you do not see a metric below, click "Configure available metrics" in the server group details to set up forwarding from Atlas to CloudWatch.'),dt.createElement(f,{alarm:l.alarm,multipleAlarms:Boolean((null==(e=null==r?void 0:r.alarms)?void 0:e.length)>1),serverGroup:a,stepAdjustments:l.step.stepAdjustments,stepsChanged:b,updateAlarm:e=>c({...l,alarm:e})})),dt.createElement("h4",{className:"section-heading"},"Actions"),dt.createElement("div",{className:"section-body"},!(null==(t=l.alarm)?void 0:t.metricName)&&dt.createElement("h4",{className:"text-center"},"Select a metric"),(null==(n=l.alarm)?void 0:n.metricName)&&dt.createElement(v,{adjustmentType:p,adjustmentTypeChanged:C,alarm:l.alarm,isMin:"min"===h,operator:d,step:l.step,stepsChanged:b})),dt.createElement(y,{command:l,isInstanceType:"instances"===p,isNew:Boolean(!r.policyARN),operator:d,updateCommand:c}))}})};t("titus.servergroup.details.capacitydetailssection",[]).component("titusCapacityDetailsSection",jt(tt(Oi,"titusCapacityDetailsSection"),["serverGroup","app"]));var ji=Object.defineProperty,Bi=Object.getOwnPropertyDescriptor;let Ri=class extends mt.Component{render(){if(!this.props.serverGroup||!this.props.serverGroup.image)return null;const{serverGroup:{image:e,entryPoint:t,iamProfile:n,resources:r}}=this.props;return mt.createElement(S,{className:"horizontal-when-filters-collapsed"},e.dockerImageName&&mt.createElement(k,{label:"Image Name",value:e.dockerImageName}),e.dockerImageVersion&&mt.createElement(k,{label:"Image Version",value:e.dockerImageVersion}),t&&mt.createElement(k,{label:"Entrypoint",value:t}),n&&mt.createElement(k,{label:"IAM Profile",value:n}),mt.createElement(k,{label:"CPU(s)",value:r.cpu}),mt.createElement(k,{label:"Memory",value:`${r.memory} MB`}),mt.createElement(k,{label:"Disk",value:`${r.disk} MB`}),mt.createElement(k,{label:"Network",value:`${r.networkMbps} Mbps`}),mt.createElement(k,{label:"GPU(s)",value:r.gpu}))}};Ri=((e,t,n,r)=>{for(var a,s=r>1?void 0:r?Bi(t,n):t,i=e.length-1;i>=0;i--)(a=e[i])&&(s=(r?a(t,n,s):a(s))||s);return r&&s&&ji(t,n,s),s})([$e("titus.serverGroup.launchConfigSection")],Ri);t("titus.servergroup.details.launchConfigSection",[]).component("titusLaunchConfigSection",jt(tt(Ri,"titusLaunchConfigSection"),["serverGroup"]));class Vi extends mt.Component{static show(e){return Me.show(Vi,e)}submit(e,t){const{application:n,serverGroup:r}=this.props,a={type:"upsertDisruptionBudget",cloudProvider:"titus",credentials:r.account,region:r.region,jobId:r.id,disruptionBudget:e.disruptionBudget};t.submit((()=>nt.executeTask({job:[a],application:n,description:`Update Disruption Budget for ${r.name}`})))}render(){const{application:e,command:t,dismissModal:n}=this.props,r=new Le({application:e,title:"Updating Job Disruption Budget",modalInstance:Le.modalInstanceEmulation((()=>n())),onTaskComplete:()=>e.serverGroups.refresh()});return mt.createElement(mt.Fragment,null,mt.createElement(Re,{monitor:r}),mt.createElement(Ge,{initialValues:t,onSubmit:e=>this.submit(e,r),render:t=>mt.createElement(mt.Fragment,null,mt.createElement(Ve,{dismiss:n}),mt.createElement(zt.Header,null,mt.createElement(zt.Title,null,"Update Disruption Budget")),mt.createElement(zt.Body,null,mt.createElement(Nn,{formik:t,app:e})),mt.createElement(zt.Footer,null,mt.createElement("button",{className:"btn btn-default",onClick:n,type:"button"},"Cancel"),mt.createElement(rt,{onClick:()=>this.submit(t.values,r),isDisabled:!t.isValid,isFormSubmit:!0,submitting:!1,label:"Update Budget"})))}))}}class Wi extends mt.Component{constructor(){super(...arguments),this.SectionHeading=({budget:e,options:t,label:n})=>{const r=t.find((t=>!!e[t.field]));return r?mt.createElement("div",null,mt.createElement("div",{className:"bold"},n),r.label," ",mt.createElement(ae,{content:r.description})):null},this.Policy=({budget:e})=>{const{ParentheticalDuration:t}=this;return e.availabilityPercentageLimit?mt.createElement("div",null,mt.createElement("div",{className:"bold"},"Percentage of Healthy Containers"),e.availabilityPercentageLimit.percentageOfHealthyContainers," percent"):e.relocationLimit?mt.createElement("div",null,mt.createElement("div",{className:"bold"},"Limit"),e.relocationLimit.limit," task",1!==e.relocationLimit.limit&&"s"):e.unhealthyTasksLimit?mt.createElement("div",null,mt.createElement("div",{className:"bold"},"Limit of Unhealthy Containers"),e.unhealthyTasksLimit.limitOfUnhealthyContainers," container",1!==e.unhealthyTasksLimit.limitOfUnhealthyContainers&&"s"):e.selfManaged?mt.createElement("div",null,mt.createElement("div",{className:"bold"},"Relocation Time"),e.selfManaged.relocationTimeMs>0&&mt.createElement(t,{durationMs:e.selfManaged.relocationTimeMs}),0===e.selfManaged.relocationTimeMs&&"0 ms (immediate)"):null},this.ParentheticalDuration=({durationMs:e})=>mt.createElement("span",null,e," ms",e>1e3&&` (${Bt(e)})`),this.Rate=({budget:e})=>{const{ParentheticalDuration:t}=this;return e.ratePerInterval?mt.createElement(mt.Fragment,null,mt.createElement("div",null,mt.createElement("div",{className:"bold"},"Interval"),mt.createElement(t,{durationMs:e.ratePerInterval.intervalMs})),mt.createElement("div",null,mt.createElement("div",{className:"bold"},"Limit"),e.ratePerInterval.limitPerInterval," task",1!==e.ratePerInterval.limitPerInterval&&"s")):e.ratePercentagePerInterval?mt.createElement(mt.Fragment,null,mt.createElement("div",null,mt.createElement("div",{className:"bold"},"Interval"),mt.createElement(t,{durationMs:e.ratePercentagePerInterval.intervalMs})),mt.createElement("div",null,mt.createElement("div",{className:"bold"},"Percentage per Interval"),e.ratePercentagePerInterval.percentageLimitPerInterval," percent")):null},this.groupedDays=e=>{const t=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=e.sort(((e,n)=>t.indexOf(e)-t.indexOf(n))),r=[],a=[];return t.slice(t.indexOf(n[0])).forEach((e=>{n.includes(e)?a.push(e):a.length&&(r.push(this.toDayRangeString(a)),a.length=0)})),a.length&&r.push(this.toDayRangeString(a)),r.join(", ")},this.TimeWindows=({budget:e})=>{const{groupedDays:t}=this,n=e.timeWindows&&e.timeWindows.length>0;return mt.createElement(mt.Fragment,null,mt.createElement("div",{className:"bold"},"When can disruption occur?"),mt.createElement("div",null,n&&e.timeWindows.map(((e,n)=>e.hourlyTimeWindows.map(((r,a)=>mt.createElement("div",{key:`${n}.${a}`},t(e.days),", ",r.startHour,":00 - ",r.endHour,":00 ",e.timeZone))))),!n&&"Any time"))},this.editBudget=()=>{const{app:e,serverGroup:t}=this.props;Zt.titusServerGroupCommandBuilder.buildServerGroupCommandFromExisting(e,t).then((n=>{Vi.show({command:n,application:e,serverGroup:t})}))}}toDayRangeString(e){return e.length?1===e.length?e[0].substr(0,3):`${e[0].substr(0,3)}-${e[e.length-1].substr(0,3)}`:null}render(){const{Policy:e,SectionHeading:t,Rate:n,TimeWindows:r}=this,a=this.props.serverGroup,s=!a.migrationPolicy||"SystemDefault"===a.migrationPolicy.type,i=yn(this.props.app),o=a.disruptionBudget||i,l=!s&&Gt(o,i);return mt.createElement(mt.Fragment,null,mt.createElement(kn,null),l&&mt.createElement("div",null,"(default policy)"),mt.createElement("div",{className:"bottom-border"},mt.createElement(t,{budget:o,options:Cn,label:"Policy"}),mt.createElement(e,{budget:o})),mt.createElement("div",{className:"bottom-border"},mt.createElement(t,{budget:o,options:En,label:"Rate"}),mt.createElement(n,{budget:o})),mt.createElement(r,{budget:o}),mt.createElement("div",{className:"sp-margin-l-top"},mt.createElement("a",{className:"clickable",onClick:this.editBudget},"Edit Disruption Budget")))}}t("spinnaker.titus.disruptionbudget.section",[]).component("titusDisruptionBudgetSection",jt(tt(Wi,"titusDisruptionBudgetSection"),["serverGroup","app"]));t("spinnaker.titus.serverGroup.details.rollback.controller",[at]).controller("titusRollbackServerGroupCtrl",["$scope","$uibModalInstance","serverGroupWriter","application","serverGroup","previousServerGroup","disabledServerGroups","allServerGroups",function(e,t,n,r,a,s,i,o){e.serverGroup=a,e.disabledServerGroups=i.sort(((e,t)=>t.name.localeCompare(e.name))),e.allServerGroups=o.sort(((e,t)=>t.name.localeCompare(e.name))),e.verification={};const l=a.capacity.desired;let c,u="EXPLICIT";if(0===o.length&&a.entityTags){const t=yt(a,"entityTags.creationMetadata.value.previousServerGroup");t&&(u="PREVIOUS_IMAGE",e.previousServerGroup={name:t.name,imageName:t.imageName},t.imageId&&t.imageId!==t.imageName&&(e.previousServerGroup.imageId=t.imageId))}c=l<10?100:l<20?90:95,e.command={rollbackType:u,rollbackContext:{imageId:s?s.imageId:void 0,rollbackServerGroupName:a.name,restoreServerGroupName:s?s.name:void 0,targetHealthyRollbackPercentage:c,delayBeforeDisableSeconds:0},targetGroups:a.targetGroups,securityGroups:a.securityGroups},e.minHealthy=function(e){return Math.ceil(l*e/100)},r&&r.attributes&&(r.attributes.platformHealthOnlyShowOverride&&r.attributes.platformHealthOnly&&(e.command.interestingHealthProviderNames=["Titus"]),e.command.platformHealthOnlyShowOverride=r.attributes.platformHealthOnlyShowOverride),this.isValid=function(){const t=e.command;return!!e.verification.verified&&("PREVIOUS_IMAGE"===u||void 0!==t.rollbackContext.restoreServerGroupName)},e.taskMonitor=new Le({application:r,title:"Rollback "+a.name,modalInstance:t}),this.rollback=function(){if(!this.isValid())return;e.taskMonitor.submit((function(){return n.rollbackServerGroup(a,r,e.command)}))},this.cancel=function(){t.dismiss()},this.label=function(e){if(!e)return"";if(!e.buildInfo||!e.buildInfo.images)return e.name;let t=e.buildInfo.images[0];return t.indexOf("/")>0&&(t=t.substring(t.indexOf("/")+1)),e.name+" ("+t+")"},this.group=function(e){return e.isDisabled?"Disabled Server Groups":"Enabled Server Groups"}}]);class Hi extends mt.Component{constructor(e){super(e),this.handleClick=()=>{this.setState({showSelection:!0})},this.typeSelected=e=>{this.setState({typeSelection:e,showSelection:!1,showModal:!0}),"step"===e&&this.createStepPolicy(),"targetTracking"===e&&this.createTargetTrackingPolicy()},this.showModalCallback=()=>{this.setState({showSelection:!1,showModal:!1,typeSelection:null})},this.state={showSelection:!1,showModal:!1,typeSelection:null,awsAccount:null},T.getAccountDetails(e.serverGroup.account).then((e=>{this.setState({awsAccount:e.awsAccount})}))}createStepPolicy(){const{serverGroup:e,application:t}=this.props,n={app:t,policy:Zt.titusServerGroupTransformer.constructNewStepScalingPolicyTemplate(e),serverGroup:e};Me.show(zi,n,{dialogClassName:"wizard-modal modal-lg"})}createTargetTrackingPolicy(){const{serverGroup:e,application:t}=this.props,n={app:t,policy:Zt.titusServerGroupTransformer.constructNewTargetTrackingPolicyTemplate(e),serverGroup:e};Me.show(Fi,n,{dialogClassName:"wizard-modal modal-lg"})}render(){const{min:e,max:t}=this.props.serverGroup.capacity;return mt.createElement("div",null,this.state.awsAccount?mt.createElement("a",{className:"clickable",onClick:this.handleClick},"Create new scaling policy"):null,this.state.showSelection&&mt.createElement(b,{warnOnMinMaxCapacity:e===t,typeSelectedCallback:this.typeSelected,showCallback:this.showModalCallback}))}}t("spinnaker.titus.serverGroup.details.scaling.policy.button",[]).component("titusCreateScalingPolicyButton",jt(tt(Hi,"titusCreateScalingPolicyButton"),["application","serverGroup"]));const Zi=O((()=>null),"titus.serverGroup.details.customScaling");t("spinnaker.application.titus.serverGroup.customScaling.component",[]).component("titusCustomScalingPolicy",jt(tt(Zi,"titusCustomScalingPolicy"),["application","serverGroup"]));t("spinnaker.titus.scalingPolicy.module",["spinnaker.titus.serverGroup.details.scaling.policy.button","spinnaker.application.titus.serverGroup.customScaling.component"]);const Ui=e=>{const{application:t,serverGroup:n}=e,{region:r,id:a,account:s,cloudProvider:i}=n,o=(l=n.serviceJobProcesses,Object.keys(l).reduce(((e,t)=>(l[t]&&e.push(t),e)),[]));var l;return mt.createElement(et,{...e,title:`Modify Service Job Processes for ${n.name}`,description:`Update Service Job Processes for ${n.name}`,initialValues:{serviceJobProcesses:o},render:()=>mt.createElement(mt.Fragment,null,mt.createElement(de,{label:"Service Job Processes",name:"serviceJobProcesses",input:e=>mt.createElement(be,{...e,options:Object.keys(n.serviceJobProcesses).map((e=>({value:e,label:ye(e)})))})}),mt.createElement(de,{label:"Reason",name:"reason",input:e=>mt.createElement(st,{...e,rows:3,placeholder:"(Optional) anything that might be helpful to explain the reason for this change; HTML is okay"})})),mapValuesToTask:({serviceJobProcesses:e,reason:o})=>({job:[{type:"updateJobProcesses",serviceJobProcesses:Object.keys(n.serviceJobProcesses).reduce(((t,n)=>(t[n]=!!e.includes(n),t)),{}),reason:o,region:r,jobId:a,credentials:s,cloudProvider:i}],application:t.name})})};class qi extends mt.Component{constructor(){super(...arguments),this.toggleServiceJobProcesses=()=>{const{app:e,serverGroup:t}=this.props;Me.show(Ui,{application:e,serverGroup:t})}}render(){const{serviceJobProcesses:e}=this.props.serverGroup;return mt.createElement(mt.Fragment,null,mt.createElement("ul",{className:"scaling-processes"},Object.keys(e).map((t=>mt.createElement("li",{key:t},mt.createElement("span",{style:{visibility:e[t]?"visible":"hidden"},className:"fa fa-check small"}),mt.createElement("span",{className:e[t]?"":"text-disabled"},ye(t)," "))))),mt.createElement("a",{className:"clickable",onClick:this.toggleServiceJobProcesses},"Edit Service Job Processes"))}}t("spinnaker.titus.servicejobprocesses.section",[]).component("titusServiceJobProcessesSection",jt(tt(qi,"titusServiceJobProcessesSection"),["serverGroup","app"]));t("spinnaker.titus.serverGroup.details.packageDetails.component",[]).component("titusPackageDetailsSection",jt(tt((({buildInfo:e})=>{var t,n;const r=e.jenkins||{},a=Boolean(Object.keys(r).length),{commitId:s,host:i,name:o,number:l,version:c}=r,u=`${i}job/${o}/${l}`;return dt.createElement(w,{heading:"Package"},!a&&dt.createElement("div",null,"No package information available."),a&&dt.createElement(S,{className:"horizontal-when-filters-collapsed"},o&&dt.createElement(k,{label:"Job",value:o}),(null==(t=e.docker)?void 0:t.image)&&dt.createElement(k,{label:"Image Name",value:null==(n=e.docker)?void 0:n.image}),l&&dt.createElement(k,{label:"Build",value:l}),s&&dt.createElement(k,{label:"Commit",value:s.substring(0,8)}),c&&dt.createElement(k,{label:"Version",value:c}),i&&dt.createElement(k,{label:"Build Link",value:dt.createElement("a",{target:"_blank",href:u},u)})))}),"titusPackageDetailsSection"),["buildInfo"]));t("spinnaker.titus.serverGroup.details.securityGroups.component",[]).component("titusSecurityGroups",jt(tt(Ut,"titusSecurityGroups"),["app","serverGroup"]));e.module("spinnaker.serverGroup.details.titus.controller",[It,"spinnaker.titus.serverGroupCommandBuilder.service","spinnaker.titus.disruptionbudget.section",at,"spinnaker.titus.serverGroup.details.rollback.controller","spinnaker.titus.servicejobprocesses.section","spinnaker.titus.scalingPolicy.module","spinnaker.titus.serverGroup.details.securityGroups.component","spinnaker.titus.serverGroup.details.packageDetails.component"]).controller("titusServerGroupDetailsCtrl",["$scope","$state","$templateCache","$interpolate","app","serverGroup","titusServerGroupCommandBuilder","$uibModal","serverGroupWriter","awsServerGroupTransformer",function(t,n,r,a,s,i,o,l,c,u){const d=s;function m(){const n=ft.find(d.serverGroups.data,(function(e){return e.name===i.name&&e.account===i.accountId&&e.region===i.region}));return Ke.getServerGroup(d.name,i.accountId,i.region,i.name).then((function(r){t.state.loading=!1,r.account=i.accountId,T.getAccountDetails(r.account).then((e=>{r.apiEndpoint=ft.filter(e.regions,{name:r.region})[0].endpoint})),t.buildInfo=r.buildInfo,e.extend(r,n),t.serverGroup=r;const a=t.serverGroup.labels;var s;delete a.name,delete a.source,delete a.spinnakerAccount,delete a[""],Object.keys(a).forEach((e=>{e.startsWith("titus.")&&delete a[e]})),t.labels=a,(s=r).scalingPolicies=(s.scalingPolicies||[]).map((e=>{const{policy:t}=e,{stepPolicyDescriptor:n,targetPolicyDescriptor:r}=t,a=n?"StepScaling":"TargetTrackingScaling";if(n){const t=n.alarmConfig;t.period=t.periodSec,t.namespace=t.metricNamespace,t.disableEditingDimensions=!0,"NFLX/EPIC"!==t.metricNamespace||t.dimensions||(t.dimensions=[{name:"AutoScalingGroupName",value:s.name}]),t.dimensions||(t.dimensions=[]);const r=ft.cloneDeep(n.scalingPolicy);return r.cooldown=r.cooldownSec,r.policyType=a,r.alarms=[t],r.id=e.id,r.stepAdjustments&&r.stepAdjustments.forEach((e=>{e.metricIntervalUpperBound=ft.get(e,"metricIntervalUpperBound",e.MetricIntervalUpperBound),e.metricIntervalLowerBound=ft.get(e,"metricIntervalLowerBound",e.MetricIntervalLowerBound)})),r}{const{customizedMetricSpecification:n}=r;return void 0===n.dimensions&&(n.dimensions=[]),t.id=e.id,t.targetTrackingConfiguration=t.targetPolicyDescriptor,t.targetTrackingConfiguration.scaleOutCooldown=t.targetTrackingConfiguration.scaleOutCooldownSec,t.targetTrackingConfiguration.scaleInCooldown=t.targetTrackingConfiguration.scaleInCooldownSec,t}})).map((e=>u.transformScalingPolicy(e))),ft.isEmpty(t.serverGroup)?p():g()}),p)}function p(){t.$$destroyed||n.go("^",{allowModalToStayOpen:!0},{location:"replace"})}this.application=s,t.gateUrl=V.gateUrl,t.state={loading:!0},m().then((()=>{t.$$destroyed||s.serverGroups.onRefresh(t,m)})).catch((()=>{})),T.getAccountDetails(i.accountId).then((e=>{const n=e.awsAccount;t.titusUiEndpoint=ft.filter(e.regions,{name:i.region})[0].endpoint,T.getAccountDetails(n).then((e=>{this.awsAccountId=e.accountId,this.env=e.environment}))}));const g=()=>{this.entityTagTargets=it.buildClusterTargets(t.serverGroup)};this.destroyServerGroup=function(){const e=t.serverGroup,r={application:d,title:"Destroying "+e.name,onTaskComplete:function(){n.includes("**.serverGroup",a)&&n.go("^")}},a={name:e.name,accountId:e.account,region:e.region},i={header:"Really destroy "+e.name+"?",buttonText:"Destroy "+e.name,account:e.account,taskMonitorConfig:r,platformHealthOnlyShowOverride:s.attributes.platformHealthOnlyShowOverride,platformHealthType:"Titus",submitMethod:function(){return c.destroyServerGroup(e,d,{cloudProvider:"titus",serverGroupName:e.name,region:e.region})}};ot.addDestroyWarningMessage(s,e,i),_e(e,s).then((e=>e&&x.confirm(i)))},this.disableServerGroup=function(){const e=t.serverGroup,n={application:d,title:"Disabling "+e.name},r={header:"Really disable "+e.name+"?",buttonText:"Disable "+e.name,account:e.account,taskMonitorConfig:n,platformHealthOnlyShowOverride:s.attributes.platformHealthOnlyShowOverride,platformHealthType:"Titus",submitMethod:function(){return c.disableServerGroup(e,d,{cloudProvider:"titus",serverGroupName:e.name,region:e.region,zone:e.zones[0]})}};ot.addDisableWarningMessage(s,e,r),_e(e,s).then((e=>e&&x.confirm(r)))},this.enableServerGroup=()=>{_e(i,s).then((e=>{if(!e)return;if(!this.isRollbackEnabled())return void this.showEnableServerGroupModal();const t={header:"Rolling back?",body:"Spinnaker provides an orchestrated rollback feature to carefully restore a different version of this\n server group. Do you want to use the orchestrated rollback?",buttonText:"Yes, take me to the rollback settings modal",cancelButtonText:"No, I just want to enable the server group"};x.confirm(t).then((()=>new Promise((e=>setTimeout(e,500))))).then((()=>this.rollbackServerGroup())).catch((({source:e})=>{"footer"===e&&this.showEnableServerGroupModal()}))}))},this.resizeServerGroup=()=>{_e(i,s).then((e=>{e&&Me.show(Fn,{serverGroup:t.serverGroup,application:d})}))},this.showEnableServerGroupModal=()=>{const e=t.serverGroup,n={application:d,title:"Enabling "+e.name},r={header:"Really enable "+e.name+"?",buttonText:"Enable "+e.name,account:e.account,taskMonitorConfig:n,platformHealthOnlyShowOverride:s.attributes.platformHealthOnlyShowOverride,platformHealthType:"Titus",submitMethod:function(){return c.enableServerGroup(e,d,{cloudProvider:"titus",serverGroupName:e.name,region:e.region,zone:e.zones[0]})}};x.confirm(r)},this.cloneServerGroup=function(){Zt.titusServerGroupCommandBuilder.buildServerGroupCommandFromExisting(d,t.serverGroup).then((e=>{const t=`Clone ${i.name}`;Tn.show({title:t,application:d,command:e})}))},this.isRollbackEnabled=function(){const e=t.serverGroup;return!e.isDisabled||d.getDataSource("serverGroups").data.some((t=>t.cluster===e.cluster&&t.region===e.region&&t.account===e.account&&!1===t.isDisabled))},this.rollbackServerGroup=function(){let e,n=t.serverGroup,r=s.getDataSource("serverGroups").data.filter((e=>e.cluster===n.cluster&&e.region===n.region&&e.account===n.account));n.isDisabled&&(e=n,n=ft.orderBy(r.filter((t=>t.name!==e.name&&!t.isDisabled)),["instanceCounts.total","createdTime"],["desc","desc"])[0]),r=r.filter((e=>e.name!==n.name)),1!==r.length||e||(e=r[0]),_e(n,s).then((t=>{t&&l.open({templateUrl:"titus/src/serverGroup/details/rollback/rollbackServerGroup.html",controller:"titusRollbackServerGroupCtrl as ctrl",resolve:{serverGroup:()=>n,previousServerGroup:()=>e,disabledServerGroups:()=>{const e=ft.find(d.clusters,{name:n.cluster,account:n.account});return ft.filter(e.serverGroups,{isDisabled:!0,region:n.region})},allServerGroups:()=>r,application:()=>d}})}))}}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/rollback/rollbackServerGroup.html",'<div modal-page class="confirmation-modal">\n <task-monitor monitor="taskMonitor"></task-monitor>\n <form role="form">\n <modal-close dismiss="$dismiss()"></modal-close>\n <div class="modal-header">\n <h4 class="modal-title">Rollback {{serverGroup.name}}</h4>\n </div>\n <div class="modal-body confirmation-modal">\n <div class="row">\n <div class="col-sm-3 sm-label-right">Restore to</div>\n <div class="col-sm-7">\n <ui-select\n ng-model="command.rollbackContext.restoreServerGroupName"\n class="form-control input-sm"\n ng-if="command.rollbackType === \'EXPLICIT\'"\n >\n <ui-select-match placeholder="Select...">{{ctrl.label($select.selected)}}</ui-select-match>\n <ui-select-choices group-by="ctrl.group" repeat="serverGroup.name as serverGroup in allServerGroups">\n <span ng-bind-html="ctrl.label(serverGroup)"></span>\n </ui-select-choices>\n </ui-select>\n <div ng-if="command.rollbackType === \'PREVIOUS_IMAGE\'" style="margin-top: 5px">\n {{ previousServerGroup.name }} <span class="small">(no longer deployed)</span><br />\n <span class="small">\n <strong>Image</strong>: {{ previousServerGroup.imageName}}\n <span ng-if="previousServerGroup.imageId">({{ previousServerGroup.imageId }})</span><br />\n </span>\n </div>\n </div>\n </div>\n\n <div class="row" ng-if="command.platformHealthOnlyShowOverride">\n <div class="col-sm-10 col-sm-offset-1">\n <platform-health-override\n command="command"\n platform-health-type="\'Titus\'"\n show-help-details="true"\n field-columns="12"\n >\n </platform-health-override>\n </div>\n </div>\n\n <task-reason command="command"></task-reason>\n\n <div class="row">\n <div class="col-sm-11 col-sm-offset-1">\n Wait\n <input\n placeholder="0"\n min="0"\n type="number"\n ng-model="command.rollbackContext.delayBeforeDisableSeconds"\n class="form-control input-sm inline-number"\n />\n seconds before disabling <em>{{ ctrl.label(serverGroup) }}</em>.\n </div>\n </div>\n\n <div class="row">\n <div class="col-sm-11 col-sm-offset-1">\n Consider rollback successful when\n <input\n type="number"\n min="0"\n max="100"\n ng-model="command.rollbackContext.targetHealthyRollbackPercentage"\n class="form-control input-sm inline-number"\n />\n percent of instances are healthy.\n </div>\n </div>\n\n <div class="row">\n <div class="col-sm-4 sm-label-right">Rollback Operations</div>\n </div>\n <div class="row" ng-if="command.rollbackType === \'EXPLICIT\'">\n <div class="col-sm-11 col-sm-offset-1">\n <ol>\n <li>Enable <em>{{ command.rollbackContext.restoreServerGroupName || \'previous server group\' }}</em></li>\n <li>\n Resize <em>{{ command.rollbackContext.restoreServerGroupName || \'previous server group\' }}</em> to [\n <strong>min</strong>: {{serverGroup.capacity.desired}}, <strong>max</strong>: {{ serverGroup.capacity.max\n }}, <strong>desired</strong>: {{ serverGroup.capacity.desired }} ]<br />(minimum capacity pinned at\n {{serverGroup.capacity.desired}} to prevent autoscaling down during rollback)\n </li>\n\n <li ng-if="command.rollbackContext.targetHealthyRollbackPercentage < 100">\n Wait for at least {{minHealthy(command.rollbackContext.targetHealthyRollbackPercentage)}} instances to\n report as healthy\n </li>\n <li>Disable {{ serverGroup.name }}</li>\n <li>\n Restore minimum capacity of\n <em>{{ command.rollbackContext.restoreServerGroupName || \'previous server group\' }}</em> [\n <strong>min</strong>: {{ serverGroup.capacity.min }} ]\n </li>\n </ol>\n <p>This rollback will affect server groups in {{ serverGroup.account }} ({{ serverGroup.region }}).</p>\n </div>\n </div>\n <div class="row" ng-if="command.rollbackType === \'PREVIOUS_IMAGE\'">\n <div class="col-sm-11 col-sm-offset-1">\n <ol>\n <li>\n Deploy <em>{{ previousServerGroup.imageId }}</em> [ <strong>min</strong>:\n {{serverGroup.capacity.desired}}, <strong>max</strong>: {{ serverGroup.capacity.max }},\n <strong>desired</strong>: {{ serverGroup.capacity.desired }} ]<br />(minimum capacity pinned at\n {{serverGroup.capacity.desired}} to prevent autoscaling down during deploy)\n </li>\n <li ng-if="command.rollbackContext.targetHealthyRollbackPercentage < 100">\n Wait for at least {{minHealthy(command.rollbackContext.targetHealthyRollbackPercentage)}} instances to\n report as healthy\n </li>\n <li>Disable <em>{{ serverGroup.name }}</em></li>\n <li>\n Restore minimum capacity of <em>new server group</em> [ <strong>min</strong>: {{ serverGroup.capacity.min\n }} ]\n </li>\n </ol>\n <p>This rollback will affect server groups in {{ serverGroup.account }} ({{ serverGroup.region }}).</p>\n </div>\n </div>\n </div>\n <aws-footer\n action="ctrl.rollback()"\n cancel="ctrl.cancel()"\n is-valid="ctrl.isValid()"\n account="serverGroup.account"\n verification="verification"\n ></aws-footer>\n </form>\n</div>\n')}]);t("spinnaker.titus.serverGroup.transformer",[]).factory("titusServerGroupTransformer",["$q",function(e){return{convertServerGroupCommandToDeployConfiguration:function(e){const t=ft.defaults({backingData:[],viewState:[]},e);return"clone"!==e.viewState.mode&&delete t.source,t.account=t.credentials,t.efs.mountPoint&&t.efs.efsId&&t.efs.mountPerm||delete t.efs,delete t.viewState,delete t.backingData,delete t.selectedProvider,t},normalizeServerGroup:function(e){return T.getCredentialsKeyedByAccount("titus").then((t=>(e.account&&t[e.account]&&(e.awsAccount=t[e.account].awsAccount),e)))},constructNewStepScalingPolicyTemplate:function(e){return{alarms:[{namespace:"NFLX/EPIC",metricName:"",threshold:50,statistic:"Average",comparisonOperator:"GreaterThanThreshold",evaluationPeriods:1,disableEditingDimensions:!0,dimensions:[{name:"AutoScalingGroupName",value:e.name}],period:60}],adjustmentType:"ChangeInCapacity",stepAdjustments:[{scalingAdjustment:1,metricIntervalLowerBound:0}],cooldown:300}},constructNewTargetTrackingPolicyTemplate:function(e){return{alarms:[],targetTrackingConfiguration:{targetValue:null,disableScaleIn:!1,customizedMetricSpecification:{namespace:"NFLX/EPIC",metricName:"",dimensions:[{name:"AutoScalingGroupName",value:e.name}]},scaleInCooldown:300,scaleOutCooldown:300}}}}}]);lt.registerValidator("titus",new class{validateSpecialCharacters(e,t){/^[a-zA-Z_0-9.]*$/g.test(e)||t.push("Only dot(.) and underscore(_) special characters are allowed.")}validateLength(e,t,n){if(e.length>250)n.push("The maximum length for an application in Titus is 250 characters.");else if(e.length>240)if(e.length>=248)t.push(`You will not be able to include a stack or detail field for clusters or ${D.get("firewalls")}.`);else{const n=248-e.length;t.push(`If you plan to include a stack or detail field for clusters, you will only\n have ~${n} characters to do so.`)}}validate(e=""){const t=[],n=[];return e&&e.length&&(this.validateSpecialCharacters(e,n),this.validateLength(e,t,n)),{warnings:t,errors:n}}});cn('.cloud-provider-logo .icon-titus {\n -webkit-mask-image: url("data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22 standalone%3D%22no%22%3F%3E%3Csvg width%3D%2247px%22 height%3D%2240px%22 viewBox%3D%220 0 47 40%22 version%3D%221.1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E %3Cg transform%3D%22translate(1.000000%2C 1.000000)%22%3E %3Cpath d%3D%22M30.8746%2C26.4746 C27.6746%2C26.4746 25.0746%2C23.8746 25.0746%2C20.6746 C25.0746%2C17.4746 27.6746%2C14.8746 30.8746%2C14.8746 C34.0746%2C14.8746 36.6746%2C17.4746 36.6746%2C20.6746 C36.5746%2C23.8746 34.0746%2C26.4746 30.8746%2C26.4746 M14.2746%2C26.4746 C11.0746%2C26.4746 8.4746%2C23.8746 8.4746%2C20.6746 C8.4746%2C17.4746 11.0746%2C14.8746 14.2746%2C14.8746 C17.4746%2C14.8746 20.0746%2C17.4746 20.0746%2C20.6746 C20.0746%2C23.8746 17.4746%2C26.4746 14.2746%2C26.4746 M38.6746%2C18.0746 L38.6746%2C2.1746 L37.5746%2C2.1746 L37.5746%2C7.5746 L34.8746%2C7.5746 C32.4746%2C3.1746 27.8746%2C0.1746 22.5746%2C0.1746 C17.2746%2C0.1746 12.6746%2C3.1746 10.2746%2C7.5746 L7.0746%2C7.5746 L7.0746%2C2.1746 L5.9746%2C2.1746 L5.9746%2C17.9746 C2.7746%2C17.9746 0.1746%2C20.5746 0.1746%2C23.7746 C0.1746%2C26.9746 2.7746%2C29.5746 5.9746%2C29.5746 C6.1746%2C29.5746 6.3746%2C29.4746 6.4746%2C29.4746 L6.4746%2C37.6746 L38.4746%2C37.6746 L38.4746%2C29.5746 C41.6746%2C29.5746 44.2746%2C26.9746 44.2746%2C23.7746 C44.3746%2C20.5746 41.7746%2C18.0746 38.6746%2C18.0746%22 id%3D%22Fill-1%22 fill%3D%22%23000000%22%3E%3C%2Fpath%3E %3Cpath d%3D%22M30.8746%2C26.4746 C27.6746%2C26.4746 25.0746%2C23.8746 25.0746%2C20.6746 C25.0746%2C17.4746 27.6746%2C14.8746 30.8746%2C14.8746 C34.0746%2C14.8746 36.6746%2C17.4746 36.6746%2C20.6746 C36.5746%2C23.8746 34.0746%2C26.4746 30.8746%2C26.4746 L30.8746%2C26.4746 Z M14.2746%2C26.4746 C11.0746%2C26.4746 8.4746%2C23.8746 8.4746%2C20.6746 C8.4746%2C17.4746 11.0746%2C14.8746 14.2746%2C14.8746 C17.4746%2C14.8746 20.0746%2C17.4746 20.0746%2C20.6746 C20.0746%2C23.8746 17.4746%2C26.4746 14.2746%2C26.4746 L14.2746%2C26.4746 Z M38.6746%2C18.0746 L38.6746%2C2.1746 L37.5746%2C2.1746 L37.5746%2C7.5746 L34.8746%2C7.5746 C32.4746%2C3.1746 27.8746%2C0.1746 22.5746%2C0.1746 C17.2746%2C0.1746 12.6746%2C3.1746 10.2746%2C7.5746 L7.0746%2C7.5746 L7.0746%2C2.1746 L5.9746%2C2.1746 L5.9746%2C17.9746 C2.7746%2C17.9746 0.1746%2C20.5746 0.1746%2C23.7746 C0.1746%2C26.9746 2.7746%2C29.5746 5.9746%2C29.5746 C6.1746%2C29.5746 6.3746%2C29.4746 6.4746%2C29.4746 L6.4746%2C37.6746 L38.4746%2C37.6746 L38.4746%2C29.5746 C41.6746%2C29.5746 44.2746%2C26.9746 44.2746%2C23.7746 C44.3746%2C20.5746 41.7746%2C18.0746 38.6746%2C18.0746 L38.6746%2C18.0746 Z%22 id%3D%22Stroke-3%22 stroke%3D%22%23000000%22 stroke-width%3D%222.349%22%3E%3C%2Fpath%3E %3C%2Fg%3E%3C%2Fsvg%3E");\n mask-image: url("data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22 standalone%3D%22no%22%3F%3E%3Csvg width%3D%2247px%22 height%3D%2240px%22 viewBox%3D%220 0 47 40%22 version%3D%221.1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E %3Cg transform%3D%22translate(1.000000%2C 1.000000)%22%3E %3Cpath d%3D%22M30.8746%2C26.4746 C27.6746%2C26.4746 25.0746%2C23.8746 25.0746%2C20.6746 C25.0746%2C17.4746 27.6746%2C14.8746 30.8746%2C14.8746 C34.0746%2C14.8746 36.6746%2C17.4746 36.6746%2C20.6746 C36.5746%2C23.8746 34.0746%2C26.4746 30.8746%2C26.4746 M14.2746%2C26.4746 C11.0746%2C26.4746 8.4746%2C23.8746 8.4746%2C20.6746 C8.4746%2C17.4746 11.0746%2C14.8746 14.2746%2C14.8746 C17.4746%2C14.8746 20.0746%2C17.4746 20.0746%2C20.6746 C20.0746%2C23.8746 17.4746%2C26.4746 14.2746%2C26.4746 M38.6746%2C18.0746 L38.6746%2C2.1746 L37.5746%2C2.1746 L37.5746%2C7.5746 L34.8746%2C7.5746 C32.4746%2C3.1746 27.8746%2C0.1746 22.5746%2C0.1746 C17.2746%2C0.1746 12.6746%2C3.1746 10.2746%2C7.5746 L7.0746%2C7.5746 L7.0746%2C2.1746 L5.9746%2C2.1746 L5.9746%2C17.9746 C2.7746%2C17.9746 0.1746%2C20.5746 0.1746%2C23.7746 C0.1746%2C26.9746 2.7746%2C29.5746 5.9746%2C29.5746 C6.1746%2C29.5746 6.3746%2C29.4746 6.4746%2C29.4746 L6.4746%2C37.6746 L38.4746%2C37.6746 L38.4746%2C29.5746 C41.6746%2C29.5746 44.2746%2C26.9746 44.2746%2C23.7746 C44.3746%2C20.5746 41.7746%2C18.0746 38.6746%2C18.0746%22 id%3D%22Fill-1%22 fill%3D%22%23000000%22%3E%3C%2Fpath%3E %3Cpath d%3D%22M30.8746%2C26.4746 C27.6746%2C26.4746 25.0746%2C23.8746 25.0746%2C20.6746 C25.0746%2C17.4746 27.6746%2C14.8746 30.8746%2C14.8746 C34.0746%2C14.8746 36.6746%2C17.4746 36.6746%2C20.6746 C36.5746%2C23.8746 34.0746%2C26.4746 30.8746%2C26.4746 L30.8746%2C26.4746 Z M14.2746%2C26.4746 C11.0746%2C26.4746 8.4746%2C23.8746 8.4746%2C20.6746 C8.4746%2C17.4746 11.0746%2C14.8746 14.2746%2C14.8746 C17.4746%2C14.8746 20.0746%2C17.4746 20.0746%2C20.6746 C20.0746%2C23.8746 17.4746%2C26.4746 14.2746%2C26.4746 L14.2746%2C26.4746 Z M38.6746%2C18.0746 L38.6746%2C2.1746 L37.5746%2C2.1746 L37.5746%2C7.5746 L34.8746%2C7.5746 C32.4746%2C3.1746 27.8746%2C0.1746 22.5746%2C0.1746 C17.2746%2C0.1746 12.6746%2C3.1746 10.2746%2C7.5746 L7.0746%2C7.5746 L7.0746%2C2.1746 L5.9746%2C2.1746 L5.9746%2C17.9746 C2.7746%2C17.9746 0.1746%2C20.5746 0.1746%2C23.7746 C0.1746%2C26.9746 2.7746%2C29.5746 5.9746%2C29.5746 C6.1746%2C29.5746 6.3746%2C29.4746 6.4746%2C29.4746 L6.4746%2C37.6746 L38.4746%2C37.6746 L38.4746%2C29.5746 C41.6746%2C29.5746 44.2746%2C26.9746 44.2746%2C23.7746 C44.3746%2C20.5746 41.7746%2C18.0746 38.6746%2C18.0746 L38.6746%2C18.0746 Z%22 id%3D%22Stroke-3%22 stroke%3D%22%23000000%22 stroke-width%3D%222.349%22%3E%3C%2Fpath%3E %3C%2Fg%3E%3C%2Fsvg%3E");\n}\n');const Ji="spinnaker.titus";t("spinnaker.titus",["spinnaker.titus.react","spinnaker.titus.securityGroup.reader","spinnaker.serverGroup.details.titus.controller","spinnaker.titus.serverGroupCommandBuilder.service","spinnaker.serverGroup.configure.titus","spinnaker.titus.serverGroup.transformer","spinnaker.titus.pipeline.stage.findAmiStage","spinnaker.titus.pipeline.stage.enableAsgStage","spinnaker.titus.pipeline.stage.disableAsgStage","spinnaker.titus.pipeline.stage.destroyAsgStage","spinnaker.titus.pipeline.stage.resizeAsgStage","spinnaker.titus.pipeline.stage.cloneServerGroupStage","spinnaker.titus.pipeline.stage.disableClusterStage","spinnaker.titus.pipeline.stage.shrinkClusterStage","spinnaker.titus.pipeline.stage.scaleDownClusterStage","titus.servergroup.details.capacitydetailssection","titus.servergroup.details.launchConfigSection"]).config((()=>{ct.registerProvider("titus",{name:"Titus",logo:{path:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABGC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voOLdc3kWeSW1yWmTzqavwcnNraHaqeoQQBhbOO7qCPYJbJkiDAhiMITiF/cH+E48kpikY4UVCPjaIBA3dU57jxhkWkRs6UX9SbRt9ywMKu0okW8Q+dZ2dO1gnqNOcXKJWpr7t3v+38Gs9AgpWxz9DDp+NQ//ryOkTXttBm0VcMXNPfDqGRR8lMQmcHdnE8A9rs9hEOQ6kGzN5pm5JNTLJa2gILm1k9lckrxPXU7uhxhcAJf22sTltZf4I2LQnsWJTuDGr3HPH+lLN9Gkpag2O64P4oS8gze1udD146D2wP8H5JyTFz+hnOcAAAAASUVORK5CYII="},serverGroup:{transformer:"titusServerGroupTransformer",detailsTemplateUrl:"titus/src/serverGroup/details/serverGroupDetails.html",detailsController:"titusServerGroupDetailsCtrl",CloneServerGroupModal:Tn,commandBuilder:"titusServerGroupCommandBuilder",configurationService:"titusServerGroupConfigurationService",skipUpstreamStageCheck:!0,checkForImageProviders:!0,TargetTrackingChart:Li,UpsertStepPolicyModal:zi,UpsertTargetTrackingModal:Fi},securityGroup:{reader:"titusSecurityGroupReader",useProvider:"aws"},loadBalancer:{LoadBalancersTag:C,incompatibleLoadBalancerTypes:[{type:"classic",reason:"Classic Load Balancers cannot be used with Titus as they do not have IP based target groups."}],useProvider:"aws"},instance:{details:en}})})),ut.registerProvider("titus",["custom","redblack","monitored"]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/serverGroupDetails.html",'<div class="details-panel" ng-class="{ disabled: serverGroup.isDisabled }">\n <div class="header" ng-if="state.loading">\n <div class="close-button">\n <a class="btn btn-link" ui-sref="^">\n <span class="glyphicon glyphicon-remove"></span>\n </a>\n </div>\n <h4 class="text-center">\n <span us-spinner="{radius:20, width:6, length: 12}"></span>\n </h4>\n </div>\n\n <div class="header" ng-if="!state.loading">\n <div class="close-button">\n <a class="btn btn-link" ui-sref="^">\n <span class="glyphicon glyphicon-remove"></span>\n </a>\n </div>\n <div class="header-text horizontal middle">\n <cloud-provider-logo provider="serverGroup.type" height="\'36px\'" width="\'36px\'"></cloud-provider-logo>\n <h3 class="horizontal middle space-between flex-1" select-on-dbl-click>\n {{serverGroup.name}}\n <render-if-feature feature="entityTags">\n <entity-notifications\n entity="serverGroup"\n application="ctrl.application"\n placement="bottom"\n h-offset-percent="90%"\n entity-type="serverGroup"\n page-location="details"\n on-update="ctrl.application.serverGroups.refresh()"\n ></entity-notifications>\n </render-if-feature>\n </h3>\n </div>\n <div>\n <div class="actions" ng-class="{ insights: serverGroup.insightActions.length > 0 }">\n <div class="dropdown" uib-dropdown dropdown-append-to-body>\n <button type="button" class="btn btn-sm btn-primary dropdown-toggle" uib-dropdown-toggle>\n Server Group Actions <span class="caret"></span>\n </button>\n <ul class="dropdown-menu" uib-dropdown-menu role="menu">\n <li><a href ng-if="ctrl.isRollbackEnabled()" ng-click="ctrl.rollbackServerGroup()">Rollback</a></li>\n <li role="presentation" class="divider" ng-if="ctrl.isRollbackEnabled()"></li>\n <li><a href ng-click="ctrl.resizeServerGroup()">Resize</a></li>\n <li><a href ng-if="!serverGroup.isDisabled" ng-click="ctrl.disableServerGroup()">Disable</a></li>\n <li><a href ng-if="serverGroup.isDisabled" ng-click="ctrl.enableServerGroup()">Enable</a></li>\n <li><a href ng-click="ctrl.destroyServerGroup()">Destroy</a></li>\n <li><a href ng-click="ctrl.cloneServerGroup()">Clone</a></li>\n <add-entity-tag-links\n component="serverGroup"\n application="ctrl.application"\n entity-type="serverGroup"\n owner-options="ctrl.entityTagTargets"\n on-update="ctrl.application.serverGroups.refresh"\n ></add-entity-tag-links>\n </ul>\n </div>\n <div class="dropdown" ng-if="serverGroup.insightActions.length > 0" uib-dropdown dropdown-append-to-body>\n <button type="button" class="btn btn-sm btn-default dropdown-toggle" uib-dropdown-toggle>\n Insight <span class="caret"></span>\n </button>\n <ul class="dropdown-menu" uib-dropdown-menu role="menu">\n <li\n ng-repeat="action in serverGroup.insightActions"\n analytics-on="click"\n analytics-category="Insight Menu (Server Group)"\n analytics-event="{{action.label}} clicked"\n analytics-label="{{serverGroup.account}}/{{serverGroup.region}}/{{serverGroup.name}}"\n >\n <a target="_blank" href="{{action.url}}">{{action.label}}</a>\n </li>\n </ul>\n </div>\n <div class="clearfix"></div>\n </div>\n </div>\n </div>\n <div class="content" ng-if="!state.loading">\n <div class="band band-info" ng-if="serverGroup.isDisabled">Job is Disabled</div>\n <managed-resource-details-indicator\n ng-if="!state.loading && serverGroup.isManaged"\n resource-summary="serverGroup.managedResourceSummary"\n application="ctrl.application"\n ></managed-resource-details-indicator>\n <server-group-running-tasks-details\n server-group="serverGroup"\n application="ctrl.application"\n ></server-group-running-tasks-details>\n <collapsible-section heading="Server Group Information" expanded="true">\n <dl class="dl-horizontal dl-narrow">\n <dt>Created</dt>\n <dd>{{serverGroup.createdTime | timestamp}}</dd>\n <dt>In</dt>\n <dd>\n <account-tag account="serverGroup.account" pad="right"></account-tag>\n {{serverGroup.region}}\n </dd>\n <dt>Job Id</dt>\n <dd><a href="{{titusUiEndpoint}}jobs/{{serverGroup.id}}" target="_blank">{{serverGroup.id}}</a></dd>\n <entity-source metadata="serverGroup.entityTags.creationMetadata"></entity-source>\n </dl>\n </collapsible-section>\n <collapsible-section heading="Capacity" expanded="true">\n <titus-capacity-details-section\n app="ctrl.application"\n server-group="serverGroup"\n ></titus-capacity-details-section>\n </collapsible-section>\n <collapsible-section heading="Health" expanded="true" ng-if="serverGroup.instanceCounts.total > 0">\n <dl class="dl-horizontal dl-narrow" ng-if="serverGroup">\n <dt>Tasks</dt>\n <dd>\n <health-counts container="serverGroup.instanceCounts" class="pull-left"></health-counts>\n </dd>\n </dl>\n </collapsible-section>\n <collapsible-section heading="Launch Configuration">\n <titus-launch-config-section server-group="serverGroup"></titus-launch-config-section>\n </collapsible-section>\n\n <titus-security-groups\n app="ctrl.application"\n server-group="serverGroup"\n class="collapsible-section"\n style="display: block"\n ></titus-security-groups>\n\n <collapsible-section heading="Service Job Processes">\n <titus-service-job-processes-section\n app="ctrl.application"\n server-group="serverGroup"\n ></titus-service-job-processes-section>\n </collapsible-section>\n\n <collapsible-section heading="Scaling Policies">\n <scaling-policy-summary\n ng-repeat="policy in serverGroup.scalingPolicies"\n policy="policy"\n server-group="serverGroup"\n application="ctrl.application"\n ></scaling-policy-summary>\n <titus-create-scaling-policy-button\n server-group="serverGroup"\n application="ctrl.application"\n ></titus-create-scaling-policy-button>\n <div ng-if="ctrl.awsAccountId">\n <config-bin-link\n application="ctrl.application"\n aws-account-id="ctrl.awsAccountId"\n cluster-name="serverGroup.cluster"\n region="serverGroup.region"\n env="ctrl.env"\n cloud-provider="\'titus\'"\n ></config-bin-link>\n </div>\n <titus-custom-scaling-policy\n application="ctrl.application"\n server-group="serverGroup"\n ></titus-custom-scaling-policy>\n </collapsible-section>\n <titus-package-details-section build-info="buildInfo"></titus-package-details-section>\n <collapsible-section heading="Job Disruption Budget">\n <titus-disruption-budget-section\n app="ctrl.application"\n server-group="serverGroup"\n ></titus-disruption-budget-section>\n </collapsible-section>\n <collapsible-section heading="Job Attributes">\n <div ng-if="!serverGroup.labels">No job attributes associated with this server group</div>\n <dl ng-if="labels">\n <dt ng-repeat-start="(key, val) in labels">{{key}}</dt>\n <dd ng-repeat-end>{{val}}</dd>\n </dl>\n </collapsible-section>\n <collapsible-section heading="Container Attributes">\n <div ng-if="!serverGroup.containerAttributes">No container attributes associated with this server group</div>\n <dl ng-if="serverGroup.containerAttributes">\n <dt ng-repeat-start="(key, val) in serverGroup.containerAttributes">{{key}}</dt>\n <dd ng-repeat-end>{{val}}</dd>\n </dl>\n </collapsible-section>\n <collapsible-section heading="Environment Variables">\n <div ng-if="!serverGroup.env">No environment variables associated with this server group</div>\n <dl ng-if="serverGroup.env">\n <dt ng-repeat-start="(key, val) in serverGroup.env">{{key}}</dt>\n <dd ng-repeat-end>{{val}}</dd>\n </dl>\n </collapsible-section>\n </div>\n</div>\n')}]);export{Ji as TITUS_MODULE,Oi as TitusCapacityDetailsSection,en as TitusInstanceDetails,Vt as TitusInstanceDns,Wt as TitusInstanceInformation,rn as TitusProviderSettings,Ht as TitusReactInject,Zt as TitusReactInjector,Fn as TitusResizeServerGroupModal,Di as TitusScalingActivitiesModal,Ut as TitusSecurityGroupsDetailsSection,Li as TitusTargetTrackingChart,zi as TitusUpsertScalingPolicyModal,Fi as TitusUpsertTargetTrackingModal,qt as applyTargetGroupInfoToHealthMetric,$t as buildTaskActions,Jt as extractHealthMetrics};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|