var t=this&&this.__decorate||function(t,e,i,s){var r,o=arguments.length,n=o<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--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,i,n):r(e,i))||n);return o>3&&n&&Object.defineProperty(e,i,n),n},e=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};import{LitElement as i,css as s}from"../../lit/index.js";import{query as r}from"../../lit/decorators.js";export const BaseCSS=s`
:host {
  opacity: 0;
}
:host(.wired-rendered) {
  opacity: 1;
}
#overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}
svg {
  display: block;
}
path {
  stroke: currentColor;
  stroke-width: 0.7;
  fill: transparent;
}
.hidden {
  display: none !important;
}
`;export class WiredBase extends i{constructor(){super(...arguments),this.lastSize=[0,0],this.seed=Math.floor(Math.random()*2**31)}updated(t){this.wiredRender()}wiredRender(t=!1){if(this.svg){const e=this.canvasSize();if(!t&&e[0]===this.lastSize[0]&&e[1]===this.lastSize[1])return;for(;this.svg.hasChildNodes();)this.svg.removeChild(this.svg.lastChild);this.svg.setAttribute("width",`${e[0]}`),this.svg.setAttribute("height",`${e[1]}`),this.draw(this.svg,e),this.lastSize=e,this.classList.add("wired-rendered")}}fire(t,e){fireEvent(this,t,e)}}t([r("svg"),e("design:type",SVGSVGElement)],WiredBase.prototype,"svg",void 0);export function randomSeed(){return Math.floor(Math.random()*2**31)}export function fireEvent(t,e,i){t.dispatchEvent(new CustomEvent(e,{composed:!0,bubbles:!0,detail:i}))}