(()=>{"use strict";var e={64042:(e,t,a)=>{var r=a(20144),n=a(85450),o=a(49026),s=a(31096),i=function(){var e=this,t=e._self._c;e._self._setupProxy;return t(s.Z,[t("div",{staticClass:"regenerate-cache-wrapper pa-2"},[t("button",{staticClass:"regenerate-cache-button",attrs:{disabled:e.regenerating},on:{click:e.regenerateCache}},[e._v(" Regenerate CSS Cache ")]),t("p",{staticClass:"regenerate-cache-description"},[e._v(" When saving in Breakdance, the CSS and other dependencies required by the saved item are cached. Use this tool to regenerate the caches for all Breakdance-created content. ")]),t("Notifications")],1)])},c=[],l=a(70655),d=a(14391),h=a(30902),g=a(98851),u=a(32521),f=a(45974),p=a(39664),v=a(64940);async function b(e){return(0,h.pipe)(await(0,g.D)({action:"breakdance_get_paginated_breakdance_post_ids",dataToPost:{page:e},resultKey:"postIds",decoder:u.IX(u.pk)}),(0,f.fold)((()=>[]),(e=>e)))}async function _(){v.kD.setIdsOfPostsToRegenerateCache([]);let e=[],t=!0,a=0;while(t){const r=await b(a);a++,e=[...e,...r],0===r.length&&(t=!1)}return e}function y(){(0,g.D)({action:"breakdance_regenerate_global_settings_cache",decoder:u._4})}async function P(){v.kD.setUnsavedChangesPresent(!0),y();const e=await _();v.kD.setIdsOfPostsToRegenerateCache(e);for await(const t of e){const e=v.kD.idsOfPostsToRegenerateCache?[...v.kD.idsOfPostsToRegenerateCache]:[];e.shift(),(0,h.pipe)(await(0,g.D)({action:"breakdance_regenerate_post_cache",dataToPost:{id:t},decoder:u._4}),(0,f.fold)((()=>{0===e.length?v.kD.setIdsOfPostsToRegenerateCache(null):v.kD.setIdsOfPostsToRegenerateCache(e),p.Z.log.message(`Couldn't recreate the cache for post "${t}". Please re-save that post manually.`)}),(()=>{0===e.length?(v.kD.setIdsOfPostsToRegenerateCache(null),p.Z.log.message("Finished recreating all posts cache")):v.kD.setIdsOfPostsToRegenerateCache(e)})))}}var k=a(75276),C=a(96326);let O=class extends r.ZP{constructor(){super(...arguments),this.regenerating=!1}async regenerateCache(){this.regenerating=!0,await P(),this.regenerating=!1}};O=(0,l.gn)([(0,d.wA)({components:{Notifications:C.Z,RegeneratingCacheProgress:k.Z}})],O);const w=O,T=w;var m=a(1001),Z=(0,m.Z)(T,i,c,!1,null,null,null);const D=Z.exports;var R=a(74604);r.ZP.directive("permission",R.Z),r.ZP.config.productionTip=!1,new r.ZP({store:n.ZP,vuetify:o.Z,render:e=>e(D)}).$mount("#regenerate-cache-wrapper")}},t={};function a(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,a),o.loaded=!0,o.exports}a.m=e,(()=>{var e=[];a.O=(t,r,n,o)=>{if(!r){var s=1/0;for(d=0;d<e.length;d++){for(var[r,n,o]=e[d],i=!0,c=0;c<r.length;c++)(!1&o||s>=o)&&Object.keys(a.O).every((e=>a.O[e](r[c])))?r.splice(c--,1):(i=!1,o<s&&(s=o));if(i){e.splice(d--,1);var l=n();void 0!==l&&(t=l)}}return t}o=o||0;for(var d=e.length;d>0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[r,n,o]}})(),(()=>{a.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;return a.d(t,{a:t}),t}})(),(()=>{a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{a.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()})(),(()=>{a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{a.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})(),(()=>{a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e)})(),(()=>{a.j=715})(),(()=>{var e={715:0};a.O.j=t=>0===e[t];var t=(t,r)=>{var n,o,[s,i,c]=r,l=0;if(s.some((t=>0!==e[t]))){for(n in i)a.o(i,n)&&(a.m[n]=i[n]);if(c)var d=c(a)}for(t&&t(r);l<s.length;l++)o=s[l],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return a.O(d)},r=globalThis["webpackChunkbuilder"]=globalThis["webpackChunkbuilder"]||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var r=a.O(void 0,[998,64],(()=>a(64042)));r=a.O(r)})();
//# sourceMappingURL=settings-tools-regenerate-cache.2b768ca2.js.map