"use strict";(self.webpackChunk_postman_app_scratchpad=self.webpackChunk_postman_app_scratchpad||[]).push([[31],{8027:function(e,t,n){n.r(t),n.d(t,{default:function(){return h}}),n.dn(h);var a=n(1),o=n(4),i=n(8),r=n(526),l=n(8028),u=n(7808),c=n(3175),d=n(3654),s=n(3623),f=n(8030),m=n(7809);window.BroadcastChannel=window.BroadcastChannel||r.default,window.onpageshow=function(e){e.persisted&&window.location.reload()};let p=!1;window.requestIdleCallback=window.requestIdleCallback||function(e){return setTimeout(function(){var t=Date.now();e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)};const w=document.getElementById("app-root");function g(e){!function(){let e=document.getElementsByClassName("pm-loader")[0];e&&e.classList.add("is-hidden")}(),e?(0,o.render)(a.createElement(d.default,{showError:!0}),w):(0,o.render)(a.createElement(d.default,null,a.createElement(s.Theme,null,a.createElement(i.ToastProvider,null,a.createElement(m.default,null)))),w,()=>{let e=(0,u.getWindowLoadTime)();c.default.addEvent("app_performance_metric","requester_window_loaded",null,null,{load_time:e})})}function h(e){p||f.default.init(()=>{l.default.init(()=>{p=!0,g(),e&&e()})})}},8028:function(e,t,n){n.r(t);var a=n(532),o=n.n(a),i=n(1716),r=n(7397),l=n(7514),u=n(7521),c=n(7522),d=n(7585),s=n(7586),f=n(7594),m=n(7603),p=n(2076),w=n.n(p),g=n(3127),h=n(7606),k=n(7354),_=n(8029),E=n(7624),C=n(7625),v=n(7664),b=n(7665),S=n(7679),R=n(530);const y={process:"requester",ui:!0};window.pm=window.pm||{},window.process={},t.default={init:e=>{R.assign(window.pm,{windowConfig:y});const t=[C.default,h.initializeNavigationForDomains,u.bootWindowConfig,l.default,i.default,S.default,v.cleanupCookies,v.initializeCommunicationForCookies,r.default,s.default,f.default,E.default,c.default,b.default];o()(t,t=>{(0,d.default)(t);let n=w().Url.parse(location.href).query;if(R.find(n,{key:"access_token"})){console.log("Found access token in URL, logging user in...",n);let e=R.mapValues(R.keyBy(n,"key"),"value"),t={email:e.email,id:e.user_id,name:e.name,username:e.username,auth:{access_token:e.access_token}};pm.eventBus.channel("auth-handler-events").publish((0,g.createEvent)("authenticated","authentication",{userData:t,hasAccounts:!1}))}return t&&pm.logger.error("Error in requester boot sequence",t),(0,m.default)(),k.default.deleteOfflineWorkspace().catch(e=>{pm.logger.warn("Requester~init: Error while deleting default offline workspace",e)}).then(()=>{(0,_.setupSocketStatusReaction)(),e&&e(t)})})}}},8030:function(e,t,n){n.r(t);var a=n(532),o=n.n(a),i=(n(577),n(1032),n(7398),n(7402),n(7409),n(7585)),r=(n(7595),n(7673),n(4095),n(7675),n(3175)),l=n(7603),u=n(7647);n(5155),n(7662),n(7676),n(8031);window.pm=window.pm||{},pm.init=e=>{u.default.markPoint("app_exec:start");const t=[];o()(t,t=>{(0,i.default)(t),t&&(pm.bulkAnalytics&&r.default.addEventV2AndPublish({category:"app_boot_failure",action:t.name,label:t.message},{noActiveWorkspace:!0}),pm.logger.error("Error in the app boot sequence",t)),(0,l.default)(),e&&e(t)})},t.default=pm},8031:function(e,t,n){n.r(t),t.default=function(e){"serviceWorker"in navigator&&navigator.serviceWorker.getRegistrations().then(function(e){for(let t of e)t.unregister()}),e&&"function"==typeof e&&e()}},8029:function(e,t,n){n.r(t),n.d(t,{setupSocketStatusReaction:function(){return s}});var a=n(1776),o=n(3305),i=n(7372),r=n(4768),l=n(530);const u="userOffline",c="You seem to be offline. Data in this workspace might not be up to date.",d=1e3;function s(){(0,a.reaction)(()=>(0,o.getStore)("SyncStatusStore").isSocketConnected,l.debounce(function(e){e?i.default.dismiss(u):i.default.trigger({id:u,message:c,meta:{targets:[r.WORKSPACE_PRIVATE,r.WORKSPACE_PERSONAL,r.WORKSPACE_TEAM,r.WORKSPACE_PUBLIC]}})},d,{leading:!1,trailing:!0}))}}}]);