Current File : /home/d/i/g/digitaw/www/wp-content/updraft/plugins-old/simple-history/build/index-admin-bar.js
(()=>{"use strict";var e,t={555:(e,t,n)=>{const r=window.React,a=window.wp.domReady;var i=n.n(a);const o=window.wp.element,s=window.wp.apiFetch;var u=n.n(s),c=(Object.defineProperty,new Map),l=new WeakMap,d=0;function m(e,t,n={},r=undefined){if(void 0===window.IntersectionObserver&&void 0!==r){const a=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:a,intersectionRect:a,rootBounds:a}),()=>{}}const{id:a,observer:i,elements:o}=function(e){const t=function(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(n=e.root,n?(l.has(n)||(d+=1,l.set(n,d.toString())),l.get(n)):"0"):e[t]}`;var n})).toString()}(e);let n=c.get(t);if(!n){const r=new Map;let a;const i=new IntersectionObserver((t=>{t.forEach((t=>{var n;const i=t.isIntersecting&&a.some((e=>t.intersectionRatio>=e));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=i),null==(n=r.get(t.target))||n.forEach((e=>{e(i,t)}))}))}),e);a=i.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:i,elements:r},c.set(t,n)}return n}(n),s=o.get(e)||[];return o.has(e)||o.set(e,s),s.push(t),i.observe(e),function(){s.splice(s.indexOf(t),1),0===s.length&&(o.delete(e),i.unobserve(e)),0===o.size&&(i.disconnect(),c.delete(a))}}r.Component;const h=window.wp.url,f=window.wp.i18n,g=window.wp.components,w=window.wp.date,y={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function p(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const b={date:p({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:p({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:p({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},v={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function M(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,a=n?.width?String(n.width):t;r=e.formattingValues[a]||e.formattingValues[t]}else{const t=e.defaultWidth,a=n?.width?String(n.width):e.defaultWidth;r=e.values[a]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function _(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const o=i[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(s)?function(e){for(let t=0;t<e.length;t++)if(e[t].test(o))return t}(s):function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t].test(o))return t}(s);let c;return c=e.valueCallback?e.valueCallback(u):u,c=n.valueCallback?n.valueCallback(c):c,{value:c,rest:t.slice(o.length)}}}var E;const k={code:"en-US",formatDistance:(e,t,n)=>{let r;const a=y[e];return r="string"==typeof a?a:1===t?a.one:a.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:b,formatRelative:(e,t,n,r)=>v[e],localize:{ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:M({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:M({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:M({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:M({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:M({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(E={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(E.matchPattern);if(!n)return null;const r=n[0],a=e.match(E.parsePattern);if(!a)return null;let i=E.valueCallback?E.valueCallback(a[0]):a[0];return i=t.valueCallback?t.valueCallback(i):i,{value:i,rest:e.slice(r.length)}}),era:_({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:_({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:_({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:_({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:_({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};let x={};function S(){return x}Math.pow(10,8);const P=6048e5,W=Symbol.for("constructDateFrom");function D(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&W in e?e[W](t):e instanceof Date?new e.constructor(t):new Date(t)}function O(e,t){return D(t||e,e)}function T(e){const t=O(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function C(e,t){const n=O(e,t?.in);return n.setHours(0,0,0,0),n}function L(e,t){const n=O(e,t?.in);return function(e,t,n){const[r,a]=function(e,...t){const n=D.bind(null,e||t.find((e=>"object"==typeof e)));return t.map(n)}(n?.in,e,t),i=C(r),o=C(a),s=+i-T(i),u=+o-T(o);return Math.round((s-u)/864e5)}(n,function(e,t){const n=O(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}(n))+1}function Y(e,t){const n=S(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=O(e,t?.in),i=a.getDay(),o=(i<r?7:0)+i-r;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function H(e,t){return Y(e,{...t,weekStartsOn:1})}function N(e,t){const n=O(e,t?.in),r=n.getFullYear(),a=D(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const i=H(a),o=D(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const s=H(o);return n.getTime()>=i.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function F(e,t){const n=O(e,t?.in),r=+H(n)-+function(e,t){const n=N(e,t),r=D(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),H(r)}(n);return Math.round(r/P)+1}function q(e,t){const n=O(e,t?.in),r=n.getFullYear(),a=S(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,o=D(t?.in||e,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=Y(o,t),u=D(t?.in||e,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const c=Y(u,t);return+n>=+s?r+1:+n>=+c?r:r-1}function j(e,t){const n=O(e,t?.in),r=+Y(n,t)-+function(e,t){const n=S(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=q(e,t),i=D(t?.in||e,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),Y(i,t)}(n,t);return Math.round(r/P)+1}function A(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const V={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return A("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):A(n+1,2)},d:(e,t)=>A(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>A(e.getHours()%12||12,t.length),H:(e,t)=>A(e.getHours(),t.length),m:(e,t)=>A(e.getMinutes(),t.length),s:(e,t)=>A(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return A(Math.trunc(r*Math.pow(10,n-3)),t.length)}},z={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:"year"})}return V.y(e,t)},Y:function(e,t,n,r){const a=q(e,r),i=a>0?a:1-a;return"YY"===t?A(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):A(i,t.length)},R:function(e,t){return A(N(e),t.length)},u:function(e,t){return A(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return A(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return A(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return V.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return A(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=j(e,r);return"wo"===t?n.ordinalNumber(a,{unit:"week"}):A(a,t.length)},I:function(e,t,n){const r=F(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):A(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):V.d(e,t)},D:function(e,t,n){const r=L(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):A(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return A(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return A(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=0===r?7:r;switch(t){case"i":return String(a);case"ii":return A(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(a=12===r?"noon":0===r?"midnight":r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(a=r>=17?"evening":r>=12?"afternoon":r>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return V.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):V.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):A(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):A(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):V.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):V.s(e,t)},S:function(e,t){return V.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return B(r);case"XXXX":case"XX":return Q(r);default:return Q(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return B(r);case"xxxx":case"xx":return Q(r);default:return Q(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+I(r,":");default:return"GMT"+Q(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+I(r,":");default:return"GMT"+Q(r,":")}},t:function(e,t,n){return A(Math.trunc(+e/1e3),t.length)},T:function(e,t,n){return A(+e,t.length)}};function I(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),i=r%60;return 0===i?n+String(a):n+String(a)+t+A(i,2)}function B(e,t){return e%60==0?(e>0?"-":"+")+A(Math.abs(e)/60,2):Q(e,t)}function Q(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+A(Math.trunc(r/60),2)+t+A(r%60,2)}const G=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},R=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},X={p:R,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return G(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"})}return i.replace("{{date}}",G(r,t)).replace("{{time}}",R(a,t))}},$=/^D+$/,J=/^Y+$/,U=["D","DD","YY","YYYY"];function K(e){return!(!((t=e)instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t))&&"number"!=typeof e||isNaN(+O(e)));var t}const Z=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ee=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,te=/^'([^]*?)'?$/,ne=/''/g,re=/[a-zA-Z]/;function ae(e,t,n){const r=S(),a=n?.locale??r.locale??k,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=O(e,n?.in);if(!K(s))throw new RangeError("Invalid time value");let u=t.match(ee).map((e=>{const t=e[0];return"p"===t||"P"===t?(0,X[t])(e,a.formatLong):e})).join("").match(Z).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:ie(e)};if(z[t])return{isToken:!0,value:e};if(t.match(re))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const c={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map((r=>{if(!r.isToken)return r.value;const i=r.value;return(!n?.useAdditionalWeekYearTokens&&function(e){return J.test(e)}(i)||!n?.useAdditionalDayOfYearTokens&&function(e){return $.test(e)}(i))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(r),U.includes(e))throw new RangeError(r)}(i,t,String(e)),(0,z[i[0]])(s,i,a.localize,c)})).join("")}function ie(e){const t=e.match(te);return t?t[1].replace(ne,"'"):e}(0,f.__)("Custom date range…","simple-history"),(0,f.__)("Last day","simple-history"),(0,f.__)("Last 7 days","simple-history"),(0,f.__)("Last 14 days","simple-history"),(0,f.__)("Last 30 days","simple-history"),(0,f.__)("Last 60 days","simple-history"),(0,f.__)("Loading…","simple-history"),(0,f._x)("Info","Log level in gui","simple-history"),(0,f._x)("Warning","Log level in gui","simple-history"),(0,f._x)("Error","Log level in gui","simple-history"),(0,f._x)("Critical","Log level in gui","simple-history"),(0,f._x)("Alert","Log level in gui","simple-history"),(0,f._x)("Emergency","Log level in gui","simple-history"),(0,f._x)("Debug","Log level in gui","simple-history");const oe="yyyy-MM-dd'T'HH:mm:ss";function se(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=se(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ue(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=se(e))&&(r&&(r+=" "),r+=t);return r}ae(C(new Date),oe),ae(function(e,t){const n=O(e,t?.in);return n.setHours(23,59,59,999),n}(new Date),oe);const ce=ue;function le(e){const{children:t,className:n}=e,a=ue("SimpleHistoryLogitem__inlineDivided",n);return(0,r.createElement)(r.Fragment,null," ",(0,r.createElement)("span",{className:a},t))}function de(e){const{event:t,eventVariant:n}=e,a=(0,w.getSettings)(),i=a.formats.datetimeAbbreviated,s=a.formats.time;let u;u=(0,w.date)("Y-m-d",t.date_gmt)===(0,w.date)("Y-m-d")?(0,f.sprintf)(
// translators: %s is the time, like 8:36 pm.
// translators: %s is the time, like 8:36 pm.
(0,f.__)("Today %s","simple-history"),(0,w.dateI18n)(s,t.date_gmt)):(0,w.dateI18n)(i,t.date_gmt);const[c,l]=(0,o.useState)((()=>(0,w.humanTimeDiff)(t.date_gmt)));(0,o.useEffect)((()=>{const e=setInterval((()=>{l((0,w.humanTimeDiff)(t.date_gmt))}),1e3);return()=>{clearInterval(e)}}),[t.date_gmt]);const d=(0,f.sprintf)(/* translators: 1: date in local time, 2: date in GMT time */ /* translators: 1: date in local time, 2: date in GMT time */
(0,f.__)("%1$s local time (%2$s GMT time)","simple-history"),t.date,t.date_gmt),m=(0,r.createElement)(r.Fragment,null,(0,r.createElement)("time",{dateTime:t.date_gmt,className:"SimpleHistoryLogitem__when__liveRelative"},u," (",c,")"));let h;return h="compact"===n?(0,r.createElement)("div",null,c):(0,r.createElement)(g.Tooltip,{text:d,delay:500},"modal"===n?(0,r.createElement)(g.__experimentalText,null,m):(0,r.createElement)(g.Button,{variant:"link",onClick:()=>{!function({event:e}){window.location.hash=`#simple-history/event/${e.id}`}({event:t})}},m)),(0,r.createElement)(le,{className:"SimpleHistoryLogitem__permalink SimpleHistoryLogitem__when"},h)}function me(e){const{event:t,eventVariant:n}=e,{initiator_data:a}=t;switch(t.initiator){case"wp_user":const e=a.user_display_name||a.user_login;let i;return i="compact"===n?(0,r.createElement)("strong",null,e):"modal"===n?(0,r.createElement)(g.__experimentalText,null,i):(0,r.createElement)(g.Button,{href:a.user_profile_url,variant:"link"},(0,r.createElement)(r.Fragment,null,(0,r.createElement)("strong",null,e)," ",(0,r.createElement)("span",null,"(",a.user_email,")"))),(0,r.createElement)(le,null,i);case"web_user":return(0,r.createElement)(le,null,(0,r.createElement)("strong",null,(0,f.__)("Anonymous web user","simple-history")));case"wp_cli":return(0,r.createElement)(le,null,(0,r.createElement)("strong",null,(0,f.__)("WP-CLI","simple-history")));case"wp":return(0,r.createElement)(le,null,(0,r.createElement)("strong",null,(0,f.__)("WordPress","simple-history")));case"other":return(0,r.createElement)(le,null,(0,r.createElement)("strong",null,(0,f.__)("Other","simple-history")));default:return(0,r.createElement)(le,null,"Unknown initiator: ",(0,r.createElement)("code",null,t.initiator))}}function he(e){const{event:t}=e,{initiator_data:n}=t;return(0,r.createElement)("img",{className:"SimpleHistoryLogitem__senderImage",src:n.user_avatar_url,alt:""})}function fe(e){const{event:t}=e,{initiator_data:n}=t;return(0,r.createElement)("img",{className:"SimpleHistoryLogitem__senderImage",src:n.user_avatar_url,alt:""})}function ge(){return(0,r.createElement)("div",{className:"SimpleHistoryLogitem__senderImage"})}function we(e){const{event:t}=e,{initiator:n}=t;switch(n){case"wp_user":return(0,r.createElement)(he,{event:t});case"web_user":return(0,r.createElement)(fe,{event:t});case"wp_cli":case"wp":case"other":return(0,r.createElement)(ge,{event:t});default:return(0,r.createElement)("p",null,'Add image for initiator "',n,'"')}}const ye=e=>{const{event:t}=e;return(0,r.createElement)(be,{href:t.link},(0,r.createElement)(we,{event:t,eventVariant:"compact"}),(0,r.createElement)(me,{event:t,eventVariant:"compact"}),(0,r.createElement)(de,{event:t,eventVariant:"compact"}),(0,r.createElement)("p",null,t.message))},pe=e=>{const{events:t}=e;return 0===t.length?null:(0,r.createElement)("ul",{style:{backgroundColor:"#4c4c4d"}},t.map((e=>(0,r.createElement)(ye,{key:e.id,event:e}))))},be=e=>{const{children:t,href:n}=e,a=ce("ab-item",{"ab-empty-item":!n}),i=n?"a":"div";return(0,r.createElement)("li",{role:"group",id:"wp-admin-bar-simple-history-subnode-1"},(0,r.createElement)(i,{className:a,role:"menuitem",style:{height:"auto"}},t))},ve=()=>{const[e,t]=(0,o.useState)(!1),[n,a]=(0,o.useState)(!1),[i,s]=(0,o.useState)(!1),[c,l]=(0,o.useState)([]),{ref:d,inView:g,entry:w}=function({threshold:e,delay:t,trackVisibility:n,rootMargin:a,root:i,triggerOnce:o,skip:s,initialInView:u,fallbackInView:c,onChange:l}={}){var d;const[h,f]=r.useState(null),g=r.useRef(),[w,y]=r.useState({inView:!!u,entry:void 0});g.current=l,r.useEffect((()=>{if(s||!h)return;let r;return r=m(h,((e,t)=>{y({inView:e,entry:t}),g.current&&g.current(e,t),t.isIntersecting&&o&&r&&(r(),r=void 0)}),{root:i,rootMargin:a,threshold:e,trackVisibility:n,delay:t},c),()=>{r&&r()}}),[Array.isArray(e)?e.toString():e,h,i,a,o,s,n,c,t]);const p=null==(d=w.entry)?void 0:d.target,b=r.useRef();h||!p||o||s||b.current===p||(b.current=p,y({inView:!!u,entry:void 0}));const v=[f,w.inView,w.entry];return v.ref=v[0],v.inView=v[1],v.entry=v[2],v}({});return(0,o.useEffect)((()=>{!1!==g&&async function(){a(!0);const e={per_page:5};try{const t=await u()({path:(0,h.addQueryArgs)("/simple-history/v1/events",e),parse:!1}),n=await t.json();l(n)}catch(e){console.error("Error loading events:",e)}finally{a(!1)}}()}),[g]),(0,r.createElement)("li",{ref:d},(0,r.createElement)("ul",null,n?(0,r.createElement)(be,null,(0,f.__)("Loading events…","simple-history")):(0,r.createElement)(be,null,(0,f.__)("Events loaded","simple-history"),(0,r.createElement)("button",null,(0,f.__)("Reload","simple-history"))),(0,r.createElement)(pe,{events:c}),(0,r.createElement)(be,{href:"#"},"View full history")))};i()((()=>{const e=document.getElementById("wp-admin-bar-simple-history-react-root-group");e&&(0,o.createRoot)(e).render((0,r.createElement)(ve,null))}))}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.m=t,e=[],r.O=(t,n,a,i)=>{if(!n){var o=1/0;for(l=0;l<e.length;l++){n=e[l][0],a=e[l][1],i=e[l][2];for(var s=!0,u=0;u<n.length;u++)(!1&i||o>=i)&&Object.keys(r.O).every((e=>r.O[e](n[u])))?n.splice(u--,1):(s=!1,i<o&&(o=i));if(s){e.splice(l--,1);var c=a();void 0!==c&&(t=c)}}return t}i=i||0;for(var l=e.length;l>0&&e[l-1][2]>i;l--)e[l]=e[l-1];e[l]=[n,a,i]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={275:0,708:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var a,i,o=n[0],s=n[1],u=n[2],c=0;if(o.some((t=>0!==e[t]))){for(a in s)r.o(s,a)&&(r.m[a]=s[a]);if(u)var l=u(r)}for(t&&t(n);c<o.length;c++)i=o[c],r.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return r.O(l)},n=self.webpackChunksimple_history=self.webpackChunksimple_history||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var a=r.O(void 0,[708],(()=>r(555)));a=r.O(a)})();