select-previsao-ondas
Version:
Componente que busca a previsão de ondas por praias
1 lines • 8.27 kB
JavaScript
const e="select-previsao-ondas";let t,n,l=0,s=!1;const o="undefined"!=typeof window?window:{},r=o.CSS,c=o.document||{head:{}},a={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l)},i=(()=>(c.head.attachShadow+"").indexOf("[native")>-1)(),u=e=>Promise.resolve(e),p=(()=>{try{return new CSSStyleSheet,!0}catch(e){}return!1})(),f=new WeakMap,d=e=>"sc-"+e,m={},$=e=>"object"==(e=typeof e)||"function"===e,h=(e,t,...n)=>{let l=null,s=!1,o=!1,r=[];const c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!$(l))&&(l+=""),s&&o?r[r.length-1].s+=l:r.push(s?_(null,l):l),o=s)};c(n);const a=_(e,null);return a.o=t,r.length>0&&(a.u=r),a},_=(e,t)=>({t:0,p:e,s:t,$:null,u:null,o:null}),w={},y=(e,t,n,l,s,r)=>{if(n!==l){let i=V(e,t),u=t.toLowerCase();if(i||"o"!==t[0]||"n"!==t[1]){const o=$(l);if((i||o&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[t]=l;else{let s=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==s||(e[t]=s)}}catch(c){}null==l||!1===l?e.removeAttribute(t):(!i||4&r||s)&&!o&&e.setAttribute(t,l=!0===l?"":l)}else t="-"===t[2]?t.slice(3):V(o,u)?u.slice(2):u[2]+t.slice(3),n&&a.rel(e,t,n,!1),l&&a.ael(e,t,l,!1)}},b=(e,t,n,l)=>{const s=11===t.$.nodeType&&t.$.host?t.$.host:t.$,o=e&&e.o||m,r=t.o||m;for(l in o)l in r||y(s,l,o[l],void 0,n,t.t);for(l in r)y(s,l,o[l],r[l],n,t.t)},v=(e,n,l)=>{let s,o,r=n.u[l],a=0;if(null!==r.s)s=r.$=c.createTextNode(r.s);else if(s=r.$=c.createElement(r.p),b(null,r,!1),null!=t&&s["s-si"]!==t&&s.classList.add(s["s-si"]=t),r.u)for(a=0;a<r.u.length;++a)o=v(e,r,a),o&&s.appendChild(o);return s},g=(e,t,l,s,o,r)=>{let c,a=e;for(a.shadowRoot&&a.tagName===n&&(a=a.shadowRoot);o<=r;++o)s[o]&&(c=v(null,l,o),c&&(s[o].$=c,a.insertBefore(c,t)))},j=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.$.remove()},M=(e,t)=>e.p===t.p,S=(e,t)=>{const n=t.$=e.$,l=e.u,s=t.u,o=t.s;null===o?(b(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,r=0,c=t.length-1,a=t[0],i=t[c],u=l.length-1,p=l[0],f=l[u];for(;o<=c&&r<=u;)null==a?a=t[++o]:null==i?i=t[--c]:null==p?p=l[++r]:null==f?f=l[--u]:M(a,p)?(S(a,p),a=t[++o],p=l[++r]):M(i,f)?(S(i,f),i=t[--c],f=l[--u]):M(a,f)?(S(a,f),e.insertBefore(a.$,i.$.nextSibling),a=t[++o],f=l[--u]):M(i,p)?(S(i,p),e.insertBefore(i.$,a.$),i=t[--c],p=l[++r]):(s=v(t&&t[r],n,r),p=l[++r],s&&a.$.parentNode.insertBefore(s,a.$));o>c?g(e,null==l[u+1]?null:l[u+1].$,n,l,r,u):r>u&&j(t,o,c)})(n,l,t,s):null!==s?(null!==e.s&&(n.textContent=""),g(n,null,t,s,0,s.length-1)):null!==l&&j(l,0,l.length-1)):e.s!==o&&(n.data=o)},R=(e,t,n)=>{const l=(e=>B(e).h)(e);return{emit:e=>L(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},L=(e,t,n)=>{const l=new CustomEvent(t,n);return e.dispatchEvent(l),l},U=(e,t)=>{t&&!e._&&t["s-p"].push(new Promise(t=>e._=t))},k=(e,t)=>{if(e.t|=16,4&e.t)return void(e.t|=512);const n=e.v,l=()=>C(e,n,t);let s;return U(e,e.g),t&&(s=O(n,"componentWillLoad")),A(s,()=>te(l))},C=(e,l,s)=>{const o=e.h,r=o["s-rc"];s&&(e=>{const t=e.j,n=e.h,l=t.t,s=((e,t)=>{let n=d(t.M),l=I.get(n);if(e=11===e.nodeType?e:c,l)if("string"==typeof l){let t,s=f.get(e=e.head||e);s||f.set(e,s=new Set),s.has(n)||(t=c.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),s&&s.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(i&&n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(e),((e,l)=>{const s=e.h,o=e.S||_(null,null),r=(e=>e&&e.p===w)(l)?l:h(null,null,l);n=s.tagName,r.p=null,r.t|=4,e.S=r,r.$=o.$=s.shadowRoot||s,t=s["s-sc"],S(o,r)})(e,P(l)),e.t&=-17,e.t|=2,r&&(r.map(e=>e()),o["s-rc"]=void 0);{const t=o["s-p"],n=()=>x(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},P=e=>{try{e=e.render()}catch(t){z(t)}return e},x=e=>{const t=e.h,n=e.g;64&e.t||(e.t|=64,T(t),e.R(t),n||E()),e._&&(e._(),e._=void 0),512&e.t&&ee(()=>k(e,!1)),e.t&=-517},E=()=>{T(c.documentElement),a.t|=2,ee(()=>L(o,"appload",{detail:{namespace:e}}))},O=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(l){z(l)}},A=(e,t)=>e&&e.then?e.then(t):t(),T=e=>e.classList.add("hydrated"),W=(e,t,n)=>{if(t.L){const l=Object.entries(t.L),s=e.prototype;l.map(([e,[t]])=>{(31&t||2&n&&32&t)&&Object.defineProperty(s,e,{get(){return((e,t)=>B(this).U.get(t))(0,e)},set(t){((e,t,n)=>{const l=B(this),s=l.U.get(t),o=l.t,r=l.v;n=(e=>(null==e||$(e),e))(n),8&o&&void 0!==s||n===s||(l.U.set(t,n),r&&2==(18&o)&&k(l,!1))})(0,e,t)},configurable:!0,enumerable:!0})})}return e},F=(e,t={})=>{const n=[],l=t.exclude||[],s=o.customElements,r=c.head,u=r.querySelector("meta[charset]"),f=c.createElement("style"),m=[];let $,h=!0;Object.assign(a,t),a.l=new URL(t.resourcesUrl||"./",c.baseURI).href,t.syncQueue&&(a.t|=4),e.map(e=>e[1].map(t=>{const o={t:t[0],M:t[1],L:t[2],k:t[3]};o.L=t[2],!i&&1&o.t&&(o.t|=8);const r=o.M,c=class extends HTMLElement{constructor(e){super(e),N(e=this,o),1&o.t&&(i?e.attachShadow({mode:"open"}):"shadowRoot"in e||(e.shadowRoot=e))}connectedCallback(){$&&(clearTimeout($),$=null),h?m.push(this):a.jmp(()=>(e=>{if(0==(1&a.t)){const t=B(e),n=t.j,l=()=>{};if(!(1&t.t)){t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){U(t,t.g=n);break}}(async(e,t,n,l,s)=>{if(0==(32&t.t)){t.t|=32;{if((s=G(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(W(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(c){z(c)}t.t&=-9,e()}const e=d(n.M);if(!I.has(e)&&s.style){const t=()=>{};let l=s.style;8&n.t&&(l=await __sc_import_select_previsao_ondas("./p-1257a87d.js").then(t=>t.scopeCss(l,e,!1))),((e,t,n)=>{let l=I.get(e);p&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,I.set(e,l)})(e,l,!!(1&n.t)),t()}}const o=t.g,r=()=>k(t,!0);o&&o["s-rc"]?o["s-rc"].push(r):r()})(0,t,n)}l()}})(this))}disconnectedCallback(){a.jmp(()=>{})}forceUpdate(){(()=>{{const e=B(this);e.h.isConnected&&2==(18&e.t)&&k(e,!1)}})()}componentOnReady(){return B(this).C}};o.P=e[0],l.includes(r)||s.get(r)||(n.push(r),s.define(r,W(c,o,1)))})),f.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",f.setAttribute("data-styles",""),r.insertBefore(f,u?u.nextSibling:r.firstChild),h=!1,m.length?m.map(e=>e.connectedCallback()):a.jmp(()=>$=setTimeout(E,30))},q=new WeakMap,B=e=>q.get(e),H=(e,t)=>q.set(t.v=e,t),N=(e,t)=>{const n={t:0,h:e,j:t,U:new Map};return n.C=new Promise(e=>n.R=e),e["s-p"]=[],e["s-rc"]=[],q.set(e,n)},V=(e,t)=>t in e,z=e=>console.error(e),D=new Map,G=e=>{const t=e.M.replace(/-/g,"_"),n=e.P,l=D.get(n);return l?l[t]:__sc_import_select_previsao_ondas(`./${n}.entry.js`).then(e=>(D.set(n,e),e[t]),z)},I=new Map,J=[],K=[],Q=[],X=(e,t)=>n=>{e.push(n),s||(s=!0,t&&4&a.t?ee(Z):a.raf(Z))},Y=(e,t)=>{let n=0,l=0;for(;n<e.length&&(l=performance.now())<t;)try{e[n++](l)}catch(s){z(s)}n===e.length?e.length=0:0!==n&&e.splice(0,n)},Z=()=>{l++,(e=>{for(let n=0;n<e.length;n++)try{e[n](performance.now())}catch(t){z(t)}e.length=0})(J);const e=2==(6&a.t)?performance.now()+10*Math.ceil(l*(1/22)):1/0;Y(K,e),Y(Q,e),K.length>0&&(Q.push(...K),K.length=0),(s=J.length+K.length+Q.length>0)?a.raf(Z):l=0},ee=e=>u().then(e),te=X(K,!0),ne=()=>r&&r.supports&&r.supports("color","var(--c)")?u():__sc_import_select_previsao_ondas("./p-a1635a26.js").then(()=>(a.O=o.__cssshim)?(!1).i():0),le=()=>{a.O=o.__cssshim;const t=Array.from(c.querySelectorAll("script")).find(t=>RegExp(`/${e}(\\.esm)?\\.js($|\\?|#)`).test(t.src)||t.getAttribute("data-stencil-namespace")===e),n=t["data-opts"]||{};return"onbeforeload"in t&&!history.scrollRestoration?{then(){}}:(n.resourcesUrl=new URL(".",new URL(t.getAttribute("data-resources-url")||t.src,o.location.href)).href,se(n.resourcesUrl,t),o.customElements?u(n):__sc_import_select_previsao_ondas("./p-1e6799ca.js").then(()=>n))},se=(e,t)=>{const n="__sc_import_select_previsao_ondas";try{o[n]=Function("w",`return import(w);//${Math.random()}`)}catch(l){const s=new Map;o[n]=l=>{const r=new URL(l,e).href;let a=s.get(r);if(!a){const e=c.createElement("script");e.type="module",e.crossOrigin=t.crossOrigin,e.src=URL.createObjectURL(new Blob([`import * as m from '${r}'; window.${n}.m = m;`],{type:"application/javascript"})),a=new Promise(t=>{e.onload=()=>{t(o[n].m),e.remove()}}),s.set(r,a),c.head.appendChild(e)}return a}}};export{ne as a,F as b,R as c,h,le as p,H as r}