From 78e073ac95986275cf5998bd33ad442cca2d34f1 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Mon, 12 Nov 2018 15:21:49 -0800 Subject: [PATCH] Better handling of unset in uploaded files (fixes #1427) --- CHANGELOG.md | 4 +++- themes/grav/app/forms/fields/files.js | 8 ++++++++ themes/grav/app/pages/page/unset.js | 18 ++++++++++++++++++ themes/grav/js/admin.min.js | 20 ++++++++++---------- 4 files changed, 39 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e167322e8..ea98d9e26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ ## 11/12/2018 1. [](#improved) - * v.1.8.14 fixes merged in + * v.1.8.14 fixes merged in +1. [](#bugfix) + * Better handling of unset in uploaded files [#1427](https://github.com/getgrav/grav-plugin-admin/issues/1427) # v1.9.0-beta.5 ## 11/05/2018 diff --git a/themes/grav/app/forms/fields/files.js b/themes/grav/app/forms/fields/files.js index 127ca981f..4ba10c485 100644 --- a/themes/grav/app/forms/fields/files.js +++ b/themes/grav/app/forms/fields/files.js @@ -133,6 +133,8 @@ export default class FilesField { const URL = Object.keys(value).filter((key) => value[key].name === filename).shift(); target.attr('href', `${config.base_url_simple}/${URL}`); }); + + $(this.dropzone.element).find('[data-dz-unset]').hide(); } initDropzone() { @@ -156,12 +158,15 @@ export default class FilesField { dropzone.files.push(mock); dropzone.options.addedfile.call(dropzone, mock); if (mock.type.match(/^image\//)) { + console.log('mock'); dropzone.options.thumbnail.call(dropzone, mock, data.path); dropzone.createThumbnailFromUrl(mock, data.path); } file.remove(); }); + + $(dropzone.element).find('[data-dz-unset]').hide(); } getURI() { @@ -192,6 +197,9 @@ export default class FilesField { input.val(value + ' '); } + console.log(file.previewElement); + $(file.previewElement).find('[data-dz-unset]').css('display', null); + return this.handleError({ file, data: response, diff --git a/themes/grav/app/pages/page/unset.js b/themes/grav/app/pages/page/unset.js index 659fe0039..b45f4b073 100644 --- a/themes/grav/app/pages/page/unset.js +++ b/themes/grav/app/pages/page/unset.js @@ -1,15 +1,33 @@ import $ from 'jquery'; $(document).on('click', '.dz-unset', function() { + const dropzone = $(this).closest('[data-grav-file-settings]')[0].dropzone; $(this).closest('.dz-image-preview').remove(); const file_upload = $('.files-upload'); const unset_image = $(this).closest('.dz-image-preview').find('[data-dz-name]').text().trim(); const images = JSON.parse(file_upload.find('input[data-grav-field="hidden"]').val()) || {}; let image_array = {}; + $.each(images, function(ind, obj) { if (!ind.endsWith(unset_image)) { image_array[ind] = obj; } }); + + const file = dropzone.files.filter((file) => file.name === unset_image).shift(); + + if (dropzone.options.maxFiles === 1) { + dropzone.removeFile(file); + } else { + const index = dropzone.files.indexOf(file); + if (index !== -1) { + dropzone.files.splice(index, 1); + } + + if (!dropzone.files.length) { + $(dropzone.previewsContainer).removeClass('dz-started'); + } + } + file_upload.find('input[data-grav-field="hidden"]').val(JSON.stringify(image_array)); }); diff --git a/themes/grav/js/admin.min.js b/themes/grav/js/admin.min.js index 6e92bb194..de6238667 100644 --- a/themes/grav/js/admin.min.js +++ b/themes/grav/js/admin.min.js @@ -2,16 +2,16 @@ var Grav=webpackJsonpGrav([0],[function(e,t,n){(function(e){"use strict";functio n*=4503599627370496,t=52-t,t>0){for(d(0,n),r=u;r>=7;)d(1e7,0),r-=7;for(d(m(10,r,1),0),r=t-1;r>=23;)p(1<<23),r-=23;p(1<0?(s=y.length,y=g+(s<=u?"0."+o.call(f,u-s)+y:y.slice(0,s-u)+"."+y.slice(s-u))):y=g+y,y}})},function(e,t,n){var r=n(37);e.exports=function(e,t){if("number"!=typeof e&&"Number"!=r(e))throw TypeError(t);return+e}},function(e,t,n){"use strict";var r=n(41),i=n(38);e.exports=function(e){var t=String(i(this)),n="",a=r(e);if(a<0||a==1/0)throw RangeError("Count can't be negative");for(;a>0;(a>>>=1)&&(t+=t))1&a&&(n+=t);return n}},function(e,t,n){"use strict";var r=n(11),i=n(10),a=n(92),o=1..toPrecision;r(r.P+r.F*(i(function(){return"1"!==o.call(1,void 0)})||!i(function(){o.call({})})),"Number",{toPrecision:function(e){var t=a(this,"Number#toPrecision: incorrect invocation!");return void 0===e?o.call(t):o.call(t,e)}})},function(e,t,n){var r=n(11);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},function(e,t,n){var r=n(11),i=n(7).isFinite;r(r.S,"Number",{isFinite:function(e){return"number"==typeof e&&i(e)}})},function(e,t,n){var r=n(11);r(r.S,"Number",{isInteger:n(98)})},function(e,t,n){var r=n(16),i=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&i(e)===e}},function(e,t,n){var r=n(11);r(r.S,"Number",{isNaN:function(e){return e!=e}})},function(e,t,n){var r=n(11),i=n(98),a=Math.abs;r(r.S,"Number",{isSafeInteger:function(e){return i(e)&&a(e)<=9007199254740991}})},function(e,t,n){var r=n(11);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(e,t,n){var r=n(11);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(e,t,n){var r=n(11),i=n(88);r(r.S+r.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},function(e,t,n){var r=n(11),i=n(84);r(r.S+r.F*(Number.parseInt!=i),"Number",{parseInt:i})},function(e,t,n){var r=n(11),i=n(106),a=Math.sqrt,o=Math.acosh;r(r.S+r.F*!(o&&710==Math.floor(o(Number.MAX_VALUE))&&o(1/0)==1/0),"Math",{acosh:function(e){return(e=+e)<1?NaN:e>94906265.62425156?Math.log(e)+Math.LN2:i(e-1+a(e-1)*a(e+1))}})},function(e,t){e.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)}},function(e,t,n){function r(e){return isFinite(e=+e)&&0!=e?e<0?-r(-e):Math.log(e+Math.sqrt(e*e+1)):e}var i=n(11),a=Math.asinh;i(i.S+i.F*!(a&&1/a(0)>0),"Math",{asinh:r})},function(e,t,n){var r=n(11),i=Math.atanh;r(r.S+r.F*!(i&&1/i(-0)<0),"Math",{atanh:function(e){return 0==(e=+e)?e:Math.log((1+e)/(1-e))/2}})},function(e,t,n){var r=n(11),i=n(110);r(r.S,"Math",{cbrt:function(e){return i(e=+e)*Math.pow(Math.abs(e),1/3)}})},function(e,t){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},function(e,t,n){var r=n(11);r(r.S,"Math",{clz32:function(e){return(e>>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}})},function(e,t,n){var r=n(11),i=Math.exp;r(r.S,"Math",{cosh:function(e){return(i(e=+e)+i(-e))/2}})},function(e,t,n){var r=n(11),i=n(114);r(r.S+r.F*(i!=Math.expm1),"Math",{expm1:i})},function(e,t){var n=Math.expm1;e.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||n(-2e-17)!=-2e-17?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:n},function(e,t,n){var r=n(11);r(r.S,"Math",{fround:n(116)})},function(e,t,n){var r=n(110),i=Math.pow,a=i(2,-52),o=i(2,-23),s=i(2,127)*(2-o),l=i(2,-126),u=function(e){return e+1/a-1/a};e.exports=Math.fround||function(e){var t,n,i=Math.abs(e),c=r(e);return is||n!=n?c*(1/0):c*n)}},function(e,t,n){var r=n(11),i=Math.abs;r(r.S,"Math",{hypot:function(e,t){for(var n,r,a=0,o=0,s=arguments.length,l=0;o0?(r=n/l,a+=r*r):a+=n;return l===1/0?1/0:l*Math.sqrt(a)}})},function(e,t,n){var r=n(11),i=Math.imul;r(r.S+r.F*n(10)(function(){return i(4294967295,5)!=-5||2!=i.length}),"Math",{imul:function(e,t){var n=65535,r=+e,i=+t,a=n&r,o=n&i;return 0|a*o+((n&r>>>16)*o+a*(n&i>>>16)<<16>>>0)}})},function(e,t,n){var r=n(11);r(r.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}})},function(e,t,n){var r=n(11);r(r.S,"Math",{log1p:n(106)})},function(e,t,n){var r=n(11);r(r.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},function(e,t,n){var r=n(11);r(r.S,"Math",{sign:n(110)})},function(e,t,n){var r=n(11),i=n(114),a=Math.exp;r(r.S+r.F*n(10)(function(){return!Math.sinh(-2e-17)!=-2e-17}),"Math",{sinh:function(e){return Math.abs(e=+e)<1?(i(e)-i(-e))/2:(a(e-1)-a(-e-1))*(Math.E/2)}})},function(e,t,n){var r=n(11),i=n(114),a=Math.exp;r(r.S,"Math",{tanh:function(e){var t=i(e=+e),n=i(-e);return t==1/0?1:n==1/0?-1:(t-n)/(a(e)+a(-e))}})},function(e,t,n){var r=n(11);r(r.S,"Math",{trunc:function(e){return(e>0?Math.floor:Math.ceil)(e)}})},function(e,t,n){var r=n(11),i=n(42),a=String.fromCharCode,o=String.fromCodePoint;r(r.S+r.F*(!!o&&1!=o.length),"String",{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,o=0;r>o;){if(t=+arguments[o++],i(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?a(t):a(((t-=65536)>>10)+55296,t%1024+56320))}return n.join("")}})},function(e,t,n){var r=n(11),i=n(35),a=n(40);r(r.S,"String",{raw:function(e){for(var t=i(e.raw),n=a(t.length),r=arguments.length,o=[],s=0;n>s;)o.push(String(t[s++])),s=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){var r=n(41),i=n(38);e.exports=function(e){return function(t,n){var a,o,s=String(i(t)),l=r(n),u=s.length;return l<0||l>=u?e?"":void 0:(a=s.charCodeAt(l),a<55296||a>56319||l+1===u||(o=s.charCodeAt(l+1))<56320||o>57343?e?s.charAt(l):a:e?s.slice(l,l+2):(a-55296<<10)+(o-56320)+65536)}}},function(e,t,n){"use strict";var r=n(27),i=n(11),a=n(21),o=n(13),s=n(132),l=n(133),u=n(28),c=n(61),f=n(29)("iterator"),d=!([].keys&&"next"in[].keys()),p="@@iterator",h="keys",m="values",v=function(){return this};e.exports=function(e,t,n,g,y,_,b){l(n,t,g);var w,x,k,S=function(e){if(!d&&e in I)return I[e];switch(e){case h:return function(){return new n(this,e)};case m:return function(){return new n(this,e)}}return function(){return new n(this,e)}},C=t+" Iterator",E=y==m,A=!1,I=e.prototype,M=I[f]||I[p]||y&&I[y],O=M||S(y),T=y?E?S("entries"):O:void 0,P="Array"==t?I.entries||M:M;if(P&&(k=c(P.call(new e)),k!==Object.prototype&&k.next&&(u(k,C,!0),r||"function"==typeof k[f]||o(k,f,v))),E&&M&&M.name!==m&&(A=!0,O=function(){return M.call(this)}),r&&!b||!d&&!A&&I[f]||o(I,f,O),s[t]=O,s[C]=v,y)if(w={values:E?O:S(m),keys:_?O:S(h),entries:T},b)for(x in w)x in I||a(I,x,w[x]);else i(i.P+i.F*(d||A),t,w);return w}},function(e,t){e.exports={}},function(e,t,n){"use strict";var r=n(48),i=n(20),a=n(28),o={};n(13)(o,n(29)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(o,{next:i(1,n)}),a(e,t+" Iterator")}},function(e,t,n){"use strict";var r=n(11),i=n(130)(!1);r(r.P,"String",{codePointAt:function(e){return i(this,e)}})},function(e,t,n){"use strict";var r=n(11),i=n(40),a=n(136),o="endsWith",s=""[o];r(r.P+r.F*n(138)(o),"String",{endsWith:function(e){var t=a(this,e,o),n=arguments.length>1?arguments[1]:void 0,r=i(t.length),l=void 0===n?r:Math.min(i(n),r),u=String(e);return s?s.call(t,u,l):t.slice(l-u.length,l)===u}})},function(e,t,n){var r=n(137),i=n(38);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(e))}},function(e,t,n){var r=n(16),i=n(37),a=n(29)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[a])?!!t:"RegExp"==i(e))}},function(e,t,n){var r=n(29)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t,n){"use strict";var r=n(11),i=n(136),a="includes";r(r.P+r.F*n(138)(a),"String",{includes:function(e){return!!~i(this,e,a).indexOf(e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(11);r(r.P,"String",{repeat:n(93)})},function(e,t,n){"use strict";var r=n(11),i=n(40),a=n(136),o="startsWith",s=""[o];r(r.P+r.F*n(138)(o),"String",{startsWith:function(e){var t=a(this,e,o),n=i(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return s?s.call(t,r,n):t.slice(n,n+r.length)===r}})},function(e,t,n){"use strict";n(143)("anchor",function(e){return function(t){return e(this,"a","name",t)}})},function(e,t,n){var r=n(11),i=n(10),a=n(38),o=/"/g,s=function(e,t,n,r){var i=String(a(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(r).replace(o,""")+'"'),s+">"+i+""};e.exports=function(e,t){var n={};n[e]=t(s),r(r.P+r.F*i(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",n)}},function(e,t,n){"use strict";n(143)("big",function(e){return function(){return e(this,"big","","")}})},function(e,t,n){"use strict";n(143)("blink",function(e){return function(){return e(this,"blink","","")}})},function(e,t,n){"use strict";n(143)("bold",function(e){return function(){return e(this,"b","","")}})},function(e,t,n){"use strict";n(143)("fixed",function(e){return function(){return e(this,"tt","","")}})},function(e,t,n){"use strict";n(143)("fontcolor",function(e){return function(t){return e(this,"font","color",t)}})},function(e,t,n){"use strict";n(143)("fontsize",function(e){return function(t){return e(this,"font","size",t)}})},function(e,t,n){"use strict";n(143)("italics",function(e){return function(){return e(this,"i","","")}})},function(e,t,n){"use strict";n(143)("link",function(e){return function(t){return e(this,"a","href",t)}})},function(e,t,n){"use strict";n(143)("small",function(e){return function(){return e(this,"small","","")}})},function(e,t,n){"use strict";n(143)("strike",function(e){return function(){return e(this,"strike","","")}})},function(e,t,n){"use strict";n(143)("sub",function(e){return function(){return e(this,"sub","","")}})},function(e,t,n){"use strict";n(143)("sup",function(e){return function(){return e(this,"sup","","")}})},function(e,t,n){var r=n(11);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},function(e,t,n){"use strict";var r=n(11),i=n(60),a=n(19);r(r.P+r.F*n(10)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function(e){var t=i(this),n=a(t);return"number"!=typeof n||isFinite(n)?t.toISOString():null}})},function(e,t,n){var r=n(11),i=n(159);r(r.P+r.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},function(e,t,n){"use strict";var r=n(10),i=Date.prototype.getTime,a=Date.prototype.toISOString,o=function(e){return e>9?e:"0"+e};e.exports=r(function(){return"0385-07-25T07:06:39.999Z"!=a.call(new Date(-5e13-1))})||!r(function(){a.call(new Date(NaN))})?function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),r=t<0?"-":t>9999?"+":"";return r+("00000"+Math.abs(t)).slice(r?-6:-4)+"-"+o(e.getUTCMonth()+1)+"-"+o(e.getUTCDate())+"T"+o(e.getUTCHours())+":"+o(e.getUTCMinutes())+":"+o(e.getUTCSeconds())+"."+(n>99?n:"0"+o(n))+"Z"}:a},function(e,t,n){var r=Date.prototype,i="Invalid Date",a="toString",o=r[a],s=r.getTime;new Date(NaN)+""!=i&&n(21)(r,a,function(){var e=s.call(this);return e===e?o.call(this):i})},function(e,t,n){var r=n(29)("toPrimitive"),i=Date.prototype;r in i||n(13)(i,r,n(162))},function(e,t,n){"use strict";var r=n(15),i=n(19),a="number";e.exports=function(e){if("string"!==e&&e!==a&&"default"!==e)throw TypeError("Incorrect hint");return i(r(this),e!=a)}},function(e,t,n){var r=n(11);r(r.S,"Array",{isArray:n(47)})},function(e,t,n){"use strict";var r=n(23),i=n(11),a=n(60),o=n(165),s=n(166),l=n(40),u=n(167),c=n(168);i(i.S+i.F*!n(169)(function(e){Array.from(e)}),"Array",{from:function(e){var t,n,i,f,d=a(e),p="function"==typeof this?this:Array,h=arguments.length,m=h>1?arguments[1]:void 0,v=void 0!==m,g=0,y=c(d);if(v&&(m=r(m,h>2?arguments[2]:void 0,2)),void 0==y||p==Array&&s(y))for(t=l(d.length),n=new p(t);t>g;g++)u(n,g,v?m(d[g],g):d[g]);else for(f=y.call(d),n=new p;!(i=f.next()).done;g++)u(n,g,v?o(f,m,[i.value,g],!0):i.value);return n.length=g,n}})},function(e,t,n){var r=n(15);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var a=e.return;throw void 0!==a&&r(a.call(e)),t}}},function(e,t,n){var r=n(132),i=n(29)("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||a[i]===e)}},function(e,t,n){"use strict";var r=n(14),i=n(20);e.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},function(e,t,n){var r=n(77),i=n(29)("iterator"),a=n(132);e.exports=n(12).getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||a[r(e)]}},function(e,t,n){var r=n(29)("iterator"),i=!1;try{var a=[7][r]();a.return=function(){i=!0},Array.from(a,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var a=[7],o=a[r]();o.next=function(){return{done:n=!0}},a[r]=function(){return o},e(a)}catch(e){}return n}},function(e,t,n){"use strict";var r=n(11),i=n(167);r(r.S+r.F*n(10)(function(){function e(){}return!(Array.of.call(e)instanceof e)}),"Array",{of:function(){for(var e=0,t=arguments.length,n=new("function"==typeof this?this:Array)(t);t>e;)i(n,e,arguments[e++]);return n.length=t,n}})},function(e,t,n){"use strict";var r=n(11),i=n(35),a=[].join;r(r.P+r.F*(n(36)!=Object||!n(172)(a)),"Array",{join:function(e){return a.call(i(this),void 0===e?",":e)}})},function(e,t,n){"use strict";var r=n(10);e.exports=function(e,t){return!!e&&r(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t,n){"use strict";var r=n(11),i=n(50),a=n(37),o=n(42),s=n(40),l=[].slice;r(r.P+r.F*n(10)(function(){i&&l.call(i)}),"Array",{slice:function(e,t){var n=s(this.length),r=a(this);if(t=void 0===t?n:t,"Array"==r)return l.call(this,e,t);for(var i=o(e,n),u=o(t,n),c=s(u-i),f=new Array(c),d=0;dw;w++)if((d||w in y)&&(m=y[w],v=_(m,w,g),e))if(n)x[w]=v;else if(v)switch(e){case 3:return!0;case 5:return m;case 6:return w;case 2:x.push(m)}else if(c)return!1;return f?-1:u||c?c:x}}},function(e,t,n){var r=n(178);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){var r=n(16),i=n(47),a=n(29)("species");e.exports=function(e){var t;return i(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!i(t.prototype)||(t=void 0),r(t)&&(t=t[a],null===t&&(t=void 0))),void 0===t?Array:t}},function(e,t,n){"use strict";var r=n(11),i=n(176)(1);r(r.P+r.F*!n(172)([].map,!0),"Array",{map:function(e){return i(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(11),i=n(176)(2);r(r.P+r.F*!n(172)([].filter,!0),"Array",{filter:function(e){return i(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(11),i=n(176)(3);r(r.P+r.F*!n(172)([].some,!0),"Array",{some:function(e){return i(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(11),i=n(176)(4);r(r.P+r.F*!n(172)([].every,!0),"Array",{every:function(e){return i(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(11),i=n(184);r(r.P+r.F*!n(172)([].reduce,!0),"Array",{reduce:function(e){return i(this,e,arguments.length,arguments[1],!1)}})},function(e,t,n){var r=n(24),i=n(60),a=n(36),o=n(40);e.exports=function(e,t,n,s,l){r(t);var u=i(e),c=a(u),f=o(u.length),d=l?f-1:0,p=l?-1:1;if(n<2)for(;;){if(d in c){s=c[d],d+=p;break}if(d+=p,l?d<0:f<=d)throw TypeError("Reduce of empty array with no initial value")}for(;l?d>=0:f>d;d+=p)d in c&&(s=t(s,c[d],d,u));return s}},function(e,t,n){"use strict";var r=n(11),i=n(184);r(r.P+r.F*!n(172)([].reduceRight,!0),"Array",{reduceRight:function(e){return i(this,e,arguments.length,arguments[1],!0)}})},function(e,t,n){"use strict";var r=n(11),i=n(39)(!1),a=[].indexOf,o=!!a&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(o||!n(172)(a)),"Array",{indexOf:function(e){return o?a.apply(this,arguments)||0:i(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(11),i=n(35),a=n(41),o=n(40),s=[].lastIndexOf,l=!!s&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(l||!n(172)(s)),"Array",{lastIndexOf:function(e){if(l)return s.apply(this,arguments)||0;var t=i(this),n=o(t.length),r=n-1;for(arguments.length>1&&(r=Math.min(r,a(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}})},function(e,t,n){var r=n(11);r(r.P,"Array",{copyWithin:n(189)}),n(190)("copyWithin")},function(e,t,n){"use strict";var r=n(60),i=n(42),a=n(40);e.exports=[].copyWithin||function(e,t){var n=r(this),o=a(n.length),s=i(e,o),l=i(t,o),u=arguments.length>2?arguments[2]:void 0,c=Math.min((void 0===u?o:i(u,o))-l,o-s),f=1;for(l0;)l in n?n[s]=n[l]:delete n[s],s+=f,l+=f;return n}},function(e,t,n){var r=n(29)("unscopables"),i=Array.prototype;void 0==i[r]&&n(13)(i,r,{}),e.exports=function(e){i[r][e]=!0}},function(e,t,n){var r=n(11);r(r.P,"Array",{fill:n(192)}),n(190)("fill")},function(e,t,n){"use strict";var r=n(60),i=n(42),a=n(40);e.exports=function(e){for(var t=r(this),n=a(t.length),o=arguments.length,s=i(o>1?arguments[1]:void 0,n),l=o>2?arguments[2]:void 0,u=void 0===l?n:i(l,n);u>s;)t[s++]=e;return t}},function(e,t,n){"use strict";var r=n(11),i=n(176)(5),a="find",o=!0;a in[]&&Array(1)[a](function(){o=!1}),r(r.P+r.F*o,"Array",{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(190)(a)},function(e,t,n){"use strict";var r=n(11),i=n(176)(6),a="findIndex",o=!0;a in[]&&Array(1)[a](function(){o=!1}),r(r.P+r.F*o,"Array",{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(190)(a)},function(e,t,n){n(196)("Array")},function(e,t,n){"use strict";var r=n(7),i=n(14),a=n(9),o=n(29)("species");e.exports=function(e){var t=r[e];a&&t&&!t[o]&&i.f(t,o,{configurable:!0,get:function(){return this}})}},function(e,t,n){"use strict";var r=n(190),i=n(198),a=n(132),o=n(35);e.exports=n(131)(Array,"Array",function(e,t){this._t=o(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):"keys"==t?i(0,n):"values"==t?i(0,e[n]):i(0,[n,e[n]])},"values"),a.Arguments=a.Array,r("keys"),r("values"),r("entries")},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(7),i=n(90),a=n(14).f,o=n(52).f,s=n(137),l=n(200),u=r.RegExp,c=u,f=u.prototype,d=/a/g,p=/a/g,h=new u(d)!==d;if(n(9)&&(!h||n(10)(function(){return p[n(29)("match")]=!1,u(d)!=d||u(p)==p||"/a/i"!=u(d,"i")}))){u=function(e,t){var n=this instanceof u,r=s(e),a=void 0===t;return!n&&r&&e.constructor===u&&a?e:i(h?new c(r&&!a?e.source:e,t):c((r=e instanceof u)?e.source:e,r&&a?l.call(e):t),n?this:f,u)};for(var m=(function(e){e in u||a(u,e,{configurable:!0,get:function(){return c[e]},set:function(t){c[e]=t}})}),v=o(c),g=0;v.length>g;)m(v[g++]);f.constructor=u,u.prototype=f,n(21)(r,"RegExp",u)}n(196)("RegExp")},function(e,t,n){"use strict";var r=n(15);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){"use strict";n(202);var r=n(15),i=n(200),a=n(9),o="toString",s=/./[o],l=function(e){n(21)(RegExp.prototype,o,e,!0)};n(10)(function(){return"/a/b"!=s.call({source:"a",flags:"b"})})?l(function(){var e=r(this);return"/".concat(e.source,"/","flags"in e?e.flags:!a&&e instanceof RegExp?i.call(e):void 0)}):s.name!=o&&l(function(){return s.call(this)})},function(e,t,n){n(9)&&"g"!=/./g.flags&&n(14).f(RegExp.prototype,"flags",{configurable:!0,get:n(200)})},function(e,t,n){n(204)("match",1,function(e,t,n){return[function(n){"use strict";var r=e(this),i=void 0==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},n]})},function(e,t,n){"use strict";var r=n(13),i=n(21),a=n(10),o=n(38),s=n(29);e.exports=function(e,t,n){var l=s(e),u=n(o,l,""[e]),c=u[0],f=u[1];a(function(){var t={};return t[l]=function(){return 7},7!=""[e](t)})&&(i(String.prototype,e,c),r(RegExp.prototype,l,2==t?function(e,t){return f.call(e,this,t)}:function(e){return f.call(e,this)}))}},function(e,t,n){n(204)("replace",2,function(e,t,n){return[function(r,i){"use strict";var a=e(this),o=void 0==r?void 0:r[t];return void 0!==o?o.call(r,a,i):n.call(String(a),r,i)},n]})},function(e,t,n){n(204)("search",1,function(e,t,n){return[function(n){"use strict";var r=e(this),i=void 0==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},n]})},function(e,t,n){n(204)("split",2,function(e,t,r){"use strict";var i=n(137),a=r,o=[].push,s="split",l="length",u="lastIndex";if("c"=="abbc"[s](/(b)*/)[1]||4!="test"[s](/(?:)/,-1)[l]||2!="ab"[s](/(?:ab)*/)[l]||4!="."[s](/(.?)(.?)/)[l]||"."[s](/()()/)[l]>1||""[s](/.?/)[l]){var c=void 0===/()??/.exec("")[1];r=function(e,t){var n=String(this);if(void 0===e&&0===t)return[];if(!i(e))return a.call(n,e,t);var r,s,f,d,p,h=[],m=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),v=0,g=void 0===t?4294967295:t>>>0,y=new RegExp(e.source,m+"g");for(c||(r=new RegExp("^"+y.source+"$(?!\\s)",m));(s=y.exec(n))&&(f=s.index+s[0][l],!(f>v&&(h.push(n.slice(v,s.index)),!c&&s[l]>1&&s[0].replace(r,function(){for(p=1;p1&&s.index=g)));)y[u]===s.index&&y[u]++;return v===n[l]?!d&&y.test("")||h.push(""):h.push(n.slice(v)),h[l]>g?h.slice(0,g):h}}else"0"[s](void 0,0)[l]&&(r=function(e,t){return void 0===e&&0===t?[]:a.call(this,e,t)});return[function(n,i){var a=e(this),o=void 0==n?void 0:n[t];return void 0!==o?o.call(n,a,i):r.call(String(a),n,i)},r]})},function(e,t,n){"use strict";var r,i,a,o,s=n(27),l=n(7),u=n(23),c=n(77),f=n(11),d=n(16),p=n(24),h=n(209),m=n(210),v=n(211),g=n(212).set,y=n(213)(),_=n(214),b=n(215),w=n(216),x=n(217),k="Promise",S=l.TypeError,C=l.process,E=C&&C.versions,A=E&&E.v8||"",I=l[k],M="process"==c(C),O=function(){},T=i=_.f,P=!!function(){try{var e=I.resolve(1),t=(e.constructor={})[n(29)("species")]=function(e){e(O,O)};return(M||"function"==typeof PromiseRejectionEvent)&&e.then(O)instanceof t&&0!==A.indexOf("6.6")&&w.indexOf("Chrome/66")===-1}catch(e){}}(),j=function(e){var t;return!(!d(e)||"function"!=typeof(t=e.then))&&t},D=function(e,t){if(!e._n){e._n=!0;var n=e._c;y(function(){for(var r=e._v,i=1==e._s,a=0,o=function(t){var n,a,o,s=i?t.ok:t.fail,l=t.resolve,u=t.reject,c=t.domain;try{s?(i||(2==e._h&&N(e),e._h=1),s===!0?n=r:(c&&c.enter(),n=s(r),c&&(c.exit(),o=!0)),n===t.promise?u(S("Promise-chain cycle")):(a=j(n))?a.call(n,l,u):l(n)):u(r)}catch(e){c&&!o&&c.exit(),u(e)}};n.length>a;)o(n[a++]);e._c=[],e._n=!1,t&&!e._h&&z(e)})}},z=function(e){g.call(l,function(){var t,n,r,i=e._v,a=L(e);if(a&&(t=b(function(){M?C.emit("unhandledRejection",i,e):(n=l.onunhandledrejection)?n({promise:e,reason:i}):(r=l.console)&&r.error&&r.error("Unhandled promise rejection",i)}),e._h=M||L(e)?2:1),e._a=void 0,a&&t.e)throw t.v})},L=function(e){return 1!==e._h&&0===(e._a||e._c).length},N=function(e){g.call(l,function(){var t;M?C.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})})},R=function(e){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=e,t._s=2,t._a||(t._a=t._c.slice()),D(t,!0))},F=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw S("Promise can't be resolved itself");(t=j(e))?y(function(){var r={_w:n,_d:!1};try{t.call(e,u(F,r,1),u(R,r,1))}catch(e){R.call(r,e)}}):(n._v=e,n._s=1,D(n,!1))}catch(e){R.call({_w:n,_d:!1},e)}}};P||(I=function(e){h(this,I,k,"_h"),p(e),r.call(this);try{e(u(F,this,1),u(R,this,1))}catch(e){R.call(this,e)}},r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(218)(I.prototype,{then:function(e,t){var n=T(v(this,I));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=M?C.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&D(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),a=function(){var e=new r;this.promise=e,this.resolve=u(F,e,1),this.reject=u(R,e,1)},_.f=T=function(e){return e===I||e===o?new a(e):i(e)}),f(f.G+f.W+f.F*!P,{Promise:I}),n(28)(I,k),n(196)(k),o=n(12)[k],f(f.S+f.F*!P,k,{reject:function(e){var t=T(this),n=t.reject;return n(e),t.promise}}),f(f.S+f.F*(s||!P),k,{resolve:function(e){return x(s&&this===o?I:this,e)}}),f(f.S+f.F*!(P&&n(169)(function(e){I.all(e).catch(O)})),k,{all:function(e){var t=this,n=T(t),r=n.resolve,i=n.reject,a=b(function(){var n=[],a=0,o=1;m(e,!1,function(e){var s=a++,l=!1;n.push(void 0),o++,t.resolve(e).then(function(e){l||(l=!0,n[s]=e,--o||r(n))},i)}),--o||r(n)});return a.e&&i(a.v),n.promise},race:function(e){var t=this,n=T(t),r=n.reject,i=b(function(){m(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(23),i=n(165),a=n(166),o=n(15),s=n(40),l=n(168),u={},c={},t=e.exports=function(e,t,n,f,d){var p,h,m,v,g=d?function(){return e}:l(e),y=r(n,f,t?2:1),_=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(a(g)){for(p=s(e.length);p>_;_++)if(v=t?y(o(h=e[_])[0],h[1]):y(e[_]),v===u||v===c)return v}else for(m=g.call(e);!(h=m.next()).done;)if(v=i(m,y,h.value,t),v===u||v===c)return v};t.BREAK=u,t.RETURN=c},function(e,t,n){var r=n(15),i=n(24),a=n(29)("species");e.exports=function(e,t){var n,o=r(e).constructor;return void 0===o||void 0==(n=r(o)[a])?t:i(n)}},function(e,t,n){var r,i,a,o=n(23),s=n(80),l=n(50),u=n(18),c=n(7),f=c.process,d=c.setImmediate,p=c.clearImmediate,h=c.MessageChannel,m=c.Dispatch,v=0,g={},y="onreadystatechange",_=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},b=function(e){_.call(e.data)};d&&p||(d=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++v]=function(){s("function"==typeof e?e:Function(e),t)},r(v),v},p=function(e){delete g[e]},"process"==n(37)(f)?r=function(e){f.nextTick(o(_,e,1))}:m&&m.now?r=function(e){m.now(o(_,e,1))}:h?(i=new h,a=i.port2,i.port1.onmessage=b,r=o(a.postMessage,a,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(r=function(e){c.postMessage(e+"","*")},c.addEventListener("message",b,!1)):r=y in u("script")?function(e){l.appendChild(u("script"))[y]=function(){l.removeChild(this),_.call(e)}}:function(e){setTimeout(o(_,e,1),0)}),e.exports={set:d,clear:p}},function(e,t,n){var r=n(7),i=n(212).set,a=r.MutationObserver||r.WebKitMutationObserver,o=r.process,s=r.Promise,l="process"==n(37)(o);e.exports=function(){var e,t,n,u=function(){var r,i;for(l&&(r=o.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(l)n=function(){o.nextTick(u)};else if(!a||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var c=s.resolve(void 0);n=function(){c.then(u)}}else n=function(){i.call(r,u)};else{var f=!0,d=document.createTextNode("");new a(u).observe(d,{characterData:!0}),n=function(){d.data=f=!f}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},function(e,t,n){"use strict";function r(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=i(t),this.reject=i(n)}var i=n(24);e.exports.f=function(e){return new r(e)}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(7),i=r.navigator;e.exports=i&&i.userAgent||""},function(e,t,n){var r=n(15),i=n(16),a=n(214);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=a.f(e),o=n.resolve;return o(t),n.promise}},function(e,t,n){var r=n(21);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},function(e,t,n){"use strict";var r=n(220),i=n(221),a="Map";e.exports=n(222)(a,function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=r.getEntry(i(this,a),e);return t&&t.v},set:function(e,t){return r.def(i(this,a),0===e?0:e,t)}},r,!0)},function(e,t,n){"use strict";var r=n(14).f,i=n(48),a=n(218),o=n(23),s=n(209),l=n(210),u=n(131),c=n(198),f=n(196),d=n(9),p=n(25).fastKey,h=n(221),m=d?"_s":"size",v=function(e,t){var n,r=p(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,u){var c=e(function(e,r){s(e,c,t,"_i"),e._t=t,e._i=i(null),e._f=void 0,e._l=void 0,e[m]=0,void 0!=r&&l(r,n,e[u],e)});return a(c.prototype,{clear:function(){for(var e=h(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[m]=0},delete:function(e){var n=h(this,t),r=v(n,e);if(r){var i=r.n,a=r.p;delete n._i[r.i],r.r=!0,a&&(a.n=i),i&&(i.p=a),n._f==r&&(n._f=i),n._l==r&&(n._l=a),n[m]--}return!!r},forEach:function(e){h(this,t);for(var n,r=o(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!v(h(this,t),e)}}),d&&r(c.prototype,"size",{get:function(){return h(this,t)[m]}}),c},def:function(e,t,n){var r,i,a=v(e,t);return a?a.v=n:(e._l=a={i:i=p(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=a),r&&(r.n=a),e[m]++,"F"!==i&&(e._i[i]=a)),e},getEntry:v,setStrong:function(e,t,n){u(e,t,function(e,n){this._t=h(e,t),this._k=n,this._l=void 0},function(){for(var e=this,t=e._k,n=e._l;n&&n.r;)n=n.p;return e._t&&(e._l=n=n?n.n:e._t._f)?"keys"==t?c(0,n.k):"values"==t?c(0,n.v):c(0,[n.k,n.v]):(e._t=void 0,c(1))},n?"entries":"values",!n,!0),f(t)}}},function(e,t,n){var r=n(16);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){"use strict";var r=n(7),i=n(11),a=n(21),o=n(218),s=n(25),l=n(210),u=n(209),c=n(16),f=n(10),d=n(169),p=n(28),h=n(90);e.exports=function(e,t,n,m,v,g){var y=r[e],_=y,b=v?"set":"add",w=_&&_.prototype,x={},k=function(e){var t=w[e];a(w,e,"delete"==e?function(e){return!(g&&!c(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(g&&!c(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return g&&!c(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof _&&(g||w.forEach&&!f(function(){(new _).entries().next()}))){var S=new _,C=S[b](g?{}:-0,1)!=S,E=f(function(){S.has(1)}),A=d(function(e){new _(e)}),I=!g&&f(function(){for(var e=new _,t=5;t--;)e[b](t,t);return!e.has(-0)});A||(_=t(function(t,n){u(t,_,e);var r=h(new y,t,_);return void 0!=n&&l(n,v,r[b],r),r}),_.prototype=w,w.constructor=_),(E||I)&&(k("delete"),k("has"),v&&k("get")),(I||C)&&k(b),g&&w.clear&&delete w.clear}else _=m.getConstructor(t,e,v,b),o(_.prototype,n),s.NEED=!0;return p(_,e),x[e]=_,i(i.G+i.W+i.F*(_!=y),x),g||m.setStrong(_,e,v),_}},function(e,t,n){"use strict";var r=n(220),i=n(221),a="Set";e.exports=n(222)(a,function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return r.def(i(this,a),e=0===e?0:e,e)}},r)},function(e,t,n){"use strict";var r,i=n(176)(0),a=n(21),o=n(25),s=n(71),l=n(225),u=n(16),c=n(10),f=n(221),d="WeakMap",p=o.getWeak,h=Object.isExtensible,m=l.ufstore,v={},g=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},y={get:function(e){if(u(e)){var t=p(e);return t===!0?m(f(this,d)).get(e):t?t[this._i]:void 0}},set:function(e,t){ return l.def(f(this,d),e,t)}},_=e.exports=n(222)(d,g,y,l,!0,!0);c(function(){return 7!=(new _).set((Object.freeze||Object)(v),7).get(v)})&&(r=l.getConstructor(g,d),s(r.prototype,y),o.NEED=!0,i(["delete","has","get","set"],function(e){var t=_.prototype,n=t[e];a(t,e,function(t,i){if(u(t)&&!h(t)){this._f||(this._f=new r);var a=this._f[e](t,i);return"set"==e?this:a}return n.call(this,t,i)})}))},function(e,t,n){"use strict";var r=n(218),i=n(25).getWeak,a=n(15),o=n(16),s=n(209),l=n(210),u=n(176),c=n(8),f=n(221),d=u(5),p=u(6),h=0,m=function(e){return e._l||(e._l=new v)},v=function(){this.a=[]},g=function(e,t){return d(e.a,function(e){return e[0]===t})};v.prototype={get:function(e){var t=g(this,e);if(t)return t[1]},has:function(e){return!!g(this,e)},set:function(e,t){var n=g(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=p(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,a){var u=e(function(e,r){s(e,u,t,"_i"),e._t=t,e._i=h++,e._l=void 0,void 0!=r&&l(r,n,e[a],e)});return r(u.prototype,{delete:function(e){if(!o(e))return!1;var n=i(e);return n===!0?m(f(this,t)).delete(e):n&&c(n,this._i)&&delete n[this._i]},has:function(e){if(!o(e))return!1;var n=i(e);return n===!0?m(f(this,t)).has(e):n&&c(n,this._i)}}),u},def:function(e,t,n){var r=i(a(t),!0);return r===!0?m(e).set(t,n):r[e._i]=n,e},ufstore:m}},function(e,t,n){"use strict";var r=n(225),i=n(221),a="WeakSet";n(222)(a,function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return r.def(i(this,a),e,!0)}},r,!1,!0)},function(e,t,n){"use strict";var r=n(11),i=n(228),a=n(229),o=n(15),s=n(42),l=n(40),u=n(16),c=n(7).ArrayBuffer,f=n(211),d=a.ArrayBuffer,p=a.DataView,h=i.ABV&&c.isView,m=d.prototype.slice,v=i.VIEW,g="ArrayBuffer";r(r.G+r.W+r.F*(c!==d),{ArrayBuffer:d}),r(r.S+r.F*!i.CONSTR,g,{isView:function(e){return h&&h(e)||u(e)&&v in e}}),r(r.P+r.U+r.F*n(10)(function(){return!new d(2).slice(1,void 0).byteLength}),g,{slice:function(e,t){if(void 0!==m&&void 0===t)return m.call(o(this),e);for(var n=o(this).byteLength,r=s(e,n),i=s(void 0===t?n:t,n),a=new(f(this,d))(l(i-r)),u=new p(this),c=new p(a),h=0;r>1,c=23===t?U(2,-24)-U(2,-77):0,f=0,d=e<0||0===e&&1/e<0?1:0;for(e=q(e),e!=e||e===R?(i=e!=e?1:0,r=l):(r=V(B(e)/G),e*(a=U(2,-r))<1&&(r--,a*=2),e+=r+u>=1?c/a:c*U(2,1-u),e*a>=2&&(r++,a/=2),r+u>=l?(i=0,r=l):r+u>=1?(i=(e*a-1)*U(2,t),r+=u):(i=e*U(2,u-1)*U(2,t),r=0));t>=8;o[f++]=255&i,i/=256,t-=8);for(r=r<0;o[f++]=255&r,r/=256,s-=8);return o[--f]|=128*d,o}function i(e,t,n){var r,i=8*n-t-1,a=(1<>1,s=i-7,l=n-1,u=e[l--],c=127&u;for(u>>=7;s>0;c=256*c+e[l],l--,s-=8);for(r=c&(1<<-s)-1,c>>=-s,s+=t;s>0;r=256*r+e[l],l--,s-=8);if(0===c)c=1-o;else{if(c===a)return r?NaN:u?-R:R;r+=U(2,t),c-=o}return(u?-1:1)*r*U(2,c-t)}function a(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function o(e){return[255&e]}function s(e){return[255&e,e>>8&255]}function l(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function u(e){return r(e,52,8)}function c(e){return r(e,23,4)}function f(e,t,n){E(e[T],t,{get:function(){return this[n]}})}function d(e,t,n,r){var i=+n,a=S(i);if(a+t>e[Y])throw N(j);var o=e[K]._b,s=a+e[J],l=o.slice(s,s+t);return r?l:l.reverse()}function p(e,t,n,r,i,a){var o=+n,s=S(o);if(s+t>e[Y])throw N(j);for(var l=e[K]._b,u=s+e[J],c=r(+i),f=0;fee;)(X=Z[ee++])in D||y(D,X,F[X]);v||(Q.constructor=D)}var te=new z(new D(2)),ne=z[T].setInt8;te.setInt8(0,2147483648),te.setInt8(1,2147483649),!te.getInt8(0)&&te.getInt8(1)||_(z[T],{setInt8:function(e,t){ne.call(this,e,t<<24>>24)},setUint8:function(e,t){ne.call(this,e,t<<24>>24)}},!0)}else D=function(e){w(this,D,M);var t=S(e);this._b=A.call(new Array(t),0),this[Y]=t},z=function(e,t,n){w(this,z,O),w(e,D,O);var r=e[Y],i=x(t);if(i<0||i>r)throw N("Wrong offset!");if(n=void 0===n?r-i:k(n),i+n>r)throw N(P);this[K]=e,this[J]=i,this[Y]=n},m&&(f(D,$,"_l"),f(z,H,"_b"),f(z,$,"_l"),f(z,W,"_o")),_(z[T],{getInt8:function(e){return d(this,1,e)[0]<<24>>24},getUint8:function(e){return d(this,1,e)[0]},getInt16:function(e){var t=d(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=d(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return a(d(this,4,e,arguments[1]))},getUint32:function(e){return a(d(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return i(d(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return i(d(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){p(this,1,e,o,t)},setUint8:function(e,t){p(this,1,e,o,t)},setInt16:function(e,t){p(this,2,e,s,t,arguments[2])},setUint16:function(e,t){p(this,2,e,s,t,arguments[2])},setInt32:function(e,t){p(this,4,e,l,t,arguments[2])},setUint32:function(e,t){p(this,4,e,l,t,arguments[2])},setFloat32:function(e,t){p(this,4,e,c,t,arguments[2])},setFloat64:function(e,t){p(this,8,e,u,t,arguments[2])}});I(D,M),I(z,O),y(z[T],g.VIEW,!0),t[M]=D,t[O]=z},function(e,t,n){var r=n(41),i=n(40);e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=i(t);if(t!==n)throw RangeError("Wrong length!");return n}},function(e,t,n){var r=n(11);r(r.G+r.W+r.F*!n(228).ABV,{DataView:n(229).DataView})},function(e,t,n){n(233)("Int8",1,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){"use strict";if(n(9)){var r=n(27),i=n(7),a=n(10),o=n(11),s=n(228),l=n(229),u=n(23),c=n(209),f=n(20),d=n(13),p=n(218),h=n(41),m=n(40),v=n(230),g=n(42),y=n(19),_=n(8),b=n(77),w=n(16),x=n(60),k=n(166),S=n(48),C=n(61),E=n(52).f,A=n(168),I=n(22),M=n(29),O=n(176),T=n(39),P=n(211),j=n(197),D=n(132),z=n(169),L=n(196),N=n(192),R=n(189),F=n(14),q=n(53),U=F.f,V=q.f,B=i.RangeError,G=i.TypeError,H=i.Uint8Array,$="ArrayBuffer",W="Shared"+$,K="BYTES_PER_ELEMENT",Y="prototype",J=Array[Y],X=l.ArrayBuffer,Q=l.DataView,Z=O(0),ee=O(2),te=O(3),ne=O(4),re=O(5),ie=O(6),ae=T(!0),oe=T(!1),se=j.values,le=j.keys,ue=j.entries,ce=J.lastIndexOf,fe=J.reduce,de=J.reduceRight,pe=J.join,he=J.sort,me=J.slice,ve=J.toString,ge=J.toLocaleString,ye=M("iterator"),_e=M("toStringTag"),be=I("typed_constructor"),we=I("def_constructor"),xe=s.CONSTR,ke=s.TYPED,Se=s.VIEW,Ce="Wrong length!",Ee=O(1,function(e,t){return Te(P(e,e[we]),t)}),Ae=a(function(){return 1===new H(new Uint16Array([1]).buffer)[0]}),Ie=!!H&&!!H[Y].set&&a(function(){new H(1).set({})}),Me=function(e,t){var n=h(e);if(n<0||n%t)throw B("Wrong offset!");return n},Oe=function(e){if(w(e)&&ke in e)return e;throw G(e+" is not a typed array!")},Te=function(e,t){if(!(w(e)&&be in e))throw G("It is not a typed array constructor!");return new e(t)},Pe=function(e,t){return je(P(e,e[we]),t)},je=function(e,t){for(var n=0,r=t.length,i=Te(e,r);r>n;)i[n]=t[n++];return i},De=function(e,t,n){U(e,t,{get:function(){return this._d[n]}})},ze=function(e){var t,n,r,i,a,o,s=x(e),l=arguments.length,c=l>1?arguments[1]:void 0,f=void 0!==c,d=A(s);if(void 0!=d&&!k(d)){for(o=d.call(s),r=[],t=0;!(a=o.next()).done;t++)r.push(a.value);s=r}for(f&&l>2&&(c=u(c,arguments[2],2)),t=0,n=m(s.length),i=Te(this,n);n>t;t++)i[t]=f?c(s[t],t):s[t];return i},Le=function(){for(var e=0,t=arguments.length,n=Te(this,t);t>e;)n[e]=arguments[e++];return n},Ne=!!H&&a(function(){ge.call(new H(1))}),Re=function(){return ge.apply(Ne?me.call(Oe(this)):Oe(this),arguments)},Fe={copyWithin:function(e,t){return R.call(Oe(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return ne(Oe(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return N.apply(Oe(this),arguments)},filter:function(e){return Pe(this,ee(Oe(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return re(Oe(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ie(Oe(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){Z(Oe(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return oe(Oe(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return ae(Oe(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return pe.apply(Oe(this),arguments)},lastIndexOf:function(e){return ce.apply(Oe(this),arguments)},map:function(e){return Ee(Oe(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return fe.apply(Oe(this),arguments)},reduceRight:function(e){return de.apply(Oe(this),arguments)},reverse:function(){for(var e,t=this,n=Oe(t).length,r=Math.floor(n/2),i=0;i1?arguments[1]:void 0)},sort:function(e){return he.call(Oe(this),e)},subarray:function(e,t){var n=Oe(this),r=n.length,i=g(e,r);return new(P(n,n[we]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,m((void 0===t?r:g(t,r))-i))}},qe=function(e,t){return Pe(this,me.call(Oe(this),e,t))},Ue=function(e){Oe(this);var t=Me(arguments[1],1),n=this.length,r=x(e),i=m(r.length),a=0;if(i+t>n)throw B(Ce);for(;a255?255:255&r),i.v[p](n*t+i.o,r,Ae)},M=function(e,t){U(e,t,{get:function(){return A(this,t)},set:function(e){return I(this,t,e)},enumerable:!0})};_?(h=n(function(e,n,r,i){c(e,h,u,"_d");var a,o,s,l,f=0,p=0;if(w(n)){if(!(n instanceof X||(l=b(n))==$||l==W))return ke in n?je(h,n):ze.call(h,n);a=n,p=Me(r,t);var g=n.byteLength;if(void 0===i){if(g%t)throw B(Ce);if(o=g-p,o<0)throw B(Ce)}else if(o=m(i)*t,o+p>g)throw B(Ce);s=o/t}else s=v(n),o=s*t,a=new X(o);for(d(e,"_d",{b:a,o:p,l:o,e:s,v:new Q(a)});f=n.length)return{value:void 0,done:!0};while(!((e=n[t._i++])in t._t));return{value:e,done:!1}}),r(r.S,"Reflect",{enumerate:function(e){return new a(e)}})},function(e,t,n){function r(e,t){var n,s,c=arguments.length<3?e:arguments[2];return u(e)===c?e[t]:(n=i.f(e,t))?o(n,"value")?n.value:void 0!==n.get?n.get.call(c):void 0:l(s=a(e))?r(s,t,c):void 0}var i=n(53),a=n(61),o=n(8),s=n(11),l=n(16),u=n(15);s(s.S,"Reflect",{get:r})},function(e,t,n){var r=n(53),i=n(11),a=n(15);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(e,t){return r.f(a(e),t)}})},function(e,t,n){var r=n(11),i=n(61),a=n(15);r(r.S,"Reflect",{getPrototypeOf:function(e){return i(a(e))}})},function(e,t,n){var r=n(11);r(r.S,"Reflect",{has:function(e,t){return t in e}})},function(e,t,n){var r=n(11),i=n(15),a=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(e){return i(e),!a||a(e)}})},function(e,t,n){var r=n(11);r(r.S,"Reflect",{ownKeys:n(253)})},function(e,t,n){var r=n(52),i=n(45),a=n(15),o=n(7).Reflect;e.exports=o&&o.ownKeys||function(e){var t=r.f(a(e)),n=i.f;return n?t.concat(n(e)):t}},function(e,t,n){var r=n(11),i=n(15),a=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(e){i(e);try{return a&&a(e),!0}catch(e){return!1}}})},function(e,t,n){function r(e,t,n){var l,d,p=arguments.length<4?e:arguments[3],h=a.f(c(e),t);if(!h){if(f(d=o(e)))return r(d,t,n,p);h=u(0)}if(s(h,"value")){if(h.writable===!1||!f(p))return!1;if(l=a.f(p,t)){if(l.get||l.set||l.writable===!1)return!1;l.value=n,i.f(p,t,l)}else i.f(p,t,u(0,n));return!0}return void 0!==h.set&&(h.set.call(p,n),!0)}var i=n(14),a=n(53),o=n(61),s=n(8),l=n(11),u=n(20),c=n(15),f=n(16);l(l.S,"Reflect",{set:r})},function(e,t,n){var r=n(11),i=n(75);i&&r(r.S,"Reflect",{setPrototypeOf:function(e,t){i.check(e,t);try{return i.set(e,t),!0}catch(e){return!1}}})},function(e,t,n){"use strict";var r=n(11),i=n(39)(!0);r(r.P,"Array",{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(190)("includes")},function(e,t,n){"use strict";var r=n(11),i=n(259),a=n(60),o=n(40),s=n(24),l=n(177);r(r.P,"Array",{flatMap:function(e){var t,n,r=a(this);return s(e),t=o(r.length),n=l(r,0),i(n,r,r,t,0,1,e,arguments[1]),n}}),n(190)("flatMap")},function(e,t,n){"use strict";function r(e,t,n,u,c,f,d,p){for(var h,m,v=c,g=0,y=!!d&&s(d,p,3);g0)v=r(e,t,h,o(h.length),v,f-1)-1;else{if(v>=9007199254740991)throw TypeError();e[v]=h}v++}g++}return v}var i=n(47),a=n(16),o=n(40),s=n(23),l=n(29)("isConcatSpreadable");e.exports=r},function(e,t,n){"use strict";var r=n(11),i=n(259),a=n(60),o=n(40),s=n(41),l=n(177);r(r.P,"Array",{flatten:function(){var e=arguments[0],t=a(this),n=o(t.length),r=l(t,0);return i(r,t,t,n,0,void 0===e?1:s(e)),r}}),n(190)("flatten")},function(e,t,n){"use strict";var r=n(11),i=n(130)(!0);r(r.P,"String",{at:function(e){return i(this,e)}})},function(e,t,n){"use strict";var r=n(11),i=n(263),a=n(216);r(r.P+r.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(a),"String",{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!0)}})},function(e,t,n){var r=n(40),i=n(93),a=n(38);e.exports=function(e,t,n,o){var s=String(a(e)),l=s.length,u=void 0===n?" ":String(n),c=r(t);if(c<=l||""==u)return s;var f=c-l,d=i.call(u,Math.ceil(f/u.length));return d.length>f&&(d=d.slice(0,f)),o?d+s:s+d}},function(e,t,n){"use strict";var r=n(11),i=n(263),a=n(216);r(r.P+r.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(a),"String",{padEnd:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!1)}})},function(e,t,n){"use strict";n(85)("trimLeft",function(e){return function(){return e(this,1)}},"trimStart")},function(e,t,n){"use strict";n(85)("trimRight",function(e){return function(){return e(this,2)}},"trimEnd")},function(e,t,n){"use strict";var r=n(11),i=n(38),a=n(40),o=n(137),s=n(200),l=RegExp.prototype,u=function(e,t){this._r=e,this._s=t};n(133)(u,"RegExp String",function(){var e=this._r.exec(this._s);return{value:e,done:null===e}}),r(r.P,"String",{matchAll:function(e){if(i(this),!o(e))throw TypeError(e+" is not a regexp!");var t=String(this),n="flags"in l?String(e.flags):s.call(e),r=new RegExp(e.source,~n.indexOf("g")?n:"g"+n);return r.lastIndex=a(e.lastIndex),new u(r,t)}})},function(e,t,n){n(31)("asyncIterator")},function(e,t,n){n(31)("observable")},function(e,t,n){var r=n(11),i=n(253),a=n(35),o=n(53),s=n(167);r(r.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=a(e),l=o.f,u=i(r),c={},f=0;u.length>f;)n=l(r,t=u[f++]),void 0!==n&&s(c,t,n);return c}})},function(e,t,n){var r=n(11),i=n(272)(!1);r(r.S,"Object",{values:function(e){return i(e)}})},function(e,t,n){var r=n(33),i=n(35),a=n(46).f;e.exports=function(e){return function(t){for(var n,o=i(t),s=r(o),l=s.length,u=0,c=[];l>u;)a.call(o,n=s[u++])&&c.push(e?[n,o[n]]:o[n]);return c}}},function(e,t,n){var r=n(11),i=n(272)(!0);r(r.S,"Object",{entries:function(e){return i(e)}})},function(e,t,n){"use strict";var r=n(11),i=n(60),a=n(24),o=n(14);n(9)&&r(r.P+n(275),"Object",{__defineGetter__:function(e,t){o.f(i(this),e,{get:a(t),enumerable:!0,configurable:!0})}})},function(e,t,n){"use strict";e.exports=n(27)||!n(10)(function(){var e=Math.random();__defineSetter__.call(null,e,function(){}),delete n(7)[e]})},function(e,t,n){"use strict";var r=n(11),i=n(60),a=n(24),o=n(14);n(9)&&r(r.P+n(275),"Object",{__defineSetter__:function(e,t){o.f(i(this),e,{set:a(t),enumerable:!0,configurable:!0})}})},function(e,t,n){"use strict";var r=n(11),i=n(60),a=n(19),o=n(61),s=n(53).f;n(9)&&r(r.P+n(275),"Object",{__lookupGetter__:function(e){var t,n=i(this),r=a(e,!0);do if(t=s(n,r))return t.get;while(n=o(n))}})},function(e,t,n){"use strict";var r=n(11),i=n(60),a=n(19),o=n(61),s=n(53).f;n(9)&&r(r.P+n(275),"Object",{__lookupSetter__:function(e){var t,n=i(this),r=a(e,!0);do if(t=s(n,r))return t.set;while(n=o(n))}})},function(e,t,n){var r=n(11);r(r.P+r.R,"Map",{toJSON:n(280)("Map")})},function(e,t,n){var r=n(77),i=n(281);e.exports=function(e){return function(){if(r(this)!=e)throw TypeError(e+"#toJSON isn't generic");return i(this)}}},function(e,t,n){var r=n(210);e.exports=function(e,t){var n=[];return r(e,!1,n.push,n,t),n}},function(e,t,n){var r=n(11);r(r.P+r.R,"Set",{toJSON:n(280)("Set")})},function(e,t,n){n(284)("Map")},function(e,t,n){"use strict";var r=n(11);e.exports=function(e){r(r.S,e,{of:function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}})}},function(e,t,n){n(284)("Set")},function(e,t,n){n(284)("WeakMap")},function(e,t,n){n(284)("WeakSet")},function(e,t,n){n(289)("Map")},function(e,t,n){"use strict";var r=n(11),i=n(24),a=n(23),o=n(210);e.exports=function(e){r(r.S,e,{from:function(e){var t,n,r,s,l=arguments[1];return i(this),t=void 0!==l,t&&i(l),void 0==e?new this:(n=[],t?(r=0,s=a(l,arguments[2],2),o(e,!1,function(e){n.push(s(e,r++))})):o(e,!1,n.push,n),new this(n))}})}},function(e,t,n){n(289)("Set")},function(e,t,n){n(289)("WeakMap")},function(e,t,n){n(289)("WeakSet")},function(e,t,n){var r=n(11);r(r.G,{global:n(7)})},function(e,t,n){var r=n(11);r(r.S,"System",{global:n(7)})},function(e,t,n){var r=n(11),i=n(37);r(r.S,"Error",{isError:function(e){return"Error"===i(e)}})},function(e,t,n){var r=n(11);r(r.S,"Math",{clamp:function(e,t,n){return Math.min(n,Math.max(t,e))}})},function(e,t,n){var r=n(11);r(r.S,"Math",{DEG_PER_RAD:Math.PI/180})},function(e,t,n){var r=n(11),i=180/Math.PI;r(r.S,"Math",{degrees:function(e){return e*i}})},function(e,t,n){var r=n(11),i=n(300),a=n(116);r(r.S,"Math",{fscale:function(e,t,n,r,o){return a(i(e,t,n,r,o))}})},function(e,t){e.exports=Math.scale||function(e,t,n,r,i){return 0===arguments.length||e!=e||t!=t||n!=n||r!=r||i!=i?NaN:e===1/0||e===-(1/0)?e:(e-t)*(i-r)/(n-t)+r}},function(e,t,n){var r=n(11);r(r.S,"Math",{iaddh:function(e,t,n,r){var i=e>>>0,a=t>>>0,o=n>>>0;return a+(r>>>0)+((i&o|(i|o)&~(i+o>>>0))>>>31)|0}})},function(e,t,n){var r=n(11);r(r.S,"Math",{isubh:function(e,t,n,r){var i=e>>>0,a=t>>>0,o=n>>>0;return a-(r>>>0)-((~i&o|~(i^o)&i-o>>>0)>>>31)|0}})},function(e,t,n){var r=n(11);r(r.S,"Math",{imulh:function(e,t){var n=65535,r=+e,i=+t,a=r&n,o=i&n,s=r>>16,l=i>>16,u=(s*o>>>0)+(a*o>>>16);return s*l+(u>>16)+((a*l>>>0)+(u&n)>>16)}})},function(e,t,n){var r=n(11);r(r.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(e,t,n){var r=n(11),i=Math.PI/180;r(r.S,"Math",{radians:function(e){return e*i}})},function(e,t,n){var r=n(11);r(r.S,"Math",{scale:n(300)})},function(e,t,n){var r=n(11);r(r.S,"Math",{umulh:function(e,t){var n=65535,r=+e,i=+t,a=r&n,o=i&n,s=r>>>16,l=i>>>16,u=(s*o>>>0)+(a*o>>>16);return s*l+(u>>>16)+((a*l>>>0)+(u&n)>>>16)}})},function(e,t,n){var r=n(11);r(r.S,"Math",{signbit:function(e){return(e=+e)!=e?e:0==e?1/e==1/0:e>0}})},function(e,t,n){"use strict";var r=n(11),i=n(12),a=n(7),o=n(211),s=n(217);r(r.P+r.R,"Promise",{finally:function(e){var t=o(this,i.Promise||a.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then(function(){return n})}:e,n?function(n){return s(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var r=n(11),i=n(214),a=n(215);r(r.S,"Promise",{try:function(e){var t=i.f(this),n=a(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){var r=n(312),i=n(15),a=r.key,o=r.set;r.exp({defineMetadata:function(e,t,n,r){o(e,t,i(n),a(r))}})},function(e,t,n){var r=n(219),i=n(11),a=n(26)("metadata"),o=a.store||(a.store=new(n(224))),s=function(e,t,n){var i=o.get(e);if(!i){if(!n)return;o.set(e,i=new r)}var a=i.get(t);if(!a){if(!n)return;i.set(t,a=new r)}return a},l=function(e,t,n){var r=s(t,n,!1);return void 0!==r&&r.has(e)},u=function(e,t,n){var r=s(t,n,!1);return void 0===r?void 0:r.get(e)},c=function(e,t,n,r){s(n,r,!0).set(e,t)},f=function(e,t){var n=s(e,t,!1),r=[];return n&&n.forEach(function(e,t){r.push(t)}),r},d=function(e){return void 0===e||"symbol"==typeof e?e:String(e)},p=function(e){i(i.S,"Reflect",e)};e.exports={store:o,map:s,has:l,get:u,set:c,keys:f,key:d,exp:p}},function(e,t,n){var r=n(312),i=n(15),a=r.key,o=r.map,s=r.store;r.exp({deleteMetadata:function(e,t){var n=arguments.length<3?void 0:a(arguments[2]),r=o(i(t),n,!1);if(void 0===r||!r.delete(e))return!1;if(r.size)return!0;var l=s.get(t);return l.delete(n),!!l.size||s.delete(t)}})},function(e,t,n){var r=n(312),i=n(15),a=n(61),o=r.has,s=r.get,l=r.key,u=function(e,t,n){var r=o(e,t,n);if(r)return s(e,t,n);var i=a(t);return null!==i?u(e,i,n):void 0};r.exp({getMetadata:function(e,t){return u(e,i(t),arguments.length<3?void 0:l(arguments[2]))}})},function(e,t,n){var r=n(223),i=n(281),a=n(312),o=n(15),s=n(61),l=a.keys,u=a.key,c=function(e,t){var n=l(e,t),a=s(e);if(null===a)return n;var o=c(a,t);return o.length?n.length?i(new r(n.concat(o))):o:n};a.exp({getMetadataKeys:function(e){return c(o(e),arguments.length<2?void 0:u(arguments[1]))}})},function(e,t,n){var r=n(312),i=n(15),a=r.get,o=r.key;r.exp({getOwnMetadata:function(e,t){return a(e,i(t),arguments.length<3?void 0:o(arguments[2]))}})},function(e,t,n){var r=n(312),i=n(15),a=r.keys,o=r.key;r.exp({getOwnMetadataKeys:function(e){return a(i(e),arguments.length<2?void 0:o(arguments[1]))}})},function(e,t,n){var r=n(312),i=n(15),a=n(61),o=r.has,s=r.key,l=function(e,t,n){var r=o(e,t,n);if(r)return!0;var i=a(t);return null!==i&&l(e,i,n)};r.exp({hasMetadata:function(e,t){return l(e,i(t),arguments.length<3?void 0:s(arguments[2]))}})},function(e,t,n){var r=n(312),i=n(15),a=r.has,o=r.key;r.exp({hasOwnMetadata:function(e,t){return a(e,i(t),arguments.length<3?void 0:o(arguments[2]))}})},function(e,t,n){var r=n(312),i=n(15),a=n(24),o=r.key,s=r.set;r.exp({metadata:function(e,t){return function(n,r){s(e,t,(void 0!==r?i:a)(n),o(r))}}})},function(e,t,n){var r=n(11),i=n(213)(),a=n(7).process,o="process"==n(37)(a);r(r.G,{asap:function(e){var t=o&&a.domain;i(t?t.bind(e):e)}})},function(e,t,n){"use strict";var r=n(11),i=n(7),a=n(12),o=n(213)(),s=n(29)("observable"),l=n(24),u=n(15),c=n(209),f=n(218),d=n(13),p=n(210),h=p.RETURN,m=function(e){return null==e?void 0:l(e)},v=function(e){var t=e._c;t&&(e._c=void 0,t())},g=function(e){return void 0===e._o},y=function(e){g(e)||(e._o=void 0,v(e))},_=function(e,t){u(e),this._c=void 0,this._o=e,e=new b(this);try{var n=t(e),r=n;null!=n&&("function"==typeof n.unsubscribe?n=function(){r.unsubscribe()}:l(n),this._c=n)}catch(t){return void e.error(t)}g(this)&&v(this)};_.prototype=f({},{unsubscribe:function(){y(this)}});var b=function(e){this._s=e};b.prototype=f({},{next:function(e){var t=this._s;if(!g(t)){var n=t._o;try{var r=m(n.next);if(r)return r.call(n,e)}catch(e){try{y(t)}finally{throw e}}}},error:function(e){var t=this._s;if(g(t))throw e;var n=t._o;t._o=void 0;try{var r=m(n.error);if(!r)throw e;e=r.call(n,e)}catch(e){try{v(t)}finally{throw e}}return v(t),e},complete:function(e){var t=this._s;if(!g(t)){var n=t._o;t._o=void 0;try{var r=m(n.complete);e=r?r.call(n,e):void 0}catch(e){try{v(t)}finally{throw e}}return v(t),e}}});var w=function(e){c(this,w,"Observable","_f")._f=l(e)};f(w.prototype,{subscribe:function(e){return new _(e,this._f)},forEach:function(e){var t=this;return new(a.Promise||i.Promise)(function(n,r){l(e);var i=t.subscribe({next:function(t){try{return e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:n})})}}),f(w,{from:function(e){var t="function"==typeof this?this:w,n=m(u(e)[s]);if(n){var r=u(n.call(e));return r.constructor===t?r:new t(function(e){return r.subscribe(e)})}return new t(function(t){var n=!1;return o(function(){if(!n){try{if(p(e,!1,function(e){if(t.next(e),n)return h})===h)return}catch(e){if(n)throw e;return void t.error(e)}t.complete()}}),function(){n=!0}})},of:function(){for(var e=0,t=arguments.length,n=new Array(t);e2,i=!!r&&o.call(arguments,2);return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,n)}};i(i.G+i.B+i.F*s,{setTimeout:l(r.setTimeout),setInterval:l(r.setInterval)})},function(e,t,n){var r=n(11),i=n(212);r(r.G+r.B,{setImmediate:i.set,clearImmediate:i.clear})},function(e,t,n){for(var r=n(197),i=n(33),a=n(21),o=n(7),s=n(13),l=n(132),u=n(29),c=u("iterator"),f=u("toStringTag"),d=l.Array,p={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},h=i(p),m=0;m=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=_.call(i,"catchLoc"),s=_.call(i,"finallyLoc");if(o&&s){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&_.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),p(n),O}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;p(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:m(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=g),O}}}("object"==typeof t?t:"object"==typeof window?window:"object"==typeof self?self:this)}).call(t,function(){return this}(),n(4))},function(e,t,n){n(328),e.exports=n(12).RegExp.escape},function(e,t,n){var r=n(11),i=n(329)(/[\\^$*+?.()|[\]{}]/g,"\\$&");r(r.S,"RegExp",{escape:function(e){return i(e)}})},function(e,t){e.exports=function(e,t){var n=t===Object(t)?function(e){return t[e]}:t;return function(t){return String(t).replace(e,n)}}},function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){return e}function a(e){return e.text().then(function(e){var t=e;try{t=JSON.parse(e)}catch(t){var n=document.createElement("div");n.innerHTML=e;var r=new Error;throw r.stack=(0,v.default)(n.innerText),r}return t})}function o(e){if(g)return!0;var t=e.status||(e.error?"error":""),n=e.message||(e.error?e.error.message:null),r=e.toastr||null,i=void 0;switch(t){case"unauthenticated":throw document.location.href=h.config.base_url_relative,y("Logged out");case"unauthorized":t="error",n=n||"Unauthorized.";break;case"error":t="error",n=n||"Unknown error.";break;case"success":t="success",n=n||"";break;default:t="error",n=n||"Invalid AJAX response."}return r&&(i=Object.assign({},f.default.options),Object.keys(r).forEach(function(e){f.default.options[e]=r[e]})),n&&(p.default||!p.default&&"error"!==t)&&f.default["success"===t?"success":"error"](n),r&&(f.default.options=i),e}function s(e){if(g)return!0;var t=e.stack?"
"+e.stack+"
":"";f.default.error("Fetch Failed:
"+e.message+" "+t),console.error(e.message+" at "+e.stack)}Object.defineProperty(t,"__esModule",{value:!0}),t.parseStatus=i,t.parseJSON=a,t.userFeedback=o,t.userFeedbackError=s;var l=n(1),u=r(l),c=n(331),f=r(c),d=n(334),p=r(d),h=n(335),m=n(336),v=r(m),g=!1,y=function e(t){var e=new Error(t.statusText||t||"");return e.response=t,e};(0,u.default)(e).on("beforeunload._ajax",function(){g=!0})}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(332),a=r(i);a.default.options.positionClass="toast-top-right",a.default.options.preventDuplicates=!0,t.default=a.default},,,function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=r(i),o=n(334),s=r(o),l=(0,a.default)("#offline-status");(0,a.default)(window).on("offline",function(){l.slideDown()}),(0,a.default)(window).on("online",function(){l.slideUp()}),(0,a.default)(document).ready(function(){s.default||l.slideDown()}),t.default="undefined"==typeof e.navigator.onLine||e.navigator.onLine}).call(t,function(){return this}())},function(e,t){e.exports=GravAdmin},function(e,t,n){function r(e,t){return e=i(e),t=t||a,o(s(e,t),t)}var i=n(337),a=n(338),o=n(339),s=n(340);e.exports=r},function(e,t){function n(e){return null==e?"":e.toString()}e.exports=n},function(e,t){e.exports=[" ","\n","\r","\t","\f","\v"," "," ","᠎"," "," "," "," "," "," "," "," "," "," "," ","\u2028","\u2029"," "," "," "]},function(e,t,n){function r(e,t){e=i(e),t=t||a;for(var n,r,o=0,s=e.length,l=t.length,u=!0;u&&o=s?"":e.substr(o,s)}var i=n(337),a=n(338);e.exports=r},function(e,t,n){function r(e,t){e=i(e),t=t||a;for(var n,r,o=e.length-1,s=t.length,l=!0;l&&o>=0;)for(l=!1,n=-1,r=e.charAt(o);++n=0?e.substring(0,o+1):""}var i=n(337),a=n(338);e.exports=r},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function i(e){return"number"==typeof e}function a(e){return"object"==typeof e&&null!==e}function o(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!i(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,i,s,l,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(n=this._events[e],o(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(a(n))for(s=Array.prototype.slice.call(arguments,1),u=n.slice(),i=u.length,l=0;l0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,i,o,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],o=n.length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(n)){for(s=o;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){i=s;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){(function(e){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),this.setPayload(t),this.task="task"+c.config.param_sep}return a(e,[{key:"setPayload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.payload=e,this}},{key:"fetch",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return p.Instance.fetch(function(t){return e.setPayload(t)},t),this}},{key:"maintenance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"hide",t=(0,s.default)("#updates [data-update-packages]");return t["show"===e?"fadeIn":"fadeOut"](),"hide"===e&&(0,s.default)(".badges.with-updates").removeClass("with-updates").find(".badge.updates").remove(),this}},{key:"grav",value:function(){var e=this.payload.grav;if(e&&e.isUpdatable){var t=this.task,n="";n+=e.isSymlink?'':'",n+="\n Grav v"+e.available+" "+c.translations.PLUGIN_ADMIN.IS_NOW_AVAILABLE+'! ('+c.translations.PLUGIN_ADMIN.CURRENT+" v"+e.version+")\n ";var r=(0,s.default)("[data-gpm-grav]").removeClass("hidden");r.is(":empty")&&r.hide(),r.addClass("grav").html(""+n).slideDown(150).parent("#messages").addClass("default-box-shadow")}return(0,s.default)("#grav-update-button").on("click",function(){(0,s.default)(this).html(c.translations.PLUGIN_ADMIN.UPDATING_PLEASE_WAIT+" "+(0,d.default)(e.assets["grav-update"].size)+"..")}),this}},{key:"resources",value:function(){if(!this.payload||!this.payload.resources||!this.payload.resources.total)return this.maintenance("hide");var e=!0,t=["plugins","themes"],n=["plugin","theme"],r=this.payload.resources,i=r.plugins,a=r.themes;return this.payload.resources.total?([i,a].forEach(function(r,i){if(r&&!Array.isArray(r)){var a=Object.keys(r).length,o=t[i];(0,s.default)('#admin-menu a[href$="/'+t[i]+'"]').find(".badges").addClass("with-updates").find(".badge.updates").text(a);var l="";l="plugins"===o?c.translations.PLUGIN_ADMIN.PLUGINS:c.translations.PLUGIN_ADMIN.THEMES;var f=(0,s.default)(".grav-update."+o);f.css("display","block").html('\n

\n '+c.translations.PLUGIN_ADMIN.UPDATE+" "+c.translations.PLUGIN_ADMIN.ALL+" "+l+'\n \n '+a+" "+c.translations.PLUGIN_ADMIN.OF_YOUR+" "+o+" "+c.translations.PLUGIN_ADMIN.HAVE_AN_UPDATE_AVAILABLE+"\n

\n ");var d=(0,s.default)("[data-update-packages]").attr("data-packages-slugs")||"";d=d?d.split(","):[];var p=(0,u.default)(d.concat(Object.keys(r))).join();(0,s.default)("[data-update-packages]").attr("data-packages-slugs",""+p),Object.keys(r).forEach(function(t){var a=(0,s.default)("[data-gpm-"+n[i]+'="'+t+'"]'),l=a.find(".gpm-name"),u=l.find("a"),f=a.parents(".content-wrapper");if("plugins"!==o||l.find(".badge.update").length?"themes"===o&&(l.append('"),f.addClass("has-updates")):(l.append(''+c.translations.PLUGIN_ADMIN.UPDATE_AVAILABLE+"!"),f.addClass("has-updates")),a.length){var d=(0,s.default)(".grav-update."+n[i]);if(d.length){var p="testing"===r[t].type?'test release':"";d.html('\n

\n '+c.translations.PLUGIN_ADMIN.UPDATE+" "+(n[i].charAt(0).toUpperCase()+n[i].substr(1).toLowerCase())+'\n \n v'+r[t].available+" "+p+" "+c.translations.PLUGIN_ADMIN.OF_THIS+" "+n[i]+" "+c.translations.PLUGIN_ADMIN.IS_NOW_AVAILABLE+"!\n

\n ").css("display","block"),e=!1}}}),(0,s.default)("[data-update-packages]").removeClass("hidden")}}),(0,s.default)(".content-wrapper").addClass("updates-checked"),void(e||(0,s.default)(".warning-reinstall-not-latest-release").removeClass("hidden"))):this}}]),e}();t.default=y;var _=new y;t.Instance=_,t.Notifications=m.default,t.Feed=g.default,p.Instance.on("fetched",function(e,t){_.setPayload(e.payload||{}),_.grav().resources()}),"1"===c.config.enable_auto_updates_check&&p.Instance.fetch()},function(e,t,n){function r(e,t){return t=t||i,a(e,function(e,n,r){for(var i=r.length;++n ul").show();switch(r.find("div").remove(),r.find(".fa-warning").removeClass("fa-warning").addClass("fa-refresh fa-spin"),e.type||(e.type="note"),e.type){case"note":e.intro_text="Note";break;case"info":e.intro_text="Info";break;case"warning":e.intro_text="Warning"}var a="";if(t>9&&(a=" hidden "),e.link){var o=document.createElement("div");o.innerHTML=e.message,i.append('\n
  • \n '+e.intro_text+'\n '+e.message+"\n
  • \n ")}else{var l=(0,s.default)("

    "+e.message+"

    ").text();i.append('\n
  • \n '+e.intro_text+'\n '+e.message+"\n
  • \n ")}}},{key:"addShowAllInFeed",value:function(){(0,s.default)("#notifications ul").append('\n
  • Show all
  • \n ')}},{key:"showNotificationInTop",value:function(e){var t=void 0;t=e.link?(0,s.default)('
    \n '+e.message+"\n "+e.closeButton+"\n
    "):(0,s.default)('
    \n '+e.message+"\n "+e.closeButton+"\n
    "),t.hide(),(0,s.default)(".top-notifications-container").removeClass("hidden").addClass("default-box-shadow").append(t),t.slideDown(150)}},{key:"showNotificationInDashboard",value:function(e){var t=void 0;t=e.link?(0,s.default)('
    \n '+e.message+"\n "+e.closeButton+"\n
    "):(0,s.default)('
    \n '+e.message+"\n "+e.closeButton+"\n
    "),t.hide(),(0,s.default)(".dashboard-notifications-container").removeClass("hidden").append(t),t.slideDown(150)}},{key:"showNotificationInPlugins",value:function(e){var t=void 0;t=e.link?(0,s.default)('
    \n '+e.message+"\n "+e.closeButton+"\n
    "):(0,s.default)('
    \n '+e.message+" "+e.closeButton+"\n
    "),t.hide(),(0,s.default)(".plugins-notifications-container").removeClass("hidden").append(t),t.slideDown(150)}},{key:"showNotificationInThemes",value:function(e){var t=void 0;t=e.link?(0,s.default)('
    \n '+e.message+"\n "+e.closeButton+"\n
    "):(0,s.default)('
    \n '+e.message+"\n "+e.closeButton+"\n
    "),t.hide(),(0,s.default)(".themes-notifications-container").removeClass("hidden").append(t),t.slideDown(150)}},{key:"processLocation",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;switch(e){case"feed":this.showNotificationInFeed(t,n);break;case"top":t.read||this.showNotificationInTop(t);break;case"dashboard":t.read||this.showNotificationInDashboard(t);break;case"plugins":t.read||this.showNotificationInPlugins(t);break;case"themes":t.read||this.showNotificationInThemes(t)}}},{key:"fetch",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.locations,n=void 0===t?[]:t,r=e.refresh,i=void 0!==r&&r;if(!f())return!1;var a=this,o=(0,s.default)("#notifications"),u=o.find(".widget-loader"),d=o.find(".widget-content > ul");u.find("div").remove(),u.find(".fa-warning").removeClass("fa-warning").addClass("fa-refresh fa-spin"),u.show(),d.hide();var p=function(e){var t=e.notifications;if((0,s.default)("#notifications").find(".widget-content > ul").empty(),t){var r=0;t.forEach(function(e,t){if(e.closeButton='',e.options&&e.options.indexOf("sticky")!==-1&&(e.closeButton=""),Array.isArray(e.location))e.location.forEach(function(t){n.length&&n.indexOf(t)===-1||("feed"===t?(a.processLocation(t,e,r),r++):a.processLocation(t,e))});else{if(n.length&&n.indexOf(e.location)===-1)return;a.processLocation(e.location,e)}}),r>10&&a.addShowAllInFeed()}};(0,c.default)(l.config.base_url_relative+"/notifications.json/task"+l.config.param_sep+"getNotifications",{method:"post"},function(e){(e.need_update===!0||i)&&s.default.get((l.config.local_notifications?"http://localhost":"https://getgrav.org")+"/notifications.json?"+Date.now()).then(function(e){(0,c.default)(l.config.base_url_relative+"/notifications.json/task"+l.config.param_sep+"processNotifications",{method:"post",body:{notifications:JSON.stringify(e)}},function(e){e.show_immediately===!0&&p(e)})}).fail(function(){var e=(0,s.default)("#notifications .widget-content");e.find(".widget-loader").find("div").remove(),e.find(".widget-loader").append("
    Failed to retrieve notifications
    ").find(".fa-spin").removeClass("fa-spin fa-refresh").addClass("fa-warning")}),p(e)})}}]),e}(),p=new d;t.default=p,f()&&(p.fetch(),(0,s.default)(document).on("click",'[data-notification-action="hide-notification"]',function(e){var t=(0,s.default)(e.target).parents(".hide-notification").data("notification-id"),n=l.config.base_url_relative+"/notifications.json/task"+l.config.param_sep+"hideNotification/notification_id"+l.config.param_sep+t;(0,c.default)(n,{method:"post"},function(){}),(0,s.default)(e.target).parents(".single-notification").hide()}),(0,s.default)(document).on("click",'[data-notification-action="show-all-notifications"]',function(e){(0,s.default)("#notifications .show-all").hide(),(0,s.default)("#notifications .hidden").removeClass("hidden")}),(0,s.default)(document).on("click",'[data-refresh="notifications"]',function(e){e.preventDefault(),p.fetch({locations:["feed"],refresh:!0})}))},function(e,t,n){(function(e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(330),i=n(335),a=void 0,o=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0};if("function"==typeof n&&(o=n,n={}),n.method&&"post"===n.method){var s=new FormData;n.body=Object.assign({"admin-nonce":i.config.admin_nonce},n.body||{}),Object.keys(n.body).map(function(e){return s.append(e,n.body[e])}),n.body=s}return n=Object.assign({credentials:"same-origin",headers:{Accept:"application/json"}},n),e(t,n).then(function(e){return a=e,e}).then(r.parseStatus).then(r.parseJSON).then(r.userFeedback).then(function(e){return o(e,a)}).catch(r.userFeedbackError)};t.default=o}).call(t,n(3))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};(0,c.default)(f,{method:"post",body:{refresh:t}},function(t){e.data=t,n(t)})}},{key:"refresh",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(0,s.default)("#news-feed .widget-content");if(t.length){var n=t.find(".widget-loader");n.find("div").remove(),n.find(".fa-warning").removeClass("fa-warning").addClass("fa-refresh fa-spin"),n.show(),t.find("> ul").hide(),!this.data||this.data.error||e?this.fetch(e,this.updateContent.bind(this)):this.updateContent()}}},{key:"updateContent",value:function(){var e=(0,s.default)("#news-feed .widget-content");if(e.length){var t=e.find(".widget-loader").hide(),n=e.find("> ul").empty().show();return this.data.error||"error"===this.data.status?(t.show().find("div").remove(),t.find(".fa-refresh").removeClass("fa-refresh fa-spin").addClass("fa-warning"),void t.append("
    "+(this.data.error?this.data.error.message:this.data.message||"Unable to download news feed")+"
    ")):void(this.data&&this.data.feed_data&&this.data.feed_data.forEach(function(e){n.append(e)}))}}}]),e}(),p=new d;(0,s.default)(document).ready(function(){return p.refresh()}),(0,s.default)(document).on("click",'[data-refresh="feed"]',function(e){e.preventDefault(),p.refresh(!0)}),t.default=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),a=r(i),o=n(2),s=n(335),l=n(331),u=r(l);(0,a.default)("[data-gpm-checkupdates]").on("click",function(){var e=(0,a.default)(this);e.find("i").addClass("fa-spin"),o.Instance.fetch(function(t){e.find("i").removeClass("fa-spin");var n=t.payload;if(n)if(n.grav.isUpdatable||n.resources.total){var r=n.grav.isUpdatable?"Grav v"+n.grav.available:"",i=n.resources.total?n.resources.total+" "+s.translations.PLUGIN_ADMIN.UPDATES_ARE_AVAILABLE:"";i||(r+=" "+s.translations.PLUGIN_ADMIN.IS_AVAILABLE_FOR_UPDATE),u.default.info(r+(r&&i?" "+s.translations.PLUGIN_ADMIN.AND+" ":"")+i)}else u.default.success(s.translations.PLUGIN_ADMIN.EVERYTHING_UP_TO_DATE)},!0)})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),a=r(i),o=n(358),s=r(o);(0,a.default)("body").on("click","[data-maintenance-update]",function(){var e=(0,a.default)(this),t=e.data("maintenanceUpdate");e.attr("disabled","disabled").find("> .fa").removeClass("fa-cloud-download").addClass("fa-refresh fa-spin"),(0,s.default)(t,function(t){"updategrav"===t.type&&((0,a.default)("[data-gpm-grav]").remove(),(0,a.default)("#footer .grav-version").html(t.version)), -e.removeAttr("disabled").find("> .fa").removeClass("fa-refresh fa-spin").addClass("fa-cloud-download")})})},function(e,t,n){(function(e){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}var r=n(1),i=t(r),a=n(358),o=t(a),s=(0,i.default)('input[type="radio"][name="channel-switch"]');s&&s.on("change",function(t){var n=(0,i.default)(t.target),r=""+n.parent("[data-url]").data("url");(0,o.default)(r,{method:"post",body:{task:"gpmRelease",release:n.val()}},function(t){t.reload&&e.location.reload()})})}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(364),a=r(i),o=n(366);n(367),t.default={Chart:{Chart:a.default,UpdatesChart:i.UpdatesChart,Instances:i.Instances},Cache:o.Instance}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instances=t.UpdatesChart=t.defaults=void 0;var s=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,r)}if("value"in i)return i.value;var o=i.get;if(void 0!==o)return o.call(r)},l=function(){function e(e,t){for(var n=0;n-1,g=t.defaults={data:{series:[100,0]},options:{Pie:{donut:!0,donutWidth:10,startAngle:0,total:100,showLabel:!1,height:150,chartPadding:5},Bar:{height:164,chartPadding:v?10:5,axisX:{showGrid:!1,labelOffset:{x:0,y:0}},axisY:{offset:15,showLabel:!0,showGrid:!0,labelOffset:{x:5,y:5},scaleMinSpace:v?10:20}}}},y=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(o(this,e),this.element=(0,c.default)(t)||[],this.element[0]){var a=(this.element.data("chart-type")||"pie").toLowerCase();this.type=a.charAt(0).toUpperCase()+a.substr(1).toLowerCase(),r=Object.assign({},g.options[this.type],r),i=Object.assign({},g.data,i),Object.assign(this,{options:r,data:i}),this.chart=d.default[this.type](this.element.find(".ct-chart").empty()[0],this.data,this.options),this.chart.on("created",function(){n.element.find(".hidden").removeClass("hidden"),n.element.find(".ct-label").each(function(e,t){t=(0,c.default)(t);var n=t.html().replace("<","<").replace(">",">");t.html(n)})})}}return l(e,[{key:"updateData",value:function(e){Object.assign(this.data,e),this.chart.update(this.data)}}]),e}();t.default=y;var _=t.UpdatesChart=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o(this,t);var a=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r));return a.chart.on("draw",function(e){return a.draw(e)}),h.Instance.on("fetched",function(e){if(e.payload){var t=e.payload.grav,n=100*(e.payload.resources.total+(t.isUpdatable?1:0))/(e.payload.installed+(t.isUpdatable?1:0)),r=100-n;a.updateData({series:[r,n]}),e.payload.resources.total&&m.Instance.maintenance("show")}}),a}return a(t,e),l(t,[{key:"draw",value:function(e){if(!e.index){var t=p.translations.PLUGIN_ADMIN[100===e.value?"FULLY_UPDATED":"UPDATES_AVAILABLE"];this.element.find(".numeric span").text(Math.round(e.value)+"%"),this.element.find(".js__updates-available-description").html(t),this.element.find(".hidden").removeClass("hidden")}}},{key:"updateData",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateData",this).call(this,e),this.data.series[0]<100&&this.element.closest("#updates").find("[data-update-packages]").fadeIn()}}]),t}(y),b={};(0,c.default)("[data-chart-name]").each(function(){var e=(0,c.default)(this),t=e.data("chart-name")||"",n=e.data("chart-options")||{},r=e.data("chart-data")||{};"updates"===t?b[t]=new _(e,n,r):b[t]=new y(e,n,r)});t.Instances=b},,function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=void 0;var a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"";return e&&(e="cleartype:"+e+"/"),l.config.base_url_relative+"/cache.json/task"+l.config.param_sep+"clearCache/"+e+"admin-nonce"+l.config.param_sep+l.config.admin_nonce},d=function(){function e(){var t=this;i(this,e),this.element=(0,s.default)("[data-clear-cache]"),(0,s.default)("body").on("click","[data-clear-cache]",function(e){return t.clear(e,e.target)})}return a(e,[{key:"clear",value:function(e,t){var n=this,r="";e&&e.preventDefault&&e.preventDefault(),"string"==typeof e&&(r=e),t=t?(0,s.default)(t):(0,s.default)('[data-clear-cache-type="'+r+'"]'),r=r||(0,s.default)(t).data("clear-cache-type")||"";var i=t.data("clearCache")||f(r);this.disable(),(0,c.default)(i,function(){return n.enable()})}},{key:"enable",value:function(){this.element.removeAttr("disabled").find("> .fa").removeClass("fa-refresh fa-spin").addClass("fa-trash")}},{key:"disable",value:function(){this.element.attr("disabled","disabled").find("> .fa").removeClass("fa-trash").addClass("fa-refresh fa-spin")}}]),e}();t.default=d;var p=new d;t.Instance=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),a=r(i),o=n(335),s=n(358),l=r(s),u=n(364);(0,a.default)('[data-ajax*="task:backup/"]').on("click",function(){var e=(0,a.default)(this),t=e.data("ajax"),n=e.closest(".dropdown-menu");(n.length?n:e).closest(".button-group").find("> button:first").attr("disabled","disabled").find("> .fa").removeClass("fa-life-ring").addClass("fa-spin fa-refresh"),(0,l.default)(t,function(){u.Instances&&u.Instances.backups&&(u.Instances.backups.updateData({series:[0,100]}),u.Instances.backups.element.find(".numeric").html("0 "+o.translations.PLUGIN_ADMIN.DAYS.toLowerCase()+"")),(n.length?n:e).closest(".button-group").find("> button:first").removeAttr("disabled").find("> .fa").removeClass("fa-spin fa-refresh").addClass("fa-life-ring")})}),(0,a.default)('[data-ajax*="task:backupDelete"]').on("click",function(){var e=(0,a.default)(this),t=e.data("ajax"),n=e.closest("tr");n.addClass("deleting"),(0,l.default)(t,function(e){"success"===e.status?n.remove():n.removeClass("deleting")})})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=r(i),o=n(369),s=r(o),l=n(370),u=r(l),c=n(378),f=r(c),d=function(e,t){return("000"+e).substr(-t)},p=null,h=(0,a.default)("#ordering");h.length&&(p=new s.default(h.get(0),{filter:".ignore",onUpdate:function(){var e=[],t=h.children(),n=(t.length+"").split("").length;t.each(function(t,r){r=(0,a.default)(r),e.push(r.data("id")),r.find(".page-order").text(d(t+1,n)+".")}),(0,a.default)("[data-order]").val(e.join(","))}}),(0,a.default)(document).on("input",'[name="data[folder]"]',function(e){var t=(0,a.default)(e.currentTarget),n=(0,a.default)("[data-id][data-active-id]");n.data("id",t.val()),p.options.onUpdate()})),t.default={Ordering:p,Page:f.default,PageFilters:{PageFilters:u.default,Instance:l.Instance}}},,function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=void 0;var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n=0?i=setTimeout(r,t-u):(i=null,n||(l=e.apply(o,a),o=a=null))}var i,a,o,s,l;null==t&&(t=100);var u=function(){o=this,a=arguments,s=Date.now();var u=n&&!i;return i||(i=setTimeout(r,t)),u&&(l=e.apply(o,a),o=a=null),l};return u.clear=function(){i&&(clearTimeout(i),i=null)},u.flush=function(){i&&(l=e.apply(o,a),o=a=null,clearTimeout(i),i=null)},u}n.debounce=n,e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=void 0;var a=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:void 0;i(this,e),this.query=t,this.elements=(0,s.default)(void 0!==r?r:this.query),this.session=JSON.parse(sessionStorage.getItem(l)||"{}"),this.elements.length&&(this.restore(),this.elements.find(".page-icon").on("click",function(e){return n.toggle(e.target)}),this.elements.data("tree_init",1),(0,s.default)("[data-page-toggleall]").on("click",function(e){var t=(0,s.default)(e.target).closest("[data-page-toggleall]"),r=t.data("page-toggleall");n[r]()}))}return a(e,[{key:"reload",value:function(){var e=(0,s.default)(this.query).filter(function(e,t){return!(0,s.default)(t).data("tree_init")});e.length&&this.constructor(this.query,e)}},{key:"toggle",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];"string"==typeof e&&(e=(0,s.default)('[data-nav-id="'+e+'"]').find('[data-toggle="children"]')),e=(0,s.default)(e||this.elements),e.each(function(e,r){r=(0,s.default)(r);var i=t.getState(r.closest('[data-toggle="children"]'));t[i.isOpen?"collapse":"expand"](i.id,n)})}},{key:"collapse",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];"string"==typeof e&&(e=(0,s.default)('[data-nav-id="'+e+'"]').find('[data-toggle="children"]')),e=(0,s.default)(e||this.elements),e.each(function(e,r){r=(0,s.default)(r);var i=t.getState(r);i.isOpen&&(i.children.hide(),i.icon.removeClass("children-open").addClass("children-closed"),n||delete t.session[i.id])});var r=e.closest(".mediapicker-scroll");r.length&&r.data("scrollbar")&&r.data("scrollbar").update(),n||this.save()}},{key:"expand",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"==typeof e){var r=(0,s.default)('[data-nav-id="'+e+'"]'),i=r.parents("[data-nav-id]");if(i.length)return i=i.find('[data-toggle="children"]:first'),i=i.add(r.find('[data-toggle="children"]:first')),this.expand(i,n);e=r.find('[data-toggle="children"]:first')}e=(0,s.default)(e||this.elements),e.each(function(e,r){r=(0,s.default)(r);var i=t.getState(r);i.isOpen||(i.children.show(),i.icon.removeClass("children-closed").addClass("children-open"),n||(t.session[i.id]=1))});var a=e.closest(".mediapicker-scroll");a.length&&a.data("scrollbar")&&a.data("scrollbar").update(),n||this.save()}},{key:"restore",value:function(){var e=this;this.collapse(null,!0),Object.keys(this.session).forEach(function(t){e.expand(t,"no-store")})}},{key:"save",value:function(){return sessionStorage.setItem(l,JSON.stringify(this.session))}},{key:"getState",value:function(e){return e=(0,s.default)(e),{id:e.closest("[data-nav-id]").data("nav-id"),children:e.closest("li.page-item").find("ul:first"),icon:e.find(".page-icon"),get isOpen(){return this.icon.hasClass("children-open")}}}}]),e}();t.default=u;var c=new u('[data-toggle="children"]');t.Instance=c},function(e,t){"use strict";!function(){function e(){var e="localStoragePollyfill";try{return localStorage.setItem(e,e),localStorage.removeItem(e),sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(e){return!1}}if(!e())try{Storage.prototype._data={},Storage.prototype.setItem=function(e,t){return this._data[e]=String(t),this._data[e]},Storage.prototype.getItem=function(e){return this._data.hasOwnProperty(e)?this._data[e]:void 0},Storage.prototype.removeItem=function(e){return delete this._data[e]},Storage.prototype.clear=function(){return this._data={},this._data}}catch(e){console.error("localStorage pollyfill error: ",e)}}()},,,,function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(374),a=r(i);a.default.define("required-fix",function(e){var t=this;this.refreshValidityState=function(){if(!t.isRequired)return!1;var e=!t.items.length;t.isInvalid=e,e?(t.$control_input.attr("required",""),t.$input.removeAttr("required")):(t.$control_input.removeAttr("required"),t.$input.attr("required"))}})},function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=r(i);n(379),n(382),n(383),n(384),n(385);var o=n(386),s=r(o);n(456);var l=(0,a.default)('input[type="radio"][name="mode-switch"]');if(l){var u=l.closest(":checked").data("leave-url"),c=(0,a.default)('');l.parent().append(c),l.siblings("label").on("mousedown touchdown",function(t){t.preventDefault();var n=(0,a.default)('[data-remodal-id="changes"] [data-leave-action="continue"]');n.one("click",function(){(0,a.default)(e).on("beforeunload._grav"),c.off("click._grav"),(0,a.default)(t.target).trigger("click")}),c.trigger("click._grav")}),l.on("change",function(e){var t=(0,a.default)(e.target);u=t.data("leave-url"),setTimeout(function(){return c.attr("href",u).get(0).click()},5)})}t.default={Media:{PageMedia:s.default,PageMediaInstances:o.Instance}}}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),a=r(i);n(380);var o=n(358),s=r(o),l=n(335),u=!1,c=(0,a.default)('[data-remodal-id="modal"] input[name="data[folder]"], [data-remodal-id="modular"] input[name="data[folder]"]'),f=(0,a.default)('[data-remodal-id="modal"] input[name="data[title]"], [data-remodal-id="modular"] input[name="data[title]"]'),d=function(e,t){t=(0,a.default)(t);var n='[data-remodal-id="'+t.closest("[data-remodal-id]").data("remodal-id")+'"]';return{title:"title"===e?(0,a.default)(t):(0,a.default)(n+' input[name="data[title]"]'),folder:"folder"===e?(0,a.default)(t):(0,a.default)(n+' input[name="data[folder]"]')}};f.on("input focus blur",function(e){if(u)return!0;var t=d("title",e.currentTarget),n=a.default.slugify(t.title.val(),{custom:{"'":""}});t.folder.val(n)}),c.on("input",function(e){var t=d("folder",e.currentTarget),n=t.folder.get(0),r=t.folder.val(),i={start:n.selectionStart,end:n.selectionEnd};r=r.toLowerCase().replace(/\s/g,"-").replace(/[^a-z0-9_\-]/g,""),t.folder.val(r),u=!!r,n.setSelectionRange(i.start,i.end)}),c.on("focus blur",function(e){return d("title",e.currentTarget).title.trigger("input")}),(0,a.default)(document).on("change",'[name="data[route]"]',function(e){var t=(0,a.default)(e.currentTarget).val(),n=(0,a.default)('[name="data[name]"]'),r=l.config.base_url_relative+"/ajax.json/task"+l.config.param_sep+"getChildTypes";0!==n.length&&(0,s.default)(r,{method:"post",body:{rawroute:t}},function(e){var t=e.child_type;""!==t&&"default"!==t&&(n.val(t),n.data("selectize").setValue(t))})})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),a=r(i),o=n(381),s=r(o);a.default.expr[":"].noparents=a.default.expr.createPseudo(function(e){return function(t){return(0,a.default)(t).parents(e).length<1}}),a.default.fn.slugify=function(e,t){return(void 0).each(function(e){var n=(0,a.default)(e),r=(0,a.default)(r);n.on("keyup change",function(){n.data("locked",""!==n.val()&&void 0!==n.val())}),r.on("keyup change",function(){if(n.data("locked")===!0)return!0;var e=n.is("input")||n.is("textarea");n[e?"val":"text"](a.default.slugify(r.val(),t))})})},a.default.slugify=function(e,t){return t=a.default.extend({},a.default.slugify.options,t),t.lang=t.lang||(0,a.default)("html").prop("lang"),"function"==typeof t.preSlug&&(e=t.preSlug(e)),e=t.slugFunc(e,t),"function"==typeof t.postSlug&&(e=t.postSlug(e)),e},a.default.slugify.options={preSlug:null,postSlug:null,slugFunc:function(e,t){return(0,s.default)(e,t)}}},,function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),a=r(i);(0,a.default)('[data-page-move] button[name="task"][value="save"]').on("click",function(){var e=(0,a.default)('form#blueprints:first select[name="data[route]"]'),t=(0,a.default)("[data-page-move] select").val();if(e.length&&e.val()!==t){var n=e.data("selectize");e.val(t),n&&n.setValue(t)}})},function(e,t,n){(function(e){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}var r=n(1),i=t(r);(0,i.default)('[data-remodal-target="delete"]').on("click",function(){var e=(0,i.default)('[data-remodal-id="delete"] [data-delete-action]'),t=(0,i.default)(this).data("delete-url");e.data("delete-action",t)}),(0,i.default)("[data-delete-action]").on("click",function(){var t=i.default.remodal.lookup[(0,i.default)('[data-remodal-id="delete"]').data("remodal")];e.location.href=(0,i.default)(this).data("delete-action"),t.close()})}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),a=r(i);(0,a.default)(document).on("click",".dz-unset",function(){(0,a.default)(this).closest(".dz-image-preview").remove();var e=(0,a.default)(".files-upload"),t=(0,a.default)(this).closest(".dz-image-preview").find("[data-dz-name]").text().trim(),n=JSON.parse(e.find('input[data-grav-field="hidden"]').val())||{},r={};a.default.each(n,function(e,n){e.endsWith(t)||(r[e]=n)}),e.find('input[data-grav-field="hidden"]').val(JSON.stringify(r))})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),a=r(i);(0,a.default)(".disable-after-click").on("click",function(){(0,a.default)(this).addClass("pointer-events-disabled")})},function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=void 0;var s=function(){function e(e,t){for(var n=0;n\n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    '+m.translations.PLUGIN_ADMIN.DELETE+'\n \n '+m.translations.PLUGIN_ADMIN.VIEW+'\n '+m.translations.PLUGIN_ADMIN.INSERT+"\n ").trim(),b=function(t){function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.container,r=void 0===t?"#grav-dropzone":t,o=e.options,s=void 0===o?{}:o;i(this,n),s=Object.assign(s,{previewTemplate:_});var l=a(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,{container:r,options:s}));if(!l.container.length)return a(l);l.urls={fetch:l.container.data("media-url")+"/task"+m.config.param_sep+"listmedia",add:l.container.data("media-url")+"/task"+m.config.param_sep+"addmedia",delete:l.container.data("media-url")+"/task"+m.config.param_sep+"delmedia"},l.dropzone.options.url=l.urls.add,("undefined"==typeof l.options.fetchMedia||l.options.fetchMedia)&&l.fetchMedia(),("undefined"==typeof l.options.attachDragDrop||l.options.attachDragDrop)&&l.attachDragDrop();var u=(0,c.default)('[name="'+l.container.data("dropzone-field")+'"]');return u.length&&(l.sortable=new y.default(l.container.get(0),{animation:150,setData:function(e,t){t=(0,c.default)(t);var n=encodeURI(t.find(".dz-filename").text()),r=(0,p.UriToMarkdown)(n);l.dropzone.disable(),t.addClass("hide-backface"),e.effectAllowed="copy",e.setData("text",r)},onSort:function(){var e=[];l.container.find("[data-dz-name]").each(function(t,n){n=(0,c.default)(n);var r=n.text().trim();e.push(r)}),u.val(e.join(","))}})),l}return o(n,t),s(n,[{key:"fetchMedia",value:function(){var e=this,t=this.container.closest(".form-field").find('[name="data[header][media_order]"]').val(),n={uri:this.getURI(),order:t},r=this.urls.fetch;(0,d.default)(r,{method:"post",body:n},function(t){var n=t.results;Object.keys(n).forEach(function(t){var r=n[t],i={name:t,size:r.size,accepted:!0,extras:r};e.dropzone.files.push(i),e.dropzone.options.addedfile.call(e.dropzone,i),e.dropzone.options.thumbnail.call(e.dropzone,i,r.url)}),e.container.find(".dz-preview").prop("draggable","true")})}},{key:"onDropzoneSending",value:function(e,t,n){n.append("name",this.options.dotNotation),n.append("admin-nonce",m.config.admin_nonce),n.append("uri",this.getURI())}},{key:"onDropzoneComplete",value:function(e){l(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"onDropzoneComplete",this).call(this,e),this.sortable.options.onSort(),(0,c.default)(".dz-preview").prop("draggable","true")}},{key:"onDropzoneRemovedFile",value:function(e){for(var t,r=arguments.length,i=Array(r>1?r-1:0),a=1;a');var u=s.find(".meta-content").html("
      ").find("ul");Object.keys(o.metadata).forEach(function(e){u.append("
    • "+(e?e+":":"")+" "+o.metadata[e]+"
    • ")}),l.open()}),this.container.delegate(".dz-preview","dragstart",function(e){var n=(0,c.default)(e.currentTarget),r=encodeURI(n.find(".dz-filename").text()),i=(0,p.UriToMarkdown)(r);t.dropzone.disable(),n.addClass("hide-backface"),e.originalEvent.dataTransfer.effectAllowed="copy",e.originalEvent.dataTransfer.setData("text",i)}),this.container.delegate(".dz-preview","dragend",function(e){var n=(0,c.default)(e.currentTarget);t.dropzone.enable(),n.removeClass("hide-backface")})}}]),n}(h.default);t.default=b;t.Instance=new b}).call(t,function(){return this}())},function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return e=e.replace(/@3x|@2x|@1x/,""),e=e.replace(/\(/g,"%28"),e=e.replace(/\)/g,"%29"),e.match(/\.(jpe?g|png|gif|svg|mp4|webm|ogv|mov)$/i)?"![]("+e+")":"["+decodeURI(e)+"]("+e+")"}Object.defineProperty(t,"__esModule",{value:!0}),t.Instances=void 0;var o=function(){function e(e,t){for(var n=0;n"),dictRemoveFileConfirmation:"[placeholder]",previewTemplate:('\n ").trim() -};e.EXIF=d.default;var y=function(e,t,n){var r=n.resolution;return r?void setTimeout(function(){var i="";return r.min&&Object.keys(r.min).forEach(function(t){r.min[t]&&e[t]r.max[t]&&(i+=m.translations.PLUGIN_FORM.RESOLUTION_MAX.replace(/{{attr}}/g,t).replace(/{{max}}/g,r.max[t]))}),i?t(i):t()},50):t()},_=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.container,a=void 0===r?".dropzone.files-upload":r,o=n.options,s=void 0===o?{}:o;i(this,t),this.container=(0,l.default)(a),this.container.length&&(this.urls={},this.options=Object.assign({},v,g,{klass:this,url:this.container.data("file-url-add")||m.config.current_url,acceptedFiles:this.container.data("media-types"),init:this.initDropzone},this.container.data("dropzone-options"),s),this.options=Object.assign({},this.options,{accept:function(e,t){y(e,t,this.options)}}),this.dropzone=new c.default(a,this.options),this.dropzone.on("complete",this.onDropzoneComplete.bind(this)),this.dropzone.on("success",this.onDropzoneSuccess.bind(this)),this.dropzone.on("removedfile",this.onDropzoneRemovedFile.bind(this)),this.dropzone.on("sending",this.onDropzoneSending.bind(this)),this.dropzone.on("error",this.onDropzoneError.bind(this)),this.container.on("mouseenter","[data-dz-view]",function(t){var n=JSON.parse(e.container.find('[name][type="hidden"]').val()||"{}"),r=(0,l.default)(t.currentTarget),i=r.parent(".dz-preview").find(".dz-filename"),a=encodeURI(i.text()),o=Object.keys(n).filter(function(e){return n[e].name===a}).shift();r.attr("href",m.config.base_url_simple+"/"+o)}))}return o(t,[{key:"initDropzone",value:function(){var e=this,t=this.options.klass.container.find("[data-file]"),n=this;t.length&&t.each(function(t,r){r=(0,l.default)(r);var i=r.data("file"),a={name:i.name,size:i.size,type:i.type,status:c.default.ADDED,accepted:!0,url:e.options.url,removeUrl:i.remove};n.files.push(a),n.options.addedfile.call(n,a),a.type.match(/^image\//)&&(n.options.thumbnail.call(n,a,i.path),n.createThumbnailFromUrl(a,i.path)),r.remove()})}},{key:"getURI",value:function(){return this.container.data("mediaUri")||""}},{key:"onDropzoneSending",value:function(e,t,n){n.append("name",this.options.dotNotation),n.append("admin-nonce",m.config.admin_nonce),n.append("task","filesupload"),n.append("uri",this.getURI())}},{key:"onDropzoneSuccess",value:function(t,n,r){if(n="string"==typeof n?JSON.parse(n):n,this.options.reloadPage&&e.location.reload(),n.session){t.sessionParams=n.session,t.removeUrl=this.options.url;var i=this.container.find('[name][type="hidden"]'),a=i.val();i.val(a+" ")}return this.handleError({file:t,data:n,mode:"removeFile",msg:"

      "+m.translations.PLUGIN_ADMIN.FILE_ERROR_UPLOAD+" "+t.name+"

      \n
      "+n.message+"
      "})}},{key:"onDropzoneComplete",value:function(t){if(!t.accepted&&!t.rejected){var n={status:"error",message:m.translations.PLUGIN_ADMIN.FILE_UNSUPPORTED+": "+t.name.match(/\..+/).join("")};return this.handleError({file:t,data:n,mode:"removeFile",msg:"

      "+m.translations.PLUGIN_ADMIN.FILE_ERROR_ADD+" "+t.name+"

      \n
      "+n.message+"
      "})}this.options.reloadPage&&e.location.reload()}},{key:"b64_to_utf8",value:function(e){return e=e.replace(/\s/g,""),decodeURIComponent(escape(window.atob(e)))}},{key:"onDropzoneRemovedFile",value:function(e){var t=this;if(e.accepted&&!e.rejected){var n=e.removeUrl||this.urls.delete,r=(n||"").match(/path:(.*)\//),i={filename:e.name,uri:this.getURI()};e.sessionParams&&(i.task="filessessionremove",i.session=e.sessionParams),(0,h.default)(n,{method:"post",body:i},function(){if(r){r=t.b64_to_utf8(r[1]);var e=t.container.find('[name][type="hidden"]'),n=JSON.parse(e.val()||"{}");delete n[r],e.val(JSON.stringify(n))}})}}},{key:"onDropzoneError",value:function(e,t,n){var r=n?t.error.message:t;return(0,l.default)(e.previewElement).find("[data-dz-errormessage]").html(r),this.handleError({file:e,data:{status:"error"},msg:"
      "+r+"
      "})}},{key:"handleError",value:function(e){var t=e.file,n=e.data,r=e.mode,i=e.msg;if("error"===n.status||"unauthorized"===n.status){switch(r){case"addBack":t instanceof File?this.dropzone.addFile.call(this.dropzone,t):(this.dropzone.files.push(t),this.dropzone.options.addedfile.call(this.dropzone,t),this.dropzone.options.thumbnail.call(this.dropzone,t,t.extras.url));break;case"removeFile":default:~this.dropzone.files.indexOf(t)&&(t.rejected=!0,this.dropzone.removeFile.call(this.dropzone,t,{silent:!0}))}var a=(0,l.default)('[data-remodal-id="generic"]');a.find(".error-content").html(i),l.default.remodal.lookup[a.data("remodal")].open()}}}]),t}();t.default=_;var b=[],w=(0,l.default)(),x=function(e,t){var n=(0,l.default)(t).find(".dropzone.files-upload");n.length&&n.each(function(e,t){t=(0,l.default)(t),~w.index(t)||k(t)})},k=function(e){e=(0,l.default)(e);var t=e.find('input[type="file"]'),n=e.data("grav-file-settings")||{};n.accept&&~n.accept.indexOf("*")&&(n.accept=[""]);var r={url:e.data("file-url-add")||(e.closest("form").attr("action")||m.config.current_url)+".json",paramName:n.paramName||"file",dotNotation:n.name||"file",acceptedFiles:n.accept?n.accept.join(","):t.attr("accept")||e.data("media-types"),maxFilesize:"undefined"!=typeof n.filesize?n.filesize:256,maxFiles:n.limit||null,resizeWidth:n.resizeWidth||null,resizeHeight:n.resizeHeight||null,resizeQuality:n.resizeQuality||null,accept:function(e,t){y(e,t,n)}};w=w.add(e),e=e[0],b.push(new _({container:e,options:r}))};t.Instances=function(){return(0,l.default)(".dropzone.files-upload").each(function(e,t){return k(t)}),(0,l.default)("body").on("mutation._grav",x),b}()}).call(t,function(){return this}())},,,function(e,t,r){var i,a;(function(){function r(e){return!!e.exifdata}function o(e,t){t=t||e.match(/^data\:([^\;]+)\;base64,/im)[1]||"",e=e.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var n=atob(e),r=n.length,i=new ArrayBuffer(r),a=new Uint8Array(i),o=0;o4?p:t+8,o=[],l=0;l4?p:t+8,v(e,a,d-1);case 3:if(1==d)return e.getUint16(t+8,!i);for(a=d>2?p:t+8,o=[],l=0;le.byteLength)return{};var a=d(e,t,t+i,E,r);if(a.Compression)switch(a.Compression){case 6:if(a.JpegIFOffset&&a.JpegIFByteCount){var o=t+a.JpegIFOffset,s=a.JpegIFByteCount;a.blob=new Blob([new Uint8Array(e.buffer,o,s)],{type:"image/jpeg"})}break;case 1:console.log("Thumbnail image format is TIFF, which is not implemented.");break;default:console.log("Unknown thumbnail image format '%s'",a.Compression)}else 2==a.PhotometricInterpretation&&console.log("Thumbnail image format is RGB, which is not implemented.");return a}function v(e,t,r){var i="";for(n=t;n")+8;s=s.substring(s.indexOf("0){t["@attributes"]={};for(var n=0;n0)for(var n=0;n').attr("href",r))}"yaml"===t.mode&&Object.assign(t.extraKeys,{Tab:function(e){e.replaceSelection(" ","end")}});var i=f.default.fromTextArea(e.get(0),t);e.data("codemirror",i),e.data("toolbar",new _(e)),e.addClass("code-mirrored"),t.toolbar===!1&&e.data("toolbar").ui.navigation.addClass("grav-editor-hide-toolbar"),i.on("change",function(){return i.save()})}},{key:"_onAddedNodes",value:function(e,t){var n=this,r=(0,s.default)(t).find("[data-grav-editor]");r.length&&r.each(function(e,t){t=(0,s.default)(t),~n.editors.index(t)||n.addEditor(t)})}}]),e}();t.default=y;var _=t.Toolbar=function(){function e(t){i(this,e),this.editor=(0,s.default)(t),this.codemirror=this.editor.data("codemirror"),this.buttons=u.default.navigation,this.ui={navigation:(0,s.default)(e.templates().navigation)},this.editor.parent(".grav-editor-content").before(this.ui.navigation).after(this.ui.states),this.renderButtons()}return a(e,null,[{key:"templates",value:function(){return{navigation:'\n
      \n
      \n
      \n
      \n '}}}]),a(e,[{key:"renderButtons",value:function(){var e=this,t={actions:"navigation",modes:"states"};["actions","modes"].forEach(function(n){e.ui.navigation.find(".grav-editor-"+n).empty().append("
        "),u.default[t[n]].forEach(function(t){return e.renderButton(t,n)})})}},{key:"renderButton",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;Object.keys(e).forEach(function(i){var a=e[i];if(a.modes||(a.modes=[]),!~n.codemirror.options.ignore.indexOf(i)&&(!a.modes.length||a.modes.indexOf(n.codemirror.options.mode)>-1)){var o=a.title?'data-hint="'+a.title+'"':"",l=(0,s.default)('
      • "+a.label+"
      • ");if((r||n.ui.navigation.find(".grav-editor-"+t+" ul:not(.dropdown-menu)")).append(l),a.shortcut&&n.addShortcut(a.identifier,a.shortcut,l),a.action&&a.action.call(a.action,{codemirror:n.codemirror,button:l,textarea:n.editor,ui:n.ui}),a.children){var u=(0,s.default)('