decap-cms-core 3.3.1 → 3.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@
14
14
  `),!r)throw Error(`Widget "${t}" registered without \`controlComponent\`.`);_n.widgets[t]=vn({control:r,preview:n,schema:o,globalStyles:a,allowMapValue:i},s)}else console.error("`registerWidget` failed, called with incorrect arguments.")}function kn(e){return _n.widgets[e]}function Cn(){return Gt(Object.entries(_n.widgets),(e=>e.map((([e,t])=>vn({name:e},t)))))}function Tn(e){return kn(e||"string")||kn("unknown")}function Pn(){return _n.editorComponents}function jn(){return _n.remarkPlugins}function Rn(e){return _n.widgetValueSerializers[e]}function Mn(e){return _n.backends[e]}function An(e){return _n.mediaLibraries.find((t=>t.name===e))}function In(e){if(!bn.includes(e))throw new Error(`Invalid event name '${e}'`)}async function Dn({name:e,data:t}){In(e);const r=_n.eventHandlers[e];let n=vn({},t);for(const{handler:e,options:o}of r){const r=await e(n,o);if(void 0!==r){const e=n.entry.set("data",r);n=vn(vn({},t),{},{entry:e})}}return n.entry.get("data")}function Ln(e){return _n.locales[e]}function Nn(){return Object.entries(_n.formats).reduce((function(e,[t,{extension:r}]){return vn(vn({},e),{},{[t]:r})}),{})}function $n(){return Object.entries(_n.formats).reduce((function(e,[t,{formatter:r}]){return vn(vn({},e),{},{[t]:r})}),{})}function Fn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Bn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fn(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Un=["yaml-frontmatter","toml-frontmatter","json-frontmatter"],zn={yml:"yml",yaml:"yml",toml:"toml",json:"json",frontmatter:"md","json-frontmatter":"md","toml-frontmatter":"md","yaml-frontmatter":"md"},qn={yml:wr,yaml:wr,toml:jr,json:Rr,md:zr,markdown:zr,html:zr};function Wn(e,t){const r=Bn({yml:wr,yaml:wr,toml:jr,json:Rr,frontmatter:zr,"json-frontmatter":Hr(t),"toml-frontmatter":Wr(t),"yaml-frontmatter":qr(t)},$n());if(e in r)return r[e];throw new Error(`No formatter available with name: ${e}`)}function Hn(e,t){const r=e.get("frontmatter_delimiter"),n=(o=r,Qe.List.isList(o)?r.toArray():r);var o;const i=e.get("format");if(i)return Wn(i,n);const a=t&&t.path;if(a){const e=a.split(".").pop();if(e)return Qt()(qn,e)}const s=e.get("extension");return s?Qt()(qn,s):Wn("frontmatter",n)}var Vn=__webpack_require__(45455),Gn=__webpack_require__.n(Vn),Kn=__webpack_require__(93433),Yn=__webpack_require__.n(Kn),Jn=__webpack_require__(39714),Qn=__webpack_require__.n(Jn);const Xn="simple",Zn="editorial_workflow",eo=(0,Qe.OrderedMap)({DRAFT:"draft",PENDING_REVIEW:"pending_review",PENDING_PUBLISH:"pending_publish"});(0,Qe.Map)({[eo.get("DRAFT")]:"Draft",[eo.get("PENDING_REVIEW")]:"Waiting for Review",[eo.get("PENDING_PUBLISH")]:"Waiting to go live"});var to,ro=__webpack_require__(1581),no=__webpack_require__.n(ro),oo=__webpack_require__(12430),io=__webpack_require__(33351),ao=__webpack_require__.n(io),so=new Uint8Array(16);function lo(){if(!to&&!(to="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return to(so)}const co=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var uo=[],fo=0;fo<256;++fo)uo.push((fo+256).toString(16).substr(1));const po=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(uo[e[t+0]]+uo[e[t+1]]+uo[e[t+2]]+uo[e[t+3]]+"-"+uo[e[t+4]]+uo[e[t+5]]+"-"+uo[e[t+6]]+uo[e[t+7]]+"-"+uo[e[t+8]]+uo[e[t+9]]+"-"+uo[e[t+10]]+uo[e[t+11]]+uo[e[t+12]]+uo[e[t+13]]+uo[e[t+14]]+uo[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&co.test(e)}(r))throw TypeError("Stringified UUID is invalid");return r},ho=function(e,t,r){var n=(e=e||{}).random||(e.rng||lo)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var o=0;o<16;++o)t[r+o]=n[o];return t}return po(n)};var go=__webpack_require__(89166),mo=__webpack_require__.n(go),yo=__webpack_require__(3440),vo=__webpack_require__.n(yo);const bo="file_based_collection",wo="folder_based_collection",_o="commit_author",So="commit_date";var xo=__webpack_require__(51756);const Oo=["title","path"],Eo=["title","date","author","description"],ko={title:{type:"string",secondaryTypes:[],synonyms:["title","name","label","headline","header"],defaultPreview:e=>(0,xo.jsx)("h1",null,e),fallbackToFirstField:!0,showError:!0},shortTitle:{type:"string",secondaryTypes:[],synonyms:["short_title","shortTitle","short"],defaultPreview:e=>(0,xo.jsx)("h2",null,e),fallbackToFirstField:!1,showError:!1},author:{type:"string",secondaryTypes:[],synonyms:["author","name","by","byline","owner"],defaultPreview:e=>(0,xo.jsx)("strong",null,e),fallbackToFirstField:!1,showError:!1},date:{type:"datetime",secondaryTypes:["date"],synonyms:["date","publishDate","publish_date"],defaultPreview:e=>e,fallbackToFirstField:!1,showError:!1},description:{type:"string",secondaryTypes:["text","markdown"],synonyms:["shortDescription","short_description","shortdescription","description","intro","introduction","brief","content","biography","bio","summary"],defaultPreview:e=>e,fallbackToFirstField:!1,showError:!1},image:{type:"image",secondaryTypes:[],synonyms:["image","thumbnail","thumb","picture","avatar","photo","cover","hero","logo"],defaultPreview:e=>e,fallbackToFirstField:!1,showError:!1}};var Co=__webpack_require__(34498),To=__webpack_require__.n(Co),Po=__webpack_require__(25291),jo=__webpack_require__.n(Po);let Ro=function(e){return e.Ascending="Ascending",e.Descending="Descending",e.None="None",e}({});var Mo=__webpack_require__(1573),Ao=__webpack_require__.n(Mo),Io=__webpack_require__(26434),Do=__webpack_require__.n(Io),Lo=__webpack_require__(85395),No=__webpack_require__.n(Lo),$o=__webpack_require__(85505),Fo=__webpack_require__.n($o),Bo=__webpack_require__(883),Uo=__webpack_require__(49705),zo=__webpack_require__.n(Uo),qo=__webpack_require__(63449),Wo=__webpack_require__(17826),Ho=__webpack_require__.n(Wo);function Vo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Go(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Vo(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ko(e,t){return function(e,t){return`${t?"/#":""}${e}`}(`/collections/${e}/new`,t)}function Yo(e,t){const r=Bo.parse(e,!0);return r.query=Go(Go({},r.query),t),Bo.format(r)}const Jo=/[\w\-.~]/i,Qo=/[\xA0-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFEF}\u{10000}-\u{1FFFD}\u{20000}-\u{2FFFD}\u{30000}-\u{3FFFD}\u{40000}-\u{4FFFD}\u{50000}-\u{5FFFD}\u{60000}-\u{6FFFD}\u{70000}-\u{7FFFD}\u{80000}-\u{8FFFD}\u{90000}-\u{9FFFD}\u{A0000}-\u{AFFFD}\u{B0000}-\u{BFFFD}\u{C0000}-\u{CFFFD}\u{D0000}-\u{DFFFD}\u{E1000}-\u{EFFFD}]/u;function Xo(e){return Jo.test(e)}function Zo(e){return Jo.test(e)||Qo.test(e)}function ei(e,t){let r;if("unicode"===e)r=Zo;else{if("ascii"!==e)throw new Error('`options.encoding` must be "unicode" or "ascii".');r=Xo}if(!Array.from(t).every(r))throw new Error("The replacement character(s) (options.replacement) is itself unsafe.");return e=>r(e)?e:t}function ti(e,t){const{replacement:r="",encoding:n="unicode"}=t||{};if(!Fo()(e))throw new Error("The input slug must be a string.");if(!Fo()(r))throw new Error("`options.replacement` must be a string.");return Array.from(e).map(ei(n,r)).join("")}function ri(e,t){const{encoding:r="unicode",sanitize_replacement:n=""}=t||{};return ei(r,n)(e)}function ni(e,t){if(!Fo()(e))throw new Error("The input slug must be a string.");const{encoding:r,clean_accents:n,sanitize_replacement:o}=t||{},i=No()([...n?[qo.Od]:[],Do()(ti,{replacement:o,encoding:r}),Do()(Ho(),{replacement:o})])(e),a=new RegExp(`(?:${mo()(o)})+`,"g"),s=new RegExp(`${mo()(o)}$`),l=new RegExp(`^${mo()(o)}`);return i.replace(a,o).replace(l,"").replace(s,"")}function oi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ii(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oi(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const{compileStringTemplate:ai,parseDateFromEntry:si,SLUG_MISSING_REQUIRED_DATE:li,keyToPathArray:ci,addFileTemplateFields:ui}=hr.stringTemplate,fi={create:"Create {{collection}} “{{slug}}”",update:"Update {{collection}} “{{slug}}”",delete:"Delete {{collection}} “{{slug}}”",uploadMedia:"Upload “{{path}}”",deleteMedia:"Delete “{{path}}”",openAuthoring:"{{message}}"},pi=/\{\{([^}]+)\}\}/g;function di(e,t,{slug:r,path:n,collection:o,authorLogin:i,authorName:a},s){const l=ii(ii({},fi),t.backend.commit_messages||{}),c=l[e].replace(pi,((e,t)=>{switch(t){case"slug":return r||"";case"path":return n||"";case"collection":return o?o.get("label_singular")||o.get("label"):"";case"author-login":return i||"";case"author-name":return a||"";default:return console.warn(`Ignoring unknown variable “${t}” in commit message template.`),""}}));return s?l.openAuthoring.replace(pi,((e,t)=>{switch(t){case"message":return c;case"author-login":return i||"";case"author-name":return a||"";default:return console.warn(`Ignoring unknown variable “${t}” in open authoring message template.`),""}})):c}function hi(e){return e.trim().toLocaleLowerCase().replace(/[']/g,"").replace(/[.]/g,"-")}function gi(e,t){return r=>t&&t.includes(r)?r:No()([e=>String(e),hi,Do()(ni,e)])(r)}function mi(e,t,r,n,o){if(!e)return;const i=Ao()(e,"/"),a=t.get("type")===bo?mc(t,n.get("slug")):void 0,s=null!==(l=null==a?void 0:a.get("preview_path"))&&void 0!==l?l:t.get("preview_path");var l;if(!s)return e;let c=n.get("data");c=ui(n.get("path"),c,t.get("folder"));const u=(null!==(f=null==a?void 0:a.get("preview_path_date_field"))&&void 0!==f?f:t.get("preview_path_date_field"))||Cc(t,"date");var f;const p=si(n,u),d=gi(o,[c.get("dirname")]);let h;try{h=ai(s,p,r,c,d)}catch(e){if(e.name===li)return console.error(ln`
15
15
  Collection "${t.get("name")}" configuration error:
16
16
  \`preview_path_date_field\` must be a field with a valid date. Ignoring \`preview_path\`.
17
- `),i;throw e}return`${i}/${Yn()(h," /")}`}function yi(e,t,r,n,o,i){if(!t||!t.get("data"))return e;let a=t.get("data").set(o,n);a=ui(t.get("path"),a,r.get("folder"));const s=si(t,Cc(r,"date"))||null,l=a.getIn(ci(kc(r))),c=gi(i,[n,a.get("dirname")]);return ai(e,s,l,a,c)}var vi=__webpack_require__(18149),bi=__webpack_require__.n(vi),wi=__webpack_require__(4335),_i=__webpack_require__.n(wi);function Si(e,t="",r="",n={}){return{collection:e,slug:t,path:r,partial:n.partial||!1,raw:n.raw||"",data:n.data||{},label:n.label||null,isModification:_i()(n.isModification)?n.isModification:null,mediaFiles:n.mediaFiles||[],author:n.author||"",updatedOn:n.updatedOn||"",status:n.status||"",meta:n.meta||{},i18n:n.i18n||{}}}function xi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Oi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xi(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const{fetchWithTimeout:Ei}=pr.unsentRequest;class ki{constructor(e){if(this.config=e,null==e.get("applicationID")||null==e.get("apiKey"))throw"The Algolia search integration needs the credentials (applicationID and apiKey) in the integration configuration.";this.applicationID=e.get("applicationID"),this.apiKey=e.get("apiKey");const t=e.get("indexPrefix");this.indexPrefix=t?`${t}-`:"",this.searchURL=`https://${this.applicationID}-dsn.algolia.net/1`,this.entriesCache={collection:null,page:null,entries:[]}}requestHeaders(e={}){return Oi({"X-Algolia-API-Key":this.apiKey,"X-Algolia-Application-Id":this.applicationID,"Content-Type":"application/json"},e)}parseJsonResponse(e){return e.json().then((t=>e.ok?t:Promise.reject(t)))}urlFor(e,t){const r=[];if(t.params)for(const e in t.params)r.push(`${e}=${encodeURIComponent(t.params[e])}`);return r.length&&(e+=`?${r.join("&")}`),e}request(e,t={}){const r=this.requestHeaders(t.headers||{}),n=this.urlFor(e,t);return Ei(n,Oi(Oi({},t),{},{headers:r})).then((e=>{const t=e.headers.get("Content-Type");return t&&t.match(/json/)?this.parseJsonResponse(e):e.text()}))}search(e,t,r){const n=e.map((e=>({indexName:`${this.indexPrefix}${e}`,params:`query=${t}&page=${r}`})));return this.request(`${this.searchURL}/indexes/*/queries`,{method:"POST",body:JSON.stringify({requests:n})}).then((t=>{const n=t.results.map(((t,r)=>t.hits.map((t=>{const n=t.path.split("/").pop().replace(/\.[^.]+$/,"");return Si(e[r],n,t.path,{data:t.data,partial:!0})}))));return{entries:sr()(n),pagination:r}}))}searchBy(e,t,r){return this.request(`${this.searchURL}/indexes/${this.indexPrefix}${t}`,{params:{restrictSearchableAttributes:e,query:r}})}listEntries(e,t){return this.entriesCache.collection===e&&this.entriesCache.page===t?Promise.resolve({page:this.entriesCache.page,entries:this.entriesCache.entries}):this.request(`${this.searchURL}/indexes/${this.indexPrefix}${e.get("name")}`,{params:{page:t}}).then((t=>{const r=t.hits.map((t=>{const r=_c(e,t.path);return Si(e.get("name"),r,t.path,{data:t.data,partial:!0})}));return this.entriesCache={collection:e,pagination:t.page,entries:r},{entries:r,pagination:t.page}}))}async listAllEntries(e){const t={hitsPerPage:1e3};let r=await this.request(`${this.searchURL}/indexes/${this.indexPrefix}${e.get("name")}`,{params:t}),{nbPages:n=0,hits:o,page:i}=r;for(i+=1;i<n;)r=await this.request(`${this.searchURL}/indexes/${this.indexPrefix}${e.get("name")}`,{params:Oi(Oi({},t),{},{page:i})}),o=[...o,...r.hits],i+=1;const a=o.map((t=>{const r=_c(e,t.path);return Si(e.get("name"),r,t.path,{data:t.data,partial:!0})}));return a}getEntry(e,t){return this.searchBy("slug",e.get("name"),t).then((r=>{const n=r.hits.filter((e=>e.slug===t))[0];return Si(e.get("name"),t,n.path,{data:n.data,partial:!0})}))}}var Ci=__webpack_require__(42208),Ti=__webpack_require__.n(Ci);function Pi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ji(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pi(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const{fetchWithTimeout:Ri}=pr.unsentRequest;class Mi{constructor(e,t){if(this.config=e,null==e.get("getSignedFormURL"))throw"The AssetStore integration needs the getSignedFormURL in the integration configuration.";this.getToken=t,this.shouldConfirmUpload=e.get("shouldConfirmUpload",!1),this.getSignedFormURL=Ao()(e.get("getSignedFormURL"),"/")}parseJsonResponse(e){return e.json().then((t=>e.ok?t:Promise.reject(t)))}urlFor(e,t){const r=[];if(t.params)for(const e in t.params)r.push(`${e}=${encodeURIComponent(t.params[e])}`);return r.length&&(e+=`?${r.join("&")}`),e}requestHeaders(e={}){return ji({},e)}confirmRequest(e){this.getToken().then((t=>this.request(`${this.getSignedFormURL}/${e}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({state:"uploaded"})})))}async request(e,t={}){const r=this.requestHeaders(t.headers||{}),n=this.urlFor(e,t),o=await Ri(n,ji(ji({},t),{},{headers:r})),i=o.headers.get("Content-Type");return i&&i.match(/json/)?await this.parseJsonResponse(o):o.text()}async retrieve(e,t,r){const n=Ti()({search:e,page:t,filter:r?"private":"public"},(e=>!!e)),o=Yo(this.getSignedFormURL,n),i={"Content-Type":"application/json",Authorization:`Bearer ${await this.getToken()}`},a=(await this.request(o,{headers:i})).map((({id:e,name:t,size:r,url:n})=>({id:e,name:t,size:r,displayURL:n,url:n,path:n})));return a}delete(e){const t=`${this.getSignedFormURL}/${e}`;return this.getToken().then((e=>this.request(t,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}})))}async upload(e,t=!1){const r={name:e.name,size:e.size};e.type&&(r.content_type=e.type),t&&(r.visibility="private");try{const t=await this.getToken(),n=await this.request(this.getSignedFormURL,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(r)}),o=n.form.url,i=n.form.fields,{id:a,name:s,size:l,url:c}=n.asset,u=new FormData;return Object.keys(i).forEach((e=>u.append(e,i[e]))),u.append("file",e,e.name),await this.request(o,{method:"POST",body:u}),this.shouldConfirmUpload&&await this.confirmRequest(a),{success:!0,asset:{id:a,name:s,size:l,displayURL:c,url:c,path:c}}}catch(e){throw console.error(e),e}}}const Ai=function(){let e=null;return(t,r,n)=>(e||(e=function(e,t){let r=(0,Qe.Map)({});return e.get("providers").forEach(((e,n)=>{switch(n){case"algolia":r=r.set("algolia",new ki(e));break;case"assetStore":r=r.set("assetStore",new Mi(e,t))}})),r}(t,r)),e.get(n))}(),Ii="SEARCH_ENTRIES_REQUEST",Di="SEARCH_ENTRIES_SUCCESS",Li="SEARCH_ENTRIES_FAILURE",Ni="QUERY_REQUEST",$i="QUERY_SUCCESS",Fi="QUERY_FAILURE",Bi="SEARCH_CLEAR",Ui="CLEAR_REQUESTS";function zi(){return{type:Bi}}function qi(e,t,r,n,o,i){return async(a,s)=>{const l=s(),c=rf(l.config),u=Gf(l,t,"search"),f=l.collections.find((e=>e.get("name")===t));a({type:Ui});const p=`${t}-${r.join()}-${n}-${o}-${i}`,d=l.search.requests.find((({id:e})=>e==p)),h=d?d.queryResponse:u?Ai(l.integrations,c.getToken,u).searchBy(r.map((e=>`data.${e}`)),t,n):c.query(f,r,n,o,i);a(function(e,t){return{type:Ni,payload:{searchTerm:e,request:t}}}(n,d?void 0:{id:p,expires:new Date((new Date).getTime()+1e4),queryResponse:h}));try{const t=await h;return a(function(e,t){return{type:$i,payload:{namespace:e,hits:t}}}(e,t.hits))}catch(e){return a(function(e){return{type:Fi,payload:{error:e}}}(e))}}}function Wi(e,t){return new pr.Cursor(e.getIn(["cursorsByType","collectionEntries",t]))}var Hi=__webpack_require__(1842),Vi=__webpack_require__.n(Hi);function Gi(e,t,r){let n=t.reduce(((t,n)=>{const o=n.get("name"),i=e.get(o),a=Rn(n.get("widget")),s=n.get("fields");return s&&Qe.List.isList(i)?t.set(o,i.map((e=>Gi(e,s,r)))):s&&Qe.Map.isMap(i)?t.set(o,Gi(i,s,r)):a&&!Vi()(i)?t.set(o,a[r](i)):Vi()(i)?t:t.set(o,i)}),(0,Qe.Map)());return n=e.mergeDeep(n),n}const Ki={PRESENCE:"PRESENCE",PATTERN:"PATTERN",RANGE:"RANGE",CUSTOM:"CUSTOM"};function Yi({predicate:e,run:t}){return{type:Je,predicate:e,run:t}}async function Ji(e,t,r=3e4){let n=!1;const o=new Promise((r=>{e(Yi(t(r)))})),i=new Promise((e=>{setTimeout((()=>{n?e():(console.warn("Wait Action timed out"),e(null))}),r)}));return await Promise.race([o.then((e=>(n=!0,e))).catch(null),i])}const Qi="NOTIFICATION_SEND",Xi="NOTIFICATION_DISMISS",Zi="NOTIFICATION_CLEAR";function ea(e){return{type:Qi,payload:e}}function ta(e){return{type:Xi,id:e}}function ra(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function na(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ra(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ra(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const oa="MEDIA_LIBRARY_OPEN",ia="MEDIA_LIBRARY_CLOSE",aa="MEDIA_LIBRARY_CREATE",sa="MEDIA_INSERT",la="MEDIA_REMOVE_INSERTED",ca="MEDIA_LOAD_REQUEST",ua="MEDIA_LOAD_SUCCESS",fa="MEDIA_LOAD_FAILURE",pa="MEDIA_PERSIST_REQUEST",da="MEDIA_PERSIST_SUCCESS",ha="MEDIA_PERSIST_FAILURE",ga="MEDIA_DELETE_REQUEST",ma="MEDIA_DELETE_SUCCESS",ya="MEDIA_DELETE_FAILURE",va="MEDIA_DISPLAY_URL_REQUEST",ba="MEDIA_DISPLAY_URL_SUCCESS",wa="MEDIA_DISPLAY_URL_FAILURE";function _a(e){return(t,r)=>{const n=r().mediaLibrary.get("externalLibrary");n&&n.onClearControl({id:e})}}function Sa(e){return(t,r)=>{const n=r().mediaLibrary.get("externalLibrary");n&&n.onRemoveControl({id:e})}}function xa(e={}){return(t,r)=>{const n=r().mediaLibrary.get("externalLibrary");if(n){const{controlID:t,value:r,config:o=(0,Qe.Map)(),allowMultiple:i,forImage:a}=e;n.show({id:t,value:r,config:o.toJS(),allowMultiple:i,imagesOnly:a})}t(function(e){return{type:oa,payload:e}}(e))}}function Oa(e,t){return(r,n)=>{const o=n(),i=o.config,a=o.entryDraft.get("entry"),s=o.entryDraft.getIn(["entry","collection"]),l=o.collections.get(s);r(function(e){return{type:sa,payload:{mediaPath:e}}}(e=Array.isArray(e)?e.map((e=>lc(i,l,e,a,t))):lc(i,l,e,a,t)))}}function Ea(e){return{type:la,payload:{controlID:e}}}function ka(e={}){const{delay:t=0,query:r="",page:n=1,privateUpload:o}=e;return async(e,i)=>{const a=i(),s=rf(a.config),l=Gf(a,null,"assetStore");if(l){const t=Ai(a.integrations,s.getToken,l);e(Ra(n));try{const i=await t.retrieve(r,n,o);return e(Ma(i,{page:n,canPaginate:!0,dynamicSearch:!0,dynamicSearchQuery:r,privateUpload:o}))}catch(t){return e(Aa({privateUpload:o}))}}function c(){return s.getMedia().then((t=>e(Ma(t)))).catch((t=>{console.error(t),404===t.status?(console.log("This 404 was expected and handled appropriately."),e(Ma([]))):e(Aa())}))}return e(Ra(n)),t>0?new Promise((e=>{setTimeout((()=>e(c())),t)})):c()}}function Ca({id:e,file:t,assetProxy:r,draft:n}){return{id:e,name:(0,pr.basename)(r.path),displayURL:r.url,draft:n,file:t,size:t.size,url:r.url,path:r.path,field:r.field}}function Ta(e,t={}){const{privateUpload:r,field:n}=t;return async(t,o)=>{const i=o(),a=rf(i.config),s=Gf(i,null,"assetStore"),l=qa(i,n),c=ni(e.name.toLowerCase(),i.config.slug),u=l.find((e=>e.name.toLowerCase()===c)),f=cc(i.entryDraft);if(!s&&u){if(!window.confirm(`${u.name} already exists. Do you want to replace it?`))return;await t(Pa(u,{privateUpload:r}))}!s&&f||t({type:pa});try{let o,l;if(s)try{const t=Ai(i.integrations,a.getToken,s),n=await t.upload(e,r);o=Tr({url:n.asset.url,path:n.asset.url})}catch(t){o=Tr({file:e,path:c})}else{if(r)throw new Error("The Private Upload option is only available for Asset Store Integration");{const t=i.entryDraft.get("entry"),r=i.collections.get(null==t?void 0:t.get("collection")),a=sc(i.config,r,t,c,n);o=Tr({file:e,path:a,field:n})}}if(t(Xa(o)),s)l=Ca({id:await(0,pr.getBlobSHA)(e),file:e,assetProxy:o,draft:!1});else{if(f)return l=Ca({id:await(0,pr.getBlobSHA)(e),file:e,assetProxy:o,draft:f}),t(function(e){return{type:ul,payload:e}}(l));l=await a.persistMedia(i.config,o)}return t(function(e,t={}){const{privateUpload:r}=t;return{type:da,payload:{file:e,privateUpload:r}}}(l,{privateUpload:r}))}catch(e){return console.error(e),t(ea({message:`Failed to persist media: ${e}`,type:"error",dismissAfter:8e3})),t(function(e={}){const{privateUpload:t}=e;return{type:ha,payload:{privateUpload:t}}}({privateUpload:r}))}}}function Pa(e,t={}){const{privateUpload:r}=t;return async(t,n)=>{const o=n(),i=rf(o.config),a=Gf(o,null,"assetStore");if(a){const n=Ai(o.integrations,i.getToken,a);t(Ia());try{return await n.delete(e.id),t(Da(e,{privateUpload:r}))}catch(e){return console.error(e),t(ea({message:`Failed to delete media: ${e.message}`,type:"error",dismissAfter:8e3})),t(La({privateUpload:r}))}}try{if(e.draft)t(Za(e.path)),t(_l({id:e.id}));else{const r=cc(o.entryDraft);t(Ia()),t(Za(e.path)),await i.deleteMedia(o.config,e.path),t(Da(e)),r&&t(_l({id:e.id}))}}catch(e){return console.error(e),t(ea({message:`Failed to delete media: ${e.message}`,type:"error",dismissAfter:8e3})),t(La())}}}function ja(e){return async(t,r)=>{const{displayURL:n,id:o}=e,i=r(),a=Wa(i,o);if(!o||!n||a.get("url")||a.get("isFetching")||a.get("err"))return Promise.resolve();if("string"==typeof n)return t(Na(o)),void t($a(o,n));try{const e=rf(i.config);t(Na(o));const r=await e.getMediaDisplayURL(n);if(!r)throw new Error("No display URL was returned!");t($a(o,r))}catch(e){console.error(e),t(function(e,t){return{type:wa,payload:{key:e,err:t}}}(o,e))}}}function Ra(e){return{type:ca,payload:{page:e}}}function Ma(e,t={}){return{type:ua,payload:na({files:e},t)}}function Aa(e={}){const{privateUpload:t}=e;return{type:fa,payload:{privateUpload:t}}}function Ia(){return{type:ga}}function Da(e,t={}){const{privateUpload:r}=t;return{type:ma,payload:{file:e,privateUpload:r}}}function La(e={}){const{privateUpload:t}=e;return{type:ya,payload:{privateUpload:t}}}function Na(e){return{type:va,payload:{key:e}}}function $a(e,t){return{type:ba,payload:{key:e,url:t}}}async function Fa(e,t){!1===t.mediaLibrary.get("isLoading")||t.mediaLibrary.get("externalLibrary")||await Ji(e,(e=>({predicate:({type:e})=>e===ua||e===fa,run:()=>e()})))}function Ba(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ua(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ba(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ba(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const za={isVisible:!1,showMediaButton:!0,controlMedia:(0,Qe.Map)(),displayURLs:(0,Qe.Map)(),config:(0,Qe.Map)()};function qa(e,t){const{mediaLibrary:r,entryDraft:n}=e,o=cc(e.entryDraft),i=Gf(e,null,"assetStore");let a;if(o&&!i){const r=n.getIn(["entry","mediaFiles"],(0,Qe.List)()).toJS(),o=n.get("entry"),i=e.collections.get(null==o?void 0:o.get("collection")),s=ac(e.config,i,o,t);a=r.filter((e=>(0,dr.dirname)(e.path)===s)).map((e=>Ua({key:e.id},e)))}else a=r.get("files")||[];return a}function Wa(e,t){return e.mediaLibrary.getIn(["displayURLs",t],(0,Qe.Map)())}const Ha="ADD_ASSETS",Va="ADD_ASSET",Ga="REMOVE_ASSET",Ka="LOAD_ASSET_REQUEST",Ya="LOAD_ASSET_SUCCESS",Ja="LOAD_ASSET_FAILURE";function Qa(e){return{type:Ha,payload:e}}function Xa(e){return{type:Va,payload:e}}function Za(e){return{type:Ga,payload:e}}const es=Tr({path:"empty.svg",file:new File(['<svg xmlns="http://www.w3.org/2000/svg"></svg>'],"empty.svg",{type:"image/svg+xml"})});function ts(e,t,r){return function(n,o){return e(rs({collection:t,entry:r,path:n,field:o}))}}function rs({collection:e,entry:t,path:r,field:n}){return(o,i)=>{if(!r)return es;const a=i(),s=sc(a.config,e,t,r,n);let{asset:l,isLoading:c,error:u}=a.medias[s]||{};return c?es:l||((0,pr.isAbsolutePath)(s)||u?(l=Tr({path:s,url:r}),o(Xa(l))):(o(function(e){return async(t,r)=>{try{t({type:Ka,payload:{path:e}}),await Fa(t,r());const i=(n=r(),o=e,qa(n).find((e=>e.path===o)));if(i){const n=await async function(e,t,r){const n=Wa(t,r.id);let o;if(n.get("url"))o=n.get("url");else if(n.get("err"))o=null;else{var i;const t=r.id,a=Ji(e,(e=>({predicate:({type:e,payload:r})=>(e===ba||e===wa)&&r.key===t,run:(t,r,n)=>e(n.payload.url)})));n.get("isFetching")||e(ja(r)),o=null!==(i=await a)&&void 0!==i?i:null}return o}(t,r(),i);t(Xa(Tr({path:e,url:n||e})))}else{const{url:n}=await async function(e,t){const r=rf(e.config),{url:n}=await r.getMediaFile(t);return{url:n}}(r(),e);t(Xa(Tr({path:e,url:n})))}t(function(e){return{type:Ya,payload:{path:e}}}(e))}catch(r){t(function(e,t){return{type:Ja,payload:{path:e,error:t}}}(e,r))}var n,o}}(s)),l=es),l)}}const ns=function(e){void 0===e&&(e={}),ge||se(!1);var t=window.history,r=(window.navigator.userAgent.indexOf("Firefox"),e),n=r.getUserConfirmation,o=void 0===n?me:n,i=r.hashType,a=void 0===i?"slash":i,s=e.basename?fe(le(e.basename)):"",l=ve[a],c=l.encodePath,u=l.decodePath;function f(){var e=u(we());return s&&(e=ue(e,s)),de(e)}var p=he();function h(e){d(k,e),k.length=t.length,p.notifyListeners(k.location,k.action)}var g=!1,m=null;function y(){var e=we(),t=c(e);if(e!==t)_e(t);else{var r=f(),n=k.location;if(!g&&function(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash}(n,r))return;if(m===pe(r))return;m=null,function(e){if(g)g=!1,h();else{p.confirmTransitionTo(e,"POP",o,(function(t){t?h({action:"POP",location:e}):function(e){var t=k.location,r=_.lastIndexOf(pe(t));-1===r&&(r=0);var n=_.lastIndexOf(pe(e));-1===n&&(n=0);var o=r-n;o&&(g=!0,S(o))}(e)}))}}(r)}}var v=we(),b=c(v);v!==b&&_e(b);var w=f(),_=[pe(w)];function S(e){t.go(e)}var x=0;function O(e){1===(x+=e)&&1===e?window.addEventListener(ye,y):0===x&&window.removeEventListener(ye,y)}var E=!1,k={length:t.length,action:"POP",location:w,createHref:function(e){var t=document.querySelector("base"),r="";return t&&t.getAttribute("href")&&(r=be(window.location.href)),r+"#"+c(s+pe(e))},push:function(e,t){var r="PUSH",n=de(e,void 0,void 0,k.location);p.confirmTransitionTo(n,r,o,(function(e){if(e){var t=pe(n),o=c(s+t);if(we()!==o){m=t,function(e){window.location.hash=e}(o);var i=_.lastIndexOf(pe(k.location)),a=_.slice(0,i+1);a.push(t),_=a,h({action:r,location:n})}else h()}}))},replace:function(e,t){var r="REPLACE",n=de(e,void 0,void 0,k.location);p.confirmTransitionTo(n,r,o,(function(e){if(e){var t=pe(n),o=c(s+t);we()!==o&&(m=t,_e(o));var i=_.indexOf(pe(k.location));-1!==i&&(_[i]=t),h({action:r,location:n})}}))},go:S,goBack:function(){S(-1)},goForward:function(){S(1)},block:function(e){void 0===e&&(e=!1);var t=p.setPrompt(e);return E||(O(1),E=!0),function(){return E&&(E=!1,O(-1)),t()}},listen:function(e){var t=p.appendListener(e);return O(1),function(){O(-1),t()}}};return k}();function os(e){return ns.push(`/collections/${e}`)}function is(e){return ns.replace(`/collections/${e}/new`)}function as(e,t){return ns.replace(`/collections/${e}/entries/${t}`)}const ss="UNPUBLISHED_ENTRY_REQUEST",ls="UNPUBLISHED_ENTRY_SUCCESS",cs="UNPUBLISHED_ENTRY_REDIRECT",us="UNPUBLISHED_ENTRIES_REQUEST",fs="UNPUBLISHED_ENTRIES_SUCCESS",ps="UNPUBLISHED_ENTRIES_FAILURE",ds="UNPUBLISHED_ENTRY_PERSIST_REQUEST",hs="UNPUBLISHED_ENTRY_PERSIST_SUCCESS",gs="UNPUBLISHED_ENTRY_PERSIST_FAILURE",ms="UNPUBLISHED_ENTRY_STATUS_CHANGE_REQUEST",ys="UNPUBLISHED_ENTRY_STATUS_CHANGE_SUCCESS",vs="UNPUBLISHED_ENTRY_STATUS_CHANGE_FAILURE",bs="UNPUBLISHED_ENTRY_PUBLISH_REQUEST",ws="UNPUBLISHED_ENTRY_PUBLISH_SUCCESS",_s="UNPUBLISHED_ENTRY_PUBLISH_FAILURE",Ss="UNPUBLISHED_ENTRY_DELETE_SUCCESS";function xs(e,t){return{type:fs,payload:{entries:e,pages:t}}}function Os(e,t){return{type:ds,payload:{collection:e.get("name"),slug:t}}}function Es(e,t){return{type:hs,payload:{collection:e.get("name"),entry:t}}}function ks(e,t,r){return{type:gs,payload:{error:e,collection:t.get("name"),slug:r},error:e}}function Cs(e,t){return async(r,n)=>{const o=n(),i=rf(o.config);if(!Qt()(o.editorialWorkflow.toJS(),"pages.ids",!1))try{const{entries:e,pagination:t}=await i.unpublishedEntries(o.collections);r(xs(e,t))}catch(e){}r(function(e,t){return{type:ss,payload:{collection:e.get("name"),slug:t}}}(e,t));try{const n=await i.unpublishedEntry(o,e,t),a=await Promise.all(n.mediaFiles.filter((e=>e.draft)).map((({url:e,file:t,path:r})=>Tr({path:r,url:e,file:t}))));r(Qa(a)),r(function(e,t){return{type:ls,payload:{collection:e.get("name"),entry:t}}}(e,n)),r(bl(n))}catch(n){n.name===pr.EDITORIAL_WORKFLOW_ERROR&&n.notUnderEditorialWorkflow?(r(function(e,t){return{type:cs,payload:{collection:e.get("name"),slug:t}}}(e,t)),r(Sl(e,t))):r(ea({message:{key:"ui.toast.onFailToLoadEntries",details:n},type:"error",dismissAfter:8e3}))}}}function Ts(e){return(t,r)=>{const n=r(),o=rf(n.config),i=Qt()(n.editorialWorkflow.toJS(),"pages.ids",!1);n.config.publish_mode!==Zn||i||(t({type:us}),o.unpublishedEntries(e).then((e=>t(xs(e.entries,e.pagination)))).catch((e=>{t(ea({message:{key:"ui.toast.onFailToLoadEntries",details:e},type:"error",dismissAfter:8e3})),t(function(e){return{type:ps,error:"Failed to load entries",payload:e}}(e)),Promise.reject(e)})))}}function Ps(e,t,r,n){return(o,i)=>{if(r===n)return;const a=i(),s=rf(a.config);o(function(e,t){return{type:ms,payload:{collection:e,slug:t}}}(e,t)),s.updateUnpublishedEntryStatus(e,t,n).then((()=>{o(ea({message:{key:"ui.toast.entryUpdated"},type:"success",dismissAfter:4e3})),o(function(e,t,r){return{type:ys,payload:{collection:e,slug:t,newStatus:r}}}(e,t,n))})).catch((r=>{o(ea({message:{key:"ui.toast.onFailToUpdateStatus",details:r},type:"error",dismissAfter:8e3})),o(function(e,t){return{type:vs,payload:{collection:e,slug:t}}}(e,t))}))}}function js(e,t){return(r,n)=>{const o=n(),i=rf(o.config);return r(function(e,t){return{type:"UNPUBLISHED_ENTRY_DELETE_REQUEST",payload:{collection:e,slug:t}}}(e,t)),i.deleteUnpublishedEntry(e,t).then((()=>{r(ea({message:{key:"ui.toast.onDeleteUnpublishedChanges"},type:"success",dismissAfter:4e3})),r(function(e,t){return{type:Ss,payload:{collection:e,slug:t}}}(e,t))})).catch((n=>{r(ea({message:{key:"ui.toast.onDeleteUnpublishedChanges",details:n},type:"error",dismissAfter:8e3})),r(function(e,t){return{type:"UNPUBLISHED_ENTRY_DELETE_FAILURE",payload:{collection:e,slug:t}}}(e,t))}))}}function Rs(e,t){return async(r,n)=>{const o=n(),i=o.collections,a=rf(o.config),s=Vf(o,e,t);r(function(e,t){return{type:bs,payload:{collection:e,slug:t}}}(e,t));try{await a.publishUnpublishedEntry(s),r(ka()),r(ea({message:{key:"ui.toast.entryPublished"},type:"success",dismissAfter:4e3})),r(function(e,t){return{type:ws,payload:{collection:e,slug:t}}}(e,t));const n=i.get(e);if(!n.has("nested"))return r(Sl(n,t));{r(kl(n));const e=Qu(n,s.get("path"));Sl(n,e),t!==e&&cc(o.entryDraft)&&as(n.get("name"),e)}}catch(n){r(ea({message:{key:"ui.toast.onFailToPublishEntry",details:n},type:"error",dismissAfter:8e3})),r(function(e,t){return{type:_s,payload:{collection:e,slug:t}}}(e,t))}}}const Ms=(0,Qe.Map)({entry:(0,Qe.Map)(),fieldsMetaData:(0,Qe.Map)(),fieldsErrors:(0,Qe.Map)(),hasChanged:!1,key:""});function As(e,t){if(!jc(e))return;const r=t.getIn(["entry","meta"]),n=r&&r.get("path"),o=Qt()(e.toJS(),["meta","path","index_file"]),i=vc(e);return n&&(0,dr.join)(e.get("folder"),n,`${o}.${i}`)}function Is(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ds(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Is(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Is(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Ls="ENTRY_REQUEST",Ns="ENTRY_SUCCESS",$s="ENTRY_FAILURE",Fs="ENTRIES_REQUEST",Bs="ENTRIES_SUCCESS",Us="ENTRIES_FAILURE",zs="SORT_ENTRIES_REQUEST",qs="SORT_ENTRIES_SUCCESS",Ws="SORT_ENTRIES_FAILURE",Hs="FILTER_ENTRIES_REQUEST",Vs="FILTER_ENTRIES_SUCCESS",Gs="FILTER_ENTRIES_FAILURE",Ks="GROUP_ENTRIES_REQUEST",Ys="GROUP_ENTRIES_SUCCESS",Js="GROUP_ENTRIES_FAILURE",Qs="DRAFT_CREATE_FROM_ENTRY",Xs="DRAFT_CREATE_EMPTY",Zs="DRAFT_DISCARD",el="DRAFT_CHANGE_FIELD",tl="DRAFT_VALIDATION_ERRORS",rl="DRAFT_CLEAR_ERRORS",nl="DRAFT_LOCAL_BACKUP_RETRIEVED",ol="DRAFT_CREATE_FROM_LOCAL_BACKUP",il="DRAFT_CREATE_DUPLICATE_FROM_ENTRY",al="ENTRY_PERSIST_REQUEST",sl="ENTRY_PERSIST_SUCCESS",ll="ENTRY_PERSIST_FAILURE",cl="ENTRY_DELETE_SUCCESS",ul="ADD_DRAFT_ENTRY_MEDIA_FILE",fl="REMOVE_DRAFT_ENTRY_MEDIA_FILE",pl="CHANGE_VIEW_STYLE";function dl(e){return{type:Fs,payload:{collection:e.get("name")}}}function hl(e,t,r,n,o=!0){return{type:Bs,payload:{collection:e.get("name"),entries:t,page:r,cursor:pr.Cursor.create(n),append:o}}}function gl(e,t){return{type:Us,error:"Failed to load entries",payload:t.toString(),meta:{collection:e.get("name")}}}async function ml(e,t){const r=rf(e.config),n=Gf(e,t.get("name"),"listEntries"),o=n?Ai(e.integrations,r.getToken,n):r;return await o.listAllEntries(t)}function yl(e,t,r=Ro.Ascending){return async(n,o)=>{const i=o(),a=ec(i.entries,e.get("name"));if(n({type:zs,payload:{collection:e.get("name"),key:t,direction:r}}),!a)try{const o=await ml(i,e);n({type:qs,payload:{collection:e.get("name"),key:t,direction:r,entries:o}})}catch(o){n({type:Ws,payload:{collection:e.get("name"),key:t,direction:r,error:o}})}}}function vl(e,t){return{type:cl,payload:{collectionName:e.get("name"),entrySlug:t}}}function bl(e){return{type:Qs,payload:{entry:e}}}function wl(){return{type:rl}}function _l({id:e}){return{type:fl,payload:{id:e}}}function Sl(e,t){return async(r,n)=>{await Fa(r,n()),r(function(e,t){return{type:Ls,payload:{collection:e.get("name"),slug:t}}}(e,t));try{const o=await xl(n(),e,t);r(function(e,t){return{type:Ns,payload:{collection:e.get("name"),entry:t}}}(e,o)),r(bl(o))}catch(n){r(ea({message:{details:n.message,key:"ui.toast.onFailToLoadEntries"},type:"error",dismissAfter:8e3})),r(function(e,t,r){return{type:$s,payload:{error:e,collection:t.get("name"),slug:r}}}(n,e,t))}}}async function xl(e,t,r){const n=rf(e.config);return await n.getEntry(e,t,r)}const Ol=(0,Qe.fromJS)({append_next:{action:"next",append:!0}});function El(e){return pr.Cursor.create(e).updateStore("actions",(e=>e.union(Ol.filter((t=>e.has(t.get("action")))).keySeq())))}function kl(e,t=0){return async(r,n)=>{if(e.get("isFetching"))return;const o=n(),i=Yl(o.entries,e.get("name"));if(i&&i.length>0){const t=i[0];return r(yl(e,t.get("key"),t.get("direction")))}const a=rf(o.config),s=Gf(o,e.get("name"),"listEntries"),l=s?Ai(o.integrations,a.getToken,s):a,c=!!(t&&!isNaN(t)&&t>0);r(dl(e));try{const n=e.has("nested")||Lc(e);let o=await(n?l.listAllEntries(e).then((e=>({entries:e}))):l.listEntries(e,t));o=Ds(Ds({},o),{},{cursor:s?pr.Cursor.create({actions:["next"],meta:{usingOldPaginationAPI:!0},data:{nextPage:t+1}}):pr.Cursor.create(o.cursor)}),r(hl(e,o.cursor.meta.get("usingOldPaginationAPI")?o.entries.reverse():o.entries,o.pagination,El(o.cursor),c))}catch(t){return r(ea({message:{details:t,key:"ui.toast.onFailToLoadEntries"},type:"error",dismissAfter:8e3})),Promise.reject(r(gl(e,t)))}}}function Cl(e,t=(()=>!1)){return e.reduce(((e,r)=>{const n=e,o=r;if(t(o))return n;const i=o.get("field")||o.get("fields"),a="list"==o.get("widget"),s=o.get("name"),l=o.get("default",null);if(Qe.List.isList(i)||Qe.Map.isMap(i)){if(a&&Qe.List.isList(l))n[s]=l;else{const e=Qe.List.isList(i)?i:(0,Qe.List)([i]),r=a?[Cl(e,t)]:Cl(e,t);c=r,[[{}],{}].some((e=>bi()(c,e)))||(n[s]=r)}return n}var c;return null!==l&&(n[s]=l),n}),{})}function Tl({entry:e}){return e.get("mediaFiles").toArray().filter((e=>e.get("draft"))).map((e=>Tr({path:e.get("path"),file:e.get("file"),url:e.get("url"),field:e.get("field")})))}function Pl(e,t){const r=yc(e,t.get("slug"));function n(e){return function(e,t){return Gi(e,t,"serialize")}(e,r)}const o=n(t.get("data"));let i=t.set("data",o);return Lc(e)&&(i=function(e,t,r){const{locales:n,defaultLocale:o}=Nc(e);return n.filter((e=>e!==o)).forEach((e=>{const n=Uc(e);t=t.setIn(n,r(t.getIn(n)))})),t}(e,i,n)),i}function jl(e,t,r){return{error:{type:Ki.CUSTOM,message:r(`editor.editorControlPane.widget.${t}`,{path:e})}}}const Rl="VIEW_STYLE_LIST",Ml="VIEW_STYLE_GRID";function Al(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Il(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Al(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Al(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const{keyToPathArray:Dl}=hr.stringTemplate;let Ll,Nl,$l,Fl,Bl;const Ul="decap-cms.entries.sort",zl="decap-cms.entries.viewStyle",ql=jo()((()=>{const e=localStorage.getItem(Ul);if(e)try{const t=JSON.parse(e);let r=(0,Qe.Map)();return Object.entries(t).forEach((([e,t])=>{let n=(0,Qe.OrderedMap)();Zt()(Object.values(t),["index"]).forEach((e=>{const{key:t,direction:r}=e;n=n.set(t,(0,Qe.fromJS)({key:t,direction:r}))})),r=r.set(e,n)})),r}catch(e){return(0,Qe.Map)()}return(0,Qe.Map)()}));function Wl(e){if(e){const t={};e.keySeq().forEach((r=>{const n=r;e.get(n).valueSeq().toJS().map(((e,t)=>Il(Il({},e),{},{index:t}))).forEach((e=>{Yt()(t,[n,e.key],e)}))})),localStorage.setItem(Ul,JSON.stringify(t))}else localStorage.removeItem(Ul)}const Hl=jo()((()=>localStorage.getItem(zl)||(localStorage.setItem(zl,Rl),Rl)));function Vl(e,t){const r=e.get("sort");return null==r?void 0:r.get(t)}function Gl(e,t){const r=e.get("filter");return(null==r?void 0:r.get(t))||(0,Qe.Map)()}function Kl(e,t){const r=e.get("group");return(null==r?void 0:r.get(t))||(0,Qe.Map)()}function Yl(e,t){const r=Vl(e,t),n=(null==r?void 0:r.valueSeq().filter((e=>(null==e?void 0:e.get("direction"))!==Ro.None)).toArray())||[];return n}function Jl(e,t,r){return e.getIn(["entities",`${t}.${r}`])}function Ql(e,t){return e.getIn(["pages",t,"ids"],(0,Qe.List)())}function Xl(e,t){const r=Ql(e,t),n=r&&r.map((r=>Jl(e,t,r)));return n}function Zl(e,t){const r=t.get("name");let n=Xl(e,r);const o=Yl(e,r);if(o&&o.length>0){const e=o.map((e=>function(e,t){return t===So?"updatedOn":t!==_o||Oc(e,t)?`data.${t}`:"author"}(t,e.get("key")))),r=o.map((e=>e.get("direction")===Ro.Ascending?"asc":"desc"));n=(0,Qe.fromJS)(To()(n.toJS(),e,r))}const i=function(e,t){const r=Gl(e,t),n=(null==r?void 0:r.valueSeq().filter((e=>!0===(null==e?void 0:e.get("active")))).toArray())||[];return n}(e,r);return i&&i.length>0&&(n=n.filter((e=>{const t=i.every((t=>{const r=t.get("pattern"),n=t.get("field"),o=(e.get("data")||(0,Qe.Map)()).getIn(Dl(n));return void 0!==o&&new RegExp(String(r)).test(String(o))}));return t})).toList()),n}function ec(e,t){return e.getIn(["pages",t,"isFetching"],!1)}const tc="DRAFT_MEDIA_FILES";function rc(e,t){const r=e.find((e=>(null==e?void 0:e.get("name"))===t));return r}function nc(e,t,r,n){if(!t)return!1;if(n&&n.has(e))return!0;if(t.has("files")){const n=rc(t.get("files"),r);if(n&&n.has(e))return!0}return!!t.has(e)}function oc(e,t,r,n,o,i,a){const s=i.filter((e=>e===o))[0];if(s)return yi(s.has(e)?s.get(e):`{{${e}}}`,n,r,a,e,t.slug);for(let s of i){s.has(e)||(s=s.set(e,`{{${e}}}`));const i=yi(s.get(e),n,r,a,e,t.slug);let l=null;if(s.has("fields")?l=oc(e,t,r,n,o,s.get("fields").toArray(),i):s.has("field")?l=oc(e,t,r,n,o,[s.get("field")],i):s.has("types")&&(l=oc(e,t,r,n,o,s.get("types").toArray(),i)),null!=l)return l}return null}function ic(e,t,r,n,o){let i=t[e];if(r.has(e)||(r=r.set(e,`{{${e}}}`)),r.has("files")){i=yi(r.get(e),n,r,i,e,t.slug);let a=rc(r.get("files"),null==n?void 0:n.get("slug"));if(a&&(a.has(e)||(a=a.set(e,`{{${e}}}`)),i=yi(a.get(e),n,r,i,e,t.slug),o)){const s=oc(e,t,r,n,o,a.get("fields").toArray(),i);null!==s&&(i=s)}}else if(i=yi(r.get(e),n,r,i,e,t.slug),o){const a=oc(e,t,r,n,o,r.get("fields").toArray(),i);null!==a&&(i=a)}return i}function ac(e,t,r,n){const o="media_folder";let i=e[o];if(nc(o,t,null==r?void 0:r.get("slug"),n)){const a=ic(o,e,t,r,n);if(a.startsWith("/"))i=(0,dr.join)(a);else{const e=null==r?void 0:r.get("path");i=e?(0,dr.join)((0,dr.dirname)(e),a):(0,dr.join)(t.get("folder"),tc)}}return tr()(i,"/")}function sc(e,t,r,n,o){if((0,pr.isAbsolutePath)(n))return n;const i=ac(e,t,r,o);return(0,dr.join)(i,(0,pr.basename)(n))}function lc(e,t,r,n,o){if((0,pr.isAbsolutePath)(r))return r;const i="public_folder";let a=e[i];return nc(i,t,null==n?void 0:n.get("slug"),o)&&(a=ic(i,e,t,n,o)),(0,pr.isAbsolutePath)(a)?function(e,...t){return zo()(e,...t)}(a,(0,pr.basename)(r)):(0,dr.join)(a,(0,pr.basename)(r))}function cc(e){const t=e.get("entry");return t&&!t.isEmpty()}function uc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?uc(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const{keyToPathArray:pc}=hr.stringTemplate,dc=(0,Qe.fromJS)({}),hc={[wo]:{entryExtension(e){const t=e.get("extension")||Qt()(Bn(Bn({},zn),Nn()),e.get("format")||"frontmatter");if(!t)throw new Error(`No extension found for format ${e.get("format")}`);return t.replace(/^\./,"")},fields:e=>e.get("fields"),entryPath(e,t){return`${e.get("folder").replace(/\/$/,"")}/${t}.${this.entryExtension(e)}`},entrySlug(e,t){var r;const n=e.get("folder").replace(/\/$/,"");return null===(r=t.split(n+"/").pop())||void 0===r?void 0:r.replace(new RegExp(`\\.${mo()(this.entryExtension(e))}$`),"")},allowNewEntries:e=>e.get("create"),allowDeletion:e=>e.get("delete",!0),templateName:e=>e.get("name")},[bo]:{fileForEntry(e,t){const r=e.get("files");return r&&r.filter((e=>(null==e?void 0:e.get("name"))===t)).get(0)},fields(e,t){const r=this.fileForEntry(e,t);return r&&r.get("fields")},entryPath(e,t){const r=this.fileForEntry(e,t);return r&&r.get("file")},entrySlug(e,t){const r=e.get("files").filter((e=>(null==e?void 0:e.get("file"))===t)).get(0);return r&&r.get("name")},entryLabel(e,t){const r=this.fileForEntry(e,t);return r&&r.get("label")},allowNewEntries:()=>!1,allowDeletion:e=>e.get("delete",!1),templateName:(e,t)=>t}};function gc(e){const t=e.reduce(((e,t)=>{if(t.has("media_folder")&&(e=[...e,t]),t.has("fields")){var r;const n=null===(r=t.get("fields"))||void 0===r?void 0:r.toArray();e=[...e,...gc(n)]}else if(t.has("field")){const r=t.get("field");e=[...e,...gc([r])]}else if(t.has("types")){var n;const r=null===(n=t.get("types"))||void 0===n?void 0:n.toArray();e=[...e,...gc(r)]}return e}),[]);return t}function mc(e,t){var r;return null===(r=e.get("files"))||void 0===r?void 0:r.toArray().find((e=>e.get("name")===t))}function yc(e,t){return hc[e.get("type")].fields(e,t)}function vc(e){return hc[wo].entryExtension(e)}function bc(e,t){return hc[bo].entryLabel(e,t)}function wc(e,t){return hc[e.get("type")].entryPath(e,t)}function _c(e,t){return hc[e.get("type")].entrySlug(e,t)}function Sc(e){return hc[e.get("type")].allowDeletion(e)}function xc(e,t=""){let r=e.map((e=>`${t}${e.get("name")}`));return e.forEach(((e,t)=>{if(e.has("fields")){var n;const o=null===(n=e.get("fields"))||void 0===n?void 0:n.toArray();r=[...r,...xc(o,`${r[t]}.`)]}else if(e.has("field")){const n=e.get("field");r=[...r,...xc([n],`${r[t]}.`)]}else if(e.has("types")){var o;const n=null===(o=e.get("types"))||void 0===o?void 0:o.toArray();r=[...r,...xc(n,`${r[t]}.`)]}})),r}function Oc(e,t){const r=pc(t);let n,o,i=e.get("fields",(0,Qe.List)()).toArray();for(;(n=r.shift())&&i;){var a,s,l,c,u;if(o=i.find((e=>e.get("name")===n)),null!==(a=o)&&void 0!==a&&a.has("fields"))i=null===(c=o)||void 0===c||null===(u=c.get("fields"))||void 0===u?void 0:u.toArray();else if(null!==(s=o)&&void 0!==s&&s.has("field")){var f;i=[null===(f=o)||void 0===f?void 0:f.get("field")]}else if(null!==(l=o)&&void 0!==l&&l.has("types")){var p,d;i=null===(p=o)||void 0===p||null===(d=p.get("types"))||void 0===d?void 0:d.toArray()}}return o}function Ec(e,t,r=(()=>!1)){return r()||(e=e.map((e=>{const n=t(e);return r()?n:n.has("fields")?n.set("fields",Ec(n.get("fields"),t,r)):n.has("field")?n.set("field",Ec((0,Qe.List)([n.get("field")]),t,r).get(0)):n.has("types")?n.set("types",Ec(n.get("types"),t,r)):n})).toList()),e}function kc(e){const t=e.get("identifier_field"),r=t?[t,...Oo]:[...Oo],n=xc(e.get("fields",(0,Qe.List)()).toArray());return r.find((e=>n.find((t=>t.toLowerCase().trim()===e.toLowerCase().trim()))))}function Cc(e,t){if("title"===t&&e.get("identifier_field"))return kc(e);const r=ko[t],n=e.get("fields");let o;if(!n||!r)return null;const i=n.filter((e=>(null==e?void 0:e.get("widget","string"))===r.type)).map((e=>null==e?void 0:e.get("name")));if(o=i.filter((e=>-1!==r.synonyms.indexOf(e))),o&&o.size>0)return o.first();const a=n.filter((e=>-1!==r.secondaryTypes.indexOf(null==e?void 0:e.get("widget","string")))).map((e=>null==e?void 0:e.get("name")));return o=a.filter((e=>-1!==r.synonyms.indexOf(e))),o&&o.size>0?o.first():r.fallbackToFirstField&&i.size>0?i.first():(r.showError&&(s=`The Field ${t} is missing for the collection “${e.get("name")}”`,l=`Decap CMS tries to infer the entry ${t} automatically, but one couldn't be found for entries of the collection “${e.get("name")}”. Please check your site configuration.`,console.error(`%c ⛔ ${s}\n%c${l}\n\n`,"color: black; font-weight: bold; font-size: 16px; line-height: 50px;","color: black;")),null);var s,l}function Tc(e,t){const r=e.get("summary");if(r)return function(e,t,r){let n=t.get("data");const o=si(t,Cc(r,"date"))||null,i=n.getIn(ci(kc(r)));return n=ui(t.get("path"),n,r.get("folder")),t.get("author")&&!Oc(r,_o)&&(n=n.set(_o,t.get("author"))),t.get("updatedOn")&&!Oc(r,So)&&(n=n.set(So,t.get("updatedOn"))),ai(e,o,i,n)}(r,t,e);if(e.get("type")==bo){const r=bc(e,t.get("slug"));if(r)return r}const n=t.get("data"),o=Cc(e,"title"),i=o&&n.getIn(pc(o));return i||"title"===o?i:n.getIn(pc("title"))}function Pc(e,t,r){let n=Eo.map((n=>{const o=Cc(e,n);return!t.isGitBackend()||"author"!==n||o||r?o:_o})).filter(Boolean);return t.isGitBackend()&&!r&&(n=[So,...n]),n}function jc(e){var t;return e.has("folder")&&e.get("type")===wo&&e.has("meta")&&(null===(t=e.get("meta"))||void 0===t?void 0:t.has("path"))}function Rc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Mc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Rc(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Ac="i18n";let Ic=function(e){return e.MULTIPLE_FOLDERS="multiple_folders",e.MULTIPLE_FILES="multiple_files",e.SINGLE_FILE="single_file",e}({}),Dc=function(e){return e.TRANSLATE="translate",e.DUPLICATE="duplicate",e.NONE="none",e}({});function Lc(e){return e.has(Ac)}function Nc(e){if(!Lc(e))return{};const{structure:t,locales:r,default_locale:n}=e.get(Ac).toJS();return{structure:t,locales:r,defaultLocale:n}}function $c(e,t,r){return t!==r&&e.get(Ac)===Dc.TRANSLATE}function Fc(e,t,r){return t!==r&&e.get(Ac)===Dc.DUPLICATE}function Bc(e,t,r){return t!==r&&e.get(Ac)===Dc.NONE}function Uc(e){return[Ac,e,"data"]}function zc(e,t){return e!==t?Uc(e):["data"]}function qc(e,t,r,n,o){switch(e){case Ic.MULTIPLE_FOLDERS:return r.replace(`/${n}`,`/${o}/${n}`);case Ic.MULTIPLE_FILES:return r.replace(new RegExp(`${mo()(t)}$`),`${o}.${t}`);case Ic.SINGLE_FILE:default:return r}}function Wc(e,t,r){switch(e){case Ic.MULTIPLE_FOLDERS:{const e=r.split("/");return e.pop(),e.pop()}case Ic.MULTIPLE_FILES:return r.slice(0,-`.${t}`.length).split(".").pop();case Ic.SINGLE_FILE:default:return""}}function Hc(e,t,r,n){const{structure:o,locales:i}=Nc(e);return o===Ic.SINGLE_FILE?[r]:i.map((e=>qc(o,t,r,n,e)))}function Vc(e,t,r){switch(e){case Ic.MULTIPLE_FOLDERS:return t.replace(`${r}/`,"");case Ic.MULTIPLE_FILES:return t.replace(`.${r}`,"");case Ic.SINGLE_FILE:default:return t}}function Gc(e,t,r,n){let o=n.find((e=>e.locale===r));o||(o=n[0],console.warn(`Could not locale entry for default locale '${r}'`));const i=n.filter((e=>e.locale!==o.locale)).reduce(((e,{locale:t,value:r})=>{const n=Uc(t);return Yt()(e,n,r.data)}),{}),a=Vc(t,o.value.path,r),s=_c(e,a);return Mc(Mc(Mc({},o.value),{},{raw:""},i),{},{path:a,slug:s})}function Kc(e,t,r){const n=e.data[t]||{},o=r.filter((e=>e!==t)).map((t=>({locale:t,value:e.data[t]}))).filter((e=>e.value)).reduce(((e,t)=>Mc(Mc({},e),{},{[t.locale]:{data:t.value}})),{});return Mc(Mc({},e),{},{data:n,i18n:o,raw:""})}function Yc(e,t,r){const{structure:n,defaultLocale:o,locales:i}=Nc(e);if(n===Ic.SINGLE_FILE)return r.map((e=>Kc(e,o,i)));const a=vo()(r.map((e=>({locale:Wc(n,t,e.path),value:e}))),(({locale:e,value:t})=>Vc(n,t.path,e)));return Object.values(a).reduce(((t,r)=>[...t,Gc(e,n,o,r)]),[])}function Jc(e,t,r,n,o=[t.get("name")]){const i=e.getIn(["entry","data",...o]);return t.get(Ac)===Dc.DUPLICATE&&r.filter((e=>e!==n)).forEach((t=>{e=e.setIn(["entry",...zc(t,n),...o],i)})),t.has("field")&&!Qe.List.isList(i)?[t.get("field")].forEach((t=>{e=Jc(e,t,r,n,[...o,t.get("name")])})):t.has("fields")&&!Qe.List.isList(i)&&t.get("fields").toArray().forEach((t=>{e=Jc(e,t,r,n,[...o,t.get("name")])})),e}function Qc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Xc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qc(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Zc={type:"string",minLength:2,maxLength:10,pattern:"^[a-zA-Z-_]+$"},eu={type:"object",properties:{structure:{type:"string",enum:Object.values(Ic)},locales:{type:"array",minItems:1,items:Zc,uniqueItems:!0},default_locale:Zc}},tu=Xc(Xc({},eu),{},{required:["structure","locales"]}),ru={oneOf:[{type:"boolean"},eu]},nu={oneOf:[{type:"boolean"},{type:"string",enum:Object.values(Dc)}]};function ou(){const e=ho();return{$id:`fields_${e}`,type:"array",minItems:1,items:{$id:`field_${e}`,type:"object",properties:{name:{type:"string"},label:{type:"string"},widget:{type:"string"},required:{type:"boolean"},i18n:nu,hint:{type:"string"},pattern:{type:"array",minItems:2,items:[{oneOf:[{type:"string"},{instanceof:"RegExp"}]},{type:"string"}]},field:{$ref:`field_${e}`},fields:{$ref:`fields_${e}`},types:{$ref:`fields_${e}`}},select:{$data:"0/widget"},selectCases:Xc({},su()),required:["name"]},uniqueItemProperties:["name"]}}const iu={type:"array",minItems:1,items:{type:"object",properties:{label:{type:"string"},field:{type:"string"},pattern:{oneOf:[{type:"boolean"},{type:"string"}]}},additionalProperties:!1,required:["label","field","pattern"]}},au={type:"array",minItems:1,items:{type:"object",properties:{label:{type:"string"},field:{type:"string"},pattern:{type:"string"}},additionalProperties:!1,required:["label","field"]}};function su(){const e=Cn().map((e=>({[e.name]:e.schema})));return Object.assign(...e)}class lu extends(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Error)){constructor(e,...t){const r=e.map((({message:e,instancePath:t})=>{const r=t.slice(1).split("/").map((e=>e.match(/^\d+$/)?`[${e}]`:`.${e}`)).join("").slice(1);return`${r?`'${r}'`:"config"} ${e}`})).join("\n");super(r,...t),this.errors=e,this.message=r}toString(){return this.message}}const cu=["hooks","collections","provider"];function uu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fu(e){const t=(e.integrations||[]).reduce(((t,r)=>{const{hooks:n,collections:o,provider:i}=r,a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(r,cu);if(t.providers[i]=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?uu(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},a),!o)return n.forEach((e=>{t.hooks[e]=i})),t;const s="*"===o?e.collections.map((e=>e.name)):o;return s.forEach((e=>{n.forEach((r=>{t.hooks[e]?t.hooks[e][r]=i:t.hooks[e]={[r]:i}}))})),t}),{providers:{},hooks:{}});return(0,Qe.fromJS)(t)}const pu=(0,Qe.fromJS)({providers:{},hooks:{}});function du(e,t,r){return t?e.getIn(["hooks",t,r],!1):e.getIn(["hooks",r],!1)}const hu=["sortableFields"];function gu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gu(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const yu="CONFIG_REQUEST",vu="CONFIG_SUCCESS",bu="CONFIG_FAILURE";function wu(e){return"types"in e||"field"in e}function _u(e,t){return e.map((e=>{const r=t(e);return function(e){return"fields"in e}(r)?mu(mu({},r),{},{fields:_u(r.fields,t)}):wu(r)&&r.field?mu(mu({},r),{},{field:_u([r.field],t)[0]}):wu(r)&&r.types?mu(mu({},r),{},{types:_u(r.types,t)}):r}))}function Su(e){return"media_folder"in e&&!("public_folder"in e)?mu(mu({},e),{},{public_folder:e.media_folder}):e}const xu={dateFormat:"date_format",timeFormat:"time_format",pickerUtc:"picker_utc",editorComponents:"editor_components",valueType:"value_type",valueField:"value_field",searchFields:"search_fields",displayFields:"display_fields",optionsLength:"options_length"};function Ou(e){const t=Object.keys(xu).filter((t=>t in e)).map((t=>{const r=xu[t];return console.warn(`Field ${e.name} is using a deprecated configuration '${t}'. Please use '${r}'`),{[r]:e[t]}}));return Object.assign({},e,...t)}function Eu(e){return!0===e[Ac]?mu(mu({},e),{},{[Ac]:Dc.TRANSLATE}):!1!==e[Ac]&&e[Ac]?e:mu(mu({},e),{},{[Ac]:Dc.NONE})}function ku(e,t){if("boolean"==typeof e)return t;{const r=e.locales||t.locales,n=e.default_locale||r[0],o=Qn()(t,e);return o.locales=r,o.default_locale=n,Pu(o),o}}function Cu(e,t){return _u(e,t?Eu:e=>{const t=mu({},e);return delete t[Ac],t})}function Tu(e){if(e&&e.structure!==Ic.SINGLE_FILE)throw new Error(`i18n configuration for files collections is limited to ${Ic.SINGLE_FILE} structure`)}function Pu(e){if(e&&e.default_locale&&!e.locales.includes(e.default_locale))throw new Error(`i18n locales '${e.locales.join(", ")}' are missing the default locale ${e.default_locale}`)}function ju(e,t){return!!du(fu((0,Qe.fromJS)(e)),t.name,"listEntries")}function Ru(e){return{type:vu,payload:e}}function Mu(e){return{type:bu,error:"Error loading config",payload:e}}function Au(e={},t){return window.CMS_CONFIG?Ru(window.CMS_CONFIG):async r=>{r({type:yu});try{const n=function(){const e=document.querySelector('link[rel="cms-config-url"]');return e&&{"text/yaml":"yaml","application/x-yaml":"yaml"}[e.type]&&e.href?(console.log(`Using config file path: "${e.href}"`),e.href):"config.yml"}(),o=!Gn()(e),i=!1===e.load_config_file?{}:await async function(e,t){const r=await fetch(e,{credentials:"same-origin"}).catch((e=>e));if(r instanceof Error||200!==r.status){if(t)return{};const e=r instanceof Error?r.message:r.status;throw new Error(`Failed to load config.yml (${e})`)}const n=r.headers.get("Content-Type")||"Not-Found";return-1===n.indexOf("yaml")&&(console.log(`Response for ${e} was not yaml. (Content-Type: ${n})`),t)?{}:function(e){const t=mr().parse(e,{maxAliasCount:-1,prettyErrors:!0,merge:!0});if("undefined"!=typeof window&&"string"==typeof window.CMS_ENV&&t[window.CMS_ENV]){const e=Object.keys(t[window.CMS_ENV]);for(const r of e)t[r]=t[window.CMS_ENV][r]}return t}(await r.text())}(n,o),a=Qn()(i,e);!function(e){const t=new(no())({allErrors:!0,$data:!0,strict:!1});if((0,oo.uniqueItemProperties)(t),(0,oo.select)(t),(0,oo.instanceof)(t),(0,oo.prohibited)(t),ao()(t),!t.validate({type:"object",properties:{backend:{type:"object",properties:{name:{type:"string",examples:["test-repo"]},auth_scope:{type:"string",examples:["repo","public_repo"],enum:["repo","public_repo"]},cms_label_prefix:{type:"string",minLength:1},open_authoring:{type:"boolean",examples:[!0]}},required:["name"]},local_backend:{oneOf:[{type:"boolean"},{type:"object",properties:{url:{type:"string",examples:["http://localhost:8081/api/v1"]},allowed_hosts:{type:"array",items:{type:"string"}}},additionalProperties:!1}]},locale:{type:"string",examples:["en","fr","de"]},i18n:tu,site_url:{type:"string",examples:["https://example.com"]},display_url:{type:"string",examples:["https://example.com"]},logo_url:{type:"string",examples:["https://example.com/images/logo.svg"]},show_preview_links:{type:"boolean"},media_folder:{type:"string",examples:["assets/uploads"]},public_folder:{type:"string",examples:["/uploads"]},media_folder_relative:{type:"boolean"},media_library:{type:"object",properties:{name:{type:"string",examples:["uploadcare"]},config:{type:"object"}},required:["name"]},publish_mode:{type:"string",enum:["simple","editorial_workflow"],examples:["editorial_workflow"]},slug:{type:"object",properties:{encoding:{type:"string",enum:["unicode","ascii"]},clean_accents:{type:"boolean"}}},collections:{type:"array",minItems:1,items:{type:"object",properties:{name:{type:"string"},label:{type:"string"},label_singular:{type:"string"},description:{type:"string"},folder:{type:"string"},files:{type:"array",items:{type:"object",properties:{name:{type:"string"},label:{type:"string"},label_singular:{type:"string"},description:{type:"string"},file:{type:"string"},preview_path:{type:"string"},preview_path_date_field:{type:"string"},fields:ou()},required:["name","label","file","fields"]},uniqueItemProperties:["name"]},identifier_field:{type:"string"},summary:{type:"string"},slug:{type:"string"},path:{type:"string"},preview_path:{type:"string"},preview_path_date_field:{type:"string"},create:{type:"boolean"},publish:{type:"boolean"},hide:{type:"boolean"},editor:{type:"object",properties:{preview:{type:"boolean"}}},format:{type:"string"},extension:{type:"string"},frontmatter_delimiter:{type:["string","array"],minItems:2,maxItems:2,items:{type:"string"}},fields:ou(),sortable_fields:{type:"array",items:{type:"string"}},sortableFields:{type:"array",items:{type:"string"}},view_filters:iu,view_groups:au,nested:{type:"object",properties:{depth:{type:"number",minimum:1,maximum:1e3},summary:{type:"string"}},required:["depth"]},meta:{type:"object",properties:{path:{type:"object",properties:{label:{type:"string"},widget:{type:"string"},index_file:{type:"string"}},required:["label","widget","index_file"]}},additionalProperties:!1,minProperties:1},i18n:ru},required:["name","label"],oneOf:[{required:["files"]},{required:["folder","fields"]}],not:{required:["sortable_fields","sortableFields"]},if:{required:["extension"]},then:{if:{properties:{extension:{enum:Object.keys(qn)}}},else:{required:["format"]}},dependencies:{frontmatter_delimiter:{properties:{format:{enum:Un}},required:["format"]}}},uniqueItemProperties:["name"]},editor:{type:"object",properties:{preview:{type:"boolean"}}}},required:["backend","collections"],anyOf:[{required:["media_folder"]},{required:["media_library"]}]},e)){const e=t.errors.map((e=>{switch(e.keyword){case"uniqueItemProperties":{const t=e.instancePath||"";let r=e;return t.endsWith("/fields")?r=Xc(Xc({},e),{},{message:"fields names must be unique"}):t.endsWith("/files")?r=Xc(Xc({},e),{},{message:"files names must be unique"}):t.endsWith("/collections")&&(r=Xc(Xc({},e),{},{message:"collections names must be unique"})),r}case"instanceof":{const t=e.instancePath||"";let r=e;return/fields\/\d+\/pattern\/\d+/.test(t)&&(r=Xc(Xc({},e),{},{message:"must be a regular expression"})),r}default:return e}}));throw console.error("Config Errors",e),new lu(e)}}(a);const s=function(e){const{collections:t=[]}=e,r=t.map((e=>{const{fields:t,files:r}=e;let n=e;if(t){const e=_u(t,Ou);n=mu(mu({},n),{},{fields:e})}if(r){const e=r.map((e=>{const t=_u(e.fields,Ou);return mu(mu({},e),{},{fields:t})}));n=mu(mu({},n),{},{files:e})}if(n.sortableFields){const{sortableFields:t}=n;n=mu(mu({},function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(n,hu)),{},{sortable_fields:t}),console.warn(`Collection ${e.name} is using a deprecated configuration 'sortableFields'. Please use 'sortable_fields'`)}return n}));return mu(mu({},e),{},{collections:r})}(await async function(e){if(!e.local_backend)return e;const{proxyUrl:t,publish_modes:r,type:n}=await async function(e){if(!["localhost","127.0.0.1",..."boolean"==typeof e?[]:(null==e?void 0:e.allowed_hosts)||[]].includes(location.hostname)||!e)return{};const t="http://localhost:8081/api/v1",r=!0===e?t:e.url||t.replace("localhost",location.hostname);try{console.log(`Looking for Decap CMS Proxy Server at '${r}'`);const e=await fetch(`${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"info"})}),{repo:t,publish_modes:n,type:o}=await e.json();return"string"==typeof t&&Array.isArray(n)&&"string"==typeof o?(console.log(`Detected Decap CMS Proxy Server at '${r}' with repo: '${t}'`),{proxyUrl:r,publish_modes:n,type:o}):(console.log(`Decap CMS Proxy Server not detected at '${r}'`),{})}catch{return console.log(`Decap CMS Proxy Server not detected at '${r}'`),{}}}(e.local_backend);return t?Gt(e,(e=>{e.backend.name="proxy",e.backend.proxy_url=t,e.publish_mode&&(e.publish_mode=function(e,t,r){if(e.publish_mode&&t&&!t.includes(e.publish_mode)){const n=t[0];return console.log(`'${e.publish_mode}' is not supported by '${r}' backend, switching to '${n}'`),n}return e.publish_mode}(e,r,n))})):e}(a)),l=Gt(s,(e=>{e.publish_mode=e.publish_mode||Xn,e.slug=e.slug||{},e.collections=e.collections||[],!e.display_url&&e.site_url&&(e.display_url=e.site_url);const t=`/${Yn()(e.media_folder,"/")}`;"public_folder"in e||(e.public_folder=t),"encoding"in e.slug||(e.slug.encoding="unicode"),"clean_accents"in e.slug||(e.slug.clean_accents=!1),"sanitize_replacement"in e.slug||(e.slug.sanitize_replacement="-");const r=e[Ac];r&&(r.default_locale=r.default_locale||r.locales[0]),Pu(r);const n=tf(e);for(const t of e.collections){"publish"in t||(t.publish=!0);let o=t[Ac];r&&o?(o=ku(o,r),t[Ac]=o):(o=void 0,delete t[Ac]),t.fields&&(t.fields=Cu(t.fields,Boolean(o)));const{folder:i,files:a,view_filters:s,view_groups:l,meta:c}=t;if(i&&(t.type=wo,t.path&&!t.media_folder&&(t.media_folder=""),"media_folder"in t&&!("public_folder"in t)&&(t.public_folder=t.media_folder),t.fields&&(t.fields=_u(t.fields,Su)),t.folder=tr()(i,"/"),c&&c.path)){const e=mu({name:"path",meta:!0,required:!0},c.path);t.fields=[e,...t.fields||[]]}if(a){t.type=bo,Tu(o),delete t.nested,delete t.meta;for(const e of a){e.file=Yn()(e.file,"/"),"media_folder"in e&&!("public_folder"in e)&&(e.public_folder=e.media_folder),e.fields&&(e.fields=_u(e.fields,Su));let t=e[Ac];t&&o?(t=ku(t,o),e[Ac]=t):(t=void 0,delete e[Ac]),Tu(t),e.fields&&(e.fields=Cu(e.fields,Boolean(t)))}}t.sortable_fields||(t.sortable_fields=Pc((0,Qe.fromJS)(t),n,ju(e,t))),t.view_filters=(s||[]).map((e=>mu(mu({},e),{},{id:`${e.field}__${e.pattern}`}))),t.view_groups=(l||[]).map((e=>mu(mu({},e),{},{id:`${e.field}__${e.pattern}`}))),e.editor&&!t.editor&&(t.editor={preview:e.editor.preview})}}));r(Ru(l)),"function"==typeof t&&t()}catch(e){throw r(Mu(e)),e}}}function Iu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Du(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Iu(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Iu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Lu(e){return e.locale||"en"}function Nu(e){return e.publish_mode===Zn}const $u=Gt(((e,t)=>{switch(t.type){case yu:e.isFetching=!0;break;case vu:return Du(Du({},t.payload),{},{isFetching:!1,error:void 0});case bu:e.isFetching=!1,e.error=t.payload.toString()}}),{isFetching:!0}),Fu=["field"];function Bu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Uu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bu(Object(r),!0).forEach((function(t){zu(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function zu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{extractTemplateVars:qu,dateParsers:Wu,expandPath:Hu}=hr.stringTemplate;class Vu{constructor(){zu(this,"storageKey","decap-cms-user")}retrieve(){const e=window.localStorage.getItem(this.storageKey);return e&&JSON.parse(e)}store(e){window.localStorage.setItem(this.storageKey,JSON.stringify(e))}logout(){window.localStorage.removeItem(this.storageKey)}}function Gu(e,t){const r="backup";return e?`${r}.${e}${t?`.${t}`:""}`:r}function Ku(e,t){const r=Qt()(t.data,e);if(r)return String(r);{const r=e.split(".")[0];return t[r]?t[r]:""}}function Yu(e){return t=>e.reduce(((e,r)=>{const n=Ku(r,t);return n?`${e} ${n}`:e}),"")}function Ju(e,t){return e.score>t.score?-1:e.score<t.score?1:0}function Qu(e,t){const r=e.get("folder",""),n=t.toLowerCase().replace(r.toLowerCase(),"");return(0,dr.join)((0,dr.dirname)(tr()(n,"/")),(0,dr.basename)(n,(0,dr.extname)(t)))}function Xu(e,t){return jc(t)?(0,dr.dirname)(e).slice(t.get("folder").length+1)||"/":e}function Zu(e){var t;let r;return r=(null===(t=e.get("nested"))||void 0===t?void 0:t.get("depth"))||(0,pr.getPathDepth)(e.get("path","")),Lc(e)&&(r=function(e,t){const{structure:r}=Nc(e);return r===Ic.MULTIPLE_FOLDERS?t+1:t}(e,r)),r}class ef{constructor(e,{backendName:t,authStore:r,config:n}){if(zu(this,"implementation",void 0),zu(this,"backendName",void 0),zu(this,"config",void 0),zu(this,"authStore",void 0),zu(this,"user",void 0),zu(this,"backupSync",void 0),zu(this,"updateUserCredentials",(e=>{const t=this.authStore.retrieve();if(t&&t.backendName===this.backendName)return this.user=Uu(Uu({},t),e),this.authStore.store(this.user),this.user})),zu(this,"getToken",(()=>this.implementation.getToken())),this.deleteAnonymousBackup(),this.config=n,this.implementation=e.init(this.config,{useWorkflow:Nu(this.config),updateUserCredentials:this.updateUserCredentials,initialWorkflowStatus:eo.first()}),this.backendName=t,this.authStore=r,null===this.implementation)throw new Error("Cannot instantiate a Backend with no implementation");this.backupSync=(0,pr.asyncLock)()}async status(){let e={auth:{status:!0},api:{status:!0,statusPage:""}};for(let t=1;t<=3;t++){if(e=await this.implementation.status(),Object.values(e).every((e=>!0===e.status)))return e;await new Promise((e=>setTimeout(e,1e3*t)))}return e}currentUser(){if(this.user)return this.user;const e=this.authStore.retrieve();return e&&e.backendName===this.backendName?Promise.resolve(this.implementation.restoreUser(e)).then((e=>(this.user=Uu(Uu({},e),{},{backendName:this.backendName}),this.authStore.store(this.user),this.user))):Promise.resolve(null)}isGitBackend(){var e,t;return(null===(e=(t=this.implementation).isGitBackend)||void 0===e?void 0:e.call(t))||!1}authComponent(){return this.implementation.authComponent()}authenticate(e){return this.implementation.authenticate(e).then((e=>(this.user=Uu(Uu({},e),{},{backendName:this.backendName}),this.authStore&&this.authStore.store(this.user),this.user)))}async logout(){try{await this.implementation.logout()}catch(e){console.warn("Error during logout",e.message)}finally{this.user=null,this.authStore&&this.authStore.logout()}}async entryExist(e,t,r,n){const o=n&&await this.implementation.unpublishedEntry({collection:e.get("name"),slug:r}).catch((e=>e.name===pr.EDITORIAL_WORKFLOW_ERROR&&e.notUnderEditorialWorkflow?Promise.resolve(!1):Promise.reject(e)));return o||await this.implementation.getEntry(t).then((({data:e})=>e)).catch((()=>Promise.resolve(!1)))}async generateUniqueSlug(e,t,r,n,o){const i=r.slug;let a;a=o?Qu(e,o):function(e,t,r){const n=e.get("slug")||"{{slug}}",o=t.getIn(ci(kc(e)));if(!o)throw new Error("Collection must have a field name that is a valid entry identifier, or must have `identifier_field` set");const i=gi(r),a=new Date,s=ai(n,a,o,t,i);if(e.has("path")){const r=hi(e.get("path"));return ai(r,a,s,t,(e=>e===s?e:i(e)))}return s}(e,t,i);let s=1,l=a;for(;n.includes(l)||await this.entryExist(e,wc(e,l),l,Nu(r));)l=`${a}${ri(" ",i)}${s++}`;return l}processEntries(e,t){const r=e.map((e=>Si(t.get("name"),_c(t,e.file.path),e.file.path,{raw:e.data||"",label:e.file.label,author:e.file.author,updatedOn:e.file.updatedOn,meta:{path:Xu(e.file.path,t)}}))).map(this.entryWithFormat(t)),n=t.get("filter"),o=n?this.filterEntries({entries:r},n):r;if(Lc(t)){const e=vc(t);return Yc(t,e,o)}return o}async listEntries(e){var t;const r=vc(e);let n;const o=e.get("type");if(o===wo)n=()=>{const t=Zu(e);return this.implementation.entriesByFolder(e.get("folder"),r,t)};else{if(o!==bo)throw new Error(`Unknown collection type: ${o}`);{const t=e.get("files").map((e=>({path:e.get("file"),label:e.get("label")}))).toArray();n=()=>this.implementation.entriesByFiles(t)}}const i=await n(),a=pr.Cursor.create(i[pr.CURSOR_COMPATIBILITY_SYMBOL]).wrapData({cursorType:"collectionEntries",collection:e});return{entries:this.processEntries(i,e),pagination:null===(t=a.meta)||void 0===t?void 0:t.get("page"),cursor:a}}async listAllEntries(e){if(e.get("folder")&&this.implementation.allEntriesByFolder){const t=Zu(e),r=vc(e);return this.implementation.allEntriesByFolder(e.get("folder"),r,t,function(e){let t="";return e.get("path")&&(t=`${e.get("folder")}/${e.get("path")}`.replace(/{{.*}}/gm,"(.*)")),Lc(e)&&(t=function(e,{defaultLocale:t,structure:r}){return r===Ic.MULTIPLE_FOLDERS?`${t}\\/${e}`:r===Ic.MULTIPLE_FILES?`${e}\\.${t}\\..*`:e}(t,Nc(e))),t?new RegExp(t):void 0}(e)).then((t=>this.processEntries(t,e)))}const t=await this.listEntries(e),{entries:r}=t;let{cursor:n}=t;for(;n&&n.actions.includes("next");){const{entries:e,cursor:t}=await this.traverseCursor(n,"next");r.push(...e),n=t}return r}async search(e,t){const r=[],n=e.map((async e=>{const r=e.get("summary",""),n=qu(r);let o=[];var i;e.get("type")===bo?null===(i=e.get("files"))||void 0===i||i.forEach((e=>{const t=e.get("fields").map((e=>e.get("name"))).toArray();o=[...o,...t]})):o=[Cc(e,"title"),Cc(e,"shortTitle"),Cc(e,"author"),...n.map((t=>Wu[t]?Cc(e,"date"):t))];const a=o.filter(Boolean),s=await this.listAllEntries(e);return ur.filter(t,s,{extract:Yu(nr()(a))})})).map((e=>e.catch((e=>(r.push(e),[]))))),o=await Promise.all(n).then((e=>sr()(e)));if(r.length>0)throw new Error({message:"Errors occurred while searching entries locally!",errors:r});const i=o.filter((({score:e})=>e>5)).sort(Ju).map((e=>e.original));return{entries:i}}async query(e,t,r,n,o){let i=await this.listAllEntries(e);n&&(i=i.filter((e=>e.slug===n)));const a=function(e,t){const r=e.reduce(((e,r)=>{const n=t.reduce(((e,t)=>{const n=Hu({data:r.data,path:t});return e.push(...n),e}),[]);for(let t=0;t<n.length;t++)e.push(Uu(Uu({},r),{},{field:n[t]}));return e}),[]);return r}(i,t);let s=ur.filter(r,a,{extract:e=>Ku(e.field,e)}).sort(Ju).map((e=>e.original));void 0!==o&&o>0&&(s=s.slice(0,o));const l=function(e){const t=e.map((e=>e.field)),r={},n=e.reduce(((e,t)=>{if(!e[t.slug]){const{field:n}=t,o=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,Fu);e[t.slug]=o,r[t.slug]=(0,Qe.Set)()}const n=t.field.split(".");let o=e[t.slug].data;for(let e=0;e<n.length;e++)if(o=o[n[e]],Array.isArray(o)){const o=n.slice(0,e+1).join(".");r[t.slug]=r[t.slug].add(o)}return e}),{});return Object.keys(n).forEach((e=>{const o=n[e].data;for(const n of r[e].toArray()){const e=Qt()(o,n),r=e.filter(((e,r)=>t.some((e=>`${e}.`.startsWith(`${n}.${r}.`)))));r.sort(((r,o)=>{const i=e.indexOf(r),a=e.indexOf(o),s=`${n}.${i}.`,l=`${n}.${a}.`,c=t.findIndex((e=>`${e}.`.startsWith(s))),u=t.findIndex((e=>`${e}.`.startsWith(l)));return c-u})),Yt()(o,n,r)}})),Object.values(n)}(s);return{query:r,hits:l}}traverseCursor(e,t){const[r,n]=e.unwrapData(),o=r.get("collection");return this.implementation.traverseCursor(n,t).then((async({entries:e,cursor:t})=>({entries:this.processEntries(e,o),cursor:pr.Cursor.create(t).wrapData({cursorType:"collectionEntries",collection:o})})))}async getLocalDraftBackup(e,t){const r=Gu(e.get("name"),t),n=await pr.localForage.getItem(r);if(!n||!n.raw.trim())return{};const{raw:o,path:i}=n;let{mediaFiles:a=[]}=n;a=a.map((e=>e.file?Uu(Uu({},e),{},{url:URL.createObjectURL(e.file)}):e));const s=bc(e,t),l=r=>this.entryWithFormat(e)(Si(e.get("name"),t,i,{raw:r,label:s,mediaFiles:a,meta:{path:Xu(i,e)}})),c=l(o);if(Lc(e)&&n.i18n){const e=function(e,t){const r=Object.entries(e).reduce(((e,[r,{raw:n}])=>{const o=t(n);return Mc(Mc({},e),{},{[r]:{data:o.data}})}),{});return r}(n.i18n,l);c.i18n=e}return{entry:c}}async persistLocalDraftBackup(e,t){try{await this.backupSync.acquire();const r=Gu(t.get("name"),e.get("slug")),n=this.entryToRaw(t,e);if(!n.trim())return;const o=await Promise.all(e.get("mediaFiles").toJS().map((async e=>{var t;if(null!==(t=e.url)&&void 0!==t&&t.startsWith("blob:")){const t=await fetch(e.url).then((e=>e.blob()));return Uu(Uu({},e),{},{file:(0,pr.blobToFileObj)(e.name,t)})}return e})));let i;return Lc(t)&&(i=function(e,t,r){const{locales:n,defaultLocale:o}=Nc(e),i=n.filter((e=>e!==o)).reduce(((e,n)=>{const i=zc(n,o),a=t.getIn(i);if(!a)return e;const s=t.set("data",a);return Mc(Mc({},e),{},{[n]:{raw:r(s)}})}),{});return i}(t,e,(e=>this.entryToRaw(t,e)))),await pr.localForage.setItem(r,Uu({raw:n,path:e.get("path"),mediaFiles:o},i&&{i18n:i})),await pr.localForage.setItem(Gu(),n)}catch(e){console.warn("persistLocalDraftBackup",e)}finally{this.backupSync.release()}}async deleteLocalDraftBackup(e,t){try{return await this.backupSync.acquire(),await pr.localForage.removeItem(Gu(e.get("name"),t)),t&&await pr.localForage.removeItem(Gu(e.get("name"))),await this.deleteAnonymousBackup()}catch(e){console.warn("deleteLocalDraftBackup",e)}finally{this.backupSync.release()}}deleteAnonymousBackup(){return pr.localForage.removeItem(Gu())}async getEntry(e,t,r){const n=wc(t,r),o=bc(t,r),i=vc(t),a=async n=>{const i=await this.implementation.getEntry(n);let a=Si(t.get("name"),r,i.file.path,{raw:i.data,label:o,mediaFiles:[],meta:{path:Xu(i.file.path,t)}});return a=this.entryWithFormat(t)(a),a=await this.processEntry(e,t,a),a};let s;return s=Lc(t)?await async function(e,t,r,n,o){const{structure:i,locales:a,defaultLocale:s}=Nc(e);let l;if(i===Ic.SINGLE_FILE)l=Kc(await o(r),s,a);else{const c=(await Promise.all(a.map((async e=>{const a=qc(i,t,r,n,e);return{value:await o(a).catch((()=>null)),locale:e}})))).filter((e=>null!==e.value));l=Gc(e,i,s,c)}return l}(t,i,n,r,a):await a(n),s}getMedia(){return this.implementation.getMedia()}getMediaFile(e){return this.implementation.getMediaFile(e)}getMediaDisplayURL(e){if(this.implementation.getMediaDisplayURL)return this.implementation.getMediaDisplayURL(e);const t=new Error("getMediaDisplayURL is not implemented by the current backend, but the backend returned a displayURL which was not a string!");return t.displayURL=e,Promise.reject(t)}entryWithFormat(e){return t=>{const r=Hn(e,t);if(t&&void 0!==t.raw){const e=r&&cr()(r.fromFile.bind(r,t.raw))||{};return ir()(e)&&console.error(e),Object.assign(t,{data:ir()(e)?{}:e})}return r.fromFile(t)}}async processUnpublishedEntry(e,t,r){const{slug:n}=t;let o;if(e.get("type")===bo){const t=e.get("files").find((e=>(null==e?void 0:e.get("name"))===n));o=(0,dr.extname)(t.get("file"))}else o=vc(e);const i=[];if(r){const r=t.diffs.filter((e=>!e.path.endsWith(o))),a=await Promise.all(r.map((t=>this.implementation.unpublishedEntryMediaFile(e.get("name"),n,t.path,t.id))));i.push(...a.map((e=>Uu(Uu({},e),{},{draft:!0}))))}const a=Zt()(t.diffs.filter((e=>e.path.endsWith(o))),(e=>e.path.length)),s=(r,o,a)=>{const s=Si(e.get("name"),n,o,{raw:r,isModification:!a,label:e&&bc(e,n),mediaFiles:i,updatedOn:t.updatedAt,author:t.pullRequestAuthor,status:t.status,meta:{path:Xu(o,e)}});return this.entryWithFormat(e)(s)},l=async r=>{const n=await this.implementation.unpublishedEntryDataFile(e.get("name"),t.slug,r.path,r.id);return s(n,r.path,r.newFile)};if(a.length<=0){const t=await this.implementation.getEntry(wc(e,n));return s(t.data,t.file.path,!1)}if(Lc(e)){const t=wc(e,n),r=function(e,t,r,n,o){const{structure:i}=Nc(e);return i===Ic.SINGLE_FILE?o:Hc(e,t,r,n).reduce(((e,t)=>{const r=o.find((e=>e.path===t));return r?[...e,r]:[...e,{path:t,id:"",newFile:!1}]}),[])}(e,o,t,n,a);let i=await Promise.all(r.map((e=>l(e).catch((()=>null)))));return i=i.filter(Boolean),(await Yc(e,o,i))[0]}return await l(a[0])}async unpublishedEntries(e){const t=await this.implementation.unpublishedEntries(),r=(await Promise.all(t.map((async t=>{const r=await this.implementation.unpublishedEntry({id:t}),n=r.collection,o=e.find((e=>e.get("name")===n));return o?await this.processUnpublishedEntry(o,r,!1):(console.warn(`Missing collection '${n}' for unpublished entry '${t}'`),null)})))).filter(Boolean);return{pagination:0,entries:r}}async processEntry(e,t,r){const n=du(e.integrations,null,"assetStore"),o=function(e,t,r){const n=function(e,t){return e.has("folder")?gc(e.get("fields").toArray()):e.has("files")?gc((null===(r=mc(e,t))||void 0===r?void 0:r.get("fields").toArray())||[]):[];var r}(t,r.get("slug")),o=n.map((n=>ac(e,t,r,n)));return t.has("files")&&mc(t,r.get("slug"))&&o.unshift(ac(e,t,r,void 0)),t.has("media_folder")&&(t=t.delete("files"),o.unshift(ac(e,t,r,void 0))),(0,Qe.Set)(o).toArray()}(e.config,t,(0,Qe.fromJS)(r));if(o.length>0&&!n){const e=await Promise.all(o.map((e=>this.implementation.getMedia(e))));r.mediaFiles=r.mediaFiles.concat(...e)}else r.mediaFiles=r.mediaFiles.concat(e.mediaLibrary.get("files")||[]);return r}async unpublishedEntry(e,t,r){const n=await this.implementation.unpublishedEntry({collection:t.get("name"),slug:r});let o=await this.processUnpublishedEntry(t,n,!0);return o=await this.processEntry(e,t,o),o}getDeploy(e,t,r){const n=this.config.site_url;if(n&&!1!==this.config.show_preview_links)return{url:mi(n,e,t,r,this.config.slug),status:"SUCCESS"}}async getDeployPreview(e,t,r,{maxAttempts:n=1,interval:o=5e3}={}){if(!this.implementation.getDeployPreview||!1===this.config.show_preview_links)return;let i,a=0;for(;!i&&a<n;)a++,i=await this.implementation.getDeployPreview(e.get("name"),t),i||await new Promise((e=>setTimeout((()=>e(void 0)),o)));return i?{url:mi(i.url,e,t,r,this.config.slug),status:i.status?i.status.toUpperCase():""}:void 0}async persistEntry({config:e,collection:t,entryDraft:r,assetProxies:n,usedSlugs:o,unpublished:i=!1,status:a}){const s=await this.invokePreSaveEvent(r.get("entry")),l=s&&r.setIn(["entry","data"],s)||r,c=l.getIn(["entry","newRecord"])||!1,u=Nu(e),f=As(t,l);let p;if(c){if(!function(e){return hc[e.get("type")].allowNewEntries(e)}(t))throw new Error("Not allowed to create new entries in this collection");const r=await this.generateUniqueSlug(t,l.getIn(["entry","data"]),e,o,f),i=f||wc(t,r);p={path:i,slug:r,raw:this.entryToRaw(t,l.get("entry"))},function(e,t,r,n,o){e.map((e=>{const i=e.path,a=sc(t,r,n.get("entry").set("path",o),i,e.field);e.path=a}))}(n,e,t,l,i)}else{const e=l.getIn(["entry","slug"]);p={path:l.getIn(["entry","path"]),slug:f&&!u?Qu(t,f):e,raw:this.entryToRaw(t,l.get("entry")),newPath:f}}const{slug:d,path:h,newPath:g}=p;let m=[p];if(Lc(t)){const e=vc(t);m=function(e,t,r,n,o,i,a){const{structure:s,defaultLocale:l,locales:c}=Nc(e);if(s===Ic.SINGLE_FILE){const e=c.reduce(((e,t)=>{const n=zc(t,l);return e.set(t,r.getIn(n))}),(0,Qe.Map)({})),u=r.set("data",e);return[Mc({path:qc(s,t,o,i,c[0]),slug:i,raw:n(u)},a&&{newPath:qc(s,t,a,i,c[0])})]}return c.map((e=>{const c=zc(e,l),u=r.set("data",r.getIn(c));return Mc({path:qc(s,t,o,i,e),slug:i,raw:u.get("data")?n(u):""},a&&{newPath:qc(s,t,a,i,e)})})).filter((e=>e.raw))}(t,e,l.get("entry"),(e=>this.entryToRaw(t,e)),h,d,g)}const y=await this.currentUser(),v=Uu({newEntry:c,commitMessage:di(c?"create":"update",e,{collection:t,slug:d,path:h,authorLogin:y.login,authorName:y.name},y.useOpenAuthoring),collectionName:t.get("name"),useWorkflow:u},{unpublished:i,status:a});return u||await this.invokePrePublishEvent(l.get("entry")),await this.implementation.persistEntry({dataFiles:m,assets:n},v),await this.invokePostSaveEvent(l.get("entry")),u||await this.invokePostPublishEvent(l.get("entry")),d}async invokeEventWithEntry(e,t){const{login:r,name:n}=await this.currentUser();return await Dn({name:e,data:{entry:t,author:{login:r,name:n}}})}async invokePrePublishEvent(e){await this.invokeEventWithEntry("prePublish",e)}async invokePostPublishEvent(e){await this.invokeEventWithEntry("postPublish",e)}async invokePreUnpublishEvent(e){await this.invokeEventWithEntry("preUnpublish",e)}async invokePostUnpublishEvent(e){await this.invokeEventWithEntry("postUnpublish",e)}async invokePreSaveEvent(e){return await this.invokeEventWithEntry("preSave",e)}async invokePostSaveEvent(e){await this.invokeEventWithEntry("postSave",e)}async persistMedia(e,t){const r=await this.currentUser(),n={commitMessage:di("uploadMedia",e,{path:t.path,authorLogin:r.login,authorName:r.name},r.useOpenAuthoring)};return this.implementation.persistMedia(t,n)}async deleteEntry(e,t,r){const n=e.config,o=wc(t,r),i=vc(t);if(!Sc(t))throw new Error("Not allowed to delete entries in this collection");const a=await this.currentUser(),s=di("delete",n,{collection:t,slug:r,path:o,authorLogin:a.login,authorName:a.name},a.useOpenAuthoring),l=Jl(e.entries,t.get("name"),r);await this.invokePreUnpublishEvent(l);let c=[o];Lc(t)&&(c=Hc(t,i,o,r)),await this.implementation.deleteFiles(c,s),await this.invokePostUnpublishEvent(l)}async deleteMedia(e,t){const r=await this.currentUser(),n=di("deleteMedia",e,{path:t,authorLogin:r.login,authorName:r.name},r.useOpenAuthoring);return this.implementation.deleteFiles([t],n)}persistUnpublishedEntry(e){return this.persistEntry(Uu(Uu({},e),{},{unpublished:!0}))}updateUnpublishedEntryStatus(e,t,r){return this.implementation.updateUnpublishedEntryStatus(e,t,r)}async publishUnpublishedEntry(e){const t=e.get("collection"),r=e.get("slug");await this.invokePrePublishEvent(e),await this.implementation.publishUnpublishedEntry(t,r),await this.invokePostPublishEvent(e)}deleteUnpublishedEntry(e,t){return this.implementation.deleteUnpublishedEntry(e,t)}entryToRaw(e,t){const r=Hn(e,t.toJS()),n=this.fieldsOrder(e,t),o=function(e,t){let r=[];if(e.has("folder"))r=e.get("fields").toArray();else if(e.has("files")){const n=e.get("files").find((e=>(null==e?void 0:e.get("name"))===t.get("slug")));r=n.get("fields").toArray()}const n={};return xc(r).forEach((t=>{const r=Oc(e,t);null!=r&&r.has("comment")&&(n[t]=r.get("comment"))})),n}(e,t);let i=r.toFile(t.get("data").toJS(),n,o);return"\n"!=i.slice(-1)&&(i+="\n"),i}fieldsOrder(e,t){if(e.get("fields"))return e.get("fields").map((e=>e.get("name"))).toArray();const r=(e.get("files")||(0,Qe.List)()).filter((e=>e.get("name")===t.get("slug"))).get(0);if(null==r)throw new Error(`No file found for ${t.get("slug")} in ${e.get("name")}`);return r.get("fields").map((e=>e.get("name"))).toArray()}filterEntries(e,t){return e.entries.filter((e=>{const r=e.data[t.get("field")];return Array.isArray(r)?r.includes(t.get("value")):r===t.get("value")}))}}function tf(e){if(!e.backend.name)throw new Error("No backend defined in configuration");const{name:t}=e.backend,r=new Vu,n=Mn(t);if(n)return new ef(n,{backendName:t,authStore:r,config:e});throw new Error(`Backend not found: ${t}`)}const rf=function(){let e;return t=>e||(e=tf(t))}(),nf="AUTH_REQUEST",of="AUTH_SUCCESS",af="AUTH_FAILURE",sf="AUTH_REQUEST_DONE",lf="USE_OPEN_AUTHORING",cf="LOGOUT";function uf(){return{type:nf}}function ff(e){return{type:of,payload:e}}function pf(e){return{type:af,error:"Failed to authenticate",payload:e}}function df(){return{type:lf}}function hf(){return(e,t)=>{const r=t(),n=rf(r.config);Promise.resolve(n.logout()).then((()=>{e({type:cf}),e({type:Zi})}))}}const gf=Gt(((e,t)=>{switch(t.type){case nf:e.isFetching=!0;break;case of:e.user=t.payload;break;case af:e.error=t.payload&&t.payload.toString();break;case sf:e.isFetching=!1;break;case cf:e.user=void 0,e.isFetching=!1}}),{isFetching:!1,user:void 0,error:void 0});var mf=__webpack_require__(37994),yf=__webpack_require__.n(mf);function vf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vf(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const wf={isFetching:!1,term:"",collections:[],page:0,entryIds:[],queryHits:{},error:void 0,requests:[]},_f=Gt(((e,t)=>{switch(t.type){case Bi:return wf;case Ii:{const{page:r,searchTerm:n,searchCollections:o}=t.payload;e.isFetching=!0,e.term=n,e.collections=o,e.page=r;break}case Di:{const{entries:r,page:n}=t.payload,o=r.map((e=>({collection:e.collection,slug:e.slug})));e.isFetching=!1,e.page=n,e.entryIds=!n||isNaN(n)||0===n?o:e.entryIds.concat(o);break}case Li:{const{error:r}=t.payload;e.isFetching=!1,e.error=r;break}case Ni:{const{searchTerm:r,request:n}=t.payload;e.isFetching=!0,e.term=r,n&&e.requests.push(n);break}case Ui:e.requests=e.requests.filter((e=>e.expires>=new Date));break;case $i:{const{namespace:r,hits:n}=t.payload;e.isFetching=!1,e.queryHits[r]=n;break}case Fi:{const{error:r}=t.payload;e.isFetching=!1,e.error=r}}}),wf),Sf=_f;function xf(e){return Object.values(e).some((e=>e.isLoading))}const Of=Gt(((e,t)=>{switch(t.type){case Ha:t.payload.forEach((t=>{e[t.path]={asset:t,isLoading:!1,error:null}}));break;case Va:{const r=t.payload;e[r.path]={asset:r,isLoading:!1,error:null};break}case Ga:{const r=t.payload;delete e[r];break}case Ka:{const{path:r}=t.payload;e[r]=e[r]||{},e[r].isLoading=!0;break}case Ya:{const{path:r}=t.payload;e[r]=e[r]||{},e[r].isLoading=!1,e[r].error=null;break}case Ja:{const{path:r,error:n}=t.payload;e[r]=e[r]||{},e[r].isLoading=!1,e[r].error=n}}}),{}),Ef="DEPLOY_PREVIEW_REQUEST",kf="DEPLOY_PREVIEW_SUCCESS",Cf="DEPLOY_PREVIEW_FAILURE";function Tf(e,t){return{type:Cf,payload:{collection:e,slug:t}}}const Pf=Gt(((e,t)=>{switch(t.type){case Ef:{const{collection:r,slug:n}=t.payload,o=`${r}.${n}`;e[o]=e[o]||{},e[o].isFetching=!0;break}case kf:{const{collection:r,slug:n,url:o,status:i}=t.payload,a=`${r}.${n}`;e[a].isFetching=!1,e[a].url=o,e[a].status=i;break}case Cf:{const{collection:r,slug:n}=t.payload;e[`${r}.${n}`].isFetching=!1;break}}}),{}),jf=Pf,Rf=["DEPLOY_PREVIEW","STATUS_REQUEST","STATUS_SUCCESS","STATUS_FAILURE"];function Mf(e){return Rf.some((t=>e.type.includes(t)))}const Af=Gt(((e,t)=>{!Mf(t)&&t.type.includes("REQUEST")?e.isFetching=!0:Mf(t)||!t.type.includes("SUCCESS")&&!t.type.includes("FAILURE")?t.type===lf&&(e.useOpenAuthoring=!0):e.isFetching=!1}),{isFetching:!1,useOpenAuthoring:!1}),If="STATUS_REQUEST",Df="STATUS_SUCCESS",Lf="STATUS_FAILURE";function Nf(e){return{type:Df,payload:{status:e}}}const $f=Gt(((e,t)=>{switch(t.type){case If:e.isFetching=!0;break;case Df:e.isFetching=!1,e.status=t.payload.status;break;case Lf:e.isFetching=!1,e.error=t.payload.error}}),{isFetching:!1,status:{auth:{status:!0},api:{status:!0,statusPage:""}},error:void 0});function Ff(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Bf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ff(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ff(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Uf=Gt(((e,t)=>{switch(t.type){case Zi:e.notifications=[];break;case Xi:e.notifications=e.notifications.filter((e=>e.id!==t.id));break;case Qi:e.notifications=[...e.notifications,Bf({id:ho()},t.payload)]}}),{notifications:[]}),zf={auth:gf,config:$u,collections:function(e=dc,t){if(t.type===vu){const e=t.payload.collections;let r=(0,Qe.OrderedMap)({});return e.forEach((e=>{r=r.set(e.name,(0,Qe.fromJS)(e))})),r}return e},search:Sf,integrations:function(e=pu,t){return t.type===vu?fu(t.payload):e},entries:function(e=(0,Qe.Map)({entities:(0,Qe.Map)(),pages:(0,Qe.Map)(),sort:ql(),viewStyle:Hl()}),t){switch(t.type){case Ls:{const r=t.payload;return e.setIn(["entities",`${r.collection}.${r.slug}`,"isFetching"],!0)}case Ns:{const r=t.payload;return Ll=r.collection,Bl=r.entry.slug,e.withMutations((e=>{e.setIn(["entities",`${Ll}.${Bl}`],(0,Qe.fromJS)(r.entry));const t=e.getIn(["pages",Ll,"ids"],(0,Qe.List)());t.includes(Bl)||e.setIn(["pages",Ll,"ids"],t.unshift(Bl))}))}case Fs:{const r=t.payload,n=e.withMutations((e=>{e.setIn(["pages",r.collection,"isFetching"],!0)}));return n}case Bs:{const r=t.payload;return Ll=r.collection,Nl=r.entries,$l=r.append,Fl=r.page,e.withMutations((e=>{Nl.forEach((t=>e.setIn(["entities",`${Ll}.${t.slug}`],(0,Qe.fromJS)(t).set("isFetching",!1))));const t=(0,Qe.List)(Nl.map((e=>e.slug)));e.setIn(["pages",Ll],(0,Qe.Map)({page:Fl,ids:$l?e.getIn(["pages",Ll,"ids"],(0,Qe.List)()).concat(t):t}))}))}case Us:return e.setIn(["pages",t.meta.collection,"isFetching"],!1);case $s:{const r=t.payload;return e.withMutations((e=>{e.setIn(["entities",`${r.collection}.${r.slug}`,"isFetching"],!1),e.setIn(["entities",`${r.collection}.${r.slug}`,"error"],r.error.message)}))}case Di:{const r=t.payload;return Nl=r.entries,e.withMutations((e=>{Nl.forEach((t=>e.setIn(["entities",`${t.collection}.${t.slug}`],(0,Qe.fromJS)(t).set("isFetching",!1))))}))}case cl:{const r=t.payload;return e.withMutations((e=>{e.deleteIn(["entities",`${r.collectionName}.${r.entrySlug}`]),e.updateIn(["pages",r.collectionName,"ids"],(e=>e.filter((e=>e!==r.entrySlug))))}))}case zs:{const r=t.payload,{collection:n,key:o,direction:i}=r,a=e.withMutations((e=>{const t=(0,Qe.OrderedMap)({[o]:(0,Qe.Map)({key:o,direction:i})});e.setIn(["sort",n],t),e.setIn(["pages",n,"isFetching"],!0),e.deleteIn(["pages",n,"page"])}));return Wl(a.get("sort")),a}case Ys:case Vs:case qs:{const r=t.payload,{collection:n,entries:o}=r;Nl=o;const i=e.withMutations((e=>{Nl.forEach((t=>e.setIn(["entities",`${t.collection}.${t.slug}`],(0,Qe.fromJS)(t).set("isFetching",!1)))),e.setIn(["pages",n,"isFetching"],!1);const t=(0,Qe.List)(Nl.map((e=>e.slug)));e.setIn(["pages",n],(0,Qe.Map)({page:1,ids:t}))}));return i}case Ws:{const r=t.payload,{collection:n,key:o}=r,i=e.withMutations((e=>{e.deleteIn(["sort",n,o]),e.setIn(["pages",n,"isFetching"],!1)}));return Wl(i.get("sort")),i}case Hs:{const r=t.payload,{collection:n,filter:o}=r,i=e.withMutations((e=>{const t=e.getIn(["filter",n,o.id],(0,Qe.fromJS)(o));e.setIn(["filter",n,t.get("id")],t.set("active",!t.get("active")))}));return i}case Gs:{const r=t.payload,{collection:n,filter:o}=r,i=e.withMutations((e=>{e.deleteIn(["filter",n,o.id]),e.setIn(["pages",n,"isFetching"],!1)}));return i}case Ks:{const r=t.payload,{collection:n,group:o}=r,i=e.withMutations((e=>{const t=e.getIn(["group",n,o.id],(0,Qe.fromJS)(o));e.deleteIn(["group",n]),e.setIn(["group",n,t.get("id")],t.set("active",!t.get("active")))}));return i}case Js:{const r=t.payload,{collection:n,group:o}=r,i=e.withMutations((e=>{e.deleteIn(["group",n,o.id]),e.setIn(["pages",n,"isFetching"],!1)}));return i}case pl:{const n=t.payload,{style:o}=n,i=e.withMutations((e=>{e.setIn(["viewStyle"],o)}));return(r=i.get("viewStyle"))?localStorage.setItem(zl,r):localStorage.removeItem(zl),i}default:return e}var r},cursors:function(e=(0,Qe.fromJS)({cursorsByType:{collectionEntries:{}}}),t){switch(t.type){case Bs:return e.setIn(["cursorsByType","collectionEntries",t.payload.collection],pr.Cursor.create(t.payload.cursor).store);case Vs:case Ys:case qs:return e.deleteIn(["cursorsByType","collectionEntries",t.payload.collection]);default:return e}},editorialWorkflow:function(e=(0,Qe.Map)(),t){switch(t.type){case vu:return(t.payload&&t.payload.publish_mode)===Zn?(0,Qe.Map)({entities:(0,Qe.Map)(),pages:(0,Qe.Map)()}):e;case ss:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isFetching"],!0);case cs:return e.deleteIn(["entities",`${t.payload.collection}.${t.payload.slug}`]);case ls:return e.setIn(["entities",`${t.payload.collection}.${t.payload.entry.slug}`],(0,Qe.fromJS)(t.payload.entry));case us:return e.setIn(["pages","isFetching"],!0);case fs:return e.withMutations((e=>{t.payload.entries.forEach((t=>e.setIn(["entities",`${t.collection}.${t.slug}`],(0,Qe.fromJS)(t).set("isFetching",!1)))),e.set("pages",(0,Qe.Map)(bf(bf({},t.payload.pages),{},{ids:(0,Qe.List)(t.payload.entries.map((e=>e.slug)))})))}));case ds:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isPersisting"],!0);case hs:return e.withMutations((e=>{e.setIn(["entities",`${t.payload.collection}.${t.payload.entry.get("slug")}`],(0,Qe.fromJS)(t.payload.entry)),e.deleteIn(["entities",`${t.payload.collection}.${t.payload.entry.get("slug")}`,"isPersisting"]),e.updateIn(["pages","ids"],(0,Qe.List)(),(e=>e.push(t.payload.entry.get("slug"))))}));case gs:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isPersisting"],!1);case ms:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isUpdatingStatus"],!0);case ys:return e.withMutations((e=>{e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"status"],t.payload.newStatus),e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isUpdatingStatus"],!1)}));case vs:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isUpdatingStatus"],!1);case bs:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isPublishing"],!0);case ws:case Ss:return e.deleteIn(["entities",`${t.payload.collection}.${t.payload.slug}`]);default:return e}},entryDraft:function(e=(0,Qe.Map)(),t){switch(t.type){case Qs:return e.withMutations((e=>{e.set("entry",(0,Qe.fromJS)(t.payload.entry)),e.setIn(["entry","newRecord"],!1),e.set("fieldsMetaData",(0,Qe.Map)()),e.set("fieldsErrors",(0,Qe.Map)()),e.set("hasChanged",!1),e.set("key",ho())}));case Xs:return e.withMutations((e=>{e.set("entry",(0,Qe.fromJS)(t.payload)),e.setIn(["entry","newRecord"],!0),e.set("fieldsMetaData",(0,Qe.Map)()),e.set("fieldsErrors",(0,Qe.Map)()),e.set("hasChanged",!1),e.set("key",ho())}));case ol:return e.withMutations((e=>{const t=e.get("localBackup").get("entry");e.delete("localBackup"),e.set("entry",t),e.setIn(["entry","newRecord"],!t.get("path")),e.set("fieldsMetaData",(0,Qe.Map)()),e.set("fieldsErrors",(0,Qe.Map)()),e.set("hasChanged",!0),e.set("key",ho())}));case il:return e.withMutations((e=>{e.set("entry",(0,Qe.fromJS)(t.payload)),e.setIn(["entry","newRecord"],!0),e.set("mediaFiles",(0,Qe.List)()),e.set("fieldsMetaData",(0,Qe.Map)()),e.set("fieldsErrors",(0,Qe.Map)()),e.set("hasChanged",!0)}));case Zs:return Ms;case nl:{const{entry:r}=t.payload,n=new Qe.Map({entry:(0,Qe.fromJS)(r)});return e.set("localBackup",n)}case el:return e.withMutations((e=>{const{field:r,value:n,metadata:o,entries:i,i18n:a}=t.payload,s=r.get("name"),l=r.get("meta"),c=a&&zc(a.currentLocale,a.defaultLocale)||["data"];l?e.setIn(["entry","meta",s],n):(e.setIn(["entry",...c,s],n),a&&(e=Jc(e,r,a.locales,a.defaultLocale))),e.mergeDeepIn(["fieldsMetaData"],(0,Qe.fromJS)(o));const u=e.getIn(["entry",...c]),f=e.getIn(["entry","meta"]);e.set("hasChanged",!i.some((e=>u.equals(e.get(...c))))||!i.some((e=>f.equals(e.get("meta")))))}));case tl:return 0===t.payload.errors.length?e.deleteIn(["fieldsErrors",t.payload.uniquefieldId]):e.setIn(["fieldsErrors",t.payload.uniquefieldId],t.payload.errors);case rl:return e.set("fieldsErrors",(0,Qe.Map)());case al:case ds:return e.setIn(["entry","isPersisting"],!0);case ll:case gs:return e.deleteIn(["entry","isPersisting"]);case ms:return e.setIn(["entry","isUpdatingStatus"],!0);case vs:case ys:return e.deleteIn(["entry","isUpdatingStatus"]);case bs:return e.setIn(["entry","isPublishing"],!0);case ws:case _s:return e.deleteIn(["entry","isPublishing"]);case sl:case hs:return e.withMutations((e=>{e.deleteIn(["entry","isPersisting"]),e.set("hasChanged",!1),e.getIn(["entry","slug"])||e.setIn(["entry","slug"],t.payload.slug)}));case cl:return e.withMutations((e=>{e.deleteIn(["entry","isPersisting"]),e.set("hasChanged",!1)}));case ul:return e.withMutations((e=>{const r=e.getIn(["entry","mediaFiles"]);e.setIn(["entry","mediaFiles"],r.filterNot((e=>e.get("id")===t.payload.id)).insert(0,(0,Qe.fromJS)(t.payload))),e.set("hasChanged",!0)}));case fl:return e.withMutations((e=>{const r=e.getIn(["entry","mediaFiles"]);e.setIn(["entry","mediaFiles"],r.filterNot((e=>e.get("id")===t.payload.id))),e.set("hasChanged",!0)}));default:return e}},medias:Of,mediaLibrary:function(e=(0,Qe.Map)(za),t){switch(t.type){case aa:return e.withMutations((e=>{e.set("externalLibrary",t.payload),e.set("showMediaButton",t.payload.enableStandalone())}));case oa:{const{controlID:r,forImage:n,privateUpload:o,config:i,field:a,value:s,replaceIndex:l}=t.payload,c=i||(0,Qe.Map)();return e.get("privateUpload")!==o?(0,Qe.Map)({isVisible:!0,forImage:n,controlID:r,canInsert:!!r,privateUpload:o,config:c,controlMedia:(0,Qe.Map)(),displayURLs:(0,Qe.Map)(),field:a,value:s,replaceIndex:l}):e.withMutations((e=>{e.set("isVisible",!0),e.set("forImage",null!=n&&n),e.set("controlID",null!=r?r:""),e.set("canInsert",!!r),e.set("privateUpload",o),e.set("config",c),e.set("field",null!=a?a:""),e.set("value",""==s&&c.get("multiple")?[]:null!=s?s:""),e.set("replaceIndex",null!=l&&l)}))}case ia:return e.set("isVisible",!1);case sa:{const{mediaPath:r}=t.payload,n=e.get("controlID"),o=e.get("value");if(!Array.isArray(o))return e.withMutations((e=>{e.setIn(["controlMedia",n],r)}));const i=e.get("replaceIndex"),a=Array.isArray(r)?r:[r],s=o;return"number"==typeof i?s[i]=a[0]:s.push(...a),e.withMutations((e=>{e.setIn(["controlMedia",n],s)}))}case la:{const r=t.payload.controlID;return e.setIn(["controlMedia",r],"")}case ca:return e.withMutations((e=>{e.set("isLoading",!0),e.set("isPaginating",t.payload.page>1)}));case ua:{const{files:r=[],page:n,canPaginate:o,dynamicSearch:i,dynamicSearchQuery:a,privateUpload:s}=t.payload;if(e.get("privateUpload")!==s)return e;const l=r.map((e=>Ua(Ua({},e),{},{key:ho()})));return e.withMutations((e=>{if(e.set("isLoading",!1),e.set("isPaginating",!1),e.set("page",null!=n?n:1),e.set("hasNextPage",!!(o&&r.length>0)),e.set("dynamicSearch",null!=i&&i),e.set("dynamicSearchQuery",null!=a?a:""),e.set("dynamicSearchActive",!!a),n&&n>1){const t=e.get("files").concat(l);e.set("files",t)}else e.set("files",l)}))}case fa:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isLoading",!1);case pa:return e.set("isPersisting",!0);case da:{const{file:r,privateUpload:n}=t.payload;return e.get("privateUpload")!==n?e:e.withMutations((e=>{const t=[Ua(Ua({},r),{},{key:ho()}),...e.get("files")];e.set("files",t),e.set("isPersisting",!1)}))}case ha:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isPersisting",!1);case ga:return e.set("isDeleting",!0);case ma:{const{file:r,privateUpload:n}=t.payload,{key:o,id:i}=r;return e.get("privateUpload")!==n?e:e.withMutations((e=>{const t=e.get("files").filter((e=>o?e.key!==o:e.id!==i));e.set("files",t),e.deleteIn(["displayURLs",i]),e.set("isDeleting",!1)}))}case ya:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isDeleting",!1);case va:return e.setIn(["displayURLs",t.payload.key,"isFetching"],!0);case ba:{const r=["displayURLs",t.payload.key];return e.setIn([...r,"isFetching"],!1).setIn([...r,"url"],t.payload.url)}case wa:{const r=["displayURLs",t.payload.key];return e.setIn([...r,"isFetching"],!1).setIn([...r,"err"],t.payload.err||!0).deleteIn([...r,"url"])}default:return e}},deploys:jf,globalUI:Af,status:$f,notifications:Uf};function qf(e,t,r){return Jl(e.entries,t,r)}function Wf(e,t){return Ql(e.entries,t)}function Hf(e,t,r){return function(e,t,r){return e[`${t}.${r}`]}(e.deploys,t,r)}function Vf(e,t,r){return function(e,t,r){return e&&e.getIn(["entities",`${t}.${r}`])}(e.editorialWorkflow,t,r)}function Gf(e,t,r){return du(e.integrations,t,r)}function Kf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const Yf=(0,He.MT)((0,He.UY)(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Kf(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},zf)),(0,Ve.Uo)((0,He.md)(Ye,(({dispatch:e,getState:t})=>{let r=[];return n=>o=>{if(o.type===Je)return r.push(o),null;const i=n(o);return function(n){const o=[],i=[];for(const e of r)e.predicate(n)?o.push(e):i.push(e);r=i;for(const r of o)r.run(e,t,n)}(o),i}}))));var Jf=__webpack_require__(98537),Qf=__webpack_require__.n(Jf);function Xf(e){return Qf()({},Ln("en"),Ln(e))}function Zf(e){var t=null;return function(){return null==t&&(t=e()),t}}function ep(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function tp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var rp=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),tp(this,"entered",[]),tp(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}var t,r;return t=e,r=[{key:"enter",value:function(e){var t=this,r=this.entered.length;return this.entered=function(e,t){var r=new Set,n=function(e){return r.add(e)};e.forEach(n),t.forEach(n);var o=[];return r.forEach((function(e){return o.push(e)})),o}(this.entered.filter((function(r){return t.isNodeInDocument(r)&&(!r.contains||r.contains(e))})),[e]),0===r&&this.entered.length>0}},{key:"leave",value:function(e){var t,r,n=this.entered.length;return this.entered=(t=this.entered.filter(this.isNodeInDocument),r=e,t.filter((function(e){return e!==r}))),n>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}],r&&ep(t.prototype,r),e}(),np=Zf((function(){return/firefox/i.test(navigator.userAgent)})),op=Zf((function(){return Boolean(window.safari)}));function ip(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ap(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var sp=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ap(this,"xs",void 0),ap(this,"ys",void 0),ap(this,"c1s",void 0),ap(this,"c2s",void 0),ap(this,"c3s",void 0);for(var n=t.length,o=[],i=0;i<n;i++)o.push(i);o.sort((function(e,r){return t[e]<t[r]?-1:1}));for(var a,s,l=[],c=[],u=[],f=0;f<n-1;f++)a=t[f+1]-t[f],s=r[f+1]-r[f],c.push(a),l.push(s),u.push(s/a);for(var p=[u[0]],d=0;d<c.length-1;d++){var h=u[d],g=u[d+1];if(h*g<=0)p.push(0);else{a=c[d];var m=c[d+1],y=a+m;p.push(3*y/((y+m)/h+(y+a)/g))}}p.push(u[u.length-1]);for(var v,b=[],w=[],_=0;_<p.length-1;_++){v=u[_];var S=p[_],x=1/c[_],O=S+p[_+1]-v-v;b.push((v-S-O)*x),w.push(O*x*x)}this.xs=t,this.ys=r,this.c1s=p,this.c2s=b,this.c3s=w}var t,r;return t=e,r=[{key:"interpolate",value:function(e){var t=this.xs,r=this.ys,n=this.c1s,o=this.c2s,i=this.c3s,a=t.length-1;if(e===t[a])return r[a];for(var s,l=0,c=i.length-1;l<=c;){var u=t[s=Math.floor(.5*(l+c))];if(u<e)l=s+1;else{if(!(u>e))return r[s];c=s-1}}var f=e-t[a=Math.max(0,c)],p=f*f;return r[a]+n[a]*f+o[a]*p+i[a]*f*p}}],r&&ip(t.prototype,r),e}(),lp=1;function cp(e){var t=e.nodeType===lp?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top;return{x:r.left,y:n}}function up(e){return{x:e.clientX,y:e.clientY}}var fp,pp="__NATIVE_FILE__",dp="__NATIVE_URL__",hp="__NATIVE_TEXT__",gp="__NATIVE_HTML__";function mp(e,t,r){var n=t.reduce((function(t,r){return t||e.getData(r)}),"");return null!=n?n:r}function yp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var vp=(yp(fp={},pp,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items},dataTransfer:function(e){return e}},matchesTypes:["Files"]}),yp(fp,gp,{exposeProperties:{html:function(e,t){return mp(e,t,"")},dataTransfer:function(e){return e}},matchesTypes:["Html","text/html"]}),yp(fp,dp,{exposeProperties:{urls:function(e,t){return mp(e,t,"").split("\n")},dataTransfer:function(e){return e}},matchesTypes:["Url","text/uri-list"]}),yp(fp,hp,{exposeProperties:{text:function(e,t){return mp(e,t,"")},dataTransfer:function(e){return e}},matchesTypes:["Text","text/plain"]}),fp);function bp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function wp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),wp(this,"item",void 0),wp(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}var t,r;return t=e,(r=[{key:"initializeExposedProperties",value:function(){var e=this;Object.keys(this.config.exposeProperties).forEach((function(t){Object.defineProperty(e.item,t,{configurable:!0,enumerable:!0,get:function(){return console.warn("Browser doesn't allow reading \"".concat(t,'" until the drop event.')),null}})}))}},{key:"loadDataTransfer",value:function(e){var t=this;if(e){var r={};Object.keys(this.config.exposeProperties).forEach((function(n){r[n]={value:t.config.exposeProperties[n](e,t.config.matchesTypes),configurable:!0,enumerable:!0}})),Object.defineProperties(this.item,r)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,t){return t===e.getSourceId()}},{key:"endDrag",value:function(){}}])&&bp(t.prototype,r),e}();function Sp(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(vp).filter((function(e){return vp[e].matchesTypes.some((function(e){return t.indexOf(e)>-1}))}))[0]||null}function xp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Op(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ep=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Op(this,"ownerDocument",null),Op(this,"globalContext",void 0),Op(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=r}var t,r;return t=e,(r=[{key:"window",get:function(){return this.globalContext?this.globalContext:"undefined"!=typeof window?window:void 0}},{key:"document",get:function(){var e;return null!==(e=this.globalContext)&&void 0!==e&&e.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var e;return(null===(e=this.optionsArgs)||void 0===e?void 0:e.rootElement)||this.window}}])&&xp(t.prototype,r),e}();function kp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kp(Object(r),!0).forEach((function(t){Pp(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Tp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Pp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var jp=function(){function t(e,r,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Pp(this,"options",void 0),Pp(this,"actions",void 0),Pp(this,"monitor",void 0),Pp(this,"registry",void 0),Pp(this,"enterLeaveCounter",void 0),Pp(this,"sourcePreviewNodes",new Map),Pp(this,"sourcePreviewNodeOptions",new Map),Pp(this,"sourceNodes",new Map),Pp(this,"sourceNodeOptions",new Map),Pp(this,"dragStartSourceIds",null),Pp(this,"dropTargetIds",[]),Pp(this,"dragEnterTargetIds",[]),Pp(this,"currentNativeSource",null),Pp(this,"currentNativeHandle",null),Pp(this,"currentDragSourceNode",null),Pp(this,"altKeyPressed",!1),Pp(this,"mouseMoveTimeoutTimer",null),Pp(this,"asyncEndDragFrameId",null),Pp(this,"dragOverTargetIds",null),Pp(this,"lastClientOffset",null),Pp(this,"hoverRafId",null),Pp(this,"getSourceClientOffset",(function(e){var t=o.sourceNodes.get(e);return t&&cp(t)||null})),Pp(this,"endDragNativeItem",(function(){o.isDraggingNativeItem()&&(o.actions.endDrag(),o.currentNativeHandle&&o.registry.removeSource(o.currentNativeHandle),o.currentNativeHandle=null,o.currentNativeSource=null)})),Pp(this,"isNodeInDocument",(function(e){return Boolean(e&&o.document&&o.document.body&&o.document.body.contains(e))})),Pp(this,"endDragIfSourceWasRemovedFromDOM",(function(){var e=o.currentDragSourceNode;null==e||o.isNodeInDocument(e)||o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()})),Pp(this,"handleTopDragStartCapture",(function(){o.clearCurrentDragSourceNode(),o.dragStartSourceIds=[]})),Pp(this,"handleTopDragStart",(function(e){if(!e.defaultPrevented){var t=o.dragStartSourceIds;o.dragStartSourceIds=null;var r=up(e);o.monitor.isDragging()&&o.actions.endDrag(),o.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:o.getSourceClientOffset,clientOffset:r});var n=e.dataTransfer,i=Sp(n);if(o.monitor.isDragging()){if(n&&"function"==typeof n.setDragImage){var a=o.monitor.getSourceId(),s=o.sourceNodes.get(a),l=o.sourcePreviewNodes.get(a)||s;if(l){var c=o.getCurrentSourcePreviewNodeOptions(),u=function(e,t,r,n,o){var i,a,s="IMG"===(i=t).nodeName&&(np()||!(null!==(a=document.documentElement)&&void 0!==a&&a.contains(i))),l=cp(s?e:t),c={x:r.x-l.x,y:r.y-l.y},u=e.offsetWidth,f=e.offsetHeight,p=n.anchorX,d=n.anchorY,h=function(e,t,r,n){var o=e?t.width:r,i=e?t.height:n;return op()&&e&&(i/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:i}}(s,t,u,f),g=h.dragPreviewWidth,m=h.dragPreviewHeight,y=o.offsetX,v=o.offsetY,b=0===v||v;return{x:0===y||y?y:new sp([0,.5,1],[c.x,c.x/u*g,c.x+g-u]).interpolate(p),y:b?v:function(){var e=new sp([0,.5,1],[c.y,c.y/f*m,c.y+m-f]).interpolate(d);return op()&&s&&(e+=(window.devicePixelRatio-1)*m),e}()}}(s,l,r,{anchorX:c.anchorX,anchorY:c.anchorY},{offsetX:c.offsetX,offsetY:c.offsetY});n.setDragImage(l,u.x,u.y)}}try{null==n||n.setData("application/json",{})}catch(e){}o.setCurrentDragSourceNode(e.target),o.getCurrentSourcePreviewNodeOptions().captureDraggingState?o.actions.publishDragSource():setTimeout((function(){return o.actions.publishDragSource()}),0)}else if(i)o.beginDragNativeItem(i);else{if(n&&!n.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute("draggable")))return;e.preventDefault()}}})),Pp(this,"handleTopDragEndCapture",(function(){o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()})),Pp(this,"handleTopDragEnterCapture",(function(e){if(o.dragEnterTargetIds=[],o.enterLeaveCounter.enter(e.target)&&!o.monitor.isDragging()){var t=e.dataTransfer,r=Sp(t);r&&o.beginDragNativeItem(r,t)}})),Pp(this,"handleTopDragEnter",(function(e){var t=o.dragEnterTargetIds;o.dragEnterTargetIds=[],o.monitor.isDragging()&&(o.altKeyPressed=e.altKey,t.length>0&&o.actions.hover(t,{clientOffset:up(e)}),t.some((function(e){return o.monitor.canDropOnTarget(e)}))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=o.getCurrentDropEffect())))})),Pp(this,"handleTopDragOverCapture",(function(){o.dragOverTargetIds=[]})),Pp(this,"handleTopDragOver",(function(e){var t=o.dragOverTargetIds;if(o.dragOverTargetIds=[],!o.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer&&(e.dataTransfer.dropEffect="none"));o.altKeyPressed=e.altKey,o.lastClientOffset=up(e),null===o.hoverRafId&&"undefined"!=typeof requestAnimationFrame&&(o.hoverRafId=requestAnimationFrame((function(){o.monitor.isDragging()&&o.actions.hover(t||[],{clientOffset:o.lastClientOffset}),o.hoverRafId=null}))),(t||[]).some((function(e){return o.monitor.canDropOnTarget(e)}))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=o.getCurrentDropEffect())):o.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"))})),Pp(this,"handleTopDragLeaveCapture",(function(e){o.isDraggingNativeItem()&&e.preventDefault(),o.enterLeaveCounter.leave(e.target)&&o.isDraggingNativeItem()&&setTimeout((function(){return o.endDragNativeItem()}),0)})),Pp(this,"handleTopDropCapture",(function(e){var t;o.dropTargetIds=[],o.isDraggingNativeItem()?(e.preventDefault(),null===(t=o.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)):Sp(e.dataTransfer)&&e.preventDefault(),o.enterLeaveCounter.reset()})),Pp(this,"handleTopDrop",(function(e){var t=o.dropTargetIds;o.dropTargetIds=[],o.actions.hover(t,{clientOffset:up(e)}),o.actions.drop({dropEffect:o.getCurrentDropEffect()}),o.isDraggingNativeItem()?o.endDragNativeItem():o.monitor.isDragging()&&o.actions.endDrag()})),Pp(this,"handleSelectStart",(function(e){var t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))})),this.options=new Ep(r,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new rp(this.isNodeInDocument)}var r,n;return r=t,(n=[{key:"profile",value:function(){var e,t;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:(null===(e=this.dragStartSourceIds)||void 0===e?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:(null===(t=this.dragOverTargetIds)||void 0===t?void 0:t.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var e=this.rootElement;if(void 0!==e){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}},{key:"teardown",value:function(){var e,t=this.rootElement;void 0!==t&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&(null===(e=this.window)||void 0===e||e.cancelAnimationFrame(this.asyncEndDragFrameId)))}},{key:"connectDragPreview",value:function(e,t,r){var n=this;return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,t),function(){n.sourcePreviewNodes.delete(e),n.sourcePreviewNodeOptions.delete(e)}}},{key:"connectDragSource",value:function(e,t,r){var n=this;this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,r);var o=function(t){return n.handleDragStart(t,e)},i=function(e){return n.handleSelectStart(e)};return t.setAttribute("draggable","true"),t.addEventListener("dragstart",o),t.addEventListener("selectstart",i),function(){n.sourceNodes.delete(e),n.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",o),t.removeEventListener("selectstart",i),t.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(e,t){var r=this,n=function(t){return r.handleDragEnter(t,e)},o=function(t){return r.handleDragOver(t,e)},i=function(t){return r.handleDrop(t,e)};return t.addEventListener("dragenter",n),t.addEventListener("dragover",o),t.addEventListener("drop",i),function(){t.removeEventListener("dragenter",n),t.removeEventListener("dragover",o),t.removeEventListener("drop",i)}}},{key:"addEventListeners",value:function(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return Cp({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId();return Cp({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}},{key:"isDraggingNativeItem",value:function(){var t=this.monitor.getItemType();return Object.keys(e).some((function(r){return e[r]===t}))}},{key:"beginDragNativeItem",value:function(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(e,t){var r=new _p(vp[e]);return r.loadDataTransfer(t),r}(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(e){var t=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout((function(){var e;return null===(e=t.rootElement)||void 0===e?void 0:e.addEventListener("mousemove",t.endDragIfSourceWasRemovedFromDOM,!0)}),1e3)}},{key:"clearCurrentDragSourceNode",value:function(){var e;return!!this.currentDragSourceNode&&(this.currentDragSourceNode=null,this.rootElement&&(null===(e=this.window)||void 0===e||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0)}},{key:"handleDragStart",value:function(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}},{key:"handleDragEnter",value:function(e,t){this.dragEnterTargetIds.unshift(t)}},{key:"handleDragOver",value:function(e,t){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}},{key:"handleDrop",value:function(e,t){this.dropTargetIds.unshift(t)}}])&&Tp(r.prototype,n),t}(),Rp=function(e,t,r){return new jp(e,t,r)};function Mp(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];if(!e){var i;if(void 0===t)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;(i=new Error(t.replace(/%s/g,(function(){return n[a++]})))).name="Invariant Violation"}throw i.framesToPop=1,i}}function Ap(e,t,r){var n=r.getRegistry(),o=n.addTarget(e,t);return[o,function(){return n.removeTarget(o)}]}function Ip(e,t,r){var n=r.getRegistry(),o=n.addSource(e,t);return[o,function(){return n.removeSource(o)}]}function Dp(e){var r={};return Object.keys(e).forEach((function(n){var o=e[n];if(n.endsWith("Ref"))r[n]=e[n];else{var i=function(e){return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!(0,t.isValidElement)(r)){var o=r;return e(o,n),o}var i=r;!function(e){if("string"!=typeof e.type){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}(i);var a=n?function(t){return e(t,n)}:e;return function(e,r){var n=e.ref;return Mp("string"!=typeof n,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?(0,t.cloneElement)(e,{ref:function(e){Lp(n,e),Lp(r,e)}}):(0,t.cloneElement)(e,{ref:r})}(i,a)}}(o);r[n]=function(){return i}}})),r}function Lp(e,t){"function"==typeof e?e(t):e.current=t}function Np(e){return Np="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Np(e)}function $p(e){return null!==e&&"object"===Np(e)&&Object.prototype.hasOwnProperty.call(e,"current")}function Fp(e,t,r,n){var o=r?r.call(n,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<i.length;l++){var c=i[l];if(!s(c))return!1;var u=e[c],f=t[c];if(!1===(o=r?r.call(n,u,f,c):void 0)||void 0===o&&u!==f)return!1}return!0}function Bp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Up(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var zp=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Up(this,"hooks",Dp({dragSource:function(e,t){r.clearDragSource(),r.dragSourceOptions=t||null,$p(e)?r.dragSourceRef=e:r.dragSourceNode=e,r.reconnectDragSource()},dragPreview:function(e,t){r.clearDragPreview(),r.dragPreviewOptions=t||null,$p(e)?r.dragPreviewRef=e:r.dragPreviewNode=e,r.reconnectDragPreview()}})),Up(this,"handlerId",null),Up(this,"dragSourceRef",null),Up(this,"dragSourceNode",void 0),Up(this,"dragSourceOptionsInternal",null),Up(this,"dragSourceUnsubscribe",void 0),Up(this,"dragPreviewRef",null),Up(this,"dragPreviewNode",void 0),Up(this,"dragPreviewOptionsInternal",null),Up(this,"dragPreviewUnsubscribe",void 0),Up(this,"lastConnectedHandlerId",null),Up(this,"lastConnectedDragSource",null),Up(this,"lastConnectedDragSourceOptions",null),Up(this,"lastConnectedDragPreview",null),Up(this,"lastConnectedDragPreviewOptions",null),Up(this,"backend",void 0),this.backend=t}var t,r;return t=e,(r=[{key:"receiveHandlerId",value:function(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(e){this.dragSourceOptionsInternal=e}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(e){this.dragPreviewOptionsInternal=e}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();t&&this.disconnectDragSource(),this.handlerId&&(e?t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)):this.lastConnectedDragSource=e)}},{key:"reconnectDragPreview",value:function(){var e=this.dragPreview,t=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();t&&this.disconnectDragPreview(),this.handlerId&&(e?t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=e,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,e,this.dragPreviewOptions)):this.lastConnectedDragPreview=e)}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!Fp(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!Fp(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}])&&Bp(t.prototype,r),e}();function qp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Wp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Hp=!1,Vp=!1,Gp=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Wp(this,"internalMonitor",void 0),Wp(this,"sourceId",null),this.internalMonitor=t.getMonitor()}var t,r;return t=e,(r=[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){Mp(!Hp,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Hp=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Hp=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;Mp(!Vp,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Vp=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Vp=!1}}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"isDraggingSource",value:function(e){return this.internalMonitor.isDraggingSource(e)}},{key:"isOverTarget",value:function(e,t){return this.internalMonitor.isOverTarget(e,t)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(e){return this.internalMonitor.subscribeToOffsetChange(e)}},{key:"canDragSource",value:function(e){return this.internalMonitor.canDragSource(e)}},{key:"canDropOnTarget",value:function(e){return this.internalMonitor.canDropOnTarget(e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}])&&qp(t.prototype,r),e}();function Kp(e){return Kp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kp(e)}function Yp(e){var t=e.current;return null==t?null:t.decoratedRef?t.decoratedRef.current:t}function Jp(e){return"function"==typeof e}function Qp(){}function Xp(e){if(!function(e){return"object"===Kp(e)&&null!==e}(e))return!1;if(null===Object.getPrototypeOf(e))return!0;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Zp(e,t){return"string"==typeof e||"symbol"===Kp(e)||!!t&&Array.isArray(e)&&e.every((function(e){return Zp(e,!1)}))}var ed=__webpack_require__(52322),td=(0,t.createContext)({dragDropManager:void 0});function rd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function od(e,t,r){return t&&nd(e.prototype,t),r&&nd(e,r),e}function id(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ad=function(){function e(t){rd(this,e),id(this,"isDisposed",!1),id(this,"action",void 0),this.action=Jp(t)?t:Qp}return od(e,[{key:"dispose",value:function(){this.isDisposed||(this.action(),this.isDisposed=!0)}}],[{key:"isDisposable",value:function(e){return Boolean(e&&Jp(e.dispose))}},{key:"_fixup",value:function(t){return e.isDisposable(t)?t:e.empty}},{key:"create",value:function(t){return new e(t)}}]),e}();id(ad,"empty",{dispose:Qp});var sd=function(){function e(){rd(this,e),id(this,"isDisposed",!1),id(this,"disposables",void 0);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];this.disposables=r}return od(e,[{key:"add",value:function(e){this.isDisposed?e.dispose():this.disposables.push(e)}},{key:"remove",value:function(e){var t=!1;if(!this.isDisposed){var r=this.disposables.indexOf(e);-1!==r&&(t=!0,this.disposables.splice(r,1),e.dispose())}return t}},{key:"clear",value:function(){if(!this.isDisposed){for(var e=this.disposables.length,t=new Array(e),r=0;r<e;r++)t[r]=this.disposables[r];this.disposables=[];for(var n=0;n<e;n++)t[n].dispose()}}},{key:"dispose",value:function(){if(!this.isDisposed){this.isDisposed=!0;for(var e=this.disposables.length,t=new Array(e),r=0;r<e;r++)t[r]=this.disposables[r];this.disposables=[];for(var n=0;n<e;n++)t[n].dispose()}}}]),e}(),ld=function(){function e(){rd(this,e),id(this,"isDisposed",!1),id(this,"current",void 0)}return od(e,[{key:"getDisposable",value:function(){return this.current}},{key:"setDisposable",value:function(e){var t=this.isDisposed;if(!t){var r=this.current;this.current=e,r&&r.dispose()}t&&e&&e.dispose()}},{key:"dispose",value:function(){if(!this.isDisposed){this.isDisposed=!0;var e=this.current;this.current=void 0,e&&e.dispose()}}}]),e}();function cd(e){return cd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cd(e)}function ud(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function pd(e,t){return pd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},pd(e,t)}function dd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hd(e){return hd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},hd(e)}function gd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function md(e){var r=e.DecoratedComponent,n=e.createHandler,o=e.createMonitor,i=e.createConnector,a=e.registerHandler,s=e.containerDisplayName,l=e.getType,c=e.collect,u=e.options.arePropsEqual,f=void 0===u?Fp:u,p=r,d=r.displayName||r.name||"Component",h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&pd(e,t)}(m,e);var r,s,u,h,g=(u=m,h=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=hd(u);if(h){var r=hd(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===cd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return dd(e)}(this,e)});function m(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,m),gd(dd(r=g.call(this,e)),"decoratedRef",(0,t.createRef)()),gd(dd(r),"handlerId",void 0),gd(dd(r),"manager",void 0),gd(dd(r),"handlerMonitor",void 0),gd(dd(r),"handlerConnector",void 0),gd(dd(r),"handler",void 0),gd(dd(r),"disposable",void 0),gd(dd(r),"currentType",void 0),gd(dd(r),"handleChange",(function(){var e=r.getCurrentState();Fp(e,r.state)||r.setState(e)})),r.disposable=new ld,r.receiveProps(e),r.dispose(),r}return r=m,s=[{key:"getHandlerId",value:function(){return this.handlerId}},{key:"getDecoratedComponentInstance",value:function(){return Mp(this.decoratedRef.current,"In order to access an instance of the decorated component, it must either be a class component or use React.forwardRef()"),this.decoratedRef.current}},{key:"shouldComponentUpdate",value:function(e,t){return!f(e,this.props)||!Fp(t,this.state)}},{key:"componentDidMount",value:function(){this.disposable=new ld,this.currentType=void 0,this.receiveProps(this.props),this.handleChange()}},{key:"componentDidUpdate",value:function(e){f(this.props,e)||(this.receiveProps(this.props),this.handleChange())}},{key:"componentWillUnmount",value:function(){this.dispose()}},{key:"receiveProps",value:function(e){this.handler&&(this.handler.receiveProps(e),this.receiveType(l(e)))}},{key:"receiveType",value:function(e){if(this.handlerMonitor&&this.manager&&this.handlerConnector&&e!==this.currentType){this.currentType=e;var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ud(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ud(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(a(e,this.handler,this.manager),2),r=t[0],n=t[1];this.handlerId=r,this.handlerMonitor.receiveHandlerId(r),this.handlerConnector.receiveHandlerId(r);var o=this.manager.getMonitor().subscribeToStateChange(this.handleChange,{handlerIds:[r]});this.disposable.setDisposable(new sd(new ad(o),new ad(n)))}}},{key:"dispose",value:function(){this.disposable.dispose(),this.handlerConnector&&this.handlerConnector.receiveHandlerId(null)}},{key:"getCurrentState",value:function(){return this.handlerConnector?c(this.handlerConnector.hooks,this.handlerMonitor,this.props):{}}},{key:"render",value:function(){var e=this;return(0,ed.jsx)(td.Consumer,{children:function(t){var r,n,o=t.dragDropManager;return e.receiveDragDropManager(o),"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame((function(){var t;return null===(t=e.handlerConnector)||void 0===t?void 0:t.reconnect()})),(0,ed.jsx)(p,Object.assign({},e.props,e.getCurrentState(),{ref:(r=p,(n=r)&&n.prototype&&"function"==typeof n.prototype.render||function(e){var t;return"Symbol(react.forward_ref)"===(null==e||null===(t=e.$$typeof)||void 0===t?void 0:t.toString())}(r)?e.decoratedRef:null)}),void 0)}},void 0)}},{key:"receiveDragDropManager",value:function(e){void 0===this.manager&&(Mp(void 0!==e,"Could not find the drag and drop manager in the context of %s. Make sure to render a DndProvider component in your top-level component. Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#could-not-find-the-drag-and-drop-manager-in-the-context",d,d),void 0!==e&&(this.manager=e,this.handlerMonitor=o(e),this.handlerConnector=i(e.getBackend()),this.handler=n(this.handlerMonitor,this.decoratedRef)))}}],s&&fd(r.prototype,s),m}(t.Component);return gd(h,"DecoratedComponent",r),gd(h,"displayName","".concat(s,"(").concat(d,")")),m()(h,r)}function yd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function vd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var bd=["canDrag","beginDrag","isDragging","endDrag"],wd=["beginDrag"],_d=function(){function e(t,r,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),vd(this,"props",null),vd(this,"spec",void 0),vd(this,"monitor",void 0),vd(this,"ref",void 0),vd(this,"beginDrag",(function(){if(o.props)return o.spec.beginDrag(o.props,o.monitor,o.ref.current)})),this.spec=t,this.monitor=r,this.ref=n}var t,r;return t=e,(r=[{key:"receiveProps",value:function(e){this.props=e}},{key:"canDrag",value:function(){return!!this.props&&(!this.spec.canDrag||this.spec.canDrag(this.props,this.monitor))}},{key:"isDragging",value:function(e,t){return!!this.props&&(this.spec.isDragging?this.spec.isDragging(this.props,this.monitor):t===e.getSourceId())}},{key:"endDrag",value:function(){this.props&&this.spec.endDrag&&this.spec.endDrag(this.props,this.monitor,Yp(this.ref))}}])&&yd(t.prototype,r),e}();function Sd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function xd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Od=!1,Ed=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),xd(this,"internalMonitor",void 0),xd(this,"targetId",null),this.internalMonitor=t.getMonitor()}var t,r;return t=e,(r=[{key:"receiveHandlerId",value:function(e){this.targetId=e}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;Mp(!Od,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Od=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Od=!1}}},{key:"isOver",value:function(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}])&&Sd(t.prototype,r),e}();function kd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Cd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Td=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Cd(this,"hooks",Dp({dropTarget:function(e,t){r.clearDropTarget(),r.dropTargetOptions=t,$p(e)?r.dropTargetRef=e:r.dropTargetNode=e,r.reconnect()}})),Cd(this,"handlerId",null),Cd(this,"dropTargetRef",null),Cd(this,"dropTargetNode",void 0),Cd(this,"dropTargetOptionsInternal",null),Cd(this,"unsubscribeDropTarget",void 0),Cd(this,"lastConnectedHandlerId",null),Cd(this,"lastConnectedDropTarget",null),Cd(this,"lastConnectedDropTargetOptions",null),Cd(this,"backend",void 0),this.backend=t}var t,r;return t=e,(r=[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();var t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}},{key:"receiveHandlerId",value:function(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(e){this.dropTargetOptionsInternal=e}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!Fp(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}])&&kd(t.prototype,r),e}();function Pd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function jd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Rd=["canDrop","hover","drop"],Md=function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),jd(this,"props",null),jd(this,"spec",void 0),jd(this,"monitor",void 0),jd(this,"ref",void 0),this.spec=t,this.monitor=r,this.ref=n}var t,r;return t=e,(r=[{key:"receiveProps",value:function(e){this.props=e}},{key:"receiveMonitor",value:function(e){this.monitor=e}},{key:"canDrop",value:function(){return!this.spec.canDrop||this.spec.canDrop(this.props,this.monitor)}},{key:"hover",value:function(){this.spec.hover&&this.props&&this.spec.hover(this.props,this.monitor,Yp(this.ref))}},{key:"drop",value:function(){if(this.spec.drop)return this.spec.drop(this.props,this.monitor,this.ref.current)}}])&&Pd(t.prototype,r),e}();var Ad="dnd-core/INIT_COORDS",Id="dnd-core/BEGIN_DRAG",Dd="dnd-core/PUBLISH_DRAG_SOURCE",Ld="dnd-core/HOVER",Nd="dnd-core/DROP",$d="dnd-core/END_DRAG";function Fd(e,t){return{type:Ad,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function Bd(e){return Bd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bd(e)}function Ud(e){return"object"===Bd(e)}var zd={type:Ad,payload:{clientOffset:null,sourceClientOffset:null}};function qd(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0},n=r.publishSource,o=void 0===n||n,i=r.clientOffset,a=r.getSourceClientOffset,s=e.getMonitor(),l=e.getRegistry();e.dispatch(Fd(i)),function(e,t,r){Mp(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach((function(e){Mp(r.getSource(e),"Expected sourceIds to be registered.")}))}(t,s,l);var c=function(e,t){for(var r=null,n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}(t,s);if(null!==c){var u=null;if(i){if(!a)throw new Error("getSourceClientOffset must be defined");!function(e){Mp("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(a),u=a(c)}e.dispatch(Fd(i,u));var f=l.getSource(c).beginDrag(s,c);if(null!=f){!function(e){Mp(Ud(e),"Item must be an object.")}(f),l.pinSource(c);var p=l.getSourceType(c);return{type:Id,payload:{itemType:p,item:f,sourceId:c,clientOffset:i||null,sourceClientOffset:u||null,isSourcePublic:!!o}}}}else e.dispatch(zd)}}function Wd(e){return function(){if(e.getMonitor().isDragging())return{type:Dd}}}function Hd(e,t){return null===t?null===e:Array.isArray(e)?e.some((function(e){return e===t})):e===t}function Vd(e){return function(t){var r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clientOffset;!function(e){Mp(Array.isArray(e),"Expected targetIds to be an array.")}(t);var n=t.slice(0),o=e.getMonitor(),i=e.getRegistry();return function(e,t,r){Mp(t.isDragging(),"Cannot call hover while not dragging."),Mp(!t.didDrop(),"Cannot call hover after drop.");for(var n=0;n<e.length;n++){var o=e[n];Mp(e.lastIndexOf(o)===n,"Expected targetIds to be unique in the passed array."),Mp(r.getTarget(o),"Expected targetIds to be registered.")}}(n,o,i),function(e,t,r){for(var n=e.length-1;n>=0;n--){var o=e[n];Hd(t.getTargetType(o),r)||e.splice(n,1)}}(n,i,o.getItemType()),function(e,t,r){e.forEach((function(e){r.getTarget(e).hover(t,e)}))}(n,o,i),{type:Ld,payload:{targetIds:n,clientOffset:r||null}}}}function Gd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Kd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gd(Object(r),!0).forEach((function(t){Yd(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Yd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jd(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.getMonitor(),n=e.getRegistry();!function(e){Mp(e.isDragging(),"Cannot call drop while not dragging."),Mp(!e.didDrop(),"Cannot call drop twice during one drag operation.")}(r);var o=function(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}(r);o.forEach((function(o,i){var a=function(e,t,r,n){var o=r.getTarget(e),i=o?o.drop(n,e):void 0;return function(e){Mp(void 0===e||Ud(e),"Drop result must either be an object or undefined.")}(i),void 0===i&&(i=0===t?{}:n.getDropResult()),i}(o,i,n,r),s={type:Nd,payload:{dropResult:Kd(Kd({},t),a)}};e.dispatch(s)}))}}function Qd(e){return function(){var t=e.getMonitor(),r=e.getRegistry();!function(e){Mp(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);var n=t.getSourceId();return null!=n&&(r.getSource(n,!0).endDrag(t,n),r.unpinSource()),{type:$d}}}function Xd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Zd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var eh=function(){function e(t,r){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Zd(this,"store",void 0),Zd(this,"monitor",void 0),Zd(this,"backend",void 0),Zd(this,"isSetUp",!1),Zd(this,"handleRefCountChange",(function(){var e=n.store.getState().refCount>0;n.backend&&(e&&!n.isSetUp?(n.backend.setup(),n.isSetUp=!0):!e&&n.isSetUp&&(n.backend.teardown(),n.isSetUp=!1))})),this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}var t,r;return t=e,r=[{key:"receiveBackend",value:function(e){this.backend=e}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var e=this,t=this.store.dispatch,r=function(e){return{beginDrag:qd(e),publishDragSource:Wd(e),hover:Vd(e),drop:Jd(e),endDrag:Qd(e)}}(this);return Object.keys(r).reduce((function(n,o){var i,a=r[o];return n[o]=(i=a,function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];var a=i.apply(e,n);void 0!==a&&t(a)}),n}),{})}},{key:"dispatch",value:function(e){this.store.dispatch(e)}}],r&&Xd(t.prototype,r),e}(),th=function(e,t){return e===t};function rh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rh(Object(r),!0).forEach((function(t){oh(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function oh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ih={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function ah(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ih,n=arguments.length>1?arguments[1]:void 0,o=n.payload;switch(n.type){case Ad:case Id:return{initialSourceClientOffset:o.sourceClientOffset,initialClientOffset:o.clientOffset,clientOffset:o.clientOffset};case Ld:return e=r.clientOffset,t=o.clientOffset,!e&&!t||e&&t&&e.x===t.x&&e.y===t.y?r:nh(nh({},r),{},{clientOffset:o.clientOffset});case $d:case Nd:return ih;default:return r}}var sh="dnd-core/ADD_SOURCE",lh="dnd-core/ADD_TARGET",ch="dnd-core/REMOVE_SOURCE",uh="dnd-core/REMOVE_TARGET";function fh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ph(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fh(Object(r),!0).forEach((function(t){dh(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function dh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var hh={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function gh(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hh,n=arguments.length>1?arguments[1]:void 0,o=n.payload;switch(n.type){case Id:return ph(ph({},r),{},{itemType:o.itemType,item:o.item,sourceId:o.sourceId,isSourcePublic:o.isSourcePublic,dropResult:null,didDrop:!1});case Dd:return ph(ph({},r),{},{isSourcePublic:!0});case Ld:return ph(ph({},r),{},{targetIds:o.targetIds});case uh:return-1===r.targetIds.indexOf(o.targetId)?r:ph(ph({},r),{},{targetIds:(e=r.targetIds,t=o.targetId,e.filter((function(e){return e!==t})))});case Nd:return ph(ph({},r),{},{dropResult:o.dropResult,didDrop:!0,targetIds:[]});case $d:return ph(ph({},r),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return r}}function mh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case sh:case lh:return e+1;case ch:case uh:return e-1;default:return e}}var yh=[],vh=[];function bh(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Ld:break;case sh:case lh:case uh:case ch:return yh;default:return vh}var t=e.payload,r=t.targetIds,n=void 0===r?[]:r,o=t.prevTargetIds,i=void 0===o?[]:o,a=function(e,t){var r=new Map,n=function(e){r.set(e,r.has(e)?r.get(e)+1:1)};e.forEach(n),t.forEach(n);var o=[];return r.forEach((function(e,t){1===e&&o.push(t)})),o}(n,i),s=a.length>0||!function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:th;if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}(n,i);if(!s)return yh;var l=i[i.length-1],c=n[n.length-1];return l!==c&&(l&&a.push(l),c&&a.push(c)),a}function wh(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)+1}function _h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Sh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_h(Object(r),!0).forEach((function(t){xh(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Oh(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:bh(r.dirtyHandlerIds,{type:n.type,payload:Sh(Sh({},n.payload),{},{prevTargetIds:(e=r,"dragOperation.targetIds",t=[],"dragOperation.targetIds".split(".").reduce((function(e,r){return e&&e[r]?e[r]:t||null}),e))})}),dragOffset:ah(r.dragOffset,n),refCount:mh(r.refCount,n),dragOperation:gh(r.dragOperation,n),stateId:wh(r.stateId)}}function Eh(e,t){return{x:e.x-t.x,y:e.y-t.y}}function kh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ch(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}yh.__IS_NONE__=!0,vh.__IS_ALL__=!0;var Th,Ph=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ch(this,"store",void 0),Ch(this,"registry",void 0),this.store=t,this.registry=r}var t,r;return t=e,r=[{key:"subscribeToStateChange",value:function(e){var t=this,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{handlerIds:void 0}).handlerIds;Mp("function"==typeof e,"listener must be a function."),Mp(void 0===r||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");var n=this.store.getState().stateId;return this.store.subscribe((function(){var o=t.store.getState(),i=o.stateId;try{var a=i===n||i===n+1&&!function(e,t){if(e===yh)return!1;if(e===vh||void 0===t)return!0;var r,n=(r=e,t.filter((function(e){return r.indexOf(e)>-1})));return n.length>0}(o.dirtyHandlerIds,r);a||e()}finally{n=i}}))}},{key:"subscribeToOffsetChange",value:function(e){var t=this;Mp("function"==typeof e,"listener must be a function.");var r=this.store.getState().dragOffset;return this.store.subscribe((function(){var n=t.store.getState().dragOffset;n!==r&&(r=n,e())}))}},{key:"canDragSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e);return Mp(t,"Expected to find a valid source. sourceId=".concat(e)),!this.isDragging()&&t.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var t=this.registry.getTarget(e);return Mp(t,"Expected to find a valid target. targetId=".concat(e)),!(!this.isDragging()||this.didDrop())&&Hd(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}},{key:"isDragging",value:function(){return Boolean(this.getItemType())}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e,!0);return Mp(t,"Expected to find a valid source. sourceId=".concat(e)),!(!this.isDragging()||!this.isSourcePublic())&&this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e)}},{key:"isOverTarget",value:function(e){if(!e)return!1;var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1}).shallow;if(!this.isDragging())return!1;var r=this.registry.getTargetType(e),n=this.getItemType();if(n&&!Hd(r,n))return!1;var o=this.getTargetIds();if(!o.length)return!1;var i=o.indexOf(e);return t?i===o.length-1:i>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return t=(e=this.store.getState().dragOffset).clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset,t&&r&&n?Eh(function(e,t){return{x:e.x+t.x,y:e.y+t.y}}(t,n),r):null;var e,t,r,n}},{key:"getDifferenceFromInitialOffset",value:function(){return t=(e=this.store.getState().dragOffset).clientOffset,r=e.initialClientOffset,t&&r?Eh(t,r):null;var e,t,r}}],r&&kh(t.prototype,r),e}(),jh=0;function Rh(e){return Rh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rh(e)}function Mh(e,t){t&&Array.isArray(e)?e.forEach((function(e){return Mh(e,!1)})):Mp("string"==typeof e||"symbol"===Rh(e),t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}!function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"}(Th||(Th={}));const Ah="undefined"!=typeof global?global:self,Ih=Ah.MutationObserver||Ah.WebKitMutationObserver;function Dh(e){return function(){const t=setTimeout(n,0),r=setInterval(n,50);function n(){clearTimeout(t),clearInterval(r),e()}}}const Lh="function"==typeof Ih?function(e){let t=1;const r=new Ih(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}:Dh;class Nh{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}const $h=new class{enqueueTask(e){const{queue:t,requestFlush:r}=this;t.length||(r(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,r=e.length-this.index;t<r;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=Lh(this.flush),this.requestErrorThrow=Dh((()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()}))}},Fh=new class{create(e){const t=this.freeTasks,r=t.length?t.pop():new Nh(this.onError,(e=>t[t.length]=e));return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}($h.registerPendingError);function Bh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Uh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return qh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qh(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Wh(e){switch(e[0]){case"S":return Th.SOURCE;case"T":return Th.TARGET;default:Mp(!1,"Cannot parse handler ID: ".concat(e))}}function Hh(e,t){var r=e.entries(),n=!1;do{var o=r.next(),i=o.done;if(zh(o.value,2)[1]===t)return!0;n=!!i}while(!n);return!1}var Vh=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Uh(this,"types",new Map),Uh(this,"dragSources",new Map),Uh(this,"dropTargets",new Map),Uh(this,"pinnedSourceId",null),Uh(this,"pinnedSource",null),Uh(this,"store",void 0),this.store=t}var t,r;return t=e,r=[{key:"addSource",value:function(e,t){Mh(e),function(e){Mp("function"==typeof e.canDrag,"Expected canDrag to be a function."),Mp("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),Mp("function"==typeof e.endDrag,"Expected endDrag to be a function.")}(t);var r=this.addHandler(Th.SOURCE,e,t);return this.store.dispatch(function(e){return{type:sh,payload:{sourceId:e}}}(r)),r}},{key:"addTarget",value:function(e,t){Mh(e,!0),function(e){Mp("function"==typeof e.canDrop,"Expected canDrop to be a function."),Mp("function"==typeof e.hover,"Expected hover to be a function."),Mp("function"==typeof e.drop,"Expected beginDrag to be a function.")}(t);var r=this.addHandler(Th.TARGET,e,t);return this.store.dispatch(function(e){return{type:lh,payload:{targetId:e}}}(r)),r}},{key:"containsHandler",value:function(e){return Hh(this.dragSources,e)||Hh(this.dropTargets,e)}},{key:"getSource",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Mp(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}},{key:"getTarget",value:function(e){return Mp(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return Mp(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return Mp(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return Wh(e)===Th.SOURCE}},{key:"isTargetId",value:function(e){return Wh(e)===Th.TARGET}},{key:"removeSource",value:function(e){var t,r=this;Mp(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:ch,payload:{sourceId:e}}}(e)),t=function(){r.dragSources.delete(e),r.types.delete(e)},$h.enqueueTask(Fh.create(t))}},{key:"removeTarget",value:function(e){Mp(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:uh,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var t=this.getSource(e);Mp(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}},{key:"unpinSource",value:function(){Mp(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,t,r){var n=function(e){var t=(jh++).toString();switch(e){case Th.SOURCE:return"S".concat(t);case Th.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}(e);return this.types.set(n,t),e===Th.SOURCE?this.dragSources.set(n,r):e===Th.TARGET&&this.dropTargets.set(n,r),n}}],r&&Bh(t.prototype,r),e}();function Gh(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=(t=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__,(0,He.MT)(Oh,t&&r&&r({name:"dnd-core",instanceId:"dnd-core"}))),a=new Ph(i,new Vh(i)),s=new eh(i,a),l=e(s,n,o);return s.receiveBackend(l),s}var Kh=["children"];function Yh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Jh=0,Qh=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),Xh=(0,t.memo)((function(e){var r=e.children,n=function(e){if("manager"in e)return[{dragDropManager:e.manager},!1];var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zh(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,o=t;return o[Qh]||(o[Qh]={dragDropManager:Gh(e,t,r,n)}),o[Qh]}(e.backend,e.context,e.options,e.debugMode);return[t,!e.context]}(function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,Kh)),o=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Yh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Yh(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(n,2),i=o[0],a=o[1];return(0,t.useEffect)((function(){if(a){var e=Zh();return++Jh,function(){0==--Jh&&(e[Qh]=null)}}}),[]),(0,ed.jsx)(td.Provider,Object.assign({value:i},{children:r}),void 0)}));function Zh(){return void 0!==__webpack_require__.g?__webpack_require__.g:window}const eg=["namespace"],tg=["children","isDragging","connectDragComponent"],rg=["onDrop","namespace"];function ng(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function og(e){let{namespace:t}=e,n=ng(e,eg);const o=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e;"function"!=typeof e&&(Mp(Zp(e),'Expected "type" provided as the first argument to DragSource to be a string, or a function that returns a string given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',e),o=function(){return e}),Mp(Xp(t),'Expected "spec" provided as the second argument to DragSource to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',t);var i=function(e){return Object.keys(e).forEach((function(t){Mp(bd.indexOf(t)>-1,'Expected the drag source specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',bd.join(", "),t),Mp("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source",t,t,e[t])})),wd.forEach((function(t){Mp("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source",t,t,e[t])})),function(t,r){return new _d(e,t,r)}}(t);return Mp("function"==typeof r,'Expected "collect" provided as the third argument to DragSource to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',r),Mp(Xp(n),'Expected "options" provided as the fourth argument to DragSource to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',r),function(e){return md({containerDisplayName:"DragSource",createHandler:i,registerHandler:Ip,createConnector:function(e){return new zp(e)},createMonitor:function(e){return new Gp(e)},DecoratedComponent:e,getType:o,collect:r,options:n})}}(t,{beginDrag(e){let{children:t,isDragging:r,connectDragComponent:n}=e;return ng(e,tg)}},(e=>({connectDragComponent:e.dragSource()})))((({children:e,connectDragComponent:t})=>e(t)));return r().createElement(o,n,n.children)}function ig(e){let{onDrop:t,namespace:n}=e,o=ng(e,rg);const i=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e;"function"!=typeof e&&(Mp(Zp(e,!0),'Expected "type" provided as the first argument to DropTarget to be a string, an array of strings, or a function that returns either given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',e),o=function(){return e}),Mp(Xp(t),'Expected "spec" provided as the second argument to DropTarget to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',t);var i=function(e){return Object.keys(e).forEach((function(t){Mp(Rd.indexOf(t)>-1,'Expected the drop target specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',Rd.join(", "),t),Mp("function"==typeof e[t],"Expected %s in the drop target specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target",t,t,e[t])})),function(t,r){return new Md(e,t,r)}}(t);return Mp("function"==typeof r,'Expected "collect" provided as the third argument to DropTarget to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',r),Mp(Xp(n),'Expected "options" provided as the fourth argument to DropTarget to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',r),function(e){return md({containerDisplayName:"DropTarget",createHandler:i,registerHandler:Ap,createMonitor:function(e){return new Ed(e)},createConnector:function(e){return new Td(e)},DecoratedComponent:e,getType:o,collect:r,options:n})}}(n,{drop(e,r){t(r.getItem())}},((e,t)=>({connectDropTarget:e.dropTarget(),isHovered:t.isOver()})))((({children:e,connectDropTarget:t,isHovered:r})=>e(t,{isHovered:r})));return r().createElement(i,o,o.children)}function ag(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}og.propTypes={namespace:i().any.isRequired,children:i().func.isRequired},ig.propTypes={onDrop:i().func.isRequired,namespace:i().any.isRequired,children:i().func.isRequired};var sg=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,lg=ag((function(e){return sg.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),cg=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},ug={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},fg=/[A-Z]|^ms/g,pg=/_EMO_([^_]+?)_([^]*?)_EMO_/g,dg=function(e){return 45===e.charCodeAt(1)},hg=function(e){return null!=e&&"boolean"!=typeof e},gg=ag((function(e){return dg(e)?e:e.replace(fg,"-$&").toLowerCase()})),mg=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(pg,(function(e,t,r){return vg={name:t,styles:r,next:vg},t}))}return 1===ug[e]||dg(e)||"number"!=typeof t||0===t?t:t+"px"};function yg(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return vg={name:r.name,styles:r.styles,next:vg},r.name;if(void 0!==r.styles){var n=r.next;if(void 0!==n)for(;void 0!==n;)vg={name:n.name,styles:n.styles,next:vg},n=n.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=yg(e,t,r[o])+";";else for(var i in r){var a=r[i];if("object"!=typeof a)null!=t&&void 0!==t[a]?n+=i+"{"+t[a]+"}":hg(a)&&(n+=gg(i)+":"+mg(i,a)+";");else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var s=yg(e,t,a);switch(i){case"animation":case"animationName":n+=gg(i)+":"+s+";";break;default:n+=i+"{"+s+"}"}}else for(var l=0;l<a.length;l++)hg(a[l])&&(n+=gg(i)+":"+mg(i,a[l])+";")}return n}(e,t,r);case"function":if(void 0!==e){var o=vg,i=r(e);return vg=o,yg(e,t,i)}}if(null==t)return r;var a=t[r];return void 0!==a?a:r}var vg,bg=/label:\s*([^\s;\n{]+)\s*(;|$)/g,wg=!!t.useInsertionEffect&&t.useInsertionEffect,_g=wg||function(e){return e()},Sg=(wg||t.useLayoutEffect,lg),xg=function(e){return"theme"!==e},Og=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Sg:xg},Eg=function(e,t,r){var n;if(t){var o=t.shouldForwardProp;n=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof n&&r&&(n=e.__emotion_forwardProp),n},kg=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return cg(t,r,n),_g((function(){return function(e,t,r){cg(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+n:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}}(t,r,n)})),null},Cg=function e(r,n){var o,i,a=r.__emotion_real===r,s=a&&r.__emotion_base||r;void 0!==n&&(o=n.label,i=n.target);var l=Eg(r,n,a),c=l||Og(s),u=!c("as");return function(){var f=arguments,p=a&&void 0!==r.__emotion_styles?r.__emotion_styles.slice(0):[];if(void 0!==o&&p.push("label:"+o+";"),null==f[0]||void 0===f[0].raw)p.push.apply(p,f);else{p.push(f[0][0]);for(var h=f.length,g=1;g<h;g++)p.push(f[g],f[0][g])}var m=(0,xo.withEmotionCache)((function(e,r,n){var o,a,f,d,h=u&&e.as||s,g="",m=[],y=e;if(null==e.theme){for(var v in y={},e)y[v]=e[v];y.theme=t.useContext(xo.ThemeContext)}"string"==typeof e.className?(o=r.registered,a=m,f=e.className,d="",f.split(" ").forEach((function(e){void 0!==o[e]?a.push(o[e]+";"):d+=e+" "})),g=d):null!=e.className&&(g=e.className+" ");var b=function(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,o="";vg=void 0;var i=e[0];null==i||void 0===i.raw?(n=!1,o+=yg(r,t,i)):o+=i[0];for(var a=1;a<e.length;a++)o+=yg(r,t,e[a]),n&&(o+=i[a]);bg.lastIndex=0;for(var s,l="";null!==(s=bg.exec(o));)l+="-"+s[1];var c=function(e){for(var t,r=0,n=0,o=e.length;o>=4;++n,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(o){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(o)+l;return{name:c,styles:o,next:vg}}(p.concat(m),r.registered,y);g+=r.key+"-"+b.name,void 0!==i&&(g+=" "+i);var w=u&&void 0===l?Og(h):c,_={};for(var S in e)u&&"as"===S||w(S)&&(_[S]=e[S]);return _.className=g,_.ref=n,t.createElement(t.Fragment,null,t.createElement(kg,{cache:r,serialized:b,isStringTag:"string"==typeof h}),t.createElement(h,_))}));return m.displayName=void 0!==o?o:"Styled("+("string"==typeof s?s:s.displayName||s.name||"Component")+")",m.defaultProps=r.defaultProps,m.__emotion_real=m,m.__emotion_base=s,m.__emotion_styles=p,m.__emotion_forwardProp=l,Object.defineProperty(m,"toString",{value:function(){return"."+i}}),m.withComponent=function(t,r){return e(t,d({},n,r,{shouldForwardProp:Eg(m,r,!0)})).apply(void 0,p)},m}},Tg=__webpack_require__(36585),Pg=__webpack_require__.n(Tg);function jg(e,{target:t=document.body}={}){if("string"!=typeof e)throw new TypeError(`Expected parameter \`text\` to be a \`string\`, got \`${typeof e}\`.`);const r=document.createElement("textarea"),n=document.activeElement;r.value=e,r.setAttribute("readonly",""),r.style.contain="strict",r.style.position="absolute",r.style.left="-9999px",r.style.fontSize="12pt";const o=document.getSelection(),i=o.rangeCount>0&&o.getRangeAt(0);t.append(r),r.select(),r.selectionStart=0,r.selectionEnd=e.length;let a=!1;try{a=document.execCommand("copy")}catch{}return r.remove(),i&&(o.removeAllRanges(),o.addRange(i)),n&&n.focus(),a}var Rg=__webpack_require__(67129);const Mg=/\s+at.*[(\s](.*)\)?/,Ag=/^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/,Ig=void 0===Rg.homedir?"":Rg.homedir().replace(/\\/g,"/");function Dg(e,{pretty:t=!1,basePath:r}={}){const n=r&&new RegExp(`(at | \\()${function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(r.replace(/\\/g,"/"))}`,"g");if("string"==typeof e)return e.replace(/\\/g,"/").split("\n").filter((e=>{const t=e.match(Mg);if(null===t||!t[1])return!0;const r=t[1];return!(r.includes(".app/Contents/Resources/electron.asar")||r.includes(".app/Contents/Resources/default_app.asar")||r.includes("node_modules/electron/dist/resources/electron.asar")||r.includes("node_modules/electron/dist/resources/default_app.asar")||Ag.test(r))})).filter((e=>""!==e.trim())).map((e=>(n&&(e=e.replace(n,"$1")),t&&(e=e.replace(Mg,((e,t)=>e.replace(t,t.replace(Ig,"~"))))),e))).join("\n")}function Lg(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ng="https://github.com/decaporg/decap-cms/issues/new?";function $g({title:e,config:t}){try{const r=function({config:e}){let t="";"string"==typeof DECAP_CMS_VERSION?t=`decap-cms@${DECAP_CMS_VERSION}`:"string"==typeof DECAP_CMS_APP_VERSION&&(t=`decap-cms-app@${DECAP_CMS_APP_VERSION}`);const r=function({version:e,provider:t,browser:r,config:n}){return`\n**Describe the bug**\n\n**To Reproduce**\n\n**Expected behavior**\n\n**Screenshots**\n\n**Applicable Versions:**\n - Decap CMS version: \`${e}\`\n - Git provider: \`${t}\`\n - Browser version: \`${r}\`\n\n**CMS configuration**\n\`\`\`\n${n}\n\`\`\`\n\n**Additional context**\n`}({version:t,provider:e.backend.name,browser:navigator.userAgent,config:mr().stringify(e)});return r}({config:t}),n=new URLSearchParams;return n.append("title",Pg()(e,{length:100})),n.append("body",Pg()(r,{length:4e3,omission:"\n..."})),n.append("labels","type: bug"),`${Ng}${n.toString()}`}catch(e){return console.log(e),`${Ng}template=bug_report.md`}}const Fg=Cg("div",{target:"emw4gx72",label:"ErrorBoundaryContainer"})("padding:40px;h1{font-size:28px;color:",qe.colors.text,";}h2{font-size:20px;}strong{color:",qe.colors.textLead,";font-weight:500;}hr{width:200px;margin:30px 0;border:0;height:1px;background-color:",qe.colors.text,";}a{color:",qe.colors.active,";}"),Bg=Cg("span",{target:"emw4gx71",label:"PrivacyWarning"})("color:",qe.colors.text,";"),Ug=Cg("button",{target:"emw4gx70",label:"CopyButton"})(qe.buttons.button,";",qe.buttons.default,";",qe.buttons.gray,";display:block;margin:12px 0;");function zg({entry:e,t}){return console.log(e),(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)("hr",null),(0,xo.jsx)("h2",null,t("ui.errorBoundary.recoveredEntry.heading")),(0,xo.jsx)("strong",null,t("ui.errorBoundary.recoveredEntry.warning")),(0,xo.jsx)(Ug,{onClick:()=>jg(e)},t("ui.errorBoundary.recoveredEntry.copyButtonLabel")),(0,xo.jsx)("pre",null,(0,xo.jsx)("code",null,e)))}class qg extends r().Component{constructor(...e){super(...e),Lg(this,"state",{hasError:!1,errorMessage:"",errorTitle:"",backup:""})}static getDerivedStateFromError(e){return console.error(e),{hasError:!0,errorMessage:Dg(e.stack,{basePath:window.location.origin||""}),errorTitle:e.toString()}}shouldComponentUpdate(e,t){return!this.props.showBackup||this.state.errorMessage!==t.errorMessage||this.state.backup!==t.backup}async componentDidUpdate(){if(this.props.showBackup){const e=await pr.localForage.getItem("backup");e&&console.log(e),this.setState({backup:e})}}render(){const{hasError:e,errorMessage:t,backup:n,errorTitle:o}=this.state,{showBackup:i,t:a}=this.props;return e?(0,xo.jsx)(Fg,null,(0,xo.jsx)("h1",null,a("ui.errorBoundary.title")),(0,xo.jsx)("p",null,(0,xo.jsx)("span",null,a("ui.errorBoundary.details")),(0,xo.jsx)("a",{href:$g({title:o,config:this.props.config}),target:"_blank",rel:"noopener noreferrer","data-testid":"issue-url"},a("ui.errorBoundary.reportIt"))),(0,xo.jsx)("p",null,a("ui.errorBoundary.privacyWarning").split("\n").map(((e,t)=>(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(Bg,{key:t},e),(0,xo.jsx)("br",null))))),(0,xo.jsx)("hr",null),(0,xo.jsx)("h2",null,a("ui.errorBoundary.detailsHeading")),(0,xo.jsx)("p",null,t),n&&i&&(0,xo.jsx)(zg,{entry:n,t:a})):this.props.children}}Lg(qg,"propTypes",{children:i().node,t:i().func.isRequired,config:i().object.isRequired});const Wg=(0,We.Iu)()(qg);function Hg({label:e,imagesOnly:t,onChange:r,disabled:n,className:o}){return(0,xo.jsx)("label",{tabIndex:"0",className:`nc-fileUploadButton ${o||""}`},(0,xo.jsx)("span",null,e),(0,xo.jsx)("input",{type:"file",accept:t?"image/*":"*/*",onChange:r,disabled:n}))}Hg.propTypes={className:i().string,label:i().string.isRequired,imagesOnly:i().bool,onChange:i().func.isRequired,disabled:i().bool};var Vg=__webpack_require__(37149),Gg=__webpack_require__.n(Vg),Kg={name:"1o9c9d2-ReactModalGlobalStyles",styles:".ReactModal__Body--open{overflow:hidden;};label:ReactModalGlobalStyles;"};function Yg(){return(0,xo.jsx)(xo.Global,{styles:Kg})}const Jg=`\n ${qe.shadows.dropDeep};\n background-color: #fff;\n border-radius: ${qe.lengths.borderRadius};\n height: 80%;\n text-align: center;\n max-width: 2200px;\n padding: 20px;\n\n &:focus {\n outline: none;\n }\n `,Qg=`\n z-index: ${qe.zIndex.zIndex99999};\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n opacity: 0;\n background-color: rgba(0, 0, 0, 0);\n transition: background-color ${qe.transitions.main}, opacity ${qe.transitions.main};\n `;class Xg extends r().Component{componentDidMount(){Gg().setAppElement("#nc-root")}render(){const{isOpen:e,children:t,className:n,onClose:o}=this.props;return(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(Yg,null),(0,xo.jsx)(xo.ClassNames,null,(({css:r,cx:i})=>(0,xo.jsx)(Gg(),{isOpen:e,onRequestClose:o,closeTimeoutMS:300,className:{base:i(r`
17
+ `),i;throw e}return`${i}/${Yn()(h," /")}`}function yi(e,t,r,n,o,i){if(!t||!t.get("data"))return e;let a=t.get("data").set(o,n);a=ui(t.get("path"),a,r.get("folder"));const s=si(t,Cc(r,"date"))||null,l=a.getIn(ci(kc(r))),c=gi(i,[n,a.get("dirname")]);return ai(e,s,l,a,c)}var vi=__webpack_require__(18149),bi=__webpack_require__.n(vi),wi=__webpack_require__(4335),_i=__webpack_require__.n(wi);function Si(e,t="",r="",n={}){return{collection:e,slug:t,path:r,partial:n.partial||!1,raw:n.raw||"",data:n.data||{},label:n.label||null,isModification:_i()(n.isModification)?n.isModification:null,mediaFiles:n.mediaFiles||[],author:n.author||"",updatedOn:n.updatedOn||"",status:n.status||"",meta:n.meta||{},i18n:n.i18n||{}}}function xi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Oi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xi(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const{fetchWithTimeout:Ei}=pr.unsentRequest;class ki{constructor(e){if(this.config=e,null==e.get("applicationID")||null==e.get("apiKey"))throw"The Algolia search integration needs the credentials (applicationID and apiKey) in the integration configuration.";this.applicationID=e.get("applicationID"),this.apiKey=e.get("apiKey");const t=e.get("indexPrefix");this.indexPrefix=t?`${t}-`:"",this.searchURL=`https://${this.applicationID}-dsn.algolia.net/1`,this.entriesCache={collection:null,page:null,entries:[]}}requestHeaders(e={}){return Oi({"X-Algolia-API-Key":this.apiKey,"X-Algolia-Application-Id":this.applicationID,"Content-Type":"application/json"},e)}parseJsonResponse(e){return e.json().then((t=>e.ok?t:Promise.reject(t)))}urlFor(e,t){const r=[];if(t.params)for(const e in t.params)r.push(`${e}=${encodeURIComponent(t.params[e])}`);return r.length&&(e+=`?${r.join("&")}`),e}request(e,t={}){const r=this.requestHeaders(t.headers||{}),n=this.urlFor(e,t);return Ei(n,Oi(Oi({},t),{},{headers:r})).then((e=>{const t=e.headers.get("Content-Type");return t&&t.match(/json/)?this.parseJsonResponse(e):e.text()}))}search(e,t,r){const n=e.map((e=>({indexName:`${this.indexPrefix}${e}`,params:`query=${t}&page=${r}`})));return this.request(`${this.searchURL}/indexes/*/queries`,{method:"POST",body:JSON.stringify({requests:n})}).then((t=>{const n=t.results.map(((t,r)=>t.hits.map((t=>{const n=t.path.split("/").pop().replace(/\.[^.]+$/,"");return Si(e[r],n,t.path,{data:t.data,partial:!0})}))));return{entries:sr()(n),pagination:r}}))}searchBy(e,t,r){return this.request(`${this.searchURL}/indexes/${this.indexPrefix}${t}`,{params:{restrictSearchableAttributes:e,query:r}})}listEntries(e,t){return this.entriesCache.collection===e&&this.entriesCache.page===t?Promise.resolve({page:this.entriesCache.page,entries:this.entriesCache.entries}):this.request(`${this.searchURL}/indexes/${this.indexPrefix}${e.get("name")}`,{params:{page:t}}).then((t=>{const r=t.hits.map((t=>{const r=_c(e,t.path);return Si(e.get("name"),r,t.path,{data:t.data,partial:!0})}));return this.entriesCache={collection:e,pagination:t.page,entries:r},{entries:r,pagination:t.page}}))}async listAllEntries(e){const t={hitsPerPage:1e3};let r=await this.request(`${this.searchURL}/indexes/${this.indexPrefix}${e.get("name")}`,{params:t}),{nbPages:n=0,hits:o,page:i}=r;for(i+=1;i<n;)r=await this.request(`${this.searchURL}/indexes/${this.indexPrefix}${e.get("name")}`,{params:Oi(Oi({},t),{},{page:i})}),o=[...o,...r.hits],i+=1;const a=o.map((t=>{const r=_c(e,t.path);return Si(e.get("name"),r,t.path,{data:t.data,partial:!0})}));return a}getEntry(e,t){return this.searchBy("slug",e.get("name"),t).then((r=>{const n=r.hits.filter((e=>e.slug===t))[0];return Si(e.get("name"),t,n.path,{data:n.data,partial:!0})}))}}var Ci=__webpack_require__(42208),Ti=__webpack_require__.n(Ci);function Pi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ji(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pi(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const{fetchWithTimeout:Ri}=pr.unsentRequest;class Mi{constructor(e,t){if(this.config=e,null==e.get("getSignedFormURL"))throw"The AssetStore integration needs the getSignedFormURL in the integration configuration.";this.getToken=t,this.shouldConfirmUpload=e.get("shouldConfirmUpload",!1),this.getSignedFormURL=Ao()(e.get("getSignedFormURL"),"/")}parseJsonResponse(e){return e.json().then((t=>e.ok?t:Promise.reject(t)))}urlFor(e,t){const r=[];if(t.params)for(const e in t.params)r.push(`${e}=${encodeURIComponent(t.params[e])}`);return r.length&&(e+=`?${r.join("&")}`),e}requestHeaders(e={}){return ji({},e)}confirmRequest(e){this.getToken().then((t=>this.request(`${this.getSignedFormURL}/${e}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({state:"uploaded"})})))}async request(e,t={}){const r=this.requestHeaders(t.headers||{}),n=this.urlFor(e,t),o=await Ri(n,ji(ji({},t),{},{headers:r})),i=o.headers.get("Content-Type");return i&&i.match(/json/)?await this.parseJsonResponse(o):o.text()}async retrieve(e,t,r){const n=Ti()({search:e,page:t,filter:r?"private":"public"},(e=>!!e)),o=Yo(this.getSignedFormURL,n),i={"Content-Type":"application/json",Authorization:`Bearer ${await this.getToken()}`},a=(await this.request(o,{headers:i})).map((({id:e,name:t,size:r,url:n})=>({id:e,name:t,size:r,displayURL:n,url:n,path:n})));return a}delete(e){const t=`${this.getSignedFormURL}/${e}`;return this.getToken().then((e=>this.request(t,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}})))}async upload(e,t=!1){const r={name:e.name,size:e.size};e.type&&(r.content_type=e.type),t&&(r.visibility="private");try{const t=await this.getToken(),n=await this.request(this.getSignedFormURL,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(r)}),o=n.form.url,i=n.form.fields,{id:a,name:s,size:l,url:c}=n.asset,u=new FormData;return Object.keys(i).forEach((e=>u.append(e,i[e]))),u.append("file",e,e.name),await this.request(o,{method:"POST",body:u}),this.shouldConfirmUpload&&await this.confirmRequest(a),{success:!0,asset:{id:a,name:s,size:l,displayURL:c,url:c,path:c}}}catch(e){throw console.error(e),e}}}const Ai=function(){let e=null;return(t,r,n)=>(e||(e=function(e,t){let r=(0,Qe.Map)({});return e.get("providers").forEach(((e,n)=>{switch(n){case"algolia":r=r.set("algolia",new ki(e));break;case"assetStore":r=r.set("assetStore",new Mi(e,t))}})),r}(t,r)),e.get(n))}(),Ii="SEARCH_ENTRIES_REQUEST",Di="SEARCH_ENTRIES_SUCCESS",Li="SEARCH_ENTRIES_FAILURE",Ni="QUERY_REQUEST",$i="QUERY_SUCCESS",Fi="QUERY_FAILURE",Bi="SEARCH_CLEAR",Ui="CLEAR_REQUESTS";function zi(){return{type:Bi}}function qi(e,t,r,n,o,i){return async(a,s)=>{const l=s(),c=rf(l.config),u=Gf(l,t,"search"),f=l.collections.find((e=>e.get("name")===t));a({type:Ui});const p=`${t}-${r.join()}-${n}-${o}-${i}`,d=l.search.requests.find((({id:e})=>e==p)),h=d?d.queryResponse:u?Ai(l.integrations,c.getToken,u).searchBy(r.map((e=>`data.${e}`)),t,n):c.query(f,r,n,o,i);a(function(e,t){return{type:Ni,payload:{searchTerm:e,request:t}}}(n,d?void 0:{id:p,expires:new Date((new Date).getTime()+1e4),queryResponse:h}));try{const t=await h;return a(function(e,t){return{type:$i,payload:{namespace:e,hits:t}}}(e,t.hits))}catch(e){return a(function(e){return{type:Fi,payload:{error:e}}}(e))}}}function Wi(e,t){return new pr.Cursor(e.getIn(["cursorsByType","collectionEntries",t]))}var Hi=__webpack_require__(1842),Vi=__webpack_require__.n(Hi);function Gi(e,t,r){let n=t.reduce(((t,n)=>{const o=n.get("name"),i=e.get(o),a=Rn(n.get("widget")),s=n.get("fields");return s&&Qe.List.isList(i)?t.set(o,i.map((e=>Gi(e,s,r)))):s&&Qe.Map.isMap(i)?t.set(o,Gi(i,s,r)):a&&!Vi()(i)?t.set(o,a[r](i)):Vi()(i)?t:t.set(o,i)}),(0,Qe.Map)());return n=e.mergeDeep(n),n}const Ki={PRESENCE:"PRESENCE",PATTERN:"PATTERN",RANGE:"RANGE",CUSTOM:"CUSTOM"};function Yi({predicate:e,run:t}){return{type:Je,predicate:e,run:t}}async function Ji(e,t,r=3e4){let n=!1;const o=new Promise((r=>{e(Yi(t(r)))})),i=new Promise((e=>{setTimeout((()=>{n?e():(console.warn("Wait Action timed out"),e(null))}),r)}));return await Promise.race([o.then((e=>(n=!0,e))).catch(null),i])}const Qi="NOTIFICATION_SEND",Xi="NOTIFICATION_DISMISS",Zi="NOTIFICATION_CLEAR";function ea(e){return{type:Qi,payload:e}}function ta(e){return{type:Xi,id:e}}function ra(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function na(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ra(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ra(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const oa="MEDIA_LIBRARY_OPEN",ia="MEDIA_LIBRARY_CLOSE",aa="MEDIA_LIBRARY_CREATE",sa="MEDIA_INSERT",la="MEDIA_REMOVE_INSERTED",ca="MEDIA_LOAD_REQUEST",ua="MEDIA_LOAD_SUCCESS",fa="MEDIA_LOAD_FAILURE",pa="MEDIA_PERSIST_REQUEST",da="MEDIA_PERSIST_SUCCESS",ha="MEDIA_PERSIST_FAILURE",ga="MEDIA_DELETE_REQUEST",ma="MEDIA_DELETE_SUCCESS",ya="MEDIA_DELETE_FAILURE",va="MEDIA_DISPLAY_URL_REQUEST",ba="MEDIA_DISPLAY_URL_SUCCESS",wa="MEDIA_DISPLAY_URL_FAILURE";function _a(e){return(t,r)=>{const n=r().mediaLibrary.get("externalLibrary");n&&n.onClearControl({id:e})}}function Sa(e){return(t,r)=>{const n=r().mediaLibrary.get("externalLibrary");n&&n.onRemoveControl({id:e})}}function xa(e={}){return(t,r)=>{const n=r().mediaLibrary.get("externalLibrary");if(n){const{controlID:t,value:r,config:o=(0,Qe.Map)(),allowMultiple:i,forImage:a}=e;n.show({id:t,value:r,config:o.toJS(),allowMultiple:i,imagesOnly:a})}t(function(e){return{type:oa,payload:e}}(e))}}function Oa(e,t){return(r,n)=>{const o=n(),i=o.config,a=o.entryDraft.get("entry"),s=o.entryDraft.getIn(["entry","collection"]),l=o.collections.get(s);r(function(e){return{type:sa,payload:{mediaPath:e}}}(e=Array.isArray(e)?e.map((e=>lc(i,l,e,a,t))):lc(i,l,e,a,t)))}}function Ea(e){return{type:la,payload:{controlID:e}}}function ka(e={}){const{delay:t=0,query:r="",page:n=1,privateUpload:o}=e;return async(e,i)=>{const a=i(),s=rf(a.config),l=Gf(a,null,"assetStore");if(l){const t=Ai(a.integrations,s.getToken,l);e(Ra(n));try{const i=await t.retrieve(r,n,o);return e(Ma(i,{page:n,canPaginate:!0,dynamicSearch:!0,dynamicSearchQuery:r,privateUpload:o}))}catch(t){return e(Aa({privateUpload:o}))}}function c(){return s.getMedia().then((t=>e(Ma(t)))).catch((t=>{console.error(t),404===t.status?(console.log("This 404 was expected and handled appropriately."),e(Ma([]))):e(Aa())}))}return e(Ra(n)),t>0?new Promise((e=>{setTimeout((()=>e(c())),t)})):c()}}function Ca({id:e,file:t,assetProxy:r,draft:n}){return{id:e,name:(0,pr.basename)(r.path),displayURL:r.url,draft:n,file:t,size:t.size,url:r.url,path:r.path,field:r.field}}function Ta(e,t={}){const{privateUpload:r,field:n}=t;return async(t,o)=>{const i=o(),a=rf(i.config),s=Gf(i,null,"assetStore"),l=qa(i,n),c=ni(e.name.toLowerCase(),i.config.slug),u=l.find((e=>e.name.toLowerCase()===c)),f=cc(i.entryDraft);if(!s&&u){if(!window.confirm(`${u.name} already exists. Do you want to replace it?`))return;await t(Pa(u,{privateUpload:r}))}!s&&f||t({type:pa});try{let o,l;if(s)try{const t=Ai(i.integrations,a.getToken,s),n=await t.upload(e,r);o=Tr({url:n.asset.url,path:n.asset.url})}catch(t){o=Tr({file:e,path:c})}else{if(r)throw new Error("The Private Upload option is only available for Asset Store Integration");{const t=i.entryDraft.get("entry"),r=i.collections.get(null==t?void 0:t.get("collection")),a=sc(i.config,r,t,c,n);o=Tr({file:e,path:a,field:n})}}if(t(Xa(o)),s)l=Ca({id:await(0,pr.getBlobSHA)(e),file:e,assetProxy:o,draft:!1});else{if(f)return l=Ca({id:await(0,pr.getBlobSHA)(e),file:e,assetProxy:o,draft:f}),t(function(e){return{type:ul,payload:e}}(l));l=await a.persistMedia(i.config,o)}return t(function(e,t={}){const{privateUpload:r}=t;return{type:da,payload:{file:e,privateUpload:r}}}(l,{privateUpload:r}))}catch(e){return console.error(e),t(ea({message:`Failed to persist media: ${e}`,type:"error",dismissAfter:8e3})),t(function(e={}){const{privateUpload:t}=e;return{type:ha,payload:{privateUpload:t}}}({privateUpload:r}))}}}function Pa(e,t={}){const{privateUpload:r}=t;return async(t,n)=>{const o=n(),i=rf(o.config),a=Gf(o,null,"assetStore");if(a){const n=Ai(o.integrations,i.getToken,a);t(Ia());try{return await n.delete(e.id),t(Da(e,{privateUpload:r}))}catch(e){return console.error(e),t(ea({message:`Failed to delete media: ${e.message}`,type:"error",dismissAfter:8e3})),t(La({privateUpload:r}))}}try{if(e.draft)t(Za(e.path)),t(_l({id:e.id}));else{const r=cc(o.entryDraft);t(Ia()),t(Za(e.path)),await i.deleteMedia(o.config,e.path),t(Da(e)),r&&t(_l({id:e.id}))}}catch(e){return console.error(e),t(ea({message:`Failed to delete media: ${e.message}`,type:"error",dismissAfter:8e3})),t(La())}}}function ja(e){return async(t,r)=>{const{displayURL:n,id:o}=e,i=r(),a=Wa(i,o);if(!o||!n||a.get("url")||a.get("isFetching")||a.get("err"))return Promise.resolve();if("string"==typeof n)return t(Na(o)),void t($a(o,n));try{const e=rf(i.config);t(Na(o));const r=await e.getMediaDisplayURL(n);if(!r)throw new Error("No display URL was returned!");t($a(o,r))}catch(e){console.error(e),t(function(e,t){return{type:wa,payload:{key:e,err:t}}}(o,e))}}}function Ra(e){return{type:ca,payload:{page:e}}}function Ma(e,t={}){return{type:ua,payload:na({files:e},t)}}function Aa(e={}){const{privateUpload:t}=e;return{type:fa,payload:{privateUpload:t}}}function Ia(){return{type:ga}}function Da(e,t={}){const{privateUpload:r}=t;return{type:ma,payload:{file:e,privateUpload:r}}}function La(e={}){const{privateUpload:t}=e;return{type:ya,payload:{privateUpload:t}}}function Na(e){return{type:va,payload:{key:e}}}function $a(e,t){return{type:ba,payload:{key:e,url:t}}}async function Fa(e,t){!1===t.mediaLibrary.get("isLoading")||t.mediaLibrary.get("externalLibrary")||await Ji(e,(e=>({predicate:({type:e})=>e===ua||e===fa,run:()=>e()})))}function Ba(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ua(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ba(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ba(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const za={isVisible:!1,showMediaButton:!0,controlMedia:(0,Qe.Map)(),displayURLs:(0,Qe.Map)(),config:(0,Qe.Map)()};function qa(e,t){const{mediaLibrary:r,entryDraft:n}=e,o=cc(e.entryDraft),i=Gf(e,null,"assetStore");let a;if(o&&!i){const r=n.getIn(["entry","mediaFiles"],(0,Qe.List)()).toJS(),o=n.get("entry"),i=e.collections.get(null==o?void 0:o.get("collection")),s=ac(e.config,i,o,t);a=r.filter((e=>(0,dr.dirname)(e.path)===s)).map((e=>Ua({key:e.id},e)))}else a=r.get("files")||[];return a}function Wa(e,t){return e.mediaLibrary.getIn(["displayURLs",t],(0,Qe.Map)())}const Ha="ADD_ASSETS",Va="ADD_ASSET",Ga="REMOVE_ASSET",Ka="LOAD_ASSET_REQUEST",Ya="LOAD_ASSET_SUCCESS",Ja="LOAD_ASSET_FAILURE";function Qa(e){return{type:Ha,payload:e}}function Xa(e){return{type:Va,payload:e}}function Za(e){return{type:Ga,payload:e}}const es=Tr({path:"empty.svg",file:new File(['<svg xmlns="http://www.w3.org/2000/svg"></svg>'],"empty.svg",{type:"image/svg+xml"})});function ts(e,t,r){return function(n,o){return e(rs({collection:t,entry:r,path:n,field:o}))}}function rs({collection:e,entry:t,path:r,field:n}){return(o,i)=>{if(!r)return es;const a=i(),s=sc(a.config,e,t,r,n);let{asset:l,isLoading:c,error:u}=a.medias[s]||{};return c?es:l||((0,pr.isAbsolutePath)(s)||u?(l=Tr({path:s,url:r}),o(Xa(l))):(o(function(e){return async(t,r)=>{try{t({type:Ka,payload:{path:e}}),await Fa(t,r());const i=(n=r(),o=e,qa(n).find((e=>e.path===o)));if(i){const n=await async function(e,t,r){const n=Wa(t,r.id);let o;if(n.get("url"))o=n.get("url");else if(n.get("err"))o=null;else{var i;const t=r.id,a=Ji(e,(e=>({predicate:({type:e,payload:r})=>(e===ba||e===wa)&&r.key===t,run:(t,r,n)=>e(n.payload.url)})));n.get("isFetching")||e(ja(r)),o=null!==(i=await a)&&void 0!==i?i:null}return o}(t,r(),i);t(Xa(Tr({path:e,url:n||e})))}else{const{url:n}=await async function(e,t){const r=rf(e.config),{url:n}=await r.getMediaFile(t);return{url:n}}(r(),e);t(Xa(Tr({path:e,url:n})))}t(function(e){return{type:Ya,payload:{path:e}}}(e))}catch(r){t(function(e,t){return{type:Ja,payload:{path:e,error:t}}}(e,r))}var n,o}}(s)),l=es),l)}}const ns=function(e){void 0===e&&(e={}),ge||se(!1);var t=window.history,r=(window.navigator.userAgent.indexOf("Firefox"),e),n=r.getUserConfirmation,o=void 0===n?me:n,i=r.hashType,a=void 0===i?"slash":i,s=e.basename?fe(le(e.basename)):"",l=ve[a],c=l.encodePath,u=l.decodePath;function f(){var e=u(we());return s&&(e=ue(e,s)),de(e)}var p=he();function h(e){d(k,e),k.length=t.length,p.notifyListeners(k.location,k.action)}var g=!1,m=null;function y(){var e=we(),t=c(e);if(e!==t)_e(t);else{var r=f(),n=k.location;if(!g&&function(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash}(n,r))return;if(m===pe(r))return;m=null,function(e){if(g)g=!1,h();else{p.confirmTransitionTo(e,"POP",o,(function(t){t?h({action:"POP",location:e}):function(e){var t=k.location,r=_.lastIndexOf(pe(t));-1===r&&(r=0);var n=_.lastIndexOf(pe(e));-1===n&&(n=0);var o=r-n;o&&(g=!0,S(o))}(e)}))}}(r)}}var v=we(),b=c(v);v!==b&&_e(b);var w=f(),_=[pe(w)];function S(e){t.go(e)}var x=0;function O(e){1===(x+=e)&&1===e?window.addEventListener(ye,y):0===x&&window.removeEventListener(ye,y)}var E=!1,k={length:t.length,action:"POP",location:w,createHref:function(e){var t=document.querySelector("base"),r="";return t&&t.getAttribute("href")&&(r=be(window.location.href)),r+"#"+c(s+pe(e))},push:function(e,t){var r="PUSH",n=de(e,void 0,void 0,k.location);p.confirmTransitionTo(n,r,o,(function(e){if(e){var t=pe(n),o=c(s+t);if(we()!==o){m=t,function(e){window.location.hash=e}(o);var i=_.lastIndexOf(pe(k.location)),a=_.slice(0,i+1);a.push(t),_=a,h({action:r,location:n})}else h()}}))},replace:function(e,t){var r="REPLACE",n=de(e,void 0,void 0,k.location);p.confirmTransitionTo(n,r,o,(function(e){if(e){var t=pe(n),o=c(s+t);we()!==o&&(m=t,_e(o));var i=_.indexOf(pe(k.location));-1!==i&&(_[i]=t),h({action:r,location:n})}}))},go:S,goBack:function(){S(-1)},goForward:function(){S(1)},block:function(e){void 0===e&&(e=!1);var t=p.setPrompt(e);return E||(O(1),E=!0),function(){return E&&(E=!1,O(-1)),t()}},listen:function(e){var t=p.appendListener(e);return O(1),function(){O(-1),t()}}};return k}();function os(e){return ns.push(`/collections/${e}`)}function is(e){return ns.replace(`/collections/${e}/new`)}function as(e,t){return ns.replace(`/collections/${e}/entries/${t}`)}const ss="UNPUBLISHED_ENTRY_REQUEST",ls="UNPUBLISHED_ENTRY_SUCCESS",cs="UNPUBLISHED_ENTRY_REDIRECT",us="UNPUBLISHED_ENTRIES_REQUEST",fs="UNPUBLISHED_ENTRIES_SUCCESS",ps="UNPUBLISHED_ENTRIES_FAILURE",ds="UNPUBLISHED_ENTRY_PERSIST_REQUEST",hs="UNPUBLISHED_ENTRY_PERSIST_SUCCESS",gs="UNPUBLISHED_ENTRY_PERSIST_FAILURE",ms="UNPUBLISHED_ENTRY_STATUS_CHANGE_REQUEST",ys="UNPUBLISHED_ENTRY_STATUS_CHANGE_SUCCESS",vs="UNPUBLISHED_ENTRY_STATUS_CHANGE_FAILURE",bs="UNPUBLISHED_ENTRY_PUBLISH_REQUEST",ws="UNPUBLISHED_ENTRY_PUBLISH_SUCCESS",_s="UNPUBLISHED_ENTRY_PUBLISH_FAILURE",Ss="UNPUBLISHED_ENTRY_DELETE_SUCCESS";function xs(e,t){return{type:fs,payload:{entries:e,pages:t}}}function Os(e,t){return{type:ds,payload:{collection:e.get("name"),slug:t}}}function Es(e,t){return{type:hs,payload:{collection:e.get("name"),entry:t}}}function ks(e,t,r){return{type:gs,payload:{error:e,collection:t.get("name"),slug:r},error:e}}function Cs(e,t){return async(r,n)=>{const o=n(),i=rf(o.config);if(!Qt()(o.editorialWorkflow.toJS(),"pages.ids",!1))try{const{entries:e,pagination:t}=await i.unpublishedEntries(o.collections);r(xs(e,t))}catch(e){}r(function(e,t){return{type:ss,payload:{collection:e.get("name"),slug:t}}}(e,t));try{const n=await i.unpublishedEntry(o,e,t),a=await Promise.all(n.mediaFiles.filter((e=>e.draft)).map((({url:e,file:t,path:r})=>Tr({path:r,url:e,file:t}))));r(Qa(a)),r(function(e,t){return{type:ls,payload:{collection:e.get("name"),entry:t}}}(e,n)),r(bl(n))}catch(n){n.name===pr.EDITORIAL_WORKFLOW_ERROR&&n.notUnderEditorialWorkflow?(r(function(e,t){return{type:cs,payload:{collection:e.get("name"),slug:t}}}(e,t)),r(Sl(e,t))):r(ea({message:{key:"ui.toast.onFailToLoadEntries",details:n},type:"error",dismissAfter:8e3}))}}}function Ts(e){return(t,r)=>{const n=r(),o=rf(n.config),i=Qt()(n.editorialWorkflow.toJS(),"pages.ids",!1);n.config.publish_mode!==Zn||i||(t({type:us}),o.unpublishedEntries(e).then((e=>t(xs(e.entries,e.pagination)))).catch((e=>{t(ea({message:{key:"ui.toast.onFailToLoadEntries",details:e},type:"error",dismissAfter:8e3})),t(function(e){return{type:ps,error:"Failed to load entries",payload:e}}(e)),Promise.reject(e)})))}}function Ps(e,t,r,n){return(o,i)=>{if(r===n)return;const a=i(),s=rf(a.config);o(function(e,t){return{type:ms,payload:{collection:e,slug:t}}}(e,t)),s.updateUnpublishedEntryStatus(e,t,n).then((()=>{o(ea({message:{key:"ui.toast.entryUpdated"},type:"success",dismissAfter:4e3})),o(function(e,t,r){return{type:ys,payload:{collection:e,slug:t,newStatus:r}}}(e,t,n))})).catch((r=>{o(ea({message:{key:"ui.toast.onFailToUpdateStatus",details:r},type:"error",dismissAfter:8e3})),o(function(e,t){return{type:vs,payload:{collection:e,slug:t}}}(e,t))}))}}function js(e,t){return(r,n)=>{const o=n(),i=rf(o.config);return r(function(e,t){return{type:"UNPUBLISHED_ENTRY_DELETE_REQUEST",payload:{collection:e,slug:t}}}(e,t)),i.deleteUnpublishedEntry(e,t).then((()=>{r(ea({message:{key:"ui.toast.onDeleteUnpublishedChanges"},type:"success",dismissAfter:4e3})),r(function(e,t){return{type:Ss,payload:{collection:e,slug:t}}}(e,t))})).catch((n=>{r(ea({message:{key:"ui.toast.onDeleteUnpublishedChanges",details:n},type:"error",dismissAfter:8e3})),r(function(e,t){return{type:"UNPUBLISHED_ENTRY_DELETE_FAILURE",payload:{collection:e,slug:t}}}(e,t))}))}}function Rs(e,t){return async(r,n)=>{const o=n(),i=o.collections,a=rf(o.config),s=Vf(o,e,t);r(function(e,t){return{type:bs,payload:{collection:e,slug:t}}}(e,t));try{await a.publishUnpublishedEntry(s),r(ka()),r(ea({message:{key:"ui.toast.entryPublished"},type:"success",dismissAfter:4e3})),r(function(e,t){return{type:ws,payload:{collection:e,slug:t}}}(e,t));const n=i.get(e);if(!n.has("nested"))return r(Sl(n,t));{r(kl(n));const e=Qu(n,s.get("path"));Sl(n,e),t!==e&&cc(o.entryDraft)&&as(n.get("name"),e)}}catch(n){r(ea({message:{key:"ui.toast.onFailToPublishEntry",details:n},type:"error",dismissAfter:8e3})),r(function(e,t){return{type:_s,payload:{collection:e,slug:t}}}(e,t))}}}const Ms=(0,Qe.Map)({entry:(0,Qe.Map)(),fieldsMetaData:(0,Qe.Map)(),fieldsErrors:(0,Qe.Map)(),hasChanged:!1,key:""});function As(e,t){if(!jc(e))return;const r=t.getIn(["entry","meta"]),n=r&&r.get("path"),o=Qt()(e.toJS(),["meta","path","index_file"]),i=vc(e);return n&&(0,dr.join)(e.get("folder"),n,`${o}.${i}`)}function Is(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ds(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Is(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Is(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Ls="ENTRY_REQUEST",Ns="ENTRY_SUCCESS",$s="ENTRY_FAILURE",Fs="ENTRIES_REQUEST",Bs="ENTRIES_SUCCESS",Us="ENTRIES_FAILURE",zs="SORT_ENTRIES_REQUEST",qs="SORT_ENTRIES_SUCCESS",Ws="SORT_ENTRIES_FAILURE",Hs="FILTER_ENTRIES_REQUEST",Vs="FILTER_ENTRIES_SUCCESS",Gs="FILTER_ENTRIES_FAILURE",Ks="GROUP_ENTRIES_REQUEST",Ys="GROUP_ENTRIES_SUCCESS",Js="GROUP_ENTRIES_FAILURE",Qs="DRAFT_CREATE_FROM_ENTRY",Xs="DRAFT_CREATE_EMPTY",Zs="DRAFT_DISCARD",el="DRAFT_CHANGE_FIELD",tl="DRAFT_VALIDATION_ERRORS",rl="DRAFT_CLEAR_ERRORS",nl="DRAFT_LOCAL_BACKUP_RETRIEVED",ol="DRAFT_CREATE_FROM_LOCAL_BACKUP",il="DRAFT_CREATE_DUPLICATE_FROM_ENTRY",al="ENTRY_PERSIST_REQUEST",sl="ENTRY_PERSIST_SUCCESS",ll="ENTRY_PERSIST_FAILURE",cl="ENTRY_DELETE_SUCCESS",ul="ADD_DRAFT_ENTRY_MEDIA_FILE",fl="REMOVE_DRAFT_ENTRY_MEDIA_FILE",pl="CHANGE_VIEW_STYLE";function dl(e){return{type:Fs,payload:{collection:e.get("name")}}}function hl(e,t,r,n,o=!0){return{type:Bs,payload:{collection:e.get("name"),entries:t,page:r,cursor:pr.Cursor.create(n),append:o}}}function gl(e,t){return{type:Us,error:"Failed to load entries",payload:t.toString(),meta:{collection:e.get("name")}}}async function ml(e,t){const r=rf(e.config),n=Gf(e,t.get("name"),"listEntries"),o=n?Ai(e.integrations,r.getToken,n):r;return await o.listAllEntries(t)}function yl(e,t,r=Ro.Ascending){return async(n,o)=>{const i=o(),a=ec(i.entries,e.get("name"));if(n({type:zs,payload:{collection:e.get("name"),key:t,direction:r}}),!a)try{const o=await ml(i,e);n({type:qs,payload:{collection:e.get("name"),key:t,direction:r,entries:o}})}catch(o){n({type:Ws,payload:{collection:e.get("name"),key:t,direction:r,error:o}})}}}function vl(e,t){return{type:cl,payload:{collectionName:e.get("name"),entrySlug:t}}}function bl(e){return{type:Qs,payload:{entry:e}}}function wl(){return{type:rl}}function _l({id:e}){return{type:fl,payload:{id:e}}}function Sl(e,t){return async(r,n)=>{await Fa(r,n()),r(function(e,t){return{type:Ls,payload:{collection:e.get("name"),slug:t}}}(e,t));try{const o=await xl(n(),e,t);r(function(e,t){return{type:Ns,payload:{collection:e.get("name"),entry:t}}}(e,o)),r(bl(o))}catch(n){r(ea({message:{details:n.message,key:"ui.toast.onFailToLoadEntries"},type:"error",dismissAfter:8e3})),r(function(e,t,r){return{type:$s,payload:{error:e,collection:t.get("name"),slug:r}}}(n,e,t))}}}async function xl(e,t,r){const n=rf(e.config);return await n.getEntry(e,t,r)}const Ol=(0,Qe.fromJS)({append_next:{action:"next",append:!0}});function El(e){return pr.Cursor.create(e).updateStore("actions",(e=>e.union(Ol.filter((t=>e.has(t.get("action")))).keySeq())))}function kl(e,t=0){return async(r,n)=>{if(e.get("isFetching"))return;const o=n(),i=Yl(o.entries,e.get("name"));if(i&&i.length>0){const t=i[0];return r(yl(e,t.get("key"),t.get("direction")))}const a=rf(o.config),s=Gf(o,e.get("name"),"listEntries"),l=s?Ai(o.integrations,a.getToken,s):a,c=!!(t&&!isNaN(t)&&t>0);r(dl(e));try{const n=e.has("nested")||Lc(e);let o=await(n?l.listAllEntries(e).then((e=>({entries:e}))):l.listEntries(e,t));o=Ds(Ds({},o),{},{cursor:s?pr.Cursor.create({actions:["next"],meta:{usingOldPaginationAPI:!0},data:{nextPage:t+1}}):pr.Cursor.create(o.cursor)}),r(hl(e,o.cursor.meta.get("usingOldPaginationAPI")?o.entries.reverse():o.entries,o.pagination,El(o.cursor),c))}catch(t){return r(ea({message:{details:t,key:"ui.toast.onFailToLoadEntries"},type:"error",dismissAfter:8e3})),Promise.reject(r(gl(e,t)))}}}function Cl(e,t=(()=>!1)){return e.reduce(((e,r)=>{const n=e,o=r;if(t(o))return n;const i=o.get("field")||o.get("fields"),a="list"==o.get("widget"),s=o.get("name"),l=o.get("default",null);if(Qe.List.isList(i)||Qe.Map.isMap(i)){if(a&&Qe.List.isList(l))n[s]=l;else{const e=Qe.List.isList(i)?i:(0,Qe.List)([i]),r=a?[Cl(e,t)]:Cl(e,t);c=r,[[{}],{}].some((e=>bi()(c,e)))||(n[s]=r)}return n}var c;return null!==l&&(n[s]=l),n}),{})}function Tl({entry:e}){return e.get("mediaFiles").toArray().filter((e=>e.get("draft"))).map((e=>Tr({path:e.get("path"),file:e.get("file"),url:e.get("url"),field:e.get("field")})))}function Pl(e,t){const r=yc(e,t.get("slug"));function n(e){return function(e,t){return Gi(e,t,"serialize")}(e,r)}const o=n(t.get("data"));let i=t.set("data",o);return Lc(e)&&(i=function(e,t,r){const{locales:n,defaultLocale:o}=Nc(e);return n.filter((e=>e!==o)).forEach((e=>{const n=Uc(e);t=t.setIn(n,r(t.getIn(n)))})),t}(e,i,n)),i}function jl(e,t,r){return{error:{type:Ki.CUSTOM,message:r(`editor.editorControlPane.widget.${t}`,{path:e})}}}const Rl="VIEW_STYLE_LIST",Ml="VIEW_STYLE_GRID";function Al(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Il(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Al(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Al(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const{keyToPathArray:Dl}=hr.stringTemplate;let Ll,Nl,$l,Fl,Bl;const Ul="decap-cms.entries.sort",zl="decap-cms.entries.viewStyle",ql=jo()((()=>{const e=localStorage.getItem(Ul);if(e)try{const t=JSON.parse(e);let r=(0,Qe.Map)();return Object.entries(t).forEach((([e,t])=>{let n=(0,Qe.OrderedMap)();Zt()(Object.values(t),["index"]).forEach((e=>{const{key:t,direction:r}=e;n=n.set(t,(0,Qe.fromJS)({key:t,direction:r}))})),r=r.set(e,n)})),r}catch(e){return(0,Qe.Map)()}return(0,Qe.Map)()}));function Wl(e){if(e){const t={};e.keySeq().forEach((r=>{const n=r;e.get(n).valueSeq().toJS().map(((e,t)=>Il(Il({},e),{},{index:t}))).forEach((e=>{Yt()(t,[n,e.key],e)}))})),localStorage.setItem(Ul,JSON.stringify(t))}else localStorage.removeItem(Ul)}const Hl=jo()((()=>localStorage.getItem(zl)||(localStorage.setItem(zl,Rl),Rl)));function Vl(e,t){const r=e.get("sort");return null==r?void 0:r.get(t)}function Gl(e,t){const r=e.get("filter");return(null==r?void 0:r.get(t))||(0,Qe.Map)()}function Kl(e,t){const r=e.get("group");return(null==r?void 0:r.get(t))||(0,Qe.Map)()}function Yl(e,t){const r=Vl(e,t),n=(null==r?void 0:r.valueSeq().filter((e=>(null==e?void 0:e.get("direction"))!==Ro.None)).toArray())||[];return n}function Jl(e,t,r){return e.getIn(["entities",`${t}.${r}`])}function Ql(e,t){return e.getIn(["pages",t,"ids"],(0,Qe.List)())}function Xl(e,t){const r=Ql(e,t),n=r&&r.map((r=>Jl(e,t,r)));return n}function Zl(e,t){const r=t.get("name");let n=Xl(e,r);const o=Yl(e,r);if(o&&o.length>0){const e=o.map((e=>function(e,t){return t===So?"updatedOn":t!==_o||Oc(e,t)?`data.${t}`:"author"}(t,e.get("key")))),r=o.map((e=>e.get("direction")===Ro.Ascending?"asc":"desc"));n=(0,Qe.fromJS)(To()(n.toJS(),e,r))}const i=function(e,t){const r=Gl(e,t),n=(null==r?void 0:r.valueSeq().filter((e=>!0===(null==e?void 0:e.get("active")))).toArray())||[];return n}(e,r);return i&&i.length>0&&(n=n.filter((e=>{const t=i.every((t=>{const r=t.get("pattern"),n=t.get("field"),o=(e.get("data")||(0,Qe.Map)()).getIn(Dl(n));return void 0!==o&&new RegExp(String(r)).test(String(o))}));return t})).toList()),n}function ec(e,t){return e.getIn(["pages",t,"isFetching"],!1)}const tc="DRAFT_MEDIA_FILES";function rc(e,t){const r=e.find((e=>(null==e?void 0:e.get("name"))===t));return r}function nc(e,t,r,n){if(!t)return!1;if(n&&n.has(e))return!0;if(t.has("files")){const n=rc(t.get("files"),r);if(n&&n.has(e))return!0}return!!t.has(e)}function oc(e,t,r,n,o,i,a){const s=i.filter((e=>e===o))[0];if(s)return yi(s.has(e)?s.get(e):`{{${e}}}`,n,r,a,e,t.slug);for(let s of i){s.has(e)||(s=s.set(e,`{{${e}}}`));const i=yi(s.get(e),n,r,a,e,t.slug);let l=null;if(s.has("fields")?l=oc(e,t,r,n,o,s.get("fields").toArray(),i):s.has("field")?l=oc(e,t,r,n,o,[s.get("field")],i):s.has("types")&&(l=oc(e,t,r,n,o,s.get("types").toArray(),i)),null!=l)return l}return null}function ic(e,t,r,n,o){let i=t[e];if(r.has(e)||(r=r.set(e,`{{${e}}}`)),r.has("files")){i=yi(r.get(e),n,r,i,e,t.slug);let a=rc(r.get("files"),null==n?void 0:n.get("slug"));if(a&&(a.has(e)||(a=a.set(e,`{{${e}}}`)),i=yi(a.get(e),n,r,i,e,t.slug),o)){const s=oc(e,t,r,n,o,a.get("fields").toArray(),i);null!==s&&(i=s)}}else if(i=yi(r.get(e),n,r,i,e,t.slug),o){const a=oc(e,t,r,n,o,r.get("fields").toArray(),i);null!==a&&(i=a)}return i}function ac(e,t,r,n){const o="media_folder";let i=e[o];if(nc(o,t,null==r?void 0:r.get("slug"),n)){const a=ic(o,e,t,r,n);if(a.startsWith("/"))i=(0,dr.join)(a);else{const e=null==r?void 0:r.get("path");i=e?(0,dr.join)((0,dr.dirname)(e),a):(0,dr.join)(t.get("folder"),tc)}}return tr()(i,"/")}function sc(e,t,r,n,o){if((0,pr.isAbsolutePath)(n))return n;const i=ac(e,t,r,o);return(0,dr.join)(i,(0,pr.basename)(n))}function lc(e,t,r,n,o){if((0,pr.isAbsolutePath)(r))return r;const i="public_folder";let a=e[i];return nc(i,t,null==n?void 0:n.get("slug"),o)&&(a=ic(i,e,t,n,o)),(0,pr.isAbsolutePath)(a)?function(e,...t){return zo()(e,...t)}(a,(0,pr.basename)(r)):(0,dr.join)(a,(0,pr.basename)(r))}function cc(e){const t=e.get("entry");return t&&!t.isEmpty()}function uc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?uc(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const{keyToPathArray:pc}=hr.stringTemplate,dc=(0,Qe.fromJS)({}),hc={[wo]:{entryExtension(e){const t=e.get("extension")||Qt()(Bn(Bn({},zn),Nn()),e.get("format")||"frontmatter");if(!t)throw new Error(`No extension found for format ${e.get("format")}`);return t.replace(/^\./,"")},fields:e=>e.get("fields"),entryPath(e,t){return`${e.get("folder").replace(/\/$/,"")}/${t}.${this.entryExtension(e)}`},entrySlug(e,t){var r;const n=e.get("folder").replace(/\/$/,"");return null===(r=t.split(n+"/").pop())||void 0===r?void 0:r.replace(new RegExp(`\\.${mo()(this.entryExtension(e))}$`),"")},allowNewEntries:e=>e.get("create"),allowDeletion:e=>e.get("delete",!0),templateName:e=>e.get("name")},[bo]:{fileForEntry(e,t){const r=e.get("files");return r&&r.filter((e=>(null==e?void 0:e.get("name"))===t)).get(0)},fields(e,t){const r=this.fileForEntry(e,t);return r&&r.get("fields")},entryPath(e,t){const r=this.fileForEntry(e,t);return r&&r.get("file")},entrySlug(e,t){const r=e.get("files").filter((e=>(null==e?void 0:e.get("file"))===t)).get(0);return r&&r.get("name")},entryLabel(e,t){const r=this.fileForEntry(e,t);return r&&r.get("label")},allowNewEntries:()=>!1,allowDeletion:e=>e.get("delete",!1),templateName:(e,t)=>t}};function gc(e){const t=e.reduce(((e,t)=>{if(t.has("media_folder")&&(e=[...e,t]),t.has("fields")){var r;const n=null===(r=t.get("fields"))||void 0===r?void 0:r.toArray();e=[...e,...gc(n)]}else if(t.has("field")){const r=t.get("field");e=[...e,...gc([r])]}else if(t.has("types")){var n;const r=null===(n=t.get("types"))||void 0===n?void 0:n.toArray();e=[...e,...gc(r)]}return e}),[]);return t}function mc(e,t){var r;return null===(r=e.get("files"))||void 0===r?void 0:r.toArray().find((e=>e.get("name")===t))}function yc(e,t){return hc[e.get("type")].fields(e,t)}function vc(e){return hc[wo].entryExtension(e)}function bc(e,t){return hc[bo].entryLabel(e,t)}function wc(e,t){return hc[e.get("type")].entryPath(e,t)}function _c(e,t){return hc[e.get("type")].entrySlug(e,t)}function Sc(e){return hc[e.get("type")].allowDeletion(e)}function xc(e,t=""){let r=e.map((e=>`${t}${e.get("name")}`));return e.forEach(((e,t)=>{if(e.has("fields")){var n;const o=null===(n=e.get("fields"))||void 0===n?void 0:n.toArray();r=[...r,...xc(o,`${r[t]}.`)]}else if(e.has("field")){const n=e.get("field");r=[...r,...xc([n],`${r[t]}.`)]}else if(e.has("types")){var o;const n=null===(o=e.get("types"))||void 0===o?void 0:o.toArray();r=[...r,...xc(n,`${r[t]}.`)]}})),r}function Oc(e,t){const r=pc(t);let n,o,i=e.get("fields",(0,Qe.List)()).toArray();for(;(n=r.shift())&&i;){var a,s,l,c,u;if(o=i.find((e=>e.get("name")===n)),null!==(a=o)&&void 0!==a&&a.has("fields"))i=null===(c=o)||void 0===c||null===(u=c.get("fields"))||void 0===u?void 0:u.toArray();else if(null!==(s=o)&&void 0!==s&&s.has("field")){var f;i=[null===(f=o)||void 0===f?void 0:f.get("field")]}else if(null!==(l=o)&&void 0!==l&&l.has("types")){var p,d;i=null===(p=o)||void 0===p||null===(d=p.get("types"))||void 0===d?void 0:d.toArray()}}return o}function Ec(e,t,r=(()=>!1)){return r()||(e=e.map((e=>{const n=t(e);return r()?n:n.has("fields")?n.set("fields",Ec(n.get("fields"),t,r)):n.has("field")?n.set("field",Ec((0,Qe.List)([n.get("field")]),t,r).get(0)):n.has("types")?n.set("types",Ec(n.get("types"),t,r)):n})).toList()),e}function kc(e){const t=e.get("identifier_field"),r=t?[t,...Oo]:[...Oo],n=xc(e.get("fields",(0,Qe.List)()).toArray());return r.find((e=>n.find((t=>t.toLowerCase().trim()===e.toLowerCase().trim()))))}function Cc(e,t){if("title"===t&&e.get("identifier_field"))return kc(e);const r=ko[t],n=e.get("fields");let o;if(!n||!r)return null;const i=n.filter((e=>(null==e?void 0:e.get("widget","string"))===r.type)).map((e=>null==e?void 0:e.get("name")));if(o=i.filter((e=>-1!==r.synonyms.indexOf(e))),o&&o.size>0)return o.first();const a=n.filter((e=>-1!==r.secondaryTypes.indexOf(null==e?void 0:e.get("widget","string")))).map((e=>null==e?void 0:e.get("name")));return o=a.filter((e=>-1!==r.synonyms.indexOf(e))),o&&o.size>0?o.first():r.fallbackToFirstField&&i.size>0?i.first():(r.showError&&(s=`The Field ${t} is missing for the collection “${e.get("name")}”`,l=`Decap CMS tries to infer the entry ${t} automatically, but one couldn't be found for entries of the collection “${e.get("name")}”. Please check your site configuration.`,console.error(`%c ⛔ ${s}\n%c${l}\n\n`,"color: black; font-weight: bold; font-size: 16px; line-height: 50px;","color: black;")),null);var s,l}function Tc(e,t){const r=e.get("summary");if(r)return function(e,t,r){let n=t.get("data");const o=si(t,Cc(r,"date"))||null,i=n.getIn(ci(kc(r)));return n=ui(t.get("path"),n,r.get("folder")),t.get("author")&&!Oc(r,_o)&&(n=n.set(_o,t.get("author"))),t.get("updatedOn")&&!Oc(r,So)&&(n=n.set(So,t.get("updatedOn"))),ai(e,o,i,n)}(r,t,e);if(e.get("type")==bo){const r=bc(e,t.get("slug"));if(r)return r}const n=t.get("data"),o=Cc(e,"title"),i=o&&n.getIn(pc(o));return i||"title"===o?i:n.getIn(pc("title"))}function Pc(e,t,r){let n=Eo.map((n=>{const o=Cc(e,n);return!t.isGitBackend()||"author"!==n||o||r?o:_o})).filter(Boolean);return t.isGitBackend()&&!r&&(n=[So,...n]),n}function jc(e){var t;return e.has("folder")&&e.get("type")===wo&&e.has("meta")&&(null===(t=e.get("meta"))||void 0===t?void 0:t.has("path"))}function Rc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Mc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Rc(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Ac="i18n";let Ic=function(e){return e.MULTIPLE_FOLDERS="multiple_folders",e.MULTIPLE_FILES="multiple_files",e.SINGLE_FILE="single_file",e}({}),Dc=function(e){return e.TRANSLATE="translate",e.DUPLICATE="duplicate",e.NONE="none",e}({});function Lc(e){return e.has(Ac)}function Nc(e){if(!Lc(e))return{};const{structure:t,locales:r,default_locale:n}=e.get(Ac).toJS();return{structure:t,locales:r,defaultLocale:n}}function $c(e,t,r){return t!==r&&e.get(Ac)===Dc.TRANSLATE}function Fc(e,t,r){return t!==r&&e.get(Ac)===Dc.DUPLICATE}function Bc(e,t,r){return t!==r&&e.get(Ac)===Dc.NONE}function Uc(e){return[Ac,e,"data"]}function zc(e,t){return e!==t?Uc(e):["data"]}function qc(e,t,r,n,o){switch(e){case Ic.MULTIPLE_FOLDERS:return r.replace(`/${n}`,`/${o}/${n}`);case Ic.MULTIPLE_FILES:return r.replace(new RegExp(`${mo()(t)}$`),`${o}.${t}`);case Ic.SINGLE_FILE:default:return r}}function Wc(e,t,r){switch(e){case Ic.MULTIPLE_FOLDERS:{const e=r.split("/");return e.pop(),e.pop()}case Ic.MULTIPLE_FILES:return r.slice(0,-`.${t}`.length).split(".").pop();case Ic.SINGLE_FILE:default:return""}}function Hc(e,t,r,n){const{structure:o,locales:i}=Nc(e);return o===Ic.SINGLE_FILE?[r]:i.map((e=>qc(o,t,r,n,e)))}function Vc(e,t,r){switch(e){case Ic.MULTIPLE_FOLDERS:return t.replace(`${r}/`,"");case Ic.MULTIPLE_FILES:return t.replace(`.${r}`,"");case Ic.SINGLE_FILE:default:return t}}function Gc(e,t,r,n){let o=n.find((e=>e.locale===r));o||(o=n[0],console.warn(`Could not locale entry for default locale '${r}'`));const i=n.filter((e=>e.locale!==o.locale)).reduce(((e,{locale:t,value:r})=>{const n=Uc(t);return Yt()(e,n,r.data)}),{}),a=Vc(t,o.value.path,r),s=_c(e,a);return Mc(Mc(Mc({},o.value),{},{raw:""},i),{},{path:a,slug:s})}function Kc(e,t,r){const n=e.data[t]||{},o=r.filter((e=>e!==t)).map((t=>({locale:t,value:e.data[t]}))).filter((e=>e.value)).reduce(((e,t)=>Mc(Mc({},e),{},{[t.locale]:{data:t.value}})),{});return Mc(Mc({},e),{},{data:n,i18n:o,raw:""})}function Yc(e,t,r){const{structure:n,defaultLocale:o,locales:i}=Nc(e);if(n===Ic.SINGLE_FILE)return r.map((e=>Kc(e,o,i)));const a=vo()(r.map((e=>({locale:Wc(n,t,e.path),value:e}))),(({locale:e,value:t})=>Vc(n,t.path,e)));return Object.values(a).reduce(((t,r)=>[...t,Gc(e,n,o,r)]),[])}function Jc(e,t,r,n,o=[t.get("name")]){const i=e.getIn(["entry","data",...o]);return t.get(Ac)===Dc.DUPLICATE&&r.filter((e=>e!==n)).forEach((t=>{e=e.setIn(["entry",...zc(t,n),...o],i)})),t.has("field")&&!Qe.List.isList(i)?[t.get("field")].forEach((t=>{e=Jc(e,t,r,n,[...o,t.get("name")])})):t.has("fields")&&!Qe.List.isList(i)&&t.get("fields").toArray().forEach((t=>{e=Jc(e,t,r,n,[...o,t.get("name")])})),e}function Qc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Xc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qc(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Zc={type:"string",minLength:2,maxLength:10,pattern:"^[a-zA-Z-_]+$"},eu={type:"object",properties:{structure:{type:"string",enum:Object.values(Ic)},locales:{type:"array",minItems:1,items:Zc,uniqueItems:!0},default_locale:Zc}},tu=Xc(Xc({},eu),{},{required:["structure","locales"]}),ru={oneOf:[{type:"boolean"},eu]},nu={oneOf:[{type:"boolean"},{type:"string",enum:Object.values(Dc)}]};function ou(){const e=ho();return{$id:`fields_${e}`,type:"array",minItems:1,items:{$id:`field_${e}`,type:"object",properties:{name:{type:"string"},label:{type:"string"},widget:{type:"string"},required:{type:"boolean"},i18n:nu,hint:{type:"string"},pattern:{type:"array",minItems:2,items:[{oneOf:[{type:"string"},{instanceof:"RegExp"}]},{type:"string"}]},field:{$ref:`field_${e}`},fields:{$ref:`fields_${e}`},types:{$ref:`fields_${e}`}},select:{$data:"0/widget"},selectCases:Xc({},su()),required:["name"]},uniqueItemProperties:["name"]}}const iu={type:"array",minItems:1,items:{type:"object",properties:{label:{type:"string"},field:{type:"string"},pattern:{oneOf:[{type:"boolean"},{type:"string"}]}},additionalProperties:!1,required:["label","field","pattern"]}},au={type:"array",minItems:1,items:{type:"object",properties:{label:{type:"string"},field:{type:"string"},pattern:{type:"string"}},additionalProperties:!1,required:["label","field"]}};function su(){const e=Cn().map((e=>({[e.name]:e.schema})));return Object.assign(...e)}class lu extends(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Error)){constructor(e,...t){const r=e.map((({message:e,instancePath:t})=>{const r=t.slice(1).split("/").map((e=>e.match(/^\d+$/)?`[${e}]`:`.${e}`)).join("").slice(1);return`${r?`'${r}'`:"config"} ${e}`})).join("\n");super(r,...t),this.errors=e,this.message=r}toString(){return this.message}}const cu=["hooks","collections","provider"];function uu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fu(e){const t=(e.integrations||[]).reduce(((t,r)=>{const{hooks:n,collections:o,provider:i}=r,a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(r,cu);if(t.providers[i]=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?uu(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},a),!o)return n.forEach((e=>{t.hooks[e]=i})),t;const s="*"===o?e.collections.map((e=>e.name)):o;return s.forEach((e=>{n.forEach((r=>{t.hooks[e]?t.hooks[e][r]=i:t.hooks[e]={[r]:i}}))})),t}),{providers:{},hooks:{}});return(0,Qe.fromJS)(t)}const pu=(0,Qe.fromJS)({providers:{},hooks:{}});function du(e,t,r){return t?e.getIn(["hooks",t,r],!1):e.getIn(["hooks",r],!1)}const hu=["sortableFields"];function gu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gu(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const yu="CONFIG_REQUEST",vu="CONFIG_SUCCESS",bu="CONFIG_FAILURE";function wu(e){return"types"in e||"field"in e}function _u(e,t){return e.map((e=>{const r=t(e);return function(e){return"fields"in e}(r)?mu(mu({},r),{},{fields:_u(r.fields,t)}):wu(r)&&r.field?mu(mu({},r),{},{field:_u([r.field],t)[0]}):wu(r)&&r.types?mu(mu({},r),{},{types:_u(r.types,t)}):r}))}function Su(e){return"media_folder"in e&&!("public_folder"in e)?mu(mu({},e),{},{public_folder:e.media_folder}):e}const xu={dateFormat:"date_format",timeFormat:"time_format",pickerUtc:"picker_utc",editorComponents:"editor_components",valueType:"value_type",valueField:"value_field",searchFields:"search_fields",displayFields:"display_fields",optionsLength:"options_length"};function Ou(e){const t=Object.keys(xu).filter((t=>t in e)).map((t=>{const r=xu[t];return console.warn(`Field ${e.name} is using a deprecated configuration '${t}'. Please use '${r}'`),{[r]:e[t]}}));return Object.assign({},e,...t)}function Eu(e){return!0===e[Ac]?mu(mu({},e),{},{[Ac]:Dc.TRANSLATE}):!1!==e[Ac]&&e[Ac]?e:mu(mu({},e),{},{[Ac]:Dc.NONE})}function ku(e,t){if("boolean"==typeof e)return t;{const r=e.locales||t.locales,n=e.default_locale||r[0],o=Qn()(t,e);return o.locales=r,o.default_locale=n,Pu(o),o}}function Cu(e,t){return _u(e,t?Eu:e=>{const t=mu({},e);return delete t[Ac],t})}function Tu(e){if(e&&e.structure!==Ic.SINGLE_FILE)throw new Error(`i18n configuration for files collections is limited to ${Ic.SINGLE_FILE} structure`)}function Pu(e){if(e&&e.default_locale&&!e.locales.includes(e.default_locale))throw new Error(`i18n locales '${e.locales.join(", ")}' are missing the default locale ${e.default_locale}`)}function ju(e,t){return!!du(fu((0,Qe.fromJS)(e)),t.name,"listEntries")}function Ru(e){return{type:vu,payload:e}}function Mu(e){return{type:bu,error:"Error loading config",payload:e}}function Au(e={},t){return window.CMS_CONFIG?Ru(window.CMS_CONFIG):async r=>{r({type:yu});try{const n=function(){const e=document.querySelector('link[rel="cms-config-url"]');return e&&{"text/yaml":"yaml","application/x-yaml":"yaml"}[e.type]&&e.href?(console.log(`Using config file path: "${e.href}"`),e.href):"config.yml"}(),o=!Gn()(e),i=!1===e.load_config_file?{}:await async function(e,t){const r=await fetch(e,{credentials:"same-origin"}).catch((e=>e));if(r instanceof Error||200!==r.status){if(t)return{};const e=r instanceof Error?r.message:r.status;throw new Error(`Failed to load config.yml (${e})`)}const n=r.headers.get("Content-Type")||"Not-Found";return-1===n.indexOf("yaml")&&(console.log(`Response for ${e} was not yaml. (Content-Type: ${n})`),t)?{}:function(e){const t=mr().parse(e,{maxAliasCount:-1,prettyErrors:!0,merge:!0});if("undefined"!=typeof window&&"string"==typeof window.CMS_ENV&&t[window.CMS_ENV]){const e=Object.keys(t[window.CMS_ENV]);for(const r of e)t[r]=t[window.CMS_ENV][r]}return t}(await r.text())}(n,o),a=Qn()(i,e);!function(e){const t=new(no())({allErrors:!0,$data:!0,strict:!1});if((0,oo.uniqueItemProperties)(t),(0,oo.select)(t),(0,oo.instanceof)(t),(0,oo.prohibited)(t),ao()(t),!t.validate({type:"object",properties:{backend:{type:"object",properties:{name:{type:"string",examples:["test-repo"]},auth_scope:{type:"string",examples:["repo","public_repo"],enum:["repo","public_repo"]},cms_label_prefix:{type:"string",minLength:1},open_authoring:{type:"boolean",examples:[!0]}},required:["name"]},local_backend:{oneOf:[{type:"boolean"},{type:"object",properties:{url:{type:"string",examples:["http://localhost:8081/api/v1"]},allowed_hosts:{type:"array",items:{type:"string"}}},additionalProperties:!1}]},locale:{type:"string",examples:["en","fr","de"]},i18n:tu,site_url:{type:"string",examples:["https://example.com"]},display_url:{type:"string",examples:["https://example.com"]},logo_url:{type:"string",examples:["https://example.com/images/logo.svg"]},show_preview_links:{type:"boolean"},media_folder:{type:"string",examples:["assets/uploads"]},public_folder:{type:"string",examples:["/uploads"]},media_folder_relative:{type:"boolean"},media_library:{type:"object",properties:{name:{type:"string",examples:["uploadcare"]},config:{type:"object"}},required:["name"]},publish_mode:{type:"string",enum:["simple","editorial_workflow",""],examples:["editorial_workflow"]},slug:{type:"object",properties:{encoding:{type:"string",enum:["unicode","ascii"]},clean_accents:{type:"boolean"}}},collections:{type:"array",minItems:1,items:{type:"object",properties:{name:{type:"string"},label:{type:"string"},label_singular:{type:"string"},description:{type:"string"},folder:{type:"string"},files:{type:"array",items:{type:"object",properties:{name:{type:"string"},label:{type:"string"},label_singular:{type:"string"},description:{type:"string"},file:{type:"string"},preview_path:{type:"string"},preview_path_date_field:{type:"string"},fields:ou()},required:["name","label","file","fields"]},uniqueItemProperties:["name"]},identifier_field:{type:"string"},summary:{type:"string"},slug:{type:"string"},path:{type:"string"},preview_path:{type:"string"},preview_path_date_field:{type:"string"},create:{type:"boolean"},publish:{type:"boolean"},hide:{type:"boolean"},editor:{type:"object",properties:{preview:{type:"boolean"}}},format:{type:"string"},extension:{type:"string"},frontmatter_delimiter:{type:["string","array"],minItems:2,maxItems:2,items:{type:"string"}},fields:ou(),sortable_fields:{type:"array",items:{type:"string"}},sortableFields:{type:"array",items:{type:"string"}},view_filters:iu,view_groups:au,nested:{type:"object",properties:{depth:{type:"number",minimum:1,maximum:1e3},summary:{type:"string"}},required:["depth"]},meta:{type:"object",properties:{path:{type:"object",properties:{label:{type:"string"},widget:{type:"string"},index_file:{type:"string"}},required:["label","widget","index_file"]}},additionalProperties:!1,minProperties:1},i18n:ru},required:["name","label"],oneOf:[{required:["files"]},{required:["folder","fields"]}],not:{required:["sortable_fields","sortableFields"]},if:{required:["extension"]},then:{if:{properties:{extension:{enum:Object.keys(qn)}}},else:{required:["format"]}},dependencies:{frontmatter_delimiter:{properties:{format:{enum:Un}},required:["format"]}}},uniqueItemProperties:["name"]},editor:{type:"object",properties:{preview:{type:"boolean"}}}},required:["backend","collections"],anyOf:[{required:["media_folder"]},{required:["media_library"]}]},e)){const e=t.errors.map((e=>{switch(e.keyword){case"uniqueItemProperties":{const t=e.instancePath||"";let r=e;return t.endsWith("/fields")?r=Xc(Xc({},e),{},{message:"fields names must be unique"}):t.endsWith("/files")?r=Xc(Xc({},e),{},{message:"files names must be unique"}):t.endsWith("/collections")&&(r=Xc(Xc({},e),{},{message:"collections names must be unique"})),r}case"instanceof":{const t=e.instancePath||"";let r=e;return/fields\/\d+\/pattern\/\d+/.test(t)&&(r=Xc(Xc({},e),{},{message:"must be a regular expression"})),r}default:return e}}));throw console.error("Config Errors",e),new lu(e)}}(a);const s=function(e){const{collections:t=[]}=e,r=t.map((e=>{const{fields:t,files:r}=e;let n=e;if(t){const e=_u(t,Ou);n=mu(mu({},n),{},{fields:e})}if(r){const e=r.map((e=>{const t=_u(e.fields,Ou);return mu(mu({},e),{},{fields:t})}));n=mu(mu({},n),{},{files:e})}if(n.sortableFields){const{sortableFields:t}=n;n=mu(mu({},function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(n,hu)),{},{sortable_fields:t}),console.warn(`Collection ${e.name} is using a deprecated configuration 'sortableFields'. Please use 'sortable_fields'`)}return n}));return mu(mu({},e),{},{collections:r})}(await async function(e){if(!e.local_backend)return e;const{proxyUrl:t,publish_modes:r,type:n}=await async function(e){if(!["localhost","127.0.0.1",..."boolean"==typeof e?[]:(null==e?void 0:e.allowed_hosts)||[]].includes(location.hostname)||!e)return{};const t="http://localhost:8081/api/v1",r=!0===e?t:e.url||t.replace("localhost",location.hostname);try{console.log(`Looking for Decap CMS Proxy Server at '${r}'`);const e=await fetch(`${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"info"})}),{repo:t,publish_modes:n,type:o}=await e.json();return"string"==typeof t&&Array.isArray(n)&&"string"==typeof o?(console.log(`Detected Decap CMS Proxy Server at '${r}' with repo: '${t}'`),{proxyUrl:r,publish_modes:n,type:o}):(console.log(`Decap CMS Proxy Server not detected at '${r}'`),{})}catch{return console.log(`Decap CMS Proxy Server not detected at '${r}'`),{}}}(e.local_backend);return t?Gt(e,(e=>{e.backend.name="proxy",e.backend.proxy_url=t,e.publish_mode&&(e.publish_mode=function(e,t,r){if(e.publish_mode&&t&&!t.includes(e.publish_mode)){const n=t[0];return console.log(`'${e.publish_mode}' is not supported by '${r}' backend, switching to '${n}'`),n}return e.publish_mode}(e,r,n))})):e}(a)),l=Gt(s,(e=>{e.publish_mode=e.publish_mode||Xn,e.slug=e.slug||{},e.collections=e.collections||[],!e.display_url&&e.site_url&&(e.display_url=e.site_url);const t=`/${Yn()(e.media_folder,"/")}`;"public_folder"in e||(e.public_folder=t),"encoding"in e.slug||(e.slug.encoding="unicode"),"clean_accents"in e.slug||(e.slug.clean_accents=!1),"sanitize_replacement"in e.slug||(e.slug.sanitize_replacement="-");const r=e[Ac];r&&(r.default_locale=r.default_locale||r.locales[0]),Pu(r);const n=tf(e);for(const t of e.collections){"publish"in t||(t.publish=!0);let o=t[Ac];r&&o?(o=ku(o,r),t[Ac]=o):(o=void 0,delete t[Ac]),t.fields&&(t.fields=Cu(t.fields,Boolean(o)));const{folder:i,files:a,view_filters:s,view_groups:l,meta:c}=t;if(i&&(t.type=wo,t.path&&!t.media_folder&&(t.media_folder=""),"media_folder"in t&&!("public_folder"in t)&&(t.public_folder=t.media_folder),t.fields&&(t.fields=_u(t.fields,Su)),t.folder=tr()(i,"/"),c&&c.path)){const e=mu({name:"path",meta:!0,required:!0},c.path);t.fields=[e,...t.fields||[]]}if(a){t.type=bo,Tu(o),delete t.nested,delete t.meta;for(const e of a){e.file=Yn()(e.file,"/"),"media_folder"in e&&!("public_folder"in e)&&(e.public_folder=e.media_folder),e.fields&&(e.fields=_u(e.fields,Su));let t=e[Ac];t&&o?(t=ku(t,o),e[Ac]=t):(t=void 0,delete e[Ac]),Tu(t),e.fields&&(e.fields=Cu(e.fields,Boolean(t)))}}t.sortable_fields||(t.sortable_fields=Pc((0,Qe.fromJS)(t),n,ju(e,t))),t.view_filters=(s||[]).map((e=>mu(mu({},e),{},{id:`${e.field}__${e.pattern}`}))),t.view_groups=(l||[]).map((e=>mu(mu({},e),{},{id:`${e.field}__${e.pattern}`}))),e.editor&&!t.editor&&(t.editor={preview:e.editor.preview})}}));r(Ru(l)),"function"==typeof t&&t()}catch(e){throw r(Mu(e)),e}}}function Iu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Du(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Iu(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Iu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Lu(e){return e.locale||"en"}function Nu(e){return e.publish_mode===Zn}const $u=Gt(((e,t)=>{switch(t.type){case yu:e.isFetching=!0;break;case vu:return Du(Du({},t.payload),{},{isFetching:!1,error:void 0});case bu:e.isFetching=!1,e.error=t.payload.toString()}}),{isFetching:!0}),Fu=["field"];function Bu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Uu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bu(Object(r),!0).forEach((function(t){zu(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function zu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{extractTemplateVars:qu,dateParsers:Wu,expandPath:Hu}=hr.stringTemplate;class Vu{constructor(){zu(this,"storageKey","decap-cms-user")}retrieve(){const e=window.localStorage.getItem(this.storageKey);return e&&JSON.parse(e)}store(e){window.localStorage.setItem(this.storageKey,JSON.stringify(e))}logout(){window.localStorage.removeItem(this.storageKey)}}function Gu(e,t){const r="backup";return e?`${r}.${e}${t?`.${t}`:""}`:r}function Ku(e,t){const r=Qt()(t.data,e);if(r)return String(r);{const r=e.split(".")[0];return t[r]?t[r]:""}}function Yu(e){return t=>e.reduce(((e,r)=>{const n=Ku(r,t);return n?`${e} ${n}`:e}),"")}function Ju(e,t){return e.score>t.score?-1:e.score<t.score?1:0}function Qu(e,t){const r=e.get("folder",""),n=t.toLowerCase().replace(r.toLowerCase(),"");return(0,dr.join)((0,dr.dirname)(tr()(n,"/")),(0,dr.basename)(n,(0,dr.extname)(t)))}function Xu(e,t){return jc(t)?(0,dr.dirname)(e).slice(t.get("folder").length+1)||"/":e}function Zu(e){var t;let r;return r=(null===(t=e.get("nested"))||void 0===t?void 0:t.get("depth"))||(0,pr.getPathDepth)(e.get("path","")),Lc(e)&&(r=function(e,t){const{structure:r}=Nc(e);return r===Ic.MULTIPLE_FOLDERS?t+1:t}(e,r)),r}class ef{constructor(e,{backendName:t,authStore:r,config:n}){if(zu(this,"implementation",void 0),zu(this,"backendName",void 0),zu(this,"config",void 0),zu(this,"authStore",void 0),zu(this,"user",void 0),zu(this,"backupSync",void 0),zu(this,"updateUserCredentials",(e=>{const t=this.authStore.retrieve();if(t&&t.backendName===this.backendName)return this.user=Uu(Uu({},t),e),this.authStore.store(this.user),this.user})),zu(this,"getToken",(()=>this.implementation.getToken())),this.deleteAnonymousBackup(),this.config=n,this.implementation=e.init(this.config,{useWorkflow:Nu(this.config),updateUserCredentials:this.updateUserCredentials,initialWorkflowStatus:eo.first()}),this.backendName=t,this.authStore=r,null===this.implementation)throw new Error("Cannot instantiate a Backend with no implementation");this.backupSync=(0,pr.asyncLock)()}async status(){let e={auth:{status:!0},api:{status:!0,statusPage:""}};for(let t=1;t<=3;t++){if(e=await this.implementation.status(),Object.values(e).every((e=>!0===e.status)))return e;await new Promise((e=>setTimeout(e,1e3*t)))}return e}currentUser(){if(this.user)return this.user;const e=this.authStore.retrieve();return e&&e.backendName===this.backendName?Promise.resolve(this.implementation.restoreUser(e)).then((e=>(this.user=Uu(Uu({},e),{},{backendName:this.backendName}),this.authStore.store(this.user),this.user))):Promise.resolve(null)}isGitBackend(){var e,t;return(null===(e=(t=this.implementation).isGitBackend)||void 0===e?void 0:e.call(t))||!1}authComponent(){return this.implementation.authComponent()}authenticate(e){return this.implementation.authenticate(e).then((e=>(this.user=Uu(Uu({},e),{},{backendName:this.backendName}),this.authStore&&this.authStore.store(this.user),this.user)))}async logout(){try{await this.implementation.logout()}catch(e){console.warn("Error during logout",e.message)}finally{this.user=null,this.authStore&&this.authStore.logout()}}async entryExist(e,t,r,n){const o=n&&await this.implementation.unpublishedEntry({collection:e.get("name"),slug:r}).catch((e=>e.name===pr.EDITORIAL_WORKFLOW_ERROR&&e.notUnderEditorialWorkflow?Promise.resolve(!1):Promise.reject(e)));return o||await this.implementation.getEntry(t).then((({data:e})=>e)).catch((()=>Promise.resolve(!1)))}async generateUniqueSlug(e,t,r,n,o){const i=r.slug;let a;a=o?Qu(e,o):function(e,t,r){const n=e.get("slug")||"{{slug}}",o=t.getIn(ci(kc(e)));if(!o)throw new Error("Collection must have a field name that is a valid entry identifier, or must have `identifier_field` set");const i=gi(r),a=new Date,s=ai(n,a,o,t,i);if(e.has("path")){const r=hi(e.get("path"));return ai(r,a,s,t,(e=>e===s?e:i(e)))}return s}(e,t,i);let s=1,l=a;for(;n.includes(l)||await this.entryExist(e,wc(e,l),l,Nu(r));)l=`${a}${ri(" ",i)}${s++}`;return l}processEntries(e,t){const r=e.map((e=>Si(t.get("name"),_c(t,e.file.path),e.file.path,{raw:e.data||"",label:e.file.label,author:e.file.author,updatedOn:e.file.updatedOn,meta:{path:Xu(e.file.path,t)}}))).map(this.entryWithFormat(t)),n=t.get("filter"),o=n?this.filterEntries({entries:r},n):r;if(Lc(t)){const e=vc(t);return Yc(t,e,o)}return o}async listEntries(e){var t;const r=vc(e);let n;const o=e.get("type");if(o===wo)n=()=>{const t=Zu(e);return this.implementation.entriesByFolder(e.get("folder"),r,t)};else{if(o!==bo)throw new Error(`Unknown collection type: ${o}`);{const t=e.get("files").map((e=>({path:e.get("file"),label:e.get("label")}))).toArray();n=()=>this.implementation.entriesByFiles(t)}}const i=await n(),a=pr.Cursor.create(i[pr.CURSOR_COMPATIBILITY_SYMBOL]).wrapData({cursorType:"collectionEntries",collection:e});return{entries:this.processEntries(i,e),pagination:null===(t=a.meta)||void 0===t?void 0:t.get("page"),cursor:a}}async listAllEntries(e){if(e.get("folder")&&this.implementation.allEntriesByFolder){const t=Zu(e),r=vc(e);return this.implementation.allEntriesByFolder(e.get("folder"),r,t,function(e){let t="";return e.get("path")&&(t=`${e.get("folder")}/${e.get("path")}`.replace(/{{.*}}/gm,"(.*)")),Lc(e)&&(t=function(e,{defaultLocale:t,structure:r}){return r===Ic.MULTIPLE_FOLDERS?`${t}\\/${e}`:r===Ic.MULTIPLE_FILES?`${e}\\.${t}\\..*`:e}(t,Nc(e))),t?new RegExp(t):void 0}(e)).then((t=>this.processEntries(t,e)))}const t=await this.listEntries(e),{entries:r}=t;let{cursor:n}=t;for(;n&&n.actions.includes("next");){const{entries:e,cursor:t}=await this.traverseCursor(n,"next");r.push(...e),n=t}return r}async search(e,t){const r=[],n=e.map((async e=>{const r=e.get("summary",""),n=qu(r);let o=[];var i;e.get("type")===bo?null===(i=e.get("files"))||void 0===i||i.forEach((e=>{const t=e.get("fields").map((e=>e.get("name"))).toArray();o=[...o,...t]})):o=[Cc(e,"title"),Cc(e,"shortTitle"),Cc(e,"author"),...n.map((t=>Wu[t]?Cc(e,"date"):t))];const a=o.filter(Boolean),s=await this.listAllEntries(e);return ur.filter(t,s,{extract:Yu(nr()(a))})})).map((e=>e.catch((e=>(r.push(e),[]))))),o=await Promise.all(n).then((e=>sr()(e)));if(r.length>0)throw new Error({message:"Errors occurred while searching entries locally!",errors:r});const i=o.filter((({score:e})=>e>5)).sort(Ju).map((e=>e.original));return{entries:i}}async query(e,t,r,n,o){let i=await this.listAllEntries(e);n&&(i=i.filter((e=>e.slug===n)));const a=function(e,t){const r=e.reduce(((e,r)=>{const n=t.reduce(((e,t)=>{const n=Hu({data:r.data,path:t});return e.push(...n),e}),[]);for(let t=0;t<n.length;t++)e.push(Uu(Uu({},r),{},{field:n[t]}));return e}),[]);return r}(i,t);let s=ur.filter(r,a,{extract:e=>Ku(e.field,e)}).sort(Ju).map((e=>e.original));void 0!==o&&o>0&&(s=s.slice(0,o));const l=function(e){const t=e.map((e=>e.field)),r={},n=e.reduce(((e,t)=>{if(!e[t.slug]){const{field:n}=t,o=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,Fu);e[t.slug]=o,r[t.slug]=(0,Qe.Set)()}const n=t.field.split(".");let o=e[t.slug].data;for(let e=0;e<n.length;e++)if(o=o[n[e]],Array.isArray(o)){const o=n.slice(0,e+1).join(".");r[t.slug]=r[t.slug].add(o)}return e}),{});return Object.keys(n).forEach((e=>{const o=n[e].data;for(const n of r[e].toArray()){const e=Qt()(o,n),r=e.filter(((e,r)=>t.some((e=>`${e}.`.startsWith(`${n}.${r}.`)))));r.sort(((r,o)=>{const i=e.indexOf(r),a=e.indexOf(o),s=`${n}.${i}.`,l=`${n}.${a}.`,c=t.findIndex((e=>`${e}.`.startsWith(s))),u=t.findIndex((e=>`${e}.`.startsWith(l)));return c-u})),Yt()(o,n,r)}})),Object.values(n)}(s);return{query:r,hits:l}}traverseCursor(e,t){const[r,n]=e.unwrapData(),o=r.get("collection");return this.implementation.traverseCursor(n,t).then((async({entries:e,cursor:t})=>({entries:this.processEntries(e,o),cursor:pr.Cursor.create(t).wrapData({cursorType:"collectionEntries",collection:o})})))}async getLocalDraftBackup(e,t){const r=Gu(e.get("name"),t),n=await pr.localForage.getItem(r);if(!n||!n.raw.trim())return{};const{raw:o,path:i}=n;let{mediaFiles:a=[]}=n;a=a.map((e=>e.file?Uu(Uu({},e),{},{url:URL.createObjectURL(e.file)}):e));const s=bc(e,t),l=r=>this.entryWithFormat(e)(Si(e.get("name"),t,i,{raw:r,label:s,mediaFiles:a,meta:{path:Xu(i,e)}})),c=l(o);if(Lc(e)&&n.i18n){const e=function(e,t){const r=Object.entries(e).reduce(((e,[r,{raw:n}])=>{const o=t(n);return Mc(Mc({},e),{},{[r]:{data:o.data}})}),{});return r}(n.i18n,l);c.i18n=e}return{entry:c}}async persistLocalDraftBackup(e,t){try{await this.backupSync.acquire();const r=Gu(t.get("name"),e.get("slug")),n=this.entryToRaw(t,e);if(!n.trim())return;const o=await Promise.all(e.get("mediaFiles").toJS().map((async e=>{var t;if(null!==(t=e.url)&&void 0!==t&&t.startsWith("blob:")){const t=await fetch(e.url).then((e=>e.blob()));return Uu(Uu({},e),{},{file:(0,pr.blobToFileObj)(e.name,t)})}return e})));let i;return Lc(t)&&(i=function(e,t,r){const{locales:n,defaultLocale:o}=Nc(e),i=n.filter((e=>e!==o)).reduce(((e,n)=>{const i=zc(n,o),a=t.getIn(i);if(!a)return e;const s=t.set("data",a);return Mc(Mc({},e),{},{[n]:{raw:r(s)}})}),{});return i}(t,e,(e=>this.entryToRaw(t,e)))),await pr.localForage.setItem(r,Uu({raw:n,path:e.get("path"),mediaFiles:o},i&&{i18n:i})),await pr.localForage.setItem(Gu(),n)}catch(e){console.warn("persistLocalDraftBackup",e)}finally{this.backupSync.release()}}async deleteLocalDraftBackup(e,t){try{return await this.backupSync.acquire(),await pr.localForage.removeItem(Gu(e.get("name"),t)),t&&await pr.localForage.removeItem(Gu(e.get("name"))),await this.deleteAnonymousBackup()}catch(e){console.warn("deleteLocalDraftBackup",e)}finally{this.backupSync.release()}}deleteAnonymousBackup(){return pr.localForage.removeItem(Gu())}async getEntry(e,t,r){const n=wc(t,r),o=bc(t,r),i=vc(t),a=async n=>{const i=await this.implementation.getEntry(n);let a=Si(t.get("name"),r,i.file.path,{raw:i.data,label:o,mediaFiles:[],meta:{path:Xu(i.file.path,t)}});return a=this.entryWithFormat(t)(a),a=await this.processEntry(e,t,a),a};let s;return s=Lc(t)?await async function(e,t,r,n,o){const{structure:i,locales:a,defaultLocale:s}=Nc(e);let l;if(i===Ic.SINGLE_FILE)l=Kc(await o(r),s,a);else{const c=(await Promise.all(a.map((async e=>{const a=qc(i,t,r,n,e);return{value:await o(a).catch((()=>null)),locale:e}})))).filter((e=>null!==e.value));l=Gc(e,i,s,c)}return l}(t,i,n,r,a):await a(n),s}getMedia(){return this.implementation.getMedia()}getMediaFile(e){return this.implementation.getMediaFile(e)}getMediaDisplayURL(e){if(this.implementation.getMediaDisplayURL)return this.implementation.getMediaDisplayURL(e);const t=new Error("getMediaDisplayURL is not implemented by the current backend, but the backend returned a displayURL which was not a string!");return t.displayURL=e,Promise.reject(t)}entryWithFormat(e){return t=>{const r=Hn(e,t);if(t&&void 0!==t.raw){const e=r&&cr()(r.fromFile.bind(r,t.raw))||{};return ir()(e)&&console.error(e),Object.assign(t,{data:ir()(e)?{}:e})}return r.fromFile(t)}}async processUnpublishedEntry(e,t,r){const{slug:n}=t;let o;if(e.get("type")===bo){const t=e.get("files").find((e=>(null==e?void 0:e.get("name"))===n));o=(0,dr.extname)(t.get("file"))}else o=vc(e);const i=[];if(r){const r=t.diffs.filter((e=>!e.path.endsWith(o))),a=await Promise.all(r.map((t=>this.implementation.unpublishedEntryMediaFile(e.get("name"),n,t.path,t.id))));i.push(...a.map((e=>Uu(Uu({},e),{},{draft:!0}))))}const a=Zt()(t.diffs.filter((e=>e.path.endsWith(o))),(e=>e.path.length)),s=(r,o,a)=>{const s=Si(e.get("name"),n,o,{raw:r,isModification:!a,label:e&&bc(e,n),mediaFiles:i,updatedOn:t.updatedAt,author:t.pullRequestAuthor,status:t.status,meta:{path:Xu(o,e)}});return this.entryWithFormat(e)(s)},l=async r=>{const n=await this.implementation.unpublishedEntryDataFile(e.get("name"),t.slug,r.path,r.id);return s(n,r.path,r.newFile)};if(a.length<=0){const t=await this.implementation.getEntry(wc(e,n));return s(t.data,t.file.path,!1)}if(Lc(e)){const t=wc(e,n),r=function(e,t,r,n,o){const{structure:i}=Nc(e);return i===Ic.SINGLE_FILE?o:Hc(e,t,r,n).reduce(((e,t)=>{const r=o.find((e=>e.path===t));return r?[...e,r]:[...e,{path:t,id:"",newFile:!1}]}),[])}(e,o,t,n,a);let i=await Promise.all(r.map((e=>l(e).catch((()=>null)))));return i=i.filter(Boolean),(await Yc(e,o,i))[0]}return await l(a[0])}async unpublishedEntries(e){const t=await this.implementation.unpublishedEntries(),r=(await Promise.all(t.map((async t=>{const r=await this.implementation.unpublishedEntry({id:t}),n=r.collection,o=e.find((e=>e.get("name")===n));return o?await this.processUnpublishedEntry(o,r,!1):(console.warn(`Missing collection '${n}' for unpublished entry '${t}'`),null)})))).filter(Boolean);return{pagination:0,entries:r}}async processEntry(e,t,r){const n=du(e.integrations,null,"assetStore"),o=function(e,t,r){const n=function(e,t){return e.has("folder")?gc(e.get("fields").toArray()):e.has("files")?gc((null===(r=mc(e,t))||void 0===r?void 0:r.get("fields").toArray())||[]):[];var r}(t,r.get("slug")),o=n.map((n=>ac(e,t,r,n)));return t.has("files")&&mc(t,r.get("slug"))&&o.unshift(ac(e,t,r,void 0)),t.has("media_folder")&&(t=t.delete("files"),o.unshift(ac(e,t,r,void 0))),(0,Qe.Set)(o).toArray()}(e.config,t,(0,Qe.fromJS)(r));if(o.length>0&&!n){const e=await Promise.all(o.map((e=>this.implementation.getMedia(e))));r.mediaFiles=r.mediaFiles.concat(...e)}else r.mediaFiles=r.mediaFiles.concat(e.mediaLibrary.get("files")||[]);return r}async unpublishedEntry(e,t,r){const n=await this.implementation.unpublishedEntry({collection:t.get("name"),slug:r});let o=await this.processUnpublishedEntry(t,n,!0);return o=await this.processEntry(e,t,o),o}getDeploy(e,t,r){const n=this.config.site_url;if(n&&!1!==this.config.show_preview_links)return{url:mi(n,e,t,r,this.config.slug),status:"SUCCESS"}}async getDeployPreview(e,t,r,{maxAttempts:n=1,interval:o=5e3}={}){if(!this.implementation.getDeployPreview||!1===this.config.show_preview_links)return;let i,a=0;for(;!i&&a<n;)a++,i=await this.implementation.getDeployPreview(e.get("name"),t),i||await new Promise((e=>setTimeout((()=>e(void 0)),o)));return i?{url:mi(i.url,e,t,r,this.config.slug),status:i.status?i.status.toUpperCase():""}:void 0}async persistEntry({config:e,collection:t,entryDraft:r,assetProxies:n,usedSlugs:o,unpublished:i=!1,status:a}){const s=await this.invokePreSaveEvent(r.get("entry")),l=s&&r.setIn(["entry","data"],s)||r,c=l.getIn(["entry","newRecord"])||!1,u=Nu(e),f=As(t,l);let p;if(c){if(!function(e){return hc[e.get("type")].allowNewEntries(e)}(t))throw new Error("Not allowed to create new entries in this collection");const r=await this.generateUniqueSlug(t,l.getIn(["entry","data"]),e,o,f),i=f||wc(t,r);p={path:i,slug:r,raw:this.entryToRaw(t,l.get("entry"))},function(e,t,r,n,o){e.map((e=>{const i=e.path,a=sc(t,r,n.get("entry").set("path",o),i,e.field);e.path=a}))}(n,e,t,l,i)}else{const e=l.getIn(["entry","slug"]);p={path:l.getIn(["entry","path"]),slug:f&&!u?Qu(t,f):e,raw:this.entryToRaw(t,l.get("entry")),newPath:f}}const{slug:d,path:h,newPath:g}=p;let m=[p];if(Lc(t)){const e=vc(t);m=function(e,t,r,n,o,i,a){const{structure:s,defaultLocale:l,locales:c}=Nc(e);if(s===Ic.SINGLE_FILE){const e=c.reduce(((e,t)=>{const n=zc(t,l);return e.set(t,r.getIn(n))}),(0,Qe.Map)({})),u=r.set("data",e);return[Mc({path:qc(s,t,o,i,c[0]),slug:i,raw:n(u)},a&&{newPath:qc(s,t,a,i,c[0])})]}return c.map((e=>{const c=zc(e,l),u=r.set("data",r.getIn(c));return Mc({path:qc(s,t,o,i,e),slug:i,raw:u.get("data")?n(u):""},a&&{newPath:qc(s,t,a,i,e)})})).filter((e=>e.raw))}(t,e,l.get("entry"),(e=>this.entryToRaw(t,e)),h,d,g)}const y=await this.currentUser(),v=Uu({newEntry:c,commitMessage:di(c?"create":"update",e,{collection:t,slug:d,path:h,authorLogin:y.login,authorName:y.name},y.useOpenAuthoring),collectionName:t.get("name"),useWorkflow:u},{unpublished:i,status:a});return u||await this.invokePrePublishEvent(l.get("entry")),await this.implementation.persistEntry({dataFiles:m,assets:n},v),await this.invokePostSaveEvent(l.get("entry")),u||await this.invokePostPublishEvent(l.get("entry")),d}async invokeEventWithEntry(e,t){const{login:r,name:n}=await this.currentUser();return await Dn({name:e,data:{entry:t,author:{login:r,name:n}}})}async invokePrePublishEvent(e){await this.invokeEventWithEntry("prePublish",e)}async invokePostPublishEvent(e){await this.invokeEventWithEntry("postPublish",e)}async invokePreUnpublishEvent(e){await this.invokeEventWithEntry("preUnpublish",e)}async invokePostUnpublishEvent(e){await this.invokeEventWithEntry("postUnpublish",e)}async invokePreSaveEvent(e){return await this.invokeEventWithEntry("preSave",e)}async invokePostSaveEvent(e){await this.invokeEventWithEntry("postSave",e)}async persistMedia(e,t){const r=await this.currentUser(),n={commitMessage:di("uploadMedia",e,{path:t.path,authorLogin:r.login,authorName:r.name},r.useOpenAuthoring)};return this.implementation.persistMedia(t,n)}async deleteEntry(e,t,r){const n=e.config,o=wc(t,r),i=vc(t);if(!Sc(t))throw new Error("Not allowed to delete entries in this collection");const a=await this.currentUser(),s=di("delete",n,{collection:t,slug:r,path:o,authorLogin:a.login,authorName:a.name},a.useOpenAuthoring),l=Jl(e.entries,t.get("name"),r);await this.invokePreUnpublishEvent(l);let c=[o];Lc(t)&&(c=Hc(t,i,o,r)),await this.implementation.deleteFiles(c,s),await this.invokePostUnpublishEvent(l)}async deleteMedia(e,t){const r=await this.currentUser(),n=di("deleteMedia",e,{path:t,authorLogin:r.login,authorName:r.name},r.useOpenAuthoring);return this.implementation.deleteFiles([t],n)}persistUnpublishedEntry(e){return this.persistEntry(Uu(Uu({},e),{},{unpublished:!0}))}updateUnpublishedEntryStatus(e,t,r){return this.implementation.updateUnpublishedEntryStatus(e,t,r)}async publishUnpublishedEntry(e){const t=e.get("collection"),r=e.get("slug");await this.invokePrePublishEvent(e),await this.implementation.publishUnpublishedEntry(t,r),await this.invokePostPublishEvent(e)}deleteUnpublishedEntry(e,t){return this.implementation.deleteUnpublishedEntry(e,t)}entryToRaw(e,t){const r=Hn(e,t.toJS()),n=this.fieldsOrder(e,t),o=function(e,t){let r=[];if(e.has("folder"))r=e.get("fields").toArray();else if(e.has("files")){const n=e.get("files").find((e=>(null==e?void 0:e.get("name"))===t.get("slug")));r=n.get("fields").toArray()}const n={};return xc(r).forEach((t=>{const r=Oc(e,t);null!=r&&r.has("comment")&&(n[t]=r.get("comment"))})),n}(e,t);let i=r.toFile(t.get("data").toJS(),n,o);return"\n"!=i.slice(-1)&&(i+="\n"),i}fieldsOrder(e,t){if(e.get("fields"))return e.get("fields").map((e=>e.get("name"))).toArray();const r=(e.get("files")||(0,Qe.List)()).filter((e=>e.get("name")===t.get("slug"))).get(0);if(null==r)throw new Error(`No file found for ${t.get("slug")} in ${e.get("name")}`);return r.get("fields").map((e=>e.get("name"))).toArray()}filterEntries(e,t){return e.entries.filter((e=>{const r=e.data[t.get("field")];return Array.isArray(r)?r.includes(t.get("value")):r===t.get("value")}))}}function tf(e){if(!e.backend.name)throw new Error("No backend defined in configuration");const{name:t}=e.backend,r=new Vu,n=Mn(t);if(n)return new ef(n,{backendName:t,authStore:r,config:e});throw new Error(`Backend not found: ${t}`)}const rf=function(){let e;return t=>e||(e=tf(t))}(),nf="AUTH_REQUEST",of="AUTH_SUCCESS",af="AUTH_FAILURE",sf="AUTH_REQUEST_DONE",lf="USE_OPEN_AUTHORING",cf="LOGOUT";function uf(){return{type:nf}}function ff(e){return{type:of,payload:e}}function pf(e){return{type:af,error:"Failed to authenticate",payload:e}}function df(){return{type:lf}}function hf(){return(e,t)=>{const r=t(),n=rf(r.config);Promise.resolve(n.logout()).then((()=>{e({type:cf}),e({type:Zi})}))}}const gf=Gt(((e,t)=>{switch(t.type){case nf:e.isFetching=!0;break;case of:e.user=t.payload;break;case af:e.error=t.payload&&t.payload.toString();break;case sf:e.isFetching=!1;break;case cf:e.user=void 0,e.isFetching=!1}}),{isFetching:!1,user:void 0,error:void 0});var mf=__webpack_require__(37994),yf=__webpack_require__.n(mf);function vf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vf(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const wf={isFetching:!1,term:"",collections:[],page:0,entryIds:[],queryHits:{},error:void 0,requests:[]},_f=Gt(((e,t)=>{switch(t.type){case Bi:return wf;case Ii:{const{page:r,searchTerm:n,searchCollections:o}=t.payload;e.isFetching=!0,e.term=n,e.collections=o,e.page=r;break}case Di:{const{entries:r,page:n}=t.payload,o=r.map((e=>({collection:e.collection,slug:e.slug})));e.isFetching=!1,e.page=n,e.entryIds=!n||isNaN(n)||0===n?o:e.entryIds.concat(o);break}case Li:{const{error:r}=t.payload;e.isFetching=!1,e.error=r;break}case Ni:{const{searchTerm:r,request:n}=t.payload;e.isFetching=!0,e.term=r,n&&e.requests.push(n);break}case Ui:e.requests=e.requests.filter((e=>e.expires>=new Date));break;case $i:{const{namespace:r,hits:n}=t.payload;e.isFetching=!1,e.queryHits[r]=n;break}case Fi:{const{error:r}=t.payload;e.isFetching=!1,e.error=r}}}),wf),Sf=_f;function xf(e){return Object.values(e).some((e=>e.isLoading))}const Of=Gt(((e,t)=>{switch(t.type){case Ha:t.payload.forEach((t=>{e[t.path]={asset:t,isLoading:!1,error:null}}));break;case Va:{const r=t.payload;e[r.path]={asset:r,isLoading:!1,error:null};break}case Ga:{const r=t.payload;delete e[r];break}case Ka:{const{path:r}=t.payload;e[r]=e[r]||{},e[r].isLoading=!0;break}case Ya:{const{path:r}=t.payload;e[r]=e[r]||{},e[r].isLoading=!1,e[r].error=null;break}case Ja:{const{path:r,error:n}=t.payload;e[r]=e[r]||{},e[r].isLoading=!1,e[r].error=n}}}),{}),Ef="DEPLOY_PREVIEW_REQUEST",kf="DEPLOY_PREVIEW_SUCCESS",Cf="DEPLOY_PREVIEW_FAILURE";function Tf(e,t){return{type:Cf,payload:{collection:e,slug:t}}}const Pf=Gt(((e,t)=>{switch(t.type){case Ef:{const{collection:r,slug:n}=t.payload,o=`${r}.${n}`;e[o]=e[o]||{},e[o].isFetching=!0;break}case kf:{const{collection:r,slug:n,url:o,status:i}=t.payload,a=`${r}.${n}`;e[a].isFetching=!1,e[a].url=o,e[a].status=i;break}case Cf:{const{collection:r,slug:n}=t.payload;e[`${r}.${n}`].isFetching=!1;break}}}),{}),jf=Pf,Rf=["DEPLOY_PREVIEW","STATUS_REQUEST","STATUS_SUCCESS","STATUS_FAILURE"];function Mf(e){return Rf.some((t=>e.type.includes(t)))}const Af=Gt(((e,t)=>{!Mf(t)&&t.type.includes("REQUEST")?e.isFetching=!0:Mf(t)||!t.type.includes("SUCCESS")&&!t.type.includes("FAILURE")?t.type===lf&&(e.useOpenAuthoring=!0):e.isFetching=!1}),{isFetching:!1,useOpenAuthoring:!1}),If="STATUS_REQUEST",Df="STATUS_SUCCESS",Lf="STATUS_FAILURE";function Nf(e){return{type:Df,payload:{status:e}}}const $f=Gt(((e,t)=>{switch(t.type){case If:e.isFetching=!0;break;case Df:e.isFetching=!1,e.status=t.payload.status;break;case Lf:e.isFetching=!1,e.error=t.payload.error}}),{isFetching:!1,status:{auth:{status:!0},api:{status:!0,statusPage:""}},error:void 0});function Ff(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Bf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ff(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ff(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Uf=Gt(((e,t)=>{switch(t.type){case Zi:e.notifications=[];break;case Xi:e.notifications=e.notifications.filter((e=>e.id!==t.id));break;case Qi:e.notifications=[...e.notifications,Bf({id:ho()},t.payload)]}}),{notifications:[]}),zf={auth:gf,config:$u,collections:function(e=dc,t){if(t.type===vu){const e=t.payload.collections;let r=(0,Qe.OrderedMap)({});return e.forEach((e=>{r=r.set(e.name,(0,Qe.fromJS)(e))})),r}return e},search:Sf,integrations:function(e=pu,t){return t.type===vu?fu(t.payload):e},entries:function(e=(0,Qe.Map)({entities:(0,Qe.Map)(),pages:(0,Qe.Map)(),sort:ql(),viewStyle:Hl()}),t){switch(t.type){case Ls:{const r=t.payload;return e.setIn(["entities",`${r.collection}.${r.slug}`,"isFetching"],!0)}case Ns:{const r=t.payload;return Ll=r.collection,Bl=r.entry.slug,e.withMutations((e=>{e.setIn(["entities",`${Ll}.${Bl}`],(0,Qe.fromJS)(r.entry));const t=e.getIn(["pages",Ll,"ids"],(0,Qe.List)());t.includes(Bl)||e.setIn(["pages",Ll,"ids"],t.unshift(Bl))}))}case Fs:{const r=t.payload,n=e.withMutations((e=>{e.setIn(["pages",r.collection,"isFetching"],!0)}));return n}case Bs:{const r=t.payload;return Ll=r.collection,Nl=r.entries,$l=r.append,Fl=r.page,e.withMutations((e=>{Nl.forEach((t=>e.setIn(["entities",`${Ll}.${t.slug}`],(0,Qe.fromJS)(t).set("isFetching",!1))));const t=(0,Qe.List)(Nl.map((e=>e.slug)));e.setIn(["pages",Ll],(0,Qe.Map)({page:Fl,ids:$l?e.getIn(["pages",Ll,"ids"],(0,Qe.List)()).concat(t):t}))}))}case Us:return e.setIn(["pages",t.meta.collection,"isFetching"],!1);case $s:{const r=t.payload;return e.withMutations((e=>{e.setIn(["entities",`${r.collection}.${r.slug}`,"isFetching"],!1),e.setIn(["entities",`${r.collection}.${r.slug}`,"error"],r.error.message)}))}case Di:{const r=t.payload;return Nl=r.entries,e.withMutations((e=>{Nl.forEach((t=>e.setIn(["entities",`${t.collection}.${t.slug}`],(0,Qe.fromJS)(t).set("isFetching",!1))))}))}case cl:{const r=t.payload;return e.withMutations((e=>{e.deleteIn(["entities",`${r.collectionName}.${r.entrySlug}`]),e.updateIn(["pages",r.collectionName,"ids"],(e=>e.filter((e=>e!==r.entrySlug))))}))}case zs:{const r=t.payload,{collection:n,key:o,direction:i}=r,a=e.withMutations((e=>{const t=(0,Qe.OrderedMap)({[o]:(0,Qe.Map)({key:o,direction:i})});e.setIn(["sort",n],t),e.setIn(["pages",n,"isFetching"],!0),e.deleteIn(["pages",n,"page"])}));return Wl(a.get("sort")),a}case Ys:case Vs:case qs:{const r=t.payload,{collection:n,entries:o}=r;Nl=o;const i=e.withMutations((e=>{Nl.forEach((t=>e.setIn(["entities",`${t.collection}.${t.slug}`],(0,Qe.fromJS)(t).set("isFetching",!1)))),e.setIn(["pages",n,"isFetching"],!1);const t=(0,Qe.List)(Nl.map((e=>e.slug)));e.setIn(["pages",n],(0,Qe.Map)({page:1,ids:t}))}));return i}case Ws:{const r=t.payload,{collection:n,key:o}=r,i=e.withMutations((e=>{e.deleteIn(["sort",n,o]),e.setIn(["pages",n,"isFetching"],!1)}));return Wl(i.get("sort")),i}case Hs:{const r=t.payload,{collection:n,filter:o}=r,i=e.withMutations((e=>{const t=e.getIn(["filter",n,o.id],(0,Qe.fromJS)(o));e.setIn(["filter",n,t.get("id")],t.set("active",!t.get("active")))}));return i}case Gs:{const r=t.payload,{collection:n,filter:o}=r,i=e.withMutations((e=>{e.deleteIn(["filter",n,o.id]),e.setIn(["pages",n,"isFetching"],!1)}));return i}case Ks:{const r=t.payload,{collection:n,group:o}=r,i=e.withMutations((e=>{const t=e.getIn(["group",n,o.id],(0,Qe.fromJS)(o));e.deleteIn(["group",n]),e.setIn(["group",n,t.get("id")],t.set("active",!t.get("active")))}));return i}case Js:{const r=t.payload,{collection:n,group:o}=r,i=e.withMutations((e=>{e.deleteIn(["group",n,o.id]),e.setIn(["pages",n,"isFetching"],!1)}));return i}case pl:{const n=t.payload,{style:o}=n,i=e.withMutations((e=>{e.setIn(["viewStyle"],o)}));return(r=i.get("viewStyle"))?localStorage.setItem(zl,r):localStorage.removeItem(zl),i}default:return e}var r},cursors:function(e=(0,Qe.fromJS)({cursorsByType:{collectionEntries:{}}}),t){switch(t.type){case Bs:return e.setIn(["cursorsByType","collectionEntries",t.payload.collection],pr.Cursor.create(t.payload.cursor).store);case Vs:case Ys:case qs:return e.deleteIn(["cursorsByType","collectionEntries",t.payload.collection]);default:return e}},editorialWorkflow:function(e=(0,Qe.Map)(),t){switch(t.type){case vu:return(t.payload&&t.payload.publish_mode)===Zn?(0,Qe.Map)({entities:(0,Qe.Map)(),pages:(0,Qe.Map)()}):e;case ss:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isFetching"],!0);case cs:return e.deleteIn(["entities",`${t.payload.collection}.${t.payload.slug}`]);case ls:return e.setIn(["entities",`${t.payload.collection}.${t.payload.entry.slug}`],(0,Qe.fromJS)(t.payload.entry));case us:return e.setIn(["pages","isFetching"],!0);case fs:return e.withMutations((e=>{t.payload.entries.forEach((t=>e.setIn(["entities",`${t.collection}.${t.slug}`],(0,Qe.fromJS)(t).set("isFetching",!1)))),e.set("pages",(0,Qe.Map)(bf(bf({},t.payload.pages),{},{ids:(0,Qe.List)(t.payload.entries.map((e=>e.slug)))})))}));case ds:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isPersisting"],!0);case hs:return e.withMutations((e=>{e.setIn(["entities",`${t.payload.collection}.${t.payload.entry.get("slug")}`],(0,Qe.fromJS)(t.payload.entry)),e.deleteIn(["entities",`${t.payload.collection}.${t.payload.entry.get("slug")}`,"isPersisting"]),e.updateIn(["pages","ids"],(0,Qe.List)(),(e=>e.push(t.payload.entry.get("slug"))))}));case gs:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isPersisting"],!1);case ms:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isUpdatingStatus"],!0);case ys:return e.withMutations((e=>{e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"status"],t.payload.newStatus),e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isUpdatingStatus"],!1)}));case vs:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isUpdatingStatus"],!1);case bs:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isPublishing"],!0);case ws:case Ss:return e.deleteIn(["entities",`${t.payload.collection}.${t.payload.slug}`]);default:return e}},entryDraft:function(e=(0,Qe.Map)(),t){switch(t.type){case Qs:return e.withMutations((e=>{e.set("entry",(0,Qe.fromJS)(t.payload.entry)),e.setIn(["entry","newRecord"],!1),e.set("fieldsMetaData",(0,Qe.Map)()),e.set("fieldsErrors",(0,Qe.Map)()),e.set("hasChanged",!1),e.set("key",ho())}));case Xs:return e.withMutations((e=>{e.set("entry",(0,Qe.fromJS)(t.payload)),e.setIn(["entry","newRecord"],!0),e.set("fieldsMetaData",(0,Qe.Map)()),e.set("fieldsErrors",(0,Qe.Map)()),e.set("hasChanged",!1),e.set("key",ho())}));case ol:return e.withMutations((e=>{const t=e.get("localBackup").get("entry");e.delete("localBackup"),e.set("entry",t),e.setIn(["entry","newRecord"],!t.get("path")),e.set("fieldsMetaData",(0,Qe.Map)()),e.set("fieldsErrors",(0,Qe.Map)()),e.set("hasChanged",!0),e.set("key",ho())}));case il:return e.withMutations((e=>{e.set("entry",(0,Qe.fromJS)(t.payload)),e.setIn(["entry","newRecord"],!0),e.set("mediaFiles",(0,Qe.List)()),e.set("fieldsMetaData",(0,Qe.Map)()),e.set("fieldsErrors",(0,Qe.Map)()),e.set("hasChanged",!0)}));case Zs:return Ms;case nl:{const{entry:r}=t.payload,n=new Qe.Map({entry:(0,Qe.fromJS)(r)});return e.set("localBackup",n)}case el:return e.withMutations((e=>{const{field:r,value:n,metadata:o,entries:i,i18n:a}=t.payload,s=r.get("name"),l=r.get("meta"),c=a&&zc(a.currentLocale,a.defaultLocale)||["data"];l?e.setIn(["entry","meta",s],n):(e.setIn(["entry",...c,s],n),a&&(e=Jc(e,r,a.locales,a.defaultLocale))),e.mergeDeepIn(["fieldsMetaData"],(0,Qe.fromJS)(o));const u=e.getIn(["entry",...c]),f=e.getIn(["entry","meta"]);e.set("hasChanged",!i.some((e=>u.equals(e.get(...c))))||!i.some((e=>f.equals(e.get("meta")))))}));case tl:return 0===t.payload.errors.length?e.deleteIn(["fieldsErrors",t.payload.uniquefieldId]):e.setIn(["fieldsErrors",t.payload.uniquefieldId],t.payload.errors);case rl:return e.set("fieldsErrors",(0,Qe.Map)());case al:case ds:return e.setIn(["entry","isPersisting"],!0);case ll:case gs:return e.deleteIn(["entry","isPersisting"]);case ms:return e.setIn(["entry","isUpdatingStatus"],!0);case vs:case ys:return e.deleteIn(["entry","isUpdatingStatus"]);case bs:return e.setIn(["entry","isPublishing"],!0);case ws:case _s:return e.deleteIn(["entry","isPublishing"]);case sl:case hs:return e.withMutations((e=>{e.deleteIn(["entry","isPersisting"]),e.set("hasChanged",!1),e.getIn(["entry","slug"])||e.setIn(["entry","slug"],t.payload.slug)}));case cl:return e.withMutations((e=>{e.deleteIn(["entry","isPersisting"]),e.set("hasChanged",!1)}));case ul:return e.withMutations((e=>{const r=e.getIn(["entry","mediaFiles"]);e.setIn(["entry","mediaFiles"],r.filterNot((e=>e.get("id")===t.payload.id)).insert(0,(0,Qe.fromJS)(t.payload))),e.set("hasChanged",!0)}));case fl:return e.withMutations((e=>{const r=e.getIn(["entry","mediaFiles"]);e.setIn(["entry","mediaFiles"],r.filterNot((e=>e.get("id")===t.payload.id))),e.set("hasChanged",!0)}));default:return e}},medias:Of,mediaLibrary:function(e=(0,Qe.Map)(za),t){switch(t.type){case aa:return e.withMutations((e=>{e.set("externalLibrary",t.payload),e.set("showMediaButton",t.payload.enableStandalone())}));case oa:{const{controlID:r,forImage:n,privateUpload:o,config:i,field:a,value:s,replaceIndex:l}=t.payload,c=i||(0,Qe.Map)();return e.get("privateUpload")!==o?(0,Qe.Map)({isVisible:!0,forImage:n,controlID:r,canInsert:!!r,privateUpload:o,config:c,controlMedia:(0,Qe.Map)(),displayURLs:(0,Qe.Map)(),field:a,value:s,replaceIndex:l}):e.withMutations((e=>{e.set("isVisible",!0),e.set("forImage",null!=n&&n),e.set("controlID",null!=r?r:""),e.set("canInsert",!!r),e.set("privateUpload",o),e.set("config",c),e.set("field",null!=a?a:""),e.set("value",""==s&&c.get("multiple")?[]:null!=s?s:""),e.set("replaceIndex",null!=l&&l)}))}case ia:return e.set("isVisible",!1);case sa:{const{mediaPath:r}=t.payload,n=e.get("controlID"),o=e.get("value");if(!Array.isArray(o))return e.withMutations((e=>{e.setIn(["controlMedia",n],r)}));const i=e.get("replaceIndex"),a=Array.isArray(r)?r:[r],s=o;return"number"==typeof i?s[i]=a[0]:s.push(...a),e.withMutations((e=>{e.setIn(["controlMedia",n],s)}))}case la:{const r=t.payload.controlID;return e.setIn(["controlMedia",r],"")}case ca:return e.withMutations((e=>{e.set("isLoading",!0),e.set("isPaginating",t.payload.page>1)}));case ua:{const{files:r=[],page:n,canPaginate:o,dynamicSearch:i,dynamicSearchQuery:a,privateUpload:s}=t.payload;if(e.get("privateUpload")!==s)return e;const l=r.map((e=>Ua(Ua({},e),{},{key:ho()})));return e.withMutations((e=>{if(e.set("isLoading",!1),e.set("isPaginating",!1),e.set("page",null!=n?n:1),e.set("hasNextPage",!!(o&&r.length>0)),e.set("dynamicSearch",null!=i&&i),e.set("dynamicSearchQuery",null!=a?a:""),e.set("dynamicSearchActive",!!a),n&&n>1){const t=e.get("files").concat(l);e.set("files",t)}else e.set("files",l)}))}case fa:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isLoading",!1);case pa:return e.set("isPersisting",!0);case da:{const{file:r,privateUpload:n}=t.payload;return e.get("privateUpload")!==n?e:e.withMutations((e=>{const t=[Ua(Ua({},r),{},{key:ho()}),...e.get("files")];e.set("files",t),e.set("isPersisting",!1)}))}case ha:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isPersisting",!1);case ga:return e.set("isDeleting",!0);case ma:{const{file:r,privateUpload:n}=t.payload,{key:o,id:i}=r;return e.get("privateUpload")!==n?e:e.withMutations((e=>{const t=e.get("files").filter((e=>o?e.key!==o:e.id!==i));e.set("files",t),e.deleteIn(["displayURLs",i]),e.set("isDeleting",!1)}))}case ya:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isDeleting",!1);case va:return e.setIn(["displayURLs",t.payload.key,"isFetching"],!0);case ba:{const r=["displayURLs",t.payload.key];return e.setIn([...r,"isFetching"],!1).setIn([...r,"url"],t.payload.url)}case wa:{const r=["displayURLs",t.payload.key];return e.setIn([...r,"isFetching"],!1).setIn([...r,"err"],t.payload.err||!0).deleteIn([...r,"url"])}default:return e}},deploys:jf,globalUI:Af,status:$f,notifications:Uf};function qf(e,t,r){return Jl(e.entries,t,r)}function Wf(e,t){return Ql(e.entries,t)}function Hf(e,t,r){return function(e,t,r){return e[`${t}.${r}`]}(e.deploys,t,r)}function Vf(e,t,r){return function(e,t,r){return e&&e.getIn(["entities",`${t}.${r}`])}(e.editorialWorkflow,t,r)}function Gf(e,t,r){return du(e.integrations,t,r)}function Kf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const Yf=(0,He.MT)((0,He.UY)(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Kf(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},zf)),(0,Ve.Uo)((0,He.md)(Ye,(({dispatch:e,getState:t})=>{let r=[];return n=>o=>{if(o.type===Je)return r.push(o),null;const i=n(o);return function(n){const o=[],i=[];for(const e of r)e.predicate(n)?o.push(e):i.push(e);r=i;for(const r of o)r.run(e,t,n)}(o),i}}))));var Jf=__webpack_require__(98537),Qf=__webpack_require__.n(Jf);function Xf(e){return Qf()({},Ln("en"),Ln(e))}function Zf(e){var t=null;return function(){return null==t&&(t=e()),t}}function ep(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function tp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var rp=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),tp(this,"entered",[]),tp(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}var t,r;return t=e,r=[{key:"enter",value:function(e){var t=this,r=this.entered.length;return this.entered=function(e,t){var r=new Set,n=function(e){return r.add(e)};e.forEach(n),t.forEach(n);var o=[];return r.forEach((function(e){return o.push(e)})),o}(this.entered.filter((function(r){return t.isNodeInDocument(r)&&(!r.contains||r.contains(e))})),[e]),0===r&&this.entered.length>0}},{key:"leave",value:function(e){var t,r,n=this.entered.length;return this.entered=(t=this.entered.filter(this.isNodeInDocument),r=e,t.filter((function(e){return e!==r}))),n>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}],r&&ep(t.prototype,r),e}(),np=Zf((function(){return/firefox/i.test(navigator.userAgent)})),op=Zf((function(){return Boolean(window.safari)}));function ip(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ap(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var sp=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ap(this,"xs",void 0),ap(this,"ys",void 0),ap(this,"c1s",void 0),ap(this,"c2s",void 0),ap(this,"c3s",void 0);for(var n=t.length,o=[],i=0;i<n;i++)o.push(i);o.sort((function(e,r){return t[e]<t[r]?-1:1}));for(var a,s,l=[],c=[],u=[],f=0;f<n-1;f++)a=t[f+1]-t[f],s=r[f+1]-r[f],c.push(a),l.push(s),u.push(s/a);for(var p=[u[0]],d=0;d<c.length-1;d++){var h=u[d],g=u[d+1];if(h*g<=0)p.push(0);else{a=c[d];var m=c[d+1],y=a+m;p.push(3*y/((y+m)/h+(y+a)/g))}}p.push(u[u.length-1]);for(var v,b=[],w=[],_=0;_<p.length-1;_++){v=u[_];var S=p[_],x=1/c[_],O=S+p[_+1]-v-v;b.push((v-S-O)*x),w.push(O*x*x)}this.xs=t,this.ys=r,this.c1s=p,this.c2s=b,this.c3s=w}var t,r;return t=e,r=[{key:"interpolate",value:function(e){var t=this.xs,r=this.ys,n=this.c1s,o=this.c2s,i=this.c3s,a=t.length-1;if(e===t[a])return r[a];for(var s,l=0,c=i.length-1;l<=c;){var u=t[s=Math.floor(.5*(l+c))];if(u<e)l=s+1;else{if(!(u>e))return r[s];c=s-1}}var f=e-t[a=Math.max(0,c)],p=f*f;return r[a]+n[a]*f+o[a]*p+i[a]*f*p}}],r&&ip(t.prototype,r),e}(),lp=1;function cp(e){var t=e.nodeType===lp?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top;return{x:r.left,y:n}}function up(e){return{x:e.clientX,y:e.clientY}}var fp,pp="__NATIVE_FILE__",dp="__NATIVE_URL__",hp="__NATIVE_TEXT__",gp="__NATIVE_HTML__";function mp(e,t,r){var n=t.reduce((function(t,r){return t||e.getData(r)}),"");return null!=n?n:r}function yp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var vp=(yp(fp={},pp,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items},dataTransfer:function(e){return e}},matchesTypes:["Files"]}),yp(fp,gp,{exposeProperties:{html:function(e,t){return mp(e,t,"")},dataTransfer:function(e){return e}},matchesTypes:["Html","text/html"]}),yp(fp,dp,{exposeProperties:{urls:function(e,t){return mp(e,t,"").split("\n")},dataTransfer:function(e){return e}},matchesTypes:["Url","text/uri-list"]}),yp(fp,hp,{exposeProperties:{text:function(e,t){return mp(e,t,"")},dataTransfer:function(e){return e}},matchesTypes:["Text","text/plain"]}),fp);function bp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function wp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),wp(this,"item",void 0),wp(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}var t,r;return t=e,(r=[{key:"initializeExposedProperties",value:function(){var e=this;Object.keys(this.config.exposeProperties).forEach((function(t){Object.defineProperty(e.item,t,{configurable:!0,enumerable:!0,get:function(){return console.warn("Browser doesn't allow reading \"".concat(t,'" until the drop event.')),null}})}))}},{key:"loadDataTransfer",value:function(e){var t=this;if(e){var r={};Object.keys(this.config.exposeProperties).forEach((function(n){r[n]={value:t.config.exposeProperties[n](e,t.config.matchesTypes),configurable:!0,enumerable:!0}})),Object.defineProperties(this.item,r)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,t){return t===e.getSourceId()}},{key:"endDrag",value:function(){}}])&&bp(t.prototype,r),e}();function Sp(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(vp).filter((function(e){return vp[e].matchesTypes.some((function(e){return t.indexOf(e)>-1}))}))[0]||null}function xp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Op(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ep=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Op(this,"ownerDocument",null),Op(this,"globalContext",void 0),Op(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=r}var t,r;return t=e,(r=[{key:"window",get:function(){return this.globalContext?this.globalContext:"undefined"!=typeof window?window:void 0}},{key:"document",get:function(){var e;return null!==(e=this.globalContext)&&void 0!==e&&e.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var e;return(null===(e=this.optionsArgs)||void 0===e?void 0:e.rootElement)||this.window}}])&&xp(t.prototype,r),e}();function kp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kp(Object(r),!0).forEach((function(t){Pp(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Tp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Pp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var jp=function(){function t(e,r,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Pp(this,"options",void 0),Pp(this,"actions",void 0),Pp(this,"monitor",void 0),Pp(this,"registry",void 0),Pp(this,"enterLeaveCounter",void 0),Pp(this,"sourcePreviewNodes",new Map),Pp(this,"sourcePreviewNodeOptions",new Map),Pp(this,"sourceNodes",new Map),Pp(this,"sourceNodeOptions",new Map),Pp(this,"dragStartSourceIds",null),Pp(this,"dropTargetIds",[]),Pp(this,"dragEnterTargetIds",[]),Pp(this,"currentNativeSource",null),Pp(this,"currentNativeHandle",null),Pp(this,"currentDragSourceNode",null),Pp(this,"altKeyPressed",!1),Pp(this,"mouseMoveTimeoutTimer",null),Pp(this,"asyncEndDragFrameId",null),Pp(this,"dragOverTargetIds",null),Pp(this,"lastClientOffset",null),Pp(this,"hoverRafId",null),Pp(this,"getSourceClientOffset",(function(e){var t=o.sourceNodes.get(e);return t&&cp(t)||null})),Pp(this,"endDragNativeItem",(function(){o.isDraggingNativeItem()&&(o.actions.endDrag(),o.currentNativeHandle&&o.registry.removeSource(o.currentNativeHandle),o.currentNativeHandle=null,o.currentNativeSource=null)})),Pp(this,"isNodeInDocument",(function(e){return Boolean(e&&o.document&&o.document.body&&o.document.body.contains(e))})),Pp(this,"endDragIfSourceWasRemovedFromDOM",(function(){var e=o.currentDragSourceNode;null==e||o.isNodeInDocument(e)||o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()})),Pp(this,"handleTopDragStartCapture",(function(){o.clearCurrentDragSourceNode(),o.dragStartSourceIds=[]})),Pp(this,"handleTopDragStart",(function(e){if(!e.defaultPrevented){var t=o.dragStartSourceIds;o.dragStartSourceIds=null;var r=up(e);o.monitor.isDragging()&&o.actions.endDrag(),o.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:o.getSourceClientOffset,clientOffset:r});var n=e.dataTransfer,i=Sp(n);if(o.monitor.isDragging()){if(n&&"function"==typeof n.setDragImage){var a=o.monitor.getSourceId(),s=o.sourceNodes.get(a),l=o.sourcePreviewNodes.get(a)||s;if(l){var c=o.getCurrentSourcePreviewNodeOptions(),u=function(e,t,r,n,o){var i,a,s="IMG"===(i=t).nodeName&&(np()||!(null!==(a=document.documentElement)&&void 0!==a&&a.contains(i))),l=cp(s?e:t),c={x:r.x-l.x,y:r.y-l.y},u=e.offsetWidth,f=e.offsetHeight,p=n.anchorX,d=n.anchorY,h=function(e,t,r,n){var o=e?t.width:r,i=e?t.height:n;return op()&&e&&(i/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:i}}(s,t,u,f),g=h.dragPreviewWidth,m=h.dragPreviewHeight,y=o.offsetX,v=o.offsetY,b=0===v||v;return{x:0===y||y?y:new sp([0,.5,1],[c.x,c.x/u*g,c.x+g-u]).interpolate(p),y:b?v:function(){var e=new sp([0,.5,1],[c.y,c.y/f*m,c.y+m-f]).interpolate(d);return op()&&s&&(e+=(window.devicePixelRatio-1)*m),e}()}}(s,l,r,{anchorX:c.anchorX,anchorY:c.anchorY},{offsetX:c.offsetX,offsetY:c.offsetY});n.setDragImage(l,u.x,u.y)}}try{null==n||n.setData("application/json",{})}catch(e){}o.setCurrentDragSourceNode(e.target),o.getCurrentSourcePreviewNodeOptions().captureDraggingState?o.actions.publishDragSource():setTimeout((function(){return o.actions.publishDragSource()}),0)}else if(i)o.beginDragNativeItem(i);else{if(n&&!n.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute("draggable")))return;e.preventDefault()}}})),Pp(this,"handleTopDragEndCapture",(function(){o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()})),Pp(this,"handleTopDragEnterCapture",(function(e){if(o.dragEnterTargetIds=[],o.enterLeaveCounter.enter(e.target)&&!o.monitor.isDragging()){var t=e.dataTransfer,r=Sp(t);r&&o.beginDragNativeItem(r,t)}})),Pp(this,"handleTopDragEnter",(function(e){var t=o.dragEnterTargetIds;o.dragEnterTargetIds=[],o.monitor.isDragging()&&(o.altKeyPressed=e.altKey,t.length>0&&o.actions.hover(t,{clientOffset:up(e)}),t.some((function(e){return o.monitor.canDropOnTarget(e)}))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=o.getCurrentDropEffect())))})),Pp(this,"handleTopDragOverCapture",(function(){o.dragOverTargetIds=[]})),Pp(this,"handleTopDragOver",(function(e){var t=o.dragOverTargetIds;if(o.dragOverTargetIds=[],!o.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer&&(e.dataTransfer.dropEffect="none"));o.altKeyPressed=e.altKey,o.lastClientOffset=up(e),null===o.hoverRafId&&"undefined"!=typeof requestAnimationFrame&&(o.hoverRafId=requestAnimationFrame((function(){o.monitor.isDragging()&&o.actions.hover(t||[],{clientOffset:o.lastClientOffset}),o.hoverRafId=null}))),(t||[]).some((function(e){return o.monitor.canDropOnTarget(e)}))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=o.getCurrentDropEffect())):o.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"))})),Pp(this,"handleTopDragLeaveCapture",(function(e){o.isDraggingNativeItem()&&e.preventDefault(),o.enterLeaveCounter.leave(e.target)&&o.isDraggingNativeItem()&&setTimeout((function(){return o.endDragNativeItem()}),0)})),Pp(this,"handleTopDropCapture",(function(e){var t;o.dropTargetIds=[],o.isDraggingNativeItem()?(e.preventDefault(),null===(t=o.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)):Sp(e.dataTransfer)&&e.preventDefault(),o.enterLeaveCounter.reset()})),Pp(this,"handleTopDrop",(function(e){var t=o.dropTargetIds;o.dropTargetIds=[],o.actions.hover(t,{clientOffset:up(e)}),o.actions.drop({dropEffect:o.getCurrentDropEffect()}),o.isDraggingNativeItem()?o.endDragNativeItem():o.monitor.isDragging()&&o.actions.endDrag()})),Pp(this,"handleSelectStart",(function(e){var t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))})),this.options=new Ep(r,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new rp(this.isNodeInDocument)}var r,n;return r=t,(n=[{key:"profile",value:function(){var e,t;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:(null===(e=this.dragStartSourceIds)||void 0===e?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:(null===(t=this.dragOverTargetIds)||void 0===t?void 0:t.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var e=this.rootElement;if(void 0!==e){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}},{key:"teardown",value:function(){var e,t=this.rootElement;void 0!==t&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&(null===(e=this.window)||void 0===e||e.cancelAnimationFrame(this.asyncEndDragFrameId)))}},{key:"connectDragPreview",value:function(e,t,r){var n=this;return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,t),function(){n.sourcePreviewNodes.delete(e),n.sourcePreviewNodeOptions.delete(e)}}},{key:"connectDragSource",value:function(e,t,r){var n=this;this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,r);var o=function(t){return n.handleDragStart(t,e)},i=function(e){return n.handleSelectStart(e)};return t.setAttribute("draggable","true"),t.addEventListener("dragstart",o),t.addEventListener("selectstart",i),function(){n.sourceNodes.delete(e),n.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",o),t.removeEventListener("selectstart",i),t.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(e,t){var r=this,n=function(t){return r.handleDragEnter(t,e)},o=function(t){return r.handleDragOver(t,e)},i=function(t){return r.handleDrop(t,e)};return t.addEventListener("dragenter",n),t.addEventListener("dragover",o),t.addEventListener("drop",i),function(){t.removeEventListener("dragenter",n),t.removeEventListener("dragover",o),t.removeEventListener("drop",i)}}},{key:"addEventListeners",value:function(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return Cp({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId();return Cp({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}},{key:"isDraggingNativeItem",value:function(){var t=this.monitor.getItemType();return Object.keys(e).some((function(r){return e[r]===t}))}},{key:"beginDragNativeItem",value:function(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(e,t){var r=new _p(vp[e]);return r.loadDataTransfer(t),r}(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(e){var t=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout((function(){var e;return null===(e=t.rootElement)||void 0===e?void 0:e.addEventListener("mousemove",t.endDragIfSourceWasRemovedFromDOM,!0)}),1e3)}},{key:"clearCurrentDragSourceNode",value:function(){var e;return!!this.currentDragSourceNode&&(this.currentDragSourceNode=null,this.rootElement&&(null===(e=this.window)||void 0===e||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0)}},{key:"handleDragStart",value:function(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}},{key:"handleDragEnter",value:function(e,t){this.dragEnterTargetIds.unshift(t)}},{key:"handleDragOver",value:function(e,t){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}},{key:"handleDrop",value:function(e,t){this.dropTargetIds.unshift(t)}}])&&Tp(r.prototype,n),t}(),Rp=function(e,t,r){return new jp(e,t,r)};function Mp(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];if(!e){var i;if(void 0===t)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;(i=new Error(t.replace(/%s/g,(function(){return n[a++]})))).name="Invariant Violation"}throw i.framesToPop=1,i}}function Ap(e,t,r){var n=r.getRegistry(),o=n.addTarget(e,t);return[o,function(){return n.removeTarget(o)}]}function Ip(e,t,r){var n=r.getRegistry(),o=n.addSource(e,t);return[o,function(){return n.removeSource(o)}]}function Dp(e){var r={};return Object.keys(e).forEach((function(n){var o=e[n];if(n.endsWith("Ref"))r[n]=e[n];else{var i=function(e){return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!(0,t.isValidElement)(r)){var o=r;return e(o,n),o}var i=r;!function(e){if("string"!=typeof e.type){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}(i);var a=n?function(t){return e(t,n)}:e;return function(e,r){var n=e.ref;return Mp("string"!=typeof n,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?(0,t.cloneElement)(e,{ref:function(e){Lp(n,e),Lp(r,e)}}):(0,t.cloneElement)(e,{ref:r})}(i,a)}}(o);r[n]=function(){return i}}})),r}function Lp(e,t){"function"==typeof e?e(t):e.current=t}function Np(e){return Np="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Np(e)}function $p(e){return null!==e&&"object"===Np(e)&&Object.prototype.hasOwnProperty.call(e,"current")}function Fp(e,t,r,n){var o=r?r.call(n,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<i.length;l++){var c=i[l];if(!s(c))return!1;var u=e[c],f=t[c];if(!1===(o=r?r.call(n,u,f,c):void 0)||void 0===o&&u!==f)return!1}return!0}function Bp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Up(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var zp=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Up(this,"hooks",Dp({dragSource:function(e,t){r.clearDragSource(),r.dragSourceOptions=t||null,$p(e)?r.dragSourceRef=e:r.dragSourceNode=e,r.reconnectDragSource()},dragPreview:function(e,t){r.clearDragPreview(),r.dragPreviewOptions=t||null,$p(e)?r.dragPreviewRef=e:r.dragPreviewNode=e,r.reconnectDragPreview()}})),Up(this,"handlerId",null),Up(this,"dragSourceRef",null),Up(this,"dragSourceNode",void 0),Up(this,"dragSourceOptionsInternal",null),Up(this,"dragSourceUnsubscribe",void 0),Up(this,"dragPreviewRef",null),Up(this,"dragPreviewNode",void 0),Up(this,"dragPreviewOptionsInternal",null),Up(this,"dragPreviewUnsubscribe",void 0),Up(this,"lastConnectedHandlerId",null),Up(this,"lastConnectedDragSource",null),Up(this,"lastConnectedDragSourceOptions",null),Up(this,"lastConnectedDragPreview",null),Up(this,"lastConnectedDragPreviewOptions",null),Up(this,"backend",void 0),this.backend=t}var t,r;return t=e,(r=[{key:"receiveHandlerId",value:function(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(e){this.dragSourceOptionsInternal=e}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(e){this.dragPreviewOptionsInternal=e}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();t&&this.disconnectDragSource(),this.handlerId&&(e?t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)):this.lastConnectedDragSource=e)}},{key:"reconnectDragPreview",value:function(){var e=this.dragPreview,t=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();t&&this.disconnectDragPreview(),this.handlerId&&(e?t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=e,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,e,this.dragPreviewOptions)):this.lastConnectedDragPreview=e)}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!Fp(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!Fp(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}])&&Bp(t.prototype,r),e}();function qp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Wp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Hp=!1,Vp=!1,Gp=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Wp(this,"internalMonitor",void 0),Wp(this,"sourceId",null),this.internalMonitor=t.getMonitor()}var t,r;return t=e,(r=[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){Mp(!Hp,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Hp=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Hp=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;Mp(!Vp,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Vp=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Vp=!1}}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"isDraggingSource",value:function(e){return this.internalMonitor.isDraggingSource(e)}},{key:"isOverTarget",value:function(e,t){return this.internalMonitor.isOverTarget(e,t)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(e){return this.internalMonitor.subscribeToOffsetChange(e)}},{key:"canDragSource",value:function(e){return this.internalMonitor.canDragSource(e)}},{key:"canDropOnTarget",value:function(e){return this.internalMonitor.canDropOnTarget(e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}])&&qp(t.prototype,r),e}();function Kp(e){return Kp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kp(e)}function Yp(e){var t=e.current;return null==t?null:t.decoratedRef?t.decoratedRef.current:t}function Jp(e){return"function"==typeof e}function Qp(){}function Xp(e){if(!function(e){return"object"===Kp(e)&&null!==e}(e))return!1;if(null===Object.getPrototypeOf(e))return!0;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Zp(e,t){return"string"==typeof e||"symbol"===Kp(e)||!!t&&Array.isArray(e)&&e.every((function(e){return Zp(e,!1)}))}var ed=__webpack_require__(52322),td=(0,t.createContext)({dragDropManager:void 0});function rd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function od(e,t,r){return t&&nd(e.prototype,t),r&&nd(e,r),e}function id(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ad=function(){function e(t){rd(this,e),id(this,"isDisposed",!1),id(this,"action",void 0),this.action=Jp(t)?t:Qp}return od(e,[{key:"dispose",value:function(){this.isDisposed||(this.action(),this.isDisposed=!0)}}],[{key:"isDisposable",value:function(e){return Boolean(e&&Jp(e.dispose))}},{key:"_fixup",value:function(t){return e.isDisposable(t)?t:e.empty}},{key:"create",value:function(t){return new e(t)}}]),e}();id(ad,"empty",{dispose:Qp});var sd=function(){function e(){rd(this,e),id(this,"isDisposed",!1),id(this,"disposables",void 0);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];this.disposables=r}return od(e,[{key:"add",value:function(e){this.isDisposed?e.dispose():this.disposables.push(e)}},{key:"remove",value:function(e){var t=!1;if(!this.isDisposed){var r=this.disposables.indexOf(e);-1!==r&&(t=!0,this.disposables.splice(r,1),e.dispose())}return t}},{key:"clear",value:function(){if(!this.isDisposed){for(var e=this.disposables.length,t=new Array(e),r=0;r<e;r++)t[r]=this.disposables[r];this.disposables=[];for(var n=0;n<e;n++)t[n].dispose()}}},{key:"dispose",value:function(){if(!this.isDisposed){this.isDisposed=!0;for(var e=this.disposables.length,t=new Array(e),r=0;r<e;r++)t[r]=this.disposables[r];this.disposables=[];for(var n=0;n<e;n++)t[n].dispose()}}}]),e}(),ld=function(){function e(){rd(this,e),id(this,"isDisposed",!1),id(this,"current",void 0)}return od(e,[{key:"getDisposable",value:function(){return this.current}},{key:"setDisposable",value:function(e){var t=this.isDisposed;if(!t){var r=this.current;this.current=e,r&&r.dispose()}t&&e&&e.dispose()}},{key:"dispose",value:function(){if(!this.isDisposed){this.isDisposed=!0;var e=this.current;this.current=void 0,e&&e.dispose()}}}]),e}();function cd(e){return cd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cd(e)}function ud(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function pd(e,t){return pd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},pd(e,t)}function dd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hd(e){return hd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},hd(e)}function gd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function md(e){var r=e.DecoratedComponent,n=e.createHandler,o=e.createMonitor,i=e.createConnector,a=e.registerHandler,s=e.containerDisplayName,l=e.getType,c=e.collect,u=e.options.arePropsEqual,f=void 0===u?Fp:u,p=r,d=r.displayName||r.name||"Component",h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&pd(e,t)}(m,e);var r,s,u,h,g=(u=m,h=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=hd(u);if(h){var r=hd(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===cd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return dd(e)}(this,e)});function m(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,m),gd(dd(r=g.call(this,e)),"decoratedRef",(0,t.createRef)()),gd(dd(r),"handlerId",void 0),gd(dd(r),"manager",void 0),gd(dd(r),"handlerMonitor",void 0),gd(dd(r),"handlerConnector",void 0),gd(dd(r),"handler",void 0),gd(dd(r),"disposable",void 0),gd(dd(r),"currentType",void 0),gd(dd(r),"handleChange",(function(){var e=r.getCurrentState();Fp(e,r.state)||r.setState(e)})),r.disposable=new ld,r.receiveProps(e),r.dispose(),r}return r=m,s=[{key:"getHandlerId",value:function(){return this.handlerId}},{key:"getDecoratedComponentInstance",value:function(){return Mp(this.decoratedRef.current,"In order to access an instance of the decorated component, it must either be a class component or use React.forwardRef()"),this.decoratedRef.current}},{key:"shouldComponentUpdate",value:function(e,t){return!f(e,this.props)||!Fp(t,this.state)}},{key:"componentDidMount",value:function(){this.disposable=new ld,this.currentType=void 0,this.receiveProps(this.props),this.handleChange()}},{key:"componentDidUpdate",value:function(e){f(this.props,e)||(this.receiveProps(this.props),this.handleChange())}},{key:"componentWillUnmount",value:function(){this.dispose()}},{key:"receiveProps",value:function(e){this.handler&&(this.handler.receiveProps(e),this.receiveType(l(e)))}},{key:"receiveType",value:function(e){if(this.handlerMonitor&&this.manager&&this.handlerConnector&&e!==this.currentType){this.currentType=e;var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ud(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ud(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(a(e,this.handler,this.manager),2),r=t[0],n=t[1];this.handlerId=r,this.handlerMonitor.receiveHandlerId(r),this.handlerConnector.receiveHandlerId(r);var o=this.manager.getMonitor().subscribeToStateChange(this.handleChange,{handlerIds:[r]});this.disposable.setDisposable(new sd(new ad(o),new ad(n)))}}},{key:"dispose",value:function(){this.disposable.dispose(),this.handlerConnector&&this.handlerConnector.receiveHandlerId(null)}},{key:"getCurrentState",value:function(){return this.handlerConnector?c(this.handlerConnector.hooks,this.handlerMonitor,this.props):{}}},{key:"render",value:function(){var e=this;return(0,ed.jsx)(td.Consumer,{children:function(t){var r,n,o=t.dragDropManager;return e.receiveDragDropManager(o),"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame((function(){var t;return null===(t=e.handlerConnector)||void 0===t?void 0:t.reconnect()})),(0,ed.jsx)(p,Object.assign({},e.props,e.getCurrentState(),{ref:(r=p,(n=r)&&n.prototype&&"function"==typeof n.prototype.render||function(e){var t;return"Symbol(react.forward_ref)"===(null==e||null===(t=e.$$typeof)||void 0===t?void 0:t.toString())}(r)?e.decoratedRef:null)}),void 0)}},void 0)}},{key:"receiveDragDropManager",value:function(e){void 0===this.manager&&(Mp(void 0!==e,"Could not find the drag and drop manager in the context of %s. Make sure to render a DndProvider component in your top-level component. Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#could-not-find-the-drag-and-drop-manager-in-the-context",d,d),void 0!==e&&(this.manager=e,this.handlerMonitor=o(e),this.handlerConnector=i(e.getBackend()),this.handler=n(this.handlerMonitor,this.decoratedRef)))}}],s&&fd(r.prototype,s),m}(t.Component);return gd(h,"DecoratedComponent",r),gd(h,"displayName","".concat(s,"(").concat(d,")")),m()(h,r)}function yd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function vd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var bd=["canDrag","beginDrag","isDragging","endDrag"],wd=["beginDrag"],_d=function(){function e(t,r,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),vd(this,"props",null),vd(this,"spec",void 0),vd(this,"monitor",void 0),vd(this,"ref",void 0),vd(this,"beginDrag",(function(){if(o.props)return o.spec.beginDrag(o.props,o.monitor,o.ref.current)})),this.spec=t,this.monitor=r,this.ref=n}var t,r;return t=e,(r=[{key:"receiveProps",value:function(e){this.props=e}},{key:"canDrag",value:function(){return!!this.props&&(!this.spec.canDrag||this.spec.canDrag(this.props,this.monitor))}},{key:"isDragging",value:function(e,t){return!!this.props&&(this.spec.isDragging?this.spec.isDragging(this.props,this.monitor):t===e.getSourceId())}},{key:"endDrag",value:function(){this.props&&this.spec.endDrag&&this.spec.endDrag(this.props,this.monitor,Yp(this.ref))}}])&&yd(t.prototype,r),e}();function Sd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function xd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Od=!1,Ed=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),xd(this,"internalMonitor",void 0),xd(this,"targetId",null),this.internalMonitor=t.getMonitor()}var t,r;return t=e,(r=[{key:"receiveHandlerId",value:function(e){this.targetId=e}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;Mp(!Od,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Od=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Od=!1}}},{key:"isOver",value:function(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}])&&Sd(t.prototype,r),e}();function kd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Cd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Td=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Cd(this,"hooks",Dp({dropTarget:function(e,t){r.clearDropTarget(),r.dropTargetOptions=t,$p(e)?r.dropTargetRef=e:r.dropTargetNode=e,r.reconnect()}})),Cd(this,"handlerId",null),Cd(this,"dropTargetRef",null),Cd(this,"dropTargetNode",void 0),Cd(this,"dropTargetOptionsInternal",null),Cd(this,"unsubscribeDropTarget",void 0),Cd(this,"lastConnectedHandlerId",null),Cd(this,"lastConnectedDropTarget",null),Cd(this,"lastConnectedDropTargetOptions",null),Cd(this,"backend",void 0),this.backend=t}var t,r;return t=e,(r=[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();var t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}},{key:"receiveHandlerId",value:function(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(e){this.dropTargetOptionsInternal=e}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!Fp(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}])&&kd(t.prototype,r),e}();function Pd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function jd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Rd=["canDrop","hover","drop"],Md=function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),jd(this,"props",null),jd(this,"spec",void 0),jd(this,"monitor",void 0),jd(this,"ref",void 0),this.spec=t,this.monitor=r,this.ref=n}var t,r;return t=e,(r=[{key:"receiveProps",value:function(e){this.props=e}},{key:"receiveMonitor",value:function(e){this.monitor=e}},{key:"canDrop",value:function(){return!this.spec.canDrop||this.spec.canDrop(this.props,this.monitor)}},{key:"hover",value:function(){this.spec.hover&&this.props&&this.spec.hover(this.props,this.monitor,Yp(this.ref))}},{key:"drop",value:function(){if(this.spec.drop)return this.spec.drop(this.props,this.monitor,this.ref.current)}}])&&Pd(t.prototype,r),e}();var Ad="dnd-core/INIT_COORDS",Id="dnd-core/BEGIN_DRAG",Dd="dnd-core/PUBLISH_DRAG_SOURCE",Ld="dnd-core/HOVER",Nd="dnd-core/DROP",$d="dnd-core/END_DRAG";function Fd(e,t){return{type:Ad,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function Bd(e){return Bd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bd(e)}function Ud(e){return"object"===Bd(e)}var zd={type:Ad,payload:{clientOffset:null,sourceClientOffset:null}};function qd(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0},n=r.publishSource,o=void 0===n||n,i=r.clientOffset,a=r.getSourceClientOffset,s=e.getMonitor(),l=e.getRegistry();e.dispatch(Fd(i)),function(e,t,r){Mp(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach((function(e){Mp(r.getSource(e),"Expected sourceIds to be registered.")}))}(t,s,l);var c=function(e,t){for(var r=null,n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}(t,s);if(null!==c){var u=null;if(i){if(!a)throw new Error("getSourceClientOffset must be defined");!function(e){Mp("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(a),u=a(c)}e.dispatch(Fd(i,u));var f=l.getSource(c).beginDrag(s,c);if(null!=f){!function(e){Mp(Ud(e),"Item must be an object.")}(f),l.pinSource(c);var p=l.getSourceType(c);return{type:Id,payload:{itemType:p,item:f,sourceId:c,clientOffset:i||null,sourceClientOffset:u||null,isSourcePublic:!!o}}}}else e.dispatch(zd)}}function Wd(e){return function(){if(e.getMonitor().isDragging())return{type:Dd}}}function Hd(e,t){return null===t?null===e:Array.isArray(e)?e.some((function(e){return e===t})):e===t}function Vd(e){return function(t){var r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clientOffset;!function(e){Mp(Array.isArray(e),"Expected targetIds to be an array.")}(t);var n=t.slice(0),o=e.getMonitor(),i=e.getRegistry();return function(e,t,r){Mp(t.isDragging(),"Cannot call hover while not dragging."),Mp(!t.didDrop(),"Cannot call hover after drop.");for(var n=0;n<e.length;n++){var o=e[n];Mp(e.lastIndexOf(o)===n,"Expected targetIds to be unique in the passed array."),Mp(r.getTarget(o),"Expected targetIds to be registered.")}}(n,o,i),function(e,t,r){for(var n=e.length-1;n>=0;n--){var o=e[n];Hd(t.getTargetType(o),r)||e.splice(n,1)}}(n,i,o.getItemType()),function(e,t,r){e.forEach((function(e){r.getTarget(e).hover(t,e)}))}(n,o,i),{type:Ld,payload:{targetIds:n,clientOffset:r||null}}}}function Gd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Kd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gd(Object(r),!0).forEach((function(t){Yd(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Yd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jd(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.getMonitor(),n=e.getRegistry();!function(e){Mp(e.isDragging(),"Cannot call drop while not dragging."),Mp(!e.didDrop(),"Cannot call drop twice during one drag operation.")}(r);var o=function(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}(r);o.forEach((function(o,i){var a=function(e,t,r,n){var o=r.getTarget(e),i=o?o.drop(n,e):void 0;return function(e){Mp(void 0===e||Ud(e),"Drop result must either be an object or undefined.")}(i),void 0===i&&(i=0===t?{}:n.getDropResult()),i}(o,i,n,r),s={type:Nd,payload:{dropResult:Kd(Kd({},t),a)}};e.dispatch(s)}))}}function Qd(e){return function(){var t=e.getMonitor(),r=e.getRegistry();!function(e){Mp(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);var n=t.getSourceId();return null!=n&&(r.getSource(n,!0).endDrag(t,n),r.unpinSource()),{type:$d}}}function Xd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Zd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var eh=function(){function e(t,r){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Zd(this,"store",void 0),Zd(this,"monitor",void 0),Zd(this,"backend",void 0),Zd(this,"isSetUp",!1),Zd(this,"handleRefCountChange",(function(){var e=n.store.getState().refCount>0;n.backend&&(e&&!n.isSetUp?(n.backend.setup(),n.isSetUp=!0):!e&&n.isSetUp&&(n.backend.teardown(),n.isSetUp=!1))})),this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}var t,r;return t=e,r=[{key:"receiveBackend",value:function(e){this.backend=e}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var e=this,t=this.store.dispatch,r=function(e){return{beginDrag:qd(e),publishDragSource:Wd(e),hover:Vd(e),drop:Jd(e),endDrag:Qd(e)}}(this);return Object.keys(r).reduce((function(n,o){var i,a=r[o];return n[o]=(i=a,function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];var a=i.apply(e,n);void 0!==a&&t(a)}),n}),{})}},{key:"dispatch",value:function(e){this.store.dispatch(e)}}],r&&Xd(t.prototype,r),e}(),th=function(e,t){return e===t};function rh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rh(Object(r),!0).forEach((function(t){oh(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function oh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ih={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function ah(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ih,n=arguments.length>1?arguments[1]:void 0,o=n.payload;switch(n.type){case Ad:case Id:return{initialSourceClientOffset:o.sourceClientOffset,initialClientOffset:o.clientOffset,clientOffset:o.clientOffset};case Ld:return e=r.clientOffset,t=o.clientOffset,!e&&!t||e&&t&&e.x===t.x&&e.y===t.y?r:nh(nh({},r),{},{clientOffset:o.clientOffset});case $d:case Nd:return ih;default:return r}}var sh="dnd-core/ADD_SOURCE",lh="dnd-core/ADD_TARGET",ch="dnd-core/REMOVE_SOURCE",uh="dnd-core/REMOVE_TARGET";function fh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ph(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fh(Object(r),!0).forEach((function(t){dh(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function dh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var hh={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function gh(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hh,n=arguments.length>1?arguments[1]:void 0,o=n.payload;switch(n.type){case Id:return ph(ph({},r),{},{itemType:o.itemType,item:o.item,sourceId:o.sourceId,isSourcePublic:o.isSourcePublic,dropResult:null,didDrop:!1});case Dd:return ph(ph({},r),{},{isSourcePublic:!0});case Ld:return ph(ph({},r),{},{targetIds:o.targetIds});case uh:return-1===r.targetIds.indexOf(o.targetId)?r:ph(ph({},r),{},{targetIds:(e=r.targetIds,t=o.targetId,e.filter((function(e){return e!==t})))});case Nd:return ph(ph({},r),{},{dropResult:o.dropResult,didDrop:!0,targetIds:[]});case $d:return ph(ph({},r),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return r}}function mh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case sh:case lh:return e+1;case ch:case uh:return e-1;default:return e}}var yh=[],vh=[];function bh(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Ld:break;case sh:case lh:case uh:case ch:return yh;default:return vh}var t=e.payload,r=t.targetIds,n=void 0===r?[]:r,o=t.prevTargetIds,i=void 0===o?[]:o,a=function(e,t){var r=new Map,n=function(e){r.set(e,r.has(e)?r.get(e)+1:1)};e.forEach(n),t.forEach(n);var o=[];return r.forEach((function(e,t){1===e&&o.push(t)})),o}(n,i),s=a.length>0||!function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:th;if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}(n,i);if(!s)return yh;var l=i[i.length-1],c=n[n.length-1];return l!==c&&(l&&a.push(l),c&&a.push(c)),a}function wh(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)+1}function _h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Sh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_h(Object(r),!0).forEach((function(t){xh(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Oh(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:bh(r.dirtyHandlerIds,{type:n.type,payload:Sh(Sh({},n.payload),{},{prevTargetIds:(e=r,"dragOperation.targetIds",t=[],"dragOperation.targetIds".split(".").reduce((function(e,r){return e&&e[r]?e[r]:t||null}),e))})}),dragOffset:ah(r.dragOffset,n),refCount:mh(r.refCount,n),dragOperation:gh(r.dragOperation,n),stateId:wh(r.stateId)}}function Eh(e,t){return{x:e.x-t.x,y:e.y-t.y}}function kh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ch(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}yh.__IS_NONE__=!0,vh.__IS_ALL__=!0;var Th,Ph=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ch(this,"store",void 0),Ch(this,"registry",void 0),this.store=t,this.registry=r}var t,r;return t=e,r=[{key:"subscribeToStateChange",value:function(e){var t=this,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{handlerIds:void 0}).handlerIds;Mp("function"==typeof e,"listener must be a function."),Mp(void 0===r||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");var n=this.store.getState().stateId;return this.store.subscribe((function(){var o=t.store.getState(),i=o.stateId;try{var a=i===n||i===n+1&&!function(e,t){if(e===yh)return!1;if(e===vh||void 0===t)return!0;var r,n=(r=e,t.filter((function(e){return r.indexOf(e)>-1})));return n.length>0}(o.dirtyHandlerIds,r);a||e()}finally{n=i}}))}},{key:"subscribeToOffsetChange",value:function(e){var t=this;Mp("function"==typeof e,"listener must be a function.");var r=this.store.getState().dragOffset;return this.store.subscribe((function(){var n=t.store.getState().dragOffset;n!==r&&(r=n,e())}))}},{key:"canDragSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e);return Mp(t,"Expected to find a valid source. sourceId=".concat(e)),!this.isDragging()&&t.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var t=this.registry.getTarget(e);return Mp(t,"Expected to find a valid target. targetId=".concat(e)),!(!this.isDragging()||this.didDrop())&&Hd(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}},{key:"isDragging",value:function(){return Boolean(this.getItemType())}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e,!0);return Mp(t,"Expected to find a valid source. sourceId=".concat(e)),!(!this.isDragging()||!this.isSourcePublic())&&this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e)}},{key:"isOverTarget",value:function(e){if(!e)return!1;var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1}).shallow;if(!this.isDragging())return!1;var r=this.registry.getTargetType(e),n=this.getItemType();if(n&&!Hd(r,n))return!1;var o=this.getTargetIds();if(!o.length)return!1;var i=o.indexOf(e);return t?i===o.length-1:i>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return t=(e=this.store.getState().dragOffset).clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset,t&&r&&n?Eh(function(e,t){return{x:e.x+t.x,y:e.y+t.y}}(t,n),r):null;var e,t,r,n}},{key:"getDifferenceFromInitialOffset",value:function(){return t=(e=this.store.getState().dragOffset).clientOffset,r=e.initialClientOffset,t&&r?Eh(t,r):null;var e,t,r}}],r&&kh(t.prototype,r),e}(),jh=0;function Rh(e){return Rh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rh(e)}function Mh(e,t){t&&Array.isArray(e)?e.forEach((function(e){return Mh(e,!1)})):Mp("string"==typeof e||"symbol"===Rh(e),t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}!function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"}(Th||(Th={}));const Ah="undefined"!=typeof global?global:self,Ih=Ah.MutationObserver||Ah.WebKitMutationObserver;function Dh(e){return function(){const t=setTimeout(n,0),r=setInterval(n,50);function n(){clearTimeout(t),clearInterval(r),e()}}}const Lh="function"==typeof Ih?function(e){let t=1;const r=new Ih(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}:Dh;class Nh{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}const $h=new class{enqueueTask(e){const{queue:t,requestFlush:r}=this;t.length||(r(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,r=e.length-this.index;t<r;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=Lh(this.flush),this.requestErrorThrow=Dh((()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()}))}},Fh=new class{create(e){const t=this.freeTasks,r=t.length?t.pop():new Nh(this.onError,(e=>t[t.length]=e));return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}($h.registerPendingError);function Bh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Uh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return qh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qh(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Wh(e){switch(e[0]){case"S":return Th.SOURCE;case"T":return Th.TARGET;default:Mp(!1,"Cannot parse handler ID: ".concat(e))}}function Hh(e,t){var r=e.entries(),n=!1;do{var o=r.next(),i=o.done;if(zh(o.value,2)[1]===t)return!0;n=!!i}while(!n);return!1}var Vh=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Uh(this,"types",new Map),Uh(this,"dragSources",new Map),Uh(this,"dropTargets",new Map),Uh(this,"pinnedSourceId",null),Uh(this,"pinnedSource",null),Uh(this,"store",void 0),this.store=t}var t,r;return t=e,r=[{key:"addSource",value:function(e,t){Mh(e),function(e){Mp("function"==typeof e.canDrag,"Expected canDrag to be a function."),Mp("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),Mp("function"==typeof e.endDrag,"Expected endDrag to be a function.")}(t);var r=this.addHandler(Th.SOURCE,e,t);return this.store.dispatch(function(e){return{type:sh,payload:{sourceId:e}}}(r)),r}},{key:"addTarget",value:function(e,t){Mh(e,!0),function(e){Mp("function"==typeof e.canDrop,"Expected canDrop to be a function."),Mp("function"==typeof e.hover,"Expected hover to be a function."),Mp("function"==typeof e.drop,"Expected beginDrag to be a function.")}(t);var r=this.addHandler(Th.TARGET,e,t);return this.store.dispatch(function(e){return{type:lh,payload:{targetId:e}}}(r)),r}},{key:"containsHandler",value:function(e){return Hh(this.dragSources,e)||Hh(this.dropTargets,e)}},{key:"getSource",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Mp(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}},{key:"getTarget",value:function(e){return Mp(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return Mp(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return Mp(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return Wh(e)===Th.SOURCE}},{key:"isTargetId",value:function(e){return Wh(e)===Th.TARGET}},{key:"removeSource",value:function(e){var t,r=this;Mp(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:ch,payload:{sourceId:e}}}(e)),t=function(){r.dragSources.delete(e),r.types.delete(e)},$h.enqueueTask(Fh.create(t))}},{key:"removeTarget",value:function(e){Mp(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:uh,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var t=this.getSource(e);Mp(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}},{key:"unpinSource",value:function(){Mp(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,t,r){var n=function(e){var t=(jh++).toString();switch(e){case Th.SOURCE:return"S".concat(t);case Th.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}(e);return this.types.set(n,t),e===Th.SOURCE?this.dragSources.set(n,r):e===Th.TARGET&&this.dropTargets.set(n,r),n}}],r&&Bh(t.prototype,r),e}();function Gh(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=(t=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__,(0,He.MT)(Oh,t&&r&&r({name:"dnd-core",instanceId:"dnd-core"}))),a=new Ph(i,new Vh(i)),s=new eh(i,a),l=e(s,n,o);return s.receiveBackend(l),s}var Kh=["children"];function Yh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Jh=0,Qh=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),Xh=(0,t.memo)((function(e){var r=e.children,n=function(e){if("manager"in e)return[{dragDropManager:e.manager},!1];var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zh(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,o=t;return o[Qh]||(o[Qh]={dragDropManager:Gh(e,t,r,n)}),o[Qh]}(e.backend,e.context,e.options,e.debugMode);return[t,!e.context]}(function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,Kh)),o=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Yh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Yh(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(n,2),i=o[0],a=o[1];return(0,t.useEffect)((function(){if(a){var e=Zh();return++Jh,function(){0==--Jh&&(e[Qh]=null)}}}),[]),(0,ed.jsx)(td.Provider,Object.assign({value:i},{children:r}),void 0)}));function Zh(){return void 0!==__webpack_require__.g?__webpack_require__.g:window}const eg=["namespace"],tg=["children","isDragging","connectDragComponent"],rg=["onDrop","namespace"];function ng(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function og(e){let{namespace:t}=e,n=ng(e,eg);const o=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e;"function"!=typeof e&&(Mp(Zp(e),'Expected "type" provided as the first argument to DragSource to be a string, or a function that returns a string given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',e),o=function(){return e}),Mp(Xp(t),'Expected "spec" provided as the second argument to DragSource to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',t);var i=function(e){return Object.keys(e).forEach((function(t){Mp(bd.indexOf(t)>-1,'Expected the drag source specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',bd.join(", "),t),Mp("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source",t,t,e[t])})),wd.forEach((function(t){Mp("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source",t,t,e[t])})),function(t,r){return new _d(e,t,r)}}(t);return Mp("function"==typeof r,'Expected "collect" provided as the third argument to DragSource to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',r),Mp(Xp(n),'Expected "options" provided as the fourth argument to DragSource to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',r),function(e){return md({containerDisplayName:"DragSource",createHandler:i,registerHandler:Ip,createConnector:function(e){return new zp(e)},createMonitor:function(e){return new Gp(e)},DecoratedComponent:e,getType:o,collect:r,options:n})}}(t,{beginDrag(e){let{children:t,isDragging:r,connectDragComponent:n}=e;return ng(e,tg)}},(e=>({connectDragComponent:e.dragSource()})))((({children:e,connectDragComponent:t})=>e(t)));return r().createElement(o,n,n.children)}function ig(e){let{onDrop:t,namespace:n}=e,o=ng(e,rg);const i=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e;"function"!=typeof e&&(Mp(Zp(e,!0),'Expected "type" provided as the first argument to DropTarget to be a string, an array of strings, or a function that returns either given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',e),o=function(){return e}),Mp(Xp(t),'Expected "spec" provided as the second argument to DropTarget to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',t);var i=function(e){return Object.keys(e).forEach((function(t){Mp(Rd.indexOf(t)>-1,'Expected the drop target specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',Rd.join(", "),t),Mp("function"==typeof e[t],"Expected %s in the drop target specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target",t,t,e[t])})),function(t,r){return new Md(e,t,r)}}(t);return Mp("function"==typeof r,'Expected "collect" provided as the third argument to DropTarget to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',r),Mp(Xp(n),'Expected "options" provided as the fourth argument to DropTarget to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',r),function(e){return md({containerDisplayName:"DropTarget",createHandler:i,registerHandler:Ap,createMonitor:function(e){return new Ed(e)},createConnector:function(e){return new Td(e)},DecoratedComponent:e,getType:o,collect:r,options:n})}}(n,{drop(e,r){t(r.getItem())}},((e,t)=>({connectDropTarget:e.dropTarget(),isHovered:t.isOver()})))((({children:e,connectDropTarget:t,isHovered:r})=>e(t,{isHovered:r})));return r().createElement(i,o,o.children)}function ag(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}og.propTypes={namespace:i().any.isRequired,children:i().func.isRequired},ig.propTypes={onDrop:i().func.isRequired,namespace:i().any.isRequired,children:i().func.isRequired};var sg=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,lg=ag((function(e){return sg.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),cg=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},ug={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},fg=/[A-Z]|^ms/g,pg=/_EMO_([^_]+?)_([^]*?)_EMO_/g,dg=function(e){return 45===e.charCodeAt(1)},hg=function(e){return null!=e&&"boolean"!=typeof e},gg=ag((function(e){return dg(e)?e:e.replace(fg,"-$&").toLowerCase()})),mg=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(pg,(function(e,t,r){return vg={name:t,styles:r,next:vg},t}))}return 1===ug[e]||dg(e)||"number"!=typeof t||0===t?t:t+"px"};function yg(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return vg={name:r.name,styles:r.styles,next:vg},r.name;if(void 0!==r.styles){var n=r.next;if(void 0!==n)for(;void 0!==n;)vg={name:n.name,styles:n.styles,next:vg},n=n.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=yg(e,t,r[o])+";";else for(var i in r){var a=r[i];if("object"!=typeof a)null!=t&&void 0!==t[a]?n+=i+"{"+t[a]+"}":hg(a)&&(n+=gg(i)+":"+mg(i,a)+";");else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var s=yg(e,t,a);switch(i){case"animation":case"animationName":n+=gg(i)+":"+s+";";break;default:n+=i+"{"+s+"}"}}else for(var l=0;l<a.length;l++)hg(a[l])&&(n+=gg(i)+":"+mg(i,a[l])+";")}return n}(e,t,r);case"function":if(void 0!==e){var o=vg,i=r(e);return vg=o,yg(e,t,i)}}if(null==t)return r;var a=t[r];return void 0!==a?a:r}var vg,bg=/label:\s*([^\s;\n{]+)\s*(;|$)/g,wg=!!t.useInsertionEffect&&t.useInsertionEffect,_g=wg||function(e){return e()},Sg=(wg||t.useLayoutEffect,lg),xg=function(e){return"theme"!==e},Og=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Sg:xg},Eg=function(e,t,r){var n;if(t){var o=t.shouldForwardProp;n=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof n&&r&&(n=e.__emotion_forwardProp),n},kg=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return cg(t,r,n),_g((function(){return function(e,t,r){cg(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+n:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}}(t,r,n)})),null},Cg=function e(r,n){var o,i,a=r.__emotion_real===r,s=a&&r.__emotion_base||r;void 0!==n&&(o=n.label,i=n.target);var l=Eg(r,n,a),c=l||Og(s),u=!c("as");return function(){var f=arguments,p=a&&void 0!==r.__emotion_styles?r.__emotion_styles.slice(0):[];if(void 0!==o&&p.push("label:"+o+";"),null==f[0]||void 0===f[0].raw)p.push.apply(p,f);else{p.push(f[0][0]);for(var h=f.length,g=1;g<h;g++)p.push(f[g],f[0][g])}var m=(0,xo.withEmotionCache)((function(e,r,n){var o,a,f,d,h=u&&e.as||s,g="",m=[],y=e;if(null==e.theme){for(var v in y={},e)y[v]=e[v];y.theme=t.useContext(xo.ThemeContext)}"string"==typeof e.className?(o=r.registered,a=m,f=e.className,d="",f.split(" ").forEach((function(e){void 0!==o[e]?a.push(o[e]+";"):d+=e+" "})),g=d):null!=e.className&&(g=e.className+" ");var b=function(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,o="";vg=void 0;var i=e[0];null==i||void 0===i.raw?(n=!1,o+=yg(r,t,i)):o+=i[0];for(var a=1;a<e.length;a++)o+=yg(r,t,e[a]),n&&(o+=i[a]);bg.lastIndex=0;for(var s,l="";null!==(s=bg.exec(o));)l+="-"+s[1];var c=function(e){for(var t,r=0,n=0,o=e.length;o>=4;++n,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(o){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(o)+l;return{name:c,styles:o,next:vg}}(p.concat(m),r.registered,y);g+=r.key+"-"+b.name,void 0!==i&&(g+=" "+i);var w=u&&void 0===l?Og(h):c,_={};for(var S in e)u&&"as"===S||w(S)&&(_[S]=e[S]);return _.className=g,_.ref=n,t.createElement(t.Fragment,null,t.createElement(kg,{cache:r,serialized:b,isStringTag:"string"==typeof h}),t.createElement(h,_))}));return m.displayName=void 0!==o?o:"Styled("+("string"==typeof s?s:s.displayName||s.name||"Component")+")",m.defaultProps=r.defaultProps,m.__emotion_real=m,m.__emotion_base=s,m.__emotion_styles=p,m.__emotion_forwardProp=l,Object.defineProperty(m,"toString",{value:function(){return"."+i}}),m.withComponent=function(t,r){return e(t,d({},n,r,{shouldForwardProp:Eg(m,r,!0)})).apply(void 0,p)},m}},Tg=__webpack_require__(36585),Pg=__webpack_require__.n(Tg);function jg(e,{target:t=document.body}={}){if("string"!=typeof e)throw new TypeError(`Expected parameter \`text\` to be a \`string\`, got \`${typeof e}\`.`);const r=document.createElement("textarea"),n=document.activeElement;r.value=e,r.setAttribute("readonly",""),r.style.contain="strict",r.style.position="absolute",r.style.left="-9999px",r.style.fontSize="12pt";const o=document.getSelection(),i=o.rangeCount>0&&o.getRangeAt(0);t.append(r),r.select(),r.selectionStart=0,r.selectionEnd=e.length;let a=!1;try{a=document.execCommand("copy")}catch{}return r.remove(),i&&(o.removeAllRanges(),o.addRange(i)),n&&n.focus(),a}var Rg=__webpack_require__(67129);const Mg=/\s+at.*[(\s](.*)\)?/,Ag=/^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/,Ig=void 0===Rg.homedir?"":Rg.homedir().replace(/\\/g,"/");function Dg(e,{pretty:t=!1,basePath:r}={}){const n=r&&new RegExp(`(at | \\()${function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(r.replace(/\\/g,"/"))}`,"g");if("string"==typeof e)return e.replace(/\\/g,"/").split("\n").filter((e=>{const t=e.match(Mg);if(null===t||!t[1])return!0;const r=t[1];return!(r.includes(".app/Contents/Resources/electron.asar")||r.includes(".app/Contents/Resources/default_app.asar")||r.includes("node_modules/electron/dist/resources/electron.asar")||r.includes("node_modules/electron/dist/resources/default_app.asar")||Ag.test(r))})).filter((e=>""!==e.trim())).map((e=>(n&&(e=e.replace(n,"$1")),t&&(e=e.replace(Mg,((e,t)=>e.replace(t,t.replace(Ig,"~"))))),e))).join("\n")}function Lg(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ng="https://github.com/decaporg/decap-cms/issues/new?";function $g({title:e,config:t}){try{const r=function({config:e}){let t="";"string"==typeof DECAP_CMS_VERSION?t=`decap-cms@${DECAP_CMS_VERSION}`:"string"==typeof DECAP_CMS_APP_VERSION&&(t=`decap-cms-app@${DECAP_CMS_APP_VERSION}`);const r=function({version:e,provider:t,browser:r,config:n}){return`\n**Describe the bug**\n\n**To Reproduce**\n\n**Expected behavior**\n\n**Screenshots**\n\n**Applicable Versions:**\n - Decap CMS version: \`${e}\`\n - Git provider: \`${t}\`\n - Browser version: \`${r}\`\n\n**CMS configuration**\n\`\`\`\n${n}\n\`\`\`\n\n**Additional context**\n`}({version:t,provider:e.backend.name,browser:navigator.userAgent,config:mr().stringify(e)});return r}({config:t}),n=new URLSearchParams;return n.append("title",Pg()(e,{length:100})),n.append("body",Pg()(r,{length:4e3,omission:"\n..."})),n.append("labels","type: bug"),`${Ng}${n.toString()}`}catch(e){return console.log(e),`${Ng}template=bug_report.md`}}const Fg=Cg("div",{target:"emw4gx72",label:"ErrorBoundaryContainer"})("padding:40px;h1{font-size:28px;color:",qe.colors.text,";}h2{font-size:20px;}strong{color:",qe.colors.textLead,";font-weight:500;}hr{width:200px;margin:30px 0;border:0;height:1px;background-color:",qe.colors.text,";}a{color:",qe.colors.active,";}"),Bg=Cg("span",{target:"emw4gx71",label:"PrivacyWarning"})("color:",qe.colors.text,";"),Ug=Cg("button",{target:"emw4gx70",label:"CopyButton"})(qe.buttons.button,";",qe.buttons.default,";",qe.buttons.gray,";display:block;margin:12px 0;");function zg({entry:e,t}){return console.log(e),(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)("hr",null),(0,xo.jsx)("h2",null,t("ui.errorBoundary.recoveredEntry.heading")),(0,xo.jsx)("strong",null,t("ui.errorBoundary.recoveredEntry.warning")),(0,xo.jsx)(Ug,{onClick:()=>jg(e)},t("ui.errorBoundary.recoveredEntry.copyButtonLabel")),(0,xo.jsx)("pre",null,(0,xo.jsx)("code",null,e)))}class qg extends r().Component{constructor(...e){super(...e),Lg(this,"state",{hasError:!1,errorMessage:"",errorTitle:"",backup:""})}static getDerivedStateFromError(e){return console.error(e),{hasError:!0,errorMessage:Dg(e.stack,{basePath:window.location.origin||""}),errorTitle:e.toString()}}shouldComponentUpdate(e,t){return!this.props.showBackup||this.state.errorMessage!==t.errorMessage||this.state.backup!==t.backup}async componentDidUpdate(){if(this.props.showBackup){const e=await pr.localForage.getItem("backup");e&&console.log(e),this.setState({backup:e})}}render(){const{hasError:e,errorMessage:t,backup:n,errorTitle:o}=this.state,{showBackup:i,t:a}=this.props;return e?(0,xo.jsx)(Fg,null,(0,xo.jsx)("h1",null,a("ui.errorBoundary.title")),(0,xo.jsx)("p",null,(0,xo.jsx)("span",null,a("ui.errorBoundary.details")),(0,xo.jsx)("a",{href:$g({title:o,config:this.props.config}),target:"_blank",rel:"noopener noreferrer","data-testid":"issue-url"},a("ui.errorBoundary.reportIt"))),(0,xo.jsx)("p",null,a("ui.errorBoundary.privacyWarning").split("\n").map(((e,t)=>(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(Bg,{key:t},e),(0,xo.jsx)("br",null))))),(0,xo.jsx)("hr",null),(0,xo.jsx)("h2",null,a("ui.errorBoundary.detailsHeading")),(0,xo.jsx)("p",null,t),n&&i&&(0,xo.jsx)(zg,{entry:n,t:a})):this.props.children}}Lg(qg,"propTypes",{children:i().node,t:i().func.isRequired,config:i().object.isRequired});const Wg=(0,We.Iu)()(qg);function Hg({label:e,imagesOnly:t,onChange:r,disabled:n,className:o}){return(0,xo.jsx)("label",{tabIndex:"0",className:`nc-fileUploadButton ${o||""}`},(0,xo.jsx)("span",null,e),(0,xo.jsx)("input",{type:"file",accept:t?"image/*":"*/*",onChange:r,disabled:n}))}Hg.propTypes={className:i().string,label:i().string.isRequired,imagesOnly:i().bool,onChange:i().func.isRequired,disabled:i().bool};var Vg=__webpack_require__(37149),Gg=__webpack_require__.n(Vg),Kg={name:"1o9c9d2-ReactModalGlobalStyles",styles:".ReactModal__Body--open{overflow:hidden;};label:ReactModalGlobalStyles;"};function Yg(){return(0,xo.jsx)(xo.Global,{styles:Kg})}const Jg=`\n ${qe.shadows.dropDeep};\n background-color: #fff;\n border-radius: ${qe.lengths.borderRadius};\n height: 80%;\n text-align: center;\n max-width: 2200px;\n padding: 20px;\n\n &:focus {\n outline: none;\n }\n `,Qg=`\n z-index: ${qe.zIndex.zIndex99999};\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n opacity: 0;\n background-color: rgba(0, 0, 0, 0);\n transition: background-color ${qe.transitions.main}, opacity ${qe.transitions.main};\n `;class Xg extends r().Component{componentDidMount(){Gg().setAppElement("#nc-root")}render(){const{isOpen:e,children:t,className:n,onClose:o}=this.props;return(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(Yg,null),(0,xo.jsx)(xo.ClassNames,null,(({css:r,cx:i})=>(0,xo.jsx)(Gg(),{isOpen:e,onRequestClose:o,closeTimeoutMS:300,className:{base:i(r`
18
18
  ${Jg};
19
19
  `,n),afterOpen:"",beforeClose:""},overlayClassName:{base:r`
20
20
  ${Qg};
@@ -25,15 +25,15 @@
25
25
  `}},t))))}}function Zg(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Zg(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}var em,tm,rm;em=Xg,tm="propTypes",rm={children:i().node.isRequired,isOpen:i().bool.isRequired,className:i().string,onClose:i().func.isRequired},(tm=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(tm))in em?Object.defineProperty(em,tm,{value:rm,enumerable:!0,configurable:!0,writable:!0}):em[tm]=rm;const nm=function(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Zg(e))&&(n&&(n+=" "),n+=t);return n},om=e=>"number"==typeof e&&!isNaN(e),im=e=>"string"==typeof e,am=e=>"function"==typeof e,sm=e=>im(e)||am(e)?e:null,lm=e=>(0,t.isValidElement)(e)||im(e)||am(e)||om(e);function cm(e){let{enter:r,exit:n,appendPosition:o=!1,collapse:i=!0,collapseDuration:a=300}=e;return function(e){let{children:s,position:l,preventExitTransition:c,done:u,nodeRef:f,isIn:p}=e;const d=o?`${r}--${l}`:r,h=o?`${n}--${l}`:n,g=(0,t.useRef)(0);return(0,t.useLayoutEffect)((()=>{const e=f.current,t=d.split(" "),r=n=>{n.target===f.current&&(e.dispatchEvent(new Event("d")),e.removeEventListener("animationend",r),e.removeEventListener("animationcancel",r),0===g.current&&"animationcancel"!==n.type&&e.classList.remove(...t))};e.classList.add(...t),e.addEventListener("animationend",r),e.addEventListener("animationcancel",r)}),[]),(0,t.useEffect)((()=>{const e=f.current,t=()=>{e.removeEventListener("animationend",t),i?function(e,t,r){void 0===r&&(r=300);const{scrollHeight:n,style:o}=e;requestAnimationFrame((()=>{o.minHeight="initial",o.height=n+"px",o.transition=`all ${r}ms`,requestAnimationFrame((()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,r)}))}))}(e,u,a):u()};p||(c?t():(g.current=1,e.className+=` ${h}`,e.addEventListener("animationend",t)))}),[p]),t.createElement(t.Fragment,null,s)}}function um(e,t){return null!=e?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const fm={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){const r=this.list.get(e).filter((e=>e!==t));return this.list.set(e,r),this}return this.list.delete(e),this},cancelEmit(e){const t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach((t=>{const r=setTimeout((()=>{t(...[].slice.call(arguments,1))}),0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(r)}))}},pm=e=>{let{theme:r,type:n,...o}=e;return t.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===r?"currentColor":`var(--toastify-icon-color-${n})`,...o})},dm={info:function(e){return t.createElement(pm,{...e},t.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return t.createElement(pm,{...e},t.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return t.createElement(pm,{...e},t.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return t.createElement(pm,{...e},t.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return t.createElement("div",{className:"Toastify__spinner"})}};function hm(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function gm(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function mm(e){let{closeToast:r,theme:n,ariaLabel:o="close"}=e;return t.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:e=>{e.stopPropagation(),r(e)},"aria-label":o},t.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},t.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function ym(e){let{delay:r,isRunning:n,closeToast:o,type:i="default",hide:a,className:s,style:l,controlledProgress:c,progress:u,rtl:f,isIn:p,theme:d}=e;const h=a||c&&0===u,g={...l,animationDuration:`${r}ms`,animationPlayState:n?"running":"paused",opacity:h?0:1};c&&(g.transform=`scaleX(${u})`);const m=nm("Toastify__progress-bar",c?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${d}`,`Toastify__progress-bar--${i}`,{"Toastify__progress-bar--rtl":f}),y=am(s)?s({rtl:f,type:i,defaultClassName:m}):nm(m,s);return t.createElement("div",{role:"progressbar","aria-hidden":h?"true":"false","aria-label":"notification timer",className:y,style:g,[c&&u>=1?"onTransitionEnd":"onAnimationEnd"]:c&&u<1?null:()=>{p&&o()}})}const vm=e=>{const{isRunning:r,preventExitTransition:n,toastRef:o,eventHandlers:i}=function(e){const[r,n]=(0,t.useState)(!1),[o,i]=(0,t.useState)(!1),a=(0,t.useRef)(null),s=(0,t.useRef)({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,l=(0,t.useRef)(e),{autoClose:c,pauseOnHover:u,closeToast:f,onClick:p,closeOnClick:d}=e;function h(t){if(e.draggable){"touchstart"===t.nativeEvent.type&&t.nativeEvent.preventDefault(),s.didMove=!1,document.addEventListener("mousemove",v),document.addEventListener("mouseup",b),document.addEventListener("touchmove",v),document.addEventListener("touchend",b);const r=a.current;s.canCloseOnClick=!0,s.canDrag=!0,s.boundingRect=r.getBoundingClientRect(),r.style.transition="",s.x=hm(t.nativeEvent),s.y=gm(t.nativeEvent),"x"===e.draggableDirection?(s.start=s.x,s.removalDistance=r.offsetWidth*(e.draggablePercent/100)):(s.start=s.y,s.removalDistance=r.offsetHeight*(80===e.draggablePercent?1.5*e.draggablePercent:e.draggablePercent/100))}}function g(t){if(s.boundingRect){const{top:r,bottom:n,left:o,right:i}=s.boundingRect;"touchend"!==t.nativeEvent.type&&e.pauseOnHover&&s.x>=o&&s.x<=i&&s.y>=r&&s.y<=n?y():m()}}function m(){n(!0)}function y(){n(!1)}function v(t){const n=a.current;s.canDrag&&n&&(s.didMove=!0,r&&y(),s.x=hm(t),s.y=gm(t),s.delta="x"===e.draggableDirection?s.x-s.start:s.y-s.start,s.start!==s.x&&(s.canCloseOnClick=!1),n.style.transform=`translate${e.draggableDirection}(${s.delta}px)`,n.style.opacity=""+(1-Math.abs(s.delta/s.removalDistance)))}function b(){document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",b),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",b);const t=a.current;if(s.canDrag&&s.didMove&&t){if(s.canDrag=!1,Math.abs(s.delta)>s.removalDistance)return i(!0),void e.closeToast();t.style.transition="transform 0.2s, opacity 0.2s",t.style.transform=`translate${e.draggableDirection}(0)`,t.style.opacity="1"}}(0,t.useEffect)((()=>{l.current=e})),(0,t.useEffect)((()=>(a.current&&a.current.addEventListener("d",m,{once:!0}),am(e.onOpen)&&e.onOpen((0,t.isValidElement)(e.children)&&e.children.props),()=>{const e=l.current;am(e.onClose)&&e.onClose((0,t.isValidElement)(e.children)&&e.children.props)})),[]),(0,t.useEffect)((()=>(e.pauseOnFocusLoss&&(document.hasFocus()||y(),window.addEventListener("focus",m),window.addEventListener("blur",y)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",m),window.removeEventListener("blur",y))})),[e.pauseOnFocusLoss]);const w={onMouseDown:h,onTouchStart:h,onMouseUp:g,onTouchEnd:g};return c&&u&&(w.onMouseEnter=y,w.onMouseLeave=m),d&&(w.onClick=e=>{p&&p(e),s.canCloseOnClick&&f()}),{playToast:m,pauseToast:y,isRunning:r,preventExitTransition:o,toastRef:a,eventHandlers:w}}(e),{closeButton:a,children:s,autoClose:l,onClick:c,type:u,hideProgressBar:f,closeToast:p,transition:d,position:h,className:g,style:m,bodyClassName:y,bodyStyle:v,progressClassName:b,progressStyle:w,updateId:_,role:S,progress:x,rtl:O,toastId:E,deleteToast:k,isIn:C,isLoading:T,iconOut:P,closeOnClick:j,theme:R}=e,M=nm("Toastify__toast",`Toastify__toast-theme--${R}`,`Toastify__toast--${u}`,{"Toastify__toast--rtl":O},{"Toastify__toast--close-on-click":j}),A=am(g)?g({rtl:O,position:h,type:u,defaultClassName:M}):nm(M,g),I=!!x||!l,D={closeToast:p,type:u,theme:R};let L=null;return!1===a||(L=am(a)?a(D):(0,t.isValidElement)(a)?(0,t.cloneElement)(a,D):mm(D)),t.createElement(d,{isIn:C,done:k,position:h,preventExitTransition:n,nodeRef:o},t.createElement("div",{id:E,onClick:c,className:A,...i,style:m,ref:o},t.createElement("div",{...C&&{role:S},className:am(y)?y({type:u}):nm("Toastify__toast-body",y),style:v},null!=P&&t.createElement("div",{className:nm("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!T})},P),t.createElement("div",null,s)),L,t.createElement(ym,{..._&&!I?{key:`pb-${_}`}:{},rtl:O,theme:R,delay:l,isRunning:r,isIn:C,closeToast:p,hide:f,type:u,style:w,className:b,controlledProgress:I,progress:x||0})))},bm=function(e,t){return void 0===t&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},wm=cm(bm("bounce",!0)),_m=(cm(bm("slide",!0)),cm(bm("zoom")),cm(bm("flip")),(0,t.forwardRef)(((e,r)=>{const{getToastToRender:n,containerRef:o,isToastActive:i}=function(e){const[,r]=(0,t.useReducer)((e=>e+1),0),[n,o]=(0,t.useState)([]),i=(0,t.useRef)(null),a=(0,t.useRef)(new Map).current,s=e=>-1!==n.indexOf(e),l=(0,t.useRef)({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:s,getToast:e=>a.get(e)}).current;function c(e){let{containerId:t}=e;const{limit:r}=l.props;!r||t&&l.containerId!==t||(l.count-=l.queue.length,l.queue=[])}function u(e){o((t=>null==e?[]:t.filter((t=>t!==e))))}function f(){const{toastContent:e,toastProps:t,staleId:r}=l.queue.shift();d(e,t,r)}function p(e,n){let{delay:o,staleId:s,...c}=n;if(!lm(e)||function(e){return!i.current||l.props.enableMultiContainer&&e.containerId!==l.props.containerId||a.has(e.toastId)&&null==e.updateId}(c))return;const{toastId:p,updateId:h,data:g}=c,{props:m}=l,y=()=>u(p),v=null==h;v&&l.count++;const b={...m,style:m.toastStyle,key:l.toastKey++,...Object.fromEntries(Object.entries(c).filter((e=>{let[t,r]=e;return null!=r}))),toastId:p,updateId:h,data:g,closeToast:y,isIn:!1,className:sm(c.className||m.toastClassName),bodyClassName:sm(c.bodyClassName||m.bodyClassName),progressClassName:sm(c.progressClassName||m.progressClassName),autoClose:!c.isLoading&&(w=c.autoClose,_=m.autoClose,!1===w||om(w)&&w>0?w:_),deleteToast(){const e=um(a.get(p),"removed");a.delete(p),fm.emit(4,e);const t=l.queue.length;if(l.count=null==p?l.count-l.displayedToast:l.count-1,l.count<0&&(l.count=0),t>0){const e=null==p?l.props.limit:1;if(1===t||1===e)l.displayedToast++,f();else{const r=e>t?t:e;l.displayedToast=r;for(let e=0;e<r;e++)f()}}else r()}};var w,_;b.iconOut=function(e){let{theme:r,type:n,isLoading:o,icon:i}=e,a=null;const s={theme:r,type:n};return!1===i||(am(i)?a=i(s):(0,t.isValidElement)(i)?a=(0,t.cloneElement)(i,s):im(i)||om(i)?a=i:o?a=dm.spinner():(e=>e in dm)(n)&&(a=dm[n](s))),a}(b),am(c.onOpen)&&(b.onOpen=c.onOpen),am(c.onClose)&&(b.onClose=c.onClose),b.closeButton=m.closeButton,!1===c.closeButton||lm(c.closeButton)?b.closeButton=c.closeButton:!0===c.closeButton&&(b.closeButton=!lm(m.closeButton)||m.closeButton);let S=e;(0,t.isValidElement)(e)&&!im(e.type)?S=(0,t.cloneElement)(e,{closeToast:y,toastProps:b,data:g}):am(e)&&(S=e({closeToast:y,toastProps:b,data:g})),m.limit&&m.limit>0&&l.count>m.limit&&v?l.queue.push({toastContent:S,toastProps:b,staleId:s}):om(o)?setTimeout((()=>{d(S,b,s)}),o):d(S,b,s)}function d(e,t,r){const{toastId:n}=t;r&&a.delete(r);const i={content:e,props:t};a.set(n,i),o((e=>[...e,n].filter((e=>e!==r)))),fm.emit(4,um(i,null==i.props.updateId?"added":"updated"))}return(0,t.useEffect)((()=>(l.containerId=e.containerId,fm.cancelEmit(3).on(0,p).on(1,(e=>i.current&&u(e))).on(5,c).emit(2,l),()=>{a.clear(),fm.emit(3,l)})),[]),(0,t.useEffect)((()=>{l.props=e,l.isToastActive=s,l.displayedToast=n.length})),{getToastToRender:function(t){const r=new Map,n=Array.from(a.values());return e.newestOnTop&&n.reverse(),n.forEach((e=>{const{position:t}=e.props;r.has(t)||r.set(t,[]),r.get(t).push(e)})),Array.from(r,(e=>t(e[0],e[1])))},containerRef:i,isToastActive:s}}(e),{className:a,style:s,rtl:l,containerId:c}=e;function u(e){const t=nm("Toastify__toast-container",`Toastify__toast-container--${e}`,{"Toastify__toast-container--rtl":l});return am(a)?a({position:e,rtl:l,defaultClassName:t}):nm(t,sm(a))}return(0,t.useEffect)((()=>{r&&(r.current=o.current)}),[]),t.createElement("div",{ref:o,className:"Toastify",id:c},n(((e,r)=>{const n=r.length?{...s}:{...s,pointerEvents:"none"};return t.createElement("div",{className:u(e),style:n,key:`container-${e}`},r.map(((e,n)=>{let{content:o,props:a}=e;return t.createElement(vm,{...a,isIn:i(a.toastId),style:{...a.style,"--nth":n+1,"--len":r.length},key:`toast-${a.key}`},o)})))})))})));_m.displayName="ToastContainer",_m.defaultProps={position:"top-right",transition:wm,autoClose:5e3,closeButton:mm,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let Sm,xm=new Map,Om=[],Em=1;function km(){return""+Em++}function Cm(e){return e&&(im(e.toastId)||om(e.toastId))?e.toastId:km()}function Tm(e,t){return xm.size>0?fm.emit(0,e,t):Om.push({content:e,options:t}),t.toastId}function Pm(e,t){return{...t,type:t&&t.type||e,toastId:Cm(t)}}function jm(e){return(t,r)=>Tm(t,Pm(e,r))}function Rm(e,t){return Tm(e,Pm("default",t))}function Mm(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Am(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Im;Rm.loading=(e,t)=>Tm(e,Pm("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),Rm.promise=function(e,t,r){let n,{pending:o,error:i,success:a}=t;o&&(n=im(o)?Rm.loading(o,r):Rm.loading(o.render,{...r,...o}));const s={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(e,t,o)=>{if(null==t)return void Rm.dismiss(n);const i={type:e,...s,...r,data:o},a=im(t)?{render:t}:t;return n?Rm.update(n,{...i,...a}):Rm(a.render,{...i,...a}),o},c=am(e)?e():e;return c.then((e=>l("success",a,e))).catch((e=>l("error",i,e))),c},Rm.success=jm("success"),Rm.info=jm("info"),Rm.error=jm("error"),Rm.warning=jm("warning"),Rm.warn=Rm.warning,Rm.dark=(e,t)=>Tm(e,Pm("default",{theme:"dark",...t})),Rm.dismiss=e=>{xm.size>0?fm.emit(1,e):Om=Om.filter((t=>null!=e&&t.options.toastId!==e))},Rm.clearWaitingQueue=function(e){return void 0===e&&(e={}),fm.emit(5,e)},Rm.isActive=e=>{let t=!1;return xm.forEach((r=>{r.isToastActive&&r.isToastActive(e)&&(t=!0)})),t},Rm.update=function(e,t){void 0===t&&(t={}),setTimeout((()=>{const r=function(e,t){let{containerId:r}=t;const n=xm.get(r||Sm);return n&&n.getToast(e)}(e,t);if(r){const{props:n,content:o}=r,i={delay:100,...n,...t,toastId:t.toastId||e,updateId:km()};i.toastId!==e&&(i.staleId=e);const a=i.render||o;delete i.render,Tm(a,i)}}),0)},Rm.done=e=>{Rm.update(e,{progress:1})},Rm.onChange=e=>(fm.on(4,e),()=>{fm.off(4,e)}),Rm.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},Rm.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},fm.on(2,(e=>{Sm=e.containerId||e,xm.set(Sm,e),Om.forEach((e=>{fm.emit(0,e.content,e.options)})),Om=[]})).on(3,(e=>{xm.delete(e.containerId||e),0===xm.size&&fm.off(0).off(1).off(5)})),(Im=document.createElement("style")).innerText=":root{--toastify-color-light:#fff;--toastify-color-dark:#121212;--toastify-color-info:#3498db;--toastify-color-success:#07bc0c;--toastify-color-warning:#f1c40f;--toastify-color-error:#e74c3c;--toastify-color-transparent:hsla(0,0%,100%,.7);--toastify-icon-color-info:var(--toastify-color-info);--toastify-icon-color-success:var(--toastify-color-success);--toastify-icon-color-warning:var(--toastify-color-warning);--toastify-icon-color-error:var(--toastify-color-error);--toastify-toast-width:320px;--toastify-toast-background:#fff;--toastify-toast-min-height:64px;--toastify-toast-max-height:800px;--toastify-font-family:sans-serif;--toastify-z-index:9999;--toastify-text-color-light:#757575;--toastify-text-color-dark:#fff;--toastify-text-color-info:#fff;--toastify-text-color-success:#fff;--toastify-text-color-warning:#fff;--toastify-text-color-error:#fff;--toastify-spinner-color:#616161;--toastify-spinner-color-empty-area:#e0e0e0;--toastify-color-progress-light:linear-gradient(90deg,#4cd964,#5ac8fa,#007aff,#34aadc,#5856d6,#ff2d55);--toastify-color-progress-dark:#bb86fc;--toastify-color-progress-info:var(--toastify-color-info);--toastify-color-progress-success:var(--toastify-color-success);--toastify-color-progress-warning:var(--toastify-color-warning);--toastify-color-progress-error:var(--toastify-color-error)}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translateZ(var(--toastify-z-index));position:fixed;padding:4px;width:var(--toastify-toast-width);box-sizing:border-box;color:#fff}.Toastify__toast-container--top-left{top:1em;left:1em}.Toastify__toast-container--top-center{top:1em;left:50%;transform:translateX(-50%)}.Toastify__toast-container--top-right{top:1em;right:1em}.Toastify__toast-container--bottom-left{bottom:1em;left:1em}.Toastify__toast-container--bottom-center{bottom:1em;left:50%;transform:translateX(-50%)}.Toastify__toast-container--bottom-right{bottom:1em;right:1em}@media only screen and (max-width:480px){.Toastify__toast-container{width:100vw;padding:0;left:0;margin:0}.Toastify__toast-container--top-center,.Toastify__toast-container--top-left,.Toastify__toast-container--top-right{top:0;transform:translateX(0)}.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-right{bottom:0;transform:translateX(0)}.Toastify__toast-container--rtl{right:0;left:auto}}.Toastify__toast{position:relative;min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:8px;border-radius:4px;box-shadow:0 1px 10px 0 rgba(0,0,0,.1),0 2px 15px 0 rgba(0,0,0,.05);display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;max-height:var(--toastify-toast-max-height);overflow:hidden;font-family:var(--toastify-font-family);cursor:default;direction:ltr;z-index:0}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-body{margin:auto 0;-ms-flex:1 1 auto;flex:1 1 auto;padding:6px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.Toastify__toast-body>div:last-child{word-break:break-word;-ms-flex:1;flex:1}.Toastify__toast-icon{-webkit-margin-end:10px;margin-inline-end:10px;width:20px;-ms-flex-negative:0;flex-shrink:0;display:-ms-flexbox;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.7s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}@media only screen and (max-width:480px){.Toastify__toast{margin-bottom:0;border-radius:0}}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--colored.Toastify__toast--default,.Toastify__toast-theme--light{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;-ms-flex-item-align:start;align-self:flex-start}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:focus,.Toastify__close-button:hover{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:5px;z-index:var(--toastify-z-index);opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:auto;transform-origin:right}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,0,0)}to{opacity:0;transform:translate3d(2000px,0,0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,0,0)}to{opacity:0;transform:translate3d(-2000px,0,0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,-10px,0)}40%,45%{opacity:1;transform:translate3d(0,20px,0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,10px,0)}40%,45%{opacity:1;transform:translate3d(0,-20px,0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--bottom-left,.Toastify__bounce-enter--top-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--bottom-right,.Toastify__bounce-enter--top-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--bottom-left,.Toastify__bounce-exit--top-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--bottom-right,.Toastify__bounce-exit--top-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:perspective(400px)}30%{transform:perspective(400px) rotateX(-20deg);opacity:1}to{transform:perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translateZ(0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translateZ(0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translateZ(0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translateZ(0)}}@keyframes Toastify__slideOutRight{0%{transform:translateZ(0)}to{visibility:hidden;transform:translate3d(110%,0,0)}}@keyframes Toastify__slideOutLeft{0%{transform:translateZ(0)}to{visibility:hidden;transform:translate3d(-110%,0,0)}}@keyframes Toastify__slideOutDown{0%{transform:translateZ(0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translateZ(0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--bottom-left,.Toastify__slide-enter--top-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--bottom-right,.Toastify__slide-enter--top-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--bottom-left,.Toastify__slide-exit--top-left{animation-name:Toastify__slideOutLeft}.Toastify__slide-exit--bottom-right,.Toastify__slide-exit--top-right{animation-name:Toastify__slideOutRight}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown}@keyframes Toastify__spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}",document.head.appendChild(Im);const Dm=H((function({notifications:e}){return{notifications:e.notifications}}))((function({notifications:e}){const n=(0,We.qM)(),o=Q(),[i,a]=r().useState({});return(0,t.useEffect)((()=>{e.filter((e=>!i[e.id])).forEach((e=>{const t=Rm("string"==typeof e.message?e.message:n(e.message.key,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mm(Object(r),!0).forEach((function(t){Am(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e.message)),{autoClose:e.dismissAfter,type:e.type});i[e.id]=t,a(i),e.dismissAfter&&setTimeout((()=>{o(ta(e.id))}),e.dismissAfter)})),Object.entries(i).forEach((([t,r])=>{e.find((e=>e.id===t))||(Rm.dismiss(r),delete i[t],a(i))}))}),[e]),Rm.onChange((e=>{if("removed"==e.status){var t;const r=null===(t=Object.entries(i).find((([,t])=>t===e.id)))||void 0===t?void 0:t[0];r&&o(ta(r))}})),(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(_m,{position:"top-right",theme:"colored",className:"notif__container"}))})),Lm={name:"m2n7c1-avatarImage",styles:"width:32px;border-radius:32px;label:avatarImage;"},Nm=Cg(qe.DropdownButton,{target:"e1gt62yu4",label:"AvatarDropdownButton"})({name:"dtukf8",styles:"display:inline-block;padding:8px;cursor:pointer;color:#1e2532;background-color:transparent"}),$m=Cg("img",{target:"e1gt62yu3",label:"AvatarImage"})(Lm,";"),Fm=Cg(qe.Icon,{target:"e1gt62yu2",label:"AvatarPlaceholderIcon"})(Lm,";height:32px;color:#1e2532;background-color:",qe.colors.textFieldBorder,";"),Bm=Cg("a",{target:"e1gt62yu1",label:"AppHeaderSiteLink"})({name:"1uk00au",styles:"font-size:14px;font-weight:400;color:#7b8290;padding:10px 16px"}),Um=Cg("a",{target:"e1gt62yu0",label:"AppHeaderTestRepoIndicator"})({name:"1uk00au",styles:"font-size:14px;font-weight:400;color:#7b8290;padding:10px 16px"});function zm({imageUrl:e}){return e?(0,xo.jsx)($m,{src:e}):(0,xo.jsx)(Fm,{type:"user",size:"large"})}function qm({displayUrl:e,isTestRepo:t,imageUrl:n,onLogoutClick:o,t:i}){return(0,xo.jsx)(r().Fragment,null,t&&(0,xo.jsx)(Um,{href:"https://www.decapcms.org/docs/test-backend",target:"_blank",rel:"noopener noreferrer"},"Test Backend ↗"),e?(0,xo.jsx)(Bm,{href:e,target:"_blank"},function(e){const t=e.indexOf("//");return t>-1?e.slice(t+2):e}(e)):null,(0,xo.jsx)(qe.Dropdown,{dropdownTopOverlap:"50px",dropdownWidth:"100px",dropdownPosition:"right",renderButton:()=>(0,xo.jsx)(Nm,null,(0,xo.jsx)(zm,{imageUrl:n}))},(0,xo.jsx)(qe.DropdownItem,{label:i("ui.settingsDropdown.logOut"),onClick:o})))}zm.propTypes={imageUrl:i().string},qm.propTypes={displayUrl:i().string,isTestRepo:i().bool,imageUrl:i().string,onLogoutClick:i().func.isRequired,t:i().func.isRequired};const Wm=(0,We.Iu)()(qm);var Hm=__webpack_require__(78841),Vm=__webpack_require__.n(Hm),Gm=__webpack_require__(75465),Km=__webpack_require__.n(Gm);function Ym(e){ns.push(Ko(e))}var Jm=__webpack_require__(16760),Qm=__webpack_require__.n(Jm);const Xm=Cg("div",{target:"el0uck02",label:"SearchContainer"})({name:"sycyb7",styles:"height:37px;display:flex;align-items:center;position:relative;width:400px"}),Zm=Cg("input",{target:"el0uck01",label:"SearchInput"})("background-color:#eff0f4;border-radius:",qe.lengths.borderRadius,";font-size:14px;padding:10px 6px 10px 32px;width:100%;position:relative;z-index:",qe.zIndex.zIndex1,";&:focus{outline:none;box-shadow:inset 0 0 0 2px ",qe.colors.active,";}"),ey=Cg(qe.Icon,{target:"el0uck00",label:"SearchIcon"})("position:absolute;top:50%;left:6px;z-index:",qe.zIndex.zIndex2,";transform:translate(0, -50%);");function ty({value:e,onChange:t,onKeyDown:r,placeholder:n,disabled:o}){return(0,xo.jsx)(Xm,null,(0,xo.jsx)(ey,{type:"search",size:"small"}),(0,xo.jsx)(Zm,{value:e,onChange:t,onKeyDown:r,placeholder:n,disabled:o}))}ty.propTypes={value:i().string,onChange:i().func.isRequired,onKeyDown:i().func.isRequired,placeholder:i().string.isRequired,disabled:i().bool};const ry=ty,ny=Cg("button",{target:"estf6121",label:"CloseButton"})(qe.buttons.button,";",qe.shadows.dropMiddle,";position:absolute;margin-right:-40px;left:-40px;top:-40px;width:40px;height:40px;border-radius:50%;background-color:white;padding:0;display:flex;justify-content:center;align-items:center;"),oy=Cg("h1",{target:"estf6120",label:"LibraryTitle"})("line-height:36px;font-size:22px;text-align:left;margin-bottom:25px;color:",(e=>e.isPrivate&&qe.colors.textFieldBorder),";");function iy({onClose:e,title:t,isPrivate:r}){return(0,xo.jsx)("div",null,(0,xo.jsx)(ny,{onClick:e},(0,xo.jsx)(qe.Icon,{type:"close"})),(0,xo.jsx)(oy,{isPrivate:r},t))}iy.propTypes={onClose:i().func.isRequired,title:i().string.isRequired,isPrivate:i().bool};const ay=iy;function sy(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ly={button:(0,xo.css)(qe.buttons.button,";",qe.buttons.default,";display:inline-block;margin-left:15px;margin-right:2px;&[disabled]{",qe.buttons.disabled,";cursor:default;};label:button;")},cy=Cg(Hg,{target:"e288rjk3",label:"UploadButton"})(ly.button,";",qe.buttons.gray,";",qe.shadows.dropMain,";margin-bottom:0;span{font-size:14px;font-weight:500;display:flex;justify-content:center;align-items:center;}input{height:0.1px;width:0.1px;margin:0;padding:0;opacity:0;overflow:hidden;position:absolute;z-index:",qe.zIndex.zIndex0,";outline:none;}"),uy=Cg("button",{target:"e288rjk2",label:"DeleteButton"})(ly.button,";",qe.buttons.lightRed,";"),fy=Cg("button",{target:"e288rjk1",label:"InsertButton"})(ly.button,";",qe.buttons.green,";"),py=Cg("button",{target:"e288rjk0",label:"ActionButton"})(ly.button,";",(e=>!e.disabled&&(0,xo.css)(qe.buttons.gray,";;label:ActionButton;")),";"),dy=py;class hy extends r().Component{constructor(...e){super(...e),sy(this,"mounted",!1),sy(this,"timeout",void 0),sy(this,"state",{copied:!1}),sy(this,"handleCopy",(()=>{clearTimeout(this.timeout);const{path:e,draft:t,name:r}=this.props;jg((0,pr.isAbsolutePath)(e)||!t?e:r),this.setState({copied:!0}),this.timeout=setTimeout((()=>this.mounted&&this.setState({copied:!1})),1500)})),sy(this,"getTitle",(()=>{const{t:e,path:t,draft:r}=this.props;return this.state.copied?e("mediaLibrary.mediaLibraryCard.copied"):t?(0,pr.isAbsolutePath)(t)?e("mediaLibrary.mediaLibraryCard.copyUrl"):e(r?"mediaLibrary.mediaLibraryCard.copyName":"mediaLibrary.mediaLibraryCard.copyPath"):e("mediaLibrary.mediaLibraryCard.copy")}))}componentDidMount(){this.mounted=!0}componentWillUnmount(){this.mounted=!1}render(){const{disabled:e}=this.props;return(0,xo.jsx)(py,{disabled:e,onClick:this.handleCopy},this.getTitle())}}hy.propTypes={disabled:i().bool.isRequired,draft:i().bool,path:i().string,name:i().string,t:i().func.isRequired};const gy=Cg("div",{target:"e1n0ky5z2",label:"LibraryTop"})({name:"16hjiy4",styles:"position:relative;display:flex;flex-direction:column"}),my=Cg("div",{target:"e1n0ky5z1",label:"RowContainer"})({name:"1eoy87d",styles:"display:flex;justify-content:space-between"}),yy=Cg("div",{target:"e1n0ky5z0",label:"ButtonsContainer"})({name:"ozd7xs",styles:"flex-shrink:0"});function vy({t:e,onClose:t,privateUpload:r,forImage:n,onDownload:o,onUpload:i,query:a,onSearchChange:s,onSearchKeyDown:l,searchDisabled:c,onDelete:u,canInsert:f,onInsert:p,hasSelection:d,isPersisting:h,isDeleting:g,selectedFile:m}){const y=h||g,v=!y,b=!y&&d,w=e(h?"mediaLibrary.mediaLibraryModal.uploading":"mediaLibrary.mediaLibraryModal.upload"),_=e(g?"mediaLibrary.mediaLibraryModal.deleting":"mediaLibrary.mediaLibraryModal.deleteSelected"),S=e("mediaLibrary.mediaLibraryModal.download"),x=e("mediaLibrary.mediaLibraryModal.chooseSelected");return(0,xo.jsx)(gy,null,(0,xo.jsx)(my,null,(0,xo.jsx)(ay,{onClose:t,title:`${r?e("mediaLibrary.mediaLibraryModal.private"):""}${e(n?"mediaLibrary.mediaLibraryModal.images":"mediaLibrary.mediaLibraryModal.mediaAssets")}`,isPrivate:r}),(0,xo.jsx)(yy,null,(0,xo.jsx)(hy,{disabled:!d,path:m.path,name:m.name,draft:m.draft,t:e}),(0,xo.jsx)(dy,{onClick:o,disabled:!d},S),(0,xo.jsx)(cy,{label:w,imagesOnly:n,onChange:i,disabled:!v}))),(0,xo.jsx)(my,null,(0,xo.jsx)(ry,{value:a,onChange:s,onKeyDown:l,placeholder:e("mediaLibrary.mediaLibraryModal.search"),disabled:c}),(0,xo.jsx)(yy,null,(0,xo.jsx)(uy,{onClick:u,disabled:!b},_),f?(0,xo.jsx)(fy,{onClick:p,disabled:!d},x):null)))}vy.propTypes={t:i().func.isRequired,onClose:i().func.isRequired,privateUpload:i().bool,forImage:i().bool,onDownload:i().func.isRequired,onUpload:i().func.isRequired,query:i().string,onSearchChange:i().func.isRequired,onSearchKeyDown:i().func.isRequired,searchDisabled:i().bool.isRequired,onDelete:i().func.isRequired,canInsert:i().bool,onInsert:i().func.isRequired,hasSelection:i().bool.isRequired,isPersisting:i().bool,isDeleting:i().bool,selectedFile:i().oneOfType([i().shape({path:i().string.isRequired,draft:i().bool.isRequired,name:i().string.isRequired}),i().shape({})])};const by=vy;var wy=!("undefined"==typeof window||!window.document||!window.document.createElement),_y=void 0;function Sy(e){e.handlers===e.nextHandlers&&(e.nextHandlers=e.handlers.slice())}function xy(e){this.target=e,this.events={}}xy.prototype.getEventHandlers=function(e,t){var r,n=String(e)+" "+String((r=t)?!0===r?100:(r.capture<<0)+(r.passive<<1)+(r.once<<2):0);return this.events[n]||(this.events[n]={handlers:[],handleEvent:void 0},this.events[n].nextHandlers=this.events[n].handlers),this.events[n]},xy.prototype.handleEvent=function(e,t,r){var n=this.getEventHandlers(e,t);n.handlers=n.nextHandlers,n.handlers.forEach((function(e){e&&e(r)}))},xy.prototype.add=function(e,t,r){var n=this,o=this.getEventHandlers(e,r);Sy(o),0===o.nextHandlers.length&&(o.handleEvent=this.handleEvent.bind(this,e,r),this.target.addEventListener(e,o.handleEvent,r)),o.nextHandlers.push(t);var i=!0;return function(){if(i){i=!1,Sy(o);var a=o.nextHandlers.indexOf(t);o.nextHandlers.splice(a,1),0===o.nextHandlers.length&&(n.target&&n.target.removeEventListener(e,o.handleEvent,r),o.handleEvent=void 0)}}};var Oy="__consolidated_events_handlers__";function Ey(e,t,r,n){e[Oy]||(e[Oy]=new xy(e));var o=function(e){if(e)return void 0===_y&&(_y=function(){if(!wy)return!1;if(!window.addEventListener||!window.removeEventListener||!Object.defineProperty)return!1;var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}}),r=function(){};window.addEventListener("testPassiveEventSupport",r,t),window.removeEventListener("testPassiveEventSupport",r,t)}catch(e){}return e}()),_y?e:!!e.capture}(n);return e[Oy].add(t,r,o)}var ky=__webpack_require__(94237);function Cy(e,t){var r,n=(r=e,!isNaN(parseFloat(r))&&isFinite(r)?parseFloat(r):"px"===r.slice(-2)?parseFloat(r.slice(0,-2)):void 0);if("number"==typeof n)return n;var o=function(e){if("%"===e.slice(-1))return parseFloat(e.slice(0,-1))/100}(e);return"number"==typeof o?o*t:void 0}var Ty,Py="above",jy="inside",Ry="below",My="invisible";function Ay(e){return"string"==typeof e.type}var Iy=[];function Dy(e){Iy.push(e),Ty||(Ty=setTimeout((function(){var e;for(Ty=null;e=Iy.shift();)e()}),0));var t=!0;return function(){if(t){t=!1;var r=Iy.indexOf(e);-1!==r&&(Iy.splice(r,1),!Iy.length&&Ty&&(clearTimeout(Ty),Ty=null))}}}var Ly="undefined"!=typeof window,Ny=function(e){function t(t){var r;return(r=e.call(this,t)||this).refElement=function(e){r._ref=e},r}Z(t,e);var n=t.prototype;return n.componentDidMount=function(){var e=this;Ly&&(this.cancelOnNextTick=Dy((function(){e.cancelOnNextTick=null;var t=e.props,r=t.children;t.debug,function(e,t){if(e&&!Ay(e)&&!t)throw new Error("<Waypoint> needs a DOM element to compute boundaries. The child you passed is neither a DOM element (e.g. <div>) nor does it use the innerRef prop.\n\nSee https://goo.gl/LrBNgw for more info.")}(r,e._ref),e._handleScroll=e._handleScroll.bind(e),e.scrollableAncestor=e._findScrollableAncestor(),e.scrollEventListenerUnsubscribe=Ey(e.scrollableAncestor,"scroll",e._handleScroll,{passive:!0}),e.resizeEventListenerUnsubscribe=Ey(window,"resize",e._handleScroll,{passive:!0}),e._handleScroll(null)})))},n.componentDidUpdate=function(){var e=this;Ly&&this.scrollableAncestor&&(this.cancelOnNextTick||(this.cancelOnNextTick=Dy((function(){e.cancelOnNextTick=null,e._handleScroll(null)}))))},n.componentWillUnmount=function(){Ly&&(this.scrollEventListenerUnsubscribe&&this.scrollEventListenerUnsubscribe(),this.resizeEventListenerUnsubscribe&&this.resizeEventListenerUnsubscribe(),this.cancelOnNextTick&&this.cancelOnNextTick())},n._findScrollableAncestor=function(){var e=this.props,t=e.horizontal,r=e.scrollableAncestor;if(r)return function(e){return"window"===e?__webpack_require__.g.window:e}(r);for(var n=this._ref;n.parentNode;){if((n=n.parentNode)===document.body)return window;var o=window.getComputedStyle(n),i=(t?o.getPropertyValue("overflow-x"):o.getPropertyValue("overflow-y"))||o.getPropertyValue("overflow");if("auto"===i||"scroll"===i||"overlay"===i)return n}return window},n._handleScroll=function(e){if(this._ref){var t=this._getBounds(),r=function(e){return e.viewportBottom-e.viewportTop==0?My:e.viewportTop<=e.waypointTop&&e.waypointTop<=e.viewportBottom||e.viewportTop<=e.waypointBottom&&e.waypointBottom<=e.viewportBottom||e.waypointTop<=e.viewportTop&&e.viewportBottom<=e.waypointBottom?jy:e.viewportBottom<e.waypointTop?Ry:e.waypointTop<e.viewportTop?Py:My}(t),n=this._previousPosition,o=this.props,i=(o.debug,o.onPositionChange),a=o.onEnter,s=o.onLeave,l=o.fireOnRapidScroll;if(this._previousPosition=r,n!==r){var c={currentPosition:r,previousPosition:n,event:e,waypointTop:t.waypointTop,waypointBottom:t.waypointBottom,viewportTop:t.viewportTop,viewportBottom:t.viewportBottom};i.call(this,c),r===jy?a.call(this,c):n===jy&&s.call(this,c),l&&(n===Ry&&r===Py||n===Py&&r===Ry)&&(a.call(this,{currentPosition:jy,previousPosition:n,event:e,waypointTop:t.waypointTop,waypointBottom:t.waypointBottom,viewportTop:t.viewportTop,viewportBottom:t.viewportBottom}),s.call(this,{currentPosition:r,previousPosition:jy,event:e,waypointTop:t.waypointTop,waypointBottom:t.waypointBottom,viewportTop:t.viewportTop,viewportBottom:t.viewportBottom}))}}},n._getBounds=function(){var e,t,r=this.props,n=r.horizontal,o=(r.debug,this._ref.getBoundingClientRect()),i=o.left,a=o.top,s=o.right,l=o.bottom,c=n?i:a,u=n?s:l;this.scrollableAncestor===window?(e=n?window.innerWidth:window.innerHeight,t=0):(e=n?this.scrollableAncestor.offsetWidth:this.scrollableAncestor.offsetHeight,t=n?this.scrollableAncestor.getBoundingClientRect().left:this.scrollableAncestor.getBoundingClientRect().top);var f=this.props,p=f.bottomOffset;return{waypointTop:c,waypointBottom:u,viewportTop:t+Cy(f.topOffset,e),viewportBottom:t+e-Cy(p,e)}},n.render=function(){var e=this,t=this.props.children;return t?Ay(t)||(0,ky.isForwardRef)(t)?r().cloneElement(t,{ref:function(r){e.refElement(r),t.ref&&("function"==typeof t.ref?t.ref(r):t.ref.current=r)}}):r().cloneElement(t,{innerRef:this.refElement}):r().createElement("span",{ref:this.refElement,style:{fontSize:0}})},t}(r().PureComponent);function $y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}Ny.above=Py,Ny.below=Ry,Ny.inside=jy,Ny.invisible=My,Ny.defaultProps={debug:!1,scrollableAncestor:void 0,children:void 0,topOffset:"0px",bottomOffset:"0px",horizontal:!1,onEnter:function(){},onLeave:function(){},onPositionChange:function(){},fireOnRapidScroll:!0},Ny.displayName="Waypoint";var Fy=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function By(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!((n=e[r])===(o=t[r])||Fy(n)&&Fy(o)))return!1;var n,o;return!0}const Uy=function(e,t){var r;void 0===t&&(t=By);var n,o=[],i=!1;return function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return i&&r===this&&t(a,o)||(n=e.apply(this,a),i=!0,r=this,o=a),n}};var zy="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function qy(e){cancelAnimationFrame(e.id)}var Wy=-1;var Hy=null;function Vy(e){if(void 0===e&&(e=!1),null===Hy||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),o=n.style;return o.width="100px",o.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?Hy="positive-descending":(t.scrollLeft=1,Hy=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),Hy}return Hy}var Gy=function(e){var t=e.columnIndex;return e.data,e.rowIndex+":"+t};function Ky(e){var r,n=e.getColumnOffset,o=e.getColumnStartIndexForOffset,i=e.getColumnStopIndexForStartIndex,a=e.getColumnWidth,s=e.getEstimatedTotalHeight,l=e.getEstimatedTotalWidth,c=e.getOffsetForColumnAndAlignment,u=e.getOffsetForRowAndAlignment,f=e.getRowHeight,p=e.getRowOffset,h=e.getRowStartIndexForOffset,g=e.getRowStopIndexForStartIndex,m=e.initInstanceProps,y=e.shouldResetStyleCacheOnItemSizeChange,v=e.validateProps;return r=function(e){function r(t){var r;return(r=e.call(this,t)||this)._instanceProps=m(r.props,$y(r)),r._resetIsScrollingTimeoutId=null,r._outerRef=void 0,r.state={instance:$y(r),isScrolling:!1,horizontalScrollDirection:"forward",scrollLeft:"number"==typeof r.props.initialScrollLeft?r.props.initialScrollLeft:0,scrollTop:"number"==typeof r.props.initialScrollTop?r.props.initialScrollTop:0,scrollUpdateWasRequested:!1,verticalScrollDirection:"forward"},r._callOnItemsRendered=void 0,r._callOnItemsRendered=Uy((function(e,t,n,o,i,a,s,l){return r.props.onItemsRendered({overscanColumnStartIndex:e,overscanColumnStopIndex:t,overscanRowStartIndex:n,overscanRowStopIndex:o,visibleColumnStartIndex:i,visibleColumnStopIndex:a,visibleRowStartIndex:s,visibleRowStopIndex:l})})),r._callOnScroll=void 0,r._callOnScroll=Uy((function(e,t,n,o,i){return r.props.onScroll({horizontalScrollDirection:n,scrollLeft:e,scrollTop:t,verticalScrollDirection:o,scrollUpdateWasRequested:i})})),r._getItemStyle=void 0,r._getItemStyle=function(e,t){var o,i=r.props,s=i.columnWidth,l=i.direction,c=i.rowHeight,u=r._getItemStyleCache(y&&s,y&&l,y&&c),d=e+":"+t;if(u.hasOwnProperty(d))o=u[d];else{var h=n(r.props,t,r._instanceProps),g="rtl"===l;u[d]=o={position:"absolute",left:g?void 0:h,right:g?h:void 0,top:p(r.props,e,r._instanceProps),height:f(r.props,e,r._instanceProps),width:a(r.props,t,r._instanceProps)}}return o},r._getItemStyleCache=void 0,r._getItemStyleCache=Uy((function(e,t,r){return{}})),r._onScroll=function(e){var t=e.currentTarget,n=t.clientHeight,o=t.clientWidth,i=t.scrollLeft,a=t.scrollTop,s=t.scrollHeight,l=t.scrollWidth;r.setState((function(e){if(e.scrollLeft===i&&e.scrollTop===a)return null;var t=r.props.direction,c=i;if("rtl"===t)switch(Vy()){case"negative":c=-i;break;case"positive-descending":c=l-o-i}c=Math.max(0,Math.min(c,l-o));var u=Math.max(0,Math.min(a,s-n));return{isScrolling:!0,horizontalScrollDirection:e.scrollLeft<i?"forward":"backward",scrollLeft:c,scrollTop:u,verticalScrollDirection:e.scrollTop<a?"forward":"backward",scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){var e,t,n,o;null!==r._resetIsScrollingTimeoutId&&qy(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=(e=r._resetIsScrolling,t=150,n=zy(),o={id:requestAnimationFrame((function r(){zy()-n>=t?e.call(null):o.id=requestAnimationFrame(r)}))})},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},(function(){r._getItemStyleCache(-1)}))},r}Z(r,e),r.getDerivedStateFromProps=function(e,t){return Yy(e,t),v(e),null};var b=r.prototype;return b.scrollTo=function(e){var t=e.scrollLeft,r=e.scrollTop;void 0!==t&&(t=Math.max(0,t)),void 0!==r&&(r=Math.max(0,r)),this.setState((function(e){return void 0===t&&(t=e.scrollLeft),void 0===r&&(r=e.scrollTop),e.scrollLeft===t&&e.scrollTop===r?null:{horizontalScrollDirection:e.scrollLeft<t?"forward":"backward",scrollLeft:t,scrollTop:r,scrollUpdateWasRequested:!0,verticalScrollDirection:e.scrollTop<r?"forward":"backward"}}),this._resetIsScrollingDebounced)},b.scrollToItem=function(e){var t=e.align,r=void 0===t?"auto":t,n=e.columnIndex,o=e.rowIndex,i=this.props,a=i.columnCount,f=i.height,p=i.rowCount,d=i.width,h=this.state,g=h.scrollLeft,m=h.scrollTop,y=function(e){if(void 0===e&&(e=!1),-1===Wy||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Wy=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Wy}();void 0!==n&&(n=Math.max(0,Math.min(n,a-1))),void 0!==o&&(o=Math.max(0,Math.min(o,p-1)));var v=s(this.props,this._instanceProps),b=l(this.props,this._instanceProps)>d?y:0,w=v>f?y:0;this.scrollTo({scrollLeft:void 0!==n?c(this.props,n,r,g,this._instanceProps,w):g,scrollTop:void 0!==o?u(this.props,o,r,m,this._instanceProps,b):m})},b.componentDidMount=function(){var e=this.props,t=e.initialScrollLeft,r=e.initialScrollTop;if(null!=this._outerRef){var n=this._outerRef;"number"==typeof t&&(n.scrollLeft=t),"number"==typeof r&&(n.scrollTop=r)}this._callPropsCallbacks()},b.componentDidUpdate=function(){var e=this.props.direction,t=this.state,r=t.scrollLeft,n=t.scrollTop;if(t.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("rtl"===e)switch(Vy()){case"negative":o.scrollLeft=-r;break;case"positive-ascending":o.scrollLeft=r;break;default:var i=o.clientWidth,a=o.scrollWidth;o.scrollLeft=a-i-r}else o.scrollLeft=Math.max(0,r);o.scrollTop=Math.max(0,n)}this._callPropsCallbacks()},b.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&qy(this._resetIsScrollingTimeoutId)},b.render=function(){var e=this.props,r=e.children,n=e.className,o=e.columnCount,i=e.direction,a=e.height,c=e.innerRef,u=e.innerElementType,f=e.innerTagName,p=e.itemData,h=e.itemKey,g=void 0===h?Gy:h,m=e.outerElementType,y=e.outerTagName,v=e.rowCount,b=e.style,w=e.useIsScrolling,_=e.width,S=this.state.isScrolling,x=this._getHorizontalRangeToRender(),O=x[0],E=x[1],k=this._getVerticalRangeToRender(),C=k[0],T=k[1],P=[];if(o>0&&v)for(var j=C;j<=T;j++)for(var R=O;R<=E;R++)P.push((0,t.createElement)(r,{columnIndex:R,data:p,isScrolling:w?S:void 0,key:g({columnIndex:R,data:p,rowIndex:j}),rowIndex:j,style:this._getItemStyle(j,R)}));var M=s(this.props,this._instanceProps),A=l(this.props,this._instanceProps);return(0,t.createElement)(m||y||"div",{className:n,onScroll:this._onScroll,ref:this._outerRefSetter,style:d({position:"relative",height:a,width:_,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:i},b)},(0,t.createElement)(u||f||"div",{children:P,ref:c,style:{height:M,pointerEvents:S?"none":void 0,width:A}}))},b._callPropsCallbacks=function(){var e=this.props,t=e.columnCount,r=e.onItemsRendered,n=e.onScroll,o=e.rowCount;if("function"==typeof r&&t>0&&o>0){var i=this._getHorizontalRangeToRender(),a=i[0],s=i[1],l=i[2],c=i[3],u=this._getVerticalRangeToRender(),f=u[0],p=u[1],d=u[2],h=u[3];this._callOnItemsRendered(a,s,f,p,l,c,d,h)}if("function"==typeof n){var g=this.state,m=g.horizontalScrollDirection,y=g.scrollLeft,v=g.scrollTop,b=g.scrollUpdateWasRequested,w=g.verticalScrollDirection;this._callOnScroll(y,v,m,w,b)}},b._getHorizontalRangeToRender=function(){var e=this.props,t=e.columnCount,r=e.overscanColumnCount,n=e.overscanColumnsCount,a=e.overscanCount,s=e.rowCount,l=this.state,c=l.horizontalScrollDirection,u=l.isScrolling,f=l.scrollLeft,p=r||n||a||1;if(0===t||0===s)return[0,0,0,0];var d=o(this.props,f,this._instanceProps),h=i(this.props,d,f,this._instanceProps),g=u&&"backward"!==c?1:Math.max(1,p),m=u&&"forward"!==c?1:Math.max(1,p);return[Math.max(0,d-g),Math.max(0,Math.min(t-1,h+m)),d,h]},b._getVerticalRangeToRender=function(){var e=this.props,t=e.columnCount,r=e.overscanCount,n=e.overscanRowCount,o=e.overscanRowsCount,i=e.rowCount,a=this.state,s=a.isScrolling,l=a.verticalScrollDirection,c=a.scrollTop,u=n||o||r||1;if(0===t||0===i)return[0,0,0,0];var f=h(this.props,c,this._instanceProps),p=g(this.props,f,c,this._instanceProps),d=s&&"backward"!==l?1:Math.max(1,u),m=s&&"forward"!==l?1:Math.max(1,u);return[Math.max(0,f-d),Math.max(0,Math.min(i-1,p+m)),f,p]},r}(t.PureComponent),r.defaultProps={direction:"ltr",itemData:void 0,useIsScrolling:!1},r}var Yy=function(e,t){e.children,e.direction,e.height,e.innerTagName,e.outerTagName,e.overscanColumnsCount,e.overscanCount,e.overscanRowsCount,e.width,t.instance},Jy=Ky({getColumnOffset:function(e,t){return t*e.columnWidth},getColumnWidth:function(e,t){return e.columnWidth},getRowOffset:function(e,t){return t*e.rowHeight},getRowHeight:function(e,t){return e.rowHeight},getEstimatedTotalHeight:function(e){var t=e.rowCount;return e.rowHeight*t},getEstimatedTotalWidth:function(e){var t=e.columnCount;return e.columnWidth*t},getOffsetForColumnAndAlignment:function(e,t,r,n,o,i){var a=e.columnCount,s=e.columnWidth,l=e.width,c=Math.max(0,a*s-l),u=Math.min(c,t*s),f=Math.max(0,t*s-l+i+s);switch("smart"===r&&(r=n>=f-l&&n<=u+l?"auto":"center"),r){case"start":return u;case"end":return f;case"center":var p=Math.round(f+(u-f)/2);return p<Math.ceil(l/2)?0:p>c+Math.floor(l/2)?c:p;default:return n>=f&&n<=u?n:f>u||n<f?f:u}},getOffsetForRowAndAlignment:function(e,t,r,n,o,i){var a=e.rowHeight,s=e.height,l=e.rowCount,c=Math.max(0,l*a-s),u=Math.min(c,t*a),f=Math.max(0,t*a-s+i+a);switch("smart"===r&&(r=n>=f-s&&n<=u+s?"auto":"center"),r){case"start":return u;case"end":return f;case"center":var p=Math.round(f+(u-f)/2);return p<Math.ceil(s/2)?0:p>c+Math.floor(s/2)?c:p;default:return n>=f&&n<=u?n:f>u||n<f?f:u}},getColumnStartIndexForOffset:function(e,t){var r=e.columnWidth,n=e.columnCount;return Math.max(0,Math.min(n-1,Math.floor(t/r)))},getColumnStopIndexForStartIndex:function(e,t,r){var n=e.columnWidth,o=e.columnCount,i=e.width,a=t*n,s=Math.ceil((i+r-a)/n);return Math.max(0,Math.min(o-1,t+s-1))},getRowStartIndexForOffset:function(e,t){var r=e.rowHeight,n=e.rowCount;return Math.max(0,Math.min(n-1,Math.floor(t/r)))},getRowStopIndexForStartIndex:function(e,t,r){var n=e.rowHeight,o=e.rowCount,i=e.height,a=t*n,s=Math.ceil((i+r-a)/n);return Math.max(0,Math.min(o-1,t+s-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.columnWidth,e.rowHeight}});let Qy;Qy="undefined"!=typeof window?window:"undefined"!=typeof self?self:__webpack_require__.g;let Xy=null,Zy=null;const ev=Qy.clearTimeout,tv=Qy.setTimeout,rv=Qy.cancelAnimationFrame||Qy.mozCancelAnimationFrame||Qy.webkitCancelAnimationFrame,nv=Qy.requestAnimationFrame||Qy.mozRequestAnimationFrame||Qy.webkitRequestAnimationFrame;null==rv||null==nv?(Xy=ev,Zy=function(e){return tv(e,20)}):(Xy=function([e,t]){rv(e),ev(t)},Zy=function(e){const t=nv((function(){ev(r),e()})),r=tv((function(){rv(t),e()}),20);return[t,r]});class ov extends t.Component{constructor(...e){super(...e),this.state={height:this.props.defaultHeight||0,scaledHeight:this.props.defaultHeight||0,scaledWidth:this.props.defaultWidth||0,width:this.props.defaultWidth||0},this._autoSizer=null,this._detectElementResize=null,this._parentNode=null,this._resizeObserver=null,this._timeoutId=null,this._onResize=()=>{this._timeoutId=null;const{disableHeight:e,disableWidth:t,onResize:r}=this.props;if(this._parentNode){var n,o,i,a;const s=window.getComputedStyle(this._parentNode)||{},l=parseFloat(null!==(n=s.paddingLeft)&&void 0!==n?n:"0"),c=parseFloat(null!==(o=s.paddingRight)&&void 0!==o?o:"0"),u=parseFloat(null!==(i=s.paddingTop)&&void 0!==i?i:"0"),f=parseFloat(null!==(a=s.paddingBottom)&&void 0!==a?a:"0"),p=this._parentNode.getBoundingClientRect(),d=p.height-u-f,h=p.width-l-c,g=this._parentNode.offsetHeight-u-f,m=this._parentNode.offsetWidth-l-c;(e||this.state.height===g&&this.state.scaledHeight===d)&&(t||this.state.width===m&&this.state.scaledWidth===h)||(this.setState({height:g,width:m,scaledHeight:d,scaledWidth:h}),"function"==typeof r&&r({height:g,scaledHeight:d,scaledWidth:h,width:m}))}},this._setRef=e=>{this._autoSizer=e}}componentDidMount(){const{nonce:e}=this.props;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,null!=this._parentNode&&("undefined"!=typeof ResizeObserver?(this._resizeObserver=new ResizeObserver((()=>{this._timeoutId=setTimeout(this._onResize,0)})),this._resizeObserver.observe(this._parentNode)):(this._detectElementResize=function(e){let t,r,n,o,i,a,s;const l="undefined"!=typeof document&&document.attachEvent;if(!l){a=function(e){const t=e.__resizeTriggers__,r=t.firstElementChild,n=t.lastElementChild,o=r.firstElementChild;n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight,o.style.width=r.offsetWidth+1+"px",o.style.height=r.offsetHeight+1+"px",r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight},i=function(e){return e.offsetWidth!==e.__resizeLast__.width||e.offsetHeight!==e.__resizeLast__.height},s=function(e){if(e.target.className&&"function"==typeof e.target.className.indexOf&&e.target.className.indexOf("contract-trigger")<0&&e.target.className.indexOf("expand-trigger")<0)return;const t=this;a(this),this.__resizeRAF__&&Xy(this.__resizeRAF__),this.__resizeRAF__=Zy((function(){i(t)&&(t.__resizeLast__.width=t.offsetWidth,t.__resizeLast__.height=t.offsetHeight,t.__resizeListeners__.forEach((function(r){r.call(t,e)})))}))};let e=!1,l="";n="animationstart";const c="Webkit Moz O ms".split(" ");let u="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),f="";{const t=document.createElement("fakeelement");if(void 0!==t.style.animationName&&(e=!0),!1===e)for(let r=0;r<c.length;r++)if(void 0!==t.style[c[r]+"AnimationName"]){f=c[r],l="-"+f.toLowerCase()+"-",n=u[r],e=!0;break}}r="resizeanim",t="@"+l+"keyframes "+r+" { from { opacity: 0; } to { opacity: 0; } } ",o=l+"animation: 1ms "+r+"; "}return{addResizeListener:function(i,c){if(l)i.attachEvent("onresize",c);else{if(!i.__resizeTriggers__){const l=i.ownerDocument,c=Qy.getComputedStyle(i);c&&"static"===c.position&&(i.style.position="relative"),function(r){if(!r.getElementById("detectElementResize")){const n=(t||"")+".resize-triggers { "+(o||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',i=r.head||r.getElementsByTagName("head")[0],a=r.createElement("style");a.id="detectElementResize",a.type="text/css",null!=e&&a.setAttribute("nonce",e),a.styleSheet?a.styleSheet.cssText=n:a.appendChild(r.createTextNode(n)),i.appendChild(a)}}(l),i.__resizeLast__={},i.__resizeListeners__=[],(i.__resizeTriggers__=l.createElement("div")).className="resize-triggers";const u=l.createElement("div");u.className="expand-trigger",u.appendChild(l.createElement("div"));const f=l.createElement("div");f.className="contract-trigger",i.__resizeTriggers__.appendChild(u),i.__resizeTriggers__.appendChild(f),i.appendChild(i.__resizeTriggers__),a(i),i.addEventListener("scroll",s,!0),n&&(i.__resizeTriggers__.__animationListener__=function(e){e.animationName===r&&a(i)},i.__resizeTriggers__.addEventListener(n,i.__resizeTriggers__.__animationListener__))}i.__resizeListeners__.push(c)}},removeResizeListener:function(e,t){if(l)e.detachEvent("onresize",t);else if(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),!e.__resizeListeners__.length){e.removeEventListener("scroll",s,!0),e.__resizeTriggers__.__animationListener__&&(e.__resizeTriggers__.removeEventListener(n,e.__resizeTriggers__.__animationListener__),e.__resizeTriggers__.__animationListener__=null);try{e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)}catch(e){}}}}}(e),this._detectElementResize.addResizeListener(this._parentNode,this._onResize)),this._onResize()))}componentWillUnmount(){this._parentNode&&(this._detectElementResize&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize),null!==this._timeoutId&&clearTimeout(this._timeoutId),this._resizeObserver&&(this._resizeObserver.observe(this._parentNode),this._resizeObserver.disconnect()))}render(){const{children:e,defaultHeight:r,defaultWidth:n,disableHeight:o=!1,disableWidth:i=!1,nonce:a,onResize:s,style:l={},tagName:c="div",...u}=this.props,{height:f,scaledHeight:p,scaledWidth:d,width:h}=this.state,g={overflow:"visible"},m={};let y=!1;return o||(0===f&&(y=!0),g.height=0,m.height=f,m.scaledHeight=p),i||(0===h&&(y=!0),g.width=0,m.width=h,m.scaledWidth=d),(0,t.createElement)(c,{ref:this._setRef,style:{...g,...l},...u},!y&&e(m))}}const iv=Cg("div",{target:"e2etv5a5",label:"Card"})("width:",(e=>e.width),";height:",(e=>e.height),";margin:",(e=>e.margin),";border:",qe.borders.textField,";border-color:",(e=>e.isSelected&&qe.colors.active),";border-radius:",qe.lengths.borderRadius,";cursor:pointer;overflow:hidden;background-color:",(e=>e.isPrivate&&qe.colors.textFieldBorder),";&:focus{outline:none;}"),av=Cg("div",{target:"e2etv5a4",label:"CardImageWrapper"})("height:",162,"px;",qe.effects.checkerboard,";",qe.shadows.inset,";border-bottom:solid ",qe.lengths.borderWidth," ",qe.colors.textFieldBorder,";position:relative;"),sv=Cg("img",{target:"e2etv5a3",label:"CardImage"})("width:100%;height:",160,"px;object-fit:contain;border-radius:2px 2px 0 0;"),lv=Cg("div",{target:"e2etv5a2",label:"CardFileIcon"})({name:"viljxp",styles:"width:100%;height:160px;object-fit:cover;border-radius:2px 2px 0 0;padding:1em;font-size:3em"}),cv=Cg("p",{target:"e2etv5a1",label:"CardText"})("color:",qe.colors.text,";padding:8px;margin-top:20px;overflow-wrap:break-word;line-height:1.3!important;"),uv=Cg("p",{target:"e2etv5a0",label:"DraftText"})("color:",qe.colors.mediaDraftText,";background-color:",qe.colors.mediaDraftBackground,";position:absolute;padding:8px;border-radius:",qe.lengths.borderRadius," 0 ",qe.lengths.borderRadius," 0;");class fv extends r().Component{render(){const{isSelected:e,displayURL:t,text:r,onClick:n,draftText:o,width:i,height:a,margin:s,isPrivate:l,type:c,isViewableImage:u,isDraft:f}=this.props,p=t.get("url");return(0,xo.jsx)(iv,{isSelected:e,onClick:n,width:i,height:a,margin:s,tabIndex:"-1",isPrivate:l},(0,xo.jsx)(av,null,f?(0,xo.jsx)(uv,{"data-testid":"draft-text"},o):null,p&&u?(0,xo.jsx)(sv,{loading:"lazy",src:p}):(0,xo.jsx)(lv,{"data-testid":"card-file-icon"},c)),(0,xo.jsx)(cv,null,r))}componentDidMount(){const{displayURL:e,loadDisplayURL:t}=this.props;e.get("url")||t()}}fv.propTypes={isSelected:i().bool,displayURL:Vm().map.isRequired,text:i().string.isRequired,onClick:i().func.isRequired,draftText:i().string.isRequired,width:i().string.isRequired,height:i().string.isRequired,margin:i().string.isRequired,isPrivate:i().bool,type:i().string,isViewableImage:i().bool.isRequired,loadDisplayURL:i().func.isRequired,isDraft:i().bool};const pv=fv;function dv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function hv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?dv(Object(r),!0).forEach((function(t){gv(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dv(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function gv(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mv(e){const{rowIndex:t,columnIndex:r,style:n,data:{mediaItems:o,isSelectedFile:i,onAssetClick:a,cardDraftText:s,cardWidth:l,cardHeight:c,isPrivate:u,displayURLs:f,loadDisplayURL:p,columnCount:d,gutter:h}}=e,g=t*d+r;if(g>=o.length)return null;const m=o[g];return(0,xo.jsx)("div",{tabIndex:"0",style:hv(hv({},n),{},{left:n.left+h*r,top:n.top+h,width:n.width-h,height:n.height-h})},(0,xo.jsx)(pv,{key:m.key,isSelected:i(m),text:m.name,onClick:()=>a(m),isDraft:m.draft,draftText:s,width:l,height:c,margin:"0px",isPrivate:u,displayURL:f.get(m.id,m.url?(0,Qe.Map)({url:m.url}):(0,Qe.Map)()),loadDisplayURL:()=>p(m),type:m.type,isViewableImage:m.isViewableImage}))}function yv(e){const{mediaItems:t,setScrollContainerRef:r}=e;return(0,xo.jsx)(bv,{ref:r},(0,xo.jsx)(ov,null,(({height:r,width:n})=>{const o=parseInt(e.cardWidth,10),i=parseInt(e.cardHeight,10),a=parseInt(e.cardMargin,10),s=o+a,l=i+a,c=Math.floor(n/s),u=Math.ceil(t.length/c);return(0,xo.jsx)(Jy,{columnCount:c,columnWidth:s,rowCount:u,rowHeight:l,width:n,height:r,itemData:hv(hv({},e),{},{gutter:a,columnCount:c})},mv)})))}function vv({setScrollContainerRef:e,mediaItems:t,isSelectedFile:r,onAssetClick:n,cardDraftText:o,cardWidth:i,cardHeight:a,cardMargin:s,isPrivate:l,displayURLs:c,loadDisplayURL:u,canLoadMore:f,onLoadMore:p,isPaginating:d,paginatingMessage:h}){return(0,xo.jsx)(bv,{ref:e},(0,xo.jsx)(wv,null,t.map((e=>(0,xo.jsx)(pv,{key:e.key,isSelected:r(e),text:e.name,onClick:()=>n(e),isDraft:e.draft,draftText:o,width:i,height:a,margin:s,isPrivate:l,displayURL:c.get(e.id,e.url?(0,Qe.Map)({url:e.url}):(0,Qe.Map)()),loadDisplayURL:()=>u(e),type:e.type,isViewableImage:e.isViewableImage}))),f?(0,xo.jsx)(Ny,{onEnter:p}):null),d?(0,xo.jsx)(_v,{isPrivate:l},h):null)}const bv=Cg("div",{target:"e1l5oka22",label:"CardGridContainer"})({name:"bv8zlo",styles:"overflow-y:auto;overflow-x:hidden"}),wv=Cg("div",{target:"e1l5oka21",label:"CardGrid"})({name:"15jhlc1",styles:"display:flex;flex-wrap:wrap;margin-left:-10px;margin-right:-10px"}),_v=Cg("h1",{target:"e1l5oka20",label:"PaginatingMessage"})("color:",(e=>e.isPrivate&&qe.colors.textFieldBorder),";");function Sv(e){const{canLoadMore:t,isPaginating:r}=e;return t||r?(0,xo.jsx)(vv,e):(0,xo.jsx)(yv,e)}Sv.propTypes={setScrollContainerRef:i().func.isRequired,mediaItems:i().arrayOf(i().shape({displayURL:i().oneOfType([i().string,i().object]),id:i().string.isRequired,key:i().string.isRequired,name:i().string.isRequired,type:i().string.isRequired,draft:i().bool})).isRequired,isSelectedFile:i().func.isRequired,onAssetClick:i().func.isRequired,canLoadMore:i().bool,onLoadMore:i().func.isRequired,isPaginating:i().bool,paginatingMessage:i().string,cardDraftText:i().string.isRequired,cardWidth:i().string.isRequired,cardMargin:i().string.isRequired,loadDisplayURL:i().func.isRequired,isPrivate:i().bool,displayURLs:i().instanceOf(Qe.Map).isRequired};const xv=Sv,Ov=Cg("div",{target:"e156433y0",label:"EmptyMessageContainer"})("height:100%;width:100%;display:flex;justify-content:center;align-items:center;color:",(e=>e.isPrivate&&qe.colors.textFieldBorder),";");function Ev({content:e,isPrivate:t}){return(0,xo.jsx)(Ov,{isPrivate:t},(0,xo.jsx)("h1",null,e))}Ev.propTypes={content:i().string.isRequired,isPrivate:i().bool};const kv=Ev,Cv="300px",Tv=Cg(Xg,{target:"e4d0svf0",label:"StyledModal"})("display:grid;grid-template-rows:120px auto;width:calc(",Cv," + 20px);background-color:",(e=>e.isPrivate&&qe.colors.grayDark),";@media (min-width: 800px){width:calc(",Cv," * 2 + 20px);}@media (min-width: 1120px){width:calc(",Cv," * 3 + 20px);}@media (min-width: 1440px){width:calc(",Cv," * 4 + 20px);}@media (min-width: 1760px){width:calc(",Cv," * 5 + 20px);}@media (min-width: 2080px){width:calc(",Cv," * 6 + 20px);}h1{color:",(e=>e.isPrivate&&qe.colors.textFieldBorder),";}button:disabled,label[disabled]{background-color:",(e=>e.isPrivate&&"rgba(217, 217, 217, 0.15)"),";}");function Pv({isVisible:e,canInsert:t,files:r,dynamicSearch:n,dynamicSearchActive:o,forImage:i,isLoading:a,isPersisting:s,isDeleting:l,hasNextPage:c,isPaginating:u,privateUpload:f,query:p,selectedFile:d,handleFilter:h,handleQuery:g,toTableData:m,handleClose:y,handleSearchChange:v,handleSearchKeyDown:b,handlePersist:w,handleDelete:_,handleInsert:S,handleDownload:x,setScrollContainerRef:O,handleAssetClick:E,handleLoadMore:k,loadDisplayURL:C,displayURLs:T,t:P}){const j=i?h(r):r,R=!n&&p?g(p,j):j,M=m(R),A=r&&!!r.length,I=j&&!!j.length,D=R&&!!R.length,L=D,N=!L,$=a&&!L&&P("mediaLibrary.mediaLibraryModal.loading")||o&&P("mediaLibrary.mediaLibraryModal.noResults")||!A&&P("mediaLibrary.mediaLibraryModal.noAssetsFound")||!I&&P("mediaLibrary.mediaLibraryModal.noImagesFound")||!D&&P("mediaLibrary.mediaLibraryModal.noResults"),F=L&&!Gn()(d);return(0,xo.jsx)(Tv,{isOpen:e,onClose:y,isPrivate:f},(0,xo.jsx)(by,{t:P,onClose:y,privateUpload:f,forImage:i,onDownload:x,onUpload:w,query:p,onSearchChange:v,onSearchKeyDown:b,searchDisabled:!o&&!I,onDelete:_,canInsert:t,onInsert:S,hasSelection:F,isPersisting:s,isDeleting:l,selectedFile:d}),N?(0,xo.jsx)(kv,{content:$,isPrivate:f}):null,(0,xo.jsx)(xv,{setScrollContainerRef:O,mediaItems:M,isSelectedFile:e=>d.key===e.key,onAssetClick:E,canLoadMore:c,onLoadMore:k,isPaginating:u,paginatingMessage:P("mediaLibrary.mediaLibraryModal.loading"),cardDraftText:P("mediaLibrary.mediaLibraryCard.draft"),cardWidth:"280px",cardHeight:"240px",cardMargin:"10px",isPrivate:f,loadDisplayURL:C,displayURLs:T}))}const jv={displayURL:i().oneOfType([i().string,i().object]).isRequired,id:i().string.isRequired,key:i().string.isRequired,name:i().string.isRequired,queryOrder:i().number,size:i().number,path:i().string.isRequired};Pv.propTypes={isVisible:i().bool,canInsert:i().bool,files:i().arrayOf(i().shape(jv)).isRequired,dynamicSearch:i().bool,dynamicSearchActive:i().bool,forImage:i().bool,isLoading:i().bool,isPersisting:i().bool,isDeleting:i().bool,hasNextPage:i().bool,isPaginating:i().bool,privateUpload:i().bool,query:i().string,selectedFile:i().oneOfType([i().shape(jv),i().shape({})]),handleFilter:i().func.isRequired,handleQuery:i().func.isRequired,toTableData:i().func.isRequired,handleClose:i().func.isRequired,handleSearchChange:i().func.isRequired,handleSearchKeyDown:i().func.isRequired,handlePersist:i().func.isRequired,handleDelete:i().func.isRequired,handleInsert:i().func.isRequired,setScrollContainerRef:i().func.isRequired,handleAssetClick:i().func.isRequired,handleLoadMore:i().func.isRequired,loadDisplayURL:i().func.isRequired,t:i().func.isRequired,displayURLs:i().instanceOf(Qe.Map).isRequired};const Rv=(0,We.Iu)()(Pv);function Mv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Av(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mv(Object(r),!0).forEach((function(t){Iv(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mv(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Iv(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Dv=["jpg","jpeg","webp","gif","png","bmp","tiff","svg","avif"],Lv=[...Dv];class Nv extends r().Component{constructor(...e){super(...e),Iv(this,"state",{selectedFile:{},query:"",isPersisted:!1}),Iv(this,"loadDisplayURL",(e=>{const{loadMediaDisplayURL:t}=this.props;t(e)})),Iv(this,"filterImages",(e=>e.filter((e=>{const t=(0,pr.fileExtension)(e.name).toLowerCase();return Lv.includes(t)})))),Iv(this,"toTableData",(e=>{const t=e&&e.map((({key:e,name:t,id:r,size:n,path:o,queryOrder:i,displayURL:a,draft:s})=>{const l=(0,pr.fileExtension)(t).toLowerCase();return{key:e,id:r,name:t,path:o,type:l.toUpperCase(),size:n,queryOrder:i,displayURL:a,draft:s,isImage:Lv.includes(l),isViewableImage:Dv.includes(l)}})),{sortFields:r}=this.state,n=Qm()(r,"fieldName").concat("queryOrder"),o=Qm()(r,"direction").concat("asc");return To()(t,n,o)})),Iv(this,"handleClose",(()=>{this.props.closeMediaLibrary()})),Iv(this,"handleAssetClick",(e=>{const t=this.state.selectedFile.key===e.key?{}:e;this.setState({selectedFile:t})})),Iv(this,"handlePersist",(async e=>{e.persist(),e.stopPropagation(),e.preventDefault();const{persistMedia:t,privateUpload:r,config:n,t:o,field:i}=this.props,{files:a}=e.dataTransfer||e.target,s=[...a][0],l=n.get("max_file_size");l&&s.size>l?window.alert(o("mediaLibrary.mediaLibrary.fileTooLarge",{size:Math.floor(l/1e3)})):(await t(s,{privateUpload:r,field:i}),this.setState({isPersisted:!0}),this.scrollToTop()),e.target.value=null})),Iv(this,"handleInsert",(()=>{const{selectedFile:e}=this.state,{path:t}=e,{insertMedia:r,field:n}=this.props;r(t,n),this.handleClose()})),Iv(this,"handleDelete",(()=>{const{selectedFile:e}=this.state,{files:t,deleteMedia:r,privateUpload:n,t:o}=this.props;window.confirm(o("mediaLibrary.mediaLibrary.onDelete"))&&r(t.find((t=>e.key===t.key)),{privateUpload:n}).then((()=>{this.setState({selectedFile:{}})}))})),Iv(this,"handleDownload",(()=>{const{selectedFile:e}=this.state,{displayURLs:t}=this.props,r=t.getIn([e.id,"url"])||e.url;if(!r)return;const n=e.name,o=document.createElement("a");o.setAttribute("href",r),o.setAttribute("download",n),o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o),this.setState({selectedFile:{}})})),Iv(this,"handleLoadMore",(()=>{const{loadMedia:e,dynamicSearchQuery:t,page:r,privateUpload:n}=this.props;e({query:t,page:r+1,privateUpload:n})})),Iv(this,"handleSearchKeyDown",(async e=>{const{dynamicSearch:t,loadMedia:r,privateUpload:n}=this.props;"Enter"===e.key&&t&&(await r({query:this.state.query,privateUpload:n}),this.scrollToTop())})),Iv(this,"scrollToTop",(()=>{this.scrollContainerRef.scrollTop=0})),Iv(this,"handleSearchChange",(e=>{this.setState({query:e.target.value})})),Iv(this,"queryFilter",((e,t)=>{const r=e.replace(/ /g,""),n=fr().filter(r,t,{extract:e=>e.name}).map(((e,r)=>Av(Av({},t[e.index]),{},{queryIndex:r})));return n}))}componentDidMount(){this.props.loadMedia()}UNSAFE_componentWillReceiveProps(e){!this.props.isVisible&&e.isVisible&&this.setState({selectedFile:{},query:""}),this.state.isPersisted&&this.setState({selectedFile:e.files[0],isPersisted:!1})}componentDidUpdate(e){!e.isVisible&&this.props.isVisible&&e.privateUpload!==this.props.privateUpload&&this.props.loadMedia({privateUpload:this.props.privateUpload}),this.state.isPersisted&&this.setState({selectedFile:this.props.files[0],isPersisted:!1})}render(){const{isVisible:e,canInsert:t,files:r,dynamicSearch:n,dynamicSearchActive:o,forImage:i,isLoading:a,isPersisting:s,isDeleting:l,hasNextPage:c,isPaginating:u,privateUpload:f,displayURLs:p,t:d}=this.props;return(0,xo.jsx)(Rv,{isVisible:e,canInsert:t,files:r,dynamicSearch:n,dynamicSearchActive:o,forImage:i,isLoading:a,isPersisting:s,isDeleting:l,hasNextPage:c,isPaginating:u,privateUpload:f,query:this.state.query,selectedFile:this.state.selectedFile,handleFilter:this.filterImages,handleQuery:this.queryFilter,toTableData:this.toTableData,handleClose:this.handleClose,handleSearchChange:this.handleSearchChange,handleSearchKeyDown:this.handleSearchKeyDown,handlePersist:this.handlePersist,handleDelete:this.handleDelete,handleInsert:this.handleInsert,handleDownload:this.handleDownload,setScrollContainerRef:e=>this.scrollContainerRef=e,handleAssetClick:this.handleAssetClick,handleLoadMore:this.handleLoadMore,displayURLs:p,loadDisplayURL:this.loadDisplayURL,t:d})}}Iv(Nv,"propTypes",{isVisible:i().bool,loadMediaDisplayURL:i().func,displayURLs:Vm().map,canInsert:i().bool,files:i().arrayOf(i().shape(jv)).isRequired,dynamicSearch:i().bool,dynamicSearchActive:i().bool,forImage:i().bool,isLoading:i().bool,isPersisting:i().bool,isDeleting:i().bool,hasNextPage:i().bool,isPaginating:i().bool,privateUpload:i().bool,config:Vm().map,loadMedia:i().func.isRequired,dynamicSearchQuery:i().string,page:i().number,persistMedia:i().func.isRequired,deleteMedia:i().func.isRequired,insertMedia:i().func.isRequired,closeMediaLibrary:i().func.isRequired,t:i().func.isRequired}),Iv(Nv,"defaultProps",{files:[]});const $v=H((function(e){const{mediaLibrary:t}=e,r=t.get("field");return Av({},{isVisible:t.get("isVisible"),canInsert:t.get("canInsert"),files:qa(e,r),displayURLs:t.get("displayURLs"),dynamicSearch:t.get("dynamicSearch"),dynamicSearchActive:t.get("dynamicSearchActive"),dynamicSearchQuery:t.get("dynamicSearchQuery"),forImage:t.get("forImage"),isLoading:t.get("isLoading"),isPersisting:t.get("isPersisting"),isDeleting:t.get("isDeleting"),privateUpload:t.get("privateUpload"),config:t.get("config"),page:t.get("page"),hasNextPage:t.get("hasNextPage"),isPaginating:t.get("isPaginating"),field:r})}),{loadMedia:ka,persistMedia:Ta,deleteMedia:Pa,insertMedia:Oa,loadMediaDisplayURL:ja,closeMediaLibrary:function(){return(e,t)=>{const r=t().mediaLibrary.get("externalLibrary");r&&r.hide(),e({type:ia})}}})((0,We.Iu)()(Nv));r().Component,r().Component;var Fv=function(e,t){return"function"==typeof e?e(t):e},Bv=function(e,t){return"string"==typeof e?de(e,null,null,t):e},Uv=function(e){return e},zv=r().forwardRef;void 0===zv&&(zv=Uv);var qv=zv((function(e,t){var n=e.innerRef,o=e.navigate,i=e.onClick,a=h(e,["innerRef","navigate","onClick"]),s=a.target,l=d({},a,{onClick:function(e){try{i&&i(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||s&&"_self"!==s||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),o())}});return l.ref=Uv!==zv&&t||n,r().createElement("a",l)})),Wv=zv((function(e,t){var n=e.component,o=void 0===n?qv:n,i=e.replace,a=e.to,s=e.innerRef,l=h(e,["component","replace","to","innerRef"]);return r().createElement(je.Consumer,null,(function(e){e||se(!1);var n=e.history,c=Bv(Fv(a,e.location),e.location),u=c?n.createHref(c):"",f=d({},l,{href:u,navigate:function(){var t=Fv(a,e.location),r=pe(e.location)===pe(Bv(t));(i||r?n.replace:n.push)(t)}});return Uv!==zv?f.ref=t||s:f.innerRef=s,r().createElement(o,f)}))})),Hv=function(e){return e},Vv=r().forwardRef;void 0===Vv&&(Vv=Hv);var Gv=Vv((function(e,t){var n=e["aria-current"],o=void 0===n?"page":n,i=e.activeClassName,a=void 0===i?"active":i,s=e.activeStyle,l=e.className,c=e.exact,u=e.isActive,f=e.location,p=e.sensitive,g=e.strict,m=e.style,y=e.to,v=e.innerRef,b=h(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return r().createElement(je.Consumer,null,(function(e){e||se(!1);var n=f||e.location,i=Bv(Fv(y,n),n),h=i.pathname,w=h&&h.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),_=w?Be(n.pathname,{path:w,exact:c,sensitive:p,strict:g}):null,S=!!(u?u(_,n):_),x="function"==typeof l?l(S):l,O="function"==typeof m?m(S):m;S&&(x=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter((function(e){return e})).join(" ")}(x,a),O=d({},O,s));var E=d({"aria-current":S&&o||null,className:x,style:O,to:i},b);return Hv!==Vv?E.ref=t||v:E.innerRef=v,r().createElement(Wv,E)}))}));function Kv(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Yv=Cg("div",{target:"e6w847r7",label:"SearchContainer"})("margin:0 12px;position:relative;",qe.Icon,"{position:absolute;top:0;left:6px;z-index:",qe.zIndex.zIndex2,";height:100%;display:flex;align-items:center;pointer-events:none;}"),Jv=Cg("div",{target:"e6w847r6",label:"InputContainer"})({name:"1dbubah",styles:"display:flex;align-items:center;position:relative"}),Qv=Cg("input",{target:"e6w847r5",label:"SearchInput"})("background-color:#eff0f4;border-radius:",qe.lengths.borderRadius,";font-size:14px;padding:10px 6px 10px 34px;width:100%;position:relative;z-index:",qe.zIndex.zIndex1,";&:focus{outline:none;box-shadow:inset 0 0 0 2px ",qe.colorsRaw.blue,";}"),Xv=Cg("div",{target:"e6w847r4",label:"SuggestionsContainer"})({name:"pw7jst",styles:"position:relative;width:100%"}),Zv=Cg("ul",{target:"e6w847r3",label:"Suggestions"})("position:absolute;top:6px;left:0;right:0;padding:10px 0;margin:0;list-style:none;background-color:#fff;border-radius:",qe.lengths.borderRadius,";border:1px solid ",qe.colors.textFieldBorder,";z-index:",qe.zIndex.zIndex1,";"),eb=Cg("li",{target:"e6w847r2",label:"SuggestionHeader"})("padding:0 6px 6px 34px;font-size:12px;color:",qe.colors.text,";"),tb=Cg("li",{target:"e6w847r1",label:"SuggestionItem"})((({isActive:e})=>`\n color: ${e?qe.colors.active:qe.colorsRaw.grayDark};\n background-color: ${e?qe.colors.activeBackground:"inherit"};\n padding: 6px 6px 6px 34px;\n cursor: pointer;\n position: relative;\n\n &:hover {\n color: ${qe.colors.active};\n background-color: ${qe.colors.activeBackground};\n }\n`),""),rb=Cg("div",{target:"e6w847r0",label:"SuggestionDivider"})({name:"1d3w5wq",styles:"width:100%"});class nb extends r().Component{constructor(...e){super(...e),Kv(this,"state",{query:this.props.searchTerm,suggestionsVisible:!1,selectedCollectionIdx:this.getSelectedSelectionBasedOnProps()}),Kv(this,"submitSearch",(()=>{const{onSubmit:e,collections:t}=this.props,{selectedCollectionIdx:r,query:n}=this.state;this.toggleSuggestions(!1),-1!==r?e(n,t.toIndexedSeq().getIn([r,"name"])):e(n)})),Kv(this,"handleKeyDown",(e=>{const{suggestionsVisible:t}=this.state;"Enter"===e.key&&this.submitSearch(),t&&("Escape"===e.key&&this.toggleSuggestions(!1),"ArrowDown"===e.key?(this.selectNextSuggestion(),e.preventDefault()):"ArrowUp"===e.key&&(this.selectPreviousSuggestion(),e.preventDefault()))})),Kv(this,"handleQueryChange",(e=>{this.setState({query:e}),this.toggleSuggestions(""!==e),""===e&&this.resetSelectedSuggestion()})),Kv(this,"handleSuggestionClick",((e,t)=>{this.setState({selectedCollectionIdx:t},this.submitSearch),e.preventDefault()}))}componentDidUpdate(e){if(e.collection!==this.props.collection){const e=this.getSelectedSelectionBasedOnProps();this.setState({selectedCollectionIdx:e})}}getSelectedSelectionBasedOnProps(){const{collection:e,collections:t}=this.props;return e?t.keySeq().indexOf(e.get("name")):-1}toggleSuggestions(e){this.setState({suggestionsVisible:e})}selectNextSuggestion(){const{collections:e}=this.props,{selectedCollectionIdx:t}=this.state;this.setState({selectedCollectionIdx:Math.min(t+1,e.size-1)})}selectPreviousSuggestion(){const{selectedCollectionIdx:e}=this.state;this.setState({selectedCollectionIdx:Math.max(e-1,-1)})}resetSelectedSuggestion(){this.setState({selectedCollectionIdx:-1})}render(){const{collections:e,t}=this.props,{suggestionsVisible:r,selectedCollectionIdx:n,query:o}=this.state;return(0,xo.jsx)(Yv,{onBlur:()=>this.toggleSuggestions(!1),onFocus:()=>this.toggleSuggestions(""!==o)},(0,xo.jsx)(Jv,null,(0,xo.jsx)(qe.Icon,{type:"search"}),(0,xo.jsx)(Qv,{onChange:e=>this.handleQueryChange(e.target.value),onKeyDown:this.handleKeyDown,onClick:()=>this.toggleSuggestions(!0),placeholder:t("collection.sidebar.searchAll"),value:o})),r&&(0,xo.jsx)(Xv,null,(0,xo.jsx)(Zv,null,(0,xo.jsx)(eb,null,t("collection.sidebar.searchIn")),(0,xo.jsx)(tb,{isActive:-1===n,onClick:e=>this.handleSuggestionClick(e,-1),onMouseDown:e=>e.preventDefault()},t("collection.sidebar.allCollections")),(0,xo.jsx)(rb,null),e.toIndexedSeq().map(((e,t)=>(0,xo.jsx)(tb,{key:t,isActive:t===n,onClick:e=>this.handleSuggestionClick(e,t),onMouseDown:e=>e.preventDefault()},e.get("label")))))))}}Kv(nb,"propTypes",{collections:Vm().map.isRequired,collection:Vm().map,searchTerm:i().string.isRequired,onSubmit:i().func.isRequired,t:i().func.isRequired});const ob=(0,We.Iu)()(nb);function ib(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ab(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ib(Object(r),!0).forEach((function(t){sb(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ib(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function sb(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{addFileTemplateFields:lb}=hr.stringTemplate,cb=Cg("div",{target:"eh84wlq5",label:"NodeTitleContainer"})({name:"1vcob1d",styles:"display:flex;justify-content:center;align-items:center"}),ub=Cg("div",{target:"eh84wlq4",label:"NodeTitle"})({name:"qamjgr",styles:"margin-right:4px"}),fb=Cg("div",{target:"eh84wlq3",label:"Caret"})({name:"1lo1a34",styles:"position:relative;top:2px"}),pb=Cg(fb,{target:"eh84wlq2",label:"CaretDown"})(qe.components.caretDown,";color:currentColor;"),db=Cg(fb,{target:"eh84wlq1",label:"CaretRight"})(qe.components.caretRight,";color:currentColor;left:2px;"),hb=Cg(Gv,{target:"eh84wlq0",label:"TreeNavLink"})("display:flex;font-size:14px;font-weight:500;align-items:center;padding:8px;padding-left:",(e=>16*e.depth+18),"px;border-left:2px solid #fff;",qe.Icon,"{margin-right:4px;flex-shrink:0;}",(e=>(0,xo.css)("&:hover,&:active,&.",e.activeClassName,"{color:",qe.colors.active,";background-color:",qe.colors.activeBackground,";border-left-color:#4863c6;};label:TreeNavLink;")),";");function gb(e){var t;const r=e.isRoot?e.title:(null===(t=e.children.find((e=>!e.isDir&&e.title)))||void 0===t?void 0:t.title)||e.title;return r}function mb(e){const{collection:t,treeData:n,depth:o=0,onToggle:i}=e,a=t.get("name");return Zt()(n,gb).map((e=>{var n;if(e.children.length<=1&&(null===(n=e.children[0])||void 0===n||!n.isDir)&&o>0)return null;let s=`/collections/${a}`;o>0&&(s=`${s}/filter${e.path}`);const l=gb(e),c=0===o||e.children.some((e=>e.children.some((e=>e.isDir))));return(0,xo.jsx)(r().Fragment,{key:e.path},(0,xo.jsx)(hb,{exact:!0,to:s,activeClassName:"sidebar-active",onClick:()=>i({node:e,expanded:!e.expanded}),depth:o,"data-testid":e.path},(0,xo.jsx)(qe.Icon,{type:"write"}),(0,xo.jsx)(cb,null,(0,xo.jsx)(ub,null,l),c&&(e.expanded?(0,xo.jsx)(pb,null):(0,xo.jsx)(db,null)))),e.expanded&&(0,xo.jsx)(mb,{collection:t,depth:o+1,treeData:e.children,onToggle:i}))}))}function yb(e,t){return function e(r){for(const n of r)t(n),e(n.children)}(e)}function vb(e,t){const r=e.get("folder"),n=t.toJS().map((e=>ab(ab({},e),{},{path:e.path.slice(r.length)}))),o=n.reduce(((e,t)=>{let r=(0,dr.dirname)(t.path);for(;!e[r]&&r&&"/"!==r;){const t=r.split(dr.sep);e[r]=t.pop(),r=t.length&&t.join(dr.sep)}return e}),{}),i=[{title:(e=e.getIn(["nested","summary"])?e.set("summary",e.getIn(["nested","summary"])):e.delete("summary")).get("label"),path:"/",isDir:!0,isRoot:!0},...Object.entries(o).map((([e,t])=>({title:t,path:e,isDir:!0,isRoot:!1}))),...n.map(((r,n)=>{let o=t.get(n);o=o.set("data",lb(o.get("path"),o.get("data")));const i=Tc(e,o);return ab(ab({},r),{},{title:i,isDir:!1,isRoot:!1})}))],a=i.reduce(((e,t)=>{const r="/"===t.path?"":(0,dr.dirname)(t.path);return e[r]?e[r].push(t):e[r]=[t],e}),{}),s=a[""].reduce((function e(t,r){const n=r;let o=[];return a[n.path]&&(o=a[n.path].reduce(e,[])),t.push(ab(ab({},n),{},{children:o})),t}),[]);return s}mb.propTypes={collection:Vm().map.isRequired,depth:i().number,treeData:i().array.isRequired,onToggle:i().func.isRequired};class bb extends r().Component{constructor(e){super(e),sb(this,"onToggle",(({node:e,expanded:t})=>{if(!this.state.selected||this.state.selected.path===e.path||t){const r=function(e,t,r){let n=!1;return function e(o){if(n)return o;for(let e=0;e<o.length;e++)if(o[e].path===t.path)return o[e]=r(t),n=!0,o;return o.forEach((t=>e(t.children))),o}([...e])}(this.state.treeData,e,(e=>ab(ab({},e),{},{expanded:t})));this.setState({treeData:r,selected:e,useFilter:!1})}else this.setState({selected:e,useFilter:!1})})),this.state={treeData:vb(this.props.collection,this.props.entries),selected:null,useFilter:!0}}componentDidUpdate(e){const{collection:t,entries:r,filterTerm:n}=this.props;if(t!==e.collection||r!==e.entries||n!==e.filterTerm){const e={};yb(this.state.treeData,(t=>{t.expanded&&(e[t.path]=!0)}));const o=vb(t,r),i=`/${n}`;yb(o,(t=>{(e[t.path]||this.state.useFilter&&i.startsWith(t.path))&&(t.expanded=!0)})),this.setState({treeData:o})}}render(){const{treeData:e}=this.state,{collection:t}=this.props;return(0,xo.jsx)(mb,{collection:t,treeData:e,onToggle:this.onToggle})}}sb(bb,"propTypes",{collection:Vm().map.isRequired,entries:Vm().list.isRequired,filterTerm:i().string});const wb=H((function(e,t){const{collection:r}=t;return{entries:Zl(e.entries,r)||(0,Qe.List)()}}),null)(bb);function _b(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Sb={sidebarNavLinkActive:(0,xo.css)("color:",qe.colors.active,";background-color:",qe.colors.activeBackground,";border-left-color:#4863c6;;label:sidebarNavLinkActive;")},xb=Cg("aside",{target:"e1t18l343",label:"SidebarContainer"})(qe.components.card,";width:250px;padding:8px 0 12px;position:fixed;max-height:calc(100vh - 112px);display:flex;flex-direction:column;"),Ob=Cg("h2",{target:"e1t18l342",label:"SidebarHeading"})("font-size:22px;font-weight:600;line-height:37px;padding:0;margin:10px 20px;color:",qe.colors.textLead,";"),Eb=Cg("ul",{target:"e1t18l341",label:"SidebarNavList"})({name:"14vcqsr",styles:"margin:12px 0 0;list-style:none;overflow:auto"}),kb=Cg(Gv,{target:"e1t18l340",label:"SidebarNavLink"})("display:flex;font-size:14px;font-weight:500;align-items:center;padding:8px 18px;border-left:2px solid #fff;z-index:-1;",qe.Icon,"{margin-right:4px;flex-shrink:0;}",(e=>(0,xo.css)("&:hover,&:active,&.",e.activeClassName,"{",Sb.sidebarNavLinkActive,";};label:SidebarNavLink;")),";");class Cb extends r().Component{constructor(...e){super(...e),_b(this,"renderLink",((e,t)=>{const r=e.get("name");return e.has("nested")?(0,xo.jsx)("li",{key:r},(0,xo.jsx)(wb,{collection:e,filterTerm:t,"data-testid":r})):(0,xo.jsx)("li",{key:r},(0,xo.jsx)(kb,{to:`/collections/${r}`,activeClassName:"sidebar-active","data-testid":r},(0,xo.jsx)(qe.Icon,{type:"write"}),e.get("label")))}))}render(){const{collections:e,collection:t,isSearchEnabled:r,searchTerm:n,t:o,filterTerm:i}=this.props;return(0,xo.jsx)(xb,null,(0,xo.jsx)(Ob,null,o("collection.sidebar.collections")),r&&(0,xo.jsx)(ob,{searchTerm:n,collections:e,collection:t,onSubmit:(e,t)=>function(e,t){t?ns.push(`/collections/${t}/search/${e}`):ns.push(`/search/${e}`)}(e,t)}),(0,xo.jsx)(Eb,null,e.toList().filter((e=>!0!==e.get("hide"))).map((e=>this.renderLink(e,i)))))}}_b(Cb,"propTypes",{collections:Vm().map.isRequired,collection:Vm().map,isSearchEnabled:i().bool,searchTerm:i().string,filterTerm:i().string,t:i().func.isRequired});const Tb=(0,We.Iu)()(Cb),Pb=Cg("div",{target:"ei8nkzc4",label:"CollectionTopContainer"})(qe.components.cardTop,";margin-bottom:22px;"),jb=Cg("div",{target:"ei8nkzc3",label:"CollectionTopRow"})({name:"bcffy2",styles:"display:flex;align-items:center;justify-content:space-between"}),Rb=Cg("h1",{target:"ei8nkzc2",label:"CollectionTopHeading"})(qe.components.cardTopHeading,";"),Mb=Cg(Wv,{target:"ei8nkzc1",label:"CollectionTopNewButton"})(qe.buttons.button,";",qe.shadows.dropDeep,";",qe.buttons.default,";",qe.buttons.gray,";padding:0 30px;"),Ab=Cg("p",{target:"ei8nkzc0",label:"CollectionTopDescription"})(qe.components.cardTopDescription,";margin-bottom:0;");function Ib({collection:e,newEntryUrl:t,t:r}){const{collectionLabel:n,collectionLabelSingular:o,collectionDescription:i}=function(e){return{collectionLabel:e.get("label"),collectionLabelSingular:e.get("label_singular"),collectionDescription:e.get("description")}}(e);return(0,xo.jsx)(Pb,null,(0,xo.jsx)(jb,null,(0,xo.jsx)(Rb,null,n),t?(0,xo.jsx)(Mb,{to:t},r("collection.collectionTop.newButton",{collectionLabel:o||n})):null),i?(0,xo.jsx)(Ab,null,i):null)}Ib.propTypes={collection:Vm().map.isRequired,newEntryUrl:i().string,t:i().func.isRequired};const Db=(0,We.Iu)()(Ib);var Lb=__webpack_require__(83465),Nb=__webpack_require__.n(Lb);function $b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$b(Object(r),!0).forEach((function(t){Bb(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Bb(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ub=Cg("li",{target:"effeus48",label:"ListCard"})(qe.components.card,";width:",qe.lengths.topCardWidth,";margin-left:12px;margin-bottom:10px;overflow:hidden;"),zb=Cg(Wv,{target:"effeus47",label:"ListCardLink"})("display:block;max-width:100%;padding:16px 20px;&:hover{background-color:",qe.colors.foreground,";}"),qb=Cg("li",{target:"effeus46",label:"GridCard"})(qe.components.card,";flex:0 0 335px;height:240px;overflow:hidden;margin-left:12px;margin-bottom:16px;"),Wb=Cg(Wv,{target:"effeus45",label:"GridCardLink"})("display:block;height:100%;outline-offset:-2px;&,&:hover{background-color:",qe.colors.foreground,";color:",qe.colors.text,";}"),Hb=Cg("h2",{target:"effeus44",label:"CollectionLabel"})("font-size:12px;color:",qe.colors.textLead,";text-transform:uppercase;"),Vb=Cg("h2",{target:"effeus43",label:"ListCardTitle"})({name:"1ykowef",styles:"margin-bottom:0"}),Gb=Cg("h2",{target:"effeus42",label:"CardHeading"})({name:"m483k0",styles:"margin:0 0 2px"}),Kb=Cg("div",{target:"effeus41",label:"CardBody"})("padding:16px 20px;height:90px;position:relative;margin-bottom:",(e=>e.hasImage&&0),";&:after{content:'';position:absolute;display:block;z-index:",qe.zIndex.zIndex1,";bottom:0;left:-20%;height:140%;width:140%;box-shadow:inset 0 -15px 24px ",qe.colorsRaw.white,";}"),Yb=Cg("div",{target:"effeus40",label:"CardImage"})("background-image:url(",(e=>e.src),");background-position:center center;background-size:cover;background-repeat:no-repeat;height:150px;"),Jb=H((function(e,t){var r;const{entry:n,inferredFields:o,collection:i}=t,a=n.get("data"),s=Tc(i,n);let l=a.get(o.imageField);l&&(l=encodeURI(l));const c=xf(e.medias);return{summary:s,path:`/collections/${i.get("name")}/entries/${n.get("slug")}`,image:l,imageFolder:null===(r=i.get("fields"))||void 0===r?void 0:r.find((e=>e.get("name")===o.imageField&&"image"===e.get("widget"))),isLoadingAsset:c}}),(function(e){return{boundGetAsset:(t,r)=>ts(e,t,r)}}),(function(e,t,r){return Fb(Fb(Fb(Fb({},e),t),r),{},{getAsset:t.boundGetAsset(r.collection,r.entry)})}))((function({path:e,summary:t,image:r,imageField:n,collectionLabel:o,viewStyle:i=Rl,getAsset:a}){return i===Rl?(0,xo.jsx)(Ub,null,(0,xo.jsx)(zb,{to:e},o?(0,xo.jsx)(Hb,null,o):null,(0,xo.jsx)(Vb,null,t))):i===Ml?(0,xo.jsx)(qb,null,(0,xo.jsx)(Wb,{to:e},(0,xo.jsx)(Kb,{hasImage:r},o?(0,xo.jsx)(Hb,null,o):null,(0,xo.jsx)(Gb,null,t)),r?(0,xo.jsx)(Yb,{src:a(r,n).toString()}):null)):void 0})),Qb=Jb;function Xb(){return Xb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xb.apply(this,arguments)}function Zb(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ew=Cg("ul",{target:"etq0ss00",label:"CardsGrid"})({name:"1dbthoi",styles:"display:flex;flex-flow:row wrap;list-style-type:none;margin-left:-12px;margin-top:16px;margin-bottom:16px"});class tw extends r().Component{constructor(...e){super(...e),Zb(this,"hasMore",(()=>{var e,t;return null===(e=this.props.cursor)||void 0===e||null===(t=e.actions)||void 0===t?void 0:t.has("append_next")})),Zb(this,"handleLoadMore",(()=>{this.hasMore()&&this.props.handleCursorActions("append_next")})),Zb(this,"inferFields",(e=>{const t=Cc(e,"title"),r=Cc(e,"description"),n=Cc(e,"image"),o=yc(e),i=[t,r,n],a=o&&o.filter((e=>-1===i.indexOf(e.get("name"))));return{titleField:t,descriptionField:r,imageField:n,remainingFields:a}})),Zb(this,"renderCardsForSingleCollection",(()=>{const{collections:e,entries:t,viewStyle:r}=this.props,n={collection:e,inferredFields:this.inferFields(e),viewStyle:r};return t.map(((e,t)=>(0,xo.jsx)(Qb,Xb({},n,{entry:e,key:t}))))})),Zb(this,"renderCardsForMultipleCollections",(()=>{const{collections:e,entries:t}=this.props,r=1===e.size;return t.map(((t,n)=>{const o=t.get("collection"),i=e.find((e=>e.get("name")===o)),a=!r&&i.get("label"),s={collection:i,entry:t,inferredFields:this.inferFields(i),collectionLabel:a};return(0,xo.jsx)(Qb,Xb({},s,{key:n}))}))}))}render(){const{collections:e,page:t}=this.props;return(0,xo.jsx)("div",null,(0,xo.jsx)(ew,null,Qe.Map.isMap(e)?this.renderCardsForSingleCollection():this.renderCardsForMultipleCollections(),this.hasMore()&&(0,xo.jsx)(Ny,{key:t,onEnter:this.handleLoadMore})))}}Zb(tw,"propTypes",{collections:Vm().iterable.isRequired,entries:Vm().list,viewStyle:i().string,cursor:i().any.isRequired,handleCursorActions:i().func.isRequired,page:i().number});const rw=Cg("div",{target:"e1d0i3na1",label:"PaginationMessage"})("width:",qe.lengths.topCardWidth,";padding:16px;text-align:center;"),nw=Cg(rw,{target:"e1d0i3na0",label:"NoEntriesMessage"})({name:"yz1nei",styles:"margin-top:16px"});function ow({collections:e,entries:t,isFetching:n,viewStyle:o,cursor:i,handleCursorActions:a,t:s,page:l}){var c;const u=[s("collection.entries.loadingEntries"),s("collection.entries.cachingEntries"),s("collection.entries.longerLoading")];return n&&void 0===l?(0,xo.jsx)(qe.Loader,{active:!0},u):t&&t.size>0||(null==i||null===(c=i.actions)||void 0===c?void 0:c.has("append_next"))?(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(tw,{collections:e,entries:t,viewStyle:o,cursor:i,handleCursorActions:a,page:l}),n&&void 0!==l&&t.size>0?(0,xo.jsx)(rw,null,s("collection.entries.loadingEntries")):null):(0,xo.jsx)(nw,null,s("collection.entries.noEntries"))}ow.propTypes={collections:Vm().iterable.isRequired,entries:Vm().list,page:i().number,isFetching:i().bool,viewStyle:i().string,cursor:i().any.isRequired,handleCursorActions:i().func.isRequired,t:i().func.isRequired};const iw=(0,We.Iu)()(ow);function aw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sw=Cg("h2",{target:"eucqz2q1",label:"GroupHeading"})("font-size:22px;font-weight:600;line-height:37px;padding-inline-start:20px;color:",qe.colors.textLead,";"),lw=Cg("div",{target:"eucqz2q0",label:"GroupContainer"})("");function cw(e,t){return e.filter((e=>t.has(e.get("path"))))}class uw extends r().Component{constructor(...e){super(...e),aw(this,"handleCursorActions",((e,t)=>{const{collection:r,traverseCollectionCursor:n}=this.props;n(r,t)}))}componentDidMount(){const{collection:e,entriesLoaded:t,loadEntries:r}=this.props;e&&!t&&r(e)}componentDidUpdate(e){const{collection:t,entriesLoaded:r,loadEntries:n}=this.props;t===e.collection||r||n(t)}render(){const{collection:e,entries:t,groups:r,isFetching:n,viewStyle:o,cursor:i,page:a,t:s}=this.props,l=({entries:t})=>(0,xo.jsx)(iw,{collections:e,entries:t,isFetching:n,collectionName:e.get("label"),viewStyle:o,cursor:i,handleCursorActions:Nb()(this.handleCursorActions,i),page:a});return r&&r.length>0?function(e,t,r,n){return e.map((e=>{const o=function(e,t){const{label:r,value:n}=e;return void 0===n?t("collection.groups.other"):"boolean"==typeof n?n?r:t("collection.groups.negateLabel",{label:r}):`${r} ${n}`.trim()}(e,n);return(0,xo.jsx)(lw,{key:e.id,id:e.id},(0,xo.jsx)(sw,null,o),(0,xo.jsx)(r,{entries:cw(t,e.paths)}))}))}(r,t,l,s):(0,xo.jsx)(l,{entries:t})}}aw(uw,"propTypes",{collection:Vm().map.isRequired,page:i().number,entries:Vm().list,groups:i().array,isFetching:i().bool.isRequired,viewStyle:i().string,cursor:i().object.isRequired,loadEntries:i().func.isRequired,traverseCollectionCursor:i().func.isRequired,entriesLoaded:i().bool});const fw={loadEntries:kl,traverseCollectionCursor:function(e,t){return async(r,n)=>{const o=n(),i=e.get("name");if(o.entries.getIn(["pages",`${i}`,"isFetching"]))return;const a=rf(o.config),{action:s,append:l}=Ol.has(t)?Ol.get(t).toJS():{action:t,append:!1},c=Wi(o.cursors,e.get("name"));if(c.meta.get("usingOldPaginationAPI",!1))return r(kl(e,c.data.get("nextPage")));try{var u;r(dl(e));const{entries:t,cursor:n}=await function(e,t,r){if(!t.actions.has(r))throw new Error(`The current cursor does not support the pagination action "${r}".`);return e.traverseCursor(t,r)}(a,c,s),o=null===(u=n.meta)||void 0===u?void 0:u.get("page");return r(hl(e,t,o,El(n),l))}catch(t){return console.error(t),r(ea({message:{details:t,key:"ui.toast.onFailToLoadEntries"},type:"error",dismissAfter:8e3})),Promise.reject(r(gl(e,t)))}}}},pw=H((function(e,t){const{collection:r,viewStyle:n,filterTerm:o}=t,i=e.entries.getIn(["pages",r.get("name"),"page"]);let a=Zl(e.entries,r);const s=function(e,t){const r=t.get("name"),n=Xl(e,r),o=function(e,t){const r=Kl(e,t),n=null==r?void 0:r.valueSeq().find((e=>!0===(null==e?void 0:e.get("active"))));return n}(e,r);if(void 0===o)return[];let i={};const a=vo()(n.toArray(),(e=>{const t=function(e,t){const r=t.get("label"),n=t.get("field"),o=e.getIn(["data",...Dl(n)]);if(void 0===o)return{id:"missing_value",label:r,value:o};const i=String(o);if(t.has("pattern")){const e=t.get("pattern");let o="";try{const t=new RegExp(e),r=i.match(t);r&&(o=r[0])}catch(t){console.warn(`Invalid view group pattern '${e}' for field '${n}'`,t)}return{id:`${r}${o}`,label:r,value:o}}return{id:`${r}${o}`,label:r,value:"boolean"==typeof o?o:i}}(e,o);return i=Il(Il({},i),{},{[t.id]:t}),t.id})),s=Object.entries(a).map((([e,t])=>Il(Il({},i[e]),{},{paths:(0,Qe.Set)(t.map((e=>e.get("path"))))})));return s}(e.entries,r);r.has("nested")&&(a=function(e,t,r){return r.filter((r=>{const n=r.get("path").slice(t.length+1);return!!n.startsWith(e)&&(e?2===n.slice(e.length+1).split("/").length:n.split("/").length<=2)}))}(o||"",r.get("folder"),a));const l=function(e,t){return!!e.getIn(["pages",t])}(e.entries,r.get("name")),c=ec(e.entries,r.get("name")),u=Wi(e.cursors,r.get("name"));return{collection:r,page:i,entries:a,groups:s,entriesLoaded:l,isFetching:c,viewStyle:n,cursor:pr.Cursor.create(u).clearData()}}),fw)(uw),dw=(0,We.Iu)()(pw);function hw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class gw extends r().Component{constructor(...e){super(...e),hw(this,"getCursor",(()=>{const{page:e}=this.props;return pr.Cursor.create({actions:isNaN(e)?[]:["append_next"]})})),hw(this,"handleCursorActions",(e=>{const{page:t,searchTerm:r,searchEntries:n,collectionNames:o}=this.props;"append_next"===e&&n(r,o,t+1)}))}componentDidMount(){const{searchTerm:e,searchEntries:t,collectionNames:r}=this.props;t(e,r)}componentDidUpdate(e){const{searchTerm:t,collectionNames:r}=this.props;if(e.searchTerm===t&&bi()(e.collectionNames,r))return;const{searchEntries:n}=e;n(t,r)}componentWillUnmount(){this.props.clearSearch()}render(){const{collections:e,entries:t,isFetching:r}=this.props;return(0,xo.jsx)(iw,{cursor:this.getCursor(),handleCursorActions:this.handleCursorActions,collections:e,entries:t,isFetching:r})}}hw(gw,"propTypes",{isFetching:i().bool,searchEntries:i().func.isRequired,clearSearch:i().func.isRequired,searchTerm:i().string.isRequired,collections:Vm().seq,collectionNames:i().array,entries:Vm().list,page:i().number});const mw={searchEntries:function(e,t,r=0){return async(n,o)=>{const i=o(),{search:a}=i,s=rf(i.config),l=t||i.collections.keySeq().toArray(),c=l.filter((e=>Gf(i,e,"search"))),u=Gf(i,c[0],"search");if(a.isFetching&&a.term===e&&bi()(l,a.collections)&&(a.page===r||!u))return;n(function(e,t,r){return{type:Ii,payload:{searchTerm:e,searchCollections:t,page:r}}}(e,l,r));const f=u?Ai(i.integrations,s.getToken,u).search(c,e,r):s.search(i.collections.filter(((e,t)=>-1!==l.indexOf(t))).valueSeq().toArray(),e);try{const e=await f;return n(function(e,t){return{type:Di,payload:{entries:e,page:t}}}(e.entries,e.pagination))}catch(e){return n(function(e){return{type:Li,payload:{error:e}}}(e))}}},clearSearch:zi},yw=H((function(e,t){const{searchTerm:r}=t,n=t.collections.toIndexedSeq(),o=t.collections.keySeq().toArray(),i=e.search.isFetching,a=e.search.page,s=function(e,t){return(0,Qe.List)(e.search.entryIds).filter((e=>-1!==t.indexOf(e.collection))).map((t=>Jl(e.entries,t.collection,t.slug)))}(e,o);return{isFetching:i,page:a,collections:n,collectionNames:o,entries:s,searchTerm:r}}),mw)(gw),vw=Cg("div",{target:"evv1i7c1",label:"ViewControlsSection"})({name:"k6mob8",styles:"display:flex;align-items:center;justify-content:flex-end;max-width:500px"}),bw=Cg("button",{target:"evv1i7c0",label:"ViewControlsButton"})(qe.buttons.button,";color:",(e=>e.isActive?qe.colors.active:"#b3b9c4"),";background-color:transparent;display:block;padding:0;margin:0 4px;&:last-child{margin-right:0;}",qe.Icon,"{display:block;}"),ww=function({viewStyle:e,onChangeViewStyle:t}){return(0,xo.jsx)(vw,null,(0,xo.jsx)(bw,{isActive:e===Rl,onClick:()=>t(Rl)},(0,xo.jsx)(qe.Icon,{type:"list"})),(0,xo.jsx)(bw,{isActive:e===Ml,onClick:()=>t(Ml)},(0,xo.jsx)(qe.Icon,{type:"grid"})))},_w=Cg(qe.StyledDropdownButton,{target:"e1obtllk0",label:"Button"})(qe.buttons.button,";",qe.buttons.medium,";",qe.buttons.grayText,";font-size:14px;&:after{top:11px;}");function Sw({active:e,title:t}){return(0,xo.jsx)(_w,{css:(0,xo.css)("color:",e?qe.colors.active:void 0,";;label:ControlButton;")},t)}function xw(){return xw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xw.apply(this,arguments)}const Ow={[Ro.Ascending]:"up",[Ro.Descending]:"down"},Ew=(0,We.Iu)()((function({t:e,fields:t,onSortClick:r,sort:n}){const o=null==n?void 0:n.valueSeq().toJS().some((e=>e.direction!==Ro.None));return(0,xo.jsx)(qe.Dropdown,{renderButton:()=>(0,xo.jsx)(Sw,{active:o,title:e("collection.collectionTop.sortBy")}),closeOnSelection:!1,dropdownTopOverlap:"30px",dropdownWidth:"160px",dropdownPosition:"left"},t.map((e=>{const t=null==n?void 0:n.getIn([e.key,"direction"]),o=t&&t!==Ro.None,i=function(e){switch(e){case Ro.Ascending:return Ro.Descending;case Ro.Descending:return Ro.None;default:return Ro.Ascending}}(t);return(0,xo.jsx)(qe.DropdownItem,xw({key:e.key,label:e.label,onClick:()=>r(e.key,i),isActive:o},o&&function(e){return{icon:"chevron",iconDirection:Ow[e],iconSmall:!0}}(t)))})))})),kw=(0,We.Iu)()((function({viewFilters:e,t,onFilterClick:r,filter:n}){const o=null==n?void 0:n.valueSeq().toJS().some((e=>!0===e.active));return(0,xo.jsx)(qe.Dropdown,{renderButton:()=>(0,xo.jsx)(Sw,{active:o,title:t("collection.collectionTop.filterBy")}),closeOnSelection:!1,dropdownTopOverlap:"30px",dropdownPosition:"left"},e.map((e=>(0,xo.jsx)(qe.DropdownCheckedItem,{key:e.id,label:e.label,id:e.id,checked:n.getIn([e.id,"active"],!1),onClick:()=>r(e)}))))})),Cw=(0,We.Iu)()((function({viewGroups:e,t,onGroupClick:r,group:n}){const o=null==n?void 0:n.valueSeq().toJS().some((e=>!0===e.active));return(0,xo.jsx)(qe.Dropdown,{renderButton:()=>(0,xo.jsx)(Sw,{active:o,title:t("collection.collectionTop.groupBy")}),closeOnSelection:!1,dropdownTopOverlap:"30px",dropdownWidth:"160px",dropdownPosition:"left"},e.map((e=>(0,xo.jsx)(qe.DropdownItem,{key:e.id,label:e.label,onClick:()=>r(e),isActive:n.getIn([e.id,"active"],!1)}))))})),Tw=Cg("div",{target:"emfmed70",label:"CollectionControlsContainer"})("display:flex;align-items:center;flex-direction:row-reverse;margin-top:22px;width:",qe.lengths.topCardWidth,";max-width:100%;&>div{margin-left:6px;}"),Pw=function({viewStyle:e,onChangeViewStyle:t,sortableFields:r,onSortClick:n,sort:o,viewFilters:i,viewGroups:a,onFilterClick:s,onGroupClick:l,t:c,filter:u,group:f}){return(0,xo.jsx)(Tw,null,(0,xo.jsx)(ww,{viewStyle:e,onChangeViewStyle:t}),a.length>0&&(0,xo.jsx)(Cw,{viewGroups:a,onGroupClick:l,t:c,group:f}),i.length>0&&(0,xo.jsx)(kw,{viewFilters:i,onFilterClick:s,t:c,filter:u}),r.length>0&&(0,xo.jsx)(Ew,{fields:r,sort:o,onSortClick:n}))};function jw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Rw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jw(Object(r),!0).forEach((function(t){Mw(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jw(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Mw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Aw=Cg("div",{target:"e1sogrfi3",label:"CollectionContainer"})("margin:",qe.lengths.pageMargin,";"),Iw=Cg("main",{target:"e1sogrfi2",label:"CollectionMain"})({name:"tka7ew",styles:"padding-left:280px"}),Dw=Cg("div",{target:"e1sogrfi1",label:"SearchResultContainer"})(qe.components.cardTop,";margin-bottom:22px;"),Lw=Cg("h1",{target:"e1sogrfi0",label:"SearchResultHeading"})(qe.components.cardTopHeading,";");class Nw extends r().Component{constructor(...e){super(...e),Mw(this,"renderEntriesCollection",(()=>{const{collection:e,filterTerm:t,viewStyle:r}=this.props;return(0,xo.jsx)(dw,{collection:e,viewStyle:r,filterTerm:t})})),Mw(this,"renderEntriesSearch",(()=>{const{searchTerm:e,collections:t,collection:r,isSingleSearchResult:n}=this.props;return(0,xo.jsx)(yw,{collections:n?t.filter((e=>e===r)):t,searchTerm:e})}))}render(){const{collection:e,collections:t,collectionName:n,isSearchEnabled:o,isSearchResults:i,isSingleSearchResult:a,searchTerm:s,sortableFields:l,onSortClick:c,sort:u,viewFilters:f,viewGroups:p,filterTerm:d,t:h,onFilterClick:g,onGroupClick:m,filter:y,group:v,onChangeViewStyle:b,viewStyle:w}=this.props;let _=e.get("create")?Ko(n):"";_&&d&&(_=Ko(n),d&&(_=`${_}?path=${d}`));const S="collection.collectionTop.searchResults"+(a?"InCollection":"");return(0,xo.jsx)(Aw,null,(0,xo.jsx)(Tb,{collections:t,collection:(!i||a)&&e,isSearchEnabled:o,searchTerm:s,filterTerm:d}),(0,xo.jsx)(Iw,null,i?(0,xo.jsx)(Dw,null,(0,xo.jsx)(Lw,null,h(S,{searchTerm:s,collection:e.get("label")}))):(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(Db,{collection:e,newEntryUrl:_}),(0,xo.jsx)(Pw,{viewStyle:w,onChangeViewStyle:b,sortableFields:l,onSortClick:c,sort:u,viewFilters:f,viewGroups:p,t:h,onFilterClick:g,onGroupClick:m,filter:y,group:v})),i?this.renderEntriesSearch():this.renderEntriesCollection()))}}Mw(Nw,"propTypes",{searchTerm:i().string,collectionName:i().string,isSearchResults:i().bool,isSingleSearchResult:i().bool,collection:Vm().map.isRequired,collections:Vm().map.isRequired,sortableFields:i().array,sort:Vm().orderedMap,onSortClick:i().func.isRequired});const $w={sortByField:yl,filterByField:function(e,t){return async(r,n)=>{const o=n(),i=ec(o.entries,e.get("name"));if(r({type:Hs,payload:{collection:e.get("name"),filter:t}}),!i)try{const n=await ml(o,e);r({type:Vs,payload:{collection:e.get("name"),filter:t,entries:n}})}catch(n){r({type:Gs,payload:{collection:e.get("name"),filter:t,error:n}})}}},changeViewStyle:function(e){return{type:pl,payload:{style:e}}},groupByField:function(e,t){return async(r,n)=>{const o=n(),i=ec(o.entries,e.get("name"));if(r({type:Ks,payload:{collection:e.get("name"),group:t}}),!i)try{const n=await ml(o,e);r({type:Ys,payload:{collection:e.get("name"),group:t,entries:n}})}catch(n){r({type:Js,payload:{collection:e.get("name"),group:t,error:n}})}}}},Fw=H((function(e,t){const{collections:r}=e,n=e.config&&0!=e.config.search,{isSearchResults:o,match:i,t:a}=t,{name:s,searchTerm:l="",filterTerm:c=""}=i.params,u=s?r.get(s):r.first(),f=Vl(e.entries,u.get("name")),p=function(e,t){const r=e.get("sortable_fields").toArray().map((r=>{if(r===So)return{key:r,field:{name:r,label:t("collection.defaultFields.updatedOn.label")}};const n=Oc(e,r);return r!==_o||n?{key:r,field:null==n?void 0:n.toJS()}:{key:r,field:{name:r,label:t("collection.defaultFields.author.label")}}})).filter((e=>!!e.field)).map((e=>fc(fc({},e.field),{},{key:e.key})));return r}(u,a),d=function(e){return e.get("view_filters").toJS()}(u),h=function(e){return e.get("view_groups").toJS()}(u),g=Gl(e.entries,u.get("name")),m=Kl(e.entries,u.get("name"));return{collection:u,collections:r,collectionName:s,isSearchEnabled:n,isSearchResults:o,searchTerm:l,filterTerm:c,sort:f,sortableFields:p,viewFilters:d,viewGroups:h,filter:g,group:m,viewStyle:e.entries.get("viewStyle")}}),$w,(function(e,t,r){return Rw(Rw(Rw({},e),r),{},{onSortClick:(r,n)=>t.sortByField(e.collection,r,n),onFilterClick:r=>t.filterByField(e.collection,r),onGroupClick:r=>t.groupByField(e.collection,r),onChangeViewStyle:e=>t.changeViewStyle(e)})}))(Nw),Bw=(0,We.Iu)()(Fw),Uw={text:{name:"1lc6g5t-text",styles:"font-size:13px;font-weight:normal;margin-top:4px;label:text;"},button:(0,xo.css)(qe.buttons.button,";width:auto;flex:1 0 0;font-size:13px;padding:6px 0;;label:button;")},zw=Cg(Wv,{target:"ewffzyy8",label:"WorkflowLink"})({name:"am2158",styles:"display:block;padding:0 18px 18px;height:200px;overflow:hidden"}),qw=Cg("div",{target:"ewffzyy7",label:"CardCollection"})("font-size:14px;color:",qe.colors.textLead,";text-transform:uppercase;margin-top:12px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;"),Ww=Cg("h2",{target:"ewffzyy6",label:"CardTitle"})("margin:28px 0 0;color:",qe.colors.textLead,";"),Hw=Cg("div",{target:"ewffzyy5",label:"CardDateContainer"})(Uw.text,";"),Vw=Cg("p",{target:"ewffzyy4",label:"CardBody"})(Uw.text,";color:",qe.colors.text,";margin:24px 0 0;overflow-wrap:break-word;word-break:break-word;hyphens:auto;"),Gw=Cg("div",{target:"ewffzyy3",label:"CardButtonContainer"})("background-color:",qe.colors.foreground,";position:absolute;bottom:0;width:100%;padding:12px 18px;display:flex;opacity:0;transition:opacity ",qe.transitions.main,";cursor:pointer;"),Kw=Cg("button",{target:"ewffzyy2",label:"DeleteButton"})(Uw.button,";background-color:",qe.colorsRaw.redLight,";color:",qe.colorsRaw.red,";margin-right:6px;"),Yw=Cg("button",{target:"ewffzyy1",label:"PublishButton"})(Uw.button,";background-color:",qe.colorsRaw.teal,";color:",qe.colors.textLight,";margin-left:6px;&[disabled]{",qe.buttons.disabled,";}"),Jw=Cg("div",{target:"ewffzyy0",label:"WorkflowCardContainer"})(qe.components.card,";margin-bottom:24px;position:relative;overflow:hidden;&:hover ",Gw,"{opacity:1;}"),Qw=(0,We.Iu)()((({t:e,date:t,author:r})=>{const n=function(e,t){return e&&t?"lastChange":e?"lastChangeNoAuthor":t?"lastChangeNoDate":void 0}(t,r);if(n)return(0,xo.jsx)(Hw,null,e(`workflow.workflowCard.${n}`,{date:t,author:r}))}));function Xw({collectionLabel:e,title:t,authorLastChange:r,body:n,isModification:o,editLink:i,timestamp:a,onDelete:s,allowPublish:l,canPublish:c,onPublish:u,postAuthor:f,t:p}){return(0,xo.jsx)(Jw,null,(0,xo.jsx)(zw,{to:i},(0,xo.jsx)(qw,null,e),f,(0,xo.jsx)(Ww,null,t),(a||r)&&(0,xo.jsx)(Qw,{date:a,author:r}),(0,xo.jsx)(Vw,null,n)),(0,xo.jsx)(Gw,null,(0,xo.jsx)(Kw,{onClick:s},p(o?"workflow.workflowCard.deleteChanges":"workflow.workflowCard.deleteNewEntry")),l&&(0,xo.jsx)(Yw,{disabled:!c,onClick:u},p(o?"workflow.workflowCard.publishChanges":"workflow.workflowCard.publishNewEntry"))))}Xw.propTypes={collectionLabel:i().string.isRequired,title:i().string,authorLastChange:i().string,body:i().string,isModification:i().bool,editLink:i().string.isRequired,timestamp:i().string.isRequired,onDelete:i().func.isRequired,allowPublish:i().bool.isRequired,canPublish:i().bool.isRequired,onPublish:i().func.isRequired,postAuthor:i().string,t:i().func.isRequired};const Zw=(0,We.Iu)()(Xw);function e_(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const t_=Cg("div",{target:"e190xgae3",label:"WorkflowListContainer"})({name:"16oyyfa",styles:"min-height:60%;display:grid;grid-template-columns:33.3% 33.3% 33.3%"}),r_=Cg("div",{target:"e190xgae2",label:"WorkflowListContainerOpenAuthoring"})({name:"1e70u5x",styles:"min-height:60%;display:grid;grid-template-columns:50% 50% 0%"});var n_={name:"108sck7-columnPosition",styles:"margin-right:0;label:columnPosition;"},o_={name:"l4owvh-columnPosition",styles:"margin-left:0;label:columnPosition;"};const i_={columnPosition:e=>0===e&&o_||2===e&&n_||(0,xo.css)("&:before,&:after{content:'';display:block;position:absolute;width:2px;height:80%;top:76px;background-color:",qe.colors.textFieldBorder,";}&:before{left:-23px;}&:after{right:-23px;};label:columnPosition;"),column:{name:"m4x6w5-column",styles:"margin:0 20px;transition:background-color 0.5s ease;border:2px dashed transparent;border-radius:4px;position:relative;height:100%;label:column;"},columnHovered:(0,xo.css)("border-color:",qe.colors.active,";;label:columnHovered;"),hiddenColumn:{name:"1woovtn-hiddenColumn",styles:"display:none;label:hiddenColumn;"},hiddenRightBorder:{name:"hg8806-hiddenRightBorder",styles:"&:not(:first-child):not(:last-child){&:after{display:none;}};label:hiddenRightBorder;"}},a_=Cg("h2",{target:"e190xgae1",label:"ColumnHeader"})("font-size:20px;font-weight:normal;padding:4px 14px;border-radius:",qe.lengths.borderRadius,";margin-bottom:28px;",(e=>"draft"===e.name&&(0,xo.css)("background-color:",qe.colors.statusDraftBackground,";color:",qe.colors.statusDraftText,";;label:ColumnHeader;"))," ",(e=>"pending_review"===e.name&&(0,xo.css)("background-color:",qe.colors.statusReviewBackground,";color:",qe.colors.statusReviewText,";;label:ColumnHeader;"))," ",(e=>"pending_publish"===e.name&&(0,xo.css)("background-color:",qe.colors.statusReadyBackground,";color:",qe.colors.statusReadyText,";;label:ColumnHeader;")),";"),s_=Cg("p",{target:"e190xgae0",label:"ColumnCount"})("font-size:13px;font-weight:500;color:",qe.colors.text,";text-transform:uppercase;margin-bottom:6px;"),l_="cms-workflow";class c_ extends r().Component{constructor(...e){super(...e),e_(this,"handleChangeStatus",((e,t)=>{const r=t.slug,n=t.collection,o=t.ownStatus;this.props.handleChangeStatus(n,r,o,e)})),e_(this,"requestDelete",((e,t,r)=>{window.confirm(this.props.t("workflow.workflowList.onDeleteEntry"))&&this.props.handleDelete(e,t,r)})),e_(this,"requestPublish",((e,t,r)=>{r===eo.last()?window.confirm(this.props.t("workflow.workflowList.onPublishEntry"))&&this.props.handlePublish(e,t):window.alert(this.props.t("workflow.workflowList.onPublishingNotReadyEntry"))})),e_(this,"renderColumns",((e,t)=>{const{isOpenAuthoring:r,collections:n,t:o}=this.props;return e?t?(0,xo.jsx)("div",null,e.map((e=>{const t=Er()(e.get("updatedOn")).format(o("workflow.workflow.dateFormat")),r=e.get("slug"),i=e.get("collection"),a=`collections/${i}/entries/${r}?ref=workflow`,s=e.get("status"),l=n.find((e=>e.get("name")===i)),c=null==l?void 0:l.get("label"),u=e.get("isModification"),f=null==l?void 0:l.get("publish"),p=s===eo.last()&&!e.get("isPersisting",!1),d=e.get("author");return(0,xo.jsx)(og,{namespace:l_,key:`${i}-${r}`,slug:r,collection:i,ownStatus:s},(n=>n((0,xo.jsx)("div",null,(0,xo.jsx)(Zw,{collectionLabel:c||i,title:Tc(l,e),authorLastChange:e.getIn(["metaData","user"]),body:e.getIn(["data","body"]),isModification:u,editLink:a,timestamp:t,onDelete:this.requestDelete.bind(this,i,r,s),allowPublish:f,canPublish:p,onPublish:this.requestPublish.bind(this,i,r,s),postAuthor:d})))))}))):e.entrySeq().map((([e,t],n)=>(0,xo.jsx)(ig,{namespace:l_,key:e,onDrop:this.handleChangeStatus.bind(this,e)},((o,{isHovered:i})=>o((0,xo.jsx)("div",{style:{height:"100%"}},(0,xo.jsx)("div",{css:[i_.column,i_.columnPosition(n),i&&i_.columnHovered,r&&"pending_publish"===e&&i_.hiddenColumn,r&&"pending_review"===e&&i_.hiddenRightBorder,";label:WorkflowList;"]},(0,xo.jsx)(a_,{name:e},function(e,t){switch(e){case"draft":return t("workflow.workflowList.draftHeader");case"pending_review":return t("workflow.workflowList.inReviewHeader");case"pending_publish":return t("workflow.workflowList.readyHeader")}}(e,this.props.t)),(0,xo.jsx)(s_,null,this.props.t("workflow.workflowList.currentEntries",{smart_count:t.size})),this.renderColumns(t,e)))))))):null}))}render(){const e=this.renderColumns(this.props.entries),t=this.props.isOpenAuthoring?r_:t_;return(0,xo.jsx)(t,null,e)}}e_(c_,"propTypes",{entries:Vm().orderedMap,handleChangeStatus:i().func.isRequired,handlePublish:i().func.isRequired,handleDelete:i().func.isRequired,t:i().func.isRequired,isOpenAuthoring:i().bool,collections:Vm().map.isRequired});const u_=(f_=(0,We.Iu)()(c_),class extends r().Component{render(){return(0,xo.jsx)(Xh,{backend:Rp},(0,xo.jsx)(f_,this.props))}});var f_;const p_=Cg("div",{target:"e1t9l5ui4",label:"WorkflowContainer"})("padding:",qe.lengths.pageMargin," 0;height:100vh;"),d_=Cg("div",{target:"e1t9l5ui3",label:"WorkflowTop"})(qe.components.cardTop,";"),h_=Cg("div",{target:"e1t9l5ui2",label:"WorkflowTopRow"})("display:flex;justify-content:space-between;span[role='button']{",qe.shadows.dropDeep,";}"),g_=Cg("h1",{target:"e1t9l5ui1",label:"WorkflowTopHeading"})(qe.components.cardTopHeading,";"),m_=Cg("p",{target:"e1t9l5ui0",label:"WorkflowTopDescription"})(qe.components.cardTopDescription,";");class y_ extends t.Component{componentDidMount(){const{loadUnpublishedEntries:e,isEditorialWorkflow:t,collections:r}=this.props;t&&e(r)}render(){const{isEditorialWorkflow:e,isOpenAuthoring:t,isFetching:r,unpublishedEntries:n,updateUnpublishedEntryStatus:o,publishUnpublishedEntry:i,deleteUnpublishedEntry:a,collections:s,t:l}=this.props;if(!e)return null;if(r)return(0,xo.jsx)(qe.Loader,{active:!0},l("workflow.workflow.loading"));const c=n.get("pending_review").size,u=n.get("pending_publish").size;return(0,xo.jsx)(p_,null,(0,xo.jsx)(d_,null,(0,xo.jsx)(h_,null,(0,xo.jsx)(g_,null,l("workflow.workflow.workflowHeading")),(0,xo.jsx)(qe.Dropdown,{dropdownWidth:"160px",dropdownPosition:"left",dropdownTopOverlap:"40px",renderButton:()=>(0,xo.jsx)(qe.StyledDropdownButton,null,l("workflow.workflow.newPost"))},s.filter((e=>e.get("create"))).toList().map((e=>(0,xo.jsx)(qe.DropdownItem,{key:e.get("name"),label:e.get("label"),onClick:()=>Ym(e.get("name"))}))))),(0,xo.jsx)(m_,null,l("workflow.workflow.description",{smart_count:c,readyCount:u}))),(0,xo.jsx)(u_,{entries:n,handleChangeStatus:o,handlePublish:i,handleDelete:a,isOpenAuthoring:t,collections:s}))}}!function(e,t,r){(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(y_,"propTypes",{collections:Vm().map.isRequired,isEditorialWorkflow:i().bool.isRequired,isOpenAuthoring:i().bool,isFetching:i().bool,unpublishedEntries:Vm().map,loadUnpublishedEntries:i().func.isRequired,updateUnpublishedEntryStatus:i().func.isRequired,publishUnpublishedEntry:i().func.isRequired,deleteUnpublishedEntry:i().func.isRequired,t:i().func.isRequired});const v_=H((function(e){const{collections:t,config:r,globalUI:n}=e,o=r.publish_mode===Zn,i={collections:t,isEditorialWorkflow:o,isOpenAuthoring:n.useOpenAuthoring};return o&&(i.isFetching=e.editorialWorkflow.getIn(["pages","isFetching"],!1),i.unpublishedEntries=eo.reduce(((t,r)=>{const n=function(e,t){return function(e,t){return e?e.get("entities").filter((e=>e.get("status")===t)).valueSeq():null}(e.editorialWorkflow,t)}(e,r);return t.set(r,n)}),(0,Qe.OrderedMap)())),i}),{loadUnpublishedEntries:Ts,updateUnpublishedEntryStatus:Ps,publishUnpublishedEntry:Rs,deleteUnpublishedEntry:js})((0,We.Iu)()(y_));var b_=__webpack_require__(54073),w_=__webpack_require__.n(b_),__=__webpack_require__(25473),S_=__webpack_require__.n(__),x_=__webpack_require__(46847);function O_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function k_(e,t,r){return t&&E_(e.prototype,t),r&&E_(e,r),e}function C_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function T_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function P_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T_(Object(r),!0).forEach((function(t){C_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function j_(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&M_(e,t)}function R_(e){return R_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},R_(e)}function M_(e,t){return M_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},M_(e,t)}function A_(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function I_(e){return function(){var t,r=R_(e);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=R_(this).constructor;t=Reflect.construct(r,arguments,n)}else t=r.apply(this,arguments);return function(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?A_(e):t}(this,t)}}var D_=function(e){j_(n,e);var t=I_(n);function n(){return O_(this,n),t.apply(this,arguments)}return k_(n,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,o=e.split,i=e.style,a=e.size,s=e.eleRef,l=["Pane",o,n],c={flex:1,position:"relative",outline:"none"};return void 0!==a&&("vertical"===o?c.width=a:(c.height=a,c.display="flex"),c.flex="none"),c=Object.assign({},c,i||{}),r().createElement("div",{ref:s,className:l.join(" "),style:c},t)}}]),n}(r().PureComponent);D_.propTypes={className:i().string.isRequired,children:i().node.isRequired,size:i().oneOfType([i().string,i().number]),split:i().oneOf(["vertical","horizontal"]),style:S_(),eleRef:i().func},D_.defaultProps={};var L_="Resizer",N_=function(e){j_(n,e);var t=I_(n);function n(){return O_(this,n),t.apply(this,arguments)}return k_(n,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.onClick,o=e.onDoubleClick,i=e.onMouseDown,a=e.onTouchEnd,s=e.onTouchStart,l=e.resizerClassName,c=e.split,u=e.style,f=[l,c,t];return r().createElement("span",{role:"presentation",className:f.join(" "),style:u,onMouseDown:function(e){return i(e)},onTouchStart:function(e){e.preventDefault(),s(e)},onTouchEnd:function(e){e.preventDefault(),a(e)},onClick:function(e){n&&(e.preventDefault(),n(e))},onDoubleClick:function(e){o&&(e.preventDefault(),o(e))}})}}]),n}(r().Component);function $_(e,t){if(e.selection)e.selection.empty();else try{t.getSelection().removeAllRanges()}catch(e){}}function F_(e,t,r,n){if("number"==typeof n){var o="number"==typeof t?t:0,i="number"==typeof r&&r>=0?r:1/0;return Math.max(o,Math.min(i,n))}return void 0!==e?e:t}N_.propTypes={className:i().string.isRequired,onClick:i().func,onDoubleClick:i().func,onMouseDown:i().func.isRequired,onTouchStart:i().func.isRequired,onTouchEnd:i().func.isRequired,split:i().oneOf(["vertical","horizontal"]),style:S_(),resizerClassName:i().string.isRequired},N_.defaultProps={resizerClassName:L_};var B_=function(e){j_(n,e);var t=I_(n);function n(e){var r;O_(this,n),(r=t.call(this,e)).onMouseDown=r.onMouseDown.bind(A_(r)),r.onTouchStart=r.onTouchStart.bind(A_(r)),r.onMouseMove=r.onMouseMove.bind(A_(r)),r.onTouchMove=r.onTouchMove.bind(A_(r)),r.onMouseUp=r.onMouseUp.bind(A_(r));var o=e.size,i=e.defaultSize,a=e.minSize,s=e.maxSize,l=e.primary,c=void 0!==o?o:F_(i,a,s,null);return r.state={active:!1,resized:!1,pane1Size:"first"===l?c:void 0,pane2Size:"second"===l?c:void 0,instanceProps:{size:o}},r}return k_(n,[{key:"componentDidMount",value:function(){document.addEventListener("mouseup",this.onMouseUp),document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("touchmove",this.onTouchMove),this.setState(n.getSizeUpdate(this.props,this.state))}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("touchmove",this.onTouchMove)}},{key:"onMouseDown",value:function(e){var t=Object.assign({},e,{touches:[{clientX:e.clientX,clientY:e.clientY}]});this.onTouchStart(t)}},{key:"onTouchStart",value:function(e){var t=this.props,r=t.allowResize,n=t.onDragStarted,o=t.split;if(r){$_(document,window);var i="vertical"===o?e.touches[0].clientX:e.touches[0].clientY;"function"==typeof n&&n(),this.setState({active:!0,position:i})}}},{key:"onMouseMove",value:function(e){var t=Object.assign({},e,{touches:[{clientX:e.clientX,clientY:e.clientY}]});this.onTouchMove(t)}},{key:"onTouchMove",value:function(e){var t=this.props,r=t.allowResize,n=t.maxSize,o=t.minSize,i=t.onChange,a=t.split,s=t.step,l=this.state,c=l.active,u=l.position;if(r&&c){$_(document,window);var f="first"===this.props.primary,p=f?this.pane1:this.pane2,d=f?this.pane2:this.pane1;if(p){var h=p,g=d;if(h.getBoundingClientRect){var m=h.getBoundingClientRect().width,y=h.getBoundingClientRect().height,v="vertical"===a?m:y,b=u-("vertical"===a?e.touches[0].clientX:e.touches[0].clientY);if(s){if(Math.abs(b)<s)return;b=~~(b/s)*s}var w=f?b:-b;parseInt(window.getComputedStyle(h).order)>parseInt(window.getComputedStyle(g).order)&&(w=-w);var _=n;if(void 0!==n&&n<=0){var S=this.splitPane;_="vertical"===a?S.getBoundingClientRect().width+n:S.getBoundingClientRect().height+n}var x=v-w,O=u-b;x<o?x=o:void 0!==n&&x>_?x=_:this.setState({position:O,resized:!0}),i&&i(x),this.setState(C_({draggedSize:x},f?"pane1Size":"pane2Size",x))}}}}},{key:"onMouseUp",value:function(){var e=this.props,t=e.allowResize,r=e.onDragFinished,n=this.state,o=n.active,i=n.draggedSize;t&&o&&("function"==typeof r&&r(i),this.setState({active:!1}))}},{key:"render",value:function(){var e=this,t=this.props,n=t.allowResize,o=t.children,i=t.className,a=t.onResizerClick,s=t.onResizerDoubleClick,l=t.paneClassName,c=t.pane1ClassName,u=t.pane2ClassName,f=t.paneStyle,p=t.pane1Style,d=t.pane2Style,h=t.resizerClassName,g=t.resizerStyle,m=t.split,y=t.style,v=this.state,b=v.pane1Size,w=v.pane2Size,_=n?"":"disabled",S=h?"".concat(h," ").concat(L_):h,x=function(e){return r().Children.toArray(e).filter((function(e){return e}))}(o),O=P_({display:"flex",flex:1,height:"100%",position:"absolute",outline:"none",overflow:"hidden",MozUserSelect:"text",WebkitUserSelect:"text",msUserSelect:"text",userSelect:"text"},y);"vertical"===m?Object.assign(O,{flexDirection:"row",left:0,right:0}):Object.assign(O,{bottom:0,flexDirection:"column",minHeight:"100%",top:0,width:"100%"});var E=["SplitPane",i,m,_],k=P_({},f,{},p),C=P_({},f,{},d),T=["Pane1",l,c].join(" "),P=["Pane2",l,u].join(" ");return r().createElement("div",{className:E.join(" "),ref:function(t){e.splitPane=t},style:O},r().createElement(D_,{className:T,key:"pane1",eleRef:function(t){e.pane1=t},size:b,split:m,style:k},x[0]),r().createElement(N_,{className:_,onClick:a,onDoubleClick:s,onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,onTouchEnd:this.onMouseUp,key:"resizer",resizerClassName:S,split:m,style:g||{}}),r().createElement(D_,{className:P,key:"pane2",eleRef:function(t){e.pane2=t},size:w,split:m,style:C},x[1]))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return n.getSizeUpdate(e,t)}},{key:"getSizeUpdate",value:function(e,t){var r={};if(t.instanceProps.size===e.size&&void 0!==e.size)return{};var n=void 0!==e.size?e.size:F_(e.defaultSize,e.minSize,e.maxSize,t.draggedSize);void 0!==e.size&&(r.draggedSize=n);var o="first"===e.primary;return r[o?"pane1Size":"pane2Size"]=n,r[o?"pane2Size":"pane1Size"]=void 0,r.instanceProps={size:e.size},r}}]),n}(r().Component);B_.propTypes={allowResize:i().bool,children:i().arrayOf(i().node).isRequired,className:i().string,primary:i().oneOf(["first","second"]),minSize:i().oneOfType([i().string,i().number]),maxSize:i().oneOfType([i().string,i().number]),defaultSize:i().oneOfType([i().string,i().number]),size:i().oneOfType([i().string,i().number]),split:i().oneOf(["vertical","horizontal"]),onDragStarted:i().func,onDragFinished:i().func,onChange:i().func,onResizerClick:i().func,onResizerDoubleClick:i().func,style:S_(),resizerStyle:S_(),paneClassName:i().string,pane1ClassName:i().string,pane2ClassName:i().string,paneStyle:S_(),pane1Style:S_(),pane2Style:S_(),resizerClassName:i().string,step:i().number},B_.defaultProps={allowResize:!0,minSize:50,primary:"first",split:"vertical",paneClassName:"",pane1ClassName:"",pane2ClassName:""},(0,x_.polyfill)(B_);const U_=B_;var z_=__webpack_require__(93232),q_=__webpack_require__(74930),W_=__webpack_require__.n(q_),H_=__webpack_require__(88100),V_=__webpack_require__.n(H_),G_=__webpack_require__(40940),K_=__webpack_require__.n(G_);function Y_(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function J_(){return{error:!1}}function Q_(e){return null==e||Object.prototype.hasOwnProperty.call(e,"length")&&0===e.length||e.constructor===Object&&0===Object.keys(e).length||Qe.List.isList(e)&&0===e.size}class X_ extends t.Component{constructor(...e){super(...e),Y_(this,"processInnerControlRef",(e=>{if(!e)return;this.innerWrappedControl=e.getWrappedInstance?e.getWrappedInstance():e,this.wrappedControlValid=this.innerWrappedControl.isValid||J_;const{shouldComponentUpdate:t}=this.innerWrappedControl;this.wrappedControlShouldComponentUpdate=t&&t.bind(this.innerWrappedControl)})),Y_(this,"getValidateValue",(()=>{var e,t;let r=(null===(e=this.innerWrappedControl)||void 0===e||null===(t=e.getValidateValue)||void 0===t?void 0:t.call(e))||this.props.value;return Qe.List.isList(r)&&(r=r.join(",")),r})),Y_(this,"validate",((e=!1)=>{const t=this.getValidateValue(),r=this.props.field,n=[],o=[this.validatePresence,this.validatePattern];if(r.get("meta")&&o.push(this.props.validateMetaField),o.forEach((e=>{const o=e(r,t,this.props.t);o.error&&n.push(o.error)})),e)e.error&&n.push(e.error);else{const e=this.validateWrappedControl(r);e.error&&n.push(e.error)}this.props.onValidate(n)})),Y_(this,"validatePresence",((e,t)=>{const{t:r,parentIds:n}=this.props;return e.get("required",!0)&&Q_(t)?{error:{type:Ki.PRESENCE,parentIds:n,message:r("editor.editorControlPane.widget.required",{fieldLabel:e.get("label",e.get("name"))})}}:{error:!1}})),Y_(this,"validatePattern",((e,t)=>{const{t:r,parentIds:n}=this.props,o=e.get("pattern",!1);return Q_(t)?{error:!1}:o&&!RegExp(o.first()).test(t)?{error:{type:Ki.PATTERN,parentIds:n,message:r("editor.editorControlPane.widget.regexPattern",{fieldLabel:e.get("label",e.get("name")),pattern:o.last()})}}:{error:!1}})),Y_(this,"validateWrappedControl",(e=>{const{t,parentIds:r}=this.props;if("function"!=typeof this.wrappedControlValid)throw new Error(sn`
26
26
  this.wrappedControlValid is not a function. Are you sure widget
27
27
  "${e.get("widget")}" is registered?
28
- `);const n=this.wrappedControlValid();return"boolean"==typeof n?{error:!n}:Object.prototype.hasOwnProperty.call(n,"error")?n:n instanceof Promise?(n.then((()=>{this.validate({error:!1})}),(t=>{const r={type:Ki.CUSTOM,message:`${e.get("label",e.get("name"))} - ${t}.`};this.validate({error:r})})),{error:{type:Ki.CUSTOM,parentIds:r,message:t("editor.editorControlPane.widget.processing",{fieldLabel:e.get("label",e.get("name"))})}}):{error:!1}})),Y_(this,"getObjectValue",(()=>this.props.value||(0,Qe.Map)())),Y_(this,"onChangeObject",((e,t,r)=>{const n=this.getObjectValue().set(e.get("name"),t);return this.props.onChange(n,r&&{[this.props.field.get("name")]:r})})),Y_(this,"setInactiveStyle",(()=>{this.props.setInactiveStyle(),this.props.field.has("pattern")&&!Q_(this.getValidateValue())&&this.validate()}))}shouldComponentUpdate(e){return!this.props.isLoadingAsset&&(this.wrappedControlShouldComponentUpdate?this.wrappedControlShouldComponentUpdate(e):this.props.value!==e.value||this.props.classNameWrapper!==e.classNameWrapper||this.props.hasActiveStyle!==e.hasActiveStyle)}render(){const{controlComponent:e,entry:t,collection:n,config:o,field:i,value:a,mediaPaths:s,metadata:l,onChange:c,onValidateObject:u,onOpenMediaLibrary:f,onRemoveMediaControl:p,onPersistMedia:d,onClearMediaControl:h,onAddAsset:g,onRemoveInsertedMedia:m,getAsset:y,classNameWrapper:v,classNameWidget:b,classNameWidgetActive:w,classNameLabel:_,classNameLabelActive:S,setActiveStyle:x,hasActiveStyle:O,editorControl:E,uniqueFieldId:k,resolveWidget:C,widget:T,getEditorComponents:P,query:j,queryHits:R,clearSearch:M,clearFieldErrors:A,isFetching:I,loadEntry:D,fieldsErrors:L,controlRef:N,isEditorComponent:$,isNewEditorComponent:F,parentIds:B,t:U,isDisabled:z,isFieldDuplicate:q,isFieldHidden:W,locale:H}=this.props;return r().createElement(e,{entry:t,collection:n,config:o,field:i,value:a,mediaPaths:s,metadata:l,onChange:c,onChangeObject:this.onChangeObject,onValidateObject:u,onOpenMediaLibrary:f,onClearMediaControl:h,onRemoveMediaControl:p,onPersistMedia:d,onAddAsset:g,onRemoveInsertedMedia:m,getAsset:y,forID:k,ref:this.processInnerControlRef,validate:this.validate,classNameWrapper:v,classNameWidget:b,classNameWidgetActive:w,classNameLabel:_,classNameLabelActive:S,setActiveStyle:x,setInactiveStyle:()=>this.setInactiveStyle(),hasActiveStyle:O,editorControl:E,resolveWidget:C,widget:T,getEditorComponents:P,getRemarkPlugins:jn,query:j,queryHits:R,clearSearch:M,clearFieldErrors:A,isFetching:I,loadEntry:D,isEditorComponent:$,isNewEditorComponent:F,fieldsErrors:L,controlRef:N,parentIds:B,t:U,isDisabled:z,isFieldDuplicate:q,isFieldHidden:W,locale:H})}}Y_(X_,"propTypes",{controlComponent:i().func.isRequired,field:Vm().map.isRequired,hasActiveStyle:i().bool,setActiveStyle:i().func.isRequired,setInactiveStyle:i().func.isRequired,classNameWrapper:i().string.isRequired,classNameWidget:i().string.isRequired,classNameWidgetActive:i().string.isRequired,classNameLabel:i().string.isRequired,classNameLabelActive:i().string.isRequired,value:i().oneOfType([i().node,i().object,i().string,i().bool]),mediaPaths:Vm().map.isRequired,metadata:Vm().map,fieldsErrors:Vm().map,onChange:i().func.isRequired,onValidate:i().func,onOpenMediaLibrary:i().func.isRequired,onClearMediaControl:i().func.isRequired,onRemoveMediaControl:i().func.isRequired,onPersistMedia:i().func.isRequired,onAddAsset:i().func.isRequired,onRemoveInsertedMedia:i().func.isRequired,getAsset:i().func.isRequired,resolveWidget:i().func.isRequired,widget:i().object.isRequired,getEditorComponents:i().func.isRequired,isFetching:i().bool,controlRef:i().func,query:i().func.isRequired,clearSearch:i().func.isRequired,clearFieldErrors:i().func.isRequired,queryHits:i().oneOfType([i().array,i().object]),editorControl:i().elementType.isRequired,uniqueFieldId:i().string.isRequired,loadEntry:i().func.isRequired,t:i().func.isRequired,onValidateObject:i().func,isEditorComponent:i().bool,isNewEditorComponent:i().bool,entry:Vm().map.isRequired,isDisabled:i().bool,isFieldDuplicate:i().func,isFieldHidden:i().func,locale:i().string});const Z_=["node"];function eS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tS(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eS(Object(r),!0).forEach((function(t){nS(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eS(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function rS(){return rS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rS.apply(this,arguments)}function nS(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oS={widget:`\n display: block;\n width: 100%;\n padding: ${qe.lengths.inputPadding};\n margin: 0;\n border: ${qe.borders.textField};\n border-radius: ${qe.lengths.borderRadius};\n border-top-left-radius: 0;\n outline: 0;\n box-shadow: none;\n background-color: ${qe.colors.inputBackground};\n color: #444a57;\n transition: border-color ${qe.transitions.main};\n position: relative;\n font-size: 15px;\n line-height: 1.5;\n\n select& {\n text-indent: 14px;\n height: 58px;\n }\n `,widgetActive:`\n border-color: ${qe.colors.active};\n `,widgetError:`\n border-color: ${qe.colors.errorText};\n `,disabled:"\n pointer-events: none;\n opacity: 0.5;\n background: #ccc;\n ",hidden:"\n visibility: hidden;\n "},iS=Cg("div",{target:"ec1nk3l2",label:"ControlContainer"})({name:"gpgisz",styles:"margin-top:16px;&:first-of-type{margin-top:36px;}"}),aS=Cg("ul",{target:"ec1nk3l1",label:"ControlErrorsList"})("list-style-type:none;font-size:12px;color:",qe.colors.errorText,";margin-bottom:5px;text-align:right;text-transform:uppercase;position:relative;font-weight:600;top:20px;"),sS=Cg("p",{target:"ec1nk3l0",label:"ControlHint"})("margin-bottom:0;padding:3px 0;font-size:12px;color:",(e=>e.error?qe.colors.errorText:e.active?qe.colors.active:qe.colors.controlLabel),";transition:color ",qe.transitions.main,";");function lS({field:e,isActive:t,hasErrors:r,uniqueFieldId:n,isFieldOptional:o,t:i}){const a=`${e.get("label",e.get("name"))}`;return(0,xo.jsx)(qe.FieldLabel,{isActive:t,hasErrors:r,htmlFor:n},a," ",o?` (${i("editor.editorControl.field.optional")})`:"")}class cS extends r().Component{constructor(...e){super(...e),nS(this,"state",{activeLabel:!1}),nS(this,"uniqueFieldId",W_()(`${this.props.field.get("name")}-field-`)),nS(this,"isAncestorOfFieldError",(()=>{const{fieldsErrors:e}=this.props;return!!(e&&e.size>0)&&Object.values(e.toJS()).some((e=>e.some((e=>e.parentIds&&e.parentIds.includes(this.uniqueFieldId)))))}))}render(){const{value:e,entry:t,collection:r,config:n,field:o,fieldsMetaData:i,fieldsErrors:a,mediaPaths:s,boundGetAsset:l,onChange:c,openMediaLibrary:u,clearMediaControl:f,removeMediaControl:p,addAsset:d,removeInsertedMedia:h,persistMedia:g,onValidate:m,processControlRef:y,controlRef:v,query:b,queryHits:w,isFetching:_,clearSearch:S,clearFieldErrors:x,loadEntry:O,className:E,isSelected:k,isEditorComponent:C,isNewEditorComponent:T,parentIds:P,t:j,validateMetaField:R,isLoadingAsset:M,isDisabled:A,isHidden:I,isFieldDuplicate:D,isFieldHidden:L,locale:N}=this.props,$=Tn(o.get("widget")),F=o.get("name"),B=o.get("hint"),U=!1===o.get("required"),z=m,q=i&&i.get(F),W=a&&a.get(this.uniqueFieldId),H=this.isAncestorOfFieldError(),V=!!W||H;return(0,xo.jsx)(xo.ClassNames,null,(({css:i,cx:F})=>(0,xo.jsx)(iS,{className:E,css:i`
28
+ `);const n=this.wrappedControlValid();return"boolean"==typeof n?{error:!n}:Object.prototype.hasOwnProperty.call(n,"error")?n:n instanceof Promise?(n.then((()=>{this.validate({error:!1})}),(t=>{const r={type:Ki.CUSTOM,message:`${e.get("label",e.get("name"))} - ${t}.`};this.validate({error:r})})),{error:{type:Ki.CUSTOM,parentIds:r,message:t("editor.editorControlPane.widget.processing",{fieldLabel:e.get("label",e.get("name"))})}}):{error:!1}})),Y_(this,"getObjectValue",(()=>this.props.value||(0,Qe.Map)())),Y_(this,"onChangeObject",((e,t,r)=>{const n=this.getObjectValue().set(e.get("name"),t);return this.props.onChange(n,r&&{[this.props.field.get("name")]:r})})),Y_(this,"setInactiveStyle",(()=>{this.props.setInactiveStyle(),this.props.field.has("pattern")&&!Q_(this.getValidateValue())&&this.validate()}))}shouldComponentUpdate(e){return(!this.props.isLoadingAsset||!e.isLoadingAsset)&&(this.wrappedControlShouldComponentUpdate?this.wrappedControlShouldComponentUpdate(e):this.props.value!==e.value||this.props.classNameWrapper!==e.classNameWrapper||this.props.hasActiveStyle!==e.hasActiveStyle)}render(){const{controlComponent:e,entry:t,collection:n,config:o,field:i,value:a,mediaPaths:s,metadata:l,onChange:c,onValidateObject:u,onOpenMediaLibrary:f,onRemoveMediaControl:p,onPersistMedia:d,onClearMediaControl:h,onAddAsset:g,onRemoveInsertedMedia:m,getAsset:y,classNameWrapper:v,classNameWidget:b,classNameWidgetActive:w,classNameLabel:_,classNameLabelActive:S,setActiveStyle:x,hasActiveStyle:O,editorControl:E,uniqueFieldId:k,resolveWidget:C,widget:T,getEditorComponents:P,query:j,queryHits:R,clearSearch:M,clearFieldErrors:A,isFetching:I,loadEntry:D,fieldsErrors:L,controlRef:N,isEditorComponent:$,isNewEditorComponent:F,parentIds:B,t:U,isDisabled:z,isFieldDuplicate:q,isFieldHidden:W,locale:H,isParentListCollapsed:V}=this.props;return r().createElement(e,{entry:t,collection:n,config:o,field:i,value:a,mediaPaths:s,metadata:l,onChange:c,onChangeObject:this.onChangeObject,onValidateObject:u,onOpenMediaLibrary:f,onClearMediaControl:h,onRemoveMediaControl:p,onPersistMedia:d,onAddAsset:g,onRemoveInsertedMedia:m,getAsset:y,forID:k,ref:this.processInnerControlRef,validate:this.validate,classNameWrapper:v,classNameWidget:b,classNameWidgetActive:w,classNameLabel:_,classNameLabelActive:S,setActiveStyle:x,setInactiveStyle:()=>this.setInactiveStyle(),hasActiveStyle:O,editorControl:E,resolveWidget:C,widget:T,getEditorComponents:P,getRemarkPlugins:jn,query:j,queryHits:R,clearSearch:M,clearFieldErrors:A,isFetching:I,loadEntry:D,isEditorComponent:$,isNewEditorComponent:F,fieldsErrors:L,controlRef:N,parentIds:B,t:U,isDisabled:z,isFieldDuplicate:q,isFieldHidden:W,locale:H,isParentListCollapsed:V})}}Y_(X_,"propTypes",{controlComponent:i().func.isRequired,field:Vm().map.isRequired,hasActiveStyle:i().bool,setActiveStyle:i().func.isRequired,setInactiveStyle:i().func.isRequired,classNameWrapper:i().string.isRequired,classNameWidget:i().string.isRequired,classNameWidgetActive:i().string.isRequired,classNameLabel:i().string.isRequired,classNameLabelActive:i().string.isRequired,value:i().oneOfType([i().node,i().object,i().string,i().bool]),mediaPaths:Vm().map.isRequired,metadata:Vm().map,fieldsErrors:Vm().map,onChange:i().func.isRequired,onValidate:i().func,onOpenMediaLibrary:i().func.isRequired,onClearMediaControl:i().func.isRequired,onRemoveMediaControl:i().func.isRequired,onPersistMedia:i().func.isRequired,onAddAsset:i().func.isRequired,onRemoveInsertedMedia:i().func.isRequired,getAsset:i().func.isRequired,resolveWidget:i().func.isRequired,widget:i().object.isRequired,getEditorComponents:i().func.isRequired,isFetching:i().bool,controlRef:i().func,query:i().func.isRequired,clearSearch:i().func.isRequired,clearFieldErrors:i().func.isRequired,queryHits:i().oneOfType([i().array,i().object]),editorControl:i().elementType.isRequired,uniqueFieldId:i().string.isRequired,loadEntry:i().func.isRequired,t:i().func.isRequired,onValidateObject:i().func,isEditorComponent:i().bool,isNewEditorComponent:i().bool,entry:Vm().map.isRequired,isDisabled:i().bool,isFieldDuplicate:i().func,isFieldHidden:i().func,locale:i().string,isParentListCollapsed:i().bool});const Z_=["node"];function eS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tS(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eS(Object(r),!0).forEach((function(t){nS(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eS(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function rS(){return rS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rS.apply(this,arguments)}function nS(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oS={widget:`\n display: block;\n width: 100%;\n padding: ${qe.lengths.inputPadding};\n margin: 0;\n border: ${qe.borders.textField};\n border-radius: ${qe.lengths.borderRadius};\n border-top-left-radius: 0;\n outline: 0;\n box-shadow: none;\n background-color: ${qe.colors.inputBackground};\n color: #444a57;\n transition: border-color ${qe.transitions.main};\n position: relative;\n font-size: 15px;\n line-height: 1.5;\n\n select& {\n text-indent: 14px;\n height: 58px;\n }\n `,widgetActive:`\n border-color: ${qe.colors.active};\n `,widgetError:`\n border-color: ${qe.colors.errorText};\n `,disabled:"\n pointer-events: none;\n opacity: 0.5;\n background: #ccc;\n ",hidden:"\n visibility: hidden;\n "},iS=Cg("div",{target:"ec1nk3l2",label:"ControlContainer"})({name:"gpgisz",styles:"margin-top:16px;&:first-of-type{margin-top:36px;}"}),aS=Cg("ul",{target:"ec1nk3l1",label:"ControlErrorsList"})("list-style-type:none;font-size:12px;color:",qe.colors.errorText,";margin-bottom:5px;text-align:right;text-transform:uppercase;position:relative;font-weight:600;top:20px;"),sS=Cg("p",{target:"ec1nk3l0",label:"ControlHint"})("margin-bottom:0;padding:3px 0;font-size:12px;color:",(e=>e.error?qe.colors.errorText:e.active?qe.colors.active:qe.colors.controlLabel),";transition:color ",qe.transitions.main,";");function lS({field:e,isActive:t,hasErrors:r,uniqueFieldId:n,isFieldOptional:o,t:i}){const a=`${e.get("label",e.get("name"))}`;return(0,xo.jsx)(qe.FieldLabel,{isActive:t,hasErrors:r,htmlFor:n},a," ",o?` (${i("editor.editorControl.field.optional")})`:"")}class cS extends r().Component{constructor(...e){super(...e),nS(this,"state",{activeLabel:!1}),nS(this,"uniqueFieldId",W_()(`${this.props.field.get("name")}-field-`)),nS(this,"isAncestorOfFieldError",(()=>{const{fieldsErrors:e}=this.props;return!!(e&&e.size>0)&&Object.values(e.toJS()).some((e=>e.some((e=>e.parentIds&&e.parentIds.includes(this.uniqueFieldId)))))}))}render(){const{value:e,entry:t,collection:r,config:n,field:o,fieldsMetaData:i,fieldsErrors:a,mediaPaths:s,boundGetAsset:l,onChange:c,openMediaLibrary:u,clearMediaControl:f,removeMediaControl:p,addAsset:d,removeInsertedMedia:h,persistMedia:g,onValidate:m,processControlRef:y,controlRef:v,query:b,queryHits:w,isFetching:_,clearSearch:S,clearFieldErrors:x,loadEntry:O,className:E,isSelected:k,isEditorComponent:C,isNewEditorComponent:T,parentIds:P,t:j,validateMetaField:R,isLoadingAsset:M,isDisabled:A,isHidden:I,isFieldDuplicate:D,isFieldHidden:L,locale:N,isParentListCollapsed:$}=this.props,F=Tn(o.get("widget")),B=o.get("name"),U=o.get("hint"),z=!1===o.get("required"),q=m,W=i&&i.get(B),H=a&&a.get(this.uniqueFieldId),V=this.isAncestorOfFieldError(),G=!!H||V;return(0,xo.jsx)(xo.ClassNames,null,(({css:i,cx:B})=>(0,xo.jsx)(iS,{className:E,css:i`
29
29
  ${I&&oS.hidden};
30
- `},$.globalStyles&&(0,xo.jsx)(xo.Global,{styles:(0,xo.css)($.globalStyles,";;label:EditorControl;")}),W&&(0,xo.jsx)(aS,null,W.map((e=>e.message&&"string"==typeof e.message&&(0,xo.jsx)("li",{key:e.message.trim().replace(/[^a-z0-9]+/gi,"-")},e.message)))),(0,xo.jsx)(lS,{field:o,isActive:k||this.state.styleActive,hasErrors:V,uniqueFieldId:this.uniqueFieldId,isFieldOptional:U,t:j}),(0,xo.jsx)(X_,{classNameWrapper:F(i`
30
+ `},F.globalStyles&&(0,xo.jsx)(xo.Global,{styles:(0,xo.css)(F.globalStyles,";;label:EditorControl;")}),H&&(0,xo.jsx)(aS,null,H.map((e=>e.message&&"string"==typeof e.message&&(0,xo.jsx)("li",{key:e.message.trim().replace(/[^a-z0-9]+/gi,"-")},e.message)))),(0,xo.jsx)(lS,{field:o,isActive:k||this.state.styleActive,hasErrors:G,uniqueFieldId:this.uniqueFieldId,isFieldOptional:z,t:j}),(0,xo.jsx)(X_,{classNameWrapper:B(i`
31
31
  ${oS.widget};
32
32
  `,{[i`
33
33
  ${oS.widgetActive};
34
34
  `]:k||this.state.styleActive},{[i`
35
35
  ${oS.widgetError};
36
- `]:V},{[i`
36
+ `]:G},{[i`
37
37
  ${oS.disabled}
38
38
  `]:A}),classNameWidget:i`
39
39
  ${oS.widget};
@@ -43,5 +43,5 @@
43
43
  ${oS.label};
44
44
  `,classNameLabelActive:i`
45
45
  ${oS.labelActive};
46
- `,controlComponent:$.control,entry:t,collection:r,config:n,field:o,uniqueFieldId:this.uniqueFieldId,value:e,mediaPaths:s,metadata:q,onChange:(e,t)=>c(o,e,t),onValidate:m&&Nb()(m,this.uniqueFieldId),onOpenMediaLibrary:u,onClearMediaControl:f,onRemoveMediaControl:p,onRemoveInsertedMedia:h,onPersistMedia:g,onAddAsset:d,getAsset:l,hasActiveStyle:k||this.state.styleActive,setActiveStyle:()=>this.setState({styleActive:!0}),setInactiveStyle:()=>this.setState({styleActive:!1}),resolveWidget:Tn,widget:$,getEditorComponents:Pn,ref:y&&Nb()(y,o),controlRef:v,editorControl:uS,query:b,loadEntry:O,queryHits:w[this.uniqueFieldId]||[],clearSearch:S,clearFieldErrors:x,isFetching:_,fieldsErrors:a,onValidateObject:z,isEditorComponent:C,isNewEditorComponent:T,parentIds:P,t:j,validateMetaField:R,isDisabled:A,isFieldDuplicate:D,isFieldHidden:L,isLoadingAsset:M,locale:N}),B&&(0,xo.jsx)(sS,{active:k||this.state.styleActive,error:V},(0,xo.jsx)(V_(),{remarkPlugins:[K_()],allowedElements:["a","strong","em","del"],unwrapDisallowed:!0,components:{a:e=>{let{node:t}=e,r=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,Z_);return(0,xo.jsx)("a",rS({},r,{target:"_blank",rel:"noopener noreferrer",style:{color:"inherit"}}))}}},B)))))}}nS(cS,"propTypes",{value:i().oneOfType([i().node,i().object,i().string,i().bool]),field:Vm().map.isRequired,fieldsMetaData:Vm().map,fieldsErrors:Vm().map,mediaPaths:Vm().map.isRequired,boundGetAsset:i().func.isRequired,onChange:i().func.isRequired,openMediaLibrary:i().func.isRequired,addAsset:i().func.isRequired,removeInsertedMedia:i().func.isRequired,persistMedia:i().func.isRequired,onValidate:i().func,processControlRef:i().func,controlRef:i().func,query:i().func.isRequired,queryHits:i().object,isFetching:i().bool,clearSearch:i().func.isRequired,clearFieldErrors:i().func.isRequired,loadEntry:i().func.isRequired,t:i().func.isRequired,isEditorComponent:i().bool,isNewEditorComponent:i().bool,parentIds:i().arrayOf(i().string),entry:Vm().map.isRequired,collection:Vm().map.isRequired,isDisabled:i().bool,isHidden:i().bool,isFieldDuplicate:i().func,isFieldHidden:i().func,locale:i().string}),nS(cS,"defaultProps",{parentIds:[]});const uS=H((function(e){const{collections:t,entryDraft:r}=e,n=r.get("entry"),o=t.get(r.getIn(["entry","collection"])),i=xf(e.medias);return{mediaPaths:e.mediaLibrary.get("controlMedia"),isFetching:e.search.isFetching,queryHits:e.search.queryHits,config:e.config,entry:n,collection:o,isLoadingAsset:i,loadEntry:async function(r,n){const o=t.get(r);if(o)return await xl(e,o,n);throw new Error(`Can't find collection '${r}'`)},validateMetaField:(t,r,n)=>function(e,t,r,n,o){if(r.get("meta")&&"path"===r.get("name")){var i;if(!n)return jl(n,"invalidPath",o);const r=n.split("/").map(gi(e.config.slug)).join("/");if(n!==r)return jl(n,"invalidPath",o);const a=As(t,(0,Qe.fromJS)({entry:{meta:{path:n}}})),s=a?function(e,t,r){const n=Ql(e,t),o=n&&n.map((r=>Jl(e,t,r)));return o&&o.find((e=>(null==e?void 0:e.get("path"))===r))}(e.entries,t.get("name"),a):void 0,l=null==s?void 0:s.get("path"),c=null===(i=e.entryDraft)||void 0===i?void 0:i.getIn(["entry","path"]);if(l&&l!==c)return jl(n,"pathExists",o)}return{error:!1}}(e,o,t,r,n)}}),(function(e){return tS(tS({},(0,He.DE)({openMediaLibrary:xa,clearMediaControl:_a,removeMediaControl:Sa,removeInsertedMedia:Ea,persistMedia:Ta,addAsset:Xa,query:qi,clearSearch:zi,clearFieldErrors:wl},e)),{},{boundGetAsset:(t,r)=>ts(e,t,r)})}),(function(e,t,r){return tS(tS(tS(tS({},e),t),r),{},{boundGetAsset:t.boundGetAsset(e.collection,e.entry)})}))((0,We.Iu)()(cS)),fS=uS;function pS(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dS=Cg("div",{target:"e11hw0lx4",label:"ControlPaneContainer"})({name:"1n0x6o4",styles:"max-width:800px;margin:0 auto;padding-bottom:16px;font-size:16px"}),hS=Cg(qe.StyledDropdownButton,{target:"e11hw0lx3",label:"LocaleButton"})(qe.buttons.button,";",qe.buttons.medium,";color:",qe.colors.controlLabel,";background:",qe.colors.textFieldBorder,";height:100%;&:after{top:11px;}"),gS=Cg("div",{target:"e11hw0lx2",label:"LocaleButtonWrapper"})({name:"zjik7",styles:"display:flex"}),mS=Cg("div",{target:"e11hw0lx1",label:"LocaleRowWrapper"})({name:"zjik7",styles:"display:flex"}),yS=Cg(qe.Dropdown,{target:"e11hw0lx0",label:"StyledDropdown"})({name:"1hfmrg2",styles:"width:max-content;margin-top:20px;margin-bottom:20px;margin-right:20px"});function vS({locales:e,dropdownText:t,onLocaleChange:r}){return(0,xo.jsx)(yS,{renderButton:()=>(0,xo.jsx)(gS,null,(0,xo.jsx)(hS,null,t))},e.map((e=>(0,xo.jsx)(qe.DropdownItem,{css:(0,xo.css)(qe.text.fieldLabel,";;label:LocaleDropdown;"),key:e,label:e,onClick:()=>r(e)}))))}function bS({field:e,entry:t,isTranslatable:r,locale:n}){if(e.get("meta"))return t.getIn(["meta",e.get("name")]);if(r){const r=Uc(n);return t.getIn([...r,e.get("name")])}return t.getIn(["data",e.get("name")])}class wS extends r().Component{constructor(...e){super(...e),pS(this,"state",{selectedLocale:this.props.locale}),pS(this,"componentValidate",{}),pS(this,"handleLocaleChange",(e=>{this.setState({selectedLocale:e}),this.props.onLocaleChange(e)})),pS(this,"copyFromOtherLocale",(({targetLocale:e,t})=>r=>{if(!window.confirm(t("editor.editorControlPane.i18n.copyFromLocaleConfirm",{locale:r.toUpperCase()})))return;const{entry:n,collection:o}=this.props,{locales:i,defaultLocale:a}=Nc(o),s=this.state.selectedLocale,l=i&&{currentLocale:s,locales:i,defaultLocale:a};this.props.fields.forEach((t=>{if($c(t,e,r)){const e=bS({field:t,entry:n,locale:r,isTranslatable:r!==a});e&&this.props.onChange(t,e,void 0,l)}}))})),pS(this,"validate",(async()=>{this.props.fields.forEach((e=>{"hidden"!==e.get("widget")&&this.componentValidate[e.get("name")]()}))})),pS(this,"switchToDefaultLocale",(()=>{if(Lc(this.props.collection)){const{defaultLocale:e}=Nc(this.props.collection);return new Promise((t=>this.setState({selectedLocale:e},t)))}return Promise.resolve()}))}controlRef(e,t){var r;if(!t)return;const n=e.get("name");this.componentValidate[n]=(null===(r=t.innerWrappedControl)||void 0===r?void 0:r.validate)||t.validate}render(){const{collection:e,entry:t,fields:r,fieldsMetaData:n,fieldsErrors:o,onChange:i,onValidate:a,t:s}=this.props;if(!e||!r)return null;if(0===t.size||!0===t.get("partial"))return null;const{locales:l,defaultLocale:c}=Nc(e),u=this.state.selectedLocale,f=l&&{currentLocale:u,locales:l,defaultLocale:c};return(0,xo.jsx)(dS,null,l&&(0,xo.jsx)(mS,null,(0,xo.jsx)(vS,{locales:l,dropdownText:s("editor.editorControlPane.i18n.writingInLocale",{locale:u.toUpperCase()}),onLocaleChange:this.handleLocaleChange}),(0,xo.jsx)(vS,{locales:l.filter((e=>e!==u)),dropdownText:s("editor.editorControlPane.i18n.copyFromLocale"),onLocaleChange:this.copyFromOtherLocale({targetLocale:u,t:s})})),r.filter((e=>"hidden"!==e.get("widget"))).map(((r,s)=>{const l=$c(r,u,c),p=Fc(r,u,c),d=Bc(r,u,c),h=f?`${u}_${s}`:s;return(0,xo.jsx)(fS,{key:h,field:r,value:bS({field:r,entry:t,locale:u,isTranslatable:l}),fieldsMetaData:n,fieldsErrors:o,onChange:(e,t,r)=>{i(e,t,r,f)},onValidate:a,processControlRef:this.controlRef.bind(this),controlRef:this.controlRef,entry:t,collection:e,isDisabled:p,isHidden:d,isFieldDuplicate:e=>Fc(e,u,c),isFieldHidden:e=>Bc(e,u,c),locale:u})})))}}wS.propTypes={collection:Vm().map.isRequired,entry:Vm().map.isRequired,fields:Vm().list.isRequired,fieldsMetaData:Vm().map.isRequired,fieldsErrors:Vm().map.isRequired,onChange:i().func.isRequired,onValidate:i().func.isRequired,locale:i().string};var _S=__webpack_require__(12693);class SS extends r().Component{render(){const{previewComponent:e,previewProps:t}=this.props;return(0,xo.jsx)(_S.Kr,null,(n=>(0,xo.jsx)(z_.ScrollSyncPane,{attachTo:n.document.scrollingElement},(0,Oe.isElement)(e)?r().cloneElement(e,t):r().createElement(e,t))))}}SS.propTypes={previewComponent:i().func.isRequired,previewProps:i().object};const xS=SS,OS=["previewComponent"];class ES extends r().Component{shouldComponentUpdate(e){return["object","list"].includes(e.field.get("widget"))||this.props.value!==e.value||this.props.fieldsMetaData!==e.fieldsMetaData||this.props.getAsset!==e.getAsset}render(){const e=this.props,{previewComponent:t}=e,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,OS);return r().createElement(t,n)}}ES.propTypes={previewComponent:i().func.isRequired,field:Vm().map.isRequired,value:i().oneOfType([i().node,i().object,i().string,i().bool])};const kS=ES;function CS(e){return"hidden"!==e.get("widget")}const TS=Cg("div",{target:"e1iji6y40",label:"PreviewContainer"})({name:"9bq7s9",styles:"font-family:Roboto,'Helvetica Neue',HelveticaNeue,Helvetica,Arial,sans-serif"});class PS extends r().Component{render(){const{collection:e,fields:t,widgetFor:r}=this.props;return e&&t?(0,xo.jsx)(TS,null,t.filter(CS).map((e=>(0,xo.jsx)("div",{key:e.get("name")},r(e.get("name")))))):null}}function jS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function RS(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jS(Object(r),!0).forEach((function(t){MS(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jS(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function MS(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}PS.propTypes={collection:Vm().map.isRequired,entry:Vm().map.isRequired,fields:Vm().list.isRequired,getAsset:i().func.isRequired,widgetFor:i().func.isRequired};const AS=Cg(_S.ZP,{target:"enus48h0",label:"PreviewPaneFrame"})("width:100%;height:100%;border:none;background:#fff;border-radius:",qe.lengths.borderRadius,";");class IS extends r().Component{constructor(...e){super(...e),MS(this,"getWidget",((e,t,r,n,o=null)=>{const{getAsset:i,entry:a}=n,s=Tn(e.get("widget")),l=o?e.get("name")+"_"+o:e.get("name"),c=t&&!s.allowMapValue&&Qe.Map.isMap(t);return s.preview?(0,xo.jsx)(kS,{previewComponent:s.preview,key:l,field:e,getAsset:i,value:c?t.get(e.get("name")):t,entry:a,fieldsMetaData:r,resolveWidget:Tn,getRemarkPlugins:jn}):null})),MS(this,"inferredFields",{}),MS(this,"widgetFor",((e,t=this.props.fields,r=this.props.entry.get("data"),n=this.props.fieldsMetaData)=>{let o=t&&t.find((t=>t.get("name")===e)),i=Qe.Map.isMap(r)&&r.get(o.get("name"));o.get("meta")&&(i=this.props.entry.getIn(["meta",o.get("name")]));const a=o.get("fields"),s=o.get("field"),l=n&&n.get(o.get("name"),(0,Qe.Map)());a&&(o=o.set("fields",this.getNestedWidgets(a,i,l))),s&&(o=o.set("field",this.getSingleNested(s,i,l)));const c=Object.entries(this.inferredFields).filter((([e])=>Oc(this.props.collection,e)===o)).map((([,e])=>e))[0];return c?i=c.defaultPreview(i):i&&-1!==["string","text","number"].indexOf(o.get("widget"))&&i.toString().length<50&&(i=(0,xo.jsx)("div",null,(0,xo.jsx)("strong",null,o.get("label",o.get("name")),":")," ",i)),i?this.getWidget(o,i,l,this.props):null})),MS(this,"getNestedWidgets",((e,t,r)=>Qe.List.isList(t)?t.map((t=>this.widgetsForNestedFields(e,t,r))):this.widgetsForNestedFields(e,t,r))),MS(this,"getSingleNested",((e,t,r)=>Qe.List.isList(t)?t.map(((t,n)=>this.getWidget(e,t,r.get(e.get("name")),this.props,n))):this.getWidget(e,t,r.get(e.get("name")),this.props))),MS(this,"widgetsForNestedFields",((e,t,r)=>e.map((n=>this.widgetFor(n.get("name"),e,t,r))))),MS(this,"widgetsFor",(e=>{const{fields:t,entry:r,fieldsMetaData:n}=this.props,o=t.find((t=>t.get("name")===e)),i=o&&o.get("fields"),a=r.getIn(["data",o.get("name")]),s=n.get(o.get("name"),(0,Qe.Map)());return Qe.List.isList(a)?a.map((e=>{const t=i&&(0,Qe.Map)(i.map(((t,r)=>[t.get("name"),(0,xo.jsx)("div",{key:r},this.getWidget(t,e,s.get(t.get("name")),this.props))])));return(0,Qe.Map)({data:e,widgets:t})})):(0,Qe.Map)({data:a,widgets:i&&(0,Qe.Map)(i.map((e=>[e.get("name"),this.getWidget(e,a,s.get(e.get("name")),this.props)])))})}))}inferFields(){const e=Cc(this.props.collection,"title"),t=Cc(this.props.collection,"shortTitle"),r=Cc(this.props.collection,"author");this.inferredFields={},e&&(this.inferredFields[e]=ko.title),t&&(this.inferredFields[t]=ko.shortTitle),r&&(this.inferredFields[r]=ko.author)}render(){const{entry:e,collection:t,config:r}=this.props;if(!e||!e.get("data"))return null;const n=On(function(e,t){return hc[e.get("type")].templateName(e,t)}(t,e.get("slug")))||PS;this.inferFields();const o=RS(RS({},this.props),{},{widgetFor:this.widgetFor,widgetsFor:this.widgetsFor}),i=xn().map(((e,t)=>e.raw?(0,xo.jsx)("style",{key:t},e.value):(0,xo.jsx)("link",{key:t,href:e.value,type:"text/css",rel:"stylesheet"})));return t||(0,xo.jsx)(AS,{id:"preview-pane",head:i}),(0,xo.jsx)(Wg,{config:r},(0,xo.jsx)(AS,{id:"preview-pane",head:i,initialContent:'\n<!DOCTYPE html>\n<html>\n <head><base target="_blank"/></head>\n <body><div></div></body>\n</html>\n'},(0,xo.jsx)(_S.Kr,null,(({document:e,window:t})=>(0,xo.jsx)(xS,{previewComponent:n,previewProps:RS(RS({},o),{},{document:e,window:t})})))))}}IS.propTypes={collection:Vm().map.isRequired,fields:Vm().list.isRequired,entry:Vm().map.isRequired,fieldsMetaData:Vm().map.isRequired,getAsset:i().func.isRequired};const DS=H((function(e){return{isLoadingAsset:xf(e.medias),config:e.config}}),(function(e){return{boundGetAsset:(t,r)=>ts(e,t,r)}}),(function(e,t,r){return RS(RS(RS(RS({},e),t),r),{},{getAsset:t.boundGetAsset(r.collection,r.entry)})}))(IS);function LS(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const NS={noOverflow:{name:"1ctb18k-noOverflow",styles:"overflow:hidden;white-space:nowrap;text-overflow:ellipsis;label:noOverflow;"},buttonMargin:{name:"bx8mhy-buttonMargin",styles:"margin:0 10px;label:buttonMargin;"},toolbarSection:(0,xo.css)("height:100%;display:flex;align-items:center;border:0 solid ",qe.colors.textFieldBorder,";;label:toolbarSection;"),publishedButton:(0,xo.css)("background-color:",qe.colorsRaw.tealLight,";color:",qe.colorsRaw.tealDark,";;label:publishedButton;")},$S=Cg("div",{target:"e1d2l9mo26",label:"TooltipText"})({name:"1ykbu60",styles:"visibility:hidden;width:321px;background-color:#555;color:#fff;text-align:unset;border-radius:6px;padding:5px;position:absolute;z-index:1;top:145%;left:50%;margin-left:-320px;opacity:0;transition:opacity 0.3s"}),FS=Cg("div",{target:"e1d2l9mo25",label:"Tooltip"})("position:relative;display:inline-block;&:hover+",$S,"{visibility:visible;opacity:0.9;}"),BS=Cg("div",{target:"e1d2l9mo24",label:"TooltipContainer"})({name:"bjn8wh",styles:"position:relative"}),US=Cg(qe.StyledDropdownButton,{target:"e1d2l9mo23",label:"DropdownButton"})(NS.noOverflow,"@media (max-width: 1200px){padding-left:10px;}"),zS=Cg("div",{target:"e1d2l9mo22",label:"ToolbarContainer"})("box-shadow:0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1);position:fixed;top:0;left:0;width:100%;min-width:800px;z-index:",qe.zIndex.zIndex300,";background-color:#fff;height:66px;display:flex;justify-content:space-between;"),qS=Cg("div",{target:"e1d2l9mo21",label:"ToolbarSectionMain"})(NS.toolbarSection,";flex:10;display:flex;justify-content:space-between;padding:0 10px;"),WS=Cg("div",{target:"e1d2l9mo20",label:"ToolbarSubSectionFirst"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),HS=Cg(WS,{target:"e1d2l9mo19",label:"ToolbarSubSectionLast"})({name:"1f60if8",styles:"justify-content:flex-end"}),VS=Cg(Wv,{target:"e1d2l9mo18",label:"ToolbarSectionBackLink"})(NS.toolbarSection,";border-right-width:1px;font-weight:normal;padding:0 20px;&:hover,&:focus{background-color:#f1f2f4;}"),GS=Cg("div",{target:"e1d2l9mo17",label:"ToolbarSectionMeta"})(NS.toolbarSection,";border-left-width:1px;padding:0 7px;"),KS=Cg(qe.Dropdown,{target:"e1d2l9mo16",label:"ToolbarDropdown"})(NS.buttonMargin,";",qe.Icon,"{color:",qe.colorsRaw.teal,";}"),YS=Cg("div",{target:"e1d2l9mo15",label:"BackArrow"})("color:",qe.colors.textLead,";font-size:21px;font-weight:600;margin-right:16px;"),JS=Cg("div",{target:"e1d2l9mo14",label:"BackCollection"})("color:",qe.colors.textLead,";font-size:14px;"),QS=Cg("div",{target:"e1d2l9mo13",label:"BackStatus"})({name:"j9a02z",styles:"margin-top:6px"}),XS=Cg(QS,{target:"e1d2l9mo12",label:"BackStatusUnchanged"})(qe.components.textBadgeSuccess,";"),ZS=Cg(QS,{target:"e1d2l9mo11",label:"BackStatusChanged"})(qe.components.textBadgeDanger,";"),ex=Cg("button",{target:"e1d2l9mo10",label:"ToolbarButton"})(qe.buttons.button,";",qe.buttons.default,";",NS.buttonMargin,";",NS.noOverflow,";display:block;@media (max-width: 1200px){padding:0 10px;}"),tx=Cg(ex,{target:"e1d2l9mo9",label:"DeleteButton"})(qe.buttons.lightRed,";"),rx=Cg(ex,{target:"e1d2l9mo8",label:"SaveButton"})(qe.buttons.lightBlue,";&[disabled]{",qe.buttons.disabled,";}"),nx=Cg(US,{target:"e1d2l9mo7",label:"PublishedToolbarButton"})(NS.publishedButton,";"),ox=Cg(ex,{target:"e1d2l9mo6",label:"PublishedButton"})(NS.publishedButton,";"),ix=Cg(US,{target:"e1d2l9mo5",label:"PublishButton"})("background-color:",qe.colorsRaw.teal,";"),ax=Cg(US,{target:"e1d2l9mo4",label:"StatusButton"})("background-color:",qe.colorsRaw.tealLight,";color:",qe.colorsRaw.teal,";"),sx=Cg("div",{target:"e1d2l9mo3",label:"PreviewButtonContainer"})("margin-right:12px;color:",qe.colorsRaw.blue,";display:flex;align-items:center;a,",qe.Icon,"{color:",qe.colorsRaw.blue,";}",qe.Icon,"{position:relative;top:1px;}"),lx=Cg("button",{target:"e1d2l9mo2",label:"RefreshPreviewButton"})("background:none;border:0;cursor:pointer;color:",qe.colorsRaw.blue,";span{margin-right:6px;}"),cx=lx.withComponent("a",{target:"e1d2l9mo27",label:"PreviewLink"}),ux=Cg(qe.DropdownItem,{target:"e1d2l9mo1",label:"PublishDropDownItem"})({name:"svxjwj",styles:"min-width:initial"}),fx=Cg(qe.DropdownItem,{target:"e1d2l9mo0",label:"StatusDropdownItem"})(qe.Icon,"{color:",qe.colors.infoText,";}");class px extends r().Component{constructor(...e){super(...e),LS(this,"renderSimpleControls",(()=>{const{collection:e,hasChanged:t,isNewEntry:n,showDelete:o,onDelete:i,t:a}=this.props,s=e.get("create");return(0,xo.jsx)(r().Fragment,null,n||t?this.renderNewEntrySimplePublishControls({canCreate:s}):this.renderExistingEntrySimplePublishControls({canCreate:s}),(0,xo.jsx)("div",null,o?(0,xo.jsx)(tx,{onClick:i},a("editor.editorToolbar.deleteEntry")):null))})),LS(this,"renderDeployPreviewControls",(e=>{const{deployPreview:t={},loadDeployPreview:r,t:n}=this.props,{url:o,status:i,isFetching:a}=t;if(!i)return;const s="SUCCESS"===i&&!a;return(0,xo.jsx)(sx,null,s?(0,xo.jsx)(cx,{rel:"noopener noreferrer",target:"_blank",href:o},(0,xo.jsx)("span",null,e),(0,xo.jsx)(qe.Icon,{type:"new-tab",size:"xsmall"})):(0,xo.jsx)(lx,{onClick:r},(0,xo.jsx)("span",null,n("editor.editorToolbar.deployPreviewPendingButtonLabel")),(0,xo.jsx)(qe.Icon,{type:"refresh",size:"xsmall"})))})),LS(this,"renderStatusInfoTooltip",(()=>{const{t:e,currentStatus:t}=this.props,r={[eo.get("DRAFT")]:"statusInfoTooltipDraft",[eo.get("PENDING_REVIEW")]:"statusInfoTooltipInReview"},n=Object.keys(r).find((e=>e===t));return(0,xo.jsx)(BS,null,(0,xo.jsx)(FS,null,(0,xo.jsx)(qe.Icon,{type:"info-circle",size:"small",className:"tooltip"})),n&&(0,xo.jsx)($S,null,e(`editor.editorToolbar.${r[n]}`)))})),LS(this,"renderWorkflowStatusControls",(()=>{const{isUpdatingStatus:e,onChangeStatus:t,currentStatus:n,t:o,useOpenAuthoring:i}=this.props,a={[eo.get("DRAFT")]:o("editor.editorToolbar.draft"),[eo.get("PENDING_REVIEW")]:o("editor.editorToolbar.inReview"),[eo.get("PENDING_PUBLISH")]:o("editor.editorToolbar.ready")},s=e?o("editor.editorToolbar.updating"):o("editor.editorToolbar.status",{status:a[n]});return(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(KS,{dropdownTopOverlap:"40px",dropdownWidth:"120px",renderButton:()=>(0,xo.jsx)(ax,null,s)},(0,xo.jsx)(fx,{label:o("editor.editorToolbar.draft"),onClick:()=>t("DRAFT"),icon:n===eo.get("DRAFT")?"check":null}),(0,xo.jsx)(fx,{label:o("editor.editorToolbar.inReview"),onClick:()=>t("PENDING_REVIEW"),icon:n===eo.get("PENDING_REVIEW")?"check":null}),i?"":(0,xo.jsx)(fx,{label:o("editor.editorToolbar.ready"),onClick:()=>t("PENDING_PUBLISH"),icon:n===eo.get("PENDING_PUBLISH")?"check":null})),i&&this.renderStatusInfoTooltip())})),LS(this,"renderNewEntryWorkflowPublishControls",(({canCreate:e,canPublish:t})=>{const{isPublishing:n,onPublish:o,onPublishAndNew:i,onPublishAndDuplicate:a,t:s}=this.props;return t?(0,xo.jsx)(KS,{dropdownTopOverlap:"40px",dropdownWidth:"200px",renderButton:()=>(0,xo.jsx)(ix,null,s(n?"editor.editorToolbar.publishing":"editor.editorToolbar.publish"))},(0,xo.jsx)(ux,{label:s("editor.editorToolbar.publishNow"),icon:"arrow",iconDirection:"right",onClick:o}),e?(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(ux,{label:s("editor.editorToolbar.publishAndCreateNew"),icon:"add",onClick:i}),(0,xo.jsx)(ux,{label:s("editor.editorToolbar.publishAndDuplicate"),icon:"add",onClick:a})):null):""})),LS(this,"renderExistingEntryWorkflowPublishControls",(({canCreate:e,canPublish:t,canDelete:r})=>{const{unPublish:n,onDuplicate:o,isPersisting:i,t:a}=this.props;return t||e?(0,xo.jsx)(KS,{dropdownTopOverlap:"40px",dropdownWidth:"150px",key:"td-publish-create",renderButton:()=>(0,xo.jsx)(nx,null,a(i?"editor.editorToolbar.unpublishing":"editor.editorToolbar.published"))},r&&t&&(0,xo.jsx)(qe.DropdownItem,{label:a("editor.editorToolbar.unpublish"),icon:"arrow",iconDirection:"right",onClick:n}),e&&(0,xo.jsx)(qe.DropdownItem,{label:a("editor.editorToolbar.duplicate"),icon:"add",onClick:o})):""})),LS(this,"renderExistingEntrySimplePublishControls",(({canCreate:e})=>{const{onDuplicate:t,t:r}=this.props;return e?(0,xo.jsx)(KS,{dropdownTopOverlap:"40px",dropdownWidth:"150px",renderButton:()=>(0,xo.jsx)(nx,null,r("editor.editorToolbar.published"))},(0,xo.jsx)(qe.DropdownItem,{label:r("editor.editorToolbar.duplicate"),icon:"add",onClick:t})):(0,xo.jsx)(ox,null,r("editor.editorToolbar.published"))})),LS(this,"renderNewEntrySimplePublishControls",(({canCreate:e})=>{const{onPersist:t,onPersistAndNew:n,onPersistAndDuplicate:o,isPersisting:i,t:a}=this.props;return(0,xo.jsx)("div",null,(0,xo.jsx)(KS,{dropdownTopOverlap:"40px",dropdownWidth:"150px",renderButton:()=>(0,xo.jsx)(ix,null,a(i?"editor.editorToolbar.publishing":"editor.editorToolbar.publish"))},(0,xo.jsx)(qe.DropdownItem,{label:a("editor.editorToolbar.publishNow"),icon:"arrow",iconDirection:"right",onClick:t}),e?(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(qe.DropdownItem,{label:a("editor.editorToolbar.publishAndCreateNew"),icon:"add",onClick:n}),(0,xo.jsx)(qe.DropdownItem,{label:a("editor.editorToolbar.publishAndDuplicate"),icon:"add",onClick:o})):null))})),LS(this,"renderSimpleDeployPreviewControls",(()=>{const{hasChanged:e,isNewEntry:t,t:r}=this.props;if(!t&&!e)return this.renderDeployPreviewControls(r("editor.editorToolbar.deployButtonLabel"))})),LS(this,"renderWorkflowControls",(()=>{const{onPersist:e,onDelete:t,onDeleteUnpublishedChanges:r,showDelete:n,hasChanged:o,hasUnpublishedChanges:i,useOpenAuthoring:a,isPersisting:s,isDeleting:l,isNewEntry:c,isModification:u,currentStatus:f,collection:p,t:d}=this.props,h=p.get("create"),g=p.get("publish")&&!a,m=p.get("delete",!0),y=i&&u&&d("editor.editorToolbar.deleteUnpublishedChanges")||i&&(c||!u)&&d("editor.editorToolbar.deleteUnpublishedEntry")||!i&&!u&&d("editor.editorToolbar.deletePublishedEntry");return[(0,xo.jsx)(rx,{disabled:!o,key:"save-button",onClick:()=>o&&e()},d(s?"editor.editorToolbar.saving":"editor.editorToolbar.save")),f?[this.renderWorkflowStatusControls(),this.renderNewEntryWorkflowPublishControls({canCreate:h,canPublish:g})]:!c&&this.renderExistingEntryWorkflowPublishControls({canCreate:h,canPublish:g,canDelete:m}),n&&!a||i||u?(0,xo.jsx)(tx,{key:"delete-button",onClick:i?r:t},l?d("editor.editorToolbar.deleting"):y):null]})),LS(this,"renderWorkflowDeployPreviewControls",(()=>{const{currentStatus:e,isNewEntry:t,t:r}=this.props;return e?this.renderDeployPreviewControls(r("editor.editorToolbar.deployPreviewButtonLabel")):t?void 0:this.renderDeployPreviewControls(r("editor.editorToolbar.deployButtonLabel"))}))}componentDidMount(){const{isNewEntry:e,loadDeployPreview:t}=this.props;e||t({maxAttempts:3})}componentDidUpdate(e){const{isNewEntry:t,isPersisting:r,loadDeployPreview:n}=this.props;t||!e.isPersisting||r||n({maxAttempts:3})}render(){const{user:e,hasChanged:t,displayUrl:r,collection:n,hasWorkflow:o,onLogoutClick:i,t:a,editorBackLink:s}=this.props;return(0,xo.jsx)(zS,null,(0,xo.jsx)(VS,{to:s},(0,xo.jsx)(YS,null,"←"),(0,xo.jsx)("div",null,(0,xo.jsx)(JS,null,a("editor.editorToolbar.backCollection",{collectionLabel:n.get("label")})),t?(0,xo.jsx)(ZS,null,a("editor.editorToolbar.unsavedChanges")):(0,xo.jsx)(XS,null,a("editor.editorToolbar.changesSaved")))),(0,xo.jsx)(qS,null,(0,xo.jsx)(WS,null,o?this.renderWorkflowControls():this.renderSimpleControls()),(0,xo.jsx)(HS,null,o?this.renderWorkflowDeployPreviewControls():this.renderSimpleDeployPreviewControls())),(0,xo.jsx)(GS,null,(0,xo.jsx)(Wm,{displayUrl:r,imageUrl:null==e?void 0:e.avatar_url,onLogoutClick:i})))}}LS(px,"propTypes",{isPersisting:i().bool,isPublishing:i().bool,isUpdatingStatus:i().bool,isDeleting:i().bool,onPersist:i().func.isRequired,onPersistAndNew:i().func.isRequired,onPersistAndDuplicate:i().func.isRequired,showDelete:i().bool.isRequired,onDelete:i().func.isRequired,onDeleteUnpublishedChanges:i().func.isRequired,onChangeStatus:i().func.isRequired,onPublish:i().func.isRequired,unPublish:i().func.isRequired,onDuplicate:i().func.isRequired,onPublishAndNew:i().func.isRequired,onPublishAndDuplicate:i().func.isRequired,user:i().object,hasChanged:i().bool,displayUrl:i().string,collection:Vm().map.isRequired,hasWorkflow:i().bool,useOpenAuthoring:i().bool,hasUnpublishedChanges:i().bool,isNewEntry:i().bool,isModification:i().bool,currentStatus:i().string,onLogoutClick:i().func.isRequired,deployPreview:i().object,loadDeployPreview:i().func.isRequired,t:i().func.isRequired,editorBackLink:i().string.isRequired});const dx=(0,We.Iu)()(px);function hx(){return hx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hx.apply(this,arguments)}function gx(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mx="cms.preview-visible",yx="cms.scroll-sync-enabled",vx="cms.split-pane-position",bx="cms.i18n-visible",wx={splitPane:(0,xo.css)(qe.components.card,";border-radius:0;height:100%;;label:splitPane;"),pane:{name:"1yvxf4n-pane",styles:"height:100%;overflow-y:auto;label:pane;"}},_x=Cg(qe.IconButton,{target:"e1nx103k7",label:"EditorToggle"})({name:"cn3xcj",styles:"margin-bottom:12px"});function Sx(){return(0,xo.jsx)(xo.Global,{styles:(0,xo.css)(".Resizer.vertical{width:21px;cursor:col-resize;position:relative;transition:background-color ",qe.transitions.main,";&:before{content:'';width:2px;height:100%;position:relative;left:10px;background-color:",qe.colors.textFieldBorder,";display:block;}&:hover,&:active{background-color:",qe.colorsRaw.GrayLight,";}};label:ReactSplitPaneGlobalStyles;")})}const xx=Cg(U_,{target:"e1nx103k6",label:"StyledSplitPane"})(wx.splitPane,";.Pane{height:100%;}"),Ox=Cg("div",{target:"e1nx103k5",label:"NoPreviewContainer"})(wx.splitPane,";"),Ex=Cg("div",{target:"e1nx103k4",label:"EditorContainer"})("width:100%;min-width:800px;height:100%;position:absolute;top:0;left:0;overflow:hidden;padding-top:66px;background-color:",qe.colors.background,";"),kx=Cg("div",{target:"e1nx103k3",label:"Editor"})({name:"yd3x82",styles:"height:100%;margin:0 auto;position:relative"}),Cx=Cg("div",{target:"e1nx103k2",label:"PreviewPaneContainer"})("height:100%;pointer-events:",(e=>e.blockEntry?"none":"auto"),";overflow-y:",(e=>e.overFlow?"auto":"hidden"),";"),Tx=Cg(Cx,{target:"e1nx103k1",label:"ControlPaneContainer"})({name:"b2tic3",styles:"padding:0 16px;position:relative;overflow-x:hidden"}),Px=Cg("div",{target:"e1nx103k0",label:"ViewControls"})("position:absolute;top:10px;right:10px;z-index:",qe.zIndex.zIndex299,";");function jx({i18nVisible:e,previewVisible:t,editor:r,editorWithEditor:n,editorWithPreview:o}){return e?n:t?o:(0,xo.jsx)(Ox,null,r)}class Rx extends t.Component{constructor(...e){super(...e),gx(this,"state",{showEventBlocker:!1,previewVisible:"false"!==localStorage.getItem(mx),scrollSyncEnabled:"false"!==localStorage.getItem(yx),i18nVisible:"false"!==localStorage.getItem(bx)}),gx(this,"handleSplitPaneDragStart",(()=>{this.setState({showEventBlocker:!0})})),gx(this,"handleSplitPaneDragFinished",(()=>{this.setState({showEventBlocker:!1})})),gx(this,"handleOnPersist",(async(e={})=>{const{createNew:t=!1,duplicate:r=!1}=e;await this.controlPaneRef.switchToDefaultLocale(),this.controlPaneRef.validate(),this.props.onPersist({createNew:t,duplicate:r})})),gx(this,"handleOnPublish",(async(e={})=>{const{createNew:t=!1,duplicate:r=!1}=e;await this.controlPaneRef.switchToDefaultLocale(),this.controlPaneRef.validate(),this.props.onPublish({createNew:t,duplicate:r})})),gx(this,"handleTogglePreview",(()=>{const e=!this.state.previewVisible;this.setState({previewVisible:e}),localStorage.setItem(mx,e)})),gx(this,"handleToggleScrollSync",(()=>{const e=!this.state.scrollSyncEnabled;this.setState({scrollSyncEnabled:e}),localStorage.setItem(yx,e)})),gx(this,"handleToggleI18n",(()=>{const e=!this.state.i18nVisible;this.setState({i18nVisible:e}),localStorage.setItem(bx,e)})),gx(this,"handleLeftPanelLocaleChange",(e=>{this.setState({leftPanelLocale:e})}))}render(){const{collection:e,entry:t,fields:r,fieldsMetaData:n,fieldsErrors:o,onChange:i,showDelete:a,onDelete:s,onDeleteUnpublishedChanges:l,onChangeStatus:c,onPublish:u,unPublish:f,onDuplicate:p,onValidate:d,user:h,hasChanged:g,displayUrl:m,hasWorkflow:y,useOpenAuthoring:v,hasUnpublishedChanges:b,isNewEntry:w,isModification:_,currentStatus:S,onLogoutClick:x,loadDeployPreview:O,deployPreview:E,draftKey:k,editorBackLink:C,t:T}=this.props,{scrollSyncEnabled:P,showEventBlocker:j}=this.state,R=function(e,t){if(e.get("type")===bo){const r=mc(e,t.get("slug")),n=null==r?void 0:r.getIn(["editor","preview"]);if(null!=n)return n}return e.getIn(["editor","preview"],!0)}(e,t),{locales:M,defaultLocale:A}=Nc(this.props.collection),I=Lc(e)&&M.length>1,D={collection:e,entry:t,fields:r,fieldsMetaData:n,fieldsErrors:o,onChange:i,onValidate:d},L=this.state.leftPanelLocale||(null==M?void 0:M[0]),N=(0,xo.jsx)(Tx,{overFlow:!0,blockEntry:j},(0,xo.jsx)(wS,hx({},D,{ref:e=>this.controlPaneRef=e,locale:L,t:T,onLocaleChange:this.handleLeftPanelLocaleChange}))),$=(0,xo.jsx)(Tx,{overFlow:!this.state.scrollSyncEnabled,blockEntry:j},(0,xo.jsx)(wS,hx({},D,{locale:null==M?void 0:M[1],t:T}))),F=I?function(e,t,r){return t===r?e:e.set("data",e.getIn([Ac,t,"data"]))}(t,L,A):t,B=(0,xo.jsx)(z_.ScrollSync,{enabled:this.state.scrollSyncEnabled},(0,xo.jsx)("div",null,(0,xo.jsx)(Sx,null),(0,xo.jsx)(xx,{maxSize:-100,minSize:400,defaultSize:parseInt(localStorage.getItem(vx),10)||"50%",onChange:e=>localStorage.setItem(vx,e),onDragStarted:this.handleSplitPaneDragStart,onDragFinished:this.handleSplitPaneDragFinished},(0,xo.jsx)(z_.ScrollSyncPane,null,N),(0,xo.jsx)(Cx,{blockEntry:j},(0,xo.jsx)(DS,{collection:e,entry:F,fields:r,fieldsMetaData:n,locale:L}))))),U=(0,xo.jsx)(z_.ScrollSync,{enabled:this.state.scrollSyncEnabled},(0,xo.jsx)("div",null,(0,xo.jsx)(xx,{maxSize:-100,defaultSize:parseInt(localStorage.getItem(vx),10)||"50%",onChange:e=>localStorage.setItem(vx,e),onDragStarted:this.handleSplitPaneDragStart,onDragFinished:this.handleSplitPaneDragFinished},(0,xo.jsx)(z_.ScrollSyncPane,null,N),(0,xo.jsx)(z_.ScrollSyncPane,null,$)))),z=I&&this.state.i18nVisible,q=R&&this.state.previewVisible,W=z||q;return(0,xo.jsx)(Ex,null,(0,xo.jsx)(dx,{isPersisting:t.get("isPersisting"),isPublishing:t.get("isPublishing"),isUpdatingStatus:t.get("isUpdatingStatus"),isDeleting:t.get("isDeleting"),onPersist:this.handleOnPersist,onPersistAndNew:()=>this.handleOnPersist({createNew:!0}),onPersistAndDuplicate:()=>this.handleOnPersist({createNew:!0,duplicate:!0}),onDelete:s,onDeleteUnpublishedChanges:l,onChangeStatus:c,showDelete:a,onPublish:u,unPublish:f,onDuplicate:p,onPublishAndNew:()=>this.handleOnPublish({createNew:!0}),onPublishAndDuplicate:()=>this.handleOnPublish({createNew:!0,duplicate:!0}),user:h,hasChanged:g,displayUrl:m,collection:e,hasWorkflow:y,useOpenAuthoring:v,hasUnpublishedChanges:b,isNewEntry:w,isModification:_,currentStatus:S,onLogoutClick:x,loadDeployPreview:O,deployPreview:E,editorBackLink:C}),(0,xo.jsx)(kx,{key:k},(0,xo.jsx)(Px,null,I&&(0,xo.jsx)(_x,{isActive:z,onClick:this.handleToggleI18n,size:"large",type:"page",title:T("editor.editorInterface.toggleI18n"),marginTop:"70px"}),R&&(0,xo.jsx)(_x,{isActive:q,onClick:this.handleTogglePreview,size:"large",type:"eye",title:T("editor.editorInterface.togglePreview")}),W&&(0,xo.jsx)(_x,{isActive:P,onClick:this.handleToggleScrollSync,size:"large",type:"scroll",title:T("editor.editorInterface.toggleScrollSync")})),(0,xo.jsx)(jx,{i18nVisible:z,previewVisible:q,editor:N,editorWithEditor:U,editorWithPreview:B})))}}Rx.propTypes={collection:Vm().map.isRequired,entry:Vm().map.isRequired,fields:Vm().list.isRequired,fieldsMetaData:Vm().map.isRequired,fieldsErrors:Vm().map.isRequired,onChange:i().func.isRequired,onValidate:i().func.isRequired,onPersist:i().func.isRequired,showDelete:i().bool.isRequired,onDelete:i().func.isRequired,onDeleteUnpublishedChanges:i().func.isRequired,onPublish:i().func.isRequired,unPublish:i().func.isRequired,onDuplicate:i().func.isRequired,onChangeStatus:i().func.isRequired,user:i().object,hasChanged:i().bool,displayUrl:i().string,hasWorkflow:i().bool,useOpenAuthoring:i().bool,hasUnpublishedChanges:i().bool,isNewEntry:i().bool,isModification:i().bool,currentStatus:i().string,onLogoutClick:i().func.isRequired,deployPreview:i().object,loadDeployPreview:i().func.isRequired,draftKey:i().string.isRequired,t:i().func.isRequired};const Mx=Rx;function Ax(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ix(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ax(Object(r),!0).forEach((function(t){Dx(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ax(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Dx(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lx(e,t){const{collections:r}=e,n=e.config.publish_mode===Zn,o=r.get(t.match.params.name),i={isEditorialWorkflow:n,showDelete:!t.newEntry&&Sc(o)};if(n){const r=t.match.params[0],n=Vf(e,o.get("name"),r);n&&(i.unpublishedEntry=!0,i.entry=n)}return i}function Nx(e,t,r){const{isEditorialWorkflow:n,unpublishedEntry:o}=e,{dispatch:i}=t,a={};return n&&(a.loadEntry=(e,t)=>i(Cs(e,t)),a.persistEntry=e=>i(function(e,t){return async(r,n)=>{const o=n(),i=o.entryDraft,a=i.get("fieldsErrors"),s=function(e,t){return function(e,t){return e.get("entities")?e.get("entities").filter(((e,r)=>yf()(r,`${t}.`))).map((e=>e.get("slug"))).valueSeq():null}(e.editorialWorkflow,t)}(o,e.get("name")),l=Wf(o,e.get("name")).concat(s);if(!Qt()(o.editorialWorkflow.toJS(),"pages.ids",!1)&&r(Ts(o.collections)),!a.isEmpty())return a.some((e=>e.some((e=>e.type&&e.type===Ki.PRESENCE))))&&r(ea({message:{key:"ui.toast.missingRequiredField"},type:"error",dismissAfter:8e3})),Promise.reject();const c=rf(o.config),u=i.get("entry"),f=Tl({entry:u}),p=Pl(e,u),d=i.set("entry",p);r(Os(e,u.get("slug")));const h=t?c.persistUnpublishedEntry:c.persistEntry;try{const t=await h.call(c,{config:o.config,collection:e,entryDraft:d,assetProxies:f,usedSlugs:l});r(ea({message:{key:"ui.toast.entrySaved"},type:"success",dismissAfter:4e3})),r(Es(e,p)),u.get("slug")!==t&&(await r(Cs(e,t)),as(e.get("name"),t))}catch(t){return r(ea({message:{key:"ui.toast.onFailToPersist",details:t},type:"error",dismissAfter:8e3})),Promise.reject(r(ks(t,e,u.get("slug"))))}}}(e,o))),Ix(Ix(Ix({},r),e),a)}function $x(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Fx extends r().Component{constructor(...e){super(...e),$x(this,"createBackup",w_()((function(e,t){this.props.persistLocalBackup(e,t)}),2e3)),$x(this,"handleChangeDraftField",((e,t,r,n)=>{const o=[this.props.unPublishedEntry,this.props.publishedEntry].filter(Boolean);this.props.changeDraftField({field:e,value:t,metadata:r,entries:o,i18n:n})})),$x(this,"handleChangeStatus",(e=>{const{entryDraft:t,updateUnpublishedEntryStatus:r,collection:n,slug:o,currentStatus:i,t:a}=this.props;if(t.get("hasChanged"))return void window.alert(a("editor.editor.onUpdatingWithUnsavedChanges"));const s=eo.get(e);r(n.get("name"),o,i,s)})),$x(this,"handlePersistEntry",(async(e={})=>{const{createNew:t=!1,duplicate:r=!1}=e,{persistEntry:n,collection:o,currentStatus:i,hasWorkflow:a,loadEntry:s,slug:l,createDraftDuplicateFromEntry:c,entryDraft:u}=this.props;await n(o),this.deleteBackup(),t?(is(o.get("name")),r&&c(u.get("entry"))):l&&a&&!i&&s(o,l)})),$x(this,"handlePublishEntry",(async(e={})=>{const{createNew:t=!1,duplicate:r=!1}=e,{publishUnpublishedEntry:n,createDraftDuplicateFromEntry:o,entryDraft:i,collection:a,slug:s,currentStatus:l,t:c}=this.props;l===eo.last()?i.get("hasChanged")?window.alert(c("editor.editor.onPublishingWithUnsavedChanges")):window.confirm(c("editor.editor.onPublishing"))&&(await n(a.get("name"),s),this.deleteBackup(),t&&is(a.get("name")),r&&o(i.get("entry"))):window.alert(c("editor.editor.onPublishingNotReady"))})),$x(this,"handleUnpublishEntry",(async()=>{const{unpublishPublishedEntry:e,collection:t,slug:r,t:n}=this.props;if(window.confirm(n("editor.editor.onUnpublishing")))return await e(t,r),os(t.get("name"))})),$x(this,"handleDuplicateEntry",(()=>{const{createDraftDuplicateFromEntry:e,collection:t,entryDraft:r}=this.props;is(t.get("name")),e(r.get("entry"))})),$x(this,"handleDeleteEntry",(()=>{const{entryDraft:e,newEntry:t,collection:r,deleteEntry:n,slug:o,t:i}=this.props;if(e.get("hasChanged")){if(!window.confirm(i("editor.editor.onDeleteWithUnsavedChanges")))return}else if(!window.confirm(i("editor.editor.onDeletePublishedEntry")))return;if(t)return os(r.get("name"));setTimeout((async()=>(await n(r,o),this.deleteBackup(),os(r.get("name")))),0)})),$x(this,"handleDeleteUnpublishedChanges",(async()=>{const{entryDraft:e,collection:t,slug:r,deleteUnpublishedEntry:n,loadEntry:o,isModification:i,t:a}=this.props;e.get("hasChanged")&&!window.confirm(a("editor.editor.onDeleteUnpublishedChangesWithUnsavedChanges"))||window.confirm(a("editor.editor.onDeleteUnpublishedChanges"))&&(await n(t.get("name"),r),this.deleteBackup(),i?o(t,r):os(t.get("name")))}))}componentDidMount(){const{newEntry:e,collection:t,slug:r,loadEntry:n,createEmptyDraft:o,loadEntries:i,retrieveLocalBackup:a,collectionEntriesLoaded:s,t:l}=this.props;a(t,r),e?o(t,this.props.location.search):n(t,r);const c=l("editor.editor.onLeavePage");this.exitBlocker=e=>{if(this.props.entryDraft.get("hasChanged"))return e.returnValue=c,c},window.addEventListener("beforeunload",this.exitBlocker);const u=ns.block(((e,r)=>{const n=this.props.entryDraft.getIn(["entry","isPersisting"]),o=this.props.entryDraft.getIn(["entry","newRecord"]),i=`/collections/${t.get("name")}/new`;if(!n||!o||this.props.location.pathname!==i||"PUSH"!==r)return this.props.hasChanged?c:void 0}));this.unlisten=ns.listen(((e,r)=>{const n=`/collections/${t.get("name")}/new`,o=`/collections/${t.get("name")}/entries/`,{pathname:i}=e;i.startsWith(n)||i.startsWith(o)&&"PUSH"===r||(this.deleteBackup(),u(),this.unlisten())})),s||i(t)}componentDidUpdate(e){if(!e.localBackup&&this.props.localBackup&&(window.confirm(this.props.t("editor.editor.confirmLoadBackup"))?this.props.loadLocalBackup():this.deleteBackup()),this.props.hasChanged&&this.createBackup(this.props.entryDraft.get("entry"),this.props.collection),e.entry===this.props.entry)return;const{newEntry:t,collection:r}=this.props;t&&e.createEmptyDraft(r,this.props.location.search)}componentWillUnmount(){this.createBackup.flush(),this.props.discardDraft(),window.removeEventListener("beforeunload",this.exitBlocker)}deleteBackup(){const{deleteLocalBackup:e,collection:t,slug:r,newEntry:n}=this.props;this.createBackup.cancel(),e(t,!n&&r)}render(){const{entry:e,entryDraft:t,fields:r,collection:n,changeDraftFieldValidation:o,user:i,hasChanged:a,displayUrl:s,hasWorkflow:l,useOpenAuthoring:c,unpublishedEntry:u,newEntry:f,isModification:p,currentStatus:d,logoutUser:h,deployPreview:g,loadDeployPreview:m,draftKey:y,slug:v,t:b,editorBackLink:w}=this.props,_=!f&&!u;return e&&e.get("error")?(0,xo.jsx)("div",null,(0,xo.jsx)("h3",null,e.get("error"))):null==t||void 0===t.get("entry")||e&&e.get("isFetching")?(0,xo.jsx)(qe.Loader,{active:!0},b("editor.editor.loadingEntry")):(0,xo.jsx)(Mx,{draftKey:y,entry:t.get("entry"),collection:n,fields:r,fieldsMetaData:t.get("fieldsMetaData"),fieldsErrors:t.get("fieldsErrors"),onChange:this.handleChangeDraftField,onValidate:o,onPersist:this.handlePersistEntry,onDelete:this.handleDeleteEntry,onDeleteUnpublishedChanges:this.handleDeleteUnpublishedChanges,onChangeStatus:this.handleChangeStatus,onPublish:this.handlePublishEntry,unPublish:this.handleUnpublishEntry,onDuplicate:this.handleDuplicateEntry,showDelete:this.props.showDelete,user:i,hasChanged:a,displayUrl:s,hasWorkflow:l,useOpenAuthoring:c,hasUnpublishedChanges:u,isNewEntry:f,isModification:p,currentStatus:d,onLogoutClick:h,deployPreview:g,loadDeployPreview:t=>m(n,v,e,_,t),editorBackLink:w,t:b})}}$x(Fx,"propTypes",{changeDraftField:i().func.isRequired,changeDraftFieldValidation:i().func.isRequired,collection:Vm().map.isRequired,createDraftDuplicateFromEntry:i().func.isRequired,createEmptyDraft:i().func.isRequired,discardDraft:i().func.isRequired,entry:Vm().map,entryDraft:Vm().map.isRequired,loadEntry:i().func.isRequired,persistEntry:i().func.isRequired,deleteEntry:i().func.isRequired,showDelete:i().bool.isRequired,fields:Vm().list.isRequired,slug:i().string,newEntry:i().bool.isRequired,displayUrl:i().string,hasWorkflow:i().bool,useOpenAuthoring:i().bool,unpublishedEntry:i().bool,isModification:i().bool,collectionEntriesLoaded:i().bool,updateUnpublishedEntryStatus:i().func.isRequired,publishUnpublishedEntry:i().func.isRequired,deleteUnpublishedEntry:i().func.isRequired,logoutUser:i().func.isRequired,loadEntries:i().func.isRequired,deployPreview:i().object,loadDeployPreview:i().func.isRequired,currentStatus:i().string,user:i().object,location:i().shape({pathname:i().string,search:i().string}),hasChanged:i().bool,t:i().func.isRequired,retrieveLocalBackup:i().func.isRequired,localBackup:Vm().map,loadLocalBackup:i().func,persistLocalBackup:i().func.isRequired,deleteLocalBackup:i().func});const Bx={changeDraftField:function({field:e,value:t,metadata:r,entries:n,i18n:o}){return{type:el,payload:{field:e,value:t,metadata:r,entries:n,i18n:o}}},changeDraftFieldValidation:function(e,t){return{type:tl,payload:{uniquefieldId:e,errors:t}}},loadEntry:Sl,loadEntries:kl,loadDeployPreview:function(e,t,r,n,o){return async(i,a)=>{const s=a(),l=rf(s.config),c=e.get("name"),u=Hf(s,c,t);if(!u||!u.isFetching){i(function(e,t){return{type:Ef,payload:{collection:e,slug:t}}}(c,t));try{const a=n?l.getDeploy(e,t,r):await l.getDeployPreview(e,t,r,o);return i(a?function(e,t,r){const{url:n,status:o}=r;return{type:kf,payload:{collection:e,slug:t,url:n,status:o}}}(c,t,a):Tf(c,t))}catch(e){console.error(e),i(ea({message:{details:e.message,key:"ui.toast.onFailToLoadDeployPreview"},type:"error",dismissAfter:8e3})),i(Tf(c,t))}}}},loadLocalBackup:function(){return{type:ol}},retrieveLocalBackup:function(e,t){return async(r,n)=>{const o=n(),i=rf(o.config),{entry:a}=await i.getLocalDraftBackup(e,t);if(a){const t=a.mediaFiles||[],o=await Promise.all(t.map((t=>t.file||t.url?Tr({path:t.path,file:t.file,url:t.url,field:t.field}):rs({collection:e,entry:(0,Qe.fromJS)(a),path:t.path,field:t.field})(r,n))));return r(Qa(o)),r(function(e){return{type:nl,payload:{entry:e}}}(a))}}},persistLocalBackup:function(e,t){return(r,n)=>{const o=n();return rf(o.config).persistLocalDraftBackup(e,t)}},deleteLocalBackup:function(e,t){return(r,n)=>{const o=n();return rf(o.config).deleteLocalDraftBackup(e,t)}},createDraftDuplicateFromEntry:function(e){return t=>{t(Yi({predicate:({type:e})=>e===Xs,run:()=>t(function(e){return{type:il,payload:Si(e.get("collection"),"","",{data:e.get("data"),mediaFiles:e.get("mediaFiles").toJS()})}}(e))}))}},createEmptyDraft:function(e,t){return async(r,n)=>{new URLSearchParams(t).forEach(((t,r)=>{e=function(e,r,n){const o=Oc(e,r);if(!o)return e;let i=!1;return e=e.set("fields",Ec(e.get("fields",(0,Qe.List)()),(function(e){const r=e;return r===o?(i=!0,(e=>{return e.set("default",!!["true","True","TRUE"].includes(r=t)||!["false","False","FALSE"].includes(r)&&function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}(r));var r})(r)):r}),(()=>i))),e}(e,r)}));const o=e.get("fields",(0,Qe.List)()),i=function(e){return e.filter((e=>!e.get("meta"))).toList()}(o),a=Cl(i),s=function(e){return e.filter((e=>!0===e.get("meta"))).toList()}(o),l=Cl(s),c=n(),u=rf(c.config);e.has("media_folder")||await Fa(r,n());const f=function(e,t){if(!Lc(e))return{};return function(e,t){const{locales:r,defaultLocale:n}=Nc(e);return Object.fromEntries(r.filter((e=>e!==n)).map((e=>[e,{data:t}])))}(e,Cl(t,(function(e){return e.get(Ac)!==Dc.DUPLICATE&&e.get(Ac)!==Dc.TRANSLATE})))}(e,i);let p=Si(e.get("name"),"","",{data:a,i18n:f,mediaFiles:[],meta:l});p=await u.processEntry(c,e,p),r({type:Xs,payload:p})}},discardDraft:function(){return{type:Zs}},persistEntry:function(e){return async(t,r)=>{const n=r(),o=n.entryDraft,i=o.get("fieldsErrors"),a=Wf(n,e.get("name"));if(!i.isEmpty())return i.some((e=>e.some((e=>e.type&&e.type===Ki.PRESENCE))))&&t(ea({message:{key:"ui.toast.missingRequiredField"},type:"error",dismissAfter:8e3})),Promise.reject();const s=rf(n.config),l=o.get("entry"),c=Tl({entry:l}),u=Pl(e,l),f=o.set("entry",u);return t(function(e,t){return{type:al,payload:{collectionName:e.get("name"),entrySlug:t.get("slug")}}}(e,u)),s.persistEntry({config:n.config,collection:e,entryDraft:f,assetProxies:c,usedSlugs:a}).then((async r=>{t(ea({message:{key:"ui.toast.entrySaved"},type:"success",dismissAfter:4e3})),c.length>0&&await t(ka()),t(function(e,t,r){return{type:sl,payload:{collectionName:e.get("name"),entrySlug:t.get("slug"),slug:r}}}(e,u,r)),e.has("nested")&&await t(kl(e)),l.get("slug")!==r&&(await t(Sl(e,r)),as(e.get("name"),r))})).catch((r=>(console.error(r),t(ea({message:{details:r,key:"ui.toast.onFailToPersist"},type:"error",dismissAfter:8e3})),Promise.reject(t(function(e,t,r){return{type:ll,error:"Failed to persist entry",payload:{collectionName:e.get("name"),entrySlug:t.get("slug"),error:r.toString()}}}(e,u,r))))))}},deleteEntry:function(e,t){return(r,n)=>{const o=n(),i=rf(o.config);return r(function(e,t){return{type:"ENTRY_DELETE_REQUEST",payload:{collectionName:e.get("name"),entrySlug:t}}}(e,t)),i.deleteEntry(o,e,t).then((()=>r(vl(e,t)))).catch((n=>(r(ea({message:{details:n,key:"ui.toast.onFailToDelete"},type:"error",dismissAfter:8e3})),console.error(n),Promise.reject(r(function(e,t,r){return{type:"ENTRY_DELETE_FAILURE",payload:{collectionName:e.get("name"),entrySlug:t,error:r.toString()}}}(e,t,n))))))}},updateUnpublishedEntryStatus:Ps,publishUnpublishedEntry:Rs,unpublishPublishedEntry:function(e,t){return(r,n)=>{const o=n(),i=rf(o.config),a=qf(o,e.get("name"),t),s=(0,Qe.Map)().set("entry",a);return r(Os(e,t)),i.deleteEntry(o,e,t).then((()=>i.persistEntry({config:o.config,collection:e,entryDraft:s,assetProxies:[],usedSlugs:(0,Qe.List)(),status:eo.get("PENDING_PUBLISH")}))).then((()=>{r(Es(e,a)),r(vl(e,t)),r(Cs(e,t)),r(ea({message:{key:"ui.toast.entryUnpublished"},type:"success",dismissAfter:4e3}))})).catch((t=>{r(ea({message:{key:"ui.toast.onFailToUnpublishEntry",details:t},type:"error",dismissAfter:8e3})),r(ks(t,e,a.get("slug")))}))}},deleteUnpublishedEntry:js,logoutUser:hf},Ux=H((function(e,t){const{collections:r,entryDraft:n,auth:o,config:i,entries:a,globalUI:s}=e,l=t.match.params[0],c=r.get(t.match.params.name),u=c.get("name"),f=!0===t.newRecord,p=yc(c,l),d=f?null:qf(e,u,l),h=o.user,g=n.get("hasChanged"),m=i.display_url,y=i.publish_mode===Zn,v=s.useOpenAuthoring,b=n.getIn(["entry","isModification"]),w=!!a.getIn(["pages",u]),_=Vf(e,u,l),S=qf(e,u,l),x=_&&_.get("status"),O=Hf(e,u,l),E=n.get("localBackup"),k=n.get("key");let C=`/collections/${u}`;if("workflow"===new URLSearchParams(t.location.search).get("ref")&&(C="/workflow"),c.has("nested")&&l){const e=l.split("/");e.length>2&&(C=`${C}/filter/${e.slice(0,-2).join("/")}`)}return{collection:c,collections:r,newEntry:f,entryDraft:n,fields:p,slug:l,entry:d,user:h,hasChanged:g,displayUrl:m,hasWorkflow:y,useOpenAuthoring:v,isModification:b,collectionEntriesLoaded:w,currentStatus:x,deployPreview:O,localBackup:E,draftKey:k,publishedEntry:S,unPublishedEntry:_,editorBackLink:C}}),Bx)(function(e){return H(Lx,null,Nx)(class extends r().Component{render(){return(0,xo.jsx)(e,this.props)}})}((0,We.Iu)()(Fx))),zx=Cg("div",{target:"ew40z3q0",label:"NotFoundContainer"})("margin:",qe.lengths.pageMargin,";");function qx({t:e}){return(0,xo.jsx)(zx,null,(0,xo.jsx)("h2",null,e("app.notFoundPage.header")))}qx.propTypes={t:i().func.isRequired};const Wx=(0,We.Iu)()(qx);function Hx(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vx(){return Vx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vx.apply(this,arguments)}const Gx={buttonActive:(0,xo.css)("color:",qe.colors.active,";;label:buttonActive;")};function Kx(e){return(0,xo.jsx)("header",Vx({css:(0,xo.css)(qe.shadows.dropMain,";position:sticky;width:100%;top:0;background-color:",qe.colors.foreground,";z-index:",qe.zIndex.zIndex300,";height:",qe.lengths.topBarHeight,";;label:AppHeader;")},e))}const Yx=Cg("div",{target:"e1rbzf6g4",label:"AppHeaderContent"})({name:"jxf21e",styles:"display:flex;justify-content:space-between;min-width:800px;max-width:1440px;padding:0 12px;margin:0 auto"}),Jx=Cg("button",{target:"e1rbzf6g3",label:"AppHeaderButton"})(qe.buttons.button,";background:none;color:#7b8290;font-family:inherit;font-size:16px;font-weight:500;display:inline-flex;padding:16px 20px;align-items:center;",qe.Icon,"{margin-right:4px;color:#b3b9c4;}&:hover,&:active,&:focus{",Gx.buttonActive,";",qe.Icon,"{",Gx.buttonActive,";}}",(e=>(0,xo.css)("&.",e.activeClassName,"{",Gx.buttonActive,";",qe.Icon,"{",Gx.buttonActive,";}};label:AppHeaderButton;")),";"),Qx=Jx.withComponent(Gv,{target:"e1rbzf6g5",label:"AppHeaderNavLink"}),Xx=Cg("div",{target:"e1rbzf6g2",label:"AppHeaderActions"})({name:"8irbms",styles:"display:inline-flex;align-items:center"}),Zx=Cg(qe.StyledDropdownButton,{target:"e1rbzf6g1",label:"AppHeaderQuickNewButton"})(qe.buttons.button,";",qe.buttons.medium,";",qe.buttons.gray,";margin-right:8px;&:after{top:11px;}"),eO=Cg("ul",{target:"e1rbzf6g0",label:"AppHeaderNavList"})({name:"1vufzxm",styles:"display:flex;margin:0;list-style:none"});class tO extends r().Component{constructor(...e){super(...e),Hx(this,"intervalId",void 0),Hx(this,"handleCreatePostClick",(e=>{const{onCreateEntryClick:t}=this.props;t&&t(e)}))}componentDidMount(){this.intervalId=setInterval((()=>{this.props.checkBackendStatus()}),3e5)}componentWillUnmount(){clearInterval(this.intervalId)}render(){const{user:e,collections:t,onLogoutClick:r,openMediaLibrary:n,hasWorkflow:o,displayUrl:i,isTestRepo:a,t:s,showMediaButton:l}=this.props,c=t.filter((e=>e.get("create"))).toList();return(0,xo.jsx)(Kx,null,(0,xo.jsx)(Yx,null,(0,xo.jsx)("nav",null,(0,xo.jsx)(eO,null,(0,xo.jsx)("li",null,(0,xo.jsx)(Qx,{to:"/",activeClassName:"header-link-active",isActive:(e,t)=>t.pathname.startsWith("/collections/")},(0,xo.jsx)(qe.Icon,{type:"page"}),s("app.header.content"))),o&&(0,xo.jsx)("li",null,(0,xo.jsx)(Qx,{to:"/workflow",activeClassName:"header-link-active"},(0,xo.jsx)(qe.Icon,{type:"workflow"}),s("app.header.workflow"))),l&&(0,xo.jsx)("li",null,(0,xo.jsx)(Jx,{onClick:n},(0,xo.jsx)(qe.Icon,{type:"media-alt"}),s("app.header.media"))))),(0,xo.jsx)(Xx,null,c.size>0&&(0,xo.jsx)(qe.Dropdown,{renderButton:()=>(0,xo.jsx)(Zx,null," ",s("app.header.quickAdd")),dropdownTopOverlap:"30px",dropdownWidth:"160px",dropdownPosition:"left"},c.map((e=>(0,xo.jsx)(qe.DropdownItem,{key:e.get("name"),label:e.get("label_singular")||e.get("label"),onClick:()=>this.handleCreatePostClick(e.get("name"))})))),(0,xo.jsx)(Wm,{displayUrl:i,isTestRepo:a,imageUrl:null==e?void 0:e.avatar_url,onLogoutClick:r}))))}}Hx(tO,"propTypes",{user:i().object.isRequired,collections:Vm().map.isRequired,onCreateEntryClick:i().func.isRequired,onLogoutClick:i().func.isRequired,openMediaLibrary:i().func.isRequired,hasWorkflow:i().bool.isRequired,displayUrl:i().string,isTestRepo:i().bool,t:i().func.isRequired,checkBackendStatus:i().func.isRequired});const rO={checkBackendStatus:function(){return async(e,t)=>{try{const r=t();if(r.status.isFetching)return;e({type:If});const n=rf(r.config),o=await n.status(),i="ui.toast.onBackendDown",a=r.notifications.notifications.filter((e=>{var t;return"string"!=typeof e.message&&(null===(t=e.message)||void 0===t?void 0:t.key)===i}));if(!1===o.api.status)return 0===a.length&&e(ea({message:{details:o.api.statusPage,key:"ui.toast.onBackendDown"},type:"error"})),e(Nf(o));if(!0===o.api.status&&a.length>0&&a.forEach((t=>{e(ta(t.id))})),!1===o.auth.status){const t="ui.toast.onLoggedOut",n=r.notifications.notifications.find((e=>{var r;return"string"!=typeof e.message&&(null===(r=e.message)||void 0===r?void 0:r.key)===t}));n||e(ea({message:{key:"ui.toast.onLoggedOut"},type:"error"}))}e(Nf(o))}catch(t){e(function(e){return{type:Lf,payload:{error:e}}}(t))}}}},nO=H(null,rO)((0,We.Iu)()(tO)),oO=["collections","render"];function iO(){return iO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iO.apply(this,arguments)}Km().config({barColors:{0:qe.colors.active,"1.0":qe.colors.active},shadowBlur:0,barThickness:2});const aO=Cg("div",{target:"eh2m33j2",label:"AppMainContainer"})({name:"y0stlg",styles:"min-width:800px;max-width:1440px;margin:0 auto"}),sO=Cg("div",{target:"eh2m33j1",label:"ErrorContainer"})({name:"3zy121",styles:"margin:20px"}),lO=Cg("pre",{target:"eh2m33j0",label:"ErrorCodeBlock"})({name:"1dps4tx",styles:"margin-left:20px;font-size:15px;line-height:1.5"});function cO(e){const t=e.filter((e=>!0!==e.get("hide"))).first();if(t)return`/collections/${t.get("name")}`;throw new Error("Could not find a non hidden collection")}function uO(e){let{collections:t,render:r}=e,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,oO);const o=cO(t);return(0,xo.jsx)(Ue,iO({},n,{render:e=>t.get(e.match.params.name)?r(e):(0,xo.jsx)(Ne,{to:o})}))}class fO extends r().Component{configError(e){const t=this.props.t;return(0,xo.jsx)(sO,null,(0,xo.jsx)("h1",null,t("app.app.errorHeader")),(0,xo.jsx)("div",null,(0,xo.jsx)("strong",null,t("app.app.configErrors"),":"),(0,xo.jsx)(lO,null,e.error),(0,xo.jsx)("span",null,t("app.app.checkConfigYml"))))}handleLogin(e){this.props.loginUser(e)}authenticating(){const{auth:e,t}=this.props,n=rf(this.props.config);return null==n?(0,xo.jsx)("div",null,(0,xo.jsx)("h1",null,t("app.app.waitingBackend"))):(0,xo.jsx)("div",null,(0,xo.jsx)(Dm,null),r().createElement(n.authComponent(),{onLogin:this.handleLogin.bind(this),error:e.error,inProgress:e.isFetching,siteId:this.props.config.backend.site_domain,base_url:this.props.config.backend.base_url,authEndpoint:this.props.config.backend.auth_endpoint,config:this.props.config,clearHash:()=>ns.replace("/"),t}))}handleLinkClick(e,t,...r){e.preventDefault(),t(...r)}render(){const{user:e,config:t,collections:n,logoutUser:o,isFetching:i,publishMode:a,useMediaLibrary:s,openMediaLibrary:l,t:c,showMediaButton:u}=this.props;if(null===t)return null;if(t.error)return this.configError(t);if(t.isFetching)return(0,xo.jsx)(qe.Loader,{active:!0},c("app.app.loadingConfig"));if(null==e)return this.authenticating(c);const f=cO(n),p=a===Zn;return(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(Dm,null),(0,xo.jsx)(nO,{user:e,collections:n,onCreateEntryClick:Ym,onLogoutClick:o,openMediaLibrary:l,hasWorkflow:p,displayUrl:t.display_url,isTestRepo:"test-repo"===t.backend.name,showMediaButton:u}),(0,xo.jsx)(aO,null,i&&(0,xo.jsx)(Km(),null),(0,xo.jsx)(ze,null,(0,xo.jsx)(Ne,{exact:!0,from:"/",to:f}),(0,xo.jsx)(Ne,{exact:!0,from:"/search/",to:f}),(0,xo.jsx)(uO,{exact:!0,collections:n,path:"/collections/:name/search/",render:({match:e})=>(0,xo.jsx)(Ne,{to:`/collections/${e.params.name}`})}),(0,xo.jsx)(Ne,{from:"/error=access_denied&error_description=Signups+not+allowed+for+this+instance",to:f}),p?(0,xo.jsx)(Ue,{path:"/workflow",component:v_}):null,(0,xo.jsx)(uO,{exact:!0,collections:n,path:"/collections/:name",render:e=>(0,xo.jsx)(Bw,e)}),(0,xo.jsx)(uO,{path:"/collections/:name/new",collections:n,render:e=>(0,xo.jsx)(Ux,iO({},e,{newRecord:!0}))}),(0,xo.jsx)(uO,{path:"/collections/:name/entries/*",collections:n,render:e=>(0,xo.jsx)(Ux,e)}),(0,xo.jsx)(uO,{path:"/collections/:name/search/:searchTerm",collections:n,render:e=>(0,xo.jsx)(Bw,iO({},e,{isSearchResults:!0,isSingleSearchResult:!0}))}),(0,xo.jsx)(uO,{collections:n,path:"/collections/:name/filter/:filterTerm*",render:e=>(0,xo.jsx)(Bw,e)}),(0,xo.jsx)(Ue,{path:"/search/:searchTerm",render:e=>(0,xo.jsx)(Bw,iO({},e,{isSearchResults:!0}))}),(0,xo.jsx)(uO,{path:"/edit/:name/:entryName",collections:n,render:({match:e})=>{const{name:t,entryName:r}=e.params;return(0,xo.jsx)(Ne,{to:`/collections/${t}/entries/${r}`})}}),(0,xo.jsx)(Ue,{component:Wx})),s?(0,xo.jsx)($v,null):null))}}!function(e,t,r){(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(fO,"propTypes",{auth:i().object.isRequired,config:i().object.isRequired,collections:Vm().map.isRequired,loginUser:i().func.isRequired,logoutUser:i().func.isRequired,user:i().object,isFetching:i().bool.isRequired,publishMode:i().oneOf([Xn,Zn]),siteId:i().string,useMediaLibrary:i().bool,openMediaLibrary:i().func.isRequired,showMediaButton:i().bool,t:i().func.isRequired});const pO=H((function(e){const{auth:t,config:r,collections:n,globalUI:o,mediaLibrary:i}=e,a=t.user,s=o.isFetching,l=r.publish_mode,c=!i.get("externalLibrary");return{auth:t,config:r,collections:n,user:a,isFetching:s,publishMode:l,showMediaButton:i.get("showMediaButton"),useMediaLibrary:c}}),{openMediaLibrary:xa,loginUser:function(e){return(t,r)=>{const n=r(),o=rf(n.config);return t(uf()),o.authenticate(e).then((e=>{e.useOpenAuthoring&&t(df()),t(ff(e))})).catch((e=>{console.error(e),t(ea({message:{details:e.message,key:"ui.toast.onFailToAuth"},type:"error",dismissAfter:8e3})),t(pf(e))}))}},logoutUser:hf})((0,We.Iu)()(fO));function dO({field:e,t}){return(0,xo.jsx)("div",null,t("editor.editorWidgets.unknownControl.noControl",{widget:e.get("widget")}))}dO.propTypes={field:Vm().map,t:i().func.isRequired};const hO=(0,We.Iu)()(dO);function gO({field:e,t}){return(0,xo.jsx)("div",{className:"nc-widgetPreview"},t("editor.editorWidgets.unknownPreview.noPreview",{widget:e.get("widget")}))}function mO(e){return Yf.dispatch(Oa(e,void 0))}gO.propTypes={field:Vm().map,t:i().func.isRequired},En("unknown",hO,(0,We.Iu)()(gO));const yO=jo()((async function(e,t){const r=An(e);if(r){const e=await r.init({options:t,handleInsert:mO});Yf.dispatch(function(e){const t={show:e.show||(()=>{}),hide:e.hide||(()=>{}),onClearControl:e.onClearControl||(()=>{}),onRemoveControl:e.onRemoveControl||(()=>{}),enableStandalone:e.enableStandalone||(()=>{})};return{type:aa,payload:t}}(e))}else{const t=new Error(`Missing external media library '${e}'. Please use 'registerMediaLibrary' to register it.`);Yf.dispatch(Mu(t))}}));Yf.subscribe((()=>{const e=Yf.getState();if(e){var t;const r=null===(t=e.config.media_library)||void 0===t?void 0:t.name;if(r&&!e.mediaLibrary.get("externalLibrary")){const t=e.config.media_library;yO(r,t)}}})),__webpack_require__(30762);const vO="nc-root",bO=H((function(e){return{locale:Lu(e.config),config:e.config}}))((function({locale:e,config:t}){return(0,xo.jsx)(We.oc,{locale:e,messages:Xf(e)},(0,xo.jsx)(Wg,{showBackup:!0,config:t},(0,xo.jsx)(Re,{history:ns},(0,xo.jsx)(Ue,{component:pO}))))}));function wO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wO(Object(r),!0).forEach((function(t){SO(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wO(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function SO(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xO=_O(_O({},Sn),{},{init:function(e={}){const{config:t}=e;console.log("decap-cms-core 3.3.1"),Yf.dispatch(Au(t,(function(){Yf.dispatch(((e,t)=>{const r=t(),n=rf(r.config);return e(uf()),Promise.resolve(n.currentUser()).then((t=>{t?(t.useOpenAuthoring&&e(df()),e(ff(t))):e({type:sf})})).catch((t=>{e(pf(t)),e(hf())}))}))}))),(0,n.s)(function(){const e=document.getElementById(vO);if(e)return e;const t=document.createElement("div");return t.id=vO,document.body.appendChild(t),t}()).render((0,xo.jsx)((function(){return(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(qe.GlobalStyles,null),(0,xo.jsx)(p,{store:Yf},(0,xo.jsx)(bO,null)))}),null))}})})(),__webpack_exports__=__webpack_exports__.DecapCmsCore,__webpack_exports__})()));
46
+ `,controlComponent:F.control,entry:t,collection:r,config:n,field:o,uniqueFieldId:this.uniqueFieldId,value:e,mediaPaths:s,metadata:W,onChange:(e,t)=>c(o,e,t),onValidate:m&&Nb()(m,this.uniqueFieldId),onOpenMediaLibrary:u,onClearMediaControl:f,onRemoveMediaControl:p,onRemoveInsertedMedia:h,onPersistMedia:g,onAddAsset:d,getAsset:l,hasActiveStyle:k||this.state.styleActive,setActiveStyle:()=>this.setState({styleActive:!0}),setInactiveStyle:()=>this.setState({styleActive:!1}),resolveWidget:Tn,widget:F,getEditorComponents:Pn,ref:y&&Nb()(y,o),controlRef:v,editorControl:uS,query:b,loadEntry:O,queryHits:w[this.uniqueFieldId]||[],clearSearch:S,clearFieldErrors:x,isFetching:_,fieldsErrors:a,onValidateObject:q,isEditorComponent:C,isNewEditorComponent:T,parentIds:P,t:j,validateMetaField:R,isDisabled:A,isFieldDuplicate:D,isFieldHidden:L,isLoadingAsset:M,locale:N,isParentListCollapsed:$}),U&&(0,xo.jsx)(sS,{active:k||this.state.styleActive,error:G},(0,xo.jsx)(V_(),{remarkPlugins:[K_()],allowedElements:["a","strong","em","del"],unwrapDisallowed:!0,components:{a:e=>{let{node:t}=e,r=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,Z_);return(0,xo.jsx)("a",rS({},r,{target:"_blank",rel:"noopener noreferrer",style:{color:"inherit"}}))}}},U)))))}}nS(cS,"propTypes",{value:i().oneOfType([i().node,i().object,i().string,i().bool]),field:Vm().map.isRequired,fieldsMetaData:Vm().map,fieldsErrors:Vm().map,mediaPaths:Vm().map.isRequired,boundGetAsset:i().func.isRequired,onChange:i().func.isRequired,openMediaLibrary:i().func.isRequired,addAsset:i().func.isRequired,removeInsertedMedia:i().func.isRequired,persistMedia:i().func.isRequired,onValidate:i().func,processControlRef:i().func,controlRef:i().func,query:i().func.isRequired,queryHits:i().object,isFetching:i().bool,clearSearch:i().func.isRequired,clearFieldErrors:i().func.isRequired,loadEntry:i().func.isRequired,t:i().func.isRequired,isEditorComponent:i().bool,isNewEditorComponent:i().bool,parentIds:i().arrayOf(i().string),entry:Vm().map.isRequired,collection:Vm().map.isRequired,isDisabled:i().bool,isHidden:i().bool,isFieldDuplicate:i().func,isFieldHidden:i().func,locale:i().string,isParentListCollapsed:i().bool}),nS(cS,"defaultProps",{parentIds:[]});const uS=H((function(e){const{collections:t,entryDraft:r}=e,n=r.get("entry"),o=t.get(r.getIn(["entry","collection"])),i=xf(e.medias);return{mediaPaths:e.mediaLibrary.get("controlMedia"),isFetching:e.search.isFetching,queryHits:e.search.queryHits,config:e.config,entry:n,collection:o,isLoadingAsset:i,loadEntry:async function(r,n){const o=t.get(r);if(o)return await xl(e,o,n);throw new Error(`Can't find collection '${r}'`)},validateMetaField:(t,r,n)=>function(e,t,r,n,o){if(r.get("meta")&&"path"===r.get("name")){var i;if(!n)return jl(n,"invalidPath",o);const r=n.split("/").map(gi(e.config.slug)).join("/");if(n!==r)return jl(n,"invalidPath",o);const a=As(t,(0,Qe.fromJS)({entry:{meta:{path:n}}})),s=a?function(e,t,r){const n=Ql(e,t),o=n&&n.map((r=>Jl(e,t,r)));return o&&o.find((e=>(null==e?void 0:e.get("path"))===r))}(e.entries,t.get("name"),a):void 0,l=null==s?void 0:s.get("path"),c=null===(i=e.entryDraft)||void 0===i?void 0:i.getIn(["entry","path"]);if(l&&l!==c)return jl(n,"pathExists",o)}return{error:!1}}(e,o,t,r,n)}}),(function(e){return tS(tS({},(0,He.DE)({openMediaLibrary:xa,clearMediaControl:_a,removeMediaControl:Sa,removeInsertedMedia:Ea,persistMedia:Ta,addAsset:Xa,query:qi,clearSearch:zi,clearFieldErrors:wl},e)),{},{boundGetAsset:(t,r)=>ts(e,t,r)})}),(function(e,t,r){return tS(tS(tS(tS({},e),t),r),{},{boundGetAsset:t.boundGetAsset(e.collection,e.entry)})}))((0,We.Iu)()(cS)),fS=uS;function pS(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dS=Cg("div",{target:"e11hw0lx4",label:"ControlPaneContainer"})({name:"1n0x6o4",styles:"max-width:800px;margin:0 auto;padding-bottom:16px;font-size:16px"}),hS=Cg(qe.StyledDropdownButton,{target:"e11hw0lx3",label:"LocaleButton"})(qe.buttons.button,";",qe.buttons.medium,";color:",qe.colors.controlLabel,";background:",qe.colors.textFieldBorder,";height:100%;&:after{top:11px;}"),gS=Cg("div",{target:"e11hw0lx2",label:"LocaleButtonWrapper"})({name:"zjik7",styles:"display:flex"}),mS=Cg("div",{target:"e11hw0lx1",label:"LocaleRowWrapper"})({name:"zjik7",styles:"display:flex"}),yS=Cg(qe.Dropdown,{target:"e11hw0lx0",label:"StyledDropdown"})({name:"1hfmrg2",styles:"width:max-content;margin-top:20px;margin-bottom:20px;margin-right:20px"});function vS({locales:e,dropdownText:t,onLocaleChange:r}){return(0,xo.jsx)(yS,{renderButton:()=>(0,xo.jsx)(gS,null,(0,xo.jsx)(hS,null,t))},e.map((e=>(0,xo.jsx)(qe.DropdownItem,{css:(0,xo.css)(qe.text.fieldLabel,";;label:LocaleDropdown;"),key:e,label:e,onClick:()=>r(e)}))))}function bS({field:e,entry:t,isTranslatable:r,locale:n}){if(e.get("meta"))return t.getIn(["meta",e.get("name")]);if(r){const r=Uc(n);return t.getIn([...r,e.get("name")])}return t.getIn(["data",e.get("name")])}class wS extends r().Component{constructor(...e){super(...e),pS(this,"state",{selectedLocale:this.props.locale}),pS(this,"componentValidate",{}),pS(this,"handleLocaleChange",(e=>{this.setState({selectedLocale:e}),this.props.onLocaleChange(e)})),pS(this,"copyFromOtherLocale",(({targetLocale:e,t})=>r=>{if(!window.confirm(t("editor.editorControlPane.i18n.copyFromLocaleConfirm",{locale:r.toUpperCase()})))return;const{entry:n,collection:o}=this.props,{locales:i,defaultLocale:a}=Nc(o),s=this.state.selectedLocale,l=i&&{currentLocale:s,locales:i,defaultLocale:a};this.props.fields.forEach((t=>{if($c(t,e,r)){const e=bS({field:t,entry:n,locale:r,isTranslatable:r!==a});e&&this.props.onChange(t,e,void 0,l)}}))})),pS(this,"validate",(async()=>{this.props.fields.forEach((e=>{"hidden"!==e.get("widget")&&this.componentValidate[e.get("name")]()}))})),pS(this,"switchToDefaultLocale",(()=>{if(Lc(this.props.collection)){const{defaultLocale:e}=Nc(this.props.collection);return new Promise((t=>this.setState({selectedLocale:e},t)))}return Promise.resolve()}))}controlRef(e,t){var r;if(!t)return;const n=e.get("name");this.componentValidate[n]=(null===(r=t.innerWrappedControl)||void 0===r?void 0:r.validate)||t.validate}render(){const{collection:e,entry:t,fields:r,fieldsMetaData:n,fieldsErrors:o,onChange:i,onValidate:a,t:s}=this.props;if(!e||!r)return null;if(0===t.size||!0===t.get("partial"))return null;const{locales:l,defaultLocale:c}=Nc(e),u=this.state.selectedLocale,f=l&&{currentLocale:u,locales:l,defaultLocale:c};return(0,xo.jsx)(dS,null,l&&(0,xo.jsx)(mS,null,(0,xo.jsx)(vS,{locales:l,dropdownText:s("editor.editorControlPane.i18n.writingInLocale",{locale:u.toUpperCase()}),onLocaleChange:this.handleLocaleChange}),(0,xo.jsx)(vS,{locales:l.filter((e=>e!==u)),dropdownText:s("editor.editorControlPane.i18n.copyFromLocale"),onLocaleChange:this.copyFromOtherLocale({targetLocale:u,t:s})})),r.filter((e=>"hidden"!==e.get("widget"))).map(((r,s)=>{const l=$c(r,u,c),p=Fc(r,u,c),d=Bc(r,u,c),h=f?`${u}_${s}`:s;return(0,xo.jsx)(fS,{key:h,field:r,value:bS({field:r,entry:t,locale:u,isTranslatable:l}),fieldsMetaData:n,fieldsErrors:o,onChange:(e,t,r)=>{i(e,t,r,f)},onValidate:a,processControlRef:this.controlRef.bind(this),controlRef:this.controlRef,entry:t,collection:e,isDisabled:p,isHidden:d,isFieldDuplicate:e=>Fc(e,u,c),isFieldHidden:e=>Bc(e,u,c),locale:u})})))}}wS.propTypes={collection:Vm().map.isRequired,entry:Vm().map.isRequired,fields:Vm().list.isRequired,fieldsMetaData:Vm().map.isRequired,fieldsErrors:Vm().map.isRequired,onChange:i().func.isRequired,onValidate:i().func.isRequired,locale:i().string};var _S=__webpack_require__(12693);class SS extends r().Component{render(){const{previewComponent:e,previewProps:t}=this.props;return(0,xo.jsx)(_S.Kr,null,(n=>(0,xo.jsx)(z_.ScrollSyncPane,{attachTo:n.document.scrollingElement},(0,Oe.isElement)(e)?r().cloneElement(e,t):r().createElement(e,t))))}}SS.propTypes={previewComponent:i().func.isRequired,previewProps:i().object};const xS=SS,OS=["previewComponent"];class ES extends r().Component{shouldComponentUpdate(e){return["object","list"].includes(e.field.get("widget"))||this.props.value!==e.value||this.props.fieldsMetaData!==e.fieldsMetaData||this.props.getAsset!==e.getAsset}render(){const e=this.props,{previewComponent:t}=e,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,OS);return r().createElement(t,n)}}ES.propTypes={previewComponent:i().func.isRequired,field:Vm().map.isRequired,value:i().oneOfType([i().node,i().object,i().string,i().bool])};const kS=ES;function CS(e){return"hidden"!==e.get("widget")}const TS=Cg("div",{target:"e1iji6y40",label:"PreviewContainer"})({name:"9bq7s9",styles:"font-family:Roboto,'Helvetica Neue',HelveticaNeue,Helvetica,Arial,sans-serif"});class PS extends r().Component{render(){const{collection:e,fields:t,widgetFor:r}=this.props;return e&&t?(0,xo.jsx)(TS,null,t.filter(CS).map((e=>(0,xo.jsx)("div",{key:e.get("name")},r(e.get("name")))))):null}}function jS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function RS(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jS(Object(r),!0).forEach((function(t){MS(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jS(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function MS(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}PS.propTypes={collection:Vm().map.isRequired,entry:Vm().map.isRequired,fields:Vm().list.isRequired,getAsset:i().func.isRequired,widgetFor:i().func.isRequired};const AS=Cg(_S.ZP,{target:"enus48h0",label:"PreviewPaneFrame"})("width:100%;height:100%;border:none;background:#fff;border-radius:",qe.lengths.borderRadius,";");class IS extends r().Component{constructor(...e){super(...e),MS(this,"getWidget",((e,t,r,n,o=null)=>{const{getAsset:i,entry:a}=n,s=Tn(e.get("widget")),l=o?e.get("name")+"_"+o:e.get("name"),c=t&&!s.allowMapValue&&Qe.Map.isMap(t);return s.preview?(0,xo.jsx)(kS,{previewComponent:s.preview,key:l,field:e,getAsset:i,value:c?t.get(e.get("name")):t,entry:a,fieldsMetaData:r,resolveWidget:Tn,getRemarkPlugins:jn}):null})),MS(this,"inferredFields",{}),MS(this,"widgetFor",((e,t=this.props.fields,r=this.props.entry.get("data"),n=this.props.fieldsMetaData)=>{let o=t&&t.find((t=>t.get("name")===e)),i=Qe.Map.isMap(r)&&r.get(o.get("name"));o.get("meta")&&(i=this.props.entry.getIn(["meta",o.get("name")]));const a=o.get("fields"),s=o.get("field"),l=n&&n.get(o.get("name"),(0,Qe.Map)());a&&(o=o.set("fields",this.getNestedWidgets(a,i,l))),s&&(o=o.set("field",this.getSingleNested(s,i,l)));const c=Object.entries(this.inferredFields).filter((([e])=>Oc(this.props.collection,e)===o)).map((([,e])=>e))[0];return c?i=c.defaultPreview(i):i&&-1!==["string","text","number"].indexOf(o.get("widget"))&&i.toString().length<50&&(i=(0,xo.jsx)("div",null,(0,xo.jsx)("strong",null,o.get("label",o.get("name")),":")," ",i)),i?this.getWidget(o,i,l,this.props):null})),MS(this,"getNestedWidgets",((e,t,r)=>Qe.List.isList(t)?t.map((t=>this.widgetsForNestedFields(e,t,r))):this.widgetsForNestedFields(e,t,r))),MS(this,"getSingleNested",((e,t,r)=>Qe.List.isList(t)?t.map(((t,n)=>this.getWidget(e,t,r.get(e.get("name")),this.props,n))):this.getWidget(e,t,r.get(e.get("name")),this.props))),MS(this,"widgetsForNestedFields",((e,t,r)=>e.map((n=>this.widgetFor(n.get("name"),e,t,r))))),MS(this,"widgetsFor",(e=>{const{fields:t,entry:r,fieldsMetaData:n}=this.props,o=t.find((t=>t.get("name")===e)),i=o&&o.get("fields"),a=r.getIn(["data",o.get("name")]),s=n.get(o.get("name"),(0,Qe.Map)());return Qe.List.isList(a)?a.map((e=>{const t=i&&(0,Qe.Map)(i.map(((t,r)=>[t.get("name"),(0,xo.jsx)("div",{key:r},this.getWidget(t,e,s.get(t.get("name")),this.props))])));return(0,Qe.Map)({data:e,widgets:t})})):(0,Qe.Map)({data:a,widgets:i&&(0,Qe.Map)(i.map((e=>[e.get("name"),this.getWidget(e,a,s.get(e.get("name")),this.props)])))})}))}inferFields(){const e=Cc(this.props.collection,"title"),t=Cc(this.props.collection,"shortTitle"),r=Cc(this.props.collection,"author");this.inferredFields={},e&&(this.inferredFields[e]=ko.title),t&&(this.inferredFields[t]=ko.shortTitle),r&&(this.inferredFields[r]=ko.author)}render(){const{entry:e,collection:t,config:r}=this.props;if(!e||!e.get("data"))return null;const n=On(function(e,t){return hc[e.get("type")].templateName(e,t)}(t,e.get("slug")))||PS;this.inferFields();const o=RS(RS({},this.props),{},{widgetFor:this.widgetFor,widgetsFor:this.widgetsFor}),i=xn().map(((e,t)=>e.raw?(0,xo.jsx)("style",{key:t},e.value):(0,xo.jsx)("link",{key:t,href:e.value,type:"text/css",rel:"stylesheet"})));return t||(0,xo.jsx)(AS,{id:"preview-pane",head:i}),(0,xo.jsx)(Wg,{config:r},(0,xo.jsx)(AS,{id:"preview-pane",head:i,initialContent:'\n<!DOCTYPE html>\n<html>\n <head><base target="_blank"/></head>\n <body><div></div></body>\n</html>\n'},(0,xo.jsx)(_S.Kr,null,(({document:e,window:t})=>(0,xo.jsx)(xS,{previewComponent:n,previewProps:RS(RS({},o),{},{document:e,window:t})})))))}}IS.propTypes={collection:Vm().map.isRequired,fields:Vm().list.isRequired,entry:Vm().map.isRequired,fieldsMetaData:Vm().map.isRequired,getAsset:i().func.isRequired};const DS=H((function(e){return{isLoadingAsset:xf(e.medias),config:e.config}}),(function(e){return{boundGetAsset:(t,r)=>ts(e,t,r)}}),(function(e,t,r){return RS(RS(RS(RS({},e),t),r),{},{getAsset:t.boundGetAsset(r.collection,r.entry)})}))(IS);function LS(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const NS={noOverflow:{name:"1ctb18k-noOverflow",styles:"overflow:hidden;white-space:nowrap;text-overflow:ellipsis;label:noOverflow;"},buttonMargin:{name:"bx8mhy-buttonMargin",styles:"margin:0 10px;label:buttonMargin;"},toolbarSection:(0,xo.css)("height:100%;display:flex;align-items:center;border:0 solid ",qe.colors.textFieldBorder,";;label:toolbarSection;"),publishedButton:(0,xo.css)("background-color:",qe.colorsRaw.tealLight,";color:",qe.colorsRaw.tealDark,";;label:publishedButton;")},$S=Cg("div",{target:"e1d2l9mo26",label:"TooltipText"})({name:"1ykbu60",styles:"visibility:hidden;width:321px;background-color:#555;color:#fff;text-align:unset;border-radius:6px;padding:5px;position:absolute;z-index:1;top:145%;left:50%;margin-left:-320px;opacity:0;transition:opacity 0.3s"}),FS=Cg("div",{target:"e1d2l9mo25",label:"Tooltip"})("position:relative;display:inline-block;&:hover+",$S,"{visibility:visible;opacity:0.9;}"),BS=Cg("div",{target:"e1d2l9mo24",label:"TooltipContainer"})({name:"bjn8wh",styles:"position:relative"}),US=Cg(qe.StyledDropdownButton,{target:"e1d2l9mo23",label:"DropdownButton"})(NS.noOverflow,"@media (max-width: 1200px){padding-left:10px;}"),zS=Cg("div",{target:"e1d2l9mo22",label:"ToolbarContainer"})("box-shadow:0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1);position:fixed;top:0;left:0;width:100%;min-width:800px;z-index:",qe.zIndex.zIndex300,";background-color:#fff;height:66px;display:flex;justify-content:space-between;"),qS=Cg("div",{target:"e1d2l9mo21",label:"ToolbarSectionMain"})(NS.toolbarSection,";flex:10;display:flex;justify-content:space-between;padding:0 10px;"),WS=Cg("div",{target:"e1d2l9mo20",label:"ToolbarSubSectionFirst"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),HS=Cg(WS,{target:"e1d2l9mo19",label:"ToolbarSubSectionLast"})({name:"1f60if8",styles:"justify-content:flex-end"}),VS=Cg(Wv,{target:"e1d2l9mo18",label:"ToolbarSectionBackLink"})(NS.toolbarSection,";border-right-width:1px;font-weight:normal;padding:0 20px;&:hover,&:focus{background-color:#f1f2f4;}"),GS=Cg("div",{target:"e1d2l9mo17",label:"ToolbarSectionMeta"})(NS.toolbarSection,";border-left-width:1px;padding:0 7px;"),KS=Cg(qe.Dropdown,{target:"e1d2l9mo16",label:"ToolbarDropdown"})(NS.buttonMargin,";",qe.Icon,"{color:",qe.colorsRaw.teal,";}"),YS=Cg("div",{target:"e1d2l9mo15",label:"BackArrow"})("color:",qe.colors.textLead,";font-size:21px;font-weight:600;margin-right:16px;"),JS=Cg("div",{target:"e1d2l9mo14",label:"BackCollection"})("color:",qe.colors.textLead,";font-size:14px;"),QS=Cg("div",{target:"e1d2l9mo13",label:"BackStatus"})({name:"j9a02z",styles:"margin-top:6px"}),XS=Cg(QS,{target:"e1d2l9mo12",label:"BackStatusUnchanged"})(qe.components.textBadgeSuccess,";"),ZS=Cg(QS,{target:"e1d2l9mo11",label:"BackStatusChanged"})(qe.components.textBadgeDanger,";"),ex=Cg("button",{target:"e1d2l9mo10",label:"ToolbarButton"})(qe.buttons.button,";",qe.buttons.default,";",NS.buttonMargin,";",NS.noOverflow,";display:block;@media (max-width: 1200px){padding:0 10px;}"),tx=Cg(ex,{target:"e1d2l9mo9",label:"DeleteButton"})(qe.buttons.lightRed,";"),rx=Cg(ex,{target:"e1d2l9mo8",label:"SaveButton"})(qe.buttons.lightBlue,";&[disabled]{",qe.buttons.disabled,";}"),nx=Cg(US,{target:"e1d2l9mo7",label:"PublishedToolbarButton"})(NS.publishedButton,";"),ox=Cg(ex,{target:"e1d2l9mo6",label:"PublishedButton"})(NS.publishedButton,";"),ix=Cg(US,{target:"e1d2l9mo5",label:"PublishButton"})("background-color:",qe.colorsRaw.teal,";"),ax=Cg(US,{target:"e1d2l9mo4",label:"StatusButton"})("background-color:",qe.colorsRaw.tealLight,";color:",qe.colorsRaw.teal,";"),sx=Cg("div",{target:"e1d2l9mo3",label:"PreviewButtonContainer"})("margin-right:12px;color:",qe.colorsRaw.blue,";display:flex;align-items:center;a,",qe.Icon,"{color:",qe.colorsRaw.blue,";}",qe.Icon,"{position:relative;top:1px;}"),lx=Cg("button",{target:"e1d2l9mo2",label:"RefreshPreviewButton"})("background:none;border:0;cursor:pointer;color:",qe.colorsRaw.blue,";span{margin-right:6px;}"),cx=lx.withComponent("a",{target:"e1d2l9mo27",label:"PreviewLink"}),ux=Cg(qe.DropdownItem,{target:"e1d2l9mo1",label:"PublishDropDownItem"})({name:"svxjwj",styles:"min-width:initial"}),fx=Cg(qe.DropdownItem,{target:"e1d2l9mo0",label:"StatusDropdownItem"})(qe.Icon,"{color:",qe.colors.infoText,";}");class px extends r().Component{constructor(...e){super(...e),LS(this,"renderSimpleControls",(()=>{const{collection:e,hasChanged:t,isNewEntry:n,showDelete:o,onDelete:i,t:a}=this.props,s=e.get("create");return(0,xo.jsx)(r().Fragment,null,n||t?this.renderNewEntrySimplePublishControls({canCreate:s}):this.renderExistingEntrySimplePublishControls({canCreate:s}),(0,xo.jsx)("div",null,o?(0,xo.jsx)(tx,{onClick:i},a("editor.editorToolbar.deleteEntry")):null))})),LS(this,"renderDeployPreviewControls",(e=>{const{deployPreview:t={},loadDeployPreview:r,t:n}=this.props,{url:o,status:i,isFetching:a}=t;if(!i)return;const s="SUCCESS"===i&&!a;return(0,xo.jsx)(sx,null,s?(0,xo.jsx)(cx,{rel:"noopener noreferrer",target:"_blank",href:o},(0,xo.jsx)("span",null,e),(0,xo.jsx)(qe.Icon,{type:"new-tab",size:"xsmall"})):(0,xo.jsx)(lx,{onClick:r},(0,xo.jsx)("span",null,n("editor.editorToolbar.deployPreviewPendingButtonLabel")),(0,xo.jsx)(qe.Icon,{type:"refresh",size:"xsmall"})))})),LS(this,"renderStatusInfoTooltip",(()=>{const{t:e,currentStatus:t}=this.props,r={[eo.get("DRAFT")]:"statusInfoTooltipDraft",[eo.get("PENDING_REVIEW")]:"statusInfoTooltipInReview"},n=Object.keys(r).find((e=>e===t));return(0,xo.jsx)(BS,null,(0,xo.jsx)(FS,null,(0,xo.jsx)(qe.Icon,{type:"info-circle",size:"small",className:"tooltip"})),n&&(0,xo.jsx)($S,null,e(`editor.editorToolbar.${r[n]}`)))})),LS(this,"renderWorkflowStatusControls",(()=>{const{isUpdatingStatus:e,onChangeStatus:t,currentStatus:n,t:o,useOpenAuthoring:i}=this.props,a={[eo.get("DRAFT")]:o("editor.editorToolbar.draft"),[eo.get("PENDING_REVIEW")]:o("editor.editorToolbar.inReview"),[eo.get("PENDING_PUBLISH")]:o("editor.editorToolbar.ready")},s=e?o("editor.editorToolbar.updating"):o("editor.editorToolbar.status",{status:a[n]});return(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(KS,{dropdownTopOverlap:"40px",dropdownWidth:"120px",renderButton:()=>(0,xo.jsx)(ax,null,s)},(0,xo.jsx)(fx,{label:o("editor.editorToolbar.draft"),onClick:()=>t("DRAFT"),icon:n===eo.get("DRAFT")?"check":null}),(0,xo.jsx)(fx,{label:o("editor.editorToolbar.inReview"),onClick:()=>t("PENDING_REVIEW"),icon:n===eo.get("PENDING_REVIEW")?"check":null}),i?"":(0,xo.jsx)(fx,{label:o("editor.editorToolbar.ready"),onClick:()=>t("PENDING_PUBLISH"),icon:n===eo.get("PENDING_PUBLISH")?"check":null})),i&&this.renderStatusInfoTooltip())})),LS(this,"renderNewEntryWorkflowPublishControls",(({canCreate:e,canPublish:t})=>{const{isPublishing:n,onPublish:o,onPublishAndNew:i,onPublishAndDuplicate:a,t:s}=this.props;return t?(0,xo.jsx)(KS,{dropdownTopOverlap:"40px",dropdownWidth:"200px",renderButton:()=>(0,xo.jsx)(ix,null,s(n?"editor.editorToolbar.publishing":"editor.editorToolbar.publish"))},(0,xo.jsx)(ux,{label:s("editor.editorToolbar.publishNow"),icon:"arrow",iconDirection:"right",onClick:o}),e?(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(ux,{label:s("editor.editorToolbar.publishAndCreateNew"),icon:"add",onClick:i}),(0,xo.jsx)(ux,{label:s("editor.editorToolbar.publishAndDuplicate"),icon:"add",onClick:a})):null):""})),LS(this,"renderExistingEntryWorkflowPublishControls",(({canCreate:e,canPublish:t,canDelete:r})=>{const{unPublish:n,onDuplicate:o,isPersisting:i,t:a}=this.props;return t||e?(0,xo.jsx)(KS,{dropdownTopOverlap:"40px",dropdownWidth:"150px",key:"td-publish-create",renderButton:()=>(0,xo.jsx)(nx,null,a(i?"editor.editorToolbar.unpublishing":"editor.editorToolbar.published"))},r&&t&&(0,xo.jsx)(qe.DropdownItem,{label:a("editor.editorToolbar.unpublish"),icon:"arrow",iconDirection:"right",onClick:n}),e&&(0,xo.jsx)(qe.DropdownItem,{label:a("editor.editorToolbar.duplicate"),icon:"add",onClick:o})):""})),LS(this,"renderExistingEntrySimplePublishControls",(({canCreate:e})=>{const{onDuplicate:t,t:r}=this.props;return e?(0,xo.jsx)(KS,{dropdownTopOverlap:"40px",dropdownWidth:"150px",renderButton:()=>(0,xo.jsx)(nx,null,r("editor.editorToolbar.published"))},(0,xo.jsx)(qe.DropdownItem,{label:r("editor.editorToolbar.duplicate"),icon:"add",onClick:t})):(0,xo.jsx)(ox,null,r("editor.editorToolbar.published"))})),LS(this,"renderNewEntrySimplePublishControls",(({canCreate:e})=>{const{onPersist:t,onPersistAndNew:n,onPersistAndDuplicate:o,isPersisting:i,t:a}=this.props;return(0,xo.jsx)("div",null,(0,xo.jsx)(KS,{dropdownTopOverlap:"40px",dropdownWidth:"150px",renderButton:()=>(0,xo.jsx)(ix,null,a(i?"editor.editorToolbar.publishing":"editor.editorToolbar.publish"))},(0,xo.jsx)(qe.DropdownItem,{label:a("editor.editorToolbar.publishNow"),icon:"arrow",iconDirection:"right",onClick:t}),e?(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(qe.DropdownItem,{label:a("editor.editorToolbar.publishAndCreateNew"),icon:"add",onClick:n}),(0,xo.jsx)(qe.DropdownItem,{label:a("editor.editorToolbar.publishAndDuplicate"),icon:"add",onClick:o})):null))})),LS(this,"renderSimpleDeployPreviewControls",(()=>{const{hasChanged:e,isNewEntry:t,t:r}=this.props;if(!t&&!e)return this.renderDeployPreviewControls(r("editor.editorToolbar.deployButtonLabel"))})),LS(this,"renderWorkflowControls",(()=>{const{onPersist:e,onDelete:t,onDeleteUnpublishedChanges:r,showDelete:n,hasChanged:o,hasUnpublishedChanges:i,useOpenAuthoring:a,isPersisting:s,isDeleting:l,isNewEntry:c,isModification:u,currentStatus:f,collection:p,t:d}=this.props,h=p.get("create"),g=p.get("publish")&&!a,m=p.get("delete",!0),y=i&&u&&d("editor.editorToolbar.deleteUnpublishedChanges")||i&&(c||!u)&&d("editor.editorToolbar.deleteUnpublishedEntry")||!i&&!u&&d("editor.editorToolbar.deletePublishedEntry");return[(0,xo.jsx)(rx,{disabled:!o,key:"save-button",onClick:()=>o&&e()},d(s?"editor.editorToolbar.saving":"editor.editorToolbar.save")),f?[this.renderWorkflowStatusControls(),this.renderNewEntryWorkflowPublishControls({canCreate:h,canPublish:g})]:!c&&this.renderExistingEntryWorkflowPublishControls({canCreate:h,canPublish:g,canDelete:m}),n&&!a||i||u?(0,xo.jsx)(tx,{key:"delete-button",onClick:i?r:t},l?d("editor.editorToolbar.deleting"):y):null]})),LS(this,"renderWorkflowDeployPreviewControls",(()=>{const{currentStatus:e,isNewEntry:t,t:r}=this.props;return e?this.renderDeployPreviewControls(r("editor.editorToolbar.deployPreviewButtonLabel")):t?void 0:this.renderDeployPreviewControls(r("editor.editorToolbar.deployButtonLabel"))}))}componentDidMount(){const{isNewEntry:e,loadDeployPreview:t}=this.props;e||t({maxAttempts:3})}componentDidUpdate(e){const{isNewEntry:t,isPersisting:r,loadDeployPreview:n}=this.props;t||!e.isPersisting||r||n({maxAttempts:3})}render(){const{user:e,hasChanged:t,displayUrl:r,collection:n,hasWorkflow:o,onLogoutClick:i,t:a,editorBackLink:s}=this.props;return(0,xo.jsx)(zS,null,(0,xo.jsx)(VS,{to:s},(0,xo.jsx)(YS,null,"←"),(0,xo.jsx)("div",null,(0,xo.jsx)(JS,null,a("editor.editorToolbar.backCollection",{collectionLabel:n.get("label")})),t?(0,xo.jsx)(ZS,null,a("editor.editorToolbar.unsavedChanges")):(0,xo.jsx)(XS,null,a("editor.editorToolbar.changesSaved")))),(0,xo.jsx)(qS,null,(0,xo.jsx)(WS,null,o?this.renderWorkflowControls():this.renderSimpleControls()),(0,xo.jsx)(HS,null,o?this.renderWorkflowDeployPreviewControls():this.renderSimpleDeployPreviewControls())),(0,xo.jsx)(GS,null,(0,xo.jsx)(Wm,{displayUrl:r,imageUrl:null==e?void 0:e.avatar_url,onLogoutClick:i})))}}LS(px,"propTypes",{isPersisting:i().bool,isPublishing:i().bool,isUpdatingStatus:i().bool,isDeleting:i().bool,onPersist:i().func.isRequired,onPersistAndNew:i().func.isRequired,onPersistAndDuplicate:i().func.isRequired,showDelete:i().bool.isRequired,onDelete:i().func.isRequired,onDeleteUnpublishedChanges:i().func.isRequired,onChangeStatus:i().func.isRequired,onPublish:i().func.isRequired,unPublish:i().func.isRequired,onDuplicate:i().func.isRequired,onPublishAndNew:i().func.isRequired,onPublishAndDuplicate:i().func.isRequired,user:i().object,hasChanged:i().bool,displayUrl:i().string,collection:Vm().map.isRequired,hasWorkflow:i().bool,useOpenAuthoring:i().bool,hasUnpublishedChanges:i().bool,isNewEntry:i().bool,isModification:i().bool,currentStatus:i().string,onLogoutClick:i().func.isRequired,deployPreview:i().object,loadDeployPreview:i().func.isRequired,t:i().func.isRequired,editorBackLink:i().string.isRequired});const dx=(0,We.Iu)()(px);function hx(){return hx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hx.apply(this,arguments)}function gx(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mx="cms.preview-visible",yx="cms.scroll-sync-enabled",vx="cms.split-pane-position",bx="cms.i18n-visible",wx={splitPane:(0,xo.css)(qe.components.card,";border-radius:0;height:100%;;label:splitPane;"),pane:{name:"1yvxf4n-pane",styles:"height:100%;overflow-y:auto;label:pane;"}},_x=Cg(qe.IconButton,{target:"e1nx103k7",label:"EditorToggle"})({name:"cn3xcj",styles:"margin-bottom:12px"});function Sx(){return(0,xo.jsx)(xo.Global,{styles:(0,xo.css)(".Resizer.vertical{width:2px;cursor:col-resize;position:relative;background:none;&:before{content:'';width:2px;height:100%;position:relative;background-color:",qe.colors.textFieldBorder,";display:block;z-index:10;transition:background-color ",qe.transitions.main,";}&:hover,&:active{&:before{width:4px;left:-1px;background-color:",qe.colorsRaw.blue,";}}};label:ReactSplitPaneGlobalStyles;")})}const xx=Cg(U_,{target:"e1nx103k6",label:"StyledSplitPane"})(wx.splitPane,";.Pane{height:100%;}"),Ox=Cg("div",{target:"e1nx103k5",label:"NoPreviewContainer"})(wx.splitPane,";"),Ex=Cg("div",{target:"e1nx103k4",label:"EditorContainer"})("width:100%;min-width:800px;height:100%;position:absolute;top:0;left:0;overflow:hidden;padding-top:66px;background-color:",qe.colors.background,";"),kx=Cg("div",{target:"e1nx103k3",label:"Editor"})({name:"yd3x82",styles:"height:100%;margin:0 auto;position:relative"}),Cx=Cg("div",{target:"e1nx103k2",label:"PreviewPaneContainer"})("height:100%;pointer-events:",(e=>e.blockEntry?"none":"auto"),";overflow-y:",(e=>e.overFlow?"auto":"hidden"),";"),Tx=Cg(Cx,{target:"e1nx103k1",label:"ControlPaneContainer"})({name:"b2tic3",styles:"padding:0 16px;position:relative;overflow-x:hidden"}),Px=Cg("div",{target:"e1nx103k0",label:"ViewControls"})("position:absolute;top:10px;right:10px;z-index:",qe.zIndex.zIndex299,";");function jx({i18nVisible:e,previewVisible:t,editor:r,editorWithEditor:n,editorWithPreview:o}){return e?n:t?o:(0,xo.jsx)(Ox,null,r)}class Rx extends t.Component{constructor(...e){super(...e),gx(this,"state",{showEventBlocker:!1,previewVisible:"false"!==localStorage.getItem(mx),scrollSyncEnabled:"false"!==localStorage.getItem(yx),i18nVisible:"false"!==localStorage.getItem(bx)}),gx(this,"handleSplitPaneDragStart",(()=>{this.setState({showEventBlocker:!0})})),gx(this,"handleSplitPaneDragFinished",(()=>{this.setState({showEventBlocker:!1})})),gx(this,"handleOnPersist",(async(e={})=>{const{createNew:t=!1,duplicate:r=!1}=e;await this.controlPaneRef.switchToDefaultLocale(),this.controlPaneRef.validate(),this.props.onPersist({createNew:t,duplicate:r})})),gx(this,"handleOnPublish",(async(e={})=>{const{createNew:t=!1,duplicate:r=!1}=e;await this.controlPaneRef.switchToDefaultLocale(),this.controlPaneRef.validate(),this.props.onPublish({createNew:t,duplicate:r})})),gx(this,"handleTogglePreview",(()=>{const e=!this.state.previewVisible;this.setState({previewVisible:e}),localStorage.setItem(mx,e)})),gx(this,"handleToggleScrollSync",(()=>{const e=!this.state.scrollSyncEnabled;this.setState({scrollSyncEnabled:e}),localStorage.setItem(yx,e)})),gx(this,"handleToggleI18n",(()=>{const e=!this.state.i18nVisible;this.setState({i18nVisible:e}),localStorage.setItem(bx,e)})),gx(this,"handleLeftPanelLocaleChange",(e=>{this.setState({leftPanelLocale:e})}))}render(){const{collection:e,entry:t,fields:r,fieldsMetaData:n,fieldsErrors:o,onChange:i,showDelete:a,onDelete:s,onDeleteUnpublishedChanges:l,onChangeStatus:c,onPublish:u,unPublish:f,onDuplicate:p,onValidate:d,user:h,hasChanged:g,displayUrl:m,hasWorkflow:y,useOpenAuthoring:v,hasUnpublishedChanges:b,isNewEntry:w,isModification:_,currentStatus:S,onLogoutClick:x,loadDeployPreview:O,deployPreview:E,draftKey:k,editorBackLink:C,t:T}=this.props,{scrollSyncEnabled:P,showEventBlocker:j}=this.state,R=function(e,t){if(e.get("type")===bo){const r=mc(e,t.get("slug")),n=null==r?void 0:r.getIn(["editor","preview"]);if(null!=n)return n}return e.getIn(["editor","preview"],!0)}(e,t),{locales:M,defaultLocale:A}=Nc(this.props.collection),I=Lc(e)&&M.length>1,D={collection:e,entry:t,fields:r,fieldsMetaData:n,fieldsErrors:o,onChange:i,onValidate:d},L=this.state.leftPanelLocale||(null==M?void 0:M[0]),N=(0,xo.jsx)(Tx,{overFlow:!0,blockEntry:j},(0,xo.jsx)(wS,hx({},D,{ref:e=>this.controlPaneRef=e,locale:L,t:T,onLocaleChange:this.handleLeftPanelLocaleChange}))),$=(0,xo.jsx)(Tx,{overFlow:!this.state.scrollSyncEnabled,blockEntry:j},(0,xo.jsx)(wS,hx({},D,{locale:null==M?void 0:M[1],t:T}))),F=I?function(e,t,r){return t===r?e:e.set("data",e.getIn([Ac,t,"data"]))}(t,L,A):t,B=(0,xo.jsx)(z_.ScrollSync,{enabled:this.state.scrollSyncEnabled},(0,xo.jsx)("div",null,(0,xo.jsx)(Sx,null),(0,xo.jsx)(xx,{maxSize:-100,minSize:400,defaultSize:parseInt(localStorage.getItem(vx),10)||"50%",onChange:e=>localStorage.setItem(vx,e),onDragStarted:this.handleSplitPaneDragStart,onDragFinished:this.handleSplitPaneDragFinished},(0,xo.jsx)(z_.ScrollSyncPane,null,N),(0,xo.jsx)(Cx,{blockEntry:j},(0,xo.jsx)(DS,{collection:e,entry:F,fields:r,fieldsMetaData:n,locale:L}))))),U=(0,xo.jsx)(z_.ScrollSync,{enabled:this.state.scrollSyncEnabled},(0,xo.jsx)("div",null,(0,xo.jsx)(xx,{maxSize:-100,defaultSize:parseInt(localStorage.getItem(vx),10)||"50%",onChange:e=>localStorage.setItem(vx,e),onDragStarted:this.handleSplitPaneDragStart,onDragFinished:this.handleSplitPaneDragFinished},(0,xo.jsx)(z_.ScrollSyncPane,null,N),(0,xo.jsx)(z_.ScrollSyncPane,null,$)))),z=I&&this.state.i18nVisible,q=R&&this.state.previewVisible,W=z||q;return(0,xo.jsx)(Ex,null,(0,xo.jsx)(dx,{isPersisting:t.get("isPersisting"),isPublishing:t.get("isPublishing"),isUpdatingStatus:t.get("isUpdatingStatus"),isDeleting:t.get("isDeleting"),onPersist:this.handleOnPersist,onPersistAndNew:()=>this.handleOnPersist({createNew:!0}),onPersistAndDuplicate:()=>this.handleOnPersist({createNew:!0,duplicate:!0}),onDelete:s,onDeleteUnpublishedChanges:l,onChangeStatus:c,showDelete:a,onPublish:u,unPublish:f,onDuplicate:p,onPublishAndNew:()=>this.handleOnPublish({createNew:!0}),onPublishAndDuplicate:()=>this.handleOnPublish({createNew:!0,duplicate:!0}),user:h,hasChanged:g,displayUrl:m,collection:e,hasWorkflow:y,useOpenAuthoring:v,hasUnpublishedChanges:b,isNewEntry:w,isModification:_,currentStatus:S,onLogoutClick:x,loadDeployPreview:O,deployPreview:E,editorBackLink:C}),(0,xo.jsx)(kx,{key:k},(0,xo.jsx)(Px,null,I&&(0,xo.jsx)(_x,{isActive:z,onClick:this.handleToggleI18n,size:"large",type:"page",title:T("editor.editorInterface.toggleI18n"),marginTop:"70px"}),R&&(0,xo.jsx)(_x,{isActive:q,onClick:this.handleTogglePreview,size:"large",type:"eye",title:T("editor.editorInterface.togglePreview")}),W&&(0,xo.jsx)(_x,{isActive:P,onClick:this.handleToggleScrollSync,size:"large",type:"scroll",title:T("editor.editorInterface.toggleScrollSync")})),(0,xo.jsx)(jx,{i18nVisible:z,previewVisible:q,editor:N,editorWithEditor:U,editorWithPreview:B})))}}Rx.propTypes={collection:Vm().map.isRequired,entry:Vm().map.isRequired,fields:Vm().list.isRequired,fieldsMetaData:Vm().map.isRequired,fieldsErrors:Vm().map.isRequired,onChange:i().func.isRequired,onValidate:i().func.isRequired,onPersist:i().func.isRequired,showDelete:i().bool.isRequired,onDelete:i().func.isRequired,onDeleteUnpublishedChanges:i().func.isRequired,onPublish:i().func.isRequired,unPublish:i().func.isRequired,onDuplicate:i().func.isRequired,onChangeStatus:i().func.isRequired,user:i().object,hasChanged:i().bool,displayUrl:i().string,hasWorkflow:i().bool,useOpenAuthoring:i().bool,hasUnpublishedChanges:i().bool,isNewEntry:i().bool,isModification:i().bool,currentStatus:i().string,onLogoutClick:i().func.isRequired,deployPreview:i().object,loadDeployPreview:i().func.isRequired,draftKey:i().string.isRequired,t:i().func.isRequired};const Mx=Rx;function Ax(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ix(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ax(Object(r),!0).forEach((function(t){Dx(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ax(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Dx(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lx(e,t){const{collections:r}=e,n=e.config.publish_mode===Zn,o=r.get(t.match.params.name),i={isEditorialWorkflow:n,showDelete:!t.newEntry&&Sc(o)};if(n){const r=t.match.params[0],n=Vf(e,o.get("name"),r);n&&(i.unpublishedEntry=!0,i.entry=n)}return i}function Nx(e,t,r){const{isEditorialWorkflow:n,unpublishedEntry:o}=e,{dispatch:i}=t,a={};return n&&(a.loadEntry=(e,t)=>i(Cs(e,t)),a.persistEntry=e=>i(function(e,t){return async(r,n)=>{const o=n(),i=o.entryDraft,a=i.get("fieldsErrors"),s=function(e,t){return function(e,t){return e.get("entities")?e.get("entities").filter(((e,r)=>yf()(r,`${t}.`))).map((e=>e.get("slug"))).valueSeq():null}(e.editorialWorkflow,t)}(o,e.get("name")),l=Wf(o,e.get("name")).concat(s);if(!Qt()(o.editorialWorkflow.toJS(),"pages.ids",!1)&&r(Ts(o.collections)),!a.isEmpty())return a.some((e=>e.some((e=>e.type&&e.type===Ki.PRESENCE))))&&r(ea({message:{key:"ui.toast.missingRequiredField"},type:"error",dismissAfter:8e3})),Promise.reject();const c=rf(o.config),u=i.get("entry"),f=Tl({entry:u}),p=Pl(e,u),d=i.set("entry",p);r(Os(e,u.get("slug")));const h=t?c.persistUnpublishedEntry:c.persistEntry;try{const t=await h.call(c,{config:o.config,collection:e,entryDraft:d,assetProxies:f,usedSlugs:l});r(ea({message:{key:"ui.toast.entrySaved"},type:"success",dismissAfter:4e3})),r(Es(e,p)),u.get("slug")!==t&&(await r(Cs(e,t)),as(e.get("name"),t))}catch(t){return r(ea({message:{key:"ui.toast.onFailToPersist",details:t},type:"error",dismissAfter:8e3})),Promise.reject(r(ks(t,e,u.get("slug"))))}}}(e,o))),Ix(Ix(Ix({},r),e),a)}function $x(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Fx extends r().Component{constructor(...e){super(...e),$x(this,"createBackup",w_()((function(e,t){this.props.persistLocalBackup(e,t)}),2e3)),$x(this,"handleChangeDraftField",((e,t,r,n)=>{const o=[this.props.unPublishedEntry,this.props.publishedEntry].filter(Boolean);this.props.changeDraftField({field:e,value:t,metadata:r,entries:o,i18n:n})})),$x(this,"handleChangeStatus",(e=>{const{entryDraft:t,updateUnpublishedEntryStatus:r,collection:n,slug:o,currentStatus:i,t:a}=this.props;if(t.get("hasChanged"))return void window.alert(a("editor.editor.onUpdatingWithUnsavedChanges"));const s=eo.get(e);r(n.get("name"),o,i,s)})),$x(this,"handlePersistEntry",(async(e={})=>{const{createNew:t=!1,duplicate:r=!1}=e,{persistEntry:n,collection:o,currentStatus:i,hasWorkflow:a,loadEntry:s,slug:l,createDraftDuplicateFromEntry:c,entryDraft:u}=this.props;await n(o),this.deleteBackup(),t?(is(o.get("name")),r&&c(u.get("entry"))):l&&a&&!i&&s(o,l)})),$x(this,"handlePublishEntry",(async(e={})=>{const{createNew:t=!1,duplicate:r=!1}=e,{publishUnpublishedEntry:n,createDraftDuplicateFromEntry:o,entryDraft:i,collection:a,slug:s,currentStatus:l,t:c}=this.props;l===eo.last()?i.get("hasChanged")?window.alert(c("editor.editor.onPublishingWithUnsavedChanges")):window.confirm(c("editor.editor.onPublishing"))&&(await n(a.get("name"),s),this.deleteBackup(),t&&is(a.get("name")),r&&o(i.get("entry"))):window.alert(c("editor.editor.onPublishingNotReady"))})),$x(this,"handleUnpublishEntry",(async()=>{const{unpublishPublishedEntry:e,collection:t,slug:r,t:n}=this.props;if(window.confirm(n("editor.editor.onUnpublishing")))return await e(t,r),os(t.get("name"))})),$x(this,"handleDuplicateEntry",(()=>{const{createDraftDuplicateFromEntry:e,collection:t,entryDraft:r}=this.props;is(t.get("name")),e(r.get("entry"))})),$x(this,"handleDeleteEntry",(()=>{const{entryDraft:e,newEntry:t,collection:r,deleteEntry:n,slug:o,t:i}=this.props;if(e.get("hasChanged")){if(!window.confirm(i("editor.editor.onDeleteWithUnsavedChanges")))return}else if(!window.confirm(i("editor.editor.onDeletePublishedEntry")))return;if(t)return os(r.get("name"));setTimeout((async()=>(await n(r,o),this.deleteBackup(),os(r.get("name")))),0)})),$x(this,"handleDeleteUnpublishedChanges",(async()=>{const{entryDraft:e,collection:t,slug:r,deleteUnpublishedEntry:n,loadEntry:o,isModification:i,t:a}=this.props;e.get("hasChanged")&&!window.confirm(a("editor.editor.onDeleteUnpublishedChangesWithUnsavedChanges"))||window.confirm(a("editor.editor.onDeleteUnpublishedChanges"))&&(await n(t.get("name"),r),this.deleteBackup(),i?o(t,r):os(t.get("name")))}))}componentDidMount(){const{newEntry:e,collection:t,slug:r,loadEntry:n,createEmptyDraft:o,loadEntries:i,retrieveLocalBackup:a,collectionEntriesLoaded:s,t:l}=this.props;a(t,r),e?o(t,this.props.location.search):n(t,r);const c=l("editor.editor.onLeavePage");this.exitBlocker=e=>{if(this.props.entryDraft.get("hasChanged"))return e.returnValue=c,c},window.addEventListener("beforeunload",this.exitBlocker);const u=ns.block(((e,r)=>{const n=this.props.entryDraft.getIn(["entry","isPersisting"]),o=this.props.entryDraft.getIn(["entry","newRecord"]),i=`/collections/${t.get("name")}/new`;if(!n||!o||this.props.location.pathname!==i||"PUSH"!==r)return this.props.hasChanged?c:void 0}));this.unlisten=ns.listen(((e,r)=>{const n=`/collections/${t.get("name")}/new`,o=`/collections/${t.get("name")}/entries/`,{pathname:i}=e;i.startsWith(n)||i.startsWith(o)&&"PUSH"===r||(this.deleteBackup(),u(),this.unlisten())})),s||i(t)}componentDidUpdate(e){if(!e.localBackup&&this.props.localBackup&&(window.confirm(this.props.t("editor.editor.confirmLoadBackup"))?this.props.loadLocalBackup():this.deleteBackup()),this.props.hasChanged&&this.createBackup(this.props.entryDraft.get("entry"),this.props.collection),e.entry===this.props.entry)return;const{newEntry:t,collection:r}=this.props;t&&e.createEmptyDraft(r,this.props.location.search)}componentWillUnmount(){this.createBackup.flush(),this.props.discardDraft(),window.removeEventListener("beforeunload",this.exitBlocker)}deleteBackup(){const{deleteLocalBackup:e,collection:t,slug:r,newEntry:n}=this.props;this.createBackup.cancel(),e(t,!n&&r)}render(){const{entry:e,entryDraft:t,fields:r,collection:n,changeDraftFieldValidation:o,user:i,hasChanged:a,displayUrl:s,hasWorkflow:l,useOpenAuthoring:c,unpublishedEntry:u,newEntry:f,isModification:p,currentStatus:d,logoutUser:h,deployPreview:g,loadDeployPreview:m,draftKey:y,slug:v,t:b,editorBackLink:w}=this.props,_=!f&&!u;return e&&e.get("error")?(0,xo.jsx)("div",null,(0,xo.jsx)("h3",null,e.get("error"))):null==t||void 0===t.get("entry")||e&&e.get("isFetching")?(0,xo.jsx)(qe.Loader,{active:!0},b("editor.editor.loadingEntry")):(0,xo.jsx)(Mx,{draftKey:y,entry:t.get("entry"),collection:n,fields:r,fieldsMetaData:t.get("fieldsMetaData"),fieldsErrors:t.get("fieldsErrors"),onChange:this.handleChangeDraftField,onValidate:o,onPersist:this.handlePersistEntry,onDelete:this.handleDeleteEntry,onDeleteUnpublishedChanges:this.handleDeleteUnpublishedChanges,onChangeStatus:this.handleChangeStatus,onPublish:this.handlePublishEntry,unPublish:this.handleUnpublishEntry,onDuplicate:this.handleDuplicateEntry,showDelete:this.props.showDelete,user:i,hasChanged:a,displayUrl:s,hasWorkflow:l,useOpenAuthoring:c,hasUnpublishedChanges:u,isNewEntry:f,isModification:p,currentStatus:d,onLogoutClick:h,deployPreview:g,loadDeployPreview:t=>m(n,v,e,_,t),editorBackLink:w,t:b})}}$x(Fx,"propTypes",{changeDraftField:i().func.isRequired,changeDraftFieldValidation:i().func.isRequired,collection:Vm().map.isRequired,createDraftDuplicateFromEntry:i().func.isRequired,createEmptyDraft:i().func.isRequired,discardDraft:i().func.isRequired,entry:Vm().map,entryDraft:Vm().map.isRequired,loadEntry:i().func.isRequired,persistEntry:i().func.isRequired,deleteEntry:i().func.isRequired,showDelete:i().bool.isRequired,fields:Vm().list.isRequired,slug:i().string,newEntry:i().bool.isRequired,displayUrl:i().string,hasWorkflow:i().bool,useOpenAuthoring:i().bool,unpublishedEntry:i().bool,isModification:i().bool,collectionEntriesLoaded:i().bool,updateUnpublishedEntryStatus:i().func.isRequired,publishUnpublishedEntry:i().func.isRequired,deleteUnpublishedEntry:i().func.isRequired,logoutUser:i().func.isRequired,loadEntries:i().func.isRequired,deployPreview:i().object,loadDeployPreview:i().func.isRequired,currentStatus:i().string,user:i().object,location:i().shape({pathname:i().string,search:i().string}),hasChanged:i().bool,t:i().func.isRequired,retrieveLocalBackup:i().func.isRequired,localBackup:Vm().map,loadLocalBackup:i().func,persistLocalBackup:i().func.isRequired,deleteLocalBackup:i().func});const Bx={changeDraftField:function({field:e,value:t,metadata:r,entries:n,i18n:o}){return{type:el,payload:{field:e,value:t,metadata:r,entries:n,i18n:o}}},changeDraftFieldValidation:function(e,t){return{type:tl,payload:{uniquefieldId:e,errors:t}}},loadEntry:Sl,loadEntries:kl,loadDeployPreview:function(e,t,r,n,o){return async(i,a)=>{const s=a(),l=rf(s.config),c=e.get("name"),u=Hf(s,c,t);if(!u||!u.isFetching){i(function(e,t){return{type:Ef,payload:{collection:e,slug:t}}}(c,t));try{const a=n?l.getDeploy(e,t,r):await l.getDeployPreview(e,t,r,o);return i(a?function(e,t,r){const{url:n,status:o}=r;return{type:kf,payload:{collection:e,slug:t,url:n,status:o}}}(c,t,a):Tf(c,t))}catch(e){console.error(e),i(ea({message:{details:e.message,key:"ui.toast.onFailToLoadDeployPreview"},type:"error",dismissAfter:8e3})),i(Tf(c,t))}}}},loadLocalBackup:function(){return{type:ol}},retrieveLocalBackup:function(e,t){return async(r,n)=>{const o=n(),i=rf(o.config),{entry:a}=await i.getLocalDraftBackup(e,t);if(a){const t=a.mediaFiles||[],o=await Promise.all(t.map((t=>t.file||t.url?Tr({path:t.path,file:t.file,url:t.url,field:t.field}):rs({collection:e,entry:(0,Qe.fromJS)(a),path:t.path,field:t.field})(r,n))));return r(Qa(o)),r(function(e){return{type:nl,payload:{entry:e}}}(a))}}},persistLocalBackup:function(e,t){return(r,n)=>{const o=n();return rf(o.config).persistLocalDraftBackup(e,t)}},deleteLocalBackup:function(e,t){return(r,n)=>{const o=n();return rf(o.config).deleteLocalDraftBackup(e,t)}},createDraftDuplicateFromEntry:function(e){return t=>{t(Yi({predicate:({type:e})=>e===Xs,run:()=>t(function(e){return{type:il,payload:Si(e.get("collection"),"","",{data:e.get("data"),mediaFiles:e.get("mediaFiles").toJS()})}}(e))}))}},createEmptyDraft:function(e,t){return async(r,n)=>{new URLSearchParams(t).forEach(((t,r)=>{e=function(e,r,n){const o=Oc(e,r);if(!o)return e;let i=!1;return e=e.set("fields",Ec(e.get("fields",(0,Qe.List)()),(function(e){const r=e;return r===o?(i=!0,(e=>{return e.set("default",!!["true","True","TRUE"].includes(r=t)||!["false","False","FALSE"].includes(r)&&function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}(r));var r})(r)):r}),(()=>i))),e}(e,r)}));const o=e.get("fields",(0,Qe.List)()),i=function(e){return e.filter((e=>!e.get("meta"))).toList()}(o),a=Cl(i),s=function(e){return e.filter((e=>!0===e.get("meta"))).toList()}(o),l=Cl(s),c=n(),u=rf(c.config);e.has("media_folder")||await Fa(r,n());const f=function(e,t){if(!Lc(e))return{};return function(e,t){const{locales:r,defaultLocale:n}=Nc(e);return Object.fromEntries(r.filter((e=>e!==n)).map((e=>[e,{data:t}])))}(e,Cl(t,(function(e){return e.get(Ac)!==Dc.DUPLICATE&&e.get(Ac)!==Dc.TRANSLATE})))}(e,i);let p=Si(e.get("name"),"","",{data:a,i18n:f,mediaFiles:[],meta:l});p=await u.processEntry(c,e,p),r({type:Xs,payload:p})}},discardDraft:function(){return{type:Zs}},persistEntry:function(e){return async(t,r)=>{const n=r(),o=n.entryDraft,i=o.get("fieldsErrors"),a=Wf(n,e.get("name"));if(!i.isEmpty())return i.some((e=>e.some((e=>e.type&&e.type===Ki.PRESENCE))))&&t(ea({message:{key:"ui.toast.missingRequiredField"},type:"error",dismissAfter:8e3})),Promise.reject();const s=rf(n.config),l=o.get("entry"),c=Tl({entry:l}),u=Pl(e,l),f=o.set("entry",u);return t(function(e,t){return{type:al,payload:{collectionName:e.get("name"),entrySlug:t.get("slug")}}}(e,u)),s.persistEntry({config:n.config,collection:e,entryDraft:f,assetProxies:c,usedSlugs:a}).then((async r=>{t(ea({message:{key:"ui.toast.entrySaved"},type:"success",dismissAfter:4e3})),c.length>0&&await t(ka()),t(function(e,t,r){return{type:sl,payload:{collectionName:e.get("name"),entrySlug:t.get("slug"),slug:r}}}(e,u,r)),e.has("nested")&&await t(kl(e)),l.get("slug")!==r&&(await t(Sl(e,r)),as(e.get("name"),r))})).catch((r=>(console.error(r),t(ea({message:{details:r,key:"ui.toast.onFailToPersist"},type:"error",dismissAfter:8e3})),Promise.reject(t(function(e,t,r){return{type:ll,error:"Failed to persist entry",payload:{collectionName:e.get("name"),entrySlug:t.get("slug"),error:r.toString()}}}(e,u,r))))))}},deleteEntry:function(e,t){return(r,n)=>{const o=n(),i=rf(o.config);return r(function(e,t){return{type:"ENTRY_DELETE_REQUEST",payload:{collectionName:e.get("name"),entrySlug:t}}}(e,t)),i.deleteEntry(o,e,t).then((()=>r(vl(e,t)))).catch((n=>(r(ea({message:{details:n,key:"ui.toast.onFailToDelete"},type:"error",dismissAfter:8e3})),console.error(n),Promise.reject(r(function(e,t,r){return{type:"ENTRY_DELETE_FAILURE",payload:{collectionName:e.get("name"),entrySlug:t,error:r.toString()}}}(e,t,n))))))}},updateUnpublishedEntryStatus:Ps,publishUnpublishedEntry:Rs,unpublishPublishedEntry:function(e,t){return(r,n)=>{const o=n(),i=rf(o.config),a=qf(o,e.get("name"),t),s=(0,Qe.Map)().set("entry",a);return r(Os(e,t)),i.deleteEntry(o,e,t).then((()=>i.persistEntry({config:o.config,collection:e,entryDraft:s,assetProxies:[],usedSlugs:(0,Qe.List)(),status:eo.get("PENDING_PUBLISH")}))).then((()=>{r(Es(e,a)),r(vl(e,t)),r(Cs(e,t)),r(ea({message:{key:"ui.toast.entryUnpublished"},type:"success",dismissAfter:4e3}))})).catch((t=>{r(ea({message:{key:"ui.toast.onFailToUnpublishEntry",details:t},type:"error",dismissAfter:8e3})),r(ks(t,e,a.get("slug")))}))}},deleteUnpublishedEntry:js,logoutUser:hf},Ux=H((function(e,t){const{collections:r,entryDraft:n,auth:o,config:i,entries:a,globalUI:s}=e,l=t.match.params[0],c=r.get(t.match.params.name),u=c.get("name"),f=!0===t.newRecord,p=yc(c,l),d=f?null:qf(e,u,l),h=o.user,g=n.get("hasChanged"),m=i.display_url,y=i.publish_mode===Zn,v=s.useOpenAuthoring,b=n.getIn(["entry","isModification"]),w=!!a.getIn(["pages",u]),_=Vf(e,u,l),S=qf(e,u,l),x=_&&_.get("status"),O=Hf(e,u,l),E=n.get("localBackup"),k=n.get("key");let C=`/collections/${u}`;if("workflow"===new URLSearchParams(t.location.search).get("ref")&&(C="/workflow"),c.has("nested")&&l){const e=l.split("/");e.length>2&&(C=`${C}/filter/${e.slice(0,-2).join("/")}`)}return{collection:c,collections:r,newEntry:f,entryDraft:n,fields:p,slug:l,entry:d,user:h,hasChanged:g,displayUrl:m,hasWorkflow:y,useOpenAuthoring:v,isModification:b,collectionEntriesLoaded:w,currentStatus:x,deployPreview:O,localBackup:E,draftKey:k,publishedEntry:S,unPublishedEntry:_,editorBackLink:C}}),Bx)(function(e){return H(Lx,null,Nx)(class extends r().Component{render(){return(0,xo.jsx)(e,this.props)}})}((0,We.Iu)()(Fx))),zx=Cg("div",{target:"ew40z3q0",label:"NotFoundContainer"})("margin:",qe.lengths.pageMargin,";");function qx({t:e}){return(0,xo.jsx)(zx,null,(0,xo.jsx)("h2",null,e("app.notFoundPage.header")))}qx.propTypes={t:i().func.isRequired};const Wx=(0,We.Iu)()(qx);function Hx(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vx(){return Vx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vx.apply(this,arguments)}const Gx={buttonActive:(0,xo.css)("color:",qe.colors.active,";;label:buttonActive;")};function Kx(e){return(0,xo.jsx)("header",Vx({css:(0,xo.css)(qe.shadows.dropMain,";position:sticky;width:100%;top:0;background-color:",qe.colors.foreground,";z-index:",qe.zIndex.zIndex300,";height:",qe.lengths.topBarHeight,";;label:AppHeader;")},e))}const Yx=Cg("div",{target:"e1rbzf6g4",label:"AppHeaderContent"})({name:"jxf21e",styles:"display:flex;justify-content:space-between;min-width:800px;max-width:1440px;padding:0 12px;margin:0 auto"}),Jx=Cg("button",{target:"e1rbzf6g3",label:"AppHeaderButton"})(qe.buttons.button,";background:none;color:#7b8290;font-family:inherit;font-size:16px;font-weight:500;display:inline-flex;padding:16px 20px;align-items:center;",qe.Icon,"{margin-right:4px;color:#b3b9c4;}&:hover,&:active,&:focus{",Gx.buttonActive,";",qe.Icon,"{",Gx.buttonActive,";}}",(e=>(0,xo.css)("&.",e.activeClassName,"{",Gx.buttonActive,";",qe.Icon,"{",Gx.buttonActive,";}};label:AppHeaderButton;")),";"),Qx=Jx.withComponent(Gv,{target:"e1rbzf6g5",label:"AppHeaderNavLink"}),Xx=Cg("div",{target:"e1rbzf6g2",label:"AppHeaderActions"})({name:"8irbms",styles:"display:inline-flex;align-items:center"}),Zx=Cg(qe.StyledDropdownButton,{target:"e1rbzf6g1",label:"AppHeaderQuickNewButton"})(qe.buttons.button,";",qe.buttons.medium,";",qe.buttons.gray,";margin-right:8px;&:after{top:11px;}"),eO=Cg("ul",{target:"e1rbzf6g0",label:"AppHeaderNavList"})({name:"1vufzxm",styles:"display:flex;margin:0;list-style:none"});class tO extends r().Component{constructor(...e){super(...e),Hx(this,"intervalId",void 0),Hx(this,"handleCreatePostClick",(e=>{const{onCreateEntryClick:t}=this.props;t&&t(e)}))}componentDidMount(){this.intervalId=setInterval((()=>{this.props.checkBackendStatus()}),3e5)}componentWillUnmount(){clearInterval(this.intervalId)}render(){const{user:e,collections:t,onLogoutClick:r,openMediaLibrary:n,hasWorkflow:o,displayUrl:i,isTestRepo:a,t:s,showMediaButton:l}=this.props,c=t.filter((e=>e.get("create"))).toList();return(0,xo.jsx)(Kx,null,(0,xo.jsx)(Yx,null,(0,xo.jsx)("nav",null,(0,xo.jsx)(eO,null,(0,xo.jsx)("li",null,(0,xo.jsx)(Qx,{to:"/",activeClassName:"header-link-active",isActive:(e,t)=>t.pathname.startsWith("/collections/")},(0,xo.jsx)(qe.Icon,{type:"page"}),s("app.header.content"))),o&&(0,xo.jsx)("li",null,(0,xo.jsx)(Qx,{to:"/workflow",activeClassName:"header-link-active"},(0,xo.jsx)(qe.Icon,{type:"workflow"}),s("app.header.workflow"))),l&&(0,xo.jsx)("li",null,(0,xo.jsx)(Jx,{onClick:n},(0,xo.jsx)(qe.Icon,{type:"media-alt"}),s("app.header.media"))))),(0,xo.jsx)(Xx,null,c.size>0&&(0,xo.jsx)(qe.Dropdown,{renderButton:()=>(0,xo.jsx)(Zx,null," ",s("app.header.quickAdd")),dropdownTopOverlap:"30px",dropdownWidth:"160px",dropdownPosition:"left"},c.map((e=>(0,xo.jsx)(qe.DropdownItem,{key:e.get("name"),label:e.get("label_singular")||e.get("label"),onClick:()=>this.handleCreatePostClick(e.get("name"))})))),(0,xo.jsx)(Wm,{displayUrl:i,isTestRepo:a,imageUrl:null==e?void 0:e.avatar_url,onLogoutClick:r}))))}}Hx(tO,"propTypes",{user:i().object.isRequired,collections:Vm().map.isRequired,onCreateEntryClick:i().func.isRequired,onLogoutClick:i().func.isRequired,openMediaLibrary:i().func.isRequired,hasWorkflow:i().bool.isRequired,displayUrl:i().string,isTestRepo:i().bool,t:i().func.isRequired,checkBackendStatus:i().func.isRequired});const rO={checkBackendStatus:function(){return async(e,t)=>{try{const r=t();if(r.status.isFetching)return;e({type:If});const n=rf(r.config),o=await n.status(),i="ui.toast.onBackendDown",a=r.notifications.notifications.filter((e=>{var t;return"string"!=typeof e.message&&(null===(t=e.message)||void 0===t?void 0:t.key)===i}));if(!1===o.api.status)return 0===a.length&&e(ea({message:{details:o.api.statusPage,key:"ui.toast.onBackendDown"},type:"error"})),e(Nf(o));if(!0===o.api.status&&a.length>0&&a.forEach((t=>{e(ta(t.id))})),!1===o.auth.status){const t="ui.toast.onLoggedOut",n=r.notifications.notifications.find((e=>{var r;return"string"!=typeof e.message&&(null===(r=e.message)||void 0===r?void 0:r.key)===t}));n||e(ea({message:{key:"ui.toast.onLoggedOut"},type:"error"}))}e(Nf(o))}catch(t){e(function(e){return{type:Lf,payload:{error:e}}}(t))}}}},nO=H(null,rO)((0,We.Iu)()(tO)),oO=["collections","render"];function iO(){return iO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iO.apply(this,arguments)}Km().config({barColors:{0:qe.colors.active,"1.0":qe.colors.active},shadowBlur:0,barThickness:2});const aO=Cg("div",{target:"eh2m33j2",label:"AppMainContainer"})({name:"y0stlg",styles:"min-width:800px;max-width:1440px;margin:0 auto"}),sO=Cg("div",{target:"eh2m33j1",label:"ErrorContainer"})({name:"3zy121",styles:"margin:20px"}),lO=Cg("pre",{target:"eh2m33j0",label:"ErrorCodeBlock"})({name:"1dps4tx",styles:"margin-left:20px;font-size:15px;line-height:1.5"});function cO(e){const t=e.filter((e=>!0!==e.get("hide"))).first();if(t)return`/collections/${t.get("name")}`;throw new Error("Could not find a non hidden collection")}function uO(e){let{collections:t,render:r}=e,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,oO);const o=cO(t);return(0,xo.jsx)(Ue,iO({},n,{render:e=>t.get(e.match.params.name)?r(e):(0,xo.jsx)(Ne,{to:o})}))}class fO extends r().Component{configError(e){const t=this.props.t;return(0,xo.jsx)(sO,null,(0,xo.jsx)("h1",null,t("app.app.errorHeader")),(0,xo.jsx)("div",null,(0,xo.jsx)("strong",null,t("app.app.configErrors"),":"),(0,xo.jsx)(lO,null,e.error),(0,xo.jsx)("span",null,t("app.app.checkConfigYml"))))}handleLogin(e){this.props.loginUser(e)}authenticating(){const{auth:e,t}=this.props,n=rf(this.props.config);return null==n?(0,xo.jsx)("div",null,(0,xo.jsx)("h1",null,t("app.app.waitingBackend"))):(0,xo.jsx)("div",null,(0,xo.jsx)(Dm,null),r().createElement(n.authComponent(),{onLogin:this.handleLogin.bind(this),error:e.error,inProgress:e.isFetching,siteId:this.props.config.backend.site_domain,base_url:this.props.config.backend.base_url,authEndpoint:this.props.config.backend.auth_endpoint,config:this.props.config,clearHash:()=>ns.replace("/"),t}))}handleLinkClick(e,t,...r){e.preventDefault(),t(...r)}render(){const{user:e,config:t,collections:n,logoutUser:o,isFetching:i,publishMode:a,useMediaLibrary:s,openMediaLibrary:l,t:c,showMediaButton:u}=this.props;if(null===t)return null;if(t.error)return this.configError(t);if(t.isFetching)return(0,xo.jsx)(qe.Loader,{active:!0},c("app.app.loadingConfig"));if(null==e)return this.authenticating(c);const f=cO(n),p=a===Zn;return(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(Dm,null),(0,xo.jsx)(nO,{user:e,collections:n,onCreateEntryClick:Ym,onLogoutClick:o,openMediaLibrary:l,hasWorkflow:p,displayUrl:t.display_url,isTestRepo:"test-repo"===t.backend.name,showMediaButton:u}),(0,xo.jsx)(aO,null,i&&(0,xo.jsx)(Km(),null),(0,xo.jsx)(ze,null,(0,xo.jsx)(Ne,{exact:!0,from:"/",to:f}),(0,xo.jsx)(Ne,{exact:!0,from:"/search/",to:f}),(0,xo.jsx)(uO,{exact:!0,collections:n,path:"/collections/:name/search/",render:({match:e})=>(0,xo.jsx)(Ne,{to:`/collections/${e.params.name}`})}),(0,xo.jsx)(Ne,{from:"/error=access_denied&error_description=Signups+not+allowed+for+this+instance",to:f}),p?(0,xo.jsx)(Ue,{path:"/workflow",component:v_}):null,(0,xo.jsx)(uO,{exact:!0,collections:n,path:"/collections/:name",render:e=>(0,xo.jsx)(Bw,e)}),(0,xo.jsx)(uO,{path:"/collections/:name/new",collections:n,render:e=>(0,xo.jsx)(Ux,iO({},e,{newRecord:!0}))}),(0,xo.jsx)(uO,{path:"/collections/:name/entries/*",collections:n,render:e=>(0,xo.jsx)(Ux,e)}),(0,xo.jsx)(uO,{path:"/collections/:name/search/:searchTerm",collections:n,render:e=>(0,xo.jsx)(Bw,iO({},e,{isSearchResults:!0,isSingleSearchResult:!0}))}),(0,xo.jsx)(uO,{collections:n,path:"/collections/:name/filter/:filterTerm*",render:e=>(0,xo.jsx)(Bw,e)}),(0,xo.jsx)(Ue,{path:"/search/:searchTerm",render:e=>(0,xo.jsx)(Bw,iO({},e,{isSearchResults:!0}))}),(0,xo.jsx)(uO,{path:"/edit/:name/:entryName",collections:n,render:({match:e})=>{const{name:t,entryName:r}=e.params;return(0,xo.jsx)(Ne,{to:`/collections/${t}/entries/${r}`})}}),(0,xo.jsx)(Ue,{component:Wx})),s?(0,xo.jsx)($v,null):null))}}!function(e,t,r){(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(fO,"propTypes",{auth:i().object.isRequired,config:i().object.isRequired,collections:Vm().map.isRequired,loginUser:i().func.isRequired,logoutUser:i().func.isRequired,user:i().object,isFetching:i().bool.isRequired,publishMode:i().oneOf([Xn,Zn]),siteId:i().string,useMediaLibrary:i().bool,openMediaLibrary:i().func.isRequired,showMediaButton:i().bool,t:i().func.isRequired});const pO=H((function(e){const{auth:t,config:r,collections:n,globalUI:o,mediaLibrary:i}=e,a=t.user,s=o.isFetching,l=r.publish_mode,c=!i.get("externalLibrary");return{auth:t,config:r,collections:n,user:a,isFetching:s,publishMode:l,showMediaButton:i.get("showMediaButton"),useMediaLibrary:c}}),{openMediaLibrary:xa,loginUser:function(e){return(t,r)=>{const n=r(),o=rf(n.config);return t(uf()),o.authenticate(e).then((e=>{e.useOpenAuthoring&&t(df()),t(ff(e))})).catch((e=>{console.error(e),t(ea({message:{details:e.message,key:"ui.toast.onFailToAuth"},type:"error",dismissAfter:8e3})),t(pf(e))}))}},logoutUser:hf})((0,We.Iu)()(fO));function dO({field:e,t}){return(0,xo.jsx)("div",null,t("editor.editorWidgets.unknownControl.noControl",{widget:e.get("widget")}))}dO.propTypes={field:Vm().map,t:i().func.isRequired};const hO=(0,We.Iu)()(dO);function gO({field:e,t}){return(0,xo.jsx)("div",{className:"nc-widgetPreview"},t("editor.editorWidgets.unknownPreview.noPreview",{widget:e.get("widget")}))}function mO(e){return Yf.dispatch(Oa(e,void 0))}gO.propTypes={field:Vm().map,t:i().func.isRequired},En("unknown",hO,(0,We.Iu)()(gO));const yO=jo()((async function(e,t){const r=An(e);if(r){const e=await r.init({options:t,handleInsert:mO});Yf.dispatch(function(e){const t={show:e.show||(()=>{}),hide:e.hide||(()=>{}),onClearControl:e.onClearControl||(()=>{}),onRemoveControl:e.onRemoveControl||(()=>{}),enableStandalone:e.enableStandalone||(()=>{})};return{type:aa,payload:t}}(e))}else{const t=new Error(`Missing external media library '${e}'. Please use 'registerMediaLibrary' to register it.`);Yf.dispatch(Mu(t))}}));Yf.subscribe((()=>{const e=Yf.getState();if(e){var t;const r=null===(t=e.config.media_library)||void 0===t?void 0:t.name;if(r&&!e.mediaLibrary.get("externalLibrary")){const t=e.config.media_library;yO(r,t)}}})),__webpack_require__(30762);const vO="nc-root",bO=H((function(e){return{locale:Lu(e.config),config:e.config}}))((function({locale:e,config:t}){return(0,xo.jsx)(We.oc,{locale:e,messages:Xf(e)},(0,xo.jsx)(Wg,{showBackup:!0,config:t},(0,xo.jsx)(Re,{history:ns},(0,xo.jsx)(Ue,{component:pO}))))}));function wO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wO(Object(r),!0).forEach((function(t){SO(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wO(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function SO(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xO=_O(_O({},Sn),{},{init:function(e={}){const{config:t}=e;console.log("decap-cms-core 3.3.3"),Yf.dispatch(Au(t,(function(){Yf.dispatch(((e,t)=>{const r=t(),n=rf(r.config);return e(uf()),Promise.resolve(n.currentUser()).then((t=>{t?(t.useOpenAuthoring&&e(df()),e(ff(t))):e({type:sf})})).catch((t=>{e(pf(t)),e(hf())}))}))}))),(0,n.s)(function(){const e=document.getElementById(vO);if(e)return e;const t=document.createElement("div");return t.id=vO,document.body.appendChild(t),t}()).render((0,xo.jsx)((function(){return(0,xo.jsx)(r().Fragment,null,(0,xo.jsx)(qe.GlobalStyles,null),(0,xo.jsx)(p,{store:Yf},(0,xo.jsx)(bO,null)))}),null))}})})(),__webpack_exports__=__webpack_exports__.DecapCmsCore,__webpack_exports__})()));
47
47
  //# sourceMappingURL=decap-cms-core.js.map