diff --git a/themes/grav/app/forms/fields/mediapicker.js b/themes/grav/app/forms/fields/mediapicker.js index 4b87024c..789114d6 100644 --- a/themes/grav/app/forms/fields/mediapicker.js +++ b/themes/grav/app/forms/fields/mediapicker.js @@ -8,7 +8,7 @@ $(function() { var thumbscroll = new Scrollbar('.thumbs-list-container .mediapicker-scroll', { autoshow: true }); // Thumb Resizer - $('.media-container .media-range').change(function() { + $('.media-container .media-range').on('input change', function() { var cards = $('.media-container div.card-item'); var width = $(this).val() + 'px'; cards.each(function() { diff --git a/themes/grav/js/admin.min.js b/themes/grav/js/admin.min.js index c7520cdb..46ae8cf8 100644 --- a/themes/grav/js/admin.min.js +++ b/themes/grav/js/admin.min.js @@ -10,7 +10,7 @@ end:t.pos,style:o},t.backUp(c.length-u)),o}var i=e.getMode(t,"text/html"),a=e.ge if(!s)return clearInterval(c)},400);e.on(a,"mouseout",o)}function a(e,t,n){this.marked=[],this.options=t,this.timeout=null,this.hasGutter=n,this.onMouseOver=function(t){g(e,t)},this.waitingFor=0}function o(e,t){return t instanceof Function?{getAnnotations:t}:(t&&t!==!0||(t={}),t)}function s(e){var t=e.state.lint;t.hasGutter&&e.clearGutter(y);for(var n=0;n1,n.options.tooltips))}}r.onUpdateLinting&&r.onUpdateLinting(t,i,e)}function m(e){var t=e.state.lint;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(function(){h(e)},t.options.delay||500))}function v(e,t){for(var n=t.target||t.srcElement,r=document.createDocumentFragment(),a=0;a=0&&_.splice(t,1)}function s(e){var t=document.createElement("style");return t.type="text/css",a(e,t),t}function c(e){var t=document.createElement("link");return t.rel="stylesheet",a(e,t),t}function u(e,t){var n,r,i;if(t.singleton){var a=y++;n=g||(g=s(t)),r=l.bind(null,n,a,!1),i=l.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=c(t),r=d.bind(null,n),i=function(){o(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(t),r=f.bind(null,n),i=function(){o(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}function l(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=b(t,i);else{var a=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function f(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function d(e,t){var n=t.css,r=t.sourceMap;r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var i=new Blob([n],{type:"text/css"}),a=e.href;e.href=URL.createObjectURL(i),a&&URL.revokeObjectURL(a)}var h={},p=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},m=p(function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())}),v=p(function(){return document.head||document.getElementsByTagName("head")[0]}),g=null,y=0,_=[];e.exports=function(e,t){t=t||{},"undefined"==typeof t.singleton&&(t.singleton=m()),"undefined"==typeof t.insertAt&&(t.insertAt="bottom");var n=i(e);return r(n,t),function(e){for(var a=[],o=0;o0){var l=a.character;c.forEach(function(e){l>e&&(l-=1)}),a.character=l}}var f=a.character-1,d=f+1;a.evidence&&(s=a.evidence.substring(f).search(/.\b/),s>-1&&(d+=s)),a.description=a.reason,a.start=a.character,a.end=d,a=n(a),a&&r.push({message:a.description,severity:a.severity,from:e.Pos(a.line-1,f),to:e.Pos(a.line-1,d)})}}}var o=["Dangerous comment"],s=[["Expected '{'","Statement body should be inside '{ }' braces."]],c=["Missing semicolon","Extra comma","Missing property name","Unmatched "," and instead saw"," is not defined","Unclosed string","Stopping, unable to continue"];e.registerHelper("lint","javascript",t)})},function(e,t,n){!function(e){e(n(360))}(function(e){"use strict";e.registerHelper("lint","json",function(t){var n=[];jsonlint.parseError=function(t,r){var i=r.loc;n.push({from:e.Pos(i.first_line-1,i.first_column),to:e.Pos(i.last_line-1,i.last_column),message:t})};try{jsonlint.parse(t)}catch(e){}return n})})},function(e,t,n){!function(e){e(n(360))}(function(e){"use strict";e.registerHelper("lint","yaml",function(t){var n=[];try{jsyaml.load(t)}catch(t){var r=t.mark,i=r?e.Pos(r.line,r.column):e.Pos(0,0),a=i;n.push({from:i,to:a,message:t.message})}return n})})},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)('[name="task"][value="saveas"], [name="task"][value="switchlanguage"]').on("mousedown touchstart",function(e){var t=["lang","redirect"],n=(0,a.default)(e.currentTarget),r=(0,a.default)("#"+n.attr("form"));if(r.length)return t.forEach(function(e){var t=n.attr(e);if(t){var i=r.find('[name="data['+e+']"]');i.length||(i=(0,a.default)(''),r.append(i)),i.val(t)}}),!0})},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(424),a=r(i),o=n(430),s=r(o),c=n(431),u=r(c);t.default={Form:{Form:s.default,Instance:o.Instance},Fields:u.default,FormState:{FormState:a.default,Instance:i.Instance}}},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")}Object.defineProperty(t,"__esModule",{value:!0}),t.DOMBehaviors=t.Instance=void 0;var a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{ignore:[],form_id:"blueprints"};i(this,e),this.options=t,this.refresh(),this.form&&this.fields.length&&(d=this.collect(),this.loadState=d,h.attach())}return a(e,[{key:"refresh",value:function(){return this.form=(0,s.default)("form#"+this.options.form_id).filter(":noparents(.remodal)"),this.fields=(0,s.default)("form#"+this.options.form_id+' *, [form="'+this.options.form_id+'"]').filter(":input:not(.no-form)").filter(":noparents(.remodal)"),this}},{key:"collect",value:function(){var e=this;if(this.form&&this.fields.length){var t={};return this.refresh().fields.each(function(n,r){r=(0,s.default)(r);var i=r.prop("name"),a=r.prop("type"),o=r.prop("tagName").toLowerCase(),c=void 0;if(!i.startsWith("toggleable_")&&"data[lang]"!==i&&"data[redirect]"!==i){switch(a){case"checkbox":c=r.is(":checked");break;case"radio":if(!r.is(":checked"))return;c=r.val();break;default:c=r.val()}"select"===o&&null===c&&(c=""),Array.isArray(c)&&(c=c.join("|")),i&&!~e.options.ignore.indexOf(i)&&(t[i]=c)}}),u.default.OrderedMap(t)}}},{key:"diff",value:function(){return(0,f.default)(d,this.collect())}},{key:"equals",value:function(){return this.form&&this.fields.length?u.default.is(d,this.collect()):null}}]),e}();t.default=p;var m=t.Instance=new p;t.DOMBehaviors=h}).call(t,function(){return this}())},function(e,t,n){!function(t,n){e.exports=n()}(this,function(){"use strict";function e(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function t(e){return a(e)?e:O(e)}function n(e){return o(e)?e:C(e)}function r(e){return s(e)?e:P(e)}function i(e){return a(e)&&!c(e)?e:T(e)}function a(e){return!(!e||!e[un])}function o(e){return!(!e||!e[ln])}function s(e){return!(!e||!e[fn])}function c(e){return o(e)||s(e)}function u(e){return!(!e||!e[dn])}function l(e){return e.value=!1,e}function f(e){e&&(e.value=!0)}function d(){}function h(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),i=0;i>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?p(e)+t:t}function v(){return!0}function g(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function y(e,t){return b(e,t,0)}function _(e,t){return b(e,t,t)}function b(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}function k(e){this.next=e}function x(e,t,n,r){var i=0===e?t:1===e?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function w(){return{value:void 0,done:!0}}function S(e){return!!I(e)}function A(e){return e&&"function"==typeof e.next}function E(e){var t=I(e);return t&&t.call(e)}function I(e){var t=e&&(wn&&e[wn]||e[Sn]);if("function"==typeof t)return t}function M(e){return e&&"number"==typeof e.length}function O(e){return null===e||void 0===e?F():a(e)?e.toSeq():R(e)}function C(e){return null===e||void 0===e?F().toKeyedSeq():a(e)?o(e)?e.toSeq():e.fromEntrySeq():q(e)}function P(e){return null===e||void 0===e?F():a(e)?o(e)?e.entrySeq():e.toIndexedSeq():U(e)}function T(e){return(null===e||void 0===e?F():a(e)?o(e)?e.entrySeq():e:U(e)).toSetSeq()}function j(e){this._array=e,this.size=e.length}function z(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function D(e){this._iterable=e,this.size=e.length||e.size}function L(e){this._iterator=e,this._iteratorCache=[]}function N(e){return!(!e||!e[En])}function F(){return In||(In=new j([]))}function q(e){var t=Array.isArray(e)?new j(e).fromEntrySeq():A(e)?new L(e).fromEntrySeq():S(e)?new D(e).fromEntrySeq():"object"==typeof e?new z(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function U(e){var t=B(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function R(e){var t=B(e)||"object"==typeof e&&new z(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}function B(e){return M(e)?new j(e):A(e)?new L(e):S(e)?new D(e):void 0}function V(e,t,n,r){var i=e._cache;if(i){for(var a=i.length-1,o=0;o<=a;o++){var s=i[n?a-o:o];if(t(s[1],r?s[0]:o,e)===!1)return o+1}return o}return e.__iterateUncached(t,n)}function H(e,t,n,r){var i=e._cache;if(i){var a=i.length-1,o=0;return new k(function(){var e=i[n?a-o:o];return o++>a?w():x(t,r?e[0]:o-1,e[1])})}return e.__iteratorUncached(t,n)}function G(e,t){return t?K(t,e,"",{"":e}):W(e)}function K(e,t,n,r){return Array.isArray(t)?e.call(r,n,P(t).map(function(n,r){return K(e,n,r,t)})):$(t)?e.call(r,n,C(t).map(function(n,r){return K(e,n,r,t)})):t}function W(e){return Array.isArray(e)?P(e).map(W).toList():$(e)?C(e).map(W).toMap():e}function $(e){return e&&(e.constructor===Object||void 0===e.constructor)}function Y(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function J(e,t){if(e===t)return!0;if(!a(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||o(e)!==o(t)||s(e)!==s(t)||u(e)!==u(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!c(e);if(u(e)){var r=e.entries();return t.every(function(e,t){var i=r.next().value;return i&&Y(i[1],e)&&(n||Y(i[0],t))})&&r.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var l=e;e=t,t=l}var f=!0,d=t.__iterate(function(t,r){if(n?!e.has(t):i?!Y(t,e.get(r,gn)):!Y(e.get(r,gn),t))return f=!1,!1});return f&&e.size===d}function X(e,t){if(!(this instanceof X))return new X(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(Mn)return Mn;Mn=this}}function Q(e,t){if(!e)throw new Error(t)}function Z(e,t,n){if(!(this instanceof Z))return new Z(e,t,n);if(Q(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t>>1&1073741824|3221225471&e}function ae(e){if(e===!1||null===e||void 0===e)return 0;if("function"==typeof e.valueOf&&(e=e.valueOf(),e===!1||null===e||void 0===e))return 0;if(e===!0)return 1;var t=typeof e;if("number"===t){if(e!==e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)e/=4294967295,n^=e;return ie(n)}if("string"===t)return e.length>Nn?oe(e):se(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return ce(e);if("function"==typeof e.toString)return se(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function oe(e){var t=Un[e];return void 0===t&&(t=se(e),qn===Fn&&(qn=0,Un={}),qn++,Un[e]=t),t}function se(e){for(var t=0,n=0;n0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}function le(e){Q(e!==1/0,"Cannot perform this action with an infinite size.")}function fe(e){return null===e||void 0===e?xe():de(e)&&!u(e)?e:xe().withMutations(function(t){var r=n(e);le(r.size),r.forEach(function(e,n){return t.set(n,e)})})}function de(e){return!(!e||!e[Rn])}function he(e,t){this.ownerID=e,this.entries=t}function pe(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function me(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function ve(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function ge(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function ye(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&be(e._root)}function _e(e,t){return x(e,t[0],t[1])}function be(e,t){return{node:e,index:0,__prev:t}}function ke(e,t,n,r){var i=Object.create(Bn);return i.size=e,i._root=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function xe(){return Vn||(Vn=ke(0))}function we(e,t,n){var r,i;if(e._root){var a=l(yn),o=l(_n);if(r=Se(e._root,e.__ownerID,0,void 0,t,n,a,o),!o.value)return e;i=e.size+(a.value?n===gn?-1:1:0)}else{if(n===gn)return e;i=1,r=new he(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=i,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?ke(i,r):xe()}function Se(e,t,n,r,i,a,o,s){return e?e.update(t,n,r,i,a,o,s):a===gn?e:(f(s),f(o),new ge(t,r,[i,a]))}function Ae(e){return e.constructor===ge||e.constructor===ve}function Ee(e,t,n,r,i){if(e.keyHash===r)return new ve(t,r,[e.entry,i]);var a,o=(0===n?e.keyHash:e.keyHash>>>n)&vn,s=(0===n?r:r>>>n)&vn,c=o===s?[Ee(e,t,n+pn,r,i)]:(a=new ge(t,r,i),o>>=1)o[s]=1&n?t[a++]:void 0;return o[r]=i,new me(e,a+1,o)}function Ce(e,t,r){for(var i=[],o=0;o>1&1431655765,e=(858993459&e)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,127&e}function Le(e,t,n,r){var i=r?e:h(e);return i[t]=n,i}function Ne(e,t,n,r){var i=e.length+1;if(r&&t+1===i)return e[t]=n,e;for(var a=new Array(i),o=0,s=0;s0&&ia?0:a-n,u=o-n;return u>mn&&(u=mn),function(){if(i===u)return Jn;var e=t?--u:i++;return r&&r[e]}}function i(e,r,i){var s,c=e&&e.array,u=i>a?0:a-i>>r,l=(o-i>>r)+1;return l>mn&&(l=mn),function(){for(;;){if(s){var e=s();if(e!==Jn)return e;s=null}if(u===l)return Jn;var a=t?--l:u++;s=n(c&&c[a],r-pn,i+(a<=e.size||t<0)return e.withMutations(function(e){t<0?Ye(e,t).set(0,n):Ye(e,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,i=e._root,a=l(_n);return t>=Xe(e._capacity)?r=Ke(r,e.__ownerID,0,t,n,a):i=Ke(i,e.__ownerID,e._level,t,n,a),a.value?e.__ownerID?(e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e):Ve(e._origin,e._capacity,e._level,i,r):e}function Ke(e,t,n,r,i,a){var o=r>>>n&vn,s=e&&o0){var u=e&&e.array[o],l=Ke(u,t,n-pn,r,i,a);return l===u?e:(c=We(e,t),c.array[o]=l,c)}return s&&e.array[o]===i?e:(f(a),c=We(e,t),void 0===i&&o===c.array.length-1?c.array.pop():c.array[o]=i,c)}function We(e,t){return t&&e&&t===e.ownerID?e:new Re(e?e.array.slice():[],t)}function $e(e,t){if(t>=Xe(e._capacity))return e._tail;if(t<1<0;)n=n.array[t>>>r&vn],r-=pn;return n}}function Ye(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new d,i=e._origin,a=e._capacity,o=i+t,s=void 0===n?a:n<0?a+n:i+n;if(o===i&&s===a)return e;if(o>=s)return e.clear();for(var c=e._level,u=e._root,l=0;o+l<0;)u=new Re(u&&u.array.length?[void 0,u]:[],r),c+=pn,l+=1<=1<f?new Re([],r):p;if(p&&h>f&&opn;g-=pn){var y=f>>>g&vn;v=v.array[y]=We(v.array[y],r)}v.array[f>>>pn&vn]=p}if(s=h)o-=h,s-=h,c=pn,u=null,m=m&&m.removeBefore(r,0,o);else if(o>i||h>>c&vn;if(_!==h>>>c&vn)break;_&&(l+=(1<i&&(u=u.removeBefore(r,c,o-l)),u&&ho&&(o=u.size),a(c)||(u=u.map(function(e){return G(e)})),i.push(u)}return o>e.size&&(e=e.setSize(o)),je(e,t,i)}function Xe(e){return e>>pn<=mn&&o.size>=2*a.size?(i=o.filter(function(e,t){return void 0!==e&&s!==t}),r=i.toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(r.__ownerID=i.__ownerID=e.__ownerID)):(r=a.remove(t),i=s===o.size-1?o.pop():o.set(s,void 0))}else if(c){if(n===o.get(s)[1])return e;r=a,i=o.set(s,[t,n])}else r=a.set(t,o.size),i=o.set(o.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=i,e.__hash=void 0,e):et(r,i)}function rt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function it(e){this._iter=e,this.size=e.size}function at(e){this._iter=e,this.size=e.size}function ot(e){this._iter=e,this.size=e.size}function st(e){var t=Mt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Ot,t.__iterateUncached=function(t,n){var r=this;return e.__iterate(function(e,n){return t(n,e,r)!==!1},n)},t.__iteratorUncached=function(t,n){if(t===xn){var r=e.__iterator(t,n);return new k(function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e})}return e.__iterator(t===kn?bn:kn,n)},t}function ct(e,t,n){var r=Mt(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,i){var a=e.get(r,gn);return a===gn?i:t.call(n,a,r,e)},r.__iterateUncached=function(r,i){var a=this;return e.__iterate(function(e,i,o){return r(t.call(n,e,i,o),i,a)!==!1},i)},r.__iteratorUncached=function(r,i){var a=e.__iterator(xn,i);return new k(function(){var i=a.next();if(i.done)return i;var o=i.value,s=o[0];return x(r,s,t.call(n,o[1],s,e),i)})},r}function ut(e,t){var n=Mt(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=st(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=Ot,n.__iterate=function(t,n){var r=this;return e.__iterate(function(e,n){return t(e,n,r)},!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function lt(e,t,n,r){var i=Mt(e);return r&&(i.has=function(r){var i=e.get(r,gn);return i!==gn&&!!t.call(n,i,r,e)},i.get=function(r,i){var a=e.get(r,gn);return a!==gn&&t.call(n,a,r,e)?a:i; }),i.__iterateUncached=function(i,a){var o=this,s=0;return e.__iterate(function(e,a,c){if(t.call(n,e,a,c))return s++,i(e,r?a:s-1,o)},a),s},i.__iteratorUncached=function(i,a){var o=e.__iterator(xn,a),s=0;return new k(function(){for(;;){var a=o.next();if(a.done)return a;var c=a.value,u=c[0],l=c[1];if(t.call(n,l,u,e))return x(i,r?u:s++,l,a)}})},i}function ft(e,t,n){var r=fe().asMutable();return e.__iterate(function(i,a){r.update(t.call(n,i,a,e),0,function(e){return e+1})}),r.asImmutable()}function dt(e,t,n){var r=o(e),i=(u(e)?Qe():fe()).asMutable();e.__iterate(function(a,o){i.update(t.call(n,a,o,e),function(e){return e=e||[],e.push(r?[o,a]:a),e})});var a=It(e);return i.map(function(t){return St(e,a(t))})}function ht(e,t,n,r){var i=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=i:n|=0),g(t,n,i))return e;var a=y(t,i),o=_(n,i);if(a!==a||o!==o)return ht(e.toSeq().cacheResult(),t,n,r);var s,c=o-a;c===c&&(s=c<0?0:c);var u=Mt(e);return u.size=0===s?s:e.size&&s||void 0,!r&&N(e)&&s>=0&&(u.get=function(t,n){return t=m(this,t),t>=0&&ts)return w();var e=i.next();return r||t===kn?e:t===bn?x(t,c-1,void 0,e):x(t,c-1,e.value[1],e)})},u}function pt(e,t,n){var r=Mt(e);return r.__iterateUncached=function(r,i){var a=this;if(i)return this.cacheResult().__iterate(r,i);var o=0;return e.__iterate(function(e,i,s){return t.call(n,e,i,s)&&++o&&r(e,i,a)}),o},r.__iteratorUncached=function(r,i){var a=this;if(i)return this.cacheResult().__iterator(r,i);var o=e.__iterator(xn,i),s=!0;return new k(function(){if(!s)return w();var e=o.next();if(e.done)return e;var i=e.value,c=i[0],u=i[1];return t.call(n,u,c,a)?r===xn?e:x(r,c,u,e):(s=!1,w())})},r}function mt(e,t,n,r){var i=Mt(e);return i.__iterateUncached=function(i,a){var o=this;if(a)return this.cacheResult().__iterate(i,a);var s=!0,c=0;return e.__iterate(function(e,a,u){if(!s||!(s=t.call(n,e,a,u)))return c++,i(e,r?a:c-1,o)}),c},i.__iteratorUncached=function(i,a){var o=this;if(a)return this.cacheResult().__iterator(i,a);var s=e.__iterator(xn,a),c=!0,u=0;return new k(function(){var e,a,l;do{if(e=s.next(),e.done)return r||i===kn?e:i===bn?x(i,u++,void 0,e):x(i,u++,e.value[1],e);var f=e.value;a=f[0],l=f[1],c&&(c=t.call(n,l,a,o))}while(c);return i===xn?e:x(i,a,l,e)})},i}function vt(e,t){var r=o(e),i=[e].concat(t).map(function(e){return a(e)?r&&(e=n(e)):e=r?q(e):U(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===i.length)return e;if(1===i.length){var c=i[0];if(c===e||r&&o(c)||s(e)&&s(c))return c}var u=new j(i);return r?u=u.toKeyedSeq():s(e)||(u=u.toSetSeq()),u=u.flatten(!0),u.size=i.reduce(function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}},0),u}function gt(e,t,n){var r=Mt(e);return r.__iterateUncached=function(r,i){function o(e,u){var l=this;e.__iterate(function(e,i){return(!t||u0}function wt(e,n,r){var i=Mt(e);return i.size=new j(r).map(function(e){return e.size}).min(),i.__iterate=function(e,t){for(var n,r=this.__iterator(kn,t),i=0;!(n=r.next()).done&&e(n.value,i++,this)!==!1;);return i},i.__iteratorUncached=function(e,i){var a=r.map(function(e){return e=t(e),E(i?e.reverse():e)}),o=0,s=!1;return new k(function(){var t;return s||(t=a.map(function(e){return e.next()}),s=t.some(function(e){return e.done})),s?w():x(e,o++,n.apply(null,t.map(function(e){return e.value})))})},i}function St(e,t){return N(e)?t:e.constructor(t)}function At(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Et(e){return le(e.size),p(e)}function It(e){return o(e)?n:s(e)?r:i}function Mt(e){return Object.create((o(e)?C:s(e)?P:T).prototype)}function Ot(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):O.prototype.cacheResult.call(this)}function Ct(e,t){return e>t?1:et?-1:0}function an(e){if(e.size===1/0)return 0;var t=u(e),n=o(e),r=t?1:0,i=e.__iterate(n?t?function(e,t){r=31*r+sn(ae(e),ae(t))|0}:function(e,t){r=r+sn(ae(e),ae(t))|0}:t?function(e){r=31*r+ae(e)|0}:function(e){r=r+ae(e)|0});return on(i,r)}function on(e,t){return t=Pn(t,3432918353),t=Pn(t<<15|t>>>-15,461845907),t=Pn(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=Pn(t^t>>>16,2246822507),t=Pn(t^t>>>13,3266489909),t=ie(t^t>>>16)}function sn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}var cn=Array.prototype.slice;e(n,t),e(r,t),e(i,t),t.isIterable=a,t.isKeyed=o,t.isIndexed=s,t.isAssociative=c,t.isOrdered=u,t.Keyed=n,t.Indexed=r,t.Set=i;var un="@@__IMMUTABLE_ITERABLE__@@",ln="@@__IMMUTABLE_KEYED__@@",fn="@@__IMMUTABLE_INDEXED__@@",dn="@@__IMMUTABLE_ORDERED__@@",hn="delete",pn=5,mn=1<r?w():x(e,i,n[t?r-i++:i++])})},e(z,C),z.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},z.prototype.has=function(e){return this._object.hasOwnProperty(e)},z.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,i=r.length-1,a=0;a<=i;a++){var o=r[t?i-a:a];if(e(n[o],o,this)===!1)return a+1}return a},z.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,i=r.length-1,a=0;return new k(function(){var o=r[t?i-a:a];return a++>i?w():x(e,o,n[o])})},z.prototype[dn]=!0,e(D,P),D.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=this._iterable,r=E(n),i=0;if(A(r))for(var a;!(a=r.next()).done&&e(a.value,i++,this)!==!1;);return i},D.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterable,r=E(n);if(!A(r))return new k(w);var i=0;return new k(function(){var t=r.next();return t.done?t:x(e,i++,t.value)})},e(L,P),L.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n=this._iterator,r=this._iteratorCache,i=0;i=r.length){var t=n.next();if(t.done)return t;r[i]=t.value}return x(e,i,r[i++])})};var In;e(X,P),X.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},X.prototype.get=function(e,t){return this.has(e)?this._value:t},X.prototype.includes=function(e){return Y(this._value,e)},X.prototype.slice=function(e,t){var n=this.size;return g(e,t,n)?this:new X(this._value,_(t,n)-y(e,n))},X.prototype.reverse=function(){return this},X.prototype.indexOf=function(e){return Y(this._value,e)?0:-1},X.prototype.lastIndexOf=function(e){return Y(this._value,e)?this.size:-1},X.prototype.__iterate=function(e,t){for(var n=0;n=0&&t=0&&nn?w():x(e,a++,o)})},Z.prototype.equals=function(e){return e instanceof Z?this._start===e._start&&this._end===e._end&&this._step===e._step:J(this,e)};var On;e(ee,t),e(te,ee),e(ne,ee),e(re,ee),ee.Keyed=te,ee.Indexed=ne,ee.Set=re;var Cn,Pn="function"==typeof Math.imul&&Math.imul(4294967295,2)===-2?Math.imul:function(e,t){e|=0,t|=0;var n=65535&e,r=65535&t;return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0},Tn=Object.isExtensible,jn=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}(),zn="function"==typeof WeakMap;zn&&(Cn=new WeakMap);var Dn=0,Ln="__immutablehash__";"function"==typeof Symbol&&(Ln=Symbol(Ln));var Nn=16,Fn=255,qn=0,Un={};e(fe,te),fe.of=function(){var e=cn.call(arguments,0);return xe().withMutations(function(t){for(var n=0;n=e.length)throw new Error("Missing value for key: "+e[n]);t.set(e[n],e[n+1])}})},fe.prototype.toString=function(){return this.__toString("Map {","}")},fe.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},fe.prototype.set=function(e,t){return we(this,e,t)},fe.prototype.setIn=function(e,t){return this.updateIn(e,gn,function(){return t})},fe.prototype.remove=function(e){return we(this,e,gn)},fe.prototype.deleteIn=function(e){return this.updateIn(e,function(){return gn})},fe.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},fe.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=ze(this,Pt(e),t,n);return r===gn?void 0:r},fe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):xe()},fe.prototype.merge=function(){return Ce(this,void 0,arguments)},fe.prototype.mergeWith=function(e){var t=cn.call(arguments,1);return Ce(this,e,t)},fe.prototype.mergeIn=function(e){var t=cn.call(arguments,1);return this.updateIn(e,xe(),function(e){return"function"==typeof e.merge?e.merge.apply(e,t):t[t.length-1]})},fe.prototype.mergeDeep=function(){return Ce(this,Pe,arguments)},fe.prototype.mergeDeepWith=function(e){var t=cn.call(arguments,1);return Ce(this,Te(e),t)},fe.prototype.mergeDeepIn=function(e){var t=cn.call(arguments,1);return this.updateIn(e,xe(),function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,t):t[t.length-1]})},fe.prototype.sort=function(e){return Qe(bt(this,e))},fe.prototype.sortBy=function(e,t){return Qe(bt(this,t,e))},fe.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},fe.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new d)},fe.prototype.asImmutable=function(){return this.__ensureOwner()},fe.prototype.wasAltered=function(){return this.__altered},fe.prototype.__iterator=function(e,t){return new ye(this,e,t)},fe.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate(function(t){return r++,e(t[1],t[0],n)},t),r},fe.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?ke(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},fe.isMap=de;var Rn="@@__IMMUTABLE_MAP__@@",Bn=fe.prototype;Bn[Rn]=!0,Bn[hn]=Bn.remove,Bn.removeIn=Bn.deleteIn,he.prototype.get=function(e,t,n,r){for(var i=this.entries,a=0,o=i.length;a=Hn)return Ie(e,c,r,i);var p=e&&e===this.ownerID,m=p?c:h(c);return d?s?u===l-1?m.pop():m[u]=m.pop():m[u]=[r,i]:m.push([r,i]),p?(this.entries=m,this):new he(e,m)}},pe.prototype.get=function(e,t,n,r){void 0===t&&(t=ae(n));var i=1<<((0===e?t:t>>>e)&vn),a=this.bitmap;return 0===(a&i)?r:this.nodes[De(a&i-1)].get(e+pn,t,n,r)},pe.prototype.update=function(e,t,n,r,i,a,o){void 0===n&&(n=ae(r));var s=(0===t?n:n>>>t)&vn,c=1<=Gn)return Oe(e,d,u,s,p);if(l&&!p&&2===d.length&&Ae(d[1^f]))return d[1^f];if(l&&p&&1===d.length&&Ae(p))return p;var m=e&&e===this.ownerID,v=l?p?u:u^c:u|c,g=l?p?Le(d,f,p,m):Fe(d,f,m):Ne(d,f,p,m);return m?(this.bitmap=v,this.nodes=g,this):new pe(e,v,g)},me.prototype.get=function(e,t,n,r){void 0===t&&(t=ae(n));var i=(0===e?t:t>>>e)&vn,a=this.nodes[i];return a?a.get(e+pn,t,n,r):r},me.prototype.update=function(e,t,n,r,i,a,o){void 0===n&&(n=ae(r));var s=(0===t?n:n>>>t)&vn,c=i===gn,u=this.nodes,l=u[s];if(c&&!l)return this;var f=Se(l,e,t+pn,n,r,i,a,o);if(f===l)return this;var d=this.count;if(l){if(!f&&(d--,d=0&&e>>t&vn;if(r>=this.array.length)return new Re([],e);var i,a=0===r;if(t>0){var o=this.array[r];if(i=o&&o.removeBefore(e,t-pn,n),i===o&&a)return this}if(a&&!i)return this;var s=We(this,e);if(!a)for(var c=0;c>>t&vn;if(r>=this.array.length)return this;var i;if(t>0){var a=this.array[r];if(i=a&&a.removeAfter(e,t-pn,n),i===a&&r===this.array.length-1)return this}var o=We(this,e);return o.array.splice(r+1),i&&(o.array[r]=i),o};var Yn,Jn={};e(Qe,fe),Qe.of=function(){return this(arguments)},Qe.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Qe.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Qe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):tt()},Qe.prototype.set=function(e,t){return nt(this,e,t)},Qe.prototype.remove=function(e){return nt(this,e,gn)},Qe.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Qe.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate(function(t){return t&&e(t[1],t[0],n)},t)},Qe.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Qe.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?et(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Qe.isOrderedMap=Ze,Qe.prototype[dn]=!0,Qe.prototype[hn]=Qe.prototype.remove;var Xn;e(rt,C),rt.prototype.get=function(e,t){return this._iter.get(e,t)},rt.prototype.has=function(e){return this._iter.has(e)},rt.prototype.valueSeq=function(){return this._iter.valueSeq()},rt.prototype.reverse=function(){var e=this,t=ut(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},rt.prototype.map=function(e,t){var n=this,r=ct(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},rt.prototype.__iterate=function(e,t){var n,r=this;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?Et(this):0,function(i){return e(i,t?--n:n++,r)}),t)},rt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(kn,t),r=t?Et(this):0;return new k(function(){var i=n.next();return i.done?i:x(e,t?--r:r++,i.value,i)})},rt.prototype[dn]=!0,e(it,P),it.prototype.includes=function(e){return this._iter.includes(e)},it.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate(function(t){return e(t,r++,n)},t)},it.prototype.__iterator=function(e,t){var n=this._iter.__iterator(kn,t),r=0;return new k(function(){var t=n.next();return t.done?t:x(e,r++,t.value,t)})},e(at,T),at.prototype.has=function(e){return this._iter.includes(e)},at.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){return e(t,t,n)},t)},at.prototype.__iterator=function(e,t){var n=this._iter.__iterator(kn,t);return new k(function(){var t=n.next();return t.done?t:x(e,t.value,t.value,t)})},e(ot,C),ot.prototype.entrySeq=function(){return this._iter.toSeq()},ot.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){if(t){At(t);var r=a(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}},t)},ot.prototype.__iterator=function(e,t){var n=this._iter.__iterator(kn,t);return new k(function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){At(r);var i=a(r);return x(e,i?r.get(0):r[0],i?r.get(1):r[1],t)}}})},it.prototype.cacheResult=rt.prototype.cacheResult=at.prototype.cacheResult=ot.prototype.cacheResult=Ot,e(Tt,te),Tt.prototype.toString=function(){return this.__toString(zt(this)+" {","}")},Tt.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},Tt.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},Tt.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=jt(this,xe()))},Tt.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+zt(this));if(this._map&&!this._map.has(e)){var n=this._defaultValues[e];if(t===n)return this}var r=this._map&&this._map.set(e,t);return this.__ownerID||r===this._map?this:jt(this,r)},Tt.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:jt(this,t)},Tt.prototype.wasAltered=function(){return this._map.wasAltered()},Tt.prototype.__iterator=function(e,t){var r=this;return n(this._defaultValues).map(function(e,t){return r.get(t)}).__iterator(e,t)},Tt.prototype.__iterate=function(e,t){var r=this;return n(this._defaultValues).map(function(e,t){return r.get(t)}).__iterate(e,t)},Tt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?jt(this,t,e):(this.__ownerID=e,this._map=t,this)};var Qn=Tt.prototype;Qn[hn]=Qn.remove,Qn.deleteIn=Qn.removeIn=Bn.removeIn,Qn.merge=Bn.merge,Qn.mergeWith=Bn.mergeWith,Qn.mergeIn=Bn.mergeIn,Qn.mergeDeep=Bn.mergeDeep,Qn.mergeDeepWith=Bn.mergeDeepWith,Qn.mergeDeepIn=Bn.mergeDeepIn,Qn.setIn=Bn.setIn,Qn.update=Bn.update,Qn.updateIn=Bn.updateIn,Qn.withMutations=Bn.withMutations,Qn.asMutable=Bn.asMutable,Qn.asImmutable=Bn.asImmutable,e(Nt,re),Nt.of=function(){return this(arguments)},Nt.fromKeys=function(e){return this(n(e).keySeq())},Nt.prototype.toString=function(){return this.__toString("Set {","}")},Nt.prototype.has=function(e){return this._map.has(e)},Nt.prototype.add=function(e){return qt(this,this._map.set(e,!0))},Nt.prototype.remove=function(e){return qt(this,this._map.remove(e))},Nt.prototype.clear=function(){return qt(this,this._map.clear())},Nt.prototype.union=function(){var e=cn.call(arguments,0);return e=e.filter(function(e){return 0!==e.size}),0===e.length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations(function(t){for(var n=0;n=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):$t(e,t)},Kt.prototype.pushAll=function(e){if(e=r(e),0===e.size)return this;le(e.size);var t=this.size,n=this._head;return e.reverse().forEach(function(e){t++,n={value:e,next:n}}),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):$t(t,n)},Kt.prototype.pop=function(){return this.slice(1)},Kt.prototype.unshift=function(){return this.push.apply(this,arguments)},Kt.prototype.unshiftAll=function(e){return this.pushAll(e)},Kt.prototype.shift=function(){return this.pop.apply(this,arguments)},Kt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Yt()},Kt.prototype.slice=function(e,t){if(g(e,t,this.size))return this;var n=y(e,this.size),r=_(t,this.size);if(r!==this.size)return ne.prototype.slice.call(this,e,t);for(var i=this.size-n,a=this._head;n--;)a=a.next;return this.__ownerID?(this.size=i, this._head=a,this.__hash=void 0,this.__altered=!0,this):$t(i,a)},Kt.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?$t(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Kt.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&e(r.value,n++,this)!==!1;)r=r.next;return n},Kt.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new k(function(){if(r){var t=r.value;return r=r.next,x(e,n++,t)}return w()})},Kt.isStack=Wt;var ir="@@__IMMUTABLE_STACK__@@",ar=Kt.prototype;ar[ir]=!0,ar.withMutations=Bn.withMutations,ar.asMutable=Bn.asMutable,ar.asImmutable=Bn.asImmutable,ar.wasAltered=Bn.wasAltered;var or;t.Iterator=k,Jt(t,{toArray:function(){le(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate(function(t,n){e[n]=t}),e},toIndexedSeq:function(){return new it(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new rt(this,!0)},toMap:function(){return fe(this.toKeyedSeq())},toObject:function(){le(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e},toOrderedMap:function(){return Qe(this.toKeyedSeq())},toOrderedSet:function(){return Bt(o(this)?this.valueSeq():this)},toSet:function(){return Nt(o(this)?this.valueSeq():this)},toSetSeq:function(){return new at(this)},toSeq:function(){return s(this)?this.toIndexedSeq():o(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Kt(o(this)?this.valueSeq():this)},toList:function(){return qe(o(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){var e=cn.call(arguments,0);return St(this,vt(this,e))},includes:function(e){return this.some(function(t){return Y(t,e)})},entries:function(){return this.__iterator(xn)},every:function(e,t){le(this.size);var n=!0;return this.__iterate(function(r,i,a){if(!e.call(t,r,i,a))return n=!1,!1}),n},filter:function(e,t){return St(this,lt(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return le(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){le(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate(function(r){n?n=!1:t+=e,t+=null!==r&&void 0!==r?r.toString():""}),t},keys:function(){return this.__iterator(bn)},map:function(e,t){return St(this,ct(this,e,t))},reduce:function(e,t,n){le(this.size);var r,i;return arguments.length<2?i=!0:r=t,this.__iterate(function(t,a,o){i?(i=!1,r=t):r=e.call(n,r,t,a,o)}),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return St(this,ut(this,!0))},slice:function(e,t){return St(this,ht(this,e,t,!0))},some:function(e,t){return!this.every(Zt(e),t)},sort:function(e){return St(this,bt(this,e))},values:function(){return this.__iterator(kn)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(e,t){return p(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return ft(this,e,t)},equals:function(e){return J(this,e)},entrySeq:function(){var e=this;if(e._cache)return new j(e._cache);var t=e.toSeq().map(Qt).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Zt(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate(function(n,i,a){if(e.call(t,n,i,a))return r=[i,n],!1}),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(v)},flatMap:function(e,t){return St(this,yt(this,e,t))},flatten:function(e){return St(this,gt(this,e,!0))},fromEntrySeq:function(){return new ot(this)},get:function(e,t){return this.find(function(t,n){return Y(n,e)},void 0,t)},getIn:function(e,t){for(var n,r=this,i=Pt(e);!(n=i.next()).done;){var a=n.value;if(r=r&&r.get?r.get(a,gn):gn,r===gn)return t}return r},groupBy:function(e,t){return dt(this,e,t)},has:function(e){return this.get(e,gn)!==gn},hasIn:function(e){return this.getIn(e,gn)!==gn},isSubset:function(e){return e="function"==typeof e.includes?e:t(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return e="function"==typeof e.isSubset?e:t(e),e.isSubset(this)},keyOf:function(e){return this.findKey(function(t){return Y(t,e)})},keySeq:function(){return this.toSeq().map(Xt).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return kt(this,e)},maxBy:function(e,t){return kt(this,t,e)},min:function(e){return kt(this,e?en(e):rn)},minBy:function(e,t){return kt(this,t?en(t):rn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return St(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return St(this,mt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Zt(e),t)},sortBy:function(e,t){return St(this,bt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return St(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return St(this,pt(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Zt(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=an(this))}});var sr=t.prototype;sr[un]=!0,sr[An]=sr.values,sr.__toJS=sr.toArray,sr.__toStringMapper=tn,sr.inspect=sr.toSource=function(){return this.toString()},sr.chain=sr.flatMap,sr.contains=sr.includes,Jt(n,{flip:function(){return St(this,st(this))},mapEntries:function(e,t){var n=this,r=0;return St(this,this.toSeq().map(function(i,a){return e.call(t,[a,i],r++,n)}).fromEntrySeq())},mapKeys:function(e,t){var n=this;return St(this,this.toSeq().flip().map(function(r,i){return e.call(t,r,i,n)}).flip())}});var cr=n.prototype;cr[ln]=!0,cr[An]=sr.entries,cr.__toJS=sr.toObject,cr.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+tn(e)},Jt(r,{toKeyedSeq:function(){return new rt(this,!1)},filter:function(e,t){return St(this,lt(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return St(this,ut(this,!1))},slice:function(e,t){return St(this,ht(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=y(e,e<0?this.count():this.size);var r=this.slice(0,e);return St(this,1===n?r:r.concat(h(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return St(this,gt(this,e,!1))},get:function(e,t){return e=m(this,e),e<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find(function(t,n){return n===e},void 0,t)},has:function(e){return e=m(this,e),e>=0&&(void 0!==this.size?this.size===1/0||e=1e4)return d(e,t,n);var c=a.diff(e,t),f=0;return c.forEach(function(e){if("="===e.op)f++;else if("!="===e.op){if(l(e.val)&&l(e.newVal)){var t=d(e.val,e.newVal,s(o,f));i=i.concat(t)}else i.push(u("replace",s(o,f),e.newVal));f++}else"+"===e.op?(i.push(u("add",s(o,f),e.val)),f++):"-"===e.op&&i.push(u("remove",s(o,f)))}),i},p=function(e,t,n){var r=n||"";return e===t?[]:[u("replace",s(r,""),t)]},m=function(e,t,n){return r.is(e,t)?r.List():e==t||null!=e&&null!=t?f(e)&&f(t)?r.fromJS(h(e,t)):l(e)&&l(t)?r.fromJS(d(e,t)):r.fromJS(p(e,t,n)):r.fromJS([u("replace","/",t)])};e.exports=m},function(e,t,n){"use strict";var r=n(425),i=function(e){return r.Iterable.isKeyed(e)},a=function(e){return r.Iterable.isIndexed(e)},o=function(e,t,n){return"remove"===e?{op:e,path:t}:{op:e,path:t,value:n}};e.exports={isMap:i,isIndexed:a,op:o}},function(e,t,n){"use strict";function r(e,t){for(var n=e.size||0,r=t.size||0,o=a(n+1,r+1,0),s=0;s=0||l>=0;)u>=0&&l>=0&&i.is(t.get(u),n.get(l))?(o.push(new s({op:"=",val:t.get(u)})),u-=1,l-=1):u>=0&&l>=0&&u===l&&!i.is(t.get(u),n.get(l))?(o.push(new c({val:t.get(u),newVal:n.get(u)})),u-=1,l-=1):l>=0&&(u===-1||e[u+1][l]>=e[u][l+1])?(o.push(new s({op:"+",val:n.get(l)})),l-=1):u>=0&&(l===-1||e[u+1][l]');n.append(i)}),e=!0,!0)})})}},{key:"addedNodes",value:function(e){var t=this;e.forEach(function(e){"childList"===e.type&&e.addedNodes&&(0,s.default)("body").trigger("mutation._grav",e.target,e,t)})}}]),t}();t.default=c;t.Instance=new c("form#blueprints")}).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(432),a=r(i),o=n(433),s=r(o),c=n(434),u=r(c),l=n(435),f=r(l),d=n(436),h=r(d),p=n(358),m=r(p),v=n(555),g=r(v),y=n(355),_=r(y),b=n(560),k=r(b),x=n(563),w=r(x);t.default={FilepickerField:{FilepickerField:a.default,Instance:i.Instance},SelectizeField:{SelectizeField:s.default,Instance:o.Instance},ArrayField:{ArrayField:u.default,Instance:c.Instance},CollectionsField:{CollectionsField:f.default,Instance:l.Instance},DateTimeField:{DateTimeField:h.default,Instance:d.Instance},EditorField:{EditorField:m.default,Instance:p.Instance},ColorpickerField:{ColorpickerField:g.default,Instance:v.Instance},FilesField:{FilesField:_.default,Instance:y.Instance},SelectUniqueField:{SelectUniqueField:w.default,Instance:x.Instance},MediapickerField:{MediapickerField:k.default,Instance:b.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(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"all",r=c.config.current_url+(".json/task"+c.config.param_sep+"getFilesInFolder"),o=e.closest("[data-grav-filepicker]"),s=o.data("name"),u=o.data("value");(0,l.default)(r,{method:"post",body:{name:s}},function(e){if("undefined"!=typeof e.files){var r=[];a=e.thumbs||{};for(var o=0;o0,d=!1,h=function(e,t){var n="";if(u&&i&&(!e.status||"available"===e.status)&&e.name.match(/\.(jpg|jpeg|png|gif)$/i)){var r=f(c.config.base_url_relative+"/../"+i+"/"+e.name,-4,"@2x"),o=f(c.config.base_url_relative+"/../"+i+"/"+e.name,-4,"@3x"),s=a[e.name]||c.config.base_url_relative+"/../"+i+"/"+e.name;n='\n "}return'
\n \n '+n+' '+t(e.name)+"\n \n
"};r.selectize({valueField:"name",labelField:"name",searchField:"name",optgroups:[{$order:1,value:"pending",label:"Pending"},{$order:2,value:"available",label:"Available"}],optgroupField:"status",create:!1,preload:!1,render:{option:function(e,t){return h(e,t)},item:function(e,t){return h(e,t)}},onInitialize:function(){this.load(function(e){return o(r,function(t){return e(t)},"selected")})},onLoad:function(){if(!d){var e=this.getValue();this.updateOption(e,{name:e}),d=!0}},onFocus:function(){this.load(function(e){return o(r,function(t){return e(t)})})}})}}}]),e}();t.default=d;t.Instance=new d},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]:{};i(this,e),this.options=Object.assign({},n),this.elements=[],(0,s.default)("[data-grav-selectize]").each(function(e,n){return t.add(n)}),(0,s.default)("body").on("mutation._grav",this._onAddedNodes.bind(this))}return a(e,[{key:"add",value:function(e){e=(0,s.default)(e);var t=e.prop("tagName").toLowerCase(),n="input"===t||"select"===t,r=(n?e.closest("[data-grav-selectize]"):e).data("grav-selectize")||{},i=n?e:e.find("input, select");i.length&&!i.get(0).selectize&&(i.selectize(r),this.elements.push(i.data("selectize")))}},{key:"_onAddedNodes",value:function(e,t){var n=this,r=(0,s.default)(t).find("select.fancy, input.fancy, [data-grav-selectize]");r.length&&r.each(function(e,t){return n.add(t)})}}]),e}();t.default=c;t.Instance=new c},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;n\n \n \n ':'\n
\n \n \n \n ',e+='\n \n \n
'}}]),e}(),d=function(){function e(){var t=this;i(this,e),l.on("input",'[data-grav-array-type="key"], [data-grav-array-type="value"]',function(e){return t.actionInput(e)}),l.on("click touch",'[data-grav-array-action]:not([data-grav-array-action="sort"])',function(e){return t.actionEvent(e)}),this.arrays=(0,s.default)(),(0,s.default)('[data-grav-field="array"]').each(function(e,n){return t.addArray(n)}),(0,s.default)("body").on("mutation._grav",this._onAddedNodes.bind(this))}return a(e,[{key:"addArray",value:function(e){e=(0,s.default)(e),e.find('[data-grav-array-type="container"]').each(function(e,t){t=(0,s.default)(t),t.data("array-sort")||t[0].hasAttribute("data-array-nosort")||t.data("array-sort",new u.default(t.get(0),{handle:".fa-bars",animation:150}))})}},{key:"actionInput",value:function(e){var t=(0,s.default)(e.target),n=t.data("grav-array-type");this._setTemplate(t);var r=t.data("array-template"),i="key"===n?t:t.siblings('[data-grav-array-type="key"]:first'),a="value"===n?t:t.siblings('[data-grav-array-type="value"]:first'),o=r.isValueOnly()?this.getIndexFor(t):i.val();o=o.toString().replace(/\[/g,"%5B").replace(/]/g,"%5D");var c=r.getName()+"["+o+"]";a.attr("name",a.val()?c:r.getName()),this.refreshNames(r)}},{key:"actionEvent",value:function(e){e&&e.preventDefault();var t=(0,s.default)(e.target),n=t.data("grav-array-action"),r=t.parents('[data-grav-array-type="container"]');this._setTemplate(t),this[n+"Action"](t);var i=r.find("> div");r[i.length>1?"removeClass":"addClass"]("one-child")}},{key:"addAction",value:function(e){var t=e.data("array-template"),n=e.closest('[data-grav-array-type="row"]');n.after(t.getNewRow())}},{key:"remAction",value:function(e){var t=e.data("array-template"),n=e.closest('[data-grav-array-type="row"]'),r=!n.siblings().length;if(r){var i=(0,s.default)(t.getNewRow());n.after(i),i.find('[data-grav-array-type="value"]:last').attr("name",t.getName())}n.remove(),this.refreshNames(t)}},{key:"refreshNames",value:function(e){if(e.isValueOnly()){var t=e.container.find('> div > [data-grav-array-type="row"]'),n=t.find('[name]:not([name=""])');n.each(function(e,t){t=(0,s.default)(t);var n=t.attr("name");n=n.replace(/\[\d+\]$/,"["+e+"]"),t.attr("name",n)}),n.length||t.find('[data-grav-array-type="value"]').attr("name",e.getName())}}},{key:"getIndexFor",value:function(e){var t=e.data("array-template"),n=e.closest('[data-grav-array-type="row"]');return t.container.find((t.isValueOnly()?"> div ":"")+' > [data-grav-array-type="row"]').index(n)}},{key:"_setTemplate",value:function(e){e.data("array-template")||e.data("array-template",new f(e.closest("[data-grav-array-name]")))}},{key:"_onAddedNodes",value:function(e,t){var n=this,r=(0,s.default)(t).find('[data-grav-field="array"]');r.length&&r.each(function(e,t){t=(0,s.default)(t),~n.arrays.index(t)||n.addArray(t)})}}]),e}();t.default=d;t.Instance=new d},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;n .collection-actions [data-action="add"]',function(e){return t.addItem(e)}),e.on("click",'> ul > li > .item-actions [data-action="delete"]',function(e){return t.removeItem(e)}),e.on("click",'> ul > li > .item-actions [data-action="collapse"]',function(e){return t.collapseItem(e)}),e.on("click",'> ul > li > .item-actions [data-action="expand"]',function(e){return t.expandItem(e)}),e.on("click",'> .collection-actions [data-action-sort="date"]',function(e){return t.sortItems(e)}),e.on("click",'> .collection-actions [data-action="collapse_all"]',function(e){return t.collapseItems(e)}),e.on("click",'> .collection-actions [data-action="expand_all"]',function(e){return t.expandItems(e)}),e.on("input change","[data-key-observe]",function(e){return t.observeKey(e)}),e.find("[data-collection-holder]").each(function(e,n){n=(0,s.default)(n),n.data("collection-sort")||n[0].hasAttribute("data-collection-nosort")||n.data("collection-sort",new u.default(n.get(0),{forceFallback:!1,handle:".collection-sort",animation:150,filter:".CodeMirror, .grav-editor-resizer",onUpdate:function(){return t.reindex(n)}}))}),this._updateActionsStateBasedOnMinMax(e)}},{key:"addItem",value:function(e){var t=(0,s.default)(e.currentTarget),n=t.data("action-add")||"bottom",r=(0,s.default)(t.closest('[data-type="collection"]')),i=(0,s.default)(r.find('> [data-collection-template="new"]').data("collection-template-html"));this._updateActionsStateBasedOnMinMax(r);var a=r.closest('[data-type="collection"]').find("> ul > [data-collection-item]"),o=r.data("max");if(!("undefined"!=typeof o&&a.length>=o)){r.find("> [data-collection-holder]")["top"===n?"prepend":"append"](i),this.reindex(r),a=r.closest('[data-type="collection"]').find("> ul > [data-collection-item]");var c=r.closest('[data-type="collection"]').find('[data-action-add="top"]'),u=r.closest('[data-type="collection"]').find('[data-action="sort"]');a.length&&(c.length&&c.parent().removeClass("hidden"),u.length&&a.length>1&&u.removeClass("hidden")),(0,s.default)('[data-grav-field="toggleable"] input[type="checkbox"]').trigger("change")}}},{key:"removeItem",value:function(e){var t=(0,s.default)(e.currentTarget),n=t.closest("[data-collection-item]"),r=(0,s.default)(t.closest('[data-type="collection"]'));this._updateActionsStateBasedOnMinMax(r);var i=r.closest('[data-type="collection"]').find("> ul > [data-collection-item]"),a=r.data("min");if(!("undefined"!=typeof a&&i.length<=a)){n.remove(),this.reindex(r),i=r.closest('[data-type="collection"]').find("> ul > [data-collection-item]");var o=r.closest('[data-type="collection"]').find('[data-action-add="top"]'),c=r.closest('[data-type="collection"]').find('[data-action="sort"]');i.length||o.length&&o.parent().addClass("hidden"),c.length&&i.length<=1&&c.addClass("hidden")}}},{key:"collapseItems",value:function(e){var t=(0,s.default)(e.currentTarget),n=(0,s.default)(t.closest('[data-type="collection"]')).find('> ul > [data-collection-item] > .item-actions [data-action="collapse"]');n.click()}},{key:"collapseItem",value:function(e){var t=(0,s.default)(e.currentTarget),n=t.closest("[data-collection-item]");t.attr("data-action","expand").removeClass("fa-chevron-circle-down").addClass("fa-chevron-circle-right"),n.addClass("collection-collapsed")}},{key:"expandItems",value:function(e){var t=(0,s.default)(e.currentTarget),n=(0,s.default)(t.closest('[data-type="collection"]')).find('> ul > [data-collection-item] > .item-actions [data-action="expand"]');n.click()}},{key:"expandItem",value:function(e){var t=(0,s.default)(e.currentTarget),n=t.closest("[data-collection-item]");t.attr("data-action","collapse").removeClass("fa-chevron-circle-right").addClass("fa-chevron-circle-down"),n.removeClass("collection-collapsed")}},{key:"sortItems",value:function(e){var t=(0,s.default)(e.currentTarget),n=t.data("action-sort"),r=t.data("action-sort-dir")||"asc",i=(0,s.default)(t.closest('[data-type="collection"]')),a=i.closest('[data-type="collection"]').find("> ul > [data-collection-item]");a.sort(function(e,t){var i=(0,s.default)(e).find('[name$="['+n+']"]'),a=(0,s.default)(t).find('[name$="['+n+']"]'),o=void 0;return o="asc"===r?i.val()a.val()?1:0:i.val()>a.val()?-1:i.val() ul > [data-collection-item]"),t.each(function(e,t){t=(0,s.default)(t);var n=t.find("[data-key-observe]"),r=n.val(),i=n.length,a=t.data("collection-key-backup");t.attr("data-collection-key",i?r:e),["name","data-grav-field-name","for","id","data-grav-file-settings"].forEach(function(e){t.find("["+e+"], [_"+e+"]").each(function(){var t=(0,s.default)(this),n=[],o=[new RegExp("\\[(\\d+|\\*|"+a+")\\]","g"),new RegExp("\\.(\\d+|\\*|"+a+")\\.","g")];if(i&&!r)return t.attr("_"+e,t.attr(e)),void t.attr(e,null);t.attr("_"+e)&&(t.attr(e,t.attr("_"+e)),t.attr("_"+e,null)),t.parents("[data-collection-key]").map(function(e,t){return n.push((0,s.default)(t).attr("data-collection-key"))}),n.reverse();var c=a,u=t.attr(e).replace(o[0],function(){return c=n.shift()||c,"["+c+"]"});u=u.replace(o[1],function(){ -return c=n.shift()||c,"."+c+"."}),t.attr(e,u)})})}),t.find('input[type="radio"][checked]').each(function(e,t){t.checked=!0})}},{key:"_onAddedNodes",value:function(e,t){var n=this,r=(0,s.default)(t).find('[data-type="collection"]');r.length&&r.each(function(e,t){t=(0,s.default)(t),~n.lists.index(t)||n.addList(t)})}},{key:"_updateActionsStateBasedOnMinMax",value:function(e){var t=e.closest('[data-type="collection"]').find("> ul > [data-collection-item]"),n=e.data("min"),r=e.data("max");e.find('> .collection-actions [data-action="add"]').attr("disabled",!1),e.find('> ul > li > .item-actions [data-action="delete"]').attr("disabled",!1),"undefined"!=typeof n&&t.length<=n&&e.find('> ul > li > .item-actions [data-action="delete"]').attr("disabled",!0),"undefined"!=typeof r&&t.length>=r&&e.find('> .collection-actions [data-action="add"]').attr("disabled",!0)}}]),e}();t.default=l;t.Instance=new l},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;n-1,p=(0,s.default)("body"),m="mousedown touchstart MSPointerDown pointerdown",v="mousemove touchmove MSPointerMove pointermove",g="mouseup touchend MSPointerUp pointerup",y=h?"focus":"focusin",_=function(){function e(t){var n=this;i(this,e),this.selector=t,this.field=(0,s.default)(this.selector),this.options=Object.assign({},this.field.data("grav-colorpicker")),this.built=!1,this.attach(),this.options.update&&this.field.on("change._grav_colorpicker",function(e,t,r,i){var a=r,o=(0,d.hex2rgb)(r);i<1&&(a="rgba("+o.r+", "+o.g+", "+o.b+", "+i+")");var s=t.closest(n.options.update);s.length||(s=t.siblings(n.options.update)),s.length||(s=t.parent(".g-colorpicker").find(n.options.update)),s.css({backgroundColor:a})})}return a(e,[{key:"attach",value:function(){var e=this;p.on(y,this.selector,function(t){return e.show(t,t.currentTarget)}),p.on(m,this.selector+" .g-colorpicker, "+this.selector+" .g-colorpicker i",this.bound("iconClick")),p.on("keydown",this.selector,function(t){switch(t.keyCode){case 9:e.hide();break;case 13:case 27:e.hide(),t.currentTarget.blur()}return!0}),p.on("keyup",this.selector,function(t){return e.updateFromInput(!0,t.currentTarget),!0}),p.on("paste",this.selector,function(t){setTimeout(function(){return e.updateFromInput(!0,t.currentTarget)},1)})}},{key:"show",value:function(e,t){t=(0,s.default)(t),this.built||this.build(),this.element=t,this.reposition(),this.wrapper.addClass("cp-visible"),this.updateFromInput();var n=(0,s.default)("#admin-main .content-wrapper").data("scrollbar").getViewElement();this.wrapper.on(m,".cp-grid, .cp-slider, .cp-opacity-slider",this.bound("bodyDown")),p.on(v,this.bound("bodyMove")),p.on(m,this.bound("bodyClick")),p.on(g,this.bound("targetReset")),(0,s.default)(n).on("scroll",this.bound("reposition"))}},{key:"hide",value:function(){if(this.built){this.wrapper.removeClass("cp-visible");var e=(0,s.default)("#admin-main .content-wrapper").data("scrollbar").getViewElement();this.wrapper.undelegate(m,".cp-grid, .cp-slider, .cp-opacity-slider",this.bound("bodyDown")),p.off(v,this.bound("bodyMove")),p.off(m,this.bound("bodyClick")),p.off(g,this.bound("targetReset")),(0,s.default)(e).off("scroll",this.bound("reposition"))}}},{key:"build",value:function(){var e=this;this.wrapper=(0,s.default)('
'),this.slider=(0,s.default)('
').appendTo(this.wrapper).append((0,s.default)('
')),this.opacitySlider=(0,s.default)('
').appendTo(this.wrapper).append((0,s.default)('
')),this.grid=(0,s.default)('
').appendTo(this.wrapper).append((0,s.default)('
')).append((0,s.default)('
')),(0,s.default)("
").appendTo(this.grid.find(".cp-picker"));var t=(0,s.default)('
').appendTo(this.wrapper);this.tabs={hue:(0,s.default)('
').text("HUE").appendTo(t),brightness:(0,s.default)('
').text("BRI").appendTo(t),saturation:(0,s.default)('
').text("SAT").appendTo(t),wheel:(0,s.default)('
').text("WHEEL").appendTo(t),transparent:(0,s.default)('
').text("TRANSPARENT").appendTo(t)},t.on(m,"> div",function(n){var r=(0,s.default)(n.currentTarget);if(r.is(e.tabs.transparent)){var i=e.opacitySlider.height();return e.opacity=0,e.opacitySlider.find(".cp-picker").css({top:(0,u.default)(i-i*e.opacity,0,i)}),void e.move(e.opacitySlider,{manualOpacity:!0})}var a=t.find(".active"),o=a.attr("class").replace(/\s|active|cp-tab-/g,""),c=r.attr("class").replace(/\s|active|cp-tab-/g,"");e.wrapper.removeClass("cp-mode-"+o).addClass("cp-mode-"+c),a.removeClass("active"),r.addClass("active"),e.mode=c,e.updateFromInput()}),this.wrapper.appendTo(".content-wrapper"),this.built=!0,this.mode="hue"}},{key:"reposition",value:function(){var e=(0,s.default)(".content-wrapper")[0],t=this.element[0].getBoundingClientRect(),n=e.getBoundingClientRect(),r={x:0,y:0};this.options.offset&&(r.x=this.options.offset.x||0,r.y=this.options.offset.y||0),this.wrapper.css({top:t.top+t.height+e.scrollTop-n.top+r.y,left:t.left+e.scrollLeft-n.left+r.x})}},{key:"iconClick",value:function(e){if(this.wrapper&&this.wrapper.hasClass("cp-visible"))return!0;e&&e.preventDefault();var t=(0,s.default)(e.currentTarget).find("input");setTimeout(function(){return t.focus()},50)}},{key:"bodyMove",value:function(e){e&&e.preventDefault(),this.target&&this.move(this.target,e)}},{key:"bodyClick",value:function(e){var t=(0,s.default)(e.target);t.closest(".cp-wrapper").length||t.is(this.selector)||this.hide()}},{key:"bodyDown",value:function(e){e&&e.preventDefault(),this.target=(0,s.default)(e.currentTarget),this.move(this.target,e,!0)}},{key:"targetReset",value:function(e){e&&e.preventDefault(),this.target=null}},{key:"move",value:function(e,t){var n=this.element,r=e.find(".cp-picker"),i=e[0].getBoundingClientRect(),a=i.left+window.scrollX,o=i.top+window.scrollY,s=Math.round((t?t.pageX:0)-a),c=Math.round((t?t.pageY:0)-o),u=void 0,l=void 0,f=void 0,d=void 0,h=t.changedTouches||t.originalEvent&&t.originalEvent.changedTouches;t&&h&&(s=(h?h[0].pageX:0)-a,c=(h?h[0].pageY:0)-o),t&&t.manualOpacity&&(c=i.height),s<0&&(s=0),c<0&&(c=0),s>i.width&&(s=i.width),c>i.height&&(c=i.height),e.parent(".cp-mode-wheel").length&&r.parent(".cp-grid").length&&(u=75-s,l=75-c,f=Math.sqrt(u*u+l*l),d=Math.atan2(l,u),d<0&&(d+=2*Math.PI),f>75&&(s=75-75*Math.cos(d),c=75-75*Math.sin(d)),s=Math.round(s),c=Math.round(c)),e.hasClass("cp-grid")?(r.css({top:c,left:s}),this.updateFromPicker(n,e)):(r.css({top:c}),this.updateFromPicker(n,e))}},{key:"updateFromInput",value:function(e,t){t=t?(0,s.default)(t):this.element;var n=t.val(),r=n.replace(/\s/g,"").match(/^rgba?\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},(.+)\)/),i=void 0,a=void 0;if(n=(0,d.rgbstr2hex)(n)||n,r=r?(0,u.default)(r[1],0,1):1,(i=(0,d.parseHex)(n))||(i="#ffffff"),a=(0,d.hex2hsb)(i),this.built){this.opacity=r;var o=this.opacitySlider.height();this.opacitySlider.find(".cp-picker").css({top:(0,u.default)(o-o*this.opacity,0,o)});var c=this.grid.height(),l=this.grid.width(),f=void 0,h=void 0,p=void 0,m=void 0;switch(o=this.slider.height(),this.mode){case"wheel":f=(0,u.default)(Math.ceil(.75*a.s),0,c/2),h=a.h*Math.PI/180,p=(0,u.default)(75-Math.cos(h)*f,0,l),m=(0,u.default)(75-Math.sin(h)*f,0,c),this.grid.css({backgroundColor:"transparent"}).find(".cp-picker").css({top:m,left:p}),m=150-a.b/(100/c),""===i&&(m=0),this.slider.find(".cp-picker").css({top:m}),this.slider.css({backgroundColor:(0,d.hsb2hex)({h:a.h,s:a.s,b:100})});break;case"saturation":p=(0,u.default)(5*a.h/12,0,150),m=(0,u.default)(c-Math.ceil(a.b/(100/c)),0,c),this.grid.find(".cp-picker").css({top:m,left:p}),m=(0,u.default)(o-a.s*(o/100),0,o),this.slider.find(".cp-picker").css({top:m}),this.slider.css({backgroundColor:(0,d.hsb2hex)({h:a.h,s:100,b:a.b})}),this.grid.find(".cp-grid-inner").css({opacity:a.s/100});break;case"brightness":p=(0,u.default)(5*a.h/12,0,150),m=(0,u.default)(c-Math.ceil(a.s/(100/c)),0,c),this.grid.find(".cp-picker").css({top:m,left:p}),m=(0,u.default)(o-a.b*(o/100),0,o),this.slider.find(".cp-picker").css({top:m}),this.slider.css({backgroundColor:(0,d.hsb2hex)({h:a.h,s:a.s,b:100})}),this.grid.find(".cp-grid-inner").css({opacity:1-a.b/100});break;case"hue":default:p=(0,u.default)(Math.ceil(a.s/(100/l)),0,l),m=(0,u.default)(c-Math.ceil(a.b/(100/c)),0,c),this.grid.find(".cp-picker").css({top:m,left:p}),m=(0,u.default)(o-a.h/(360/o),0,o),this.slider.find(".cp-picker").css({top:m}),this.grid.css({backgroundColor:(0,d.hsb2hex)({h:a.h,s:100,b:100})})}}e||t.val(this.getValue(i)),(this.element||t).trigger("change._grav_colorpicker",[t,i,r])}},{key:"updateFromPicker",value:function(e,t){var n=function(e,t){var n,r;return e.length&&t?(n=e[0].getBoundingClientRect().left,r=e[0].getBoundingClientRect().top,{x:n-t[0].getBoundingClientRect().left+e[0].offsetWidth/2,y:r-t[0].getBoundingClientRect().top+e[0].offsetHeight/2}):null},r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,c=void 0,l=void 0,f=void 0,h=this.wrapper.find(".cp-grid"),p=this.wrapper.find(".cp-slider"),m=this.wrapper.find(".cp-opacity-slider"),v=h.find(".cp-picker"),g=p.find(".cp-picker"),y=m.find(".cp-picker"),_=n(v,h),b=n(g,p),k=n(y,m),x=h[0].getBoundingClientRect().width,w=h[0].getBoundingClientRect().height,S=p[0].getBoundingClientRect().height,A=m[0].getBoundingClientRect().height,E=this.element.val();if(E=(0,d.rgbstr2hex)(E)||E,(r=(0,d.parseHex)(E))||(r="#ffffff"),t.hasClass("cp-grid")||t.hasClass("cp-slider"))switch(this.mode){case"wheel":s=x/2-_.x,c=w/2-_.y,l=Math.sqrt(s*s+c*c),f=Math.atan2(c,s),f<0&&(f+=2*Math.PI),l>75&&(l=75,_.x=69-75*Math.cos(f),_.y=69-75*Math.sin(f)),a=(0,u.default)(l/.75,0,100),i=(0,u.default)(180*f/Math.PI,0,360),o=(0,u.default)(100-Math.floor(b.y*(100/S)),0,100),r=(0,d.hsb2hex)({h:i,s:a,b:o}),p.css({backgroundColor:(0,d.hsb2hex)({h:i,s:a,b:100})});break;case"saturation":i=(0,u.default)(parseInt(_.x*(360/x),10),0,360),a=(0,u.default)(100-Math.floor(b.y*(100/S)),0,100),o=(0,u.default)(100-Math.floor(_.y*(100/w)),0,100),r=(0,d.hsb2hex)({h:i,s:a,b:o}),p.css({backgroundColor:(0,d.hsb2hex)({h:i,s:100,b:o})}),h.find(".cp-grid-inner").css({opacity:a/100});break;case"brightness":i=(0,u.default)(parseInt(_.x*(360/x),10),0,360),a=(0,u.default)(100-Math.floor(_.y*(100/w)),0,100),o=(0,u.default)(100-Math.floor(b.y*(100/S)),0,100),r=(0,d.hsb2hex)({h:i,s:a,b:o}),p.css({backgroundColor:(0,d.hsb2hex)({h:i,s:a,b:100})}),h.find(".cp-grid-inner").css({opacity:1-o/100});break;default:i=(0,u.default)(360-parseInt(b.y*(360/S),10),0,360),a=(0,u.default)(Math.floor(_.x*(100/x)),0,100),o=(0,u.default)(100-Math.floor(_.y*(100/w)),0,100),r=(0,d.hsb2hex)({h:i,s:a,b:o}),h.css({backgroundColor:(0,d.hsb2hex)({h:i,s:100,b:100})})}t.hasClass("cp-opacity-slider")&&(this.opacity=parseFloat(1-k.y/A).toFixed(2)),e.val(this.getValue(r)),this.element.trigger("change._grav_colorpicker",[this.element,r,this.opacity])}},{key:"getValue",value:function(e){if(1===this.opacity)return e;var t=(0,d.hex2rgb)(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+this.opacity+")"}},{key:"bound",value:function e(t){var e=this._bound||(this._bound={});return e[t]||(e[t]=(0,f.default)(this[t],this))}}]),e}();t.default=_;t.Instance=new _("[data-grav-colorpicker]")},function(e,t){function n(e,t,n){return en?n:e}e.exports=n},function(e,t,n){function r(e,t,n){var r=i(arguments,2);return function(){return e.apply(t,r.concat(i(arguments)))}}var i=n(558);e.exports=r},function(e,t){function n(e,t,n){var r=e.length;t=null==t?0:t<0?Math.max(r+t,0):Math.min(t,r),n=null==n?r:n<0?Math.max(r+n,0):Math.min(n,r);for(var i=[];t-1?e.substring(1):e,16),{r:e>>16,g:(65280&e)>>8,b:255&e}}},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(561),s=r(o);(0,a.default)(function(){var e="",t=new s.default(".pages-list-container .mediapicker-scroll",{autoshow:!0}),n=new s.default(".thumbs-list-container .mediapicker-scroll",{autoshow:!0});(0,a.default)(".media-container .media-range").change(function(){var e=(0,a.default)(".media-container div.card-item"),t=(0,a.default)(this).val()+"px";e.each(function(){(0,a.default)(this).css("width",t)})}),(0,a.default)(document).on("opened",".remodal",function(){setTimeout(function(){t.update(),n.update()},10)}),(0,a.default)("body").on("click","[data-mediapicker-modal-trigger]",function(){var t=(0,a.default)(this).data("grav-mediapicker-unique-identifier");e=a.default.remodal.lookup[(0,a.default)("body").find('[data-remodal-unique-identifier="'+t+'"]').data("remodal")],e.open()}),(0,a.default)("body").on("click","[data-remodal-mediapicker] .media-container.in-modal .admin-media-details a",function(t){t.preventDefault(),t.stopPropagation();var n=(0,a.default)(t.target).parents(".js__media-element").data("file-url"),r=n.replace(/ /g,"%20"),i=(0,a.default)(t.target).parents("[data-remodal-mediapicker]").data("remodal-unique-identifier");(0,a.default)("body").find('[data-grav-mediapicker-unique-identifier="'+i+'"] input').val(r),e.close()})})},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;n ul > [data-collection-item]"),n=e.data("min"),r=e.data("max");e.find('> .collection-actions [data-action="add"]').attr("disabled",!1),e.find('> ul > li > .item-actions [data-action="delete"]').attr("disabled",!1),"undefined"!=typeof n&&t.length<=n&&e.find('> ul > li > .item-actions [data-action="delete"]').attr("disabled",!0),"undefined"!=typeof r&&t.length>=r&&e.find('> .collection-actions [data-action="add"]').attr("disabled",!0)}}]),e}();t.default=l;t.Instance=new l},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;n-1,p=(0,s.default)("body"),m="mousedown touchstart MSPointerDown pointerdown",v="mousemove touchmove MSPointerMove pointermove",g="mouseup touchend MSPointerUp pointerup",y=h?"focus":"focusin",_=function(){function e(t){var n=this;i(this,e),this.selector=t,this.field=(0,s.default)(this.selector),this.options=Object.assign({},this.field.data("grav-colorpicker")),this.built=!1,this.attach(),this.options.update&&this.field.on("change._grav_colorpicker",function(e,t,r,i){var a=r,o=(0,d.hex2rgb)(r);i<1&&(a="rgba("+o.r+", "+o.g+", "+o.b+", "+i+")");var s=t.closest(n.options.update);s.length||(s=t.siblings(n.options.update)),s.length||(s=t.parent(".g-colorpicker").find(n.options.update)),s.css({backgroundColor:a})})}return a(e,[{key:"attach",value:function(){var e=this;p.on(y,this.selector,function(t){return e.show(t,t.currentTarget)}),p.on(m,this.selector+" .g-colorpicker, "+this.selector+" .g-colorpicker i",this.bound("iconClick")),p.on("keydown",this.selector,function(t){switch(t.keyCode){case 9:e.hide();break;case 13:case 27:e.hide(),t.currentTarget.blur()}return!0}),p.on("keyup",this.selector,function(t){return e.updateFromInput(!0,t.currentTarget),!0}),p.on("paste",this.selector,function(t){setTimeout(function(){return e.updateFromInput(!0,t.currentTarget)},1)})}},{key:"show",value:function(e,t){t=(0,s.default)(t),this.built||this.build(),this.element=t,this.reposition(),this.wrapper.addClass("cp-visible"),this.updateFromInput();var n=(0,s.default)("#admin-main .content-wrapper").data("scrollbar").getViewElement();this.wrapper.on(m,".cp-grid, .cp-slider, .cp-opacity-slider",this.bound("bodyDown")),p.on(v,this.bound("bodyMove")),p.on(m,this.bound("bodyClick")),p.on(g,this.bound("targetReset")),(0,s.default)(n).on("scroll",this.bound("reposition"))}},{key:"hide",value:function(){if(this.built){this.wrapper.removeClass("cp-visible");var e=(0,s.default)("#admin-main .content-wrapper").data("scrollbar").getViewElement();this.wrapper.undelegate(m,".cp-grid, .cp-slider, .cp-opacity-slider",this.bound("bodyDown")),p.off(v,this.bound("bodyMove")),p.off(m,this.bound("bodyClick")),p.off(g,this.bound("targetReset")),(0,s.default)(e).off("scroll",this.bound("reposition"))}}},{key:"build",value:function(){var e=this;this.wrapper=(0,s.default)('
'),this.slider=(0,s.default)('
').appendTo(this.wrapper).append((0,s.default)('
')),this.opacitySlider=(0,s.default)('
').appendTo(this.wrapper).append((0,s.default)('
')),this.grid=(0,s.default)('
').appendTo(this.wrapper).append((0,s.default)('
')).append((0,s.default)('
')),(0,s.default)("
").appendTo(this.grid.find(".cp-picker"));var t=(0,s.default)('
').appendTo(this.wrapper);this.tabs={hue:(0,s.default)('
').text("HUE").appendTo(t),brightness:(0,s.default)('
').text("BRI").appendTo(t),saturation:(0,s.default)('
').text("SAT").appendTo(t),wheel:(0,s.default)('
').text("WHEEL").appendTo(t),transparent:(0,s.default)('
').text("TRANSPARENT").appendTo(t)},t.on(m,"> div",function(n){var r=(0,s.default)(n.currentTarget);if(r.is(e.tabs.transparent)){var i=e.opacitySlider.height();return e.opacity=0,e.opacitySlider.find(".cp-picker").css({top:(0,u.default)(i-i*e.opacity,0,i)}),void e.move(e.opacitySlider,{manualOpacity:!0})}var a=t.find(".active"),o=a.attr("class").replace(/\s|active|cp-tab-/g,""),c=r.attr("class").replace(/\s|active|cp-tab-/g,"");e.wrapper.removeClass("cp-mode-"+o).addClass("cp-mode-"+c),a.removeClass("active"),r.addClass("active"),e.mode=c,e.updateFromInput()}),this.wrapper.appendTo(".content-wrapper"),this.built=!0,this.mode="hue"}},{key:"reposition",value:function(){var e=(0,s.default)(".content-wrapper")[0],t=this.element[0].getBoundingClientRect(),n=e.getBoundingClientRect(),r={x:0,y:0};this.options.offset&&(r.x=this.options.offset.x||0,r.y=this.options.offset.y||0),this.wrapper.css({top:t.top+t.height+e.scrollTop-n.top+r.y,left:t.left+e.scrollLeft-n.left+r.x})}},{key:"iconClick",value:function(e){if(this.wrapper&&this.wrapper.hasClass("cp-visible"))return!0;e&&e.preventDefault();var t=(0,s.default)(e.currentTarget).find("input");setTimeout(function(){return t.focus()},50)}},{key:"bodyMove",value:function(e){e&&e.preventDefault(),this.target&&this.move(this.target,e)}},{key:"bodyClick",value:function(e){var t=(0,s.default)(e.target);t.closest(".cp-wrapper").length||t.is(this.selector)||this.hide()}},{key:"bodyDown",value:function(e){e&&e.preventDefault(),this.target=(0,s.default)(e.currentTarget),this.move(this.target,e,!0)}},{key:"targetReset",value:function(e){e&&e.preventDefault(),this.target=null}},{key:"move",value:function(e,t){var n=this.element,r=e.find(".cp-picker"),i=e[0].getBoundingClientRect(),a=i.left+window.scrollX,o=i.top+window.scrollY,s=Math.round((t?t.pageX:0)-a),c=Math.round((t?t.pageY:0)-o),u=void 0,l=void 0,f=void 0,d=void 0,h=t.changedTouches||t.originalEvent&&t.originalEvent.changedTouches;t&&h&&(s=(h?h[0].pageX:0)-a,c=(h?h[0].pageY:0)-o),t&&t.manualOpacity&&(c=i.height),s<0&&(s=0),c<0&&(c=0),s>i.width&&(s=i.width),c>i.height&&(c=i.height),e.parent(".cp-mode-wheel").length&&r.parent(".cp-grid").length&&(u=75-s,l=75-c,f=Math.sqrt(u*u+l*l),d=Math.atan2(l,u),d<0&&(d+=2*Math.PI),f>75&&(s=75-75*Math.cos(d),c=75-75*Math.sin(d)),s=Math.round(s),c=Math.round(c)),e.hasClass("cp-grid")?(r.css({top:c,left:s}),this.updateFromPicker(n,e)):(r.css({top:c}),this.updateFromPicker(n,e))}},{key:"updateFromInput",value:function(e,t){t=t?(0,s.default)(t):this.element;var n=t.val(),r=n.replace(/\s/g,"").match(/^rgba?\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},(.+)\)/),i=void 0,a=void 0;if(n=(0,d.rgbstr2hex)(n)||n,r=r?(0,u.default)(r[1],0,1):1,(i=(0,d.parseHex)(n))||(i="#ffffff"),a=(0,d.hex2hsb)(i),this.built){this.opacity=r;var o=this.opacitySlider.height();this.opacitySlider.find(".cp-picker").css({top:(0,u.default)(o-o*this.opacity,0,o)});var c=this.grid.height(),l=this.grid.width(),f=void 0,h=void 0,p=void 0,m=void 0;switch(o=this.slider.height(),this.mode){case"wheel":f=(0,u.default)(Math.ceil(.75*a.s),0,c/2),h=a.h*Math.PI/180,p=(0,u.default)(75-Math.cos(h)*f,0,l),m=(0,u.default)(75-Math.sin(h)*f,0,c),this.grid.css({backgroundColor:"transparent"}).find(".cp-picker").css({top:m,left:p}),m=150-a.b/(100/c),""===i&&(m=0),this.slider.find(".cp-picker").css({top:m}),this.slider.css({backgroundColor:(0,d.hsb2hex)({h:a.h,s:a.s,b:100})});break;case"saturation":p=(0,u.default)(5*a.h/12,0,150),m=(0,u.default)(c-Math.ceil(a.b/(100/c)),0,c),this.grid.find(".cp-picker").css({top:m,left:p}),m=(0,u.default)(o-a.s*(o/100),0,o),this.slider.find(".cp-picker").css({top:m}),this.slider.css({backgroundColor:(0,d.hsb2hex)({h:a.h,s:100,b:a.b})}),this.grid.find(".cp-grid-inner").css({opacity:a.s/100});break;case"brightness":p=(0,u.default)(5*a.h/12,0,150),m=(0,u.default)(c-Math.ceil(a.s/(100/c)),0,c),this.grid.find(".cp-picker").css({top:m,left:p}),m=(0,u.default)(o-a.b*(o/100),0,o),this.slider.find(".cp-picker").css({top:m}),this.slider.css({backgroundColor:(0,d.hsb2hex)({h:a.h,s:a.s,b:100})}),this.grid.find(".cp-grid-inner").css({opacity:1-a.b/100});break;case"hue":default:p=(0,u.default)(Math.ceil(a.s/(100/l)),0,l),m=(0,u.default)(c-Math.ceil(a.b/(100/c)),0,c),this.grid.find(".cp-picker").css({top:m,left:p}),m=(0,u.default)(o-a.h/(360/o),0,o),this.slider.find(".cp-picker").css({top:m}),this.grid.css({backgroundColor:(0,d.hsb2hex)({h:a.h,s:100,b:100})})}}e||t.val(this.getValue(i)),(this.element||t).trigger("change._grav_colorpicker",[t,i,r])}},{key:"updateFromPicker",value:function(e,t){var n=function(e,t){var n,r;return e.length&&t?(n=e[0].getBoundingClientRect().left,r=e[0].getBoundingClientRect().top,{x:n-t[0].getBoundingClientRect().left+e[0].offsetWidth/2,y:r-t[0].getBoundingClientRect().top+e[0].offsetHeight/2}):null},r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,c=void 0,l=void 0,f=void 0,h=this.wrapper.find(".cp-grid"),p=this.wrapper.find(".cp-slider"),m=this.wrapper.find(".cp-opacity-slider"),v=h.find(".cp-picker"),g=p.find(".cp-picker"),y=m.find(".cp-picker"),_=n(v,h),b=n(g,p),k=n(y,m),x=h[0].getBoundingClientRect().width,w=h[0].getBoundingClientRect().height,S=p[0].getBoundingClientRect().height,A=m[0].getBoundingClientRect().height,E=this.element.val();if(E=(0,d.rgbstr2hex)(E)||E,(r=(0,d.parseHex)(E))||(r="#ffffff"),t.hasClass("cp-grid")||t.hasClass("cp-slider"))switch(this.mode){case"wheel":s=x/2-_.x,c=w/2-_.y,l=Math.sqrt(s*s+c*c),f=Math.atan2(c,s),f<0&&(f+=2*Math.PI),l>75&&(l=75,_.x=69-75*Math.cos(f),_.y=69-75*Math.sin(f)),a=(0,u.default)(l/.75,0,100),i=(0,u.default)(180*f/Math.PI,0,360),o=(0,u.default)(100-Math.floor(b.y*(100/S)),0,100),r=(0,d.hsb2hex)({h:i,s:a,b:o}),p.css({backgroundColor:(0,d.hsb2hex)({h:i,s:a,b:100})});break;case"saturation":i=(0,u.default)(parseInt(_.x*(360/x),10),0,360),a=(0,u.default)(100-Math.floor(b.y*(100/S)),0,100),o=(0,u.default)(100-Math.floor(_.y*(100/w)),0,100),r=(0,d.hsb2hex)({h:i,s:a,b:o}),p.css({backgroundColor:(0,d.hsb2hex)({h:i,s:100,b:o})}),h.find(".cp-grid-inner").css({opacity:a/100});break;case"brightness":i=(0,u.default)(parseInt(_.x*(360/x),10),0,360),a=(0,u.default)(100-Math.floor(_.y*(100/w)),0,100),o=(0,u.default)(100-Math.floor(b.y*(100/S)),0,100),r=(0,d.hsb2hex)({h:i,s:a,b:o}),p.css({backgroundColor:(0,d.hsb2hex)({h:i,s:a,b:100})}),h.find(".cp-grid-inner").css({opacity:1-o/100});break;default:i=(0,u.default)(360-parseInt(b.y*(360/S),10),0,360),a=(0,u.default)(Math.floor(_.x*(100/x)),0,100),o=(0,u.default)(100-Math.floor(_.y*(100/w)),0,100),r=(0,d.hsb2hex)({h:i,s:a,b:o}),h.css({backgroundColor:(0,d.hsb2hex)({h:i,s:100,b:100})})}t.hasClass("cp-opacity-slider")&&(this.opacity=parseFloat(1-k.y/A).toFixed(2)),e.val(this.getValue(r)),this.element.trigger("change._grav_colorpicker",[this.element,r,this.opacity])}},{key:"getValue",value:function(e){if(1===this.opacity)return e;var t=(0,d.hex2rgb)(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+this.opacity+")"}},{key:"bound",value:function e(t){var e=this._bound||(this._bound={});return e[t]||(e[t]=(0,f.default)(this[t],this))}}]),e}();t.default=_;t.Instance=new _("[data-grav-colorpicker]")},function(e,t){function n(e,t,n){return en?n:e}e.exports=n},function(e,t,n){function r(e,t,n){var r=i(arguments,2);return function(){return e.apply(t,r.concat(i(arguments)))}}var i=n(558);e.exports=r},function(e,t){function n(e,t,n){var r=e.length;t=null==t?0:t<0?Math.max(r+t,0):Math.min(t,r),n=null==n?r:n<0?Math.max(r+n,0):Math.min(n,r);for(var i=[];t-1?e.substring(1):e,16),{r:e>>16,g:(65280&e)>>8,b:255&e}}},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(561),s=r(o);(0,a.default)(function(){var e="",t=new s.default(".pages-list-container .mediapicker-scroll",{autoshow:!0}),n=new s.default(".thumbs-list-container .mediapicker-scroll",{autoshow:!0});(0,a.default)(".media-container .media-range").on("input change",function(){var e=(0,a.default)(".media-container div.card-item"),t=(0,a.default)(this).val()+"px";e.each(function(){(0,a.default)(this).css("width",t)})}),(0,a.default)(document).on("opened",".remodal",function(){setTimeout(function(){t.update(),n.update()},10)}),(0,a.default)("body").on("click","[data-mediapicker-modal-trigger]",function(){var t=(0,a.default)(this).data("grav-mediapicker-unique-identifier");e=a.default.remodal.lookup[(0,a.default)("body").find('[data-remodal-unique-identifier="'+t+'"]').data("remodal")],e.open()}),(0,a.default)("body").on("click","[data-remodal-mediapicker] .media-container.in-modal .admin-media-details a",function(t){t.preventDefault(),t.stopPropagation();var n=(0,a.default)(t.target).parents(".js__media-element").data("file-url"),r=n.replace(/ /g,"%20"),i=(0,a.default)(t.target).parents("[data-remodal-mediapicker]").data("remodal-unique-identifier");(0,a.default)("body").find('[data-grav-mediapicker-unique-identifier="'+i+'"] input').val(r),e.close()})})},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;n