@sevn/elections-components 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +297 -0
  3. package/dist/index.cjs +603 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +351 -0
  6. package/dist/index.d.ts +351 -0
  7. package/dist/index.js +15609 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/styles.css +38 -0
  10. package/dist/umd/candidate-by-state.js +98 -0
  11. package/dist/umd/candidate-carrousel-state-results-viewer.js +108 -0
  12. package/dist/umd/candidate-counting-progress.js +77 -0
  13. package/dist/umd/candidate-duel-state-result-viewer.js +91 -0
  14. package/dist/umd/candidate-map-by-state.js +104 -0
  15. package/dist/umd/candidate-multi-ring-chart-performance-by-municipality.js +105 -0
  16. package/dist/umd/candidate-performance-by-municipality.js +105 -0
  17. package/dist/umd/candidate-ranking.js +59 -0
  18. package/dist/umd/candidate-results-by-municipality.js +103 -0
  19. package/dist/umd/counting-progress.js +125 -0
  20. package/dist/umd/current-leader.js +43 -0
  21. package/dist/umd/election-round-analysis.js +100 -0
  22. package/dist/umd/election-status.js +135 -0
  23. package/dist/umd/final-results.js +141 -0
  24. package/dist/umd/live-summary.js +36 -0
  25. package/dist/umd/municipality-perfomance-map.js +82 -0
  26. package/dist/umd/party-performance.js +99 -0
  27. package/dist/umd/results-by-office.js +94 -0
  28. package/dist/umd/round-results-analysis.js +99 -0
  29. package/dist/umd/state-leaders.js +118 -0
  30. package/dist/umd/state-winners.js +129 -0
  31. package/dist/umd/top-dispute.js +43 -0
  32. package/dist/umd/vote-comparison-by-round.js +76 -0
  33. package/dist/umd/vote-counting-progress.js +23 -0
  34. package/dist/umd/voting-map.js +112 -0
  35. package/package.json +96 -0
@@ -0,0 +1,105 @@
1
+ (function(V,G){typeof exports=="object"&&typeof module<"u"?module.exports=G():typeof define=="function"&&define.amd?define(G):(V=typeof globalThis<"u"?globalThis:V||self,V.CandidatePerformanceByMunicipality=G())})(this,(function(){"use strict";var Sl=Object.defineProperty;var ii=V=>{throw TypeError(V)};var El=(V,G,ne)=>G in V?Sl(V,G,{enumerable:!0,configurable:!0,writable:!0,value:ne}):V[G]=ne;var Ze=(V,G,ne)=>El(V,typeof G!="symbol"?G+"":G,ne),Sr=(V,G,ne)=>G.has(V)||ii("Cannot "+ne);var v=(V,G,ne)=>(Sr(V,G,"read from private field"),ne?ne.call(V):G.get(V)),O=(V,G,ne)=>G.has(V)?ii("Cannot add the same private member more than once"):G instanceof WeakSet?G.add(V):G.set(V,ne),R=(V,G,ne,Dt)=>(Sr(V,G,"write to private field"),Dt?Dt.call(V,ne):G.set(V,ne),ne),ue=(V,G,ne)=>(Sr(V,G,"access private method"),ne);var Qt,Xt,Rt,$t,xn,yn,Pt,st,en,ke,Er,Cr,Ar,si,Ue,br,ot,It,Ve,Ke,Se,Ge,lt,Ot,mt,tn,nn,rn,ct,Dn,ce,Cl,Al,Tr,qn,Un,Mr,He,We,Ee,Nt,zn,kn,jn,ai;class V extends Error{constructor(){super('Chave de acesso não configurada. Chame Core.applyKey("sua-chave") antes de montar o componente, ou carregue o script com ?cid=sua-chave.'),this.name="SevnKeyMissingError"}}class G extends Error{constructor(t,n){super(`Não foi possível contatar a API para ${t}.`),this.name="SevnNetworkError",this.cause=n}}const ne="__sevnElectionsState_v1__",Dt=globalThis;function Lr(e){return Dt[ne]||(Dt[ne]={config:e(),transport:{activeIndex:0,pinnedAt:0}}),Dt[ne]}const oi="https://failover-api.sevntech.com",li=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Rr(){return{key:null,apiHosts:[],assetsBase:"https://cdn.sevnelections.com/static",assetsVersion:"v1",cache:{storageKey:"election_cache",maxEntries:200},request:{timeoutMs:8e3,retriesPerHost:3,retryDelayMs:300,stickyWindowMs:12e4},theme:null}}const ci=Rr;function jt(){return Lr(Rr)}function ui(e){return[`https://${e}-api1.sevnelections.com`,`https://${e}-api2.sevnelections.com`,oi]}function Hn(e){if(typeof e!="string"||!li.test(e))throw new Error(`[sevn] Chave inválida: ${JSON.stringify(e)}. Use apenas letras, números e hífen (a chave vira subdomínio da API).`);const t=jt();t.config.key=e,t.config.apiHosts=ui(e)}function Pr(e){const{cache:t,request:n,key:r,...a}=e,i=jt();i.config={...i.config,...a,cache:{...i.config.cache,...t},request:{...i.config.request,...n}},r&&(Hn(r),a.apiHosts&&(i.config.apiHosts=a.apiHosts))}function on(){return jt().config}function Ir(){return jt().config.apiHosts.length>0}function Or(){if(!Ir())throw new V;return jt().config.apiHosts}function fi(e){const{assetsBase:t,assetsVersion:n}=jt().config,r=t.replace(/\/+$/,""),a=String(e).replace(/^\/+/,"");return`${r}/${n}/${a}`}const di=':root{--sevn-color-primary: #0a3e27;--sevn-color-secondary: #c38214;--sevn-color-tertiary: #1c1c1c;--sevn-color-red: #da0000;--sevn-color-yellow: #e4a615;--sevn-color-green: #1e6704;--sevn-color-blue: #0e2a41;--sevn-color-neutral: #f2f2f7;--sevn-color-text-secondary: #6b7280}[class^=sevn_],[class*=" sevn_"],[class^=sevn_] *,[class^=sevn_] *:before,[class^=sevn_] *:after,[class*=" sevn_"] *,[class*=" sevn_"] *:before,[class*=" sevn_"] *:after{box-sizing:border-box}[class^=sevn_] *,[class*=" sevn_"] *{margin:0;padding:0}',Qe=typeof window<"u"&&typeof document<"u",Nr="data-sevn-tokens",Fr="data-sevn-theme",Dr={primary:"--sevn-color-primary",secondary:"--sevn-color-secondary",tertiary:"--sevn-color-tertiary",neutral:"--sevn-color-neutral",red:"--sevn-color-red",green:"--sevn-color-green",blue:"--sevn-color-blue",yellow:"--sevn-color-yellow",textSecondary:"--sevn-color-text-secondary"};function vi(){if(!Qe||document.querySelector(`style[${Nr}]`))return;const e=document.createElement("style");e.setAttribute(Nr,""),e.textContent=di,document.head.prepend(e);const t=on().theme;t&&Bn(t)}function Bn(e){if(!Qe)return;const t=Object.keys(Dr).filter(r=>e[r]).map(r=>` ${Dr[r]}: ${e[r]};`);if(t.length===0)return;let n=document.querySelector(`style[${Fr}]`);n||(n=document.createElement("style"),n.setAttribute(Fr,""),document.head.appendChild(n)),n.textContent=`:root {
2
+ ${t.join(`
3
+ `)}
4
+ }`}function jr(){return Lr(ci).transport}function qr(e){return new Promise(t=>setTimeout(t,e))}function hi(e,t){const n=AbortSignal.timeout(e);return t&&typeof AbortSignal.any=="function"?AbortSignal.any([t,n]):n}function pi(e,t){const n=new URL(e),r=new URL(t);return n.protocol=r.protocol,n.host=r.host,n.toString()}function _i(e,t){return Array.from({length:t},(n,r)=>(e+r)%t)}const gi=async(e,t)=>{const n=typeof e=="string"?e:e instanceof URL?e.toString():e.url,r=Or(),{timeoutMs:a,retriesPerHost:i,retryDelayMs:s,stickyWindowMs:l}=on().request,o=jr();o.activeIndex!==0&&Date.now()-o.pinnedAt>=l&&(o.activeIndex=0);let f=null;for(const u of _i(o.activeIndex,r.length)){const _=pi(n,r[u]);for(let d=0;d<i;d++)try{const p=await fetch(_,{...t,signal:hi(a,t?.signal)});if(p.status>=500){f=new Error(`HTTP ${p.status} em ${r[u]}`),d<i-1&&await qr(s);continue}return o.activeIndex=u,o.pinnedAt=Date.now(),p}catch(p){f=p,d<i-1&&await qr(s)}}throw new G(n,f)};function mi(){return on().apiHosts[jr().activeIndex]??null}const wi={applyKey:Hn,configure(e){Pr(e),e.theme&&Bn(e.theme)},getConfig:on,isReady:Ir,assetUrl:fi,setTheme(e){Pr({theme:e}),Bn(e)},activeHost:mi},Vn=!1;var Ur=Array.isArray,bi=Array.prototype.indexOf,qt=Array.prototype.includes,An=Array.from,xi=Object.defineProperty,Ut=Object.getOwnPropertyDescriptor,yi=Object.getOwnPropertyDescriptors,zi=Object.prototype,ki=Array.prototype,Hr=Object.getPrototypeOf,Br=Object.isExtensible;const Si=()=>{};function Ei(e){for(var t=0;t<e.length;t++)e[t]()}function Vr(){var e,t,n=new Promise((r,a)=>{e=r,t=a});return{promise:n,resolve:e,reject:t}}const fe=2,ln=4,Tn=8,Kr=1<<24,Xe=16,Ie=32,xt=64,Kn=128,Ce=512,le=1024,de=2048,Oe=4096,xe=8192,$e=16384,yt=32768,Ht=65536,Gr=1<<17,Wr=1<<18,Bt=1<<19,Ci=1<<20,et=1<<25,zt=65536,Gn=1<<21,Wn=1<<22,ft=1<<23,cn=Symbol("$state"),Ai=Symbol("legacy props"),Ti=Symbol(""),kt=new class extends Error{constructor(){super(...arguments);Ze(this,"name","StaleReactionError");Ze(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Mi(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Li(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Ri(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Pi(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Ii(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Oi(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Ni(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Fi(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Di(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function ji(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function qi(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Ui(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Hi=1,Bi=2,Yr=4,Vi=8,Ki=16,Gi=1,Wi=4,Yi=8,Ji=16,Zi=2,ve=Symbol(),Jr="http://www.w3.org/1999/xhtml";function Qi(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Zr(e){return e===this.v}function Xi(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Qr(e){return!Xi(e,this.v)}let $i=!1,ye=null;function Vt(e){ye=e}function Kt(e,t=!1,n){ye={p:ye,i:!1,c:null,e:null,s:e,x:null,l:null}}function Gt(e){var t=ye,n=t.e;if(n!==null){t.e=null;for(var r of n)ya(r)}return t.i=!0,ye=t.p,{}}function Xr(){return!0}let St=[];function $r(){var e=St;St=[],Ei(e)}function tt(e){if(St.length===0&&!un){var t=St;queueMicrotask(()=>{t===St&&$r()})}St.push(e)}function es(){for(;St.length>0;)$r()}function ea(e){var t=U;if(t===null)return I.f|=ft,e;if((t.f&yt)===0&&(t.f&ln)===0)throw e;Wt(e,t)}function Wt(e,t){for(;t!==null;){if((t.f&Kn)!==0){if((t.f&yt)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const ts=-7169;function re(e,t){e.f=e.f&ts|t}function Yn(e){(e.f&Ce)!==0||e.deps===null?re(e,le):re(e,Oe)}function ta(e){if(e!==null)for(const t of e)(t.f&fe)===0||(t.f&zt)===0||(t.f^=zt,ta(t.deps))}function na(e,t,n){(e.f&de)!==0?t.add(e):(e.f&Oe)!==0&&n.add(e),ta(e.deps),re(e,le)}const Mn=new Set;let H=null,Jn=null,Ne=null,ge=[],Ln=null,Zn=!1,un=!1;const wr=class wr{constructor(){O(this,ke);Ze(this,"committed",!1);Ze(this,"current",new Map);Ze(this,"previous",new Map);O(this,Qt,new Set);O(this,Xt,new Set);O(this,Rt,0);O(this,$t,0);O(this,xn,null);O(this,yn,new Set);O(this,Pt,new Set);O(this,st,new Map);Ze(this,"is_fork",!1);O(this,en,!1)}skip_effect(t){v(this,st).has(t)||v(this,st).set(t,{d:[],m:[]})}unskip_effect(t){var n=v(this,st).get(t);if(n){v(this,st).delete(t);for(var r of n.d)re(r,de),Fe(r);for(r of n.m)re(r,Oe),Fe(r)}}process(t){ge=[],this.apply();var n=[],r=[];for(const a of t)ue(this,ke,Cr).call(this,a,n,r);if(ue(this,ke,Er).call(this)){ue(this,ke,Ar).call(this,r),ue(this,ke,Ar).call(this,n);for(const[a,i]of v(this,st))oa(a,i)}else{for(const a of v(this,Qt))a();v(this,Qt).clear(),v(this,Rt)===0&&ue(this,ke,si).call(this),Jn=this,H=null,aa(r),aa(n),Jn=null,v(this,xn)?.resolve()}Ne=null}capture(t,n){n!==ve&&!this.previous.has(t)&&this.previous.set(t,n),(t.f&ft)===0&&(this.current.set(t,t.v),Ne?.set(t,t.v))}activate(){H=this,this.apply()}deactivate(){H===this&&(H=null,Ne=null)}flush(){if(this.activate(),ge.length>0){if(ra(),H!==null&&H!==this)return}else v(this,Rt)===0&&this.process([]);this.deactivate()}discard(){for(const t of v(this,Xt))t(this);v(this,Xt).clear()}increment(t){R(this,Rt,v(this,Rt)+1),t&&R(this,$t,v(this,$t)+1)}decrement(t){R(this,Rt,v(this,Rt)-1),t&&R(this,$t,v(this,$t)-1),!v(this,en)&&(R(this,en,!0),tt(()=>{R(this,en,!1),ue(this,ke,Er).call(this)?ge.length>0&&this.flush():this.revive()}))}revive(){for(const t of v(this,yn))v(this,Pt).delete(t),re(t,de),Fe(t);for(const t of v(this,Pt))re(t,Oe),Fe(t);this.flush()}oncommit(t){v(this,Qt).add(t)}ondiscard(t){v(this,Xt).add(t)}settled(){return(v(this,xn)??R(this,xn,Vr())).promise}static ensure(){if(H===null){const t=H=new wr;Mn.add(H),un||tt(()=>{H===t&&t.flush()})}return H}apply(){}};Qt=new WeakMap,Xt=new WeakMap,Rt=new WeakMap,$t=new WeakMap,xn=new WeakMap,yn=new WeakMap,Pt=new WeakMap,st=new WeakMap,en=new WeakMap,ke=new WeakSet,Er=function(){return this.is_fork||v(this,$t)>0},Cr=function(t,n,r){t.f^=le;for(var a=t.first;a!==null;){var i=a.f,s=(i&(Ie|xt))!==0,l=s&&(i&le)!==0,o=l||(i&xe)!==0||v(this,st).has(a);if(!o&&a.fn!==null){s?a.f^=le:(i&ln)!==0?n.push(a):hn(a)&&((i&Xe)!==0&&v(this,Pt).add(a),Jt(a));var f=a.first;if(f!==null){a=f;continue}}for(;a!==null;){var u=a.next;if(u!==null){a=u;break}a=a.parent}}},Ar=function(t){for(var n=0;n<t.length;n+=1)na(t[n],v(this,yn),v(this,Pt))},si=function(){var a;if(Mn.size>1){this.previous.clear();var t=Ne,n=!0;for(const i of Mn){if(i===this){n=!1;continue}const s=[];for(const[o,f]of this.current){if(i.current.has(o))if(n&&f!==i.current.get(o))i.current.set(o,f);else continue;s.push(o)}if(s.length===0)continue;const l=[...i.current.keys()].filter(o=>!this.current.has(o));if(l.length>0){var r=ge;ge=[];const o=new Set,f=new Map;for(const u of s)ia(u,l,o,f);if(ge.length>0){H=i,i.apply();for(const u of ge)ue(a=i,ke,Cr).call(a,u,[],[]);i.deactivate()}ge=r}}H=null,Ne=t}this.committed=!0,Mn.delete(this)};let dt=wr;function ns(e){var t=un;un=!0;try{for(var n;;){if(es(),ge.length===0&&(H?.flush(),ge.length===0))return Ln=null,n;ra()}}finally{un=t}}function ra(){Zn=!0;var e=null;try{for(var t=0;ge.length>0;){var n=dt.ensure();if(t++>1e3){var r,a;rs()}n.process(ge),vt.clear()}}finally{ge=[],Zn=!1,Ln=null}}function rs(){try{Ni()}catch(e){Wt(e,Ln)}}let nt=null;function aa(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&($e|xe))===0&&hn(r)&&(nt=new Set,Jt(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Sa(r),nt?.size>0)){vt.clear();for(const a of nt){if((a.f&($e|xe))!==0)continue;const i=[a];let s=a.parent;for(;s!==null;)nt.has(s)&&(nt.delete(s),i.push(s)),s=s.parent;for(let l=i.length-1;l>=0;l--){const o=i[l];(o.f&($e|xe))===0&&Jt(o)}}nt.clear()}}nt=null}}function ia(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const a of e.reactions){const i=a.f;(i&fe)!==0?ia(a,t,n,r):(i&(Wn|Xe))!==0&&(i&de)===0&&sa(a,t,r)&&(re(a,de),Fe(a))}}function sa(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const a of e.deps){if(qt.call(t,a))return!0;if((a.f&fe)!==0&&sa(a,t,n))return n.set(a,!0),!0}return n.set(e,!1),!1}function Fe(e){var t=Ln=e,n=t.b;if(n?.is_pending&&(e.f&(ln|Tn|Kr))!==0&&(e.f&yt)===0){n.defer_effect(e);return}for(;t.parent!==null;){t=t.parent;var r=t.f;if(Zn&&t===U&&(r&Xe)!==0&&(r&Wr)===0&&(r&yt)!==0)return;if((r&(xt|Ie))!==0){if((r&le)===0)return;t.f^=le}}ge.push(t)}function oa(e,t){if(!((e.f&Ie)!==0&&(e.f&le)!==0)){(e.f&de)!==0?t.d.push(e):(e.f&Oe)!==0&&t.m.push(e),re(e,le);for(var n=e.first;n!==null;)oa(n,t),n=n.next}}function as(e){let t=0,n=Et(0),r;return()=>{er()&&(c(n),tr(()=>(t===0&&(r=Zt(()=>e(()=>fn(n)))),t+=1,()=>{tt(()=>{t-=1,t===0&&(r?.(),r=void 0,fn(n))})})))}}var is=Ht|Bt;function ss(e,t,n){new os(e,t,n)}class os{constructor(t,n,r){O(this,ce);Ze(this,"parent");Ze(this,"is_pending",!1);O(this,Ue);O(this,br,null);O(this,ot);O(this,It);O(this,Ve);O(this,Ke,null);O(this,Se,null);O(this,Ge,null);O(this,lt,null);O(this,Ot,0);O(this,mt,0);O(this,tn,!1);O(this,nn,new Set);O(this,rn,new Set);O(this,ct,null);O(this,Dn,as(()=>(R(this,ct,Et(v(this,Ot))),()=>{R(this,ct,null)})));R(this,Ue,t),R(this,ot,n),R(this,It,a=>{var i=U;i.b=this,i.f|=Kn,r(a)}),this.parent=U.b,R(this,Ve,nr(()=>{ue(this,ce,Tr).call(this)},is))}defer_effect(t){na(t,v(this,nn),v(this,rn))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!v(this,ot).pending}update_pending_count(t){ue(this,ce,Mr).call(this,t),R(this,Ot,v(this,Ot)+t),!(!v(this,ct)||v(this,tn))&&(R(this,tn,!0),tt(()=>{R(this,tn,!1),v(this,ct)&&Yt(v(this,ct),v(this,Ot))}))}get_effect_pending(){return v(this,Dn).call(this),c(v(this,ct))}error(t){var n=v(this,ot).onerror;let r=v(this,ot).failed;if(!n&&!r)throw t;v(this,Ke)&&(me(v(this,Ke)),R(this,Ke,null)),v(this,Se)&&(me(v(this,Se)),R(this,Se,null)),v(this,Ge)&&(me(v(this,Ge)),R(this,Ge,null));var a=!1,i=!1;const s=()=>{if(a){Qi();return}a=!0,i&&Ui(),v(this,Ge)!==null&&At(v(this,Ge),()=>{R(this,Ge,null)}),ue(this,ce,Un).call(this,()=>{dt.ensure(),ue(this,ce,Tr).call(this)})};tt(()=>{try{i=!0,n?.(t,s),i=!1}catch(l){Wt(l,v(this,Ve)&&v(this,Ve).parent)}r&&R(this,Ge,ue(this,ce,Un).call(this,()=>{dt.ensure();try{return De(()=>{var l=U;l.b=this,l.f|=Kn,r(v(this,Ue),()=>t,()=>s)})}catch(l){return Wt(l,v(this,Ve).parent),null}}))})}}Ue=new WeakMap,br=new WeakMap,ot=new WeakMap,It=new WeakMap,Ve=new WeakMap,Ke=new WeakMap,Se=new WeakMap,Ge=new WeakMap,lt=new WeakMap,Ot=new WeakMap,mt=new WeakMap,tn=new WeakMap,nn=new WeakMap,rn=new WeakMap,ct=new WeakMap,Dn=new WeakMap,ce=new WeakSet,Cl=function(){try{R(this,Ke,De(()=>v(this,It).call(this,v(this,Ue))))}catch(t){this.error(t)}},Al=function(){const t=v(this,ot).pending;t&&(this.is_pending=!0,R(this,Se,De(()=>t(v(this,Ue)))),tt(()=>{var n=R(this,lt,document.createDocumentFragment()),r=ht();n.append(r),R(this,Ke,ue(this,ce,Un).call(this,()=>(dt.ensure(),De(()=>v(this,It).call(this,r))))),v(this,mt)===0&&(v(this,Ue).before(n),R(this,lt,null),At(v(this,Se),()=>{R(this,Se,null)}),ue(this,ce,qn).call(this))}))},Tr=function(){try{if(this.is_pending=this.has_pending_snippet(),R(this,mt,0),R(this,Ot,0),R(this,Ke,De(()=>{v(this,It).call(this,v(this,Ue))})),v(this,mt)>0){var t=R(this,lt,document.createDocumentFragment());Aa(v(this,Ke),t);const n=v(this,ot).pending;R(this,Se,De(()=>n(v(this,Ue))))}else ue(this,ce,qn).call(this)}catch(n){this.error(n)}},qn=function(){this.is_pending=!1;for(const t of v(this,nn))re(t,de),Fe(t);for(const t of v(this,rn))re(t,Oe),Fe(t);v(this,nn).clear(),v(this,rn).clear()},Un=function(t){var n=U,r=I,a=ye;Be(v(this,Ve)),Ae(v(this,Ve)),Vt(v(this,Ve).ctx);try{return t()}catch(i){return ea(i),null}finally{Be(n),Ae(r),Vt(a)}},Mr=function(t){var n;if(!this.has_pending_snippet()){this.parent&&ue(n=this.parent,ce,Mr).call(n,t);return}R(this,mt,v(this,mt)+t),v(this,mt)===0&&(ue(this,ce,qn).call(this),v(this,Se)&&At(v(this,Se),()=>{R(this,Se,null)}),v(this,lt)&&(v(this,Ue).before(v(this,lt)),R(this,lt,null)))};function ls(e,t,n,r){const a=Rn;var i=e.filter(d=>!d.settled);if(n.length===0&&i.length===0){r(t.map(a));return}var s=H,l=U,o=cs(),f=i.length===1?i[0].promise:i.length>1?Promise.all(i.map(d=>d.promise)):null;function u(d){o();try{r(d)}catch(p){(l.f&$e)===0&&Wt(p,l)}s?.deactivate(),Qn()}if(n.length===0){f.then(()=>u(t.map(a)));return}function _(){o(),Promise.all(n.map(d=>fs(d))).then(d=>u([...t.map(a),...d])).catch(d=>Wt(d,l))}f?f.then(_):_()}function cs(){var e=U,t=I,n=ye,r=H;return function(i=!0){Be(e),Ae(t),Vt(n),i&&r?.activate()}}function Qn(){Be(null),Ae(null),Vt(null)}function us(){var e=U.b,t=H,n=e.is_rendered();return e.update_pending_count(1),t.increment(n),()=>{e.update_pending_count(-1),t.decrement(n)}}function Rn(e){var t=fe|de,n=I!==null&&(I.f&fe)!==0?I:null;return U!==null&&(U.f|=Bt),{ctx:ye,deps:null,effects:null,equals:Zr,f:t,fn:e,reactions:null,rv:0,v:ve,wv:0,parent:n??U,ac:null}}function fs(e,t,n){U===null&&Li();var a=void 0,i=Et(ve),s=!I,l=new Map;return ks(()=>{var o=Vr();a=o.promise;try{Promise.resolve(e()).then(o.resolve,o.reject).then(()=>{f===H&&f.committed&&f.deactivate(),Qn()})}catch(d){o.reject(d),Qn()}var f=H;if(s){var u=us();l.get(f)?.reject(kt),l.delete(f),l.set(f,o)}const _=(d,p=void 0)=>{if(f.activate(),p)p!==kt&&(i.f|=ft,Yt(i,p));else{(i.f&ft)!==0&&(i.f^=ft),Yt(i,d);for(const[g,x]of l){if(l.delete(g),g===f)break;x.reject(kt)}}u&&u()};o.promise.then(_,d=>_(null,d||"unknown"))}),xa(()=>{for(const o of l.values())o.reject(kt)}),new Promise(o=>{function f(u){function _(){u===a?o(i):f(a)}u.then(_,_)}f(a)})}function te(e){const t=Rn(e);return Ma(t),t}function la(e){const t=Rn(e);return t.equals=Qr,t}function ds(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)me(t[n])}}function vs(e){for(var t=e.parent;t!==null;){if((t.f&fe)===0)return(t.f&$e)===0?t:null;t=t.parent}return null}function Xn(e){var t,n=U;Be(vs(e));try{e.f&=~zt,ds(e),t=Oa(e)}finally{Be(n)}return t}function ca(e){var t=Xn(e);if(!e.equals(t)&&(e.wv=Pa(),(!H?.is_fork||e.deps===null)&&(e.v=t,e.deps===null))){re(e,le);return}pt||(Ne!==null?(er()||H?.is_fork)&&Ne.set(e,t):Yn(e))}function hs(e){if(e.effects!==null)for(const t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(kt),t.teardown=Si,t.ac=null,pn(t,0),rr(t))}function ua(e){if(e.effects!==null)for(const t of e.effects)t.teardown&&Jt(t)}let $n=new Set;const vt=new Map;let fa=!1;function Et(e,t){var n={f:0,v:e,reactions:null,equals:Zr,rv:0,wv:0};return n}function Z(e,t){const n=Et(e);return Ma(n),n}function ps(e,t=!1,n=!0){const r=Et(e);return t||(r.equals=Qr),r}function y(e,t,n=!1){I!==null&&(!je||(I.f&Gr)!==0)&&Xr()&&(I.f&(fe|Xe|Wn|Gr))!==0&&(Te===null||!qt.call(Te,e))&&qi();let r=n?rt(t):t;return Yt(e,r)}function Yt(e,t){if(!e.equals(t)){var n=e.v;pt?vt.set(e,t):vt.set(e,n),e.v=t;var r=dt.ensure();if(r.capture(e,n),(e.f&fe)!==0){const a=e;(e.f&de)!==0&&Xn(a),Yn(a)}e.wv=Pa(),da(e,de),U!==null&&(U.f&le)!==0&&(U.f&(Ie|xt))===0&&(Me===null?Cs([e]):Me.push(e)),!r.is_fork&&$n.size>0&&!fa&&_s()}return t}function _s(){fa=!1;for(const e of $n)(e.f&le)!==0&&re(e,Oe),hn(e)&&Jt(e);$n.clear()}function fn(e){y(e,e.v+1)}function da(e,t){var n=e.reactions;if(n!==null)for(var r=n.length,a=0;a<r;a++){var i=n[a],s=i.f,l=(s&de)===0;if(l&&re(i,t),(s&fe)!==0){var o=i;Ne?.delete(o),(s&zt)===0&&(s&Ce&&(i.f|=zt),da(o,Oe))}else l&&((s&Xe)!==0&&nt!==null&&nt.add(i),Fe(i))}}function rt(e){if(typeof e!="object"||e===null||cn in e)return e;const t=Hr(e);if(t!==zi&&t!==ki)return e;var n=new Map,r=Ur(e),a=Z(0),i=Mt,s=l=>{if(Mt===i)return l();var o=I,f=Mt;Ae(null),Ra(i);var u=l();return Ae(o),Ra(f),u};return r&&n.set("length",Z(e.length)),new Proxy(e,{defineProperty(l,o,f){(!("value"in f)||f.configurable===!1||f.enumerable===!1||f.writable===!1)&&Di();var u=n.get(o);return u===void 0?s(()=>{var _=Z(f.value);return n.set(o,_),_}):y(u,f.value,!0),!0},deleteProperty(l,o){var f=n.get(o);if(f===void 0){if(o in l){const u=s(()=>Z(ve));n.set(o,u),fn(a)}}else y(f,ve),fn(a);return!0},get(l,o,f){if(o===cn)return e;var u=n.get(o),_=o in l;if(u===void 0&&(!_||Ut(l,o)?.writable)&&(u=s(()=>{var p=rt(_?l[o]:ve),g=Z(p);return g}),n.set(o,u)),u!==void 0){var d=c(u);return d===ve?void 0:d}return Reflect.get(l,o,f)},getOwnPropertyDescriptor(l,o){var f=Reflect.getOwnPropertyDescriptor(l,o);if(f&&"value"in f){var u=n.get(o);u&&(f.value=c(u))}else if(f===void 0){var _=n.get(o),d=_?.v;if(_!==void 0&&d!==ve)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return f},has(l,o){if(o===cn)return!0;var f=n.get(o),u=f!==void 0&&f.v!==ve||Reflect.has(l,o);if(f!==void 0||U!==null&&(!u||Ut(l,o)?.writable)){f===void 0&&(f=s(()=>{var d=u?rt(l[o]):ve,p=Z(d);return p}),n.set(o,f));var _=c(f);if(_===ve)return!1}return u},set(l,o,f,u){var _=n.get(o),d=o in l;if(r&&o==="length")for(var p=f;p<_.v;p+=1){var g=n.get(p+"");g!==void 0?y(g,ve):p in l&&(g=s(()=>Z(ve)),n.set(p+"",g))}if(_===void 0)(!d||Ut(l,o)?.writable)&&(_=s(()=>Z(void 0)),y(_,rt(f)),n.set(o,_));else{d=_.v!==ve;var x=s(()=>rt(f));y(_,x)}var h=Reflect.getOwnPropertyDescriptor(l,o);if(h?.set&&h.set.call(u,f),!d){if(r&&typeof o=="string"){var z=n.get("length"),m=Number(o);Number.isInteger(m)&&m>=z.v&&y(z,m+1)}fn(a)}return!0},ownKeys(l){c(a);var o=Reflect.ownKeys(l).filter(_=>{var d=n.get(_);return d===void 0||d.v!==ve});for(var[f,u]of n)u.v!==ve&&!(f in l)&&o.push(f);return o},setPrototypeOf(){ji()}})}var va,ha,pa,_a;function gs(){if(va===void 0){va=window,ha=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;pa=Ut(t,"firstChild").get,_a=Ut(t,"nextSibling").get,Br(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Br(n)&&(n.__t=void 0)}}function ht(e=""){return document.createTextNode(e)}function dn(e){return pa.call(e)}function vn(e){return _a.call(e)}function b(e,t){return dn(e)}function ga(e,t=!1){{var n=dn(e);return n instanceof Comment&&n.data===""?vn(n):n}}function P(e,t=1,n=!1){let r=e;for(;t--;)r=vn(r);return r}function ms(e){e.textContent=""}function ma(){return!1}function wa(e,t,n){return document.createElementNS(Jr,e,void 0)}let ba=!1;function ws(){ba||(ba=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function Pn(e){var t=I,n=U;Ae(null),Be(null);try{return e()}finally{Ae(t),Be(n)}}function bs(e,t,n,r=n){e.addEventListener(t,()=>Pn(n));const a=e.__on_r;a?e.__on_r=()=>{a(),r(!0)}:e.__on_r=()=>r(!0),ws()}function xs(e){U===null&&(I===null&&Oi(),Ii()),pt&&Pi()}function ys(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function at(e,t,n){var r=U;r!==null&&(r.f&xe)!==0&&(e|=xe);var a={ctx:ye,deps:null,nodes:null,f:e|de|Ce,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{Jt(a)}catch(l){throw me(a),l}else t!==null&&Fe(a);var i=a;if(n&&i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&Bt)===0&&(i=i.first,(e&Xe)!==0&&(e&Ht)!==0&&i!==null&&(i.f|=Ht)),i!==null&&(i.parent=r,r!==null&&ys(i,r),I!==null&&(I.f&fe)!==0&&(e&xt)===0)){var s=I;(s.effects??(s.effects=[])).push(i)}return a}function er(){return I!==null&&!je}function xa(e){const t=at(Tn,null,!1);return re(t,le),t.teardown=e,t}function Ct(e){xs();var t=U.f,n=!I&&(t&Ie)!==0&&(t&yt)===0;if(n){var r=ye;(r.e??(r.e=[])).push(e)}else return ya(e)}function ya(e){return at(ln|Ci,e,!1)}function zs(e){dt.ensure();const t=at(xt|Bt,e,!0);return(n={})=>new Promise(r=>{n.outro?At(t,()=>{me(t),r(void 0)}):(me(t),r(void 0))})}function za(e){return at(ln,e,!1)}function ks(e){return at(Wn|Bt,e,!0)}function tr(e,t=0){return at(Tn|t,e,!0)}function N(e,t=[],n=[],r=[]){ls(r,t,n,a=>{at(Tn,()=>e(...a.map(c)),!0)})}function nr(e,t=0){var n=at(Xe|t,e,!0);return n}function De(e){return at(Ie|Bt,e,!0)}function ka(e){var t=e.teardown;if(t!==null){const n=pt,r=I;Ta(!0),Ae(null);try{t.call(null)}finally{Ta(n),Ae(r)}}}function rr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const a=n.ac;a!==null&&Pn(()=>{a.abort(kt)});var r=n.next;(n.f&xt)!==0?n.parent=null:me(n,t),n=r}}function Ss(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&Ie)===0&&me(t),t=n}}function me(e,t=!0){var n=!1;(t||(e.f&Wr)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(Es(e.nodes.start,e.nodes.end),n=!0),rr(e,t&&!n),pn(e,0),re(e,$e);var r=e.nodes&&e.nodes.t;if(r!==null)for(const i of r)i.stop();ka(e);var a=e.parent;a!==null&&a.first!==null&&Sa(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function Es(e,t){for(;e!==null;){var n=e===t?null:vn(e);e.remove(),e=n}}function Sa(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function At(e,t,n=!0){var r=[];Ea(e,r,!0);var a=()=>{n&&me(e),t&&t()},i=r.length;if(i>0){var s=()=>--i||a();for(var l of r)l.out(s)}else a()}function Ea(e,t,n){if((e.f&xe)===0){e.f^=xe;var r=e.nodes&&e.nodes.t;if(r!==null)for(const l of r)(l.is_global||n)&&t.push(l);for(var a=e.first;a!==null;){var i=a.next,s=(a.f&Ht)!==0||(a.f&Ie)!==0&&(e.f&Xe)!==0;Ea(a,t,s?n:!1),a=i}}}function ar(e){Ca(e,!0)}function Ca(e,t){if((e.f&xe)!==0){e.f^=xe,(e.f&le)===0&&(re(e,de),Fe(e));for(var n=e.first;n!==null;){var r=n.next,a=(n.f&Ht)!==0||(n.f&Ie)!==0;Ca(n,a?t:!1),n=r}var i=e.nodes&&e.nodes.t;if(i!==null)for(const s of i)(s.is_global||t)&&s.in()}}function Aa(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var a=n===r?null:vn(n);t.append(n),n=a}}let In=!1,pt=!1;function Ta(e){pt=e}let I=null,je=!1;function Ae(e){I=e}let U=null;function Be(e){U=e}let Te=null;function Ma(e){I!==null&&(Te===null?Te=[e]:Te.push(e))}let we=null,ze=0,Me=null;function Cs(e){Me=e}let La=1,Tt=0,Mt=Tt;function Ra(e){Mt=e}function Pa(){return++La}function hn(e){var t=e.f;if((t&de)!==0)return!0;if(t&fe&&(e.f&=~zt),(t&Oe)!==0){for(var n=e.deps,r=n.length,a=0;a<r;a++){var i=n[a];if(hn(i)&&ca(i),i.wv>e.wv)return!0}(t&Ce)!==0&&Ne===null&&re(e,le)}return!1}function Ia(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Te!==null&&qt.call(Te,e)))for(var a=0;a<r.length;a++){var i=r[a];(i.f&fe)!==0?Ia(i,t,!1):t===i&&(n?re(i,de):(i.f&le)!==0&&re(i,Oe),Fe(i))}}function Oa(e){var x;var t=we,n=ze,r=Me,a=I,i=Te,s=ye,l=je,o=Mt,f=e.f;we=null,ze=0,Me=null,I=(f&(Ie|xt))===0?e:null,Te=null,Vt(e.ctx),je=!1,Mt=++Tt,e.ac!==null&&(Pn(()=>{e.ac.abort(kt)}),e.ac=null);try{e.f|=Gn;var u=e.fn,_=u();e.f|=yt;var d=e.deps,p=H?.is_fork;if(we!==null){var g;if(p||pn(e,ze),d!==null&&ze>0)for(d.length=ze+we.length,g=0;g<we.length;g++)d[ze+g]=we[g];else e.deps=d=we;if(er()&&(e.f&Ce)!==0)for(g=ze;g<d.length;g++)((x=d[g]).reactions??(x.reactions=[])).push(e)}else!p&&d!==null&&ze<d.length&&(pn(e,ze),d.length=ze);if(Xr()&&Me!==null&&!je&&d!==null&&(e.f&(fe|Oe|de))===0)for(g=0;g<Me.length;g++)Ia(Me[g],e);if(a!==null&&a!==e){if(Tt++,a.deps!==null)for(let h=0;h<n;h+=1)a.deps[h].rv=Tt;if(t!==null)for(const h of t)h.rv=Tt;Me!==null&&(r===null?r=Me:r.push(...Me))}return(e.f&ft)!==0&&(e.f^=ft),_}catch(h){return ea(h)}finally{e.f^=Gn,we=t,ze=n,Me=r,I=a,Te=i,Vt(s),je=l,Mt=o}}function As(e,t){let n=t.reactions;if(n!==null){var r=bi.call(n,e);if(r!==-1){var a=n.length-1;a===0?n=t.reactions=null:(n[r]=n[a],n.pop())}}if(n===null&&(t.f&fe)!==0&&(we===null||!qt.call(we,t))){var i=t;(i.f&Ce)!==0&&(i.f^=Ce,i.f&=~zt),Yn(i),hs(i),pn(i,0)}}function pn(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)As(e,n[r])}function Jt(e){var t=e.f;if((t&$e)===0){re(e,le);var n=U,r=In;U=e,In=!0;try{(t&(Xe|Kr))!==0?Ss(e):rr(e),ka(e);var a=Oa(e);e.teardown=typeof a=="function"?a:null,e.wv=La;var i;Vn&&$i&&(e.f&de)!==0&&e.deps}finally{In=r,U=n}}}async function Ts(){await Promise.resolve(),ns()}function c(e){var t=e.f,n=(t&fe)!==0;if(I!==null&&!je){var r=U!==null&&(U.f&$e)!==0;if(!r&&(Te===null||!qt.call(Te,e))){var a=I.deps;if((I.f&Gn)!==0)e.rv<Tt&&(e.rv=Tt,we===null&&a!==null&&a[ze]===e?ze++:we===null?we=[e]:we.push(e));else{(I.deps??(I.deps=[])).push(e);var i=e.reactions;i===null?e.reactions=[I]:qt.call(i,I)||i.push(I)}}}if(pt&&vt.has(e))return vt.get(e);if(n){var s=e;if(pt){var l=s.v;return((s.f&le)===0&&s.reactions!==null||Fa(s))&&(l=Xn(s)),vt.set(s,l),l}var o=(s.f&Ce)===0&&!je&&I!==null&&(In||(I.f&Ce)!==0),f=(s.f&yt)===0;hn(s)&&(o&&(s.f|=Ce),ca(s)),o&&!f&&(ua(s),Na(s))}if(Ne?.has(e))return Ne.get(e);if((e.f&ft)!==0)throw e.v;return e.v}function Na(e){if(e.f|=Ce,e.deps!==null)for(const t of e.deps)(t.reactions??(t.reactions=[])).push(e),(t.f&fe)!==0&&(t.f&Ce)===0&&(ua(t),Na(t))}function Fa(e){if(e.v===ve)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(vt.has(t)||(t.f&fe)!==0&&Fa(t))return!0;return!1}function Zt(e){var t=je;try{return je=!0,e()}finally{je=t}}const Ms=["touchstart","touchmove"];function Ls(e){return Ms.includes(e)}const Lt=Symbol("events"),Da=new Set,ir=new Set;function Rs(e,t,n,r={}){function a(i){if(r.capture||sr.call(t,i),!i.cancelBubble)return Pn(()=>n?.call(this,i))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?tt(()=>{t.addEventListener(e,a,r)}):t.addEventListener(e,a,r),a}function ja(e,t,n,r,a){var i={capture:r,passive:a},s=Rs(e,t,n,i);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&xa(()=>{t.removeEventListener(e,s,i)})}function it(e,t,n){(t[Lt]??(t[Lt]={}))[e]=n}function qa(e){for(var t=0;t<e.length;t++)Da.add(e[t]);for(var n of ir)n(e)}let Ua=null;function sr(e){var t=this,n=t.ownerDocument,r=e.type,a=e.composedPath?.()||[],i=a[0]||e.target;Ua=e;var s=0,l=Ua===e&&e[Lt];if(l){var o=a.indexOf(l);if(o!==-1&&(t===document||t===window)){e[Lt]=t;return}var f=a.indexOf(t);if(f===-1)return;o<=f&&(s=o)}if(i=a[s]||e.target,i!==t){xi(e,"currentTarget",{configurable:!0,get(){return i||n}});var u=I,_=U;Ae(null),Be(null);try{for(var d,p=[];i!==null;){var g=i.assignedSlot||i.parentNode||i.host||null;try{var x=i[Lt]?.[r];x!=null&&(!i.disabled||e.target===i)&&x.call(i,e)}catch(h){d?p.push(h):d=h}if(e.cancelBubble||g===t||g===null)break;i=g}if(d){for(let h of p)queueMicrotask(()=>{throw h});throw d}}finally{e[Lt]=t,delete e.currentTarget,Ae(u),Be(_)}}}const Ps=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Is(e){return Ps?.createHTML(e)??e}function Ha(e,t=!1){var n=wa("template");return e=e.replaceAll("<!>","<!---->"),n.innerHTML=t?Is(e):e,n.content}function or(e,t){var n=U;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function T(e,t){var n=(t&Zi)!==0,r,a=!e.startsWith("<!>");return()=>{r===void 0&&(r=Ha(a?e:"<!>"+e,!0),r=dn(r));var i=n||ha?document.importNode(r,!0):r.cloneNode(!0);return or(i,i),i}}function Os(e,t,n="svg"){var r=!e.startsWith("<!>"),a=`<${n}>${r?e:"<!>"+e}</${n}>`,i;return()=>{if(!i){var s=Ha(a,!0),l=dn(s);i=dn(l)}var o=i.cloneNode(!0);return or(o,o),o}}function lr(e,t){return Os(e,t,"svg")}function Ba(){var e=document.createDocumentFragment(),t=document.createComment(""),n=ht();return e.append(t,n),or(t,n),e}function A(e,t){e!==null&&e.before(t)}function Q(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=n,e.nodeValue=n+"")}function Ns(e,t){return Fs(e,t)}const On=new Map;function Fs(e,{target:t,anchor:n,props:r={},events:a,context:i,intro:s=!0}){gs();var l=void 0,o=zs(()=>{var f=n??t.appendChild(ht());ss(f,{pending:()=>{}},d=>{Kt({});var p=ye;i&&(p.c=i),a&&(r.$$events=a),l=e(d,r)||{},Gt()});var u=new Set,_=d=>{for(var p=0;p<d.length;p++){var g=d[p];if(!u.has(g)){u.add(g);var x=Ls(g);for(const m of[t,document]){var h=On.get(m);h===void 0&&(h=new Map,On.set(m,h));var z=h.get(g);z===void 0?(m.addEventListener(g,sr,{passive:x}),h.set(g,1)):h.set(g,z+1)}}}};return _(An(Da)),ir.add(_),()=>{for(var d of u)for(const x of[t,document]){var p=On.get(x),g=p.get(d);--g==0?(x.removeEventListener(d,sr),p.delete(d),p.size===0&&On.delete(x)):p.set(d,g)}ir.delete(_),f!==n&&f.parentNode?.removeChild(f)}});return cr.set(l,o),l}let cr=new WeakMap;function Ds(e,t){const n=cr.get(e);return n?(cr.delete(e),n(t)):Promise.resolve()}class js{constructor(t,n=!0){Ze(this,"anchor");O(this,He,new Map);O(this,We,new Map);O(this,Ee,new Map);O(this,Nt,new Set);O(this,zn,!0);O(this,kn,()=>{var t=H;if(v(this,He).has(t)){var n=v(this,He).get(t),r=v(this,We).get(n);if(r)ar(r),v(this,Nt).delete(n);else{var a=v(this,Ee).get(n);a&&(v(this,We).set(n,a.effect),v(this,Ee).delete(n),a.fragment.lastChild.remove(),this.anchor.before(a.fragment),r=a.effect)}for(const[i,s]of v(this,He)){if(v(this,He).delete(i),i===t)break;const l=v(this,Ee).get(s);l&&(me(l.effect),v(this,Ee).delete(s))}for(const[i,s]of v(this,We)){if(i===n||v(this,Nt).has(i))continue;const l=()=>{if(Array.from(v(this,He).values()).includes(i)){var f=document.createDocumentFragment();Aa(s,f),f.append(ht()),v(this,Ee).set(i,{effect:s,fragment:f})}else me(s);v(this,Nt).delete(i),v(this,We).delete(i)};v(this,zn)||!r?(v(this,Nt).add(i),At(s,l,!1)):l()}}});O(this,jn,t=>{v(this,He).delete(t);const n=Array.from(v(this,He).values());for(const[r,a]of v(this,Ee))n.includes(r)||(me(a.effect),v(this,Ee).delete(r))});this.anchor=t,R(this,zn,n)}ensure(t,n){var r=H,a=ma();if(n&&!v(this,We).has(t)&&!v(this,Ee).has(t))if(a){var i=document.createDocumentFragment(),s=ht();i.append(s),v(this,Ee).set(t,{effect:De(()=>n(s)),fragment:i})}else v(this,We).set(t,De(()=>n(this.anchor)));if(v(this,He).set(r,t),a){for(const[l,o]of v(this,We))l===t?r.unskip_effect(o):r.skip_effect(o);for(const[l,o]of v(this,Ee))l===t?r.unskip_effect(o.effect):r.skip_effect(o.effect);r.oncommit(v(this,kn)),r.ondiscard(v(this,jn))}else v(this,kn).call(this)}}He=new WeakMap,We=new WeakMap,Ee=new WeakMap,Nt=new WeakMap,zn=new WeakMap,kn=new WeakMap,jn=new WeakMap;function K(e,t,n=!1){var r=new js(e),a=n?Ht:0;function i(s,l){r.ensure(s,l)}nr(()=>{var s=!1;t((l,o=0)=>{s=!0,i(o,l)}),s||i(!1,null)},a)}function ur(e,t){return t}function qs(e,t,n){for(var r=[],a=t.length,i,s=t.length,l=0;l<a;l++){let _=t[l];At(_,()=>{if(i){if(i.pending.delete(_),i.done.add(_),i.pending.size===0){var d=e.outrogroups;fr(An(i.done)),d.delete(i),d.size===0&&(e.outrogroups=null)}}else s-=1},!1)}if(s===0){var o=r.length===0&&n!==null;if(o){var f=n,u=f.parentNode;ms(u),u.append(f),e.items.clear()}fr(t,!o)}else i={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(i)}function fr(e,t=!0){for(var n=0;n<e.length;n++)me(e[n],t)}var Va;function _n(e,t,n,r,a,i=null){var s=e,l=new Map,o=(t&Yr)!==0;if(o){var f=e;s=f.appendChild(ht())}var u=null,_=la(()=>{var z=n();return Ur(z)?z:z==null?[]:An(z)}),d,p=!0;function g(){h.fallback=u,Us(h,d,s,t,r),u!==null&&(d.length===0?(u.f&et)===0?ar(u):(u.f^=et,mn(u,null,s)):At(u,()=>{u=null}))}var x=nr(()=>{d=c(_);for(var z=d.length,m=new Set,S=H,F=ma(),W=0;W<z;W+=1){var se=d[W],Y=r(se,W),$=p?null:l.get(Y);$?($.v&&Yt($.v,se),$.i&&Yt($.i,W),F&&S.unskip_effect($.e)):($=Hs(l,p?s:Va??(Va=ht()),se,Y,W,a,t,n),p||($.e.f|=et),l.set(Y,$)),m.add(Y)}if(z===0&&i&&!u&&(p?u=De(()=>i(s)):(u=De(()=>i(Va??(Va=ht()))),u.f|=et)),z>m.size&&Ri(),!p)if(F){for(const[C,j]of l)m.has(C)||S.skip_effect(j.e);S.oncommit(g),S.ondiscard(()=>{})}else g();c(_)}),h={effect:x,items:l,outrogroups:null,fallback:u};p=!1}function gn(e){for(;e!==null&&(e.f&Ie)===0;)e=e.next;return e}function Us(e,t,n,r,a){var i=(r&Vi)!==0,s=t.length,l=e.items,o=gn(e.effect.first),f,u=null,_,d=[],p=[],g,x,h,z;if(i)for(z=0;z<s;z+=1)g=t[z],x=a(g,z),h=l.get(x).e,(h.f&et)===0&&(h.nodes?.a?.measure(),(_??(_=new Set)).add(h));for(z=0;z<s;z+=1){if(g=t[z],x=a(g,z),h=l.get(x).e,e.outrogroups!==null)for(const j of e.outrogroups)j.pending.delete(h),j.done.delete(h);if((h.f&et)!==0)if(h.f^=et,h===o)mn(h,null,n);else{var m=u?u.next:o;h===e.effect.last&&(e.effect.last=h.prev),h.prev&&(h.prev.next=h.next),h.next&&(h.next.prev=h.prev),_t(e,u,h),_t(e,h,m),mn(h,m,n),u=h,d=[],p=[],o=gn(u.next);continue}if((h.f&xe)!==0&&(ar(h),i&&(h.nodes?.a?.unfix(),(_??(_=new Set)).delete(h))),h!==o){if(f!==void 0&&f.has(h)){if(d.length<p.length){var S=p[0],F;u=S.prev;var W=d[0],se=d[d.length-1];for(F=0;F<d.length;F+=1)mn(d[F],S,n);for(F=0;F<p.length;F+=1)f.delete(p[F]);_t(e,W.prev,se.next),_t(e,u,W),_t(e,se,S),o=S,u=se,z-=1,d=[],p=[]}else f.delete(h),mn(h,o,n),_t(e,h.prev,h.next),_t(e,h,u===null?e.effect.first:u.next),_t(e,u,h),u=h;continue}for(d=[],p=[];o!==null&&o!==h;)(f??(f=new Set)).add(o),p.push(o),o=gn(o.next);if(o===null)continue}(h.f&et)===0&&d.push(h),u=h,o=gn(h.next)}if(e.outrogroups!==null){for(const j of e.outrogroups)j.pending.size===0&&(fr(An(j.done)),e.outrogroups?.delete(j));e.outrogroups.size===0&&(e.outrogroups=null)}if(o!==null||f!==void 0){var Y=[];if(f!==void 0)for(h of f)(h.f&xe)===0&&Y.push(h);for(;o!==null;)(o.f&xe)===0&&o!==e.fallback&&Y.push(o),o=gn(o.next);var $=Y.length;if($>0){var C=(r&Yr)!==0&&s===0?n:null;if(i){for(z=0;z<$;z+=1)Y[z].nodes?.a?.measure();for(z=0;z<$;z+=1)Y[z].nodes?.a?.fix()}qs(e,Y,C)}}i&&tt(()=>{if(_!==void 0)for(h of _)h.nodes?.a?.apply()})}function Hs(e,t,n,r,a,i,s,l){var o=(s&Hi)!==0?(s&Ki)===0?ps(n,!1,!1):Et(n):null,f=(s&Bi)!==0?Et(a):null;return{v:o,i:f,e:De(()=>(i(t,o??n,f??a,l),()=>{e.delete(r)}))}}function mn(e,t,n){if(e.nodes)for(var r=e.nodes.start,a=e.nodes.end,i=t&&(t.f&et)===0?t.nodes.start:n;r!==null;){var s=vn(r);if(i.before(r),r===a)return;r=s}}function _t(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function gt(e,t){za(()=>{var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector("#"+t.hash)){const a=wa("style");a.id=t.hash,a.textContent=t.code,r.appendChild(a)}})}const Ka=[...`
5
+ \r\f \v\uFEFF`];function Bs(e,t,n){var r=e==null?"":""+e;if(t&&(r=r?r+" "+t:t),n){for(var a in n)if(n[a])r=r?r+" "+a:a;else if(r.length)for(var i=a.length,s=0;(s=r.indexOf(a,s))>=0;){var l=s+i;(s===0||Ka.includes(r[s-1]))&&(l===r.length||Ka.includes(r[l]))?r=(s===0?"":r.substring(0,s))+r.substring(l+1):s=l}}return r===""?null:r}function Vs(e,t){return e==null?null:String(e)}function Le(e,t,n,r,a,i){var s=e.__className;if(s!==n||s===void 0){var l=Bs(n,r,i);l==null?e.removeAttribute("class"):t?e.className=l:e.setAttribute("class",l),e.__className=n}else if(i&&a!==i)for(var o in i){var f=!!i[o];(a==null||f!==!!a[o])&&e.classList.toggle(o,f)}return i}function qe(e,t,n,r){var a=e.__style;if(a!==t){var i=Vs(t);i==null?e.removeAttribute("style"):e.style.cssText=i,e.__style=t}return r}const Ks=Symbol("is custom element"),Gs=Symbol("is html");function X(e,t,n,r){var a=Ws(e);a[t]!==(a[t]=n)&&(t==="loading"&&(e[Ti]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Ys(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Ws(e){return e.__attributes??(e.__attributes={[Ks]:e.nodeName.includes("-"),[Gs]:e.namespaceURI===Jr})}var Ga=new Map;function Ys(e){var t=e.getAttribute("is")||e.nodeName,n=Ga.get(t);if(n)return n;Ga.set(t,n=[]);for(var r,a=e,i=Element.prototype;i!==a;){r=yi(a);for(var s in r)r[s].set&&n.push(s);a=Hr(a)}return n}function Js(e,t,n=t){var r=new WeakSet;bs(e,"input",async a=>{var i=a?e.defaultValue:e.value;if(i=dr(e)?vr(i):i,n(i),H!==null&&r.add(H),await Ts(),i!==(i=t())){var s=e.selectionStart,l=e.selectionEnd,o=e.value.length;if(e.value=i??"",l!==null){var f=e.value.length;s===l&&l===o&&f>o?(e.selectionStart=f,e.selectionEnd=f):(e.selectionStart=s,e.selectionEnd=Math.min(l,f))}}}),Zt(t)==null&&e.value&&(n(dr(e)?vr(e.value):e.value),H!==null&&r.add(H)),tr(()=>{var a=t();if(e===document.activeElement){var i=Jn??H;if(r.has(i))return}dr(e)&&a===vr(e.value)||e.type==="date"&&!a&&!e.value||a!==e.value&&(e.value=a??"")})}function dr(e){var t=e.type;return t==="number"||t==="range"}function vr(e){return e===""?null:+e}function Wa(e,t){return e===t||e?.[cn]===t}function hr(e={},t,n,r){return za(()=>{var a,i;return tr(()=>{a=i,i=[],Zt(()=>{e!==n(...i)&&(t(e,...i),a&&Wa(n(...a),e)&&t(null,...a))})}),()=>{tt(()=>{i&&Wa(n(...i),e)&&t(null,...i)})}}),e}let Nn=!1;function Zs(e){var t=Nn;try{return Nn=!1,[e(),Nn]}finally{Nn=t}}function E(e,t,n,r){var a=(n&Yi)!==0,i=(n&Ji)!==0,s=r,l=!0,o=()=>(l&&(l=!1,s=i?Zt(r):r),s),f;if(a){var u=cn in e||Ai in e;f=Ut(e,t)?.set??(u&&t in e?m=>e[t]=m:void 0)}var _,d=!1;a?[_,d]=Zs(()=>e[t]):_=e[t],_===void 0&&r!==void 0&&(_=o(),f&&(Fi(),f(_)));var p;if(p=()=>{var m=e[t];return m===void 0?o():(l=!0,m)},(n&Wi)===0)return p;if(f){var g=e.$$legacy;return(function(m,S){return arguments.length>0?((!S||g||d)&&f(S?p():m),m):p()})}var x=!1,h=((n&Gi)!==0?Rn:la)(()=>(x=!1,p()));a&&c(h);var z=U;return(function(m,S){if(arguments.length>0){const F=S?c(h):a?rt(m):m;return y(h,F),x=!0,s!==void 0&&(s=F),m}return pt&&x||(z.f&$e)!==0?h.v:c(h)})}function Ya(e){ye===null&&Mi(),Ct(()=>{const t=Zt(e);if(typeof t=="function")return t})}function Qs(e,t){var n,r;return r=class{constructor(i){O(this,n,null);if(!Qe)throw new Error(`[sevn] ${t} só pode ser instanciado no navegador. Em SSR, monte o componente dentro de um efeito de cliente.`);const{target:s,...l}=i??{},o=typeof s=="string"?document.querySelector(s):s;if(!o)throw new Error(`[sevn] ${t}: alvo não encontrado`+(typeof s=="string"?` para o seletor "${s}".`:"."));vi(),R(this,n,Ns(e,{target:o,props:l}))}destroy(){if(!v(this,n))return Promise.resolve();const i=v(this,n);return R(this,n,null),Ds(i)}},n=new WeakMap,r}function Ja(e){try{return new URL(e,document.baseURI).searchParams.get("cid")}catch{return null}}function Xs(){const e=document.currentScript;if(e?.src){const n=Ja(e.src);if(n)return n}const t=document.querySelectorAll('script[src*="cid="]');for(const n of t){const r=Ja(n.src);if(r)return r}return null}function $s(){if(!Qe)return;const e=Xs();if(e)try{Hn(e)}catch(t){console.error("[sevn] Chave inválida na tag <script>:",t)}}const eo="5";typeof window<"u"&&((ai=window.__svelte??(window.__svelte={})).v??(ai.v=new Set)).add(eo);const to="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M25.9798%2026.872L17.6305%2018.5227C16.9638%2019.0907%2016.1971%2019.5302%2015.3305%2019.8413C14.4638%2020.1524%2013.5927%2020.308%2012.7171%2020.308C10.582%2020.308%208.77493%2019.5689%207.29582%2018.0907C5.8167%2016.6124%205.07715%2014.8058%205.07715%2012.6707C5.07715%2010.5356%205.81581%208.728%207.29315%207.248C8.77048%205.768%2010.5767%205.02711%2012.7118%205.02533C14.8469%205.02356%2016.6549%205.76311%2018.1358%207.244C19.6167%208.72489%2020.3571%2010.5324%2020.3571%2012.6667C20.3571%2013.5929%2020.1931%2014.4893%2019.8651%2015.356C19.5371%2016.2227%2019.106%2016.964%2018.5718%2017.58L26.9211%2025.928L25.9798%2026.872ZM12.7185%2018.9733C14.4874%2018.9733%2015.9807%2018.3644%2017.1985%2017.1467C18.4163%2015.9289%2019.0251%2014.4351%2019.0251%2012.6653C19.0251%2010.8956%2018.4163%209.40222%2017.1985%208.18533C15.9807%206.96844%2014.4874%206.35956%2012.7185%206.35867C10.9496%206.35778%209.45581%206.96667%208.23715%208.18533C7.01848%209.404%206.40959%2010.8973%206.41048%2012.6653C6.41137%2014.4333%207.02026%2015.9267%208.23715%2017.1453C9.45404%2018.364%2010.9474%2018.9729%2012.7171%2018.972'%20fill='%231C1C1C'/%3e%3c/svg%3e",wn="data:image/svg+xml,%3csvg%20width='13'%20height='8'%20viewBox='0%200%2013%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.91%20-0.00016065L12.97%201.06084L7.193%206.83984C7.10043%206.93299%206.99036%207.00692%206.86911%207.05737C6.74786%207.10782%206.61783%207.13379%206.4865%207.13379C6.35517%207.13379%206.22514%207.10782%206.10389%207.05737C5.98264%207.00692%205.87257%206.93299%205.78%206.83984L2.65457e-07%201.06084L1.06%200.000838803L6.485%205.42484L11.91%20-0.00016065Z'%20fill='black'/%3e%3c/svg%3e",Za="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.5%201.5L1.5%2010.5M1.5%201.5L10.5%2010.5'%20stroke='black'%20stroke-width='1.6'%20stroke-linecap='round'/%3e%3c/svg%3e";var no=T('<span class="mobile-label svelte-1dw55dz"> </span>'),ro=T('<input class="search-input svelte-1dw55dz" type="text"/>'),ao=T('<span class="field-label-prefix svelte-1dw55dz"> </span>'),io=T('<span class="field-text svelte-1dw55dz"><!> </span>'),so=T("<span> </span>"),oo=T('<button class="icon-clear svelte-1dw55dz" type="button" aria-label="Limpar seleção"><img alt="" aria-hidden="true"/></button>'),lo=T('<img alt="" aria-hidden="true"/>'),co=T('<img class="icon-search svelte-1dw55dz" alt="" aria-hidden="true"/>'),uo=T('<span class="meta svelte-1dw55dz"> </span>'),fo=T('<div class="web-info svelte-1dw55dz"><span class="selected-label svelte-1dw55dz"><strong class="svelte-1dw55dz">Você selecionou:</strong> </span> <!></div>'),vo=T('<button type="button" role="option"> </button>'),ho=T('<div class="no-results svelte-1dw55dz">Nenhum resultado encontrado</div>'),po=T('<div class="dropdown svelte-1dw55dz" role="listbox"></div>'),_o=T('<div><!> <div role="combobox" aria-haspopup="listbox"><!> <!></div> <!> <!></div>');const go={hash:"svelte-1dw55dz",code:`.autocomplete.svelte-1dw55dz {position:relative;width:var(--field-width);font-family:inherit;}
6
+
7
+ /* ── Label (mobile only) ─────────────────────────────── */.mobile-label.svelte-1dw55dz {display:none;font-size:0.875rem;font-weight:600;color:var(--sevn-color-tertiary);margin-bottom:6px;}
8
+
9
+ @media (max-width: 768px) {.mobile-label.svelte-1dw55dz {display:block;}
10
+ }
11
+
12
+ /* ── Campo principal ─────────────────────────────────── */.field.svelte-1dw55dz {display:flex;align-items:center;width:100%;height:var(--field-height);padding:0 14px;background:var(--sevn-color-neutral);border:1px solid transparent;border-radius:8px;cursor:pointer;gap:8px;transition:border-color 0.15s, box-shadow 0.15s;color:var(--sevn-color-tertiary);}.field.svelte-1dw55dz:hover {border-color:#d1d1d6;}.field.disabled.svelte-1dw55dz {cursor:not-allowed;opacity:0.55;}.field.disabled.svelte-1dw55dz:hover {border-color:transparent;}.field.open.svelte-1dw55dz {border-color:var(--sevn-color-primary);box-shadow:0 0 0 2px color-mix(in srgb, var(--sevn-color-primary) 15%, transparent);background:#fff;}
13
+
14
+ /* ── Texto do campo ──────────────────────────────────── */.field-text.svelte-1dw55dz {flex:1;text-align:left;font-size:0.9375rem;color:var(--sevn-color-tertiary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.field-text.is-placeholder.svelte-1dw55dz {color:#9a9aaa;}.field-label-prefix.svelte-1dw55dz {font-weight:600;margin-right:4px;}
15
+
16
+ /* ── Input de busca ──────────────────────────────────── */.search-input.svelte-1dw55dz {flex:1;border:none;outline:none;font-size:0.9375rem;font-family:inherit;color:var(--sevn-color-tertiary);background:transparent;min-width:0;}.search-input.svelte-1dw55dz::placeholder {color:#9a9aaa;}
17
+
18
+ /* ── Ícone de lupa ───────────────────────────────────── */.icon-search.svelte-1dw55dz {flex-shrink:0;}.field.open.svelte-1dw55dz .icon-search:where(.svelte-1dw55dz) {opacity:1;}
19
+
20
+ /* ── Botão de limpar ─────────────────────────────────── */.icon-clear.svelte-1dw55dz {display:flex;align-items:center;justify-content:center;flex-shrink:0;padding:0;background:none;border:none;border-radius:50%;cursor:pointer;transition:background 0.15s;}.icon-clear.svelte-1dw55dz:hover,
21
+ .icon-clear.svelte-1dw55dz:focus-visible {background:rgba(0, 0, 0, 0.08);}
22
+
23
+ /* ── Ícone de chevron ────────────────────────────────── */.icon-chevron.svelte-1dw55dz {flex-shrink:0;transition:transform 0.2s ease;}.icon-chevron.open.svelte-1dw55dz {transform:rotate(180deg);}
24
+
25
+ /* ── "Você selecionou" (web only) ────────────────────── */.web-info.svelte-1dw55dz {display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:20px;font-size:0.8125rem;color:var(--sevn-color-tertiary);}.selected-label.svelte-1dw55dz strong:where(.svelte-1dw55dz) {font-weight:600;}.meta.svelte-1dw55dz {font-size:0.7rem;opacity:50%;}
26
+
27
+ @media (max-width: 768px) {.web-info.svelte-1dw55dz {display:none;}.field-text.svelte-1dw55dz {font-weight:600;}.field-text.is-placeholder.svelte-1dw55dz:not(.force-placeholder) {display:none;}.search-input.svelte-1dw55dz::placeholder {color:transparent;}.show-placeholder-mobile.svelte-1dw55dz .search-input:where(.svelte-1dw55dz)::placeholder {color:#9a9aaa;}.icon-search.svelte-1dw55dz {margin-left:auto;}
28
+ }
29
+
30
+ /* ── Dropdown ────────────────────────────────────────── */.dropdown.svelte-1dw55dz {position:absolute;top:calc(var(--field-height) + 6px);left:0;right:0;background:#fff;border:1px solid #d1d1d6;border-radius:8px;max-height:240px;overflow-y:auto;z-index:200;box-shadow:0 6px 16px rgba(0, 0, 0, 0.1);scrollbar-width:thin;scrollbar-color:#d1d1d6 transparent;}.dropdown.svelte-1dw55dz::-webkit-scrollbar {width:4px;}.dropdown.svelte-1dw55dz::-webkit-scrollbar-track {background:transparent;}.dropdown.svelte-1dw55dz::-webkit-scrollbar-thumb {background-color:#d1d1d6;border-radius:4px;}
31
+
32
+ /* ── Opção ───────────────────────────────────────────── */.option.svelte-1dw55dz {display:block;width:100%;padding:11px 14px;text-align:left;background:none;border:none;border-bottom:1px solid #f0f0f5;cursor:pointer;font-size:0.9375rem;font-family:inherit;color:var(--sevn-color-tertiary);transition:background 0.1s;line-height:1.4;}.option.svelte-1dw55dz:last-child {border-bottom:none;}.option.svelte-1dw55dz:hover {background:var(--sevn-color-neutral);}.option.selected.svelte-1dw55dz {background:color-mix(in srgb, var(--sevn-color-primary) 8%, transparent);color:var(--sevn-color-primary);font-weight:600;}.no-results.svelte-1dw55dz {padding:14px;color:#9a9aaa;font-size:0.875rem;text-align:center;}`};function Fn(e,t){Kt(t,!0),gt(e,go);let n=E(t,"label",3,""),r=E(t,"showLabel",3,!0),a=E(t,"options",19,()=>[]),i=E(t,"value",15,null),s=E(t,"meta",3,""),l=E(t,"width",3,"100%"),o=E(t,"height",3,"48px"),f=E(t,"icon",3,to),u=E(t,"iconSize",3,13),_=E(t,"showLabelInField",3,!1),d=E(t,"showDescriptionSelection",3,!0),p=E(t,"labelAsPlaceholder",3,!0),g=E(t,"showPlaceholderOnMobile",3,!1),x=E(t,"disabled",3,!1),h=E(t,"clearable",3,!0);const z=`autocomplete-listbox-${Math.random().toString(36).slice(2,9)}`;let m=Z(!1),S=Z(""),F=Z(null),W=Z(null),se=te(()=>c(S).trim()?a().filter(k=>k.label.toLowerCase().includes(c(S).trim().toLowerCase())):a()),Y=te(()=>i()!=null?a().find(k=>k.value===i())??null:null);function $(k){i(k.value),y(S,""),y(m,!1)}function C(){x()||(y(m,!c(m)),c(m)||y(S,""))}function j(k){k.stopPropagation(),i(null),y(S,""),y(m,!1)}function oe(k){k.target===k.currentTarget&&(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),C())}function D(k){c(F)&&!c(F).contains(k.target)&&(y(m,!1),y(S,""))}function M(k){k.key==="Escape"&&(y(m,!1),y(S,""))}Ct(()=>{c(m)&&c(W)&&c(W).focus()}),Ct(()=>{x()&&(y(m,!1),y(S,""))}),Ya(()=>(document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)));var q=_o();let ae;var _e=b(q);{var be=k=>{var L=no(),w=b(L);N(()=>Q(w,n())),A(k,L)};K(_e,k=>{r()&&n()&&k(be)})}var ie=P(_e,2);let Re;var ut=b(ie);{var wt=k=>{var L=ro();hr(L,w=>y(W,w),()=>c(W)),N(()=>X(L,"placeholder",n())),it("keydown",L,M),it("click",L,w=>w.stopPropagation()),Js(L,()=>c(S),w=>y(S,w)),A(k,L)},Ft=k=>{var L=io(),w=b(L);{var J=B=>{var he=ao(),Ye=b(he);N(()=>Q(Ye,n())),A(B,he)};K(w,B=>{_()&&B(J)})}var ee=P(w,1,!0);N(()=>Q(ee,c(Y).label)),A(k,L)},an=k=>{var L=Ba(),w=ga(L);{var J=ee=>{var B=so();let he;var Ye=b(B);N(()=>{he=Le(B,1,"field-text is-placeholder svelte-1dw55dz",null,he,{"force-placeholder":g()}),Q(Ye,n())}),A(ee,B)};K(w,ee=>{p()&&ee(J)})}A(k,L)};K(ut,k=>{c(m)?k(wt):c(Y)?k(Ft,1):k(an,!1)})}var Sn=P(ut,2);{var pe=k=>{var L=oo(),w=b(L);N(()=>{X(w,"src",Za),X(w,"width",u()?u():12),X(w,"height",u()?u():12)}),it("click",L,j),A(k,L)},bt=k=>{var L=lo();let w;N(()=>{w=Le(L,1,"icon-chevron svelte-1dw55dz",null,w,{open:c(m)}),X(L,"src",wn),X(L,"width",u()?u():12),X(L,"height",u()?u():12)}),A(k,L)},xr=k=>{var L=co();N(()=>{X(L,"src",f()),X(L,"width",u()),X(L,"height",u())}),A(k,L)};K(Sn,k=>{c(Y)&&h()&&!x()?k(pe):c(Y)?k(bt,1):k(xr,!1)})}var En=P(ie,2);{var yr=k=>{var L=fo(),w=b(L),J=P(b(w)),ee=P(w,2);{var B=he=>{var Ye=uo(),Cn=b(Ye);N(()=>Q(Cn,s())),A(he,Ye)};K(ee,he=>{s()&&he(B)})}N(()=>Q(J,` ${c(Y).label??""}`)),A(k,L)};K(En,k=>{c(Y)&&d()&&k(yr)})}var zr=P(En,2);{var kr=k=>{var L=po();_n(L,21,()=>c(se),w=>w.value,(w,J)=>{var ee=vo();let B;var he=b(ee);N(()=>{B=Le(ee,1,"option svelte-1dw55dz",null,B,{selected:c(J).value===i()}),X(ee,"aria-selected",c(J).value===i()),Q(he,c(J).label)}),it("click",ee,()=>$(c(J))),A(w,ee)},w=>{var J=ho();A(w,J)}),N(()=>X(L,"id",z)),A(k,L)};K(zr,k=>{c(m)&&k(kr)})}hr(q,k=>y(F,k),()=>c(F)),N(()=>{ae=Le(q,1,"autocomplete svelte-1dw55dz",null,ae,{"show-placeholder-mobile":g()}),qe(q,`--field-width: ${l()??""}; --field-height: ${o()??""}`),Re=Le(ie,1,"field svelte-1dw55dz",null,Re,{open:c(m),"has-value":c(Y)&&!c(m),disabled:x()}),X(ie,"tabindex",x()?-1:0),X(ie,"aria-controls",z),X(ie,"aria-expanded",c(m)),X(ie,"aria-disabled",x())}),it("click",ie,C),it("keydown",ie,oe),A(e,q),Gt()}qa(["click","keydown"]);var mo=T("<span> </span>");const wo={hash:"svelte-pamnib",code:".tag.svelte-pamnib {display:inline-flex;align-items:center;padding:4px 8px;border-radius:5px;font-family:inherit;font-weight:700;color:#ffffff;white-space:nowrap;letter-spacing:0.03em;width:fit-content;}"};function bn(e,t){gt(e,wo);let n=E(t,"color",3,"#1C1C1C"),r=E(t,"fontSize",3,"0.6875rem"),a=E(t,"class",3,"");var i=mo(),s=b(i);N(()=>{Le(i,1,`tag ${a()??""}`,"svelte-pamnib"),qe(i,`background-color: ${n()??""}; font-size: ${r()??""}`),Q(s,t.label)}),A(e,i)}var bo=T("<span> </span>"),xo=T('<div class="vote-overview-stats svelte-1m9ufac"></div>'),yo=T("<span> </span>"),zo=T('<span class="vote-overview-sep svelte-1m9ufac">|</span>'),ko=T("<span> </span>"),So=T('<div class="vote-overview-meta svelte-1m9ufac"><!> <!> <!></div>'),Eo=T('<div class="vote-overview svelte-1m9ufac"><!> <!></div>');const Co={hash:"svelte-1m9ufac",code:".vote-overview.svelte-1m9ufac {display:flex;align-items:center;padding:0.5rem 1rem;font-size:0.8rem;color:#1c1c1c;gap:1rem;flex-wrap:wrap;opacity:50%;}.vote-overview-stats.svelte-1m9ufac {display:flex;align-items:center;gap:1.5rem;font-weight:600;}.vote-overview-meta.svelte-1m9ufac {display:flex;align-items:center;gap:0.4rem;font-weight:400;white-space:nowrap;}.vote-overview-sep.svelte-1m9ufac {opacity:0.4;}"};function Ao(e,t){Kt(t,!0),gt(e,Co);let n=E(t,"data",19,()=>[]),r=E(t,"borderTop",3,!1),a=E(t,"align",3,"start");var i=Eo(),s=b(i);{var l=u=>{var _=xo();_n(_,21,n,ur,(d,p)=>{var g=bo(),x=b(g);N(()=>Q(x,`${c(p).text??""} ${c(p).value??""}`)),A(d,g)}),A(u,_)};K(s,u=>{n().length&&u(l)})}var o=P(s,2);{var f=u=>{var _=So(),d=b(_);{var p=m=>{var S=yo(),F=b(S);N(()=>Q(F,`Atualizado em ${t.date??""}`)),A(m,S)};K(d,m=>{t.date&&m(p)})}var g=P(d,2);{var x=m=>{var S=zo();A(m,S)};K(g,m=>{t.date&&t.font&&m(x)})}var h=P(g,2);{var z=m=>{var S=ko(),F=b(S);N(()=>Q(F,`Fonte ${t.font??""}`)),A(m,S)};K(h,m=>{t.font&&m(z)})}A(u,_)};K(o,u=>{(t.date||t.font)&&u(f)})}N(()=>qe(i,`justify-content:${a()==="end"?"flex-end":"flex-start"};${r()?"border-top:1px solid var(--sevn-color-neutral)":""}`)),A(e,i),Gt()}var To=T('<div><div class="candidates-votes-ranking-candidate svelte-icwugj"><span class="candidates-votes-ranking-dot svelte-icwugj"></span> <div class="candidates-votes-ranking-info svelte-icwugj"><span class="candidates-votes-ranking-name svelte-icwugj"> </span> <!> <!> <!></div></div> <span class="candidates-votes-ranking-votes svelte-icwugj"> </span></div>'),Mo=T('<div class="candidates-votes-ranking svelte-icwugj"><div class="candidates-votes-ranking-header svelte-icwugj"><span> </span> <span> </span></div> <!> <!></div>');const Lo={hash:"svelte-icwugj",code:`.candidates-votes-ranking.svelte-icwugj {display:flex;flex-direction:column;font-family:inherit;}
33
+
34
+ /* ── Header ── */.candidates-votes-ranking-header.svelte-icwugj {display:flex;justify-content:space-between;align-items:center;padding:0 0 8px;font-size:0.85rem;font-weight:600;color:var(--sevn-color-tertiary);}
35
+
36
+ /* ── Row ── */.candidates-votes-ranking-row.svelte-icwugj {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 0;border-bottom:1px solid var(--sevn-color-neutral);transition:background-color 0.15s ease;}.candidates-votes-ranking-row.svelte-icwugj:last-of-type {border-bottom:none;}.candidates-votes-ranking-row.elected.svelte-icwugj {background-color:#e8f5ee;margin:0 -12px;padding:14px 12px;border-radius:8px;}
37
+
38
+ /* ── Left side ── */.candidates-votes-ranking-candidate.svelte-icwugj {display:flex;align-items:center;gap:10px;min-width:0;flex:1;}.candidates-votes-ranking-dot.svelte-icwugj {width:var(--dot-size);height:var(--dot-size);border-radius:50%;flex-shrink:0;}.candidates-votes-ranking-info.svelte-icwugj {display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-width:0;}.candidates-votes-ranking-name.svelte-icwugj {font-size:var(--name-size);font-weight:var(--name-weight);color:var(--sevn-color-tertiary);white-space:nowrap;}
39
+
40
+ /* ── Right side ── */.candidates-votes-ranking-votes.svelte-icwugj {font-size:var(--votes-size);font-weight:var(--votes-weight);color:var(--sevn-color-tertiary);white-space:nowrap;flex-shrink:0;opacity:0.5;}
41
+
42
+ /* ── Responsive ── */
43
+ @media (max-width: 480px) {.candidates-votes-ranking-name.svelte-icwugj {font-size:calc(var(--name-size) * 0.9);}.candidates-votes-ranking-votes.svelte-icwugj {font-size:calc(var(--votes-size) * 0.9);}.candidates-votes-ranking-row.elected.svelte-icwugj {margin:0 -8px;padding:14px 8px;}
44
+ }`};function Ro(e,t){gt(e,Lo);let n=E(t,"candidates",19,()=>[]),r=E(t,"headerLeft",3,"Partido/ Candidato"),a=E(t,"headerRight",3,"Votos"),i=E(t,"dotSize",3,"12px"),s=E(t,"nameFontSize",3,"1rem"),l=E(t,"nameWeight",3,700),o=E(t,"votesFontSize",3,"0.875rem"),f=E(t,"votesWeight",3,600),u=E(t,"tagFontSize",3,"0.6875rem"),_=E(t,"electedColor",3,"var(--sevn-color-green)"),d=E(t,"electedLabel",3,"ELEITO");const p=te(()=>!!(t.totalVotes||t.date||t.font)),g=te(()=>t.totalVotes?[{text:"Total",value:`${t.totalVotes} votos`}]:[]);var x=Mo(),h=b(x),z=b(h),m=b(z),S=P(z,2),F=b(S),W=P(h,2);_n(W,17,n,ur,($,C)=>{var j=To();let oe;var D=b(j),M=b(D),q=P(M,2),ae=b(q),_e=b(ae),be=P(ae,2);{var ie=pe=>{{let bt=te(()=>c(C).tagColor??"var(--sevn-color-secondary)");bn(pe,{get label(){return c(C).tag},get color(){return c(bt)},get fontSize(){return u()}})}};K(be,pe=>{c(C).tag&&pe(ie)})}var Re=P(be,2);{var ut=pe=>{bn(pe,{get label(){return d()},get color(){return _()},get fontSize(){return u()}})};K(Re,pe=>{c(C).elected&&pe(ut)})}var wt=P(Re,2);{var Ft=pe=>{{let bt=te(()=>c(C).statusColor??"var(--sevn-color-tertiary)");bn(pe,{get label(){return c(C).statusLabel},get color(){return c(bt)},get fontSize(){return u()}})}};K(wt,pe=>{c(C).statusLabel&&pe(Ft)})}var an=P(D,2),Sn=b(an);N(()=>{oe=Le(j,1,"candidates-votes-ranking-row svelte-icwugj",null,oe,{elected:c(C).elected}),qe(M,`background-color: ${c(C).dotColor??"var(--sevn-color-secondary)"??""}`),Q(_e,c(C).name),Q(Sn,c(C).votes)}),A($,j)});var se=P(W,2);{var Y=$=>{Ao($,{get data(){return c(g)},get date(){return t.date},get font(){return t.font},borderTop:!0})};K(se,$=>{c(p)&&$(Y)})}N(()=>{qe(x,`
45
+ --dot-size: ${i()??""};
46
+ --name-size: ${s()??""};
47
+ --name-weight: ${l()??""};
48
+ --votes-size: ${o()??""};
49
+ --votes-weight:${f()??""};
50
+ `),Q(m,r()),Q(F,a())}),A(e,x)}function Po(e,t,n,r,a,i){const s=n-i,l=Qa(r),o=Qa(a),f=a-r>180?1:0,u=e+n*Math.cos(l),_=t+n*Math.sin(l),d=e+n*Math.cos(o),p=t+n*Math.sin(o),g=e+s*Math.cos(o),x=t+s*Math.sin(o),h=e+s*Math.cos(l),z=t+s*Math.sin(l);return[`M ${u} ${_}`,`A ${n} ${n} 0 ${f} 1 ${d} ${p}`,`L ${g} ${x}`,`A ${s} ${s} 0 ${f} 0 ${h} ${z}`,"Z"].join(" ")}function Qa(e){return e*Math.PI/180}var Io=lr('<path style="cursor: pointer; transition: opacity 0.2s;" role="button" tabindex="0"><title> </title></path>'),Oo=lr('<text text-anchor="middle" dominant-baseline="middle" class="donut-chart-center-label svelte-1q978zv"> </text>'),No=lr('<text text-anchor="middle" dominant-baseline="middle" class="donut-chart-center-sub svelte-1q978zv"> </text>'),Fo=T('<div class="donut-tooltip svelte-1q978zv"><div class="donut-tooltip-content svelte-1q978zv"><div class="donut-tooltip-header svelte-1q978zv"></div> <div class="donut-tooltip-body svelte-1q978zv"><div class="donut-tooltip-label svelte-1q978zv"> </div> <div class="donut-tooltip-value svelte-1q978zv"> </div></div></div> <div class="donut-tooltip-arrow svelte-1q978zv"></div></div>'),Do=T('<div class="donut-chart svelte-1q978zv"><svg viewBox="0 0 200 200" role="img" aria-label="Gráfico de donut" class="svelte-1q978zv"><!><!><!></svg> <!></div>');const jo={hash:"svelte-1q978zv",code:`.donut-chart.svelte-1q978zv {display:inline-block;}svg.svelte-1q978zv {width:100%;height:100%;display:block;}.donut-chart-center-label.svelte-1q978zv {font-family:inherit;font-weight:700;fill:var(--sevn-color-tertiary);}.donut-chart-center-sub.svelte-1q978zv {font-family:inherit;font-weight:500;fill:#9a9aaa;}
51
+
52
+ /* ── Hover effect ─────────────────────── */svg.svelte-1q978zv path.hovered:where(.svelte-1q978zv) {opacity:0.8;filter:brightness(1.1);}
53
+
54
+ /* ── Foco: sem outline ao clicar (mouse), mantém pra navegação por teclado ── */svg.svelte-1q978zv path:where(.svelte-1q978zv):focus {outline:none;}svg.svelte-1q978zv path:where(.svelte-1q978zv):focus-visible {outline:2px solid var(--sevn-color-tertiary, #1c1c1c);outline-offset:2px;}
55
+
56
+ /* ── Tooltip ──────────────────────────── */.donut-tooltip.svelte-1q978zv {position:fixed;left:var(--tooltip-x);top:var(--tooltip-y);transform:translate(-50%, -100%);z-index:1000;pointer-events:none;
57
+ animation: svelte-1q978zv-slideUp 0.2s ease-out;}
58
+
59
+ @keyframes svelte-1q978zv-slideUp {
60
+ from {
61
+ opacity: 0;
62
+ transform: translate(-50%, -90%);
63
+ }
64
+ to {
65
+ opacity: 1;
66
+ transform: translate(-50%, -100%);
67
+ }
68
+ }.donut-tooltip-content.svelte-1q978zv {background:white;border-radius:8px;box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);overflow:hidden;min-width:140px;}.donut-tooltip-header.svelte-1q978zv {height:4px;width:100%;}.donut-tooltip-body.svelte-1q978zv {padding:12px 16px;display:flex;flex-direction:column;gap:4px;}.donut-tooltip-label.svelte-1q978zv {font-size:0.75rem;font-weight:600;color:var(--sevn-color-tertiary, #1c1c1c);text-transform:uppercase;letter-spacing:0.05em;}.donut-tooltip-value.svelte-1q978zv {font-size:1.125rem;font-weight:700;color:var(--sevn-color-tertiary, #1c1c1c);}.donut-tooltip-arrow.svelte-1q978zv {position:absolute;bottom:-6px;left:50%;transform:translateX(-50%);width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid white;filter:drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));}`};function qo(e,t){Kt(t,!0),gt(e,jo);let n=E(t,"segments",19,()=>[]),r=E(t,"size",3,"200px"),a=E(t,"radius",3,80),i=E(t,"thickness",3,32),s=E(t,"gap",3,2),l=E(t,"centerLabelSize",3,22),o=E(t,"centerSubSize",3,10);const f=100,u=100;let _=Z(null),d=Z(rt({x:0,y:0}));function p(D,M){y(_,M,!0);const q=D.currentTarget.getBoundingClientRect();y(d,{x:q.left+q.width/2,y:q.top-10},!0)}function g(){y(_,null)}const x=te(()=>n().reduce((D,M)=>D+M.value,0)),h=te(()=>Math.min(a(),100)),z=te(()=>Math.min(i(),50)),m=te(()=>{if(c(x)===0)return[];const D=s();let M=-90;return n().map(q=>{const ae=q.value/c(x)*360-D,_e=M+D/2,be=_e+ae;return M+=q.value/c(x)*360,{path:Po(f,u,c(h),_e,be,c(z)),color:q.color,label:q.label}})});var S=Do(),F=b(S),W=b(F);_n(W,17,()=>c(m),ur,(D,M,q)=>{var ae=Io();let _e;var be=b(ae),ie=b(be);N(()=>{X(ae,"d",c(M).path),X(ae,"fill",c(M).color),_e=Le(ae,0,"svelte-1q978zv",null,_e,{hovered:c(_)===q}),Q(ie,c(M).label)}),ja("mouseenter",ae,Re=>p(Re,q)),ja("mouseleave",ae,g),A(D,ae)});var se=P(W);{var Y=D=>{var M=Oo();X(M,"x",f);var q=b(M);N(()=>{X(M,"y",t.centerSub?u-6:u),qe(M,`font-size: ${l()??""}px`),Q(q,t.centerLabel)}),A(D,M)};K(se,D=>{t.centerLabel&&D(Y)})}var $=P(se);{var C=D=>{var M=No();X(M,"x",f),X(M,"y",u+18);var q=b(M);N(()=>{qe(M,`font-size: ${o()??""}px`),Q(q,t.centerSub)}),A(D,M)};K($,D=>{t.centerSub&&D(C)})}var j=P(F,2);{var oe=D=>{const M=te(()=>n()[c(_)]);var q=Fo(),ae=b(q),_e=b(ae),be=P(_e,2),ie=b(be),Re=b(ie),ut=P(ie,2),wt=b(ut);N(Ft=>{qe(q,`--tooltip-x: ${c(d).x??""}px; --tooltip-y: ${c(d).y??""}px;`),qe(_e,`background-color: ${c(M).color??""};`),Q(Re,c(M).label),Q(wt,`${Ft??""}%`)},[()=>c(M).value.toFixed(1)]),A(D,q)};K(j,D=>{c(_)!==null&&n()[c(_)]&&D(oe)})}N(()=>qe(S,`width: ${r()??""}; height: ${r()??""};`)),A(e,S),Gt()}var Uo=T('<span class="trigger-label svelte-hkzjiw"> </span>'),Ho=T('<img alt="" aria-hidden="true" width="10" height="10"/>'),Bo=T('<button class="clear svelte-hkzjiw" type="button"><img alt="" aria-hidden="true" width="8" height="8"/></button>'),Vo=T('<button type="button" role="option"> </button>'),Ko=T('<div class="dropdown svelte-hkzjiw" role="listbox"></div>'),Go=T('<div class="filter-dropdown svelte-hkzjiw"><button type="button" aria-haspopup="listbox"><!> <span class="trigger-value svelte-hkzjiw"> </span> <!></button> <!> <!></div>');const Wo={hash:"svelte-hkzjiw",code:`.filter-dropdown.svelte-hkzjiw {position:relative;display:inline-flex;align-items:center;}
69
+
70
+ /* ── Trigger ─────────────────────────────── */.trigger.svelte-hkzjiw {display:inline-flex;align-items:center;gap:4px;padding:0;background:none;border:none;cursor:pointer;font-family:inherit;font-size:0.875rem;color:var(--sevn-color-tertiary);white-space:nowrap;}.trigger-label.svelte-hkzjiw {font-weight:700;}.trigger-value.svelte-hkzjiw {font-weight:400;}.trigger-chevron.svelte-hkzjiw {flex-shrink:0;transition:transform 0.2s ease;margin-left:2px;}.trigger-chevron.rotated.svelte-hkzjiw {transform:rotate(180deg);}
71
+
72
+ /* ── Botão de limpar ─────────────────────── */.clear.svelte-hkzjiw {display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:16px;height:16px;margin-left:4px;padding:0;background:none;border:none;border-radius:50%;cursor:pointer;transition:background 0.15s;}.clear.svelte-hkzjiw:hover,
73
+ .clear.svelte-hkzjiw:focus-visible {background:rgba(0, 0, 0, 0.08);}
74
+
75
+ /* ── Dropdown ────────────────────────────── */.dropdown.svelte-hkzjiw {position:absolute;top:calc(100% + 6px);left:0;min-width:100%;background:#fff;border:1px solid #d1d1d6;border-radius:8px;box-shadow:0 6px 16px rgba(0, 0, 0, 0.1);z-index:200;overflow:hidden;}
76
+
77
+ /* ── Options ─────────────────────────────── */.option.svelte-hkzjiw {display:block;width:100%;padding:10px 14px;text-align:left;background:none;border:none;border-bottom:1px solid #f0f0f5;cursor:pointer;font-size:0.875rem;font-family:inherit;color:var(--sevn-color-tertiary);white-space:nowrap;transition:background 0.1s;}.option.svelte-hkzjiw:last-child {border-bottom:none;}.option.svelte-hkzjiw:hover {background:var(--sevn-color-neutral);}.option.selected.svelte-hkzjiw {background:color-mix(in srgb, var(--sevn-color-primary) 8%, transparent);color:var(--sevn-color-primary);font-weight:600;}`};function Yo(e,t){Kt(t,!0),gt(e,Wo);let n=E(t,"label",3,""),r=E(t,"options",19,()=>[]),a=E(t,"value",15,null),i=E(t,"clearable",3,!0),s=Z(!1),l=Z(null);const o=te(()=>a()!=null?r().find(C=>C.value===a())??null:null);function f(C){a(C.value),y(s,!1)}function u(){a(null),y(s,!1)}function _(C){c(l)&&!c(l).contains(C.target)&&y(s,!1)}Ya(()=>(document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)));var d=Go(),p=b(d);let g;var x=b(p);{var h=C=>{var j=Uo(),oe=b(j);N(()=>Q(oe,`${n()??""}:`)),A(C,j)};K(x,C=>{n()&&C(h)})}var z=P(x,2),m=b(z),S=P(z,2);{var F=C=>{var j=Ho();let oe;N(()=>{oe=Le(j,1,"trigger-chevron svelte-hkzjiw",null,oe,{rotated:c(s)}),X(j,"src",wn)}),A(C,j)};K(S,C=>{c(o)&&i()||C(F)})}var W=P(p,2);{var se=C=>{var j=Bo(),oe=b(j);N(()=>{X(j,"aria-label",`Limpar ${(n()||"filtro")??""}`),X(oe,"src",Za)}),it("click",j,u),A(C,j)};K(W,C=>{c(o)&&i()&&C(se)})}var Y=P(W,2);{var $=C=>{var j=Ko();_n(j,21,r,oe=>oe.value,(oe,D)=>{var M=Vo();let q;var ae=b(M);N(()=>{q=Le(M,1,"option svelte-hkzjiw",null,q,{selected:c(D).value===a()}),X(M,"aria-selected",c(D).value===a()),Q(ae,c(D).label)}),it("click",M,()=>f(c(D))),A(oe,M)}),A(C,j)};K(Y,C=>{c(s)&&C($)})}hr(d,C=>y(l,C),()=>c(l)),N(()=>{g=Le(p,1,"trigger svelte-hkzjiw",null,g,{open:c(s)}),X(p,"aria-expanded",c(s)),Q(m,c(o)?c(o).label:"")}),it("click",p,()=>y(s,!c(s))),A(e,d),Gt()}qa(["click"]);var Jo=T('<span class="header-tag-above svelte-1xm1ks6"><!></span>'),Zo=T('<span class="header-tag-inline svelte-1xm1ks6"><!></span>'),Qo=T('<p class="header-description svelte-1xm1ks6"> </p>'),Xo=T('<header class="header svelte-1xm1ks6"><!> <div class="header-title-row svelte-1xm1ks6"><h1 class="header-title svelte-1xm1ks6"> </h1> <!></div> <!></header>');const $o={hash:"svelte-1xm1ks6",code:`.header.svelte-1xm1ks6 {display:flex;flex-direction:column;gap:4px;}.header-tag-inline.svelte-1xm1ks6 {display:none;}.header-title-row.svelte-1xm1ks6 {display:flex;align-items:center;gap:10px;}.header-title.svelte-1xm1ks6 {font-size:var(--header-title-font-size);font-weight:var(--header-title-font-weight);color:var(--sevn-color-tertiary);line-height:1.15;}.header-description.svelte-1xm1ks6 {font-size:var(--header-description-font-size);color:var(--sevn-color-tertiary);}
78
+
79
+ @media (max-width: 767px) {.header-title.svelte-1xm1ks6 {font-size:calc(var(--header-title-font-size) * 0.75);max-width:60%;}.header-description.svelte-1xm1ks6 {font-size:calc(var(--header-description-font-size) * 0.9);}
80
+ }
81
+
82
+ @media (min-width: 768px) {.header-tag-above.svelte-1xm1ks6 {display:none;}.header-tag-inline.svelte-1xm1ks6 {display:inline-flex;}
83
+ }`};function el(e,t){gt(e,$o);var n=Xo(),r=b(n);{var a=d=>{var p=Jo(),g=b(p);bn(g,{get label(){return t.tag},get color(){return t.tagColor}}),A(d,p)};K(r,d=>{t.tag&&d(a)})}var i=P(r,2),s=b(i),l=b(s),o=P(s,2);{var f=d=>{var p=Zo(),g=b(p);bn(g,{get label(){return t.tag},get color(){return t.tagColor}}),A(d,p)};K(o,d=>{t.tag&&d(f)})}var u=P(i,2);{var _=d=>{var p=Qo(),g=b(p);N(()=>Q(g,t.description)),A(d,p)};K(u,d=>{t.description&&d(_)})}N(()=>{qe(n,`
84
+ --header-title-font-size: ${t.titleFontSize??"1.75rem"??""};
85
+ --header-title-font-weight: ${t.titleFontWeight??700??""};
86
+ --header-description-font-size: ${t.descriptionFontSize??"0.875rem"??""};
87
+ `),Q(l,t.title)}),A(e,n)}class Xa{constructor(t={}){var n,r,a;this.inflight=new Map,this.tick=0,this.storageKey=(n=t.storageKey)!==null&&n!==void 0?n:"reqcache",this.maxEntries=(r=t.maxEntries)!==null&&r!==void 0?r:100,this.storage=(a=t.storage)!==null&&a!==void 0?a:nl()}async getFetch(t,n,r={}){const a=Date.now(),i=this.readAll(),s=i.find(f=>f.rota===t);if(s&&a<s.expiresAt)return s.lastAccess=this.nextAccess(),this.writeAll(i),s.data;const l=this.inflight.get(t);if(l)return l;const o=this.revalidate(t,n,r,s??null).finally(()=>this.inflight.delete(t));return this.inflight.set(t,o),o}invalidate(t){const n=this.readAll().filter(r=>r.rota!==t);this.writeAll(n)}cleanup(t=3600){const n=Date.now()-t*1e3,r=this.readAll(),a=r.filter(i=>i.expiresAt>n);return this.writeAll(a),r.length-a.length}clear(){if(this.storage)try{this.storage.removeItem(this.storageKey)}catch{}}nextAccess(){return this.tick=Math.max(Date.now(),this.tick+1),this.tick}async revalidate(t,n,r,a){var i,s;const l=(i=r.fetcher)!==null&&i!==void 0?i:fetch;let o;try{const u=await l(t,r.fetchOptions);if(!u.ok)throw new Error(`HTTP ${u.status} ao buscar ${t}`);o=await u.json()}catch(u){if(a&&(!((s=r.staleOnError)!==null&&s!==void 0)||s))return this.upsert({...a,expiresAt:Date.now()+n,lastAccess:this.nextAccess()}),a.data;throw u}if(a&&r.monotonicKey){const u=$a(a.data,r.monotonicKey),_=$a(o,r.monotonicKey);if(typeof u=="number"&&typeof _=="number"&&_<=u)return this.upsert({...a,expiresAt:Date.now()+n,lastAccess:this.nextAccess()}),a.data}const f=Date.now();return this.upsert({rota:t,data:o,createdAt:f,expiresAt:f+n,lastAccess:this.nextAccess()}),o}upsert(t){const n=this.readAll().filter(r=>r.rota!==t.rota);n.push(t),this.evictIfNeeded(n),this.writeAll(n)}evictIfNeeded(t){for(;t.length>this.maxEntries;){let n=0;for(let r=1;r<t.length;r++)t[r].lastAccess<t[n].lastAccess&&(n=r);t.splice(n,1)}}readAll(){if(!this.storage)return[];try{const t=this.storage.getItem(this.storageKey);if(!t)return[];const n=JSON.parse(t);return Array.isArray(n)?n:[]}catch{return[]}}writeAll(t){if(this.storage)try{this.storage.setItem(this.storageKey,JSON.stringify(t))}catch(n){if(tl(n)&&t.length>0){const r=[...t].sort((a,i)=>a.lastAccess-i.lastAccess);r.splice(0,Math.ceil(r.length/2));try{this.storage.setItem(this.storageKey,JSON.stringify(r))}catch{}}}}}function $a(e,t){return t.split(".").reduce((n,r)=>{if(n&&typeof n=="object"&&r in n)return n[r]},e)}function tl(e){return e instanceof Error&&(e.name==="QuotaExceededError"||e.name==="NS_ERROR_DOM_QUOTA_REACHED")}function nl(){try{if(typeof localStorage<"u"){const e="__reqcache_probe__";return localStorage.setItem(e,"1"),localStorage.removeItem(e),localStorage}}catch{}return null}new Xa;const ei=300,rl=3600,pr=new Map;function _r(){try{return typeof window<"u"&&typeof localStorage<"u"}catch{return!1}}const al={getItem(e){return _r()?localStorage.getItem(e):pr.get(e)??null},setItem(e,t){if(_r())try{localStorage.setItem(e,t)}catch{console.warn("[api] Cota do localStorage excedida, ignorando escrita")}else pr.set(e,t)},removeItem(e){_r()?localStorage.removeItem(e):pr.delete(e)}};let gr=null;function il(){if(!gr){const{storageKey:e,maxEntries:t}=on().cache;gr=new Xa({storage:al,storageKey:e,maxEntries:t})}return gr}async function ti(e,t,n=ei,r){const[a]=Or(),i=e.replace(/^\/+/,""),s=new URL(i,`${a.replace(/\/+$/,"")}/`);let l;try{l=await il().getFetch(s.toString(),n*1e3,{monotonicKey:r,fetcher:gi})}catch(o){throw o instanceof Error&&/^HTTP 404 /.test(o.message)?new Error("Dados ainda não publicados"):o}if(l&&typeof l=="object"&&l.published===!1)throw new Error(l.reason??"Dados ainda não publicados");return l}function sl(e){return ti(`v1/reference/municipalities/${e.toUpperCase()}.json`,void 0,rl)}function ni(e,t){const n=t?.round??1,r=t?.office??"president";let a="br";return t?.municipalityId?a=`mun/${t.municipalityId}`:t?.state&&(a=`uf/${t.state.toUpperCase()}`),ti(`v1/elections/${e}/r${n}/${r}/${a}/results.json`,void 0,ei,"summary.ballots_counted")}const ol=new Set(["da","de","do","das","dos","e"]);function ll(e){return e.toLowerCase().split(" ").map((t,n)=>n>0&&ol.has(t)?t:t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function cl(e){if(typeof e=="string"){const n=e.match(/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2}))?/);if(n)return new Date(Date.UTC(Number(n[1]),Number(n[2])-1,Number(n[3]),Number(n[4]),Number(n[5]),Number(n[6]??0)))}const t=new Date(e);return Number.isNaN(t.getTime())?null:t}function mr(e){if(e==null||e==="")return"";const t=cl(e);if(!t)return"";const n=String(t.getUTCDate()).padStart(2,"0"),r=String(t.getUTCMonth()+1).padStart(2,"0"),a=t.getUTCFullYear(),i=String(t.getUTCHours()).padStart(2,"0"),s=String(t.getUTCMinutes()).padStart(2,"0");return`${n}/${r}/${a} às ${i}h${s}`}function ul(e,t="TSE"){const n=mr(e);return n?`Atualizado em ${n} | Fonte ${t}`:`Fonte ${t}`}const fl=mr("2022-10-31T00:18:00Z");ul("2022-10-31T00:18:00Z");var dl=T('<p class="sevn_candidate_performance__status svelte-xuxslg"> </p>'),vl=T('<p class="sevn_candidate_performance__status sevn_candidate_performance__status--error svelte-xuxslg"> </p>'),hl=T('<p class="sevn_candidate_performance__status svelte-xuxslg">Resultado ainda não publicado para este recorte.</p>'),pl=T('<div class="sevn_candidate_performance__content svelte-xuxslg"><div class="sevn_candidate_performance__chart svelte-xuxslg"><!></div> <div class="sevn_candidate_performance__ranking svelte-xuxslg"><!></div></div>'),_l=T('<div><!> <div class="sevn_candidate_performance__office-web svelte-xuxslg"><!></div> <div class="sevn_candidate_performance__office-mobile svelte-xuxslg"><!></div> <div class="sevn_candidate_performance__filters svelte-xuxslg"><div class="sevn_candidate_performance__uf svelte-xuxslg"><!></div> <div class="sevn_candidate_performance__municipality svelte-xuxslg"><!></div> <div class="sevn_candidate_performance__filter svelte-xuxslg"><!></div></div> <!></div>');const gl={hash:"svelte-xuxslg",code:`.sevn_candidate_performance.svelte-xuxslg {display:flex;flex-direction:column;gap:24px;}.sevn_candidate_performance--raw.svelte-xuxslg,
88
+ .sevn_candidate_performance--raw.svelte-xuxslg :where(.svelte-xuxslg) {all:revert;}.sevn_candidate_performance__status.svelte-xuxslg {font-size:0.875rem;color:var(--sevn-color-text-secondary, #6b7280);}.sevn_candidate_performance__status--error.svelte-xuxslg {color:#e11d48;}
89
+
90
+ /* Filters row */.sevn_candidate_performance__filters.svelte-xuxslg {display:flex;gap:16px;align-items:flex-start;}.sevn_candidate_performance__uf.svelte-xuxslg,
91
+ .sevn_candidate_performance__municipality.svelte-xuxslg {flex:1;min-width:0;}.sevn_candidate_performance__filter.svelte-xuxslg {width:200px;flex-shrink:0;}.sevn_candidate_performance__office-web.svelte-xuxslg {display:none;}.sevn_candidate_performance__office-mobile.svelte-xuxslg {display:block;width:220px;}
92
+
93
+ @media (min-width: 769px) {.sevn_candidate_performance__office-web.svelte-xuxslg {display:block;}.sevn_candidate_performance__office-mobile.svelte-xuxslg {display:none;}
94
+ }
95
+
96
+ /* Content: chart + ranking side by side on web */.sevn_candidate_performance__content.svelte-xuxslg {display:flex;gap:40px;align-items:center;}.sevn_candidate_performance__chart.svelte-xuxslg {flex-shrink:0;}.sevn_candidate_performance__ranking.svelte-xuxslg {flex:1;min-width:0;}.sevn_candidate_performance.svelte-xuxslg .vote-overview {gap:8px;padding:0.5rem 0;align-items:flex-end;}
97
+
98
+ /* Mobile */
99
+ @media (max-width: 768px) {.sevn_candidate_performance__filters.svelte-xuxslg {flex-direction:column;gap:12px;}.sevn_candidate_performance__office-mobile.svelte-xuxslg,
100
+ .sevn_candidate_performance__uf.svelte-xuxslg,
101
+ .sevn_candidate_performance__municipality.svelte-xuxslg,
102
+ .sevn_candidate_performance__filter.svelte-xuxslg {width:100%;}.sevn_candidate_performance__uf.svelte-xuxslg .dropdown,
103
+ .sevn_candidate_performance__municipality.svelte-xuxslg .dropdown,
104
+ .sevn_candidate_performance__filter.svelte-xuxslg .dropdown {position:static;margin-top:10px;}.sevn_candidate_performance__content.svelte-xuxslg {flex-direction:column;align-items:stretch;gap:24px;}.sevn_candidate_performance__chart.svelte-xuxslg {display:flex;justify-content:center;}.sevn_candidate_performance.svelte-xuxslg .vote-overview {padding:3px;font-size:0.7rem;gap:8px;}.sevn_candidate_performance.svelte-xuxslg .vote-overview .vote-overview-stats {gap:8px;}
105
+ }`};function ml(e,t){Kt(t,!0),gt(e,gl);let n=E(t,"mock",3,!1),r=E(t,"rawStyle",3,!1),a=E(t,"year",3,2026),i=E(t,"defaultOffice",3,"president"),s=E(t,"header",19,()=>({title:"Consulte o desempenho dos candidatos por município",description:"Resultados presidenciais por município, em tempo real"}));const l=[{value:"presidente",label:"Presidente"},{value:"governador",label:"Governador"}],o={presidente:"president",governador:"governor"},f={president:"presidente",governor:"governador"};let u=Z(rt(Zt(()=>f[i()]??"presidente")));const _=[{value:"ac",label:"Acre AC"},{value:"al",label:"Alagoas AL"},{value:"ap",label:"Amapá AP"},{value:"am",label:"Amazonas AM"},{value:"ba",label:"Bahia BA"},{value:"ce",label:"Ceará CE"},{value:"df",label:"Distrito Federal DF"},{value:"es",label:"Espírito Santo ES"},{value:"go",label:"Goiás GO"},{value:"ma",label:"Maranhão MA"},{value:"mt",label:"Mato Grosso MT"},{value:"ms",label:"Mato Grosso do Sul MS"},{value:"mg",label:"Minas Gerais MG"},{value:"pa",label:"Pará PA"},{value:"pb",label:"Paraíba PB"},{value:"pr",label:"Paraná PR"},{value:"pe",label:"Pernambuco PE"},{value:"pi",label:"Piauí PI"},{value:"rj",label:"Rio de Janeiro RJ"},{value:"rn",label:"Rio Grande do Norte RN"},{value:"rs",label:"Rio Grande do Sul RS"},{value:"ro",label:"Rondônia RO"},{value:"rr",label:"Roraima RR"},{value:"sc",label:"Santa Catarina SC"},{value:"sp",label:"São Paulo SP"},{value:"se",label:"Sergipe SE"},{value:"to",label:"Tocantins TO"}],d=[{value:"1turno",label:"1º Turno"},{value:"2turno",label:"2º Turno"}],p=[{value:"3507001",label:"Boituva"},{value:"3509502",label:"Campinas"},{value:"3518800",label:"Guarulhos"},{value:"3543402",label:"Ribeirão Preto"},{value:"3548500",label:"Santos"},{value:"3549805",label:"São João da Boa Vista"},{value:"3550308",label:"São Paulo"},{value:"3552205",label:"Sorocaba"}];let g=Z(""),x=Z(null),h=Z(""),z=Z(null),m=Z(!1),S=Z(null),F=Z(!1),W=Z(null);Ct(()=>{!Qe||!c(g)||(y(x,null),!n()&&(y(z,null),y(m,!0),sl(c(g)).then(w=>{y(z,w,!0),y(m,!1)}).catch(w=>{console.error("Failed to fetch municipalities:",w),y(m,!1)})))});const se=te(()=>!n()&&c(z)?.municipalities?c(z).municipalities.map(w=>({value:String(w.municipality_id),label:w.name})):n()?p:[]),Y=te(()=>c(se).find(w=>w.value===c(x))?.label??null),$=te(()=>c(g)?c(m)?"Carregando municípios...":c(x)?"Você selecionou:":"Busque pelo município (opcional)":"Selecione a UF primeiro");let C=Z(null);Ct(()=>{if(!Qe||n()||!c(g)||!c(u))return;const w=`${c(g)}|${c(u)}|${c(x)??""}`;if(c(C)===w)return;const J=o[c(u)]||"president",ee=c(x)?Number(c(x)):void 0;let B=!1;return ni(a(),{office:J,round:2,state:c(g),municipalityId:ee}).then(he=>{if(B)return;const Ye=!!he?.candidates?.some(Cn=>Cn.votes>0);y(h,Ye?"2turno":"1turno",!0),y(C,w)}).catch(()=>{B||(y(h,"1turno"),y(C,w))}),()=>{B=!0}}),Ct(()=>{if(!Qe||n())return;if(!c(g)||!c(h)||!c(u)){y(S,null);return}const w=c(h)==="2turno"?2:1,J=o[c(u)]||"president";y(F,!0),y(W,null),y(S,null),ni(a(),{office:J,round:w,state:c(g),municipalityId:c(x)?Number(c(x)):void 0}).then(ee=>{y(S,ee,!0),y(F,!1)}).catch(ee=>{console.error("Failed to fetch municipality results:",ee),y(W,ee instanceof Error?ee.message:"Não foi possível carregar os resultados.",!0),y(F,!1)})});const j=[{name:"Candidato A",tag:"ABC",dotColor:"var(--sevn-color-primary)",tagColor:"var(--sevn-color-primary)",votes:"42,8%"},{name:"Candidato B",tag:"EFG",dotColor:"#16a34a",tagColor:"#16a34a",votes:"31,4%"},{name:"Candidato C",tag:"HIJ",dotColor:"#1e4d6b",tagColor:"#1e4d6b",votes:"12,6%"},{name:"Candidato D",tag:"KLM",dotColor:"#0f172a",tagColor:"#0f172a",votes:"6,7%"},{name:"Candidato E",tag:"MNO",dotColor:"#e11d48",tagColor:"#e11d48",votes:"4,1%"}],oe=[{label:"ABC",value:42.8,color:"var(--sevn-color-primary)"},{label:"EFG",value:31.4,color:"#16a34a"},{label:"HIJ",value:12.6,color:"#1e4d6b"},{label:"KLM",value:6.7,color:"#0f172a"},{label:"MNO",value:4.1,color:"#e11d48"}],D=te(()=>{if(n())return{candidates:j,segments:oe,totalVotes:"118.552.353"};if(!c(S)?.candidates||!Array.isArray(c(S).candidates))return{candidates:[],segments:[],totalVotes:null};const w=[...c(S).candidates].sort((B,he)=>he.valid_votes_pct-B.valid_votes_pct),J=w.map(B=>({name:ll(B.ballot_name),tag:B.party_abbr,dotColor:B.party_color||"var(--sevn-color-primary)",tagColor:B.party_color||"var(--sevn-color-primary)",votes:`${B.valid_votes_pct.toFixed(1).replace(".",",")}%`})),ee=w.map(B=>({label:B.party_abbr,value:B.valid_votes_pct,color:B.party_color||"var(--sevn-color-primary)"}));return{candidates:J,segments:ee,totalVotes:c(S).summary?.total_valid_votes.toLocaleString("pt-BR")??null}}),M=te(()=>c(D).candidates),q=te(()=>c(D).segments),ae=te(()=>c(D).totalVotes),_e=te(()=>n()?fl:mr(c(S)?.summary?.last_updated));let be=Z(rt(Qe?window.innerWidth<=480:!1));Ct(()=>{if(!Qe)return;const w=window.matchMedia("(max-width: 480px)");y(be,w.matches,!0);const J=ee=>{y(be,ee.matches,!0)};return w.addEventListener("change",J),()=>w.removeEventListener("change",J)});var ie=_l();let Re;var ut=b(ie);el(ut,{get title(){return s().title},get description(){return s().description},get tag(){return s().tag},get tagColor(){return s().tagColor}});var wt=P(ut,2),Ft=b(wt);Yo(Ft,{label:"Cargo",get options(){return l},get value(){return c(u)},set value(w){y(u,w,!0)}});var an=P(wt,2),Sn=b(an);Fn(Sn,{label:"Cargo:",showLabel:!1,showLabelInField:!0,labelAsPlaceholder:!0,showPlaceholderOnMobile:!0,get options(){return l},get value(){return c(u)},set value(w){y(u,w,!0)}});var pe=P(an,2),bt=b(pe),xr=b(bt);{let w=te(()=>c(g)?"Você selecionou:":"Busque por UF");Fn(xr,{get label(){return c(w)},get icon(){return wn},iconSize:13,get options(){return _},get value(){return c(g)},set value(J){y(g,J,!0)}})}var En=P(bt,2),yr=b(En);{let w=te(()=>!c(g)||c(m));Fn(yr,{get label(){return c($)},get icon(){return wn},iconSize:13,get options(){return c(se)},get disabled(){return c(w)},get value(){return c(x)},set value(J){y(x,J,!0)}})}var zr=P(En,2),kr=b(zr);Fn(kr,{label:"Filtrar por",get icon(){return wn},iconSize:13,get options(){return d},get value(){return c(h)},set value(w){y(h,w,!0)}});var k=P(pe,2);{var L=w=>{var J=Ba(),ee=ga(J);{var B=Pe=>{var Je=dl(),sn=b(Je);N(()=>Q(sn,`Carregando resultados${c(Y)?` de ${c(Y)}`:""}...`)),A(Pe,Je)},he=Pe=>{var Je=vl(),sn=b(Je);N(()=>Q(sn,c(W))),A(Pe,Je)},Ye=Pe=>{var Je=hl();A(Pe,Je)},Cn=Pe=>{var Je=pl(),sn=b(Je),wl=b(sn);{let yl=te(()=>d.find(kl=>kl.value===c(h))?.label??""),zl=te(()=>c(be)?"250px":"388px");qo(wl,{get segments(){return c(q)},get centerLabel(){return c(yl)},get size(){return c(zl)},centerLabelSize:15,centerSubSize:10,radius:85,thickness:18,gap:1})}var bl=P(sn,2),xl=b(bl);Ro(xl,{get candidates(){return c(M)},get totalVotes(){return c(ae)},get date(){return c(_e)},font:"TSE"}),A(Pe,Je)};K(ee,Pe=>{c(F)?Pe(B):c(W)?Pe(he,1):!n()&&c(M).length===0?Pe(Ye,2):Pe(Cn,!1)})}A(w,J)};K(k,w=>{c(g)&&c(h)&&c(u)&&w(L)})}N(()=>Re=Le(ie,1,"sevn_candidate_performance svelte-xuxslg",null,Re,{"sevn_candidate_performance--raw":r()})),A(e,ie),Gt()}const ri=Qs(ml,"CandidatePerformanceByMunicipality");return typeof window<"u"&&(window.SevnElections=Object.assign(window.SevnElections||{},{Core:wi,CandidatePerformanceByMunicipality:ri}),$s()),ri}));
@@ -0,0 +1,59 @@
1
+ (function(R,I){typeof exports=="object"&&typeof module<"u"?module.exports=I():typeof define=="function"&&define.amd?define(I):(R=typeof globalThis<"u"?globalThis:R||self,R.CandidateRanking=I())})(this,(function(){"use strict";var bo=Object.defineProperty;var Ea=R=>{throw TypeError(R)};var xo=(R,I,B)=>I in R?bo(R,I,{enumerable:!0,configurable:!0,writable:!0,value:B}):R[I]=B;var Ne=(R,I,B)=>xo(R,typeof I!="symbol"?I+"":I,B),$n=(R,I,B)=>I.has(R)||Ea("Cannot "+B);var f=(R,I,B)=>($n(R,I,"read from private field"),B?B.call(R):I.get(R)),k=(R,I,B)=>I.has(R)?Ea("Cannot add the same private member more than once"):I instanceof WeakSet?I.add(R):I.set(R,B),b=(R,I,B,bt)=>($n(R,I,"write to private field"),bt?bt.call(R,B):I.set(R,B),B),J=(R,I,B)=>($n(R,I,"access private method"),B);var It,Nt,ht,Pt,Qt,$t,pt,Fe,Lt,fe,er,tr,nr,Ca,Ce,Yn,He,gt,Te,qe,ue,je,Ue,_t,$e,Ot,Dt,Ft,Ve,gn,G,So,Eo,rr,mn,wn,ar,ke,Me,de,mt,en,tn,_n,Sa;class R extends Error{constructor(){super('Chave de acesso não configurada. Chame Core.applyKey("sua-chave") antes de montar o componente, ou carregue o script com ?cid=sua-chave.'),this.name="SevnKeyMissingError"}}class I extends Error{constructor(t,n){super(`Não foi possível contatar a API para ${t}.`),this.name="SevnNetworkError",this.cause=n}}const B="__sevnElectionsState_v1__",bt=globalThis;function ir(e){return bt[B]||(bt[B]={config:e(),transport:{activeIndex:0,pinnedAt:0}}),bt[B]}const ka="https://failover-api.sevntech.com",Aa=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function sr(){return{key:null,apiHosts:[],assetsBase:"https://cdn.sevnelections.com/static",assetsVersion:"v1",cache:{storageKey:"election_cache",maxEntries:200},request:{timeoutMs:8e3,retriesPerHost:3,retryDelayMs:300,stickyWindowMs:12e4},theme:null}}const za=sr;function xt(){return ir(sr)}function Ta(e){return[`https://${e}-api1.sevnelections.com`,`https://${e}-api2.sevnelections.com`,ka]}function yn(e){if(typeof e!="string"||!Aa.test(e))throw new Error(`[sevn] Chave inválida: ${JSON.stringify(e)}. Use apenas letras, números e hífen (a chave vira subdomínio da API).`);const t=xt();t.config.key=e,t.config.apiHosts=Ta(e)}function or(e){const{cache:t,request:n,key:r,...a}=e,i=xt();i.config={...i.config,...a,cache:{...i.config.cache,...t},request:{...i.config.request,...n}},r&&(yn(r),a.apiHosts&&(i.config.apiHosts=a.apiHosts))}function Ut(){return xt().config}function lr(){return xt().config.apiHosts.length>0}function cr(){if(!lr())throw new R;return xt().config.apiHosts}function qa(e){const{assetsBase:t,assetsVersion:n}=xt().config,r=t.replace(/\/+$/,""),a=String(e).replace(/^\/+/,"");return`${r}/${n}/${a}`}const ja=':root{--sevn-color-primary: #0a3e27;--sevn-color-secondary: #c38214;--sevn-color-tertiary: #1c1c1c;--sevn-color-red: #da0000;--sevn-color-yellow: #e4a615;--sevn-color-green: #1e6704;--sevn-color-blue: #0e2a41;--sevn-color-neutral: #f2f2f7;--sevn-color-text-secondary: #6b7280}[class^=sevn_],[class*=" sevn_"],[class^=sevn_] *,[class^=sevn_] *:before,[class^=sevn_] *:after,[class*=" sevn_"] *,[class*=" sevn_"] *:before,[class*=" sevn_"] *:after{box-sizing:border-box}[class^=sevn_] *,[class*=" sevn_"] *{margin:0;padding:0}',et=typeof window<"u"&&typeof document<"u",fr="data-sevn-tokens",ur="data-sevn-theme",dr={primary:"--sevn-color-primary",secondary:"--sevn-color-secondary",tertiary:"--sevn-color-tertiary",neutral:"--sevn-color-neutral",red:"--sevn-color-red",green:"--sevn-color-green",blue:"--sevn-color-blue",yellow:"--sevn-color-yellow",textSecondary:"--sevn-color-text-secondary"};function Ma(){if(!et||document.querySelector(`style[${fr}]`))return;const e=document.createElement("style");e.setAttribute(fr,""),e.textContent=ja,document.head.prepend(e);const t=Ut().theme;t&&bn(t)}function bn(e){if(!et)return;const t=Object.keys(dr).filter(r=>e[r]).map(r=>` ${dr[r]}: ${e[r]};`);if(t.length===0)return;let n=document.querySelector(`style[${ur}]`);n||(n=document.createElement("style"),n.setAttribute(ur,""),document.head.appendChild(n)),n.textContent=`:root {
2
+ ${t.join(`
3
+ `)}
4
+ }`}function vr(){return ir(za).transport}function hr(e){return new Promise(t=>setTimeout(t,e))}function Ra(e,t){const n=AbortSignal.timeout(e);return t&&typeof AbortSignal.any=="function"?AbortSignal.any([t,n]):n}function Ia(e,t){const n=new URL(e),r=new URL(t);return n.protocol=r.protocol,n.host=r.host,n.toString()}function Na(e,t){return Array.from({length:t},(n,r)=>(e+r)%t)}const Pa=async(e,t)=>{const n=typeof e=="string"?e:e instanceof URL?e.toString():e.url,r=cr(),{timeoutMs:a,retriesPerHost:i,retryDelayMs:s,stickyWindowMs:o}=Ut().request,l=vr();l.activeIndex!==0&&Date.now()-l.pinnedAt>=o&&(l.activeIndex=0);let c=null;for(const h of Na(l.activeIndex,r.length)){const p=Ia(n,r[h]);for(let u=0;u<i;u++)try{const g=await fetch(p,{...t,signal:Ra(a,t?.signal)});if(g.status>=500){c=new Error(`HTTP ${g.status} em ${r[h]}`),u<i-1&&await hr(s);continue}return l.activeIndex=h,l.pinnedAt=Date.now(),g}catch(g){c=g,u<i-1&&await hr(s)}}throw new I(n,c)};function La(){return Ut().apiHosts[vr().activeIndex]??null}const Oa={applyKey:yn,configure(e){or(e),e.theme&&bn(e.theme)},getConfig:Ut,isReady:lr,assetUrl:qa,setTheme(e){or({theme:e}),bn(e)},activeHost:La},xn=!1;var pr=Array.isArray,Da=Array.prototype.indexOf,St=Array.prototype.includes,on=Array.from,Fa=Object.defineProperty,Et=Object.getOwnPropertyDescriptor,Ha=Object.getOwnPropertyDescriptors,Ua=Object.prototype,Va=Array.prototype,gr=Object.getPrototypeOf,_r=Object.isExtensible;const Ka=()=>{};function Ba(e){for(var t=0;t<e.length;t++)e[t]()}function mr(){var e,t,n=new Promise((r,a)=>{e=r,t=a});return{promise:n,resolve:e,reject:t}}const Q=2,Vt=4,ln=8,wr=1<<24,Pe=16,we=32,tt=64,Sn=128,ve=512,Z=1024,$=2048,ye=4096,le=8192,Le=16384,nt=32768,Ct=65536,yr=1<<17,br=1<<18,kt=1<<19,Wa=1<<20,We=1<<25,rt=65536,En=1<<21,Cn=1<<22,Ye=1<<23,cn=Symbol("$state"),Ya=Symbol("legacy props"),Xa=Symbol(""),at=new class extends Error{constructor(){super(...arguments);Ne(this,"name","StaleReactionError");Ne(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Za(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Ga(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Ja(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Qa(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function $a(e){throw new Error("https://svelte.dev/e/effect_orphan")}function ei(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function ti(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function ni(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function ri(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function ai(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function ii(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const si=1,oi=2,li=16,ci=1,fi=4,ui=8,di=16,vi=1,hi=2,ee=Symbol(),xr="http://www.w3.org/1999/xhtml";function pi(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Sr(e){return e===this.v}function gi(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Er(e){return!gi(e,this.v)}let _i=!1,he=null;function At(e){he=e}function kn(e,t=!1,n){he={p:he,i:!1,c:null,e:null,s:e,x:null,l:null}}function An(e){var t=he,n=t.e;if(n!==null){t.e=null;for(var r of n)Wr(r)}return t.i=!0,he=t.p,{}}function Cr(){return!0}let zt=[];function mi(){var e=zt;zt=[],Ba(e)}function it(e){if(zt.length===0){var t=zt;queueMicrotask(()=>{t===zt&&mi()})}zt.push(e)}function kr(e){var t=M;if(t===null)return E.f|=Ye,e;if((t.f&nt)===0&&(t.f&Vt)===0)throw e;Tt(e,t)}function Tt(e,t){for(;t!==null;){if((t.f&Sn)!==0){if((t.f&nt)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const wi=-7169;function W(e,t){e.f=e.f&wi|t}function zn(e){(e.f&ve)!==0||e.deps===null?W(e,Z):W(e,ye)}function Ar(e){if(e!==null)for(const t of e)(t.f&Q)===0||(t.f&rt)===0||(t.f^=rt,Ar(t.deps))}function zr(e,t,n){(e.f&$)!==0?t.add(e):(e.f&ye)!==0&&n.add(e),Ar(e.deps),W(e,Z)}const fn=new Set;let L=null,be=null,pe=[],Tn=null,qn=!1;const Wn=class Wn{constructor(){k(this,fe);Ne(this,"committed",!1);Ne(this,"current",new Map);Ne(this,"previous",new Map);k(this,It,new Set);k(this,Nt,new Set);k(this,ht,0);k(this,Pt,0);k(this,Qt,null);k(this,$t,new Set);k(this,pt,new Set);k(this,Fe,new Map);Ne(this,"is_fork",!1);k(this,Lt,!1)}skip_effect(t){f(this,Fe).has(t)||f(this,Fe).set(t,{d:[],m:[]})}unskip_effect(t){var n=f(this,Fe).get(t);if(n){f(this,Fe).delete(t);for(var r of n.d)W(r,$),xe(r);for(r of n.m)W(r,ye),xe(r)}}process(t){pe=[],this.apply();var n=[],r=[];for(const a of t)J(this,fe,tr).call(this,a,n,r);if(J(this,fe,er).call(this)){J(this,fe,nr).call(this,r),J(this,fe,nr).call(this,n);for(const[a,i]of f(this,Fe))Mr(a,i)}else{for(const a of f(this,It))a();f(this,It).clear(),f(this,ht)===0&&J(this,fe,Ca).call(this),L=null,Tr(r),Tr(n),f(this,Qt)?.resolve()}be=null}capture(t,n){n!==ee&&!this.previous.has(t)&&this.previous.set(t,n),(t.f&Ye)===0&&(this.current.set(t,t.v),be?.set(t,t.v))}activate(){L=this,this.apply()}deactivate(){L===this&&(L=null,be=null)}flush(){if(this.activate(),pe.length>0){if(yi(),L!==null&&L!==this)return}else f(this,ht)===0&&this.process([]);this.deactivate()}discard(){for(const t of f(this,Nt))t(this);f(this,Nt).clear()}increment(t){b(this,ht,f(this,ht)+1),t&&b(this,Pt,f(this,Pt)+1)}decrement(t){b(this,ht,f(this,ht)-1),t&&b(this,Pt,f(this,Pt)-1),!f(this,Lt)&&(b(this,Lt,!0),it(()=>{b(this,Lt,!1),J(this,fe,er).call(this)?pe.length>0&&this.flush():this.revive()}))}revive(){for(const t of f(this,$t))f(this,pt).delete(t),W(t,$),xe(t);for(const t of f(this,pt))W(t,ye),xe(t);this.flush()}oncommit(t){f(this,It).add(t)}ondiscard(t){f(this,Nt).add(t)}settled(){return(f(this,Qt)??b(this,Qt,mr())).promise}static ensure(){if(L===null){const t=L=new Wn;fn.add(L),it(()=>{L===t&&t.flush()})}return L}apply(){}};It=new WeakMap,Nt=new WeakMap,ht=new WeakMap,Pt=new WeakMap,Qt=new WeakMap,$t=new WeakMap,pt=new WeakMap,Fe=new WeakMap,Lt=new WeakMap,fe=new WeakSet,er=function(){return this.is_fork||f(this,Pt)>0},tr=function(t,n,r){t.f^=Z;for(var a=t.first;a!==null;){var i=a.f,s=(i&(we|tt))!==0,o=s&&(i&Z)!==0,l=o||(i&le)!==0||f(this,Fe).has(a);if(!l&&a.fn!==null){s?a.f^=Z:(i&Vt)!==0?n.push(a):Wt(a)&&((i&Pe)!==0&&f(this,pt).add(a),jt(a));var c=a.first;if(c!==null){a=c;continue}}for(;a!==null;){var h=a.next;if(h!==null){a=h;break}a=a.parent}}},nr=function(t){for(var n=0;n<t.length;n+=1)zr(t[n],f(this,$t),f(this,pt))},Ca=function(){var a;if(fn.size>1){this.previous.clear();var t=be,n=!0;for(const i of fn){if(i===this){n=!1;continue}const s=[];for(const[l,c]of this.current){if(i.current.has(l))if(n&&c!==i.current.get(l))i.current.set(l,c);else continue;s.push(l)}if(s.length===0)continue;const o=[...i.current.keys()].filter(l=>!this.current.has(l));if(o.length>0){var r=pe;pe=[];const l=new Set,c=new Map;for(const h of s)qr(h,o,l,c);if(pe.length>0){L=i,i.apply();for(const h of pe)J(a=i,fe,tr).call(a,h,[],[]);i.deactivate()}pe=r}}L=null,be=t}this.committed=!0,fn.delete(this)};let Xe=Wn;function yi(){qn=!0;var e=null;try{for(var t=0;pe.length>0;){var n=Xe.ensure();if(t++>1e3){var r,a;bi()}n.process(pe),Ze.clear()}}finally{pe=[],qn=!1,Tn=null}}function bi(){try{ei()}catch(e){Tt(e,Tn)}}let Oe=null;function Tr(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&(Le|le))===0&&Wt(r)&&(Oe=new Set,jt(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Xr(r),Oe?.size>0)){Ze.clear();for(const a of Oe){if((a.f&(Le|le))!==0)continue;const i=[a];let s=a.parent;for(;s!==null;)Oe.has(s)&&(Oe.delete(s),i.push(s)),s=s.parent;for(let o=i.length-1;o>=0;o--){const l=i[o];(l.f&(Le|le))===0&&jt(l)}}Oe.clear()}}Oe=null}}function qr(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const a of e.reactions){const i=a.f;(i&Q)!==0?qr(a,t,n,r):(i&(Cn|Pe))!==0&&(i&$)===0&&jr(a,t,r)&&(W(a,$),xe(a))}}function jr(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const a of e.deps){if(St.call(t,a))return!0;if((a.f&Q)!==0&&jr(a,t,n))return n.set(a,!0),!0}return n.set(e,!1),!1}function xe(e){var t=Tn=e,n=t.b;if(n?.is_pending&&(e.f&(Vt|ln|wr))!==0&&(e.f&nt)===0){n.defer_effect(e);return}for(;t.parent!==null;){t=t.parent;var r=t.f;if(qn&&t===M&&(r&Pe)!==0&&(r&br)===0&&(r&nt)!==0)return;if((r&(tt|we))!==0){if((r&Z)===0)return;t.f^=Z}}pe.push(t)}function Mr(e,t){if(!((e.f&we)!==0&&(e.f&Z)!==0)){(e.f&$)!==0?t.d.push(e):(e.f&ye)!==0&&t.m.push(e),W(e,Z);for(var n=e.first;n!==null;)Mr(n,t),n=n.next}}function xi(e){let t=0,n=st(0),r;return()=>{Nn()&&(v(n),Vi(()=>(t===0&&(r=oa(()=>e(()=>Kt(n)))),t+=1,()=>{it(()=>{t-=1,t===0&&(r?.(),r=void 0,Kt(n))})})))}}var Si=Ct|kt;function Ei(e,t,n){new Ci(e,t,n)}class Ci{constructor(t,n,r){k(this,G);Ne(this,"parent");Ne(this,"is_pending",!1);k(this,Ce);k(this,Yn,null);k(this,He);k(this,gt);k(this,Te);k(this,qe,null);k(this,ue,null);k(this,je,null);k(this,Ue,null);k(this,_t,0);k(this,$e,0);k(this,Ot,!1);k(this,Dt,new Set);k(this,Ft,new Set);k(this,Ve,null);k(this,gn,xi(()=>(b(this,Ve,st(f(this,_t))),()=>{b(this,Ve,null)})));b(this,Ce,t),b(this,He,n),b(this,gt,a=>{var i=M;i.b=this,i.f|=Sn,r(a)}),this.parent=M.b,b(this,Te,Pn(()=>{J(this,G,rr).call(this)},Si))}defer_effect(t){zr(t,f(this,Dt),f(this,Ft))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!f(this,He).pending}update_pending_count(t){J(this,G,ar).call(this,t),b(this,_t,f(this,_t)+t),!(!f(this,Ve)||f(this,Ot))&&(b(this,Ot,!0),it(()=>{b(this,Ot,!1),f(this,Ve)&&qt(f(this,Ve),f(this,_t))}))}get_effect_pending(){return f(this,gn).call(this),v(f(this,Ve))}error(t){var n=f(this,He).onerror;let r=f(this,He).failed;if(!n&&!r)throw t;f(this,qe)&&(se(f(this,qe)),b(this,qe,null)),f(this,ue)&&(se(f(this,ue)),b(this,ue,null)),f(this,je)&&(se(f(this,je)),b(this,je,null));var a=!1,i=!1;const s=()=>{if(a){pi();return}a=!0,i&&ii(),f(this,je)!==null&&ct(f(this,je),()=>{b(this,je,null)}),J(this,G,wn).call(this,()=>{Xe.ensure(),J(this,G,rr).call(this)})};it(()=>{try{i=!0,n?.(t,s),i=!1}catch(o){Tt(o,f(this,Te)&&f(this,Te).parent)}r&&b(this,je,J(this,G,wn).call(this,()=>{Xe.ensure();try{return Se(()=>{var o=M;o.b=this,o.f|=Sn,r(f(this,Ce),()=>t,()=>s)})}catch(o){return Tt(o,f(this,Te).parent),null}}))})}}Ce=new WeakMap,Yn=new WeakMap,He=new WeakMap,gt=new WeakMap,Te=new WeakMap,qe=new WeakMap,ue=new WeakMap,je=new WeakMap,Ue=new WeakMap,_t=new WeakMap,$e=new WeakMap,Ot=new WeakMap,Dt=new WeakMap,Ft=new WeakMap,Ve=new WeakMap,gn=new WeakMap,G=new WeakSet,So=function(){try{b(this,qe,Se(()=>f(this,gt).call(this,f(this,Ce))))}catch(t){this.error(t)}},Eo=function(){const t=f(this,He).pending;t&&(this.is_pending=!0,b(this,ue,Se(()=>t(f(this,Ce)))),it(()=>{var n=b(this,Ue,document.createDocumentFragment()),r=lt();n.append(r),b(this,qe,J(this,G,wn).call(this,()=>(Xe.ensure(),Se(()=>f(this,gt).call(this,r))))),f(this,$e)===0&&(f(this,Ce).before(n),b(this,Ue,null),ct(f(this,ue),()=>{b(this,ue,null)}),J(this,G,mn).call(this))}))},rr=function(){try{if(this.is_pending=this.has_pending_snippet(),b(this,$e,0),b(this,_t,0),b(this,qe,Se(()=>{f(this,gt).call(this,f(this,Ce))})),f(this,$e)>0){var t=b(this,Ue,document.createDocumentFragment());Jr(f(this,qe),t);const n=f(this,He).pending;b(this,ue,Se(()=>n(f(this,Ce))))}else J(this,G,mn).call(this)}catch(n){this.error(n)}},mn=function(){this.is_pending=!1;for(const t of f(this,Dt))W(t,$),xe(t);for(const t of f(this,Ft))W(t,ye),xe(t);f(this,Dt).clear(),f(this,Ft).clear()},wn=function(t){var n=M,r=E,a=he;ze(f(this,Te)),ge(f(this,Te)),At(f(this,Te).ctx);try{return t()}catch(i){return kr(i),null}finally{ze(n),ge(r),At(a)}},ar=function(t){var n;if(!this.has_pending_snippet()){this.parent&&J(n=this.parent,G,ar).call(n,t);return}b(this,$e,f(this,$e)+t),f(this,$e)===0&&(J(this,G,mn).call(this),f(this,ue)&&ct(f(this,ue),()=>{b(this,ue,null)}),f(this,Ue)&&(f(this,Ce).before(f(this,Ue)),b(this,Ue,null)))};function ki(e,t,n,r){const a=un;var i=e.filter(u=>!u.settled);if(n.length===0&&i.length===0){r(t.map(a));return}var s=L,o=M,l=Ai(),c=i.length===1?i[0].promise:i.length>1?Promise.all(i.map(u=>u.promise)):null;function h(u){l();try{r(u)}catch(g){(o.f&Le)===0&&Tt(g,o)}s?.deactivate(),jn()}if(n.length===0){c.then(()=>h(t.map(a)));return}function p(){l(),Promise.all(n.map(u=>Ti(u))).then(u=>h([...t.map(a),...u])).catch(u=>Tt(u,o))}c?c.then(p):p()}function Ai(){var e=M,t=E,n=he,r=L;return function(i=!0){ze(e),ge(t),At(n),i&&r?.activate()}}function jn(){ze(null),ge(null),At(null)}function zi(){var e=M.b,t=L,n=e.is_rendered();return e.update_pending_count(1),t.increment(n),()=>{e.update_pending_count(-1),t.decrement(n)}}function un(e){var t=Q|$,n=E!==null&&(E.f&Q)!==0?E:null;return M!==null&&(M.f|=kt),{ctx:he,deps:null,effects:null,equals:Sr,f:t,fn:e,reactions:null,rv:0,v:ee,wv:0,parent:n??M,ac:null}}function Ti(e,t,n){M===null&&Za();var a=void 0,i=st(ee),s=!E,o=new Map;return Ui(()=>{var l=mr();a=l.promise;try{Promise.resolve(e()).then(l.resolve,l.reject).then(()=>{c===L&&c.committed&&c.deactivate(),jn()})}catch(u){l.reject(u),jn()}var c=L;if(s){var h=zi();o.get(c)?.reject(at),o.delete(c),o.set(c,l)}const p=(u,g=void 0)=>{if(c.activate(),g)g!==at&&(i.f|=Ye,qt(i,g));else{(i.f&Ye)!==0&&(i.f^=Ye),qt(i,u);for(const[d,w]of o){if(o.delete(d),d===c)break;w.reject(at)}}h&&h()};l.promise.then(p,u=>p(null,u||"unknown"))}),Kr(()=>{for(const l of o.values())l.reject(at)}),new Promise(l=>{function c(h){function p(){h===a?l(i):c(a)}h.then(p,p)}c(a)})}function O(e){const t=un(e);return $r(t),t}function Rr(e){const t=un(e);return t.equals=Er,t}function qi(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)se(t[n])}}function ji(e){for(var t=e.parent;t!==null;){if((t.f&Q)===0)return(t.f&Le)===0?t:null;t=t.parent}return null}function Mn(e){var t,n=M;ze(ji(e));try{e.f&=~rt,qi(e),t=aa(e)}finally{ze(n)}return t}function Ir(e){var t=Mn(e);if(!e.equals(t)&&(e.wv=na(),(!L?.is_fork||e.deps===null)&&(e.v=t,e.deps===null))){W(e,Z);return}Ge||(be!==null?(Nn()||L?.is_fork)&&be.set(e,t):zn(e))}function Mi(e){if(e.effects!==null)for(const t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(at),t.teardown=Ka,t.ac=null,Yt(t,0),Ln(t))}function Nr(e){if(e.effects!==null)for(const t of e.effects)t.teardown&&jt(t)}let Rn=new Set;const Ze=new Map;let Pr=!1;function st(e,t){var n={f:0,v:e,reactions:null,equals:Sr,rv:0,wv:0};return n}function te(e,t){const n=st(e);return $r(n),n}function Ri(e,t=!1,n=!0){const r=st(e);return t||(r.equals=Er),r}function U(e,t,n=!1){E!==null&&(!Ee||(E.f&yr)!==0)&&Cr()&&(E.f&(Q|Pe|Cn|yr))!==0&&(_e===null||!St.call(_e,e))&&ai();let r=n?ot(t):t;return qt(e,r)}function qt(e,t){if(!e.equals(t)){var n=e.v;Ge?Ze.set(e,t):Ze.set(e,n),e.v=t;var r=Xe.ensure();if(r.capture(e,n),(e.f&Q)!==0){const a=e;(e.f&$)!==0&&Mn(a),zn(a)}e.wv=na(),Lr(e,$),M!==null&&(M.f&Z)!==0&&(M.f&(we|tt))===0&&(me===null?Wi([e]):me.push(e)),!r.is_fork&&Rn.size>0&&!Pr&&Ii()}return t}function Ii(){Pr=!1;for(const e of Rn)(e.f&Z)!==0&&W(e,ye),Wt(e)&&jt(e);Rn.clear()}function Kt(e){U(e,e.v+1)}function Lr(e,t){var n=e.reactions;if(n!==null)for(var r=n.length,a=0;a<r;a++){var i=n[a],s=i.f,o=(s&$)===0;if(o&&W(i,t),(s&Q)!==0){var l=i;be?.delete(l),(s&rt)===0&&(s&ve&&(i.f|=rt),Lr(l,ye))}else o&&((s&Pe)!==0&&Oe!==null&&Oe.add(i),xe(i))}}function ot(e){if(typeof e!="object"||e===null||cn in e)return e;const t=gr(e);if(t!==Ua&&t!==Va)return e;var n=new Map,r=pr(e),a=te(0),i=ut,s=o=>{if(ut===i)return o();var l=E,c=ut;ge(null),ta(i);var h=o();return ge(l),ta(c),h};return r&&n.set("length",te(e.length)),new Proxy(e,{defineProperty(o,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&ni();var h=n.get(l);return h===void 0?s(()=>{var p=te(c.value);return n.set(l,p),p}):U(h,c.value,!0),!0},deleteProperty(o,l){var c=n.get(l);if(c===void 0){if(l in o){const h=s(()=>te(ee));n.set(l,h),Kt(a)}}else U(c,ee),Kt(a);return!0},get(o,l,c){if(l===cn)return e;var h=n.get(l),p=l in o;if(h===void 0&&(!p||Et(o,l)?.writable)&&(h=s(()=>{var g=ot(p?o[l]:ee),d=te(g);return d}),n.set(l,h)),h!==void 0){var u=v(h);return u===ee?void 0:u}return Reflect.get(o,l,c)},getOwnPropertyDescriptor(o,l){var c=Reflect.getOwnPropertyDescriptor(o,l);if(c&&"value"in c){var h=n.get(l);h&&(c.value=v(h))}else if(c===void 0){var p=n.get(l),u=p?.v;if(p!==void 0&&u!==ee)return{enumerable:!0,configurable:!0,value:u,writable:!0}}return c},has(o,l){if(l===cn)return!0;var c=n.get(l),h=c!==void 0&&c.v!==ee||Reflect.has(o,l);if(c!==void 0||M!==null&&(!h||Et(o,l)?.writable)){c===void 0&&(c=s(()=>{var u=h?ot(o[l]):ee,g=te(u);return g}),n.set(l,c));var p=v(c);if(p===ee)return!1}return h},set(o,l,c,h){var p=n.get(l),u=l in o;if(r&&l==="length")for(var g=c;g<p.v;g+=1){var d=n.get(g+"");d!==void 0?U(d,ee):g in o&&(d=s(()=>te(ee)),n.set(g+"",d))}if(p===void 0)(!u||Et(o,l)?.writable)&&(p=s(()=>te(void 0)),U(p,ot(c)),n.set(l,p));else{u=p.v!==ee;var w=s(()=>ot(c));U(p,w)}var _=Reflect.getOwnPropertyDescriptor(o,l);if(_?.set&&_.set.call(h,c),!u){if(r&&typeof l=="string"){var N=n.get("length"),m=Number(l);Number.isInteger(m)&&m>=N.v&&U(N,m+1)}Kt(a)}return!0},ownKeys(o){v(a);var l=Reflect.ownKeys(o).filter(p=>{var u=n.get(p);return u===void 0||u.v!==ee});for(var[c,h]of n)h.v!==ee&&!(c in o)&&l.push(c);return l},setPrototypeOf(){ri()}})}var Or,Dr,Fr,Hr;function Ni(){if(Or===void 0){Or=window,Dr=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Fr=Et(t,"firstChild").get,Hr=Et(t,"nextSibling").get,_r(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),_r(n)&&(n.__t=void 0)}}function lt(e=""){return document.createTextNode(e)}function dn(e){return Fr.call(e)}function Bt(e){return Hr.call(e)}function S(e,t){return dn(e)}function Pi(e,t=!1){{var n=dn(e);return n instanceof Comment&&n.data===""?Bt(n):n}}function Y(e,t=1,n=!1){let r=e;for(;t--;)r=Bt(r);return r}function Li(e){e.textContent=""}function Ur(){return!1}function Vr(e,t,n){return document.createElementNS(xr,e,void 0)}function In(e){var t=E,n=M;ge(null),ze(null);try{return e()}finally{ge(t),ze(n)}}function Oi(e){M===null&&(E===null&&$a(),Qa()),Ge&&Ja()}function Di(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function De(e,t,n){var r=M;r!==null&&(r.f&le)!==0&&(e|=le);var a={ctx:he,deps:null,nodes:null,f:e|$|ve,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{jt(a)}catch(o){throw se(a),o}else t!==null&&xe(a);var i=a;if(n&&i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&kt)===0&&(i=i.first,(e&Pe)!==0&&(e&Ct)!==0&&i!==null&&(i.f|=Ct)),i!==null&&(i.parent=r,r!==null&&Di(i,r),E!==null&&(E.f&Q)!==0&&(e&tt)===0)){var s=E;(s.effects??(s.effects=[])).push(i)}return a}function Nn(){return E!==null&&!Ee}function Kr(e){const t=De(ln,null,!1);return W(t,Z),t.teardown=e,t}function Br(e){Oi();var t=M.f,n=!E&&(t&we)!==0&&(t&nt)===0;if(n){var r=he;(r.e??(r.e=[])).push(e)}else return Wr(e)}function Wr(e){return De(Vt|Wa,e,!1)}function Fi(e){Xe.ensure();const t=De(tt|kt,e,!0);return(n={})=>new Promise(r=>{n.outro?ct(t,()=>{se(t),r(void 0)}):(se(t),r(void 0))})}function Hi(e){return De(Vt,e,!1)}function Ui(e){return De(Cn|kt,e,!0)}function Vi(e,t=0){return De(ln|t,e,!0)}function P(e,t=[],n=[],r=[]){ki(r,t,n,a=>{De(ln,()=>e(...a.map(v)),!0)})}function Pn(e,t=0){var n=De(Pe|t,e,!0);return n}function Se(e){return De(we|kt,e,!0)}function Yr(e){var t=e.teardown;if(t!==null){const n=Ge,r=E;Qr(!0),ge(null);try{t.call(null)}finally{Qr(n),ge(r)}}}function Ln(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const a=n.ac;a!==null&&In(()=>{a.abort(at)});var r=n.next;(n.f&tt)!==0?n.parent=null:se(n,t),n=r}}function Ki(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&we)===0&&se(t),t=n}}function se(e,t=!0){var n=!1;(t||(e.f&br)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(Bi(e.nodes.start,e.nodes.end),n=!0),Ln(e,t&&!n),Yt(e,0),W(e,Le);var r=e.nodes&&e.nodes.t;if(r!==null)for(const i of r)i.stop();Yr(e);var a=e.parent;a!==null&&a.first!==null&&Xr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function Bi(e,t){for(;e!==null;){var n=e===t?null:Bt(e);e.remove(),e=n}}function Xr(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function ct(e,t,n=!0){var r=[];Zr(e,r,!0);var a=()=>{n&&se(e),t&&t()},i=r.length;if(i>0){var s=()=>--i||a();for(var o of r)o.out(s)}else a()}function Zr(e,t,n){if((e.f&le)===0){e.f^=le;var r=e.nodes&&e.nodes.t;if(r!==null)for(const o of r)(o.is_global||n)&&t.push(o);for(var a=e.first;a!==null;){var i=a.next,s=(a.f&Ct)!==0||(a.f&we)!==0&&(e.f&Pe)!==0;Zr(a,t,s?n:!1),a=i}}}function On(e){Gr(e,!0)}function Gr(e,t){if((e.f&le)!==0){e.f^=le,(e.f&Z)===0&&(W(e,$),xe(e));for(var n=e.first;n!==null;){var r=n.next,a=(n.f&Ct)!==0||(n.f&we)!==0;Gr(n,a?t:!1),n=r}var i=e.nodes&&e.nodes.t;if(i!==null)for(const s of i)(s.is_global||t)&&s.in()}}function Jr(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var a=n===r?null:Bt(n);t.append(n),n=a}}let vn=!1,Ge=!1;function Qr(e){Ge=e}let E=null,Ee=!1;function ge(e){E=e}let M=null;function ze(e){M=e}let _e=null;function $r(e){E!==null&&(_e===null?_e=[e]:_e.push(e))}let oe=null,ce=0,me=null;function Wi(e){me=e}let ea=1,ft=0,ut=ft;function ta(e){ut=e}function na(){return++ea}function Wt(e){var t=e.f;if((t&$)!==0)return!0;if(t&Q&&(e.f&=~rt),(t&ye)!==0){for(var n=e.deps,r=n.length,a=0;a<r;a++){var i=n[a];if(Wt(i)&&Ir(i),i.wv>e.wv)return!0}(t&ve)!==0&&be===null&&W(e,Z)}return!1}function ra(e,t,n=!0){var r=e.reactions;if(r!==null&&!(_e!==null&&St.call(_e,e)))for(var a=0;a<r.length;a++){var i=r[a];(i.f&Q)!==0?ra(i,t,!1):t===i&&(n?W(i,$):(i.f&Z)!==0&&W(i,ye),xe(i))}}function aa(e){var w;var t=oe,n=ce,r=me,a=E,i=_e,s=he,o=Ee,l=ut,c=e.f;oe=null,ce=0,me=null,E=(c&(we|tt))===0?e:null,_e=null,At(e.ctx),Ee=!1,ut=++ft,e.ac!==null&&(In(()=>{e.ac.abort(at)}),e.ac=null);try{e.f|=En;var h=e.fn,p=h();e.f|=nt;var u=e.deps,g=L?.is_fork;if(oe!==null){var d;if(g||Yt(e,ce),u!==null&&ce>0)for(u.length=ce+oe.length,d=0;d<oe.length;d++)u[ce+d]=oe[d];else e.deps=u=oe;if(Nn()&&(e.f&ve)!==0)for(d=ce;d<u.length;d++)((w=u[d]).reactions??(w.reactions=[])).push(e)}else!g&&u!==null&&ce<u.length&&(Yt(e,ce),u.length=ce);if(Cr()&&me!==null&&!Ee&&u!==null&&(e.f&(Q|ye|$))===0)for(d=0;d<me.length;d++)ra(me[d],e);if(a!==null&&a!==e){if(ft++,a.deps!==null)for(let _=0;_<n;_+=1)a.deps[_].rv=ft;if(t!==null)for(const _ of t)_.rv=ft;me!==null&&(r===null?r=me:r.push(...me))}return(e.f&Ye)!==0&&(e.f^=Ye),p}catch(_){return kr(_)}finally{e.f^=En,oe=t,ce=n,me=r,E=a,_e=i,At(s),Ee=o,ut=l}}function Yi(e,t){let n=t.reactions;if(n!==null){var r=Da.call(n,e);if(r!==-1){var a=n.length-1;a===0?n=t.reactions=null:(n[r]=n[a],n.pop())}}if(n===null&&(t.f&Q)!==0&&(oe===null||!St.call(oe,t))){var i=t;(i.f&ve)!==0&&(i.f^=ve,i.f&=~rt),zn(i),Mi(i),Yt(i,0)}}function Yt(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Yi(e,n[r])}function jt(e){var t=e.f;if((t&Le)===0){W(e,Z);var n=M,r=vn;M=e,vn=!0;try{(t&(Pe|wr))!==0?Ki(e):Ln(e),Yr(e);var a=aa(e);e.teardown=typeof a=="function"?a:null,e.wv=ea;var i;xn&&_i&&(e.f&$)!==0&&e.deps}finally{vn=r,M=n}}}function v(e){var t=e.f,n=(t&Q)!==0;if(E!==null&&!Ee){var r=M!==null&&(M.f&Le)!==0;if(!r&&(_e===null||!St.call(_e,e))){var a=E.deps;if((E.f&En)!==0)e.rv<ft&&(e.rv=ft,oe===null&&a!==null&&a[ce]===e?ce++:oe===null?oe=[e]:oe.push(e));else{(E.deps??(E.deps=[])).push(e);var i=e.reactions;i===null?e.reactions=[E]:St.call(i,E)||i.push(E)}}}if(Ge&&Ze.has(e))return Ze.get(e);if(n){var s=e;if(Ge){var o=s.v;return((s.f&Z)===0&&s.reactions!==null||sa(s))&&(o=Mn(s)),Ze.set(s,o),o}var l=(s.f&ve)===0&&!Ee&&E!==null&&(vn||(E.f&ve)!==0),c=(s.f&nt)===0;Wt(s)&&(l&&(s.f|=ve),Ir(s)),l&&!c&&(Nr(s),ia(s))}if(be?.has(e))return be.get(e);if((e.f&Ye)!==0)throw e.v;return e.v}function ia(e){if(e.f|=ve,e.deps!==null)for(const t of e.deps)(t.reactions??(t.reactions=[])).push(e),(t.f&Q)!==0&&(t.f&ve)===0&&(Nr(t),ia(t))}function sa(e){if(e.v===ee)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(Ze.has(t)||(t.f&Q)!==0&&sa(t))return!0;return!1}function oa(e){var t=Ee;try{return Ee=!0,e()}finally{Ee=t}}const Xi=["touchstart","touchmove"];function Zi(e){return Xi.includes(e)}const dt=Symbol("events"),la=new Set,Dn=new Set;function Gi(e,t,n,r={}){function a(i){if(r.capture||Fn.call(t,i),!i.cancelBubble)return In(()=>n?.call(this,i))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?it(()=>{t.addEventListener(e,a,r)}):t.addEventListener(e,a,r),a}function Ji(e,t,n,r,a){var i={capture:r,passive:a},s=Gi(e,t,n,i);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Kr(()=>{t.removeEventListener(e,s,i)})}function Xt(e,t,n){(t[dt]??(t[dt]={}))[e]=n}function Qi(e){for(var t=0;t<e.length;t++)la.add(e[t]);for(var n of Dn)n(e)}let ca=null;function Fn(e){var t=this,n=t.ownerDocument,r=e.type,a=e.composedPath?.()||[],i=a[0]||e.target;ca=e;var s=0,o=ca===e&&e[dt];if(o){var l=a.indexOf(o);if(l!==-1&&(t===document||t===window)){e[dt]=t;return}var c=a.indexOf(t);if(c===-1)return;l<=c&&(s=l)}if(i=a[s]||e.target,i!==t){Fa(e,"currentTarget",{configurable:!0,get(){return i||n}});var h=E,p=M;ge(null),ze(null);try{for(var u,g=[];i!==null;){var d=i.assignedSlot||i.parentNode||i.host||null;try{var w=i[dt]?.[r];w!=null&&(!i.disabled||e.target===i)&&w.call(i,e)}catch(_){u?g.push(_):u=_}if(e.cancelBubble||d===t||d===null)break;i=d}if(u){for(let _ of g)queueMicrotask(()=>{throw _});throw u}}finally{e[dt]=t,delete e.currentTarget,ge(h),ze(p)}}}const $i=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function es(e){return $i?.createHTML(e)??e}function ts(e,t=!1){var n=Vr("template");return e=e.replaceAll("<!>","<!---->"),n.innerHTML=t?es(e):e,n.content}function fa(e,t){var n=M;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function T(e,t){var n=(t&vi)!==0,r=(t&hi)!==0,a,i=!e.startsWith("<!>");return()=>{a===void 0&&(a=ts(i?e:"<!>"+e,!0),n||(a=dn(a)));var s=r||Dr?document.importNode(a,!0):a.cloneNode(!0);if(n){var o=dn(s),l=s.lastChild;fa(o,l)}else fa(s,s);return s}}function q(e,t){e!==null&&e.before(t)}function ne(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=n,e.nodeValue=n+"")}function ns(e,t){return rs(e,t)}const hn=new Map;function rs(e,{target:t,anchor:n,props:r={},events:a,context:i,intro:s=!0}){Ni();var o=void 0,l=Fi(()=>{var c=n??t.appendChild(lt());Ei(c,{pending:()=>{}},u=>{kn({});var g=he;i&&(g.c=i),a&&(r.$$events=a),o=e(u,r)||{},An()});var h=new Set,p=u=>{for(var g=0;g<u.length;g++){var d=u[g];if(!h.has(d)){h.add(d);var w=Zi(d);for(const m of[t,document]){var _=hn.get(m);_===void 0&&(_=new Map,hn.set(m,_));var N=_.get(d);N===void 0?(m.addEventListener(d,Fn,{passive:w}),_.set(d,1)):_.set(d,N+1)}}}};return p(on(la)),Dn.add(p),()=>{for(var u of h)for(const w of[t,document]){var g=hn.get(w),d=g.get(u);--d==0?(w.removeEventListener(u,Fn),g.delete(u),g.size===0&&hn.delete(w)):g.set(u,d)}Dn.delete(p),c!==n&&c.parentNode?.removeChild(c)}});return Hn.set(o,l),o}let Hn=new WeakMap;function as(e,t){const n=Hn.get(e);return n?(Hn.delete(e),n(t)):Promise.resolve()}class is{constructor(t,n=!0){Ne(this,"anchor");k(this,ke,new Map);k(this,Me,new Map);k(this,de,new Map);k(this,mt,new Set);k(this,en,!0);k(this,tn,()=>{var t=L;if(f(this,ke).has(t)){var n=f(this,ke).get(t),r=f(this,Me).get(n);if(r)On(r),f(this,mt).delete(n);else{var a=f(this,de).get(n);a&&(f(this,Me).set(n,a.effect),f(this,de).delete(n),a.fragment.lastChild.remove(),this.anchor.before(a.fragment),r=a.effect)}for(const[i,s]of f(this,ke)){if(f(this,ke).delete(i),i===t)break;const o=f(this,de).get(s);o&&(se(o.effect),f(this,de).delete(s))}for(const[i,s]of f(this,Me)){if(i===n||f(this,mt).has(i))continue;const o=()=>{if(Array.from(f(this,ke).values()).includes(i)){var c=document.createDocumentFragment();Jr(s,c),c.append(lt()),f(this,de).set(i,{effect:s,fragment:c})}else se(s);f(this,mt).delete(i),f(this,Me).delete(i)};f(this,en)||!r?(f(this,mt).add(i),ct(s,o,!1)):o()}}});k(this,_n,t=>{f(this,ke).delete(t);const n=Array.from(f(this,ke).values());for(const[r,a]of f(this,de))n.includes(r)||(se(a.effect),f(this,de).delete(r))});this.anchor=t,b(this,en,n)}ensure(t,n){var r=L,a=Ur();if(n&&!f(this,Me).has(t)&&!f(this,de).has(t))if(a){var i=document.createDocumentFragment(),s=lt();i.append(s),f(this,de).set(t,{effect:Se(()=>n(s)),fragment:i})}else f(this,Me).set(t,Se(()=>n(this.anchor)));if(f(this,ke).set(r,t),a){for(const[o,l]of f(this,Me))o===t?r.unskip_effect(l):r.skip_effect(l);for(const[o,l]of f(this,de))o===t?r.unskip_effect(l.effect):r.skip_effect(l.effect);r.oncommit(f(this,tn)),r.ondiscard(f(this,_n))}else f(this,tn).call(this)}}ke=new WeakMap,Me=new WeakMap,de=new WeakMap,mt=new WeakMap,en=new WeakMap,tn=new WeakMap,_n=new WeakMap;function V(e,t,n=!1){var r=new is(e),a=n?Ct:0;function i(s,o){r.ensure(s,o)}Pn(()=>{var s=!1;t((o,l=0)=>{s=!0,i(l,o)}),s||i(!1,null)},a)}function ua(e,t){return t}function ss(e,t,n){for(var r=[],a=t.length,i,s=t.length,o=0;o<a;o++){let p=t[o];ct(p,()=>{if(i){if(i.pending.delete(p),i.done.add(p),i.pending.size===0){var u=e.outrogroups;Un(on(i.done)),u.delete(i),u.size===0&&(e.outrogroups=null)}}else s-=1},!1)}if(s===0){var l=r.length===0&&n!==null;if(l){var c=n,h=c.parentNode;Li(h),h.append(c),e.items.clear()}Un(t,!l)}else i={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(i)}function Un(e,t=!0){for(var n=0;n<e.length;n++)se(e[n],t)}var da;function va(e,t,n,r,a,i=null){var s=e,o=new Map;{var l=e;s=l.appendChild(lt())}var c=null,h=Rr(()=>{var _=n();return pr(_)?_:_==null?[]:on(_)}),p,u=!0;function g(){w.fallback=c,os(w,p,s,t,r),c!==null&&(p.length===0?(c.f&We)===0?On(c):(c.f^=We,Gt(c,null,s)):ct(c,()=>{c=null}))}var d=Pn(()=>{p=v(h);for(var _=p.length,N=new Set,m=L,X=Ur(),j=0;j<_;j+=1){var D=p[j],x=r(D,j),A=u?null:o.get(x);A?(A.v&&qt(A.v,D),A.i&&qt(A.i,j),X&&m.unskip_effect(A.e)):(A=ls(o,u?s:da??(da=lt()),D,x,j,a,t,n),u||(A.e.f|=We),o.set(x,A)),N.add(x)}if(_===0&&i&&!c&&(u?c=Se(()=>i(s)):(c=Se(()=>i(da??(da=lt()))),c.f|=We)),_>N.size&&Ga(),!u)if(X){for(const[F,re]of o)N.has(F)||m.skip_effect(re.e);m.oncommit(g),m.ondiscard(()=>{})}else g();v(h)}),w={effect:d,items:o,outrogroups:null,fallback:c};u=!1}function Zt(e){for(;e!==null&&(e.f&we)===0;)e=e.next;return e}function os(e,t,n,r,a){var i=t.length,s=e.items,o=Zt(e.effect.first),l,c=null,h=[],p=[],u,g,d,w;for(w=0;w<i;w+=1){if(u=t[w],g=a(u,w),d=s.get(g).e,e.outrogroups!==null)for(const F of e.outrogroups)F.pending.delete(d),F.done.delete(d);if((d.f&We)!==0)if(d.f^=We,d===o)Gt(d,null,n);else{var _=c?c.next:o;d===e.effect.last&&(e.effect.last=d.prev),d.prev&&(d.prev.next=d.next),d.next&&(d.next.prev=d.prev),Je(e,c,d),Je(e,d,_),Gt(d,_,n),c=d,h=[],p=[],o=Zt(c.next);continue}if((d.f&le)!==0&&On(d),d!==o){if(l!==void 0&&l.has(d)){if(h.length<p.length){var N=p[0],m;c=N.prev;var X=h[0],j=h[h.length-1];for(m=0;m<h.length;m+=1)Gt(h[m],N,n);for(m=0;m<p.length;m+=1)l.delete(p[m]);Je(e,X.prev,j.next),Je(e,c,X),Je(e,j,N),o=N,c=j,w-=1,h=[],p=[]}else l.delete(d),Gt(d,o,n),Je(e,d.prev,d.next),Je(e,d,c===null?e.effect.first:c.next),Je(e,c,d),c=d;continue}for(h=[],p=[];o!==null&&o!==d;)(l??(l=new Set)).add(o),p.push(o),o=Zt(o.next);if(o===null)continue}(d.f&We)===0&&h.push(d),c=d,o=Zt(d.next)}if(e.outrogroups!==null){for(const F of e.outrogroups)F.pending.size===0&&(Un(on(F.done)),e.outrogroups?.delete(F));e.outrogroups.size===0&&(e.outrogroups=null)}if(o!==null||l!==void 0){var D=[];if(l!==void 0)for(d of l)(d.f&le)===0&&D.push(d);for(;o!==null;)(o.f&le)===0&&o!==e.fallback&&D.push(o),o=Zt(o.next);var x=D.length;if(x>0){var A=i===0?n:null;ss(e,D,A)}}}function ls(e,t,n,r,a,i,s,o){var l=(s&si)!==0?(s&li)===0?Ri(n,!1,!1):st(n):null,c=(s&oi)!==0?st(a):null;return{v:l,i:c,e:Se(()=>(i(t,l??n,c??a,o),()=>{e.delete(r)}))}}function Gt(e,t,n){if(e.nodes)for(var r=e.nodes.start,a=e.nodes.end,i=t&&(t.f&We)===0?t.nodes.start:n;r!==null;){var s=Bt(r);if(i.before(r),r===a)return;r=s}}function Je(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Mt(e,t){Hi(()=>{var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector("#"+t.hash)){const a=Vr("style");a.id=t.hash,a.textContent=t.code,r.appendChild(a)}})}const ha=[...`
5
+ \r\f \v\uFEFF`];function cs(e,t,n){var r=e==null?"":""+e;if(t&&(r=r?r+" "+t:t),n){for(var a in n)if(n[a])r=r?r+" "+a:a;else if(r.length)for(var i=a.length,s=0;(s=r.indexOf(a,s))>=0;){var o=s+i;(s===0||ha.includes(r[s-1]))&&(o===r.length||ha.includes(r[o]))?r=(s===0?"":r.substring(0,s))+r.substring(o+1):s=o}}return r===""?null:r}function fs(e,t){return e==null?null:String(e)}function Qe(e,t,n,r,a,i){var s=e.__className;if(s!==n||s===void 0){var o=cs(n,r,i);o==null?e.removeAttribute("class"):e.className=o,e.__className=n}else if(i&&a!==i)for(var l in i){var c=!!i[l];(a==null||c!==!!a[l])&&e.classList.toggle(l,c)}return i}function Jt(e,t,n,r){var a=e.__style;if(a!==t){var i=fs(t);i==null?e.removeAttribute("style"):e.style.cssText=i,e.__style=t}return r}const us=Symbol("is custom element"),ds=Symbol("is html");function vt(e,t,n,r){var a=vs(e);a[t]!==(a[t]=n)&&(t==="loading"&&(e[Xa]=n),n==null?e.removeAttribute(t):typeof n!="string"&&hs(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function vs(e){return e.__attributes??(e.__attributes={[us]:e.nodeName.includes("-"),[ds]:e.namespaceURI===xr})}var pa=new Map;function hs(e){var t=e.getAttribute("is")||e.nodeName,n=pa.get(t);if(n)return n;pa.set(t,n=[]);for(var r,a=e,i=Element.prototype;i!==a;){r=Ha(a);for(var s in r)r[s].set&&n.push(s);a=gr(a)}return n}let pn=!1;function ps(e){var t=pn;try{return pn=!1,[e(),pn]}finally{pn=t}}function K(e,t,n,r){var a=(n&ui)!==0,i=(n&di)!==0,s=r,o=!0,l=()=>(o&&(o=!1,s=i?oa(r):r),s),c;if(a){var h=cn in e||Ya in e;c=Et(e,t)?.set??(h&&t in e?m=>e[t]=m:void 0)}var p,u=!1;a?[p,u]=ps(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=l(),c&&(ti(),c(p)));var g;if(g=()=>{var m=e[t];return m===void 0?l():(o=!0,m)},(n&fi)===0)return g;if(c){var d=e.$$legacy;return(function(m,X){return arguments.length>0?((!X||d||u)&&c(X?g():m),m):g()})}var w=!1,_=((n&ci)!==0?un:Rr)(()=>(w=!1,g()));a&&v(_);var N=M;return(function(m,X){if(arguments.length>0){const j=X?v(_):a?ot(m):m;return U(_,j),w=!0,s!==void 0&&(s=j),m}return Ge&&w||(N.f&Le)!==0?_.v:v(_)})}function gs(e,t){var n,r;return r=class{constructor(i){k(this,n,null);if(!et)throw new Error(`[sevn] ${t} só pode ser instanciado no navegador. Em SSR, monte o componente dentro de um efeito de cliente.`);const{target:s,...o}=i??{},l=typeof s=="string"?document.querySelector(s):s;if(!l)throw new Error(`[sevn] ${t}: alvo não encontrado`+(typeof s=="string"?` para o seletor "${s}".`:"."));Ma(),b(this,n,ns(e,{target:l,props:o}))}destroy(){if(!f(this,n))return Promise.resolve();const i=f(this,n);return b(this,n,null),as(i)}},n=new WeakMap,r}function ga(e){try{return new URL(e,document.baseURI).searchParams.get("cid")}catch{return null}}function _s(){const e=document.currentScript;if(e?.src){const n=ga(e.src);if(n)return n}const t=document.querySelectorAll('script[src*="cid="]');for(const n of t){const r=ga(n.src);if(r)return r}return null}function ms(){if(!et)return;const e=_s();if(e)try{yn(e)}catch(t){console.error("[sevn] Chave inválida na tag <script>:",t)}}const ws="5";typeof window<"u"&&((Sa=window.__svelte??(window.__svelte={})).v??(Sa.v=new Set)).add(ws);const ys="data:image/svg+xml,%3csvg%20width='37'%20height='45'%20viewBox='0%200%2037%2045'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.5'%3e%3cpath%20d='M11.3846%2028.125H25.6154C30.34%2028.125%2034.1538%2031.8937%2034.1538%2036.5625V42.1875H2.84615V36.5625C2.84615%2031.8937%206.66%2028.125%2011.3846%2028.125ZM11.3846%2011.25H25.6154V18.2812C25.6154%2020.1461%2024.8657%2021.9345%2023.5313%2023.2531C22.1969%2024.5717%2020.3871%2025.3125%2018.5%2025.3125C16.6129%2025.3125%2014.8031%2024.5717%2013.4687%2023.2531C12.1343%2021.9345%2011.3846%2020.1461%2011.3846%2018.2812V11.25ZM25.6154%2011.25C27.1808%2011.25%2028.4615%2012.5156%2028.4615%2014.0625C28.4615%2015.6094%2027.1808%2016.875%2025.6154%2016.875V11.25ZM11.3846%2016.875C9.81923%2016.875%208.53846%2015.6094%208.53846%2014.0625C8.53846%2012.5156%209.81923%2011.25%2011.3846%2011.25V16.875Z'%20fill='%231C1C1C'/%3e%3cpath%20d='M11.7262%2011.5875H10.3031C8.16847%209.84374%208.53847%207.17186%208.53847%204.92186C8.53847%202.67186%209.96154%204.19061%2011.3846%204.19061C12.8077%204.19061%2014.2308%205.59686%2014.2308%205.59686C11.7262%205.59686%2011.3846%202.78436%2011.3846%202.78436H19.9231C23.0539%202.78436%2025.6154%205.31561%2025.6154%208.40936H27.0385C27.0385%208.40936%2027.75%2010.5187%2026.6969%2011.925L11.7546%2011.5875H11.7262Z'%20fill='%231C1C1C'/%3e%3c/g%3e%3c/svg%3e",bs="data:image/svg+xml,%3csvg%20width='37'%20height='45'%20viewBox='0%200%2037%2045'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.5'%3e%3cpath%20d='M11.3846%2028.125H25.6154C30.34%2028.125%2034.1539%2031.8937%2034.1539%2036.5625V42.1875H2.84616V36.5625C2.84616%2031.8937%206.66001%2028.125%2011.3846%2028.125ZM11.3846%2011.25H25.6154V18.2812C25.6154%2020.1461%2024.8657%2021.9345%2023.5313%2023.2531C22.197%2024.5717%2020.3871%2025.3125%2018.5%2025.3125C16.6129%2025.3125%2014.8031%2024.5717%2013.4687%2023.2531C12.1343%2021.9345%2011.3846%2020.1461%2011.3846%2018.2812V11.25Z'%20fill='black'/%3e%3cpath%20d='M27.0385%2011.0531V9.84375C27.0385%206.75%2024.4769%204.21875%2021.3461%204.21875L19.9231%202.8125H15.6538C12.5231%202.8125%209.96153%205.34375%209.96153%208.4375V11.0531C9.96153%2014.7938%208.45307%2018.3656%205.80615%2021.0094L4.26923%2022.5281L6.37538%2023.5688C8.53846%2024.6375%2011.1285%2024.2156%2012.8077%2022.5281H24.1923C25.9%2024.2156%2028.49%2024.6375%2030.6246%2023.5688L32.7308%2022.5281L31.1938%2021.0094C29.8732%2019.701%2028.8264%2018.1483%2028.1134%2016.4399C27.4004%2014.7316%2027.0351%2012.9011%2027.0385%2011.0531Z'%20fill='black'/%3e%3cpath%20d='M19.9231%202.8125C19.9231%202.8125%2021.3462%202.8125%2021.3462%204.21875H19.9231V2.8125Z'%20fill='black'/%3e%3c/g%3e%3c/svg%3e";var xs=T('<span class="avatar-tag svelte-ga6vh2"> </span>'),Ss=T('<div class="avatar-container svelte-ga6vh2"><div class="avatar svelte-ga6vh2"><img width="1" height="1"/></div> <!></div>');const Es={hash:"svelte-ga6vh2",code:".avatar-container.svelte-ga6vh2 {position:relative;display:inline-flex;flex-direction:column;align-items:center;flex-shrink:0;}.avatar.svelte-ga6vh2 {border-radius:50%;display:flex;align-items:flex-end;justify-content:center;overflow:hidden;}.avatar-image.svelte-ga6vh2 {width:75%;height:auto;display:block;margin-bottom:-6%;}.avatar-image--photo.svelte-ga6vh2 {width:100%;height:100%;margin-bottom:0;object-fit:cover;object-position:center top;}.avatar-tag.svelte-ga6vh2 {position:absolute;bottom:-5px;color:#fff;font-weight:700;letter-spacing:0.05em;border-radius:4px;border:1px solid #fff;white-space:nowrap;}"};function _a(e,t){Mt(e,Es);let n=K(t,"avatar",3,"man"),r=K(t,"size",3,"md"),a=K(t,"tagColor",3,"var(--sevn-color-green)"),i=te(!1);const s=O(()=>n()==="woman"?bs:ys),o=O(()=>!!t.photoUrl&&!v(i)),l=O(()=>v(o)?t.photoUrl:v(s)),c={sm:"40px",md:"56px",lg:"72px"},h={sm:{fontSize:"9px",padding:"1px 5px"},md:{fontSize:"12px",padding:"2px 8px"},lg:{fontSize:"14px",padding:"3px 10px"}},p=O(()=>c[r()]??r()),u=O(()=>h[r()]??h.md);var g=Ss(),d=S(g),w=S(d);let _;var N=Y(d,2);{var m=X=>{var j=xs(),D=S(j);P(()=>{Jt(j,`background-color: ${a()??""}; font-size: ${v(u).fontSize??""}; padding: ${v(u).padding??""};`),ne(D,t.tag)}),q(X,j)};V(N,X=>{t.tag&&X(m)})}P(()=>{Jt(d,`background-color: ${t.avatarColor??"var(--sevn-color-secondary)"??""}; width: ${v(p)??""}; height: ${v(p)??""};`),_=Qe(w,1,"avatar-image svelte-ga6vh2",null,_,{"avatar-image--photo":v(o)}),vt(w,"src",v(l)),vt(w,"alt",t.name)}),Ji("error",w,()=>U(i,!0)),q(e,g)}const ma="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.5%206.5L19%2012L13.5%2017.5M17.75%2012L4.75%2012'%20stroke='%231C1C1C'%20stroke-width='2'%20stroke-linecap='square'/%3e%3c/svg%3e",wa="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.6'%3e%3cpath%20d='M10.5%206.5L5%2012L10.5%2017.5M6.25%2012L19.25%2012'%20stroke='%231C1C1C'%20stroke-width='2'%20stroke-linecap='square'/%3e%3c/g%3e%3c/svg%3e";var Cs=T("<span> </span>");const ks={hash:"svelte-pamnib",code:".tag.svelte-pamnib {display:inline-flex;align-items:center;padding:4px 8px;border-radius:5px;font-family:inherit;font-weight:700;color:#ffffff;white-space:nowrap;letter-spacing:0.03em;width:fit-content;}"};function Rt(e,t){Mt(e,ks);let n=K(t,"color",3,"#1C1C1C"),r=K(t,"fontSize",3,"0.6875rem"),a=K(t,"class",3,"");var i=Cs(),s=S(i);P(()=>{Qe(i,1,`tag ${a()??""}`,"svelte-pamnib"),Jt(i,`background-color: ${n()??""}; font-size: ${r()??""}`),ne(s,t.label)}),q(e,i)}var As=T('<p class="candidate-description svelte-q1jzvs"> </p>'),zs=T('<span class="candidate-stats-percent-suffix svelte-q1jzvs"> </span>'),Ts=T('<span class="candidate-stats-percent svelte-q1jzvs"> <!></span>'),qs=T('<span class="candidate-stats-votes svelte-q1jzvs"> </span>'),js=T('<div class="candidate-stats svelte-q1jzvs"><!> <!></div>'),Ms=T('<div class="candidate-wrapper svelte-q1jzvs"><!> <div><div class="candidate-name-row svelte-q1jzvs"><span class="candidate-name svelte-q1jzvs"> </span> <!> <!></div> <!></div></div>'),Rs=T('<p class="candidate-description svelte-q1jzvs"> </p>'),Is=T('<span class="candidate-stats-percent-suffix svelte-q1jzvs"> </span>'),Ns=T('<span class="candidate-stats-percent svelte-q1jzvs"> <!></span>'),Ps=T('<span class="candidate-stats-votes svelte-q1jzvs"> </span>'),Ls=T('<div class="candidate-stats svelte-q1jzvs"><!> <!></div>'),Os=T('<!> <div><div class="candidate-name-row svelte-q1jzvs"><span class="candidate-name svelte-q1jzvs"> </span> <!> <!></div> <!></div>',1),Ds=T("<span> </span>"),Fs=T('<div class="candidate svelte-q1jzvs"><!> <!></div>');const Hs={hash:"svelte-q1jzvs",code:`.candidate.svelte-q1jzvs {display:flex;align-items:center;justify-content:space-between;}.candidate-wrapper.svelte-q1jzvs {display:flex;align-items:center;gap:15px;}.candidate-info.svelte-q1jzvs {display:flex;flex-direction:column;gap:2px;}
6
+
7
+ /* Desktop: description on the right inside the info block */.candidate-info.right.svelte-q1jzvs {flex:1;flex-direction:row;flex-wrap:wrap;align-items:center;}.candidate-info.right.svelte-q1jzvs .candidate-description:where(.svelte-q1jzvs) {margin-left:auto;flex-shrink:0;}.candidate-name-row.svelte-q1jzvs {display:flex;align-items:center;gap:8px;flex-wrap:wrap;}.candidate-name.svelte-q1jzvs {font-size:var(--font-name);font-weight:var(--weight-name);color:var(--sevn-color-tertiary);line-height:1.2;}.candidate-description.svelte-q1jzvs {font-size:var(--font-desc);font-weight:var(--weight-desc);color:var(--sevn-color-tertiary);opacity:0.7;}.candidate-position.svelte-q1jzvs {font-size:var(--font-position);font-weight:600;color:var(--sevn-color-tertiary);white-space:nowrap;flex-shrink:0;margin-left:auto;}.candidate-position.left.svelte-q1jzvs {order:-1;margin-left:0;}
8
+
9
+ /* ── Stats ─────────────────────────────── */.candidate-stats.svelte-q1jzvs {display:flex;flex-direction:column;gap:4px;align-items:baseline;flex-shrink:0;}.candidate-stats-percent.svelte-q1jzvs {font-size:1rem;font-weight:700;color:var(--sevn-color-tertiary);line-height:1.2;}.candidate-stats-votes.svelte-q1jzvs {font-size:var(--font-desc);font-weight:400;color:var(--sevn-color-tertiary);opacity:0.7;}.candidate-stats-percent-suffix.svelte-q1jzvs {display:inline;margin-left:4px;}
10
+
11
+ @media (min-width: 768px) {.candidate-stats.svelte-q1jzvs {flex-direction:row;gap:8px;}.candidate-stats-percent-suffix.svelte-q1jzvs {display:none;}
12
+ }
13
+
14
+ @media (max-width: 640px) {.candidate.svelte-q1jzvs {flex:1;flex-wrap:wrap;align-items:center;}.candidate-info.svelte-q1jzvs {flex:1;}
15
+
16
+ /* Mobile: description keeps right alignment */.candidate-info.right.svelte-q1jzvs {flex-direction:row;align-items:center;}.candidate-position.svelte-q1jzvs {order:3;margin-left:auto;}.candidate-position.left.svelte-q1jzvs {order:-1;margin-left:0;}
17
+ }`};function Us(e,t){Mt(e,Hs);let n=K(t,"avatar",3,"man"),r=K(t,"elected",3,!1),a=K(t,"electedLabel",3,"ELEITO"),i=K(t,"electedColor",3,"var(--sevn-color-green)"),s=K(t,"descriptionSide",3,"inline"),o=K(t,"positionSide",3,"right"),l=K(t,"size",3,"md"),c=K(t,"nameWeight",3,700),h=K(t,"descWeight",3,400),p=K(t,"wrapper",3,!1);const u={sm:{fontSize:"0.875rem",descSize:"0.75rem",tagSize:"0.625rem"},md:{fontSize:"1.125rem",descSize:"0.875rem",tagSize:"0.6875rem"},lg:{fontSize:"1.375rem",descSize:"1rem",tagSize:"0.75rem"}},g=O(()=>u[l()]??u.md);var d=Fs(),w=S(d);{var _=j=>{var D=Ms(),x=S(D);_a(x,{get name(){return t.name},get photoUrl(){return t.photoUrl},get avatar(){return n()},get avatarColor(){return t.avatarColor},get size(){return l()},get tag(){return t.avatarTag},get tagColor(){return t.avatarTagColor}});var A=Y(x,2);let F;var re=S(A),Ke=S(re),nn=S(Ke),wt=Y(Ke,2);{var rn=C=>{{let H=O(()=>t.tagColor??"var(--sevn-color-secondary)"),ae=O(()=>t.tagSize??v(g).tagSize);Rt(C,{get label(){return t.tag},get color(){return v(H)},get fontSize(){return v(ae)}})}};V(wt,C=>{t.tag&&C(rn)})}var z=Y(wt,2);{var y=C=>{{let H=O(()=>t.tagSize??v(g).tagSize);Rt(C,{get label(){return a()},get color(){return i()},get fontSize(){return v(H)}})}};V(z,C=>{r()&&C(y)})}var Re=Y(re,2);{var Ht=C=>{var H=As(),ae=S(H);P(()=>ne(ae,t.description)),q(C,H)},Ie=C=>{var H=js(),ae=S(H);{var an=ie=>{var Ae=Ts(),Be=S(Ae),Gn=Y(Be);{var Jn=yt=>{var sn=zs(),Qn=S(sn);P(()=>ne(Qn,t.percentSuffix)),q(yt,sn)};V(Gn,yt=>{t.percentSuffix&&yt(Jn)})}P(()=>ne(Be,`${t.percent??""} `)),q(ie,Ae)};V(ae,ie=>{t.percent&&ie(an)})}var Xn=Y(ae,2);{var Zn=ie=>{var Ae=qs(),Be=S(Ae);P(()=>ne(Be,t.votes)),q(ie,Ae)};V(Xn,ie=>{t.votes&&ie(Zn)})}q(C,H)};V(Re,C=>{t.description?C(Ht):(t.percent||t.votes)&&C(Ie,1)})}P(()=>{F=Qe(A,1,"candidate-info svelte-q1jzvs",null,F,{right:s()==="right"&&!!t.description}),ne(nn,t.name)}),q(j,D)},N=j=>{var D=Os(),x=Pi(D);_a(x,{get name(){return t.name},get photoUrl(){return t.photoUrl},get avatar(){return n()},get avatarColor(){return t.avatarColor},get size(){return l()},get tag(){return t.avatarTag},get tagColor(){return t.avatarTagColor}});var A=Y(x,2);let F;var re=S(A),Ke=S(re),nn=S(Ke),wt=Y(Ke,2);{var rn=C=>{{let H=O(()=>t.tagColor??"var(--sevn-color-secondary)"),ae=O(()=>t.tagSize??v(g).tagSize);Rt(C,{get label(){return t.tag},get color(){return v(H)},get fontSize(){return v(ae)}})}};V(wt,C=>{t.tag&&C(rn)})}var z=Y(wt,2);{var y=C=>{{let H=O(()=>t.tagSize??v(g).tagSize);Rt(C,{get label(){return a()},get color(){return i()},get fontSize(){return v(H)}})}};V(z,C=>{r()&&C(y)})}var Re=Y(re,2);{var Ht=C=>{var H=Rs(),ae=S(H);P(()=>ne(ae,t.description)),q(C,H)},Ie=C=>{var H=Ls(),ae=S(H);{var an=ie=>{var Ae=Ns(),Be=S(Ae),Gn=Y(Be);{var Jn=yt=>{var sn=Is(),Qn=S(sn);P(()=>ne(Qn,t.percentSuffix)),q(yt,sn)};V(Gn,yt=>{t.percentSuffix&&yt(Jn)})}P(()=>ne(Be,`${t.percent??""} `)),q(ie,Ae)};V(ae,ie=>{t.percent&&ie(an)})}var Xn=Y(ae,2);{var Zn=ie=>{var Ae=Ps(),Be=S(Ae);P(()=>ne(Be,t.votes)),q(ie,Ae)};V(Xn,ie=>{t.votes&&ie(Zn)})}q(C,H)};V(Re,C=>{t.description?C(Ht):(t.percent||t.votes)&&C(Ie,1)})}P(()=>{F=Qe(A,1,"candidate-info svelte-q1jzvs",null,F,{right:s()==="right"&&!!t.description}),ne(nn,t.name)}),q(j,D)};V(w,j=>{p()?j(_):j(N,!1)})}var m=Y(w,2);{var X=j=>{var D=Ds();let x;var A=S(D);P(()=>{x=Qe(D,1,"candidate-position svelte-q1jzvs",null,x,{left:o()==="left"}),ne(A,t.position)}),q(j,D)};V(m,j=>{t.position&&j(X)})}P(()=>Jt(d,`
18
+ --font-name: ${t.fontSize??v(g).fontSize??""};
19
+ --font-desc: ${t.descSize??v(g).descSize??""};
20
+ --font-tag: ${t.tagSize??v(g).tagSize??""};
21
+ --font-position: ${t.positionSize??v(g).fontSize??""};
22
+ --weight-name: ${c()??""};
23
+ --weight-desc: ${h()??""};
24
+ gap: ${p()?"10px":"18px"};
25
+ `)),q(e,d)}function Vs(e,t){return`${typeof e=="number"&&Number.isFinite(e)&&e>0?e:t+1}º lugar`}var Ks=T('<img alt="" class="svelte-1nweovp"/>'),Bs=T('<img alt="" class="flip svelte-1nweovp"/>'),Ws=T('<div class="candidate-position-carrousel-item svelte-1nweovp"><!></div>'),Ys=T('<img alt="" class="flip svelte-1nweovp"/>'),Xs=T('<img alt="" class="svelte-1nweovp"/>'),Zs=T("<button></button>"),Gs=T('<div class="candidate-position-carrousel-dots svelte-1nweovp"></div>'),Js=T('<div class="candidate-position-carrousel svelte-1nweovp"><div class="candidate-position-carrousel-inner svelte-1nweovp"><button class="candidate-position-carrousel-arrow svelte-1nweovp" aria-label="Anterior"><!></button> <div role="presentation"></div> <button class="candidate-position-carrousel-arrow svelte-1nweovp" aria-label="Próximo"><!></button></div> <!></div>');const Qs={hash:"svelte-1nweovp",code:`.candidate-position-carrousel.svelte-1nweovp {display:flex;flex-direction:column;gap:12px;}.candidate-position-carrousel-inner.svelte-1nweovp {display:flex;align-items:center;}
26
+
27
+ /* ── Track ─────────────────────────────── */.candidate-position-carrousel-track.svelte-1nweovp {flex:1;display:flex;flex-direction:column;gap:14px;padding-bottom:15px;opacity:1;transform:translateX(0);transition:opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
28
+ transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);}
29
+
30
+ /* Estado "instantâneo" (sem transição) da página que está entrando — o
31
+ conteúdo já nasce deslocado/invisível pro lado de onde deve vir. */.candidate-position-carrousel-track.entering.svelte-1nweovp {transition:none;}.candidate-position-carrousel-track.entering.forward.svelte-1nweovp {opacity:0;transform:translateX(20px);}.candidate-position-carrousel-track.entering.backward.svelte-1nweovp {opacity:0;transform:translateX(-20px);}
32
+
33
+ @media (min-width: 768px) {.candidate-position-carrousel-track.entering.forward.svelte-1nweovp {transform:translateX(40px);}.candidate-position-carrousel-track.entering.backward.svelte-1nweovp {transform:translateX(-40px);}
34
+ }
35
+
36
+ /* ── Item ─────────────────────────────── */.candidate-position-carrousel-item.svelte-1nweovp {display:flex;align-items:center;gap:8px;}
37
+
38
+
39
+ /* ── Arrows ───────────────────────────── */.candidate-position-carrousel-arrow.svelte-1nweovp {display:none;}
40
+
41
+ /* ── Dots ─────────────────────────────── */.candidate-position-carrousel-dots.svelte-1nweovp {display:flex;justify-content:center;gap:6px;}.candidate-position-carrousel-dot.svelte-1nweovp {width:8px;height:8px;border-radius:50%;border:none;padding:0;cursor:pointer;background-color:var(--sevn-color-neutral);transition:width 0.2s, border-radius 0.2s, background-color 0.2s;}.candidate-position-carrousel-dot.active.svelte-1nweovp {width:16px;border-radius:40%;background-color:var(--sevn-color-tertiary);}
42
+
43
+ /* ── Desktop ──────────────────────────── */
44
+ @media (min-width: 768px) {.candidate-position-carrousel-track.svelte-1nweovp {flex-direction:row;gap:0;border-bottom:1px solid var(--sevn-color-neutral);}.candidate-position-carrousel-item.svelte-1nweovp {flex:1;flex-direction:row;align-items:center;gap:30px;padding:0 20px;}.candidate-position-carrousel-item.svelte-1nweovp:first-child {padding-left:12px;}.candidate-position-carrousel-arrow.svelte-1nweovp {display:flex;align-items:center;background:none;border:none;cursor:pointer;padding:4px 8px;flex-shrink:0;}.candidate-position-carrousel-arrow.svelte-1nweovp:disabled {cursor:default;}.candidate-position-carrousel-arrow.svelte-1nweovp img:where(.svelte-1nweovp) {width:24px;height:24px;}.candidate-position-carrousel-arrow.svelte-1nweovp .flip:where(.svelte-1nweovp) {transform:scaleX(-1);}.candidate-position-carrousel-dots.svelte-1nweovp {display:none;}
45
+ }
46
+
47
+ @media (max-width: 767px) {.candidate-position-carrousel-item.svelte-1nweovp {padding-bottom:15px;border-bottom:1px solid var(--sevn-color-neutral);}
48
+ }`};function $s(e,t){kn(t,!0),Mt(e,Qs);let n=K(t,"candidates",19,()=>[]),r=K(t,"itemsPerPage",3,3),a=te(0),i=te(!1),s=te("forward");const o=O(()=>Math.ceil(n().length/r())),l=O(()=>n().slice(v(a)*r(),(v(a)+1)*r()));function c(z,y){U(s,y,!0),U(i,!0),U(a,z,!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{U(i,!1)})})}function h(){v(a)>0&&c(v(a)-1,"backward")}function p(){v(a)<v(o)-1&&c(v(a)+1,"forward")}let u=te(ot(et?window.innerWidth<=480:!1)),g=0;function d(z){g=z.touches[0].clientX}function w(z){const y=g-z.changedTouches[0].clientX;Math.abs(y)<30||(y>0?p():h())}Br(()=>{if(!et)return;const z=window.matchMedia("(max-width: 480px)");U(u,z.matches,!0);const y=Re=>{U(u,Re.matches,!0)};return z.addEventListener("change",y),()=>z.removeEventListener("change",y)});var _=Js(),N=S(_),m=S(N),X=S(m);{var j=z=>{var y=Ks();P(()=>vt(y,"src",wa)),q(z,y)},D=z=>{var y=Bs();P(()=>vt(y,"src",ma)),q(z,y)};V(X,z=>{v(a)===0?z(j):z(D,!1)})}var x=Y(m,2);let A;va(x,21,()=>v(l),ua,(z,y)=>{var Re=Ws(),Ht=S(Re);{let Ie=O(()=>v(y).avatar??"man"),C=O(()=>v(u)?"right":"left"),H=O(()=>v(y).size??"sm"),ae=O(()=>v(y).nameWeight??800),an=O(()=>v(y).descWeight??600);Us(Ht,{get name(){return v(y).name},get photoUrl(){return v(y).photoUrl},get avatar(){return v(Ie)},get avatarColor(){return v(y).avatarColor},get tag(){return v(y).tag},get tagColor(){return v(y).tagColor},get description(){return v(y).description},get position(){return v(y).position},get positionSide(){return v(C)},get size(){return v(H)},get nameWeight(){return v(ae)},get descWeight(){return v(an)},get percent(){return v(y).percent},get percentSuffix(){return v(y).percentSuffix},get votes(){return v(y).votes}})}q(z,Re)});var F=Y(x,2),re=S(F);{var Ke=z=>{var y=Ys();P(()=>vt(y,"src",wa)),q(z,y)},nn=z=>{var y=Xs();P(()=>vt(y,"src",ma)),q(z,y)};V(re,z=>{v(a)===v(o)-1?z(Ke):z(nn,!1)})}var wt=Y(N,2);{var rn=z=>{var y=Gs();va(y,21,()=>({length:v(o)}),ua,(Re,Ht,Ie)=>{var C=Zs();let H;vt(C,"aria-label",`Página ${Ie+1}`),P(()=>H=Qe(C,1,"candidate-position-carrousel-dot svelte-1nweovp",null,H,{active:Ie===v(a)})),Xt("click",C,()=>c(Ie,Ie>v(a)?"forward":"backward")),q(Re,C)}),q(z,y)};V(wt,z=>{v(o)>1&&z(rn)})}P(()=>{m.disabled=v(a)===0,A=Qe(x,1,"candidate-position-carrousel-track svelte-1nweovp",null,A,{entering:v(i),forward:v(s)==="forward",backward:v(s)==="backward"}),F.disabled=v(a)===v(o)-1}),Xt("click",m,h),Xt("touchstart",x,d),Xt("touchend",x,w),Xt("click",F,p),q(e,_),An()}Qi(["click","touchstart","touchend"]);var eo=T('<span class="header-tag-above svelte-1xm1ks6"><!></span>'),to=T('<span class="header-tag-inline svelte-1xm1ks6"><!></span>'),no=T('<p class="header-description svelte-1xm1ks6"> </p>'),ro=T('<header class="header svelte-1xm1ks6"><!> <div class="header-title-row svelte-1xm1ks6"><h1 class="header-title svelte-1xm1ks6"> </h1> <!></div> <!></header>');const ao={hash:"svelte-1xm1ks6",code:`.header.svelte-1xm1ks6 {display:flex;flex-direction:column;gap:4px;}.header-tag-inline.svelte-1xm1ks6 {display:none;}.header-title-row.svelte-1xm1ks6 {display:flex;align-items:center;gap:10px;}.header-title.svelte-1xm1ks6 {font-size:var(--header-title-font-size);font-weight:var(--header-title-font-weight);color:var(--sevn-color-tertiary);line-height:1.15;}.header-description.svelte-1xm1ks6 {font-size:var(--header-description-font-size);color:var(--sevn-color-tertiary);}
49
+
50
+ @media (max-width: 767px) {.header-title.svelte-1xm1ks6 {font-size:calc(var(--header-title-font-size) * 0.75);max-width:60%;}.header-description.svelte-1xm1ks6 {font-size:calc(var(--header-description-font-size) * 0.9);}
51
+ }
52
+
53
+ @media (min-width: 768px) {.header-tag-above.svelte-1xm1ks6 {display:none;}.header-tag-inline.svelte-1xm1ks6 {display:inline-flex;}
54
+ }`};function io(e,t){Mt(e,ao);var n=ro(),r=S(n);{var a=u=>{var g=eo(),d=S(g);Rt(d,{get label(){return t.tag},get color(){return t.tagColor}}),q(u,g)};V(r,u=>{t.tag&&u(a)})}var i=Y(r,2),s=S(i),o=S(s),l=Y(s,2);{var c=u=>{var g=to(),d=S(g);Rt(d,{get label(){return t.tag},get color(){return t.tagColor}}),q(u,g)};V(l,u=>{t.tag&&u(c)})}var h=Y(i,2);{var p=u=>{var g=no(),d=S(g);P(()=>ne(d,t.description)),q(u,g)};V(h,u=>{t.description&&u(p)})}P(()=>{Jt(n,`
55
+ --header-title-font-size: ${t.titleFontSize??"1.75rem"??""};
56
+ --header-title-font-weight: ${t.titleFontWeight??700??""};
57
+ --header-description-font-size: ${t.descriptionFontSize??"0.875rem"??""};
58
+ `),ne(o,t.title)}),q(e,n)}class ya{constructor(t={}){var n,r,a;this.inflight=new Map,this.tick=0,this.storageKey=(n=t.storageKey)!==null&&n!==void 0?n:"reqcache",this.maxEntries=(r=t.maxEntries)!==null&&r!==void 0?r:100,this.storage=(a=t.storage)!==null&&a!==void 0?a:oo()}async getFetch(t,n,r={}){const a=Date.now(),i=this.readAll(),s=i.find(c=>c.rota===t);if(s&&a<s.expiresAt)return s.lastAccess=this.nextAccess(),this.writeAll(i),s.data;const o=this.inflight.get(t);if(o)return o;const l=this.revalidate(t,n,r,s??null).finally(()=>this.inflight.delete(t));return this.inflight.set(t,l),l}invalidate(t){const n=this.readAll().filter(r=>r.rota!==t);this.writeAll(n)}cleanup(t=3600){const n=Date.now()-t*1e3,r=this.readAll(),a=r.filter(i=>i.expiresAt>n);return this.writeAll(a),r.length-a.length}clear(){if(this.storage)try{this.storage.removeItem(this.storageKey)}catch{}}nextAccess(){return this.tick=Math.max(Date.now(),this.tick+1),this.tick}async revalidate(t,n,r,a){var i,s;const o=(i=r.fetcher)!==null&&i!==void 0?i:fetch;let l;try{const h=await o(t,r.fetchOptions);if(!h.ok)throw new Error(`HTTP ${h.status} ao buscar ${t}`);l=await h.json()}catch(h){if(a&&(!((s=r.staleOnError)!==null&&s!==void 0)||s))return this.upsert({...a,expiresAt:Date.now()+n,lastAccess:this.nextAccess()}),a.data;throw h}if(a&&r.monotonicKey){const h=ba(a.data,r.monotonicKey),p=ba(l,r.monotonicKey);if(typeof h=="number"&&typeof p=="number"&&p<=h)return this.upsert({...a,expiresAt:Date.now()+n,lastAccess:this.nextAccess()}),a.data}const c=Date.now();return this.upsert({rota:t,data:l,createdAt:c,expiresAt:c+n,lastAccess:this.nextAccess()}),l}upsert(t){const n=this.readAll().filter(r=>r.rota!==t.rota);n.push(t),this.evictIfNeeded(n),this.writeAll(n)}evictIfNeeded(t){for(;t.length>this.maxEntries;){let n=0;for(let r=1;r<t.length;r++)t[r].lastAccess<t[n].lastAccess&&(n=r);t.splice(n,1)}}readAll(){if(!this.storage)return[];try{const t=this.storage.getItem(this.storageKey);if(!t)return[];const n=JSON.parse(t);return Array.isArray(n)?n:[]}catch{return[]}}writeAll(t){if(this.storage)try{this.storage.setItem(this.storageKey,JSON.stringify(t))}catch(n){if(so(n)&&t.length>0){const r=[...t].sort((a,i)=>a.lastAccess-i.lastAccess);r.splice(0,Math.ceil(r.length/2));try{this.storage.setItem(this.storageKey,JSON.stringify(r))}catch{}}}}}function ba(e,t){return t.split(".").reduce((n,r)=>{if(n&&typeof n=="object"&&r in n)return n[r]},e)}function so(e){return e instanceof Error&&(e.name==="QuotaExceededError"||e.name==="NS_ERROR_DOM_QUOTA_REACHED")}function oo(){try{if(typeof localStorage<"u"){const e="__reqcache_probe__";return localStorage.setItem(e,"1"),localStorage.removeItem(e),localStorage}}catch{}return null}new ya;const lo=300,Vn=new Map;function Kn(){try{return typeof window<"u"&&typeof localStorage<"u"}catch{return!1}}const co={getItem(e){return Kn()?localStorage.getItem(e):Vn.get(e)??null},setItem(e,t){if(Kn())try{localStorage.setItem(e,t)}catch{console.warn("[api] Cota do localStorage excedida, ignorando escrita")}else Vn.set(e,t)},removeItem(e){Kn()?localStorage.removeItem(e):Vn.delete(e)}};let Bn=null;function fo(){if(!Bn){const{storageKey:e,maxEntries:t}=Ut().cache;Bn=new ya({storage:co,storageKey:e,maxEntries:t})}return Bn}async function uo(e,t,n=lo,r){const[a]=cr(),i=e.replace(/^\/+/,""),s=new URL(i,`${a.replace(/\/+$/,"")}/`);let o;try{o=await fo().getFetch(s.toString(),n*1e3,{monotonicKey:r,fetcher:Pa})}catch(l){throw l instanceof Error&&/^HTTP 404 /.test(l.message)?new Error("Dados ainda não publicados"):l}if(o&&typeof o=="object"&&o.published===!1)throw new Error(o.reason??"Dados ainda não publicados");return o}function vo(e,t,n,r){return uo(`v1/elections/${e}/r${n}/${t}/br/timeline.json`)}const ho=new Set(["da","de","do","das","dos","e"]);function po(e){return e.toLowerCase().split(" ").map((t,n)=>n>0&&ho.has(t)?t:t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}var go=T('<p class="sevn_candidate_ranking__status svelte-1jldgqf">Carregando...</p>'),_o=T('<p class="sevn_candidate_ranking__status sevn_candidate_ranking__status--error svelte-1jldgqf"> </p>'),mo=T("<div><!> <!></div>");const wo={hash:"svelte-1jldgqf",code:`.sevn_candidate_ranking.svelte-1jldgqf {display:flex;flex-direction:column;gap:24px;}.sevn_candidate_ranking--raw.svelte-1jldgqf,
59
+ .sevn_candidate_ranking--raw.svelte-1jldgqf :where(.svelte-1jldgqf) {all:revert;}.sevn_candidate_ranking__status.svelte-1jldgqf {font-size:0.875rem;color:var(--sevn-color-text-secondary, #6b7280);}.sevn_candidate_ranking__status--error.svelte-1jldgqf {color:#e11d48;}`};function yo(e,t){kn(t,!0),Mt(e,wo);let n=K(t,"mock",3,!1),r=K(t,"rawStyle",3,!1),a=K(t,"year",3,2026),i=K(t,"header",19,()=>({title:"Posições de liderança",tagColor:"var(--sevn-color-tertiary, #1a1a2e)"})),s=te(null),o=te(!1),l=te(null);Br(()=>{!et||n()||(U(o,!0),U(l,null),U(s,null),vo(a(),"president",1).then(x=>{U(s,x,!0),U(o,!1)}).catch(x=>{console.error("Failed to fetch timeline:",x),U(l,x instanceof Error?x.message:"Não foi possível carregar os resultados.",!0),U(o,!1)}))});const c=[{position:"1º lugar",name:"Candidato A",tag:"ABC",tagColor:"var(--sevn-color-primary)",avatar:"man",avatarColor:"var(--sevn-color-primary)",description:"41,8% dos votos válidos"},{position:"2º lugar",name:"Candidato B",tag:"DEF",tagColor:"var(--sevn-color-secondary)",avatar:"man",avatarColor:"var(--sevn-color-secondary)",description:"36,4% dos votos válidos"},{position:"3º lugar",name:"Candidato C",tag:"GHI",tagColor:"#1e4d6b",avatar:"man",avatarColor:"#1e4d6b",description:"21,8% dos votos válidos"},{position:"4º lugar",name:"Candidato D",tag:"JKL",tagColor:"#0f172a",avatar:"man",avatarColor:"#0f172a",description:"8,4% dos votos válidos"},{position:"5º lugar",name:"Candidato E",tag:"MNO",tagColor:"#16a34a",avatar:"man",avatarColor:"#16a34a",description:"3,2% dos votos válidos"},{position:"6º lugar",name:"Candidato F",tag:"PQR",tagColor:"#e11d48",avatar:"man",avatarColor:"#e11d48",description:"1,7% dos votos válidos"}],h=O(()=>!n()&&v(s)?.snapshots&&Array.isArray(v(s).snapshots)?v(s).snapshots[v(s).snapshots.length-1]:null),p=O(()=>n()?c:!v(h)?.results?.length||!v(s)?.candidates_meta||!Array.isArray(v(s).candidates_meta)?[]:[...v(h).results].sort((A,F)=>F.valid_votes_pct-A.valid_votes_pct).map((A,F)=>{const re=v(s).candidates_meta.find(Ke=>Ke.candidate_id===A.candidate_id);return{position:Vs(A.position,F),name:re?.name?po(re.name):"Unknown",photoUrl:re?.photo_url,tag:re?.party_abbr||"",tagColor:re?.party_color||"var(--sevn-color-primary)",avatar:"man",avatarColor:re?.party_color||"var(--sevn-color-primary)",description:`${A.valid_votes_pct}% dos votos válidos`}})),u=O(()=>v(h)?.ballots_counted_pct||0),g=O(()=>n()?"X% das urnas apuradas":v(u)?`${v(u)}% das urnas apuradas`:""),d=O(()=>i().description??v(g));var w=mo();let _;var N=S(w);io(N,{get title(){return i().title},get description(){return v(d)},get tag(){return i().tag},get tagColor(){return i().tagColor}});var m=Y(N,2);{var X=x=>{var A=go();q(x,A)},j=x=>{var A=_o(),F=S(A);P(()=>ne(F,v(l))),q(x,A)},D=x=>{$s(x,{get candidates(){return v(p)},itemsPerPage:3})};V(m,x=>{v(o)?x(X):v(l)?x(j,1):x(D,!1)})}P(()=>_=Qe(w,1,"sevn_candidate_ranking svelte-1jldgqf",null,_,{"sevn_candidate_ranking--raw":r()})),q(e,w),An()}const xa=gs(yo,"CandidateRanking");return typeof window<"u"&&(window.SevnElections=Object.assign(window.SevnElections||{},{Core:Oa,CandidateRanking:xa}),ms()),xa}));