Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
wp-content
/
plugins
/
wpide
/
dist
/
js
/
chunks
/
FileManager
:
FileManager-Gallery.js
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
/*! For license information please see FileManager-Gallery.js.LICENSE.txt */ "use strict";(self.webpackChunkwpide=self.webpackChunkwpide||[]).push([[632],{75019:(t,e,r)=>{r.r(e),r.d(e,{default:()=>c});var n=r(56022),o=r(66198),i=(r(35545),r(11923),r(82837),r(83900),r(47623),r(95653),r(27397));const a={name:"Gallery", /* fs_premium_only */ components:{ImageEditor:function(){return window.WPIDE.premium?r.e(827).then(r.bind(r,51244)):null}}, /* /fs_premium_only */ props:["item","itemSelected"],data:function(){return{downloading:!1,editMode:!1,currentItem:"",images:[]}},watch:{item:function(t){this.setCurrentItem(t)},editMode:function(t,e){t||t===e||(this.setImages(),this.$emit("editorClosed"))}},created:function(){this.loading(),this.appDom.classList.add("gallery-active")},destroyed:function(){this.appDom.classList.remove("gallery-active")},mounted:function(){this.setCurrentItem(this.item),this.idle()},methods:{setCurrentItem:function(t){var e=this,r=this.currentItem.dir;this.currentItem=t,this.downloading=!0,i.Z.downloadItem({path:this.currentItem.path}).catch((function(){e.$emit("noFileFound",e.currentItem)})).finally((function(){e.downloading=!1})),this.currentItem.dir!==r&&this.setImages()},isCurrentItem:function(t){return this.currentItem.path===t.path},updateItemTime:function(){this.currentItem.time=Date.now()},enableEditMode:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.premium)return this.showPremiumFeatureModal(); /* fs_premium_only */this.editMode=t},setImages:function(){var t=this;return(0,o.Z)((0,n.Z)().mark((function e(){var r;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.Z.getDir({dir:t.currentItem.dir});case 2:r=e.sent,t.images=r.files.filter((function(e){return t.isImage(e)}));case 4:case"end":return e.stop()}}),e)})))()},onDeleted:function(t){var e=this;return(0,o.Z)((0,n.Z)().mark((function r(){return(0,n.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:e.enableEditMode(!1),e.$emit("deleted",t);case 2:case"end":return r.stop()}}),r)})))()},onReverted:function(t){var e=this;return(0,o.Z)((0,n.Z)().mark((function r(){return(0,n.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:e.updateItemTime(),e.$emit("reverted",t);case 2:case"end":return r.stop()}}),r)})))()},onUpdated:function(t){var e=this;return(0,o.Z)((0,n.Z)().mark((function r(){return(0,n.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:e.updateItemTime(),e.$emit("updated",t);case 2:case"end":return r.stop()}}),r)})))()},onEditorClosed:function(){this.enableEditMode(!1)}}};const c=(0,r(9970).Z)(a,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"gallery-wrap bg2"},[e("div",{staticClass:"gallery d-flex",class:{"edit-mode":t.editMode}},[e("div",{staticClass:"gallery-main"},[t.premium&&t.editMode?e("ImageEditor",{attrs:{item:t.currentItem},on:{deleted:t.onDeleted,reverted:t.onReverted,updated:t.onUpdated,editorClosed:t.onEditorClosed}}):t._e(),t.editMode?t._e():e("div",{staticClass:"gallery-image",style:"background-image: url("+t.getDownloadLink(t.currentItem,!0)+")"},[t.downloading?e("span",{staticClass:"position-absolute loading-file"},[e("b-spinner",{staticStyle:{width:"3rem",height:"3rem"},attrs:{variant:"primary",label:"Spinning"}})],1):e("div",{staticClass:"wpide-editor-actions"},[e("button",{staticClass:"btn btn-primary",attrs:{type:"button"},domProps:{textContent:t._s(t.__("Edit image","wpide"))},on:{click:t.enableEditMode}})])])],1),!t.editMode&&t.images.length?e("div",{staticClass:"gallery-sidebar"},[e("ul",t._l(t.images,(function(r,n){return e("li",{key:n},[e("a",{class:{active:t.isCurrentItem(r)},attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.itemSelected(r)}}},[e("img",{directives:[{name:"lazy",rawName:"v-lazy",value:t.getDownloadLink(r),expression:"getDownloadLink(image)"}]})])])})),0)]):t._e()])])}),[],!1,null,"5182c489",null).exports},83900:(t,e,r)=>{var n=r(77545),o=r(39272),i=Date,a=o(i.prototype.getTime);n({target:"Date",stat:!0},{now:function(){return a(new i)}})},1388:(t,e,r)=>{var n=r(62262);r(94521)(n.JSON,"JSON",!0)},19657:(t,e,r)=>{r(94521)(Math,"Math",!0)},88523:(t,e,r)=>{r(77545)({target:"Object",stat:!0,sham:!r(74777)},{create:r(92990)})},9450:(t,e,r)=>{var n=r(77545),o=r(79024),i=r(46834),a=r(13520),c=r(39822);n({target:"Object",stat:!0,forced:o((function(){a(1)})),sham:!c},{getPrototypeOf:function(t){return a(i(t))}})},31068:(t,e,r)=>{var n=r(74777),o=r(76633),i=r(81930),a=r(46834),c=r(63175),u=Object.getPrototypeOf,s=Object.setPrototypeOf,l=Object.prototype,h="__proto__";if(n&&u&&s&&!(h in l))try{o(l,h,{configurable:!0,get:function(){return u(a(this))},set:function(t){var e=c(this);(i(t)||null===t)&&i(e)&&s(e,t)}})}catch(t){}},86199:(t,e,r)=>{r(77545)({target:"Object",stat:!0},{setPrototypeOf:r(38914)})},35670:(t,e,r)=>{r(73833)("asyncIterator")},21509:(t,e,r)=>{var n=r(96024),o=r(73833),i=r(94521);o("toStringTag"),i(n("Symbol"),"Symbol")},66198:(t,e,r)=>{r.d(e,{Z:()=>o});r(35545);function n(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,u,"next",t)}function u(t){n(a,o,i,c,u,"throw",t)}c(void 0)}))}}},56022:(t,e,r)=>{r.d(e,{Z:()=>o});r(75539),r(73470),r(98239),r(35545),r(35142),r(11923),r(82837),r(35670),r(21509),r(1388),r(19657),r(88523),r(9450),r(43146),r(19356),r(30359),r(81379),r(83090),r(90203),r(86199),r(31068),r(7996),r(53290);var n=r(93808);function o(){o=function(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof w?e:w,i=Object.create(o.prototype),c=new S(n||[]);return a(i,"_invoke",{value:C(t,r,c)}),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",m="suspendedYield",v="executing",y="completed",g={};function w(){}function b(){}function x(){}var E={};h(E,u,(function(){return this}));var L=Object.getPrototypeOf,I=L&&L(L(M([])));I&&I!==r&&i.call(I,u)&&(E=I);var _=x.prototype=w.prototype=Object.create(E);function O(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,a,c,u){var s=d(t[o],t,a);if("throw"!==s.type){var l=s.arg,h=l.value;return h&&"object"==(0,n.Z)(h)&&i.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(h).then((function(t){l.value=t,c(l)}),(function(t){return r("throw",t,c,u)}))}u(s.arg)}var o;a(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}})}function C(e,r,n){var o=p;return function(i,a){if(o===v)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=d(e,r,n);if("normal"===s.type){if(o=n.done?y:m,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=y,n.method="throw",n.arg=s.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=d(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function Z(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(Z,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError((0,n.Z)(e)+" is not iterable")}return b.prototype=x,a(_,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=h(x,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,h(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},O(k.prototype),h(k.prototype,s,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(_),h(_,l,"Generator"),h(_,u,(function(){return this})),h(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=M,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}}}]);