Files
ambersplace.net/cohost-archive/static/3797.98615fe5765058de4bb3.js

3 lines
14 KiB
JavaScript

/*! For license information please see 3797.98615fe5765058de4bb3.js.LICENSE.txt */
"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[3797],{93797:function(e,t,n){n.d(t,{ZP:function(){return ce}});var r=n(94159);function i(e,t,n,r){return new(n||(n=Promise))((function(i,u){function o(e){try{c(r.next(e))}catch(e){u(e)}}function a(e){try{c(r.throw(e))}catch(e){u(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))}function u(e,t){var n,r,i,u,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(u){return function(a){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}}var o,a=function(){},c=a(),f=Object,l=function(e){return e===c},s=function(e){return"function"==typeof e},d=function(e,t){return f.assign({},e,t)},v="undefined",h=function(){return typeof window!=v},p=new WeakMap,g=0,y=function(e){var t,n,r=typeof e,i=e&&e.constructor,u=i==Date;if(f(e)!==e||u||i==RegExp)t=u?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(t=p.get(e))return t;if(t=++g+"~",p.set(e,t),i==Array){for(t="@",n=0;n<e.length;n++)t+=y(e[n])+",";p.set(e,t)}if(i==f){t="#";for(var o=f.keys(e).sort();!l(n=o.pop());)l(e[n])||(t+=n+":"+y(e[n])+",");p.set(e,t)}}return t},b=!0,w=h(),m=typeof document!=v,O=w&&window.addEventListener?window.addEventListener.bind(window):a,E=m?document.addEventListener.bind(document):a,k=w&&window.removeEventListener?window.removeEventListener.bind(window):a,R=m?document.removeEventListener.bind(document):a,S={isOnline:function(){return b},isVisible:function(){var e=m&&document.visibilityState;return l(e)||"hidden"!==e}},D={initFocus:function(e){return E("visibilitychange",e),O("focus",e),function(){R("visibilitychange",e),k("focus",e)}},initReconnect:function(e){var t=function(){b=!0,e()},n=function(){b=!1};return O("online",t),O("offline",n),function(){k("online",t),k("offline",n)}}},x=!h()||"Deno"in window,C=x?r.useEffect:r.useLayoutEffect,V="undefined"!=typeof navigator&&navigator.connection,L=!x&&V&&(["slow-2g","2g"].includes(V.effectiveType)||V.saveData),T=function(e){if(s(e))try{e=e()}catch(t){e=""}var t=[].concat(e);return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?y(e):"",t,e?"$swr$"+e:""]},A=new WeakMap,_=function(e,t,n,r,i,u,o){void 0===o&&(o=!0);var a=A.get(e),c=a[0],f=a[1],l=a[3],s=c[t],d=f[t];if(o&&d)for(var v=0;v<d.length;++v)d[v](n,r,i);return u&&(delete l[t],s&&s[0])?s[0](2).then((function(){return e.get(t)})):e.get(t)},P=0,$=function(){return++P},I=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(void 0,void 0,void 0,(function(){var t,n,r,i,o,a,f,v,h,p,g,y,b,w,m,O,E,k,R,S;return u(this,(function(u){switch(u.label){case 0:if(t=e[0],n=e[1],r=e[2],i=e[3],a=!!l((o="boolean"==typeof i?{revalidate:i}:i||{}).populateCache)||o.populateCache,f=!1!==o.revalidate,v=!1!==o.rollbackOnError,h=o.optimisticData,p=T(n),g=p[0],y=p[2],!g)return[2];if(b=A.get(t),w=b[2],e.length<3)return[2,_(t,g,t.get(g),c,c,f,!0)];if(m=r,E=$(),w[g]=[E,0],k=!l(h),R=t.get(g),k&&(t.set(g,h),_(t,g,h)),s(m))try{m=m(t.get(g))}catch(e){O=e}return m&&s(m.then)?[4,m.catch((function(e){O=e}))]:[3,2];case 1:if(m=u.sent(),E!==w[g][0]){if(O)throw O;return[2,m]}O&&k&&v&&(a=!0,m=R,t.set(g,R)),u.label=2;case 2:return a&&(O||(s(a)&&(m=a(m,R)),t.set(g,m)),t.set(y,d(t.get(y),{error:O}))),w[g][1]=$(),[4,_(t,g,m,O,c,f,!!a)];case 3:if(S=u.sent(),O)throw O;return[2,a?S:m]}}))}))},F=function(e,t){for(var n in e)e[n][0]&&e[n][0](t)},M=function(e,t){if(!A.has(e)){var n=d(D,t),r={},i=I.bind(c,e),u=a;if(A.set(e,[r,{},{},{},i]),!x){var o=n.initFocus(setTimeout.bind(c,F.bind(c,r,0))),f=n.initReconnect(setTimeout.bind(c,F.bind(c,r,1)));u=function(){o&&o(),f&&f(),A.delete(e)}}return[e,i,u]}return[e,A.get(e)[4]]},N=M(new Map),W=N[0],j=N[1],z=d({onLoadingSlow:a,onSuccess:a,onError:a,onErrorRetry:function(e,t,n,r,i){var u=n.errorRetryCount,o=i.retryCount,a=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!l(u)&&o>u||setTimeout(r,a,i)},onDiscarded:a,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:L?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:L?5e3:3e3,compare:function(e,t){return y(e)==y(t)},isPaused:function(){return!1},cache:W,mutate:j,fallback:{}},S),J=function(e,t){var n=d(e,t);if(t){var r=e.use,i=e.fallback,u=t.use,o=t.fallback;r&&u&&(n.use=r.concat(u)),i&&o&&(n.fallback=d(i,o))}return n},H=(0,r.createContext)({}),q=function(e){return s(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}]},B=function(){return d(z,(0,r.useContext)(H))},G=function(e,t,n){var r=t[e]||(t[e]=[]);return r.push(n),function(){var e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}},K={dedupe:!0},U=(f.defineProperty((function(e){var t=e.value,n=J((0,r.useContext)(H),t),i=t&&t.provider,u=(0,r.useState)((function(){return i?M(i(n.cache||W),t):c}))[0];return u&&(n.cache=u[0],n.mutate=u[1]),C((function(){return u?u[2]:c}),[]),(0,r.createElement)(H.Provider,d(e,{value:n}))}),"default",{value:z}),o=function(e,t,n){var o=n.cache,a=n.compare,f=n.fallbackData,p=n.suspense,g=n.revalidateOnMount,y=n.refreshInterval,b=n.refreshWhenHidden,w=n.refreshWhenOffline,m=A.get(o),O=m[0],E=m[1],k=m[2],R=m[3],S=T(e),D=S[0],V=S[1],L=S[2],P=(0,r.useRef)(!1),F=(0,r.useRef)(!1),M=(0,r.useRef)(D),N=(0,r.useRef)(t),W=(0,r.useRef)(n),j=function(){return W.current},z=function(){return j().isVisible()&&j().isOnline()},J=function(e){return o.set(L,d(o.get(L),e))},H=o.get(D),q=l(f)?n.fallback[D]:f,B=l(H)?q:H,U=o.get(L)||{},Z=U.error,Q=!P.current,X=function(){return Q&&!l(g)?g:!j().isPaused()&&(p?!l(B):l(B)||n.revalidateIfStale)},Y=!(!D||!t)&&(!!U.isValidating||Q&&X()),ee=function(e,t){var n=(0,r.useState)({})[1],i=(0,r.useRef)(e),u=(0,r.useRef)({data:!1,error:!1,isValidating:!1}),o=(0,r.useCallback)((function(e){var r=!1,o=i.current;for(var a in e){var c=a;o[c]!==e[c]&&(o[c]=e[c],u.current[c]&&(r=!0))}r&&!t.current&&n({})}),[]);return C((function(){i.current=e})),[i,u.current,o]}({data:B,error:Z,isValidating:Y},F),te=ee[0],ne=ee[1],re=ee[2],ie=(0,r.useCallback)((function(e){return i(void 0,void 0,void 0,(function(){var t,r,i,f,d,v,h,p,g,y,b,w,m;return u(this,(function(u){switch(u.label){case 0:if(t=N.current,!D||!t||F.current||j().isPaused())return[2,!1];f=!0,d=e||{},v=!R[D]||!d.dedupe,h=function(){return!F.current&&D===M.current&&P.current},p=function(){var e=R[D];e&&e[1]===i&&delete R[D]},g={isValidating:!1},y=function(){J({isValidating:!1}),h()&&re(g)},J({isValidating:!0}),re({isValidating:!0}),u.label=1;case 1:return u.trys.push([1,3,,4]),v&&(_(o,D,te.current.data,te.current.error,!0),n.loadingTimeout&&!o.get(D)&&setTimeout((function(){f&&h()&&j().onLoadingSlow(D,n)}),n.loadingTimeout),R[D]=[t.apply(void 0,V),$()]),m=R[D],r=m[0],i=m[1],[4,r];case 2:return r=u.sent(),v&&setTimeout(p,n.dedupingInterval),R[D]&&R[D][1]===i?(J({error:c}),g.error=c,b=k[D],!l(b)&&(i<=b[0]||i<=b[1]||0===b[1])?(y(),v&&h()&&j().onDiscarded(D),[2,!1]):(a(te.current.data,r)?g.data=te.current.data:g.data=r,a(o.get(D),r)||o.set(D,r),v&&h()&&j().onSuccess(r,D,n),[3,4])):(v&&h()&&j().onDiscarded(D),[2,!1]);case 3:return w=u.sent(),p(),j().isPaused()||(J({error:w}),g.error=w,v&&h()&&(j().onError(w,D,n),("boolean"==typeof n.shouldRetryOnError&&n.shouldRetryOnError||s(n.shouldRetryOnError)&&n.shouldRetryOnError(w))&&z()&&j().onErrorRetry(w,D,n,ie,{retryCount:(d.retryCount||0)+1,dedupe:!0}))),[3,4];case 4:return f=!1,y(),h()&&v&&_(o,D,g.data,g.error,!1),[2,!0]}}))}))}),[D]),ue=(0,r.useCallback)(I.bind(c,o,(function(){return M.current})),[]);if(C((function(){N.current=t,W.current=n})),C((function(){if(D){var e=D!==M.current,t=ie.bind(c,K),n=0,r=G(D,E,(function(e,t,n){re(d({error:t,isValidating:n},a(te.current.data,e)?c:{data:e}))})),i=G(D,O,(function(e){if(0==e){var r=Date.now();j().revalidateOnFocus&&r>n&&z()&&(n=r+j().focusThrottleInterval,t())}else if(1==e)j().revalidateOnReconnect&&z()&&t();else if(2==e)return ie()}));return F.current=!1,M.current=D,P.current=!0,e&&re({data:B,error:Z,isValidating:Y}),X()&&(l(B)||x?t():(u=t,h()&&typeof window.requestAnimationFrame!=v?window.requestAnimationFrame(u):setTimeout(u,1))),function(){F.current=!0,r(),i()}}var u}),[D,ie]),C((function(){var e;function t(){var t=s(y)?y(B):y;t&&-1!==e&&(e=setTimeout(n,t))}function n(){te.current.error||!b&&!j().isVisible()||!w&&!j().isOnline()?t():ie(K).then(t)}return t(),function(){e&&(clearTimeout(e),e=-1)}}),[y,b,w,ie]),(0,r.useDebugValue)(B),p&&l(B)&&D)throw N.current=t,W.current=n,F.current=!1,l(Z)?ie(K):Z;return{mutate:ue,get data(){return ne.data=!0,B},get error(){return ne.error=!0,Z},get isValidating(){return ne.isValidating=!0,Y}}},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=B(),r=q(e),i=r[0],u=r[1],a=r[2],c=J(n,a),f=o,l=c.use;if(l)for(var s=l.length;s-- >0;)f=l[s](f);return f(i,u||c.fetcher,c)}),Z=function(){return Z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Z.apply(this,arguments)};var Q=function(){},X=Q(),Y=Object,ee=function(e){return e===X},te=function(e){return"function"==typeof e},ne="undefined"==typeof window||"Deno"in window?r.useEffect:r.useLayoutEffect,re=new WeakMap,ie=0,ue=function(e){var t,n,r=typeof e,i=e&&e.constructor,u=i==Date;if(Y(e)!==e||u||i==RegExp)t=u?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(t=re.get(e))return t;if(t=++ie+"~",re.set(e,t),i==Array){for(t="@",n=0;n<e.length;n++)t+=ue(e[n])+",";re.set(e,t)}if(i==Y){t="#";for(var o=Y.keys(e).sort();!ee(n=o.pop());)ee(e[n])||(t+=n+":"+ue(e[n])+",");re.set(e,t)}}return t},oe=function(e){if(te(e))try{e=e()}catch(t){e=""}var t=[].concat(e);return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?ue(e):"",t,e?"$swr$"+e:""]},ae=function(e){return te(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}]},ce=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=ae(n),u=i[0],o=i[1],a=i[2],c=(a.use||[]).concat(t);return e(u,o,Z(Z({},a),{use:c}))}}(U,(function(e){return function(t,n,i){var u=(0,r.useState)({})[1],o=(0,r.useRef)(!1),a=(0,r.useRef)(),c=i.cache,f=i.initialSize,l=void 0===f?1:f,s=i.revalidateAll,d=void 0!==s&&s,v=i.persistSize,h=void 0!==v&&v,p=i.revalidateFirstPage,g=void 0===p||p,y=i.revalidateOnMount,b=void 0!==y&&y,w=null;try{w=function(e){return oe(e?e(0,null):null)[0]}(t)}catch(e){}var m=null,O=null;w&&(m="$ctx$"+w,O="$len$"+w);var E=(0,r.useCallback)((function(){var e=c.get(O);return ee(e)?l:e}),[O,l]),k=(0,r.useRef)(E());ne((function(){o.current?w&&c.set(O,h?k.current:l):o.current=!0}),[w]);var R=b&&!o.current,S=e(w?"$inf$"+w:null,(function(){return e=void 0,r=void 0,o=function(){var e,r,u,o,f,l,s,v,h,p,y,b;return function(e,t){var n,r,i,u,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(u){return function(a){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}}(this,(function(w){switch(w.label){case 0:e=c.get(m)||[],r=e[0],u=e[1],o=[],f=E(),l=null,s=0,w.label=1;case 1:return s<f?(v=oe(t(s,l)),h=v[0],p=v[1],h?(y=c.get(h),b=d||r||ee(y)||g&&!s&&!ee(a.current)||R||u&&!ee(u[s])&&!i.compare(u[s],y),n&&b?[4,n.apply(void 0,p)]:[3,3]):[3,5]):[3,5];case 2:y=w.sent(),c.set(h,y),w.label=3;case 3:o.push(y),l=y,w.label=4;case 4:return++s,[3,1];case 5:return c.delete(m),[2,o]}}))},new((u=void 0)||(u=Promise))((function(t,n){function i(e){try{c(o.next(e))}catch(e){n(e)}}function a(e){try{c(o.throw(e))}catch(e){n(e)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof u?n:new u((function(e){e(n)}))).then(i,a)}c((o=o.apply(e,r||[])).next())}));var e,r,u,o}),i);ne((function(){a.current=S.data}),[S.data]);var D=(0,r.useCallback)((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[0],r=!1!==e[1];if(m){if(r)if(ee(n))c.set(m,[!0]);else{var i=a.current;c.set(m,[!1,i])}return e.length?S.mutate(n,r):S.mutate()}}),[m]),x=(0,r.useCallback)((function(e){var n;if(O&&(te(e)?n=e(E()):"number"==typeof e&&(n=e),"number"==typeof n))return c.set(O,n),k.current=n,u({}),D(function(e){for(var n=[],r=null,i=0;i<e;++i){var u=oe(t(i,r))[0],o=u?c.get(u):X;if(ee(o))return a.current;n.push(o),r=o}return n}(n))}),[O,E,D]);return{size:E(),setSize:x,mutate:D,get error(){return S.error},get data(){return S.data},get isValidating(){return S.isValidating}}}}))}}]);
//# sourceMappingURL=3797.98615fe5765058de4bb3.js.map