/**!
 * IMPORTANT NOTE:
 *    This file is licensed only for use in providing the iCloud
 *    service or any part thereof, and is subject to the iCloud
 *    Terms and Conditions. You may not port this file to another
 *    platform without Apple's written consent.
 *
 *    Portions of this Apple Software may utilize copyrighted material under open source licenses.
 *    Please see the file at https://www.icloud.com/system/icloud.com/2602Build17/en-us/acknowledgements.txt for licensing information.
 */
!function(e){const t="object"==typeof globalThis&&globalThis||"object"==typeof window&&window||"object"==typeof self&&self;try{const{performance:o,Promise:n,MessageChannel:s,requestAnimationFrame:r}=t;if(!(o&&o.mark&&n&&s&&r))return;const a=t=>o.mark("chunk-"+e+"-"+t);let c=!1,f=!1,i=n.resolve();a("exec-start");for(let e=0;e<5;e++)i=i.then();i.then((()=>{a("exec-sync-end")}));if("undefined"!=typeof window){let e=()=>{c&&!f&&(a("after-paint"),f=!0)},t=new s;t.port1.onmessage=e,t.port2.postMessage(null),setTimeout(e),r((()=>{c=!0,a("raf"),t.port2.postMessage(null),setTimeout(e)}))}}catch(e){t.__jsPerformanceMarksError=e}}("2.main");/*! For license information please see 2.main.js.LICENSE.txt */
(window.__LOADABLE_LOADED_CHUNKS__=window.__LOADABLE_LOADED_CHUNKS__||[]).push([[2],{1609:function(e,t,a){"use strict";a.r(t),a.d(t,"default",(function(){return i}));var n=a(935),r=a(1610);function i(e){return n.createElement(r.a,e)}},1610:function(e,t,a){"use strict";a.d(t,"a",(function(){return L}));var n=a(935),r=a(2256),i=(a(1611),a(2293)),c=a(2292),l=a(1641),o=a(1691),s=a(2244),d=a(1643),u=a(1333),m=a(1208),p=a(1265),v=a(1644),g=a(1185),b=a(2296),h=a(986),f=a(985),E=a(2238),y=a(1442),O=a(2160),j=a(1451),S=a(2139),N=a(2294);function P(){return P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},P.apply(null,arguments)}const w=Object(y.a)({resolved:{},chunkName:()=>"Routes-HomePageRoute",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!!a.m[t]},importAsync:()=>Object(j.a)((()=>Promise.all([a.e(4),a.e(1)]).then(a.bind(null,2147)))),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then((e=>(this.resolved[t]=!0,e)))},requireSync(e){const t=this.resolve(e);return a(t)},resolve:()=>2147}),C=Object(y.a)({resolved:{},chunkName:()=>"Routes-LegacyShareAcceptanceRoute",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!!a.m[t]},importAsync:()=>Object(j.a)((()=>Promise.all([a.e(8),a.e(12)]).then(a.bind(null,2088)))),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then((e=>(this.resolved[t]=!0,e)))},requireSync(e){const t=this.resolve(e);return a(t)},resolve:()=>2088}),D=Object(y.a)({resolved:{},chunkName:()=>"Routes-CKShareAcceptanceRoute",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!!a.m[t]},importAsync:()=>Object(j.a)((()=>Promise.all([a.e(8),a.e(13)]).then(a.bind(null,2093)))),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then((e=>(this.resolved[t]=!0,e)))},requireSync(e){const t=this.resolve(e);return a(t)},resolve:()=>2093}),T=Object(y.a)({resolved:{},chunkName:()=>"Routes-UnauthedShareRoute",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!!a.m[t]},importAsync:()=>Object(j.a)((()=>a.e(9).then(a.bind(null,2094)))),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then((e=>(this.resolved[t]=!0,e)))},requireSync(e){const t=this.resolve(e);return a(t)},resolve:()=>2094}),I=Object(y.a)({resolved:{},chunkName:()=>"Routes-CalendarEventReplyRoute",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!!a.m[t]},importAsync:()=>Object(j.a)((()=>a.e(5).then(a.bind(null,2153)))),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then((e=>(this.resolved[t]=!0,e)))},requireSync(e){const t=this.resolve(e);return a(t)},resolve:()=>2153});function A(e){var t;const a=e.rootState,r=null===(t=Object(u.b)())||void 0===t||null===(t=t.details)||void 0===t||null===(t=t.beneficiaryInfo)||void 0===t?void 0:t.isBeneficiary;switch(n.useLayoutEffect((()=>{"child-application"===a.kind?document.body.classList.add("disable-scroll"):document.body.classList.remove("disable-scroll")}),[a]),a.kind){case"load-child-application-adp-blocked":return n.createElement(c.a,{className:e.className,applicationIdentifier:a.applicationIdentifier,pcsKeyIdentifier:a.pcsKeyIdentifier,onComplete:a.onComplete});case"load-child-application":return n.createElement(i.a,{className:e.className,applicationIdentifier:a.applicationIdentifier,hadError:a.hadError});case"unauthed-share":return n.createElement(T,{onSignInPressed:a.onSignInPressed,shareRecord:a.shareRecord,className:e.className,fallback:n.createElement(N.a,null)});case"redirect-to-domain":return n.createElement(S.i,{className:e.className,pageProps:a.pageProps});case"springboard":return n.createElement(w,{initiallyInCustomizeMode:a.initiallyInCustomizeMode,className:e.className});case"ck-share-acceptance":return n.createElement(D,{className:e.className,ckShareRecord:a.ckShareRecord,isAuthenticated:a.isAuthenticated,onSignInPressed:a.onSignInPressed,fallback:n.createElement(N.a,null)});case"share-acceptance":return n.createElement(C,{className:e.className,shareRecord:a.shareRecord,isAuthenticated:a.isAuthenticated,fallback:n.createElement(N.a,null)});case"share-acceptance-error":return n.createElement(S.k,P({className:e.className},a));case"ck-reminders-template":return n.createElement(S.b,{className:e.className,pageProps:a.remindersTemplatePageProps});case"mail-email-view":return n.createElement(S.f,{threadId:a.threadId});case"calendar-event-view":return n.createElement(S.c,{eventId:a.eventId,collectionId:a.collectionId});case"calendar-event-reply":return n.createElement(I,{className:e.className,isAuthenticated:a.isAuthenticated,details:a.details,fallback:n.createElement(N.a,null)});case"mail-drop":return n.createElement(S.e,{className:e.className,isAuthenticated:a.isAuthenticated,details:a.details});case"terms-and-conditions":return n.createElement(S.n,{className:e.className,pageProps:a.pageProps});case"terms-and-conditions-confirmation":return n.createElement(S.m,{wasTermsUpdatePerformed:a.wasTermsUpdatePerformed,onDismiss:a.onDismiss});case p.b.plan:return n.createElement(S.g,{className:e.className,isBeneficiary:r});case p.b.storage:return n.createElement(S.l,{className:e.className,isBeneficiary:r});case p.b.recovery:return n.createElement(S.h,{className:e.className});case p.b.icloudplus:return n.createElement(S.d,{className:e.className});case p.b.settings:return n.createElement(S.j,{className:e.className});case"web-access-blocked":return n.createElement(S.p,{className:e.className,onComplete:a.onComplete});case"account-maintenance":return n.createElement(S.a,{className:e.className});case"waiting-for-pcs-keys":return n.createElement(S.o,{className:e.className});default:return null}}function L(e){Object(d.a)(!!e.hasChildApplicationWithUnsavedChanges);const t=n.useRef(null),a=n.useRef();"home-login"===e.rootState.kind&&(a.current||(a.current=e.homeLoginProps));const i=n.useRef([]),[c]=n.useState((()=>document.getElementById("early-child"))),[u]=n.useState((()=>c?n.createElement("iframe",{id:"early-child",src:c.src,className:c.className,"data-name":c.getAttribute("data-name")}):null)),[y]=n.useState(c?"initial-load-with-early-child":"initial-load");n.useEffect((()=>()=>{null===c||void 0===c||c.__data.onHydrate()}),[c]);const j=n.useRef(1),S=n.useRef({kind:y}),[N,P]=n.useState(null);if(L=S.current,k=e.rootState,L.kind!==k.kind||"child-application"===L.kind&&"child-application"===k.kind&&L.applicationIdentifier!==k.applicationIdentifier){var w,C,D;if(null!==(w=e.hideChildApplicationRef)&&void 0!==w&&w.current){if((null===S||void 0===S?void 0:S.current.kind)===p.b.icloudplus)null===(C=(D=e.hideChildApplicationRef).current)||void 0===C||C.call(D);else if((null===S||void 0===S?void 0:S.current.kind)===p.b.recovery&&e.rootState.kind!==p.b.icloudplus){var T,I;null===(T=(I=e.hideChildApplicationRef).current)||void 0===T||T.call(I)}}else document.querySelectorAll("ui-pane, ui-pane-backdrop").forEach((e=>{e.classList.add("hide")}));if(P({content:n.createElement(A,{key:j.current,rootState:S.current,className:"fade-out"}),state:S.current}),++j.current,S.current.kind===y&&e.rootState.kind!==y&&"springboard"!==e.rootState.kind){const t=O.e.value,a=e.rootState.kind,n={source:a};switch(n.statCategory=t?h.a.USER:h.a.SESSION,n.__allow_user=!0,a){case"load-child-application":n.childName=e.rootState.applicationIdentifier;break;case"plan":n.hasCid=!!E.a.sharedInstance.applicationParameter.url.searchParams.get("cid")}f.a.withEventAndLabel("load","deeplink",n).record()}}var L,k;S.current=e.rootState,n.useEffect((()=>{const a=t.current;if(!a)return;const n=[],r=[];for(const t of i.current)e.remoteViewControllers.includes(t)||n.push(t);for(const t of e.remoteViewControllers)i.current.includes(t)||r.push(t);i.current=[...e.remoteViewControllers];for(const e of r){const t=e.iframe;"early-child"!==t.id&&a.appendChild(t),e.isConnected=!0}for(const e of n){const t=e.iframe;a.removeChild(t),e.isConnected=!1}const c="child-application"===e.rootState.kind?e.rootState.applicationIdentifier:null,l="child-application"===(null===N||void 0===N?void 0:N.state.kind)?N.state.applicationIdentifier:null;for(const e of i.current)e.controller.applicationConfiguration.identifier===c?(e.iframe.classList.add("fade-in"),e.iframe.classList.remove("fade-out"),e.iframe.removeAttribute("aria-hidden")):e.controller.applicationConfiguration.identifier===l?(e.iframe.classList.add("fade-out"),e.iframe.classList.remove("fade-in"),e.iframe.setAttribute("aria-hidden","")):(e.iframe.classList.remove("fade-in"),e.iframe.classList.remove("fade-out"),e.iframe.setAttribute("aria-hidden",""))}));const R=e.remoteViewControllers.some((e=>e.controller.applicationConfiguration.identifier===g.b.identifier));return n.useEffect((()=>{N&&setTimeout((()=>{P(null)}),800)}),[N]),n.createElement(n.Fragment,null,n.createElement(l.a,null,n.createElement("div",{className:"root-viewport"},n.createElement(s.a,{to:e.notificationElement}),n.createElement("div",{className:"init-spinner-container",suppressHydrationWarning:!0},n.createElement(r.a,{description:Object(m.a)("CloudOS.Spinner.Loading")})),e.bannerData&&n.createElement(b.a,{bannerData:e.bannerData}),R&&n.createElement(v.a,null),n.createElement("div",{className:"root-component",ref:t},u,null===N||void 0===N?void 0:N.content,n.createElement(A,{key:j.current,className:"fade-in",rootState:e.rootState}),n.createElement(o.a,{loginProps:a.current,rootState:e.rootState})))))}},1611:function(e,t,a){},1614:function(e,t,a){"use strict";function n(e,t){let a=e.x,n=t.height-e.y-e.height;const r=Math.min(e.width,e.height),i=r,c=r;return e.width>e.height?a+=(e.width-e.height)/2:e.height>e.width&&(n+=(e.height-e.width)/2),{top:n,left:a,width:i,height:c}}function r(e,t){return{x:Math.round(e.left),y:Math.round(t.height-e.top-e.height),width:Math.round(e.width),height:Math.round(e.height)}}a.d(t,"a",(function(){return n})),a.d(t,"b",(function(){return r}))},1619:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a(935),r=a(2211);function i(e){const[t,a]=n.useState(!1);n.useEffect((()=>{a(r.a.sharedInstance.hasPCSKey(e))}),[e]);const i=n.useCallback(((t,n)=>{n===e&&a(!0)}),[e]);return n.useEffect((()=>(r.a.sharedInstance.addListener(i),()=>{r.a.sharedInstance.removeListener(i)})),[i]),t}},1622:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(935);function r(e){const t=n.useRef(null);return n.useLayoutEffect((()=>{e.forEach((e=>{let[a,n,r]=e;const i=t.current;i&&("set"===a?i.setAttribute(n,null!==r&&void 0!==r?r:""):"remove"===a&&i.removeAttribute(n))}))}),[e]),t}},1627:function(e,t,a){"use strict";a.d(t,"b",(function(){return r})),a.d(t,"a",(function(){return i}));var n=a(1208);const r=e=>{switch(e){case"key":case"numbers":case"pages":return{width:36,height:40,viewBox:"0 0 18 20"};case"pptx":case"ppt":case"xlsx":case"xls":case"xlam":case"docx":case"doc":return{width:40,height:40,viewBox:"0 0 20 20"};case"jpg":case"jpeg":case"png":case"gif":case"tiff":case"tif":case"bmp":return{width:48,height:36,viewBox:"0 0 24 18"};case"aac":case"wav":case"m4a":case"m4p":case"aiff":case"midi":case"wave":case"mp3":return{width:36,height:40,viewBox:"0 0 22 24"};case"mp4":case"m4v":case"mov":return{width:44,height:36,viewBox:"0 0 22 18"};default:return{width:32,height:40,viewBox:"0 0 16 20"}}},i=e=>{switch(e){case"key":return Object(n.a)("Drive.Icon.Description.Key");case"numbers":return Object(n.a)("Drive.Icon.Description.Numbers");case"pages":return Object(n.a)("Drive.Icon.Description.Pages");case"pptx":case"ppt":return Object(n.a)("Drive.Icon.Description.PowerPoint");case"xlsx":case"xls":case"xlam":return Object(n.a)("Drive.Icon.Description.Excel");case"docx":case"doc":return Object(n.a)("Drive.Icon.Description.Word");case"jpg":case"jpeg":case"png":case"gif":case"tiff":case"tif":case"bmp":return Object(n.a)("Drive.Icon.Description.Image",{fileExtension:e.toUpperCase()});case"aac":case"wav":case"m4a":case"m4p":case"aiff":case"midi":case"wave":case"mp3":return Object(n.a)("Drive.Icon.Description.Audio",{fileExtension:e.toUpperCase()});case"mp4":case"m4v":case"mov":return Object(n.a)("Drive.Icon.Description.Video",{fileExtension:e.toUpperCase()});case"zip":return Object(n.a)("Drive.Icon.Description.Archive");case"pdf":return Object(n.a)("Drive.Icon.Description.Pdf");case"folder":return Object(n.a)("ShareAcceptancePage.User.Description.Folder.Name");default:return e||Object(n.a)("Drive.Icon.Description.Default")}}},1632:function(e,t,a){"use strict";a.d(t,"a",(function(){return o})),a.d(t,"b",(function(){return s}));var n=a(954);let r=function(e){return e.Safari="SAFARI",e.Mail="MAIL",e.News="APPLE_NEWS",e.OnDemand="ON_DEMAND",e.InApp="IN_APP",e}({});const i=n.z.object({anonymousId:n.z.string(),domain:n.z.string().optional(),forwardToEmail:n.z.string().optional(),hme:n.z.string(),isActive:n.z.boolean(),recipientMailId:n.z.string().optional(),label:n.z.string().optional(),origin:n.z.nativeEnum(r)}),c=n.z.object({forwardToEmails:n.z.array(n.z.string()),hmeEmails:n.z.array(i),selectedForwardTo:n.z.string().optional()}),l=n.z.object({errorCode:n.z.string(),errorMessage:n.z.string(),retryAfter:n.z.number().optional()}),o=n.z.object({success:n.z.boolean(),timestamp:n.z.number(),error:l.optional()}),s=o.merge(n.z.object({result:c.optional()}))},1633:function(e,t,a){"use strict";a.d(t,"a",(function(){return l})),a.d(t,"b",(function(){return o}));var n=a(1634),r=a(1208),i=a(955),c=a(2160);function l(e){var t;return(null===(t=c.h.value)||void 0===t||null===(t=t.details)||void 0===t?void 0:t.accountType)!==i.a.HSA2&&!e}function o(e){if(l(e.success))return[];var t;if(!e.success||!e.result)throw new Error((null===e||void 0===e||null===(t=e.error)||void 0===t?void 0:t.errorMessage)||"hide my email api returns error");return e.result.domains.map((e=>e.status===n.a.InProgress?Object(r.a)("CustomEmailDomainTile.Status.InProgress",{domain:e.name}):e.name))}},1634:function(e,t,a){"use strict";a.d(t,"a",(function(){return i})),a.d(t,"b",(function(){return d}));var n=a(954),r=a(1632);let i=function(e){return e.InProgress="IN_PROGRESS",e.EmailNotSelected="DEFAULT_EMAIL_NOT_SELECTED",e.Complete="COMPLETE",e}({});var c=function(e){return e.NotStarted="NOT_STARTED",e.InProgress="IN_PROGRESS",e.Success="SUCCESS",e.Failed="FAILED",e}(c||{}),l=function(e){return e.NotStarted="NOT_STARTED",e.InProgress="VERIFICATION_IN_PROGRESS",e.Success="VERIFICATION_SUCCESS",e.Failed="VERIFICATION_FAILED",e}(l||{});const o=n.z.object({name:n.z.string(),owner:n.z.object({dsid:n.z.string(),firstName:n.z.string(),lastName:n.z.string()}),isShared:n.z.boolean(),isOwner:n.z.boolean(),status:n.z.nativeEnum(i),transferTimestamp:n.z.number().optional(),dnsRecordsGenerated:n.z.boolean().optional(),dnsProviderName:n.z.string().optional(),isDomainConnect:n.z.boolean().optional(),applyTemplateUrl:n.z.string().optional(),verificationStatus:n.z.nativeEnum(c).optional(),catchAllEnabled:n.z.boolean().optional(),isEmailImportSupported:n.z.boolean().optional(),reverificationStatus:n.z.nativeEnum(l).optional()}),s=n.z.object({domains:n.z.array(o),maxDomainsAllowed:n.z.number()}),d=r.a.merge(n.z.object({result:s.optional()}))},1636:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));var n=a(1637),r=a(2260),i=a(1437),c=a(1638);function l(e,t){return Object(n.a)(),Object(c.a)({...t,endpoint:r.b.photosLibraryInfo,cacheKeys:[e],fetchProvider:t=>Object(i.c)(t,e)})}},1637:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var n=a(935),r=a(1143),i=a(1333),c=a(2248),l=a(1436),o=a(2245);function s(){const e=Object(i.a)();if(!e)throw new Error("usePhotosTile() needs a dsid!");const t=e.dsid;n.useEffect((()=>r.configure({user:{dsid:t},fetch:c.a,urlForServiceName:o.j,telemetry:Object(l.a)("photos")})),[t])}},1638:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var n=a(1487);const r=6e4,i=()=>"hidden"===document.visibilityState;function c(e){let{endpoint:t,fetchProvider:a,pageActiveFetchInterval:c=3*r,pageHiddenFetchInterval:l=30*r,cacheKeys:o,...s}=e;return Object(n.a)({...s,endpoint:t,cacheKeys:o,fetchProvider:a,refetchInterval:i()?c:l,refetchIntervalInBackground:!0})}},1639:function(e,t,a){"use strict";a.d(t,"a",(function(){return i})),a.d(t,"b",(function(){return c}));var n=a(1208),r=a(1143);function i(e){switch(e){case r.PhotosTileAssetListType.Library:return Object(n.a)("PhotosHomeTile.TileCustomization.Library.Name");case r.PhotosTileAssetListType.Favorites:return Object(n.a)("PhotosHomeTile.TileCustomization.Favorites.Name");case r.PhotosTileAssetListType.Recents:return Object(n.a)("PhotosHomeTile.TileCustomization.Recents.Name");default:return e}}function c(e,t){if(void 0===(null===e||void 0===e?void 0:e.breakdown)){var a;const r=Object(n.b)({zero:"Media.Count.Total.Zero",one:"Media.Count.Total.One",two:"Media.Count.Total.Two",many:"Media.Count.Total.More"},null!==(a=null===e||void 0===e?void 0:e.itemsCount)&&void 0!==a?a:0);return t?Object(n.a)("Media.Count.WithListName",{count:r,selectedLibrary:i(t)}):r}const{photosCount:r=0,videosCount:c=0,othersCount:s=0}=(null===e||void 0===e?void 0:e.breakdown)||{},d={photosCount:o(r),videosCount:o(c),otherItemsCount:o(s)};let u=Object(n.a)(`Media.Count.${l(r)}.${l(c)}.${l(s)}.0`,d);for(let[,n]of Object.entries(d))u=u.replace(`${n} `,`${n}\xa0`);return t?Object(n.a)("Media.Count.WithListName",{count:u,selectedLibrary:i(t)}):u}const l=e=>e<3?String(e):"More",o=(e,t)=>Number(e).toLocaleString(t).replace(/ /g,"\xa0")},1641:function(e,t,a){"use strict";a.d(t,"a",(function(){return o})),a.d(t,"b",(function(){return s}));var n=a(935),r=a(1313),i=a(2156),c=a(1333);const l=n.createContext(void 0);function o(e){let{children:t}=e;const[a,o]=n.useState(),s=Object(c.d)();return n.useEffect((()=>{if(Object(r.c)())return;if(!s)return;let e=!0;return(async()=>{try{const t=Object(i.b)(),a=await(null===t||void 0===t?void 0:t.getAddressBookContacts());if(!a.ok||!a.value)return void(e&&o(new Map));const n=a.value.items;e&&o(function(e){const t=new Map;return e.forEach((e=>{e&&e.emailAddresses&&e.emailAddresses.forEach((a=>{a&&!t.has(a.field)&&t.set(a.field,e)}))})),t}(n))}catch(t){e&&o(new Map)}})(),()=>{e=!1}}),[s]),n.createElement(l.Provider,{value:{contacts:a}},t)}function s(){const e=n.useContext(l);if(void 0===e)throw new Error("`useContactsLookupService` must be used within a ContactsLookupProvider");return e}},1643:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));var n=a(935),r=a(1208),i=a(1229),c=a(1267);function l(e){n.useEffect((()=>{if(!e)return;const t=e=>{var t;const a=null===(t=c.a.sharedInstance.hasChildApplicationWithUnsavedChanges())||void 0===t?void 0:t.applicationConfiguration;if(!a)return;e.preventDefault();const n=Object(r.a)("CloudOS.UnsavedChanges.Alert.Description",{applicationName:Object(i.e)(a)});return e.returnValue=n,n};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}}),[e])}},1644:function(e,t,a){"use strict";a.d(t,"a",(function(){return l})),a(935);var n=a(1645),r=a(1403),i=a(1185),c=a(1690);function l(){const e=Object(n.useRecentDriveDocs)(Object(c.a)("app")),t=r.a.sharedInstance;return e.result&&t.setTileData(i.b.identifier,JSON.stringify(e.result)),t.switchDriveToAppMode=e.appIsLaunching,null}},1690:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a(1488),r=a(1421);const i=e=>{const t=Object(n.a)();return{mode:e,fetchRecents:e=>Object(r.i)({webServices:t},e),getChanges:(e,a)=>Object(r.j)({webServices:t},e,a)}}},1691:function(e,t,a){"use strict";a.d(t,"a",(function(){return m}));var n=a(935),r=a(1196),i=a.n(r),c=a(2309),l=a(1461),o=a(2149),s=a(2175),d=a(2266);function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},u.apply(null,arguments)}function m(e){let{loginProps:t,rootState:a}=e;if(!t)return null;const r="home-login"===a.kind;return n.createElement(c.a,{className:i()("home-login-route",{"fade-in":r,"fade-out":!r})},n.createElement(l.b,{value:l.a.LOGIN},n.createElement(o.a,null)),n.createElement(s.a,u({},t,{isLoginViewActive:r})),n.createElement("footer",null,n.createElement(d.a,null)))}},2139:function(e,t,a){"use strict";a.d(t,"o",(function(){return Di})),a.d(t,"a",(function(){return Ti})),a.d(t,"p",(function(){return Ii})),a.d(t,"j",(function(){return Ai})),a.d(t,"h",(function(){return Li})),a.d(t,"d",(function(){return ki})),a.d(t,"l",(function(){return Ri})),a.d(t,"g",(function(){return Fi})),a.d(t,"e",(function(){return Mi})),a.d(t,"k",(function(){return zi})),a.d(t,"b",(function(){return Bi})),a.d(t,"f",(function(){return xi})),a.d(t,"c",(function(){return Ui})),a.d(t,"i",(function(){return _i})),a.d(t,"m",(function(){return Wi})),a.d(t,"n",(function(){return Hi}));var n=a(2309),r=a(935),i=a.n(r),c=a(1196),l=a.n(c),o=a(1461),s=a(2149),d=a(2256),u=a(1208);const m=()=>{const e=Object(u.a)("EP.Loading.Message");return r.createElement("div",{className:"parent-container-loading"},r.createElement(d.a,{className:"ui-spinner-loading",description:Object(u.a)("CloudOS.Spinner.Loading")}),r.createElement("article",{className:"loading-screen-text"},e))};var p=a(2266),v=a(2316),g=a(2160),b=a(2201),h=a(1183);const f=e=>{let{className:t}=e;const a=function(){const e=Object(g.c)().maintenanceDuration,t=Object(u.a)("AccountMaintenance.Description"),a=e>0&&e<=18e5?Object(u.a)("AccountMaintenance.Description.ShortDuration"):e>18e5&&e<=36e5?Object(u.a)("AccountMaintenance.Description.MediumDuration"):e>36e5&&e<=432e5?Object(u.a)("AccountMaintenance.Description.LongDuration",{hours:Math.ceil(e/36e5)}):null;return a?t+" "+a:t}();return r.createElement("div",{className:l()("account-maintenance-page",t)},r.createElement("div",{className:"header-section"},r.createElement(v.a,{title:Object(u.a)("AccountMaintenance.Title")})),r.createElement("section",{className:"body-section description"},r.createElement("div",{className:"item-description"},a),r.createElement("div",{className:"learn-more-link"},r.createElement(b.a,{href:Object(h.a)("accountMaintenance"),useSemiboldArrow:!0,statName:"accountMaintenanceLearnMoreLink"},Object(u.a)("AccountMaintenance.LearnMore")))))};var E=a(2253),y=a(1066),O=a(1182),j=a(1490),S=a(966),N=a(1333),P=a(2198),w=a(954),C=a(985),D=a(2207),T=a(1039);const I=w.z.object({isWebAccessAllowed:w.z.boolean(),isWebAccessNotificationSent:w.z.boolean()});var A,L=a(1276),k=a(1270),R=a(1031),F=a(1356),M=function(e){return e.WEB_ACCESS_MANAGER="WebAccessManager",e}(M||{}),z=function(e){return e.WEB_ACCESS_BLOCKED_PAGE="Button Manage on device from web access blocked page",e}(z||{}),B=function(e){return e.NO_DEVICE="User has no iCDRS supported device.",e.NOTIFICATION_NOT_SENT_WEB_ACCESS="Web access notification not sent.",e.USER_DECLINED='User chose "Don\'t allow" from device.',e}(B||{});class x{constructor(e,t,a){this.stat=void 0,this.requestSource=t,this.requestReason=a,this.stat=new C.a(e).time()}reportSuccess(e,t){this.stat.end(),e<1||D.b.sharedInstance.recordStat(this.stat.success({requestSource:this.requestSource,requestReason:this.requestReason,requestCount:e,notificationsSentToDeviceCount:t}))}reportFailure(e,t,a,n){this.stat.end(),a<1||D.b.sharedInstance.recordStat(this.stat.failure({requestSource:this.requestSource,requestReason:this.requestReason,requestCount:a,notificationsSentToDeviceCount:n,failureReason:e,failureDescription:t}))}}const U=w.z.object({apsTopic:w.z.string(),isWebAccessAllowed:w.z.boolean(),clientIdThatRequestedNotification:w.z.string()});class _{_resetStat(){this._endTime=0,this._requestCount=0,this._notificationsSentToDeviceCount=0}constructor(){this._enableWebAccessStat=new x("enableWebAccess",M.WEB_ACCESS_MANAGER,z.WEB_ACCESS_BLOCKED_PAGE),this._endTime=0,this._requestCount=0,this._notificationsSentToDeviceCount=0,this.newWebAccessListeners=[],this.handlePush=e=>{if(e.data.topic!==F.a.hash)return;const t=e.data.payload;var a;if(a=t,U.safeParse(a).success&&"boolean"===typeof t.isWebAccessAllowed){for(const a of this.newWebAccessListeners)a(t.isWebAccessAllowed);this.newWebAccessListeners=[];const e=Object(R.i)();t.isWebAccessAllowed!==e&&(t.isWebAccessAllowed?Object(R.s)():window.location.reload())}},Object(k.b)(this.handlePush)}async enableWebAccess(e,t){var a,n;if(Object(R.i)())return Object(R.s)(),!0;null===t||void 0===t||null===(a=t.sentRequestToEnableWebAccess)||void 0===a||a.call(t),this._requestCount>0?++this._requestCount:(this._enableWebAccessStat=new x("enableWebAccess",M.WEB_ACCESS_MANAGER,z.WEB_ACCESS_BLOCKED_PAGE),this._requestCount=1,this._notificationsSentToDeviceCount=0);const r=await async function(){const e=`https://setup.${S.a.sharedInstance.current.servicesDomain}/setup/ws/1/enableWebAccess`;let t;try{t=await T.a.postURL(e)}catch{return{ok:!1}}if(!t||!t.ok)return{ok:!1};const a=await(async()=>{try{const a=await t.json();return e=a,I.safeParse(e).success?a:null}catch{return null}var e})();return a?{ok:!0,data:a}:{ok:!1}}();var i,c,l,o;if(null!==e&&void 0!==e&&e.current)return null===t||void 0===t||null===(i=t.canceledEnableWebAccess)||void 0===i||i.call(t),!1;if(!r.ok)return null===t||void 0===t||null===(c=t.receivedRequestToEnableWebAccesseFailure)||void 0===c||c.call(t),this._enableWebAccessStat.reportFailure("Error","enableWebAccess failed",this._requestCount,this._notificationsSentToDeviceCount),this._resetStat(),!1;if(Object(R.p)(r.data.isWebAccessAllowed),r.data.isWebAccessAllowed)return Object(R.s)(),this._enableWebAccessStat.reportSuccess(this._requestCount,this._notificationsSentToDeviceCount),this._resetStat(),null===t||void 0===t||null===(l=t.receivedRequestToEnableWebAccessNotificationGranted)||void 0===l||l.call(t),!0;if(!r.data.isWebAccessNotificationSent)return null===t||void 0===t||null===(o=t.receivedRequestToEnableWebAccesseFailure)||void 0===o||o.call(t),this._enableWebAccessStat.reportFailure("Error",B.NOTIFICATION_NOT_SENT_WEB_ACCESS,this._requestCount,this._notificationsSentToDeviceCount),this._resetStat(),!1;null===t||void 0===t||null===(n=t.receivedRequestToEnableWebAccessNotificationSent)||void 0===n||n.call(t),++this._notificationsSentToDeviceCount;let s=!1;const d=this._endTime>0,u=await Promise.race([new Promise((e=>{this.newWebAccessListeners.push((t=>{s=!0,e(t)}))})),new Promise((t=>{(async()=>{if(this._endTime=Date.now()+12e4,!d){for(;Date.now()<this._endTime;){if(await new Promise((e=>window.setTimeout((()=>e()),1e4))),s||null!==e&&void 0!==e&&e.current)return;const a=await Object(L.a)();if(s||null!==e&&void 0!==e&&e.current)return;a.ok&&a.data.isWebAccessAllowed&&(Object(R.p)(a.data.isWebAccessAllowed),Object(R.s)(),t("AlreadyWebAccessEnabled"))}t("Timeout")}})()}))]);var m,p,v,g;if(null!==e&&void 0!==e&&e.current)return null===t||void 0===t||null===(m=t.canceledEnableWebAccess)||void 0===m||m.call(t),!1;if("Timeout"===u)return this._enableWebAccessStat.reportFailure("Timeout","",this._requestCount,this._notificationsSentToDeviceCount),this._resetStat(),null===t||void 0===t||null===(p=t.receivedRequestToEnableWebAccessNotificationTimeout)||void 0===p||p.call(t),!1;if("AlreadyWebAccessEnabled"===u)return null===t||void 0===t||null===(v=t.receivedRequestToEnableWebAccessNotificationGranted)||void 0===v||v.call(t),this._enableWebAccessStat.reportSuccess(this._requestCount,this._notificationsSentToDeviceCount),this._resetStat(),!0;if(!u)return null===t||void 0===t||null===(g=t.receivedRequestToEnableWebAccesseNotificationDenied)||void 0===g||g.call(t),this._enableWebAccessStat.reportFailure("Error",B.USER_DECLINED,this._requestCount,this._notificationsSentToDeviceCount),this._resetStat(),!1;const b=await Object(L.a)();var h,f,E;return null!==e&&void 0!==e&&e.current?(null===t||void 0===t||null===(h=t.canceledEnableWebAccess)||void 0===h||h.call(t),!1):b.ok&&b.data.isWebAccessAllowed?(Object(R.p)(b.data.isWebAccessAllowed),this._enableWebAccessStat.reportSuccess(this._requestCount,this._notificationsSentToDeviceCount),this._resetStat(),null===t||void 0===t||null===(f=t.receivedRequestToEnableWebAccessNotificationGranted)||void 0===f||f.call(t),!0):(null===t||void 0===t||null===(E=t.receivedRequestToEnableWebAccesseNotificationDenied)||void 0===E||E.call(t),this._enableWebAccessStat.reportFailure("Error",B.USER_DECLINED,this._requestCount,this._notificationsSentToDeviceCount),this._resetStat(),!1)}}A=_,_.sharedInstance=new A;var W=a(1580),H=a(1352),V=a(1470),q=a(2186),G=function(e){return e[e.Init=0]="Init",e[e.Sending=1]="Sending",e[e.Failed=2]="Failed",e[e.Sent=3]="Sent",e[e.Granted=4]="Granted",e[e.Denied=5]="Denied",e[e.Timeout=6]="Timeout",e[e.Canceled=7]="Canceled",e}(G||{});const K=e=>{var t,a,n,i,c,o,s;let{className:d,onComplete:m}=e;const p=Object(q.a)(),[g,b]=Object(V.a)(G.Init,2e3);r.useEffect((()=>()=>{null===m||void 0===m||m()}),[m]);const h=Object(N.b)(),f=null!==(t=null===h||void 0===h||null===(a=h.details)||void 0===a?void 0:a.firstName)&&void 0!==t?t:"",w=null!==(n=null===h||void 0===h||null===(i=h.details)||void 0===i?void 0:i.lastName)&&void 0!==n?n:"",C=Object(j.a)(f,w),D=Object(j.a)(f,w,!0),T=S.a.sharedInstance.isDomainCN?Object(u.a)("CloudOS.AccountNeedsSetup.Domain.icloud.com.cn"):Object(u.a)("CloudOS.AccountNeedsSetup.Domain.icloud.com");if(null===h||void 0===h||null===(c=h.details)||void 0===c||null===(c=c.beneficiaryInfo)||void 0===c?void 0:c.isBeneficiary){const e=Object(y.a)(f),t=e?Object(u.a)("WebAccessBlocked.Greeting.Beneficiary.NameIsCJK",{firstName:C}):Object(u.a)("WebAccessBlocked.Greeting.Beneficiary",{firstName:C}),a=e?Object(u.a)("WebAccessBlocked.Title.Beneficiary.NameIsCJK",{firstName:f,currentDomain:T}):Object(u.a)("WebAccessBlocked.Title.Beneficiary",{firstName:f,currentDomain:T}),n=e?Object(u.a)("WebAccessBlocked.Description.Beneficiary.NameIsCJK",{firstName:f}):Object(u.a)("WebAccessBlocked.Description.Beneficiary",{firstName:f});return r.createElement("div",{className:l()("web-access-blocked-page",d)},r.createElement("div",{className:"header-section"},r.createElement(v.a,{title:t}),r.createElement(H.a,{className:"lock-image",width:64,height:60,layoutMode:"glyphBox"}),r.createElement("h1",null,a)),r.createElement("section",{className:"body-section description"},r.createElement("div",{className:"item-description"},n)))}const I=(null!==(o=null===h||void 0===h||null===(s=h.details)||void 0===s?void 0:s.ICDRSCapableDeviceCount)&&void 0!==o?o:0)<1,A=(new Date).getHours(),L=A<6?"WebAccessBlocked.Greeting.0-6":A<12?"WebAccessBlocked.Greeting.6-12":A<18?"WebAccessBlocked.Greeting.12-18":"WebAccessBlocked.Greeting.18-0",k=Object(u.a)(L,{firstName:C}),F=Object(R.f)(),M=F?Object(u.a)("WebAccessBlocked.Title.ADP"):Object(u.a)("WebAccessBlocked.Title"),z=F?Object(u.a)("WebAccessBlocked.Description.ADP",{currentDomain:T}):Object(u.a)("WebAccessBlocked.Description",{currentDomain:T});if(I)return r.createElement("div",{className:l()("web-access-blocked-page",d)},r.createElement("div",{className:"header-section"},r.createElement(v.a,{title:k}),r.createElement("h1",null,M)),r.createElement("section",{className:"body-section description"},r.createElement("div",{className:"item-description"},z)),r.createElement("section",{className:"no-device-section"},r.createElement("p",{className:"section-no-device"},r.createElement("span",null,Object(u.a)("ContinueOnDevice.NoDevice.IOS.Description")),r.createElement("br",null),r.createElement(O.a,{interpolations:{"#{chevron}":r.createElement(p,{layoutMode:"glyphBox",desiredFontSize:7})}},Object(u.a)("WebAccessBlocked.NoDevice.Description",{fullName:D}))),r.createElement("p",{className:"section-no-device"},r.createElement("span",null,Object(u.a)("ContinueOnDevice.NoDevice.Mac.Description")),r.createElement("br",null),r.createElement(O.a,{interpolations:{"#{chevron}":r.createElement(p,{layoutMode:"glyphBox",desiredFontSize:7})}},Object(u.a)("WebAccessBlocked.NoDevice.Description2",{fullName:D}))),r.createElement("p",{className:"section-no-device"},Object(u.a)("WebAccessBlocked.NoDevice.Notice"))),!F&&r.createElement("div",{className:"quick-access-container"},r.createElement(P.a,{manageDevicesHidden:!0})));const B=()=>{g!==G.Sending&&(async()=>{_.sharedInstance.enableWebAccess({current:!1},new class{sentRequestToEnableWebAccess(){b(G.Sending)}receivedRequestToEnableWebAccesseFailure(){b(G.Failed)}receivedRequestToEnableWebAccessNotificationSent(){b(G.Sent)}receivedRequestToEnableWebAccessNotificationGranted(){b(G.Granted)}receivedRequestToEnableWebAccesseNotificationDenied(){b(G.Denied)}receivedRequestToEnableWebAccessNotificationTimeout(){b(G.Timeout)}canceledEnableWebAccess(){b(G.Canceled)}})})()};switch(g){case G.Init:return r.createElement("div",{className:l()("web-access-blocked-page",d)},r.createElement("div",{className:"header-section"},r.createElement(v.a,{title:k}),r.createElement("h1",null,M)),r.createElement("section",{className:"body-section description init"},r.createElement("div",{className:"item-description"},z)),r.createElement("section",{className:"body-section"},r.createElement("div",{className:"buttons-row"},r.createElement(E.a,{onActivate:B,variant:"block primary large"},r.createElement(W.a,{"aria-hidden":!0,desiredFontSize:14,layoutMode:"glyphBox"}),"\xa0",Object(u.a)("WebAccessBlocked.ManageButton.Title"))),r.createElement("div",{className:"item-notice"},Object(u.a)("WebAccessBlocked.Notice")),!F&&r.createElement("div",{className:"quick-access-container"},r.createElement(P.a,{manageDevicesHidden:!0}))));case G.Sending:return r.createElement("div",{className:l()("web-access-blocked-page",d)},r.createElement("div",{className:"header-section"},r.createElement(v.a,{title:k}),r.createElement("h1",null,Object(u.a)("WebAccessBlocked.Title.Sending"))));case G.Failed:return r.createElement("div",{className:l()("web-access-blocked-page",d)},r.createElement("div",{className:"header-section"},r.createElement(v.a,{title:k}),r.createElement("h1",null,Object(u.a)("WebAccessBlocked.Title.Failed"))),r.createElement("section",{className:"body-section description"},r.createElement("div",{className:"item-description failed"},Object(u.a)("WebAccessBlocked.Description.Failed"))),r.createElement("section",{className:"body-section"},r.createElement("div",{className:"buttons-row"},r.createElement(E.a,{onActivate:B,variant:"push primary large"},Object(u.a)("WebAccessBlocked.ManageButton.Title.TryAgain")))));case G.Sent:case G.Granted:case G.Denied:case G.Timeout:case G.Canceled:return r.createElement("div",{className:l()("web-access-blocked-page",d)},r.createElement("div",{className:"header-section"},r.createElement(v.a,{title:k}),r.createElement("h1",null,Object(u.a)("WebAccessBlocked.Title.Sent"))),r.createElement("section",{className:"body-section description"},r.createElement("div",{className:"item-description"},Object(u.a)("WebAccessBlocked.Description.Sent"))),r.createElement("section",{className:"body-section"},r.createElement("div",{className:"item-description notice"},Object(u.a)("WebAccessBlocked.Notice.Sent")),r.createElement("div",{className:"buttons-row"},r.createElement(E.a,{onActivate:B,variant:"send-again"},Object(u.a)("WebAccessBlocked.ManageButton.Title.SendAgain")))),r.createElement("section",{className:"body-section footnote"},r.createElement(O.a,{interpolations:{"#{chevron}":r.createElement(p,{layoutMode:"glyphBox",desiredFontSize:7})}},Object(u.a)("WebAccessBlocked.Description2.Sent",{fullName:D}))))}};a(1611);var $=a(1332);const Z=()=>{var e;const t=Object($.c)(),a=Object(N.b)(),n=null===a||void 0===a||null===(e=a.details)||void 0===e||null===(e=e.beneficiaryInfo)||void 0===e?void 0:e.isBeneficiary;return t!==$.a.Plus&&t!==$.a.MAID&&!n};var Y=["styles"];function Q(){return Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},Q.apply(null,arguments)}var X=function(e){e.styles;var t=function(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;a[n]=e[n]}return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],-1===t.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}(e,Y);return i.a.createElement("svg",Q({viewBox:"0 0 18 24",xmlns:"http://www.w3.org/2000/svg"},t),i.a.createElement("path",{d:"M16.33 14.1c-.93-.87-1.41-1.95-1.42-3.26-.01-1.68.75-2.99 2.29-3.92-.86-1.23-2.16-1.91-3.88-2.04-.64-.05-1.41.08-2.33.41-.97.36-1.55.54-1.72.54-.23 0-.74-.15-1.55-.45-.81-.3-1.45-.45-1.95-.45-.9.01-1.75.25-2.52.71-.78.46-1.4 1.09-1.86 1.89C.8 8.5.5 9.69.5 11.06c0 1.2.22 2.44.66 3.72.41 1.18.93 2.22 1.57 3.12.59.84 1.09 1.43 1.48 1.78.62.58 1.24.85 1.86.83.41-.01.95-.15 1.61-.42.66-.27 1.28-.4 1.86-.4.55 0 1.16.13 1.81.4.66.27 1.22.4 1.69.4.65-.01 1.26-.28 1.82-.8.37-.32.84-.89 1.42-1.71a11.17 11.17 0 001.46-2.93c-.51-.24-.98-.55-1.41-.95zM12.32 3.28c.75-.89 1.12-1.84 1.12-2.87 0-.14-.01-.27-.02-.41-.52.03-1.07.18-1.66.47-.58.29-1.07.65-1.45 1.09-.76.86-1.19 1.91-1.19 2.9 0 .14.01.27.02.39 1.19.09 2.28-.52 3.18-1.57z"}))},J=a(2143),ee=a(1579);const te=e=>r.createElement("section",{"aria-label":"Breadcrumbs",className:"breadcrumbs"},r.createElement("ol",null,r.createElement("li",null,r.createElement("a",{href:"/",onClick:e=>{e.preventDefault(),e.stopPropagation(),J.a.cloudOSApplication.switchToSpringboard()}},r.createElement(X,{className:"apple-logo"}),Object(u.a)("Application.Title"))),r.createElement("li",null,r.createElement(ee.b,{"aria-hidden":!0,layoutMode:"glyphBox",desiredFontSize:8,className:"chevron"}),r.createElement("span",{"aria-current":"page"},e.currentPageName))));var ae=a(1065),ne=a(943),re=a(2258),ie=a(1483),ce=a(1618),le=a(1409),oe=a(1465),se=a(2250),de=a(951),ue=a(1236),me=a(1237),pe=a(1342),ve=a(986),ge=a(2182);const be=()=>{const{permissionState:e,userSubscription:t,subscribeToPushNotification:a,unsubscribeToPushNotifications:n,askUserPermission:i}=(()=>{const[e,t]=Object(r.useState)(),[a,n]=Object(r.useState)(!1),{permissionState:i,setPermissionState:c,notificationsEnabled:l}=Object(oe.a)("notifications");return Object(r.useEffect)((()=>{l()&&(n(!1),se.a.sharedInstance.getBrowserSubscription().then((e=>{t(e)})).catch((()=>t(null))))}),[l]),{permissionState:i,askUserPermission:async()=>{n(!1);const e=await se.a.sharedInstance.requestPermission();return c("default"===e?"prompt":e),e},subscribeToPushNotification:async()=>{let e;n(!1);try{if(e=await se.a.sharedInstance.createNotificationSubscription(),e.ok){const{value:a}=e;Object(me.a)("Subscription Created"),t(a)}return e}catch(a){const e=Object(ue.a)(a);return de.Result.failure(new Error(e))}},unsubscribeToPushNotifications:async()=>(n(!1),e&&e.unsubscribe().then((()=>(Object(me.a)("Subscription Removed"),t(null),!0))).catch((e=>{const t="Couldn't remove the subscription."+e;throw n(t),console.error(t),new Error(t)})),!1),userSubscription:e,error:a,notificationsEnabled:l}})(),[c,l]=r.useState(null),[o,s]=r.useState(!0),[d,m]=r.useState(!1),p=r.useRef(!1),v=r.useRef(!1),b=r.useRef({mailToggleValue:se.a.sharedInstance.pushEnabledApps.has(se.c.mail),calendarToggleValue:se.a.sharedInstance.pushEnabledApps.has(se.c.calendar)}),h=r.useRef(!1),f=Object(pe.a)(),E=r.useCallback((e=>{new C.a("pushNotification.showPushErrorModal",{statCategory:ve.a.SESSION,error:e}).record(),f({title:Object(u.a)("NotificationSettings.Error.UnableToSave.Title"),description:Object(u.a)("NotificationSettings.Error.UnableToSave.Description"),buttons:[{title:Object(u.a)("NotificationSettings.Error.UnableToSave.Acknowledge"),action:""}],onActionSelected:()=>{l(se.b.create_subscription_failed)}})}),[f]);r.useEffect((()=>{ge.b.isInitialized||ge.b.isReady.then((e=>{e.isOK&&(b.current={mailToggleValue:se.a.sharedInstance.pushEnabledApps.has(se.c.mail),calendarToggleValue:se.a.sharedInstance.pushEnabledApps.has(se.c.calendar)}),s(!1)}))}),[]);const y=()=>{var e,t;return null!==(e=null===(t=g.h.value)||void 0===t?void 0:t.isExtendedLogin)&&void 0!==e?e:null};var O;O=()=>new C.a("pushNotification.closeNotificationModal",{statCategory:ve.a.USER,changeset:{initialState:b.current,endState:{mailToggleValue:p.current,calendarToggleValue:v.current}},browserPermission:e,extendedSessionEnabled:y(),userDidToggle:h.current}).record(),r.useEffect((()=>()=>O()),[]);const j=r.useCallback((()=>{new C.a("pushNotification.openNotificationModal",{statCategory:ve.a.USER,success:!0,initialState:b.current,browserPermission:e,extendedSessionEnabled:y()}).record()}),[e]);r.useEffect((()=>{if(o&&ge.b.isInitialized)return"denied"===e||"prompt"===e?(s(!1),void j()):void("granted"===e&&(p.current=se.a.sharedInstance.pushEnabledApps.has(se.c.mail),v.current=se.a.sharedInstance.pushEnabledApps.has(se.c.calendar),s(!1),j()))}),[e,j,o,s]);const S=async()=>{m(!0);try{if("prompt"===e&&"denied"===await i())return p.current=!1,v.current=!1,void m(!1);const c=new Set;p.current&&c.add(se.c.mail),v.current&&c.add(se.c.calendar);const l=await(async()=>{if(p.current||v.current){if(t)return de.Result.success(t);{const e=await a();if(!e.ok){const{error:t}=e;return p.current=!1,v.current=!1,de.Result.failure(new Error(t.message))}return e}}return await n(),t?de.Result.success(t):de.Result.failure(new Error("Failure to update Subscription"))})();if(l.ok){const{value:e}=l,t=await se.a.sharedInstance.updateAccountPreferences(e,c);var r;t.success||E(null!==(r=t.errorDesc)&&void 0!==r?r:"")}else if(!l.ok){const{error:e}=l,t=Object(ue.a)(e);E(t)}}catch(c){const e=Object(ue.a)(c);E(e)}finally{m(!1)}};return{isMailBrowserNotificationsEnabled:p.current,isCalendarBrowserNotificationsEnabled:v.current,updatePushAppValue:async(e,t)=>{switch(h.current=!0,e){case se.c.mail:p.current!==t&&(p.current=t,await S());break;case se.c.calendar:v.current!==t&&(v.current=t,await S());break;default:return}},permissionState:e,isSaving:d,error:c,isLoading:o,saveCurrentData:S}};var he=a(2238),fe=a(2275),Ee=a(2254),ye=a(2269),Oe=a(1325);const je=e=>{let{title:t,description:a,labelName:n,loadingDescription:i,initialCheckedValue:c,isDisabled:l=!1,icon:o,isWaiting:s=!1,onStateChanged:u,shouldDebounce:m=!0}=e;const p=Object(Oe.a)(u,1e3);return r.createElement("div",{className:"notification-switch-wrapper"},r.createElement("div",{className:"notification-switch"},r.createElement(Ee.a,{htmlFor:`${n}-notifications-switch`},o,t),s?r.createElement(d.a,{description:i,style:{fontSize:16}}):l?r.createElement(ye.a,{id:`${n}-notifications-switch`,defaultChecked:!1,disabled:l,ariaDescribedBy:`${n}-switch-description`}):r.createElement(ye.a,{id:`${n}-notifications-switch`,defaultChecked:c,ariaDescribedBy:`${n}-switch-description`,onStateChange:m?p:u})),r.createElement("div",{id:`${n}-switch-description`,className:"description"},r.createElement("div",null,a)))};var Se=a(2282);const Ne=e=>{let{onClose:t}=e;const a="https://support.apple.com/ht213880?cid=mc-ols-icloud-article_ht213880-settings_ui-08072023",{isMailBrowserNotificationsEnabled:n,isCalendarBrowserNotificationsEnabled:i,updatePushAppValue:c,permissionState:l,isSaving:o,error:s,isLoading:m}=be(),p="denied"===l,[v,g]=r.useState(!1),[h,f]=r.useState(!1);return r.useEffect((()=>{o||(g(!1),f(!1))}),[o]),r.useEffect((()=>{p&&(g(!1),f(!1))}),[p]),r.useEffect((()=>{s===se.b.create_subscription_failed&&t()}),[s,t]),r.createElement("div",{className:"notification-settings-overlay"},r.createElement("div",{className:"close-button"},r.createElement(Se.a,{onActivate:t,className:"modal-close-button"})),r.createElement("div",{className:"content"},r.createElement("div",{className:"title-icon"},r.createElement(ie.a,{layoutMode:"glyphBox",width:54,height:54})),r.createElement("h2",null,Object(u.a)("NotificationSettings.ChangeNotificationSettings.Title")),r.createElement("div",{className:"browser-push-notifications-description"},Object(u.a)("NotificationSettings.ChangeNotificationSettings.Description")),m?r.createElement(d.a,{className:"loading-content",description:Object(u.a)("NotificationSettings.Loading.MainContent")}):r.createElement(r.Fragment,null,p&&r.createElement("div",{className:"denied-content"},r.createElement("div",{className:"title"},Object(u.a)("NotificationSettings.Error.Denied.Title")),r.createElement("div",{className:"description"},Object(u.a)("NotificationSettings.Error.Denied.Description")),r.createElement(b.a,{className:"link",href:a},Object(u.a)("NotificationSettings.Error.Denied.ExternalLink"))),r.createElement("div",{className:`notification-switches-container ${p&&"denied"}`},r.createElement("div",{className:"title"},Object(u.a)("NotificationSettings.Switches.Title")),r.createElement(je,{title:Object(u.a)("NotificationSettings.Mail.Title"),description:Object(u.a)("NotificationSettings.Mail.Description"),labelName:se.c.mail,loadingDescription:Object(u.a)("NotificationSettings.Loading.MailSwitch"),initialCheckedValue:n,icon:r.createElement(ce.a,{layoutMode:"glyphBox",width:17,height:17}),isDisabled:p,isWaiting:v,shouldDebounce:"prompt"!==l,onStateChanged:e=>{void 0!==e.checked&&("prompt"===l&&g(!0),c(se.c.mail,e.checked))}}),r.createElement(je,{title:Object(u.a)("NotificationSettings.Calendar.Title"),description:Object(u.a)("NotificationSettings.Calendar.Description.Title"),labelName:se.c.calendar,loadingDescription:Object(u.a)("NotificationSettings.Loading.CalendarSwitch"),initialCheckedValue:i,icon:r.createElement(le.a,{layoutMode:"glyphBox",width:17,height:17}),isDisabled:p,isWaiting:h,shouldDebounce:"prompt"!==l,onStateChanged:e=>{void 0!==e.checked&&("prompt"===l&&f(!0),c(se.c.calendar,e.checked))}})),!p&&r.createElement(r.Fragment,null,r.createElement("div",{className:"notification-settings-note"},Object(u.a)("NotificationSettings.ChangeNotificationSettings.Note"),r.createElement(b.a,{className:"learn-more",href:a},Object(u.a)("NotificationSettings.ChangeNotificationSettings.Note.LearnMore"))),r.createElement("div",{className:"calendar-note"},r.createElement("div",{className:"divider"}),Object(u.a)("NotificationSettings.Calendar.Note"))))))};var Pe=a(1265),we=a(1396),Ce=a(1491),De=a(2291),Te=a(1457);const Ie=e=>{const t=Object($.c)(),a=l()("plan-card",e.className,t),{storageUsage:n}=Object(De.a)(),i=function(e){switch(e){case $.a.MAID:return{title:Object(u.a)("AccountPage.PlanCard.MAID.Title"),links:[Pe.b.plan,Pe.b.storage]};case $.a.Lite:return{title:Object(u.a)("AccountPage.PlanCard.WebOnly.Title"),description:Object(u.a)("AccountPage.PlanCard.WebOnly.Description"),links:[Pe.b.plan,Pe.b.storage]};case $.a.Standard:return{title:Object(u.a)("AccountPage.PlanCard.iCloud.Title"),links:[Pe.b.plan,Pe.b.storage]};case $.a.Plus:return{title:Object(u.a)("AccountPage.PlanCard.iCloud+.Title"),links:[Pe.b.plan,Pe.b.storage,Pe.b.icloudplus]};default:Object(we.a)(e)}}(t);return r.createElement("article",{"aria-label":Object(u.a)("VoiceOver.AccountPage.PlanCard"),className:a},r.createElement(Te.a,{className:"shadow"}),r.createElement(Te.a,null),r.createElement("div",{className:"plan-card-content"},r.createElement("div",{className:"plan-card-title"},i.title),i.description&&r.createElement("div",{className:"plan-card-description"},i.description),r.createElement("div",{className:"plan-card-info"},r.createElement("div",{className:"plan-card-links"},i.links.map((e=>{const t=e===Pe.b.plan?Object(u.a)("AccountPage.PlanCard.Plan.Link.Name"):e===Pe.b.storage?Object(u.a)("AccountPage.PlanCard.Storage.Link.Name"):e===Pe.b.icloudplus?Object(u.a)("AccountPage.PlanCard.iCloud+.Link.Name"):void Object(we.a)(e);return r.createElement("div",{key:t,className:"link"},r.createElement(Pe.a,{to:e,name:t},t,r.createElement(ee.b,{layoutMode:"glyphBox",desiredFontSize:12})))}))),n?r.createElement("div",{className:"quota"},Object(Ce.a)(n.totalBytes,0)):null)))};var Ae=a(2288),Le=a(1613),ke=a(2219);function Re(e){var t;return null!==(t=function(e,t){let a,n,r,i;for(let c in t){const l=parseFloat(c);(!i||!r||l>r)&&(i=t[c],r=l);const o=l-e;(void 0===a||o>=0&&o<a)&&(a=o,n=t[l])}return n||i}(window.devicePixelRatio>1?58:29,e.iconURLs))&&void 0!==t?t:"../eec23e311e07b52d13d853f0c7746612.png"}const Fe=Object(Oe.a)((function(e,t,a){a({...t,isDiscoverable:e})}),2e3),Me=e=>r.createElement("div",{className:"modal-content look-me-up-by-email-modal-content"},r.createElement("div",{className:"modal-icon","data-testid":"icon"},r.createElement(Le.a,{layoutMode:"glyphBox",width:39,height:52})),r.createElement("h2",{className:"modal-title","data-testid":"title",id:e.titleId},Object(u.a)("AccountPage.Settings.LookMeUpByEmail.Modal.Title")),r.createElement("div",{className:"modal-description","data-testid":"description"},Object(u.a)("AccountPage.Settings.LookMeUpByEmail.Modal.Description")," ",r.createElement(b.a,{href:Object(h.a)("lookMeUp")},Object(u.a)("AccountPage.Settings.LookMeUpByEmail.Modal.LearnMore"))),r.createElement("div",{className:"look-me-up-by-email-list"},e.isLoading?r.createElement("div",{className:"loading"},r.createElement(d.a,{description:Object(u.a)("AccountPage.Settings.LookMeUpByEmail.Modal.LoadingDescription")})):function(e,t){if(e&&0!==e.length){const a=Object(u.b)({one:"AccountPage.Settings.LookMeUpByEmail.Modal.List.Title.One",two:"AccountPage.Settings.LookMeUpByEmail.Modal.List.Title.Two",zero:"AccountPage.Settings.LookMeUpByEmail.Modal.List.Title.One",many:"AccountPage.Settings.LookMeUpByEmail.Modal.List.Title.Many"},e.length);return r.createElement(r.Fragment,null,r.createElement("div",{className:"count"},a),r.createElement("div",{className:"description"},Object(u.a)("AccountPage.Settings.LookMeUpByEmail.Modal.List.Description")),r.createElement("div",{role:"table","aria-label":Object(u.a)("VoiceOver.AccountPage.LookMeUpByEmail.Modal.List.AriaLabel")},e.map((e=>r.createElement("div",{key:e.id,role:"row"},r.createElement("div",{role:"cell",className:"checkbox-cell"},r.createElement(ke.a,{defaultChecked:e.isDiscoverable,ariaLabel:Object(u.a)("VoiceOver.AccountPage.LookMeUpByEmail.Modal.List.Checkbox.AriaLbel",{appName:e.name}),onStateChange:a=>Fe(a.checked,e,t)})),r.createElement("div",{role:"cell",className:"text-cell"},r.createElement("img",{src:Re(e),"aria-hidden":!0,alt:""}),r.createElement("span",null,e.name)))))))}return r.createElement("div",{className:"empty-list"},r.createElement("div",{className:"title"},Object(u.a)("AccountPage.Settings.LookMeUpByEmail.Modal.List.Empty.Title")),r.createElement("div",{className:"content"},Object(u.a)("AccountPage.Settings.LookMeUpByEmail.Modal.List.Empty.Content")))}(e.items,e.onUpdateLookMeUpByEmail)));function ze(){return ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},ze.apply(null,arguments)}const Be="look-me-up-by-email-modal-title";var xe=a(1487),Ue=a(2260),_e=a(1422),We=a(1423);const He=w.z.object({bundleId:w.z.string(),displaySetId:w.z.string(),applicationNameLocalized:w.z.string(),applicationIconUrls:w.z.record(w.z.string())}),Ve=w.z.object({isDiscoverable:w.z.boolean(),containerType:w.z.string(),containerName:w.z.string(),bundleIdAndIcons:w.z.record(w.z.array(He).or(w.z.null()))}),qe=w.z.array(Ve);function Ge(e){const t=null===e||void 0===e?void 0:e.bundleIdAndIcons;if(!t)return;let a,n="";for(let i in t){var r;n=i;const c=null!==(r=t[i])&&void 0!==r?r:[];for(let t=0;t<c.length;t++){const n=c[t],r={id:n.bundleId||"",name:n.applicationNameLocalized||"",iconURLs:n.applicationIconUrls,containerName:e.containerName,containerType:e.containerType,isDiscoverable:e.isDiscoverable};(!a||r.id&&r.name&&r.iconURLs)&&(a=r)}}return!a&&n&&(a={id:n,name:n,iconURLs:{},containerName:e.containerName,containerType:e.containerType,isDiscoverable:e.isDiscoverable}),a}function Ke(e){return`/ws/v1/${e.containerName}/${e.containerType}/privacy/set`}var $e=a(1363),Ze=a(1488);var Ye=["styles"];function Qe(){return Qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},Qe.apply(null,arguments)}var Xe=function(e){e.styles;var t=function(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;a[n]=e[n]}return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],-1===t.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}(e,Ye);return i.a.createElement("svg",Qe({width:"60",height:"60",xmlns:"http://www.w3.org/2000/svg"},t),i.a.createElement("defs",null,i.a.createElement("clipPath",{id:"1745ae87233d84a26db476836e9c4233a"},i.a.createElement("path",{d:"M42.053 0c6.24 0 8.503.65 10.785 1.87a12.721 12.721 0 015.292 5.292C59.35 9.444 60 11.707 60 17.947v24.106c0 6.24-.65 8.503-1.87 10.785a12.721 12.721 0 01-5.292 5.292C50.556 59.35 48.293 60 42.053 60H17.947c-6.24 0-8.503-.65-10.785-1.87a12.721 12.721 0 01-5.292-5.292C.65 50.556 0 48.293 0 42.053V17.947c0-6.24.65-8.503 1.87-10.785A12.721 12.721 0 017.162 1.87C9.444.65 11.707 0 17.947 0h24.106z"})),i.a.createElement("clipPath",{id:"1745ae87233d84a26db476836e9c4233b"},i.a.createElement("path",{d:"M12.017 13.606c3.383 0 6.018 2.619 6.038 6.301 1.554.69 2.557 2.186 2.557 3.899 0 2.304-1.928 4.194-4.425 4.194l-11.25-.02C2.124 27.98 0 25.913 0 23.471c0-2.008 1.101-3.682 2.97-3.997.04-2.304 2.222-3.86 4.268-3.308 1.003-1.398 2.616-2.56 4.779-2.56zm26.807.236c3.698 0 6.176 2.481 6.176 6.164 0 3.662-2.478 6.143-6.176 6.143H22.461a6.214 6.214 0 00.452-2.343c0-2.245-1.003-4.056-2.655-5.277-.275-1.851-1.062-3.446-2.242-4.687zm-.275 4.135c-1.101 0-2.046.926-2.046 2.029 0 1.122.945 2.047 2.046 2.028 1.101-.02 2.026-.906 2.026-2.028a2.05 2.05 0 00-2.026-2.029zM33.416 0c2.792 0 4.936 1.32 5.9 3.741l3.5 8.684c-1.16-.571-2.517-.886-3.992-.886H15.656c-.354 0-.807 0-1.279.078a7.157 7.157 0 00-2.439-.295l3.069-7.58C15.99 1.318 18.134 0 20.927 0z"})),i.a.createElement("linearGradient",{id:"1745ae87233d84a26db476836e9c4233c",x1:"22.5",y1:"0",x2:"22.5",y2:"28",gradientUnits:"userSpaceOnUse"},i.a.createElement("stop",{stopColor:"#3980FF",offset:"0%"}),i.a.createElement("stop",{stopColor:"#5CBEFF",offset:"100%"}))),i.a.createElement("g",{clipPath:"url(#1745ae87233d84a26db476836e9c4233a)"},i.a.createElement("path",{fill:"var(--theme-color-backgroundPrimary)",d:"M0 0h60v60H0V0z"}),i.a.createElement("path",{d:"M17.947 0h24.106c6.24 0 8.503.65 10.785 1.87a12.721 12.721 0 015.292 5.292C59.35 9.444 60 11.707 60 17.947v24.106c0 6.24-.65 8.503-1.87 10.785a12.721 12.721 0 01-5.292 5.292C50.556 59.35 48.293 60 42.053 60H17.947c-6.24 0-8.503-.65-10.785-1.87a12.721 12.721 0 01-5.292-5.292C.65 50.556 0 48.293 0 42.053V17.947c0-6.24.65-8.503 1.87-10.785A12.721 12.721 0 017.162 1.87C9.444.65 11.707 0 17.947 0z",stroke:"var(--theme-color-gray6)",fill:"none",strokeMiterlimit:"5"})),i.a.createElement("g",{clipPath:"url(#1745ae87233d84a26db476836e9c4233b)",transform:"translate(6.5 16)"},i.a.createElement("path",{fill:"#1C1C1F",d:"M0 0h45v28H0V0z"}),i.a.createElement("path",{fill:"url(#1745ae87233d84a26db476836e9c4233c)",d:"M0 0h45v28H0V0z"})))},Je=a(1463),et=a(1181),tt=a(2138);const at=e=>{const t=S.a.sharedInstance.isDomainCN,a=[{title:Object(u.a)("UpgradePlanTiles.MoreStorage"),description:Object(u.a)("UpgradePlanTiles.MoreStorage.Description"),icon:r.createElement(Xe,{width:60,height:60,"aria-hidden":!0}),contentImageSrc1x:"../27118e413e14022017c5056c3c9b2a6f.png",contentImageSrc2x:"../1376acec25c19758d863429654396a0e.png",contentImageSrc3x:"../a656e6879dab8f4a76db6bb6cbb757ca.png",linkInfo:{text:Object(u.a)("UpgradePlanTiles.MoreStorage.LinkText"),href:Object(h.a)("iCloudPlusPlanPricing")}},{title:Object(u.a)("UpgradePlanTiles.HomeKitSecureVideo"),description:Object(u.a)("UpgradePlanTiles.HomeKitSecureVideo.Description"),icon:r.createElement(tt.a,{iconSize:60,applicationIdentifier:"homekit"}),linkInfo:{text:Object(u.a)("UpgradePlanTiles.HomeKitSecureVideo.LinkText"),href:Object(h.a)("homeKitSecureVideo")}},{title:Object(u.a)("UpgradePlanTiles.FamilySharing"),description:Object(u.a)("UpgradePlanTiles.FamilySharing.Description"),icon:r.createElement(tt.a,{applicationIdentifier:"plan",iconSize:60}),linkInfo:{text:Object(u.a)("UpgradePlanTiles.FamilySharing.LinkText"),href:Object(h.a)("familySharing")}},{title:Object(u.a)("UpgradePlanTiles.HideMyEmail"),description:Object(u.a)("UpgradePlanTiles.HideMyEmail.Description"),icon:r.createElement(tt.a,{iconSize:60,applicationIdentifier:"hidemyemail"}),contentImageSrc1x:et.a,linkInfo:{text:Object(u.a)("UpgradePlanTiles.HideMyEmail.LinkText"),href:Object(h.a)("hideMyEmail")}}],n=[{title:Object(u.a)("UpgradePlanTiles.PrivateRelay"),description:Object(u.a)("UpgradePlanTiles.PrivateRelay.Description"),icon:r.createElement(tt.a,{iconSize:60,applicationIdentifier:"privaterelay"}),linkInfo:{text:Object(u.a)("UpgradePlanTiles.PrivateRelay.LinkText"),href:Object(h.a)("privateRelay")}},{title:Object(u.a)("UpgradePlanTiles.CustomEmailDomain"),description:Object(u.a)("UpgradePlanTiles.CustomEmailDomain.Description"),icon:r.createElement(tt.a,{iconSize:60,applicationIdentifier:"customdomainsettings"}),linkInfo:{text:Object(u.a)("UpgradePlanTiles.CustomEmailDomain.LinkText"),href:Object(h.a)("customEmailDomains")}}],i=t?a:[a[0],n[0],a[1],a[3],n[1],a[2]];return r.createElement("div",{className:l()("upgrade-plan-tiles",e.className)},r.createElement("div",{className:"application-content"},r.createElement("h2",{className:"upgrade-heading"},Object(u.a)("UpgradePlanTiles.Upgrade")),r.createElement("p",{className:"upgrade-description"},Object(u.a)("UpgradePlanTiles.Upgrade.Description")),r.createElement(Je.a,{tiles:i})))};var nt=a(2326),rt=a(1053),it=a(949);let ct=function(e){return e[e.Deg0=0]="Deg0",e[e.DegNeg90=1]="DegNeg90",e[e.DegNeg180=2]="DegNeg180",e[e.DegNeg270=3]="DegNeg270",e}({});var lt=a(1614),ot=a(1519),st=a(2265),dt=a(1480),ut=a(2268),mt=a(1615),pt=a(1616);const vt=e=>{const t=l()("zoom-control",e.className,e.disabled?"disabled":void 0),a=Object(u.a)("ImagePicker.ZoomControl.ZoomLabel"),n=Object(u.a)("VoiceOver.ImagePicker.ZoomControl.ZoomControlAriaLabel"),i=99*(e.zoomLevel-1)/7;return r.createElement("div",{className:t},r.createElement(ut.a,{min:0,max:99,step:1,value:i,onStateChange:t=>{void 0!==t.value&&e.onZoomLevelChange(7*t.value/99+1)},disabled:e.disabled,ariaLabel:n}),r.createElement("div",{className:"label-container"},r.createElement(mt.a,{width:12,height:12,layoutMode:"glyphBox","aria-hidden":"true"}),r.createElement("label",{htmlFor:"zoom-control"},a),r.createElement(pt.a,{width:12,height:12,layoutMode:"glyphBox","aria-hidden":"true"})))};var gt=a(1617);const bt=[ct.Deg0,ct.DegNeg90,ct.DegNeg180,ct.DegNeg270],ht=e=>{const t=l()("rotation-control",e.className,e.disabled?"disabled":void 0),a=Object(u.a)("ImagePicker.RotationControl.RotateLabel"),n=Object(u.a)("VoiceOver.ImagePicker.RotationControl.RotateLabel");return r.createElement("div",{className:t},r.createElement(E.a,{className:"rotate-button",variant:"push",ariaLabel:n,onActivate:()=>{e.onRotate(bt[(e.orientation+1)%4])},disabled:e.disabled},r.createElement(gt.a,{width:26,height:26,layoutMode:"glyphBox"})),r.createElement("div",{className:"rotate-label"},a))},ft=200,Et=r.forwardRef(((e,t)=>{const{id:a,className:n,style:i,cancelButtonLabel:c,doneButtonLabel:o,compactDoneButtonLabel:s,changeImageButtonLabel:m,imageAlt:p,loadingAriaLabel:v,onComplete:g,onCancel:b,imageURL:h,meCardCrop:f,onUserSelectedImage:y,acceptType:O,instructionsLabel:j,errorTextForImageFailedToLoad:S,ariaLabel:N,title:P,dropZoneLabel:w}=e,[C,D]=Object(r.useState)(!h),[T,I]=Object(r.useState)(null),[A,L]=Object(r.useState)(0),[k,R]=Object(r.useState)(0),[F,M]=Object(r.useState)(!1),[z,B]=Object(r.useState)(1),[x,U]=Object(r.useState)(ct.Deg0),_=["rotate(0)","rotate(-90deg)","rotate(-180deg)","rotate(-270deg)"][x],[W,H]=Object(r.useState)(!1),V=Object(r.useRef)(void 0),q=Object(r.useRef)(null),G=Object(r.useRef)(null),K=Object(r.useRef)(null),$=Object(r.useRef)(null),Z=Object(r.useRef)(null),[Y,Q]=Object(r.useState)(1),X=Y*z;Object(r.useEffect)((()=>{T&&f&&!V.current&&!F&&(V.current=Object(lt.a)(f,T))}),[f,T,F]),Object(r.useEffect)((()=>{if(W)return;if(!T)return;const e=ft/Math.min(T.width,T.height);if(Q(e),V.current){const t=ft/V.current.width;B(t/e),H(!0)}else V.current={top:(T.height*e-200)/e/2,left:(T.width*e-ft)/e/2,width:ft/e,height:200/e},H(!0)}),[T,W,f]),Object(r.useLayoutEffect)((()=>{W&&V.current&&K.current&&he({scrollLeft:V.current.left*X+(V.current.width*X-ft)/2,scrollTop:V.current.top*X+(V.current.height*X-200)/2})}),[W,X]);const[J,ee]=Object(r.useState)(h);async function te(e){const t=null===e||void 0===e?void 0:e[0],a=!y||y(t);if(t&&a){ee(void 0);const e=await Object(ot.a)(t);ee(e),M(!0),U(ct.Deg0),B(1)}}const ae=W?42/X:0,ne=Object(r.useRef)(J);Object(r.useEffect)((()=>{J!==ne.current&&(ne.current=J,V.current=void 0,D(!1),I(null),Q(1),H(!1))}),[J]),Object(r.useEffect)((()=>{const e=()=>{Q(1),H(!1)};return window.addEventListener("orientationchange",e),()=>window.removeEventListener("orientationchange",e)}),[]),Object(r.useEffect)((()=>{const e=K.current;if(e){const t=e=>{e.preventDefault(),e.stopPropagation()};return e.addEventListener("wheel",t,{passive:!1}),()=>{e.removeEventListener("wheel",t)}}}),[]);const re=Object(r.useRef)(!1),ie=Object(r.useRef)(0),ce=Object(r.useRef)(0),le=Object(r.useRef)(0),oe=Object(r.useRef)(0);function se(e,t){C&&K.current&&(x===ct.Deg0?he({scrollLeft:le.current+ie.current-e,scrollTop:oe.current+ce.current-t}):x===ct.DegNeg90?he({scrollLeft:oe.current-ce.current+t,scrollTop:le.current+ie.current-e}):x===ct.DegNeg180?he({scrollLeft:le.current-ie.current+e,scrollTop:oe.current-ce.current+t}):he({scrollLeft:oe.current+ce.current-t,scrollTop:le.current-ie.current+e}))}function de(){re.current=!1}function ue(e,t){re.current=!0,ie.current=e,ce.current=t;const a=K.current;a&&(x===ct.Deg0||x===ct.DegNeg180?(le.current=a.scrollLeft,oe.current=a.scrollTop):(le.current=a.scrollTop,oe.current=a.scrollLeft))}function me(e){let{up:t=0,left:a=0,down:n=0,right:r=0}=e;const i=K.current;C&&i&&(x===ct.Deg0?(i.scrollLeft+=a,i.scrollTop+=t,i.scrollLeft-=r,i.scrollTop-=n):x===ct.DegNeg90?(i.scrollTop+=a,i.scrollLeft-=t,i.scrollTop-=r,i.scrollLeft+=n):x===ct.DegNeg180?(i.scrollLeft-=a,i.scrollTop-=t,i.scrollLeft+=r,i.scrollTop+=n):(i.scrollTop-=a,i.scrollLeft+=t,i.scrollTop+=r,i.scrollLeft-=n))}const[pe,ve]=Object(r.useState)(!1);function ge(){return b?b():null}function be(){if(K.current&&J&&V.current)return g(J,V.current,x)}function he(e){let{scrollLeft:t,scrollTop:a}=e;const n=K.current;n&&("function"===typeof n.scrollTo?n.scrollTo(t,a):(n.scrollTop=a,n.scrollLeft=t))}return r.createElement("div",{"aria-label":N,id:a,style:i,className:l()(n,A>0?"drag-over":void 0,"image-picker",C?"is-loaded":"is-loading",pe?"has-error":void 0,J?void 0:"no-image"),ref:t,onDragOver:e=>e.preventDefault(),onDragEnter:()=>L((e=>e+1)),onDragLeave:()=>L((e=>e-1)),onDrop:()=>{L(0),R(0)}},r.createElement("div",{className:"close-button"},r.createElement(Se.a,{onActivate:ge,ariaLabel:Object(u.a)("VoiceOver.ImagePicker.CloseButtonLabel"),className:"modal-close-button"})),r.createElement("div",{className:"content"},r.createElement("div",{className:"title-icon"},r.createElement(dt.a,{layoutMode:"glyphBox",width:48,height:48})),r.createElement("h2",null,P),r.createElement("div",{className:l()("image-wrapper",k>0?"drag-over":void 0),ref:q,onDragOver:e=>e.preventDefault(),onDragEnter:()=>R((e=>e+1)),onDragLeave:()=>R((e=>e-1)),onDrop:function(e){var t,a;e.preventDefault(),e.stopPropagation(),L(0),R(0),te(null!==(t=null===(a=e.dataTransfer)||void 0===a?void 0:a.files)&&void 0!==t?t:void 0)}},A>0?r.createElement("div",{className:"drop-zone-label"},r.createElement("span",null,w)):J?pe?r.createElement("div",{className:"error-message"},r.createElement("span",null,S)):C?void 0:r.createElement("div",{className:"loading-indicator"},r.createElement(d.a,{description:v})):r.createElement("div",{className:"empty-profile-image"}),r.createElement("div",{className:"scroll-container",tabIndex:0,ref:K,onScroll:function(e){if(C&&W&&V.current){const t=e.target;e.preventDefault(),V.current={top:t.scrollTop/X,left:t.scrollLeft/X,width:ft/X,height:ft/X}}},onMouseDown:function(e){C&&ue(e.clientX,e.clientY)},onMouseMove:function(e){re.current&&se(e.clientX,e.clientY)},onMouseUp:de,onMouseLeave:de,onTouchStart:function(e){C&&ue(e.touches[0].clientX,e.touches[0].clientY)},onTouchEnd:de,onTouchMove:function(e){re.current&&se(e.touches[0].clientX,e.touches[0].clientY)},style:{transform:_},onKeyDown:e=>{switch(e.key){case"Enter":e.preventDefault(),be();break;case"Esc":e.preventDefault(),ge();break;case"Left":case"ArrowLeft":e.preventDefault(),me({left:10});break;case"Up":case"ArrowUp":e.preventDefault(),me({up:10});break;case"Right":case"ArrowRight":e.preventDefault(),me({right:10});break;case"Down":case"ArrowDown":e.preventDefault(),me({down:10});break;default:return}}},r.createElement(st.b,{alt:p,src:J,style:{transform:`scale(${X}) `,transformOrigin:"left top",padding:ae},ref:$,onLoad:function(){D(!0),I({width:$.current.offsetWidth,height:$.current.offsetHeight}),pe&&ve(!1)},onLoadFailure:function(){ve(!0)}})),r.createElement(yt,{ref:G})),r.createElement("div",{className:"controls"},r.createElement(vt,{zoomLevel:z,onZoomLevelChange:B,disabled:!J||!C}),r.createElement(ht,{orientation:x,onRotate:U,disabled:!J||!C})),r.createElement("div",{className:l()("instructions-label",C||pe?void 0:"muted")},j),r.createElement(E.a,{onActivate:()=>{var e;null===Z||void 0===Z||null===(e=Z.current)||void 0===e||e.click()},variant:"push primary",className:"file-upload",disabled:!C&&!pe},r.createElement("input",{ref:Z,type:"file",title:"",accept:O||"image/jpeg",onChange:e=>{!function(e){const t=e.target.files;t&&!t.length||te(null!==t&&void 0!==t?t:void 0)}(e)}}),m)),r.createElement("div",{className:"button-container"},r.createElement(E.a,{className:"compact-done-button",onActivate:be,variant:"block primary large"},s),r.createElement(E.a,{className:"cancel-button",onActivate:ge,variant:"block secondary large"},c),r.createElement(E.a,{className:"regular-done-button",disabled:!C||void 0,onActivate:be,variant:"block primary large"},o)))}));Et.displayName="UIImagePicker";const yt=r.forwardRef(((e,t)=>r.createElement("svg",{viewBox:"0 0 284 284",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",className:"image-picker-mask"},r.createElement("defs",null,r.createElement("circle",{id:"b",cx:"50%",cy:"50%",r:"100"}),r.createElement("rect",{id:"a",rx:"8",width:"284",height:"284"}),r.createElement("mask",{id:"c"},r.createElement("use",{xlinkHref:"#a",fill:"#fff"}),r.createElement("use",{xlinkHref:"#b"}))),r.createElement("use",{xlinkHref:"#a",mask:"url(#c)",fill:"rgba(73, 73, 75, 0.6)",className:"square"}),r.createElement("use",{xlinkHref:"#b",fill:"none",stroke:"#fff",strokeWidth:"2px",ref:t,className:"circle"}))));function Ot(){return Ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},Ot.apply(null,arguments)}yt.displayName="ImagePickerMask";var jt=a(988);function St(e,t,a,n){const r=t.width,i=t.height,c=Math.round(r*a),l=Math.round(i*a),o=document.createElement("canvas");o.width=c,o.height=l;const s=o.getContext("2d");if(!s)throw new Error("extractImageData: cannot get canvas context");s.fillStyle="#ffffff",s.fillRect(0,0,c,l),s.drawImage(e,t.left,t.top,r,i,0,0,c,l);const d=o.toDataURL("image/jpeg",n);return{dataURL:d,width:c,height:l,size:d.length,scale:a,quality:n}}function Nt(e,t,a,n,r,i,c){let l=0;if(a.size>c&&++l,n.size>c&&++l,r.size>c&&++l,i.size>c&&++l,4===l||0===l)return null;const o=a.scale,s=i.scale,d=a.quality,u=i.quality;if(s-o<.05||u-d<.05)return a;const m=(o+s)/2,p=(d+u)/2,v=St(e,t,m,u),g=St(e,t,s,p),b=St(e,t,m,p);let h;if(h=Nt(e,t,b,g,v,i,c))return h;const f=St(e,t,m,d);if(h=Nt(e,t,f,n,b,g,c))return h;const E=St(e,t,o,p);return(h=Nt(e,t,E,b,r,v,c))||(h=Nt(e,t,a,f,E,b,c)),h}async function Pt(e,t,a,n,r){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1e7,c=arguments.length>6&&void 0!==arguments[6]&&arguments[6];const l=c?r:{left:0,top:0,width:t,height:a};let o,s=St(e,l,1,1);if(s.size>i&&(s=Nt(e,l,St(e,l,.1,.1),St(e,l,1,.1),St(e,l,.1,1),s,i)),!s)throw new Error("extractImageData: cannot convert image to data URL");if(c)o={left:0,top:0,width:s.width,height:s.height};else{const e=s.scale;o={top:Math.round(r.top*e),left:Math.round(r.left*e),width:Math.round(r.width*e),height:Math.round(r.height*e)}}const d=await async function(e,t,a){const{width:n,height:r}=e,{left:i,top:c}=t,l=n-t.width-i,o=r-t.height-c,s=function(e,t){let{left:a,top:n,right:r,bottom:i,width:c,height:l}=e;const o=[a,n,r,i,a],s=[c,l,c],[d,u]=o.slice(t,t+2),[m,p]=s.slice(t%2,t%2+2);return{left:d,top:u,width:m,height:p}}({...t,right:l,bottom:o},a),d=document.createElement("canvas"),u=a===ct.Deg0||a===ct.DegNeg180?n:r,m=a===ct.Deg0||a===ct.DegNeg180?r:n;d.width=u,d.height=m;const p=d.getContext("2d");if(!p)return Promise.resolve({...e,crop:t});const v=new Image;v.src=e.dataURL;try{await v.decode()}catch{return Promise.resolve({...e,crop:t})}p.translate(u/2,m/2),p.rotate(-Math.PI/2*a),p.drawImage(v,-n/2,-r/2);const g=d.toDataURL("image/jpeg");return Promise.resolve({dataURL:g,width:u,height:m,size:g.length,scale:e.scale,quality:e.quality,crop:s})}(s,o,n);return Promise.resolve(d)}var wt=a(1339);const Ct=["image/jpeg","image/gif","image/png","image/bmp"];var Dt=a(1581),Tt=a(1041);const It=e=>{let{crossed:t,onChange:a}=e;return r.createElement("button",{className:"sandwich-menu-toggle-icon","aria-label":Object(u.a)("SandwichMenu.NavLinks.ToggleIcon"),"data-cross-activated":t,onClick:()=>a({crossed:t})},r.createElement("div",{className:"sandwich-menu-toggle-icon-top"},r.createElement("div",{className:"sandwich-menu-toggle-icon-crust-top"})),r.createElement("div",{className:"sandwich-menu-toggle-icon-bottom"},r.createElement("div",{className:"sandwich-menu-toggle-icon-crust-bottom"})))};var At=a(969),Lt=a(1230);function kt(){return kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},kt.apply(null,arguments)}const Rt=e=>{const t=e.useHorizontalSizeClass||Lt.c,a=t()===(e.collapsedSizeClass||(e=>{if(e)return At.e.COMPACT;throw new TypeError("When bringing your own sizeClass media query, you need to set a `collapsedSizeClass`!")})(t===Lt.c)),[n,i]=r.useState(!1),c=r.useCallback((()=>i(!1)),[i]);r.useEffect((()=>{a||c()}),[a,c]);const[o,s]=r.useState(!0);r.useLayoutEffect((()=>{s(a)}),[a]);const d=a&&n;r.useEffect((()=>{document.documentElement.classList[d?"add":"remove"]("sandwich-menu-open")}),[d]);const m=c,p=r.useCallback((e=>{" "!==e.key&&"Return"!==e.key||m()}),[m]),{liProps:v,selectedItem:g}=e,b=e.menuItems.map((e=>{const{key:t}=e;if(!t)throw new TypeError("menuItems need to set a `key` prop!");const a=g&&t===g?"selected":null,n=l()(null===v||void 0===v?void 0:v.className,a)||void 0;return r.createElement("li",kt({key:t,className:n,onClick:m,onKeyDown:p},v),e)}));return r.createElement("div",{className:l()("sandwich-menu",d?"open":"closed",o?"animated":null)},r.createElement("div",{className:"sandwich-menu-button-container"},r.createElement(It,{crossed:n,onChange:e=>{let{crossed:t}=e;return i(!t)}})),r.createElement("div",{className:"sandwich-menu-header"},e.compactHeader),r.createElement("section",{className:"sandwich-menu-items-container","aria-label":Object(u.a)("SandwichMenu.AriaLabel")},r.createElement("ul",null,b)))},Ft=e=>{let{route:t,locPrefix:a}=e;const n=Object(Pe.c)(t,`${a}${Pe.g[t]}`,void 0,!0);return r.createElement(n,null)},Mt=e=>{var t;let{current:a,tabs:n}=e;const i=function(){var e;const t=null===(e=Object(N.b)())||void 0===e||null===(e=e.details)||void 0===e||null===(e=e.beneficiaryInfo)||void 0===e?void 0:e.isBeneficiary;return[Pe.b.plan,Pe.b.storage,Object($.b)()&&!t?Pe.b.icloudplus:null,t?null:Pe.b.recovery,t?null:Pe.b.settings].filter(Tt.a)}();n||(n=i);const c=Object($.b)(),l="MD"===Object(Dt.b)(),o=(null===(t=Object(N.b)())||void 0===t||null===(t=t.details)||void 0===t||null===(t=t.beneficiaryInfo)||void 0===t?void 0:t.isBeneficiary)?"ShortName.":c&&l?"":"LongName.",s=n.map((e=>r.createElement(Ft,{key:e,route:e,locPrefix:o})));return r.createElement(Rt,{menuItems:s,selectedItem:a,useHorizontalSizeClass:Dt.b,collapsedSizeClass:"SM"})};var zt=a(1267),Bt=a(1460),xt=a(1341),Ut=a(2283);const _t=e=>{var t,a,n,i;let{className:c,onPageLoaded:o}=e;const s=l()("account-page",c),d=function(){const e=Object(pe.a)();return()=>e({title:Object(u.a)("AccountPage.Settings.Access.Signout.Modal.Title"),description:Object(u.a)("AccountPage.Settings.Access.Signout.Modal.Description"),buttons:[{title:Object(u.a)("AccountPage.Settings.Access.Signout.Confirm"),action:"signout"},{title:Object(u.a)("AccountPage.Settings.Access.Signout.Cancel"),action:"cancel"}],defaultAction:"cancel",cancelAction:"cancel",onActionSelected:e=>{"signout"===e&&Object(R.q)()},unmountWithPresenter:!0})}(),m=Object($.c)(),p=Object(N.b)(),v=Z(),h=Object(ae.a)(Object(ne.b)(),{givenName:null===p||void 0===p||null===(t=p.details)||void 0===t?void 0:t.firstName,familyName:null===p||void 0===p||null===(a=p.details)||void 0===a?void 0:a.lastName}),f=Object(Ut.a)().find((e=>"find"===e.applicationIdentifier)),{data:y,isLoading:O}=Object(xe.a)({endpoint:Ue.b.lookMeUpByEmailList,fetchProvider:e=>()=>async function(e){let{webServices:t}=e;if(null===t||void 0===t||!t.cksharews)throw new Error("no service url available");return function(e){const t=[];for(let a=0;a<e.length;a++){const n=Ge(e[a]);n&&t.push(n)}return t}(await Object(_e.a)({url:`${t.cksharews}/ws/v1/com.apple.cloudkit/production/privacy/getall`,method:"POST",includeCredentials:!0,body:{lang:Object(ne.b)(),platform:null},validate:{type:"WireLookMeUpByEmailListResponse",schema:qe}}))}(e)}),j=function(){const e=Object(Ze.a)(),t=Object($e.useQueryClient)();return Object($e.useMutation)((t=>async function(e,t){let{webServices:a}=e;if(null===a||void 0===a||!a.cksharews)throw new Error("no service url available");return await Object(_e.c)({url:`${a.cksharews}${Ke(t)}`,method:"POST",includeCredentials:!0,body:{bundleId:t.id,isDiscoverable:t.isDiscoverable}}).then(We.g),!0}({webServices:e},t)),{onSuccess:(e,a)=>{var n;const r=null!==(n=t.getQueryData([Ue.b.lookMeUpByEmailList]))&&void 0!==n?n:[],i=r.findIndex((e=>e.id===a.id));i<0||t.setQueryData([Ue.b.lookMeUpByEmailList],[...r.slice(0,i),a,...r.slice(i+1)])}})}(),S=(P={items:y,isLoading:O,onUpdateLookMeUpByEmail:function(e){j.mutate(e)}},Object(Ae.a)(r.createElement(Me,ze({},P,{titleId:Be})),{ariaLabelledBy:Be}));var P;const{isImageLoading:w,showImagePicker:C}=function(){const{data:e,isLoading:t}=Object(nt.a)(),a=Object($e.useMutation)((e=>{const t=((e,t)=>{const a=null!==(e=null===(t=g.h.value)||void 0===t?void 0:t.details)&&void 0!==e?e:null;return Object(it.a)(a)})(),a=Object(rt.b)();return t&&a?a.storePhoto(t,{...e}):Promise.resolve(null)})),n=Object(u.a)("ImagePicker.Alert.Title.UnsupportedFileType"),i=Object(u.a)("ImagePicker.Alert.Title.FileTooLarge"),c=Object(u.a)("ImagePicker.Alert.Title.Generic"),l=Object(u.a)("ImagePicker.Alert.Description.UnsupportedFileType"),o=Object(u.a)("ImagePicker.Alert.Description.FileTooLarge"),s=Object(u.a)("ImagePicker.Alert.Description.Generic"),d=Object(u.a)("ImagePicker.Alert.Action.Ok"),m=Object(pe.a)(),[p,v]=r.useState(null===e||void 0===e?void 0:e.url),b=r.useRef(p);(null===e||void 0===e?void 0:e.url)!==b.current&&(b.current=null===e||void 0===e?void 0:e.url,v(null===e||void 0===e?void 0:e.url));const[h,f]=r.useState(!1),E=function(e){const t=Object(r.useRef)(null),a=r.createElement(Et,Ot({ref:t},e,{onComplete:(t,a,n)=>{e.onComplete(t,a,n),i()},onCancel:()=>{e.onCancel(),i()}})),[n,i]=Object(re.a)(a,{initialFocus:t,className:"for-image-picker"});return n}({cancelButtonLabel:Object(u.a)("ImagePicker.CancelButtonLabel"),compactDoneButtonLabel:Object(u.a)("ImagePicker.CompactDoneButtonLabel"),doneButtonLabel:Object(u.a)("ImagePicker.DoneButtonLabel"),changeImageButtonLabel:Object(u.a)("ImagePicker.ChangeImageButtonLabel"),imageAlt:Object(u.a)("Avatar.ImageAlt"),loadingAriaLabel:Object(u.a)("VoiceOver.ImagePicker.LoadingAriaLabel"),instructionsLabel:Object(u.a)("ImagePicker.Instructions"),title:Object(u.a)("ImagePicker.Title"),errorTextForImageFailedToLoad:Object(u.a)("ImagePicker.ErrorImageFailedToLoad"),onUserSelectedImage:e=>{if(e){const t=e.type;return Ct.includes(t)?!(e.size>1e7)||(m({title:i,description:o,buttons:[d]}),!1):(m({title:n,description:l,buttons:[d]}),!1)}return m({title:c,description:s,buttons:[d]}),!1},onComplete:async(t,n,r)=>{try{var i,l,o,u;if(!e)return;f(!0);const c=await Object(wt.a)(t,void 0,void 0,"use-credentials");f(!1);const s=Object(lt.b)(n,{height:c.height,width:c.width});if(t!==b.current||s.x!==(null===(i=e.crop)||void 0===i?void 0:i.x)||s.y!==(null===(l=e.crop)||void 0===l?void 0:l.y)||s.height!==(null===(o=e.crop)||void 0===o?void 0:o.height)||s.width!==(null===(u=e.crop)||void 0===u?void 0:u.width)||r!==ct.Deg0){const t=await Pt(c,c.width,c.height,r,n,96256,!1),i={contactId:""!==e.contactId?e.contactId:Object(jt.a)().toUpperCase(),url:t.dataURL,crop:Object(lt.b)(t.crop,{width:t.width,height:t.height}),signature:e.signature};a.mutate(i)}}catch{m({title:c,description:s,buttons:[d]})}},acceptType:"image/*",onCancel:()=>{},imageURL:null===e||void 0===e?void 0:e.url,meCardCrop:null===e||void 0===e?void 0:e.crop,dropZoneLabel:Object(u.a)("ImagePicker.DropZoneLabel")});return{isImageLoading:t||a.isLoading||h,showImagePicker:E}}(),D="lookmeupbyemail"===(null===(n=he.a.sharedInstance.applicationParameter.informationalPageDetails)||void 0===n?void 0:n.relativePath);r.useEffect((()=>{O||null===o||void 0===o||o()}),[O,o]),r.useEffect((()=>{D&&S()}),[D,S]);const T=Object(xt.a)(),I=l()("standard-button",{tall:T}),A=Object(R.f)(),L=function(){var e,t;const[a,n]=Object(re.a)(r.createElement(Ne,{onClose:()=>{n()}}),{ariaLabel:Object(u.a)("NotificationSettings.ChangeNotificationSettings.Title")}),i=null!==(e="notifications"===(null===he.a||void 0===he.a||null===(t=he.a.sharedInstance)||void 0===t||null===(t=t.applicationParameter)||void 0===t||null===(t=t.informationalPageDetails)||void 0===t?void 0:t.relativePath))&&void 0!==e&&e;return r.useEffect((()=>{i&&Object(fe.a)()&&a()}),[i,a]),a}();return r.createElement("div",{className:s},r.createElement(Mt,{current:Pe.b.settings}),r.createElement("div",{className:"account-info-wrapper"},r.createElement("div",{className:"application-content"},r.createElement("div",{className:"account-page-header"},r.createElement("h1",{className:l()({tall:T})},h)),r.createElement("div",{className:"page-content"},r.createElement("div",{className:"content-column"},r.createElement(Ie,null),r.createElement("section",null,r.createElement("h2",null,Object(u.a)("AccountPage.Settings.Title")),!A&&r.createElement("section",null,r.createElement("h3",null,Object(u.a)("AccountPage.Settings.Customize.Title")),r.createElement("p",null,Object(u.a)("AccountPage.Settings.Customize.Description")),r.createElement(E.a,{className:I,onActivate:function(){J.a.cloudOSApplication.switchToSpringboard(!1,!0)}},Object(u.a)("AccountPage.Settings.Customize.Button.Name"),r.createElement(ee.a,{layoutMode:"glyphBox",desiredFontSize:8}))),r.createElement("section",{className:"notification-section"},r.createElement("h3",null," ",Object(u.a)("AccountPage.Settings.ChangeNotificationSettings.Title")),r.createElement("p",null,Object(fe.a)()?Object(u.a)("AccountPage.Settings.ChangeNotificationSettings.Description"):Object(u.a)("AccountPage.Settings.ChangeNotificationSettings.NotSupported.Description")),Object(fe.a)()?r.createElement(E.a,{className:I,onActivate:L},Object(u.a)("AccountPage.Settings.ChangeNotificationSettings.Button.Label"),r.createElement(ee.a,{layoutMode:"glyphBox",desiredFontSize:8})):r.createElement(b.a,{href:"https://support.apple.com/guide/icloud/mm3392084d5d/icloud",useSemiboldArrow:!0},Object(u.a)("AccountPage.Settings.ChangeNotificationSettings.NotSupported.Button.Label"))),r.createElement("section",null,r.createElement("h3",null,Object(u.a)("AccountPage.Settings.LookMeUpByEmail.Title")),r.createElement("p",null,Object(u.a)("AccountPage.Settings.LookMeUpByEmail.Description")),r.createElement(E.a,{className:I,onActivate:S},Object(u.a)("AccountPage.Settings.LookMeUpByEmail.Button.Name"),r.createElement(ee.a,{layoutMode:"glyphBox",desiredFontSize:8}))),r.createElement("section",null,r.createElement("h3",null,Object(u.a)("AccountPage.Settings.Access.Title")),r.createElement("p",null,Object(u.a)("AccountPage.Settings.Access.Description")),r.createElement(E.a,{className:I,variant:"push primary destructive",onActivate:d},Object(u.a)("AccountPage.Settings.Access.Button.Name"))))),r.createElement("div",{className:"content-column second"},r.createElement("section",null,r.createElement("section",{className:"apple-id"},r.createElement("h2",null,Object(u.a)("AccountPage.AppleId.Title")),r.createElement("p",{className:"account-email"},null===p||void 0===p||null===(i=p.details)||void 0===i?void 0:i.appleId)),r.createElement("section",null,r.createElement("h3",null,Object(u.a)("AccountPage.Settings.Photo.Title")),r.createElement(E.a,{className:`${I} change-photo`,onActivate:C,disabled:w},Object(u.a)("AccountPage.Settings.Photo.ChangeAppleIDPhoto.Button.Name"),r.createElement(ee.a,{layoutMode:"glyphBox",desiredFontSize:8}))),r.createElement("section",{className:l()(m===$.a.Lite&&"final-section")},r.createElement("h3",null,Object(u.a)("AccountPage.Settings.AppleID.Title")),r.createElement("p",null,Object(u.a)("AccountPage.Settings.AppleID.Description")),r.createElement(b.a,{href:Object(Bt.b)(),onClick:()=>Object(Bt.d)(),useSemiboldArrow:!0},Object(u.a)("AccountPage.Settings.AppleID.Button.Name"))),m!==$.a.Lite&&f&&r.createElement("section",{className:"final-section"},r.createElement("h3",null,Object(u.a)("AccountPage.Settings.FindDevices.Title")),r.createElement("p",null,Object(u.a)("AccountPage.Settings.FindDevices.Description")),r.createElement(E.a,{className:I,onActivate:function(){zt.a.sharedInstance.switchToApplication("find",{hash:"",route:void 0})}},Object(u.a)("AccountPage.Settings.FindDevices.Button.Name"),r.createElement(ee.a,{layoutMode:"glyphBox",desiredFontSize:8})))))))),v?r.createElement(at,null):null)};var Wt=a(2192),Ht=a(2200);const Vt=e=>{const{title:t,subtitle:a,subtitleDescription:n,extraSubtitle:i,description:c}=e,o=l()("page-header",e.className);return r.createElement("div",{className:o},r.createElement("div",{className:"application-content"},r.createElement("div",{className:"page-header-top-row"},r.createElement("h1",{className:"page-header-title"},t)),!!a&&r.createElement("div",{className:"page-header-subtitle"}," ",a," "),!!n&&r.createElement("div",{className:"page-header-description"},n),!!i&&r.createElement("div",{className:"page-header-subtitle"},i),!!c&&r.createElement("div",{className:"page-header-description"},c)))};var qt=a(2300),Gt=a(1315);function Kt(e){const t=[];return e.forEachBookmarkRecord((a=>{var n;if(!function(e){var t,a;if("BookmarkLeaf"!==e.recordType)return!1;const n=Date.now()-2592e6,r=!(null===(t=e.fields.Deleted)||void 0===t||!t.value),i=e.modified.timestamp,c=null===(a=e.fields.ParentFolder)||void 0===a?void 0:a.value.recordName;return r&&"Reading List"!==c&&i>=n}(a))return;const r=null===(n=a.fields.ParentFolder)||void 0===n?void 0:n.value.recordName,i=r?e.getBookmarkRecord(r):void 0;t.push({recordName:a.recordName,title:Zt(a),deletionDate:new Date(a.modified.timestamp),url:Yt(a),folder:i?Zt(i):"",isFavoritesBar:"Favorites Bar"===r})})),t}function $t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Gt.a.shared;const[t,a]=r.useState((()=>Kt(e))),[n,i]=r.useState(e.isLoading),c=r.useRef({bookmarksDidChange(){a(Kt(e))},loadingDidChange(e,t){i(t)}}).current;return r.useEffect((()=>(e.addListener(c),()=>{e.removeListener(c)})),[e,c]),[t,n]}function Zt(e){switch(e.recordName){case"Favorites Bar":return Object(u.a)("RecoveryPage.BookmarksRecoveryModal.LocalizedName.FavoritesBar");case"Bookmarks Menu":return Object(u.a)("RecoveryPage.BookmarksRecoveryModal.LocalizedName.BookmarksMenu");default:{var t;const a=null===(t=e.fields.Title)||void 0===t?void 0:t.value;if(!a)return"";const n=atob(a),r=new Uint8Array(n.length);for(let e=0;e<n.length;++e)r[e]=n.charCodeAt(e);return(new TextDecoder).decode(r)}}}function Yt(e){var t;const a=null===(t=e.fields.URL)||void 0===t?void 0:t.value;if(!a)return"";const n=atob(a),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return(new TextDecoder).decode(r)}var Qt=a(2322),Xt=a(2313),Jt=a(1347),ea=a(1317),ta=a(1399);const aa=e=>{const{deletedArchives:t=[],tileSize:a,headingText:n,iconSymbol:i,iconColor:c,isLoading:l,onTileClick:o,error:s}=e,d=t.length,m=Object(u.b)({zero:"RecoveryPage.ArchivesTile.TotalNumber.Zero",one:"RecoveryPage.ArchivesTile.TotalNumber.One",two:"RecoveryPage.ArchivesTile.TotalNumber.Two",many:"RecoveryPage.ArchivesTile.TotalNumber.Many"},d),p=l?Object(u.a)("RecoveryPage.Loading"):m;t.sort(((e,t)=>t.deletionDate.getTime()-e.deletionDate.getTime()));const v=Object(ea.a)(t,(e=>Object(ta.a)(e.deletionDate,"long")),Fn);return r.createElement(Ht.b,{tileIndex:-1,icon:r.createElement(Jt.a,{iconSize:40,symbolSize:20,symbol:i,backgroundColor:c}),className:"archives-recovery-tile",heading:n,description:p,tileSize:a,isLoading:l,onTileClick:o,error:s},l?null:s?r.createElement(Qt.a,{refetch:e.refetch,showClouds:!1}):r.createElement(Xt.a,{contentListItems:v.length>0?v:[Object(u.a)("RecoveryPage.TileContent.NoItems")],contentDescriptionText:""}))};var na=a(1631),ra=a(1425);const ia=w.z.object({dateCreated:w.z.string(),archiveId:w.z.string(),sharedCalendars:w.z.boolean().optional(),sharedEvents:w.z.boolean().optional()}),ca=w.z.object({archives:w.z.array(ia).optional(),status:w.z.string().optional(),sharedCalendars:w.z.boolean().optional(),sharedEvents:w.z.boolean().optional()}),la=w.z.object({dateCreated:w.z.string(),drivewsid:w.z.string(),docwsid:w.z.string(),zone:w.z.string(),name:w.z.string(),extension:w.z.string().optional(),isDeleted:w.z.boolean(),parentId:w.z.string(),hierarchy:w.z.array(w.z.object({drivewsid:w.z.string(),name:w.z.string(),etag:w.z.string()})),isChainedToParent:w.z.boolean().optional(),dateModified:w.z.string(),dateChanged:w.z.string(),size:w.z.number(),etag:w.z.string(),type:w.z.string()}),oa=(w.z.object({hasMoreItems:w.z.boolean().optional(),items:w.z.array(la).optional(),jobId:w.z.string(),jobStatus:w.z.string(),retryAfterMilliseconds:w.z.number().optional()}),w.z.object({status:w.z.union([w.z.literal("BUSY"),w.z.literal("FREE")])})),sa=w.z.union([w.z.literal("CONSISTENT"),w.z.literal("MORE_AVAILABLE")]),da=ra.c.extend({item_id:w.z.string()}),ua=w.z.object({continuationMarker:w.z.string().optional(),documents:w.z.array(da),status:sa}),ma=w.z.object({drive_items_with_status:w.z.array(w.z.object({status_message:w.z.string(),drive_items:w.z.object({drive_item:w.z.array(w.z.object({item_id:w.z.string()}))})}))});function pa(e){if(e.dateChanged&&e.name&&e.extension&&e.item_id)return{deletionDate:new Date(e.dateChanged),fileName:e.name,extension:e.extension,drivewsid:e.drivewsid,docwsid:e.docwsid,size:e.size||0,hierarchy:[],etag:e.etag,zone:e.zone,itemid:e.item_id}}function va(e){return e.archives?e.archives.map((e=>{const{dateCreated:t,archiveId:a}=e;return{deletionDate:new Date(t),archiveId:a}})):[]}const ga=(e,t)=>{let{webServices:a}=e;if(null===a||void 0===a||!a.archivews)throw new Error("fetchDevices: no service url available");return Object(_e.a)({url:Object(Ue.q)(a.archivews),method:"POST",includeCredentials:!0,body:{service:t},validate:{type:"WireListArchivesResponse",schema:ca}}).then(va)},ba=(e,t,a)=>{let{webServices:n}=e;if(null===n||void 0===n||!n.archivews)throw new Error("restoreDeletedArchives: no service url available");return Object(_e.a)({url:Object(Ue.w)(n.archivews),method:"POST",includeCredentials:!0,body:{service:t,archiveId:a},validate:{type:"WireServiceStatusResponse",schema:oa}})},ha=(e,t)=>{let{webServices:a}=e;if(null===a||void 0===a||!a.archivews)throw new Error("retrieveServiceStatus: no service url available");return Object(_e.a)({url:Object(Ue.y)(a.archivews),method:"POST",includeCredentials:!0,body:{service:t},validate:{type:"WireServiceStatusResponse",schema:oa}})},fa=e=>ha(e,"CALENDAR-REMINDERS"),Ea=e=>ha(e,"CONTACTS");var ya=a(1629);const Oa=e=>{let{items:t,listDescription:a,isLoading:n,restoringArchiveId:i,onRestoreArchive:c}=e;const l=Object(u.c)({zero:"RecoveryPage.ArchivesTile.TotalNumber.Zero",one:"RecoveryPage.ArchivesTile.TotalNumber.One",two:"RecoveryPage.ArchivesTile.TotalNumber.Two",many:"RecoveryPage.ArchivesTile.TotalNumber.Many"},t.length),o=Object(u.a)("VoiceOver.RecoveryPage.ArchivesRecoveryList.ArchiveTableLabel"),s=Object(u.a)("RecoveryPage.ArchivesRecoveryList.LoadingDescription"),m=Object(u.a)("RecoveryPage.ArchivesRecoveryList.EmptyList"),p=t.map((e=>{let{deletionDate:t,archiveId:a}=e;return{archiveId:a,deletionDate:Object(ta.a)(t,"long")}})),v=r.createElement("div",{role:"table","aria-label":o},p.map((e=>r.createElement("div",{key:e.archiveId,role:"row"},r.createElement("div",{role:"cell",className:"date-cell"},r.createElement(ya.a,{"aria-hidden":!0,desiredFontSize:10,layoutMode:"glyphBox"}),e.deletionDate),r.createElement("div",{role:"cell",className:"restore-cell"},e.archiveId===i?r.createElement("span",{className:"restoring"},r.createElement(d.a,{description:Object(u.a)("RecoveryPage.ArchivesRecoveryList.RestoringArchiveDescription",{date:e.deletionDate})}),Object(u.a)("RecoveryPage.ArchivesRecoveryList.Restoring")):r.createElement(E.a,{className:"restore-button",variant:"push secondary neutral",ariaLabel:Object(u.a)("VoiceOver.RecoveryPage.ArchivesRecoveryList.RestoreButtonLabel",{date:e.deletionDate}),onActivate:()=>c(e.archiveId),disabled:void 0!==i},Object(u.a)("RecoveryPage.ArchivesRecoveryList.RestoreButton"))))))),g=r.createElement("div",{className:"empty-list"},m);return r.createElement("div",{className:"archives-recovery-list"},r.createElement("div",{className:"count"},l),r.createElement("div",{className:"description"},a),n?r.createElement("div",{className:"loading"},r.createElement(d.a,{description:s})):t.length?v:g)},ja=e=>{let{icon:t,modalTitle:a,modalDescription:n,learnMoreLink:i,titleId:c,...l}=e;const o=Object(u.a)("RecoveryPage.ArchivesRecoveryModalContent.LearnMore");return r.createElement("div",{className:"modal-content"},r.createElement("div",{className:"modal-icon","data-testid":"icon"},t),r.createElement("h2",{className:"modal-title","data-testid":"title",id:c},a),r.createElement("div",{className:"modal-description","data-testid":"description"},n," ",r.createElement(b.a,{href:i},o)),r.createElement(Oa,l))};var Sa=a(1228),Na=a(1190);const Pa="calendars-recovery-modal-title",wa=e=>{var t;let{items:a,isLoading:n,onRestoreArchive:i,restoringArchiveId:c}=e;const l=r.createElement(Jt.a,{iconSize:54,symbolSize:30,symbol:le.a,backgroundColor:"#F04634"}),o=1===(null===(t=Sa.a.sharedInstance.getApplicationConfiguration(Na.a))||void 0===t?void 0:t.applicationInfo.generation),s=o?Object(u.a)("RecoveryPage.CalendarsRecoveryModalContent.Reminders.Title"):Object(u.a)("RecoveryPage.CalendarsRecoveryModalContent.Title"),d=o?Object(u.a)("RecoveryPage.CalendarsRecoveryModalContent.Reminders.Description"):Object(u.a)("RecoveryPage.CalendarsRecoveryModalContent.Description"),m=Object(h.a)("restoreCalendars"),p=r.createElement(r.Fragment,null,Object(u.a)("RecoveryPage.CalendarsRecoveryModalContent.ListDescription.FirstLine"),r.createElement("ul",null,r.createElement("li",null,Object(u.a)("RecoveryPage.CalendarsRecoveryModalContent.ListDescription.BulletPointOne")),r.createElement("li",null,Object(u.a)("RecoveryPage.CalendarsRecoveryModalContent.ListDescription.BulletPointTwo")),r.createElement("li",null,Object(u.a)("RecoveryPage.CalendarsRecoveryModalContent.ListDescription.BulletPointThree"))));return r.createElement(ja,{icon:l,modalTitle:s,modalDescription:d,learnMoreLink:m,items:a,listDescription:p,isLoading:n,onRestoreArchive:i,titleId:Pa,restoringArchiveId:c})};function Ca(e,t,a){const n=Object(Ze.a)();return function(e,t,a){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:3;const c=r.useRef(0),[l,o]=r.useState("idle");return function(e,t){const a=r.useRef();r.useEffect((()=>{a.current=e}),[e]),r.useEffect((()=>{if(null!==t){const e=setInterval((function(){var e;null===(e=a.current)||void 0===e||e.call(a)}),t);return()=>clearInterval(e)}}),[t])}((()=>{e().then((e=>{"pending"===l&&"idle"===e&&(o("idle"),t())}),(()=>{c.current++,c.current>=i&&"pending"===l&&(o("idle"),a())}))}),"pending"===l?n:null),()=>{c.current=0,o("pending")}}((()=>e({webServices:n}).then((e=>"FREE"===e.status?"idle":"pending"))),t,a)}var Da=a(1324),Ta=a(1225),Ia=e=>({recordOpenedRecovery:Object(r.useCallback)((()=>{D.b.sharedInstance.recordStat(new C.a(`openedRecover${Object(Ta.a)(e)}`))}),[e]),recordStartedRecovery:Object(r.useCallback)((()=>{D.b.sharedInstance.recordStat(new C.a(`startedRecover${Object(Ta.a)(e)}`))}),[e])}),Aa=a(2194);const La=e=>{let{confirmationTitle:t,confirmationDescription:a,confirmationRestore:n,confirmationCancel:i,recoveryType:c,startRestore:l,endRestore:o}=e;const[s]=Object(Aa.b)(),d=Ia(c);return Object(r.useCallback)((e=>{s({title:t,description:a,buttons:[{title:n,action:"restore"},{title:i,action:"cancel"}],cancelAction:"cancel",onActionSelected:t=>{"cancel"===t?o():"restore"===t&&(d.recordStartedRecovery(),l(e))}})}),[t,a,n,i,l,o,s,d])},ka=()=>{var e;const t=Object(ne.b)(),a=Object(xe.a)({endpoint:Ue.b.listCalendarArchives,fetchProvider:e=>()=>ga(e,"CALENDAR-REMINDERS")}),n=Object(u.a)("RecoveryPage.ArchivesTile.Title.Calendars"),[i,c]=r.useState(void 0),l=Object(u.a)("RecoveryPage.CalendarArchivesRecoveryTileWrapper.Confirmation.Title"),o=Object(u.a)("RecoveryPage.CalendarArchivesRecoveryTileWrapper.Confirmation.Description"),s=Object(u.a)("Alert.CancelButton"),d=Object(u.a)("RecoveryPage.CalendarArchivesRecoveryTileWrapper.Confirmation.RestoreButton"),m=Object(u.a)("RecoveryPage.CalendarArchivesRecoveryTileWrapper.AlertSuccess.Title"),p=Object(u.a)("Alert.OkButton"),v=Object(u.a)("RecoveryPage.CalendarArchivesRecoveryTileWrapper.AlertFailure.Title"),g=Object(u.a)("RecoveryPage.CalendarArchivesRecoveryTileWrapper.AlertFailure.Description"),f=Object(u.a)("Alert.ContactSupport"),E=Ia("calendar"),y=Object(pe.a)(),[O,j]=Object(Da.b)("workflow","restore-calendar"),[S,N]=Object(Da.b)("load","calendar-recovery-tile",{measureFromBaseline:!0});r.useEffect((()=>{a.isLoading||(a.isSuccess?S():N())}),[a,S,N]);const P=()=>{j(),y({title:v,description:g,accessory:r.createElement(b.a,{className:"calendar-recovery-failure-alert-support-link",href:Object(h.a)("contactAppleSupport")},f),buttons:[p]}),D()},w=Ca(fa,(()=>{O(),y({title:m,description:Object(u.a)("RecoveryPage.CalendarArchivesRecoveryTileWrapper.AlertSuccess.Description",{time:(new Date).toLocaleTimeString(t,{hour12:!0,hour:"numeric",minute:"2-digit"})}),buttons:[p]}),D()}),P),C=function(e,t){const a=Object(Ze.a)();return Object($e.useMutation)((e=>((e,t)=>ba(e,"CALENDAR-REMINDERS",t))({webServices:a},e)),{onSuccess:e,onError:t})}((()=>{w()}),(()=>{P()})),D=()=>{c(void 0),a.refetch()},T=La({confirmationTitle:l,confirmationDescription:o,confirmationRestore:d,confirmationCancel:s,recoveryType:"calendar",startRestore:e=>{c(e),C.mutate(e)},endRestore:D}),I=(A={items:null!==(e=a.data)&&void 0!==e?e:[],isLoading:a.isLoading,onRestoreArchive:e=>{T(e)},restoringArchiveId:i},Object(Ae.a)(r.createElement(wa,A),{ariaLabelledBy:Pa}));var A;return r.createElement(aa,{error:a.error,isLoading:a.isLoading,isSuccess:a.isSuccess,refetch:a.refetch,deletedArchives:a.data,tileSize:Ht.c.Small,headingText:n,iconColor:"#FF3B30",iconSymbol:na.a,onTileClick:()=>{E.recordOpenedRecovery(),I()}})};var Ra=a(1630);const Fa="contacts-recovery-modal-title",Ma=e=>{let{items:t,isLoading:a,onRestoreArchive:n,restoringArchiveId:i}=e;const c=r.createElement(Jt.a,{iconSize:54,symbolSize:30,symbol:dt.a,backgroundColor:"#61BFF4"}),l=Object(u.a)("RecoveryPage.ContactsRecoveryModalContent.Title"),o=Object(u.a)("RecoveryPage.ContactsRecoveryModalContent.Description"),s=Object(h.a)("restoreContacts"),d=r.createElement(r.Fragment,null,Object(u.a)("RecoveryPage.ContactsRecoveryModalContent.ListDescription.FirstLine"),r.createElement("ul",null,r.createElement("li",null,Object(u.a)("RecoveryPage.ContactsRecoveryModalContent.ListDescription.BulletPointOne")),r.createElement("li",null,Object(u.a)("RecoveryPage.ContactsRecoveryModalContent.ListDescription.BulletPointTwo"))));return r.createElement(ja,{icon:c,modalTitle:l,modalDescription:o,learnMoreLink:s,items:t,listDescription:d,isLoading:a,onRestoreArchive:n,restoringArchiveId:i,titleId:Fa})},za=()=>{var e;const t=Object(ne.b)(),a=Object(xe.a)({endpoint:Ue.b.listContactArchives,fetchProvider:e=>()=>ga(e,"CONTACTS")}),n=Object(u.a)("RecoveryPage.ArchivesTile.Title.Contacts"),[i,c]=r.useState(void 0),l=Object(u.a)("RecoveryPage.ContactArchivesRecoveryTileWrapper.Confirmation.Title"),o=Object(u.a)("RecoveryPage.ContactArchivesRecoveryTileWrapper.Confirmation.Description"),s=Object(u.a)("Alert.CancelButton"),d=Object(u.a)("RecoveryPage.ContactArchivesRecoveryTileWrapper.Confirmation.RestoreButton"),m=Object(u.a)("RecoveryPage.ContactArchivesRecoveryTileWrapper.AlertSuccess.Title"),p=Object(u.a)("Alert.OkButton"),v=Object(u.a)("RecoveryPage.ContactArchivesRecoveryTileWrapper.AlertFailure.Title"),g=Object(u.a)("RecoveryPage.ContactArchivesRecoveryTileWrapper.AlertFailure.Description"),f=Object(u.a)("Alert.ContactSupport"),E=Ia("contact"),y=Object(pe.a)(),[O,j]=Object(Da.b)("workflow","restore-contacts"),[S,N]=Object(Da.b)("load","contacts-recovery-tile",{measureFromBaseline:!0});r.useEffect((()=>{a.isLoading||(a.isSuccess?S():N())}),[a,S,N]);const P=()=>{j(),y({title:v,description:g,accessory:r.createElement(b.a,{className:"contact-recovery-failure-alert-support-link",href:Object(h.a)("contactAppleSupport")},f),buttons:[p]}),D()},w=Ca(Ea,(()=>{O(),y({title:m,description:Object(u.a)("RecoveryPage.ContactArchivesRecoveryTileWrapper.AlertSuccess.Description",{time:(new Date).toLocaleTimeString(t,{hour12:!0,hour:"numeric",minute:"2-digit"})}),buttons:[p]}),D()}),P),C=function(e,t){const a=Object(Ze.a)();return Object($e.useMutation)((e=>((e,t)=>ba(e,"CONTACTS",t))({webServices:a},e)),{onSuccess:e,onError:t})}((()=>{w()}),(()=>{P()})),D=()=>{c(void 0),a.refetch()},T=La({confirmationTitle:l,confirmationDescription:o,confirmationRestore:d,confirmationCancel:s,recoveryType:"contact",startRestore:e=>{c(e),C.mutate(e)},endRestore:D}),I=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(Ae.a)(r.createElement(Ma,e),{ariaLabelledBy:Fa,closeButtonDisabled:t})}({items:null!==(e=a.data)&&void 0!==e?e:[],isLoading:a.isLoading,onRestoreArchive:e=>{T(e)},restoringArchiveId:i},void 0!==i);return r.createElement(aa,{error:a.error,isLoading:a.isLoading,isSuccess:a.isSuccess,refetch:a.refetch,deletedArchives:a.data,tileSize:Ht.c.Small,headingText:n,iconColor:"#5AC8FA",iconSymbol:Ra.a,onTileClick:()=>{E.recordOpenedRecovery(),I()}})};var Ba=a(1349),xa=a(1623),Ua=a(1620),_a=a(1621),Wa=a(2195),Ha=a(1622),Va=function(e){return e[e.SELECTING=0]="SELECTING",e[e.RESTORING=1]="RESTORING",e[e.DELETING=2]="DELETING",e}(Va||{});function qa(e){let{bookmark:t,checked:a,onCheck:n}=e;const i=t.deletionDate,c=Math.min(Math.max(0,Math.floor((Date.now()-i.getTime())/1e3/60/60/24)),30),l=Math.max(30-c,0),o=(()=>{switch(c){case 0:return Object(u.a)("RecoveryPage.BookmarksRecoveryModal.DeletedToday",{daysRemaining:l});case 1:return Object(u.a)("RecoveryPage.BookmarksRecoveryModal.DeletedYesterday",{daysRemaining:l});default:return Object(u.a)("RecoveryPage.BookmarksRecoveryModal.DeletedDaysAgo",{daysAgo:c,daysRemaining:l})}})();return r.createElement("div",{className:"deleted-bookmark-row"},r.createElement("div",null,r.createElement(ke.a,{id:t.recordName,checked:a,onStateChange:e=>n(e.checked,t.recordName)})),r.createElement("div",{className:"middle-column"},r.createElement(Ee.a,{htmlFor:t.recordName},t.title),r.createElement("div",{className:"bookmark-date"},o),r.createElement("div",{className:"bookmark-link"},r.createElement(b.a,{hideArrow:!0,href:t.url},t.url))),r.createElement("div",{className:"folder-label"},t.folder,"\xa0",t.isFavoritesBar?r.createElement(Ua.a,{"aria-hidden":"true",desiredFontSize:8,layoutMode:"glyphBox"}):r.createElement(_a.a,{"aria-hidden":"true",desiredFontSize:8,layoutMode:"glyphBox"})))}function Ga(e,t){const a={};if(t.newChecked)for(const n of t.deletedBookmarks)t.newChecked[n.recordName]&&(a[n.recordName]=!0);else for(const n of t.deletedBookmarks)e[n.recordName]&&(a[n.recordName]=!0);return a}const Ka=()=>{const[e,t]=$t(),a=Ia("bookmark"),n=Object(u.b)({zero:"RecoveryPage.BookmarksTile.TotalNumber.Zero",one:"RecoveryPage.BookmarksTile.TotalNumber.One",two:"RecoveryPage.BookmarksTile.TotalNumber.Two",many:"RecoveryPage.BookmarksTile.TotalNumber.Many"},e.length),[i,c]=r.useState(Va.SELECTING),o=i===Va.RESTORING,s=i===Va.DELETING,m=i!==Va.SELECTING,[p,v]=r.useReducer(Ga,{}),[g]=Object(Aa.b)(),[f,y]=Object(Da.b)("workflow","restore-bookmarks");r.useEffect((()=>{v({deletedBookmarks:e})}),[e]);const[O,j]=r.useState("date"),S=(()=>{switch(O){case"name":return[...e].sort(((e,t)=>e.title.localeCompare(t.title)));case"folder":return[...e].sort(((e,t)=>e.folder.localeCompare(t.folder)));default:return[...e].sort(((e,t)=>t.deletionDate.getTime()-e.deletionDate.getTime()))}})(),N=S.every((e=>!!p[e.recordName])),P=S.some((e=>!!p[e.recordName])),w=(t,a)=>{const n={...p};n[a]=t,v({deletedBookmarks:e,newChecked:n})},C=r.useMemo((()=>[m?["set","inert"]:["remove","inert"]]),[m]),D=Object(Ha.a)(C);return r.createElement(r.Fragment,null,r.createElement("div",{className:"bookmarks-recovery-modal-content"},r.createElement("div",{className:"bookmarks-recovery-modal-icon","data-testid":"icon"},r.createElement(Jt.a,{iconSize:54,symbolSize:30,symbol:Ba.a,backgroundColor:"#FF9500"})),r.createElement("h2",{className:"bookmarks-recovery-modal-title","data-testid":"title",id:"bookmarks-recovery-modal-title-id"},Object(u.a)("RecoveryPage.BookmarksRecoveryModal.Title")),r.createElement("div",{className:"bookmarks-recovery-modal-description","data-testid":"description"},Object(u.a)("RecoveryPage.BookmarksRecoveryModal.Description")," ",r.createElement(b.a,{href:Object(h.a)("restoreBookmarks")},Object(u.a)("RecoveryPage.BookmarksRecoveryModal.LearnMore"))),r.createElement("div",{className:l()("bookmarks-recovery-list",{blocked:m}),ref:D},r.createElement("div",{className:"count"},n),r.createElement("div",{className:"description"},Object(u.a)("RecoveryPage.BookmarksRecoveryModal.ListDescription.FirstLine")),t?r.createElement("div",{className:"loading"},r.createElement(d.a,{description:Object(u.a)("RecoveryPage.BookmarksRecoveryModal.LoadingDescription")})):S.length?r.createElement(r.Fragment,null,r.createElement("div",{className:"header"},r.createElement(E.a,{variant:"standard bookmarks-recovery",onActivate:()=>{const t={};for(const a of e)t[a.recordName]=!N;v({deletedBookmarks:e,newChecked:t})}},N?Object(u.a)("RecoveryPage.BookmarksRecoveryModal.DeselectAll"):Object(u.a)("RecoveryPage.BookmarksRecoveryModal.SelectAll")),r.createElement("div",{className:"flex-space"}),r.createElement($a,{onSortChange:e=>{let{value:t}=e;j(t)}})),S.map((e=>r.createElement(qa,{bookmark:e,checked:!!p[e.recordName],onCheck:w,key:e.recordName})))):r.createElement("div",null,Object(u.a)("RecoveryPage.BookmarksRecoveryModal.EmptyList")))),!m&&r.createElement(Ya,{hidden:!P},r.createElement(E.a,{variant:"block secondary large",disabled:!P,onActivate:()=>{g({title:Object(u.a)("RecoveryPage.BookmarksRecoveryModal.DeletePrompt.Title"),description:Object(u.a)("RecoveryPage.BookmarksRecoveryModal.DeletePrompt.Description"),buttons:[{title:"Delete",destructive:!0,action:"delete"},{title:Object(u.a)("RecoveryPage.BookmarksRecoveryModal.DeletePrompt.Cancel"),action:"cancel"}],cancelAction:"cancel",onActionSelected:t=>{"delete"===t&&(async()=>{c(Va.DELETING),await function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gt.a.shared).deleteBookmarkRecords(e.map((e=>e.recordName)))}(e.filter((e=>!!p[e.recordName]))),c(Va.SELECTING)})()}})}},Object(u.a)("RecoveryPage.BookmarksRecoveryModal.Delete")),r.createElement("div",{className:"flex-space"}),r.createElement(E.a,{className:"block primary large",disabled:!P,onActivate:async()=>{a.recordStartedRecovery(),c(Va.RESTORING);const t=await function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gt.a.shared).restoreBookmarkRecords(e.map((e=>e.recordName)))}(e.filter((e=>!!p[e.recordName])));t?f():y(),c(Va.SELECTING)}},Object(u.a)("RecoveryPage.BookmarksRecoveryModal.Restore"))),o&&r.createElement(Za,{text:Object(u.a)("RecoveryPage.BookmarksRecoveryModal.Restoring")}),s&&r.createElement(Za,{text:Object(u.a)("RecoveryPage.BookmarksRecoveryModal.Deleting")}))};function $a(e){return r.createElement(Wa.a,{variant:"standard bookmarks-recovery",shouldUseNativeControl:!0,defaultValue:"date",onStateChange:e.onSortChange,chevronAsset:r.createElement(r.Fragment,null,"\xa0",r.createElement(xa.a,{layoutMode:"glyphBox",desiredFontSize:9}))},r.createElement(Wa.c,{value:"date"},Object(u.a)("RecoveryPage.BookmarksRecoveryModal.DateDeleted")),r.createElement(Wa.c,{value:"name"},Object(u.a)("RecoveryPage.BookmarksRecoveryModal.Name")),r.createElement(Wa.c,{value:"folder"},Object(u.a)("RecoveryPage.BookmarksRecoveryModal.Folder")))}function Za(e){return r.createElement(Ya,null,r.createElement("div",{className:"bottom-spinner-bar"},r.createElement(d.a,{variant:"standard bookmarks-recovery",description:"","aria-hidden":"true"}),r.createElement("span",{className:"status"},e.text)))}function Ya(e){return r.createElement("div",{className:l()("bottom-bar",{"visually-hidden":!0===e.hidden})},e.children)}var Qa=a(2251),Xa=a(2211),Ja=a(2267),en=a(1619),tn=a(2245),an=a(1624),nn=a(1142),rn=a(1210),cn=a(2262),ln=a(2161);const on=e=>{if(!Number.isFinite(e))return"0";const t=-1===Math.sign(e)?"-":"";return(e=Math.abs(e))<1?`${t}0`:`${t}1${"0".repeat(Math.floor(Math.log10(e)))}`};const sn=e=>{let{percentage:t,animated:a=!0,className:n,ariaLabel:i}=e;const c=Math.max(0,Math.min(100,t));return r.createElement("div",{className:l()("progress-bar",n),role:"progressbar","aria-valuenow":c,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},r.createElement("div",{className:l()("progress-bar-fill",{"no-animation":!a}),style:{width:`${c}%`}}))};var dn=a(1625),un=a(1627),mn=a(2225),pn=a(1484),vn=a(1626),gn=a(1263),bn=function(e){return Object(r.createElement)(gn.a,{originalProps:e,metadata:{name:"arrow.trianglehead.2.clockwise.rotate.90.icloud",svgPath:"M105.192 3.25674C119.912 3.25674 131.465-7.55716 131.465-21.0301C131.465-31.2556 125.571-40.1325 115.985-44.1371C116.081-65.9081 100.478-81.6491 80.5047-81.6491C67.2127-81.6491 57.8173-74.5654 51.9646-66.0277C39.964-69.5217 26.881-60.4358 26.6126-46.7001C15.5666-44.9702 8.72266-35.1099 8.72266-23.1916C8.72266-8.84446 21.2514 3.18389 37.9536 3.18389ZM105.182-4.64848L37.9431-4.66958C25.6344-4.66958 16.5761-13.2274 16.5761-23.1916C16.5761-32.9639 22.4644-40.6897 32.8482-40.6897C33.5019-40.6897 33.7923-41.053 33.7923-41.7067C33.7923-56.7055 44.572-61.1698 54.6051-57.9154C55.1965-57.7285 55.5598-57.8531 55.8607-58.3928C60.5758-66.8356 67.8453-73.7956 80.5047-73.7956C96.5065-73.7956 107.61-61.0759 108.401-46.573C108.526-44.3426 108.391-41.7182 108.184-39.3939C108.132-38.7507 108.37-38.3874 108.962-38.2628C117.85-36.3399 123.623-29.8572 123.623-21.0301C123.623-11.9085 115.54-4.64848 105.182-4.64848ZM46.0025-30.5848L60.1472-30.5848C61.9299-30.5848 62.3344-32.2947 61.329-33.694L55.0096-42.4961C53.9926-43.9492 52.1571-44.0527 51.0366-42.4961L44.8313-33.694C43.8364-32.3052 44.2409-30.5848 46.0025-30.5848ZM71.9891-12.1868C77.1307-12.1868 81.8774-14.0368 85.2429-16.7295C87.1693-18.2007 87.2105-20.2729 86.278-21.516C85.3972-22.6661 83.5838-23.0907 81.5845-21.7124C78.9657-19.6418 75.7525-18.3515 71.9891-18.3515C63.3036-18.3515 56.2391-25.416 56.2391-34.0497C56.2391-35.7385 54.8714-37.158 53.1826-37.158C51.4939-37.158 50.1262-35.7385 50.1262-34.0497C50.1262-21.9867 59.9261-12.1868 71.9891-12.1868ZM97.9239-37.5665L83.831-37.5665C81.9965-37.5665 81.592-35.8566 82.5975-34.4467L88.9581-25.6552C89.9856-24.1915 91.7693-24.0468 92.8898-25.6552L99.1364-34.4467C100.142-35.7943 99.7373-37.5665 97.9239-37.5665ZM71.9891-55.9644C66.8369-55.9644 62.0902-54.1144 58.7353-51.4112C56.7983-49.94 56.7053-47.8784 57.7002-46.6247C58.581-45.4746 60.3427-45.0606 62.3314-46.4283C64.9502-48.4989 68.2257-49.7892 71.9891-49.7892C80.664-49.7892 87.7285-42.7247 87.7285-34.0497C87.7285-32.4022 89.0962-30.9933 90.7956-30.9933C92.4843-30.9933 93.852-32.4022 93.852-34.0497C93.852-46.1645 84.0521-55.9644 71.9891-55.9644Z",layoutBox:{viewBox:"0 0 143.4599609375 108.103759765625",width:143.4599609375,height:108.103759765625,translateX:1.635009765625,translateY:89.2818603515625,baseline:89.2818603515625,capline:18.8218994140625},glyphBox:{viewBox:"0 0 122.74462890625 92.838134765625",width:122.74462890625,height:92.838134765625,translateX:-8.72265625,translateY:81.6490478515625,baseline:81.6490478515625,capline:11.1890869140625}}})},hn=function(e){return Object(r.createElement)(gn.a,{originalProps:e,metadata:{name:"exclamationmark.icloud",svgPath:"M105.192 3.25674C119.912 3.25674 131.465-7.55716 131.465-21.0301C131.465-31.2556 125.571-40.1325 115.985-44.1371C116.081-65.9081 100.478-81.6491 80.5047-81.6491C67.2127-81.6491 57.8173-74.5654 51.9646-66.0277C39.964-69.5217 26.881-60.4358 26.6126-46.7001C15.5666-44.9702 8.72266-35.1099 8.72266-23.1916C8.72266-8.84446 21.2514 3.18389 37.9536 3.18389ZM105.182-4.64848L37.9431-4.66958C25.6344-4.66958 16.5761-13.2274 16.5761-23.1916C16.5761-32.9639 22.4644-40.6897 32.8482-40.6897C33.5019-40.6897 33.7923-41.053 33.7923-41.7067C33.7923-56.7055 44.572-61.1698 54.6051-57.9154C55.1965-57.7285 55.5598-57.8531 55.8607-58.3928C60.5758-66.8356 67.8453-73.7956 80.5047-73.7956C96.5065-73.7956 107.61-61.0759 108.401-46.573C108.526-44.3426 108.391-41.7182 108.184-39.3939C108.132-38.7507 108.37-38.3874 108.962-38.2628C117.85-36.3399 123.623-29.8572 123.623-21.0301C123.623-11.9085 115.54-4.64848 105.182-4.64848ZM70.12-30.207C72.4825-30.207 73.7784-31.5239 73.8819-34.0839L74.5557-51.9719C74.6592-54.646 72.6905-56.5216 70.0682-56.5216C67.4564-56.5216 65.529-54.6977 65.6325-52.0236L66.3063-34.0839C66.4098-31.5757 67.7056-30.207 70.12-30.207ZM70.0682-14.5996C72.8996-14.5996 75.3465-16.8195 75.3465-19.6815C75.3465-22.5435 72.9513-24.7528 70.0682-24.7528C67.2474-24.7528 64.8416-22.4917 64.8416-19.6815C64.8416-16.8712 67.2991-14.5996 70.0682-14.5996Z",layoutBox:{viewBox:"0 0 143.4599609375 108.103759765625",width:143.4599609375,height:108.103759765625,translateX:1.635009765625,translateY:89.2818603515625,baseline:89.2818603515625,capline:18.8218994140625},glyphBox:{viewBox:"0 0 122.74462890625 92.838134765625",width:122.74462890625,height:92.838134765625,translateX:-8.72265625,translateY:81.6490478515625,baseline:81.6490478515625,capline:11.1890869140625}}})},fn=function(e){return Object(r.createElement)(gn.a,{originalProps:e,metadata:{name:"checkmark.icloud",svgPath:"M105.192 3.25674C119.912 3.25674 131.465-7.55716 131.465-21.0301C131.465-31.2556 125.571-40.1325 115.985-44.1371C116.081-65.9081 100.478-81.6491 80.5047-81.6491C67.2127-81.6491 57.8173-74.5654 51.9646-66.0277C39.964-69.5217 26.881-60.4358 26.6126-46.7001C15.5666-44.9702 8.72266-35.1099 8.72266-23.1916C8.72266-8.84446 21.2514 3.18389 37.9536 3.18389ZM105.182-4.64848L37.9431-4.66958C25.6344-4.66958 16.5761-13.2274 16.5761-23.1916C16.5761-32.9639 22.4644-40.6897 32.8482-40.6897C33.5019-40.6897 33.7923-41.053 33.7923-41.7067C33.7923-56.7055 44.572-61.1698 54.6051-57.9154C55.1965-57.7285 55.5598-57.8531 55.8607-58.3928C60.5758-66.8356 67.8453-73.7956 80.5047-73.7956C96.5065-73.7956 107.61-61.0759 108.401-46.573C108.526-44.3426 108.391-41.7182 108.184-39.3939C108.132-38.7507 108.37-38.3874 108.962-38.2628C117.85-36.3399 123.623-29.8572 123.623-21.0301C123.623-11.9085 115.54-4.64848 105.182-4.64848ZM66.5932-15.9814C68.2302-15.9814 69.5979-16.727 70.4893-18.2299L89.6203-49.2817C90.1178-50.1002 90.7081-51.1986 90.7081-52.3381C90.7081-54.4937 88.8737-56.0895 86.5945-56.0895C85.2163-56.0895 83.9003-55.271 83.0712-53.8822L66.3757-26.0336L57.9967-37.0178C57.1054-38.2714 55.914-38.9759 54.4217-38.9759C52.2049-38.9759 50.4633-37.2459 50.4633-34.914C50.4633-33.9086 50.8055-32.9137 51.5828-31.9188L62.4901-18.1676C63.6614-16.6235 64.9668-15.9814 66.5932-15.9814Z",layoutBox:{viewBox:"0 0 143.4599609375 108.103759765625",width:143.4599609375,height:108.103759765625,translateX:1.635009765625,translateY:89.2818603515625,baseline:89.2818603515625,capline:18.8218994140625},glyphBox:{viewBox:"0 0 122.74462890625 92.838134765625",width:122.74462890625,height:92.838134765625,translateX:-8.72265625,translateY:81.6490478515625,baseline:81.6490478515625,capline:11.1890869140625}}})};const En="file-recovery-modal-title";function yn(e){var t,a;const n=Object(rn.d)(),[i,c]=r.useState({}),[l,o]=r.useState("date"),s=r.useCallback((e=>{C.a.withEventAndLabel("workflow","filerecovery.performSortBy",{statCategory:ve.a.SESSION,sortBy:e,previousSortBy:l}).record(),o(e)}),[l]),[m,p]=r.useState(!1),[v,g]=r.useState(!1),h=r.useMemo((()=>{if(!e.deletedDriveItems)return;const t=[...e.deletedDriveItems];return"date"===l?t.sort(((e,t)=>e.deletionDate.getTime()-t.deletionDate.getTime())):"name"===l?t.sort(((e,t)=>e.fileName.localeCompare(t.fileName))):"size"===l&&t.sort(((e,t)=>e.size-t.size)),t}),[e.deletedDriveItems,l]),f=Object.values(i).filter((e=>!!e)),y=!!h&&h.every((e=>!!i[e.drivewsid])),j=()=>{const e={};y||null===h||void 0===h||h.forEach((t=>{e[t.drivewsid]=t})),c(e)},[S]=Object(Aa.b)(),{refetch:N}=e,P=r.createElement(Jt.a,{iconSize:54,symbolSize:30,symbol:an.a,backgroundColor:"#AF52DF"}),w=r.useCallback((e=>(t,a)=>{let n=f;"Restore"===e&&t&&(n=f.filter((e=>t.includes(e.itemid))));const i={one:`FileRecovery.${e}.Error.Title.One`,two:`FileRecovery.${e}.Error.Title.Two`,many:`FileRecovery.${e}.Error.Title.Many`},l=`FileRecovery.${e}.Error.Description`,o=a&&a.length>0;S({className:"file-recovery-alert",variant:"standard",icon:r.createElement(hn,{height:30,width:43,layoutMode:"glyphBox"}),title:Object(u.b)(i,n.length),description:o?Object(u.b)({one:"FileRecovery.Restore.Error.OutOfStorage.Description.One",two:"FileRecovery.Restore.Error.OutOfStorage.Description.Two",many:"FileRecovery.Restore.Error.OutOfStorage.Description.Many"},a.length):Object(u.a)(l),accessory:r.createElement(Nn,{items:n}),buttons:[{title:Object(u.a)("FileRecovery.Error.OK.Button"),action:"confirm",shouldCloseOnClick:!0}],onActionSelected:()=>{c({}),N()}})}),[f,S,N]),D=function(e){const t=Object(Ze.a)(),[a,n]=Object(r.useState)({isLoading:!1,restoredItemIds:[],failedItemIds:[],isPaused:!1,isCancelled:!1,isError:!1,isSuccess:!1,error:null,data:void 0}),i=Object(r.useRef)(!1),c=Object(r.useRef)(!1),l=Object(r.useCallback)((()=>{i.current=!0,n((e=>({...e,isPaused:!0})))}),[]),o=Object(r.useCallback)((()=>{i.current=!1,n((e=>({...e,isPaused:!1})))}),[]),s=Object(r.useCallback)((()=>{c.current=!0,n((e=>({...e,isCancelled:!0})))}),[]),d=Object(r.useCallback)((async e=>{if(c.current)return{shouldBreak:!0,restoredIds:[],failedIds:[],failedIdsWithStorageError:[],failureStatusCounts:{}};for(;i.current&&!c.current;)await new Promise((e=>setTimeout(e,1e3)));if(c.current)return{shouldBreak:!0,restoredIds:[],failedIds:[],failedIdsWithStorageError:[],failureStatusCounts:{}};try{const a=await(async(e,t)=>{let{webServices:a}=e;if(null===a||void 0===a||!a.docws)throw new Error("restoreDeletedDriveFiles: no service url available");return Object(_e.a)({url:Object(Ue.x)(a.docws),method:"PUT",includeCredentials:!0,body:{drive_item_update_request:{is_recover:"true"},item_ids:t},validate:{type:"RestoreDriveFilesResponse",schema:ma}}).then((e=>function(e,t){var a;const n=[],r=[],i=[],c={};null===(a=e.drive_items_with_status)||void 0===a||a.forEach((e=>{const t=e.drive_items.drive_item.map((e=>e.item_id));if("OK"===e.status_message)n.push(...t);else{var a;r.push(...t);const n=e.status_message||"UNKNOWN_ERROR";c[n]=(c[n]||0)+t.length,null!==(a=e.status_message)&&void 0!==a&&a.includes("QUOTA_EXCEEDED")&&i.push(...t)}}));const l=new Set([...n,...r]),o=t.filter((e=>!l.has(e))),s=[...r,...o];return{restoredIds:n,failedIds:s,failedIdsWithStorageError:i,failureStatusCounts:c}}(e,t)))})({webServices:t},e);return{shouldBreak:!1,restoredIds:a.restoredIds,failedIds:a.failedIds,failedIdsWithStorageError:a.failedIdsWithStorageError,failureStatusCounts:a.failureStatusCounts||{}}}catch(a){return{shouldBreak:!1,restoredIds:[],failedIds:e,failedIdsWithStorageError:[],failureStatusCounts:{}}}}),[t]),u=Object(r.useCallback)((async t=>{if(C.a.withEventAndLabel("workflow","filerecovery.restoreSelectedFiles.start",{statCategory:ve.a.SESSION,selectedItemsCountMagnitude:on(t.length)}).record(),0===t.length)return n({isLoading:!1,restoredItemIds:[],failedItemIds:[],isPaused:!1,isCancelled:!1,isError:!1,isSuccess:!0,error:null,data:[]}),void setTimeout((()=>{e([],[])}),0);c.current=!1,i.current=!1,n({isLoading:!0,restoredItemIds:[],failedItemIds:[],isPaused:!1,isCancelled:!1,isError:!1,isSuccess:!1,error:null,data:void 0});const a=[],r=[],l=[],o={},s=(e=>{const t=[];for(let a=0;a<e.length;a+=100)t.push(e.slice(a,a+100));return t})(t);for(const e of s){const t=await d(e);if(t.shouldBreak)break;a.push(...t.restoredIds),r.push(...t.failedIds),l.push(...t.failedIdsWithStorageError),Object.entries(t.failureStatusCounts).forEach((e=>{let[t,a]=e;o[t]=(o[t]||0)+a})),n((e=>({...e,restoredItemIds:[...e.restoredItemIds,...t.restoredIds],failedItemIds:[...e.failedItemIds,...t.failedIds]})))}if(n({isLoading:!1,restoredItemIds:a,failedItemIds:r,isPaused:!1,isCancelled:!1,isError:!1,isSuccess:!0,error:null,data:a}),r.length>0){const e={statCategory:ve.a.SESSION,failedItemsCountMagnitude:on(r.length),totalSelectedItemsMagnitude:on(t.length)};Object.keys(o).length>0&&(e.failureStatusCounts=Object.fromEntries(Object.entries(o).map((e=>{let[t,a]=e;return[t,on(a)]})))),C.a.withEventAndLabel("workflow","filerecovery.restoreSelectedFiles.failure",e).record()}else C.a.withEventAndLabel("workflow","filerecovery.restoreSelectedFiles.success",{statCategory:ve.a.SESSION,restoredItemsCountMagnitude:on(a.length)}).record();setTimeout((()=>{c.current||e(r,l)}),500)}),[e,d]),m=Object(r.useCallback)((()=>{n({isLoading:!1,restoredItemIds:[],failedItemIds:[],isPaused:!1,isCancelled:!1,isError:!1,isSuccess:!1,error:null,data:void 0})}),[]);return{...a,restoreFiles:u,pause:l,resume:o,cancel:s,mutate:u,isLoading:a.isLoading,reset:m}}(r.useCallback(((e,t)=>{p(!1),e.length>0?w("Restore")(e,t):S({className:"file-recovery-alert",variant:"standard",icon:r.createElement(fn,{height:30,width:43,layoutMode:"glyphBox"}),title:1===f.length?Object(u.a)("FileRecovery.Success.Title.One"):Object(u.a)("FileRecovery.Success.Title.Many",{count:f.length}),description:1===f.length?Object(u.a)("FileRecovery.Success.Description.One"):Object(u.a)("FileRecovery.Success.Description.Many"),buttons:[{title:Object(u.a)("FileRecovery.Error.OK.Button"),action:"confirm",shouldCloseOnClick:!0}],onActionSelected:()=>{c({}),N()}})}),[w,N,f.length,S]),w("Restore")),T=r.useMemo((()=>{var e;return m?r.createElement(Sn,{text:Object(u.b)({one:"FileRecovery.Restoring.One",two:"FileRecovery.Restoring.Two",many:"FileRecovery.Restoring.Many"},f.length),totalItemsCount:f.length,restoredItemsCount:(null===(e=D.restoredItemIds)||void 0===e?void 0:e.length)||0,onClose:()=>{var e;D.pause();const t=(null===(e=D.restoredItemIds)||void 0===e?void 0:e.length)||0,a=f.length-t;S({className:"file-recovery-alert",icon:r.createElement(hn,{height:30,width:43,layoutMode:"glyphBox"}),variant:"standard",title:Object(u.a)("FileRecovery.Cancel.Title"),description:1===a?Object(u.b)({one:"FileRecovery.Cancel.Description.One",two:"FileRecovery.Cancel.Description.Two.OneRemaining",many:"FileRecovery.Cancel.Description.Many.OneRemaining"},f.length,{restoredItems:t.toString(),totalItems:f.length.toString(),remainingItems:a.toString()}):Object(u.b)({one:"FileRecovery.Cancel.Description.One",two:"FileRecovery.Cancel.Description.Two",many:"FileRecovery.Cancel.Description.Many"},f.length,{restoredItems:t.toString(),totalItems:f.length.toString(),remainingItems:a.toString()}),buttons:[{title:Object(u.a)("FileRecovery.Cancel.Cancel"),action:"confirm-cancel",shouldCloseOnClick:!0},{title:Object(u.a)("FileRecovery.Cancel.Continue"),action:"continue",shouldCloseOnClick:!0}],cancelAction:"confirm-cancel",defaultAction:"confirm-cancel",onActionSelected:e=>{"confirm-cancel"===e?(D.cancel(),p(!1),c({}),N()):"continue"===e&&D.resume()}})}}):null}),[m,f.length,D,S,N]),I=r.useMemo((()=>v?r.createElement(Sn,{text:Object(u.b)({one:"FileRecovery.Purging.One",two:"FileRecovery.Purging.Two",many:"FileRecovery.Purging.Many"},f.length)}):null),[v,f.length]),[A,L]=Object(re.a)(T,{ariaLabel:Object(u.a)("FileRecovery.Progress.PopupAriaLabel"),className:"restore-progress-popup"}),[k,R]=Object(re.a)(I,{ariaLabel:Object(u.a)("FileRecovery.Progress.PopupAriaLabel"),className:"restore-progress-popup"});r.useEffect((()=>{m?A():L()}),[m,A,L]),r.useEffect((()=>{v?k():R()}),[v,k,R]);const F=function(e,t){const a=Object(Ze.a)();return Object($e.useMutation)((e=>(C.a.withEventAndLabel("workflow","filerecovery.purgeSelectedFiles.start",{statCategory:ve.a.SESSION,selectedItemsCountMagnitude:on(e.length)}).record(),(async(e,t)=>{let{webServices:a}=e;if(null===a||void 0===a||!a.docws)throw new Error("purgeDeletedDriveItems: no service url available");const n={};for(const r of t)n[r.zone]?n[r.zone].push(r.docwsid):n[r.zone]=[r.docwsid];return Promise.all(Object.entries(n).map((e=>{let[t,n]=e;return Object(_e.c)({url:Object(Ue.s)(a.docws,t),method:"POST",includeCredentials:!0,body:{documentIds:n}})})))})({webServices:a},e))),{onSuccess:()=>{C.a.withEventAndLabel("workflow","filerecovery.purgeSelectedFiles.success",{statCategory:ve.a.SESSION}).record(),e()},onError:e=>{const a=e instanceof Error?e.name:"unknown",n=e instanceof Error?e.message:"unknown";C.a.withEventAndLabel("workflow","filerecovery.purgeSelectedFiles.failure",{statCategory:ve.a.SESSION,errorType:a,errorMessage:n}).record(),t()}})}(r.useCallback((()=>{g(!1),S({className:"file-recovery-alert",variant:"standard",icon:r.createElement(fn,{height:30,width:43,layoutMode:"glyphBox"}),title:Object(u.a)("FileRecovery.Purge.Success.Title"),description:Object(u.a)("FileRecovery.Purge.Success.Description"),buttons:[{title:Object(u.a)("FileRecovery.Error.OK.Button"),action:"confirm",shouldCloseOnClick:!0}],onActionSelected:()=>{c({}),N()}})}),[S,c,N,g]),r.useCallback((e=>{g(!1),w("Purge")(e)}),[w,g])),M=Object(u.a)("RecoveryPage.FilesRecoveryModalContent.Title");r.useLayoutEffect((()=>{const e=document.querySelector(".modal-header"),t=document.querySelector(".file-recovery-modal-content"),a=document.querySelector(".header-control-container");if(!e||!t||!a)return;const n=()=>{t.scrollTop>300?(e.classList.add("show"),a.classList.add("show")):(e.classList.remove("show"),a.classList.remove("show"))};return t.addEventListener("scroll",n),()=>{t.removeEventListener("scroll",n)}}),[]);const z=h&&h.length>0,B=(e.isLoading||e.hasNextPage)&&!z,x=!e.isLoading&&!e.hasNextPage;return r.createElement("div",{className:"modal-container"},r.createElement("div",{className:"header-control-container"},r.createElement(On,{sortBy:l,onSortChange:s,disabled:e.isLoading||e.hasNextPage&&!e.error,allItemsSelected:y,onSelectAll:j,deletedDriveItemsCount:null===(t=e.deletedDriveItems)||void 0===t?void 0:t.length})),r.createElement("div",{className:"file-recovery-modal-content"},r.createElement("div",{className:"modal-icon","data-testid":"icon"},P),r.createElement("h2",{className:"modal-title","data-testid":"title",id:En},M),r.createElement("div",{className:"modal-description","data-testid":"description"},r.createElement(O.a,{interpolations:{"#{learnMoreLink}":r.createElement(b.a,{href:"https://support.apple.com/guide/icloud/recover-deleted-files-mmae56ea1ca5/icloud"},Object(u.a)("FileRecovery.ModalDescription.LearnMoreLink"))}},Object(u.a)("FileRecovery.ModalDescription"))),e.error&&r.createElement("div",{className:"error-loading-all"},r.createElement(O.a,{interpolations:{"#{tryAgainButton}":r.createElement(E.a,{className:"reload-button",onActivate:N},r.createElement(dn.a,{"aria-hidden":!0,className:"arrow-clockwise",height:20,width:20,layoutMode:"glyphBox"}),Object(u.a)("ErrorHomeTileContent.TryAgain"))}},Object(u.a)("FileRecovery.Error.LoadingAllFiles.Text"))),B&&!e.error&&r.createElement("div",{className:"spinner initial-loading"},r.createElement(d.a,{description:Object(u.a)("FileRecovery.TombstonesLoading")})),x&&!z&&!e.error&&r.createElement("div",{className:"file-count"},Object(u.a)("FileRecovery.NoFiles")),!e.error&&z&&r.createElement(r.Fragment,null,e.hasNextPage&&r.createElement("div",{className:"spinner"},r.createElement(d.a,{description:Object(u.a)("FileRecovery.TombstonesLoading"),size:14}),Object(u.a)("FileRecovery.TombstonesLoading")),r.createElement("div",{className:"file-count"},f.length>0?Object(u.b)({one:"FileRecovery.FileCount.One",two:"FileRecovery.FileCount.Two",many:"FileRecovery.FileCount.Many"},f.length):Object(u.a)("FileRecovery.SelectFile")),r.createElement(On,{sortBy:l,onSortChange:s,disabled:e.isLoading||e.hasNextPage&&!e.error,allItemsSelected:y,onSelectAll:j,deletedDriveItemsCount:null===(a=e.deletedDriveItems)||void 0===a?void 0:a.length}),r.createElement(jn,{deletedDriveItems:h,itemSelectionMap:i,setItemSelectionMap:c}))),r.createElement("div",{className:"actions-container"},r.createElement(cn.a,{mode:n},r.createElement(E.a,{onActivate:()=>{f.length&&(p(!0),D.mutate(f.map((e=>e.itemid))))},variant:"push primary",disabled:!f.length},f.length>0?Object(u.b)({one:"FileRecovery.RestoreButton.One",two:"FileRecovery.RestoreButton.Two",many:"FileRecovery.RestoreButton.Many"},f.length,{count:f.length.toString()}):Object(u.a)("FileRecovery.RestoreButton")),r.createElement(E.a,{onActivate:()=>{f&&S({title:Object(u.a)("FileRecovery.PurgeConfirmation.Title"),description:Object(u.a)("FileRecovery.PurgeConfirmation.Description"),variant:"standard",icon:r.createElement(hn,{height:30,width:43,layoutMode:"glyphBox"}),buttons:[{title:Object(u.a)("FileRecovery.PurgeConfirmation.Cancel"),action:"cancel"},{title:Object(u.a)("FileRecovery.PurgeConfirmation.Purge"),destructive:!0,action:"purge"}],defaultAction:"cancel",cancelAction:"cancel",onActionSelected:e=>{"purge"===e&&(g(!0),F.mutate(f.map((e=>({docwsid:e.docwsid,zone:e.zone})))))}})},variant:"push secondary",disabled:!f.length},f.length>0?Object(u.b)({one:"FileRecovery.PurgeButton.One",two:"FileRecovery.PurgeButton.Two",many:"FileRecovery.PurgeButton.Many"},f.length,{count:f.length.toString()}):Object(u.a)("FileRecovery.PurgeButton")))))}function On(e){return e.deletedDriveItemsCount?r.createElement("div",{className:"controls-row","data-testid":"controls-row"},r.createElement("div",{className:"select-all-container"},r.createElement(E.a,{onActivate:e.onSelectAll,variant:"push",disabled:e.disabled},e.allItemsSelected?Object(u.a)("FileRecovery.DeselectAll",{count:e.deletedDriveItemsCount}):Object(u.a)("FileRecovery.SelectAll",{count:e.deletedDriveItemsCount}))),r.createElement("div",{className:"sort-container"},r.createElement(Wa.a,{displayForValue:e=>{const t={size:"FileRecovery.SortBySize",date:"FileRecovery.SortByDateDeleted",name:"FileRecovery.SortByName"};return t[e]?Object(u.a)(t[e]):""},variant:"transparent",shouldUseNativeControl:!1,value:e.sortBy,chevronAsset:r.createElement(r.Fragment,null,r.createElement(xa.a,{layoutMode:"glyphBox",desiredFontSize:9}),"\xa0"),onStateChange:t=>{t.value&&e.onSortChange(t.value)},disabled:e.disabled},r.createElement(Wa.c,{value:"date",nativeText:Object(u.a)("FileRecovery.DateDeleted")},r.createElement(mn.a,{startIcon:r.createElement(mn.e,{symbol:le.a})},Object(u.a)("FileRecovery.DateDeleted"))),r.createElement(Wa.c,{value:"name",nativeText:Object(u.a)("FileRecovery.Name")},r.createElement(mn.a,{startIcon:r.createElement(mn.e,{symbol:vn.a})},Object(u.a)("FileRecovery.Name"))),r.createElement(Wa.c,{value:"size",nativeText:Object(u.a)("FileRecovery.Size")},r.createElement(mn.a,{startIcon:r.createElement(mn.e,{symbol:pn.a})},Object(u.a)("FileRecovery.Size")))))):null}function jn(e){var t;return 0===e.deletedDriveItems.length?null:r.createElement("div",{role:"table",className:"deleted-items-list"},r.createElement("div",{className:"content"},null===(t=e.deletedDriveItems)||void 0===t?void 0:t.map((t=>r.createElement(Pn,{key:t.drivewsid,item:t,checked:!!e.itemSelectionMap[t.drivewsid],onCheckStateChange:a=>((t,a)=>{e.setItemSelectionMap((e=>({...e,[t]:a})))})(t.drivewsid,a)})))))}function Sn(e){const{totalItemsCount:t,restoredItemsCount:a}=e,n=void 0!==t&&void 0!==a,i=n?Math.min(a/t*100,100):0,c=Object(rn.d)();return r.createElement("div",{className:"restore-progress-container"},r.createElement(bn,{height:30,width:43,layoutMode:"glyphBox"}),r.createElement("h1",{className:"title"},e.text),n&&r.createElement(r.Fragment,null,r.createElement("div",{className:"progress-container"},r.createElement(sn,{percentage:i,ariaLabel:Object(u.b)({one:"FileRecovery.Progress.AriaLabel.One",two:"FileRecovery.Progress.AriaLabel.Two",many:"FileRecovery.Progress.AriaLabel.Many"},a,{restoredItems:a.toString(),totalItems:t.toString()})})),r.createElement("div",{className:"progress-text"},r.createElement("p",null,Object(u.b)({one:"FileRecovery.Progress.FilesRestored.One",two:"FileRecovery.Progress.FilesRestored.Two",many:"FileRecovery.Progress.FilesRestored.Many"},a,{restoredItems:a.toString(),totalItems:t.toString()})),r.createElement("p",null,Object(u.a)("FileRecovery.Progress.StayOnPage")))),e.onClose&&r.createElement("div",{className:"cancel-button-container"},r.createElement(cn.a,{mode:c},r.createElement(E.a,{onActivate:e.onClose,variant:"push secondary"},Object(u.a)("FileRecovery.Cancel.Button")))))}function Nn(e){let{items:t}=e;return r.createElement("div",null,r.createElement("div",{role:"table",className:"deleted-items-list"},r.createElement("div",{className:"content"},null===t||void 0===t?void 0:t.map((e=>r.createElement(Pn,{key:e.drivewsid,item:e}))))))}function Pn(e){var t;let{item:a,checked:n,onCheckStateChange:i}=e;const c="compact"===Object(rn.d)(),o=Object(u.a)("FileRecovery.PathSeparator"),s=a.hierarchy.join(o);return r.createElement("div",{key:a.drivewsid,role:"row"},!!i&&r.createElement("div",{role:"cell",className:"checkbox"},r.createElement(ke.a,{checked:n,onStateChange:e=>{i(e.checked?a:void 0)}})),r.createElement("div",{role:"cell",className:"icon"},r.createElement(ln.a,{fileExtension:a.extension})),r.createElement("div",{className:"file-description"},r.createElement("div",{className:"name-size-icon"},r.createElement("div",{role:"cell",className:"name"},a.fileName),r.createElement("div",{role:"cell",className:"size"},Object(Ce.a)(a.size))),r.createElement("div",{className:"file-details"},r.createElement("div",{role:"cell",className:"metadata"},r.createElement("span",null,Object(un.a)(null!==(t=a.extension)&&void 0!==t?t:""),!!i&&r.createElement(r.Fragment,null,Object(u.a)("FileRecovery.Separator"),Object(u.a)("FileRecovery.DeletedOnDate",{friendlyDate:Object(ta.a)(a.deletionDate)})),!c&&r.createElement(r.Fragment,null,Object(u.a)("FileRecovery.Separator"),r.createElement("span",{className:l()("time-remaining",{warning:An(a.deletionDate)})},In(a.deletionDate))))),c&&r.createElement("div",{role:"cell",className:l()("metadata",{warning:An(a.deletionDate)})},In(a.deletionDate))),r.createElement("div",{className:"hierarchy"},r.createElement("div",{role:"cell",className:"hierarchy",title:s},s))))}const wn=864e5,Cn=30*wn,Dn=3*wn;function Tn(e){const t=Date.now()-e.getTime();return Cn-t}function In(e){const t=Tn(e);return t>wn?Object(u.a)("FileRecovery.RemainingDays.MoreThanOne",{days:Math.ceil(t/wn)}):Object(u.a)("FileRecovery.RemainingDays.One")}function An(e){return Tn(e)<=Dn}const Ln=Object(nn.a)("iclouddrive"),kn=e=>{const t=Object(en.a)(Ln),{deletedDriveItems:a=[],tileSize:n,error:i,hasNextPage:c}=e,l=e.isLoading&&t,o=Object(u.a)("RecoveryPage.DriveItemsTile.Title"),s=a.length,d=Object(u.b)({zero:"RecoveryPage.DriveItemsTile.TotalNumber.Zero",one:"RecoveryPage.DriveItemsTile.TotalNumber.One",two:"RecoveryPage.DriveItemsTile.TotalNumber.Two",many:"RecoveryPage.DriveItemsTile.TotalNumber.Many"},s),m=!t||i?"":l||c?Object(u.a)("RecoveryPage.Loading"):d;a.sort(((e,t)=>t.deletionDate.getTime()-e.deletionDate.getTime()));const p=Object(ea.a)(a,(e=>`${e.fileName}.${e.extension}`),Fn),[v,g]=Object(Da.b)("load","iclouddrive-recovery-tile",{measureFromBaseline:!0});r.useEffect((()=>{e.isLoading||(e.isSuccess?v():g())}),[e.isLoading,e.isSuccess,v,g]);const b=Object(Ja.a)(),h=function(e){return Object(Ae.a)(r.createElement(yn,e),{ariaLabelledBy:En,className:"file-recovery-modal",modalHeader:Object(u.a)("RecoveryPage.FilesRecoveryModalContent.Title")})}(e),f=r.useCallback((()=>{t?h():b("iclouddrivefilerecovery",Ln,!1,(e=>{e&&h()}))}),[t,b,h]);return r.createElement(Ht.b,{tileIndex:-1,icon:r.createElement(Jt.a,{iconSize:40,symbolSize:20,symbol:an.a,backgroundColor:"#AF52DF"}),className:"driveitems-recovery-tile",heading:o,description:m,tileSize:n,isLoading:l,onTileClick:f,error:i},(!l||c)&&t&&!i&&r.createElement(Xt.a,{contentListItems:p.length>0?p:[Object(u.a)("RecoveryPage.TileContent.NoItems")],contentDescriptionText:""}),!l&&t&&i&&r.createElement(Qt.a,{refetch:e.refetch,showClouds:!1}),!t&&r.createElement("div",{className:"adp-locked-tile"},r.createElement(H.a,{"aria-hidden":"true",className:"adp-icon",layoutMode:"glyphBox",desiredFontSize:18}),r.createElement("div",{className:"title"},Object(u.a)("ADP.BookmarksRecoveryTile.Title"))))};function Rn(e){const t=new Map;for(const a of e){const e=pa(a);e&&!t.has(e.drivewsid)&&t.set(e.drivewsid,e)}return Array.from(t.values())}const Fn=6;function Mn(e){const t=Object(en.a)(qt.b),[a,n]=$t(),i=t&&n,[c]=Object(Da.b)("load","bookmarks-recovery-tile",{measureFromBaseline:!0});return r.useEffect((()=>{i||c()}),[i,c]),r.createElement(qt.a,{isLoading:i,isLocked:!t,deletedBookmarks:null!==a&&void 0!==a?a:[],tileSize:Ht.c.Small,maxTileLines:Fn,onTileClick:e.onBookmarksRecoveryModalClicked})}const zn=e=>{var t;const a=l()("recovery-page",e.className),n=Object(u.a)("RecoveryPage.Title"),i=Object(u.a)("RecoveryPage.Details.Standard"),c=function(){var e,t;let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;const n=r.useRef(!1),i=r.useRef(!1),c=Object(xe.b)({endpoint:Ue.b.enumerateDeletedDriveFiles,fetchProvider:e=>t=>{let{pageParam:n}=t;return async function(e,t){let{webServices:a}=e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50;if(null===a||void 0===a||!a.docws)throw new Error("fetchDeletedDriveFilesPage: no service url available");return Object(_e.a)({url:Object(Ue.l)(a.docws,"tombstones",n,t),method:"GET",includeCredentials:!0,validate:{type:"PaginatedDeletedDriveFilesResponse",schema:ua}})}(e,n,a)},getNextPageParam:e=>{if(e.continuationMarker&&"MORE_AVAILABLE"===e.status)return e.continuationMarker},cacheTime:0,onError:e=>{n.current&&(C.a.withEventAndLabel("workflow","filerecovery.fetchAllRecoverableDocuments.failure",{statCategory:ve.a.SESSION,errorType:e.name,errorMessage:e.message}).record(),n.current=!1)},onSuccess:e=>{const t=e.pages[e.pages.length-1];if((!(null===t||void 0===t?void 0:t.continuationMarker)||"MORE_AVAILABLE"!==(null===t||void 0===t?void 0:t.status))&&n.current&&!i.current){const t=Rn(e.pages.flatMap((e=>e.documents)));C.a.withEventAndLabel("workflow","filerecovery.fetchAllRecoverableDocuments.success",{statCategory:ve.a.SESSION,itemsCountMagnitude:on(t.length)}).record(),n.current=!1,i.current=!0}}}),{data:l,error:o,isLoading:s,isError:d,isFetching:u,isFetchingNextPage:m,hasNextPage:p,fetchNextPage:v}=c,g=r.useMemo((()=>{if(null!==l&&void 0!==l&&l.pages&&0!==l.pages.length)return Rn(l.pages.flatMap((e=>e.documents)))}),[null===l||void 0===l?void 0:l.pages]);r.useEffect((()=>{if(p&&!m&&!o&&!s){const e=setTimeout((()=>{v()}),100);return()=>clearTimeout(e)}}),[p,m,o,s,v]),r.useEffect((()=>{(s||u)&&(i.current&&(i.current=!1),n.current||(C.a.withEventAndLabel("workflow","filerecovery.fetchAllRecoverableDocuments.start",{statCategory:ve.a.SESSION}).record(),n.current=!0))}),[s,u]);const b=null!==(e=null===l||void 0===l||null===(t=l.pages)||void 0===t?void 0:t.length)&&void 0!==e?e:0,h=b;return{data:g,error:o,isError:d,isLoading:s,isFetching:u,isRefetching:c.isRefetching,isSuccess:!!g&&!o,isIdle:c.isIdle,status:c.status,reset:()=>{c.remove(),c.refetch()},isLoadingMore:m,hasNextPage:!!p,totalPages:b,currentPage:h}}(),o=Ia("bookmark"),s=Object(Ae.a)(r.createElement(Ka,null),{className:"bookmarks-recovery-modal",paneType:Qa.d.Modal,ariaLabelledBy:"bookmarks-recovery-modal-title-id"}),d=Object(Ja.a)(),m=r.useCallback((()=>{Xa.a.sharedInstance.hasPCSKey(qt.b)?(s(),o.recordOpenedRecovery()):d("bookmarks",qt.b,!1,(e=>{e&&(s(),o.recordOpenedRecovery())}))}),[s,d,o]),p=Object($.c)()!==$.a.Lite,v=null===(t=tn.c.value)||void 0===t?void 0:t.safariBookmarksHasMigratedToCloudKit;return r.createElement(Da.a,{scope:"data-recovery-page",baseline:!0},r.createElement("div",{className:a},r.createElement(Mt,{current:Pe.b.recovery}),r.createElement(Vt,{title:n,description:i}),r.createElement("div",{className:"application-content"},r.createElement("div",{className:"recovery-page-tiles"},r.createElement(kn,{error:c.error,isLoading:c.isLoading||c.isRefetching,isLoadingMore:c.isLoadingMore,hasNextPage:c.hasNextPage,isSuccess:c.isSuccess,deletedDriveItems:c.data,refetch:c.reset,tileSize:Ht.c.Small}),p&&v&&r.createElement(Mn,{onBookmarksRecoveryModalClicked:m}),r.createElement(za,null),p&&r.createElement(ka,null)))))};var Bn=a(2187),xn=a(2202),Un=a(2185);const _n=e=>{let{icon:t,modalTitle:a,modalSubTitle:n,modalSectionTitle:i,modalDescription:c,learnMoreLink:l,titleId:o,feature:s,variant:d}=e;const m=Object(u.a)("ICloudPlusPage.ModalContent.LearnMore");return r.createElement("div",{className:"modal-content feature-info"},r.createElement("div",{className:"modal-icon","data-testid":"icon"},t),r.createElement("h2",{className:"modal-title","data-testid":"title",id:o},a),r.createElement("div",{className:"modal-subtitle","data-testid":"subtitle"},n),i&&r.createElement("h3",{className:"modal-section-title","data-testid":"sectiontitle"},i),r.createElement("div",{className:"modal-section-description","data-testid":"description"},c," ",r.createElement(b.a,{href:l},m)),r.createElement(Un.b,{feature:s,variant:d}))};var Wn=a(2307);const Hn="private-relay-modal-title",Vn=()=>{const e=r.createElement(tt.a,{iconSize:54,applicationIdentifier:"privaterelay"}),t=Object(u.a)("ICloudPlusPage.PrivateRelayModalContent.Title"),a=Object(u.a)("ICloudPlusPage.PrivateRelayModalContent.SubTitle"),n=Object(u.a)("ICloudPlusPage.PrivateRelayModalContent.Section.Description"),i=Object(h.a)("privateRelay");return r.createElement(_n,{icon:e,modalTitle:t,modalSubTitle:a,modalDescription:n,learnMoreLink:i,titleId:Hn,feature:Wn.a.PRIVATE_RELAY,variant:Un.a.PRIVATE_RELAY})};function qn(){return Object(Ae.a)(r.createElement(Vn,null),{ariaLabelledBy:Hn})}const Gn=e=>{const{tileSize:t,isLoading:a,tileIndex:n,ariaLevel:i=3}=e,c=Object(u.a)("PrivateRelayTile.Heading"),l=Object(u.a)("PrivateRelayTile.Description"),o=Object(u.a)("PrivateRelayTile.Content.Description"),s=qn();return r.createElement(Ht.b,{tileIndex:n,icon:r.createElement(tt.a,{iconSize:40,applicationIdentifier:"privaterelay"}),className:"private-relay-tile",heading:c,description:l,isLoading:a,tileSize:t,onTileClick:()=>s(),ariaLevel:i},r.createElement(Xt.a,{contentDescriptionText:o,continueOnDevice:!0}))},Kn=()=>r.createElement(Gn,{tileIndex:0,error:null,isLoading:!1,isSuccess:!0,refetch:()=>{},tileSize:Ht.c.Small});var $n=a(2325);function Zn(){const{data:e}=function(){const e=Object(N.b)();return Object(xe.a)({endpoint:Ue.b.listSubscriptionFeatures,fetchProvider:()=>async()=>{var t,a;return a=await Object($n.c)(null===e||void 0===e||null===(t=e.details)||void 0===t?void 0:t.dsid),Object.fromEntries(a.filter((e=>e.canUse)).map((e=>[e.featureKey,e])))}})}();if(!e||!e["home.cameras"])return 0;const t=e["home.cameras"].limit;return void 0===t?"unlimited":t}const Yn="homekit-secure-video-modal-title",Qn=e=>{let{numberOfCamsSupported:t}=e;const a=r.createElement(tt.a,{iconSize:54,applicationIdentifier:"homekit"}),n=Object(u.a)("ICloudPlusPage.HomeKitSecureVideoModalContent.Title"),i="unlimited"===t?Object(u.a)("ICloudPlusPage.HomeKitSecureVideoModalContent.SubTitle.Unlimited"):Object(u.b)({one:"ICloudPlusPage.HomeKitSecureVideoModalContent.SubTitle.One",two:"ICloudPlusPage.HomeKitSecureVideoModalContent.SubTitle.Two",many:"ICloudPlusPage.HomeKitSecureVideoModalContent.SubTitle.Many"},t),c=Object(u.a)("ICloudPlusPage.HomeKitSecureVideoModalContent.Section.Description"),l=Object(h.a)("homeKitSecureVideo");return r.createElement(_n,{icon:a,modalTitle:n,modalSubTitle:i,modalDescription:c,learnMoreLink:l,titleId:Yn,feature:Wn.a.HOMEKIT_SECURE_VIDEO,variant:Un.a.HOMEKIT_SECURE_VIDEO})};function Xn(e){return Object(Ae.a)(r.createElement(Qn,e),{ariaLabelledBy:Yn})}const Jn=e=>{const{tileSize:t,isLoading:a,tileIndex:n,numberOfCamsSupported:i,ariaLevel:c=3}=e,l=Object(u.a)("HomeKitSecureVideoTile.Heading"),o="unlimited"===i?Object(u.a)("HomeKitSecureVideoTile.Description.Unlimited"):Object(u.b)({one:"HomeKitSecureVideoTile.Description.One",two:"HomeKitSecureVideoTile.Description.Two",many:"HomeKitSecureVideoTile.Description.Many"},i),s=Object(u.a)("HomeKitSecureVideoTile.Content.Description"),d=Xn({numberOfCamsSupported:i});return r.createElement(Ht.b,{tileIndex:n,icon:r.createElement(tt.a,{iconSize:40,applicationIdentifier:"homekit"}),className:"home-kit-secure-video-tile",heading:l,description:o,isLoading:a,tileSize:t,ariaLevel:c,onTileClick:()=>d()},r.createElement(Xt.a,{contentDescriptionText:s,continueOnDevice:!0}))},er=()=>{const e=Zn();return r.createElement(Jn,{tileIndex:0,error:null,isLoading:!1,isSuccess:!0,refetch:()=>{},tileSize:Ht.c.Small,numberOfCamsSupported:e})};var tr=a(2231);const ar="family-sharing-modal-title",nr=e=>{let{role:t,ownerShortName:a,ownerLongName:n}=e;const i=t===tr.a.NonOrganizerMember,c=t===tr.a.OrganizerWithNoMember,l=r.createElement(tt.a,{applicationIdentifier:"plan",iconSize:54}),o=Object(u.a)("ICloudPlusPage.FamilySharingModalContent.Title"),s=i?Object(u.a)("ICloudPlusPage.FamilySharingModalContent.SubTitle.Sharing",{name:a}):Object(u.a)("ICloudPlusPage.FamilySharingModalContent.SubTitle.NotSharing"),d=i?Object(u.a)("ICloudPlusPage.FamilySharingModalContent.Section.Description.Sharing",{name:n}):Object(u.a)("ICloudPlusPage.FamilySharingModalContent.Section.Description.NotSharing"),m=Object(h.a)("familySharing");return i?r.createElement(_n,{icon:l,modalTitle:o,modalSubTitle:s,modalDescription:d,learnMoreLink:m,titleId:ar,feature:Wn.a.FAMILY_SHARING,variant:Un.a.FAMILY_SHARING_MEMBER}):c?r.createElement(_n,{icon:l,modalTitle:o,modalSubTitle:s,modalDescription:d,learnMoreLink:m,titleId:ar,feature:Wn.a.FAMILY_SHARING,variant:Un.a.FAMILY_SHARING_ORGANIZER_NO_FAMILY}):r.createElement(_n,{icon:l,modalTitle:o,modalSubTitle:s,modalDescription:d,learnMoreLink:m,titleId:ar,feature:Wn.a.FAMILY_SHARING,variant:Un.a.FAMILY_SHARING_ORGANIZER})},rr=e=>{const{tileSize:t,tileIndex:a,error:n,isLoading:i,role:c,organizer:l,ariaLevel:o=3}=e,s=null!==n,d=c===tr.a.NonOrganizerMember,m=Object(j.a)(l.firstName,l.lastName),p=Object(j.a)(l.firstName,l.lastName,!0),v=Object(u.a)("FamilySharingTile.Heading"),g=d?Object(u.a)("FamilySharingTile.Description.Member",{name:m}):Object(u.a)("FamilySharingTile.Description.Five"),b=d?Object(u.a)("FamilySharingTile.Content.Description.Member",{name:p}):Object(u.a)("FamilySharingTile.Content.Description"),h=function(e){const t=Object(Ae.b)();return()=>t(r.createElement(nr,e),{ariaLabelledBy:ar})}({role:c,ownerShortName:m,ownerLongName:p});return r.createElement(Ht.b,{tileIndex:a,icon:r.createElement(tt.a,{applicationIdentifier:"plan",iconSize:40}),className:"family-sharing-tile",heading:v,description:g,isLoading:i,tileSize:t,onTileClick:()=>h(),ariaLevel:o,error:n},s?r.createElement(Qt.a,{refetch:e.refetch,showClouds:!1}):r.createElement(Xt.a,{contentDescriptionText:b,continueOnDevice:!0}))},ir=()=>{const{result:e,refetch:t}=Object(tr.c)(),a=Object(tr.b)(),n=e.ok&&void 0===e.value||a.ok&&void 0===a.value,i=e.ok&&(e.value===tr.a.None||a.ok),c=i?null:new Error("Missing family data"),l=e.ok&&e.value?e.value:tr.a.Organizer,o=a.ok&&a.value?a.value:{dsid:"",firstName:"",lastName:"",fullName:""};return r.createElement(rr,{tileIndex:0,error:c,isLoading:n,isSuccess:i,role:l,organizer:o,refetch:t,tileSize:Ht.c.Small})};var cr=a(1467),lr=a(1322),or=a(2174),sr=a(1268);const dr=e=>{let{tileIndex:t}=e;const a=Object(lr.b)(),n=Object(u.a)("Invites.DisplayName"),i=Object(u.a)("InvitesPlusTile.Description");return r.createElement(Ht.b,{tileIndex:null!==t&&void 0!==t?t:0,icon:r.createElement(tt.a,{applicationIdentifier:"invites",iconSize:40}),className:"invites-plus-tile",heading:n,description:i,isLoading:!1,tileSize:Ht.c.Small,onTileClick:()=>{a.launchApp(or.a,{options:{source:{reason:sr.b.TILE_CLICK}}})},ariaLevel:3},Object(u.a)("InvitesPlusTile.Content"))},ur=S.a.sharedInstance.isDomainCN,mr=e=>{let{className:t,onPageLoaded:a}=e;const n=l()("icloud-plus-page",t),i=Object(u.a)("ICloudPlusPage.Title"),c=Object(u.a)("ICloudPlusPage.Description"),{modalToOpen:o,setModalToOpen:s}=Object(cr.b)(),d=qn(),m=Xn({numberOfCamsSupported:Zn()}),[p,v]=r.useState(!1),[g,b]=r.useState(!1);r.useEffect((()=>{p&&g&&(null===a||void 0===a||a())}),[p,g,a]),r.useEffect((()=>{if(""!==o){switch(o){case"private-relay":d();break;case"homekit-secure-video":m()}s("")}}),[o,s,d,m]);const h=Object(Ut.a)(),f=r.useMemo((()=>h.some((e=>e.applicationIdentifier===or.a))),[h]);return r.createElement("div",{className:n},r.createElement(Mt,{current:Pe.b.icloudplus}),r.createElement(Vt,{title:i,description:c}),r.createElement("div",{className:"application-content"},r.createElement("div",{className:"tile-grid-content"},r.createElement(Bn.a,{onSuccess:()=>v(!0),onError:()=>v(!0)}),ur?null:r.createElement(xn.a,{onSuccess:()=>b(!0),onError:()=>b(!0)}),f?r.createElement(dr,null):null),r.createElement("section",{"aria-labelledby":"icloud-plus-device-only-header",className:"device-only-content"},r.createElement("h2",{id:"icloud-plus-device-only-header",className:"heading"},Object(u.a)("ICloudPlusPage.OnlyOnDevices.Title")),r.createElement("p",null,Object(u.a)("ICloudPlusPage.OnlyOnDevices.Description")),r.createElement("div",{className:"tile-grid-content"},ur?null:r.createElement(Kn,null),r.createElement(er,null),r.createElement(ir,null)))))};var pr=a(2304),vr=a(1636);function gr(e){return e.devices.filter((e=>e.latestBackup)).map((e=>({latestBackup:new Date(e.latestBackup),name:e.name,modelSmallPhotoURL1x:e.modelSmallPhotoURL1x,modelSmallPhotoURL2x:e.modelSmallPhotoURL2x,modelLargePhotoURL1x:e.modelLargePhotoURL1x,modelLargePhotoURL2x:e.modelLargePhotoURL2x,backupSizeBytes:0})))}const br=w.z.object({imei:w.z.string().optional(),latestBackup:w.z.string().optional(),model:w.z.string(),modelDisplayName:w.z.string(),modelLargePhotoURL1x:w.z.string(),modelLargePhotoURL2x:w.z.string(),modelSmallPhotoURL1x:w.z.string(),modelSmallPhotoURL2x:w.z.string(),name:w.z.string(),osVersion:w.z.string().optional(),paymentMethods:w.z.array(w.z.string()).optional(),serialNumber:w.z.string().optional(),udid:w.z.string().optional(),hasActivationLock:w.z.boolean().optional(),isMissing:w.z.boolean().optional()}),hr=w.z.object({balanceStatus:w.z.union([w.z.literal("YES"),w.z.literal("NO"),w.z.literal("NOTAPPLICABLE"),w.z.literal("UNAVAILABLE"),w.z.literal("NEGATIVE")]),id:w.z.string(),isCarKey:w.z.boolean().optional(),lastFourDigits:w.z.string().optional(),suspensionReason:w.z.string().optional(),type:w.z.string(),balanceTime:w.z.string().optional(),balanceCode:w.z.string().optional(),balance:w.z.string().optional(),name:w.z.string().optional(),routeDestinationStation:w.z.string().optional(),routeOriginStation:w.z.string().optional()}),fr=w.z.object({devices:w.z.array(br),paymentMethods:w.z.array(hr).optional()});var Er=a(1640),yr=a(1639),Or=a(1143);w.z.object({apps:w.z.array(w.z.object({label:w.z.string(),detailLabel:w.z.string().optional(),iconUrls:w.z.object({"1x":w.z.string(),"2x":w.z.string(),"3x":w.z.string()})})),primaryAppsSectionCount:w.z.number(),secondaryAppsSectionLabel:w.z.string(),thermometer:w.z.object({sections:w.z.array(w.z.object({displayLabel:w.z.string(),storagePercentage:w.z.number()}))})});const jr={photos:()=>{const{data:e,isSuccess:t}=Object(vr.a)({library:Or.GoldilocksLibrary.Personal,assetListKey:Or.PhotosTileAssetListType.Library}),a=Object(yr.b)(e);return r.createElement(r.Fragment,null,t?a:"\u2026")},mail:()=>r.createElement(r.Fragment,null,Object(u.a)("StoragePage.AppCounts.Mail.All")),backup:()=>{const{data:e,isSuccess:t}=Object(xe.a)({endpoint:Ue.b.devicesBackup,fetchProvider:e=>()=>(e=>{let{webServices:t}=e;if(null===t||void 0===t||!t.account)throw new Error("fetchDevices: no service url available");return Object(_e.a)({url:Object(Ue.j)(t.account),includeCredentials:!0,validate:{type:"WireDevicesResponse",schema:fr}}).then(gr)})(e)}),a=Object(u.b)({zero:"DeviceBackupList.TotalNumber.Zero",one:"DeviceBackupList.TotalNumber.One",two:"DeviceBackupList.TotalNumber.Two",many:"DeviceBackupList.TotalNumber.Many"},(null===e||void 0===e?void 0:e.length)||0);return r.createElement(r.Fragment,null,t?a:"\u2026")},messages:()=>r.createElement(r.Fragment,null,Object(u.a)("StorageUsageList.Messages.Count")),docs:()=>r.createElement(r.Fragment,null,Object(u.a)("StorageUsageList.Drive.Count")),family:()=>r.createElement(r.Fragment,null,Object(u.a)("StorageUsageList.Family.Count"))},Sr=e=>{var t,a,n,i;let{className:c,isError:o,isLoading:s,refetch:d,storageUsage:m,firstName:p,isBeneficiary:v}=e;const g=l()("storage-usage-list",c,{loading:s,error:o}),b=Object(u.a)("VoiceOver.StorageUsageList.Table"),h=v&&p?Object(u.a)("StorageUsageList.Family.Personal.TitleWithName",{firstName:p}):Object(u.a)("StorageUsageList.Family.Personal.Title"),f=null!==(t=null===m||void 0===m?void 0:m.usageByMedia.filter((e=>"family"!==e.mediaKey)))&&void 0!==t?t:[],y=(null!==(a=null===m||void 0===m?void 0:m.usedBytes)&&void 0!==a?a:0)-(null!==(n=null===m||void 0===m||null===(i=m.familyStorageUsage)||void 0===i?void 0:i.usageInBytes)&&void 0!==n?n:0);return r.createElement("article",{className:g,"aria-labelledby":"storage-usage-heading"},o?r.createElement("div",null,r.createElement("div",{className:"error-description"},Object(u.a)("StorageUsageList.Content.Error.Description")),r.createElement(E.a,{className:"reload-button",onActivate:d},r.createElement(Er.a,{layoutMode:"glyphBox",width:20,height:20}),Object(u.a)("ErrorHomeTileContent.TryAgain"))):r.createElement(r.Fragment,null,null!==m&&void 0!==m&&m.familyStorageUsage?r.createElement("div",{className:"title"},r.createElement("h2",{id:"family-storage-list"},h),r.createElement("h2",null,Object(Ce.a)(y,1))):null,!1,f.length>0?r.createElement("div",{role:"table","aria-label":b},f.filter((e=>e.usageInBytes)).map(((e,t)=>{var a;return r.createElement("div",{key:t,role:"row"},r.createElement(Nr,{usageInfo:e,totalBytes:null!==(a=null===m||void 0===m?void 0:m.totalBytes)&&void 0!==a?a:0}))}))):null))},Nr=e=>{var t;let{usageInfo:a,totalBytes:n}=e;const i=`${(a.usageInBytes/n*100).toFixed(1)}%`,{mediaKey:c}=a,l=Object(Ce.a)(a.usageInBytes,1),o=jr[c],s=Object(u.a)("VoiceOver.StorageUsageList.StorageUsed",{percentage:i});return r.createElement(r.Fragment,null,r.createElement("span",{className:"app-name-icon",role:"cell"},r.createElement(tt.a,{className:"icon",applicationIdentifier:c,iconSize:32}),r.createElement("div",null,r.createElement("span",{className:"label"},null!==(t=(e=>"photos"===e?Object(u.a)("Photos.DisplayName"):"docs"===e?Object(u.a)("StorageUsageList.Drive.Heading"):"backup"===e?Object(u.a)("DeviceBackupList.Heading"):void 0)(a.mediaKey))&&void 0!==t?t:a.displayLabel),r.createElement("span",{className:"item-description-small"},r.createElement(o,null)))),r.createElement("span",{className:"item-description",role:"cell"},r.createElement(o,null)),r.createElement("span",{className:"usage",role:"cell"},l,r.createElement(pr.a,null,r.createElement(r.Fragment,null,", ",s)),r.createElement("span",{className:"dot",style:{backgroundColor:`#${a.displayColor}`}})))};var Pr=a(1641),wr=a(2232);const Cr=e=>{const t=Object(y.a)(e.firstName)&&Object(y.a)(e.lastName),a=e.firstName.charAt(0)+e.lastName.charAt(0),n=Object(j.a)(e.firstName,e.lastName);return t&&!e.profilePhoto?r.createElement(dt.a,{width:36,height:36,layoutMode:"glyphBox",className:"cjk-profile-photo"}):r.createElement(r.Fragment,null,e.profilePhoto?r.createElement(r.Fragment,null,e.profilePhoto):r.createElement("div",{className:"profile-photo-placeholder","aria-label":Object(u.a)("StorageUsageList.Family.ImageAlt",{familyMemberName:n})},r.createElement("div",{className:"initials"},a)))},Dr=e=>{var t,a;let{member:n}=e;const{contacts:i}=Object(Pr.b)(),c=null===i||void 0===i?void 0:i.get(n.appleId),l=Object(j.a)(n.firstName,n.lastName),o=r.createElement(wr.a,{imageAlt:Object(u.a)("StorageUsageList.Family.ImageAlt",{familyMemberName:l}),profilePhoto:c?{contactId:c.contactId,url:null===(t=c.photo)||void 0===t?void 0:t.url,crop:null===(a=c.photo)||void 0===a?void 0:a.crop}:void 0,isProfilePhotoLoading:!1,size:36});return r.createElement(Cr,{firstName:n.firstName,lastName:n.lastName,profilePhoto:c&&o})},Tr=e=>{const t=l()("family-usage-list",e.className),a=e.familyMembers.reduce(((e,t)=>e+t.usageInBytes),0),n=e.isBeneficiary&&e.ownerFirstName?Object(u.a)("StorageUsageList.Family.TitleWithName",{firstName:e.ownerFirstName}):Object(u.a)("StorageUsageList.Family.Title");return r.createElement("article",{className:t,"aria-labelledby":"family-storage-list"},r.createElement("div",{className:"title"},r.createElement("h2",{id:"family-storage-list"},n),r.createElement("h2",null,Object(Ce.a)(a,1))),!e.isBeneficiary&&r.createElement("div",{role:"table","aria-label":Object(u.a)("VoiceOver.StorageUsageList.FamilyUsageList")},e.familyMembers.map((t=>r.createElement("div",{key:t.appleId,role:"row"},r.createElement("div",{role:"cell"},r.createElement(Dr,{member:t}),r.createElement("span",{className:"member-name"},t.fullName)),r.createElement("div",{role:"cell"},Object(Ce.a)(t.usageInBytes,1),r.createElement("span",{className:"dot",style:{backgroundColor:`#${e.displayColor}`}})))))))},Ir=()=>r.createElement("section",{className:"change-plan-section learn-more-section"},r.createElement("div",{className:"change-plan-section-heading"},r.createElement(O.a,{interpolations:{"#{iCloudPlusLink}":r.createElement(b.a,{href:Object(h.a)("iCloudPlusPlanPricing")},Object(u.a)("PlanDetailsPage.ChangePlanSection.LearnMore.Link.Title"))}},Object(u.a)("PlanDetailsPage.ChangePlanSection.LearnMore.Text"))));var Ar=a(1584),Lr=a(2306),kr=a(2317);function Rr(){return Rr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},Rr.apply(null,arguments)}const Fr=e=>{let{className:t,...a}=e;return r.createElement("svg",Rr({},a,{className:l()("dual-tone-exclamation-mark",t),viewBox:"0 0 99.61 99.657",xmlns:"http://www.w3.org/2000/svg"}),r.createElement("path",{fill:"currentColor",d:"M49.805 99.61c27.246 0 49.805-22.608 49.805-49.805C99.61 22.559 77.002 0 49.756 0 22.56 0 0 22.559 0 49.805c0 27.197 22.608 49.804 49.805 49.804Z"}),r.createElement("path",{fill:"#fff",d:"M49.805 58.887c-2.54 0-3.955-1.416-4.004-4.004l-.635-26.612c-.049-2.587 1.856-4.443 4.59-4.443 2.686 0 4.688 1.904 4.639 4.492l-.684 26.563c-.049 2.636-1.465 4.004-3.906 4.004ZM49.805 75.244c-2.93 0-5.469-2.344-5.469-5.225 0-2.88 2.49-5.273 5.469-5.273 2.978 0 5.469 2.344 5.469 5.273 0 2.93-2.54 5.225-5.47 5.225Z"}))},Mr=e=>{var t,a,n,i,c,l;let{storageUsage:o,isLoading:s,isError:d,isBeneficiary:m,continueOnDeviceSection:p,isPlanUpgradeEligibleDataReady:v,shouldShowContinueOnDeviceUpgradePlanSection:g}=e;const b=null!==(t=null===o||void 0===o?void 0:o.usedBytes)&&void 0!==t?t:0,h=null!==(a=null===o||void 0===o?void 0:o.totalBytes)&&void 0!==a?a:0,f=(null!==(n=null===o||void 0===o?void 0:o.totalBytes)&&void 0!==n?n:0)-b,E=Object(Ar.b)();return r.createElement("div",{className:"meter-header"},r.createElement("div",{className:"usage-header"},r.createElement("div",{className:"storage-label-section"},r.createElement("span",{className:"storage-label"},d||s?r.createElement(pn.a,{layoutMode:"glyphBox",height:26,width:39,fill:"var(--theme-color-backgroundPrimary)"}):r.createElement(r.Fragment,null,Object(Ce.a)(h,1))),E&&r.createElement(Fr,{"aria-hidden":!0,className:"warning-icon",width:24,height:24})),r.createElement(kr.a,{ariaLevel:2,text:Object(u.a)("StorageUsageList.Heading"),id:"storage-usage-heading"}),s?r.createElement("div",{className:"loading"},Object(u.a)("StorageUsageList.Description.Loading")):d?r.createElement("div",{className:"error"},Object(u.a)("StorageUsageList.Description.Error")):r.createElement("div",{className:"usage-description"},r.createElement(O.a,{interpolations:{"#{freeStorage}":r.createElement("span",{className:"free-storage"},Object(u.a)("StorageUsageList.FreeStorage",{free:Object(Ce.a)(f,1)})),"#{usedStorage}":r.createElement("span",{className:"used-storage"},Object(u.a)("StorageUsageList.UsedStorage",{used:Object(Ce.a)(b,1)}))}},Object(u.a)("StorageUsageList.Description")))),r.createElement(Lr.a,{hideInfo:!0,usedBytes:null!==(i=null===o||void 0===o?void 0:o.usedBytes)&&void 0!==i?i:0,totalBytes:null!==(c=null===o||void 0===o?void 0:o.totalBytes)&&void 0!==c?c:0,usageByMedia:null!==(l=null===o||void 0===o?void 0:o.usageByMedia)&&void 0!==l?l:[]}),!1,E&&v&&g&&r.createElement(r.Fragment,null,r.createElement(zr,{type:E}),!m&&r.createElement("div",{className:"xl-no-display"},p)))};function zr(e){switch(e.type){case Ar.a.AlmostFull:return r.createElement(Br,null);case Ar.a.Full:return r.createElement(xr,null);case Ar.a.FullNoUpgrade:return r.createElement(_r,null);case Ar.a.AlmostFullNoUpgrade:return r.createElement(Ur,null)}}function Br(){return r.createElement(Wr,null,Object(u.a)("StoragePage.StorageWarning.AlmostFull"))}function xr(){return r.createElement(Wr,null,Object(u.a)("StoragePage.StorageWarning.Full"))}function Ur(){return r.createElement(Wr,null,Object(u.a)("StoragePage.StorageWarning.AlmostFull.NoUpgrade"))}function _r(){return r.createElement(Wr,null,Object(u.a)("StoragePage.StorageWarning.Full.NoUpgrade"))}function Wr(e){let{children:t}=e;return r.createElement("div",{className:"usage-warning",role:"note"},r.createElement(Fr,{className:"warning-icon",width:17,height:17}),t)}var Hr=a(1492),Vr=a(1046),qr=a(1486),Gr=a(1635);const Kr=e=>{var t,a,n;let{className:i,onPageLoaded:c}=e;const o=Object(N.b)(),s=null===o||void 0===o||null===(t=o.details)||void 0===t||null===(t=t.beneficiaryInfo)||void 0===t?void 0:t.isBeneficiary,d=null!==(a=null===o||void 0===o||null===(n=o.details)||void 0===n?void 0:n.firstName)&&void 0!==a?a:"",m=l()("storage-page",i),p=s&&d?Object(u.a)("StoragePage.TitleWithName",{firstName:d}):Object(u.a)("StoragePage.Title"),v=s?Object(u.a)("StoragePage.Description.Neutral"):Object(u.a)("StoragePage.Description.Standard"),{storageUsage:g,isLoading:b}=Object(De.a)(),h=void 0,f=b||void 0!==h&&h.isLoading,E=null==g&&!f||void 0!==h&&h.isError,y=l()("callout manage-storage",{"has-family-storage":null===g||void 0===g?void 0:g.familyStorageUsage}),O=Object(Ar.b)();r.useEffect((()=>{!f&&c&&c()}),[f,c]);const j=Object($.c)(),{isPlanUpgradeEligibleDataReady:S,shouldShowPlanUpgrade:P,planUpgradeEligibleDeviceList:w,planUpgradeButtonTextData:C}=Object(qr.b)(Gr.EntryPoint.StoragePage),D=void 0!==O&&j!==$.a.MAID&&!s&&!P;return r.createElement("div",{className:m},r.createElement(Mt,{current:Pe.b.storage}),r.createElement(Vt,{title:p,description:v}),r.createElement("div",{className:"application-content"},r.createElement(Mr,{storageUsage:g,isLoading:f,isError:E,isBeneficiary:s,continueOnDeviceSection:r.createElement(Zr,{calloutClassName:y,isPlanUpgradeEligibleDataReady:S,shouldShowContinueOnDeviceUpgradePlanSection:D}),isPlanUpgradeEligibleDataReady:S,shouldShowContinueOnDeviceUpgradePlanSection:D}),P&&r.createElement($r,{planUpgradeEligibleDeviceList:w,icloudPlan:j,planUpgradeButtonTextData:C}),r.createElement("div",{className:"content-section"},r.createElement("div",{className:"content-column"},r.createElement(Sr,{storageUsage:g,isError:E,isLoading:f,refetch:()=>{var e;null===(e=Object(Vr.b)())||void 0===e||e.fetchStorageQuota(),null===h||void 0===h||h.refetch()},firstName:d,isBeneficiary:s}),null!==g&&void 0!==g&&g.familyStorageUsage&&O?r.createElement(Tr,{familyMembers:g.familyStorageUsage.familyMembers,className:"family-usage",ownerFirstName:d,isBeneficiary:s,displayColor:g.familyStorageUsage.displayColor}):null),r.createElement("div",{className:"content-column"},null!==g&&void 0!==g&&g.familyStorageUsage&&!O?r.createElement(Tr,{familyMembers:g.familyStorageUsage.familyMembers,className:"family-usage",ownerFirstName:d,isBeneficiary:s,displayColor:g.familyStorageUsage.displayColor}):null,r.createElement("div",{className:"xl-display"},r.createElement(Zr,{calloutClassName:y,isPlanUpgradeEligibleDataReady:S,shouldShowContinueOnDeviceUpgradePlanSection:D})),!s&&r.createElement(Un.b,{className:y,feature:Wn.a.STORAGE_MANAGE,variant:Un.a.STORAGE_MANAGE})))))},$r=e=>{let{planUpgradeEligibleDeviceList:t,icloudPlan:a,planUpgradeButtonTextData:n}=e;const[i,c]=r.useState(!1),o=Object(qr.a)();return r.createElement("div",{className:l()("upgrade-plan",{"is-hidden":i})},t?r.createElement(Hr.StoragePageUpgradePlanSection,{continueOnDeviceEligibleDevicesList:t,userPlan:a,refetchPageContent:()=>{o(),c(!0)},buttonTextData:n}):void 0)},Zr=e=>{let{calloutClassName:t,isPlanUpgradeEligibleDataReady:a,shouldShowContinueOnDeviceUpgradePlanSection:n}=e;return r.createElement(r.Fragment,null,a&&r.createElement(r.Fragment,null,n?r.createElement(r.Fragment,null,r.createElement(Un.b,{className:t,feature:Wn.a.PLAN_UPGRADE,variant:Un.a.STORAGE_FULL}),r.createElement(Ir,null)):void 0))};var Yr=a(2227);const Qr=e=>{const t=l()("change-plan-section",e.className);return r.createElement(r.Fragment,null,e.plan===$.a.Lite&&r.createElement("section",{className:t},r.createElement("h2",{className:"change-plan-section-heading"},Object(u.a)("PlanDetailsPage.ChangePlanSection.Title.Lite")),r.createElement("p",{className:"change-plan-section-body"},Object(u.a)("PlanDetailsPage.ChangePlanSection.Body.Lite")," ",r.createElement(b.a,{href:Object(h.a)("webOnlyPlan")},Object(u.a)("PlanDetailsPage.ChangePlanSection.Body.Lite.LearnMore.Title")))),e.plan!==$.a.Lite&&r.createElement(r.Fragment,null,r.createElement(Un.b,{feature:Wn.a.PLAN_UPGRADE,variant:Un.a.PLAN_UPGRADE}),r.createElement(Ir,null)))},Xr=S.a.sharedInstance.isDomainCN,Jr=e=>{let{text:t}=e;return r.createElement("li",null,r.createElement("span",{className:"bullet-dot"}),r.createElement("span",null,t))},ei=e=>{const{planType:t,planFeatures:a,isBeneficiary:n=!1}=e,i=function(e,t){if(e===$.a.MAID)return{storage:"",premium:[],featuresHeader:"",features:[]};if(e===$.a.Lite)return{storage:Object(u.a)("PlanDetailsPage.Bullets.Lite.Storage"),premium:[],featuresHeader:Object(u.a)("PlanDetailsPage.Bullets.Lite.FeaturesHeader"),features:[Object(u.a)("PlanDetailsPage.Bullets.Features.Drive"),Object(u.a)("PlanDetailsPage.Bullets.Features.Notes"),Object(u.a)("PlanDetailsPage.Bullets.Features.Contacts"),Object(u.a)("PlanDetailsPage.Bullets.Features.Pages"),Object(u.a)("PlanDetailsPage.Bullets.Features.Numbers"),Object(u.a)("PlanDetailsPage.Bullets.Features.Keynote")]};if(e===$.a.Standard)return{storage:Object(u.a)("PlanDetailsPage.Bullets.Standard.Storage"),premium:[],featuresHeader:Object(u.a)("PlanDetailsPage.Bullets.StandardPlus.FeaturesHeader"),features:[Object(u.a)("PlanDetailsPage.Bullets.Features.Photos"),Object(u.a)("PlanDetailsPage.Bullets.Features.Drive"),Object(u.a)("PlanDetailsPage.Bullets.Features.Backup"),Object(u.a)("PlanDetailsPage.Bullets.Features.Mail"),Object(u.a)("PlanDetailsPage.Bullets.Features.PasswordAndKeychain")]};if(e===$.a.Plus){const e=t?"unlimited"===t.numberOfSupportedCameras?Object(u.a)("PlanDetailsPage.Bullets.Plus.Premium.HomeKitSecureCam.Unlimited"):Object(u.b)({one:"PlanDetailsPage.Bullets.Plus.Premium.HomeKitSecureCam.One",two:"PlanDetailsPage.Bullets.Plus.Premium.HomeKitSecureCam.Two",many:"PlanDetailsPage.Bullets.Plus.Premium.HomeKitSecureCam.Many"},t.numberOfSupportedCameras):Object(u.a)("PlanDetailsPage.Bullets.Plus.Premium.HomeKitSecureCam.One");var a,n;return Xr?{storage:Object(u.a)("PlanDetailsPage.Bullets.Plus.Storage",{storage:null!==(a=null===t||void 0===t?void 0:t.storageSize)&&void 0!==a?a:""}),premium:[Object(u.a)("PlanDetailsPage.Bullets.Plus.Premium.HideMyEmail"),e,Object(u.a)("PlanDetailsPage.Bullets.Plus.Premium.FamilySharing")],featuresHeader:Object(u.a)("PlanDetailsPage.Bullets.StandardPlus.FeaturesHeader"),features:[Object(u.a)("PlanDetailsPage.Bullets.Features.Photos"),Object(u.a)("PlanDetailsPage.Bullets.Features.Drive"),Object(u.a)("PlanDetailsPage.Bullets.Features.Backup"),Object(u.a)("PlanDetailsPage.Bullets.Features.Mail"),Object(u.a)("PlanDetailsPage.Bullets.Features.PasswordAndKeychain")]}:{storage:Object(u.a)("PlanDetailsPage.Bullets.Plus.Storage",{storage:null!==(n=null===t||void 0===t?void 0:t.storageSize)&&void 0!==n?n:""}),premium:[Object(u.a)("PlanDetailsPage.Bullets.Plus.Premium.PrivateRelay"),Object(u.a)("PlanDetailsPage.Bullets.Plus.Premium.HideMyEmail"),Object(u.a)("PlanDetailsPage.Bullets.Plus.Premium.CustomEmailDomain"),e,Object(u.a)("PlanDetailsPage.Bullets.Plus.Premium.FamilySharing")],featuresHeader:Object(u.a)("PlanDetailsPage.Bullets.StandardPlus.FeaturesHeader"),features:[Object(u.a)("PlanDetailsPage.Bullets.Features.Photos"),Object(u.a)("PlanDetailsPage.Bullets.Features.Drive"),Object(u.a)("PlanDetailsPage.Bullets.Features.Backup"),Object(u.a)("PlanDetailsPage.Bullets.Features.Mail"),Object(u.a)("PlanDetailsPage.Bullets.Features.PasswordAndKeychain")]}}Object(we.a)(e)}(t,a),c=n?Object(u.a)("PlanDetailsPage.Included"):Object(u.a)("PlanDetailsPage.Includes"),o=l()("included-in-plan-section",e.className);return t===$.a.MAID?r.createElement(r.Fragment,null):r.createElement("section",{className:o},r.createElement("h2",{className:"heading"},c),r.createElement("ul",null,r.createElement(Jr,{text:i.storage})),i.premium.length>0?r.createElement(r.Fragment,null,r.createElement("h3",{className:"heading-secondary"},Object(u.a)("PlanDetailsPage.Bullets.Plus.Premium.Header")),r.createElement("ul",null,i.premium.map(((e,t)=>r.createElement(Jr,{key:t,text:e}))))):null,r.createElement("h3",{className:"heading-secondary"},i.featuresHeader),r.createElement("ul",null,i.features.map(((e,t)=>r.createElement(Jr,{key:t,text:e})))),t!==$.a.Lite&&r.createElement("p",{className:"included-in-plan-learn-more"},r.createElement(O.a,{interpolations:{"#{iCloudFeaturesLink}":r.createElement(b.a,{href:Object(h.a)("iCloudAppsFeatures")},Object(u.a)("PlanDetailsPage.Included.iCloudFeatures.Link.Title"))}},Object(u.a)("PlanDetailsPage.Included.StandardPlus.LearnMore.Features"))),t===$.a.Plus&&r.createElement("p",{className:"downgrade-or-cancel-icloudplus"},r.createElement(b.a,{href:Object(h.a)("downgradeICloudPlus")},Object(u.a)("PlanDetailsPage.Downgrade.Link.Title"))))},ti=e=>{var t,a,n,i,c;let{className:o,onPageLoaded:s}=e;const d=l()("plan-details-page",o),m=Object($.c)(),p=Z(),v=Object(Yr.d)(),g=null!==(t=Object(Yr.c)(v))&&void 0!==t?t:"",b=Zn(),h=Object(N.b)(),f=null===h||void 0===h||null===(a=h.details)||void 0===a||null===(a=a.beneficiaryInfo)||void 0===a?void 0:a.isBeneficiary,E=null!==(n=null===h||void 0===h||null===(i=h.details)||void 0===i?void 0:i.firstName)&&void 0!==n?n:"",y=f?Object(u.a)("PlanDetailsPage.TitleWithName",{firstName:E}):Object(u.a)("PlanDetailsPage.Title"),{planDetails:O,planDescription:j,extraPlanDetails:S,price:P}=function(e,t){if(e===$.a.MAID)return"free"===t.type?{planDetails:Object(u.a)("PlanDetailsPage.MAID.Details",{storage:Object(Yr.b)(t.storageSize)}),price:Object(u.a)("PlanDetailsPage.MAID.Price")}:{price:Object(u.a)("PlanDetailsPage.MAID.Price")};if(e===$.a.Lite)return{planDetails:Object(u.a)("PlanDetailsPage.Lite.Details"),price:Object(u.a)("PlanDetailsPage.Lite.Price")};if(e===$.a.Standard)return{planDetails:Object(u.a)("PlanDetailsPage.Standard.Details"),price:Object(u.a)("PlanDetailsPage.Standard.Price")};if(e===$.a.Plus){const e=t.type;if("loading"===e||"error"===e)return{};if("apple-one"===e)return{planDetails:Object(u.a)("PlanDetailsPage.Plus.Details",{storage:Object(Yr.b)(t.storageSize)}),planDescription:Object(u.a)("PlanDetailsPage.AppleOne")};if("apple-one-with-extra"===e)return{planDetails:Object(u.a)("PlanDetailsPage.Plus.Details",{storage:Object(Yr.b)(t.storageSize)}),planDescription:Object(u.a)("PlanDetailsPage.AppleOne"),extraPlanDetails:Object(u.a)("PlanDetailsPage.ExtraStorage",{storage:Object(Yr.b)(t.extraStorageSize)}),price:Object(Yr.a)(t.price,t.renewalPeriod)};if("icloud+"===e)return{planDetails:Object(u.a)("PlanDetailsPage.Plus.Details",{storage:Object(Yr.b)(t.storageSize)}),price:Object(Yr.a)(t.price,t.renewalPeriod)};if("family-sharing"===e)return{planDetails:Object(u.a)("PlanDetailsPage.Plus.Details",{storage:Object(Yr.b)(t.storageSize)}),planDescription:Object(u.a)("PlanDetailsPage.SharedBy",{planOwnerName:t.sharerName})};if("free"===e)return{planDetails:Object(u.a)("PlanDetailsPage.Plus.Details",{storage:Object(Yr.b)(t.storageSize)}),price:Object(u.a)("PlanDetailsPage.Plus.Free")};Object(we.a)(e)}else Object(we.a)(e)}(m,v);r.useEffect((()=>{"loading"!==v.type&&(null===s||void 0===s||s())}),[v,s]);const{isPlanUpgradeEligibleDataReady:w,shouldShowPlanUpgrade:C,planUpgradeEligibleDeviceList:D,planUpgradeButtonTextData:T}=Object(qr.b)(Gr.EntryPoint.PlanPage),I=Object(qr.a)(),[A,L]=r.useState(!1);return r.createElement("div",{className:d},r.createElement(Mt,{current:Pe.b.plan}),r.createElement(Vt,{title:y,subtitle:O,subtitleDescription:j,extraSubtitle:S,description:P}),r.createElement("div",{className:"plan-details-page-first-row"},r.createElement("div",{className:"application-content plan-section-wrapper"},r.createElement("div",{className:"plan-section"},r.createElement("div",{className:"border-box"},r.createElement(ei,{planType:m,planFeatures:{storageSize:g,numberOfSupportedCameras:b},isBeneficiary:f}))),w&&r.createElement(r.Fragment,null,m!==$.a.MAID&&!f&&r.createElement("div",{className:"plan-section change-plan"},null!==h&&void 0!==h&&null!==(c=h.details)&&void 0!==c&&c.dsid&&C&&D?r.createElement("div",{className:l()("upgrade-plan",{"is-hidden":A})},r.createElement(Hr.PlanPageUpgradePlanSection,{continueOnDeviceEligibleDevicesList:D,userPlan:m,refetchPageContent:()=>{I(),L(!0)},buttonTextData:T})):r.createElement(Qr,{plan:m}))))),p?r.createElement(at,null):null)};var ai=a(1642),ni=a(2318),ri=a(2319),ii=a(1472),ci=a(990);function li(){return li=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},li.apply(null,arguments)}const oi=e=>{var t;let{className:a,mailDropDetail:n}=e;const i=l()("maildrop-page",a),c=Object(u.a)("ShareAcceptancePage.Title"),[o]=Object(Aa.b)(),s=n.downloadURL?n.title:"",d=Object(Ce.a)(n.downloadURL?n.size:0,1),m=function(e){const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return e.replace(/[&<>]/g,(e=>t[e]||""))}(n.downloadURL&&null!==(t=n.fileType)&&void 0!==t?t:"dmg"),p=Object(u.a)("MailDropPage.Download.Item.Description",{fileType:Object(un.a)(m),size:d}),v=r.useRef(void 0),g=r.useRef(),b=r.useRef();function h(){J.a.cloudOSApplication.switchToSpringboard(!0)}const f=r.useCallback(((e,t)=>{o({icon:r.createElement(ii.a,null),title:Object(u.a)(e),description:Object(u.a)(t),variant:"standard",buttons:[{title:Object(u.a)("CloudOS.Button.OK.Title"),action:"ok"}],defaultAction:"ok",onActionSelected:h})}),[o]);r.useEffect((()=>{n.downloadURL?g.current=Object(ci.a)(n.downloadURL,{teh:"1"}):f("MailDropPage.Error.Title","MailDropPage.Error.Description")}),[n.downloadURL,f]);const y=e=>{switch(b.current=e,null===e||void 0===e?void 0:e.status){case 403:case 410:f("MailDropPage.Error.Title.Expired","MailDropPage.Error.Description.Expired");break;case 404:f("MailDropPage.Error.Title.NotFound","MailDropPage.Error.Description.NotFound");break;case 429:f("MailDropPage.Error.Title.MaxDownloads","MailDropPage.Error.Description.MaxDownloads");break;default:f("MailDropPage.Error.Title","MailDropPage.Error.Description")}const t=new C.a("MaildropAttachment.failure",{status:null===e||void 0===e?void 0:e.status});D.b.sharedInstance.recordStat(t)},O=()=>{const e=v.current;e&&(v.current=void 0,window.removeEventListener("message",e))};return r.createElement("div",{className:i},r.createElement("div",{className:"header-section"},r.createElement(ai.a,{className:"header-image",width:60,height:60,layoutMode:"glyphBox"}),r.createElement("h2",null,c),r.createElement("p",null,Object(u.a)("MailDropPage.Description")),r.createElement("div",{className:"maildrop-details"},r.createElement(ln.a,li({fileExtension:m},Object(un.b)(m))),r.createElement("div",{className:"item-title"},s),r.createElement("div",{className:"item-description"},p))),r.createElement("div",{className:"bottom-section"},r.createElement("div",{className:"buttons-row"},r.createElement(E.a,{onActivate:async()=>{if(!g.current)return void f("MailDropPage.Error.Title","MailDropPage.Error.Description");const e=new ni.a(" ",g.current.hostname),t=new ri.a(g.current.href," ");(()=>{if(!v.current){const e=v.current=e=>(e=>{var t;if(e.origin===(null===(t=g.current)||void 0===t?void 0:t.origin)){let t=e.data;try{t=JSON.parse(t)}catch(a){t={}}y(t)}O()})(e);window.addEventListener("message",e)}})(),(await e.download(t)).success?(D.b.sharedInstance.recordStat(new C.a("MaildropAttachment.success",{status:200})),O()):setTimeout((()=>{b.current||(O(),y())}),3e3)},className:"download-button",variant:"block primary"},Object(u.a)("MailDropPage.Download.Button.Text")))))},si=r.memo(oi),di=e=>{let{className:t,errorTitle:a,errorDescription:n}=e;const i=l()("share-acceptance-error-page",t),c=Object(u.a)("ShareAcceptancePage.Title");return r.createElement("div",{className:i},r.createElement("div",{className:"header-section"},r.createElement(ai.a,{className:"header-image",width:60,height:60,layoutMode:"glyphBox"}),r.createElement("h2",null,c),r.createElement("div",{className:"error-details"},r.createElement("div",{className:"error-title"},a),r.createElement("div",{className:"error-description"},n))))};var ui=a(968);const mi=e=>{let{longGuid:t,isUnsupportedOs:a,isUnsupportedOsVersion:n,isIOS:i,isiPad:c,isMac:l}=e;return a?r.createElement("h3",null,Object(u.a)("RemindersTemplatePage.Description.UnsupportedOs")):n?r.createElement("h3",null,Object(u.a)(c?"RemindersTemplatePage.Description.UnsupportedIpadOsVersion":i?"RemindersTemplatePage.Description.UnsupportedIOsVersion":l?"RemindersTemplatePage.Description.UnsupportedMacOsVersion":"RemindersTemplatePage.Description.UnsupportedOs")):r.createElement(E.a,{onActivate:()=>{ui.a(`x-apple-reminderkit://publictemplate/${t}`)},className:"preview-template",variant:"block primary"},Object(u.a)("RemindersTemplatePage.Button.RemindersTemplate"))},pi=e=>{let{className:t,shareInfo:a}=e;const{applicationIdentifier:n,shareTitle:i,longGuid:c}=a,o=l()("reminders-template-page",t),s=Object(u.a)("ShareAcceptancePage.Title"),{isMac:d,isIOS:m,osMajorVersion:p,osMinorVersion:v,osMicroVersion:g,isDesktopClassIpad:b}=he.a.sharedInstance.applicationParameter,h=At.c.sharedInstance.isiPad,{isUnsupportedOs:f,isUnsupportedOsVersion:E}=function(e,t,a,n,r,i){return{isUnsupportedOs:!(e||t),isUnsupportedOsVersion:e&&(n<10||10===n&&(r<15||15===r&&i<7))||t&&!a&&n<16}}(d,m,b,p,v,g);return r.createElement("div",{className:o},r.createElement("div",{className:"share-contant-container"},r.createElement("div",{className:"header-section"},r.createElement(ai.a,{className:"header-image",width:60,height:60,layoutMode:"glyphBox"}),r.createElement("h2",null,s),r.createElement("div",{className:l()("sharing-details",{disabled:f||E})},r.createElement(tt.a,{applicationIdentifier:n,iconSize:40}),r.createElement("div",{className:"sharing-title"},Object(u.a)("RemindersTemplatePage.Title.RemindersTemplate")),r.createElement("div",{className:"sharing-item-description"},i))),r.createElement("div",{className:"bottom-section"},r.createElement("div",{className:"buttons-row"},r.createElement(mi,{longGuid:c,isUnsupportedOs:f,isUnsupportedOsVersion:E,isIOS:m,isiPad:h,isMac:d})),r.createElement("p",{className:"download-add-description"},f||E?Object(u.a)("RemindersTemplatePage.Description.Unsupported"):Object(u.a)("RemindersTemplatePage.Description.Supported")))))};var vi=a(1405),gi=a(1406),bi=a(1407),hi=a(2295);function fi(){return fi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},fi.apply(null,arguments)}const Ei=e=>r.createElement(hi.a,fi({},e,{logo:r.createElement("img",{src:vi.a,srcSet:`${vi.a}, ${gi.a} 2x, ${bi.a} 3x`,width:430,height:388,alt:"","aria-hidden":!0})}));var yi=a(991);function Oi(e){const t=r.useRef(null);r.useEffect((()=>{var e;null===(e=t.current)||void 0===e||e.focus()}),[]);const a=Object(yi.a)("CloudOS.TermsAndConditions.SuccessConfirmation.Title"),n=(()=>{switch((he.a.sharedInstance.needsGameCenterTermsFlow?1:0)+2*(e.wasTermsUpdatePerformed?1:0)){case 0:return Object(yi.a)("CloudOS.TermsAndConditions.SuccessConfirmation.UpToDate.Description");case 1:return Object(yi.a)("CloudOS.TermsAndConditions.SuccessConfirmation.GameCenter.UpToDate.Description");case 2:return Object(yi.a)("CloudOS.TermsAndConditions.SuccessConfirmation.Description");case 3:return Object(yi.a)("CloudOS.TermsAndConditions.SuccessConfirmation.GameCenter.Description");default:return}})();return r.createElement("div",{className:"terms-and-conditions-success-confirmation"},r.createElement("div",{className:"content"},r.createElement("div",{className:"title-text"},a),r.createElement("div",{className:"description-text"},n),r.createElement(E.a,{ref:t,onActivate:()=>{var t;he.a.sharedInstance.applicationUrl.pathname.startsWith("/terms")&&he.a.sharedInstance.replaceHistoryState(void 0,void 0,void 0,void 0,void 0,void 0),null===(t=e.onDismiss)||void 0===t||t.call(e)}},Object(yi.a)("CloudOS.Button.OK.Title"))))}var ji=a(2302),Si=a(1538);function Ni(e){const[t]=Object(Aa.b)(),[a]=Object(Aa.b)(),n=e=>{let{title:t,description:a,accessory:n,onActionSelected:i,animates:c=Qa.b.IN,showAlertFn:l,variant:o="standard",buttons:s=[{title:Object(u.a)("CloudOS.TermsAndConditions.AgreeButton.Title"),action:"agree"},{title:Object(u.a)("CloudOS.TermsAndConditions.CancelButton.Title"),action:"cancel"}]}=e;l({icon:r.createElement(ie.a,{fill:"#0061e1",layoutMode:"glyphBox","aria-hidden":"true"}),variant:o,animates:c,title:t,buttons:s,cancelAction:"cancel",onActionSelected:e=>{i(e)},...!!a&&{description:a},...!!n&&{accessory:n}})};return r.useEffect((()=>{var e;null===(e=document.getElementsByTagName("ui-main-pane")[0])||void 0===e||e.removeAttribute("inert");let t=document.getElementsByClassName("show-modal-pane-centered");for(let a=0;a<t.length;a++){const{style:e}=t[a];e.background="transparent",e.pointerEvents="none"}}),[]),r.createElement("div",{className:"terms-and-conditions"},r.createElement(ie.a,{desiredFontSize:24,fill:"#0061e1",className:"cloud-image"}),r.createElement("div",{className:"terms-header"},r.createElement("div",{className:"terms-header-title"},e.isChina?r.createElement(r.Fragment,null,Object(u.a)("Application.Title"),r.createElement(ji.a,{className:"china-terms-and-conditions-branding"}),r.createElement("div",null,Object(u.a)("CloudOS.TermsAndConditions.Title.WithoutiCloud"))):r.createElement(r.Fragment,null,Object(u.a)("CloudOS.TermsAndConditions.Title")))),r.createElement("div",{className:"content-scroll"},r.createElement("div",{className:"content-desc",dangerouslySetInnerHTML:{__html:e.termsDetails.iCloudTerms.content}})),r.createElement("div",{className:"terms-footer"},r.createElement(E.a,{variant:"block secondary",className:"download-button",onActivate:()=>{const{locale:t,country:a,downloadICloudTerms:n}=e.termsDetails,r=Object(ci.a)(n,{locale:t,country:a});new ni.a("X-APPLE-TERMS-VALIDATE",S.a.sharedInstance.current.servicesDomain).download(new ri.a(r,"termsValidateToken"))}},Object(u.a)("CloudOS.TermsAndConditions.DownloadCopyButton.Title")),r.createElement("div",{className:"button-groups"},r.createElement(E.a,{variant:"block neutral",className:"disagree-button",onActivate:()=>{window.location.reload()}},Object(u.a)("CloudOS.TermsAndConditions.DisagreeButton.Title")),r.createElement(E.a,{variant:"block primary",onActivate:()=>{n({showAlertFn:t,title:Object(u.a)("CloudOS.TermsAndConditions.Title"),description:"CHN"===e.accountCountry?Object(u.a)("CloudOS.TermsAndConditions.ChinaTerms.Description"):Object(u.a)("CloudOS.TermsAndConditions.Description"),onActionSelected:t=>{var r,i,c,l,o;"agree"===t&&(e.showGcbdPrivacyConsent?n({showAlertFn:a,title:null!==(r=e.termsDetails.gcbdPrivacyNoticeTitle)&&void 0!==r?r:"",accessory:Object(Si.default)(`<p class="description">${o=null!==(i=e.termsDetails.gcbdPrivacyNoticeMessage)&&void 0!==i?i:"",o.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&amp;/g,"&")}</p>`),variant:"standard disable-animation should-stack",buttons:[{title:null!==(c=e.termsDetails.confirmAndAgreeButtonText)&&void 0!==c?c:Object(u.a)("CloudOS.TermsAndConditions.AgreeButton.Title"),action:"agree"},{title:null!==(l=e.termsDetails.disagreeButtonText)&&void 0!==l?l:Object(u.a)("CloudOS.TermsAndConditions.DisagreeButton.Title"),action:"cancel"}],onActionSelected:t=>{"agree"===t&&e.onAcceptTerms(!0)}}):e.onAcceptTerms(!0))}})}},Object(u.a)("CloudOS.TermsAndConditions.AgreeButton.Title")))))}function Pi(e){return r.createElement("div",{className:"terms-and-conditions"},r.createElement(ie.a,{desiredFontSize:24,fill:"#0061e1",className:"cloud-image"}),r.createElement("div",{className:"terms-header"},r.createElement("div",{className:"terms-header-title"},Object(u.a)("Application.Title"),r.createElement(ji.a,{className:"china-terms-and-conditions-branding"}))),r.createElement("div",{className:"content-scroll"},r.createElement("div",{className:"china-terms-label"},Object(u.a)("CloudOS.TermsAndConditions.ChinaTerms.Paragraph.One")),r.createElement("div",{className:"china-terms-label"},Object(u.a)("CloudOS.TermsAndConditions.ChinaTerms.Paragraph.Two"))),r.createElement("div",{className:"terms-footer china"},r.createElement(E.a,{variant:"block primary",onActivate:e.onContinue},Object(u.a)("CloudOS.TermsAndConditions.ContinueButton.Title"))))}const wi=e=>{const[t,a]=r.useState(!1),n="CHN"!==e.accountCountry||t?r.createElement(Ni,{onAcceptTerms:e.onAcceptTerms,accountCountry:e.accountCountry,termsDetails:e.termsDetails,isChina:"CHN"===e.accountCountry,showGcbdPrivacyConsent:e.showGcbdPrivacyConsent}):r.createElement(Pi,{onContinue:()=>a(!0)});return r.createElement("div",{className:"terms-and-conditions-container"},n)};function Ci(){g.h.value&&J.a.cloudOSApplication.triggerPrefetchTileData(!1,g.h.value),Object(Wt.c)()}function Di(e){return r.createElement(n.a,{className:e.className},r.createElement(o.b,{value:o.a.LOGIN},r.createElement(s.a,null)),r.createElement("main",null,r.createElement(m,null)),r.createElement("footer",null,r.createElement(p.a,null)))}function Ti(e){return r.createElement(n.a,{className:e.className},r.createElement(o.b,{value:o.a.LOGIN},r.createElement(s.a,null)),r.createElement("main",null,r.createElement(f,null)),r.createElement("footer",null,r.createElement(p.a,null)))}function Ii(e){return r.createElement(n.a,{className:e.className},r.createElement(o.b,{value:o.a.LOGIN},r.createElement(s.a,null)),r.createElement("main",null,r.createElement(K,{onComplete:e.onComplete})),r.createElement("footer",null,r.createElement(p.a,null)))}function Ai(e){const t=Z();return r.createElement(n.a,{className:l()("settings-page-route",e.className)},r.createElement(o.b,{value:o.a.INTERNAL_APP},r.createElement(s.a,{canTriggerAutoWhatsNew:!0})),r.createElement("main",null,r.createElement(_t,{onPageLoaded:Ci})),r.createElement("footer",{className:t?"gray-theme":""},r.createElement(te,{currentPageName:Object(u.a)("Settings.DisplayName")}),r.createElement(p.a,null)))}function Li(e){return r.createElement(n.a,{className:l()("recovery-page-route",e.className)},r.createElement(o.b,{value:o.a.INTERNAL_APP},r.createElement(s.a,{canTriggerAutoWhatsNew:!0})),r.createElement("main",null,r.createElement(zn,null)),r.createElement("footer",null,r.createElement(te,{currentPageName:Object(u.a)("RecoveryPage.Title")}),r.createElement(p.a,null)))}function ki(e){return r.createElement(n.a,{className:l()("icloud-plus-page-route",e.className)},r.createElement(o.b,{value:o.a.INTERNAL_APP},r.createElement(s.a,{canTriggerAutoWhatsNew:!0})),r.createElement("main",null,r.createElement(mr,{onPageLoaded:Ci})),r.createElement("footer",null,r.createElement(te,{currentPageName:Object(u.a)("ICloudPlusPage.Title")}),r.createElement(p.a,null)))}function Ri(e){const t=e.isBeneficiary?Object(u.a)("StoragePage.Title.Lite"):Object(u.a)("StoragePage.Title");return r.createElement(n.a,{className:l()("storage-page-route",e.className)},r.createElement(o.b,{value:o.a.INTERNAL_APP},r.createElement(s.a,{canTriggerAutoWhatsNew:!0})),r.createElement("main",null,r.createElement(Kr,{onPageLoaded:Ci})),r.createElement("footer",null,r.createElement(te,{currentPageName:t}),r.createElement(p.a,null)))}function Fi(e){const t=e.isBeneficiary?Object(u.a)("PlanDetailsPage.Title.Lite"):Object(u.a)("PlanDetailsPage.Title"),a=Z();return r.createElement(n.a,{className:l()("plan-page-route",e.className)},r.createElement(o.b,{value:o.a.INTERNAL_APP},r.createElement(s.a,{canTriggerAutoWhatsNew:!0})),r.createElement("main",null,r.createElement(ti,{onPageLoaded:Ci})),r.createElement("footer",{className:a?"gray-theme":""},r.createElement(te,{currentPageName:t}),r.createElement(p.a,null)))}function Mi(e){return r.createElement(n.a,{className:e.className},r.createElement(o.b,{value:o.a.LOGIN},r.createElement(s.a,null)),r.createElement("main",null,r.createElement(si,{mailDropDetail:e.details})),r.createElement("footer",null,r.createElement(p.a,null)))}function zi(e){return r.createElement(n.a,{className:e.className},r.createElement(o.b,{value:o.a.LOGIN},r.createElement(s.a,null)),r.createElement("main",null,r.createElement(di,{errorDescription:e.errorDescription,errorTitle:e.errorTitle,applicationIdentifier:e.applicationIdentifier})),r.createElement("footer",null,r.createElement(p.a,null)))}function Bi(e){return r.createElement(n.a,{className:e.className},r.createElement(o.b,{value:o.a.LOGIN},r.createElement(s.a,null)),r.createElement("main",{className:"centering"},r.createElement(pi,e.pageProps)),r.createElement("footer",null,r.createElement(p.a,null)))}function xi(e){return Object(lr.b)().launchApp("mail",{options:{source:{reason:sr.b.OPEN_DOCUMENT},launchItem:{id:e.threadId}}}),null}function Ui(e){return Object(lr.b)().launchApp("calendar",{options:{source:{reason:sr.b.OPEN_DOCUMENT},launchItem:{id:e.eventId,calendarId:e.collectionId}}}),null}function _i(e){return r.createElement(n.a,{className:l()("redirect-to-domain-route",e.className)},r.createElement(o.b,{value:o.a.LOGIN},r.createElement(s.a,null)),r.createElement("main",null,r.createElement(Ei,e.pageProps)),r.createElement("footer",null,r.createElement(p.a,null)))}function Wi(e){return r.createElement("main",null,r.createElement(Oi,{wasTermsUpdatePerformed:e.wasTermsUpdatePerformed,onDismiss:e.onDismiss}))}function Hi(e){return r.createElement(n.a,{className:l()("terms-and-conditions-route",e.className)},r.createElement(o.b,{value:o.a.LOGIN},r.createElement(s.a,null)),r.createElement("main",null,r.createElement(wi,e.pageProps)),r.createElement("footer",null,r.createElement(p.a,null)))}},2161:function(e,t,a){"use strict";a.d(t,"a",(function(){return H}));var n=a(935),r=a.n(n),i=["styles"];function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},c.apply(null,arguments)}var l=function(e){e.styles;var t=function(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;a[n]=e[n]}return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],-1===t.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}(e,i);return r.a.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"37.11 6.39 82.13 90.14"},t),r.a.createElement("path",{fill:"var(--theme-color-systemBlue)",fillRule:"evenodd",d:"M55.663 37.29h44.796c1.503 0 2.685 1.181 2.685 2.736a2.661 2.661 0 01-2.685 2.695H55.663c-1.514 0-2.685-1.182-2.685-2.695 0-1.555 1.171-2.737 2.685-2.737zm22.435-5.067c-6.81 0-11.773-4.827-11.773-10.287 0-6.063 5.502-10.486 11.773-10.486 5.959 0 11.689 4.122 11.689 10.62 0 5.389-4.963 10.153-11.69 10.153zM45.692 50.255h64.948c6.3 0 9.66-4.13 8.29-10.968l-4.682-23.034c-1.204-6.08-5.426-9.865-11.546-9.865H53.63c-6.12 0-10.342 3.786-11.535 9.865l-4.682 23.034c-1.38 6.838 1.98 10.968 8.28 10.968zM74.08 91.72h8.174V48.853H74.08zm-12.89 4.806h33.95c2.227 0 4.082-1.906 4.082-4.082 0-2.237-1.855-4.082-4.082-4.082H61.19c-2.227 0-4.082 1.845-4.082 4.082 0 2.176 1.855 4.082 4.082 4.082z"}))},o=["styles"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},s.apply(null,arguments)}var d=function(e){e.styles;var t=function(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;a[n]=e[n]}return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],-1===t.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}(e,o);return r.a.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"31.89 11.51 92.55 78.89"},t),r.a.createElement("path",{fill:"var(--theme-color-systemOrange)",d:"M70.12 42.164l10.174 10.235 16.4-16.338c10.7-10.647 16.737-20.997 13.968-23.767-2.977-2.966-13.287 2.699-23.934 13.335zm5.488 13.375l-8.616-8.586-26.194 26.194-2.613 3.722 7.466 7.403 3.764-2.55zM32.113 88.116c-.788 1.451.622 2.81 2.01 2.073l7.236-3.821-5.362-5.31zm17.918 2.249h70.482c2.135 0 3.927-1.803 3.927-3.979 0-2.124-1.792-3.926-3.927-3.926H57.988z"}))},u=["styles"];function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},m.apply(null,arguments)}var p=function(e){e.styles;var t=function(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;a[n]=e[n]}return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],-1===t.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}(e,u);return r.a.createElement("svg",m({xmlns:"http://www.w3.org/2000/svg",viewBox:"32 6.28 92.33 90.35"},t),r.a.createElement("path",{fill:"var(--theme-color-systemGreen)",d:"M37.499 96.634h6.37c3.29 0 5.447-2.261 5.447-5.673V73.584c0-3.35-2.158-5.673-5.446-5.673h-6.371c-3.278 0-5.498 2.323-5.498 5.673v17.377c0 3.412 2.22 5.673 5.498 5.673zm24.995 0h6.37c3.268 0 5.499-2.261 5.499-5.673V50.239c0-3.413-2.23-5.684-5.498-5.684h-6.37c-3.29 0-5.447 2.271-5.447 5.684V90.96c0 3.412 2.158 5.673 5.446 5.673zm25.037 0h6.308c3.289 0 5.508-2.261 5.508-5.673V11.9c0-3.412-2.22-5.62-5.508-5.62h-6.308c-3.278 0-5.498 2.208-5.498 5.62v79.06c0 3.412 2.22 5.673 5.498 5.673zm24.984 0h6.32c3.288 0 5.497-2.261 5.497-5.673v-56.2c0-3.412-2.209-5.673-5.498-5.673h-6.319c-3.267 0-5.498 2.261-5.498 5.673v56.2c0 3.412 2.23 5.673 5.498 5.673z"}))},v=["styles"];function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},g.apply(null,arguments)}var b=function(e){e.styles;var t=function(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;a[n]=e[n]}return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],-1===t.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}(e,v);return r.a.createElement("svg",g({width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg"},t),r.a.createElement("path",{d:"M16.795 0c1.115 0 1.519.116 1.926.334.407.218.727.538.945.945.218.407.334.811.334 1.926v13.59c0 1.115-.116 1.519-.334 1.926a2.272 2.272 0 01-.945.945c-.407.218-.811.334-1.926.334H3.205c-1.115 0-1.519-.116-1.926-.334a2.272 2.272 0 01-.945-.945C.116 18.314 0 17.91 0 16.795V3.205C0 2.09.116 1.686.334 1.279.552.872.872.552 1.279.334 1.686.116 2.09 0 3.205 0h13.59zm-6.663 4.431H5.933V15H7.77v-3.516l2.362.001.263-.007a3.7 3.7 0 001.607-.435 3.185 3.185 0 001.256-1.236c.301-.53.452-1.145.452-1.847v-.014l-.007-.26a3.54 3.54 0 00-.445-1.584 3.177 3.177 0 00-1.256-1.231c-.536-.293-1.159-.44-1.87-.44zm-.454 1.51l.223.006c.58.035 1.038.208 1.375.52.379.35.568.846.568 1.489v.015l-.007.207c-.037.54-.224.966-.561 1.28-.379.353-.911.53-1.598.53H7.77V5.94h1.91z",fill:"#B9380B",fillRule:"evenodd"}))},h=["styles"];function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},f.apply(null,arguments)}var E=function(e){e.styles;var t=function(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;a[n]=e[n]}return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],-1===t.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}(e,h);return r.a.createElement("svg",f({width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg"},t),r.a.createElement("path",{d:"M16.795 0c1.115 0 1.519.116 1.926.334.407.218.727.538.945.945.218.407.334.811.334 1.926v13.59c0 1.115-.116 1.519-.334 1.926a2.272 2.272 0 01-.945.945c-.407.218-.811.334-1.926.334H3.205c-1.115 0-1.519-.116-1.926-.334a2.272 2.272 0 01-.945-.945C.116 18.314 0 17.91 0 16.795V3.205C0 2.09.116 1.686.334 1.279.552.872.872.552 1.279.334 1.686.116 2.09 0 3.205 0h13.59zM5.177 4.931H3.264L6.098 15.5h1.734L10 7.867h.105l2.179 7.633h1.727l2.834-10.569h-1.904l-1.83 7.99h-.105l-2.132-7.99H9.231l-2.11 7.99h-.106l-1.838-7.99z",fill:"#205BC5",fillRule:"evenodd"}))},y=["styles"];function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},O.apply(null,arguments)}var j=function(e){e.styles;var t=function(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;a[n]=e[n]}return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],-1===t.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}(e,y);return r.a.createElement("svg",O({width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg"},t),r.a.createElement("path",{d:"M16.795 0c1.115 0 1.519.116 1.926.334.407.218.727.538.945.945.218.407.334.811.334 1.926v13.59c0 1.115-.116 1.519-.334 1.926a2.272 2.272 0 01-.945.945c-.407.218-.811.334-1.926.334H3.205c-1.115 0-1.519-.116-1.926-.334a2.272 2.272 0 01-.945-.945C.116 18.314 0 17.91 0 16.795V3.205C0 2.09.116 1.686.334 1.279.552.872.872.552 1.279.334 1.686.116 2.09 0 3.205 0h13.59zm-9.33 4.931h-2.38l3.388 5.224L5.06 15.5h2.19l2.494-3.816 2.427 3.816h2.313l-3.451-5.3 3.506-5.269H12.28l-2.443 3.91-2.373-3.91z",fill:"#297337",fillRule:"evenodd"}))},S=["styles"];function N(){return N=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},N.apply(null,arguments)}var P=function(e){e.styles;var t=function(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;a[n]=e[n]}return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],-1===t.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}(e,S);return r.a.createElement("svg",N({width:"16",height:"20",xmlns:"http://www.w3.org/2000/svg"},t),r.a.createElement("path",{d:"M2.949 20H13.05c1.97 0 2.949-.98 2.949-2.92V8.61H9.113c-1.218 0-1.798-.569-1.798-1.763V0H2.95C.989 0 0 .989 0 2.93v14.15C0 19.03.98 20 2.949 20zm5.08-6.627c.315 0 .573.057.774.171.202.114.35.278.447.49.097.212.146.466.146.76 0 .298-.05.555-.148.771a1.074 1.074 0 01-.45.5c-.201.116-.458.174-.769.174H6.843v-2.866zm3.855 0v.554h-1.286v.693h1.17v.537h-1.17v1.082H9.87v-2.866h2.014zm-6.517 0c.233 0 .428.045.584.136.157.09.275.21.355.36.08.151.12.317.12.498 0 .182-.041.348-.122.496a.882.882 0 01-.358.355 1.199 1.199 0 01-.587.132h-.541v.889H4.09v-2.866zm2.546.547h-.342v1.771h.342c.13 0 .24-.018.333-.054a.537.537 0 00.228-.165.724.724 0 00.132-.275c.028-.11.042-.239.042-.386 0-.196-.025-.36-.076-.493a.583.583 0 00-.238-.299.792.792 0 00-.42-.1zM5.2 13.903h-.384v.928H5.2a.57.57 0 00.26-.055.39.39 0 00.17-.158.506.506 0 00.058-.251c0-.15-.043-.266-.13-.345a.512.512 0 00-.358-.12zM8.62.103c.399.065.789.335 1.236.783l5.241 5.233c.457.457.733.83.79 1.213H9.14c-.351 0-.523-.168-.523-.504z",fill:"var(--theme-color-systemRed)"}))},w=["styles"];function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},C.apply(null,arguments)}var D=function(e){e.styles;var t=function(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;a[n]=e[n]}return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],-1===t.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}(e,w);return r.a.createElement("svg",C({width:"16",height:"20",xmlns:"http://www.w3.org/2000/svg"},t),r.a.createElement("path",{d:"M6.602 0L6.24 1.502 5.784 3.46a3.66 3.66 0 00-.086.783c0 1.157.628 1.922 1.712 2.118v2.341H5.755c-.333 0-.59.243-.59.56 0 .327.257.588.59.588H7.41v1.38H5.755c-.333 0-.59.243-.59.56 0 .327.257.588.59.588H7.41v1.38H5.755c-.333 0-.59.243-.59.56 0 .327.257.588.59.588H7.41v1.38H5.755a.573.573 0 100 1.148H7.41v1.063h1.18v-2.332h1.655a.573.573 0 100-1.147H8.59v-1.38h1.655c.333 0 .59-.253.59-.58a.573.573 0 00-.59-.568H8.59v-1.38h1.655c.333 0 .59-.253.59-.58a.573.573 0 00-.59-.568H8.59v-1.38h1.655c.333 0 .59-.253.59-.58a.573.573 0 00-.59-.568H8.59V6.362c1.084-.196 1.712-.96 1.712-2.118a3.66 3.66 0 00-.086-.783l-.455-1.952h.002L9.41 0h3.64c1.899 0 2.878.92 2.945 2.725l.004.204V17.08c0 1.95-.98 2.92-2.949 2.92H2.95C.979 20 0 19.03 0 17.08V2.93C0 .988.98 0 2.949 0h3.653zM8 3.134c.58 0 1.037.448 1.037 1.017 0 .578-.438 1.026-1.037 1.026-.59 0-1.037-.448-1.037-1.026 0-.569.457-1.017 1.037-1.017z",fill:"var(--theme-color-labelPrimary)"}))},T=["styles"];function I(){return I=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},I.apply(null,arguments)}var A=function(e){e.styles;var t=function(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;a[n]=e[n]}return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],-1===t.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}(e,T);return r.a.createElement("svg",I({width:"24",height:"18",xmlns:"http://www.w3.org/2000/svg"},t),r.a.createElement("path",{d:"M3.563 18h16.874c2.049 0 3.063-1.007 3.063-3.021V3.03C23.5 1.017 22.486 0 20.437 0H3.563C1.524 0 .5 1.017.5 3.031v11.948C.5 16.993 1.524 18 3.563 18zm4.253-8.75a2.417 2.417 0 01-2.41-2.416 2.424 2.424 0 012.41-2.415c1.316 0 2.399 1.095 2.399 2.415a2.415 2.415 0 01-2.4 2.415zm-4.234 7.186c-.946 0-1.512-.567-1.512-1.526v-.596l2.995-2.62c.43-.382.897-.577 1.326-.577.478 0 .976.195 1.405.596l1.863 1.682 4.662-4.146c.478-.43 1.015-.625 1.57-.625a2.27 2.27 0 011.552.635l4.487 4.165v1.506c0 .939-.576 1.506-1.503 1.506H3.582z",fill:"var(--theme-color-systemYellow)"}))},L=["styles"];function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},k.apply(null,arguments)}var R=function(e){e.styles;var t=function(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;a[n]=e[n]}return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],-1===t.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}(e,L);return r.a.createElement("svg",k({width:"22",height:"24"},t),r.a.createElement("path",{fill:"var(--theme-color-systemPink)",d:"M8.736 0c.667 0 1.19.523 1.19 1.18v20.907c0 .656-.523 1.169-1.19 1.169a1.153 1.153 0 01-1.158-1.17V1.18C7.578.523 8.09 0 8.736 0zm7.578 2.215c.666 0 1.19.533 1.19 1.19v16.457c0 .656-.524 1.179-1.19 1.179a1.162 1.162 0 01-1.159-1.18V3.405c0-.656.513-1.19 1.159-1.19zM4.953 3.507c.656 0 1.179.533 1.179 1.19V18.56c0 .656-.523 1.179-1.18 1.179a1.164 1.164 0 01-1.168-1.18V4.697c0-.656.512-1.19 1.169-1.19zm7.577 1.59c.657 0 1.18.532 1.18 1.189V16.98a1.17 1.17 0 01-1.18 1.17 1.162 1.162 0 01-1.169-1.17V6.286c0-.657.513-1.19 1.17-1.19zM20.108 6.9c.656 0 1.18.533 1.18 1.18v7.095c0 .656-.524 1.169-1.18 1.169a1.156 1.156 0 01-1.169-1.17V8.08c0-.646.513-1.18 1.169-1.18zm-18.95.554c.667 0 1.19.533 1.19 1.189v5.978c0 .646-.523 1.169-1.19 1.169A1.16 1.16 0 010 14.622V8.644c0-.656.513-1.19 1.159-1.19z"}))},F=["styles"];function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},M.apply(null,arguments)}var z=function(e){e.styles;var t=function(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;a[n]=e[n]}return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],-1===t.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}(e,F);return r.a.createElement("svg",M({width:"22",height:"18",xmlns:"http://www.w3.org/2000/svg"},t),r.a.createElement("path",{d:"M2.166 18h17.668C21.14 18 22 17.122 22 15.797V2.203C22 .878 21.14 0 19.834 0H2.166C.85 0 0 .878 0 2.203v13.594C0 17.122.851 18 2.166 18zm-.01-14.26a.42.42 0 01-.435-.43v-.925c0-.277.186-.468.454-.468h1.027c.241 0 .417.182.417.449v.944c0 .238-.176.43-.417.43H2.156zm3.471 4.3c-.296 0-.5-.2-.5-.505V2.423c0-.305.204-.506.5-.506h10.709c.296 0 .5.2.5.506v5.113c0 .305-.204.505-.5.505H5.627zm13.134-4.3a.423.423 0 01-.426-.429v-.944c0-.267.185-.449.426-.449h1.018c.277 0 .462.191.462.468v.925a.42.42 0 01-.435.43h-1.045zM2.156 6.84a.425.425 0 01-.435-.429v-.935c0-.267.176-.448.435-.448h1.046c.241 0 .417.181.417.448v.935c0 .23-.176.43-.417.43H2.156zm16.605 0a.43.43 0 01-.426-.429v-.935c0-.267.185-.448.426-.448h1.045c.26 0 .435.181.435.448v.935c0 .23-.175.43-.435.43h-1.045zM2.156 9.901a.42.42 0 01-.435-.429v-.935c0-.257.176-.438.435-.438h1.046c.241 0 .417.18.417.438v.935c0 .239-.176.43-.417.43H2.156zm16.605 0a.423.423 0 01-.426-.429v-.935a.42.42 0 01.426-.438h1.045c.26 0 .435.18.435.438v.935a.42.42 0 01-.435.43h-1.045zM5.627 16.073c-.296 0-.5-.2-.5-.505v-5.085c0-.305.204-.515.5-.515h10.709c.296 0 .5.21.5.515v5.085c0 .305-.204.505-.5.505H5.627zm-3.47-3.09c-.26 0-.436-.2-.436-.44v-.925c0-.267.176-.448.435-.448h1.046c.241 0 .417.181.417.448v.926c0 .238-.176.439-.417.439H2.156zm16.604 0a.431.431 0 01-.426-.44v-.925c0-.267.185-.448.426-.448h1.045c.26 0 .435.181.435.448v.926a.428.428 0 01-.435.439h-1.045zm-16.586 3.09a.437.437 0 01-.454-.458V14.7c0-.268.176-.449.435-.449h1.046c.241 0 .417.181.417.449v.934c0 .258-.176.44-.417.44H2.175zm16.586 0a.42.42 0 01-.426-.439V14.7c0-.268.185-.449.426-.449h1.045c.26 0 .435.181.435.449v.915a.439.439 0 01-.462.458H18.76z",fill:"var(--theme-color-gray1)"}))},B=["styles"];function x(){return x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},x.apply(null,arguments)}var U=function(e){e.styles;var t=function(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;a[n]=e[n]}return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],-1===t.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}(e,B);return r.a.createElement("svg",x({width:"16",height:"20",xmlns:"http://www.w3.org/2000/svg"},t),r.a.createElement("path",{d:"M4.379 5.366a.605.605 0 01-.443-1.03.615.615 0 01.443-.17h7.253c.176 0 .323.056.441.17a.559.559 0 01.178.42.602.602 0 01-.619.61H4.379zm0 3.322a.597.597 0 01-.443-.18.592.592 0 01-.178-.43.56.56 0 01.178-.422.615.615 0 01.443-.17h7.253c.176 0 .323.057.441.17a.56.56 0 01.178.421c0 .168-.06.311-.178.431a.595.595 0 01-.441.18H4.379zm0 3.313a.614.614 0 01-.443-.17.56.56 0 01-.178-.42.605.605 0 01.62-.61l3.472-.002a.597.597 0 01.617.611.567.567 0 01-.173.42.606.606 0 01-.444.171H4.379zM0 17.024c0 .985.252 1.728.755 2.227.503.5 1.249.749 2.236.749h10.018c.993 0 1.74-.25 2.24-.749.5-.499.751-1.242.751-2.227V2.985c0-.986-.25-1.73-.75-2.232C14.75.251 14.001 0 13.01 0H2.99C2.005 0 1.259.251.756.753.252 1.255 0 2 0 2.985v14.039z",fill:"var(--theme-color-systemPurple)"}))},_=a(1208);function W(){return W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},W.apply(null,arguments)}const H=e=>{const t={aac:"FileIcon.FileType.aac",abbu:"FileIcon.FileType.abbu",ai:"FileIcon.FileType.ai",aiff:"FileIcon.FileType.aiff",apk:"FileIcon.FileType.apk",app:"FileIcon.FileType.app",avi:"FileIcon.FileType.avi",band:"FileIcon.FileType.band",bat:"FileIcon.FileType.bat",bin:"FileIcon.FileType.bin",blend:"FileIcon.FileType.blend",bmp:"FileIcon.FileType.bmp",c:"FileIcon.FileType.c",c4d:"FileIcon.FileType.c4d",class:"FileIcon.FileType.class",cpp:"FileIcon.FileType.cpp",css:"FileIcon.FileType.css",cer:"FileIcon.FileType.cer",csv:"FileIcon.FileType.csv",dae:"FileIcon.FileType.dae",dmg:"FileIcon.FileType.dmg",dng:"FileIcon.FileType.dng",doc:"FileIcon.FileType.doc",docx:"FileIcon.FileType.docx",dxf:"FileIcon.FileType.dxf",eps:"FileIcon.FileType.eps",exe:"FileIcon.FileType.exe",fbx:"FileIcon.FileType.fbx",gif:"FileIcon.FileType.gif",gz:"FileIcon.FileType.gz",h:"FileIcon.FileType.h",hqx:"FileIcon.FileType.hqx",htm:"FileIcon.FileType.htm",epub:"FileIcon.FileType.epub",ibooks:"FileIcon.FileType.ibooks",icns:"FileIcon.FileType.icns",ico:"FileIcon.FileType.ico",ics:"FileIcon.FileType.ics",indd:"FileIcon.FileType.indd",ipa:"FileIcon.FileType.ipa",iso:"FileIcon.FileType.iso",java:"FileIcon.FileType.java",jpg:"FileIcon.FileType.jpg",jpeg:"FileIcon.FileType.jpg",js:"FileIcon.FileType.js",key:"FileIcon.FileType.key",keychain:"FileIcon.FileType.keychain",log:"FileIcon.FileType.log",m:"FileIcon.FileType.m",m3u:"FileIcon.FileType.m3u",m4a:"FileIcon.FileType.m4a",m4p:"FileIcon.FileType.m4p",m4r:"FileIcon.FileType.m4r",m4v:"FileIcon.FileType.m4v",mid:"FileIcon.FileType.mid",qt:"FileIcon.FileType.qt",mp3:"FileIcon.FileType.mp3",mp4:"FileIcon.FileType.mp4",mpeg:"FileIcon.FileType.mpeg",numbers:"FileIcon.FileType.numbers",obj:"FileIcon.FileType.obj",otf:"FileIcon.FileType.otf",pages:"FileIcon.FileType.pages",pdf:"FileIcon.FileType.pdf",perl:"FileIcon.FileType.perl",pkg:"FileIcon.FileType.pkg",png:"FileIcon.FileType.png",pps:"FileIcon.FileType.pps",ppsx:"FileIcon.FileType.ppsx",ppt:"FileIcon.FileType.ppt",pptx:"FileIcon.FileType.pptx",ps:"FileIcon.FileType.ps",psd:"FileIcon.FileType.psd",py:"FileIcon.FileType.py",rar:"FileIcon.FileType.rar",rtf:"FileIcon.FileType.rtf",safariextz:"FileIcon.FileType.safariextz",scpt:"FileIcon.FileType.scpt",sh:"FileIcon.FileType.sh",stl:"FileIcon.FileType.stl",svg:"FileIcon.FileType.svg",swift:"FileIcon.FileType.swift",tar:"FileIcon.FileType.tar",tiff:"FileIcon.FileType.tiff",ttf:"FileIcon.FileType.ttf",txt:"FileIcon.FileType.txt",vcf:"FileIcon.FileType.vcf",wave:"FileIcon.FileType.wave",wma:"FileIcon.FileType.wma",wmv:"FileIcon.FileType.wmv",xcodeproj:"FileIcon.FileType.xcodeproj",xhtml:"FileIcon.FileType.xhtml",xlam:"FileIcon.FileType.xlam",xls:"FileIcon.FileType.xls",xlsx:"FileIcon.FileType.xlsx",xml:"FileIcon.FileType.xml",zip:"FileIcon.FileType.zip"},{fileExtension:a,...r}=e,i=a&&t[a]?Object(_.a)(t[a]):Object(_.a)("FileIcon.FileType.default");return n.createElement("div",{className:"icon"},(()=>{switch(a){case"key":return n.createElement(l,W({"aria-label":i,"data-testid":"keynote-icon",height:18,width:20},r));case"numbers":return n.createElement(p,W({"aria-label":i,"data-testid":"numbers-icon",height:18,width:20},r));case"pages":return n.createElement(d,W({"aria-label":i,"data-testid":"pages-icon",height:18,width:20},r));case"pptx":case"ppt":return n.createElement(b,W({"aria-label":i,"data-testid":"ppt-icon"},r));case"xlsx":case"xls":case"xlam":return n.createElement(j,W({"aria-label":i,"data-testid":"excel-icon"},r));case"docx":case"doc":return n.createElement(E,W({"aria-label":i,"data-testid":"word-icon"},r));case"jpg":case"jpeg":case"png":case"gif":case"tiff":case"tif":case"bmp":return n.createElement(A,W({"aria-label":i,"data-testid":"image-icon"},r));case"aac":case"wav":case"m4a":case"m4p":case"aiff":case"midi":case"wave":case"mp3":return n.createElement(R,W({"aria-label":i,"data-testid":"audio-icon"},r));case"mp4":case"m4v":case"mov":return n.createElement(z,W({"aria-label":i,"data-testid":"video-icon"},r));case"zip":return n.createElement(D,W({"aria-label":i,"data-testid":"zip-icon"},r));case"pdf":return n.createElement(P,W({"aria-label":i,"data-testid":"pdf-icon"},r));default:return n.createElement(U,W({"aria-label":i,"data-testid":"default-icon"},r))}})())}},2187:function(e,t,a){"use strict";a.d(t,"a",(function(){return f}));var n=a(935),r=a(1487),i=a(2260),c=a(1422),l=a(1633),o=a(1632);var s=a(2200),d=a(2238),u=a(1208),m=a(1322),p=a(1319),v=a(2322),g=a(2313),b=a(2138);const h=e=>{var t;const{hmeInfo:a,tileSize:r,isLoading:i,tileIndex:c,error:l,appId:o}=e,h=Object(u.a)("HideMyEmailTile.Heading"),f=Object(u.a)("HideMyEmailTile.Description"),E=Object(u.a)("HideMyEmailTile.Content.Title"),y=[Object(u.a)("HideMyEmailTile.Content.ListItem.Active",{count:a?a.active:0}),Object(u.a)("HideMyEmailTile.Content.ListItem.Inactive",{count:a?a.inactive:0})],O=Object(m.b)(),j=n.useCallback((()=>{O.launchApp("hidemyemail",void 0,{presentationStyle:"modal"})}),[O]),S="hidemyemail"===(null===(t=d.a.sharedInstance.applicationParameter.informationalPageDetails)||void 0===t?void 0:t.relativePath);n.useEffect((()=>{S&&j()}),[j,S]);const{isInCustomizationMode:N}=Object(p.b)();return n.createElement(s.b,{appId:o,tileIndex:c,icon:n.createElement(b.a,{iconSize:40,applicationIdentifier:"hidemyemail"}),className:"hide-my-email-tile",heading:h,description:f,isLoading:i,tileSize:r,onTileClick:N?void 0:j,error:l},e.error?n.createElement(v.a,{refetch:e.refetch,showClouds:!1}):n.createElement(g.a,{contentTitleText:E,contentListItems:y}))},f=e=>{let{onSuccess:t,onError:a,appId:d,tileIndex:u,tileSize:m}=e;const{data:p,error:v,isLoading:g,isSuccess:b,refetch:f}=(E={onSuccess:t,onError:a},Object(r.a)({...E,endpoint:i.b.hmeList,fetchProvider:e=>()=>function(e){let{webServices:t}=e;if(null===t||void 0===t||!t.premiummailsettings)throw new Error("no service url available");return Object(c.a)({url:`${t.premiummailsettings}/v2/hme/list`,includeCredentials:!0,validate:{type:"WireHmeListResponse",schema:o.b}}).then((e=>function(e){if(Object(l.a)(e.success))return{active:0,inactive:0};if(e.success&&e.result){const{hmeEmails:t}=e.result;return{active:t.filter((e=>e.isActive)).length,inactive:t.filter((e=>!e.isActive)).length}}var t;throw new Error((null===e||void 0===e||null===(t=e.error)||void 0===t?void 0:t.errorMessage)||"hide my email api returns error")}(e)))}(e)}));var E;return n.createElement(h,{appId:d,tileIndex:null!==u&&void 0!==u?u:0,error:v,isLoading:g,isSuccess:b,hmeInfo:p,refetch:f,tileSize:null!==m&&void 0!==m?m:s.c.Small})}},2202:function(e,t,a){"use strict";a.d(t,"a",(function(){return f}));var n=a(935),r=a(1487),i=a(2260),c=a(1422),l=a(1634),o=a(1633);var s=a(2238),d=a(1208),u=a(1322),m=a(1319),p=a(2322),v=a(2313),g=a(2200),b=a(2138);const h=e=>{var t;const{customEmailDomainNames:a,tileSize:r,isLoading:i,tileIndex:c,error:l,appId:o}=e,h=Object(d.a)("CustomEmailDomainTile.Heading"),f=Object(d.a)("CustomEmailDomainTile.Description"),E=a?a.length:0,y=Object(d.b)({zero:"CustomEmailDomainTile.Content.Title.Zero",one:"CustomEmailDomainTile.Content.Title.One",two:"CustomEmailDomainTile.Content.Title.Two",many:"CustomEmailDomainTile.Content.Title.Many"},E),O=Object(u.b)(),j=n.useCallback((()=>{O.launchApp("customdomainsettings",void 0,{presentationStyle:"modal"})}),[O]),S="customdomain"===(null===(t=s.a.sharedInstance.applicationParameter.informationalPageDetails)||void 0===t?void 0:t.relativePath);n.useEffect((()=>{S&&j()}),[j,S]);const{isInCustomizationMode:N}=Object(m.b)();return n.createElement(g.b,{appId:o,tileIndex:c,icon:n.createElement(b.a,{iconSize:40,applicationIdentifier:"customdomainsettings"}),className:"custom-email-domain-tile",heading:h,description:f,isLoading:i,tileSize:r,onTileClick:N?void 0:j,error:l},e.error?n.createElement(p.a,{refetch:e.refetch,showClouds:!1}):n.createElement(v.a,{contentTitleText:y,contentListItems:a}))},f=e=>{let{onSuccess:t,onError:a,appId:s,tileIndex:d,tileSize:u}=e;const{data:m,error:p,isLoading:v,isSuccess:b,refetch:f}=(E={onSuccess:t,onError:a},Object(r.a)({...E,endpoint:i.b.customEmailDomains,fetchProvider:e=>()=>function(e){let{webServices:t}=e;if(null===t||void 0===t||!t.premiummailsettings)throw new Error("no service url available");return Object(c.a)({url:`${t.premiummailsettings}/v2/domain/list`,includeCredentials:!0,validate:{type:"WireCustomDomainListResponse",schema:l.b}}).then((e=>Object(o.b)(e)))}(e)}));var E;return n.createElement(h,{appId:s,tileIndex:null!==d&&void 0!==d?d:0,error:p,isLoading:v,isSuccess:b,customEmailDomainNames:m,refetch:f,tileSize:null!==u&&void 0!==u?u:g.c.Small})}},2232:function(e,t,a){"use strict";a.d(t,"a",(function(){return g}));var n=a(935),r=a(1208),i=a(2221),c=a(2251),l=a(2196),o=a(2265),s=a(2253),d=a(1196),u=a.n(d),m=a(1614),p=a(1628),v=a(1480);const g=e=>{var t;let{profilePhoto:a,isProfilePhotoLoading:d,size:g=120,onPhotoReady:b,imageAlt:h,showPlaceholderOnError:f=!1}=e;const E=h||Object(r.a)("Avatar.ImageAlt"),y=(e=>{const[t,a]=n.useState(void 0);return n.useEffect((()=>{if(!e)return void a(void 0);const t=()=>{a({width:n.width,height:n.height})},n=new Image;return n.addEventListener("load",t),n.src=e,()=>{n.removeEventListener("load",t)}}),[e]),t})(null!==(t=null===a||void 0===a?void 0:a.url)&&void 0!==t?t:""),[O,j]=n.useState(!1),S=n.useRef(null===a||void 0===a?void 0:a.url),N=Object(r.a)("AccountTilePopover.Button.Text"),P=!a||!a.url||!a.crop,w=P||f;n.useEffect((()=>{(null===a||void 0===a?void 0:a.url)!==S.current&&(S.current=null===a||void 0===a?void 0:a.url,j(!1))}),[null===a||void 0===a?void 0:a.url]),n.useEffect((()=>{!d&&P&&(null===b||void 0===b||b())}),[b,d,P]);const C=n.useRef(null),D=Object(i.b)({...i.c,anchorMargin:-10,sidePreference:[i.a.below]}),[T]=Object(c.i)(n.createElement(l.b,{style:{padding:"10px",width:"275px",height:"60px",display:"flex",justifyContent:"center",alignItems:"center"},arrowAsset:n.createElement(n.Fragment,null),cornerArrowAsset:n.createElement(n.Fragment,null),positioner:D,anchorRef:C},n.createElement("div",null,N))),I=null!==a&&void 0!==a&&a.crop&&y?Object(m.a)(a.crop,y):void 0;return n.createElement("div",{className:u()("static-avatar",d?"static-avatar-loading":void 0,w?"image-placeholder":void 0),style:{width:g,height:g}},!d&&n.createElement("div",{className:u()("profile-image-container",w?"image-placeholder":void 0)},P?n.createElement(v.a,{width:g,height:g,layoutMode:"glyphBox",className:"icon"}):I&&!O?n.createElement(o.b,{style:{width:g,height:g},src:null===a||void 0===a?void 0:a.url,crop:I,alt:E,onLoadFailure:()=>{j(!0),null===b||void 0===b||b(!0)},onLoad:b}):null,O&&(f?n.createElement(v.a,{width:g,height:g,layoutMode:"glyphBox",className:"icon"}):n.createElement(s.a,{ref:C,className:"static-avatar-error",onActivate:T},n.createElement(p.a,{height:35,width:24,layoutMode:"glyphBox"})))))}},2292:function(e,t,a){"use strict";a.d(t,"a",(function(){return O}));var n=a(935),r=a(1196),i=a.n(r),c=a(1352),l=a(2253),o=a(1229),s=a(1228),d=a(1267),u=a(2309),m=a(1461),p=a(2149),v=a(1208),g=a(1468),b=a(966),h=a(2266),f=a(2138),E=a(1469),y=a(2160);function O(e){const t=e.applicationIdentifier,a=e.pcsKeyIdentifier,r=s.a.sharedInstance.getApplicationConfiguration(t),l=null===r||void 0===r?void 0:r.applicationInfo.adpMinimumOSListLocKey,v=!!t&&-1!==["mail","photos","iclouddrive"].indexOf(t),g=r?v?Object(o.d)(r):Object(o.e)(r):"",[b,y]=Object(E.b)(t,a);n.useEffect((()=>{b===E.a.AccessGranted&&d.a.sharedInstance.switchToApplication(t)}),[t,b]);const O=e.onComplete;n.useEffect((()=>()=>{null===O||void 0===O||O()}),[O]);const j=(()=>{switch(b){case E.a.ArmingRequest:return n.createElement(S,null);case E.a.FailedToSendAccessRequest:return n.createElement(P,{adpMinimumOSListLocKey:l,onTryAgain:y});case E.a.AwaitingDeviceConsent:return n.createElement(N,{adpMinimumOSListLocKey:l,onTryAgain:y});case E.a.FailedToObtainConsent:return n.createElement(w,{applicationIdentifier:t,onTryAgain:y});case E.a.DeviceConsentDenied:return n.createElement(C,{applicationIdentifier:t,onTryAgain:y});case E.a.FailedToFetchKeys:return n.createElement(T,{applicationIdentifier:t,onTryAgain:y});case E.a.AppNotSupportedWithArmedDevice:return n.createElement(I,{applicationIdentifier:t,adpMinimumOSListLocKey:l});case E.a.FetchingKeys:case E.a.AccessGranted:return n.createElement(A,{applicationIdentifier:t})}})(),D=n.useRef(null);return n.useEffect((()=>{var e;null===(e=D.current)||void 0===e||null===(e=e.querySelector("h2"))||void 0===e||e.focus()}),[b]),n.createElement(u.a,{className:i()("load-child-application-adp-blocked-route",e.className)},n.createElement(m.b,{value:m.a.LOGIN},n.createElement(p.a,null)),n.createElement("main",{ref:D,className:"centering"},t&&n.createElement(f.a,{iconSize:80,applicationIdentifier:t}),n.createElement("div",{className:"title"},g),n.createElement(c.a,{"aria-hidden":"true",className:"rectangle-icon",layoutMode:"layoutBox",desiredFontSize:40}),j,n.createElement("div",{style:{flex:1}})),n.createElement("footer",null,n.createElement(h.a,null)))}function j(){return n.createElement("span",{className:"ellipsis"},n.createElement("span",{className:"dots"}))}function S(){return n.createElement("h2",{tabIndex:-1,className:"with-ellipsis"},n.createElement("span",null,Object(v.a)("ADP.ArmingRequestState.Title")),"\u2060",n.createElement(j,null))}function N(e){var t;const a=b.a.sharedInstance.isDomainCN?Object(v.a)("ADP.Domain.icloud.com.cn"):Object(v.a)("ADP.Domain.icloud.com"),r=Object(v.a)("ADP.AwaitingDeviceConsentState.Title"),i=Object(v.a)("ADP.AwaitingDeviceConsentState.Description.WithOSList",{domain:a,osList:Object(v.a)(null!==(t=e.adpMinimumOSListLocKey)&&void 0!==t?t:"ADP.SupportedOS.Default")}),c=Object(v.a)("ADP.AwaitingDeviceConsentState.DidntReceive"),o=Object(v.a)("ADP.AwaitingDeviceConsentState.SendAgain");return n.createElement(n.Fragment,null,n.createElement("h2",{tabIndex:-1},r),n.createElement("div",{className:"description"},i),n.createElement("div",{className:"didnt-receive"},c),n.createElement(l.a,{variant:"send-again",onActivate:e.onTryAgain}," ",o))}function P(e){var t,a,r;const i=null===(t=y.h.value)||void 0===t?void 0:t.primaryEmail,c=Object(v.a)("ADP.FailedToSendAccessRequest.Title"),l=i?Object(v.a)("ADP.FailedToSendAccessRequest.Description.WithOSList",{appleId:i,osList:Object(v.a)(null!==(a=e.adpMinimumOSListLocKey)&&void 0!==a?a:"ADP.SupportedOS.Default")}):Object(v.a)("ADP.FailedToSendAccessRequest.Description.NoUser.WithOSList",{osList:Object(v.a)(null!==(r=e.adpMinimumOSListLocKey)&&void 0!==r?r:"ADP.SupportedOS.Default")}),o=Object(v.a)("ADP.FailedToSendAccessRequest.TryAgain");return n.createElement(D,{title:c,description:l,buttonText:o,onClick:e.onTryAgain})}function w(e){const t=b.a.sharedInstance.isDomainCN?Object(v.a)("ADP.Domain.icloud.com.cn"):Object(v.a)("ADP.Domain.icloud.com"),a=Object(g.a)(e.applicationIdentifier),r=Object(g.b)(e.applicationIdentifier),i=Object(v.a)("ADP.FailedToObtainConsent.Title",{data:r}),c=Object(v.a)("ADP.FailedToObtainConsent.Description",{domain:t,data:a}),l=Object(v.a)("ADP.FailedToObtainConsent.TryAgain");return n.createElement(D,{title:i,description:c,buttonText:l,onClick:e.onTryAgain})}function C(e){const t=b.a.sharedInstance.isDomainCN?Object(v.a)("ADP.Domain.icloud.com.cn"):Object(v.a)("ADP.Domain.icloud.com"),a=Object(g.a)(e.applicationIdentifier),r=Object(g.b)(e.applicationIdentifier),i=Object(v.a)("ADP.DeviceConsentDenied.Title",{data:r}),c=Object(v.a)("ADP.DeviceConsentDenied.Description",{domain:t,data:a}),l=Object(v.a)("ADP.DeviceConsentDenied.TryAgain");return n.createElement(D,{title:i,description:c,buttonText:l,onClick:e.onTryAgain})}function D(e){return n.createElement(n.Fragment,null,n.createElement("h2",{tabIndex:-1},e.title),n.createElement("div",{className:"description"},e.description),!e.hideButtons&&e.buttonText&&e.onClick&&n.createElement("div",null,n.createElement(l.a,{variant:"failed-state",onActivate:e.onClick},e.buttonText)))}function T(e){const t=Object(g.a)(e.applicationIdentifier),a=Object(g.b)(e.applicationIdentifier),r=Object(v.a)("ADP.FailedToFetchKeys.Title",{data:a}),i=Object(v.a)("ADP.FailedToFetchKeys.Description",{data:t}),c=Object(v.a)("ADP.FailedToFetchKeys.TryAgain");return n.createElement(D,{title:r,description:i,buttonText:c,onClick:e.onTryAgain})}function I(e){var t;const a=Object(g.a)(e.applicationIdentifier),r=Object(g.b)(e.applicationIdentifier),i=Object(v.a)("ADP.FailedToFetchKeys.Title",{data:r}),c=Object(v.a)("ADP.FailedToFetchKeys.ArmedDeviceNotSupported.Description",{data:a,osList:Object(v.a)(null!==(t=e.adpMinimumOSListLocKey)&&void 0!==t?t:"ADP.SupportedOS.Default")});return n.createElement(D,{title:i,description:c})}function A(e){const t=b.a.sharedInstance.isDomainCN?Object(v.a)("ADP.Domain.icloud.com.cn"):Object(v.a)("ADP.Domain.icloud.com"),a=(()=>{switch(e.applicationIdentifier){case"maildrop":case"bookmarks":return Object(v.a)("ADP.FetchingKeysState.Description.MailDrop");default:return Object(v.a)("ADP.FetchingKeysState.Description",{domain:t,data:Object(g.a)(e.applicationIdentifier)})}})();return n.createElement(n.Fragment,null,n.createElement("h2",{tabIndex:-1,className:"with-ellipsis"},n.createElement("span",null,Object(v.a)("ADP.FetchingKeysState.Title")),"\u2060",n.createElement(j,null)),n.createElement("div",{className:"description"},a))}},2293:function(e,t,a){"use strict";a.d(t,"a",(function(){return O}));var n=a(935),r=a(1196),i=a.n(r),c=a(1298),l=a(2253),o=a(1229),s=a(1228),d=a(1267),u=a(2309),m=a(1461),p=a(2149),v=a(1208),g=a(1612),b=a(2266),h=a(2138),f=a(2201),E=a(2310),y=a(2182);function O(e){const t=s.a.sharedInstance.getApplicationConfiguration(e.applicationIdentifier),a=null===t||void 0===t?void 0:t.identifier;let r=null;t&&(r="newspublisher"===a?Object(o.e)(t):Object(o.d)(t));const O=n.useRef(null);return n.useEffect((()=>{const e=O.current;if(!e)return;const a=null===t||void 0===t?void 0:t.applicationInfo;if(!a)return;const n=d.a.sharedInstance.getChildApplicationController(a);if(!n)return;const r=n.applicationContext;if(!r)return;const i=()=>{l=window.setTimeout((()=>{r.targetUIStateWhenLaunched=c.a.ACTIVE_FOREGROUND,a&&d.a.sharedInstance.launchChildApplication(a,{},void 0,!0)}),500)};e.addEventListener("animationend",i);let l=window.setTimeout((()=>{r.targetUIStateWhenLaunched=c.a.BACKGROUND,e.classList.add("load-child-application-main-fade-in")}),2700);return r.targetUIStateWhenLaunched=c.a.ACTIVE_FOREGROUND,()=>{r.targetUIStateWhenLaunched=c.a.BACKGROUND,e.removeEventListener("animationend",i),window.clearTimeout(l)}}),[t]),n.useEffect((()=>{const t=O.current;e.hadError&&t&&!t.classList.contains("load-child-application-main-fade-in")&&t.classList.add("load-child-application-main-fade-in")}),[e.hadError]),n.createElement(u.a,{className:i()("load-child-application-route",e.className)},n.createElement(m.b,{value:m.a.LOGIN},n.createElement(p.a,null)),n.createElement("main",{className:"centering",ref:O},a&&n.createElement(h.a,{className:"delayed-fade-in",iconSize:80,applicationIdentifier:a}),r&&n.createElement("div",{className:"delayed-fade-in title"},r),!e.hadError&&n.createElement(E.a,{className:"load-child-application-dots"}),e.hadError&&n.createElement(n.Fragment,null,n.createElement("div",{className:"problem"},Object(v.a)("LoadingPage.Problem",{application:null!==r&&void 0!==r?r:""})),n.createElement(l.a,{className:"try-again",onActivate:async()=>{const t=s.a.sharedInstance.displayOrder.find((e=>e.identifier===a));t&&y.b.isAppPreferenceFailedToInitilize(t.applicationInfo.authBagId)?(await y.b.initializeAppPreferences([t.applicationInfo.authBagId],!0)).isOK&&d.a.sharedInstance.switchToApplication(e.applicationIdentifier,{}):d.a.sharedInstance.switchToApplication(e.applicationIdentifier,{})}},n.createElement(g.a,{"aria-hidden":"true",desiredFontSize:12,layoutMode:"glyphBox"}),"\xa0",Object(v.a)("LoadingPage.TryAgain")),n.createElement(f.a,{className:"system-status",href:"https://www.apple.com/support/systemstatus/"},Object(v.a)("LoadingPage.SystemStatus"))),n.createElement("div",{style:{flex:1}})),n.createElement("footer",null,n.createElement(b.a,null)))}},2294:function(e,t,a){"use strict";a.d(t,"a",(function(){return o}));var n=a(2149),r=a(935),i=a(1461),c=a(2256),l=a(1208);const o=()=>r.createElement("div",{className:"chunk-loading-page"},r.createElement(i.b,{value:i.a.LOGIN},r.createElement(n.a,null)),r.createElement("div",{className:"spinner-container"},r.createElement(c.a,{description:Object(l.a)("LoadingPage.Loading")})))},2296:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var n=a(935),r=a(2253),i=a(1579);function c(e){const t=e.bannerData;return n.createElement("div",{role:"banner",className:"banner"},n.createElement("div",{className:"banner-inner"},n.createElement("span",{className:"title"},t.title),n.createElement("span",{className:"description"},t.description),t.buttonTitle&&t.onClick&&n.createElement(r.a,{variant:"banner-button",onActivate:()=>{var e;return null===(e=t.onClick)||void 0===e?void 0:e.call(t,t)}},n.createElement("span",null,t.buttonTitle),"link"===t.buttonType&&n.createElement(i.b,{"aria-hidden":!0,desiredFontSize:8}))))}},2309:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var n=a(935),r=a(1196),i=a.n(r);function c(e){return n.createElement("div",{className:i()("flex-page-viewport",e.className),style:e.style},n.createElement("div",{className:i()("flex-page-content")},e.children))}},2310:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));var n=a(935),r=a(991),i=a(1196),c=a.n(i);function l(e){let{className:t}=e;return n.createElement("div",{"aria-label":Object(r.b)("LoadingPage.Loading"),className:c()("loading-dots",t)},n.createElement("div",{"aria-hidden":!0}),n.createElement("div",{"aria-hidden":!0}),n.createElement("div",{"aria-hidden":!0}))}},2316:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var n=a(935),r=a(1196),i=a.n(r),c=a(1405),l=a(1406),o=a(1407);const s=e=>n.createElement("div",{className:i()("icloud-hero",e.className)},n.createElement("div",{className:"clouds"},n.createElement("img",{src:c.a,srcSet:`${c.a}, ${l.a} 2x, ${o.a} 3x`,width:430,height:388,alt:"","aria-hidden":!0})),n.createElement("h1",null,e.title))},2317:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(935);const r=e=>{const{ariaLevel:t,id:a,text:r}=e;return n.createElement("span",{"aria-level":t,className:"ScreenreaderOnlyHeading",id:a,role:"heading"},r)}},2318:function(e,t,a){"use strict";a.d(t,"a",(function(){return u}));var n=a(977),r=a(2249),i=a(2319);let c=function(e){return e[e.FAILED=0]="FAILED",e[e.SURVIVED=1]="SURVIVED",e}({});class l{constructor(){this.running=!1,this.urlQueue=[]}downloadFromURL(e){const t=new Promise((t=>{this.urlQueue.push([e,t])}));return this.running||this.run(),t}async run(){for(this.running=!0;this.urlQueue.length;){const[e,t]=this.urlQueue.shift();t(await this.beginIFrameDownload(e))}this.running=!1}async beginIFrameDownload(e){const t=document.createElement("iframe");t.style.display="none",document.body.appendChild(t);let a=()=>{},n=c.FAILED;try{const r=new Promise((e=>{window.setTimeout(e,5e3)})).then((()=>c.SURVIVED)),i=new Promise((e=>{a=()=>e(c.FAILED)}));t.addEventListener("load",a),t.id=e,t.src=e,n=await Promise.race([r,i])}finally{var r;t.removeEventListener("load",a),null===(r=t.parentElement)||void 0===r||r.removeChild(t)}return n}}var o=a(969),s=a(2238);let d=function(e){return e.FAILED_TO_DOWNLOAD="Failed to download the url",e.ALREADY_DOWNLOADING="Already downloading a file. Retry after some time.",e}({});class u{static create(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return new u(...t)}constructor(e,t){if(this._cookieManager=void 0,this.shouldUseIFrameDownloader=void 0,this._downloadManager=void 0,this.downloadCookieName=e,!e)throw new Error("downloadCookieName is required to create the ValidatedDownloadManager");if(!t)throw new Error("cookieManagerDomain is required to create the ValidatedDownloadManager");this._cookieManager=new r.a(t),this._downloadManager=new l;let a=!0;if(o.c.sharedInstance.primaryInteractionMode===o.b.TOUCH){const e=s.a.sharedInstance.applicationParameter.isIOS,t=s.a.sharedInstance.applicationParameter.osMajorVersion;a=e&&t>=13}this.shouldUseIFrameDownloader=a}download(e){if(!(e instanceof i.a))throw new Error("Url to be downloaded is not of type ValidatedDownloadUrl");const{_cookieManager:t,downloadCookieName:a}=this;return t.readCookieValue(a)?Promise.resolve({success:!1,errorReason:d.ALREADY_DOWNLOADING}):(this._writeCookie(e),this.startDownload(e))}async startDownload(e){return this.shouldUseIFrameDownloader?await this._downloadManager.downloadFromURL(e.href)===c.FAILED?{success:!1,errorReason:d.FAILED_TO_DOWNLOAD}:{success:!0}:(Object(n.a)(e.toString(),{target:"_blank",features:[]}),{success:!0})}_writeCookie(e){const{downloadTokenQueryParamValue:t}=e,{_cookieManager:a,downloadCookieName:n}=this;a.writeCookie(n,t,void 0,!0,void 0,1)}}},2319:function(e,t,a){"use strict";a.d(t,"a",(function(){return u}));var n=a(1039),r=a(988),i=a(2246);class c{constructor(e){if(this.url=void 0,"string"===typeof e)this.url=i.c(e);else{if(!e||e.constructor!==window.Location)throw new Error("A URL object cannot be created with the data provided");this.url=i.c(e.href)}}get protocol(){return this.url.protocol}set protocol(e){this.url.protocol=e}get auth(){return`${this.url.username}:${this.url.password}`}set auth(e){const[t,a]=e.split(":");this.url.username=t,this.url.password=a}get hostname(){return this.url.hostname}set hostname(e){this.url.hostname=e}get port(){return this.url.port}set port(e){this.url.port="number"===typeof e?e.toString():parseInt(e,10).toString()}get pathname(){return this.url.pathname}set pathname(e){this.url.pathname=e}get query(){return this.url.search}set query(e){this.url.search=e}get hash(){return this.url.hash}set hash(e){this.url.hash=e}get href(){return this.url.href}get host(){return this.url.host}get origin(){return this.url.origin}get path(){return this.query?`${this.pathname||""}${this.query}`:this.pathname}get queryObject(){const e=this.url.searchParams,t={};return e.forEach(((a,n)=>{if(t[n])return;const r=e.getAll(n);if(1!==r.length)t[n]=r;else{const e=r[0];e.indexOf(",")>-1?t[n]=e.split(","):t[n]=e}})),t}set queryObject(e){const t=[];for(const a of Object.keys(e)){const n=e[a];Array.isArray(n)?t.push(`${a}=${n.map((e=>e.toString())).join(",")}`):t.push(`${a}=${n.toString()}`)}this.url.search=`?${t.join("&")}`}isInDomain(e){const t=this.hostname;return!(!t||""===e)&&t.indexOf(e)>-1}setQueryParameter(e,t){const a=this.url.searchParams;return a.delete(e),a.set(e,t),this.url.search=`?${a.toString()}`,this}appendQueryParameter(e,t){const a=this.url.searchParams;return a.append(e,t),this.url.search=`?${a.toString()}`,this}removeQueryParameter(e){return this.url.searchParams.delete(e),this}getQueryParameter(e){return this.url.searchParams.get(e)}setMultipleQueryParameters(e){for(const t in e)e.hasOwnProperty(t)&&this.setQueryParameter(t,e[t]);return this}toString(){return this.url.href}toJSON(){return this.url.toJSON()}}var l=a(954),o=a(990),s=a(2245);const d=l.z.object({package_token:l.z.object({url:l.z.string()})});class u extends c{static async packageUrlFromShortToken(e,t){if(!e)throw new Error("Cannot fetch a `ValidatedPackageDownloadURL` without a `shortToken`.");if(!t)throw new Error("Cannot fetch a `ValidatedPackageDownloadURL` without defining a `databaseScope`.");const a=Object(o.a)(Object(s.j)("docws",`ws/${t.toLowerCase()}/download/by_token`),{short_token:e}),r=await async function(e){try{const t=await n.a.fetchJSON(e,{validate:{type:"WirePackageDownloadUrl",schema:d}});return t.ok?{success:!0,url:t.value.package_token.url}:{success:!1,data:t.response}}catch{return{success:!1,data:null}}}(a);return r.success?new u(r.url," "):r}constructor(e,t,a){if(super(String(e)),this.downloadTokenQueryParamKey=void 0,this.downloadTokenQueryParamValue=void 0,!t)throw new Error("downloadTokenQueryParamKey not provided");this.downloadTokenQueryParamKey=t,this.downloadTokenQueryParamValue=a||Object(r.a)(),this.setQueryParameter(this.downloadTokenQueryParamKey,this.downloadTokenQueryParamValue)}static create(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return new u(...t)}}},2322:function(e,t,a){"use strict";a.d(t,"a",(function(){return p}));var n=a(935),r=a(1196),i=a.n(r),c=a(1625),l=a(1628),o=a(2253),s=a(1208),d=a(1319),u=a(1322),m=a(1268);const p=e=>{let{className:t,refetch:a,errorMessage:r=Object(s.a)("ErrorHomeTileContent.Message"),showClouds:p=!0,hideRetryButton:v=!1,showOpenAppId:g}=e;const{isInCustomizationMode:b}=Object(d.b)(),h=Object(u.b)(),f=Object(s.a)("ErrorHomeTileContent.TryAgain"),E=Object(s.a)("ErrorHomeTileContent.OpenApp",{appName:Object(s.a)("ICloudDrive.DisplayName")});return n.createElement("div",{className:i()("error-home-tile-content",t)},p&&n.createElement(l.a,{"aria-hidden":!0,className:"cloud",height:50,width:50,layoutMode:"glyphBox"}),n.createElement("p",{className:"message"},r),!b&&!v&&n.createElement(o.a,{className:"reload-button",onActivate:a},n.createElement(c.a,{"aria-hidden":!0,className:"arrow-clockwise",height:20,width:20,layoutMode:"glyphBox"}),f),!b&&g&&n.createElement(o.a,{className:"reload-button",onActivate:()=>{h.launchApp(g,{options:{source:{reason:m.b.TILE_CLICK}}})}},E))}},2326:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var n=a(935),r=a(1053);function i(){var e;const t=null===(e=Object(r.b)())||void 0===e?void 0:e.meCard;return t?function(e){var t;const a=null===(t=e.contacts)||void 0===t?void 0:t[0];if(!a)return{contactId:""};const n=a.photo;return n?{contactId:a.contactId,url:n.url,crop:{width:n.crop.width,height:n.crop.height,x:n.crop.x,y:n.crop.y},signature:n.signature}:{contactId:a.contactId}}(t):{contactId:""}}function c(){const[e,t]=n.useState((()=>i())),a=Object(r.b)(),[c,l]=n.useState((()=>{var e;return null!==(e=null===a||void 0===a?void 0:a.isFetching)&&void 0!==e&&e}));return n.useEffect((()=>{const e=()=>{const e=i();""!==e.contactId&&t(e)};null===a||void 0===a||a.addEventListener("change",e);const n=()=>{var e;l(null!==(e=null===a||void 0===a?void 0:a.isFetching)&&void 0!==e&&e)};return null===a||void 0===a||a.addEventListener("fetchingchange",n),()=>{null===a||void 0===a||a.removeEventListener("fetchingchange",n),null===a||void 0===a||a.removeEventListener("change",e)}}),[a]),{isLoading:c,data:e}}}},0,[4,1]]);
//# sourceMappingURL=2.main.js.map