@yoast/ai-insights-client 1.4.54 → 1.4.55

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.
@@ -46,7 +46,7 @@ object-assign
46
46
  */var Oc,J0;function G_(){if(J0)return Oc;J0=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function i(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var o={},a=0;a<10;a++)o["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(o).map(function(c){return o[c]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(c){u[c]=c}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch(c){return!1}}return Oc=i()?Object.assign:function(s,o){for(var a,l=r(s),u,c=1;c<arguments.length;c++){a=Object(arguments[c]);for(var d in a)t.call(a,d)&&(l[d]=a[d]);if(e){u=e(a);for(var f=0;f<u.length;f++)n.call(a,u[f])&&(l[u[f]]=a[u[f]])}}return l},Oc}var Ec,eg;function Nf(){if(eg)return Ec;eg=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ec=e,Ec}var Ac,tg;function C2(){return tg||(tg=1,Ac=Function.call.bind(Object.prototype.hasOwnProperty)),Ac}var Tc,ng;function K_(){if(ng)return Tc;ng=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Nf(),n={},r=C2();e=function(s){var o="Warning: "+s;typeof console!="undefined"&&console.error(o);try{throw new Error(o)}catch(a){}}}function i(s,o,a,l,u){if(process.env.NODE_ENV!=="production"){for(var c in s)if(r(s,c)){var d;try{if(typeof s[c]!="function"){var f=Error((l||"React class")+": "+a+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}d=s[c](o,c,l,a,null,t)}catch(g){d=g}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var h=u?u():"";e("Failed "+a+" type: "+d.message+(h!=null?h:""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Tc=i,Tc}var Pc,rg;function V_(){if(rg)return Pc;rg=1;var e=S2(),t=G_(),n=Nf(),r=C2(),i=K_(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(a){var l="Warning: "+a;typeof console!="undefined"&&console.error(l);try{throw new Error(l)}catch(u){}});function o(){return null}return Pc=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function d(F){var U=F&&(u&&F[u]||F[c]);if(typeof U=="function")return U}var f="<<anonymous>>",h={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:b(),arrayOf:S,element:C(),elementType:w(),instanceOf:k,node:E(),objectOf:_,oneOf:x,oneOfType:O,shape:M,exact:B};function g(F,U){return F===U?F!==0||1/F===1/U:F!==F&&U!==U}function m(F,U){this.message=F,this.data=U&&typeof U=="object"?U:{},this.stack=""}m.prototype=Error.prototype;function p(F){if(process.env.NODE_ENV!=="production")var U={},q=0;function V(ne,ee,ge,se,Se,ye,Ue){if(se=se||f,ye=ye||ge,Ue!==n){if(l){var le=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw le.name="Invariant Violation",le}else if(process.env.NODE_ENV!=="production"&&typeof console!="undefined"){var Ge=se+":"+ge;!U[Ge]&&q<3&&(s("You are manually calling a React.PropTypes validation function for the `"+ye+"` prop on `"+se+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),U[Ge]=!0,q++)}}return ee[ge]==null?ne?ee[ge]===null?new m("The "+Se+" `"+ye+"` is marked as required "+("in `"+se+"`, but its value is `null`.")):new m("The "+Se+" `"+ye+"` is marked as required in "+("`"+se+"`, but its value is `undefined`.")):null:F(ee,ge,se,Se,ye)}var N=V.bind(null,!1);return N.isRequired=V.bind(null,!0),N}function v(F){function U(q,V,N,ne,ee,ge){var se=q[V],Se=P(se);if(Se!==F){var ye=I(se);return new m("Invalid "+ne+" `"+ee+"` of type "+("`"+ye+"` supplied to `"+N+"`, expected ")+("`"+F+"`."),{expectedType:F})}return null}return p(U)}function b(){return p(o)}function S(F){function U(q,V,N,ne,ee){if(typeof F!="function")return new m("Property `"+ee+"` of component `"+N+"` has invalid PropType notation inside arrayOf.");var ge=q[V];if(!Array.isArray(ge)){var se=P(ge);return new m("Invalid "+ne+" `"+ee+"` of type "+("`"+se+"` supplied to `"+N+"`, expected an array."))}for(var Se=0;Se<ge.length;Se++){var ye=F(ge,Se,N,ne,ee+"["+Se+"]",n);if(ye instanceof Error)return ye}return null}return p(U)}function C(){function F(U,q,V,N,ne){var ee=U[q];if(!a(ee)){var ge=P(ee);return new m("Invalid "+N+" `"+ne+"` of type "+("`"+ge+"` supplied to `"+V+"`, expected a single ReactElement."))}return null}return p(F)}function w(){function F(U,q,V,N,ne){var ee=U[q];if(!e.isValidElementType(ee)){var ge=P(ee);return new m("Invalid "+N+" `"+ne+"` of type "+("`"+ge+"` supplied to `"+V+"`, expected a single ReactElement type."))}return null}return p(F)}function k(F){function U(q,V,N,ne,ee){if(!(q[V]instanceof F)){var ge=F.name||f,se=W(q[V]);return new m("Invalid "+ne+" `"+ee+"` of type "+("`"+se+"` supplied to `"+N+"`, expected ")+("instance of `"+ge+"`."))}return null}return p(U)}function x(F){if(!Array.isArray(F))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),o;function U(q,V,N,ne,ee){for(var ge=q[V],se=0;se<F.length;se++)if(g(ge,F[se]))return null;var Se=JSON.stringify(F,function(Ue,le){var Ge=I(le);return Ge==="symbol"?String(le):le});return new m("Invalid "+ne+" `"+ee+"` of value `"+String(ge)+"` "+("supplied to `"+N+"`, expected one of "+Se+"."))}return p(U)}function _(F){function U(q,V,N,ne,ee){if(typeof F!="function")return new m("Property `"+ee+"` of component `"+N+"` has invalid PropType notation inside objectOf.");var ge=q[V],se=P(ge);if(se!=="object")return new m("Invalid "+ne+" `"+ee+"` of type "+("`"+se+"` supplied to `"+N+"`, expected an object."));for(var Se in ge)if(r(ge,Se)){var ye=F(ge,Se,N,ne,ee+"."+Se,n);if(ye instanceof Error)return ye}return null}return p(U)}function O(F){if(!Array.isArray(F))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var U=0;U<F.length;U++){var q=F[U];if(typeof q!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+G(q)+" at index "+U+"."),o}function V(N,ne,ee,ge,se){for(var Se=[],ye=0;ye<F.length;ye++){var Ue=F[ye],le=Ue(N,ne,ee,ge,se,n);if(le==null)return null;le.data&&r(le.data,"expectedType")&&Se.push(le.data.expectedType)}var Ge=Se.length>0?", expected one of type ["+Se.join(", ")+"]":"";return new m("Invalid "+ge+" `"+se+"` supplied to "+("`"+ee+"`"+Ge+"."))}return p(V)}function E(){function F(U,q,V,N,ne){return R(U[q])?null:new m("Invalid "+N+" `"+ne+"` supplied to "+("`"+V+"`, expected a ReactNode."))}return p(F)}function T(F,U,q,V,N){return new m((F||"React class")+": "+U+" type `"+q+"."+V+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+N+"`.")}function M(F){function U(q,V,N,ne,ee){var ge=q[V],se=P(ge);if(se!=="object")return new m("Invalid "+ne+" `"+ee+"` of type `"+se+"` "+("supplied to `"+N+"`, expected `object`."));for(var Se in F){var ye=F[Se];if(typeof ye!="function")return T(N,ne,ee,Se,I(ye));var Ue=ye(ge,Se,N,ne,ee+"."+Se,n);if(Ue)return Ue}return null}return p(U)}function B(F){function U(q,V,N,ne,ee){var ge=q[V],se=P(ge);if(se!=="object")return new m("Invalid "+ne+" `"+ee+"` of type `"+se+"` "+("supplied to `"+N+"`, expected `object`."));var Se=t({},q[V],F);for(var ye in Se){var Ue=F[ye];if(r(F,ye)&&typeof Ue!="function")return T(N,ne,ee,ye,I(Ue));if(!Ue)return new m("Invalid "+ne+" `"+ee+"` key `"+ye+"` supplied to `"+N+"`.\nBad object: "+JSON.stringify(q[V],null," ")+`
47
47
  Valid keys: `+JSON.stringify(Object.keys(F),null," "));var le=Ue(ge,ye,N,ne,ee+"."+ye,n);if(le)return le}return null}return p(U)}function R(F){switch(typeof F){case"number":case"string":case"undefined":return!0;case"boolean":return!F;case"object":if(Array.isArray(F))return F.every(R);if(F===null||a(F))return!0;var U=d(F);if(U){var q=U.call(F),V;if(U!==F.entries){for(;!(V=q.next()).done;)if(!R(V.value))return!1}else for(;!(V=q.next()).done;){var N=V.value;if(N&&!R(N[1]))return!1}}else return!1;return!0;default:return!1}}function j(F,U){return F==="symbol"?!0:U?U["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&U instanceof Symbol:!1}function P(F){var U=typeof F;return Array.isArray(F)?"array":F instanceof RegExp?"object":j(U,F)?"symbol":U}function I(F){if(typeof F=="undefined"||F===null)return""+F;var U=P(F);if(U==="object"){if(F instanceof Date)return"date";if(F instanceof RegExp)return"regexp"}return U}function G(F){var U=I(F);switch(U){case"array":case"object":return"an "+U;case"boolean":case"date":case"regexp":return"a "+U;default:return U}}function W(F){return!F.constructor||!F.constructor.name?f:F.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},Pc}var jc,ig;function W_(){if(ig)return jc;ig=1;var e=Nf();function t(){}function n(){}return n.resetWarningCache=t,jc=function(){function r(o,a,l,u,c,d){if(d!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},jc}var sg;function Q_(){if(sg)return dl.exports;if(sg=1,process.env.NODE_ENV!=="production"){var e=S2(),t=!0;dl.exports=V_()(e.isElement,t)}else dl.exports=W_()();return dl.exports}var Y_=Q_();const Nd=Sp(Y_);var Qa=function(t){var n=t.className,r=n===void 0?"":n;return y.jsx("hr",{className:ke("yst-my-6",r)})};Qa.propTypes={className:Nd.string};const _2=6048e5,X_=864e5,og=Symbol.for("constructDateFrom");function dn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&og in e?e[og](t):e instanceof Date?new e.constructor(t):new Date(t)}function Kt(e,t){return dn(t||e,e)}function k2(e,t,n){const r=Kt(e,n==null?void 0:n.in);if(isNaN(t))return dn(e,NaN);if(!t)return r;const i=r.getDate(),s=dn(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const o=s.getDate();return i>=o?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}let Z_={};function Ku(){return Z_}function fa(e,t){var a,l,u,c,d,f,h,g;const n=Ku(),r=(g=(h=(c=(u=t==null?void 0:t.weekStartsOn)!=null?u:(l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)!=null?c:n.weekStartsOn)!=null?h:(f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)!=null?g:0,i=Kt(e,t==null?void 0:t.in),s=i.getDay(),o=(s<r?7:0)+s-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function su(e,t){return fa(e,{...t,weekStartsOn:1})}function O2(e,t){const n=Kt(e,t==null?void 0:t.in),r=n.getFullYear(),i=dn(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=su(i),o=dn(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=su(o);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function ag(e){const t=Kt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Vu(e,...t){const n=dn.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function ou(e,t){const n=Kt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function J_(e,t,n){const[r,i]=Vu(n==null?void 0:n.in,e,t),s=ou(r),o=ou(i),a=+s-ag(s),l=+o-ag(o);return Math.round((a-l)/X_)}function e8(e,t){const n=O2(e,t),r=dn(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),su(r)}function t8(e){return dn(e,Date.now())}function n8(e,t,n){const[r,i]=Vu(n==null?void 0:n.in,e,t);return+ou(r)==+ou(i)}function r8(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function i8(e){return!(!r8(e)&&typeof e!="number"||isNaN(+Kt(e)))}function s8(e,t){const n=Kt(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function o8(e,t){const[n,r]=Vu(e,t.start,t.end);return{start:n,end:r}}function a8(e,t){const{start:n,end:r}=o8(t==null?void 0:t.in,e);let i=+n>+r;const s=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0);let a=1;const l=[];for(;+o<=s;)l.push(dn(n,o)),o.setDate(o.getDate()+a),o.setHours(0,0,0,0);return i?l.reverse():l}function l8(e,t){const n=Kt(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function u8(e,t){const n=Kt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const c8={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},d8=(e,t,n)=>{let r;const i=c8[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Mc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const f8={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},h8={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},g8={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},y8={date:Mc({formats:f8,defaultWidth:"full"}),time:Mc({formats:h8,defaultWidth:"full"}),dateTime:Mc({formats:g8,defaultWidth:"full"})},m8={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},p8=(e,t,n,r)=>m8[e];function wo(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):o;i=e.formattingValues[a]||e.formattingValues[o]}else{const o=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[o]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}const v8={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},b8={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},x8={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},w8={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},S8={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},C8={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},_8=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},k8={ordinalNumber:_8,era:wo({values:v8,defaultWidth:"wide"}),quarter:wo({values:b8,defaultWidth:"wide",argumentCallback:e=>e-1}),month:wo({values:x8,defaultWidth:"wide"}),day:wo({values:w8,defaultWidth:"wide"}),dayPeriod:wo({values:S8,defaultWidth:"wide",formattingValues:C8,defaultFormattingWidth:"wide"})};function So(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const o=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?E8(a,d=>d.test(o)):O8(a,d=>d.test(o));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(o.length);return{value:u,rest:c}}}function O8(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function E8(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function A8(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let o=e.valueCallback?e.valueCallback(s[0]):s[0];o=n.valueCallback?n.valueCallback(o):o;const a=t.slice(i.length);return{value:o,rest:a}}}const T8=/^(\d+)(th|st|nd|rd)?/i,P8=/\d+/i,j8={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},M8={any:[/^b/i,/^(a|c)/i]},$8={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},L8={any:[/1/i,/2/i,/3/i,/4/i]},D8={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},I8={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},R8={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},N8={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},F8={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},B8={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},q8={ordinalNumber:A8({matchPattern:T8,parsePattern:P8,valueCallback:e=>parseInt(e,10)}),era:So({matchPatterns:j8,defaultMatchWidth:"wide",parsePatterns:M8,defaultParseWidth:"any"}),quarter:So({matchPatterns:$8,defaultMatchWidth:"wide",parsePatterns:L8,defaultParseWidth:"any",valueCallback:e=>e+1}),month:So({matchPatterns:D8,defaultMatchWidth:"wide",parsePatterns:I8,defaultParseWidth:"any"}),day:So({matchPatterns:R8,defaultMatchWidth:"wide",parsePatterns:N8,defaultParseWidth:"any"}),dayPeriod:So({matchPatterns:F8,defaultMatchWidth:"any",parsePatterns:B8,defaultParseWidth:"any"})},z8={code:"en-US",formatDistance:d8,formatLong:y8,formatRelative:p8,localize:k8,match:q8,options:{weekStartsOn:0,firstWeekContainsDate:1}};function H8(e,t){const n=Kt(e,t==null?void 0:t.in);return J_(n,u8(n))+1}function U8(e,t){const n=Kt(e,t==null?void 0:t.in),r=+su(n)-+e8(n);return Math.round(r/_2)+1}function E2(e,t){var c,d,f,h,g,m,p,v;const n=Kt(e,t==null?void 0:t.in),r=n.getFullYear(),i=Ku(),s=(v=(p=(h=(f=t==null?void 0:t.firstWeekContainsDate)!=null?f:(d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)!=null?h:i.firstWeekContainsDate)!=null?p:(m=(g=i.locale)==null?void 0:g.options)==null?void 0:m.firstWeekContainsDate)!=null?v:1,o=dn((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,s),o.setHours(0,0,0,0);const a=fa(o,t),l=dn((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=fa(l,t);return+n>=+a?r+1:+n>=+u?r:r-1}function G8(e,t){var a,l,u,c,d,f,h,g;const n=Ku(),r=(g=(h=(c=(u=t==null?void 0:t.firstWeekContainsDate)!=null?u:(l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)!=null?c:n.firstWeekContainsDate)!=null?h:(f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)!=null?g:1,i=E2(e,t),s=dn((t==null?void 0:t.in)||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),fa(s,t)}function K8(e,t){const n=Kt(e,t==null?void 0:t.in),r=+fa(n,t)-+G8(n,t);return Math.round(r/_2)+1}function Ye(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const $r={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ye(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ye(n+1,2)},d(e,t){return Ye(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ye(e.getHours()%12||12,t.length)},H(e,t){return Ye(e.getHours(),t.length)},m(e,t){return Ye(e.getMinutes(),t.length)},s(e,t){return Ye(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Ye(i,t.length)}},ns={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},lg={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return $r.y(e,t)},Y:function(e,t,n,r){const i=E2(e,r),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return Ye(o,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Ye(s,t.length)},R:function(e,t){const n=O2(e);return Ye(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ye(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ye(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ye(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return $r.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Ye(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=K8(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Ye(i,t.length)},I:function(e,t,n){const r=U8(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ye(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):$r.d(e,t)},D:function(e,t,n){const r=H8(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ye(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Ye(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Ye(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Ye(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=ns.noon:r===0?i=ns.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=ns.evening:r>=12?i=ns.afternoon:r>=4?i=ns.morning:i=ns.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return $r.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):$r.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ye(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ye(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):$r.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):$r.s(e,t)},S:function(e,t){return $r.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return cg(r);case"XXXX":case"XX":return mi(r);case"XXXXX":case"XXX":default:return mi(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return cg(r);case"xxxx":case"xx":return mi(r);case"xxxxx":case"xxx":default:return mi(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ug(r,":");case"OOOO":default:return"GMT"+mi(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ug(r,":");case"zzzz":default:return"GMT"+mi(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Ye(r,t.length)},T:function(e,t,n){return Ye(+e,t.length)}};function ug(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+Ye(s,2)}function cg(e,t){return e%60===0?(e>0?"-":"+")+Ye(Math.abs(e)/60,2):mi(e,t)}function mi(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Ye(Math.trunc(r/60),2),s=Ye(r%60,2);return n+i+t+s}const dg=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},A2=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},V8=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return dg(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",dg(r,t)).replace("{{time}}",A2(i,t))},W8={p:A2,P:V8},Q8=/^D+$/,Y8=/^Y+$/,X8=["D","DD","YY","YYYY"];function Z8(e){return Q8.test(e)}function J8(e){return Y8.test(e)}function e7(e,t,n){const r=t7(e,t,n);if(console.warn(r),X8.includes(e))throw new RangeError(r)}function t7(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const n7=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,r7=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,i7=/^'([^]*?)'?$/,s7=/''/g,o7=/[a-zA-Z]/;function Io(e,t,n){var c,d,f,h,g,m,p,v,b;const r=Ku(),i=(c=r.locale)!=null?c:z8,s=(g=(h=r.firstWeekContainsDate)!=null?h:(f=(d=r.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)!=null?g:1,o=(b=(v=r.weekStartsOn)!=null?v:(p=(m=r.locale)==null?void 0:m.options)==null?void 0:p.weekStartsOn)!=null?b:0,a=Kt(e,n==null?void 0:n.in);if(!i8(a))throw new RangeError("Invalid time value");let l=t.match(r7).map(S=>{const C=S[0];if(C==="p"||C==="P"){const w=W8[C];return w(S,i.formatLong)}return S}).join("").match(n7).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const C=S[0];if(C==="'")return{isToken:!1,value:a7(S)};if(lg[C])return{isToken:!0,value:S};if(C.match(o7))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:S}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(S=>{if(!S.isToken)return S.value;const C=S.value;(J8(C)||Z8(C))&&e7(C,t,String(e));const w=lg[C[0]];return w(a,C,i.localize,u)}).join("")}function a7(e){const t=e.match(i7);return t?t[1].replace(s7,"'"):e}function fg(e,t,n){const[r,i]=Vu(n==null?void 0:n.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function l7(e,t){return n8(dn(e,e),t8(e))}function u7(e,t,n){return k2(e,-1,n)}function ha(e){"@babel/helpers - typeof";return ha=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ha(e)}function $c(e,t,n){return(t=c7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c7(e){var t=d7(e,"string");return ha(t)=="symbol"?t:t+""}function d7(e,t){if(ha(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ha(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hg(e,t){return y7(e)||g7(e,t)||h7(e,t)||f7()}function f7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
48
48
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h7(e,t){if(e){if(typeof e=="string")return gg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gg(e,t):void 0}}function gg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function g7(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function y7(e){if(Array.isArray(e))return e}var Hn={selected:{background:"yst-bg-primary-500",text:"yst-text-white",hover:"hover:yst-bg-primary-600"},hasAnalysis:{border:"yst-border-2 yst-border-primary-500",text:"yst-text-slate-900",hover:"hover:yst-bg-primary-50"},today:{underline:"yst-border-b-2 yst-border-slate-400"},indicator:{default:"yst-bg-blue-500"}},m7=function(t){var n=t.analyses,r=t.selectedAnalysisId,i=t.onAnalysisSelect,s=t.isLoading,o=s===void 0?!1:s,a=t.isOpen,l=a===void 0?!1:a,u=t.onClose,c=z.useState(new Date),d=hg(c,2),f=d[0],h=d[1],g=function(_){if(!_)return null;var O=_.slice(0,10),E=O.split("-"),T=hg(E,3),M=T[0],B=T[1],R=T[2],j=Number(M),P=Number(B),I=Number(R);return Number.isNaN(j)||Number.isNaN(P)||Number.isNaN(I)||P<1||P>12||I<1||I>31?null:new Date(j,P-1,I)},m=z.useMemo(function(){var x=new Map;return n.forEach(function(_){var O=g(_.createdAt),E=O?Io(O,"yyyy-MM-dd"):"";E&&(x.has(E)||x.set(E,[]),x.get(E).push(_))}),x},[n]);z.useEffect(function(){if(l&&r){var x=n.find(function(T){return T.id===r});if(x){var _=g(x.createdAt);_&&h(_)}}else if(l&&n.length>0){var O=n.reduce(function(T,M){return new Date(M.createdAt)>new Date(T.createdAt)?M:T}),E=g(O.createdAt);E&&h(E)}},[l,r,n]);var p=z.useMemo(function(){return n.length===0?null:n.reduce(function(x,_){return new Date(_.createdAt)>new Date(x.createdAt)?_:x})},[n]),v=function(){if(p){var _=g(p.createdAt);_&&h(_)}},b=z.useMemo(function(){if(!p)return!1;var x=g(p.createdAt);return x?fg(x,f):!1},[p,f]),S=z.useMemo(function(){var x=l8(f),_=s8(f),O=new Date(x),E=O.getDay(),T=E===0?6:E-1;O.setDate(O.getDate()-T);var M=new Date(_),B=M.getDay(),R=B===0?0:7-B;return M.setDate(M.getDate()+R),a8({start:O,end:M}).map(function(j){var P=Io(j,"yyyy-MM-dd"),I=m.get(P)||[],G=I.find(function(W){return String(W.id)===String(r)});return{date:P,dateObj:j,isCurrentMonth:fg(j,f),isToday:l7(j),isSelected:!!G,hasAnalyses:I.length>0,analyses:I}})},[f,m,r]),C=function(){h(function(_){return u7(_)})},w=function(){h(function(_){return k2(_,1)})},k=function(_){if(_.hasAnalyses){if(_.analyses.length===1)i(_.analyses[0].id);else{var O=_.analyses.reduce(function(E,T){return new Date(T.createdAt)>new Date(E.createdAt)?T:E});i(O.id)}u==null||u()}};return l?o?y.jsx("div",{className:"yst-absolute yst-left-0 yst-right-0 yst-top-full yst-z-50 yst-mt-1 yst-rounded-md yst-border yst-border-slate-200 yst-bg-white yst-p-4 yst-shadow-lg",children:y.jsxs("div",{className:"yst-animate-pulse yst-space-y-4",children:[y.jsx("div",{className:"yst-h-6 yst-rounded yst-bg-slate-200"}),y.jsx("div",{className:"yst-h-48 yst-rounded yst-bg-slate-200"})]})}):y.jsxs("div",{className:"yst-absolute yst-left-0 yst-right-0 yst-top-full yst-z-50 yst-mt-1 yst-min-w-80 yst-max-w-sm yst-rounded-md yst-border yst-border-slate-200 yst-bg-white yst-p-4 yst-shadow-lg",children:[y.jsxs("div",{className:"yst-mb-6 yst-flex yst-items-center yst-justify-between",children:[y.jsxs("button",{type:"button",onClick:C,className:"yst-rounded-md yst-p-1.5 yst-text-slate-400 hover:yst-bg-slate-100 hover:yst-text-slate-500",children:[y.jsx("span",{className:"yst-sr-only",children:"Previous month"}),y.jsx(H4,{className:"yst-h-5 yst-w-5"})]}),y.jsx("h2",{className:"yst-text-sm yst-font-semibold yst-text-slate-900",children:Io(f,"MMMM yyyy")}),y.jsxs("button",{type:"button",onClick:w,className:"yst-rounded-md yst-p-1.5 yst-text-slate-400 hover:yst-bg-slate-100 hover:yst-text-slate-500",children:[y.jsx("span",{className:"yst-sr-only",children:"Next month"}),y.jsx(G4,{className:"yst-h-5 yst-w-5"})]})]}),y.jsx("div",{className:"yst-mb-0 yst-grid yst-grid-cols-7 yst-gap-x-1",children:["M","T","W","T","F","S","S"].map(function(x,_){return y.jsx("div",{className:"yst-py-2 yst-text-center yst-text-xs yst-font-medium yst-text-slate-500",children:x},"".concat(x,"-").concat(_))})}),y.jsx("div",{className:"yst-grid yst-grid-cols-7 yst-gap-x-1",children:S.map(function(x){return y.jsx("div",{className:"yst-flex yst-items-center yst-justify-center yst-py-1",children:y.jsxs("button",{type:"button",onClick:function(){return k(x)},disabled:!x.hasAnalyses,className:ke("yst-relative yst-rounded-full yst-text-sm yst-transition-colors","yst-flex yst-h-10 yst-w-10 yst-items-center yst-justify-center","yst-p-0",{"yst-text-slate-900":x.isCurrentMonth,"yst-text-slate-400":!x.isCurrentMonth},{"focus:yst-outline-none focus:yst-ring-2 focus:yst-ring-blue-500":x.hasAnalyses,"yst-cursor-not-allowed":!x.hasAnalyses,"yst-cursor-pointer":x.hasAnalyses},$c({},"".concat(Hn.selected.background," ").concat(Hn.selected.text," ").concat(Hn.selected.hover),x.isSelected),$c({},"".concat(Hn.hasAnalysis.border," ").concat(Hn.hasAnalysis.text," ").concat(Hn.hasAnalysis.hover),x.hasAnalyses&&!x.isSelected)),children:[y.jsx("span",{className:ke("yst-relative yst-z-10 yst-w-4",$c({},Hn.today.underline,x.isToday&&!x.isSelected)),children:Io(x.dateObj,"d")}),x.hasAnalyses&&x.analyses.length>1&&!x.isSelected&&y.jsx("span",{className:ke("yst-absolute yst-right-1 yst-top-1 yst-h-2 yst-w-2 yst-rounded-full",Hn.indicator.default)})]})},x.date)})}),y.jsxs("div",{className:"yst-mt-4 yst-flex yst-items-center yst-gap-4 yst-text-xs yst-text-slate-600",children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-1",children:[y.jsx("div",{className:"yst-h-3 yst-w-3 yst-rounded-full ".concat(Hn.hasAnalysis.border)}),y.jsx("span",{children:"Has analysis"})]}),y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-1",children:[y.jsx("div",{className:"yst-h-3 yst-w-3 yst-rounded-full ".concat(Hn.selected.background)}),y.jsx("span",{children:"Selected"})]}),y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-1",children:[y.jsx("div",{className:"yst-h-0.5 yst-w-4 yst-bg-slate-400"}),y.jsx("span",{children:"Today"})]})]}),p&&y.jsx("div",{className:"yst-mt-6",children:y.jsx(A.Button,{onClick:v,className:"yst-w-full",disabled:b,children:"Show latest analysis"})})]}):null};function Lc(e,t){return x7(e)||b7(e,t)||v7(e,t)||p7()}function p7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
49
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v7(e,t){if(e){if(typeof e=="string")return yg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yg(e,t):void 0}}function yg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function b7(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function x7(e){if(Array.isArray(e))return e}var w7=function(t){var n=t.analyses,r=t.selectedAnalysisId,i=t.onAnalysisSelect,s=t.isLoading,o=s===void 0?!1:s,a=t.disabled,l=a===void 0?!1:a,u=t.id,c=u===void 0?"analysis-date-select":u,d=z.useState(!1),f=Lc(d,2),h=f[0],g=f[1],m=z.useState("latest"),p=Lc(m,2),v=p[0],b=p[1],S=z.useRef(null),C=function(j){if(!j)return null;var P=j.slice(0,10),I=P.split("-"),G=Lc(I,3),W=G[0],F=G[1],U=G[2],q=Number(W),V=Number(F),N=Number(U);return Number.isNaN(q)||Number.isNaN(V)||Number.isNaN(N)||V<1||V>12||N<1||N>31?null:new Date(q,V-1,N)},w=function(j){var P=C(j.createdAt);return P?P.getTime():-1/0};z.useEffect(function(){if((r==="latest"||!r)&&n.length>0&&!o){var R=n.reduce(function(j,P){return w(P)>w(j)?P:j});i(R.id)}},[n,r,i,o]);var k=z.useMemo(function(){if(r==="latest"||!r){if(n.length>0){var R=n.reduce(function(j,P){return w(P)>w(j)?P:j});return R.id}return"latest"}return r},[r,n,w]);z.useEffect(function(){b(k)},[k]);var x=n.find(function(R){return String(R.id)===String(v)}),_=n.length>0?String(n.reduce(function(R,j){return w(j)>w(R)?j:R}).id):"",O=function(){if(x){var R=C(x.createdAt),j=R?Io(R,"MMMM d, yyyy"):x.createdAt?x.createdAt.slice(0,10):"Unknown date",P=String(x.id)===_?"(latest)":"(older)";return"".concat(j," ").concat(P)}return n.length>0?"Select date...":"No analyses available"}();z.useEffect(function(){var R=function(P){S.current&&!S.current.contains(P.target)&&g(!1)};return h&&document.addEventListener("mousedown",R),function(){document.removeEventListener("mousedown",R)}},[h]);var E=function(){!l&&!o&&g(!h)},T=function(j){b(j),i(j),g(!1)},M=function(){g(!1)},B=function(j){j.key==="Enter"||j.key===" "?(j.preventDefault(),E()):j.key==="Escape"&&g(!1)};return y.jsxs("div",{ref:S,className:"yst-relative",children:[y.jsxs("div",{className:"yst-relative",children:[y.jsx(A.TextInput,{id:c,onClick:E,onKeyDown:B,onChange:function(){},disabled:l||o,value:O,"aria-expanded":h,"aria-haspopup":"true","aria-label":"Select analysis date",className:ke("yst-pr-10",{"yst-cursor-default":!l&&!o})}),y.jsx(F4,{className:ke("yst-pointer-events-none yst-absolute yst-right-3 yst-top-1/2 yst--translate-y-1/2 yst-transform",{"yst-text-gray-400":l||o})})]}),y.jsx(m7,{analyses:n,selectedAnalysisId:v,onAnalysisSelect:T,isLoading:o,isOpen:h,onClose:M})]})};function T2(e){if(e!=null){if(typeof e=="number"){var t=1e12;return e>t?e-Date.now():e}var n=Date.parse(e);if(!Number.isNaN(n))return n-Date.now()}}function S7(e,t){var n=T2(e);return n!==void 0&&n>t*60*1e3}var C7=2;function P2(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:C7,n=T2(e);return n!==void 0&&n<=t*60*1e3}function Fd(e){if(e==null)return"a future date";var t;if(typeof e=="number"){var n=1e12;e>n?t=e:t=Date.now()+e}else{var r=Date.parse(e);Number.isNaN(r)||(t=r)}if(t===void 0)return"a future date";var i=new Date(t),s={month:"long",day:"numeric",hour:"numeric",minute:"2-digit",hour12:!0},o=i.toLocaleDateString("en-US",s),a=o.split(" ");if(a.length>=4){var l=a[0],u=a[1].replace(",",""),c=a.slice(2).join(" ");return"".concat(l," ").concat(u," at ").concat(c)}return"".concat(o)}var mg;function pg(e,t){return E7(e)||O7(e,t)||k7(e,t)||_7()}function _7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
49
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v7(e,t){if(e){if(typeof e=="string")return yg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yg(e,t):void 0}}function yg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function b7(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function x7(e){if(Array.isArray(e))return e}var w7=function(t){var n=t.analyses,r=t.selectedAnalysisId,i=t.onAnalysisSelect,s=t.isLoading,o=s===void 0?!1:s,a=t.disabled,l=a===void 0?!1:a,u=t.id,c=u===void 0?"analysis-date-select":u,d=z.useState(!1),f=Lc(d,2),h=f[0],g=f[1],m=z.useState("latest"),p=Lc(m,2),v=p[0],b=p[1],S=z.useRef(null),C=function(j){if(!j)return null;var P=j.slice(0,10),I=P.split("-"),G=Lc(I,3),W=G[0],F=G[1],U=G[2],q=Number(W),V=Number(F),N=Number(U);return Number.isNaN(q)||Number.isNaN(V)||Number.isNaN(N)||V<1||V>12||N<1||N>31?null:new Date(q,V-1,N)},w=function(j){var P=C(j.createdAt);return P?P.getTime():-1/0};z.useEffect(function(){if((r==="latest"||!r)&&n.length>0&&!o){var R=n.reduce(function(j,P){return w(P)>w(j)?P:j});i(R.id)}},[n,r,i,o]);var k=z.useMemo(function(){if(r==="latest"||!r){if(n.length>0){var R=n.reduce(function(j,P){return w(P)>w(j)?P:j});return R.id}return"latest"}return r},[r,n,w]);z.useEffect(function(){b(k)},[k]);var x=n.find(function(R){return String(R.id)===String(v)}),_=n.length>0?String(n.reduce(function(R,j){return w(j)>w(R)?j:R}).id):"",O=function(){if(x){var R=C(x.createdAt),j=R?Io(R,"MMMM d, yyyy"):x.createdAt?x.createdAt.slice(0,10):"Unknown date",P=String(x.id)===_?"(latest)":"(older)";return"".concat(j," ").concat(P)}return n.length>0?"Select date...":"No analyses available"}();z.useEffect(function(){var R=function(P){S.current&&!S.current.contains(P.target)&&g(!1)};return h&&document.addEventListener("mousedown",R),function(){document.removeEventListener("mousedown",R)}},[h]);var E=function(){!l&&!o&&g(!h)},T=function(j){b(j),i(j),g(!1)},M=function(){g(!1)},B=function(j){j.key==="Enter"||j.key===" "?(j.preventDefault(),E()):j.key==="Escape"&&g(!1)};return y.jsxs("div",{ref:S,className:"yst-relative",children:[y.jsxs("div",{className:"yst-relative",children:[y.jsx(A.TextInput,{id:c,onClick:E,onKeyDown:B,onChange:function(){},disabled:l||o,value:O,"aria-expanded":h,"aria-haspopup":"true","aria-label":"Select analysis date",className:ke("yst-pr-10",{"yst-cursor-default":!l&&!o})}),y.jsx(F4,{className:ke("yst-pointer-events-none yst-absolute yst-right-3 yst-top-1/2 yst--translate-y-1/2 yst-transform",{"yst-text-gray-400":l||o})})]}),y.jsx(m7,{analyses:n,selectedAnalysisId:v,onAnalysisSelect:T,isLoading:o,isOpen:h,onClose:M})]})};function T2(e){if(e!=null){if(typeof e=="number"){var t=1e12;return e>t?e-Date.now():e}var n=Date.parse(e);if(!Number.isNaN(n))return n-Date.now()}}function S7(e,t){var n=T2(e);return n!==void 0&&n>t*60*1e3}var C7=2;function P2(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:C7,n=T2(e);return n!==void 0&&n<=t*60*1e3}function Fd(e){if(e==null)return"a future date";var t;if(typeof e=="number"){var n=1e12;e>n?t=e:t=Date.now()+e}else{var r=Date.parse(e);Number.isNaN(r)||(t=r)}if(t===void 0)return"a future date";var i=new Date(t),s={month:"long",day:"numeric"},o={hour:"numeric",minute:"2-digit",hour12:!0},a=i.toLocaleDateString("en-US",s),l=i.toLocaleTimeString("en-US",o);return"".concat(a," at ").concat(l)}var mg;function pg(e,t){return E7(e)||O7(e,t)||k7(e,t)||_7()}function _7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
50
50
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function k7(e,t){if(e){if(typeof e=="string")return vg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vg(e,t):void 0}}function vg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function O7(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function E7(e){if(Array.isArray(e))return e}function Bd(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Xt(b,"_invoke",function(S,C,w){var k,x,_,O=0,E=w||[],T=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(j,P){return k=j,x=0,_=e,M.n=P,o}};function B(R,j){for(x=R,_=j,t=0;!T&&O&&!P&&t<E.length;t++){var P,I=E[t],G=M.p,W=I[2];R>3?(P=W===j)&&(_=I[(x=I[4])?5:(x=3,3)],I[4]=I[5]=e):I[0]<=G&&((P=R<2&&G<I[1])?(x=0,M.v=j,M.n=I[1]):G<W&&(P=R<3||I[0]>j||j>W)&&(I[4]=R,I[5]=j,M.n=W,x=0))}if(P||R>1)return o;throw T=!0,j}return function(R,j,P){if(O>1)throw TypeError("Generator is already running");for(T&&j===1&&B(j,P),x=j,_=P;(t=x<2?e:_)||!T;){k||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(O=2,k){if(x||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=k.return)&&t.call(k),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);k=e}else if((t=(T=M.n<0)?_:S.call(C,M))!==o)break}catch(I){k=e,x=1,_=I}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Xt(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,Xt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,Xt(d,"constructor",u),Xt(u,"constructor",l),l.displayName="GeneratorFunction",Xt(u,i,"GeneratorFunction"),Xt(d),Xt(d,i,"Generator"),Xt(d,r,function(){return this}),Xt(d,"toString",function(){return"[object Generator]"}),(Bd=function(){return{w:s,m:f}})()}function Xt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Xt=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){Xt(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},Xt(e,t,n,r)}function bg(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function A7(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){bg(s,r,i,o,a,"next",l)}function a(l){bg(s,r,i,o,a,"throw",l)}o(void 0)})}}function T7(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Dc=Wa(mg||(mg=T7(["yst-flex-1 yst-space-y-2"]))),P7=function(t){var n,r,i,s,o=t.className,a=Fn(),l=a.brandId,u=a.analysisId,c=a.model,d=Ga(),f=d.setModel,h=d.setAnalysisId,g=Gt(),m=fn(),p=li(),v=p.data,b=zu({query:{select:function(Fe){var ze=Fe.data;return ze==null?void 0:ze.data}}}),S=b.data,C=b.isLoading,w=S==null?void 0:S.displayName,k=Yi({query:{select:function(Fe){var ze=Fe.data;return ze==null?void 0:ze.brands}}}),x=k.data,_=k.isLoading,O=a2(l,{query:{enabled:!!l,select:function(Fe){var ze=Fe.data;return ze==null?void 0:ze.analyses}}}),E=O.data,T=O.isLoading,M=Fu(l,u,{query:{enabled:!!l&&!!u,select:function(Fe){var ze=Fe.data;return ze}}}),B=M.data,R=M.isLoading,j=iu(l,{query:{enabled:!!l,select:function(Fe){var ze=Fe.data;return ze}}}),P=j.data,I=j.isLoading,G=H5({mutation:{onSuccess:function(){var we=A7(Bd().m(function ze(){var Pn,Vt;return Bd().w(function(hn){for(;;)switch(hn.n){case 0:return hn.n=1,Promise.all([g.invalidateQueries({queryKey:Lf(l)}),g.invalidateQueries({queryKey:Jn(l,u)}),g.invalidateQueries({queryKey:Bu(l)})]);case 1:Pn=(E==null?void 0:E.filter(function(Bn){return String(Bn.id)!==String(u)}))||[],Pn.length>0?(Vt=Pn.reduce(function(Bn,sr){var Ji=Bn.createdAt?new Date(Bn.createdAt).getTime():0,Mr=sr.createdAt?new Date(sr.createdAt).getTime():0;return Mr>Ji?sr:Bn}),h(Vt.id),m("/brands/".concat(l,"/analysis/").concat(Vt.id))):(h("latest"),m("/brands/".concat(l))),N(!1);case 2:return hn.a(2)}},ze)}));function Fe(){return we.apply(this,arguments)}return Fe}()}}),W=G.mutate,F=G.isPending;z.useEffect(function(){!I&&!R&&l&&x&&(x==null?void 0:x.length)<2&&(!(P!=null&&P.queries)||Array.isArray(P==null?void 0:P.queries)&&P.queries.length===0)&&(E==null?void 0:E.length)===0&&m("/setup/".concat(l,"/queries"))},[I,R,P,l,m,x,E==null?void 0:E.length]);var U=z.useState(!1),q=pg(U,2),V=q[0],N=q[1],ne=function(){N(!1)},ee=x==null?void 0:x.find(function(we){return String(we.id)===String(l)}),ge=B==null||(n=B.analysis)===null||n===void 0?void 0:n.id,se=l!=null&&typeof ge=="number"&&!isNaN(ge),Se=z.useState(!1),ye=pg(Se,2),Ue=ye[0],le=ye[1];z.useEffect(function(){if(se){var we="yst_legal_alert_dismissed_".concat(l,"_").concat(ge);le(window.localStorage.getItem(we)===null)}},[l,ge,se]);var Ge=function(Fe){if(Fe.preventDefault(),!!se){var ze="yst_legal_alert_dismissed_".concat(l,"_").concat(ge);window.localStorage.setItem(ze,"true"),le(!1)}},ut=function(Fe){switch(Fe){case"openai":return"OpenAI";case"perplexity":return"Perplexity";case"anthropic":return"Anthropic";default:return Fe||"Unknown"}},ft=(B==null||(r=B.analysis)===null||r===void 0||(r=r.scans)===null||r===void 0?void 0:r.map(function(we){return{value:we.aiProvider,label:ut(we.aiProvider)}}))||[{value:"",label:"Default model"}],Be=E!=null&&E.some(function(we){return String(we.id)===String(u)})?u:E&&E.length>0?E[0].id:"latest",qe=iu(l,{query:{enabled:!!l,select:function(Fe){var ze=Fe.data;return ze}}}),J=qe.data,Te=(J==null?void 0:J.name)||"your brand",nt=Fd(J==null?void 0:J.nextScheduledAnalysis),$e=B==null||(i=B.analysis)===null||i===void 0?void 0:i.status,je=function(){var we=y.jsxs("div",{className:"yst-max-w-xl yst-space-y-2",children:[y.jsx("p",{className:"yst-font-medium",children:"Your analysis is scheduled"}),y.jsxs("p",{children:["You've completed the setup for"," ",y.jsx("b",{className:"yst-font-medium",children:Te}),". The analysis is scheduled to run on"," ",y.jsx("b",{className:"yst-font-medium",children:nt}),". You'll see the results here once it's ready. We'll also notify you by email."]})]});if($e===void 0&&(P==null?void 0:P.setupStatus)==="scheduledFirstAnalysis")return{alertContent:we,alertVariant:"info"};switch($e){case yi.pending:return{alertContent:we,alertVariant:"info"};case yi.processing:return{alertContent:y.jsxs(y.Fragment,{children:["You've completed the setup for ",Te,". The analysis is now processing. You'll see the results here once it's ready. We'll also notify you by email."]}),alertVariant:"info"};case yi.failed:return{alertContent:y.jsx(y.Fragment,{children:"Analysis failed. Try restarting the analysis or contact support if the issue persists."}),alertVariant:"danger"};case yi.cancelled:return{alertContent:y.jsx(y.Fragment,{children:"Analysis was cancelled. You can restart the analysis when ready."}),alertVariant:"warning"};case yi.completed:return{alertContent:null};default:return{alertContent:null,alertVariant:"info"}}}(),X=je.alertContent,Z=je.alertVariant,re=!T&&(P==null?void 0:P.setupStatus)!=="pendingQuerySelection"&&(E==null?void 0:E.length)===0&&(P==null?void 0:P.nextScheduledAnalysis)===null,fe=v&&["updating","completed"].includes(v.status)&&!v.isUpToDateWithBrandGroups,Re=(v==null?void 0:v.status)===D6.updating&&fe===!0;return y.jsxs(y.Fragment,{children:[y.jsx(Gu,{isOpen:V,onClose:ne,onConfirm:function(){l&&u&&W({brandId:l,analysisId:u})},isLoading:F,title:"Delete analysis?",description:y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"This will permanently delete all data associated with this analysis."}),y.jsx("p",{children:"This action cannot be undone."})]}),confirmText:"Yes, delete analysis",cancelText:"No, go back"}),y.jsx(A.Card,{className:ke("yst-relative yst-overflow-visible",o),children:y.jsxs(A.Card.Content,{className:"yst-mt-0",children:[y.jsxs("div",{className:"yst-flex yst-flex-1 yst-flex-col yst-flex-wrap yst-items-start yst-justify-between yst-gap-4 md:yst-flex-row xl:yst-items-center",children:[y.jsx("div",{className:"xl:yst-max-w-1/4",children:y.jsxs("div",{className:"yst-flex yst-flex-col xl:yst-flex-row xl:yst-items-baseline xl:yst-gap-2",children:[y.jsx(A.Title,{children:y.jsxs(y.Fragment,{children:[C?y.jsx(A.SkeletonLoader,{className:"yst-inline-block yst-h-8 yst-w-64"}):y.jsxs(y.Fragment,{children:["Hi",w&&" ".concat(w),","]})," "]})}),y.jsx("p",{className:"yst-text-sm yst-font-normal yst-text-slate-600",children:"welcome to your brand analysis!"})]})}),y.jsxs("div",{className:"yst-flex yst-flex-row yst-flex-wrap yst-items-center yst-justify-end yst-gap-4 yst-self-end md:yst-self-start",children:[y.jsxs(A.Button,{variant:"primary",className:"yst-gap-1.5",onClick:function(){return m("/setup")},disabled:T||_,children:[y.jsx(g2,{})," Analyze a different brand"]}),y.jsx("div",{className:"yst-relative",children:y.jsxs(A.DropdownMenu,{children:[y.jsx(A.DropdownMenu.IconTrigger,{screenReaderTriggerLabel:"Open brand list options",disabled:T||_||x&&(x==null?void 0:x.length)<1,children:y.jsx(X4,{})}),y.jsx(A.DropdownMenu.List,{className:"yst-absolute yst-right-0 yst-top-full yst-z-40 yst-mt-2 yst-flex yst-w-64 yst-flex-col yst-justify-start",children:y.jsxs(A.DropdownMenu.ButtonItem,{onClick:function(){return N(!0)},disabled:T||_||(B==null||(s=B.analysis)===null||s===void 0?void 0:s.status)!=="completed"||!E||E.length===0,className:"yst-flex yst-justify-start yst-gap-1.5 yst-text-red-600 hover:yst-bg-red-50",children:[y.jsx(Df,{className:"yst-h-4 yst-w-4"}),"Delete analysis"]})})]})})]})]}),y.jsx(Qa,{}),y.jsxs("form",{className:"yst-flex yst-flex-col yst-items-stretch yst-gap-4 md:yst-flex-row md:yst-items-center",children:[y.jsxs(Dc,{children:[y.jsx(A.Label,{htmlFor:"brand-name",children:"Brand"}),y.jsx(A.Select,{onChange:function(we){m("/brands/".concat(we.toString()))},id:"brand-name",value:l?Number(l):"loading",options:x&&x.length>0?x.map(function(we){return{value:we.id,label:we.name}}):[{value:"loading",label:"Loading..."}],disabled:_||!x||x.length<2||!l})]}),y.jsxs(Dc,{children:[y.jsx(A.Label,{htmlFor:"analysis-date",children:"Analysis date"}),y.jsx(w7,{analyses:E||[],selectedAnalysisId:Be,onAnalysisSelect:function(we){m("/brands/".concat(l,"/analysis/").concat(String(we)))},isLoading:T,disabled:T||!E||E.length<1,id:"analysis-date"})]}),y.jsxs(Dc,{children:[y.jsx(A.Label,{htmlFor:"ai-tool",children:"AI model"}),y.jsx(A.Select,{onChange:function(we){Object.values(L6).includes(we)?f(we):console.error("Invalid AI provider selected:",we)},id:"ai-tool",value:c,options:R||T?[{value:c,label:"Loading..."}]:ft,disabled:R||T||[{}].length<2})]})]})]})}),y.jsxs("div",{className:"ystaii-alerts yst-space-y-4",children:[se&&Ue&&y.jsx(A.Alert,{children:y.jsxs("div",{className:"yst-flex yst-w-full",children:[y.jsx("div",{className:"yst-max-w-xl yst-space-y-4",children:y.jsx("p",{className:"yst-mb-0",children:"Note: This content was generated by an AI model (see dropdown above) and may contain errors. Please review before acting on it."})}),y.jsx("div",{className:"yst-ml-auto",children:y.jsx(A.Link,{onClick:Ge,variant:"default",children:y.jsx(b2,{})})})]})}),$e!==yi.completed&&X&&y.jsx(A.Alert,{className:"md:yst-col-span-2",variant:Z,children:X}),fe&&y.jsxs(A.Alert,{variant:"warning",children:["Note: This scan is not up to date with your current brand groups.",Re?y.jsxs(y.Fragment,{children:[" ","We're updating your sentiment analysis to reflect your new brand groups. This may take a few minutes."]}):y.jsx(y.Fragment,{children:" Newer scans will use your newly selected brand groupings."})]})]}),re&&y.jsx(A.Alert,{variant:"info",className:"yst-mb-6",children:y.jsx("div",{className:"yst-flex yst-items-start yst-gap-3",children:y.jsxs("div",{className:"yst-flex-1",children:[y.jsx("h3",{className:"yst-mb-2 yst-font-medium yst-text-blue-800",children:"No analyses scheduled"}),y.jsxs("p",{className:"yst-text-bluer-700 yst-mb-0",children:[y.jsx("span",{className:"yst-font-medium yst-text-blue-900",children:ee==null?void 0:ee.name})," ","has not been analyzed yet, and no analyses are scheduled because this brand is set to inactive in your"," ",y.jsx("span",{className:"yst-cursor-pointer yst-font-medium yst-text-blue-900 yst-underline",onClick:function(){return m("/settings")},role:"button",tabIndex:0,onKeyPress:function(we){(we.key==="Enter"||we.key===" ")&&m("/settings")},children:"Settings"}),"."]})]})})}),ee&&y.jsx(z_,{brand:ee},ee.id)]})},j7=function(){var t,n,r,i=li(),s=i.data,o=i.isLoading,a=i.isRefetching,l=s==null?void 0:s.mentions;return y.jsx(A.Card,{className:"yst-overflow-visible",children:y.jsxs(A.Card.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(Va,{title:"Mentions",tooltip:"The queries where your brand was mentioned."}),y.jsx(Ka,{score:l==null||(t=l.mentionedInNumberOfQueries)===null||t===void 0?void 0:t.value,total:l==null||(n=l.queriesWithMentions)===null||n===void 0?void 0:n.length,suffix:"queries",isLoading:o||a})]}),!o&&l?y.jsx("ul",{children:l==null||(r=l.queriesWithMentions)===null||r===void 0?void 0:r.map(function(u,c){var d=c===0,f=l.queriesWithMentions&&c===l.queriesWithMentions.length-1;return y.jsxs("li",{className:ke("yst-flex yst-flex-row yst-items-center yst-gap-2 yst-border-l yst-border-r yst-border-slate-300 yst-p-4 yst-font-medium yst-text-slate-800",{"yst-rounded-t-lg yst-border-t":d,"yst-rounded-b-lg yst-border-b":f,"yst-border-b":!f}),children:[y.jsx("div",{className:"yst-h-4 yst-w-4",children:u!=null&&u.mentioned?y.jsx(q4,{className:"yst-text-green-500"}):y.jsx(d6,{className:"yst-text-red-500"})}),y.jsx("span",{className:"yst-justify-start",children:u.query}),y.jsx("span",{className:"yst-ml-auto yst-flex yst-items-end",children:u!=null&&u.mentioned?y.jsx(A.Badge,{className:"yst-bg-green-100 yst-text-green-800",children:"Found"}):y.jsx(A.Badge,{className:"yst-bg-red-100 yst-text-red-800",children:"Not found"})})]},u.query)})}):y.jsx(A.SkeletonLoader,{className:"yst-h-56 yst-w-full"})]})})};/*!
51
51
  * @kurkle/color v0.3.4
52
52
  * https://github.com/kurkle/color#readme