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:calc(var(--uib-size)*.42);justify-content:center;width:var(--uib-size)}:host([hidden]){display:none}.container{height:calc(var(--uib-size)*.42);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;transition:stroke .5s ease;will-change:stroke-dasharray,stroke-dashoffset}.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="M26.7,12.2c3.5,3.4,7.4,7.8,12.7,7.8c5.5,0,9.6-4.4,9.6-9.5C49,5,45.1,1,39.8,1c-5.5,0-9.5,4.2-13.1,7.8l-3.4,3.3c-3.6,3.6-7.6,7.8-13.1,7.8C4.9,20,1,16,1,10.5C1,5.4,5.1,1,10.6,1c5.3,0,9.2,4.5,12.7,7.8L26.7,12.2z"}connectedCallback(){this.upgradeStoredProps(),this.applyDefaultProps({size:55,color:"black",speed:1.3,stroke:4,"stroke-length":.15,"bg-opacity":.1});const e=parseInt(this.size),i=t(e/50,this.d);this.template.innerHTML=`\n      <svg\n        class="container" \n        x="0px" \n        y="0px"\n        viewBox="0 0 ${this.size} ${e*(2.1/5)}"\n        height="${e*(2.1/5)}"\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="${i}"\n        />\n\n        <path\n          class="car" \n          fill="none" \n          stroke-width="${this.stroke}" \n          pathlength="100"\n          d="${i}"\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"),n=parseInt(this.size);e&&(i.setAttribute("height",String(n*(2.1/5))),i.setAttribute("width",this.size),i.setAttribute("viewBox",`0 0 ${this.size} ${n*(2.1/5)}`),r.forEach((e=>{e.setAttribute("stroke-width",this.stroke),e.setAttribute("d",t(n/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-infinity")=>{customElements.get(t)||customElements.define(t,class extends i{})},element:i};export{r as default};
//# sourceMappingURL=infinity.js.map
