1(self.webpackChunkapp=self.webpackChunkapp||[]).push([[948],{4974:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var s=n(3043),i=n(2791),a=n(9333),r=n(9970),l=n(5711),o=n(7158),c=n(7689),d=n(184);const u=e=>{let{heading:t,subheading:n,introduction:u,cta:v,centered:m,bannerAsset:h,searchConfig:f,blowoutImage:b,blowoutImageSize:p,blowoutSize:g,blowoutImagePosition:j,subtitle:x}=e;const y=!(!b||"none"===b.value);let w=null;const[N,S]=(0,i.useState)(!(window.innerWidth>768)),T=(0,c.TH)();(0,i.useEffect)((()=>{const e=()=>{S(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]);const A=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h1",{className:"header-heading",dangerouslySetInnerHTML:{__html:(x?`<span class="subtitle">${x}</span>`:"")+(0,a.Ps)(t,"/"==T.pathname?"white":"green")}}),f&&f.displaySearch?(0,d.jsx)(r.Z,{searchConfig:f}):(0,d.jsx)(d.Fragment,{}),n?(0,d.jsx)("h2",{className:"header-subheading",children:(0,a.mb)(n)}):(0,d.jsx)(d.Fragment,{}),u?(0,d.jsx)("div",{className:"header-introduction",dangerouslySetInnerHTML:{__html:u}}):(0,d.jsx)(d.Fragment,{}),v?(0,d.jsx)("div",{}):(0,d.jsx)(d.Fragment,{})]}),y?(0,d.jsx)(o.Z,{name:b.value,blowout:{imageSize:null!==p&&void 0!==p?p:500,blowoutSize:null!==g&&void 0!==g?g:50,id:b.value,position:null!==j&&void 0!==j?j:null}}):h?h.map(((e,t)=>{var n;return w=null,"video"===e.handle&&e.assetAttachment?w=(0,d.jsxs)("video",{className:"banner-img video",autoPlay:!0,muted:!0,playsInline:!0,loop:!0,children:[e.title,(0,d.jsx)("source",{src:null!==(n=e.assetAttachment.url)&&void 0!==n?n:e.url}),(0,d.jsx)(o.Z,{image:h[0].asset})]},"banner-"+e.handle+"-"+t):d.Fragment,w})):(0,d.jsx)(d.Fragment,{})]});return(0,d.jsx)(s.E.header,{id:"site-header",initial:l.o.beforeEnter,animate:l.o.animate,variants:l.o.default,exit:l.o.exit,className:`${m?"centered headings-container":"headings-container"} ${y?"has-blowout":""}`,children:A})}},6186:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var s=n(2791),i=n(7689),a=n(9434),r=n(4974),l=n(2227),o=n(4072),c=n(5218),d=(n(4626),n(184));const u=()=>{const{currentUser:e}=(0,a.v9)((e=>e.state)),t=(0,i.s0)(),n=(0,o.Z)(),[u,v]=(0,s.useState)([]),[m,h]=(0,s.useState)(null);(0,s.useEffect)((()=>{document.body.className="",document.body.classList.add("account-page")}),[]),(0,s.useEffect)((()=>{(!1===e||e&&!e.hasActiveSubscription)&&t("/join",{replace:!0})}),[e]),(0,s.useEffect)((()=>{e&&f()}),[e]);const f=async()=>{try{var e;const t=await n.getAdverts();null!==t&&void 0!==t&&t.success&&v(null!==(e=t.data)&&void 0!==e?e:[])}catch(t){console.error("Failed to load adverts",t)}};return e?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(l.Z,{title:"The Avicultural Society | My Adverts",description:"",canonical:"https://www.avisoc.co.uk/account/adverts"}),(0,d.jsx)(r.Z,{heading:"My Adverts"}),(0,d.jsx)("main",{className:"account-adverts-page",children:(0,d.jsxs)("div",{className:"adverts-list-view",children:[(0,d.jsx)("div",{className:"page-actions",children:(0,d.jsx)("button",{className:"button green1",onClick:()=>t("/account/adverts/new"),children:"Post New Advert"})}),0===u.length?(0,d.jsx)("p",{className:"no-adverts",children:"You have no adverts yet."}):(0,d.jsx)("ul",{className:"my-adverts-list",children:u.map((e=>{var s,i,a,r,l,o;return(0,d.jsxs)("li",{className:"my-advert-item",children:[(0,d.jsxs)("div",{className:"listing-info",children:[(0,d.jsx)("h3",{children:e.title}),(0,d.jsx)("p",{className:"advert-location",children:e.listingLocation}),(0,d.jsxs)("div",{className:"advert-meta",children:[e.advertType&&(0,d.jsx)("span",{className:"bubble",children:null!==(s=null===(i=e.advertType)||void 0===i?void 0:i.label)&&void 0!==s?s:e.advertType}),e.listingType&&(0,d.jsx)("span",{className:"bubble",children:null!==(a=null===(r=e.listingType)||void 0===r?void 0:r.label)&&void 0!==a?a:e.listingType}),e.listingStatus&&(0,d.jsx)("span",{className:"bubble",children:null!==(l=null===(o=e.listingStatus)||void 0===o?void 0:o.label)&&void 0!==l?l:e.listingStatus}),(0,d.jsx)("span",{className:"bubble approval "+(e.enabled?"live":"pending"),children:e.enabled?"Live":"Pending Approval"})]})]}),(0,d.jsx)("div",{className:"advert-actions",children:m===e.id?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{children:"Are you sure?"}),(0,d.jsx)("button",{className:"button inverted",onClick:()=>(async e=>{try{const s=await n.deleteAdvert(e);var t;null!==s&&void 0!==s&&s.success?(c.ZP.success("Advert deleted"),v((t=>t.filter((t=>
1t.id!==e))))):c.ZP.error(null!==(t=null===s||void 0===s?void 0:s.message)&&void 0!==t?t:"Could not delete advert")}finally{h(null)}})(e.id),children:"Yes, delete"}),(0,d.jsx)("button",{className:"button green1 inverted",onClick:()=>h(null),children:"Cancel"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{className:"button green1 inverted",onClick:()=>t(`/account/adverts/${e.id}/edit`,{state:{advert:e}}),children:"Edit"}),(0,d.jsx)("button",{className:"button inverted",onClick:()=>h(e.id),children:"Delete"})]})})]},e.id)}))})]})})]}):null}},5095:(e,t,n)=>{var s=NaN,i="[object Symbol]",a=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,o=/^0o[0-7]+$/i,c=parseInt,d="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,u="object"==typeof self&&self&&self.Object===Object&&self,v=d||u||Function("return this")(),m=Object.prototype.toString,h=Math.max,f=Math.min,b=function(){return v.Date.now()};function p(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&m.call(e)==i}(e))return s;if(p(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=p(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var n=l.test(e);return n||o.test(e)?c(e.slice(2),n?2:8):r.test(e)?s:+e}e.exports=function(e,t,n){var s,i,a,r,l,o,c=0,d=!1,u=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=s,a=i;return s=i=void 0,c=t,r=e.apply(a,n)}function j(e){var n=e-o;return void 0===o||n>=t||n<0||u&&e-c>=a}function x(){var e=b();if(j(e))return y(e);l=setTimeout(x,function(e){var n=t-(e-o);return u?f(n,a-(e-c)):n}(e))}function y(e){return l=void 0,v&&s?m(e):(s=i=void 0,r)}function w(){var e=b(),n=j(e);if(s=arguments,i=this,o=e,n){if(void 0===l)return function(e){return c=e,l=setTimeout(x,t),d?m(e):r}(o);
vendor: 383 bytes, lines 1-2
1if(u)return l=setTimeout(x,t),m(o)}return void 0===l&&(l=setTimeout(x,t)),r}return t=g(t)||0,p(n)&&(d=!!n.leading,a=(u="maxWait"in n)?h(g(n.maxWait)||0,t):a,v="trailing"in n?!!n.trailing:v),w.cancel=function(){void 0!==l&&clearTimeout(l),c=0,s=o=i=l=void 0},w.flush=function(){return void 0===l?r:y(b())},w}},4626:()=>{"use strict"}}]); 2//# sourceMappingURL=948.45b4f6c9.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.