1import{D as e,E as t,Et as l,G as a,Gt as o,J as s,Lt as n,N as r,Nt as i,St as u,Tt as c,_ as d,fn as g,hn as m,it as p,mn as f,q as b,vt as v,w}from"./B8XHxhss.js";import{H as h,It as y,Pt as _,_ as x,k as E}from"#entry";import{t as C}from"./DXNx4Ry-.js";import{t as S}from"./tKPW4sCS.js";import{t as T}from"./BHxXZfbq2.js";var j=Object.assign({inheritAttrs:!1},{__name:"ToggleButton",props:b({color:{type:String,default:""}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const a=v(t,"modelValue");return(n,r)=>(p(),e("div",s({class:["c-toggle-button",{[`c-toggle-button--color--${t.color}`]:t.color}]},("useAttrsSome"in n?n.useAttrsSome:o(S))(["class","style","data-n-ids"],n.$attrs)),[w("div",{class:g(["group relative w-full h-full rounded-full p-4 cursor-pointer",[!t.color&&"before:content-[''] before:absolute before:inset-0 before:transition-colors before:duration-200 before:rounded-full hover:before:bg-opacity-50",a.value?"before:bg-onIndentActive":"before:bg-onIndent"]])},[l(w("input",s({"onUpdate:modelValue":r[0]||(r[0]=e=>a.value=e),type:"checkbox",class:"appearance-none absolute inset-0 w-full h-full"},("useAttrsExcept"in n?n.useAttrsExcept:o(E))(["class","style","data-n-ids"],n.$attrs)),null,16),[[y,a.value]]),r[1]||(r[1]=w("div",{class:"c-toggle-button__pill relative w-auto h-full aspect-ratio-1 bg-bgCurrent border border-extraStrong rounded-full"},null,-1))],2)],16))}}),k={class:"sr-only"},z=["aria-hidden","inert"],A={class:"pl-4xs"},O={__name:"ClimateToggle",setup(l){const b=h(),v=n(!!b.value),y=n({}),E=n({}),S=n(null),O=n(0),B=n(!a("climateButtonStartsOpen",!0));T("scroll",V),T("resize",V),u(B,()=>{O.value=0}),u(v,e=>{if(!!e!=!!b.value&&S.value){const{left:t,top:l,width:a,height:o}=(document.getElementById("climate-toggle")||S.value).getBoundingClientRect();Object.assign(y.value,{backgroundColor:getComputedStyle(document.documentElement).backgroundColor,"--origin-x":Math.round((t+a/2)/window.innerWidth*1e4)/100+"%","--origin-y":Math.round((l+o/2)/window.innerHeight*1e4)/100+"%"}),setTimeout(()=>{b.value=e},200)}});let I=0;function V(){const e=I;({scrollY:I}=window);const t=Math.abs(I-e);O.value=Math.min(O.value+t,I),O.value>.8*window.innerHeight&&(B.value=!0)}function M(){B.value&&(B.value=!1)}return(l,a)=>{const n=C,u=j;return p(),e(d,null,[r(_,{name:"t-climate-toggle__screen-cover"},{default:c(()=>[o(v)!==o(b)?(p(),e("div",{key:0,class:"c-climate-toggle__screen-cover",style:f(o(y))},null,4)):t("",!0)]),_:1}),w("div",s({ref_key:"$el",ref:S,class:["c-climate-toggle",{"c-climate-toggle--has-scrolled":o(B)}]},l.$attrs),[w("div",{class:g(["c-climate-toggle__wrap relative grid items-center w-fit p-4xs bg-secondary text-strong text-body-sm-strong rounded-full pointer-events-auto transition-colors duration-300",[!o(B)&&">=656:justify-end 656:w-fit 656:pr-28"]]),style:f(o(E))},[r(n,{name:"eco",class:"w-24 h-24 >=656:w-48 656:h-48"}),o(B)?(p(),e("button",{key:0,class:"absolute left-0 top-0 h-full w-auto aspect-ratio-1 z-10",onClick:M},[w("span",k,m(("localize"in l?l.localize:o(x))("OPEN_CLIMATE_BUTTON",{capitalize:!0})),1)])):t("",!0),w("label",{class:g(["ml-auto cursor-pointer inline-flex justify-between items-center gap-4xs w-max max-w-[calc(100cqw-64px)] transition-opacity duration-200",{"opacity-0 invisible":o(B),"delay-100":!o(B)}]),"aria-hidden":o(B)?"true":null,inert:o(B)?"true":null},[w("span",A,m(("localize"in l?l.localize:o(x))("REDUCE_SITES_CARBON_FOOTPRING",{capitalize:!0})),1),r(u,{id:"climate-toggle",modelValue:o(v),"onUpdate:modelValue":a[0]||(a[0]=e=>i(v)?v.value=e:null),name:"climate-mode","data-focus":".c-climate-toggle__wrap",class:"transition-colors duration-300"},null,8,["modelValue"])],10,z)],6)],16)],64)}}};export{O as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.