From 7d7eb6ac92a31122036c20cf84bde302216ee281 Mon Sep 17 00:00:00 2001 From: zomco Date: Fri, 16 Aug 2024 14:31:55 +0800 Subject: [PATCH] refactor --- .gitignore | 1 + .idea/inspectionProfiles/Project_Default.xml | 6 + .idea/vcs.xml | 6 + .idea/workspace.xml | 113 + app/globals.css | 76 +- app/install-button.tsx | 161 + app/layout.tsx | 4 +- app/page.tsx | 351 +- app/release.json | 19 + components.json | 17 + components/ui/alert.tsx | 59 + components/ui/badge.tsx | 36 + components/ui/button.tsx | 56 + components/ui/drawer.tsx | 118 + components/ui/input.tsx | 25 + components/ui/label.tsx | 26 + components/ui/select.tsx | 160 + components/ui/textarea.tsx | 24 + components/ui/toggle-group.tsx | 61 + components/ui/toggle.tsx | 45 + components/ui/tooltip.tsx | 30 + lib/utils.ts | 6 + package-lock.json | 2873 ++++++++++++----- package.json | 22 +- public/esp-web-tools/esp32-D9Bry5AK.js | 1 + public/esp-web-tools/esp32c2-C0aHw_np.js | 1 + public/esp-web-tools/esp32c3-1QKN64_Z.js | 1 + public/esp-web-tools/esp32c6-CgjBrh_Q.js | 1 + public/esp-web-tools/esp32h2-Bm3EZXXU.js | 1 + public/esp-web-tools/esp32s2-DxMNCsFV.js | 1 + public/esp-web-tools/esp32s3-DkYcGTTD.js | 1 + public/esp-web-tools/esp8266-DEFNY3lv.js | 1 + public/esp-web-tools/index-BbuTar3J.js | 129 + public/esp-web-tools/install-button.js | 1 + .../esp-web-tools/install-dialog-BWZCBYvU.js | 886 +++++ public/esp-web-tools/rom-B2LvkjpK.js | 1 + public/esp-web-tools/styles-ChWDJ3ue.js | 98 + public/manifest_owcare.json | 27 - public/release/r60abd1/a4/0_0_19.json | 15 + public/release/r60abd1/zero/0_0_19.json | 15 + tailwind.config.ts | 87 +- 41 files changed, 4583 insertions(+), 979 deletions(-) create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 app/install-button.tsx create mode 100644 app/release.json create mode 100644 components.json create mode 100644 components/ui/alert.tsx create mode 100644 components/ui/badge.tsx create mode 100644 components/ui/button.tsx create mode 100644 components/ui/drawer.tsx create mode 100644 components/ui/input.tsx create mode 100644 components/ui/label.tsx create mode 100644 components/ui/select.tsx create mode 100644 components/ui/textarea.tsx create mode 100644 components/ui/toggle-group.tsx create mode 100644 components/ui/toggle.tsx create mode 100644 components/ui/tooltip.tsx create mode 100644 lib/utils.ts create mode 100644 public/esp-web-tools/esp32-D9Bry5AK.js create mode 100644 public/esp-web-tools/esp32c2-C0aHw_np.js create mode 100644 public/esp-web-tools/esp32c3-1QKN64_Z.js create mode 100644 public/esp-web-tools/esp32c6-CgjBrh_Q.js create mode 100644 public/esp-web-tools/esp32h2-Bm3EZXXU.js create mode 100644 public/esp-web-tools/esp32s2-DxMNCsFV.js create mode 100644 public/esp-web-tools/esp32s3-DkYcGTTD.js create mode 100644 public/esp-web-tools/esp8266-DEFNY3lv.js create mode 100644 public/esp-web-tools/index-BbuTar3J.js create mode 100644 public/esp-web-tools/install-button.js create mode 100644 public/esp-web-tools/install-dialog-BWZCBYvU.js create mode 100644 public/esp-web-tools/rom-B2LvkjpK.js create mode 100644 public/esp-web-tools/styles-ChWDJ3ue.js delete mode 100644 public/manifest_owcare.json create mode 100644 public/release/r60abd1/a4/0_0_19.json create mode 100644 public/release/r60abd1/zero/0_0_19.json diff --git a/.gitignore b/.gitignore index fd3dbb5..549e1e4 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ # misc .DS_Store *.pem +/.next/ # debug npm-debug.log* diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..03d9549 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..d070885 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + { + "associatedIndex": 6 +} + + + + + + + + + + + + + + + + + + + + + + + + + +
+
Welcome to the OwRadar web installer!
+
Plug in your ESP to a USB port. We will install OwRadar 0.15.0-b4 to it.
+
Hit "Install" and select the correct COM port.
+
Get OwRadar installed and connected in less than 3 minutes!
+
+
+ updateRadar(value)}> + { + Releases.radars.map((radar, index) => { + return + {radar.name} + + }) + } + +
+
+ + + Zero + + + A4 + + +
+
+ +
+
+ + + + + Error + + Browser does not work + + + + + Error + + HTTPS not allowed + + + +
+ + +} \ No newline at end of file diff --git a/app/layout.tsx b/app/layout.tsx index 247f883..29ad22d 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -2,8 +2,8 @@ import './globals.css' import { Inter } from 'next/font/google' export const metadata = { - title: 'owkor', - description: 'owkor', + title: 'OwRadar', + description: 'OwRadar', manifest: 'site.webmanifest', icons: { icon: ['/favicon-32x32.png', '/favicon-16x16.png'], diff --git a/app/page.tsx b/app/page.tsx index 3510a19..90740eb 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,54 +1,309 @@ -import Image from 'next/image' -import Link from 'next/link' -import Script from 'next/script' -import * as React from 'react' -import styles from './page.module.css' +import { + Bird, + Book, + Bot, + Code2, + CornerDownLeft, + LifeBuoy, + Mic, + Paperclip, + Rabbit, + Settings, + Settings2, + Share, + SquareTerminal, + SquareUser, + Triangle, + Turtle, +} from "lucide-react" -declare global { - namespace JSX { - interface IntrinsicElements { - 'esp-web-install-button': any; - } - } -} +import { Badge } from "@/components/ui/badge" +import { Button } from "@/components/ui/button" +import { + Drawer, + DrawerContent, + DrawerDescription, + DrawerHeader, + DrawerTitle, + DrawerTrigger, +} from "@/components/ui/drawer" +import { Input } from "@/components/ui/input" +import { Label } from "@/components/ui/label" +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select" +import { Textarea } from "@/components/ui/textarea" +import { + Tooltip, + TooltipContent, + TooltipTrigger, + TooltipProvider, +} from "@/components/ui/tooltip" +import InstallButton from "@/app/install-button"; + +export default function Dashboard() { -export default function Home() { return ( -
-
-
    -
  1. Plug in your devices to a USB port. We will install firmware to it.
  2. -
  3. Hit ‘Connect’ and select the correct COM port.
  4. -
  5. Get firmware installed and connected in less than 3 minutes!
  6. -
-
- + +
+ +
+
+

Install

+ + + + + + + Configuration + + Configure the settings for the model and messages. + + +
+
+ + Settings + +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + Messages + +
+ + +
+
+ + + `;const a=this.renderPrefix(),n=this.renderSuffix(),l=this.inputMode;return o` +
+ ${a} + + ${n} +
+ `}renderPrefix(){return this.renderAffix(this.prefixText,!1)}renderSuffix(){return this.renderAffix(this.suffixText,!0)}renderAffix(e,t){if(!e)return c;return o`${e}`}getErrorText(){return this.error?this.errorText:this.nativeErrorText}handleFocusChange(){this.focused=this.inputOrTextarea?.matches(":focus")??!1}handleInput(e){this.dirty=!0,this.value=e.target.value}redispatchEvent(e){y(this,e)}getInputOrTextarea(){return this.inputOrTextarea||(this.connectedCallback(),this.scheduleUpdate()),this.isUpdatePending&&this.scheduleUpdate(),this.inputOrTextarea}getInput(){return"textarea"===this.type?null:this.getInputOrTextarea()}handleIconChange(){this.hasLeadingIcon=this.leadingIcons.length>0,this.hasTrailingIcon=this.trailingIcons.length>0}[ce](){return this.value}formResetCallback(){this.reset()}formStateRestoreCallback(e){this.value=e}focus(){this.getInputOrTextarea().focus()}[oe](){return new je((()=>({state:this,renderedControl:this.inputOrTextarea})))}[se](){return this.inputOrTextarea}[Ne](e){e?.preventDefault();const t=this.getErrorText();this.nativeError=!!e,this.nativeErrorText=this.validationMessage,t===this.getErrorText()&&this.field?.reannounceError()}}l(Xe),Xe.shadowRootOptions={...r.shadowRootOptions,delegatesFocus:!0},t([a({type:Boolean,reflect:!0})],Xe.prototype,"error",void 0),t([a({attribute:"error-text"})],Xe.prototype,"errorText",void 0),t([a()],Xe.prototype,"label",void 0),t([a({type:Boolean,reflect:!0})],Xe.prototype,"required",void 0),t([a()],Xe.prototype,"value",void 0),t([a({attribute:"prefix-text"})],Xe.prototype,"prefixText",void 0),t([a({attribute:"suffix-text"})],Xe.prototype,"suffixText",void 0),t([a({type:Boolean,attribute:"has-leading-icon"})],Xe.prototype,"hasLeadingIcon",void 0),t([a({type:Boolean,attribute:"has-trailing-icon"})],Xe.prototype,"hasTrailingIcon",void 0),t([a({attribute:"supporting-text"})],Xe.prototype,"supportingText",void 0),t([a({attribute:"text-direction"})],Xe.prototype,"textDirection",void 0),t([a({type:Number})],Xe.prototype,"rows",void 0),t([a({type:Number})],Xe.prototype,"cols",void 0),t([a({reflect:!0})],Xe.prototype,"inputMode",void 0),t([a()],Xe.prototype,"max",void 0),t([a({type:Number})],Xe.prototype,"maxLength",void 0),t([a()],Xe.prototype,"min",void 0),t([a({type:Number})],Xe.prototype,"minLength",void 0),t([a({type:Boolean,attribute:"no-spinner"})],Xe.prototype,"noSpinner",void 0),t([a()],Xe.prototype,"pattern",void 0),t([a({reflect:!0,converter:Me})],Xe.prototype,"placeholder",void 0),t([a({type:Boolean,reflect:!0})],Xe.prototype,"readOnly",void 0),t([a({type:Boolean,reflect:!0})],Xe.prototype,"multiple",void 0),t([a()],Xe.prototype,"step",void 0),t([a({reflect:!0})],Xe.prototype,"type",void 0),t([a({reflect:!0})],Xe.prototype,"autocomplete",void 0),t([m()],Xe.prototype,"dirty",void 0),t([m()],Xe.prototype,"focused",void 0),t([m()],Xe.prototype,"nativeError",void 0),t([m()],Xe.prototype,"nativeErrorText",void 0),t([d(".input")],Xe.prototype,"inputOrTextarea",void 0),t([d(".field")],Xe.prototype,"field",void 0),t([i({slot:"leading-icon"})],Xe.prototype,"leadingIcons",void 0),t([i({slot:"trailing-icon"})],Xe.prototype,"trailingIcons",void 0);class Je extends Xe{constructor(){super(...arguments),this.fieldTag=X`md-filled-field`}}const Qe=s`:host{display:inline-flex;outline:none;resize:both;-webkit-tap-highlight-color:rgba(0,0,0,0)}.text-field,.field{width:100%}.text-field{display:inline-flex}.field{cursor:text}.disabled .field{cursor:default}.text-field,.textarea .field{resize:inherit}.icon{color:currentColor;display:flex;fill:currentColor}.icon ::slotted(*){display:flex}[hasstart] .icon.leading{font-size:var(--_leading-icon-size);height:var(--_leading-icon-size);width:var(--_leading-icon-size)}[hasend] .icon.trailing{font-size:var(--_trailing-icon-size);height:var(--_trailing-icon-size);width:var(--_trailing-icon-size)}.input-wrapper{display:flex}.input-wrapper>*{all:inherit;padding:0}.input{caret-color:var(--_caret-color);overflow-x:hidden;text-align:inherit}.input::placeholder{color:currentColor;opacity:1}.input::-webkit-calendar-picker-indicator{display:none}.input::-webkit-search-decoration,.input::-webkit-search-cancel-button{display:none}@media(forced-colors: active){.input{background:none}}.no-spinner .input::-webkit-inner-spin-button,.no-spinner .input::-webkit-outer-spin-button{display:none}.no-spinner .input[type=number]{-moz-appearance:textfield}:focus-within .input{caret-color:var(--_focus-caret-color)}.error:focus-within .input{caret-color:var(--_error-focus-caret-color)}.text-field:not(.disabled) .prefix{color:var(--_input-text-prefix-color)}.text-field:not(.disabled) .suffix{color:var(--_input-text-suffix-color)}.text-field:not(.disabled) .input::placeholder{color:var(--_input-text-placeholder-color)}.prefix,.suffix{text-wrap:nowrap;width:min-content}.prefix{padding-inline-end:var(--_input-text-prefix-trailing-space)}.suffix{padding-inline-start:var(--_input-text-suffix-leading-space)}/*# sourceMappingURL=shared-styles.css.map */ +`;class et extends Je{constructor(){super(...arguments),this.fieldTag=X`md-filled-field`}}et.styles=[Qe,Ie],customElements.define("ew-filled-text-field",et);class tt extends r{connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){return o``}}const it=s`:host{display:flex;pointer-events:none}:host,.shadow,.shadow::before,.shadow::after{border-radius:inherit;inset:0;position:absolute;transition-duration:inherit;transition-property:inherit;transition-timing-function:inherit}.shadow::before,.shadow::after{content:"";transition-property:box-shadow,opacity;--_level: var(--md-elevation-level, 0);--_shadow-color: var(--md-elevation-shadow-color, var(--md-sys-color-shadow, #000))}.shadow::before{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 3,1) + 2*clamp(0,var(--_level) - 4,1))) calc(1px*(2*clamp(0,var(--_level),1) + clamp(0,var(--_level) - 2,1) + clamp(0,var(--_level) - 4,1))) 0px var(--_shadow-color);opacity:.3}.shadow::after{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 1,1) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(3*clamp(0,var(--_level),2) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(clamp(0,var(--_level),4) + 2*clamp(0,var(--_level) - 4,1))) var(--_shadow-color);opacity:.15}/*# sourceMappingURL=elevation-styles.css.map */ +`;let rt=class extends tt{};rt.styles=[it],rt=t([n("md-elevation")],rt);const ot=function(e,t){return new CustomEvent("close-menu",{bubbles:!0,composed:!0,detail:{initiator:e,reason:t,itemPath:[e]}})},st={SPACE:"Space",ENTER:"Enter"},at="click-selection",nt="keydown",lt={ESCAPE:"Escape",SPACE:st.SPACE,ENTER:st.ENTER};function dt(e){return Object.values(lt).some((t=>t===e))}function ct(e,t){const i=new Event("md-contains",{bubbles:!0,composed:!0});let r=[];const o=e=>{r=e.composedPath()};t.addEventListener("md-contains",o),e.dispatchEvent(i),t.removeEventListener("md-contains",o);return r.length>0}const ht="none",pt="list-root",ft="first-item",ut="last-item",mt="end-start",vt="start-start";class gt{constructor(e,t){this.host=e,this.getProperties=t,this.surfaceStylesInternal={display:"none"},this.lastValues={isOpen:!1},this.host.addController(this)}get surfaceStyles(){return this.surfaceStylesInternal}async position(){const{surfaceEl:e,anchorEl:t,anchorCorner:i,surfaceCorner:r,positioning:o,xOffset:s,yOffset:a,repositionStrategy:n}=this.getProperties(),l=i.toLowerCase().trim(),d=r.toLowerCase().trim();if(!e||!t)return;const c=window.innerWidth,h=window.innerHeight,p=document.createElement("div");p.style.opacity="0",p.style.position="fixed",p.style.display="block",p.style.inset="0",document.body.appendChild(p);const f=p.getBoundingClientRect();p.remove();const u=window.innerHeight-f.bottom,m=window.innerWidth-f.right;this.surfaceStylesInternal={display:"block",opacity:"0"},this.host.requestUpdate(),await this.host.updateComplete,e.popover&&e.isConnected&&e.showPopover();const v=e.getSurfacePositionClientRect?e.getSurfacePositionClientRect():e.getBoundingClientRect(),g=t.getSurfacePositionClientRect?t.getSurfacePositionClientRect():t.getBoundingClientRect(),[y,b]=d.split("-"),[_,x]=l.split("-"),w="ltr"===getComputedStyle(e).direction;let{blockInset:E,blockOutOfBoundsCorrection:k,surfaceBlockProperty:A}=this.calculateBlock({surfaceRect:v,anchorRect:g,anchorBlock:_,surfaceBlock:y,yOffset:a,positioning:o,windowInnerHeight:h,blockScrollbarHeight:u});if(k){const e="start"===y?"end":"start",t="start"===_?"end":"start",i=this.calculateBlock({surfaceRect:v,anchorRect:g,anchorBlock:t,surfaceBlock:e,yOffset:a,positioning:o,windowInnerHeight:h,blockScrollbarHeight:u});k>i.blockOutOfBoundsCorrection&&(E=i.blockInset,k=i.blockOutOfBoundsCorrection,A=i.surfaceBlockProperty)}let{inlineInset:S,inlineOutOfBoundsCorrection:R,surfaceInlineProperty:T}=this.calculateInline({surfaceRect:v,anchorRect:g,anchorInline:x,surfaceInline:b,xOffset:s,positioning:o,isLTR:w,windowInnerWidth:c,inlineScrollbarWidth:m});if(R){const e="start"===b?"end":"start",t="start"===x?"end":"start",i=this.calculateInline({surfaceRect:v,anchorRect:g,anchorInline:t,surfaceInline:e,xOffset:s,positioning:o,isLTR:w,windowInnerWidth:c,inlineScrollbarWidth:m});Math.abs(R)>Math.abs(i.inlineOutOfBoundsCorrection)&&(S=i.inlineInset,R=i.inlineOutOfBoundsCorrection,T=i.surfaceInlineProperty)}"move"===n&&(E-=k,S-=R),this.surfaceStylesInternal={display:"block",opacity:"1",[A]:`${E}px`,[T]:`${S}px`},"resize"===n&&(k&&(this.surfaceStylesInternal.height=v.height-k+"px"),R&&(this.surfaceStylesInternal.width=v.width-R+"px")),this.host.requestUpdate()}calculateBlock(e){const{surfaceRect:t,anchorRect:i,anchorBlock:r,surfaceBlock:o,yOffset:s,positioning:a,windowInnerHeight:n,blockScrollbarHeight:l}=e,d="fixed"===a||"document"===a?1:0,c="document"===a?1:0,h="start"===o?1:0,p="end"===o?1:0,f=(r!==o?1:0)*i.height+s,u=h*i.top+p*(n-i.bottom-l);return{blockInset:d*u+c*(h*window.scrollY-p*window.scrollY)+f,blockOutOfBoundsCorrection:Math.abs(Math.min(0,n-u-f-t.height)),surfaceBlockProperty:"start"===o?"inset-block-start":"inset-block-end"}}calculateInline(e){const{isLTR:t,surfaceInline:i,anchorInline:r,anchorRect:o,surfaceRect:s,xOffset:a,positioning:n,windowInnerWidth:l,inlineScrollbarWidth:d}=e,c="fixed"===n||"document"===n?1:0,h="document"===n?1:0,p=t?1:0,f=t?0:1,u="start"===i?1:0,m="end"===i?1:0,v=(r!==i?1:0)*o.width+a,g=p*(u*o.left+m*(l-o.right-d))+f*(u*(l-o.right-d)+m*o.left);let y="start"===i?"inset-inline-start":"inset-inline-end";return"document"!==n&&"fixed"!==n||(y="start"===i&&t||"end"===i&&!t?"left":"right"),{inlineInset:c*g+v+h*(p*(u*window.scrollX-m*window.scrollX)+f*(m*window.scrollX-u*window.scrollX)),inlineOutOfBoundsCorrection:Math.abs(Math.min(0,l-g-v-s.width)),surfaceInlineProperty:y}}hostUpdate(){this.onUpdate()}hostUpdated(){this.onUpdate()}async onUpdate(){const e=this.getProperties();let t=!1;for(const[i,r]of Object.entries(e))if(t=t||r!==this.lastValues[i],t)break;const i=this.lastValues.isOpen!==e.isOpen,r=!!e.anchorEl,o=!!e.surfaceEl;t&&r&&o&&(this.lastValues.isOpen=e.isOpen,e.isOpen?(this.lastValues=e,await this.position(),e.onOpen()):i&&(await e.beforeClose(),this.close(),e.onClose()))}close(){this.surfaceStylesInternal={display:"none"},this.host.requestUpdate();const e=this.getProperties().surfaceEl;e?.popover&&e?.isConnected&&e.hidePopover()}}const yt=0,bt=1,_t=2;class xt{constructor(e){this.getProperties=e,this.typeaheadRecords=[],this.typaheadBuffer="",this.cancelTypeaheadTimeout=0,this.isTypingAhead=!1,this.lastActiveRecord=null,this.onKeydown=e=>{this.isTypingAhead?this.typeahead(e):this.beginTypeahead(e)},this.endTypeahead=()=>{this.isTypingAhead=!1,this.typaheadBuffer="",this.typeaheadRecords=[]}}get items(){return this.getProperties().getItems()}get active(){return this.getProperties().active}beginTypeahead(e){this.active&&("Space"===e.code||"Enter"===e.code||e.code.startsWith("Arrow")||"Escape"===e.code||(this.isTypingAhead=!0,this.typeaheadRecords=this.items.map(((e,t)=>[t,e,e.typeaheadText.trim().toLowerCase()])),this.lastActiveRecord=this.typeaheadRecords.find((e=>0===e[bt].tabIndex))??null,this.lastActiveRecord&&(this.lastActiveRecord[bt].tabIndex=-1),this.typeahead(e)))}typeahead(e){if(e.defaultPrevented)return;if(clearTimeout(this.cancelTypeaheadTimeout),"Enter"===e.code||e.code.startsWith("Arrow")||"Escape"===e.code)return this.endTypeahead(),void(this.lastActiveRecord&&(this.lastActiveRecord[bt].tabIndex=-1));"Space"===e.code&&e.preventDefault(),this.cancelTypeaheadTimeout=setTimeout(this.endTypeahead,this.getProperties().typeaheadBufferTime),this.typaheadBuffer+=e.key.toLowerCase();const t=this.lastActiveRecord?this.lastActiveRecord[yt]:-1,i=this.typeaheadRecords.length,r=e=>(e[yt]+i-t)%i,o=this.typeaheadRecords.filter((e=>!e[bt].disabled&&e[_t].startsWith(this.typaheadBuffer))).sort(((e,t)=>r(e)-r(t)));if(0===o.length)return clearTimeout(this.cancelTypeaheadTimeout),this.lastActiveRecord&&(this.lastActiveRecord[bt].tabIndex=-1),void this.endTypeahead();const s=1===this.typaheadBuffer.length;let a;a=this.lastActiveRecord===o[0]&&s?o[1]??o[0]:o[0],this.lastActiveRecord&&(this.lastActiveRecord[bt].tabIndex=-1),this.lastActiveRecord=a,a[bt].tabIndex=0,a[bt].focus()}}const wt=new Set([F.ArrowDown,F.ArrowUp,F.Home,F.End]),Et=new Set([F.ArrowLeft,F.ArrowRight,...wt]);class kt extends r{get openDirection(){return"start"===this.menuCorner.split("-")[0]?"DOWN":"UP"}get anchorElement(){return this.anchor?this.getRootNode().querySelector(`#${this.anchor}`):this.currentAnchorElement}set anchorElement(e){this.currentAnchorElement=e,this.requestUpdate("anchorElement")}constructor(){super(),this.anchor="",this.positioning="absolute",this.quick=!1,this.hasOverflow=!1,this.open=!1,this.xOffset=0,this.yOffset=0,this.typeaheadDelay=200,this.anchorCorner=mt,this.menuCorner=vt,this.stayOpenOnOutsideClick=!1,this.stayOpenOnFocusout=!1,this.skipRestoreFocus=!1,this.defaultFocus=ft,this.typeaheadActive=!0,this.isSubmenu=!1,this.pointerPath=[],this.isRepositioning=!1,this.openCloseAnimationSignal=R(),this.listController=new M({isItem:e=>e.hasAttribute("md-menu-item"),getPossibleItems:()=>this.slotItems,isRtl:()=>"rtl"===getComputedStyle(this).direction,deactivateItem:e=>{e.selected=!1,e.tabIndex=-1},activateItem:e=>{e.selected=!0,e.tabIndex=0},isNavigableKey:e=>{if(!this.isSubmenu)return Et.has(e);return e===("rtl"===getComputedStyle(this).direction?F.ArrowLeft:F.ArrowRight)||wt.has(e)}}),this.lastFocusedElement=null,this.typeaheadController=new xt((()=>({getItems:()=>this.items,typeaheadBufferTime:this.typeaheadDelay,active:this.typeaheadActive}))),this.currentAnchorElement=null,this.internals=this.attachInternals(),this.menuPositionController=new gt(this,(()=>({anchorCorner:this.anchorCorner,surfaceCorner:this.menuCorner,surfaceEl:this.surfaceEl,anchorEl:this.anchorElement,positioning:"popover"===this.positioning?"document":this.positioning,isOpen:this.open,xOffset:this.xOffset,yOffset:this.yOffset,onOpen:this.onOpened,beforeClose:this.beforeClose,onClose:this.onClosed,repositionStrategy:this.hasOverflow&&"popover"!==this.positioning?"move":"resize"}))),this.onWindowResize=()=>{this.isRepositioning||"document"!==this.positioning&&"fixed"!==this.positioning&&"popover"!==this.positioning||(this.isRepositioning=!0,this.reposition(),this.isRepositioning=!1)},this.handleFocusout=async e=>{const t=this.anchorElement;if(this.stayOpenOnFocusout||!this.open||this.pointerPath.includes(t))return;if(e.relatedTarget){if(ct(e.relatedTarget,this)||0!==this.pointerPath.length&&ct(e.relatedTarget,t))return}else if(this.pointerPath.includes(this))return;const i=this.skipRestoreFocus;this.skipRestoreFocus=!0,this.close(),await this.updateComplete,this.skipRestoreFocus=i},this.onOpened=async()=>{this.lastFocusedElement=function(e=document){let t=e.activeElement;for(;t&&t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}();const e=this.items,t=L(e);t&&this.defaultFocus!==ht&&(t.item.tabIndex=-1);let i=!this.quick;switch(this.quick?this.dispatchEvent(new Event("opening")):i=!!await this.animateOpen(),this.defaultFocus){case ft:const t=O(e);t&&(t.tabIndex=0,t.focus(),await t.updateComplete);break;case ut:const i=z(e);i&&(i.tabIndex=0,i.focus(),await i.updateComplete);break;case pt:this.focus()}i||this.dispatchEvent(new Event("opened"))},this.beforeClose=async()=>{this.open=!1,this.skipRestoreFocus||this.lastFocusedElement?.focus?.(),this.quick||await this.animateClose()},this.onClosed=()=>{this.quick&&(this.dispatchEvent(new Event("closing")),this.dispatchEvent(new Event("closed")))},this.onWindowPointerdown=e=>{this.pointerPath=e.composedPath()},this.onDocumentClick=e=>{if(!this.open)return;const t=e.composedPath();this.stayOpenOnOutsideClick||t.includes(this)||t.includes(this.anchorElement)||(this.open=!1)},this.internals.role="menu",this.addEventListener("keydown",this.handleKeydown),this.addEventListener("keydown",this.captureKeydown,{capture:!0}),this.addEventListener("focusout",this.handleFocusout)}get items(){return this.listController.items}willUpdate(e){e.has("open")&&(this.open?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true"))}update(e){e.has("open")&&(this.open?this.setUpGlobalEventListeners():this.cleanUpGlobalEventListeners()),e.has("positioning")&&"popover"===this.positioning&&!this.showPopover&&(this.positioning="fixed"),super.update(e)}connectedCallback(){super.connectedCallback(),this.open&&this.setUpGlobalEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.cleanUpGlobalEventListeners()}render(){return this.renderSurface()}renderSurface(){return o` + + `}renderMenuItems(){return o``}renderElevation(){return o``}getSurfaceClasses(){return{open:this.open,fixed:"fixed"===this.positioning,"has-overflow":this.hasOverflow}}captureKeydown(e){e.target===this&&!e.defaultPrevented&&dt(e.code)&&(e.preventDefault(),this.close()),this.typeaheadController.onKeydown(e)}async animateOpen(){const e=this.surfaceEl,t=this.slotEl;if(!e||!t)return!0;const i=this.openDirection;this.dispatchEvent(new Event("opening")),e.classList.toggle("animating",!0);const r=this.openCloseAnimationSignal.start(),o=e.offsetHeight,s="UP"===i,a=this.items,n=250/a.length,l=e.animate([{height:"0px"},{height:`${o}px`}],{duration:500,easing:w.EMPHASIZED}),d=t.animate([{transform:s?`translateY(-${o}px)`:""},{transform:""}],{duration:500,easing:w.EMPHASIZED}),c=e.animate([{opacity:0},{opacity:1}],50),h=[];for(let e=0;e{t.classList.toggle("md-menu-hidden",!1)})),h.push([t,i])}let p=e=>{};const f=new Promise((e=>{p=e}));return r.addEventListener("abort",(()=>{l.cancel(),d.cancel(),c.cancel(),h.forEach((([e,t])=>{e.classList.toggle("md-menu-hidden",!1),t.cancel()})),p(!0)})),l.addEventListener("finish",(()=>{e.classList.toggle("animating",!1),this.openCloseAnimationSignal.finish(),p(!1)})),await f}animateClose(){let e,t;const i=new Promise(((i,r)=>{e=i,t=r})),r=this.surfaceEl,o=this.slotEl;if(!r||!o)return t(),i;const s="UP"===this.openDirection;this.dispatchEvent(new Event("closing")),r.classList.toggle("animating",!0);const a=this.openCloseAnimationSignal.start(),n=r.offsetHeight,l=this.items,d=150,c=50/l.length,h=r.animate([{height:`${n}px`},{height:.35*n+"px"}],{duration:d,easing:w.EMPHASIZED_ACCELERATE}),p=o.animate([{transform:""},{transform:s?`translateY(-${.65*n}px)`:""}],{duration:d,easing:w.EMPHASIZED_ACCELERATE}),f=r.animate([{opacity:1},{opacity:0}],{duration:50,delay:100}),u=[];for(let e=0;e{t.classList.toggle("md-menu-hidden",!0)})),u.push([t,i])}return a.addEventListener("abort",(()=>{h.cancel(),p.cancel(),f.cancel(),u.forEach((([e,t])=>{t.cancel(),e.classList.toggle("md-menu-hidden",!1)})),t()})),h.addEventListener("finish",(()=>{r.classList.toggle("animating",!1),u.forEach((([e])=>{e.classList.toggle("md-menu-hidden",!1)})),this.openCloseAnimationSignal.finish(),this.dispatchEvent(new Event("closed")),e(!0)})),i}handleKeydown(e){this.pointerPath=[],this.listController.handleKeydown(e)}setUpGlobalEventListeners(){document.addEventListener("click",this.onDocumentClick,{capture:!0}),window.addEventListener("pointerdown",this.onWindowPointerdown),document.addEventListener("resize",this.onWindowResize,{passive:!0}),window.addEventListener("resize",this.onWindowResize,{passive:!0})}cleanUpGlobalEventListeners(){document.removeEventListener("click",this.onDocumentClick,{capture:!0}),window.removeEventListener("pointerdown",this.onWindowPointerdown),document.removeEventListener("resize",this.onWindowResize),window.removeEventListener("resize",this.onWindowResize)}onCloseMenu(){this.close()}onDeactivateItems(e){e.stopPropagation(),this.listController.onDeactivateItems()}onRequestActivation(e){e.stopPropagation(),this.listController.onRequestActivation(e)}handleDeactivateTypeahead(e){e.stopPropagation(),this.typeaheadActive=!1}handleActivateTypeahead(e){e.stopPropagation(),this.typeaheadActive=!0}handleStayOpenOnFocusout(e){e.stopPropagation(),this.stayOpenOnFocusout=!0}handleCloseOnFocusout(e){e.stopPropagation(),this.stayOpenOnFocusout=!1}close(){this.open=!1;this.slotItems.forEach((e=>{e.close?.()}))}show(){this.open=!0}activateNextItem(){return this.listController.activateNextItem()??null}activatePreviousItem(){return this.listController.activatePreviousItem()??null}reposition(){this.open&&this.menuPositionController.position()}}t([d(".menu")],kt.prototype,"surfaceEl",void 0),t([d("slot")],kt.prototype,"slotEl",void 0),t([a()],kt.prototype,"anchor",void 0),t([a()],kt.prototype,"positioning",void 0),t([a({type:Boolean})],kt.prototype,"quick",void 0),t([a({type:Boolean,attribute:"has-overflow"})],kt.prototype,"hasOverflow",void 0),t([a({type:Boolean,reflect:!0})],kt.prototype,"open",void 0),t([a({type:Number,attribute:"x-offset"})],kt.prototype,"xOffset",void 0),t([a({type:Number,attribute:"y-offset"})],kt.prototype,"yOffset",void 0),t([a({type:Number,attribute:"typeahead-delay"})],kt.prototype,"typeaheadDelay",void 0),t([a({attribute:"anchor-corner"})],kt.prototype,"anchorCorner",void 0),t([a({attribute:"menu-corner"})],kt.prototype,"menuCorner",void 0),t([a({type:Boolean,attribute:"stay-open-on-outside-click"})],kt.prototype,"stayOpenOnOutsideClick",void 0),t([a({type:Boolean,attribute:"stay-open-on-focusout"})],kt.prototype,"stayOpenOnFocusout",void 0),t([a({type:Boolean,attribute:"skip-restore-focus"})],kt.prototype,"skipRestoreFocus",void 0),t([a({attribute:"default-focus"})],kt.prototype,"defaultFocus",void 0),t([i({flatten:!0})],kt.prototype,"slotItems",void 0),t([m()],kt.prototype,"typeaheadActive",void 0);const At=s`:host{--md-elevation-level: var(--md-menu-container-elevation, 2);--md-elevation-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));min-width:112px;color:unset;display:contents}md-focus-ring{--md-focus-ring-shape: var(--md-menu-container-shape, 4px)}.menu{border-radius:var(--md-menu-container-shape, 4px);display:none;inset:auto;border:none;padding:0px;overflow:visible;background-color:rgba(0,0,0,0);color:inherit;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit;max-width:inherit}.menu::backdrop{display:none}.fixed{position:fixed}.items{display:block;list-style-type:none;margin:0;outline:none;box-sizing:border-box;background-color:var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));height:inherit;max-height:inherit;overflow:auto;min-width:inherit;max-width:inherit;border-radius:inherit}.item-padding{padding-block:8px}.has-overflow:not([popover]) .items{overflow:visible}.has-overflow.animating .items,.animating .items{overflow:hidden}.has-overflow.animating .items{pointer-events:none}.animating ::slotted(.md-menu-hidden){opacity:0}slot{display:block;height:inherit;max-height:inherit}::slotted(:is(md-divider,[role=separator])){margin:8px 0}@media(forced-colors: active){.menu{border-style:solid;border-color:CanvasText;border-width:1px}}/*# sourceMappingURL=menu-styles.css.map */ +`;let St=class extends kt{};St.styles=[At],St=t([n("md-menu")],St);class Rt extends fe{computeValidity(e){return this.selectControl||(this.selectControl=document.createElement("select")),x(o``,this.selectControl),this.selectControl.value=e.value,this.selectControl.required=e.required,{validity:this.selectControl.validity,validationMessage:this.selectControl.validationMessage}}equals(e,t){return e.value===t.value&&e.required===t.required}copy({value:e,required:t}){return{value:e,required:t}}}var Tt;const It=Symbol("value"),Ct=Ve(de(pe(b(r))));class Bt extends Ct{get value(){return this[It]}set value(e){this.lastUserSetValue=e,this.select(e)}get options(){return this.menu?.items??[]}get selectedIndex(){const[e,t]=(this.getSelectedOptions()??[])[0]??[];return t??-1}set selectedIndex(e){this.lastUserSetSelectedIndex=e,this.selectIndex(e)}get selectedOptions(){return(this.getSelectedOptions()??[]).map((([e])=>e))}get hasError(){return this.error||this.nativeError}constructor(){super(),this.quick=!1,this.required=!1,this.errorText="",this.label="",this.supportingText="",this.error=!1,this.menuPositioning="popover",this.clampMenuWidth=!1,this.typeaheadDelay=200,this.hasLeadingIcon=!1,this.displayText="",this.menuAlign="start",this[Tt]="",this.lastUserSetValue=null,this.lastUserSetSelectedIndex=null,this.lastSelectedOption=null,this.lastSelectedOptionRecords=[],this.nativeError=!1,this.nativeErrorText="",this.focused=!1,this.open=!1,this.defaultFocus=ht,this.prevOpen=this.open,this.selectWidth=0,this.addEventListener("focus",this.handleFocus.bind(this)),this.addEventListener("blur",this.handleBlur.bind(this))}select(e){const t=this.options.find((t=>t.value===e));t&&this.selectItem(t)}selectIndex(e){const t=this.options[e];t&&this.selectItem(t)}reset(){for(const e of this.options)e.selected=e.hasAttribute("selected");this.updateValueAndDisplayText(),this.nativeError=!1,this.nativeErrorText=""}[(Tt=It,Ne)](e){e?.preventDefault();const t=this.getErrorText();this.nativeError=!!e,this.nativeErrorText=this.validationMessage,t===this.getErrorText()&&this.field?.reannounceError()}update(e){if(this.hasUpdated||this.initUserSelection(),this.prevOpen!==this.open&&this.open){const e=this.getBoundingClientRect();this.selectWidth=e.width}this.prevOpen=this.open,super.update(e)}render(){return o` + + ${this.renderField()} ${this.renderMenu()} + + `}async firstUpdated(e){await(this.menu?.updateComplete),this.lastSelectedOptionRecords.length||this.initUserSelection(),this.lastSelectedOptionRecords.length||this.options.length||setTimeout((()=>{this.updateValueAndDisplayText()})),super.firstUpdated(e)}getRenderClasses(){return{disabled:this.disabled,error:this.error,open:this.open}}renderField(){return Q` + <${this.fieldTag} + aria-haspopup="listbox" + role="combobox" + part="field" + id="field" + tabindex=${this.disabled?"-1":"0"} + aria-label=${this.ariaLabel||c} + aria-describedby="description" + aria-expanded=${this.open?"true":"false"} + aria-controls="listbox" + class="field" + label=${this.label} + .focused=${this.focused||this.open} + .populated=${!!this.displayText} + .disabled=${this.disabled} + .required=${this.required} + .error=${this.hasError} + ?has-start=${this.hasLeadingIcon} + has-end + supporting-text=${this.supportingText} + error-text=${this.getErrorText()} + @keydown=${this.handleKeydown} + @click=${this.handleClick}> + ${this.renderFieldContent()} +
+ `}renderFieldContent(){return[this.renderLeadingIcon(),this.renderLabel(),this.renderTrailingIcon()]}renderLeadingIcon(){return o` + + + + `}renderTrailingIcon(){return o` + + + + + + + + + `}renderLabel(){return o`
${this.displayText||o` `}
`}renderMenu(){const e=this.label||this.ariaLabel;return o``}renderMenuContent(){return o``}handleKeydown(e){if(this.open||this.disabled||!this.menu)return;const t=this.menu.typeaheadController,i="Space"===e.code||"ArrowDown"===e.code||"ArrowUp"===e.code||"End"===e.code||"Home"===e.code||"Enter"===e.code;if(!t.isTypingAhead&&i){switch(e.preventDefault(),this.open=!0,e.code){case"Space":case"ArrowDown":case"Enter":this.defaultFocus=ht;break;case"End":this.defaultFocus=ut;break;case"ArrowUp":case"Home":this.defaultFocus=ft}return}if(1===e.key.length){t.onKeydown(e),e.preventDefault();const{lastActiveRecord:i}=t;if(!i)return;this.labelEl?.setAttribute?.("aria-live","polite");this.selectItem(i[bt])&&this.dispatchInteractionEvents()}}handleClick(){this.open=!this.open}handleFocus(){this.focused=!0}handleBlur(){this.focused=!1}handleFocusout(e){e.relatedTarget&&ct(e.relatedTarget,this)||(this.open=!1)}getSelectedOptions(){if(!this.menu)return this.lastSelectedOptionRecords=[],null;const e=this.menu.items;return this.lastSelectedOptionRecords=function(e){const t=[];for(let i=0;it===e))}(t.key)?r=this.selectItem(i):(i.tabIndex=-1,i.blur()),r&&this.dispatchInteractionEvents()}selectItem(e){return(this.getSelectedOptions()??[]).forEach((([t])=>{e!==t&&(t.selected=!1)})),e.selected=!0,this.updateValueAndDisplayText()}handleRequestSelection(e){const t=e.target;this.lastSelectedOptionRecords.some((([e])=>e===t))||this.selectItem(t)}handleRequestDeselection(e){const t=e.target;this.lastSelectedOptionRecords.some((([e])=>e===t))&&this.updateValueAndDisplayText()}initUserSelection(){this.lastUserSetValue&&!this.lastSelectedOptionRecords.length?this.select(this.lastUserSetValue):null===this.lastUserSetSelectedIndex||this.lastSelectedOptionRecords.length?this.updateValueAndDisplayText():this.selectIndex(this.lastUserSetSelectedIndex)}handleIconChange(){this.hasLeadingIcon=this.leadingIcons.length>0}dispatchInteractionEvents(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0}))}getErrorText(){return this.error?this.errorText:this.nativeErrorText}[ce](){return this.value}formResetCallback(){this.reset()}formStateRestoreCallback(e){this.value=e}[oe](){return new Rt((()=>this))}[se](){return this.field}}l(Bt),Bt.shadowRootOptions={...r.shadowRootOptions,delegatesFocus:!0},t([a({type:Boolean})],Bt.prototype,"quick",void 0),t([a({type:Boolean})],Bt.prototype,"required",void 0),t([a({type:String,attribute:"error-text"})],Bt.prototype,"errorText",void 0),t([a()],Bt.prototype,"label",void 0),t([a({type:String,attribute:"supporting-text"})],Bt.prototype,"supportingText",void 0),t([a({type:Boolean,reflect:!0})],Bt.prototype,"error",void 0),t([a({attribute:"menu-positioning"})],Bt.prototype,"menuPositioning",void 0),t([a({type:Boolean,attribute:"clamp-menu-width"})],Bt.prototype,"clampMenuWidth",void 0),t([a({type:Number,attribute:"typeahead-delay"})],Bt.prototype,"typeaheadDelay",void 0),t([a({type:Boolean,attribute:"has-leading-icon"})],Bt.prototype,"hasLeadingIcon",void 0),t([a({attribute:"display-text"})],Bt.prototype,"displayText",void 0),t([a({attribute:"menu-align"})],Bt.prototype,"menuAlign",void 0),t([a()],Bt.prototype,"value",null),t([a({type:Number,attribute:"selected-index"})],Bt.prototype,"selectedIndex",null),t([m()],Bt.prototype,"nativeError",void 0),t([m()],Bt.prototype,"nativeErrorText",void 0),t([m()],Bt.prototype,"focused",void 0),t([m()],Bt.prototype,"open",void 0),t([m()],Bt.prototype,"defaultFocus",void 0),t([d(".field")],Bt.prototype,"field",void 0),t([d("md-menu")],Bt.prototype,"menu",void 0),t([d("#label")],Bt.prototype,"labelEl",void 0),t([i({slot:"leading-icon",flatten:!0})],Bt.prototype,"leadingIcons",void 0);class $t extends Bt{constructor(){super(...arguments),this.fieldTag=X`md-filled-field`}}const Lt=s`:host{--_text-field-active-indicator-color: var(--md-filled-select-text-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-active-indicator-height: var(--md-filled-select-text-field-active-indicator-height, 1px);--_text-field-container-color: var(--md-filled-select-text-field-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_text-field-container-shape-start-start: var( --md-filled-select-text-field-container-shape-start-start, var( --md-filled-select-text-field-container-shape, 4px ) );--_text-field-container-shape-start-end: var( --md-filled-select-text-field-container-shape-start-end, var( --md-filled-select-text-field-container-shape, 4px ) );--_text-field-container-shape-end-end: var( --md-filled-select-text-field-container-shape-end-end, var( --md-filled-select-text-field-container-shape, 0px ) );--_text-field-container-shape-end-start: var( --md-filled-select-text-field-container-shape-end-start, var( --md-filled-select-text-field-container-shape, 0px ) );--_text-field-disabled-active-indicator-color: var(--md-filled-select-text-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-active-indicator-height: var(--md-filled-select-text-field-disabled-active-indicator-height, 1px);--_text-field-disabled-active-indicator-opacity: var(--md-filled-select-text-field-disabled-active-indicator-opacity, 0.38);--_text-field-disabled-container-color: var(--md-filled-select-text-field-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-container-opacity: var(--md-filled-select-text-field-disabled-container-opacity, 0.04);--_text-field-disabled-input-text-color: var(--md-filled-select-text-field-disabled-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-input-text-opacity: var(--md-filled-select-text-field-disabled-input-text-opacity, 0.38);--_text-field-disabled-label-text-color: var(--md-filled-select-text-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-label-text-opacity: var(--md-filled-select-text-field-disabled-label-text-opacity, 0.38);--_text-field-disabled-leading-icon-color: var(--md-filled-select-text-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-leading-icon-opacity: var(--md-filled-select-text-field-disabled-leading-icon-opacity, 0.38);--_text-field-disabled-supporting-text-color: var(--md-filled-select-text-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-supporting-text-opacity: var(--md-filled-select-text-field-disabled-supporting-text-opacity, 0.38);--_text-field-disabled-trailing-icon-color: var(--md-filled-select-text-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-trailing-icon-opacity: var(--md-filled-select-text-field-disabled-trailing-icon-opacity, 0.38);--_text-field-error-active-indicator-color: var(--md-filled-select-text-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-active-indicator-color: var(--md-filled-select-text-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-input-text-color: var(--md-filled-select-text-field-error-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-focus-label-text-color: var(--md-filled-select-text-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-leading-icon-color: var(--md-filled-select-text-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-focus-supporting-text-color: var(--md-filled-select-text-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-trailing-icon-color: var(--md-filled-select-text-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_text-field-error-hover-active-indicator-color: var(--md-filled-select-text-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-hover-input-text-color: var(--md-filled-select-text-field-error-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-hover-label-text-color: var(--md-filled-select-text-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-hover-leading-icon-color: var(--md-filled-select-text-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-hover-state-layer-color: var(--md-filled-select-text-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-hover-state-layer-opacity: var(--md-filled-select-text-field-error-hover-state-layer-opacity, 0.08);--_text-field-error-hover-supporting-text-color: var(--md-filled-select-text-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-hover-trailing-icon-color: var(--md-filled-select-text-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-input-text-color: var(--md-filled-select-text-field-error-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-label-text-color: var(--md-filled-select-text-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-leading-icon-color: var(--md-filled-select-text-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-supporting-text-color: var(--md-filled-select-text-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-trailing-icon-color: var(--md-filled-select-text-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_text-field-focus-active-indicator-color: var(--md-filled-select-text-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_text-field-focus-active-indicator-height: var(--md-filled-select-text-field-focus-active-indicator-height, 3px);--_text-field-focus-input-text-color: var(--md-filled-select-text-field-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-focus-label-text-color: var(--md-filled-select-text-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_text-field-focus-leading-icon-color: var(--md-filled-select-text-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-focus-supporting-text-color: var(--md-filled-select-text-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-focus-trailing-icon-color: var(--md-filled-select-text-field-focus-trailing-icon-color, var(--md-sys-color-primary, #6750a4));--_text-field-hover-active-indicator-color: var(--md-filled-select-text-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-active-indicator-height: var(--md-filled-select-text-field-hover-active-indicator-height, 1px);--_text-field-hover-input-text-color: var(--md-filled-select-text-field-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-label-text-color: var(--md-filled-select-text-field-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-leading-icon-color: var(--md-filled-select-text-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-state-layer-color: var(--md-filled-select-text-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-state-layer-opacity: var(--md-filled-select-text-field-hover-state-layer-opacity, 0.08);--_text-field-hover-supporting-text-color: var(--md-filled-select-text-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-trailing-icon-color: var(--md-filled-select-text-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-input-text-color: var(--md-filled-select-text-field-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-input-text-font: var(--md-filled-select-text-field-input-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_text-field-input-text-line-height: var(--md-filled-select-text-field-input-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_text-field-input-text-size: var(--md-filled-select-text-field-input-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_text-field-input-text-weight: var(--md-filled-select-text-field-input-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_text-field-label-text-color: var(--md-filled-select-text-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-label-text-font: var(--md-filled-select-text-field-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_text-field-label-text-line-height: var(--md-filled-select-text-field-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_text-field-label-text-populated-line-height: var(--md-filled-select-text-field-label-text-populated-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_text-field-label-text-populated-size: var(--md-filled-select-text-field-label-text-populated-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_text-field-label-text-size: var(--md-filled-select-text-field-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_text-field-label-text-weight: var(--md-filled-select-text-field-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_text-field-leading-icon-color: var(--md-filled-select-text-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-leading-icon-size: var(--md-filled-select-text-field-leading-icon-size, 24px);--_text-field-supporting-text-color: var(--md-filled-select-text-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-supporting-text-font: var(--md-filled-select-text-field-supporting-text-font, var(--md-sys-typescale-body-small-font, var(--md-ref-typeface-plain, Roboto)));--_text-field-supporting-text-line-height: var(--md-filled-select-text-field-supporting-text-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_text-field-supporting-text-size: var(--md-filled-select-text-field-supporting-text-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_text-field-supporting-text-weight: var(--md-filled-select-text-field-supporting-text-weight, var(--md-sys-typescale-body-small-weight, var(--md-ref-typeface-weight-regular, 400)));--_text-field-trailing-icon-color: var(--md-filled-select-text-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-trailing-icon-size: var(--md-filled-select-text-field-trailing-icon-size, 24px);--md-filled-field-active-indicator-color: var(--_text-field-active-indicator-color);--md-filled-field-active-indicator-height: var(--_text-field-active-indicator-height);--md-filled-field-container-color: var(--_text-field-container-color);--md-filled-field-container-shape-end-end: var(--_text-field-container-shape-end-end);--md-filled-field-container-shape-end-start: var(--_text-field-container-shape-end-start);--md-filled-field-container-shape-start-end: var(--_text-field-container-shape-start-end);--md-filled-field-container-shape-start-start: var(--_text-field-container-shape-start-start);--md-filled-field-content-color: var(--_text-field-input-text-color);--md-filled-field-content-font: var(--_text-field-input-text-font);--md-filled-field-content-line-height: var(--_text-field-input-text-line-height);--md-filled-field-content-size: var(--_text-field-input-text-size);--md-filled-field-content-weight: var(--_text-field-input-text-weight);--md-filled-field-disabled-active-indicator-color: var(--_text-field-disabled-active-indicator-color);--md-filled-field-disabled-active-indicator-height: var(--_text-field-disabled-active-indicator-height);--md-filled-field-disabled-active-indicator-opacity: var(--_text-field-disabled-active-indicator-opacity);--md-filled-field-disabled-container-color: var(--_text-field-disabled-container-color);--md-filled-field-disabled-container-opacity: var(--_text-field-disabled-container-opacity);--md-filled-field-disabled-content-color: var(--_text-field-disabled-input-text-color);--md-filled-field-disabled-content-opacity: var(--_text-field-disabled-input-text-opacity);--md-filled-field-disabled-label-text-color: var(--_text-field-disabled-label-text-color);--md-filled-field-disabled-label-text-opacity: var(--_text-field-disabled-label-text-opacity);--md-filled-field-disabled-leading-content-color: var(--_text-field-disabled-leading-icon-color);--md-filled-field-disabled-leading-content-opacity: var(--_text-field-disabled-leading-icon-opacity);--md-filled-field-disabled-supporting-text-color: var(--_text-field-disabled-supporting-text-color);--md-filled-field-disabled-supporting-text-opacity: var(--_text-field-disabled-supporting-text-opacity);--md-filled-field-disabled-trailing-content-color: var(--_text-field-disabled-trailing-icon-color);--md-filled-field-disabled-trailing-content-opacity: var(--_text-field-disabled-trailing-icon-opacity);--md-filled-field-error-active-indicator-color: var(--_text-field-error-active-indicator-color);--md-filled-field-error-content-color: var(--_text-field-error-input-text-color);--md-filled-field-error-focus-active-indicator-color: var(--_text-field-error-focus-active-indicator-color);--md-filled-field-error-focus-content-color: var(--_text-field-error-focus-input-text-color);--md-filled-field-error-focus-label-text-color: var(--_text-field-error-focus-label-text-color);--md-filled-field-error-focus-leading-content-color: var(--_text-field-error-focus-leading-icon-color);--md-filled-field-error-focus-supporting-text-color: var(--_text-field-error-focus-supporting-text-color);--md-filled-field-error-focus-trailing-content-color: var(--_text-field-error-focus-trailing-icon-color);--md-filled-field-error-hover-active-indicator-color: var(--_text-field-error-hover-active-indicator-color);--md-filled-field-error-hover-content-color: var(--_text-field-error-hover-input-text-color);--md-filled-field-error-hover-label-text-color: var(--_text-field-error-hover-label-text-color);--md-filled-field-error-hover-leading-content-color: var(--_text-field-error-hover-leading-icon-color);--md-filled-field-error-hover-state-layer-color: var(--_text-field-error-hover-state-layer-color);--md-filled-field-error-hover-state-layer-opacity: var(--_text-field-error-hover-state-layer-opacity);--md-filled-field-error-hover-supporting-text-color: var(--_text-field-error-hover-supporting-text-color);--md-filled-field-error-hover-trailing-content-color: var(--_text-field-error-hover-trailing-icon-color);--md-filled-field-error-label-text-color: var(--_text-field-error-label-text-color);--md-filled-field-error-leading-content-color: var(--_text-field-error-leading-icon-color);--md-filled-field-error-supporting-text-color: var(--_text-field-error-supporting-text-color);--md-filled-field-error-trailing-content-color: var(--_text-field-error-trailing-icon-color);--md-filled-field-focus-active-indicator-color: var(--_text-field-focus-active-indicator-color);--md-filled-field-focus-active-indicator-height: var(--_text-field-focus-active-indicator-height);--md-filled-field-focus-content-color: var(--_text-field-focus-input-text-color);--md-filled-field-focus-label-text-color: var(--_text-field-focus-label-text-color);--md-filled-field-focus-leading-content-color: var(--_text-field-focus-leading-icon-color);--md-filled-field-focus-supporting-text-color: var(--_text-field-focus-supporting-text-color);--md-filled-field-focus-trailing-content-color: var(--_text-field-focus-trailing-icon-color);--md-filled-field-hover-active-indicator-color: var(--_text-field-hover-active-indicator-color);--md-filled-field-hover-active-indicator-height: var(--_text-field-hover-active-indicator-height);--md-filled-field-hover-content-color: var(--_text-field-hover-input-text-color);--md-filled-field-hover-label-text-color: var(--_text-field-hover-label-text-color);--md-filled-field-hover-leading-content-color: var(--_text-field-hover-leading-icon-color);--md-filled-field-hover-state-layer-color: var(--_text-field-hover-state-layer-color);--md-filled-field-hover-state-layer-opacity: var(--_text-field-hover-state-layer-opacity);--md-filled-field-hover-supporting-text-color: var(--_text-field-hover-supporting-text-color);--md-filled-field-hover-trailing-content-color: var(--_text-field-hover-trailing-icon-color);--md-filled-field-label-text-color: var(--_text-field-label-text-color);--md-filled-field-label-text-font: var(--_text-field-label-text-font);--md-filled-field-label-text-line-height: var(--_text-field-label-text-line-height);--md-filled-field-label-text-populated-line-height: var(--_text-field-label-text-populated-line-height);--md-filled-field-label-text-populated-size: var(--_text-field-label-text-populated-size);--md-filled-field-label-text-size: var(--_text-field-label-text-size);--md-filled-field-label-text-weight: var(--_text-field-label-text-weight);--md-filled-field-leading-content-color: var(--_text-field-leading-icon-color);--md-filled-field-supporting-text-color: var(--_text-field-supporting-text-color);--md-filled-field-supporting-text-font: var(--_text-field-supporting-text-font);--md-filled-field-supporting-text-line-height: var(--_text-field-supporting-text-line-height);--md-filled-field-supporting-text-size: var(--_text-field-supporting-text-size);--md-filled-field-supporting-text-weight: var(--_text-field-supporting-text-weight);--md-filled-field-trailing-content-color: var(--_text-field-trailing-icon-color)}[has-start] .icon.leading{font-size:var(--_text-field-leading-icon-size);height:var(--_text-field-leading-icon-size);width:var(--_text-field-leading-icon-size)}.icon.trailing{font-size:var(--_text-field-trailing-icon-size);height:var(--_text-field-trailing-icon-size);width:var(--_text-field-trailing-icon-size)}/*# sourceMappingURL=filled-select-styles.css.map */ +`,Ot=s`:host{color:unset;min-width:210px;display:flex}.field{cursor:default;outline:none}.select{position:relative;flex-direction:column}.icon.trailing svg,.icon ::slotted(*){fill:currentColor}.icon ::slotted(*){width:inherit;height:inherit;font-size:inherit}.icon slot{display:flex;height:100%;width:100%;align-items:center;justify-content:center}.icon.trailing :is(.up,.down){opacity:0;transition:opacity 75ms linear 75ms}.select:not(.open) .down,.select.open .up{opacity:1}.field,.select,md-menu{min-width:inherit;width:inherit;max-width:inherit;display:flex}md-menu{min-width:var(--__menu-min-width);max-width:var(--__menu-max-width, inherit)}.menu-wrapper{width:0px;height:0px;max-width:inherit}md-menu ::slotted(:not[disabled]){cursor:pointer}.field,.select{width:100%}:host{display:inline-flex}:host([disabled]){pointer-events:none}/*# sourceMappingURL=shared-styles.css.map */ +`;class zt extends $t{}zt.styles=[Ot,Lt],customElements.define("ew-filled-select",zt);const Ut=s`:host{display:flex;--md-ripple-hover-color: var(--md-menu-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-menu-item-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-menu-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-menu-item-pressed-state-layer-opacity, 0.12)}:host([disabled]){opacity:var(--md-menu-item-disabled-opacity, 0.3);pointer-events:none}md-focus-ring{z-index:1;--md-focus-ring-shape: 8px}a,button,li{background:none;border:none;padding:0;margin:0;text-align:unset;text-decoration:none}.list-item{border-radius:inherit;display:flex;flex:1;max-width:inherit;min-width:inherit;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.list-item:not(.disabled){cursor:pointer}[slot=container]{pointer-events:none}md-ripple{border-radius:inherit}md-item{border-radius:inherit;flex:1;color:var(--md-menu-item-label-text-color, var(--md-sys-color-on-surface, #1d1b20));font-family:var(--md-menu-item-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));line-height:var(--md-menu-item-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));font-weight:var(--md-menu-item-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));min-height:var(--md-menu-item-one-line-container-height, 56px);padding-top:var(--md-menu-item-top-space, 12px);padding-bottom:var(--md-menu-item-bottom-space, 12px);padding-inline-start:var(--md-menu-item-leading-space, 16px);padding-inline-end:var(--md-menu-item-trailing-space, 16px)}md-item[multiline]{min-height:var(--md-menu-item-two-line-container-height, 72px)}[slot=supporting-text]{color:var(--md-menu-item-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-menu-item-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-menu-item-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-menu-item-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)))}[slot=trailing-supporting-text]{color:var(--md-menu-item-trailing-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-menu-item-trailing-supporting-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-trailing-supporting-text-size, var(--md-sys-typescale-label-small-size, 0.6875rem));line-height:var(--md-menu-item-trailing-supporting-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));font-weight:var(--md-menu-item-trailing-supporting-text-weight, var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500)))}:is([slot=start],[slot=end])::slotted(*){fill:currentColor}[slot=start]{color:var(--md-menu-item-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}[slot=end]{color:var(--md-menu-item-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}.list-item{background-color:var(--md-menu-item-container-color, transparent)}.list-item.selected{background-color:var(--md-menu-item-selected-container-color, var(--md-sys-color-secondary-container, #e8def8))}.selected:not(.disabled) ::slotted(*){color:var(--md-menu-item-selected-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b))}@media(forced-colors: active){:host([disabled]),:host([disabled]) slot{color:GrayText;opacity:1}.list-item{position:relative}.list-item.selected::before{content:"";position:absolute;inset:0;box-sizing:border-box;border-radius:inherit;pointer-events:none;border:3px double CanvasText}}/*# sourceMappingURL=menu-item-styles.css.map */ +`;class Dt{constructor(e,t){this.host=e,this.internalTypeaheadText=null,this.onClick=()=>{this.host.keepOpen||this.host.dispatchEvent(ot(this.host,{kind:at}))},this.onKeydown=e=>{if(this.host.href&&"Enter"===e.code){const e=this.getInteractiveElement();e instanceof HTMLAnchorElement&&e.click()}if(e.defaultPrevented)return;const t=e.code;this.host.keepOpen&&"Escape"!==t||dt(t)&&(e.preventDefault(),this.host.dispatchEvent(ot(this.host,{kind:nt,key:t})))},this.getHeadlineElements=t.getHeadlineElements,this.getSupportingTextElements=t.getSupportingTextElements,this.getDefaultElements=t.getDefaultElements,this.getInteractiveElement=t.getInteractiveElement,this.host.addController(this)}get typeaheadText(){if(null!==this.internalTypeaheadText)return this.internalTypeaheadText;const e=this.getHeadlineElements(),t=[];return e.forEach((e=>{e.textContent&&e.textContent.trim()&&t.push(e.textContent.trim())})),0===t.length&&this.getDefaultElements().forEach((e=>{e.textContent&&e.textContent.trim()&&t.push(e.textContent.trim())})),0===t.length&&this.getSupportingTextElements().forEach((e=>{e.textContent&&e.textContent.trim()&&t.push(e.textContent.trim())})),t.join(" ")}get tagName(){switch(this.host.type){case"link":return"a";case"button":return"button";default:return"li"}}get role(){return"option"===this.host.type?"option":"menuitem"}hostConnected(){this.host.toggleAttribute("md-menu-item",!0)}hostUpdate(){this.host.href&&(this.host.type="link")}setTypeaheadText(e){this.internalTypeaheadText=e}}class Pt{get role(){return this.menuItemController.role}get typeaheadText(){return this.menuItemController.typeaheadText}setTypeaheadText(e){this.menuItemController.setTypeaheadText(e)}get displayText(){return null!==this.internalDisplayText?this.internalDisplayText:this.menuItemController.typeaheadText}setDisplayText(e){this.internalDisplayText=e}constructor(e,t){this.host=e,this.internalDisplayText=null,this.lastSelected=this.host.selected,this.firstUpdate=!0,this.onClick=()=>{this.menuItemController.onClick()},this.onKeydown=e=>{this.menuItemController.onKeydown(e)},this.menuItemController=new Dt(e,t),e.addController(this)}hostUpdate(){this.lastSelected!==this.host.selected&&(this.host.ariaSelected=this.host.selected?"true":"false")}hostUpdated(){this.lastSelected===this.host.selected||this.firstUpdate||(this.host.selected?this.host.dispatchEvent(new Event("request-selection",{bubbles:!0,composed:!0})):this.host.dispatchEvent(new Event("request-deselection",{bubbles:!0,composed:!0}))),this.lastSelected=this.host.selected,this.firstUpdate=!1}}class Ft extends r{constructor(){super(...arguments),this.disabled=!1,this.isMenuItem=!0,this.selected=!1,this.value="",this.type="option",this.selectOptionController=new Pt(this,{getHeadlineElements:()=>this.headlineElements,getSupportingTextElements:()=>this.supportingTextElements,getDefaultElements:()=>this.defaultElements,getInteractiveElement:()=>this.listItemRoot})}get typeaheadText(){return this.selectOptionController.typeaheadText}set typeaheadText(e){this.selectOptionController.setTypeaheadText(e)}get displayText(){return this.selectOptionController.displayText}set displayText(e){this.selectOptionController.setDisplayText(e)}render(){return this.renderListItem(o` + +
+ ${this.renderRipple()} ${this.renderFocusRing()} +
+ + + ${this.renderBody()} +
+ `)}renderListItem(e){return o` +
  • ${e}
  • + `}renderRipple(){return o` `}renderFocusRing(){return o` `}getRenderClasses(){return{disabled:this.disabled,selected:this.selected}}renderBody(){return o` + + + + + + `}focus(){this.listItemRoot?.focus()}}l(Ft),Ft.shadowRootOptions={...r.shadowRootOptions,delegatesFocus:!0},t([a({type:Boolean,reflect:!0})],Ft.prototype,"disabled",void 0),t([a({type:Boolean,attribute:"md-menu-item",reflect:!0})],Ft.prototype,"isMenuItem",void 0),t([a({type:Boolean})],Ft.prototype,"selected",void 0),t([a()],Ft.prototype,"value",void 0),t([d(".list-item")],Ft.prototype,"listItemRoot",void 0),t([i({slot:"headline"})],Ft.prototype,"headlineElements",void 0),t([i({slot:"supporting-text"})],Ft.prototype,"supportingTextElements",void 0),t([function(t){return(i,r)=>{const{slot:o}=t??{},s="slot"+(o?`[name=${o}]`:":not([name])");return e(i,r,{get(){const e=this.renderRoot?.querySelector(s);return e?.assignedNodes(t)??[]}})}}({slot:""})],Ft.prototype,"defaultElements",void 0),t([a({attribute:"typeahead-text"})],Ft.prototype,"typeaheadText",null),t([a({attribute:"display-text"})],Ft.prototype,"displayText",null);class Mt extends Ft{}Mt.styles=[Ut],customElements.define("ew-select-option",Mt);class Nt extends r{constructor(){super(...arguments),this.value=0,this.max=1,this.indeterminate=!1,this.fourColor=!1}render(){const{ariaLabel:e}=this;return o` +
    ${this.renderIndicator()}
    + `}getRenderClasses(){return{indeterminate:this.indeterminate,"four-color":this.fourColor}}}l(Nt),t([a({type:Number})],Nt.prototype,"value",void 0),t([a({type:Number})],Nt.prototype,"max",void 0),t([a({type:Boolean})],Nt.prototype,"indeterminate",void 0),t([a({type:Boolean,attribute:"four-color"})],Nt.prototype,"fourColor",void 0);class Ht extends Nt{renderIndicator(){return this.indeterminate?this.renderIndeterminateContainer():this.renderDeterminateContainer()}renderDeterminateContainer(){const e=100*(1-this.value/this.max);return o` + + + + + `}renderIndeterminateContainer(){return o`
    +
    +
    +
    +
    +
    +
    +
    `}}const qt=s`:host{--_active-indicator-color: var(--md-circular-progress-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_active-indicator-width: var(--md-circular-progress-active-indicator-width, 10);--_four-color-active-indicator-four-color: var(--md-circular-progress-four-color-active-indicator-four-color, var(--md-sys-color-tertiary-container, #ffd8e4));--_four-color-active-indicator-one-color: var(--md-circular-progress-four-color-active-indicator-one-color, var(--md-sys-color-primary, #6750a4));--_four-color-active-indicator-three-color: var(--md-circular-progress-four-color-active-indicator-three-color, var(--md-sys-color-tertiary, #7d5260));--_four-color-active-indicator-two-color: var(--md-circular-progress-four-color-active-indicator-two-color, var(--md-sys-color-primary-container, #eaddff));--_size: var(--md-circular-progress-size, 48px);display:inline-flex;vertical-align:middle;width:var(--_size);height:var(--_size);position:relative;align-items:center;justify-content:center;contain:strict;content-visibility:auto}.progress{flex:1;align-self:stretch;margin:4px}.progress,.spinner,.left,.right,.circle,svg,.track,.active-track{position:absolute;inset:0}svg{transform:rotate(-90deg)}circle{cx:50%;cy:50%;r:calc(50%*(1 - var(--_active-indicator-width)/100));stroke-width:calc(var(--_active-indicator-width)*1%);stroke-dasharray:100;fill:rgba(0,0,0,0)}.active-track{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1);stroke:var(--_active-indicator-color)}.track{stroke:rgba(0,0,0,0)}.progress.indeterminate{animation:linear infinite linear-rotate;animation-duration:1568.2352941176ms}.spinner{animation:infinite both rotate-arc;animation-duration:5332ms;animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.left{overflow:hidden;inset:0 50% 0 0}.right{overflow:hidden;inset:0 0 0 50%}.circle{box-sizing:border-box;border-radius:50%;border:solid calc(var(--_active-indicator-width)/100*(var(--_size) - 8px));border-color:var(--_active-indicator-color) var(--_active-indicator-color) rgba(0,0,0,0) rgba(0,0,0,0);animation:expand-arc;animation-iteration-count:infinite;animation-fill-mode:both;animation-duration:1333ms,5332ms;animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.four-color .circle{animation-name:expand-arc,four-color}.left .circle{rotate:135deg;inset:0 -100% 0 0}.right .circle{rotate:100deg;inset:0 0 0 -100%;animation-delay:-666.5ms,0ms}@media(forced-colors: active){.active-track{stroke:CanvasText}.circle{border-color:CanvasText CanvasText Canvas Canvas}}@keyframes expand-arc{0%{transform:rotate(265deg)}50%{transform:rotate(130deg)}100%{transform:rotate(265deg)}}@keyframes rotate-arc{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes linear-rotate{to{transform:rotate(360deg)}}@keyframes four-color{0%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}15%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}25%{border-top-color:var(--_four-color-active-indicator-two-color);border-right-color:var(--_four-color-active-indicator-two-color)}40%{border-top-color:var(--_four-color-active-indicator-two-color);border-right-color:var(--_four-color-active-indicator-two-color)}50%{border-top-color:var(--_four-color-active-indicator-three-color);border-right-color:var(--_four-color-active-indicator-three-color)}65%{border-top-color:var(--_four-color-active-indicator-three-color);border-right-color:var(--_four-color-active-indicator-three-color)}75%{border-top-color:var(--_four-color-active-indicator-four-color);border-right-color:var(--_four-color-active-indicator-four-color)}90%{border-top-color:var(--_four-color-active-indicator-four-color);border-right-color:var(--_four-color-active-indicator-four-color)}100%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}}/*# sourceMappingURL=circular-progress-styles.css.map */ +`;class Wt extends Ht{}Wt.styles=[qt],customElements.define("ew-circular-progress",Wt);class Zt extends r{render(){return o` +
    + + ${void 0!==this.progress?o`
    ${this.progress}%
    `:""} +
    + ${this.label} + `}}Zt.styles=s` + :host { + display: flex; + flex-direction: column; + text-align: center; + } + ew-circular-progress { + margin-bottom: 16px; + } + `,t([a()],Zt.prototype,"label",void 0),t([a()],Zt.prototype,"progress",void 0),customElements.define("ewt-page-progress",Zt);class Vt extends r{render(){return o` +
    ${this.icon}
    + ${this.label} + `}}Vt.styles=s` + :host { + display: flex; + flex-direction: column; + text-align: center; + } + .icon { + font-size: 50px; + line-height: 80px; + color: black; + } + `,t([a()],Vt.prototype,"icon",void 0),t([a()],Vt.prototype,"label",void 0),customElements.define("ewt-page-message",Vt);const Gt=T` + + + +`,jt=T` + + + +`,Kt=T` + + + +`,Yt=T` + + + +`,Xt=T` + + + +`,Jt=T` + + + +`,Qt=T` + + + +`,ei=["I".charCodeAt(0),"M".charCodeAt(0),"P".charCodeAt(0),"R".charCodeAt(0),"O".charCodeAt(0),"V".charCodeAt(0),1];var ti,ii;!function(e){e[e.CURRENT_STATE=1]="CURRENT_STATE",e[e.ERROR_STATE=2]="ERROR_STATE",e[e.RPC=3]="RPC",e[e.RPC_RESULT=4]="RPC_RESULT"}(ti||(ti={})),function(e){e[e.READY=2]="READY",e[e.PROVISIONING=3]="PROVISIONING",e[e.PROVISIONED=4]="PROVISIONED"}(ii||(ii={}));const ri={0:"NO_ERROR",1:"INVALID_RPC_PACKET",2:"UNKNOWN_RPC_COMMAND",3:"UNABLE_TO_CONNECT",254:"TIMEOUT",255:"UNKNOWN_ERROR"};class oi extends Error{constructor(){super("Port is not ready")}}const si=e=>"["+e.map((e=>((e,t=2)=>{let i=e.toString(16).toUpperCase();return i.startsWith("-")?"-0x"+i.substring(1).padStart(t,"0"):"0x"+i.padStart(t,"0")})(e))).join(", ")+"]";class ai extends EventTarget{constructor(e,t){if(super(),this.port=e,this.logger=t,this.error=0,null===e.readable)throw new Error("Port is not readable");if(null===e.writable)throw new Error("Port is not writable")}async initialize(e=1e3){var t;if(this.logger.log("Initializing Improv Serial"),this._processInput(),await(t=1e3,new Promise((e=>setTimeout(e,t)))),void 0===this._reader)throw new oi;try{await new Promise((async(t,i)=>{setTimeout((()=>i(new Error("Improv Wi-Fi Serial not detected"))),e),await this.requestCurrentState(),t(void 0)})),await this.requestInfo()}catch(e){throw await this.close(),e}return this.info}async close(){this._reader&&await new Promise((e=>{this._reader.cancel(),this.addEventListener("disconnect",e,{once:!0})}))}async requestCurrentState(){let e;try{await new Promise((async(t,i)=>{this.addEventListener("state-changed",t,{once:!0});e=this._sendRPCWithResponse(2,[]),e.catch((e=>{this.removeEventListener("state-changed",t),i(e)}))}))}catch(e){throw this._rpcFeedback=void 0,new Error(`Error fetching current state: ${e}`)}if(this.state!==ii.PROVISIONED)return void(this._rpcFeedback=void 0);const t=await e;this.nextUrl=t[0]}async requestInfo(e){const t=await this._sendRPCWithResponse(3,[],e);this.info={firmware:t[0],version:t[1],name:t[3],chipFamily:t[2]}}async provision(e,t,i){const r=new TextEncoder,o=r.encode(e),s=r.encode(t),a=[o.length,...o,s.length,...s],n=await this._sendRPCWithResponse(1,a,i);this.nextUrl=n[0]}async scan(){const e=(await this._sendRPCWithMultipleResponses(4,[])).map((([e,t,i])=>({name:e,rssi:parseInt(t),secured:"YES"===i})));return e.sort(((e,t)=>e.name.toLocaleLowerCase().localeCompare(t.name.toLocaleLowerCase()))),e}_sendRPC(e,t){this.writePacketToStream(ti.RPC,[e,t.length,...t])}async _sendRPCWithResponse(e,t,i){if(this._rpcFeedback)throw new Error("Only 1 RPC command that requires feedback can be active");return await this._awaitRPCResultWithTimeout(new Promise(((i,r)=>{this._rpcFeedback={command:e,resolve:i,reject:r},this._sendRPC(e,t)})),i)}async _sendRPCWithMultipleResponses(e,t,i){if(this._rpcFeedback)throw new Error("Only 1 RPC command that requires feedback can be active");return await this._awaitRPCResultWithTimeout(new Promise(((i,r)=>{this._rpcFeedback={command:e,resolve:i,reject:r,receivedData:[]},this._sendRPC(e,t)})),i)}async _awaitRPCResultWithTimeout(e,t){return t?await new Promise(((i,r)=>{const o=setTimeout((()=>this._setError(254)),t);e.finally((()=>clearTimeout(o))),e.then(i,r)})):await e}async _processInput(){this.logger.debug("Starting read loop"),this._reader=this.port.readable.getReader();try{let e,t=[],i=0;for(;;){const{value:r,done:o}=await this._reader.read();if(o)break;if(r&&0!==r.length)for(const o of r){if(!1===e){10===o&&(e=void 0);continue}if(!0===e){t.push(o),t.length===i&&(this._handleIncomingPacket(t),e=void 0,t=[]);continue}if(10===o){t=[];continue}if(t.push(o),9!==t.length)continue;if(e="IMPROV"===String.fromCharCode(...t.slice(0,6)),!e){t=[];continue}i=9+t[8]+1}}}catch(e){this.logger.error("Error while reading serial port",e)}finally{this._reader.releaseLock(),this._reader=void 0}this.logger.debug("Finished read loop"),this.dispatchEvent(new Event("disconnect"))}_handleIncomingPacket(e){const t=e.slice(6),i=t[0],r=t[1],o=t[2],s=t.slice(3,3+o);if(this.logger.debug("PROCESS",{version:i,packetType:r,packetLength:o,data:si(s)}),1!==i)return void this.logger.error("Received unsupported version",i);let a=t[3+o],n=0;for(let t=0;t0?this._rpcFeedback.receivedData.push(t):(this._rpcFeedback.resolve(this._rpcFeedback.receivedData),this._rpcFeedback=void 0):(this._rpcFeedback.resolve(t),this._rpcFeedback=void 0)}else this.logger.error("Unable to handle packet",t);else this.logger.error(`Received invalid checksum ${a}. Expected ${n}`)}async writePacketToStream(e,t){const i=new Uint8Array([...ei,e,t.length,...t,0,0]);i[i.length-2]=255&i.reduce(((e,t)=>e+t),0),i[i.length-1]=10,this.logger.debug("Writing to stream:",si(new Array(...i)));const r=this.port.writable.getWriter();await r.write(i);try{r.releaseLock()}catch(e){console.error("Ignoring release lock error",e)}}_setError(e){this.error=e,e>0&&this._rpcFeedback&&(this._rpcFeedback.reject(ri[e]||`UNKNOWN_ERROR (${e})`),this._rpcFeedback=void 0),this.dispatchEvent(new CustomEvent("error-changed",{detail:this.error}))}}class ni extends Error{}function li(e){let t=e.length;for(;--t>=0;)e[t]=0}const di=256,ci=286,hi=30,pi=15,fi=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),ui=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),mi=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),vi=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),gi=new Array(576);li(gi);const yi=new Array(60);li(yi);const bi=new Array(512);li(bi);const _i=new Array(256);li(_i);const xi=new Array(29);li(xi);const wi=new Array(hi);function Ei(e,t,i,r,o){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=r,this.max_length=o,this.has_stree=e&&e.length}let ki,Ai,Si;function Ri(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}li(wi);const Ti=e=>e<256?bi[e]:bi[256+(e>>>7)],Ii=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Ci=(e,t,i)=>{e.bi_valid>16-i?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=i-16):(e.bi_buf|=t<{Ci(e,i[2*t],i[2*t+1])},$i=(e,t)=>{let i=0;do{i|=1&e,e>>>=1,i<<=1}while(--t>0);return i>>>1},Li=(e,t,i)=>{const r=new Array(16);let o,s,a=0;for(o=1;o<=pi;o++)a=a+i[o-1]<<1,r[o]=a;for(s=0;s<=t;s++){let t=e[2*s+1];0!==t&&(e[2*s]=$i(r[t]++,t))}},Oi=e=>{let t;for(t=0;t{e.bi_valid>8?Ii(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Ui=(e,t,i,r)=>{const o=2*t,s=2*i;return e[o]{const r=e.heap[i];let o=i<<1;for(;o<=e.heap_len&&(o{let r,o,s,a,n=0;if(0!==e.sym_next)do{r=255&e.pending_buf[e.sym_buf+n++],r+=(255&e.pending_buf[e.sym_buf+n++])<<8,o=e.pending_buf[e.sym_buf+n++],0===r?Bi(e,o,t):(s=_i[o],Bi(e,s+di+1,t),a=fi[s],0!==a&&(o-=xi[s],Ci(e,o,a)),r--,s=Ti(r),Bi(e,s,i),a=ui[s],0!==a&&(r-=wi[s],Ci(e,r,a)))}while(n{const i=t.dyn_tree,r=t.stat_desc.static_tree,o=t.stat_desc.has_stree,s=t.stat_desc.elems;let a,n,l,d=-1;for(e.heap_len=0,e.heap_max=573,a=0;a>1;a>=1;a--)Di(e,i,a);l=s;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Di(e,i,1),n=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=n,i[2*l]=i[2*a]+i[2*n],e.depth[l]=(e.depth[a]>=e.depth[n]?e.depth[a]:e.depth[n])+1,i[2*a+1]=i[2*n+1]=l,e.heap[1]=l++,Di(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const i=t.dyn_tree,r=t.max_code,o=t.stat_desc.static_tree,s=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,n=t.stat_desc.extra_base,l=t.stat_desc.max_length;let d,c,h,p,f,u,m=0;for(p=0;p<=pi;p++)e.bl_count[p]=0;for(i[2*e.heap[e.heap_max]+1]=0,d=e.heap_max+1;d<573;d++)c=e.heap[d],p=i[2*i[2*c+1]+1]+1,p>l&&(p=l,m++),i[2*c+1]=p,c>r||(e.bl_count[p]++,f=0,c>=n&&(f=a[c-n]),u=i[2*c],e.opt_len+=u*(p+f),s&&(e.static_len+=u*(o[2*c+1]+f)));if(0!==m){do{for(p=l-1;0===e.bl_count[p];)p--;e.bl_count[p]--,e.bl_count[p+1]+=2,e.bl_count[l]--,m-=2}while(m>0);for(p=l;0!==p;p--)for(c=e.bl_count[p];0!==c;)h=e.heap[--d],h>r||(i[2*h+1]!==p&&(e.opt_len+=(p-i[2*h+1])*i[2*h],i[2*h+1]=p),c--)}})(e,t),Li(i,d,e.bl_count)},Mi=(e,t,i)=>{let r,o,s=-1,a=t[1],n=0,l=7,d=4;for(0===a&&(l=138,d=3),t[2*(i+1)+1]=65535,r=0;r<=i;r++)o=a,a=t[2*(r+1)+1],++n{let r,o,s=-1,a=t[1],n=0,l=7,d=4;for(0===a&&(l=138,d=3),r=0;r<=i;r++)if(o=a,a=t[2*(r+1)+1],!(++n{Ci(e,0+(r?1:0),3),zi(e),Ii(e,i),Ii(e,~i),i&&e.pending_buf.set(e.window.subarray(t,t+i),e.pending),e.pending+=i};var Wi=e=>{Hi||((()=>{let e,t,i,r,o;const s=new Array(16);for(i=0,r=0;r<28;r++)for(xi[r]=i,e=0;e<1<>=7;r{let o,s,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,i=4093624447;for(t=0;t<=31;t++,i>>>=1)if(1&i&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t{let t;for(Mi(e,e.dyn_ltree,e.l_desc.max_code),Mi(e,e.dyn_dtree,e.d_desc.max_code),Fi(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*vi[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),o=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=o&&(o=s)):o=s=i+5,i+4<=o&&-1!==t?qi(e,t,i,r):4===e.strategy||s===o?(Ci(e,2+(r?1:0),3),Pi(e,gi,yi)):(Ci(e,4+(r?1:0),3),((e,t,i,r)=>{let o;for(Ci(e,t-257,5),Ci(e,i-1,5),Ci(e,r-4,4),o=0;o(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=i,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(_i[i]+di+1)]++,e.dyn_dtree[2*Ti(t)]++),e.sym_next===e.sym_end),Gi=e=>{Ci(e,2,3),Bi(e,256,gi),(e=>{16===e.bi_valid?(Ii(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)},ji={_tr_init:Wi,_tr_stored_block:qi,_tr_flush_block:Zi,_tr_tally:Vi,_tr_align:Gi};var Ki=(e,t,i,r)=>{let o=65535&e|0,s=e>>>16&65535|0,a=0;for(;0!==i;){a=i>2e3?2e3:i,i-=a;do{o=o+t[r++]|0,s=s+o|0}while(--a);o%=65521,s%=65521}return o|s<<16|0};const Yi=new Uint32Array((()=>{let e,t=[];for(var i=0;i<256;i++){e=i;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t})());var Xi=(e,t,i,r)=>{const o=Yi,s=r+i;e^=-1;for(let i=r;i>>8^o[255&(e^t[i])];return-1^e},Ji={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Qi={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:er,_tr_stored_block:tr,_tr_flush_block:ir,_tr_tally:rr,_tr_align:or}=ji,{Z_NO_FLUSH:sr,Z_PARTIAL_FLUSH:ar,Z_FULL_FLUSH:nr,Z_FINISH:lr,Z_BLOCK:dr,Z_OK:cr,Z_STREAM_END:hr,Z_STREAM_ERROR:pr,Z_DATA_ERROR:fr,Z_BUF_ERROR:ur,Z_DEFAULT_COMPRESSION:mr,Z_FILTERED:vr,Z_HUFFMAN_ONLY:gr,Z_RLE:yr,Z_FIXED:br,Z_DEFAULT_STRATEGY:_r,Z_UNKNOWN:xr,Z_DEFLATED:wr}=Qi,Er=258,kr=262,Ar=42,Sr=113,Rr=666,Tr=(e,t)=>(e.msg=Ji[t],t),Ir=e=>2*e-(e>4?9:0),Cr=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Br=e=>{let t,i,r,o=e.w_size;t=e.hash_size,r=t;do{i=e.head[--r],e.head[r]=i>=o?i-o:0}while(--t);t=o,r=t;do{i=e.prev[--r],e.prev[r]=i>=o?i-o:0}while(--t)};let $r=(e,t,i)=>(t<{const t=e.state;let i=t.pending;i>e.avail_out&&(i=e.avail_out),0!==i&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+i),e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending&&(t.pending_out=0))},Or=(e,t)=>{ir(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Lr(e.strm)},zr=(e,t)=>{e.pending_buf[e.pending++]=t},Ur=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Dr=(e,t,i,r)=>{let o=e.avail_in;return o>r&&(o=r),0===o?0:(e.avail_in-=o,t.set(e.input.subarray(e.next_in,e.next_in+o),i),1===e.state.wrap?e.adler=Ki(e.adler,t,o,i):2===e.state.wrap&&(e.adler=Xi(e.adler,t,o,i)),e.next_in+=o,e.total_in+=o,o)},Pr=(e,t)=>{let i,r,o=e.max_chain_length,s=e.strstart,a=e.prev_length,n=e.nice_match;const l=e.strstart>e.w_size-kr?e.strstart-(e.w_size-kr):0,d=e.window,c=e.w_mask,h=e.prev,p=e.strstart+Er;let f=d[s+a-1],u=d[s+a];e.prev_length>=e.good_match&&(o>>=2),n>e.lookahead&&(n=e.lookahead);do{if(i=t,d[i+a]===u&&d[i+a-1]===f&&d[i]===d[s]&&d[++i]===d[s+1]){s+=2,i++;do{}while(d[++s]===d[++i]&&d[++s]===d[++i]&&d[++s]===d[++i]&&d[++s]===d[++i]&&d[++s]===d[++i]&&d[++s]===d[++i]&&d[++s]===d[++i]&&d[++s]===d[++i]&&sa){if(e.match_start=t,a=r,r>=n)break;f=d[s+a-1],u=d[s+a]}}}while((t=h[t&c])>l&&0!=--o);return a<=e.lookahead?a:e.lookahead},Fr=e=>{const t=e.w_size;let i,r,o;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-kr)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Br(e),r+=t),0===e.strm.avail_in)break;if(i=Dr(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=i,e.lookahead+e.insert>=3)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=$r(e,e.ins_h,e.window[o+1]);e.insert&&(e.ins_h=$r(e,e.ins_h,e.window[o+3-1]),e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead{let i,r,o,s=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,a=0,n=e.strm.avail_in;do{if(i=65535,o=e.bi_valid+42>>3,e.strm.avail_outr+e.strm.avail_in&&(i=r+e.strm.avail_in),i>o&&(i=o),i>8,e.pending_buf[e.pending-2]=~i,e.pending_buf[e.pending-1]=~i>>8,Lr(e.strm),r&&(r>i&&(r=i),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,i-=r),i&&(Dr(e.strm,e.strm.output,e.strm.next_out,i),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i)}while(0===a);return n-=e.strm.avail_in,n&&(n>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=n&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-n,e.strm.next_in),e.strstart),e.strstart+=n,e.insert+=n>e.w_size-e.insert?e.w_size-e.insert:n),e.block_start=e.strstart),e.high_watero&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(Dr(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,s=o>e.w_size?e.w_size:o,r=e.strstart-e.block_start,(r>=s||(r||t===lr)&&t!==sr&&0===e.strm.avail_in&&r<=o)&&(i=r>o?o:r,a=t===lr&&0===e.strm.avail_in&&i===r?1:0,tr(e,e.block_start,i,a),e.block_start+=i,Lr(e.strm)),a?3:1)},Nr=(e,t)=>{let i,r;for(;;){if(e.lookahead=3&&(e.ins_h=$r(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==i&&e.strstart-i<=e.w_size-kr&&(e.match_length=Pr(e,i)),e.match_length>=3)if(r=rr(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=$r(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=$r(e,e.ins_h,e.window[e.strstart+1]);else r=rr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Or(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===lr?(Or(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Or(e,!1),0===e.strm.avail_out)?1:2},Hr=(e,t)=>{let i,r,o;for(;;){if(e.lookahead=3&&(e.ins_h=$r(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==i&&e.prev_length4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-3,r=rr(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=o&&(e.ins_h=$r(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(Or(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=rr(e,0,e.window[e.strstart-1]),r&&Or(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=rr(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===lr?(Or(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Or(e,!1),0===e.strm.avail_out)?1:2};function qr(e,t,i,r,o){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=r,this.func=o}const Wr=[new qr(0,0,0,0,Mr),new qr(4,4,8,4,Nr),new qr(4,5,16,8,Nr),new qr(4,6,32,32,Nr),new qr(4,4,16,16,Hr),new qr(8,16,32,32,Hr),new qr(8,16,128,128,Hr),new qr(8,32,128,256,Hr),new qr(32,128,258,1024,Hr),new qr(32,258,258,4096,Hr)];function Zr(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=wr,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Cr(this.dyn_ltree),Cr(this.dyn_dtree),Cr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Cr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Cr(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Vr=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Ar&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==Sr&&t.status!==Rr?1:0},Gr=e=>{if(Vr(e))return Tr(e,pr);e.total_in=e.total_out=0,e.data_type=xr;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?Ar:Sr,e.adler=2===t.wrap?0:1,t.last_flush=-2,er(t),cr},jr=e=>{const t=Gr(e);return t===cr&&(e=>{e.window_size=2*e.w_size,Cr(e.head),e.max_lazy_match=Wr[e.level].max_lazy,e.good_match=Wr[e.level].good_length,e.nice_match=Wr[e.level].nice_length,e.max_chain_length=Wr[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0})(e.state),t},Kr=(e,t,i,r,o,s)=>{if(!e)return pr;let a=1;if(t===mr&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),o<1||o>9||i!==wr||r<8||r>15||t<0||t>9||s<0||s>br||8===r&&1!==a)return Tr(e,pr);8===r&&(r=9);const n=new Zr;return e.state=n,n.strm=e,n.status=Ar,n.wrap=a,n.gzhead=null,n.w_bits=r,n.w_size=1<{if(Vr(e)||t>dr||t<0)return e?Tr(e,pr):pr;const i=e.state;if(!e.output||0!==e.avail_in&&!e.input||i.status===Rr&&t!==lr)return Tr(e,0===e.avail_out?ur:pr);const r=i.last_flush;if(i.last_flush=t,0!==i.pending){if(Lr(e),0===e.avail_out)return i.last_flush=-1,cr}else if(0===e.avail_in&&Ir(t)<=Ir(r)&&t!==lr)return Tr(e,ur);if(i.status===Rr&&0!==e.avail_in)return Tr(e,ur);if(i.status===Ar&&0===i.wrap&&(i.status=Sr),i.status===Ar){let t=wr+(i.w_bits-8<<4)<<8,r=-1;if(r=i.strategy>=gr||i.level<2?0:i.level<6?1:6===i.level?2:3,t|=r<<6,0!==i.strstart&&(t|=32),t+=31-t%31,Ur(i,t),0!==i.strstart&&(Ur(i,e.adler>>>16),Ur(i,65535&e.adler)),e.adler=1,i.status=Sr,Lr(e),0!==i.pending)return i.last_flush=-1,cr}if(57===i.status)if(e.adler=0,zr(i,31),zr(i,139),zr(i,8),i.gzhead)zr(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),zr(i,255&i.gzhead.time),zr(i,i.gzhead.time>>8&255),zr(i,i.gzhead.time>>16&255),zr(i,i.gzhead.time>>24&255),zr(i,9===i.level?2:i.strategy>=gr||i.level<2?4:0),zr(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(zr(i,255&i.gzhead.extra.length),zr(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=Xi(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69;else if(zr(i,0),zr(i,0),zr(i,0),zr(i,0),zr(i,0),zr(i,9===i.level?2:i.strategy>=gr||i.level<2?4:0),zr(i,3),i.status=Sr,Lr(e),0!==i.pending)return i.last_flush=-1,cr;if(69===i.status){if(i.gzhead.extra){let t=i.pending,r=(65535&i.gzhead.extra.length)-i.gzindex;for(;i.pending+r>i.pending_buf_size;){let o=i.pending_buf_size-i.pending;if(i.pending_buf.set(i.gzhead.extra.subarray(i.gzindex,i.gzindex+o),i.pending),i.pending=i.pending_buf_size,i.gzhead.hcrc&&i.pending>t&&(e.adler=Xi(e.adler,i.pending_buf,i.pending-t,t)),i.gzindex+=o,Lr(e),0!==i.pending)return i.last_flush=-1,cr;t=0,r-=o}let o=new Uint8Array(i.gzhead.extra);i.pending_buf.set(o.subarray(i.gzindex,i.gzindex+r),i.pending),i.pending+=r,i.gzhead.hcrc&&i.pending>t&&(e.adler=Xi(e.adler,i.pending_buf,i.pending-t,t)),i.gzindex=0}i.status=73}if(73===i.status){if(i.gzhead.name){let t,r=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>r&&(e.adler=Xi(e.adler,i.pending_buf,i.pending-r,r)),Lr(e),0!==i.pending)return i.last_flush=-1,cr;r=0}t=i.gzindexr&&(e.adler=Xi(e.adler,i.pending_buf,i.pending-r,r)),i.gzindex=0}i.status=91}if(91===i.status){if(i.gzhead.comment){let t,r=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>r&&(e.adler=Xi(e.adler,i.pending_buf,i.pending-r,r)),Lr(e),0!==i.pending)return i.last_flush=-1,cr;r=0}t=i.gzindexr&&(e.adler=Xi(e.adler,i.pending_buf,i.pending-r,r))}i.status=103}if(103===i.status){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size&&(Lr(e),0!==i.pending))return i.last_flush=-1,cr;zr(i,255&e.adler),zr(i,e.adler>>8&255),e.adler=0}if(i.status=Sr,Lr(e),0!==i.pending)return i.last_flush=-1,cr}if(0!==e.avail_in||0!==i.lookahead||t!==sr&&i.status!==Rr){let r=0===i.level?Mr(i,t):i.strategy===gr?((e,t)=>{let i;for(;;){if(0===e.lookahead&&(Fr(e),0===e.lookahead)){if(t===sr)return 1;break}if(e.match_length=0,i=rr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(Or(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===lr?(Or(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Or(e,!1),0===e.strm.avail_out)?1:2})(i,t):i.strategy===yr?((e,t)=>{let i,r,o,s;const a=e.window;for(;;){if(e.lookahead<=Er){if(Fr(e),e.lookahead<=Er&&t===sr)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(o=e.strstart-1,r=a[o],r===a[++o]&&r===a[++o]&&r===a[++o])){s=e.strstart+Er;do{}while(r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&oe.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(i=rr(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=rr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(Or(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===lr?(Or(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Or(e,!1),0===e.strm.avail_out)?1:2})(i,t):Wr[i.level].func(i,t);if(3!==r&&4!==r||(i.status=Rr),1===r||3===r)return 0===e.avail_out&&(i.last_flush=-1),cr;if(2===r&&(t===ar?or(i):t!==dr&&(tr(i,0,0,!1),t===nr&&(Cr(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),Lr(e),0===e.avail_out))return i.last_flush=-1,cr}return t!==lr?cr:i.wrap<=0?hr:(2===i.wrap?(zr(i,255&e.adler),zr(i,e.adler>>8&255),zr(i,e.adler>>16&255),zr(i,e.adler>>24&255),zr(i,255&e.total_in),zr(i,e.total_in>>8&255),zr(i,e.total_in>>16&255),zr(i,e.total_in>>24&255)):(Ur(i,e.adler>>>16),Ur(i,65535&e.adler)),Lr(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?cr:hr)},Xr=(e,t)=>{let i=t.length;if(Vr(e))return pr;const r=e.state,o=r.wrap;if(2===o||1===o&&r.status!==Ar||r.lookahead)return pr;if(1===o&&(e.adler=Ki(e.adler,t,i,0)),r.wrap=0,i>=r.w_size){0===o&&(Cr(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(i-r.w_size,i),0),t=e,i=r.w_size}const s=e.avail_in,a=e.next_in,n=e.input;for(e.avail_in=i,e.next_in=0,e.input=t,Fr(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=$r(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,Fr(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=a,e.input=n,e.avail_in=s,r.wrap=o,cr},Jr={deflateInit:(e,t)=>Kr(e,t,wr,15,8,_r),deflateInit2:Kr,deflateReset:jr,deflateResetKeep:Gr,deflateSetHeader:(e,t)=>Vr(e)||2!==e.state.wrap?pr:(e.state.gzhead=t,cr),deflate:Yr,deflateEnd:e=>{if(Vr(e))return pr;const t=e.state.status;return e.state=null,t===Sr?Tr(e,fr):cr},deflateSetDictionary:Xr,deflateInfo:"pako deflate (from Nodeca project)"};const Qr=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var eo={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const t in i)Qr(i,t)&&(e[t]=i[t])}}return e},flattenChunks:e=>{let t=0;for(let i=0,r=e.length;i=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;io[254]=io[254]=1;var ro={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,i,r,o,s,a=e.length,n=0;for(o=0;o>>6,t[s++]=128|63&i):i<65536?(t[s++]=224|i>>>12,t[s++]=128|i>>>6&63,t[s++]=128|63&i):(t[s++]=240|i>>>18,t[s++]=128|i>>>12&63,t[s++]=128|i>>>6&63,t[s++]=128|63&i);return t},buf2string:(e,t)=>{const i=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let r,o;const s=new Array(2*i);for(o=0,r=0;r4)s[o++]=65533,r+=a-1;else{for(t&=2===a?31:3===a?15:7;a>1&&r1?s[o++]=65533:t<65536?s[o++]=t:(t-=65536,s[o++]=55296|t>>10&1023,s[o++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&to)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let i="";for(let r=0;r{(t=t||e.length)>e.length&&(t=e.length);let i=t-1;for(;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+io[e[i]]>t?i:t}};var oo=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const so=Object.prototype.toString,{Z_NO_FLUSH:ao,Z_SYNC_FLUSH:no,Z_FULL_FLUSH:lo,Z_FINISH:co,Z_OK:ho,Z_STREAM_END:po,Z_DEFAULT_COMPRESSION:fo,Z_DEFAULT_STRATEGY:uo,Z_DEFLATED:mo}=Qi;function vo(e){this.options=eo.assign({level:fo,method:mo,chunkSize:16384,windowBits:15,memLevel:8,strategy:uo},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new oo,this.strm.avail_out=0;let i=Jr.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==ho)throw new Error(Ji[i]);if(t.header&&Jr.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?ro.string2buf(t.dictionary):"[object ArrayBuffer]"===so.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,i=Jr.deflateSetDictionary(this.strm,e),i!==ho)throw new Error(Ji[i]);this._dict_set=!0}}function go(e,t){const i=new vo(t);if(i.push(e,!0),i.err)throw i.msg||Ji[i.err];return i.result}vo.prototype.push=function(e,t){const i=this.strm,r=this.options.chunkSize;let o,s;if(this.ended)return!1;for(s=t===~~t?t:!0===t?co:ao,"string"==typeof e?i.input=ro.string2buf(e):"[object ArrayBuffer]"===so.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),(s===no||s===lo)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if(o=Jr.deflate(i,s),o===po)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),o=Jr.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===ho;if(0!==i.avail_out){if(s>0&&i.next_out>0)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},vo.prototype.onData=function(e){this.chunks.push(e)},vo.prototype.onEnd=function(e){e===ho&&(this.result=eo.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var yo={Deflate:vo,deflate:go,deflateRaw:function(e,t){return(t=t||{}).raw=!0,go(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,go(e,t)},constants:Qi};const bo=16209;var _o=function(e,t){let i,r,o,s,a,n,l,d,c,h,p,f,u,m,v,g,y,b,_,x,w,E,k,A;const S=e.state;i=e.next_in,k=e.input,r=i+(e.avail_in-5),o=e.next_out,A=e.output,s=o-(t-e.avail_out),a=o+(e.avail_out-257),n=S.dmax,l=S.wsize,d=S.whave,c=S.wnext,h=S.window,p=S.hold,f=S.bits,u=S.lencode,m=S.distcode,v=(1<>>24,p>>>=b,f-=b,b=y>>>16&255,0===b)A[o++]=65535&y;else{if(!(16&b)){if(0==(64&b)){y=u[(65535&y)+(p&(1<>>=b,f-=b),f<15&&(p+=k[i++]<>>24,p>>>=b,f-=b,b=y>>>16&255,!(16&b)){if(0==(64&b)){y=m[(65535&y)+(p&(1<n){e.msg="invalid distance too far back",S.mode=bo;break e}if(p>>>=b,f-=b,b=o-s,x>b){if(b=x-b,b>d&&S.sane){e.msg="invalid distance too far back",S.mode=bo;break e}if(w=0,E=h,0===c){if(w+=l-b,b<_){_-=b;do{A[o++]=h[w++]}while(--b);w=o-x,E=A}}else if(c2;)A[o++]=E[w++],A[o++]=E[w++],A[o++]=E[w++],_-=3;_&&(A[o++]=E[w++],_>1&&(A[o++]=E[w++]))}else{w=o-x;do{A[o++]=A[w++],A[o++]=A[w++],A[o++]=A[w++],_-=3}while(_>2);_&&(A[o++]=A[w++],_>1&&(A[o++]=A[w++]))}break}}break}}while(i>3,i-=_,f-=_<<3,p&=(1<{const l=n.bits;let d,c,h,p,f,u,m=0,v=0,g=0,y=0,b=0,_=0,x=0,w=0,E=0,k=0,A=null;const S=new Uint16Array(16),R=new Uint16Array(16);let T,I,C,B=null;for(m=0;m<=xo;m++)S[m]=0;for(v=0;v=1&&0===S[y];y--);if(b>y&&(b=y),0===y)return o[s++]=20971520,o[s++]=20971520,n.bits=1,0;for(g=1;g0&&(0===e||1!==y))return-1;for(R[1]=0,m=1;m852||2===e&&E>592)return 1;for(;;){T=m-x,a[v]+1=u?(I=B[a[v]-u],C=A[a[v]-u]):(I=96,C=0),d=1<>x)+c]=T<<24|I<<16|C|0}while(0!==c);for(d=1<>=1;if(0!==d?(k&=d-1,k+=d):k=0,v++,0==--S[m]){if(m===y)break;m=t[i+a[v]]}if(m>b&&(k&p)!==h){for(0===x&&(x=b),f+=g,_=m-x,w=1<<_;_+x852||2===e&&E>592)return 1;h=k&p,o[h]=b<<24|_<<16|f-s|0}}return 0!==k&&(o[f+k]=m-x<<24|64<<16|0),n.bits=b,0};const{Z_FINISH:Ro,Z_BLOCK:To,Z_TREES:Io,Z_OK:Co,Z_STREAM_END:Bo,Z_NEED_DICT:$o,Z_STREAM_ERROR:Lo,Z_DATA_ERROR:Oo,Z_MEM_ERROR:zo,Z_BUF_ERROR:Uo,Z_DEFLATED:Do}=Qi,Po=16180,Fo=16190,Mo=16191,No=16192,Ho=16194,qo=16199,Wo=16200,Zo=16206,Vo=16209,Go=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function jo(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Ko=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode16211?1:0},Yo=e=>{if(Ko(e))return Lo;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Po,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Co},Xo=e=>{if(Ko(e))return Lo;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Yo(e)},Jo=(e,t)=>{let i;if(Ko(e))return Lo;const r=e.state;return t<0?(i=0,t=-t):(i=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Lo:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=i,r.wbits=t,Xo(e))},Qo=(e,t)=>{if(!e)return Lo;const i=new jo;e.state=i,i.strm=e,i.window=null,i.mode=Po;const r=Jo(e,t);return r!==Co&&(e.state=null),r};let es,ts,is=!0;const rs=e=>{if(is){es=new Int32Array(512),ts=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(So(1,e.lens,0,288,es,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;So(2,e.lens,0,32,ts,0,e.work,{bits:5}),is=!1}e.lencode=es,e.lenbits=9,e.distcode=ts,e.distbits=5},os=(e,t,i,r)=>{let o;const s=e.state;return null===s.window&&(s.wsize=1<=s.wsize?(s.window.set(t.subarray(i-s.wsize,i),0),s.wnext=0,s.whave=s.wsize):(o=s.wsize-s.wnext,o>r&&(o=r),s.window.set(t.subarray(i-r,i-r+o),s.wnext),(r-=o)?(s.window.set(t.subarray(i-r,i),0),s.wnext=r,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave{let i,r,o,s,a,n,l,d,c,h,p,f,u,m,v,g,y,b,_,x,w,E,k=0;const A=new Uint8Array(4);let S,R;const T=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ko(e)||!e.output||!e.input&&0!==e.avail_in)return Lo;i=e.state,i.mode===Mo&&(i.mode=No),a=e.next_out,o=e.output,l=e.avail_out,s=e.next_in,r=e.input,n=e.avail_in,d=i.hold,c=i.bits,h=n,p=l,E=Co;e:for(;;)switch(i.mode){case Po:if(0===i.wrap){i.mode=No;break}for(;c<16;){if(0===n)break e;n--,d+=r[s++]<>>8&255,i.check=Xi(i.check,A,2,0),d=0,c=0,i.mode=16181;break}if(i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&d)<<8)+(d>>8))%31){e.msg="incorrect header check",i.mode=Vo;break}if((15&d)!==Do){e.msg="unknown compression method",i.mode=Vo;break}if(d>>>=4,c-=4,w=8+(15&d),0===i.wbits&&(i.wbits=w),w>15||w>i.wbits){e.msg="invalid window size",i.mode=Vo;break}i.dmax=1<>8&1),512&i.flags&&4&i.wrap&&(A[0]=255&d,A[1]=d>>>8&255,i.check=Xi(i.check,A,2,0)),d=0,c=0,i.mode=16182;case 16182:for(;c<32;){if(0===n)break e;n--,d+=r[s++]<>>8&255,A[2]=d>>>16&255,A[3]=d>>>24&255,i.check=Xi(i.check,A,4,0)),d=0,c=0,i.mode=16183;case 16183:for(;c<16;){if(0===n)break e;n--,d+=r[s++]<>8),512&i.flags&&4&i.wrap&&(A[0]=255&d,A[1]=d>>>8&255,i.check=Xi(i.check,A,2,0)),d=0,c=0,i.mode=16184;case 16184:if(1024&i.flags){for(;c<16;){if(0===n)break e;n--,d+=r[s++]<>>8&255,i.check=Xi(i.check,A,2,0)),d=0,c=0}else i.head&&(i.head.extra=null);i.mode=16185;case 16185:if(1024&i.flags&&(f=i.length,f>n&&(f=n),f&&(i.head&&(w=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(r.subarray(s,s+f),w)),512&i.flags&&4&i.wrap&&(i.check=Xi(i.check,r,f,s)),n-=f,s+=f,i.length-=f),i.length))break e;i.length=0,i.mode=16186;case 16186:if(2048&i.flags){if(0===n)break e;f=0;do{w=r[s+f++],i.head&&w&&i.length<65536&&(i.head.name+=String.fromCharCode(w))}while(w&&f>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=Mo;break;case 16189:for(;c<32;){if(0===n)break e;n--,d+=r[s++]<>>=7&c,c-=7&c,i.mode=Zo;break}for(;c<3;){if(0===n)break e;n--,d+=r[s++]<>>=1,c-=1,3&d){case 0:i.mode=16193;break;case 1:if(rs(i),i.mode=qo,t===Io){d>>>=2,c-=2;break e}break;case 2:i.mode=16196;break;case 3:e.msg="invalid block type",i.mode=Vo}d>>>=2,c-=2;break;case 16193:for(d>>>=7&c,c-=7&c;c<32;){if(0===n)break e;n--,d+=r[s++]<>>16^65535)){e.msg="invalid stored block lengths",i.mode=Vo;break}if(i.length=65535&d,d=0,c=0,i.mode=Ho,t===Io)break e;case Ho:i.mode=16195;case 16195:if(f=i.length,f){if(f>n&&(f=n),f>l&&(f=l),0===f)break e;o.set(r.subarray(s,s+f),a),n-=f,s+=f,l-=f,a+=f,i.length-=f;break}i.mode=Mo;break;case 16196:for(;c<14;){if(0===n)break e;n--,d+=r[s++]<>>=5,c-=5,i.ndist=1+(31&d),d>>>=5,c-=5,i.ncode=4+(15&d),d>>>=4,c-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=Vo;break}i.have=0,i.mode=16197;case 16197:for(;i.have>>=3,c-=3}for(;i.have<19;)i.lens[T[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,S={bits:i.lenbits},E=So(0,i.lens,0,19,i.lencode,0,i.work,S),i.lenbits=S.bits,E){e.msg="invalid code lengths set",i.mode=Vo;break}i.have=0,i.mode=16198;case 16198:for(;i.have>>24,g=k>>>16&255,y=65535&k,!(v<=c);){if(0===n)break e;n--,d+=r[s++]<>>=v,c-=v,i.lens[i.have++]=y;else{if(16===y){for(R=v+2;c>>=v,c-=v,0===i.have){e.msg="invalid bit length repeat",i.mode=Vo;break}w=i.lens[i.have-1],f=3+(3&d),d>>>=2,c-=2}else if(17===y){for(R=v+3;c>>=v,c-=v,w=0,f=3+(7&d),d>>>=3,c-=3}else{for(R=v+7;c>>=v,c-=v,w=0,f=11+(127&d),d>>>=7,c-=7}if(i.have+f>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=Vo;break}for(;f--;)i.lens[i.have++]=w}}if(i.mode===Vo)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=Vo;break}if(i.lenbits=9,S={bits:i.lenbits},E=So(1,i.lens,0,i.nlen,i.lencode,0,i.work,S),i.lenbits=S.bits,E){e.msg="invalid literal/lengths set",i.mode=Vo;break}if(i.distbits=6,i.distcode=i.distdyn,S={bits:i.distbits},E=So(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,S),i.distbits=S.bits,E){e.msg="invalid distances set",i.mode=Vo;break}if(i.mode=qo,t===Io)break e;case qo:i.mode=Wo;case Wo:if(n>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=s,e.avail_in=n,i.hold=d,i.bits=c,_o(e,p),a=e.next_out,o=e.output,l=e.avail_out,s=e.next_in,r=e.input,n=e.avail_in,d=i.hold,c=i.bits,i.mode===Mo&&(i.back=-1);break}for(i.back=0;k=i.lencode[d&(1<>>24,g=k>>>16&255,y=65535&k,!(v<=c);){if(0===n)break e;n--,d+=r[s++]<>b)],v=k>>>24,g=k>>>16&255,y=65535&k,!(b+v<=c);){if(0===n)break e;n--,d+=r[s++]<>>=b,c-=b,i.back+=b}if(d>>>=v,c-=v,i.back+=v,i.length=y,0===g){i.mode=16205;break}if(32&g){i.back=-1,i.mode=Mo;break}if(64&g){e.msg="invalid literal/length code",i.mode=Vo;break}i.extra=15&g,i.mode=16201;case 16201:if(i.extra){for(R=i.extra;c>>=i.extra,c-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=16202;case 16202:for(;k=i.distcode[d&(1<>>24,g=k>>>16&255,y=65535&k,!(v<=c);){if(0===n)break e;n--,d+=r[s++]<>b)],v=k>>>24,g=k>>>16&255,y=65535&k,!(b+v<=c);){if(0===n)break e;n--,d+=r[s++]<>>=b,c-=b,i.back+=b}if(d>>>=v,c-=v,i.back+=v,64&g){e.msg="invalid distance code",i.mode=Vo;break}i.offset=y,i.extra=15&g,i.mode=16203;case 16203:if(i.extra){for(R=i.extra;c>>=i.extra,c-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=Vo;break}i.mode=16204;case 16204:if(0===l)break e;if(f=p-l,i.offset>f){if(f=i.offset-f,f>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=Vo;break}f>i.wnext?(f-=i.wnext,u=i.wsize-f):u=i.wnext-f,f>i.length&&(f=i.length),m=i.window}else m=o,u=a-i.offset,f=i.length;f>l&&(f=l),l-=f,i.length-=f;do{o[a++]=m[u++]}while(--f);0===i.length&&(i.mode=Wo);break;case 16205:if(0===l)break e;o[a++]=i.length,l--,i.mode=Wo;break;case Zo:if(i.wrap){for(;c<32;){if(0===n)break e;n--,d|=r[s++]<Qo(e,15),inflateInit2:Qo,inflate:ss,inflateEnd:e=>{if(Ko(e))return Lo;let t=e.state;return t.window&&(t.window=null),e.state=null,Co},inflateGetHeader:(e,t)=>{if(Ko(e))return Lo;const i=e.state;return 0==(2&i.wrap)?Lo:(i.head=t,t.done=!1,Co)},inflateSetDictionary:(e,t)=>{const i=t.length;let r,o,s;return Ko(e)?Lo:(r=e.state,0!==r.wrap&&r.mode!==Fo?Lo:r.mode===Fo&&(o=1,o=Ki(o,t,i,0),o!==r.check)?Oo:(s=os(e,t,i,i),s?(r.mode=16210,zo):(r.havedict=1,Co)))},inflateInfo:"pako inflate (from Nodeca project)"};var ns=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const ls=Object.prototype.toString,{Z_NO_FLUSH:ds,Z_FINISH:cs,Z_OK:hs,Z_STREAM_END:ps,Z_NEED_DICT:fs,Z_STREAM_ERROR:us,Z_DATA_ERROR:ms,Z_MEM_ERROR:vs}=Qi;function gs(e){this.options=eo.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new oo,this.strm.avail_out=0;let i=as.inflateInit2(this.strm,t.windowBits);if(i!==hs)throw new Error(Ji[i]);if(this.header=new ns,as.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=ro.string2buf(t.dictionary):"[object ArrayBuffer]"===ls.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=as.inflateSetDictionary(this.strm,t.dictionary),i!==hs)))throw new Error(Ji[i])}function ys(e,t){const i=new gs(t);if(i.push(e),i.err)throw i.msg||Ji[i.err];return i.result}gs.prototype.push=function(e,t){const i=this.strm,r=this.options.chunkSize,o=this.options.dictionary;let s,a,n;if(this.ended)return!1;for(a=t===~~t?t:!0===t?cs:ds,"[object ArrayBuffer]"===ls.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),s=as.inflate(i,a),s===fs&&o&&(s=as.inflateSetDictionary(i,o),s===hs?s=as.inflate(i,a):s===ms&&(s=fs));i.avail_in>0&&s===ps&&i.state.wrap>0&&0!==e[i.next_in];)as.inflateReset(i),s=as.inflate(i,a);switch(s){case us:case ms:case fs:case vs:return this.onEnd(s),this.ended=!0,!1}if(n=i.avail_out,i.next_out&&(0===i.avail_out||s===ps))if("string"===this.options.to){let e=ro.utf8border(i.output,i.next_out),t=i.next_out-e,o=ro.buf2string(i.output,e);i.next_out=t,i.avail_out=r-t,t&&i.output.set(i.output.subarray(e,e+t),0),this.onData(o)}else this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out));if(s!==hs||0!==n){if(s===ps)return s=as.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===i.avail_in)break}}return!0},gs.prototype.onData=function(e){this.chunks.push(e)},gs.prototype.onEnd=function(e){e===hs&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=eo.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var bs={Inflate:gs,inflate:ys,inflateRaw:function(e,t){return(t=t||{}).raw=!0,ys(e,t)},ungzip:ys,constants:Qi};const{Deflate:_s,deflate:xs,deflateRaw:ws,gzip:Es}=yo,{Inflate:ks,inflate:As,inflateRaw:Ss,ungzip:Rs}=bs;var Ts=xs,Is=ks;class Cs{constructor(e,t=!1,i=!0){this.device=e,this.tracing=t,this.slipReaderEnabled=!1,this.leftOver=new Uint8Array(0),this.baudrate=0,this.traceLog="",this.lastTraceTime=Date.now(),this._DTR_state=!1,this.slipReaderEnabled=i}getInfo(){const e=this.device.getInfo();return e.usbVendorId&&e.usbProductId?`WebSerial VendorID 0x${e.usbVendorId.toString(16)} ProductID 0x${e.usbProductId.toString(16)}`:""}getPid(){return this.device.getInfo().usbProductId}trace(e){const t=`${`TRACE ${(Date.now()-this.lastTraceTime).toFixed(3)}`} ${e}`;console.log(t),this.traceLog+=t+"\n"}async returnTrace(){try{await navigator.clipboard.writeText(this.traceLog),console.log("Text copied to clipboard!")}catch(e){console.error("Failed to copy text:",e)}}hexify(e){return Array.from(e).map((e=>e.toString(16).padStart(2,"0"))).join("").padEnd(16," ")}hexConvert(e,t=!0){if(t&&e.length>16){let t="",i=e;for(;i.length>0;){const e=i.slice(0,16),r=String.fromCharCode(...e).split("").map((e=>" "===e||e>=" "&&e<="~"&&" "!==e?e:".")).join("");i=i.slice(16),t+=`\n ${this.hexify(e.slice(0,8))} ${this.hexify(e.slice(8))} | ${r}`}return t}return this.hexify(e)}slipWriter(e){const t=[];t.push(192);for(let i=0;i0)return e;r=this.leftOver,this.leftOver=new Uint8Array(0)}if(null==this.device.readable)return this.leftOver;const o=this.device.readable.getReader();try{e>0&&(i=setTimeout((function(){o.cancel()}),e));do{const{value:e,done:t}=await o.read();if(t)throw this.leftOver=r,new Error("Timeout");r=new Uint8Array(this._appendBuffer(r.buffer,e.buffer))}while(r.length0&&clearTimeout(i),o.releaseLock()}if(this.tracing&&(console.log("Read bytes"),this.trace(`Read ${r.length} bytes: ${this.hexConvert(r)}`)),this.slipReaderEnabled){const e=this.slipReader(r);return this.tracing&&(console.log("Slip reader results"),this.trace(`Read ${e.length} bytes: ${this.hexConvert(e)}`)),e}return r}async rawRead(e=0){if(0!=this.leftOver.length){const e=this.leftOver;return this.leftOver=new Uint8Array(0),e}if(!this.device.readable)return this.leftOver;const t=this.device.readable.getReader();let i;try{e>0&&(i=setTimeout((function(){t.cancel()}),e));const{value:r,done:o}=await t.read();if(o)throw new Error("Timeout");return this.tracing&&(console.log("Raw Read bytes"),this.trace(`Read ${r.length} bytes: ${this.hexConvert(r)}`)),r}finally{e>0&&clearTimeout(i),t.releaseLock()}}async setRTS(e){await this.device.setSignals({requestToSend:e}),await this.setDTR(this._DTR_state)}async setDTR(e){this._DTR_state=e,await this.device.setSignals({dataTerminalReady:e})}async connect(e=115200,t={}){await this.device.open({baudRate:e,dataBits:null==t?void 0:t.dataBits,stopBits:null==t?void 0:t.stopBits,bufferSize:null==t?void 0:t.bufferSize,parity:null==t?void 0:t.parity,flowControl:null==t?void 0:t.flowControl}),this.baudrate=e,this.leftOver=new Uint8Array(0)}async sleep(e){return new Promise((t=>setTimeout(t,e)))}async waitForUnlock(e){for(;this.device.readable&&this.device.readable.locked||this.device.writable&&this.device.writable.locked;)await this.sleep(e)}async disconnect(){await this.waitForUnlock(400),await this.device.close()}}function Bs(e){return new Promise((t=>setTimeout(t,e)))}async function $s(e,t){const i={D:async t=>await e.setDTR(t),R:async t=>await e.setRTS(t),W:async e=>await Bs(e)};try{const e=function(e){const t=["D","R","W"],i=e.split("|");for(const e of i){const i=e[0],r=e.slice(1);if(!t.includes(i))return!1;if("D"===i||"R"===i){if("0"!==r&&"1"!==r)return!1}else if("W"===i){const e=parseInt(r);if(isNaN(e)||e<=0)return!1}}return!0}(t);if(!e)return;const r=t.split("|");for(const e of r){const t=e[0],r=e.slice(1);"W"===t?await i.W(Number(r)):"D"!==t&&"R"!==t||await i[t]("1"===r)}}catch(e){throw new Error("Invalid custom reset sequence")}}for(var Ls={},Os={byteLength:function(e){var t=Ms(e),i=t[0],r=t[1];return 3*(i+r)/4-r},toByteArray:function(e){var t,i,r=Ms(e),o=r[0],s=r[1],a=new Ds(function(e,t,i){return 3*(t+i)/4-i}(0,o,s)),n=0,l=s>0?o-4:o;for(i=0;i>16&255,a[n++]=t>>8&255,a[n++]=255&t;2===s&&(t=Us[e.charCodeAt(i)]<<2|Us[e.charCodeAt(i+1)]>>4,a[n++]=255&t);1===s&&(t=Us[e.charCodeAt(i)]<<10|Us[e.charCodeAt(i+1)]<<4|Us[e.charCodeAt(i+2)]>>2,a[n++]=t>>8&255,a[n++]=255&t);return a},fromByteArray:function(e){for(var t,i=e.length,r=i%3,o=[],s=16383,a=0,n=i-r;an?n:a+s));1===r?(t=e[i-1],o.push(zs[t>>2]+zs[t<<4&63]+"==")):2===r&&(t=(e[i-2]<<8)+e[i-1],o.push(zs[t>>10]+zs[t>>4&63]+zs[t<<2&63]+"="));return o.join("")}},zs=[],Us=[],Ds="undefined"!=typeof Uint8Array?Uint8Array:Array,Ps="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fs=0;Fs<64;++Fs)zs[Fs]=Ps[Fs],Us[Ps.charCodeAt(Fs)]=Fs;function Ms(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function Ns(e,t,i){for(var r,o,s=[],a=t;a>18&63]+zs[o>>12&63]+zs[o>>6&63]+zs[63&o]);return s.join("")}Us["-".charCodeAt(0)]=62,Us["_".charCodeAt(0)]=63;var Hs={};Hs.read=function(e,t,i,r,o){var s,a,n=8*o-r-1,l=(1<>1,c=-7,h=i?o-1:0,p=i?-1:1,f=e[t+h];for(h+=p,s=f&(1<<-c)-1,f>>=-c,c+=n;c>0;s=256*s+e[t+h],h+=p,c-=8);for(a=s&(1<<-c)-1,s>>=-c,c+=r;c>0;a=256*a+e[t+h],h+=p,c-=8);if(0===s)s=1-d;else{if(s===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),s-=d}return(f?-1:1)*a*Math.pow(2,s-r)},Hs.write=function(e,t,i,r,o,s){var a,n,l,d=8*s-o-1,c=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:s-1,u=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(n=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=c?(n=0,a=c):a+h>=1?(n=(t*l-1)*Math.pow(2,o),a+=h):(n=t*Math.pow(2,h-1)*Math.pow(2,o),a=0));o>=8;e[i+f]=255&n,f+=u,n/=256,o-=8);for(a=a<0;e[i+f]=255&a,f+=u,a/=256,d-=8);e[i+f-u]|=128*m},function(e){const t=Os,i=Hs,r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=function(e){+e!=e&&(e=0);return a.alloc(+e)},e.INSPECT_MAX_BYTES=50;const o=2147483647;function s(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,i){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return n(e,t,i)}function n(e,t,i){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const i=0|f(e,t);let r=s(i);const o=r.write(e,t);o!==i&&(r=r.slice(0,o));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(G(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(G(e,ArrayBuffer)||e&&G(e.buffer,ArrayBuffer))return h(e,t,i);if("undefined"!=typeof SharedArrayBuffer&&(G(e,SharedArrayBuffer)||e&&G(e.buffer,SharedArrayBuffer)))return h(e,t,i);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return a.from(r,t,i);const o=function(e){if(a.isBuffer(e)){const t=0|p(e.length),i=s(t);return 0===i.length||e.copy(i,0,0,t),i}if(void 0!==e.length)return"number"!=typeof e.length||j(e.length)?s(0):c(e);if("Buffer"===e.type&&Array.isArray(e.data))return c(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return l(e),s(e<0?0:0|p(e))}function c(e){const t=e.length<0?0:0|p(e.length),i=s(t);for(let r=0;r=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function f(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||G(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const i=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===i)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return Z(e).length;default:if(o)return r?-1:W(e).length;t=(""+t).toLowerCase(),o=!0}}function u(e,t,i){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,i);case"utf8":case"utf-8":return k(this,t,i);case"ascii":return S(this,t,i);case"latin1":case"binary":return R(this,t,i);case"base64":return E(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,i);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,i){const r=e[t];e[t]=e[i],e[i]=r}function v(e,t,i,r,o){if(0===e.length)return-1;if("string"==typeof i?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),j(i=+i)&&(i=o?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(o)return-1;i=e.length-1}else if(i<0){if(!o)return-1;i=0}if("string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:g(e,t,i,r,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):g(e,[t],i,r,o);throw new TypeError("val must be string, number or Buffer")}function g(e,t,i,r,o){let s,a=1,n=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,n/=2,l/=2,i/=2}function d(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let r=-1;for(s=i;sn&&(i=n-l),s=i;s>=0;s--){let i=!0;for(let r=0;ro&&(r=o):r=o;const s=t.length;let a;for(r>s/2&&(r=s/2),a=0;a>8,o=i%256,s.push(o),s.push(r);return s}(t,e.length-i),e,i,r)}function E(e,i,r){return 0===i&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(i,r))}function k(e,t,i){i=Math.min(e.length,i);const r=[];let o=t;for(;o239?4:t>223?3:t>191?2:1;if(o+a<=i){let i,r,n,l;switch(a){case 1:t<128&&(s=t);break;case 2:i=e[o+1],128==(192&i)&&(l=(31&t)<<6|63&i,l>127&&(s=l));break;case 3:i=e[o+1],r=e[o+2],128==(192&i)&&128==(192&r)&&(l=(15&t)<<12|(63&i)<<6|63&r,l>2047&&(l<55296||l>57343)&&(s=l));break;case 4:i=e[o+1],r=e[o+2],n=e[o+3],128==(192&i)&&128==(192&r)&&128==(192&n)&&(l=(15&t)<<18|(63&i)<<12|(63&r)<<6|63&n,l>65535&&l<1114112&&(s=l))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),o+=a}return function(e){const t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);let i="",r=0;for(;rr.length?(a.isBuffer(t)||(t=a.from(t)),t.copy(r,o)):Uint8Array.prototype.set.call(r,t,o);else{if(!a.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,o)}o+=t.length}return r},a.byteLength=f,a.prototype._isBuffer=!0,a.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;ti&&(t+=" ... "),""},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(e,t,i,r,o){if(G(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||i>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=i)return 0;if(r>=o)return-1;if(t>=i)return 1;if(this===e)return 0;let s=(o>>>=0)-(r>>>=0),n=(i>>>=0)-(t>>>=0);const l=Math.min(s,n),d=this.slice(r,o),c=e.slice(t,i);for(let e=0;e>>=0,isFinite(i)?(i>>>=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}const o=this.length-t;if((void 0===i||i>o)&&(i=o),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let s=!1;for(;;)switch(r){case"hex":return y(this,e,t,i);case"utf8":case"utf-8":return b(this,e,t,i);case"ascii":case"latin1":case"binary":return _(this,e,t,i);case"base64":return x(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,i);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const A=4096;function S(e,t,i){let r="";i=Math.min(e.length,i);for(let o=t;or)&&(i=r);let o="";for(let r=t;ri)throw new RangeError("Trying to access beyond buffer length")}function B(e,t,i,r,o,s){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function $(e,t,i,r,o){M(t,r,o,e,i,7);let s=Number(t&BigInt(4294967295));e[i++]=s,s>>=8,e[i++]=s,s>>=8,e[i++]=s,s>>=8,e[i++]=s;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[i++]=a,a>>=8,e[i++]=a,a>>=8,e[i++]=a,a>>=8,e[i++]=a,i}function L(e,t,i,r,o){M(t,r,o,e,i,7);let s=Number(t&BigInt(4294967295));e[i+7]=s,s>>=8,e[i+6]=s,s>>=8,e[i+5]=s,s>>=8,e[i+4]=s;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[i+3]=a,a>>=8,e[i+2]=a,a>>=8,e[i+1]=a,a>>=8,e[i]=a,i+8}function O(e,t,i,r,o,s){if(i+r>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function z(e,t,r,o,s){return t=+t,r>>>=0,s||O(e,0,r,4),i.write(e,t,r,o,23,4),r+4}function U(e,t,r,o,s){return t=+t,r>>>=0,s||O(e,0,r,8),i.write(e,t,r,o,52,8),r+8}a.prototype.slice=function(e,t){const i=this.length;(e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t>>=0,t>>>=0,i||C(e,t,this.length);let r=this[e],o=1,s=0;for(;++s>>=0,t>>>=0,i||C(e,t,this.length);let r=this[e+--t],o=1;for(;t>0&&(o*=256);)r+=this[e+--t]*o;return r},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readBigUInt64LE=Y((function(e){N(e>>>=0,"offset");const t=this[e],i=this[e+7];void 0!==t&&void 0!==i||H(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+i*2**24;return BigInt(r)+(BigInt(o)<>>=0,"offset");const t=this[e],i=this[e+7];void 0!==t&&void 0!==i||H(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+i;return(BigInt(r)<>>=0,t>>>=0,i||C(e,t,this.length);let r=this[e],o=1,s=0;for(;++s=o&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(e,t,i){e>>>=0,t>>>=0,i||C(e,t,this.length);let r=t,o=1,s=this[e+--r];for(;r>0&&(o*=256);)s+=this[e+--r]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*t)),s},a.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},a.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readBigInt64LE=Y((function(e){N(e>>>=0,"offset");const t=this[e],i=this[e+7];void 0!==t&&void 0!==i||H(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(i<<24);return(BigInt(r)<>>=0,"offset");const t=this[e],i=this[e+7];void 0!==t&&void 0!==i||H(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||C(e,4,this.length),i.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,i,r){if(e=+e,t>>>=0,i>>>=0,!r){B(this,e,t,i,Math.pow(2,8*i)-1,0)}let o=1,s=0;for(this[t]=255&e;++s>>=0,i>>>=0,!r){B(this,e,t,i,Math.pow(2,8*i)-1,0)}let o=i-1,s=1;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+i},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,i){return e=+e,t>>>=0,i||B(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,i){return e=+e,t>>>=0,i||B(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,i){return e=+e,t>>>=0,i||B(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,i){return e=+e,t>>>=0,i||B(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,i){return e=+e,t>>>=0,i||B(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigUInt64LE=Y((function(e,t=0){return $(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),a.prototype.writeBigUInt64BE=Y((function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),a.prototype.writeIntLE=function(e,t,i,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*i-1);B(this,e,t,i,r-1,-r)}let o=0,s=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+i},a.prototype.writeIntBE=function(e,t,i,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*i-1);B(this,e,t,i,r-1,-r)}let o=i-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+i},a.prototype.writeInt8=function(e,t,i){return e=+e,t>>>=0,i||B(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,i){return e=+e,t>>>=0,i||B(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,i){return e=+e,t>>>=0,i||B(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,i){return e=+e,t>>>=0,i||B(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,i){return e=+e,t>>>=0,i||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigInt64LE=Y((function(e,t=0){return $(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),a.prototype.writeBigInt64BE=Y((function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),a.prototype.writeFloatLE=function(e,t,i){return z(this,e,t,!0,i)},a.prototype.writeFloatBE=function(e,t,i){return z(this,e,t,!1,i)},a.prototype.writeDoubleLE=function(e,t,i){return U(this,e,t,!0,i)},a.prototype.writeDoubleBE=function(e,t,i){return U(this,e,t,!1,i)},a.prototype.copy=function(e,t,i,r){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(o=t;o=r+4;i-=3)t=`_${e.slice(i-3,i)}${t}`;return`${e.slice(0,i)}${t}`}function M(e,t,i,r,o,s){if(e>i||e3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(s+1)}${r}`:`>= -(2${r} ** ${8*(s+1)-1}${r}) and < 2 ** ${8*(s+1)-1}${r}`:`>= ${t}${r} and <= ${i}${r}`,new D.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,i){N(t,"offset"),void 0!==e[t]&&void 0!==e[t+i]||H(t,e.length-(i+1))}(r,o,s)}function N(e,t){if("number"!=typeof e)throw new D.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,i){if(Math.floor(e)!==e)throw N(e,i),new D.ERR_OUT_OF_RANGE(i||"offset","an integer",e);if(t<0)throw new D.ERR_BUFFER_OUT_OF_BOUNDS;throw new D.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${t}`,e)}P("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),P("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),P("ERR_OUT_OF_RANGE",(function(e,t,i){let r=`The value of "${e}" is out of range.`,o=i;return Number.isInteger(i)&&Math.abs(i)>2**32?o=F(String(i)):"bigint"==typeof i&&(o=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(o=F(o)),o+="n"),r+=` It must be ${t}. Received ${o}`,r}),RangeError);const q=/[^+/0-9A-Za-z-_]/g;function W(e,t){let i;t=t||1/0;const r=e.length;let o=null;const s=[];for(let a=0;a55295&&i<57344){if(!o){if(i>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&s.push(239,191,189);continue}o=i;continue}if(i<56320){(t-=3)>-1&&s.push(239,191,189),o=i;continue}i=65536+(o-55296<<10|i-56320)}else o&&(t-=3)>-1&&s.push(239,191,189);if(o=null,i<128){if((t-=1)<0)break;s.push(i)}else if(i<2048){if((t-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function Z(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,i,r){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+i]=e[o];return o}function G(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function j(e){return e!=e}const K=function(){const e="0123456789abcdef",t=new Array(256);for(let i=0;i<16;++i){const r=16*i;for(let o=0;o<16;++o)t[r+o]=e[i]+e[o]}return t}();function Y(e){return"undefined"==typeof BigInt?X:e}function X(){throw new Error("BigInt not supported")}}(Ls);class qs{constructor(e){this.ESP_RAM_BLOCK=6144,this.ESP_FLASH_BEGIN=2,this.ESP_FLASH_DATA=3,this.ESP_FLASH_END=4,this.ESP_MEM_BEGIN=5,this.ESP_MEM_END=6,this.ESP_MEM_DATA=7,this.ESP_WRITE_REG=9,this.ESP_READ_REG=10,this.ESP_SPI_ATTACH=13,this.ESP_CHANGE_BAUDRATE=15,this.ESP_FLASH_DEFL_BEGIN=16,this.ESP_FLASH_DEFL_DATA=17,this.ESP_FLASH_DEFL_END=18,this.ESP_SPI_FLASH_MD5=19,this.ESP_ERASE_FLASH=208,this.ESP_ERASE_REGION=209,this.ESP_READ_FLASH=210,this.ESP_RUN_USER_CODE=211,this.ESP_IMAGE_MAGIC=233,this.ESP_CHECKSUM_MAGIC=239,this.ROM_INVALID_RECV_MSG=5,this.ERASE_REGION_TIMEOUT_PER_MB=3e4,this.ERASE_WRITE_TIMEOUT_PER_MB=4e4,this.MD5_TIMEOUT_PER_MB=8e3,this.CHIP_ERASE_TIMEOUT=12e4,this.FLASH_READ_TIMEOUT=1e5,this.MAX_TIMEOUT=2*this.CHIP_ERASE_TIMEOUT,this.CHIP_DETECT_MAGIC_REG_ADDR=1073745920,this.DETECTED_FLASH_SIZES={18:"256KB",19:"512KB",20:"1MB",21:"2MB",22:"4MB",23:"8MB",24:"16MB"},this.DETECTED_FLASH_SIZES_NUM={18:256,19:512,20:1024,21:2048,22:4096,23:8192,24:16384},this.USB_JTAG_SERIAL_PID=4097,this.romBaudrate=115200,this.debugLogging=!1,this.checksum=function(e){let t,i=239;for(t=0;tsetTimeout(t,e)))}write(e,t=!0){this.terminal?t?this.terminal.writeLine(e):this.terminal.write(e):console.log(e)}error(e,t=!0){this.write(`Error: ${e}`,t)}info(e,t=!0){this.write(e,t)}debug(e,t=!0){this.debugLogging&&this.write(`Debug: ${e}`,t)}_shortToBytearray(e){return new Uint8Array([255&e,e>>8&255])}_intToByteArray(e){return new Uint8Array([255&e,e>>8&255,e>>16&255,e>>24&255])}_byteArrayToShort(e,t){return e|t>>8}_byteArrayToInt(e,t,i,r){return e|t<<8|i<<16|r<<24}_appendBuffer(e,t){const i=new Uint8Array(e.byteLength+t.byteLength);return i.set(new Uint8Array(e),0),i.set(new Uint8Array(t),e.byteLength),i.buffer}_appendArray(e,t){const i=new Uint8Array(e.length+t.length);return i.set(e,0),i.set(t,e.length),i}ui8ToBstr(e){let t="";for(let i=0;i0&&(s=this._appendArray(s,this._intToByteArray(this.chip.UART_DATE_REG_ADDR)),s=this._appendArray(s,this._intToByteArray(0)),s=this._appendArray(s,this._intToByteArray(0)),s=this._appendArray(s,this._intToByteArray(o))),await this.checkCommand("write target memory",this.ESP_WRITE_REG,s)}async sync(){this.debug("Sync");const e=new Uint8Array(36);let t;for(e[0]=7,e[1]=7,e[2]=18,e[3]=32,t=0;t<32;t++)e[4+t]=85;try{return await this.command(8,e,void 0,void 0,100)}catch(e){throw this.debug("Sync err "+e),e}}async _connectAttempt(e="default_reset",t=!1){if(this.debug("_connect_attempt "+e+" "+t),"no_reset"!==e)if(this.transport.getPid()===this.USB_JTAG_SERIAL_PID)await async function(e){await e.setRTS(!1),await e.setDTR(!1),await Bs(100),await e.setDTR(!0),await e.setRTS(!1),await Bs(100),await e.setRTS(!0),await e.setDTR(!1),await e.setRTS(!0),await Bs(100),await e.setRTS(!1),await e.setDTR(!1)}(this.transport);else{const e=t?"D0|R1|W100|W2000|D1|R0|W50|D0":"D0|R1|W100|D1|R0|W50|D0";await $s(this.transport,e)}let i=0,r=!0;for(;r;){try{i+=(await this.transport.read(1e3)).length}catch(e){if(this.debug(e.message),e instanceof Error){r=!1;break}}await this._sleep(50)}for(this.transport.slipReaderEnabled=!0,i=7;i--;){try{const e=await this.sync();return this.debug(e[0].toString()),"success"}catch(e){e instanceof Error&&(t?this.info("_",!1):this.info(".",!1))}await this._sleep(50)}return"error"}async connect(e="default_reset",t=7,i=!1){let r,o;for(this.info("Connecting...",!1),await this.transport.connect(this.romBaudrate,this.serialOptions),r=0;r>>0;this.debug("Chip Magic "+e.toString(16));const t=await async function(e){switch(e){case 15736195:{const{ESP32ROM:e}=await import("./esp32-D9Bry5AK.js");return new e}case 1867591791:case 2084675695:{const{ESP32C2ROM:e}=await import("./esp32c2-C0aHw_np.js");return new e}case 1763790959:case 456216687:case 1216438383:case 1130455151:{const{ESP32C3ROM:e}=await import("./esp32c3-1QKN64_Z.js");return new e}case 752910447:{const{ESP32C6ROM:e}=await import("./esp32c6-CgjBrh_Q.js");return new e}case 3619110528:{const{ESP32H2ROM:e}=await import("./esp32h2-Bm3EZXXU.js");return new e}case 9:{const{ESP32S3ROM:e}=await import("./esp32s3-DkYcGTTD.js");return new e}case 1990:{const{ESP32S2ROM:e}=await import("./esp32s2-DxMNCsFV.js");return new e}case 4293968129:{const{ESP8266ROM:e}=await import("./esp8266-DEFNY3lv.js");return new e}default:return null}}(e);if(null===this.chip)throw new ni(`Unexpected CHIP magic value ${e}. Failed to autodetect chip type.`);this.chip=t}}async detectChip(e="default_reset"){await this.connect(e),this.info("Detecting chip type... ",!1),null!=this.chip?this.info(this.chip.CHIP_NAME):this.info("unknown!")}async checkCommand(e="",t=null,i=new Uint8Array(0),r=0,o=3e3){this.debug("check_command "+e);const s=await this.command(t,i,r,void 0,o);return s[1].length>4?s[1]:s[0]}async memBegin(e,t,i,r){this.debug("mem_begin "+e+" "+t+" "+i+" "+r.toString(16));let o=this._appendArray(this._intToByteArray(e),this._intToByteArray(t));o=this._appendArray(o,this._intToByteArray(i)),o=this._appendArray(o,this._intToByteArray(r)),await this.checkCommand("enter RAM download mode",this.ESP_MEM_BEGIN,o)}async memBlock(e,t){let i=this._appendArray(this._intToByteArray(e.length),this._intToByteArray(t));i=this._appendArray(i,this._intToByteArray(0)),i=this._appendArray(i,this._intToByteArray(0)),i=this._appendArray(i,e);const r=this.checksum(e);await this.checkCommand("write to target RAM",this.ESP_MEM_DATA,i,r)}async memFinish(e){const t=0===e?1:0,i=this._appendArray(this._intToByteArray(t),this._intToByteArray(e));await this.checkCommand("leave RAM download mode",this.ESP_MEM_END,i,void 0,50)}async flashSpiAttach(e){const t=this._intToByteArray(e);await this.checkCommand("configure SPI flash pins",this.ESP_SPI_ATTACH,t)}async flashBegin(e,t){const i=Math.floor((e+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),r=this.chip.getEraseSize(t,e),o=new Date,s=o.getTime();let a=3e3;0==this.IS_STUB&&(a=this.timeoutPerMb(this.ERASE_REGION_TIMEOUT_PER_MB,e)),this.debug("flash begin "+r+" "+i+" "+this.FLASH_WRITE_SIZE+" "+t+" "+e);let n=this._appendArray(this._intToByteArray(r),this._intToByteArray(i));n=this._appendArray(n,this._intToByteArray(this.FLASH_WRITE_SIZE)),n=this._appendArray(n,this._intToByteArray(t)),0==this.IS_STUB&&(n=this._appendArray(n,this._intToByteArray(0))),await this.checkCommand("enter Flash download mode",this.ESP_FLASH_BEGIN,n,void 0,a);const l=o.getTime();return 0!=e&&0==this.IS_STUB&&this.info("Took "+(l-s)/1e3+"."+(l-s)%1e3+"s to erase flash block"),i}async flashDeflBegin(e,t,i){const r=Math.floor((t+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),o=Math.floor((e+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),s=new Date,a=s.getTime();let n,l;this.IS_STUB?(n=e,l=3e3):(n=o*this.FLASH_WRITE_SIZE,l=this.timeoutPerMb(this.ERASE_REGION_TIMEOUT_PER_MB,n)),this.info("Compressed "+e+" bytes to "+t+"...");let d=this._appendArray(this._intToByteArray(n),this._intToByteArray(r));d=this._appendArray(d,this._intToByteArray(this.FLASH_WRITE_SIZE)),d=this._appendArray(d,this._intToByteArray(i)),"ESP32-S2"!==this.chip.CHIP_NAME&&"ESP32-S3"!==this.chip.CHIP_NAME&&"ESP32-C3"!==this.chip.CHIP_NAME&&"ESP32-C2"!==this.chip.CHIP_NAME||!1!==this.IS_STUB||(d=this._appendArray(d,this._intToByteArray(0))),await this.checkCommand("enter compressed flash mode",this.ESP_FLASH_DEFL_BEGIN,d,void 0,l);const c=s.getTime();return 0!=e&&!1===this.IS_STUB&&this.info("Took "+(c-a)/1e3+"."+(c-a)%1e3+"s to erase flash block"),r}async flashBlock(e,t,i){let r=this._appendArray(this._intToByteArray(e.length),this._intToByteArray(t));r=this._appendArray(r,this._intToByteArray(0)),r=this._appendArray(r,this._intToByteArray(0)),r=this._appendArray(r,e);const o=this.checksum(e);await this.checkCommand("write to target Flash after seq "+t,this.ESP_FLASH_DATA,r,o,i)}async flashDeflBlock(e,t,i){let r=this._appendArray(this._intToByteArray(e.length),this._intToByteArray(t));r=this._appendArray(r,this._intToByteArray(0)),r=this._appendArray(r,this._intToByteArray(0)),r=this._appendArray(r,e);const o=this.checksum(e);this.debug("flash_defl_block "+e[0].toString(16)+" "+e[1].toString(16)),await this.checkCommand("write compressed data to flash after seq "+t,this.ESP_FLASH_DEFL_DATA,r,o,i)}async flashFinish(e=!1){const t=e?0:1,i=this._intToByteArray(t);await this.checkCommand("leave Flash mode",this.ESP_FLASH_END,i)}async flashDeflFinish(e=!1){const t=e?0:1,i=this._intToByteArray(t);await this.checkCommand("leave compressed flash mode",this.ESP_FLASH_DEFL_END,i)}async runSpiflashCommand(e,t,i){const r=this.chip.SPI_REG_BASE,o=r+0,s=r+this.chip.SPI_USR_OFFS,a=r+this.chip.SPI_USR1_OFFS,n=r+this.chip.SPI_USR2_OFFS,l=r+this.chip.SPI_W0_OFFS;let d;d=null!=this.chip.SPI_MOSI_DLEN_OFFS?async(e,t)=>{const i=r+this.chip.SPI_MOSI_DLEN_OFFS,o=r+this.chip.SPI_MISO_DLEN_OFFS;e>0&&await this.writeReg(i,e-1),t>0&&await this.writeReg(o,t-1)}:async(e,t)=>{const i=a,r=(0===t?0:t-1)<<8|(0===e?0:e-1)<<17;await this.writeReg(i,r)};const c=1<<18;if(i>32)throw new ni("Reading more than 32 bits back from a SPI flash operation is unsupported");if(t.length>64)throw new ni("Writing more than 64 bytes of data with one SPI command is unsupported");const h=8*t.length,p=await this.readReg(s),f=await this.readReg(n);let u,m=1<<31;i>0&&(m|=268435456),h>0&&(m|=134217728),await d(h,i),await this.writeReg(s,m);let v=7<<28|e;if(await this.writeReg(n,v),0==h)await this.writeReg(l,0);else{if(t.length%4!=0){const e=new Uint8Array(t.length%4);t=this._appendArray(t,e)}let e=l;for(u=0;u("00"+e.toString(16)).slice(-2))).join("")}async flashMd5sum(e,t){const i=this.timeoutPerMb(this.MD5_TIMEOUT_PER_MB,t);let r=this._appendArray(this._intToByteArray(e),this._intToByteArray(t));r=this._appendArray(r,this._intToByteArray(0)),r=this._appendArray(r,this._intToByteArray(0));let o=await this.checkCommand("calculate md5sum",this.ESP_SPI_FLASH_MD5,r,void 0,i);o instanceof Uint8Array&&o.length>16&&(o=o.slice(0,16));return this.toHex(o)}async readFlash(e,t,i=null){let r=this._appendArray(this._intToByteArray(e),this._intToByteArray(t));r=this._appendArray(r,this._intToByteArray(4096)),r=this._appendArray(r,this._intToByteArray(1024));const o=await this.checkCommand("read flash",this.ESP_READ_FLASH,r);if(0!=o)throw new ni("Failed to read memory: "+o);let s=new Uint8Array(0);for(;s.length0&&(s=this._appendArray(s,e),await this.transport.write(this._intToByteArray(s.length)),i&&i(e,s.length,t))}return s}async runStub(){this.info("Uploading stub...");let e=Ls.Buffer.from(this.chip.ROM_TEXT,"base64").toString("binary"),t=e.split("").map((function(e){return e.charCodeAt(0)}));const i=new Uint8Array(t);e=Ls.Buffer.from(this.chip.ROM_DATA,"base64").toString("binary"),t=e.split("").map((function(e){return e.charCodeAt(0)}));const r=new Uint8Array(t);let o,s=Math.floor((i.length+this.ESP_RAM_BLOCK-1)/this.ESP_RAM_BLOCK);for(await this.memBegin(i.length,s,this.ESP_RAM_BLOCK,this.chip.TEXT_START),o=0;ot)throw new ni(`File ${i+1} doesn't fit in the available flash`)}let t,i;!0===this.IS_STUB&&!0===e.eraseAll&&await this.eraseFlash();for(let r=0;r0&&(t+="ÿÿÿÿ".substring(4-o)),i=e.fileArray[r].address,this.debug("Image Length "+t.length),0===t.length){this.debug("Warning: File is empty");continue}t=this._updateImageFlashParams(t,i,e.flashSize,e.flashMode,e.flashFreq);let s=null;e.calculateMD5Hash&&(s=e.calculateMD5Hash(t),this.debug("Image MD5 "+s));const a=t.length;let n;if(e.compress){const e=this.bstrToUi8(t);t=this.ui8ToBstr(Ts(e,{level:9})),n=await this.flashDeflBegin(a,t.length,i)}else n=await this.flashBegin(a,i);let l=0,d=0;const c=t.length;e.reportProgress&&e.reportProgress(r,0,c);let h=new Date;const p=h.getTime();let f=5e3;const u=new Is({chunkSize:1});let m=0;for(u.onData=function(e){m+=e.byteLength};t.length>0;){this.debug("Write loop "+i+" "+l+" "+n),this.info("Writing at 0x"+(i+m).toString(16)+"... ("+Math.floor(100*(l+1)/n)+"%)");const o=this.bstrToUi8(t.slice(0,this.FLASH_WRITE_SIZE));if(!e.compress)throw new ni("Yet to handle Non Compressed writes");{const e=m;u.push(o,!1);const t=m-e;let i=3e3;this.timeoutPerMb(this.ERASE_WRITE_TIMEOUT_PER_MB,t)>3e3&&(i=this.timeoutPerMb(this.ERASE_WRITE_TIMEOUT_PER_MB,t)),!1===this.IS_STUB&&(f=i),await this.flashDeflBlock(o,l,f),this.IS_STUB&&(f=i)}d+=o.length,t=t.slice(this.FLASH_WRITE_SIZE,t.length),l++,e.reportProgress&&e.reportProgress(r,d,c)}this.IS_STUB&&await this.readReg(this.CHIP_DETECT_MAGIC_REG_ADDR,f),h=new Date;const v=h.getTime()-p;if(e.compress&&this.info("Wrote "+a+" bytes ("+d+" compressed) at 0x"+i.toString(16)+" in "+v/1e3+" seconds."),s){const e=await this.flashMd5sum(i,a);if(new String(e).valueOf()!=new String(s).valueOf())throw this.info("File md5: "+s),this.info("Flash md5: "+e),new ni("MD5 of file does not match data in flash!");this.info("Hash of data verified.")}}this.info("Leaving..."),this.IS_STUB&&(await this.flashBegin(0,0),e.compress?await this.flashDeflFinish():await this.flashFinish())}async flashId(){this.debug("flash_id");const e=await this.readFlashId();this.info("Manufacturer: "+(255&e).toString(16));const t=e>>16&255;this.info("Device: "+(e>>8&255).toString(16)+t.toString(16)),this.info("Detected flash size: "+this.DETECTED_FLASH_SIZES[t])}async getFlashSize(){this.debug("flash_id");const e=await this.readFlashId()>>16&255;return this.DETECTED_FLASH_SIZES_NUM[e]}async hardReset(){await this.transport.setRTS(!0),await this._sleep(100),await this.transport.setRTS(!1)}async softReset(){if(this.IS_STUB){if("ESP8266"!=this.chip.CHIP_NAME)throw new ni("Soft resetting is currently only supported on ESP8266");await this.command(this.ESP_RUN_USER_CODE,void 0,void 0,!1)}else await this.flashBegin(0,0),await this.flashFinish(!1)}}const Ws=async e=>{await e.device.setSignals({dataTerminalReady:!1,requestToSend:!0}),await _e(250),await e.device.setSignals({dataTerminalReady:!1,requestToSend:!1}),await _e(250)},Zs=(e,t="")=>{const i=new Blob([e],{type:"text/plain"}),r=URL.createObjectURL(i);((e,t="")=>{const i=document.createElement("a");i.target="_blank",i.href=e,i.download=t,document.body.appendChild(i),i.dispatchEvent(new MouseEvent("click")),document.body.removeChild(i)})(r,t),setTimeout((()=>URL.revokeObjectURL(r)),0)};console.log("ESP Web Tools 10.0.1 by Nabu Casa; https://esphome.github.io/esp-web-tools/");class Vs extends r{constructor(){super(...arguments),this.logger=console,this._state="DASHBOARD",this._installErase=!1,this._installConfirmed=!1,this._provisionForce=!1,this._wasProvisioned=!1,this._busy=!1,this._selectedSsid=null,this._bodyOverflow=null,this._handleDisconnect=()=>{this._state="ERROR",this._error="Disconnected"}}render(){if(!this.port)return o``;let e,t,i=!1;return void 0===this._client&&"INSTALL"!==this._state&&"LOGS"!==this._state?this._error?[e,t]=this._renderError(this._error):t=this._renderProgress("Connecting"):"INSTALL"===this._state?[e,t,i]=this._renderInstall():"ASK_ERASE"===this._state?[e,t]=this._renderAskErase():"ERROR"===this._state?[e,t]=this._renderError(this._error):"DASHBOARD"===this._state?[e,t,i]=this._client?this._renderDashboard():this._renderDashboardNoImprov():"PROVISION"===this._state?[e,t]=this._renderProvision():"LOGS"===this._state&&([e,t]=this._renderLogs()),o` + + ${e?o`
    ${e}
    `:""} + ${i?o` + + ${Gt} + + `:""} + ${t} +
    + `}_renderProgress(e,t){return o` + + `}_renderError(e){return["Error",o` + +
    + Close +
    + `]}_renderDashboard(){const e=this._manifest.name;let t;return t=o` +
    + + +
    Connected to ${this._info.name}
    +
    + ${this._info.firmware} ${this._info.version} + (${this._info.chipFamily}) +
    +
    + ${this._isSameVersion?"":o` + {this._isSameFirmware?this._startInstall(!1):this._manifest.new_install_prompt_erase?this._state="ASK_ERASE":this._startInstall(!0)}} + > + ${Kt} +
    + ${this._isSameFirmware?`Update ${this._manifest.name}`:`Install ${this._manifest.name}`} +
    +
    + `} + ${void 0===this._client.nextUrl?"":o` + + ${Jt} +
    Visit Device
    +
    + `} + ${this._manifest.home_assistant_domain&&this._client.state===ii.PROVISIONED?o` + + ${Qt} +
    Add to Home Assistant
    +
    + `:""} + {this._state="PROVISION",this._client.state===ii.PROVISIONED&&(this._provisionForce=!0)}} + > + ${Yt} +
    + ${this._client.state===ii.READY?"Connect to Wi-Fi":"Change Wi-Fi"} +
    +
    + {const e=this._client;e&&(await this._closeClientWithoutEvents(e),await _e(100)),this._client=void 0,this._state="LOGS"}} + > + ${Xt} +
    Logs & Console
    +
    + ${this._isSameFirmware&&this._manifest.funding_url?o` + +
    Fund Development
    +
    + `:""} + ${this._isSameVersion?o` + this._startInstall(!0)} + > +
    Erase User Data
    +
    + `:""} +
    +
    + `,[e,t,!0]}_renderDashboardNoImprov(){const e=this._manifest.name;let t;return t=o` +
    + + {this._manifest.new_install_prompt_erase?this._state="ASK_ERASE":this._startInstall(!0)}} + > + ${Kt} +
    ${`Install ${this._manifest.name}`}
    +
    + {this._client=void 0,this._state="LOGS"}} + > + ${Xt} +
    Logs & Console
    +
    +
    +
    + `,[e,t,!0]}_renderProvision(){var e;let t,i="Configure Wi-Fi";if(this._busy)return[i,this._renderProgress(void 0===this._ssids?"Scanning for networks":"Trying to connect")];if(this._provisionForce||this._client.state!==ii.PROVISIONED){let i;switch(this._client.error){case 3:i="Unable to connect";break;case 254:i="Timeout";break;case 0:case 2:break;default:i=`Unknown error (${this._client.error})`}const r=null===(e=this._ssids)||void 0===e?void 0:e.find((e=>e.name===this._selectedSsid));t=o` + + ${jt} + +
    +
    Connect your device to the network to start using it.
    + ${i?o`

    ${i}

    `:""} + ${null!==this._ssids?o` + {const t=e.target.selectedIndex;this._selectedSsid=t===this._ssids.length?null:this._ssids[t].name}} + > + ${this._ssids.map((e=>o` + + ${e.name} + + `))} + + + Join other… + + + `:""} + ${r?"":o` + + `} + ${!r||r.secured?o` + + `:""} +
    +
    + {this._state="DASHBOARD"}} + > + ${this._installState&&this._installErase?"Skip":"Back"} + + Connect +
    + `}else{i=void 0;const e=!this._wasProvisioned&&(void 0!==this._client.nextUrl||"home_assistant_domain"in this._manifest);t=o` +
    + + ${e?o` + + ${void 0===this._client.nextUrl?"":o` + {this._state="DASHBOARD"}} + > + ${Jt} +
    Visit Device
    +
    + `} + ${this._manifest.home_assistant_domain?o` + {this._state="DASHBOARD"}} + > + ${Qt} +
    Add to Home Assistant
    +
    + `:""} + {this._state="DASHBOARD"}} + > +
    +
    Skip
    +
    +
    + `:""} +
    + + ${e?"":o` +
    + {this._state="DASHBOARD"}} + > + Continue + +
    + `} + `}return[i,t]}_renderAskErase(){return["Erase device",o` +
    +
    + Do you want to erase the device before installing + ${this._manifest.name}? All data on the device will be lost. +
    + +
    +
    + {this._state="DASHBOARD"}} + > + Back + + {const e=this.shadowRoot.querySelector("ew-checkbox");this._startInstall(e.checked)}} + > + Next + +
    + `]}_renderInstall(){let e,t;const i=!this._installErase&&this._isSameFirmware;if(!this._installConfirmed&&this._isSameVersion)e="Erase User Data",t=o` +
    + Do you want to reset your device and erase all user data from your + device? +
    +
    + + Erase User Data + +
    + `;else if(this._installConfirmed)if(this._installState&&"initializing"!==this._installState.state&&"preparing"!==this._installState.state)if("erasing"===this._installState.state)e="Installing",t=this._renderProgress("Erasing");else if("writing"===this._installState.state||"finished"===this._installState.state&&void 0===this._client){let i,r;e="Installing","finished"===this._installState.state?r="Wrapping up":this._installState.details.percentage<4?r="Installing":i=this._installState.details.percentage,t=this._renderProgress(o` + ${r?o`${r}
    `:""} +
    + This will take + ${"ESP8266"===this._installState.chipFamily?"a minute":"2 minutes"}.
    + Keep this page visible to prevent slow down + `,i)}else if("finished"===this._installState.state){e=void 0;const i=null!==this._client;t=o` + + +
    + {this._state=i&&this._installErase?"PROVISION":"DASHBOARD"}} + > + Next + +
    + `}else"error"===this._installState.state&&(e="Installation failed",t=o` + +
    + {this._initialize(),this._state="DASHBOARD"}} + > + Back + +
    + `);else e="Installing",t=this._renderProgress("Preparing installation");else{e="Confirm Installation";const r=i?"update to":"install";t=o` +
    + ${i?o`Your device is running + ${this._info.firmware} ${this._info.version}.

    `:""} + Do you want to ${r} + ${this._manifest.name} ${this._manifest.version}? + ${this._installErase?o`

    All data on the device will be erased.`:""} +
    +
    + {this._state="DASHBOARD"}} + > + Back + + + Install + +
    + `}return[e,t,!1]}_renderLogs(){let e;return e=o` +
    + +
    +
    + {await this.shadowRoot.querySelector("ewt-console").reset()}} + > + Reset Device + + {Zs(this.shadowRoot.querySelector("ewt-console").logs(),"esp-web-tools-logs.txt"),this.shadowRoot.querySelector("ewt-console").reset()}} + > + Download Logs + + {await this.shadowRoot.querySelector("ewt-console").disconnect(),this._state="DASHBOARD",this._initialize()}} + > + Back + +
    + `,["Logs",e]}willUpdate(e){e.has("_state")&&("ERROR"!==this._state&&(this._error=void 0),"PROVISION"===this._state?this._updateSsids():this._provisionForce=!1,"INSTALL"===this._state&&(this._installConfirmed=!1,this._installState=void 0))}async _updateSsids(e=0){const t=this._ssids;let i;this._ssids=void 0,this._busy=!0;try{i=await this._client.scan()}catch(e){return void 0===this._ssids&&(this._ssids=null,this._selectedSsid=null),void(this._busy=!1)}if(0===i.length&&e<3)return console.log("SCHEDULE RETRY",e),void setTimeout((()=>this._updateSsids(e+1)),1e3);t?this._selectedSsid&&!i.find((e=>e.name===this._selectedSsid))&&(this._selectedSsid=i[0].name):this._selectedSsid=i.length?i[0].name:null,this._ssids=i,this._busy=!1}firstUpdated(e){super.firstUpdated(e),this._bodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden",this._initialize()}updated(e){super.updated(e),e.has("_state")&&this.setAttribute("state",this._state),"PROVISION"===this._state&&(e.has("_selectedSsid")&&null===this._selectedSsid?this._focusFormElement("ew-filled-text-field[name=ssid]"):e.has("_ssids")&&this._focusFormElement())}_focusFormElement(e="ew-filled-text-field, ew-filled-select"){const t=this.shadowRoot.querySelector(e);t&&t.updateComplete.then((()=>setTimeout((()=>t.focus()),100)))}async _initialize(e=!1){if(null===this.port.readable||null===this.port.writable)return this._state="ERROR",void(this._error="Serial port is not readable/writable. Close any other application using it and try again.");try{this._manifest=await(async e=>{const t=new URL(e,location.toString()).toString(),i=await fetch(t),r=await i.json();return"new_install_skip_erase"in r&&(console.warn('Manifest option "new_install_skip_erase" is deprecated. Use "new_install_prompt_erase" instead.'),r.new_install_skip_erase&&(r.new_install_prompt_erase=!0)),r})(this.manifestPath)}catch(e){return this._state="ERROR",void(this._error="Failed to download manifest")}if(0===this._manifest.new_install_improv_wait_time)return void(this._client=null);const t=new ai(this.port,this.logger);t.addEventListener("state-changed",(()=>{this.requestUpdate()})),t.addEventListener("error-changed",(()=>this.requestUpdate()));try{const i=e?void 0!==this._manifest.new_install_improv_wait_time?1e3*this._manifest.new_install_improv_wait_time:1e4:1e3;this._info=await t.initialize(i),this._client=t,t.addEventListener("disconnect",this._handleDisconnect)}catch(e){this._info=void 0,e instanceof oi?(this._state="ERROR",this._error="Serial port is not ready. Close any other application using it and try again."):(this._client=null,this.logger.error("Improv initialization failed.",e))}}_startInstall(e){this._state="INSTALL",this._installErase=e,this._installConfirmed=!1}async _confirmInstall(){this._installConfirmed=!0,this._installState=void 0,this._client&&await this._closeClientWithoutEvents(this._client),this._client=void 0,await this.port.close(),(async(e,t,i,r,o)=>{let s,a;const n=t=>e({...t,manifest:r,build:s,chipFamily:a}),l=new Cs(t),d=new qs({transport:l,baudrate:115200,romBaudrate:115200,enableTracing:!1});window.esploader=d,n({state:"initializing",message:"Initializing...",details:{done:!1}});try{await d.main(),await d.flashId()}catch(e){return console.error(e),n({state:"error",message:"Failed to initialize. Try resetting your device or holding the BOOT button while clicking INSTALL.",details:{error:"failed_initialize",details:e}}),await Ws(l),void await l.disconnect()}if(a=d.chip.CHIP_NAME,!d.chip.ROM_TEXT)return n({state:"error",message:`Chip ${a} is not supported`,details:{error:"not_supported",details:`Chip ${a} is not supported`}}),await Ws(l),void await l.disconnect();if(n({state:"initializing",message:`Initialized. Found ${a}`,details:{done:!0}}),s=r.builds.find((e=>e.chipFamily===a)),!s)return n({state:"error",message:`Your ${a} board is not supported.`,details:{error:"not_supported",details:a}}),await Ws(l),void await l.disconnect();n({state:"preparing",message:"Preparing installation...",details:{done:!1}});const c=new URL(i,location.toString()).toString(),h=s.parts.map((async e=>{const t=new URL(e.path,c).toString(),i=await fetch(t);if(!i.ok)throw new Error(`Downlading firmware ${e.path} failed: ${i.status}`);const r=new FileReader,o=await i.blob();return new Promise((e=>{r.addEventListener("load",(()=>e(r.result))),r.readAsBinaryString(o)}))})),p=[];let f=0;for(let e=0;e{const r=t/i*p[e].data.length,o=Math.floor((u+r)/f*100);t!==i?n({state:"writing",message:`Writing progress: ${o}%`,details:{bytesTotal:f,bytesWritten:u+t,percentage:o}}):u+=r}})}catch(e){return n({state:"error",message:e.message,details:{error:"write_failed",details:e}}),await Ws(l),void await l.disconnect()}n({state:"writing",message:"Writing complete",details:{bytesTotal:f,bytesWritten:u,percentage:100}}),await _e(100),console.log("HARD RESET"),await Ws(l),console.log("DISCONNECT"),await l.disconnect(),n({state:"finished",message:"All done!"})})((e=>{this._installState=e,"finished"===e.state?_e(100).then((()=>this.port.open({baudRate:115200}))).then((()=>this._initialize(!0))).then((()=>this.requestUpdate())):"error"===e.state&&_e(100).then((()=>this.port.open({baudRate:115200})))}),this.port,this.manifestPath,this._manifest,this._installErase)}async _doProvision(){var e;this._busy=!0,this._wasProvisioned=this._client.state===ii.PROVISIONED;const t=null===this._selectedSsid?this.shadowRoot.querySelector("ew-filled-text-field[name=ssid]").value:this._selectedSsid,i=(null===(e=this.shadowRoot.querySelector("ew-filled-text-field[name=password]"))||void 0===e?void 0:e.value)||"";try{await this._client.provision(t,i,3e4)}catch(e){return}finally{this._busy=!1,this._provisionForce=!1}}_closeDialog(){this.shadowRoot.querySelector("ew-dialog").close()}async _handleClose(){this._client&&await this._closeClientWithoutEvents(this._client),((e,t,i,r)=>{r=r||{};const o=new CustomEvent(t,{bubbles:void 0===r.bubbles||r.bubbles,cancelable:Boolean(r.cancelable),composed:void 0===r.composed||r.composed,detail:i});e.dispatchEvent(o)})(this,"closed"),document.body.style.overflow=this._bodyOverflow,this.parentNode.removeChild(this)}get _isSameFirmware(){var e;return!!this._info&&((null===(e=this.overrides)||void 0===e?void 0:e.checkSameFirmware)?this.overrides.checkSameFirmware(this._manifest,this._info):this._info.firmware===this._manifest.name)}get _isSameVersion(){return this._isSameFirmware&&this._info.version===this._manifest.version}async _closeClientWithoutEvents(e){e.removeEventListener("disconnect",this._handleDisconnect),await e.close()}_preventDefault(e){e.preventDefault()}}Vs.styles=[I,s` + :host { + --mdc-dialog-max-width: 390px; + } + div[slot="headline"] { + padding-right: 48px; + } + ew-icon-button[slot="headline"] { + position: absolute; + right: 4px; + top: 8px; + } + ew-icon-button[slot="headline"] svg { + padding: 8px; + color: var(--text-color); + } + .dialog-nav svg { + color: var(--text-color); + } + .table-row { + display: flex; + } + .table-row.last { + margin-bottom: 16px; + } + .table-row svg { + width: 20px; + margin-right: 8px; + } + ew-filled-text-field, + ew-filled-select { + display: block; + margin-top: 16px; + } + label.formfield { + display: inline-flex; + align-items: center; + padding-right: 8px; + } + ew-list { + margin: 0 -24px; + padding: 0; + } + ew-list-item svg { + height: 24px; + } + ewt-page-message + ew-list { + padding-top: 16px; + } + .fake-icon { + width: 24px; + } + .error { + color: var(--danger-color); + } + .danger { + --mdc-theme-primary: var(--danger-color); + --mdc-theme-secondary: var(--danger-color); + --md-sys-color-primary: var(--danger-color); + --md-sys-color-on-surface: var(--danger-color); + } + button.link { + background: none; + color: inherit; + border: none; + padding: 0; + font: inherit; + text-align: left; + text-decoration: underline; + cursor: pointer; + } + :host([state="LOGS"]) ew-dialog { + max-width: 90vw; + max-height: 90vh; + } + ewt-console { + width: calc(80vw - 48px); + height: calc(90vh - 168px); + } + `],t([m()],Vs.prototype,"_client",void 0),t([m()],Vs.prototype,"_state",void 0),t([m()],Vs.prototype,"_installErase",void 0),t([m()],Vs.prototype,"_installConfirmed",void 0),t([m()],Vs.prototype,"_installState",void 0),t([m()],Vs.prototype,"_provisionForce",void 0),t([m()],Vs.prototype,"_error",void 0),t([m()],Vs.prototype,"_busy",void 0),t([m()],Vs.prototype,"_ssids",void 0),t([m()],Vs.prototype,"_selectedSsid",void 0),customElements.define("ewt-install-dialog",Vs);export{Vs as EwtInstallDialog}; diff --git a/public/esp-web-tools/rom-B2LvkjpK.js b/public/esp-web-tools/rom-B2LvkjpK.js new file mode 100644 index 0000000..aa809d8 --- /dev/null +++ b/public/esp-web-tools/rom-B2LvkjpK.js @@ -0,0 +1 @@ +class e{getEraseSize(e,r){return r}}export{e as R}; diff --git a/public/esp-web-tools/styles-ChWDJ3ue.js b/public/esp-web-tools/styles-ChWDJ3ue.js new file mode 100644 index 0000000..c2633e6 --- /dev/null +++ b/public/esp-web-tools/styles-ChWDJ3ue.js @@ -0,0 +1,98 @@ +function t(t,e,i,s){var o,r=arguments.length,n=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(n=(r<3?o(n):r>3?o(e,i,n):o(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n}"function"==typeof SuppressedError&&SuppressedError;const e=globalThis,i=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;let r=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=o.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&o.set(e,t))}return t}toString(){return this.cssText}};const n=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1]),t[0]);return new r(i,t,s)},a=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new r("string"==typeof t?t:t+"",void 0,s))(e)})(t):t,{is:l,defineProperty:c,getOwnPropertyDescriptor:d,getOwnPropertyNames:h,getOwnPropertySymbols:p,getPrototypeOf:u}=Object,m=globalThis,f=m.trustedTypes,v=f?f.emptyScript:"",g=m.reactiveElementPolyfillSupport,b=(t,e)=>t,y={toAttribute(t,e){switch(e){case Boolean:t=t?v:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},_=(t,e)=>!l(t,e),x={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:_};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),m.litPropertyMetadata??(m.litPropertyMetadata=new WeakMap);let A=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=x){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);void 0!==s&&c(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:o}=d(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return s?.call(this)},set(e){const r=s?.call(this);o.call(this,e),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??x}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const t=u(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const t=this.properties,e=[...h(t),...p(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(a(t))}else void 0!==t&&e.push(a(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??(this._$EO=new Set)).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,s)=>{if(i)t.adoptedStyleSheets=s.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of s){const s=document.createElement("style"),o=e.litNonce;void 0!==o&&s.setAttribute("nonce",o),s.textContent=i.cssText,t.appendChild(s)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(void 0!==s&&!0===i.reflect){const o=(void 0!==i.converter?.toAttribute?i.converter:y).toAttribute(e,i.type);this._$Em=t,null==o?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){const i=this.constructor,s=i._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=i.getPropertyOptions(s),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:y;this._$Em=s,this[s]=o.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??_)(this[t],e))return;this.P(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t)!0!==i.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],i)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach((t=>this._$EC(t,this[t])))),this._$EU()}updated(t){}firstUpdated(t){}};A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[b("elementProperties")]=new Map,A[b("finalized")]=new Map,g?.({ReactiveElement:A}),(m.reactiveElementVersions??(m.reactiveElementVersions=[])).push("2.0.4");const $=globalThis,C=$.trustedTypes,w=C?C.createPolicy("lit-html",{createHTML:t=>t}):void 0,E="$lit$",S=`lit$${(Math.random()+"").slice(9)}$`,P="?"+S,T=`<${P}>`,k=document,R=()=>k.createComment(""),I=t=>null===t||"object"!=typeof t&&"function"!=typeof t,O=Array.isArray,z="[ \t\n\f\r]",L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,M=/-->/g,U=/>/g,H=RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),N=/'/g,D=/"/g,B=/^(?:script|style|textarea|title)$/i,V=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),j=V(1),F=V(2),W=Symbol.for("lit-noChange"),q=Symbol.for("lit-nothing"),Y=new WeakMap,G=k.createTreeWalker(k,129);function K(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==w?w.createHTML(e):e}const Z=(t,e)=>{const i=t.length-1,s=[];let o,r=2===e?"":"",n=L;for(let e=0;e"===l[0]?(n=o??L,c=-1):void 0===l[1]?c=-2:(c=n.lastIndex-l[2].length,a=l[1],n=void 0===l[3]?H:'"'===l[3]?D:N):n===D||n===N?n=H:n===M||n===U?n=L:(n=H,o=void 0);const h=n===H&&t[e+1].startsWith("/>")?" ":"";r+=n===L?i+T:c>=0?(s.push(a),i.slice(0,c)+E+i.slice(c)+S+h):i+S+(-2===c?e:h)}return[K(t,r+(t[i]||"")+(2===e?"":"")),s]};class J{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,r=0;const n=t.length-1,a=this.parts,[l,c]=Z(t,e);if(this.el=J.createElement(l,i),G.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=G.nextNode())&&a.length0){s.textContent=C?C.emptyScript:"";for(let i=0;iO(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==q&&I(this._$AH)?this._$AA.nextSibling.data=t:this.T(k.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,s="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=J.createElement(K(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new Q(s,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=Y.get(t.strings);return void 0===e&&Y.set(t.strings,e=new J(t)),e}k(t){O(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new tt(this.S(R()),this.S(R()),this,this.options)):i=e[s],i._$AI(o),s++;s2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=q}_$AI(t,e=this,i,s){const o=this.strings;let r=!1;if(void 0===o)t=X(this,t,e,0),r=!I(t)||t!==this._$AH&&t!==W,r&&(this._$AH=t);else{const s=t;let n,a;for(t=o[0],n=0;n{const s=i?.renderBefore??e;let o=s._$litPart$;if(void 0===o){const t=i?.renderBefore??null;s._$litPart$=o=new tt(e.insertBefore(R(),t),t,void 0,i??{})}return o._$AI(t),o};class lt extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=at(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return W}}lt._$litElement$=!0,lt.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:lt});const ct=globalThis.litElementPolyfillSupport;ct?.({LitElement:lt}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.4");const dt=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)},ht={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:_},pt=(t=ht,e,i)=>{const{kind:s,metadata:o}=i;let r=globalThis.litPropertyMetadata.get(o);if(void 0===r&&globalThis.litPropertyMetadata.set(o,r=new Map),r.set(i.name,t),"accessor"===s){const{name:s}=i;return{set(i){const o=e.get.call(this);e.set.call(this,i),this.requestUpdate(s,o,t)},init(e){return void 0!==e&&this.P(s,void 0,t),e}}}if("setter"===s){const{name:s}=i;return function(i){const o=this[s];e.call(this,i),this.requestUpdate(s,o,t)}}throw Error("Unsupported decorator location: "+s)};function ut(t){return(e,i)=>"object"==typeof i?pt(t,e,i):((t,e,i)=>{const s=e.hasOwnProperty(i);return e.constructor.createProperty(i,s?{...t,wrapped:!0}:t),s?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}function mt(t){return ut({...t,state:!0,attribute:!1})}const ft=(t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i);function vt(t,e){return(i,s,o)=>{const r=e=>e.renderRoot?.querySelector(t)??null;if(e){const{get:t,set:e}="object"==typeof s?i:o??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return ft(i,s,{get(){let i=t.call(this);return void 0===i&&(i=r(this),(null!==i||this.hasUpdated)&&e.call(this,i)),i}})}return ft(i,s,{get(){return r(this)}})}}function gt(t){return(e,i)=>{const{slot:s,selector:o}=t??{},r="slot"+(s?`[name=${s}]`:":not([name])");return ft(e,i,{get(){const e=this.renderRoot?.querySelector(r),i=e?.assignedElements(t)??[];return void 0===o?i:i.filter((t=>t.matches(o)))}})}}const bt=n`:host{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end);box-sizing:border-box;cursor:pointer;display:inline-flex;gap:8px;min-height:var(--_container-height);outline:none;padding-block:calc((var(--_container-height) - max(var(--_label-text-line-height),var(--_icon-size)))/2);padding-inline-start:var(--_leading-space);padding-inline-end:var(--_trailing-space);place-content:center;place-items:center;position:relative;font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);text-overflow:ellipsis;text-wrap:nowrap;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);vertical-align:top;--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}md-focus-ring{--md-focus-ring-shape-start-start: var(--_container-shape-start-start);--md-focus-ring-shape-start-end: var(--_container-shape-start-end);--md-focus-ring-shape-end-end: var(--_container-shape-end-end);--md-focus-ring-shape-end-start: var(--_container-shape-end-start)}:host([disabled]){cursor:default;pointer-events:none}.button{border-radius:inherit;cursor:inherit;display:inline-flex;align-items:center;justify-content:center;border:none;outline:none;-webkit-appearance:none;vertical-align:middle;background:rgba(0,0,0,0);text-decoration:none;min-width:calc(64px - var(--_leading-space) - var(--_trailing-space));width:100%;z-index:0;height:100%;font:inherit;color:var(--_label-text-color);padding:0;gap:inherit}.button::-moz-focus-inner{padding:0;border:0}:host(:hover) .button{color:var(--_hover-label-text-color)}:host(:focus-within) .button{color:var(--_focus-label-text-color)}:host(:active) .button{color:var(--_pressed-label-text-color)}.background{background-color:var(--_container-color);border-radius:inherit;inset:0;position:absolute}.label{overflow:hidden}:is(.button,.label,.label slot),.label ::slotted(*){text-overflow:inherit}:host([disabled]) .label{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}:host([disabled]) .background{background-color:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}@media(forced-colors: active){.background{border:1px solid CanvasText}:host([disabled]){--_disabled-icon-color: GrayText;--_disabled-icon-opacity: 1;--_disabled-container-opacity: 1;--_disabled-label-text-color: GrayText;--_disabled-label-text-opacity: 1}}:host([has-icon]:not([trailing-icon])){padding-inline-start:var(--_with-leading-icon-leading-space);padding-inline-end:var(--_with-leading-icon-trailing-space)}:host([has-icon][trailing-icon]){padding-inline-start:var(--_with-trailing-icon-leading-space);padding-inline-end:var(--_with-trailing-icon-trailing-space)}::slotted([slot=icon]){display:inline-flex;position:relative;writing-mode:horizontal-tb;fill:currentColor;flex-shrink:0;color:var(--_icon-color);font-size:var(--_icon-size);inline-size:var(--_icon-size);block-size:var(--_icon-size)}:host(:hover) ::slotted([slot=icon]){color:var(--_hover-icon-color)}:host(:focus-within) ::slotted([slot=icon]){color:var(--_focus-icon-color)}:host(:active) ::slotted([slot=icon]){color:var(--_pressed-icon-color)}:host([disabled]) ::slotted([slot=icon]){color:var(--_disabled-icon-color);opacity:var(--_disabled-icon-opacity)}.touch{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%)}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_container-height))/2) 0}:host([touch-target=none]) .touch{display:none}/*# sourceMappingURL=shared-styles.css.map */ +`,yt=Symbol("attachableController");let _t;_t=new MutationObserver((t=>{for(const e of t)e.target[yt]?.hostConnected()}));class xt{get htmlFor(){return this.host.getAttribute("for")}set htmlFor(t){null===t?this.host.removeAttribute("for"):this.host.setAttribute("for",t)}get control(){return this.host.hasAttribute("for")?this.htmlFor&&this.host.isConnected?this.host.getRootNode().querySelector(`#${this.htmlFor}`):null:this.currentControl||this.host.parentElement}set control(t){t?this.attach(t):this.detach()}constructor(t,e){this.host=t,this.onControlChange=e,this.currentControl=null,t.addController(this),t[yt]=this,_t?.observe(t,{attributeFilter:["for"]})}attach(t){t!==this.currentControl&&(this.setCurrentControl(t),this.host.removeAttribute("for"))}detach(){this.setCurrentControl(null),this.host.setAttribute("for","")}hostConnected(){this.setCurrentControl(this.control)}hostDisconnected(){this.setCurrentControl(null)}setCurrentControl(t){this.onControlChange(this.currentControl,t),this.currentControl=t}}const At=["focusin","focusout","pointerdown"];class $t extends lt{constructor(){super(...arguments),this.visible=!1,this.inward=!1,this.attachableController=new xt(this,this.onControlChange.bind(this))}get htmlFor(){return this.attachableController.htmlFor}set htmlFor(t){this.attachableController.htmlFor=t}get control(){return this.attachableController.control}set control(t){this.attachableController.control=t}attach(t){this.attachableController.attach(t)}detach(){this.attachableController.detach()}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}handleEvent(t){if(!t[Ct]){switch(t.type){default:return;case"focusin":this.visible=this.control?.matches(":focus-visible")??!1;break;case"focusout":case"pointerdown":this.visible=!1}t[Ct]=!0}}onControlChange(t,e){for(const i of At)t?.removeEventListener(i,this),e?.addEventListener(i,this)}update(t){t.has("visible")&&this.dispatchEvent(new Event("visibility-changed")),super.update(t)}}t([ut({type:Boolean,reflect:!0})],$t.prototype,"visible",void 0),t([ut({type:Boolean,reflect:!0})],$t.prototype,"inward",void 0);const Ct=Symbol("handledByFocusRing"),wt=n`:host{animation-delay:0s,calc(var(--md-focus-ring-duration, 600ms)*.25);animation-duration:calc(var(--md-focus-ring-duration, 600ms)*.25),calc(var(--md-focus-ring-duration, 600ms)*.75);animation-timing-function:cubic-bezier(0.2, 0, 0, 1);box-sizing:border-box;color:var(--md-focus-ring-color, var(--md-sys-color-secondary, #625b71));display:none;pointer-events:none;position:absolute}:host([visible]){display:flex}:host(:not([inward])){animation-name:outward-grow,outward-shrink;border-end-end-radius:calc(var(--md-focus-ring-shape-end-end, var(--md-focus-ring-shape, 9999px)) + var(--md-focus-ring-outward-offset, 2px));border-end-start-radius:calc(var(--md-focus-ring-shape-end-start, var(--md-focus-ring-shape, 9999px)) + var(--md-focus-ring-outward-offset, 2px));border-start-end-radius:calc(var(--md-focus-ring-shape-start-end, var(--md-focus-ring-shape, 9999px)) + var(--md-focus-ring-outward-offset, 2px));border-start-start-radius:calc(var(--md-focus-ring-shape-start-start, var(--md-focus-ring-shape, 9999px)) + var(--md-focus-ring-outward-offset, 2px));inset:calc(-1*var(--md-focus-ring-outward-offset, 2px));outline:var(--md-focus-ring-width, 3px) solid currentColor}:host([inward]){animation-name:inward-grow,inward-shrink;border-end-end-radius:calc(var(--md-focus-ring-shape-end-end, var(--md-focus-ring-shape, 9999px)) - var(--md-focus-ring-inward-offset, 0px));border-end-start-radius:calc(var(--md-focus-ring-shape-end-start, var(--md-focus-ring-shape, 9999px)) - var(--md-focus-ring-inward-offset, 0px));border-start-end-radius:calc(var(--md-focus-ring-shape-start-end, var(--md-focus-ring-shape, 9999px)) - var(--md-focus-ring-inward-offset, 0px));border-start-start-radius:calc(var(--md-focus-ring-shape-start-start, var(--md-focus-ring-shape, 9999px)) - var(--md-focus-ring-inward-offset, 0px));border:var(--md-focus-ring-width, 3px) solid currentColor;inset:var(--md-focus-ring-inward-offset, 0px)}@keyframes outward-grow{from{outline-width:0}to{outline-width:var(--md-focus-ring-active-width, 8px)}}@keyframes outward-shrink{from{outline-width:var(--md-focus-ring-active-width, 8px)}}@keyframes inward-grow{from{border-width:0}to{border-width:var(--md-focus-ring-active-width, 8px)}}@keyframes inward-shrink{from{border-width:var(--md-focus-ring-active-width, 8px)}}@media(prefers-reduced-motion){:host{animation:none}}/*# sourceMappingURL=focus-ring-styles.css.map */ +`;let Et=class extends $t{};Et.styles=[wt],Et=t([dt("md-focus-ring")],Et);const St={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Pt=t=>(...e)=>({_$litDirective$:t,values:e});class Tt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const kt=Pt(class extends Tt{constructor(t){if(super(t),t.type!==St.ATTRIBUTE||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const i=t.element.classList;for(const t of this.st)t in e||(i.remove(t),this.st.delete(t));for(const t in e){const s=!!e[t];s===this.st.has(t)||this.nt?.has(t)||(s?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return W}}),Rt={STANDARD:"cubic-bezier(0.2, 0, 0, 1)",STANDARD_ACCELERATE:"cubic-bezier(.3,0,1,1)",STANDARD_DECELERATE:"cubic-bezier(0,0,0,1)",EMPHASIZED:"cubic-bezier(.3,0,0,1)",EMPHASIZED_ACCELERATE:"cubic-bezier(.3,0,.8,.15)",EMPHASIZED_DECELERATE:"cubic-bezier(.05,.7,.1,1)"};function It(){let t=null;return{start:()=>(t?.abort(),t=new AbortController,t.signal),finish(){t=null}}}var Ot;!function(t){t[t.INACTIVE=0]="INACTIVE",t[t.TOUCH_DELAY=1]="TOUCH_DELAY",t[t.HOLDING=2]="HOLDING",t[t.WAITING_FOR_CLICK=3]="WAITING_FOR_CLICK"}(Ot||(Ot={}));const zt=["click","contextmenu","pointercancel","pointerdown","pointerenter","pointerleave","pointerup"],Lt=window.matchMedia("(forced-colors: active)");class Mt extends lt{constructor(){super(...arguments),this.disabled=!1,this.hovered=!1,this.pressed=!1,this.rippleSize="",this.rippleScale="",this.initialSize=0,this.state=Ot.INACTIVE,this.checkBoundsAfterContextMenu=!1,this.attachableController=new xt(this,this.onControlChange.bind(this))}get htmlFor(){return this.attachableController.htmlFor}set htmlFor(t){this.attachableController.htmlFor=t}get control(){return this.attachableController.control}set control(t){this.attachableController.control=t}attach(t){this.attachableController.attach(t)}detach(){this.attachableController.detach()}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){const t={hovered:this.hovered,pressed:this.pressed};return j`
    `}update(t){t.has("disabled")&&this.disabled&&(this.hovered=!1,this.pressed=!1),super.update(t)}handlePointerenter(t){this.shouldReactToEvent(t)&&(this.hovered=!0)}handlePointerleave(t){this.shouldReactToEvent(t)&&(this.hovered=!1,this.state!==Ot.INACTIVE&&this.endPressAnimation())}handlePointerup(t){if(this.shouldReactToEvent(t)){if(this.state!==Ot.HOLDING)return this.state===Ot.TOUCH_DELAY?(this.state=Ot.WAITING_FOR_CLICK,void this.startPressAnimation(this.rippleStartEvent)):void 0;this.state=Ot.WAITING_FOR_CLICK}}async handlePointerdown(t){if(this.shouldReactToEvent(t)){if(this.rippleStartEvent=t,!this.isTouch(t))return this.state=Ot.WAITING_FOR_CLICK,void this.startPressAnimation(t);this.checkBoundsAfterContextMenu&&!this.inBounds(t)||(this.checkBoundsAfterContextMenu=!1,this.state=Ot.TOUCH_DELAY,await new Promise((t=>{setTimeout(t,150)})),this.state===Ot.TOUCH_DELAY&&(this.state=Ot.HOLDING,this.startPressAnimation(t)))}}handleClick(){this.disabled||(this.state!==Ot.WAITING_FOR_CLICK?this.state===Ot.INACTIVE&&(this.startPressAnimation(),this.endPressAnimation()):this.endPressAnimation())}handlePointercancel(t){this.shouldReactToEvent(t)&&this.endPressAnimation()}handleContextmenu(){this.disabled||(this.checkBoundsAfterContextMenu=!0,this.endPressAnimation())}determineRippleSize(){const{height:t,width:e}=this.getBoundingClientRect(),i=Math.max(t,e),s=Math.max(.35*i,75),o=Math.floor(.2*i),r=Math.sqrt(e**2+t**2)+10;this.initialSize=o,this.rippleScale=""+(r+s)/o,this.rippleSize=`${o}px`}getNormalizedPointerEventCoords(t){const{scrollX:e,scrollY:i}=window,{left:s,top:o}=this.getBoundingClientRect(),r=e+s,n=i+o,{pageX:a,pageY:l}=t;return{x:a-r,y:l-n}}getTranslationCoordinates(t){const{height:e,width:i}=this.getBoundingClientRect(),s={x:(i-this.initialSize)/2,y:(e-this.initialSize)/2};let o;return o=t instanceof PointerEvent?this.getNormalizedPointerEventCoords(t):{x:i/2,y:e/2},o={x:o.x-this.initialSize/2,y:o.y-this.initialSize/2},{startPoint:o,endPoint:s}}startPressAnimation(t){if(!this.mdRoot)return;this.pressed=!0,this.growAnimation?.cancel(),this.determineRippleSize();const{startPoint:e,endPoint:i}=this.getTranslationCoordinates(t),s=`${e.x}px, ${e.y}px`,o=`${i.x}px, ${i.y}px`;this.growAnimation=this.mdRoot.animate({top:[0,0],left:[0,0],height:[this.rippleSize,this.rippleSize],width:[this.rippleSize,this.rippleSize],transform:[`translate(${s}) scale(1)`,`translate(${o}) scale(${this.rippleScale})`]},{pseudoElement:"::after",duration:450,easing:Rt.STANDARD,fill:"forwards"})}async endPressAnimation(){this.rippleStartEvent=void 0,this.state=Ot.INACTIVE;const t=this.growAnimation;let e=1/0;"number"==typeof t?.currentTime?e=t.currentTime:t?.currentTime&&(e=t.currentTime.to("ms").value),e>=225?this.pressed=!1:(await new Promise((t=>{setTimeout(t,225-e)})),this.growAnimation===t&&(this.pressed=!1))}shouldReactToEvent(t){if(this.disabled||!t.isPrimary)return!1;if(this.rippleStartEvent&&this.rippleStartEvent.pointerId!==t.pointerId)return!1;if("pointerenter"===t.type||"pointerleave"===t.type)return!this.isTouch(t);const e=1===t.buttons;return this.isTouch(t)||e}inBounds({x:t,y:e}){const{top:i,left:s,bottom:o,right:r}=this.getBoundingClientRect();return t>=s&&t<=r&&e>=i&&e<=o}isTouch({pointerType:t}){return"touch"===t}async handleEvent(t){if(!Lt?.matches)switch(t.type){case"click":this.handleClick();break;case"contextmenu":this.handleContextmenu();break;case"pointercancel":this.handlePointercancel(t);break;case"pointerdown":await this.handlePointerdown(t);break;case"pointerenter":this.handlePointerenter(t);break;case"pointerleave":this.handlePointerleave(t);break;case"pointerup":this.handlePointerup(t)}}onControlChange(t,e){for(const i of zt)t?.removeEventListener(i,this),e?.addEventListener(i,this)}}t([ut({type:Boolean,reflect:!0})],Mt.prototype,"disabled",void 0),t([mt()],Mt.prototype,"hovered",void 0),t([mt()],Mt.prototype,"pressed",void 0),t([vt(".surface")],Mt.prototype,"mdRoot",void 0);const Ut=n`:host{display:flex;margin:auto;pointer-events:none}:host([disabled]){display:none}@media(forced-colors: active){:host{display:none}}:host,.surface{border-radius:inherit;position:absolute;inset:0;overflow:hidden}.surface{-webkit-tap-highlight-color:rgba(0,0,0,0)}.surface::before,.surface::after{content:"";opacity:0;position:absolute}.surface::before{background-color:var(--md-ripple-hover-color, var(--md-sys-color-on-surface, #1d1b20));inset:0;transition:opacity 15ms linear,background-color 15ms linear}.surface::after{background:radial-gradient(closest-side, var(--md-ripple-pressed-color, var(--md-sys-color-on-surface, #1d1b20)) max(100% - 70px, 65%), transparent 100%);transform-origin:center center;transition:opacity 375ms linear}.hovered::before{background-color:var(--md-ripple-hover-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-ripple-hover-opacity, 0.08)}.pressed::after{opacity:var(--md-ripple-pressed-opacity, 0.12);transition-duration:105ms}/*# sourceMappingURL=ripple-styles.css.map */ +`;let Ht=class extends Mt{};Ht.styles=[Ut],Ht=t([dt("md-ripple")],Ht);const Nt=["ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaCurrent","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText"];function Dt(t){return t.replace("aria","aria-").replace(/Elements?/g,"").toLowerCase()}function Bt(t){for(const e of Nt)t.createProperty(e,{attribute:Dt(e),reflect:!0});t.addInitializer((t=>{const e={hostConnected(){t.setAttribute("role","presentation")}};t.addController(e)}))}Nt.map(Dt);const Vt=Symbol("internals"),jt=Symbol("privateInternals");function Ft(t){return class extends t{get[Vt](){return this[jt]||(this[jt]=this.attachInternals()),this[jt]}}}function Wt(t){t.addInitializer((t=>{const e=t;e.addEventListener("click",(async t=>{const{type:i,[Vt]:s}=e,{form:o}=s;o&&"button"!==i&&(await new Promise((t=>{setTimeout(t)})),t.defaultPrevented||("reset"!==i?(o.addEventListener("submit",(t=>{Object.defineProperty(t,"submitter",{configurable:!0,enumerable:!0,get:()=>e})}),{capture:!0,once:!0}),s.setFormValue(e.value),o.requestSubmit()):o.reset()))}))}))}function qt(t){const e=new MouseEvent("click",{bubbles:!0});return t.dispatchEvent(e),e}function Yt(t){return t.currentTarget===t.target&&(t.composedPath()[0]===t.target&&(!t.target.disabled&&!function(t){const e=Gt;e&&(t.preventDefault(),t.stopImmediatePropagation());return async function(){Gt=!0,await null,Gt=!1}(),e}(t)))}let Gt=!1;const Kt=Ft(lt);class Zt extends Kt{get name(){return this.getAttribute("name")??""}set name(t){this.setAttribute("name",t)}get form(){return this[Vt].form}constructor(){super(),this.disabled=!1,this.href="",this.target="",this.trailingIcon=!1,this.hasIcon=!1,this.type="submit",this.value="",this.handleActivationClick=t=>{Yt(t)&&this.buttonElement&&(this.focus(),qt(this.buttonElement))},this.addEventListener("click",this.handleActivationClick)}focus(){this.buttonElement?.focus()}blur(){this.buttonElement?.blur()}render(){const t=this.disabled&&!this.href,e=this.href?this.renderLink():this.renderButton(),i=this.href?"link":"button";return j` + ${this.renderElevationOrOutline?.()} +
    + + + ${e} + `}renderButton(){const{ariaLabel:t,ariaHasPopup:e,ariaExpanded:i}=this;return j``}renderLink(){const{ariaLabel:t,ariaHasPopup:e,ariaExpanded:i}=this;return j`${this.renderContent()} + `}renderContent(){const t=j``;return j` + + ${this.trailingIcon?q:t} + + ${this.trailingIcon?t:q} + `}handleSlotChange(){this.hasIcon=this.assignedIcons.length>0}}Bt(Zt),Wt(Zt),Zt.formAssociated=!0,Zt.shadowRootOptions={mode:"open",delegatesFocus:!0},t([ut({type:Boolean,reflect:!0})],Zt.prototype,"disabled",void 0),t([ut()],Zt.prototype,"href",void 0),t([ut()],Zt.prototype,"target",void 0),t([ut({type:Boolean,attribute:"trailing-icon",reflect:!0})],Zt.prototype,"trailingIcon",void 0),t([ut({type:Boolean,attribute:"has-icon",reflect:!0})],Zt.prototype,"hasIcon",void 0),t([ut()],Zt.prototype,"type",void 0),t([ut({reflect:!0})],Zt.prototype,"value",void 0),t([vt(".button")],Zt.prototype,"buttonElement",void 0),t([gt({slot:"icon",flatten:!0})],Zt.prototype,"assignedIcons",void 0);class Jt extends Zt{}const Xt=n`:host{--_container-height: var(--md-text-button-container-height, 40px);--_container-shape: var(--md-text-button-container-shape, 9999px);--_disabled-label-text-color: var(--md-text-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-text-button-disabled-label-text-opacity, 0.38);--_focus-label-text-color: var(--md-text-button-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-label-text-color: var(--md-text-button-hover-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-text-button-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-text-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-text-button-label-text-color, var(--md-sys-color-primary, #6750a4));--_label-text-font: var(--md-text-button-label-text-font, var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-text-button-label-text-line-height, var(--md-sys-typescale-label-large-line-height, 1.25rem));--_label-text-size: var(--md-text-button-label-text-size, var(--md-sys-typescale-label-large-size, 0.875rem));--_label-text-weight: var(--md-text-button-label-text-weight, var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500)));--_pressed-label-text-color: var(--md-text-button-pressed-label-text-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-color: var(--md-text-button-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-text-button-pressed-state-layer-opacity, 0.12);--_disabled-icon-color: var(--md-text-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-text-button-disabled-icon-opacity, 0.38);--_focus-icon-color: var(--md-text-button-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_hover-icon-color: var(--md-text-button-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-color: var(--md-text-button-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-size: var(--md-text-button-icon-size, 18px);--_pressed-icon-color: var(--md-text-button-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_leading-space: var(--md-text-button-leading-space, 12px);--_trailing-space: var(--md-text-button-trailing-space, 12px);--_with-leading-icon-leading-space: var(--md-text-button-with-leading-icon-leading-space, 12px);--_with-leading-icon-trailing-space: var(--md-text-button-with-leading-icon-trailing-space, 16px);--_with-trailing-icon-leading-space: var(--md-text-button-with-trailing-icon-leading-space, 16px);--_with-trailing-icon-trailing-space: var(--md-text-button-with-trailing-icon-trailing-space, 12px);--_container-color: none;--_disabled-container-color: none;--_disabled-container-opacity: 0;--_container-shape-start-start: var( --md-text-button-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-text-button-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-text-button-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-text-button-container-shape-end-start, var(--_container-shape) )}/*# sourceMappingURL=text-styles.css.map */ +`;class Qt extends Jt{}Qt.styles=[bt,Xt],customElements.define("ew-text-button",Qt);class te extends lt{constructor(){super(...arguments),this.inset=!1,this.insetStart=!1,this.insetEnd=!1}}t([ut({type:Boolean,reflect:!0})],te.prototype,"inset",void 0),t([ut({type:Boolean,reflect:!0,attribute:"inset-start"})],te.prototype,"insetStart",void 0),t([ut({type:Boolean,reflect:!0,attribute:"inset-end"})],te.prototype,"insetEnd",void 0);const ee=n`:host{box-sizing:border-box;color:var(--md-divider-color, var(--md-sys-color-outline-variant, #cac4d0));display:flex;height:var(--md-divider-thickness, 1px);width:100%}:host([inset]),:host([inset-start]){padding-inline-start:16px}:host([inset]),:host([inset-end]){padding-inline-end:16px}:host::before{background:currentColor;content:"";height:100%;width:100%}@media(forced-colors: active){:host::before{background:CanvasText}}/*# sourceMappingURL=divider-styles.css.map */ +`;function ie(t,e){!e.bubbles||t.shadowRoot&&!e.composed||e.stopPropagation();const i=Reflect.construct(e.constructor,[e.type,e]),s=t.dispatchEvent(i);return s||e.preventDefault(),s}let se=class extends te{};se.styles=[ee],se=t([dt("md-divider")],se);const oe={dialog:[[[{transform:"translateY(-50px)"},{transform:"translateY(0)"}],{duration:500,easing:Rt.EMPHASIZED}]],scrim:[[[{opacity:0},{opacity:.32}],{duration:500,easing:"linear"}]],container:[[[{opacity:0},{opacity:1}],{duration:50,easing:"linear",pseudoElement:"::before"}],[[{height:"35%"},{height:"100%"}],{duration:500,easing:Rt.EMPHASIZED,pseudoElement:"::before"}]],headline:[[[{opacity:0},{opacity:0,offset:.2},{opacity:1}],{duration:250,easing:"linear",fill:"forwards"}]],content:[[[{opacity:0},{opacity:0,offset:.2},{opacity:1}],{duration:250,easing:"linear",fill:"forwards"}]],actions:[[[{opacity:0},{opacity:0,offset:.5},{opacity:1}],{duration:300,easing:"linear",fill:"forwards"}]]},re={dialog:[[[{transform:"translateY(0)"},{transform:"translateY(-50px)"}],{duration:150,easing:Rt.EMPHASIZED_ACCELERATE}]],scrim:[[[{opacity:.32},{opacity:0}],{duration:150,easing:"linear"}]],container:[[[{height:"100%"},{height:"35%"}],{duration:150,easing:Rt.EMPHASIZED_ACCELERATE,pseudoElement:"::before"}],[[{opacity:"1"},{opacity:"0"}],{delay:100,duration:50,easing:"linear",pseudoElement:"::before"}]],headline:[[[{opacity:1},{opacity:0}],{duration:100,easing:"linear",fill:"forwards"}]],content:[[[{opacity:1},{opacity:0}],{duration:100,easing:"linear",fill:"forwards"}]],actions:[[[{opacity:1},{opacity:0}],{duration:100,easing:"linear",fill:"forwards"}]]};class ne extends lt{get open(){return this.isOpen}set open(t){t!==this.isOpen&&(this.isOpen=t,t?(this.setAttribute("open",""),this.show()):(this.removeAttribute("open"),this.close()))}constructor(){super(),this.returnValue="",this.getOpenAnimation=()=>oe,this.getCloseAnimation=()=>re,this.isOpen=!1,this.isOpening=!1,this.isConnectedPromise=this.getIsConnectedPromise(),this.isAtScrollTop=!1,this.isAtScrollBottom=!1,this.nextClickIsFromContent=!1,this.hasHeadline=!1,this.hasActions=!1,this.hasIcon=!1,this.escapePressedWithoutCancel=!1,this.addEventListener("submit",this.handleSubmit),this.addEventListener("focus",(()=>{this.dialog?.focus()})),this.addEventListener("blur",(()=>{this.dialog?.blur()}))}async show(){this.isOpening=!0,await this.isConnectedPromise,await this.updateComplete;const t=this.dialog;if(t.open||!this.isOpening)return void(this.isOpening=!1);this.dispatchEvent(new Event("open",{cancelable:!0}))?(t.showModal(),this.open=!0,this.scroller&&(this.scroller.scrollTop=0),this.querySelector("[autofocus]")?.focus(),await this.animateDialog(this.getOpenAnimation()),this.dispatchEvent(new Event("opened")),this.isOpening=!1):this.open=!1}async close(t=this.returnValue){if(this.isOpening=!1,!this.isConnected)return void(this.open=!1);await this.updateComplete;const e=this.dialog;if(!e.open||this.isOpening)return void(this.open=!1);const i=this.returnValue;this.returnValue=t;this.dispatchEvent(new Event("close",{cancelable:!0}))?(await this.animateDialog(this.getCloseAnimation()),e.close(t),this.open=!1,this.dispatchEvent(new Event("closed"))):this.returnValue=i}connectedCallback(){super.connectedCallback(),this.isConnectedPromiseResolve()}disconnectedCallback(){super.disconnectedCallback(),this.isConnectedPromise=this.getIsConnectedPromise()}render(){const t=this.open&&!(this.isAtScrollTop&&this.isAtScrollBottom),e={"has-headline":this.hasHeadline,"has-actions":this.hasActions,"has-icon":this.hasIcon,scrollable:t,"show-top-divider":t&&!this.isAtScrollTop,"show-bottom-divider":t&&!this.isAtScrollBottom},{ariaLabel:i}=this;return j` +
    + +
    +
    + +

    + +

    + +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    + `}firstUpdated(){this.intersectionObserver=new IntersectionObserver((t=>{for(const e of t)this.handleAnchorIntersection(e)}),{root:this.scroller}),this.intersectionObserver.observe(this.topAnchor),this.intersectionObserver.observe(this.bottomAnchor)}handleDialogClick(){if(this.nextClickIsFromContent)return void(this.nextClickIsFromContent=!1);!this.dispatchEvent(new Event("cancel",{cancelable:!0}))||this.close()}handleContentClick(){this.nextClickIsFromContent=!0}handleSubmit(t){const e=t.target,{submitter:i}=t;"dialog"===e.method&&i&&this.close(i.getAttribute("value")??this.returnValue)}handleCancel(t){if(t.target!==this.dialog)return;this.escapePressedWithoutCancel=!1;const e=!ie(this,t);t.preventDefault(),e||this.close()}handleClose(){this.escapePressedWithoutCancel&&(this.escapePressedWithoutCancel=!1,this.dialog?.dispatchEvent(new Event("cancel",{cancelable:!0})))}handleKeydown(t){"Escape"===t.key&&(this.escapePressedWithoutCancel=!0,setTimeout((()=>{this.escapePressedWithoutCancel=!1})))}async animateDialog(t){const{dialog:e,scrim:i,container:s,headline:o,content:r,actions:n}=this;if(!(e&&i&&s&&o&&r&&n))return;const{container:a,dialog:l,scrim:c,headline:d,content:h,actions:p}=t,u=[[e,l??[]],[i,c??[]],[s,a??[]],[o,d??[]],[r,h??[]],[n,p??[]]],m=[];for(const[t,e]of u)for(const i of e)m.push(t.animate(...i));await Promise.all(m.map((t=>t.finished)))}handleHeadlineChange(t){const e=t.target;this.hasHeadline=e.assignedElements().length>0}handleActionsChange(t){const e=t.target;this.hasActions=e.assignedElements().length>0}handleIconChange(t){const e=t.target;this.hasIcon=e.assignedElements().length>0}handleAnchorIntersection(t){const{target:e,isIntersecting:i}=t;e===this.topAnchor&&(this.isAtScrollTop=i),e===this.bottomAnchor&&(this.isAtScrollBottom=i)}getIsConnectedPromise(){return new Promise((t=>{this.isConnectedPromiseResolve=t}))}}Bt(ne),t([ut({type:Boolean})],ne.prototype,"open",null),t([ut({attribute:!1})],ne.prototype,"returnValue",void 0),t([ut()],ne.prototype,"type",void 0),t([vt("dialog")],ne.prototype,"dialog",void 0),t([vt(".scrim")],ne.prototype,"scrim",void 0),t([vt(".container")],ne.prototype,"container",void 0),t([vt(".headline")],ne.prototype,"headline",void 0),t([vt(".content")],ne.prototype,"content",void 0),t([vt(".actions")],ne.prototype,"actions",void 0),t([mt()],ne.prototype,"isAtScrollTop",void 0),t([mt()],ne.prototype,"isAtScrollBottom",void 0),t([vt(".scroller")],ne.prototype,"scroller",void 0),t([vt(".top.anchor")],ne.prototype,"topAnchor",void 0),t([vt(".bottom.anchor")],ne.prototype,"bottomAnchor",void 0),t([mt()],ne.prototype,"hasHeadline",void 0),t([mt()],ne.prototype,"hasActions",void 0),t([mt()],ne.prototype,"hasIcon",void 0);const ae=n`:host{border-start-start-radius:var(--md-dialog-container-shape-start-start, var(--md-dialog-container-shape, 28px));border-start-end-radius:var(--md-dialog-container-shape-start-end, var(--md-dialog-container-shape, 28px));border-end-end-radius:var(--md-dialog-container-shape-end-end, var(--md-dialog-container-shape, 28px));border-end-start-radius:var(--md-dialog-container-shape-end-start, var(--md-dialog-container-shape, 28px));display:contents;margin:auto;max-height:min(560px,100% - 48px);max-width:min(560px,100% - 48px);min-height:140px;min-width:280px;position:fixed;height:fit-content;width:fit-content}dialog{background:rgba(0,0,0,0);border:none;border-radius:inherit;flex-direction:column;height:inherit;margin:inherit;max-height:inherit;max-width:inherit;min-height:inherit;min-width:inherit;outline:none;overflow:visible;padding:0;width:inherit}dialog[open]{display:flex}::backdrop{background:none}.scrim{background:var(--md-sys-color-scrim, #000);display:none;inset:0;opacity:32%;pointer-events:none;position:fixed;z-index:1}:host([open]) .scrim{display:flex}h2{all:unset;align-self:stretch}.headline{align-items:center;color:var(--md-dialog-headline-color, var(--md-sys-color-on-surface, #1d1b20));display:flex;flex-direction:column;font-family:var(--md-dialog-headline-font, var(--md-sys-typescale-headline-small-font, var(--md-ref-typeface-brand, Roboto)));font-size:var(--md-dialog-headline-size, var(--md-sys-typescale-headline-small-size, 1.5rem));line-height:var(--md-dialog-headline-line-height, var(--md-sys-typescale-headline-small-line-height, 2rem));font-weight:var(--md-dialog-headline-weight, var(--md-sys-typescale-headline-small-weight, var(--md-ref-typeface-weight-regular, 400)));position:relative}slot[name=headline]::slotted(*){align-items:center;align-self:stretch;box-sizing:border-box;display:flex;gap:8px;padding:24px 24px 0}.icon{display:flex}slot[name=icon]::slotted(*){color:var(--md-dialog-icon-color, var(--md-sys-color-secondary, #625b71));fill:currentColor;font-size:var(--md-dialog-icon-size, 24px);margin-top:24px;height:var(--md-dialog-icon-size, 24px);width:var(--md-dialog-icon-size, 24px)}.has-icon slot[name=headline]::slotted(*){justify-content:center;padding-top:16px}.scrollable slot[name=headline]::slotted(*){padding-bottom:16px}.scrollable.has-headline slot[name=content]::slotted(*){padding-top:8px}.container{border-radius:inherit;display:flex;flex-direction:column;flex-grow:1;overflow:hidden;position:relative;transform-origin:top}.container::before{background:var(--md-dialog-container-color, var(--md-sys-color-surface-container-high, #ece6f0));border-radius:inherit;content:"";inset:0;position:absolute}.scroller{display:flex;flex:1;flex-direction:column;overflow:hidden;z-index:1}.scrollable .scroller{overflow-y:scroll}.content{color:var(--md-dialog-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-dialog-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-dialog-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-dialog-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-dialog-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)));height:min-content;position:relative}slot[name=content]::slotted(*){box-sizing:border-box;padding:24px}.anchor{position:absolute}.top.anchor{top:0}.bottom.anchor{bottom:0}.actions{position:relative}slot[name=actions]::slotted(*){box-sizing:border-box;display:flex;gap:8px;justify-content:flex-end;padding:16px 24px 24px}.has-actions slot[name=content]::slotted(*){padding-bottom:8px}md-divider{display:none;position:absolute}.has-headline.show-top-divider .headline md-divider,.has-actions.show-bottom-divider .actions md-divider{display:flex}.headline md-divider{bottom:0}.actions md-divider{top:0}@media(forced-colors: active){dialog{outline:2px solid WindowText}}/*# sourceMappingURL=dialog-styles.css.map */ +`;class le extends ne{}le.styles=[ae],customElements.define("ew-dialog",le);const ce=n` + :host { + --roboto-font: Roboto, system-ui; + --text-color: rgba(0, 0, 0, 0.6); + --danger-color: #db4437; + + --md-sys-color-primary: #03a9f4; + --md-sys-color-on-primary: #fff; + --md-ref-typeface-brand: var(--roboto-font); + --md-ref-typeface-plain: var(--roboto-font); + + --md-sys-color-surface: #fff; + --md-sys-color-surface-container: #fff; + --md-sys-color-surface-container-high: #fff; + --md-sys-color-surface-container-highest: #f5f5f5; + --md-sys-color-secondary-container: #e0e0e0; + + --md-sys-typescale-headline-font: var(--roboto-font); + --md-sys-typescale-title-font: var(--roboto-font); + } + + a { + color: var(--md-sys-color-primary); + } +`;export{te as D,Rt as E,q as T,t as _,vt as a,kt as b,ee as c,Vt as d,ft as e,mt as f,Yt as g,qt as h,n as i,ie as j,Wt as k,at as l,Ft as m,ut as n,gt as o,Pt as p,Tt as q,Bt as r,lt as s,dt as t,St as u,It as v,W as w,j as x,F as y,ce as z}; diff --git a/public/manifest_owcare.json b/public/manifest_owcare.json deleted file mode 100644 index ecae10f..0000000 --- a/public/manifest_owcare.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "Owcare", - "version": "0.1.0", - "home_assistant_domain": "owcare", - "funding_url": "https://owkor.com/guides/supporters.html", - "new_install_prompt_erase": false, - "builds": [ - { - "chipFamily": "ESP32C3", - "parts": [ - { "path": "bootloader_dout_40m.bin", "offset": 0 }, - { "path": "partitions.bin", "offset": 32768 }, - { "path": "boot_app0.bin", "offset": 57344 }, - { "path": "esp32-c3.bin", "offset": 65536 } - ] - }, - { - "chipFamily": "ESP32-S3", - "parts": [ - { "path": "bootloader_dout_40m.bin", "offset": 4096 }, - { "path": "partitions.bin", "offset": 32768 }, - { "path": "boot_app0.bin", "offset": 57344 }, - { "path": "esp32-s3.bin", "offset": 65536 } - ] - } - ] - } \ No newline at end of file diff --git a/public/release/r60abd1/a4/0_0_19.json b/public/release/r60abd1/a4/0_0_19.json new file mode 100644 index 0000000..b3eb2c5 --- /dev/null +++ b/public/release/r60abd1/a4/0_0_19.json @@ -0,0 +1,15 @@ +{ + "name": "OwRadar", + "version": "0.0.19", + "home_assistant_domain": "owradar", + "funding_url": "https://owradar.owkor.com/guides/supporters.html", + "new_install_prompt_erase": false, + "builds": [ + { + "chipFamily": "ESP32C3", + "parts": [ + { "path": "https://github.com/zomco/owradar-site/releases/download/0.0.19-a%2B4/merge-esp32c3-r60abd1-a4.bin", "offset": 0 } + ] + } + ] +} \ No newline at end of file diff --git a/public/release/r60abd1/zero/0_0_19.json b/public/release/r60abd1/zero/0_0_19.json new file mode 100644 index 0000000..dd76bcb --- /dev/null +++ b/public/release/r60abd1/zero/0_0_19.json @@ -0,0 +1,15 @@ +{ + "name": "OwRadar", + "version": "0.0.19", + "home_assistant_domain": "owradar", + "funding_url": "https://owradar.owkor.com/guides/supporters.html", + "new_install_prompt_erase": false, + "builds": [ + { + "chipFamily": "ESP32C3", + "parts": [ + { "path": "https://github.com/zomco/owradar-site/releases/download/0.0.19-a%2B4/merge-esp32c3-r60abd1-zero.bin", "offset": 0 } + ] + } + ] +} \ No newline at end of file diff --git a/tailwind.config.ts b/tailwind.config.ts index 64d7a24..84287e8 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -1,23 +1,80 @@ -import type { Config } from 'tailwindcss' +import type { Config } from "tailwindcss" -const config: Config = { +const config = { + darkMode: ["class"], content: [ - './pages/**/*.{js,ts,jsx,tsx,mdx}', - './components/**/*.{js,ts,jsx,tsx,mdx}', - './app/**/*.{js,ts,jsx,tsx,mdx}', - ], + './pages/**/*.{ts,tsx}', + './components/**/*.{ts,tsx}', + './app/**/*.{ts,tsx}', + './src/**/*.{ts,tsx}', + ], + prefix: "", theme: { + container: { + center: true, + padding: "2rem", + screens: { + "2xl": "1400px", + }, + }, extend: { - backgroundImage: { - 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))', - 'gradient-conic': - 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))', + colors: { + border: "hsl(var(--border))", + input: "hsl(var(--input))", + ring: "hsl(var(--ring))", + background: "hsl(var(--background))", + foreground: "hsl(var(--foreground))", + primary: { + DEFAULT: "hsl(var(--primary))", + foreground: "hsl(var(--primary-foreground))", + }, + secondary: { + DEFAULT: "hsl(var(--secondary))", + foreground: "hsl(var(--secondary-foreground))", + }, + destructive: { + DEFAULT: "hsl(var(--destructive))", + foreground: "hsl(var(--destructive-foreground))", + }, + muted: { + DEFAULT: "hsl(var(--muted))", + foreground: "hsl(var(--muted-foreground))", + }, + accent: { + DEFAULT: "hsl(var(--accent))", + foreground: "hsl(var(--accent-foreground))", + }, + popover: { + DEFAULT: "hsl(var(--popover))", + foreground: "hsl(var(--popover-foreground))", + }, + card: { + DEFAULT: "hsl(var(--card))", + foreground: "hsl(var(--card-foreground))", + }, + }, + borderRadius: { + lg: "var(--radius)", + md: "calc(var(--radius) - 2px)", + sm: "calc(var(--radius) - 4px)", }, - fontFamily: { - default: ['var(--font-inter)'], + keyframes: { + "accordion-down": { + from: { height: "0" }, + to: { height: "var(--radix-accordion-content-height)" }, + }, + "accordion-up": { + from: { height: "var(--radix-accordion-content-height)" }, + to: { height: "0" }, + }, + }, + animation: { + "accordion-down": "accordion-down 0.2s ease-out", + "accordion-up": "accordion-up 0.2s ease-out", }, }, }, - plugins: [], -} -export default config + plugins: [require("tailwindcss-animate")], +} satisfies Config + +export default config \ No newline at end of file