Module 883600

1,758 characters · in no known chunk
Dependencies
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.d(t,{A:()=>O});var r=n(311907),i=n(506774),s=n(73153),a=n(773669),o=n(253932),l=n(617617),u=n(559868);let c={},d={},_=null,f=null,p=null,h="lastChangeLogDate",m=null,E=null,g=new Set;function A(e){let{key:t}=e;if(g.has(t))return!1;(g=new Set(g)).add(t)}function I(e){let{key:t}=e;if(!g.has(t))return!1;(g=new Set(g)).delete(t)}function T(e){let{config:t,latestChangelogId:n}=e;_=n,p=t}function S(e){let{id:t,changelog:n}=e;null==c[t]&&(c[t]={}),c[t][n.locale]={id:t,date:n.date,body:n.content,revision:1,locale:n.locale,[n.asset_type===u.PW.YOUTUBE_VIDEO_ID?"youtube_video_id":"image"]:n.asset},null==d[t]&&(d[t]={}),d[t][n.locale]=u._f.LOADED_SUCCESS}function y(e){let{id:t,locale:n}=e;if(null!=c[t]&&null!=c[t][n])return!1;null==d[t]&&(d[t]={}),d[t][n]=u._f.LOADED_FAILURE}function v(e){let{id:t}=e;f=t}function N(e){let{changelogDate:t}=e;E=new Date(t),i.w.set(h,t)}function C(){m=o.pK.getSetting()}class R extends r.Ay.Store{static displayName="ChangelogStore";initialize(){this.waitFor(a.default,l.A),this.syncWith([a.default],()=>!0),this.syncWith([l.A],C);let e=i.w.get(h);if(null!=e)try{E=new Date(e)}catch{i.w.remove(h)}}getChangelog(e,t){return c[e]?.[t]??null}latestChangelogId(){return _}getChangelogLoadStatus(e,t){return d[e]?.[t]??u._f.NOT_LOADED}hasLoadedConfig(){return null!=p}getConfig(){return p}overrideId(){return f}lastSeenChangelogId(){return m}lastSeenChangelogDate(){return E}getStateForDebugging(){return{changelogConfig:p,loadedChangelogs:d,lastSeenChangelogId:m,lastSeenChangelogDate:E}}isLocked(){return g.size>0}}let O=new R(s.h,{CHANGE_LOG_LOCK:A,CHANGE_LOG_UNLOCK:I,CHANGE_LOG_SET_CONFIG:T,CHANGE_LOG_FETCH_SUCCESS:S,CHANGE_LOG_FETCH_FAILED:y,CHANGE_LOG_SET_OVERRIDE:v,CHANGE_LOG_MARK_SEEN:N})}