!function(){"use strict";vare,t,n={274:function(e,t,n){varr=i(n(180)),o=i(n(521));functioni(e){returne&&e.__esModule?e:{default:e}}window.document.addEventListener("DOMContentLoaded",(()=>{(0,o.default)(),(0,r.default)()}))},521:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void0;varr=s(n(648)),o=s(n(93)),i=s(n(436)),a=s(n(149));functions(e){returne&&e.__esModule?e:{default:e}}t.default=()=>{r.default.component.register("AnchorSelectorField",o.default),r.default.transform("pages-history",(e=>{e.component("HistoryViewer.pages-controller-cms-content",i.default,"PageHistoryViewer")})),r.default.transform("pages-history-revert",(e=>{e.component("HistoryViewerToolbar.VersionedAdmin.HistoryViewer.SiteTree.HistoryViewerVersionDetail",a.default,"PageRevertMutation")}))}},180:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void0;varr=a(n(648)),o=n(827),i=a(n(572));functiona(e){returne&&e.__esModule?e:{default:e}}t.default=()=>{r.default.reducer.register("cms",(0,o.combineReducers)({anchorSelector:i.default}))}},93:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ConnectedAnchorSelectorField=t.Component=void0;varr=y(n(754)),o=y(n(363)),i=y(n(875)),a=n(624),s=n(827),u=n(762),l=y(n(277)),c=function(e,t){if(!t&&e&&e.__esModule)returne;if(null===e||"object"!=typeofe&&"function"!=typeofe)return{default:e};varn=b(t);if(n&&n.has(e))returnn.get(e);varr={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(variine)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){vara=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,n&&n.set(e,r);returnr}(n(447)),d=y(n(892)),f=y(n(42)),p=y(n(783)),h=y(n(78)),v=y(n(720)),m=y(n(820)),g=y(n(86));functionb(e){if("function"!=typeofWeakMap)returnnull;vart=newWeakMap,n=newWeakMap;return(b=function(e){returne?n:t})(e)}functiony(e){returne&&e.__esModule?e:{default:e}}constw=()=>null;classOextendsl.default{constructor(e){super(e),this.handleChange=this.handleChange.bind(this),this.handleLoadingError=this.handleLoadingError.bind(this)}componentDidMount(){this.ensurePagesLoaded()}componentDidUpdate(e){this.props.pageId!==e.pageId&&this.ensurePagesLoaded()}ensurePagesLoaded(){lete=arguments.length>0&&void0!==arguments[0]?arguments[0]:this.props;if(e.loadingState===d.default.UPDATING||e.loadingState===d.default.SUCCESS||!e.pageId)returnPromise.resolve();lett=[];e.loadingState===d.default.FIELD_ONLY&&(t=this.props.anchors),e.actions.anchorSelector.beginUpdating(e.pageId);constn=e.data.endpoint.replace(/:id/,e.pageId);return(0,i.default)(n,{credentials:"same-origin"}).then((e=>e.json())).then((n=>{constr=[...newSet([...n,...t])];returne.actions.anchorSelector.updated(e.pageId,r),r})).catch((t=>{e.actions.anchorSelector.updateFailed(e.pageId),this.handleLoadingError(t,e)}))}getDropdownOptions(){conste=this.props.anchors.map((e=>({value:e})));returnthis.props.value&&!this.props.anchors.find((e=>e===this.props.value))&&e.unshift({value:this.props.value}),e}handleChange(e){"function"==typeofthis.props.onChange&&this.props.onChange(e?e.value:"")}handleLoadingError(e){lett=arguments.length>1&&void0!==arguments[1]?arguments[1]:this.props;if(t.onLoadingError===w)throwe;returnt.onLoadingError({errors:[{value:e.message,type:"error"}]})}render(){conste=(0,m.default)("anchorselectorfield",this.props.extraClass),t=this.getDropdownOptions(),n=this.props.value||"",i=r.default._t("CMS.ANCHOR_SELECT_OR_TYPE","Select or enter anchor");returno.default.createElement(h.default,null,o.default.createElement(p.default,{isSearchable:!0,isClearable:!0,options:t,className:e,name:this.props.name,onChange:this.handleChange,value:{value:n},noOptionsMessage:()=>r.default._t("CMS.ANCHOR_NO_OPTIONS","No options"),placeholder:i,getOptionLabel:e=>{let{value:t}=e;returnt},classNamePrefix:"anchorselectorfield"}))}}t.Component=O,O.propTypes={extraClass:g.default.string,id:g.default.string,name:g.default.string.isRequired,onChange:g.defau