import t from"../lib/scaleD.js";import e from"../lib/LdrsBaseElement.js";var s=":host{align-items:center;display:inline-flex;flex-shrink:0;height:var(--uib-size);justify-content:center;width:var(--uib-size)}:host([hidden]){display:none}.container{height:var(--uib-size);overflow:visible;transform-origin:center;width:var(--uib-size)}.car{fill:none;stroke:var(--uib-color);stroke-dasharray:var(--uib-dash),var(--uib-gap);stroke-dashoffset:0;stroke-linecap:round;animation:travel var(--uib-speed) linear infinite;will-change:stroke-dasharray,stroke-dashoffset}.car,.track{transition:stroke .5s ease}.track{stroke:var(--uib-color);opacity:var(--uib-bg-opacity)}@keyframes travel{0%{stroke-dashoffset:0}to{stroke-dashoffset:100}}";class i extends e{_attributes=["size","color","speed","stroke","stroke-length","bg-opacity"];size;color;speed;stroke;"stroke-length";"bg-opacity";d;static get observedAttributes(){return["size","color","speed","stroke","stroke-length","bg-opacity"]}constructor(){super(),this.storePropsToUpgrade(this._attributes),this.reflect(this._attributes),this.d="M49.5,42.9c0-18.1-9.9-34-24.5-42.4C10.4,9,0.5,24.8,0.5,42.9c7.2,4.2,15.6,6.6,24.5,6.6S42.3,47.1,49.5,42.9z"}connectedCallback(){this.upgradeStoredProps(),this.applyDefaultProps({size:37,color:"black",stroke:5,speed:.9,"stroke-length":.15,"bg-opacity":.1});const e=t(parseInt(this.size)/50,this.d);this.template.innerHTML=`\n      <svg\n        class="container" \n        x="0px" \n        y="0px"\n        viewBox="0 0 ${this.size} ${this.size}"\n        height="${this.size}"\n        width="${this.size}"\n        preserveAspectRatio='xMidYMid meet'\n      >\n        <path\n          class="track" \n          fill="none" \n          stroke-width="${this.stroke}" \n          pathlength="100"\n          d="${e}"\n        />\n\n        <path\n          class="car" \n          fill="none" \n          stroke-width="${this.stroke}" \n          pathlength="100"\n          d="${e}"\n        />\n      </svg>\n      <style>\n        :host{\n          --uib-size: ${this.size}px;\n          --uib-color: ${this.color};\n          --uib-speed: ${this.speed}s;\n          --uib-dash: ${100*parseFloat(this["stroke-length"])};\n          --uib-gap: ${100-100*parseFloat(this["stroke-length"])};\n          --uib-bg-opacity: ${this["bg-opacity"]};\n        }\n        ${s}\n      </style>\n    `,this.shadow.replaceChildren(this.template.content.cloneNode(!0))}attributeChangedCallback(){const e=this.shadow.querySelector("style"),i=this.shadow.querySelector("svg"),r=this.shadow.querySelectorAll("path");e&&(i.setAttribute("height",this.size),i.setAttribute("width",this.size),i.setAttribute("viewBox",`0 0 ${this.size} ${this.size}`),r.forEach((e=>{e.setAttribute("stroke-width",this.stroke),e.setAttribute("d",t(parseInt(this.size)/50,this.d))})),e.innerHTML=`\n      :host{\n        --uib-size: ${this.size}px;\n        --uib-color: ${this.color};\n        --uib-speed: ${this.speed}s;\n        --uib-dash: ${100*parseFloat(this["stroke-length"])};\n        --uib-gap: ${100-100*parseFloat(this["stroke-length"])};\n        --uib-bg-opacity: ${this["bg-opacity"]};\n      }\n      ${s}\n    `)}}var r={register:(t="l-reuleaux")=>{customElements.get(t)||customElements.define(t,class extends i{})},element:i};export{r as default};
//# sourceMappingURL=reuleaux.js.map
