"use strict";(globalThis.__googlesitekit_webpackJsonp=globalThis.__googlesitekit_webpackJsonp||[]).push([[452],{40290(e,t,s){var o=s(50539),a=s.n(o),l=s(17800),r=s(32091),n=s.n(r),i=s(17243);const c="SET_SELECTION",b="SET_STATUS",g="SET_PROGRESS",p="SET_BLOB",u="CLEAR_EXPORT",d="REQUEST_CANCEL",y="CLEAR_CANCEL_REQUEST",S="START_EXPORTING",E="FINISH_EXPORTING";function m(e){return Array.isArray(e)&&e.every(e=>"string"==typeof e)}const R={selection:{contextSlugs:[],widgetSlugs:[]},status:"idle",progress:0,blobURL:null,blobFilename:null,cancelRequested:!1,isExporting:!1},T={setSelection:e=>(n()((0,i.isPlainObject)(e),"selection must be a plain object."),n()(m(e.contextSlugs),"selection.contextSlugs must be an array of strings."),n()(m(e.widgetSlugs),"selection.widgetSlugs must be an array of strings."),{payload:{selection:e},type:c}),setStatus(e){const t=["idle","progress","success","error"];return n()(t.includes(e),`status must be one of: ${t.join(", ")}.`),{payload:{status:e},type:b}},setProgress:e=>(n()("number"==typeof e&&Number.isFinite(e)&&e>=0&&e<=100,"progress must be a number between 0 and 100."),{payload:{progress:e},type:g}),setBlob:e=>(n()((0,i.isPlainObject)(e),"blob must be a plain object."),n()("string"==typeof e.url&&e.url.length>0,"blob.url must be a non-empty string."),n()("string"==typeof e.filename&&e.filename.length>0,"blob.filename must be a non-empty string."),{payload:{blob:e},type:p}),clearExport:()=>({payload:{},type:u}),requestCancel:()=>({payload:{},type:d}),clearCancelRequest:()=>({payload:{},type:y}),startExporting:()=>({payload:{},type:S}),finishExporting:()=>({payload:{},type:E})},_=(0,o.createReducer)((e,t)=>{switch(t.type){case c:e.selection=t.payload.selection;break;case b:e.status=t.payload.status;break;case g:e.progress=t.payload.progress;break;case p:e.blobURL=t.payload.blob.url,e.blobFilename=t.payload.blob.filename;break;case u:e.status=R.status,e.progress=R.progress,e.blobURL=R.blobURL,e.blobFilename=R.blobFilename;break;case d:e.cancelRequested=!0;break;case y:e.cancelRequested=!1;break;case S:e.isExporting||(e.isExporting=!0);break;case E:e.isExporting=!1}}),f={initialState:R,actions:T,controls:{},reducer:_,resolvers:{},selectors:{getSelection:e=>e.selection,getSelectedContextSlugs:e=>e.selection.contextSlugs,getSelectedWidgetSlugs:e=>e.selection.widgetSlugs,getStatus:e=>e.status,getProgress:e=>e.progress,getBlob:e=>({url:e.blobURL,filename:e.blobFilename}),isCancelRequested:e=>e.cancelRequested,isExporting:e=>e.isExporting}},x=(0,o.combineStores)(o.commonStore,f);x.initialState,x.actions,x.controls,x.reducer,x.resolvers,x.selectors;a().registerStore(l.v,x)},17800(e,t,s){s.d(t,{v:()=>o});const o="core/pdf"},50539(e){e.exports=googlesitekit.data}},e=>{e.O(0,[660],()=>{return t=40290,e(e.s=t);var t});e.O()}]);