@digital-realty/ui-service-management 12.0.13 → 12.0.14

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.
@@ -1 +1 @@
1
- import{__decorate as o}from"tslib";import{MobxLitElement as C}from"@adobe/lit-mobx";import"@digital-realty/ix-wizard/ix-wizard-step.js";import"@digital-realty/ix-wizard/ix-wizard.js";import{html as a,nothing as c}from"lit";import{state as S,property as u,customElement as $}from"lit/decorators.js";import{T as b,S as m,y as e,z as M,v as F,L as _,s as j,B,C as D,e as x,x as L,E as w,F as A,H as I,O as q,I as V,A as f,m as R,R as N,b as O}from"./ui-service-management.js";import"@digital-realty/ix-email-list/ix-email-list.js";import"@digital-realty/ix-file-uploader/ix-file-uploader.js";import"@digital-realty/ix-select/ix-select-option.js";import"@digital-realty/ix-select/ix-select.js";import"@digital-realty/ix-textbox/ix-textbox.js";import{classMap as z}from"lit/directives/class-map.js";import{ifDefined as E}from"lit-html/directives/if-defined.js";import{S as T,E as P,N as U,b as W}from"./ui-service-management9.js";import{S as G}from"./ui-service-management13.js";import{Router as Y}from"@vaadin/router";import"@digital-realty/ix-progress/ix-progress.js";let h=class extends G{constructor(){super(...arguments),this.validation={siteErrorMessage:""},this.isEdit=!1,this.validationState={subjectMinLength:1,subjectMaxLength:160,subject:"",descriptionMinLength:1,descriptionMaxLength:500,customerRefMaxLength:50,description:"",requestType:"",category:"",isEmailValid:!0,maxEmailCount:-1,maxEmailLength:-1,location:"",attachments:"",loaRequired:!1},this.locations=[],this.siteSpecificValidationRules={[m.Insite]:{subjectMinLength:1,subjectMaxLength:100,descriptionMinLength:1,descriptionMaxLength:32e3,customerRefMaxLength:40,maxEmailCount:-1,maxEmailLength:-1,loaRequired:!0},[m.ServiceNow]:{subjectMinLength:1,subjectMaxLength:160,descriptionMinLength:1,descriptionMaxLength:4e3,customerRefMaxLength:100,maxEmailCount:-1,maxEmailLength:-1,loaRequired:!0},[m.TelxSFDC]:{subjectMinLength:1,subjectMaxLength:255,descriptionMinLength:1,descriptionMaxLength:32e3,customerRefMaxLength:-1,maxEmailCount:4,maxEmailLength:80,loaRequired:!1}},this.requestCategories=void 0,this.siteError=null}async firstUpdated(){var t,i,s,r;e.ticket.attachments=[];const l=this.isEdit?Promise.resolve([]):M(_.Create,F.CustomerCare,"Customer_care",(t=e.ticket.site)===null||t===void 0?void 0:t.siteId,e.ticket.accountNumber),[n,v]=await Promise.all([j.getServiceBackend(e.ticket.accountNumber,(i=e.ticket.site)===null||i===void 0?void 0:i.siteId,"Customer_care"),l]);if(this.locations=v,this.backendServiceName=n,n&&(this.setValidation(n),e.ticket.serviceBackend=n,!this.isEdit)){const k=await B((s=e.ticket.site)===null||s===void 0?void 0:s.siteId);this.requestCategories=await e.getCategories(k,e.ticket.accountNumber)}this.isEdit&&e.ticket.site&&(e.ticket.site.displayName=await D((r=e.selectedTicket)===null||r===void 0?void 0:r.site))}updated(t){var i;(i=super.updated)===null||i===void 0||i.call(this,t),e.ticket.isValid=this.isFormValid}setValidation(t){Object.values(m).includes(t)&&(this.validationState={...this.validationState,...this.siteSpecificValidationRules[t]})}get isRequiredInputsFilled(){return!!e.ticket.site&&!!e.ticket.subject&&!!e.ticket.description&&!!e.ticket.requestType&&!!e.ticket.category&&!!e.ticket.location}get isFormValid(){return this.isRequiredInputsFilled&&!this.validationState.subject&&!this.validationState.description&&!this.validationState.requestType&&!this.validationState.category&&this.validationState.isEmailValid&&this.isAttachmentsValid()}validateTicket(){let t=!0;return this.validationState={...this.validationState,subject:"",description:"",requestType:"",category:"",location:"",attachments:""},this.validateRequiredAndLengthInputs("subject",this.validationState.subjectMaxLength,this.validationState.subjectMinLength,e.ticket.subject),this.validateRequiredAndLengthInputs("description",this.validationState.descriptionMaxLength,this.validationState.descriptionMinLength,e.ticket.description),(this.validationState.subject||this.validationState.description)&&(t=!1),e.ticket.requestType||(this.validationState.requestType="Request Type is required",t=!1),e.ticket.category||(this.validationState.category="Category is required",t=!1),this.validationState.isEmailValid||(t=!1),e.ticket.location||(this.validationState.location="Location is required",t=!1),this.isAttachmentsValid()||(this.validationState.attachments="A Letter of Authorization document is required",t=!1),t}async handleOnSubmit(){if(this.onSubmitted&&this.isEdit){if(!this.validateTicket())return;try{await e.updateTicket()}finally{x.ticketStep=L,this.onSubmitted()}}}handleNextClick(){var t;this.validateTicket()&&((t=this.onNextButtonClick)===null||t===void 0||t.call(this))}async handleFileUploaded(t){var i;const s=await Promise.all(t.detail.filesUploaded.map(async r=>({fileName:r.file.name,fileType:r.file.type,file:await r.file.arrayBuffer(),id:r.id})));e.ticket.attachments=[...(i=e.ticket.attachments)!==null&&i!==void 0?i:[],...s],this.validationState={...this.validationState,attachments:""}}handleFileDelete(t){var i;const s=t.detail.file.id;e.ticket.attachments=(i=e.ticket.attachments)===null||i===void 0?void 0:i.filter(r=>r.id!==s)}handleLocationChange(t){e.updateLocation(t),this.validationState={...this.validationState,location:""}}render(){var t,i,s,r,l;return a` <div class="wizard-content form-margin"> <div class="mb-4 flex flex-col"> <div class="flex items-center gap-6"> <h3 id="edit-title" class="dlr-text-page-title ${this.isEdit?"":"mb-6"}"> ${this.isEdit?"Edit":"Create"} Customer Care Service Ticket ${this.isEdit?`#${(t=e.selectedTicket)===null||t===void 0?void 0:t.id}`:""} </h3> </div> ${this.isEdit?c:a` <div class="sub-header"> <h3 class="dlr-text-heading">Service Ticket Details</h3> <span class="italic dlr-text-small">*denotes required field</span> </div>`} </div> <div class="form-wrapper"> <div class="form-wrapper__fields"> <ix-textbox id="field" label="Subject" required class="block" ?disabled="${this.isEdit&&((i=e.selectedTicket)===null||i===void 0?void 0:i.status)!==w.New}" .errorText="${this.validationState.subject}" .error="${!!this.validationState.subject}" .value="${(s=e.ticket)===null||s===void 0?void 0:s.subject}" .minLength="${this.validationState.subjectMinLength}" .maxLength="${this.validationState.subjectMaxLength}" @input="${n=>this.handleSubjectChange(n)}"></ix-textbox> <ix-textbox id="field" label="Description" ?disabled="${this.isEdit&&((r=e.selectedTicket)===null||r===void 0?void 0:r.status)!==w.New}" .errorText="${this.validationState.description}" .error="${!!this.validationState.description}" .value="${(l=e.ticket)===null||l===void 0?void 0:l.description}" .minLength="${this.validationState.descriptionMinLength}" .maxLength="${this.validationState.descriptionMaxLength}" @input="${n=>this.handleDescriptionChange(n)}" required type="textarea" .rows="${1}"></ix-textbox> ${this.renderSiteSelector()} ${this.renderLocation()} <div class="col-2"> ${this.renderRequestTypeSelector()} ${this.renderCategorySelector()} </div> ${this.renderCustomerReferenceNumber()} ${this.renderContactsSelector()} ${e.ticket.attachments?a` <div class="w-full"> <ix-file-uploader .defaultFiles="${this.isEdit?x.ticketAttachments:[]}" .extensions="${A}" .error="${!!this.validationState.attachments}" allowMultipleFiles allowDuplicates headerText="${`Click here to browse your device or drop files to upload ${this.isLOARequiredForTicketCategory()?"*":""}`}" bodyText="Max file size is 10MB with accepted file formats of: JPG (JPEG), PNG, PDF, GIF, DOC/X, XLS/X, CSV" @on-files-uploaded="${n=>this.handleFileUploaded(n)}" @on-file-removed="${n=>this.handleFileDelete(n)}"></ix-file-uploader> ${this.isLOARequiredForTicketCategory()&&!this.isEdit?a`<div class="${z({"supporting-text":!0,error:!!this.validationState.attachments})}"> When selecting ${e.ticket.category}, you must upload a valid Letter of Authorization document </div>`:c} </div>`:c} </div> </div> <form-footer ?isEditMode="${this.isEdit}" .isSubmitting="${e.loadings.isSubmitting}" .handleCancelClick="${this.onCancelled}" .handleSubmitClick="${()=>this.handleOnSubmit()}" .handleNextClick="${()=>this.handleNextClick()}"></form-footer> </div> `}validateRequiredAndLengthInputs(t,i,s,r){let l="";const n=t.charAt(0).toUpperCase()+t.slice(1);r?(!r||r.length<s||r.length>i)&&(l=`${n} should be a minimum ${s} and maximum ${i} characters.`):l=`${n} is required`,this.validationState={...this.validationState,[t]:l}}handleDescriptionChange(t){e.ticket.description=t.target.value;const{descriptionMinLength:i,descriptionMaxLength:s}=this.validationState;this.validateRequiredAndLengthInputs("description",s,i,t.target.value)}handleSubjectChange(t){e.ticket.subject=t.target.value;const{subjectMinLength:i,subjectMaxLength:s}=this.validationState;this.validateRequiredAndLengthInputs("subject",s,i,t.target.value)}handleInputChange(t,i){e.ticket[i]=t.target.value;const s=i.replace(/([A-Z])/g," $&"),r=s.charAt(0).toUpperCase()+s.slice(1);this.validationState={...this.validationState,[i]:t.target.value?"":`${r} is required`}}handleEmailChange(t){let i=t.some(s=>!s.isValid||s.isDuplicate);this.validationState.maxEmailLength&&this.validationState.maxEmailLength>=0&&t.some(s=>s.address.length>(this.validationState.maxEmailLength||0))&&(i=!0),this.validationState={...this.validationState,isEmailValid:!i},i||(e.ticket.contacts=t.map(s=>s.address).join(",")),this.requestUpdate()}async handleRequestTypeChange(t){this.handleInputChange(t,"requestType"),this.validationState={...this.validationState,attachments:""},e.ticket.category&&(this.validationState={...this.validationState,category:"Category is required"},e.ticket={...e.ticket,category:""})}handleCategoryChange(t){this.handleInputChange(t,"category"),this.validationState={...this.validationState,attachments:""},this.requestUpdate()}isLOARequiredForTicketCategory(){var t,i;const s=this.isEdit?(t=e.selectedTicket)===null||t===void 0?void 0:t.requestType:e.ticket.requestType,r=this.isEdit?(i=e.selectedTicket)===null||i===void 0?void 0:i.category:e.ticket.category;return this.validationState.loaRequired&&s==="Cross Connect"&&(r==="New Install"||r==="Change (Hot Cut)")}isAttachmentsValid(){var t;return!this.isLOARequiredForTicketCategory()||this.isEdit||!!(!((t=e.ticket.attachments)===null||t===void 0)&&t.length)}renderRequestTypeSelector(){var t,i,s,r;const l=(this.isEdit?[(t=e.ticket)===null||t===void 0?void 0:t.requestType]:(r=(s=(i=this.requestCategories)===null||i===void 0?void 0:i.items)===null||s===void 0?void 0:s.map(n=>n.requestType))!==null&&r!==void 0?r:[]).map(n=>{var v;return a` <ix-select-option .selected="${((v=e.ticket)===null||v===void 0?void 0:v.requestType)===n}" value="${E(n)}"> <div slot="headline">${n}</div> </ix-select-option>`});return a`<ix-select id="field" name="rtype" label="Request Type" menu-positioning="popover" .error="${!!this.validationState.requestType}" .errorText="${this.validationState.requestType}" @input="${n=>this.handleRequestTypeChange(n)}" required ?disabled="${this.isEdit}"> ${l} </ix-select>`}renderLocation(){var t;if(this.isEdit&&!e.ticket.location)return c;const i=(this.isEdit?[e.ticket.location]:(t=this.locations)!==null&&t!==void 0?t:[]).map(s=>{var r,l;return a`<ix-select-option .selected="${((l=(r=e.ticket)===null||r===void 0?void 0:r.location)===null||l===void 0?void 0:l.id)===(s==null?void 0:s.id)}" .value="${s}"> <div slot="headline"> ${I(s)} </div></ix-select-option>`});return a`<ix-select label="Location" name="locationSelect" menu-positioning="popover" .wideMenu="${!0}" required .disabled="${this.isEdit}" .errorText="${this.validationState.location}" .error="${!!this.validationState.location}" @input="${s=>this.handleLocationChange(s.target.value)}">${i}</ix-select>`}renderCategorySelector(){var t,i,s,r;let l={};if(e.ticket.requestType){const n=this.isEdit?[(t=e.ticket)===null||t===void 0?void 0:t.category]:(r=(s=(i=this.requestCategories)===null||i===void 0?void 0:i.items)===null||s===void 0?void 0:s.find(v=>v.requestType===e.ticket.requestType))===null||r===void 0?void 0:r.categories;l=(n!=null?n:[]).map(v=>{var k;return a` <ix-select-option .value="${v}" .selected="${((k=e.ticket)===null||k===void 0?void 0:k.category)===v}"> <div slot="headline">${v}</div> </ix-select-option>`})}return a`<ix-select label="Category" menu-positioning="popover" .errorText="${this.validationState.category}" .error="${!!this.validationState.category}" .disabled="${!e.ticket.requestType||this.isEdit}" @input="${n=>this.handleCategoryChange(n)}" required> ${l} </ix-select>`}renderCustomerReferenceNumber(){var t;return e.ticket.serviceBackend===m.TelxSFDC?c:a`<ix-textbox id="field" .value="${(t=e.ticket)===null||t===void 0?void 0:t.customerReferenceNumber}" .maxLength="${this.validationState.customerRefMaxLength}" @input="${i=>this.handleInputChange(i,"customerReferenceNumber")}" label="Customer Reference Number"></ix-textbox>`}renderContactsSelector(){var t;return e.ticket.serviceBackend===m.TelxSFDC?c:a`<div class="flex flex-col gap-3.5 w-full"> <div class="w-full"> <ix-email-list id="field" label="${q}" checkDuplicates .error="${!this.validationState.isEmailValid}" .value="${(t=e.ticket)===null||t===void 0?void 0:t.contacts}" .maximumEmailCount="${this.validationState.maxEmailCount}" .maximumEmailLength="${this.validationState.maxEmailLength}" .onChanged="${i=>this.handleEmailChange(i)}"></ix-email-list> <div ?hidden="${!this.validationState.isEmailValid}" id="contacts-helper-text" class="contacts-helper-text"> Enter email addresses separated by a comma, semicolon or the Enter key. </div> </div> </div>`}renderSiteSelector(){var t;return a` ${!((t=e.ticket.site)===null||t===void 0)&&t.displayName?a` <ix-select name="site" id="field" label="Site" menu-positioning="popover" required disabled="disabled" errorText="Please select a site" .error="${!!this.siteError}"> <ix-select-option .selected="${!0}" value="${E(e.ticket.site.id)}"> <div slot="headline"> ${e.ticket.site.displayName} </div> </ix-select-option> </ix-select>`:c}`}};h.styles=[b,T],o([S()],h.prototype,"validation",void 0),o([u({attribute:!1})],h.prototype,"onNextButtonClick",void 0),o([u({type:Function})],h.prototype,"onSubmitted",void 0),o([u({type:Function})],h.prototype,"onCancelled",void 0),o([u({type:Boolean})],h.prototype,"isEdit",void 0),o([S()],h.prototype,"validationState",void 0),o([S()],h.prototype,"locations",void 0),o([S()],h.prototype,"backendServiceName",void 0),o([S()],h.prototype,"requestCategories",void 0),h=o([$("create-edit-customer-care-service-ticket")],h);let y=class extends C{constructor(){super(...arguments),this.isEdit=!1}get isSuccess(){return e.submissionResult.state!==V.Error}handleCloseClick(){this.isEdit&&window.dispatchEvent(new Event(f.DrawerClose))}getTicketDetailsRoute(){var t;return!((t=e.submissionResult.result)===null||t===void 0)&&t.id?R(N.CustomerCareTicketDetails,{ticketId:e.submissionResult.result.id}):""}handleOnViewAllTickets(){window.dispatchEvent(new Event(f.DrawerClose)),Y.go(R(N.ServiceTickets))}async handleOnRetry(){this.isEdit?await e.updateTicket():await e.createTicket()}renderIcon(){let t=W;return this.isSuccess||(t=P),a` <div> <svg xmlns="http://www.w3.org/2000/svg" width="88" height="88" viewBox="0 0 88 88" fill="none"> ${t} </svg> </div> `}renderTitle(){let t=a`<div>Customer Care Service Ticket</div> <div>Cannot Be ${this.isEdit?"Edited":"Created"}</div>`;return this.isSuccess&&(t=a`<div> ${this.isEdit?"Changes Saved":"Customer Care Service Ticket Created"} </div>`),a`<div class="result-form__title">${t}</div>`}renderBody(){let t=a`<div> We are unable to process your request. Please, retry or reach out to us for further assistance. We apologize for the inconvenience. Your Digital Realty Team </div>`;return this.isSuccess&&(t=a`<div> Your Customer Care Service Tickets have been successfully ${this.isEdit?"edited":"created"}. </div> ${this.isEdit?c:a`<div>We will reach out to you shortly.</div>`}`),a`<div class="result-form__body dlr-text-default"> ${t} </div>`}renderTicketNumbers(){var t;return this.isSuccess&&!this.isEdit?a`<div class="result-form__ticket-numbers"> <div> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 24" fill="none"> ${U} </svg> <span class="ticket-numbers__label dlr-text-small">Ticket Number(s):</span> </div> <div> <a class="ticket-numbers__content" href="${E(this.getTicketDetailsRoute())}">${(t=e.submissionResult.result)===null||t===void 0?void 0:t.id}</a> </div> </div>`:c}renderFooter(){return a`<div class="result-form__footer"> ${this.isSuccess?c:a`<ix-button appearance="outlined" @click="${this.handleOnRetry}">RETRY</ix-button>`} ${this.isEdit?a`<ix-button @click="${()=>this.handleCloseClick()}">CLOSE</ix-button>`:a`<ix-button @click="${this.handleOnViewAllTickets}">VIEW ALL SERVICE TICKETS</ix-button>`} </div>`}renderAttachmentsFailedMessage(){return x.error.uploadingAttachments?a`<attachment-upload-failed-message .fileNames="${x.failedAttachments}"></attachment-upload-failed-message>`:c}render(){return e.loadings.isSubmitting?a`<div class="w-full flex justify-center mt-12"> <ix-progress .indeterminate="${!0}" .linear="${!1}"></ix-progress> </div>`:a` <div class="form-margin"> <div class="result-form"> ${this.renderIcon()} ${this.renderTitle()} ${this.renderBody()} ${this.renderTicketNumbers()} ${this.renderAttachmentsFailedMessage()} ${this.renderFooter()} </div> </div>`}};y.styles=[T,b],o([u({type:Boolean})],y.prototype,"isEdit",void 0),y=o([$("create-edit-customer-care-result")],y);let g=class extends C{constructor(){super(...arguments),this.isEdit=!1,this.isSubmitting=!1}async handleOnSubmit(){var t;this.isSubmitting=!0;try{this.onSubmitted&&(this.isEdit?await e.updateTicket():await e.createTicket())}finally{x.ticketStep=L,this.isSubmitting=!1,(t=this.onSubmitted)===null||t===void 0||t.call(this)}}renderFormFields(){var t,i,s,r,l;return e.loadings.isSubmitting?a`<div class="w-full flex justify-center mt-12"> <ix-progress .indeterminate="${!0}" .linear="${!1}"></ix-progress> </div>`:a`<div class="form-wrapper"> <div class="summary-form"> <div class="summary-form__subheader"> <span>Service Ticket Details</span> <span> <md-icon slot="icon" @click="${()=>{var n;return(n=this.onEditButtonClicked)===null||n===void 0?void 0:n.call(this)}}"> edit </md-icon> </span> </div> <div class="summary-form__field"> <span>Subject</span> <span>${e.ticket.subject}</span> </div> <div class="summary-form__field"> <span>Description</span> <span class="whitespace-break-spaces">${e.ticket.description}</span> </div> <div class="summary-form__field"> <span>Request Type</span> <span>${e.ticket.requestType}</span> </div> <div class="summary-form__field"> <span>Category</span> <span>${e.ticket.category}</span> </div> <div class="summary-form__field"> <span>Site</span> <span> ${(t=e.ticket.site)===null||t===void 0?void 0:t.displayName} - ${(i=e.ticket.site)===null||i===void 0?void 0:i.accountNumber} </span> </div> <div class="summary-form__field"> <span>Location</span> <span>${(s=e.ticket.location)===null||s===void 0?void 0:s.id}</span> </div> ${e.ticket.serviceBackend!==m.TelxSFDC?a`<div class="summary-form__field"> <span>Customer Reference Number</span> <span>${e.ticket.customerReferenceNumber}</span> </div>`:c} ${e.ticket.serviceBackend!==m.TelxSFDC?a`<div class="summary-form__field"> <span>${q}</span> <span> ${!((r=e.ticket.contacts)===null||r===void 0)&&r.length?a`<ix-chip-set> ${e.ticket.contacts.split(",").map(n=>a`<span> <ix-chip label="${n}"></ix-chip> </span>`)} </ix-chip-set>`:c} </span> </div>`:c} <div class="summary-form__field"> <span>Attachments</span> <div> ${(l=e.ticket.attachments)===null||l===void 0?void 0:l.map(n=>a`<div class="attachments-file-summary"> ${n.fileName} </div>`)} </div> </div> </div> </div>`}render(){var t;return a` <div class="wizard-content form-margin"> <div> <h1 class="dlr-text-page-title"> ${this.isEdit?"Edit":"Create"} Customer Care Service Ticket ${this.isEdit?`#${(t=e.selectedTicket)===null||t===void 0?void 0:t.id}`:""} </h1> <div class="sub-header dlr-text-heading"> <h3 class="dlr-text-heading">Are these details correct?</h3> <ix-button type="submit" has-icon trailing-icon @click="${this.handleOnSubmit}" ?submitting="${this.isSubmitting}"> <ix-icon slot="icon">east</ix-icon> <span class="button-label">YES, SUBMIT</span> </ix-button> </div> </div> ${this.renderFormFields()} </div>`}};g.styles=[T,b],o([u({attribute:!1})],g.prototype,"onEditButtonClicked",void 0),o([u({attribute:!1})],g.prototype,"onSubmitted",void 0),o([u({type:Boolean})],g.prototype,"isEdit",void 0),o([S()],g.prototype,"isSubmitting",void 0),g=o([$("create-edit-customer-care-summary")],g);const d={details:1,summary:2,result:3};let p=class extends C{constructor(){super(...arguments),this.currentStep=d.details,this.isEdit=!1}firstUpdated(){this.selectedSite&&e.updateSite(this.selectedSite)}disconnectedCallback(){super.disconnectedCallback(),this.isEdit||e.clear()}handleWizardClose(){this.currentStep===d.result&&(this.currentStep=d.details)}renderDetailsStep(){return a` <ix-wizard-step .isVisible="${this.currentStep===d.details}" .isNextButtonVisible="${!1}"> <create-edit-customer-care-service-ticket ?isEdit="${this.isEdit}" .onNextButtonClick="${()=>{this.currentStep=d.summary}}" .onSubmitted="${()=>{this.currentStep=d.result}}" .onCancelled="${()=>this.toggleDrawer()}"> </create-edit-customer-care-service-ticket> </ix-wizard-step>`}renderSummaryStep(){return this.isEdit?c:this.currentStep!==d.summary?c:a` <ix-wizard-step .isVisible="${this.currentStep===d.summary}" .isNextButtonVisible="${!1}"> <create-edit-customer-care-summary ?isEdit="${this.isEdit}" .onEditButtonClicked="${()=>{this.currentStep=d.details}}" .onSubmitted="${()=>{this.currentStep=d.result}}"> </create-edit-customer-care-summary> </ix-wizard-step>`}renderResultStep(){return this.currentStep!==d.result?c:a` <ix-wizard-step .isVisible="${this.currentStep===d.result}" .isNextButtonVisible="${!1}"> <create-edit-customer-care-result ?isEdit="${this.isEdit}"></create-edit-customer-care-result> </ix-wizard-step>`}get CreateEditCustomerCareServiceTicket(){var t,i;return(i=(t=this.shadowRoot)===null||t===void 0?void 0:t.querySelector("create-edit-customer-care-service-ticket"))!==null&&i!==void 0?i:null}get enableNextStepClick(){return this.currentStep===d.details?e.ticket.isValid:!0}handleNextStepClick(){var t;this.currentStep===d.details?(t=this.CreateEditCustomerCareServiceTicket)===null||t===void 0||t.handleNextClick():this.currentStep+=1}handlePrevStepClick(){this.currentStep===d.details&&!this.isEdit?O(this,f.CreateTicket):this.isEdit&&this.currentStep===d.details?this.toggleDrawer():this.currentStep-=1}render(){return a` <ix-wizard totalSteps="2" .currentStep="${this.currentStep}" .hideStepCount="${this.isEdit||this.currentStep===d.result}" .hideNextStep="${this.currentStep===d.summary}" .onNextStepClick="${()=>this.handleNextStepClick()}" .onPrevStepClick="${()=>this.handlePrevStepClick()}" .enableNextStepClick="${this.enableNextStepClick}" .enableHideCloseButton="${!this.isEdit}" .onCloseClick="${()=>this.onCloseClick()}" .onMinimiseClick="${()=>this.onMinimiseClick()}"> ${this.renderDetailsStep()} ${this.renderSummaryStep()} ${this.renderResultStep()} </ix-wizard>`}};p.styles=[],o([u({type:Object})],p.prototype,"selectedSite",void 0),o([S()],p.prototype,"currentStep",void 0),o([u({type:Boolean})],p.prototype,"isEdit",void 0),o([u({type:Function})],p.prototype,"toggleDrawer",void 0),o([u({type:Function})],p.prototype,"onCloseClick",void 0),o([u({type:Function})],p.prototype,"onMinimiseClick",void 0),p=o([$("customer-care-service-ticket-wizard")],p);
1
+ import{__decorate as o}from"tslib";import{MobxLitElement as C}from"@adobe/lit-mobx";import"@digital-realty/ix-wizard/ix-wizard-step.js";import"@digital-realty/ix-wizard/ix-wizard.js";import{html as a,nothing as c}from"lit";import{state as S,property as u,customElement as $}from"lit/decorators.js";import{T as b,S as m,y as e,z as M,v as F,L as _,s as j,B,C as D,e as x,x as L,E as w,F as A,H as I,O as q,I as V,A as f,m as R,R as N,b as O}from"./ui-service-management.js";import"@digital-realty/ix-email-list/ix-email-list.js";import"@digital-realty/ix-file-uploader/ix-file-uploader.js";import"@digital-realty/ix-select/ix-select-option.js";import"@digital-realty/ix-select/ix-select.js";import"@digital-realty/ix-textbox/ix-textbox.js";import{classMap as z}from"lit/directives/class-map.js";import{ifDefined as E}from"lit-html/directives/if-defined.js";import{S as T,E as P,N as U,b as W}from"./ui-service-management9.js";import{S as G}from"./ui-service-management13.js";import{Router as Y}from"@vaadin/router";import"@digital-realty/ix-progress/ix-progress.js";let h=class extends G{constructor(){super(...arguments),this.validation={siteErrorMessage:""},this.isEdit=!1,this.validationState={subjectMinLength:1,subjectMaxLength:160,subject:"",descriptionMinLength:1,descriptionMaxLength:500,customerRefMaxLength:50,description:"",requestType:"",category:"",isEmailValid:!0,maxEmailCount:-1,maxEmailLength:-1,location:"",attachments:"",loaRequired:!1},this.locations=[],this.siteSpecificValidationRules={[m.Insite]:{subjectMinLength:1,subjectMaxLength:100,descriptionMinLength:1,descriptionMaxLength:32e3,customerRefMaxLength:40,maxEmailCount:-1,maxEmailLength:-1,loaRequired:!0},[m.ServiceNow]:{subjectMinLength:1,subjectMaxLength:160,descriptionMinLength:1,descriptionMaxLength:4e3,customerRefMaxLength:100,maxEmailCount:-1,maxEmailLength:-1,loaRequired:!0},[m.TelxSFDC]:{subjectMinLength:1,subjectMaxLength:255,descriptionMinLength:1,descriptionMaxLength:32e3,customerRefMaxLength:-1,maxEmailCount:4,maxEmailLength:80,loaRequired:!1}},this.requestCategories=void 0,this.siteError=null}async firstUpdated(){var t,i,s,r;e.ticket.attachments=[];const l=this.isEdit?Promise.resolve([]):M(_.Create,F.CustomerCare,"Customer_care",(t=e.ticket.site)===null||t===void 0?void 0:t.siteId,e.ticket.accountNumber),[n,v]=await Promise.all([j.getServiceBackend(e.ticket.accountNumber,(i=e.ticket.site)===null||i===void 0?void 0:i.siteId,"Customer_care"),l]);if(this.locations=v,this.backendServiceName=n,n&&(this.setValidation(n),e.ticket.serviceBackend=n,!this.isEdit)){const k=await B((s=e.ticket.site)===null||s===void 0?void 0:s.siteId);this.requestCategories=await e.getCategories(k,e.ticket.accountNumber)}this.isEdit&&e.ticket.site&&(e.ticket.site.displayName=await D((r=e.selectedTicket)===null||r===void 0?void 0:r.site))}updated(t){var i;(i=super.updated)===null||i===void 0||i.call(this,t),e.ticket.isValid=this.isFormValid}setValidation(t){Object.values(m).includes(t)&&(this.validationState={...this.validationState,...this.siteSpecificValidationRules[t]})}get isRequiredInputsFilled(){return!!e.ticket.site&&!!e.ticket.subject&&!!e.ticket.description&&!!e.ticket.requestType&&!!e.ticket.category&&!!e.ticket.location}get isFormValid(){return this.isRequiredInputsFilled&&!this.validationState.subject&&!this.validationState.description&&!this.validationState.requestType&&!this.validationState.category&&this.validationState.isEmailValid&&this.isAttachmentsValid()}validateTicket(){let t=!0;return this.validationState={...this.validationState,subject:"",description:"",requestType:"",category:"",location:"",attachments:""},this.validateRequiredAndLengthInputs("subject",this.validationState.subjectMaxLength,this.validationState.subjectMinLength,e.ticket.subject),this.validateRequiredAndLengthInputs("description",this.validationState.descriptionMaxLength,this.validationState.descriptionMinLength,e.ticket.description),(this.validationState.subject||this.validationState.description)&&(t=!1),e.ticket.requestType||(this.validationState.requestType="Request Type is required",t=!1),e.ticket.category||(this.validationState.category="Category is required",t=!1),this.validationState.isEmailValid||(t=!1),e.ticket.location||(this.validationState.location="Location is required",t=!1),this.isAttachmentsValid()||(this.validationState.attachments="A Letter of Authorization document is required",t=!1),t}async handleOnSubmit(){if(this.onSubmitted&&this.isEdit){if(!this.validateTicket())return;try{await e.updateTicket()}finally{x.ticketStep=L,this.onSubmitted()}}}handleNextClick(){var t;this.validateTicket()&&((t=this.onNextButtonClick)===null||t===void 0||t.call(this))}async handleFileUploaded(t){var i;const s=await Promise.all(t.detail.filesUploaded.map(async r=>({fileName:r.file.name,fileType:r.file.type,file:await r.file.arrayBuffer(),id:r.id})));e.ticket.attachments=[...(i=e.ticket.attachments)!==null&&i!==void 0?i:[],...s],this.validationState={...this.validationState,attachments:""}}handleFileDelete(t){var i;const s=t.detail.file.id;e.ticket.attachments=(i=e.ticket.attachments)===null||i===void 0?void 0:i.filter(r=>r.id!==s)}handleLocationChange(t){e.updateLocation(t),this.validationState={...this.validationState,location:""}}render(){var t,i,s,r,l;return a` <div class="wizard-content form-margin"> <div class="mb-4 flex flex-col"> <div class="flex items-center gap-6"> <h3 id="edit-title" class="dlr-text-page-title ${this.isEdit?"":"mb-6"}"> ${this.isEdit?"Edit":"Create"} Customer Care Service Ticket ${this.isEdit?`#${(t=e.selectedTicket)===null||t===void 0?void 0:t.id}`:""} </h3> </div> ${this.isEdit?c:a` <div class="sub-header"> <h3 class="dlr-text-heading">Service Ticket Details</h3> <span class="italic dlr-text-small">*denotes required field</span> </div>`} </div> <div class="form-wrapper"> <div class="form-wrapper__fields"> <ix-textbox id="field" label="Subject" required class="block" ?disabled="${this.isEdit&&((i=e.selectedTicket)===null||i===void 0?void 0:i.status)!==w.New}" .errorText="${this.validationState.subject}" .error="${!!this.validationState.subject}" .value="${(s=e.ticket)===null||s===void 0?void 0:s.subject}" .minLength="${this.validationState.subjectMinLength}" .maxLength="${this.validationState.subjectMaxLength}" @input="${n=>this.handleSubjectChange(n)}"></ix-textbox> <ix-textbox id="field" label="Description" ?disabled="${this.isEdit&&((r=e.selectedTicket)===null||r===void 0?void 0:r.status)!==w.New}" .errorText="${this.validationState.description}" .error="${!!this.validationState.description}" .value="${(l=e.ticket)===null||l===void 0?void 0:l.description}" .minLength="${this.validationState.descriptionMinLength}" .maxLength="${this.validationState.descriptionMaxLength}" @input="${n=>this.handleDescriptionChange(n)}" required type="textarea" .rows="${1}"></ix-textbox> ${this.renderSiteSelector()} ${this.renderLocation()} <div class="col-2"> ${this.renderRequestTypeSelector()} ${this.renderCategorySelector()} </div> ${this.renderCustomerReferenceNumber()} ${this.renderContactsSelector()} ${e.ticket.attachments?a` <div class="w-full"> <ix-file-uploader .defaultFiles="${this.isEdit?x.ticketAttachments:[]}" .extensions="${A}" .error="${!!this.validationState.attachments}" allowMultipleFiles allowDuplicates headerText="${`Click here to browse your device or drop files to upload ${this.isLOARequiredForTicketCategory()?"*":""}`}" bodyText="Max file size is 10MB with accepted file formats of: JPG (JPEG), PNG, PDF, GIF, DOC/X, XLS/X, CSV" @on-files-uploaded="${n=>this.handleFileUploaded(n)}" @on-file-removed="${n=>this.handleFileDelete(n)}"></ix-file-uploader> ${this.isLOARequiredForTicketCategory()&&!this.isEdit?a`<div class="${z({"supporting-text":!0,error:!!this.validationState.attachments})}"> When selecting ${e.ticket.category}, you must upload a valid Letter of Authorization document </div>`:c} </div>`:c} </div> </div> <form-footer ?isEditMode="${this.isEdit}" .isSubmitting="${e.loadings.isSubmitting}" .handleCancelClick="${this.onCancelled}" .handleSubmitClick="${()=>this.handleOnSubmit()}" .handleNextClick="${()=>this.handleNextClick()}"></form-footer> </div> `}validateRequiredAndLengthInputs(t,i,s,r){let l="";const n=t.charAt(0).toUpperCase()+t.slice(1);r?(!r||r.length<s||r.length>i)&&(l=`${n} should be a minimum ${s} and maximum ${i} characters.`):l=`${n} is required`,this.validationState={...this.validationState,[t]:l}}handleDescriptionChange(t){e.ticket.description=t.target.value;const{descriptionMinLength:i,descriptionMaxLength:s}=this.validationState;this.validateRequiredAndLengthInputs("description",s,i,t.target.value)}handleSubjectChange(t){e.ticket.subject=t.target.value;const{subjectMinLength:i,subjectMaxLength:s}=this.validationState;this.validateRequiredAndLengthInputs("subject",s,i,t.target.value)}handleInputChange(t,i){e.ticket[i]=t.target.value;const s=i.replace(/([A-Z])/g," $&"),r=s.charAt(0).toUpperCase()+s.slice(1);this.validationState={...this.validationState,[i]:t.target.value?"":`${r} is required`}}handleEmailChange(t){let i=t.some(s=>!s.isValid||s.isDuplicate);this.validationState.maxEmailLength&&this.validationState.maxEmailLength>=0&&t.some(s=>s.address.length>(this.validationState.maxEmailLength||0))&&(i=!0),this.validationState={...this.validationState,isEmailValid:!i},i||(e.ticket.contacts=t.map(s=>s.address).join(",")),this.requestUpdate()}async handleRequestTypeChange(t){this.handleInputChange(t,"requestType"),e.ticket.category&&(this.validationState={...this.validationState,category:"Category is required"},e.ticket={...e.ticket,category:""})}handleCategoryChange(t){this.handleInputChange(t,"category"),this.requestUpdate()}isLOARequiredForTicketCategory(){var t,i;const s=this.isEdit?(t=e.selectedTicket)===null||t===void 0?void 0:t.requestType:e.ticket.requestType,r=this.isEdit?(i=e.selectedTicket)===null||i===void 0?void 0:i.category:e.ticket.category;return this.validationState.loaRequired&&s==="Cross Connect"&&(r==="New Install"||r==="Change (Hot Cut)")}isAttachmentsValid(){var t;return!this.isLOARequiredForTicketCategory()||this.isEdit||!!(!((t=e.ticket.attachments)===null||t===void 0)&&t.length)}renderRequestTypeSelector(){var t,i,s,r;const l=(this.isEdit?[(t=e.ticket)===null||t===void 0?void 0:t.requestType]:(r=(s=(i=this.requestCategories)===null||i===void 0?void 0:i.items)===null||s===void 0?void 0:s.map(n=>n.requestType))!==null&&r!==void 0?r:[]).map(n=>{var v;return a` <ix-select-option .selected="${((v=e.ticket)===null||v===void 0?void 0:v.requestType)===n}" value="${E(n)}"> <div slot="headline">${n}</div> </ix-select-option>`});return a`<ix-select id="field" name="rtype" label="Request Type" menu-positioning="popover" .error="${!!this.validationState.requestType}" .errorText="${this.validationState.requestType}" @input="${n=>this.handleRequestTypeChange(n)}" required ?disabled="${this.isEdit}"> ${l} </ix-select>`}renderLocation(){var t;if(this.isEdit&&!e.ticket.location)return c;const i=(this.isEdit?[e.ticket.location]:(t=this.locations)!==null&&t!==void 0?t:[]).map(s=>{var r,l;return a`<ix-select-option .selected="${((l=(r=e.ticket)===null||r===void 0?void 0:r.location)===null||l===void 0?void 0:l.id)===(s==null?void 0:s.id)}" .value="${s}"> <div slot="headline"> ${I(s)} </div></ix-select-option>`});return a`<ix-select label="Location" name="locationSelect" menu-positioning="popover" .wideMenu="${!0}" required .disabled="${this.isEdit}" .errorText="${this.validationState.location}" .error="${!!this.validationState.location}" @input="${s=>this.handleLocationChange(s.target.value)}">${i}</ix-select>`}renderCategorySelector(){var t,i,s,r;let l={};if(e.ticket.requestType){const n=this.isEdit?[(t=e.ticket)===null||t===void 0?void 0:t.category]:(r=(s=(i=this.requestCategories)===null||i===void 0?void 0:i.items)===null||s===void 0?void 0:s.find(v=>v.requestType===e.ticket.requestType))===null||r===void 0?void 0:r.categories;l=(n!=null?n:[]).map(v=>{var k;return a` <ix-select-option .value="${v}" .selected="${((k=e.ticket)===null||k===void 0?void 0:k.category)===v}"> <div slot="headline">${v}</div> </ix-select-option>`})}return a`<ix-select label="Category" menu-positioning="popover" .errorText="${this.validationState.category}" .error="${!!this.validationState.category}" .disabled="${!e.ticket.requestType||this.isEdit}" @input="${n=>this.handleCategoryChange(n)}" required> ${l} </ix-select>`}renderCustomerReferenceNumber(){var t;return e.ticket.serviceBackend===m.TelxSFDC?c:a`<ix-textbox id="field" .value="${(t=e.ticket)===null||t===void 0?void 0:t.customerReferenceNumber}" .maxLength="${this.validationState.customerRefMaxLength}" @input="${i=>this.handleInputChange(i,"customerReferenceNumber")}" label="Customer Reference Number"></ix-textbox>`}renderContactsSelector(){var t;return e.ticket.serviceBackend===m.TelxSFDC?c:a`<div class="flex flex-col gap-3.5 w-full"> <div class="w-full"> <ix-email-list id="field" label="${q}" checkDuplicates .error="${!this.validationState.isEmailValid}" .value="${(t=e.ticket)===null||t===void 0?void 0:t.contacts}" .maximumEmailCount="${this.validationState.maxEmailCount}" .maximumEmailLength="${this.validationState.maxEmailLength}" .onChanged="${i=>this.handleEmailChange(i)}"></ix-email-list> <div ?hidden="${!this.validationState.isEmailValid}" id="contacts-helper-text" class="contacts-helper-text"> Enter email addresses separated by a comma, semicolon or the Enter key. </div> </div> </div>`}renderSiteSelector(){var t;return a` ${!((t=e.ticket.site)===null||t===void 0)&&t.displayName?a` <ix-select name="site" id="field" label="Site" menu-positioning="popover" required disabled="disabled" errorText="Please select a site" .error="${!!this.siteError}"> <ix-select-option .selected="${!0}" value="${E(e.ticket.site.id)}"> <div slot="headline"> ${e.ticket.site.displayName} </div> </ix-select-option> </ix-select>`:c}`}};h.styles=[b,T],o([S()],h.prototype,"validation",void 0),o([u({attribute:!1})],h.prototype,"onNextButtonClick",void 0),o([u({type:Function})],h.prototype,"onSubmitted",void 0),o([u({type:Function})],h.prototype,"onCancelled",void 0),o([u({type:Boolean})],h.prototype,"isEdit",void 0),o([S()],h.prototype,"validationState",void 0),o([S()],h.prototype,"locations",void 0),o([S()],h.prototype,"backendServiceName",void 0),o([S()],h.prototype,"requestCategories",void 0),h=o([$("create-edit-customer-care-service-ticket")],h);let y=class extends C{constructor(){super(...arguments),this.isEdit=!1}get isSuccess(){return e.submissionResult.state!==V.Error}handleCloseClick(){this.isEdit&&window.dispatchEvent(new Event(f.DrawerClose))}getTicketDetailsRoute(){var t;return!((t=e.submissionResult.result)===null||t===void 0)&&t.id?R(N.CustomerCareTicketDetails,{ticketId:e.submissionResult.result.id}):""}handleOnViewAllTickets(){window.dispatchEvent(new Event(f.DrawerClose)),Y.go(R(N.ServiceTickets))}async handleOnRetry(){this.isEdit?await e.updateTicket():await e.createTicket()}renderIcon(){let t=W;return this.isSuccess||(t=P),a` <div> <svg xmlns="http://www.w3.org/2000/svg" width="88" height="88" viewBox="0 0 88 88" fill="none"> ${t} </svg> </div> `}renderTitle(){let t=a`<div>Customer Care Service Ticket</div> <div>Cannot Be ${this.isEdit?"Edited":"Created"}</div>`;return this.isSuccess&&(t=a`<div> ${this.isEdit?"Changes Saved":"Customer Care Service Ticket Created"} </div>`),a`<div class="result-form__title">${t}</div>`}renderBody(){let t=a`<div> We are unable to process your request. Please, retry or reach out to us for further assistance. We apologize for the inconvenience. Your Digital Realty Team </div>`;return this.isSuccess&&(t=a`<div> Your Customer Care Service Tickets have been successfully ${this.isEdit?"edited":"created"}. </div> ${this.isEdit?c:a`<div>We will reach out to you shortly.</div>`}`),a`<div class="result-form__body dlr-text-default"> ${t} </div>`}renderTicketNumbers(){var t;return this.isSuccess&&!this.isEdit?a`<div class="result-form__ticket-numbers"> <div> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 24" fill="none"> ${U} </svg> <span class="ticket-numbers__label dlr-text-small">Ticket Number(s):</span> </div> <div> <a class="ticket-numbers__content" href="${E(this.getTicketDetailsRoute())}">${(t=e.submissionResult.result)===null||t===void 0?void 0:t.id}</a> </div> </div>`:c}renderFooter(){return a`<div class="result-form__footer"> ${this.isSuccess?c:a`<ix-button appearance="outlined" @click="${this.handleOnRetry}">RETRY</ix-button>`} ${this.isEdit?a`<ix-button @click="${()=>this.handleCloseClick()}">CLOSE</ix-button>`:a`<ix-button @click="${this.handleOnViewAllTickets}">VIEW ALL SERVICE TICKETS</ix-button>`} </div>`}renderAttachmentsFailedMessage(){return x.error.uploadingAttachments?a`<attachment-upload-failed-message .fileNames="${x.failedAttachments}"></attachment-upload-failed-message>`:c}render(){return e.loadings.isSubmitting?a`<div class="w-full flex justify-center mt-12"> <ix-progress .indeterminate="${!0}" .linear="${!1}"></ix-progress> </div>`:a` <div class="form-margin"> <div class="result-form"> ${this.renderIcon()} ${this.renderTitle()} ${this.renderBody()} ${this.renderTicketNumbers()} ${this.renderAttachmentsFailedMessage()} ${this.renderFooter()} </div> </div>`}};y.styles=[T,b],o([u({type:Boolean})],y.prototype,"isEdit",void 0),y=o([$("create-edit-customer-care-result")],y);let g=class extends C{constructor(){super(...arguments),this.isEdit=!1,this.isSubmitting=!1}async handleOnSubmit(){var t;this.isSubmitting=!0;try{this.onSubmitted&&(this.isEdit?await e.updateTicket():await e.createTicket())}finally{x.ticketStep=L,this.isSubmitting=!1,(t=this.onSubmitted)===null||t===void 0||t.call(this)}}renderFormFields(){var t,i,s,r,l;return e.loadings.isSubmitting?a`<div class="w-full flex justify-center mt-12"> <ix-progress .indeterminate="${!0}" .linear="${!1}"></ix-progress> </div>`:a`<div class="form-wrapper"> <div class="summary-form"> <div class="summary-form__subheader"> <span>Service Ticket Details</span> <span> <md-icon slot="icon" @click="${()=>{var n;return(n=this.onEditButtonClicked)===null||n===void 0?void 0:n.call(this)}}"> edit </md-icon> </span> </div> <div class="summary-form__field"> <span>Subject</span> <span>${e.ticket.subject}</span> </div> <div class="summary-form__field"> <span>Description</span> <span class="whitespace-break-spaces">${e.ticket.description}</span> </div> <div class="summary-form__field"> <span>Request Type</span> <span>${e.ticket.requestType}</span> </div> <div class="summary-form__field"> <span>Category</span> <span>${e.ticket.category}</span> </div> <div class="summary-form__field"> <span>Site</span> <span> ${(t=e.ticket.site)===null||t===void 0?void 0:t.displayName} - ${(i=e.ticket.site)===null||i===void 0?void 0:i.accountNumber} </span> </div> <div class="summary-form__field"> <span>Location</span> <span>${(s=e.ticket.location)===null||s===void 0?void 0:s.id}</span> </div> ${e.ticket.serviceBackend!==m.TelxSFDC?a`<div class="summary-form__field"> <span>Customer Reference Number</span> <span>${e.ticket.customerReferenceNumber}</span> </div>`:c} ${e.ticket.serviceBackend!==m.TelxSFDC?a`<div class="summary-form__field"> <span>${q}</span> <span> ${!((r=e.ticket.contacts)===null||r===void 0)&&r.length?a`<ix-chip-set> ${e.ticket.contacts.split(",").map(n=>a`<span> <ix-chip label="${n}"></ix-chip> </span>`)} </ix-chip-set>`:c} </span> </div>`:c} <div class="summary-form__field"> <span>Attachments</span> <div> ${(l=e.ticket.attachments)===null||l===void 0?void 0:l.map(n=>a`<div class="attachments-file-summary"> ${n.fileName} </div>`)} </div> </div> </div> </div>`}render(){var t;return a` <div class="wizard-content form-margin"> <div> <h1 class="dlr-text-page-title"> ${this.isEdit?"Edit":"Create"} Customer Care Service Ticket ${this.isEdit?`#${(t=e.selectedTicket)===null||t===void 0?void 0:t.id}`:""} </h1> <div class="sub-header dlr-text-heading"> <h3 class="dlr-text-heading">Are these details correct?</h3> <ix-button type="submit" has-icon trailing-icon @click="${this.handleOnSubmit}" ?submitting="${this.isSubmitting}"> <ix-icon slot="icon">east</ix-icon> <span class="button-label">YES, SUBMIT</span> </ix-button> </div> </div> ${this.renderFormFields()} </div>`}};g.styles=[T,b],o([u({attribute:!1})],g.prototype,"onEditButtonClicked",void 0),o([u({attribute:!1})],g.prototype,"onSubmitted",void 0),o([u({type:Boolean})],g.prototype,"isEdit",void 0),o([S()],g.prototype,"isSubmitting",void 0),g=o([$("create-edit-customer-care-summary")],g);const d={details:1,summary:2,result:3};let p=class extends C{constructor(){super(...arguments),this.currentStep=d.details,this.isEdit=!1}firstUpdated(){this.selectedSite&&e.updateSite(this.selectedSite)}disconnectedCallback(){super.disconnectedCallback(),this.isEdit||e.clear()}handleWizardClose(){this.currentStep===d.result&&(this.currentStep=d.details)}renderDetailsStep(){return a` <ix-wizard-step .isVisible="${this.currentStep===d.details}" .isNextButtonVisible="${!1}"> <create-edit-customer-care-service-ticket ?isEdit="${this.isEdit}" .onNextButtonClick="${()=>{this.currentStep=d.summary}}" .onSubmitted="${()=>{this.currentStep=d.result}}" .onCancelled="${()=>this.toggleDrawer()}"> </create-edit-customer-care-service-ticket> </ix-wizard-step>`}renderSummaryStep(){return this.isEdit?c:this.currentStep!==d.summary?c:a` <ix-wizard-step .isVisible="${this.currentStep===d.summary}" .isNextButtonVisible="${!1}"> <create-edit-customer-care-summary ?isEdit="${this.isEdit}" .onEditButtonClicked="${()=>{this.currentStep=d.details}}" .onSubmitted="${()=>{this.currentStep=d.result}}"> </create-edit-customer-care-summary> </ix-wizard-step>`}renderResultStep(){return this.currentStep!==d.result?c:a` <ix-wizard-step .isVisible="${this.currentStep===d.result}" .isNextButtonVisible="${!1}"> <create-edit-customer-care-result ?isEdit="${this.isEdit}"></create-edit-customer-care-result> </ix-wizard-step>`}get CreateEditCustomerCareServiceTicket(){var t,i;return(i=(t=this.shadowRoot)===null||t===void 0?void 0:t.querySelector("create-edit-customer-care-service-ticket"))!==null&&i!==void 0?i:null}get enableNextStepClick(){return this.currentStep===d.details?e.ticket.isValid:!0}handleNextStepClick(){var t;this.currentStep===d.details?(t=this.CreateEditCustomerCareServiceTicket)===null||t===void 0||t.handleNextClick():this.currentStep+=1}handlePrevStepClick(){this.currentStep===d.details&&!this.isEdit?O(this,f.CreateTicket):this.isEdit&&this.currentStep===d.details?this.toggleDrawer():this.currentStep-=1}render(){return a` <ix-wizard totalSteps="2" .currentStep="${this.currentStep}" .hideStepCount="${this.isEdit||this.currentStep===d.result}" .hideNextStep="${this.currentStep===d.summary}" .onNextStepClick="${()=>this.handleNextStepClick()}" .onPrevStepClick="${()=>this.handlePrevStepClick()}" .enableNextStepClick="${this.enableNextStepClick}" .enableHideCloseButton="${!this.isEdit}" .onCloseClick="${()=>this.onCloseClick()}" .onMinimiseClick="${()=>this.onMinimiseClick()}"> ${this.renderDetailsStep()} ${this.renderSummaryStep()} ${this.renderResultStep()} </ix-wizard>`}};p.styles=[],o([u({type:Object})],p.prototype,"selectedSite",void 0),o([S()],p.prototype,"currentStep",void 0),o([u({type:Boolean})],p.prototype,"isEdit",void 0),o([u({type:Function})],p.prototype,"toggleDrawer",void 0),o([u({type:Function})],p.prototype,"onCloseClick",void 0),o([u({type:Function})],p.prototype,"onMinimiseClick",void 0),p=o([$("customer-care-service-ticket-wizard")],p);
@@ -1 +1 @@
1
- import{__decorate as d}from"tslib";import{MobxLitElement as P}from"@adobe/lit-mobx";import"@digital-realty/ix-button/ix-button.js";import"@digital-realty/ix-chip/ix-chip.js";import"@digital-realty/ix-date-next/ix-date-next.js";import"@digital-realty/ix-date/ix-date.js";import"@digital-realty/ix-drawer/ix-drawer.js";import"@digital-realty/ix-grid/ix-grid-no-rows.js";import"@digital-realty/ix-grid/ix-grid.js";import"@digital-realty/ix-progress/ix-progress.js";import"@digital-realty/ix-tooltip/ix-tooltip.js";import{LitElement as A,html as n,nothing as w}from"lit";import{property as k,state as h,customElement as f}from"lit/decorators.js";import{b4 as C,aQ as g,g as x,ba as O,bb as _,T,V as L,a2 as N,v as G,L as M,bc as R,aR as U,b1 as V,b7 as b,n as F}from"./ui-service-management.js";import{A as E,F as v,b as S,O as $}from"./ui-service-management11.js";import{d as z}from"./ui-service-management12.js";import{S as D}from"./ui-service-management9.js";import"./ui-service-management18.js";import{R as K}from"./ui-service-management28.js";import{makeAutoObservable as q,reaction as B}from"mobx";import"@digital-realty/ix-tabs/ix-tabs.js";import"@digital-realty/ix-tabs/ix-primary-tab.js";import"@digital-realty/ix-divider/ix-divider.js";import"./ui-service-management17.js";import"moment";import"@digital-realty/theme";import"moment-timezone";import"date-fns/format.js";import"mobx-persist-store";import"@digital-realty/ix-account-switcher";import"@vaadin/router";import"oidc-client-ts";import"lit/directives/if-defined.js";import"@digital-realty/ix-select/ix-select.js";import"@digital-realty/ix-select/ix-select-option.js";import"@digital-realty/ix-icon-button/ix-icon-button.js";import"lit-html/directives/until.js";import"libphonenumber-js";import"@digital-realty/ix-grid/ix-grid-nav.js";import"lit/directives/class-map.js";import"lit-html/directives/unsafe-html.js";import"@digital-realty/ix-toast/ix-toasters.js";import"@digital-realty/ix-toast/ix-message-toast.js";const I={loadings:{incidentsList:!0,downloadIncidentsList:!1,downloadAttachment:{},getIncidentTicket:!1},errorIncidentsGrid:!1};class j{constructor(){this.loadings=I.loadings,this.errorIncidentsGrid=I.errorIncidentsGrid,q(this)}async GetIncident(t){let i;return t&&(this.loadings.getIncidentTicket=!0,i=await C.incidentsApi.getIncidentsTicketById({ticketId:t}).catch(s=>{g(s,!1)}).finally(()=>{this.loadings.getIncidentTicket=!1})),i}async GetIncidentsList(t,i,s,r,a){const{accountNumber:o}=x.getUserAccount();let l;return this.errorIncidentsGrid=!1,o&&(this.loadings.incidentsList=!0,l=await C.incidentsApi.getIncidentsTickets({$filter:t,$orderby:i,$skip:s,$top:r},a).catch(y=>{var u;!((u=a==null?void 0:a.signal)===null||u===void 0)&&u.aborted||(g(y,!1),this.errorIncidentsGrid=!0)}).finally(()=>{this.loadings.incidentsList=!1})),l}async downloadIncidentsList(t,i,s,r){this.loadings.downloadIncidentsList=!0,await O(t,i,s,r),this.loadings.downloadIncidentsList=!1}async downloadIncidentAttachment(t,i,s){const r=`${t}_${i}`;this.loadings.downloadAttachment[r]=!0,await _(t,i,s).catch(a=>{g(a,!1)}).finally(()=>{this.loadings.downloadAttachment[r]=!1})}}const c=new j,Z=[{id:"details",label:"Details"},{id:"activity",label:"Activity"}];let p=class extends A{constructor(){super(...arguments),this.useNewDatePickerComponent=!1,this.activeTab="details",this.hasUpdatePermissions=!1,this.statusAllowsUpdate=!1,this.toggleVisibilityReactionDisposers=new Map}async firstUpdated(){const e=L.sites.find(t=>t.name===this.incident.site);this.site=e?`${e==null?void 0:e.name} - ${e==null?void 0:e.streetAddress}`:this.incident.site,e!=null&&e.locationId&&this.incident.accountNumber&&(this.hasUpdatePermissions=await N(M.Update,G.PlannedMaintenance,e.locationId,this.incident.accountNumber)),this.statusAllowsUpdate=this.incident.status!==R.Closed&&this.incident.status!==R.Cancelled}disconnectedCallback(){super.disconnectedCallback(),this.toggleVisibilityReactionDisposers.forEach(e=>e()),this.toggleVisibilityReactionDisposers.clear()}toggleVisibility(e,t,i){const s=e.parentElement,r=s==null?void 0:s.querySelector(`#progress-${t}`);r.style.display=i?"inline-block":"none";const a=e;a.style.display=i?"none":"inline-block"}deleteToggleVisibilityReactionByKey(e){this.toggleVisibilityReactionDisposers.get(e)(),this.toggleVisibilityReactionDisposers.delete(e)}async handleAttachmentClick(e,t){const i=e.currentTarget,s=this.incident.id,r=i.getAttribute("attachment-id");if(!r){U("Unable to download the attachment");return}this.toggleVisibility(i,r,!0);const a=`${s}_${r}`;this.toggleVisibilityReactionDisposers.has(a)&&this.deleteToggleVisibilityReactionByKey(a);const o=B(()=>c.loadings.downloadAttachment[a],l=>{this.toggleVisibility(i,r,l),l||this.deleteToggleVisibilityReactionByKey(a)});this.toggleVisibilityReactionDisposers.set(a,o),await c.downloadIncidentAttachment(s,r,t.fileName||s)}renderActivityPanel(){var e;const t=((e=this.incident.comments)===null||e===void 0?void 0:e.map(i=>({comment:i.comment||"",commentedOn:i.createdAt||"",commentedBy:i.createdBy||""})))||[];return n`<ticket-comments .ticketNumber="${this.incident.id}" .ticketType="${V.INCIDENTS}" .comments="${t}" ?IsDisabled="${!this.hasUpdatePermissions||!this.statusAllowsUpdate}"> </ticket-comments>`}renderDetailsPanel(){var e;return n` <div class=""> <div class="summary-form"> <div class="summary-form__field" name="id"> <span>ID</span> <span>${this.incident.id}</span> </div> <div class="summary-form__field" name="description"> <span>Short Description</span> <span class="whitespace-preserve">${this.incident.subject}</span> </div> <div class="summary-form__field" name="account"> <span>Account</span> <span>${this.incident.accountName}</span> </div> <div class="summary-form__field" name="site"> <span>Site</span> <span>${this.site}</span> </div> <div class="summary-form__field" name="priority"> <span>Priority</span> <span>${this.incident.priority}</span> </div> <div class="summary-form__field" name="status"> <span>Status</span> <span>${this.incident.status}</span> </div> <div class="summary-form__field" name="opened"> <span>Opened</span> <span> ${this.useNewDatePickerComponent===!0?n`<ix-date-next type="static" .value="${this.incident.createdAt}" .noTimeZoneConversion="${!0}" variant="date-time"> </ix-date-next>`:n`<ix-date type="static" .value="${this.incident.createdAt}" .noTimeZoneConversion="${!0}" variant="date-time"> </ix-date>`} </span> </div> <div class="summary-form__field" name="updated"> <span>Updated</span> <span> ${this.useNewDatePickerComponent===!0?n`<ix-date-next type="static" .value="${this.incident.updatedAt}" .noTimeZoneConversion="${!0}" variant="date-time"> </ix-date-next>`:n`<ix-date type="static" .value="${this.incident.updatedAt}" .noTimeZoneConversion="${!0}" variant="date-time"> </ix-date>`} </span> </div> <ix-divider></ix-divider> <div class="summary-form__field" name="attachments"> <span>Attachments</span> <span> ${(e=this.incident.attachments)===null||e===void 0?void 0:e.map(t=>n` <ix-progress id="progress-${t.id}" .linear="${!1}" indeterminate="false" style="--md-circular-progress-size:2rem;display:none;padding:.0625rem"></ix-progress> <div @click="${i=>this.handleAttachmentClick(i,t)}" attachment-id="${t.id}" class="file-attachment cursor-pointer"> <span>${t.fileName}</span> </div>`)} </span> </div> </div> </div>`}renderActivePanel(){switch(this.activeTab){case"details":return this.renderDetailsPanel();case"activity":return this.renderActivityPanel();default:return w}}renderTabs(){return n` <ix-tabs inline> ${Z.map(e=>n` <ix-primary-tab ?active="${this.activeTab===e.id}" @click="${()=>{this.activeTab=e.id}}"> ${e.label} </ix-primary-tab>`)} </ix-tabs> <div class="tab-navigation"></div> `}renderHeader(){return n` <h2>Incident Work Order Case #${this.incident.id}</h2> `}render(){return n` <div class="mt-2 form-margin wizard-content"> <div class="incident-header">${this.renderHeader()}</div> <div>${this.renderTabs()}</div> <div class="overflow-auto">${this.renderActivePanel()}</div> </div> `}};p.styles=[D,T],d([k({type:Object})],p.prototype,"incident",void 0),d([k({type:Boolean})],p.prototype,"useNewDatePickerComponent",void 0),d([h()],p.prototype,"activeTab",void 0),d([h()],p.prototype,"site",void 0),d([h()],p.prototype,"hasUpdatePermissions",void 0),d([h()],p.prototype,"statusAllowsUpdate",void 0),p=d([f("incident-details")],p);let m=class extends P{constructor(){super(),this.incidentRecords=void 0,this.incidentRecord=void 0,this.showDrawer=!1,this.fetchTicketsController=new AbortController,this.listSort="updated_at desc",this.listSkip=0,this.listPageSize=b,this.useNewDatePickerComponent=!1,this.dateCellRenderer=e=>t=>{const i=t[e],s=this.useNewDatePickerComponent?n`<ix-date-next type="static" variant="date-time" .value="${i}" .noTimeZoneConversion="${!0}" @click="${()=>this.handleRowClick(t)}" @keypress="${r=>this.handleKeyPress(r,t)}"></ix-date-next>`:n`<ix-date type="static" variant="date-time" .value="${i}" .noTimeZoneConversion="${!0}" @click="${()=>this.handleRowClick(t)}" @keypress="${r=>this.handleKeyPress(r,t)}"></ix-date>`;return n`<span> ${s} </span>`},this.useNewDatePickerComponent=F.showNewDatePickerComponent()}async connectedCallback(){this.debouncedHandleTableChange=z(this.handleTableChange.bind(this),300);const e=await x.getHashedRootAccountNumberAndUserEmail();e&&(this.hashedLocalStorageID=`incidents-tickets-${e}`),super.connectedCallback()}toggleDrawer(){this.showDrawer=!this.showDrawer,this.showDrawer||window.history.replaceState({},document.title,`${E}/incidents`)}handleCellMouseOver(e,t){const i=e.target,s=i.closest("vaadin-grid-cell-content")||i;s.offsetWidth<s.scrollWidth&&document.dispatchEvent(new CustomEvent("show-tooltip",{detail:{target:e.composedPath()[0],placement:"bottom-start",tooltip:n`<div style="background-color:#092241;font-size:12px;color:#fff;text-align:left;padding:5px 8px;border-radius:3px;max-width:300px;word-wrap:break-word"> ${t} </div>`}}))}handleCellMouseOut(){document.dispatchEvent(new CustomEvent("hide-tooltip"))}getColumns(){return[{name:"id",header:"ID",bodyRenderer:e=>n`<span @mouseover="${t=>{var i;return this.handleCellMouseOver(t,(i=e.id)!==null&&i!==void 0?i:"")}}" @mouseout="${this.handleCellMouseOut}" @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}">${e.id}</span>`,sortable:!0,filterable:!0,filterOperators:["contains","equals"]},{name:"subject",header:"Short Description",width:"360px",bodyRenderer:e=>n`<span @mouseover="${t=>{var i;return this.handleCellMouseOver(t,(i=e.subject)!==null&&i!==void 0?i:"")}}" @mouseout="${this.handleCellMouseOut}" @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}" style="text-wrap:auto;white-space:preserve">${e.subject}</span>`,sortable:!0,filterable:!0,filterOperators:["contains","equals"]},{name:"account",header:"Account",width:"120px",bodyRenderer:e=>n`<span @mouseover="${t=>{var i;return this.handleCellMouseOver(t,(i=e.accountName)!==null&&i!==void 0?i:"")}}" @mouseout="${this.handleCellMouseOut}" @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}" style="text-wrap:auto">${e.accountName}</span>`,sortable:!0,filterable:!0,filterOperators:["contains","equals"]},{name:"site",header:"Site",width:"247px",flexGrow:0,bodyRenderer:e=>n` <site-location-cell @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}" .items="${[e.site]}"> </site-location-cell>`,sortable:!0,filterable:!0,filterOperators:["contains","equals"]},{name:"priority",header:"Priority",width:"127px",flexGrow:0,bodyRenderer:e=>n`<span @mouseover="${t=>{var i;return this.handleCellMouseOver(t,(i=e.priority)!==null&&i!==void 0?i:"")}}" @mouseout="${this.handleCellMouseOut}" @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}">${e.priority}</span>`,sortable:!0,filterable:!0,filterOperators:["contains","equals"]},{name:"status",header:"Status",width:"119px",flexGrow:0,bodyRenderer:e=>n`<span @mouseover="${t=>{var i;return this.handleCellMouseOver(t,(i=e.status)!==null&&i!==void 0?i:"")}}" @mouseout="${this.handleCellMouseOut}" @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}">${e.status}</span>`,sortable:!0,filterable:!0,filterOperators:["contains","equals"]},{name:"opened",header:"Opened",bodyRenderer:this.dateCellRenderer("createdAt"),sortable:!0,filterable:!0,filterOperators:["equals"],dataType:"dateTime"},{name:"updated",header:"Updated",bodyRenderer:this.dateCellRenderer("updatedAt"),sortable:!0,filterable:!0,filterOperators:["equals"],dataType:"dateTime"}]}get downloadMenuItems(){return[{label:"Download All Incidents",name:"download-all-tickets",onClick:e=>{this.handleDownloadCsv(e)}},{label:"Download Current View",name:"download-current-filter",onClick:e=>{this.handleDownloadCsv(e)}}]}handleKeyPress(e,t){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.handleRowClick(t))}async handleRowClick(e){e!=null&&e.id&&(this.incidentRecord=await c.GetIncident(e.id),this.showDrawer=!0)}async handleTableChange(e){const{columnName:t,page:i,pageSize:s,sortOrder:r,filters:a,filtersOperators:o}=e.detail;this.listPageSize=s;const l={id:this.tryGetFilter(a,o,"id",v.Single,!0),subject:this.tryGetFilter(a,o,"subject",v.Single,!0),account_name:this.tryGetFilter(a,o,"account",v.Single,!0),site:this.tryGetFilter(a,o,"site",v.Single,!0),priority:this.tryGetFilter(a,o,"priority",v.Single,!0),status:this.tryGetFilter(a,o,"status",v.Single,!0),created_at:this.tryGetFilter(a,o,"opened",v.Single,!1,!0),updated_at:this.tryGetFilter(a,o,"updated",v.Single,!1,!0)};if(this.currentFilters=l,t&&r){const y={account:"account_name",opened:"created_at",updated:"updated_at"}[t]||t;this.listSort=`${y} ${r}`}this.listSkip=(i-1)*this.listPageSize,this.fetchTicketsController.abort(),this.fetchTicketsController=new AbortController,this.fetchTickets({signal:this.fetchTicketsController.signal})}async fetchTickets(e){const t=this.listPageSize||b,i=S(this.currentFilters,{orderBy:[this.listSort],top:t,skip:this.listSkip}),s=new URLSearchParams(i);this.incidentRecords=await c.GetIncidentsList(s.get("$filter")||void 0,s.get("$orderby")||void 0,this.listSkip,t,e)}async handleDownloadCsv(e){switch(e){case"download-all-tickets":await c.downloadIncidentsList(void 0,"updated_at desc");break;case"download-current-filter":{const t=this.listPageSize||b,i=S(this.currentFilters,{orderBy:[this.listSort],top:t,skip:this.listSkip}),s=new URLSearchParams(i);await c.downloadIncidentsList(s.get("$filter")||void 0,s.get("$orderby")||void 0,this.listSkip,t);break}}}tryGetFilter(e,t,i,s,r,a=!1){const o=t.find(u=>u.columnField===i);if(o===void 0)return[];const l=e[i];if(l===void 0)return[];const y=a||o.operator==="contains"?$.Contains:$.Equals;return(Array.isArray(l)?l:[l]).map(u=>({matchValue:u.value||u,equalityOperator:y,concatenationOperator:$.Or,fieldType:s,ignoreCase:r}))}renderGridNoRows(){const e=c.errorIncidentsGrid?"Sorry, an error has occurred":this.incidentRecords!==void 0?"No data to display":null;return e?n`<ix-grid-no-rows slot="no-rows" message="${e}"></ix-grid-no-rows>`:w}renderBody(){return c.loadings.getIncidentTicket?w:this.incidentRecord?n` <incident-details .incident="${this.incidentRecord}" .useNewDatePickerComponent="${this.useNewDatePickerComponent}"> </incident-details>`:n` <div class="report-drawer-error"> <sm-error> This Incident is currently not available. Check back later, or contact support. </sm-error> </div>`}render(){var e,t,i,s;return n`<div class="incidents-grid"> <ix-grid session-storage-key="sm-incidents" column-reordering-allowed .columns="${this.getColumns()}" .downloadMenuItems="${this.downloadMenuItems}" .rows="${(t=(e=this.incidentRecords)===null||e===void 0?void 0:e.items)!==null&&t!==void 0?t:[]}" .recordCount="${(s=(i=this.incidentRecords)===null||i===void 0?void 0:i.totalCount)!==null&&s!==void 0?s:0}" @change="${this.debouncedHandleTableChange}" .localStorageID="${this.hashedLocalStorageID}" .addParamsToURL="${!1}" .pageSize="${20}" .pageSizes="${[5,10,20,50,100]}" .isLoading="${c.loadings.incidentsList||c.loadings.getIncidentTicket}" .isDownloading="${c.loadings.downloadIncidentsList}" ?useNewDatePicker="${this.useNewDatePickerComponent}"> <reports-nav-bar slot="header" .selectedTab="${K.Incidents}"></reports-nav-bar> ${this.renderGridNoRows()} </ix-grid> </div> <ix-tooltip></ix-tooltip> <ix-drawer ?isVisible="${this.showDrawer}" .onClosed="${()=>this.toggleDrawer()}" .scrollable="${!1}"> <div slot="content">${this.renderBody()}</div> </ix-drawer>`}};m.styles=[D,T],d([h()],m.prototype,"hashedLocalStorageID",void 0),d([h()],m.prototype,"currentFilters",void 0),d([h()],m.prototype,"incidentRecords",void 0),d([h()],m.prototype,"incidentRecord",void 0),d([h()],m.prototype,"showDrawer",void 0),m=d([f("incidents-list")],m);export{m as IncidentsList};
1
+ import{__decorate as d}from"tslib";import{MobxLitElement as P}from"@adobe/lit-mobx";import"@digital-realty/ix-button/ix-button.js";import"@digital-realty/ix-chip/ix-chip.js";import"@digital-realty/ix-date-next/ix-date-next.js";import"@digital-realty/ix-date/ix-date.js";import"@digital-realty/ix-drawer/ix-drawer.js";import"@digital-realty/ix-grid/ix-grid-no-rows.js";import"@digital-realty/ix-grid/ix-grid.js";import"@digital-realty/ix-progress/ix-progress.js";import"@digital-realty/ix-tooltip/ix-tooltip.js";import{LitElement as A,html as n,nothing as w}from"lit";import{property as k,state as h,customElement as f}from"lit/decorators.js";import{b4 as C,aQ as g,g as x,ba as O,bb as _,T,V as L,a2 as N,v as G,L as M,bc as R,aR as U,b1 as V,b7 as b,n as F}from"./ui-service-management.js";import{A as E,F as v,b as S,O as $}from"./ui-service-management11.js";import{d as z}from"./ui-service-management12.js";import{S as D}from"./ui-service-management9.js";import"./ui-service-management18.js";import{R as K}from"./ui-service-management28.js";import{makeAutoObservable as q,reaction as B}from"mobx";import"@digital-realty/ix-tabs/ix-tabs.js";import"@digital-realty/ix-tabs/ix-primary-tab.js";import"@digital-realty/ix-divider/ix-divider.js";import"./ui-service-management17.js";import"moment";import"@digital-realty/theme";import"moment-timezone";import"date-fns/format.js";import"mobx-persist-store";import"@digital-realty/ix-account-switcher";import"@vaadin/router";import"oidc-client-ts";import"lit/directives/if-defined.js";import"@digital-realty/ix-select/ix-select.js";import"@digital-realty/ix-select/ix-select-option.js";import"@digital-realty/ix-icon-button/ix-icon-button.js";import"lit-html/directives/until.js";import"libphonenumber-js";import"@digital-realty/ix-grid/ix-grid-nav.js";import"lit/directives/class-map.js";import"lit-html/directives/unsafe-html.js";import"@digital-realty/ix-toast/ix-toasters.js";import"@digital-realty/ix-toast/ix-message-toast.js";const I={loadings:{incidentsList:!0,downloadIncidentsList:!1,downloadAttachment:{},getIncidentTicket:!1},errorIncidentsGrid:!1};class j{constructor(){this.loadings=I.loadings,this.errorIncidentsGrid=I.errorIncidentsGrid,q(this)}async GetIncident(t){let i;return t&&(this.loadings.getIncidentTicket=!0,i=await C.incidentsApi.getIncidentsTicketById({ticketId:t}).catch(s=>{g(s,!1)}).finally(()=>{this.loadings.getIncidentTicket=!1})),i}async GetIncidentsList(t,i,s,r,a){const{accountNumber:o}=x.getUserAccount();let l;return this.errorIncidentsGrid=!1,o&&(this.loadings.incidentsList=!0,l=await C.incidentsApi.getIncidentsTickets({$filter:t,$orderby:i,$skip:s,$top:r},a).catch(y=>{var u;!((u=a==null?void 0:a.signal)===null||u===void 0)&&u.aborted||(g(y,!1),this.errorIncidentsGrid=!0)}).finally(()=>{this.loadings.incidentsList=!1})),l}async downloadIncidentsList(t,i,s,r){this.loadings.downloadIncidentsList=!0,await O(t,i,s,r),this.loadings.downloadIncidentsList=!1}async downloadIncidentAttachment(t,i,s){const r=`${t}_${i}`;this.loadings.downloadAttachment[r]=!0,await _(t,i,s).catch(a=>{g(a,!1)}).finally(()=>{this.loadings.downloadAttachment[r]=!1})}}const c=new j,Z=[{id:"details",label:"Details"},{id:"activity",label:"Activity"}];let p=class extends A{constructor(){super(...arguments),this.useNewDatePickerComponent=!1,this.activeTab="details",this.hasUpdatePermissions=!1,this.statusAllowsUpdate=!1,this.toggleVisibilityReactionDisposers=new Map}async firstUpdated(){const e=L.sites.find(t=>t.name===this.incident.site);this.site=e?`${e==null?void 0:e.name} - ${e==null?void 0:e.streetAddress}`:this.incident.site,e!=null&&e.locationId&&this.incident.accountNumber&&(this.hasUpdatePermissions=await N(M.Update,G.PlannedMaintenance,e.locationId,this.incident.accountNumber)),this.statusAllowsUpdate=this.incident.status!==R.Closed&&this.incident.status!==R.Cancelled}disconnectedCallback(){super.disconnectedCallback(),this.toggleVisibilityReactionDisposers.forEach(e=>e()),this.toggleVisibilityReactionDisposers.clear()}toggleVisibility(e,t,i){const s=e.parentElement,r=s==null?void 0:s.querySelector(`#progress-${t}`);r.style.display=i?"inline-block":"none";const a=e;a.style.display=i?"none":"inline-block"}deleteToggleVisibilityReactionByKey(e){this.toggleVisibilityReactionDisposers.get(e)(),this.toggleVisibilityReactionDisposers.delete(e)}async handleAttachmentClick(e,t){const i=e.currentTarget,s=this.incident.id,r=i.getAttribute("attachment-id");if(!r){U("Unable to download the attachment");return}this.toggleVisibility(i,r,!0);const a=`${s}_${r}`;this.toggleVisibilityReactionDisposers.has(a)&&this.deleteToggleVisibilityReactionByKey(a);const o=B(()=>c.loadings.downloadAttachment[a],l=>{this.toggleVisibility(i,r,l),l||this.deleteToggleVisibilityReactionByKey(a)});this.toggleVisibilityReactionDisposers.set(a,o),await c.downloadIncidentAttachment(s,r,t.fileName||s)}renderActivityPanel(){var e;const t=((e=this.incident.comments)===null||e===void 0?void 0:e.map(i=>({comment:i.comment||"",commentedOn:i.createdAt||"",commentedBy:i.createdBy||""})))||[];return n`<ticket-comments .ticketNumber="${this.incident.id}" .ticketType="${V.INCIDENTS}" .comments="${t}" ?IsDisabled="${!this.hasUpdatePermissions||!this.statusAllowsUpdate}"> </ticket-comments>`}renderDetailsPanel(){var e;return n` <div class=""> <div class="summary-form"> <div class="summary-form__field" name="id"> <span>ID</span> <span>${this.incident.id}</span> </div> <div class="summary-form__field" name="description"> <span>Short Description</span> <span>${this.incident.subject}</span> </div> <div class="summary-form__field" name="account"> <span>Account</span> <span>${this.incident.accountName}</span> </div> <div class="summary-form__field" name="site"> <span>Site</span> <span>${this.site}</span> </div> <div class="summary-form__field" name="priority"> <span>Priority</span> <span>${this.incident.priority}</span> </div> <div class="summary-form__field" name="status"> <span>Status</span> <span>${this.incident.status}</span> </div> <div class="summary-form__field" name="opened"> <span>Opened</span> <span> ${this.useNewDatePickerComponent===!0?n`<ix-date-next type="static" .value="${this.incident.createdAt}" .noTimeZoneConversion="${!0}" variant="date-time"> </ix-date-next>`:n`<ix-date type="static" .value="${this.incident.createdAt}" .noTimeZoneConversion="${!0}" variant="date-time"> </ix-date>`} </span> </div> <div class="summary-form__field" name="updated"> <span>Updated</span> <span> ${this.useNewDatePickerComponent===!0?n`<ix-date-next type="static" .value="${this.incident.updatedAt}" .noTimeZoneConversion="${!0}" variant="date-time"> </ix-date-next>`:n`<ix-date type="static" .value="${this.incident.updatedAt}" .noTimeZoneConversion="${!0}" variant="date-time"> </ix-date>`} </span> </div> <ix-divider></ix-divider> <div class="summary-form__field" name="attachments"> <span>Attachments</span> <span> ${(e=this.incident.attachments)===null||e===void 0?void 0:e.map(t=>n` <ix-progress id="progress-${t.id}" .linear="${!1}" indeterminate="false" style="--md-circular-progress-size:2rem;display:none;padding:.0625rem"></ix-progress> <div @click="${i=>this.handleAttachmentClick(i,t)}" attachment-id="${t.id}" class="file-attachment cursor-pointer"> <span>${t.fileName}</span> </div>`)} </span> </div> </div> </div>`}renderActivePanel(){switch(this.activeTab){case"details":return this.renderDetailsPanel();case"activity":return this.renderActivityPanel();default:return w}}renderTabs(){return n` <ix-tabs inline> ${Z.map(e=>n` <ix-primary-tab ?active="${this.activeTab===e.id}" @click="${()=>{this.activeTab=e.id}}"> ${e.label} </ix-primary-tab>`)} </ix-tabs> <div class="tab-navigation"></div> `}renderHeader(){return n` <h2>Incident Work Order Case #${this.incident.id}</h2> `}render(){return n` <div class="mt-2 form-margin wizard-content"> <div class="incident-header">${this.renderHeader()}</div> <div>${this.renderTabs()}</div> <div class="overflow-auto">${this.renderActivePanel()}</div> </div> `}};p.styles=[D,T],d([k({type:Object})],p.prototype,"incident",void 0),d([k({type:Boolean})],p.prototype,"useNewDatePickerComponent",void 0),d([h()],p.prototype,"activeTab",void 0),d([h()],p.prototype,"site",void 0),d([h()],p.prototype,"hasUpdatePermissions",void 0),d([h()],p.prototype,"statusAllowsUpdate",void 0),p=d([f("incident-details")],p);let m=class extends P{constructor(){super(),this.incidentRecords=void 0,this.incidentRecord=void 0,this.showDrawer=!1,this.fetchTicketsController=new AbortController,this.listSort="updated_at desc",this.listSkip=0,this.listPageSize=b,this.useNewDatePickerComponent=!1,this.dateCellRenderer=e=>t=>{const i=t[e],s=this.useNewDatePickerComponent?n`<ix-date-next type="static" variant="date-time" .value="${i}" .noTimeZoneConversion="${!0}" @click="${()=>this.handleRowClick(t)}" @keypress="${r=>this.handleKeyPress(r,t)}"></ix-date-next>`:n`<ix-date type="static" variant="date-time" .value="${i}" .noTimeZoneConversion="${!0}" @click="${()=>this.handleRowClick(t)}" @keypress="${r=>this.handleKeyPress(r,t)}"></ix-date>`;return n`<span> ${s} </span>`},this.useNewDatePickerComponent=F.showNewDatePickerComponent()}async connectedCallback(){this.debouncedHandleTableChange=z(this.handleTableChange.bind(this),300);const e=await x.getHashedRootAccountNumberAndUserEmail();e&&(this.hashedLocalStorageID=`incidents-tickets-${e}`),super.connectedCallback()}toggleDrawer(){this.showDrawer=!this.showDrawer,this.showDrawer||window.history.replaceState({},document.title,`${E}/incidents`)}handleCellMouseOver(e,t){const i=e.target,s=i.closest("vaadin-grid-cell-content")||i;s.offsetWidth<s.scrollWidth&&document.dispatchEvent(new CustomEvent("show-tooltip",{detail:{target:e.composedPath()[0],placement:"bottom-start",tooltip:n`<div style="background-color:#092241;font-size:12px;color:#fff;text-align:left;padding:5px 8px;border-radius:3px;max-width:300px;word-wrap:break-word"> ${t} </div>`}}))}handleCellMouseOut(){document.dispatchEvent(new CustomEvent("hide-tooltip"))}getColumns(){return[{name:"id",header:"ID",bodyRenderer:e=>n`<span @mouseover="${t=>{var i;return this.handleCellMouseOver(t,(i=e.id)!==null&&i!==void 0?i:"")}}" @mouseout="${this.handleCellMouseOut}" @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}">${e.id}</span>`,sortable:!0,filterable:!0,filterOperators:["contains","equals"]},{name:"subject",header:"Short Description",width:"360px",bodyRenderer:e=>n`<span @mouseover="${t=>{var i;return this.handleCellMouseOver(t,(i=e.subject)!==null&&i!==void 0?i:"")}}" @mouseout="${this.handleCellMouseOut}" @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}" style="text-wrap:auto">${e.subject}</span>`,sortable:!0,filterable:!0,filterOperators:["contains","equals"]},{name:"account",header:"Account",width:"120px",bodyRenderer:e=>n`<span @mouseover="${t=>{var i;return this.handleCellMouseOver(t,(i=e.accountName)!==null&&i!==void 0?i:"")}}" @mouseout="${this.handleCellMouseOut}" @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}" style="text-wrap:auto">${e.accountName}</span>`,sortable:!0,filterable:!0,filterOperators:["contains","equals"]},{name:"site",header:"Site",width:"247px",flexGrow:0,bodyRenderer:e=>n` <site-location-cell @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}" .items="${[e.site]}"> </site-location-cell>`,sortable:!0,filterable:!0,filterOperators:["contains","equals"]},{name:"priority",header:"Priority",width:"127px",flexGrow:0,bodyRenderer:e=>n`<span @mouseover="${t=>{var i;return this.handleCellMouseOver(t,(i=e.priority)!==null&&i!==void 0?i:"")}}" @mouseout="${this.handleCellMouseOut}" @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}">${e.priority}</span>`,sortable:!0,filterable:!0,filterOperators:["contains","equals"]},{name:"status",header:"Status",width:"119px",flexGrow:0,bodyRenderer:e=>n`<span @mouseover="${t=>{var i;return this.handleCellMouseOver(t,(i=e.status)!==null&&i!==void 0?i:"")}}" @mouseout="${this.handleCellMouseOut}" @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}">${e.status}</span>`,sortable:!0,filterable:!0,filterOperators:["contains","equals"]},{name:"opened",header:"Opened",bodyRenderer:this.dateCellRenderer("createdAt"),sortable:!0,filterable:!0,filterOperators:["equals"],dataType:"dateTime"},{name:"updated",header:"Updated",bodyRenderer:this.dateCellRenderer("updatedAt"),sortable:!0,filterable:!0,filterOperators:["equals"],dataType:"dateTime"}]}get downloadMenuItems(){return[{label:"Download All Incidents",name:"download-all-tickets",onClick:e=>{this.handleDownloadCsv(e)}},{label:"Download Current View",name:"download-current-filter",onClick:e=>{this.handleDownloadCsv(e)}}]}handleKeyPress(e,t){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.handleRowClick(t))}async handleRowClick(e){e!=null&&e.id&&(this.incidentRecord=await c.GetIncident(e.id),this.showDrawer=!0)}async handleTableChange(e){const{columnName:t,page:i,pageSize:s,sortOrder:r,filters:a,filtersOperators:o}=e.detail;this.listPageSize=s;const l={id:this.tryGetFilter(a,o,"id",v.Single,!0),subject:this.tryGetFilter(a,o,"subject",v.Single,!0),account_name:this.tryGetFilter(a,o,"account",v.Single,!0),site:this.tryGetFilter(a,o,"site",v.Single,!0),priority:this.tryGetFilter(a,o,"priority",v.Single,!0),status:this.tryGetFilter(a,o,"status",v.Single,!0),created_at:this.tryGetFilter(a,o,"opened",v.Single,!1,!0),updated_at:this.tryGetFilter(a,o,"updated",v.Single,!1,!0)};if(this.currentFilters=l,t&&r){const y={account:"account_name",opened:"created_at",updated:"updated_at"}[t]||t;this.listSort=`${y} ${r}`}this.listSkip=(i-1)*this.listPageSize,this.fetchTicketsController.abort(),this.fetchTicketsController=new AbortController,this.fetchTickets({signal:this.fetchTicketsController.signal})}async fetchTickets(e){const t=this.listPageSize||b,i=S(this.currentFilters,{orderBy:[this.listSort],top:t,skip:this.listSkip}),s=new URLSearchParams(i);this.incidentRecords=await c.GetIncidentsList(s.get("$filter")||void 0,s.get("$orderby")||void 0,this.listSkip,t,e)}async handleDownloadCsv(e){switch(e){case"download-all-tickets":await c.downloadIncidentsList(void 0,"updated_at desc");break;case"download-current-filter":{const t=this.listPageSize||b,i=S(this.currentFilters,{orderBy:[this.listSort],top:t,skip:this.listSkip}),s=new URLSearchParams(i);await c.downloadIncidentsList(s.get("$filter")||void 0,s.get("$orderby")||void 0,this.listSkip,t);break}}}tryGetFilter(e,t,i,s,r,a=!1){const o=t.find(u=>u.columnField===i);if(o===void 0)return[];const l=e[i];if(l===void 0)return[];const y=a||o.operator==="contains"?$.Contains:$.Equals;return(Array.isArray(l)?l:[l]).map(u=>({matchValue:u.value||u,equalityOperator:y,concatenationOperator:$.Or,fieldType:s,ignoreCase:r}))}renderGridNoRows(){const e=c.errorIncidentsGrid?"Sorry, an error has occurred":this.incidentRecords!==void 0?"No data to display":null;return e?n`<ix-grid-no-rows slot="no-rows" message="${e}"></ix-grid-no-rows>`:w}renderBody(){return c.loadings.getIncidentTicket?w:this.incidentRecord?n` <incident-details .incident="${this.incidentRecord}" .useNewDatePickerComponent="${this.useNewDatePickerComponent}"> </incident-details>`:n` <div class="report-drawer-error"> <sm-error> This Incident is currently not available. Check back later, or contact support. </sm-error> </div>`}render(){var e,t,i,s;return n`<div class="incidents-grid"> <ix-grid session-storage-key="sm-incidents" column-reordering-allowed .columns="${this.getColumns()}" .downloadMenuItems="${this.downloadMenuItems}" .rows="${(t=(e=this.incidentRecords)===null||e===void 0?void 0:e.items)!==null&&t!==void 0?t:[]}" .recordCount="${(s=(i=this.incidentRecords)===null||i===void 0?void 0:i.totalCount)!==null&&s!==void 0?s:0}" @change="${this.debouncedHandleTableChange}" .localStorageID="${this.hashedLocalStorageID}" .addParamsToURL="${!1}" .pageSize="${20}" .pageSizes="${[5,10,20,50,100]}" .isLoading="${c.loadings.incidentsList||c.loadings.getIncidentTicket}" .isDownloading="${c.loadings.downloadIncidentsList}" ?useNewDatePicker="${this.useNewDatePickerComponent}"> <reports-nav-bar slot="header" .selectedTab="${K.Incidents}"></reports-nav-bar> ${this.renderGridNoRows()} </ix-grid> </div> <ix-tooltip></ix-tooltip> <ix-drawer ?isVisible="${this.showDrawer}" .onClosed="${()=>this.toggleDrawer()}" .scrollable="${!1}"> <div slot="content">${this.renderBody()}</div> </ix-drawer>`}};m.styles=[D,T],d([h()],m.prototype,"hashedLocalStorageID",void 0),d([h()],m.prototype,"currentFilters",void 0),d([h()],m.prototype,"incidentRecords",void 0),d([h()],m.prototype,"incidentRecord",void 0),d([h()],m.prototype,"showDrawer",void 0),m=d([f("incidents-list")],m);export{m as IncidentsList};
@@ -1,4 +1,4 @@
1
- import{css as t,svg as e}from"lit";const i=t`:host{--light-grey:rgba(9, 34, 65, 0.6);--tracking-number-warning-background:#f5f7ff;--md-dialog-container-color:white;--ix-file-uploader-label-font-size:12px;--ix-file-uploader-help-font-size:12px;--ix-grid-cell-height:auto;--ix-checkbox-radio-gap:1rem;--ix-drawer-padding:0px 40px 0px 16px;--wizard-custom-margin-left:24px;--ix-wizard-hideclose-header-custom-margin-left:var(--wizard-custom-margin-left)}.reports-grid-nav{--ix-button-font-family:var(--root-primary-font)}.flex_column{flex-direction:column}.sub-header{display:flex;justify-content:space-between;align-items:center;align-self:stretch;position:relative;z-index:2}.default-margin-top{margin-top:2rem}.sub-header__action-buttons{display:flex;margin-left:auto;gap:10px}.sub-header span{text-align:right;font-family:var(--root-primary-font);font-size:14px;font-weight:400;letter-spacing:.25px}.sub-header ix-button span{font-family:var(--root-secondary-font);font-weight:700;font-size:14px;line-height:100%;letter-spacing:1.25px;text-align:center;vertical-align:middle;text-transform:uppercase}.sub-header__row{display:flex;flex-direction:row;gap:50px;align-items:center;width:100%}.sub-header__row .sub-header__row_value{font-size:1rem}.sub-header__row div{width:25%}.sub-header__row div span{font-style:normal}.sub-header__row_caption{font-family:var(--root-secondary-font);font-size:20px;font-style:normal;font-weight:700;line-height:24px;letter-spacing:.15px;margin:0}.sub-header__row div:last-child{margin-left:auto;width:auto}.italic{font-style:italic}.visitors-grid__footer{display:flex;padding:10px;border-top:1px solid #e0e0e0}.form-wrapper__fields{display:flex;flex-direction:column;align-items:flex-start;gap:2rem;padding-right:1rem}.form-wrapper__fields ix-email-list,.form-wrapper__fields ix-select,.form-wrapper__fields ix-textbox{align-self:stretch}.form-wrapper__fields ix-divider{padding:0}.form-wrapper__fields .textfield{width:100%}.form-wrapper__fields packages-grid,.form-wrapper__fields requested-location-details-grid,.form-wrapper__fields visitors-grid{width:100%}.form-wrapper__fields .col-2{display:flex;align-items:flex-start;gap:24px;align-self:stretch}.form-wrapper__fields .col-2>*{width:50%}.form-wrapper__fields .col-1{align-items:flex-start;align-self:stretch;width:100%}.form-wrapper__fields ix-file-uploader{--ix-file-uploader-label-line-height:1rem;--ix-file-uploader-label-letter-spacing:1.25px;--ix-file-uploader-help-font-family:var(--root-primary-font);--ix-file-uploader-help-line-height:1rem;--ix-file-uploader-help-letter-spacing:0.4px;--ix-file-chip-font-size:1rem;--ix-file-chip-letter-spacing:0.15px}ix-file-uploader{width:100%;font-size:12px;align-self:stretch}.warning-text{padding:4px 16px 0 16px;font-size:12px;line-height:16px;margin:var(--warning-text-margin,inherit)}.package-dialog{min-width:500px}.contact-details-dialog{width:min(90vw,41.125rem);--ix-message-toast-error-bg:#db0028}.contact-details-dialog .col-2{flex-wrap:wrap}.contact-details-dialog .col-2>*{width:unset;flex-grow:1}.urgent-work-form{width:560px}.summary-form{display:inline-flex;padding:20px 0;flex-direction:column;align-items:flex-start;gap:16px;flex-shrink:0;width:100%}.summary-form ix-divider{padding:10px 0}.summary-form packages-grid,.summary-form requested-location-details-grid,.summary-form visitors-grid{width:100%}.summary-form__subheader{display:flex;justify-content:flex-end;align-items:center;gap:16px;width:100%}.summary-form__subheader span:nth-child(1){flex:1 0 0;font-family:var(--root-primary-font);font-size:16px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.15px}.summary-form__subheader span:nth-child(2){width:24px;height:24px;flex-shrink:0;color:#1456e0;cursor:pointer}.summary-form__field{display:flex;align-items:flex-start;gap:24px;width:100%;font-family:var(--root-primary-font);font-size:16px;font-style:normal;font-weight:400;line-height:28px;letter-spacing:.44px}.summary-form__field>span:nth-child(1){color:var(--Text-Dark-2nd,rgba(9,34,65,.6));width:192px}.summary-form__field>span:nth-child(2){color:var(--On-Surface,#092241);flex:1 0 0}.packages-grid{display:flex;width:100%;padding:4px 0;flex-direction:column;align-items:flex-start;gap:24px}.packages-grid ix-grid{width:100%}.packages-grid ix-button{width:50px}.packages-grid__title{display:flex;align-items:center;gap:10px;align-self:stretch;color:var(--Text-Dark,#092241);font-family:var(--root-primary-font);font-size:16px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.15px}.packages-grid_action-buttons{margin:0 -10px}.packages-wrapper{width:100%;display:flex;flex-direction:column;gap:10px}.result-form{display:flex;width:100%;flex-direction:column;justify-content:center;align-items:center;gap:1rem;max-width:696px;margin:auto;margin-top:1rem}.result-form__title{align-self:stretch;color:#000;text-align:center;font-family:var(--root-secondary-font);font-size:34px;font-style:normal;font-weight:700;line-height:40px;letter-spacing:.35px}.result-form__body{align-self:stretch;text-align:center;line-height:28px;letter-spacing:.44px}.result-form__ticket-numbers{display:flex;flex-direction:column;align-items:center;gap:8px;border-radius:4px}.result-form__ticket-numbers svg{width:25px;height:24px}.result-form__ticket-numbers div{display:flex;align-items:flex-start;gap:8px;flex-wrap:wrap;justify-content:center}.ticket-numbers__label{color:#000;text-align:center;font-weight:700;line-height:24px;letter-spacing:.1px}.ticket-numbers__content{color:var(--Primary-Main,#1456e0);font-family:var(--root-primary-font);font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.25px;text-decoration-line:underline;cursor:pointer}.warning-text_content{text-align:justify;font-family:var(--root-primary-font);font-size:12px;font-style:normal;font-weight:400;line-height:16px;letter-spacing:.4px}.warning-text_link{color:var(--Primary-Main,#1456e0);text-decoration-line:underline;cursor:pointer}.result-form__notice{display:flex;padding:8px 12px;align-items:center;gap:8px;border-radius:4px;border:1px solid var(--Warning-Main,#ff9800);max-width:550px}.result-form__notice .svg-container{height:24px}.result-form__notice .svg-container svg{height:inherit}.result-form__notice span{color:#000;font-family:var(--root-primary-font);font-size:12px;font-style:normal;font-weight:700;line-height:16px;letter-spacing:.4px}.result-form__notice div{display:flex;flex-direction:column;gap:8px}.result-form__footer{display:flex;height:39px;align-items:flex-start;gap:24px;margin-top:.5rem}#account-selection-dialog div[slot=content],#site-selection-dialog div[slot=content]{min-width:min(80vw,560px)}#pending-approval-info-dialog div[slot=content]{width:560px}#pending-approval-info-dialog ::part(surface){border-radius:6px}ix-divider{padding:30px 0}.form-wrapper>ix-divider{padding-right:1rem}.terms-header h3{margin:10px 0}.terms-request-type{font-size:1rem;line-height:1.25rem;margin-top:.5rem}.terms-html-container{overflow-y:scroll;line-height:1.5rem;font-size:14px;letter-spacing:.25px}.terms-html-container ol{list-style-type:decimal}.terms-html-container ol[type='a']{list-style-type:lower-alpha}.terms-html-container ol,.terms-html-container ul{padding-left:22px}.terms-html-container::-webkit-scrollbar-thumb{background:#c4c4c4;border-radius:100px;background-clip:padding-box;border:4px solid transparent}.terms-html-container::-webkit-scrollbar{width:12px}.terms-content ix-divider{padding:1.5rem 0}ix-button[type=submit]{align-self:flex-end}span.error{color:#db0028;font-size:.75rem;margin-left:1rem}.tooltip{position:relative;padding:0 8px;background-color:#1456e0;border-radius:100px;font-size:12px;font-weight:600;color:#fff}.tooltip .tooltip-text{visibility:hidden;position:absolute;width:max-content;background-color:#092241;font-size:12px;color:#fff;text-align:center;padding:5px 8px 5px 8px;margin-top:-6px;margin-left:20px;border-radius:6px;z-index:1;opacity:0;transition:opacity .3s ease 0s}.tooltip:hover .tooltip-text{visibility:visible;opacity:1}ix-button[type=submit]{align-self:flex-end}.ticket-details-container{display:flex;flex-wrap:wrap;align-items:flex-start;gap:2rem}.ticket-details-container__body{display:flex;flex-direction:column;align-items:flex-start;padding-bottom:48px;flex:1 1 0}.ticket-details-container__body deliveries-other-information-section,.ticket-details-container__body deliveries-package-details-section,.ticket-details-container__body deliveries-ticket-details-section,.ticket-details-container__body deliveries-ticket-information-section,.ticket-details-container__body remote-hands-other-information-section,.ticket-details-container__body trouble-ticket-other-information-section{width:100%}.w-100{width:100%}.ticket-details-body__section{display:flex;flex-direction:column;align-items:flex-start;gap:24px;align-self:stretch}.ticket-details-body__section packages-grid,.ticket-details-body__section requested-location-details-grid,.ticket-details-body__section visitors-grid{width:100%}.ticket-details-body__section .informations-section__title{color:var(--Text-Dark,#092241);font-family:var(--root-secondary-font);font-size:20px;font-style:normal;font-weight:700;line-height:24px;letter-spacing:.15px}.ticket-details-body__section .informations-section__items{display:flex;flex-direction:column;align-items:flex-start;gap:16px;align-self:stretch}.ticket-details-body__section .informations-section__items-row{display:flex;align-items:flex-start;align-self:stretch;flex-wrap:wrap}.ticket-details-body__section .informations-section__items-col{padding-top:16px;width:25%}.ticket-details-body__section .informations-section__items-col-1_5{padding-top:16px;width:37.5%}.ticket-details-body__section .informations-section__items-col-3{padding-top:16px;width:75%}.ticket-details-body__section .informations-section__items-col-4{padding-top:16px;width:100%}ticket-comments{display:flex;align-self:stretch;flex:1 0 0px;width:100%}.ticketComments{background-color:#fff;border-radius:12px 12px 0 0;padding:24px;display:flexbox;align-self:stretch;flex-direction:column;width:100%;gap:24px;overflow-y:auto}.ticketComments::-webkit-scrollbar-thumb{background:#c4c4c4;border-radius:100px;background-clip:padding-box;border:4px solid transparent}.ticketComments::-webkit-scrollbar{width:12px}.ticketComments h3{margin:0}.ticketComments span:not(.material-symbols-outlined,.error){font-size:14px;font-weight:700;line-height:24px;letter-spacing:.1px;color:#092241b2}.ticketComments p{margin:0;font-size:16px;font-weight:400;line-height:28px;color:#092241;letter-spacing:.44px;word-break:break-word}.ticketComments .form-wrapper__fields{gap:6px}.ticketComments .form-wrapper__fields span{margin-left:20px}.ticketComments textarea{resize:none;max-height:9.125rem;padding:10px 18px;border-radius:1.875rem;align-self:stretch;font-size:1rem;box-shadow:0 0 0 1px #6f7979 inset;font-family:var(--root-secondary-font),var(--root-primary-font);border:none;background-color:#f5f7ffd9;height:3rem}.ticketComments textarea[error]{box-shadow:0 0 0 1px #db0028 inset}.ticketComments textarea:focus{box-shadow:0 0 0 3px #1456e0 inset;border-color:transparent;outline:0}.ticketComments textarea:focus[error]{box-shadow:0 0 0 3px #db0028 inset}.ticketComments .commentPostButton{align-self:flex-end;width:82px}.ticketComments .commentPostButton span{color:#fff;margin:0;letter-spacing:1.25px}.commentContainer{display:flex;gap:24px}.commentContainer .avatarContainer{background-color:#f5f7ff;border-radius:100px;min-width:40px;height:40px;justify-content:center;align-items:center;display:flex;color:#09224199}.commentContainer .content ix-date{display:inline}.commentContainer .content p{white-space:preserve-breaks}.commentsGroup{display:flex;flex-direction:column;gap:24px}.commentsGroup+.commentsGroup{margin-top:1.5rem}.ticket-details-container__comments{display:flex;align-items:flex-start;align-self:stretch}.commentContainer{display:flex;gap:24px}.commentContainer .avatarContainer{background-color:#f5f7ff;border-radius:100px;min-width:40px;height:40px;justify-content:center;align-items:center;display:flex;color:#09224199}.ticket-details-body__details-section{display:flex;flex-direction:column;align-items:flex-start;gap:24px}.chip-container{gap:5px;display:flex;flex-wrap:wrap}.chip{border-radius:68px;background:var(--Primary-Main,#1456e0);color:var(--Text-Light,#fff);font-family:var(--root-primary-font);font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.25px;padding:0 10px}.service-tickets__buttons-container{display:flex;gap:.625rem;justify-content:flex-end;width:100%;margin-bottom:20px}@media only screen and (max-width:669px){.ticket-details-container__body{width:100%}.ticket-details-container__comments{width:100%}.ticket-details-body__section packages-grid{max-width:300px}.ticket-details-body__section .informations-section__items-col{width:100%}}@media only screen and (min-width:670px){.ticket-details-container__body{max-height:calc(100vh - 160px);overflow-y:auto}.ticket-details-container__comments{width:309px;position:sticky;top:144px;height:calc(100vh - 160px);overflow-y:auto}}@media only screen and (min-width:1200px){.ticket-details-container__comments{width:464px}}@media only screen and (min-width:500px) and (max-width:1250px){.ticket-details-body__section packages-grid{max-width:580px}.ticket-details-body__section .informations-section__items-col{width:50%}}.service-tickets__header{width:fit-content}.dialog{max-width:658px}.dialog-input{line-height:2.75rem}.blank-focus-input-styles{height:0;width:0;outline:0;border:none}.required-text{color:var(--light-grey);font-size:.75rem;margin-left:.9375rem}.form-wrapper__fields.account-selection-dialog,.form-wrapper__fields.cancellation-dialog,.form-wrapper__fields.site-selection-dialog{gap:0;margin-left:0;padding-right:0}.account-dialog__short-desc,.site-dialog__short-desc{color:var(--light-grey);margin:0 2rem .625rem 0}.pending-approval-dialog__short-desc{color:var(--light-grey);font-size:16px;margin:0}.account-dialog__title,.cancellation__title,.site-dialog__title{display:flex;justify-content:space-between;margin-top:0;margin-bottom:.625rem;font-size:20px}.cancellation__title{gap:3.125rem}.pending-approval-dialog__title{display:flex;justify-content:space-between;font-size:20px;margin-bottom:20px}.account-dialog__title span,.cancellation__title span,.pending-approval-dialog__title span,.site-dialog__title span{cursor:pointer}.account-selection-dialog__button-container,.cancellation__button-container,.site-selection-dialog__button-container{padding:.9375rem 0 .625rem}.cancellation__button-text{margin-right:.75rem}.pending-approval-dialog__button-container .account-selection-dialog__button-container,.site-selection-dialog__button-container{display:flex;gap:8px;justify-content:flex-end}.pending-approval-dialog__button-container{padding:10px 8px;height:56px}.dialog-input{line-height:2.75rem}.blank-focus-input-styles{height:0;width:0;outline:0;border:none}.required-text{color:var(--light-grey);font-size:.75rem;margin-left:.9375rem}.file-attachment{background:#f5f7ff;display:inline-block;padding:4px 8px;margin:8px 4px}.tracking-number__warning{align-items:center;background:var(--tracking-number-warning-background);display:flex;gap:.625rem;margin-top:2rem;padding:.5rem 1rem}.supporting-text{color:var(--md-sys-text-color-secondary);font-size:.75rem;padding-left:.75rem}.supporting-text.error{margin-left:unset}.planned-work__supporting-text{margin-top:-1.75rem}.attachment-container{height:100px;overflow:hidden}.attachment-file-container{display:flex}.attachment-file-container__items{display:flex;font-size:1rem;justify-content:space-between;width:100%;max-width:620px}.attachment-file__icons-container{align-items:flex-start;display:flex;gap:20px;margin-right:20px;margin-top:4px}.attachment-file__icons-container.isError{opacity:24%}.attachment-file__icons-container.isError svg{cursor:not-allowed}.attachment-file__icons-container svg{cursor:pointer}.attachment-file-container__sub-heading{color:var(--light-grey);font-size:14px}.attachment-file-component{width:100%}.error-icon-container{display:flex;align-items:center;margin-right:20px}.attachments-file-summary{display:inline-block;margin-bottom:10px;margin-right:10px;background-color:var(--tracking-number-warning-background);padding:8px 12px;border-radius:3px}.disabled{pointer-events:none;opacity:.5}.approve-deny__title{margin:24px 24px 0}.approve-deny__container{--ix-grid-cell-pointer:default;width:55vw;padding:0}.approve-deny__scroll-container{max-height:80vh;overflow-y:scroll}.approve-deny__divider{padding:24px 0}.approve-deny__progress-container{position:absolute;margin-top:-24px}.approve-deny-buttons__message{background-color:#fff;color:var(--lumo-body-text-color);padding:10px 20px;text-align:center;width:244px}.approve-deny-buttons__container{display:flex}.approve-deny-buttons__button{align-items:end;border:1px solid rgba(9,34,65,.12);cursor:pointer;display:inline-flex;font-weight:700;gap:5px;padding:10px 20px;width:100px}.approve-deny-buttons__approve{--approve-deny-buttons__icon-color:#4caf50;border-radius:5px 0 0 5px}.approve-deny-buttons__deny{--approve-deny-buttons__icon-color:#db0028;border-left:none;border-radius:0 5px 5px 0}.approve-deny-buttons svg{fill:var(--approve-deny-buttons__icon-color)}.approve-deny-buttons__selected{background-color:var(--approve-deny-buttons__icon-color);color:#fff}.approve-deny-buttons__selected svg{fill:#fff}.approve-deny-buttons__disabled{cursor:default}.maintenance-grid-header{display:flex;justify-content:space-between;align-items:center;gap:var(--grid-nav-button-group-gap,.5rem);--md-filled-button-container-color:var(--ix-text-dark, #000);--md-filled-button-label-text-color:white;--md-text-button-label-text-color:var(--ix-text-dark, #000);--md-text-button-hover-label-text-color:var(--ix-text-dark, #000)}.maintenance-grid-header .button-text{text-transform:none}.maintenance-grid-header .selected{pointer-events:none}.full-width{width:100%}.site-maintenance-details__header{height:50px;display:flex;align-items:center;margin-bottom:1rem}.site-maintenance-details__header span{font-family:var(--root-secondary-font);font-weight:700;font-size:14px;line-height:100%;letter-spacing:1.25px;vertical-align:middle;text-transform:uppercase;color:var(--Text-Dark,#092241)}.site-maintenance-details__subheader{white-space:normal;word-break:break-word;margin-bottom:1rem}.site-maintenance-details__subheader span{font-family:var(--root-secondary-font);font-weight:700;font-size:24px;line-height:32px;letter-spacing:0;vertical-align:middle;color:var(--Text-Dark,#092241)}.create-service-ticket-container{color:var(--Text-Dark,#092241)}.create-service-ticket-container.wizard-content{max-height:calc(100vh - 85px);padding-top:60px}.create-service-ticket-container.wizard-content h1{margin:4px 0 34px}.create-service-ticket-container-subheader{display:flex;flex-direction:row;align-items:center;justify-content:space-between;margin:0 0 32px 0}.create-service-ticket-container-subheader *{margin:0}.create-service-ticket-container-subheader h3{font-family:var(--root-secondary-font);font-size:20px;font-style:normal;font-weight:700;letter-spacing:.15px}.create-service-ticket-container-subheader p{font-family:var(--root-primary-font);font-size:14px;font-style:italic}ticket-type-card-list{overflow-y:auto}.create-service-ticket-btn{font-size:14px;line-height:18.52px;letter-spacing:1.25px}.dialog__title{margin:0;padding:16px 0 24px;display:flex;justify-content:space-between}.wizard-content{display:flex;flex-direction:column;max-height:calc(100vh - 100px);height:calc(100vh - 100px)}.wizard-content h1{margin:0 0 1.5rem}.wizard-content .sub-header h3{margin:0;font-weight:700;line-height:24px;letter-spacing:.15px}.wizard-content .sub-header span.italic{margin:0;line-height:24px;letter-spacing:.25px;font-style:italic}.wizard-content .form-footer{display:flex;-webkit-box-pack:end;justify-content:flex-end;padding:32px 20px 46px}.form-wrapper{overflow-y:auto;padding-top:1rem;padding-bottom:1rem;height:100%}.form-wrapper.allow-overflow{overflow-y:visible}.form-wrapper.pt-0{padding-top:0}.form-wrapper.mt-0{margin-top:0}.terms-form-footer{justify-content:space-between}.contacts-helper-text{margin-left:1rem;margin-top:.125rem;font-size:.75rem;line-height:1rem;letter-spacing:.025rem;color:var(--ix-inactive-field-color,#092241b2);opacity:.7}.selection-dialog{z-index:20;position:relative}.selection-dialog-header{font-family:var(--root-secondary-font);font-weight:700;font-size:1.25rem;line-height:1.5rem;letter-spacing:.009rem;width:38.125rem}.error-text{color:#092241;font-size:1.5rem;font-weight:700;line-height:2rem;font-family:'Red Hat Display',sans-serif;margin-top:.5rem}.error-text a{color:#1456e0;text-decoration:underline}.report-drawer-error{display:flex;align-items:center;height:90%}.display-inline-block{display:inline-block}.site-location-cell{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:flex-start;gap:14px}.site-location-cell__primary-text{white-space:nowrap;min-width:4rem;width:auto;overflow:hidden;text-overflow:ellipsis}.site-location-cell__additional-text{max-width:2rem;min-width:2rem;height:100%;margin-top:auto;color:#1456e0}.word-break-all{word-break:break-all}@media only screen and (max-width:639px){.summary-form__field{flex-direction:column;gap:0}.site-maintenance-details ix-divider,.site-maintenance-details ix-divider+div{margin-top:-1rem}}.visitor-hosts-selection{--ix-filter-select-max-height:270px;--md-outlined-field-supporting-text-color:#092241b3}.visitor-hosts-selection:hover{--md-outlined-field-hover-supporting-text-color:#092241b3}.attachment-upload-failed-message-container{width:34.375rem;height:3rem;opacity:1;gap:8px;border-radius:4px;border-width:1px;padding-top:8px;padding-right:12px;padding-bottom:8px;padding-left:12px;border:1px solid var(--clr-on-surface-critical,#db0028);display:flex;align-items:center}.attachment-upload-failed-message-container p{font-family:var(--root-primary-font, 'Open Sans', sans-serif);font-weight:700;font-size:12px;line-height:16px;letter-spacing:.4px;vertical-align:middle}.location-implication-info{align-items:center;background:#f5f7ff;display:flex;gap:.625rem;margin-top:1rem;margin-bottom:1rem;padding:.5rem 1rem}.form-margin{margin-left:var(--wizard-custom-margin-left)}.form-footer{padding:32px 0 46px}.unsupported-select-option{--md-menu-item-disabled-opacity:1;--md-menu-item-supporting-text-color:var(--clr-on-surface-critical)}.fade-label{--md-menu-item-label-text-color:rgba(0, 0, 0, 0.4)}.incidents-grid{--ix-grid-filter-column-width:160px}.tab-navigation{border-top:1.5px solid #bec9c8;position:relative;top:-1px}.incident-header{font-family:var(--root-secondary-font);font-weight:700;font-size:2.125rem;line-height:2.5rem;vertical-align:middle;margin-bottom:2rem;margin-top:1.5rem}.no-padding{padding:0}.commentContainer .content ix-date-next{display:inline}.whitespace-preserve{white-space:preserve}`,o={CustomerSupport:e`
1
+ import{css as t,svg as e}from"lit";const i=t`:host{--light-grey:rgba(9, 34, 65, 0.6);--tracking-number-warning-background:#f5f7ff;--md-dialog-container-color:white;--ix-file-uploader-label-font-size:12px;--ix-file-uploader-help-font-size:12px;--ix-grid-cell-height:auto;--ix-checkbox-radio-gap:1rem;--ix-drawer-padding:0px 40px 0px 16px;--wizard-custom-margin-left:24px;--ix-wizard-hideclose-header-custom-margin-left:var(--wizard-custom-margin-left)}.reports-grid-nav{--ix-button-font-family:var(--root-primary-font)}.flex_column{flex-direction:column}.sub-header{display:flex;justify-content:space-between;align-items:center;align-self:stretch;position:relative;z-index:2}.default-margin-top{margin-top:2rem}.sub-header__action-buttons{display:flex;margin-left:auto;gap:10px}.sub-header span{text-align:right;font-family:var(--root-primary-font);font-size:14px;font-weight:400;letter-spacing:.25px}.sub-header ix-button span{font-family:var(--root-secondary-font);font-weight:700;font-size:14px;line-height:100%;letter-spacing:1.25px;text-align:center;vertical-align:middle;text-transform:uppercase}.sub-header__row{display:flex;flex-direction:row;gap:50px;align-items:center;width:100%}.sub-header__row .sub-header__row_value{font-size:1rem}.sub-header__row div{width:25%}.sub-header__row div span{font-style:normal}.sub-header__row_caption{font-family:var(--root-secondary-font);font-size:20px;font-style:normal;font-weight:700;line-height:24px;letter-spacing:.15px;margin:0}.sub-header__row div:last-child{margin-left:auto;width:auto}.italic{font-style:italic}.visitors-grid__footer{display:flex;padding:10px;border-top:1px solid #e0e0e0}.form-wrapper__fields{display:flex;flex-direction:column;align-items:flex-start;gap:2rem;padding-right:1rem}.form-wrapper__fields ix-email-list,.form-wrapper__fields ix-select,.form-wrapper__fields ix-textbox{align-self:stretch}.form-wrapper__fields ix-divider{padding:0}.form-wrapper__fields .textfield{width:100%}.form-wrapper__fields packages-grid,.form-wrapper__fields requested-location-details-grid,.form-wrapper__fields visitors-grid{width:100%}.form-wrapper__fields .col-2{display:flex;align-items:flex-start;gap:24px;align-self:stretch}.form-wrapper__fields .col-2>*{width:50%}.form-wrapper__fields .col-1{align-items:flex-start;align-self:stretch;width:100%}.form-wrapper__fields ix-file-uploader{--ix-file-uploader-label-line-height:1rem;--ix-file-uploader-label-letter-spacing:1.25px;--ix-file-uploader-help-font-family:var(--root-primary-font);--ix-file-uploader-help-line-height:1rem;--ix-file-uploader-help-letter-spacing:0.4px;--ix-file-chip-font-size:1rem;--ix-file-chip-letter-spacing:0.15px}ix-file-uploader{width:100%;font-size:12px;align-self:stretch}.warning-text{padding:4px 16px 0 16px;font-size:12px;line-height:16px;margin:var(--warning-text-margin,inherit)}.package-dialog{min-width:500px}.contact-details-dialog{width:min(90vw,41.125rem);--ix-message-toast-error-bg:#db0028}.contact-details-dialog .col-2{flex-wrap:wrap}.contact-details-dialog .col-2>*{width:unset;flex-grow:1}.urgent-work-form{width:560px}.summary-form{display:inline-flex;padding:20px 0;flex-direction:column;align-items:flex-start;gap:16px;flex-shrink:0;width:100%}.summary-form ix-divider{padding:10px 0}.summary-form packages-grid,.summary-form requested-location-details-grid,.summary-form visitors-grid{width:100%}.summary-form__subheader{display:flex;justify-content:flex-end;align-items:center;gap:16px;width:100%}.summary-form__subheader span:nth-child(1){flex:1 0 0;font-family:var(--root-primary-font);font-size:16px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.15px}.summary-form__subheader span:nth-child(2){width:24px;height:24px;flex-shrink:0;color:#1456e0;cursor:pointer}.summary-form__field{display:flex;align-items:flex-start;gap:24px;width:100%;font-family:var(--root-primary-font);font-size:16px;font-style:normal;font-weight:400;line-height:28px;letter-spacing:.44px}.summary-form__field>span:nth-child(1){color:var(--Text-Dark-2nd,rgba(9,34,65,.6));width:192px}.summary-form__field>span:nth-child(2){color:var(--On-Surface,#092241);flex:1 0 0}.packages-grid{display:flex;width:100%;padding:4px 0;flex-direction:column;align-items:flex-start;gap:24px}.packages-grid ix-grid{width:100%}.packages-grid ix-button{width:50px}.packages-grid__title{display:flex;align-items:center;gap:10px;align-self:stretch;color:var(--Text-Dark,#092241);font-family:var(--root-primary-font);font-size:16px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.15px}.packages-grid_action-buttons{margin:0 -10px}.packages-wrapper{width:100%;display:flex;flex-direction:column;gap:10px}.result-form{display:flex;width:100%;flex-direction:column;justify-content:center;align-items:center;gap:1rem;max-width:696px;margin:auto;margin-top:1rem}.result-form__title{align-self:stretch;color:#000;text-align:center;font-family:var(--root-secondary-font);font-size:34px;font-style:normal;font-weight:700;line-height:40px;letter-spacing:.35px}.result-form__body{align-self:stretch;text-align:center;line-height:28px;letter-spacing:.44px}.result-form__ticket-numbers{display:flex;flex-direction:column;align-items:center;gap:8px;border-radius:4px}.result-form__ticket-numbers svg{width:25px;height:24px}.result-form__ticket-numbers div{display:flex;align-items:flex-start;gap:8px;flex-wrap:wrap;justify-content:center}.ticket-numbers__label{color:#000;text-align:center;font-weight:700;line-height:24px;letter-spacing:.1px}.ticket-numbers__content{color:var(--Primary-Main,#1456e0);font-family:var(--root-primary-font);font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.25px;text-decoration-line:underline;cursor:pointer}.warning-text_content{text-align:justify;font-family:var(--root-primary-font);font-size:12px;font-style:normal;font-weight:400;line-height:16px;letter-spacing:.4px}.warning-text_link{color:var(--Primary-Main,#1456e0);text-decoration-line:underline;cursor:pointer}.result-form__notice{display:flex;padding:8px 12px;align-items:center;gap:8px;border-radius:4px;border:1px solid var(--Warning-Main,#ff9800);max-width:550px}.result-form__notice .svg-container{height:24px}.result-form__notice .svg-container svg{height:inherit}.result-form__notice span{color:#000;font-family:var(--root-primary-font);font-size:12px;font-style:normal;font-weight:700;line-height:16px;letter-spacing:.4px}.result-form__notice div{display:flex;flex-direction:column;gap:8px}.result-form__footer{display:flex;height:39px;align-items:flex-start;gap:24px;margin-top:.5rem}#account-selection-dialog div[slot=content],#site-selection-dialog div[slot=content]{min-width:min(80vw,560px)}#pending-approval-info-dialog div[slot=content]{width:560px}#pending-approval-info-dialog ::part(surface){border-radius:6px}ix-divider{padding:30px 0}.form-wrapper>ix-divider{padding-right:1rem}.terms-header h3{margin:10px 0}.terms-request-type{font-size:1rem;line-height:1.25rem;margin-top:.5rem}.terms-html-container{overflow-y:scroll;line-height:1.5rem;font-size:14px;letter-spacing:.25px}.terms-html-container ol{list-style-type:decimal}.terms-html-container ol[type='a']{list-style-type:lower-alpha}.terms-html-container ol,.terms-html-container ul{padding-left:22px}.terms-html-container::-webkit-scrollbar-thumb{background:#c4c4c4;border-radius:100px;background-clip:padding-box;border:4px solid transparent}.terms-html-container::-webkit-scrollbar{width:12px}.terms-content ix-divider{padding:1.5rem 0}ix-button[type=submit]{align-self:flex-end}span.error{color:#db0028;font-size:.75rem;margin-left:1rem}.tooltip{position:relative;padding:0 8px;background-color:#1456e0;border-radius:100px;font-size:12px;font-weight:600;color:#fff}.tooltip .tooltip-text{visibility:hidden;position:absolute;width:max-content;background-color:#092241;font-size:12px;color:#fff;text-align:center;padding:5px 8px 5px 8px;margin-top:-6px;margin-left:20px;border-radius:6px;z-index:1;opacity:0;transition:opacity .3s ease 0s}.tooltip:hover .tooltip-text{visibility:visible;opacity:1}ix-button[type=submit]{align-self:flex-end}.ticket-details-container{display:flex;flex-wrap:wrap;align-items:flex-start;gap:2rem}.ticket-details-container__body{display:flex;flex-direction:column;align-items:flex-start;padding-bottom:48px;flex:1 1 0}.ticket-details-container__body deliveries-other-information-section,.ticket-details-container__body deliveries-package-details-section,.ticket-details-container__body deliveries-ticket-details-section,.ticket-details-container__body deliveries-ticket-information-section,.ticket-details-container__body remote-hands-other-information-section,.ticket-details-container__body trouble-ticket-other-information-section{width:100%}.w-100{width:100%}.ticket-details-body__section{display:flex;flex-direction:column;align-items:flex-start;gap:24px;align-self:stretch}.ticket-details-body__section packages-grid,.ticket-details-body__section requested-location-details-grid,.ticket-details-body__section visitors-grid{width:100%}.ticket-details-body__section .informations-section__title{color:var(--Text-Dark,#092241);font-family:var(--root-secondary-font);font-size:20px;font-style:normal;font-weight:700;line-height:24px;letter-spacing:.15px}.ticket-details-body__section .informations-section__items{display:flex;flex-direction:column;align-items:flex-start;gap:16px;align-self:stretch}.ticket-details-body__section .informations-section__items-row{display:flex;align-items:flex-start;align-self:stretch;flex-wrap:wrap}.ticket-details-body__section .informations-section__items-col{padding-top:16px;width:25%}.ticket-details-body__section .informations-section__items-col-1_5{padding-top:16px;width:37.5%}.ticket-details-body__section .informations-section__items-col-3{padding-top:16px;width:75%}.ticket-details-body__section .informations-section__items-col-4{padding-top:16px;width:100%}ticket-comments{display:flex;align-self:stretch;flex:1 0 0px;width:100%}.ticketComments{background-color:#fff;border-radius:12px 12px 0 0;padding:24px;display:flexbox;align-self:stretch;flex-direction:column;width:100%;gap:24px;overflow-y:auto}.ticketComments::-webkit-scrollbar-thumb{background:#c4c4c4;border-radius:100px;background-clip:padding-box;border:4px solid transparent}.ticketComments::-webkit-scrollbar{width:12px}.ticketComments h3{margin:0}.ticketComments span:not(.material-symbols-outlined,.error){font-size:14px;font-weight:700;line-height:24px;letter-spacing:.1px;color:#092241b2}.ticketComments p{margin:0;font-size:16px;font-weight:400;line-height:28px;color:#092241;letter-spacing:.44px;word-break:break-word}.ticketComments .form-wrapper__fields{gap:6px}.ticketComments .form-wrapper__fields span{margin-left:20px}.ticketComments textarea{resize:none;max-height:9.125rem;padding:10px 18px;border-radius:1.875rem;align-self:stretch;font-size:1rem;box-shadow:0 0 0 1px #6f7979 inset;font-family:var(--root-secondary-font),var(--root-primary-font);border:none;background-color:#f5f7ffd9;height:3rem}.ticketComments textarea[error]{box-shadow:0 0 0 1px #db0028 inset}.ticketComments textarea:focus{box-shadow:0 0 0 3px #1456e0 inset;border-color:transparent;outline:0}.ticketComments textarea:focus[error]{box-shadow:0 0 0 3px #db0028 inset}.ticketComments .commentPostButton{align-self:flex-end;width:82px}.ticketComments .commentPostButton span{color:#fff;margin:0;letter-spacing:1.25px}.commentContainer{display:flex;gap:24px}.commentContainer .avatarContainer{background-color:#f5f7ff;border-radius:100px;min-width:40px;height:40px;justify-content:center;align-items:center;display:flex;color:#09224199}.commentContainer .content ix-date{display:inline}.commentContainer .content p{white-space:preserve-breaks}.commentsGroup{display:flex;flex-direction:column;gap:24px}.commentsGroup+.commentsGroup{margin-top:1.5rem}.ticket-details-container__comments{display:flex;align-items:flex-start;align-self:stretch}.commentContainer{display:flex;gap:24px}.commentContainer .avatarContainer{background-color:#f5f7ff;border-radius:100px;min-width:40px;height:40px;justify-content:center;align-items:center;display:flex;color:#09224199}.ticket-details-body__details-section{display:flex;flex-direction:column;align-items:flex-start;gap:24px}.chip-container{gap:5px;display:flex;flex-wrap:wrap}.chip{border-radius:68px;background:var(--Primary-Main,#1456e0);color:var(--Text-Light,#fff);font-family:var(--root-primary-font);font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.25px;padding:0 10px}.service-tickets__buttons-container{display:flex;gap:.625rem;justify-content:flex-end;width:100%;margin-bottom:20px}@media only screen and (max-width:669px){.ticket-details-container__body{width:100%}.ticket-details-container__comments{width:100%}.ticket-details-body__section packages-grid{max-width:300px}.ticket-details-body__section .informations-section__items-col{width:100%}}@media only screen and (min-width:670px){.ticket-details-container__body{max-height:calc(100vh - 160px);overflow-y:auto}.ticket-details-container__comments{width:309px;position:sticky;top:144px;height:calc(100vh - 160px);overflow-y:auto}}@media only screen and (min-width:1200px){.ticket-details-container__comments{width:464px}}@media only screen and (min-width:500px) and (max-width:1250px){.ticket-details-body__section packages-grid{max-width:580px}.ticket-details-body__section .informations-section__items-col{width:50%}}.service-tickets__header{width:fit-content}.dialog{max-width:658px}.dialog-input{line-height:2.75rem}.blank-focus-input-styles{height:0;width:0;outline:0;border:none}.required-text{color:var(--light-grey);font-size:.75rem;margin-left:.9375rem}.form-wrapper__fields.account-selection-dialog,.form-wrapper__fields.cancellation-dialog,.form-wrapper__fields.site-selection-dialog{gap:0;margin-left:0;padding-right:0}.account-dialog__short-desc,.site-dialog__short-desc{color:var(--light-grey);margin:0 2rem .625rem 0}.pending-approval-dialog__short-desc{color:var(--light-grey);font-size:16px;margin:0}.account-dialog__title,.cancellation__title,.site-dialog__title{display:flex;justify-content:space-between;margin-top:0;margin-bottom:.625rem;font-size:20px}.cancellation__title{gap:3.125rem}.pending-approval-dialog__title{display:flex;justify-content:space-between;font-size:20px;margin-bottom:20px}.account-dialog__title span,.cancellation__title span,.pending-approval-dialog__title span,.site-dialog__title span{cursor:pointer}.account-selection-dialog__button-container,.cancellation__button-container,.site-selection-dialog__button-container{padding:.9375rem 0 .625rem}.cancellation__button-text{margin-right:.75rem}.pending-approval-dialog__button-container .account-selection-dialog__button-container,.site-selection-dialog__button-container{display:flex;gap:8px;justify-content:flex-end}.pending-approval-dialog__button-container{padding:10px 8px;height:56px}.dialog-input{line-height:2.75rem}.blank-focus-input-styles{height:0;width:0;outline:0;border:none}.required-text{color:var(--light-grey);font-size:.75rem;margin-left:.9375rem}.file-attachment{background:#f5f7ff;display:inline-block;padding:4px 8px;margin:8px 4px}.tracking-number__warning{align-items:center;background:var(--tracking-number-warning-background);display:flex;gap:.625rem;margin-top:2rem;padding:.5rem 1rem}.supporting-text{color:var(--md-sys-text-color-secondary);font-size:.75rem;padding-left:.75rem}.supporting-text.error{margin-left:unset}.planned-work__supporting-text{margin-top:-1.75rem}.attachment-container{height:100px;overflow:hidden}.attachment-file-container{display:flex}.attachment-file-container__items{display:flex;font-size:1rem;justify-content:space-between;width:100%;max-width:620px}.attachment-file__icons-container{align-items:flex-start;display:flex;gap:20px;margin-right:20px;margin-top:4px}.attachment-file__icons-container.isError{opacity:24%}.attachment-file__icons-container.isError svg{cursor:not-allowed}.attachment-file__icons-container svg{cursor:pointer}.attachment-file-container__sub-heading{color:var(--light-grey);font-size:14px}.attachment-file-component{width:100%}.error-icon-container{display:flex;align-items:center;margin-right:20px}.attachments-file-summary{display:inline-block;margin-bottom:10px;margin-right:10px;background-color:var(--tracking-number-warning-background);padding:8px 12px;border-radius:3px}.disabled{pointer-events:none;opacity:.5}.approve-deny__title{margin:24px 24px 0}.approve-deny__container{--ix-grid-cell-pointer:default;width:55vw;padding:0}.approve-deny__scroll-container{max-height:80vh;overflow-y:scroll}.approve-deny__divider{padding:24px 0}.approve-deny__progress-container{position:absolute;margin-top:-24px}.approve-deny-buttons__message{background-color:#fff;color:var(--lumo-body-text-color);padding:10px 20px;text-align:center;width:244px}.approve-deny-buttons__container{display:flex}.approve-deny-buttons__button{align-items:end;border:1px solid rgba(9,34,65,.12);cursor:pointer;display:inline-flex;font-weight:700;gap:5px;padding:10px 20px;width:100px}.approve-deny-buttons__approve{--approve-deny-buttons__icon-color:#4caf50;border-radius:5px 0 0 5px}.approve-deny-buttons__deny{--approve-deny-buttons__icon-color:#db0028;border-left:none;border-radius:0 5px 5px 0}.approve-deny-buttons svg{fill:var(--approve-deny-buttons__icon-color)}.approve-deny-buttons__selected{background-color:var(--approve-deny-buttons__icon-color);color:#fff}.approve-deny-buttons__selected svg{fill:#fff}.approve-deny-buttons__disabled{cursor:default}.maintenance-grid-header{display:flex;justify-content:space-between;align-items:center;gap:var(--grid-nav-button-group-gap,.5rem);--md-filled-button-container-color:var(--ix-text-dark, #000);--md-filled-button-label-text-color:white;--md-text-button-label-text-color:var(--ix-text-dark, #000);--md-text-button-hover-label-text-color:var(--ix-text-dark, #000)}.maintenance-grid-header .button-text{text-transform:none}.maintenance-grid-header .selected{pointer-events:none}.full-width{width:100%}.site-maintenance-details__header{height:50px;display:flex;align-items:center;margin-bottom:1rem}.site-maintenance-details__header span{font-family:var(--root-secondary-font);font-weight:700;font-size:14px;line-height:100%;letter-spacing:1.25px;vertical-align:middle;text-transform:uppercase;color:var(--Text-Dark,#092241)}.site-maintenance-details__subheader{white-space:normal;word-break:break-word;margin-bottom:1rem}.site-maintenance-details__subheader span{font-family:var(--root-secondary-font);font-weight:700;font-size:24px;line-height:32px;letter-spacing:0;vertical-align:middle;color:var(--Text-Dark,#092241)}.create-service-ticket-container{color:var(--Text-Dark,#092241)}.create-service-ticket-container.wizard-content{max-height:calc(100vh - 85px);padding-top:60px}.create-service-ticket-container.wizard-content h1{margin:4px 0 34px}.create-service-ticket-container-subheader{display:flex;flex-direction:row;align-items:center;justify-content:space-between;margin:0 0 32px 0}.create-service-ticket-container-subheader *{margin:0}.create-service-ticket-container-subheader h3{font-family:var(--root-secondary-font);font-size:20px;font-style:normal;font-weight:700;letter-spacing:.15px}.create-service-ticket-container-subheader p{font-family:var(--root-primary-font);font-size:14px;font-style:italic}ticket-type-card-list{overflow-y:auto}.create-service-ticket-btn{font-size:14px;line-height:18.52px;letter-spacing:1.25px}.dialog__title{margin:0;padding:16px 0 24px;display:flex;justify-content:space-between}.wizard-content{display:flex;flex-direction:column;max-height:calc(100vh - 100px);height:calc(100vh - 100px)}.wizard-content h1{margin:0 0 1.5rem}.wizard-content .sub-header h3{margin:0;font-weight:700;line-height:24px;letter-spacing:.15px}.wizard-content .sub-header span.italic{margin:0;line-height:24px;letter-spacing:.25px;font-style:italic}.wizard-content .form-footer{display:flex;-webkit-box-pack:end;justify-content:flex-end;padding:32px 20px 46px}.form-wrapper{overflow-y:auto;padding-top:1rem;padding-bottom:1rem;height:100%}.form-wrapper.allow-overflow{overflow-y:visible}.form-wrapper.pt-0{padding-top:0}.form-wrapper.mt-0{margin-top:0}.terms-form-footer{justify-content:space-between}.contacts-helper-text{margin-left:1rem;margin-top:.125rem;font-size:.75rem;line-height:1rem;letter-spacing:.025rem;color:var(--ix-inactive-field-color,#092241b2);opacity:.7}.selection-dialog{z-index:20;position:relative}.selection-dialog-header{font-family:var(--root-secondary-font);font-weight:700;font-size:1.25rem;line-height:1.5rem;letter-spacing:.009rem;width:38.125rem}.error-text{color:#092241;font-size:1.5rem;font-weight:700;line-height:2rem;font-family:'Red Hat Display',sans-serif;margin-top:.5rem}.error-text a{color:#1456e0;text-decoration:underline}.report-drawer-error{display:flex;align-items:center;height:90%}.display-inline-block{display:inline-block}.site-location-cell{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:flex-start;gap:14px}.site-location-cell__primary-text{white-space:nowrap;min-width:4rem;width:auto;overflow:hidden;text-overflow:ellipsis}.site-location-cell__additional-text{max-width:2rem;min-width:2rem;height:100%;margin-top:auto;color:#1456e0}.word-break-all{word-break:break-all}@media only screen and (max-width:639px){.summary-form__field{flex-direction:column;gap:0}.site-maintenance-details ix-divider,.site-maintenance-details ix-divider+div{margin-top:-1rem}}.visitor-hosts-selection{--ix-filter-select-max-height:270px;--md-outlined-field-supporting-text-color:#092241b3}.visitor-hosts-selection:hover{--md-outlined-field-hover-supporting-text-color:#092241b3}.attachment-upload-failed-message-container{width:34.375rem;height:3rem;opacity:1;gap:8px;border-radius:4px;border-width:1px;padding-top:8px;padding-right:12px;padding-bottom:8px;padding-left:12px;border:1px solid var(--clr-on-surface-critical,#db0028);display:flex;align-items:center}.attachment-upload-failed-message-container p{font-family:var(--root-primary-font, 'Open Sans', sans-serif);font-weight:700;font-size:12px;line-height:16px;letter-spacing:.4px;vertical-align:middle}.location-implication-info{align-items:center;background:#f5f7ff;display:flex;gap:.625rem;margin-top:1rem;margin-bottom:1rem;padding:.5rem 1rem}.form-margin{margin-left:var(--wizard-custom-margin-left)}.form-footer{padding:32px 0 46px}.unsupported-select-option{--md-menu-item-disabled-opacity:1;--md-menu-item-supporting-text-color:var(--clr-on-surface-critical)}.fade-label{--md-menu-item-label-text-color:rgba(0, 0, 0, 0.4)}.incidents-grid{--ix-grid-filter-column-width:160px}.tab-navigation{border-top:1.5px solid #bec9c8;position:relative;top:-1px}.incident-header{font-family:var(--root-secondary-font);font-weight:700;font-size:2.125rem;line-height:2.5rem;vertical-align:middle;margin-bottom:2rem;margin-top:1.5rem}.no-padding{padding:0}.commentContainer .content ix-date-next{display:inline}`,o={CustomerSupport:e`
2
2
  <path d="M67.075 41.125L62.075 33.625C62.035 33.56 61.97 33.51 61.92 33.45C61.85 33.3625 61.7825 33.2775 61.7025 33.2025C61.49 33 61.2575 32.82 61 32.7L51.775 28.7C50.65 29.575 48.7 30.825 45.95 31.65L53.3175 34.835L40 39.83L26.735 34.855L34.175 31.7C31.425 30.875 29.45 29.65 28.3 28.75L19.025 32.7C19.0125 32.705 19.0025 32.715 18.99 32.72C18.9475 32.74 18.915 32.77 18.8725 32.7925C18.665 32.9025 18.475 33.0375 18.305 33.1975C18.22 33.275 18.1525 33.36 18.08 33.45C18.03 33.5125 17.97 33.5575 17.925 33.625L12.925 41.125C12.5 41.75 12.375 42.55 12.625 43.275C12.85 44 13.4 44.575 14.125 44.85L17.5 46.115V57.5C17.5 58.5425 18.1475 59.475 19.1225 59.8425L39.1225 67.3425C39.405 67.4475 39.7025 67.5 40 67.5C40.2975 67.5 40.595 67.4475 40.8775 67.3425L60.8775 59.8425C61.8525 59.475 62.5 58.5425 62.5 57.5V46.29L65.975 44.8C66.675 44.5 67.175 43.925 67.4 43.225C67.6 42.5 67.5 41.725 67.075 41.125ZM18.825 41.275L20.9825 38.04L36.1825 43.74L34.025 46.975L18.825 41.275ZM61.25 41.375L48.075 47.025L44.525 43.475L59.02 38.04L61.25 41.375ZM57.5 55.7675L40 62.33L22.5 55.7675V47.99L34.125 52.35C34.4 52.45 34.7 52.5 35 52.5C35.825 52.5 36.6 52.1 37.075 51.375L40.4 46.425L45.725 51.775C46.45 52.5 47.55 52.7 48.475 52.3L57.5 48.4325V55.7675ZM40 27.51C34.13 27.51 31.06 24.595 30.73 24.2625C29.755 23.2825 29.7575 21.7025 30.7375 20.7275C31.7075 19.7625 33.2725 19.755 34.2475 20.71C34.3725 20.825 36.2575 22.51 40 22.51C43.795 22.51 45.6775 20.78 45.7575 20.7075C46.75 19.7725 48.3275 19.795 49.2775 20.7725C50.2275 21.7525 50.235 23.2975 49.2725 24.2625C48.94 24.595 45.87 27.51 40 27.51ZM35 12.5C34.337 12.5 33.7011 12.7634 33.2322 13.2322C32.7634 13.7011 32.5 14.337 32.5 15C32.5 15.663 32.7634 16.2989 33.2322 16.7678C33.7011 17.2366 34.337 17.5 35 17.5C35.663 17.5 36.2989 17.2366 36.7678 16.7678C37.2366 16.2989 37.5 15.663 37.5 15C37.5 14.337 37.2366 13.7011 36.7678 13.2322C36.2989 12.7634 35.663 12.5 35 12.5ZM45 12.5C44.337 12.5 43.7011 12.7634 43.2322 13.2322C42.7634 13.7011 42.5 14.337 42.5 15C42.5 15.663 42.7634 16.2989 43.2322 16.7678C43.7011 17.2366 44.337 17.5 45 17.5C45.663 17.5 46.2989 17.2366 46.7678 16.7678C47.2366 16.2989 47.5 15.663 47.5 15C47.5 14.337 47.2366 13.7011 46.7678 13.2322C46.2989 12.7634 45.663 12.5 45 12.5Z"
3
3
  fill="white"
4
4
  />`,FacilityAccess:e`
@@ -0,0 +1 @@
1
+ export default {"build-id":"0000","env":"tx","branch":"xxxx"}
@@ -1 +1 @@
1
- {}
1
+ {"build-id":"0000","env":"tx","branch":"xxxx"}
@@ -1,2 +1,2 @@
1
1
  define(["exports"],function(t){"use strict";try{self["workbox:core:6.5.4"]&&_()}catch(t){}const e=(t,...e)=>{let s=t;return e.length>0&&(s+=` :: ${JSON.stringify(e)}`),s};class s extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}try{self["workbox:routing:6.5.4"]&&_()}catch(t){}const n=t=>t&&"object"==typeof t?t:{handle:t};class r{constructor(t,e,s="GET"){this.handler=n(e),this.match=t,this.method=s}setCatchHandler(t){this.catchHandler=n(t)}}class i extends r{constructor(t,e,s){super(({url:e})=>{const s=t.exec(e.href);if(s&&(e.origin===location.origin||0===s.index))return s.slice(1)},e,s)}}class o{constructor(){this.t=new Map,this.i=new Map}get routes(){return this.t}addFetchListener(){self.addEventListener("fetch",t=>{const{request:e}=t,s=this.handleRequest({request:e,event:t});s&&t.respondWith(s)})}addCacheListener(){self.addEventListener("message",t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data,s=Promise.all(e.urlsToCache.map(e=>{"string"==typeof e&&(e=[e]);const s=new Request(...e);return this.handleRequest({request:s,event:t})}));t.waitUntil(s),t.ports&&t.ports[0]&&s.then(()=>t.ports[0].postMessage(!0))}})}handleRequest({request:t,event:e}){const s=new URL(t.url,location.href);if(!s.protocol.startsWith("http"))return;const n=s.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:e,request:t,sameOrigin:n,url:s});let o=i&&i.handler;const a=t.method;if(!o&&this.i.has(a)&&(o=this.i.get(a)),!o)return;let c;try{c=o.handle({url:s,request:t,event:e,params:r})}catch(t){c=Promise.reject(t)}const h=i&&i.catchHandler;return c instanceof Promise&&(this.o||h)&&(c=c.catch(async n=>{if(h)try{return await h.handle({url:s,request:t,event:e,params:r})}catch(t){t instanceof Error&&(n=t)}if(this.o)return this.o.handle({url:s,request:t,event:e});throw n})),c}findMatchingRoute({url:t,sameOrigin:e,request:s,event:n}){const r=this.t.get(s.method)||[];for(const i of r){let r;const o=i.match({url:t,sameOrigin:e,request:s,event:n});if(o)return r=o,(Array.isArray(r)&&0===r.length||o.constructor===Object&&0===Object.keys(o).length||"boolean"==typeof o)&&(r=void 0),{route:i,params:r}}return{}}setDefaultHandler(t,e="GET"){this.i.set(e,n(t))}setCatchHandler(t){this.o=n(t)}registerRoute(t){this.t.has(t.method)||this.t.set(t.method,[]),this.t.get(t.method).push(t)}unregisterRoute(t){if(!this.t.has(t.method))throw new s("unregister-route-but-not-found-with-method",{method:t.method});const e=this.t.get(t.method).indexOf(t);if(!(e>-1))throw new s("unregister-route-route-not-registered");this.t.get(t.method).splice(e,1)}}let a;const c=()=>(a||(a=new o,a.addFetchListener(),a.addCacheListener()),a);function h(t,e,n){let o;if("string"==typeof t){const s=new URL(t,location.href);o=new r(({url:t})=>t.href===s.href,e,n)}else if(t instanceof RegExp)o=new i(t,e,n);else if("function"==typeof t)o=new r(t,e,n);else{if(!(t instanceof r))throw new s("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});o=t}return c().registerRoute(o),o}const u={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},l=t=>[u.prefix,t,u.suffix].filter(t=>t&&t.length>0).join("-"),f=t=>t||l(u.precache),w=t=>t||l(u.runtime);function d(t,e){const s=new URL(t);for(const t of e)s.searchParams.delete(t);return s.href}class p{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}}const y=new Set;try{self["workbox:strategies:6.5.4"]&&_()}catch(t){}function g(t){return"string"==typeof t?new Request(t):t}class R{constructor(t,e){this.h={},Object.assign(this,e),this.event=e.event,this.u=t,this.l=new p,this.p=[],this.R=[...t.plugins],this.m=new Map;for(const t of this.R)this.m.set(t,{});this.event.waitUntil(this.l.promise)}async fetch(t){const{event:e}=this;let n=g(t);if("navigate"===n.mode&&e instanceof FetchEvent&&e.preloadResponse){const t=await e.preloadResponse;if(t)return t}const r=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))n=await t({request:n.clone(),event:e})}catch(t){if(t instanceof Error)throw new s("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const i=n.clone();try{let t;t=await fetch(n,"navigate"===n.mode?void 0:this.u.fetchOptions);for(const s of this.iterateCallbacks("fetchDidSucceed"))t=await s({event:e,request:i,response:t});return t}catch(t){throw r&&await this.runCallbacks("fetchDidFail",{error:t,event:e,originalRequest:r.clone(),request:i.clone()}),t}}async fetchAndCachePut(t){const e=await this.fetch(t),s=e.clone();return this.waitUntil(this.cachePut(t,s)),e}async cacheMatch(t){const e=g(t);let s;const{cacheName:n,matchOptions:r}=this.u,i=await this.getCacheKey(e,"read"),o=Object.assign(Object.assign({},r),{cacheName:n});s=await caches.match(i,o);for(const t of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await t({cacheName:n,matchOptions:r,cachedResponse:s,request:i,event:this.event})||void 0;return s}async cachePut(t,e){const n=g(t);var r;await(r=0,new Promise(t=>setTimeout(t,r)));const i=await this.getCacheKey(n,"write");if(!e)throw new s("cache-put-with-no-response",{url:(o=i.url,new URL(String(o),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var o;const a=await this.v(e);if(!a)return!1;const{cacheName:c,matchOptions:h}=this.u,u=await self.caches.open(c),l=this.hasCallback("cacheDidUpdate"),f=l?await async function(t,e,s,n){const r=d(e.url,s);if(e.url===r)return t.match(e,n);const i=Object.assign(Object.assign({},n),{ignoreSearch:!0}),o=await t.keys(e,i);for(const e of o)if(r===d(e.url,s))return t.match(e,n)}(u,i.clone(),["__WB_REVISION__"],h):null;try{await u.put(i,l?a.clone():a)}catch(t){if(t instanceof Error)throw"QuotaExceededError"===t.name&&await async function(){for(const t of y)await t()}(),t}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:c,oldResponse:f,newResponse:a.clone(),request:i,event:this.event});return!0}async getCacheKey(t,e){const s=`${t.url} | ${e}`;if(!this.h[s]){let n=t;for(const t of this.iterateCallbacks("cacheKeyWillBeUsed"))n=g(await t({mode:e,request:n,event:this.event,params:this.params}));this.h[s]=n}return this.h[s]}hasCallback(t){for(const e of this.u.plugins)if(t in e)return!0;return!1}async runCallbacks(t,e){for(const s of this.iterateCallbacks(t))await s(e)}*iterateCallbacks(t){for(const e of this.u.plugins)if("function"==typeof e[t]){const s=this.m.get(e),n=n=>{const r=Object.assign(Object.assign({},n),{state:s});return e[t](r)};yield n}}waitUntil(t){return this.p.push(t),t}async doneWaiting(){let t;for(;t=this.p.shift();)await t}destroy(){this.l.resolve(null)}async v(t){let e=t,s=!1;for(const t of this.iterateCallbacks("cacheWillUpdate"))if(e=await t({request:this.request,response:e,event:this.event})||void 0,s=!0,!e)break;return s||e&&200!==e.status&&(e=void 0),e}}class m{constructor(t={}){this.cacheName=w(t.cacheName),this.plugins=t.plugins||[],this.fetchOptions=t.fetchOptions,this.matchOptions=t.matchOptions}handle(t){const[e]=this.handleAll(t);return e}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const e=t.event,s="string"==typeof t.request?new Request(t.request):t.request,n="params"in t?t.params:void 0,r=new R(this,{event:e,request:s,params:n}),i=this.q(r,s,e);return[i,this.U(i,r,s,e)]}async q(t,e,n){let r;await t.runCallbacks("handlerWillStart",{event:n,request:e});try{if(r=await this.L(e,t),!r||"error"===r.type)throw new s("no-response",{url:e.url})}catch(s){if(s instanceof Error)for(const i of t.iterateCallbacks("handlerDidError"))if(r=await i({error:s,event:n,request:e}),r)break;if(!r)throw s}for(const s of t.iterateCallbacks("handlerWillRespond"))r=await s({event:n,request:e,response:r});return r}async U(t,e,s,n){let r,i;try{r=await t}catch(i){}try{await e.runCallbacks("handlerDidRespond",{event:n,request:s,response:r}),await e.doneWaiting()}catch(t){t instanceof Error&&(i=t)}if(await e.runCallbacks("handlerDidComplete",{event:n,request:s,response:r,error:i}),e.destroy(),i)throw i}}function v(t,e){const s=e();return t.waitUntil(s),s}try{self["workbox:precaching:6.5.4"]&&_()}catch(t){}function q(t){if(!t)throw new s("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:e,url:n}=t;if(!n)throw new s("add-to-cache-list-unexpected-type",{entry:t});if(!e){const t=new URL(n,location.href);return{cacheKey:t.href,url:t.href}}const r=new URL(n,location.href),i=new URL(n,location.href);return r.searchParams.set("__WB_REVISION__",e),{cacheKey:r.href,url:i.href}}class U{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:t,state:e})=>{e&&(e.originalRequest=t)},this.cachedResponseWillBeUsed=async({event:t,state:e,cachedResponse:s})=>{if("install"===t.type&&e&&e.originalRequest&&e.originalRequest instanceof Request){const t=e.originalRequest.url;s?this.notUpdatedURLs.push(t):this.updatedURLs.push(t)}return s}}}class L{constructor({precacheController:t}){this.cacheKeyWillBeUsed=async({request:t,params:e})=>{const s=(null==e?void 0:e.cacheKey)||this._.getCacheKeyForURL(t.url);return s?new Request(s,{headers:t.headers}):t},this._=t}}let b,E;async function C(t,e){let n=null;if(t.url){n=new URL(t.url).origin}if(n!==self.location.origin)throw new s("cross-origin-copy-response",{origin:n});const r=t.clone(),i={headers:new Headers(r.headers),status:r.status,statusText:r.statusText},o=e?e(i):i,a=function(){if(void 0===b){const t=new Response("");if("body"in t)try{new Response(t.body),b=!0}catch(t){b=!1}b=!1}return b}()?r.body:await r.blob();return new Response(a,o)}class x extends m{constructor(t={}){t.cacheName=f(t.cacheName),super(t),this.C=!1!==t.fallbackToNetwork,this.plugins.push(x.copyRedirectedCacheableResponsesPlugin)}async L(t,e){const s=await e.cacheMatch(t);return s||(e.event&&"install"===e.event.type?await this.O(t,e):await this.N(t,e))}async N(t,e){let n;const r=e.params||{};if(!this.C)throw new s("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const s=r.integrity,i=t.integrity,o=!i||i===s;n=await e.fetch(new Request(t,{integrity:"no-cors"!==t.mode?i||s:void 0})),s&&o&&"no-cors"!==t.mode&&(this.k(),await e.cachePut(t,n.clone()))}return n}async O(t,e){this.k();const n=await e.fetch(t);if(!await e.cachePut(t,n.clone()))throw new s("bad-precaching-response",{url:t.url,status:n.status});return n}k(){let t=null,e=0;for(const[s,n]of this.plugins.entries())n!==x.copyRedirectedCacheableResponsesPlugin&&(n===x.defaultPrecacheCacheabilityPlugin&&(t=s),n.cacheWillUpdate&&e++);0===e?this.plugins.push(x.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}x.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:t})=>!t||t.status>=400?null:t},x.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await C(t):t};class O{constructor({cacheName:t,plugins:e=[],fallbackToNetwork:s=!0}={}){this.K=new Map,this.T=new Map,this.W=new Map,this.u=new x({cacheName:f(t),plugins:[...e,new L({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this.u}precache(t){this.addToCacheList(t),this.j||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this.j=!0)}addToCacheList(t){const e=[];for(const n of t){"string"==typeof n?e.push(n):n&&void 0===n.revision&&e.push(n.url);const{cacheKey:t,url:r}=q(n),i="string"!=typeof n&&n.revision?"reload":"default";if(this.K.has(r)&&this.K.get(r)!==t)throw new s("add-to-cache-list-conflicting-entries",{firstEntry:this.K.get(r),secondEntry:t});if("string"!=typeof n&&n.integrity){if(this.W.has(t)&&this.W.get(t)!==n.integrity)throw new s("add-to-cache-list-conflicting-integrities",{url:r});this.W.set(t,n.integrity)}if(this.K.set(r,t),this.T.set(r,i),e.length>0){const t=`Workbox is precaching URLs without revision info: ${e.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(t)}}}install(t){return v(t,async()=>{const e=new U;this.strategy.plugins.push(e);for(const[e,s]of this.K){const n=this.W.get(s),r=this.T.get(e),i=new Request(e,{integrity:n,cache:r,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:i,event:t}))}const{updatedURLs:s,notUpdatedURLs:n}=e;return{updatedURLs:s,notUpdatedURLs:n}})}activate(t){return v(t,async()=>{const t=await self.caches.open(this.strategy.cacheName),e=await t.keys(),s=new Set(this.K.values()),n=[];for(const r of e)s.has(r.url)||(await t.delete(r),n.push(r.url));return{deletedURLs:n}})}getURLsToCacheKeys(){return this.K}getCachedURLs(){return[...this.K.keys()]}getCacheKeyForURL(t){const e=new URL(t,location.href);return this.K.get(e.href)}getIntegrityForCacheKey(t){return this.W.get(t)}async matchPrecache(t){const e=t instanceof Request?t.url:t,s=this.getCacheKeyForURL(e);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(t){const e=this.getCacheKeyForURL(t);if(!e)throw new s("non-precached-url",{url:t});return s=>(s.request=new Request(t),s.params=Object.assign({cacheKey:e},s.params),this.strategy.handle(s))}}const N=()=>(E||(E=new O),E);class k extends r{constructor(t,e){super(({request:s})=>{const n=t.getURLsToCacheKeys();for(const r of function*(t,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:r}={}){const i=new URL(t,location.href);i.hash="",yield i.href;const o=function(t,e=[]){for(const s of[...t.searchParams.keys()])e.some(t=>t.test(s))&&t.searchParams.delete(s);return t}(i,e);if(yield o.href,s&&o.pathname.endsWith("/")){const t=new URL(o.href);t.pathname+=s,yield t.href}if(n){const t=new URL(o.href);t.pathname+=".html",yield t.href}if(r){const t=r({url:i});for(const e of t)yield e.href}}(s.url,e)){const e=n.get(r);if(e){return{cacheKey:e,integrity:t.getIntegrityForCacheKey(e)}}}},t.strategy)}}t.CacheFirst=class extends m{async L(t,e){let n,r=await e.cacheMatch(t);if(!r)try{r=await e.fetchAndCachePut(t)}catch(t){t instanceof Error&&(n=t)}if(!r)throw new s("no-response",{url:t.url,error:n});return r}},t.NavigationRoute=class extends r{constructor(t,{allowlist:e=[/./],denylist:s=[]}={}){super(t=>this.M(t),t),this.P=e,this.S=s}M({url:t,request:e}){if(e&&"navigate"!==e.mode)return!1;const s=t.pathname+t.search;for(const t of this.S)if(t.test(s))return!1;return!!this.P.some(t=>t.test(s))}},t.clientsClaim=function(){self.addEventListener("activate",()=>self.clients.claim())},t.createHandlerBoundToURL=function(t){return N().createHandlerBoundToURL(t)},t.precacheAndRoute=function(t,e){!function(t){N().precache(t)}(t),function(t){const e=N();h(new k(e,t))}(e)},t.registerRoute=h});
2
- //# sourceMappingURL=workbox-b865b753.js.map
2
+ //# sourceMappingURL=workbox-a523fd56.js.map