1"use strict";(self.webpackChunksimplified_web=self.webpackChunksimplified_web||[]).push([[508],{810508:(o,e,n)=>{n.r(e),n.d(e,{default:()=>r});var i=n(683017),t=n(270858),l=n(104399),s=n(90583),d=n(764293),u=n(408499),v=n(228993);const r=()=>{const{t:o}=(0,u.$)(["common"]),[e,n]=(0,i.useState)([]),[r,a]=(0,i.useState)(()=>Date.now()),c=(0,d.v9)(o=>null===o||void 0===o?void 0:o.auth),_=(0,d.v9)(o=>null===o||void 0===o?void 0:o.apps),m=(0,i.useRef)(null),[f,p]=(0,l.useLocalStorage)("maintenance_banner_snooze"),[h,w]=(0,l.useLocalStorage)("promotional_banner_version","0"),b=(0,i.useMemo)(()=>null===e||void 0===e?void 0:e.find(o=>"maintenance"===(null===o||void 0===o?void 0:o.id)),[e]),g=(0,i.useMemo)(()=>null===e||void 0===e?void 0:e.find(o=>"promotional"===(null===o||void 0===o?void 0:o.id)),[e]),S=(0,i.useMemo)(()=>{const o=null===b||void 0===b?void 0:b.starts_at,e=null===b||void 0===b?void 0:b.ends_at;return!(o&&r<new Date(o).getTime())&&!(e&&r>new Date(e).getTime())},[null===b||void 0===b?void 0:b.starts_at,null===b||void 0===b?void 0:b.ends_at,r]),y=(0,i.useMemo)(()=>{var o;return(null===f||void 0===f?void 0:f.version)===(null===b||void 0===b?void 0:b.version)&&r<(null!==(o=null===f||void 0===f?void 0:f.until)&&void 0!==o?o:0)},[null===f||void 0===f?void 0:f.version,null===f||void 0===f?void 0:f.until,null===b||void 0===b?void 0:b.version,r]),T=(0,i.useMemo)(()=>"active"===(null===b||void 0===b?void 0:b.status)&&S&&!y,[null===b||void 0===b?void 0:b.status,S,y]),x=(0,i.useMemo)(()=>!T&&"active"===(null===g||void 0===g?void 0:g.status)&&(null===g||void 0===g?void 0:g.version)!==h,[T,null===g||void 0===g?void 0:g.status,null===g||void 0===g?void 0:g.version,h]),C=(0,i.useCallback)(()=>{var o;const e=null!==(o=null===b||void 0===b?void 0:b.snooze_hours)&&void 0!==o?o:1;p({version:null===b||void 0===b?void 0:b.version,until:Date.now()+60*e*60*1e3})},[null===b||void 0===b?void 0:b.version,null===b||void 0===b?void 0:b.snooze_hours,p]),D=(0,i.useCallback)(async()=>{try{const o=await fetch(l.SIMPLIFIED_BANNERS_JSON);if(o.status===l.HTTP_STATUS_SUCCESS_200){const e=await o.json();n(e)}}catch(o){console.error(o)}},[n]);(0,i.useEffect)(()=>{null!==c&&void 0!==c&&c.isAuthenticated&&D()},[null===c||void 0===c?void 0:c.isAuthenticated,D]),(0,i.useEffect)(()=>{const o=[null===f||void 0===f?void 0:f.until,(null===b||void 0===b?void 0:b.starts_at)&&new Date(b.starts_at).getTime(),(null===b||void 0===b?void 0:b.ends_at)&&new Date(b.ends_at).getTime()].filter(o=>"number"===typeof o&&o>r).sort((o,e)=>o-e)[0];if(!o)return;const e=setTimeout(()=>a(Date.now()),o-r);return()=>clearTimeout(e)},[null===f||void 0===f?void 0:f.until,null===b||void 0===b?void 0:b.starts_at,null===b||void 0===b?void 0:b.ends_at,r]);const E=T||x;return(0,i.useEffect)(()=>{const o=document.documentElement,e=m.current;if(!E||!e)return void o.style.setProperty("--banner-height","0px");const n=new ResizeObserver(()=>o.style.setProperty("--banner-height",`${e.offsetHeight}px`));return n.observe(e),()=>{n.disconnect(),o.style.setProperty("--banner-height","0px")}},[E]),E?(0,v.jsxs)(t.x,{ref:m,position:"fixed",top:0,left:0,zIndex:"overlay",w:"full",bgColor:"base_level_1",children:[(0,v.jsx)(s.uqq,{show:T,data:b,translations:{snooze_label:o("banners.remind_me_later",{ns:"common",defaultValue:"Remind me later"})},onClose:C}),(0,v.jsx)(s.aYn,{show:x,apps:_,auth:c,translations:{no_owner_error_description:o("ai_quota_progress.contact_owner",{ns:"billing"}),no_owner_error_title:o("error",{ns:"common"})},data:g,onClose:()=>w(null===g||void 0===g?void 0:g.version)})]}):null}}}]); 2//# sourceMappingURL=508.179f3caf.chunk.js.map
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.