@yoast/ai-insights-client 1.4.23 → 1.4.24

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.
@@ -1287,7 +1287,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1287
1287
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ER(e,t){if(e){if(typeof e=="string")return Sp(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)?Sp(e,t):void 0}}function Sp(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 AR(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,c=!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(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function PR(e){if(Array.isArray(e))return e}var TR=function(t){var n=t.isOpen,r=t.onClose,i=Kt(),s=q.useState(""),o=kR(s,2),a=o[0],l=o[1],c=cO({mutation:{onSuccess:function(){i.clear(),r()}}}),u=c.mutate,d=c.isPending;return q.useEffect(function(){n&&l("")},[n]),y.jsx(Mc,{isOpen:n,onClose:r,onConfirm:function(){u()},isLoading:d,disabled:a!=="DELETE ALL",title:"Delete all data?",description:y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"This will permanently erase all brands, analysis results, and queries from your account."}),y.jsx("p",{children:"This action cannot be undone."}),y.jsx(A.TextField,{id:"delete-all-confirmation",label:"To confirm, please type DELETE ALL:",value:a,onChange:function(f){return l(f.target.value)}}),y.jsx("p",{children:y.jsx("em",{children:"This is to make sure you understand this action is permanent."})})]}),confirmText:"Yes, delete all data",cancelText:"No, go back"})};function jR(e,t){return IR(e)||DR(e,t)||$R(e,t)||MR()}function MR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1288
1288
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $R(e,t){if(e){if(typeof e=="string")return Cp(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)?Cp(e,t):void 0}}function Cp(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 DR(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,c=!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(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function IR(e){if(Array.isArray(e))return e}var LR=function(t){var n=t.isOpen,r=t.brandId,i=t.onClose,s=t.brandName,o=Kt(),a=q.useState(""),l=jR(a,2),c=l[0],u=l[1],d=Kk({mutation:{onSuccess:function(){o.invalidateQueries({queryKey:sr()}),console.log("Brand data deleted"),i()}}}),f=d.mutate,h=d.isPending;return q.useEffect(function(){n&&u("")},[n]),y.jsx(Mc,{isOpen:n,onClose:i,onConfirm:function(){if(!s){console.error("Brand name is required for deletion confirmation");return}f({brandId:r})},isLoading:h,disabled:c.toLowerCase()!==(s==null?void 0:s.toLowerCase()),title:"Delete brand?",description:y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"This will permanently delete all data associated with this brand, including past analyses and query history."}),y.jsx("p",{children:"This action cannot be undone."}),y.jsx(A.TextField,{id:"delete-modal-brand-name-confirmation",label:"To confirm, please type your brand name ".concat(s,":"),value:c,onChange:function(g){return u(g.target.value)}}),y.jsx("p",{children:y.jsx("em",{children:"This is to make sure you understand this action is permanent."})})]}),confirmText:"Yes, delete brand",cancelText:"No, go back"})};function ya(e){"@babel/helpers - typeof";return ya=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},ya(e)}function $o(){/*! 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 Zt(b,"_invoke",function(w,S,x){var O,C,_,k=0,E=x||[],j=!1,D={p:0,n:0,v:e,a:z,f:z.bind(e,4),d:function(M,I){return O=M,C=0,_=e,D.n=I,o}};function z(N,M){for(C=N,_=M,t=0;!j&&k&&!I&&t<E.length;t++){var I,L=E[t],J=D.p,ce=L[2];N>3?(I=ce===M)&&(_=L[(C=L[4])?5:(C=3,3)],L[4]=L[5]=e):L[0]<=J&&((I=N<2&&J<L[1])?(C=0,D.v=M,D.n=L[1]):J<ce&&(I=N<3||L[0]>M||M>ce)&&(L[4]=N,L[5]=M,D.n=ce,C=0))}if(I||N>1)return o;throw j=!0,M}return function(N,M,I){if(k>1)throw TypeError("Generator is already running");for(j&&M===1&&z(M,I),C=M,_=I;(t=C<2?e:_)||!j;){O||(C?C<3?(C>1&&(D.n=-1),z(C,_)):D.n=_:D.v=_);try{if(k=2,O){if(C||(N="next"),t=O[N]){if(!(t=t.call(O,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,C<2&&(C=0)}else C===1&&(t=O.return)&&t.call(O),C<2&&(_=TypeError("The iterator does not provide a '"+N+"' method"),C=1);O=e}else if((t=(j=D.n<0)?_:w.call(S,D))!==o)break}catch(L){O=e,C=1,_=L}finally{k=1}}return{value:t,done:j}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Zt(t={},r,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,c):(h.__proto__=c,Zt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=c,Zt(d,"constructor",c),Zt(c,"constructor",l),l.displayName="GeneratorFunction",Zt(c,i,"GeneratorFunction"),Zt(d),Zt(d,i,"Generator"),Zt(d,r,function(){return this}),Zt(d,"toString",function(){return"[object Generator]"}),($o=function(){return{w:s,m:f}})()}function Zt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Zt=function(o,a,l,c){if(a)i?i(o,a,{value:l,enumerable:!c,configurable:!c,writable:!c}):o[a]=l;else{var u=function(f,h){Zt(o,f,function(g){return this._invoke(f,h,g)})};u("next",0),u("throw",1),u("return",2)}},Zt(e,t,n,r)}function _p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Cr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_p(Object(n),!0).forEach(function(r){RR(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_p(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RR(e,t,n){return(t=NR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NR(e){var t=FR(e,"string");return ya(t)=="symbol"?t:t+""}function FR(e,t){if(ya(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ya(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kp(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(c){return void n(c)}a.done?t(l):Promise.resolve(l).then(r,i)}function Op(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){kp(s,r,i,o,a,"next",l)}function a(l){kp(s,r,i,o,a,"throw",l)}o(void 0)})}}function BR(e,t){return UR(e)||HR(e,t)||zR(e,t)||qR()}function qR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1289
1289
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zR(e,t){if(e){if(typeof e=="string")return Ep(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)?Ep(e,t):void 0}}function Ep(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 HR(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,c=!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(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function UR(e){if(Array.isArray(e))return e}var KR=function(t){var n,r=t.brand,i=t.isLast,s=t.onDelete,o=r.id,a=Gn(),l=a.hostAppProps,c=l.onAddSubscription,u=q.useState(!1),d=BR(u,2),f=d[0],h=d[1],g=Kt(),m=Ac({query:{select:function(j){var D=j.data;return D}}}),p=m.data,v=pf(o,{query:{select:function(j){var D=j.data;return D}}}),b=v.data,w=qv({mutation:{onMutate:function(){var E=Op($o().m(function D(z){var N,M,I;return $o().w(function(L){for(;;)switch(L.n){case 0:return N=z.brandId,M=z.data,L.n=1,g.cancelQueries({queryKey:sr()});case 1:return I=g.getQueryData(sr()),g.setQueryData(sr(),function(J){var ce,F;return J&&Cr(Cr({},J),{},{data:Cr(Cr({},J.data),{},{brands:((ce=(F=J.data)===null||F===void 0?void 0:F.brands)!==null&&ce!==void 0?ce:[]).map(function(V){return V.id===N?Cr(Cr({},V),{},{settings:Cr(Cr({},V.settings),{},{enableAutomaticAnalysis:M.enableAutomaticAnalysis})}):V})})})}),L.a(2,{previous:I})}},D)}));function j(D){return E.apply(this,arguments)}return j}(),onSuccess:function(){if(r.settings.enableAutomaticAnalysis===!1)return h(!1);h(!k)},onError:function(j,D,z){z!=null&&z.previous&&g.setQueryData(sr(),z.previous)},onSettled:function(){var E=Op($o().m(function D(){return $o().w(function(z){for(;;)switch(z.n){case 0:return z.n=1,Promise.all([g.invalidateQueries({queryKey:sr()}),g.invalidateQueries({queryKey:vf()})]);case 1:return z.a(2)}},D)}));function j(){return E.apply(this,arguments)}return j}()}}),S=w.mutate,x=w.isPending,O=function(j){S({brandId:o,data:{enableAutomaticAnalysis:j}})},C=function(j){if(j){if(!_)return h(!0);if(!k)return O(!0);h(!0)}else O(!1)},_=Number(p==null?void 0:p.maxNumberOfActiveBrands)-Number(p==null?void 0:p.numberOfActiveBrands)>0||r.settings.enableAutomaticAnalysis===!0,k=ob(b==null?void 0:b.firstNextAnalysisOpportunity);return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:_e("yst-flex yst-max-w-2xl yst-flex-1 yst-flex-row yst-items-center yst-justify-start yst-gap-4 yst-py-4 yst-text-slate-800",{"yst-border-b-[1px] yst-border-b-slate-200":!i}),children:[y.jsx(A.Toggle,{id:"toggle-brand-".concat(r==null?void 0:r.id),checked:r==null||(n=r.settings)===null||n===void 0?void 0:n.enableAutomaticAnalysis,screenReaderLabel:"Enable or disable automatic analysis for this brand",onChange:C,disabled:(r==null?void 0:r.id)==="loading"||x}),y.jsx("div",{className:"yst-font-medium",children:(r==null?void 0:r.id)==="loading"?y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-32"}):r==null?void 0:r.name}),y.jsx("div",{className:"yst-ml-auto yst-flex yst-flex-row yst-items-center yst-justify-end yst-gap-2 yst-text-slate-800",children:(r==null?void 0:r.id)==="loading"?y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsxs(A.Button,{size:"small",variant:"tertiary",className:"yst-gap-1 yst-text-red-600 *:hover:yst-text-red-700",onClick:function(){r!=null&&r.id&&s(r.id)},disabled:(r==null?void 0:r.id)==="loading",children:[y.jsx(bf,{})," Delete brand"]})})]}),y.jsx(A.Modal,{isOpen:f,onClose:function(){return h(!1)},position:"center",as:"div",className:_e({"yst-mx-auto yst-max-w-xl":_}),children:_?y.jsx(A.Modal.Panel,{children:k?y.jsxs(y.Fragment,{children:[y.jsx(A.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(A.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Start brand analysis now?"})}),y.jsxs(A.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:[y.jsx("p",{children:"Activating this brand will immediately start a new analysis."}),y.jsx("p",{children:"This will use one of your weekly analyses included in your subscription."})]}),y.jsxs(A.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[y.jsx(A.Button,{variant:"secondary",onClick:function(){return h(!1)},children:"Cancel"}),y.jsx(A.Button,{variant:"primary",onClick:function(){O(!0)},isLoading:x,children:"Yes, start analysis"})]})]}):y.jsxs(y.Fragment,{children:[y.jsx(A.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(A.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Automatic analysis enabled"})}),y.jsxs(A.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:[y.jsx("p",{children:"You've turned on the weekly automatic analysis for this brand."}),y.jsxs("p",{children:["The next analysis will run on"," ",y.jsx("span",{className:"yst-font-medium",children:ab(r==null?void 0:r.nextScheduledAnalysis)||"the next analysis cycle"}),"."]})]}),y.jsx(A.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:y.jsx(A.Button,{variant:"primary",onClick:function(){return h(!1)},children:"Got it"})})]})}):y.jsxs(A.Modal.Panel,{children:[y.jsx("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(A.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(A.Modal.Title,{as:"h3",className:"yst-text-center yst-text-lg yst-font-medium",children:"You've reached your active brand limit"})}),y.jsx(A.Modal.Container.Content,{children:y.jsx("p",{className:"yst-text-center",children:"Each subscription lets you activate 1 brand. Add another subscription or deactivate an existing brand to activate this brand."})})]})}),y.jsx(A.Modal.Container.Footer,{children:y.jsxs("div",{className:"yst-flex yst-flex-col yst-justify-stretch yst-gap-2",children:[c&&y.jsxs(A.Button,{variant:"upsell",className:"yst-flex yst-gap-1",onClick:c,children:[y.jsx(Kv,{}),"Add a subscription"]}),y.jsx(A.Button,{variant:"tertiary",className:"",onClick:function(){return h(!1)},children:"Manage active brands"})]})})]})})]})},Ap,Pp,Tp;function qu(e,t){return QR(e)||GR(e,t)||VR(e,t)||WR()}function WR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1290
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VR(e,t){if(e){if(typeof e=="string")return jp(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)?jp(e,t):void 0}}function jp(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 GR(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,c=!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(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function QR(e){if(Array.isArray(e))return e}function lh(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Mp=Ra(Ap||(Ap=lh(["xl:yst-w-1/3"]))),$p=Ra(Pp||(Pp=lh(["xl:yst-w-2/3"]))),Dp=Ra(Tp||(Tp=lh(["yst-flex yst-flex-col yst-gap-8 xl:yst-flex-row"]))),YR=function(){var t,n,r,i,s=q.useState(!1),o=qu(s,2),a=o[0],l=o[1],c=q.useState(!1),u=qu(c,2),d=u[0],f=u[1],h=q.useState(null),g=qu(h,2),m=g[0],p=g[1],v=Ac({query:{select:function(C){var _=C.data;return _}}}),b=v.data,w=Fi({query:{select:function(C){var _=C.data;return _==null?void 0:_.brands}}}),S=w.data,x=S==null?void 0:S.find(function(O){return O.id===m});return y.jsxs("form",{children:[y.jsxs(A.Card,{children:[y.jsx(e1,{title:"Settings",description:"Manage your brand settings and data. You can update analysis preferences or delete brands from your account."}),y.jsxs(A.Card.Content,{children:[y.jsxs(Dp,{children:[y.jsxs(Mp,{className:"yst-space-y-2",children:[y.jsx(A.Title,{size:"4",children:"Brands"}),y.jsxs("p",{children:["You have"," ",y.jsxs("b",{children:[(t=b==null?void 0:b.activeSubscriptions)!==null&&t!==void 0?t:"—"," active subscriptions"," "]}),"=",y.jsxs("b",{children:[" ",(b==null?void 0:b.activeSubscriptions)!=null?b.activeSubscriptions*4:"—"," ","analyses per month"]}),". You can have up to"," ",y.jsxs("b",{children:[(n=b==null?void 0:b.maxNumberOfActiveBrands)!==null&&n!==void 0?n:"—"," active brands"]}),", each with 1 automatic weekly analysis if you still have analyses left for the month. Manual and new brand analyses also count toward your monthly total."]}),y.jsx("p",{children:"You can activate, deactivate, or permanently delete brands (including their data) anytime."})]}),y.jsxs($p,{children:[S&&y.jsxs("p",{className:"yst-flex yst-w-full yst-max-w-2xl yst-flex-1 yst-flex-row yst-items-center yst-justify-start yst-gap-2 yst-border-b-[1px] yst-border-b-slate-200 yst-py-4 yst-font-medium yst-text-slate-800",children:["Active brands: ",(r=b==null?void 0:b.numberOfActiveBrands)!==null&&r!==void 0?r:"—"," of"," ",(i=b==null?void 0:b.maxNumberOfActiveBrands)!==null&&i!==void 0?i:"—"]}),S&&S.length===0&&y.jsxs("p",{className:"yst-mt-4 yst-text-slate-500",children:["No brands found. Please"," ",y.jsx(A.Link,{as:Yr,to:"/setup",children:"add a brand"})," ","to start analyzing."]}),(S!=null?S:[{id:"loading",name:"Loading..."}]).map(function(O,C,_){return y.jsx(KR,{brand:O,isLast:C===_.length-1,onDelete:function(k){p(k),l(!0)}},O.id)})]})]}),y.jsx(Na,{}),y.jsxs(Dp,{children:[y.jsxs(Mp,{className:"yst-space-y-2",children:[y.jsx(A.Title,{size:"4",children:"Delete all data"}),y.jsx("p",{children:"Permanently delete all brands, analysis results, and query history from your account."})]}),y.jsxs($p,{className:"yst-space-y-4",children:[y.jsxs(A.Button,{variant:"error",onClick:function(){f(!0)},disabled:(S==null?void 0:S.length)===0,children:[y.jsx(bf,{})," Delete all data"]}),y.jsx("p",{children:y.jsxs("i",{children:[y.jsx("b",{children:"Note:"})," This will erase everything and cannot be reversed."]})})]})]})]})]}),y.jsx(LR,{isOpen:a,onClose:function(){l(!1),p(null)},brandId:m||"",brandName:x==null?void 0:x.name}),y.jsx(TR,{isOpen:d,onClose:function(){f(!1)}})]})};const XR=Object.freeze(Object.defineProperty({__proto__:null,default:YR},Symbol.toStringTag,{value:"Module"}));function dc(e){"@babel/helpers - typeof";return dc=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},dc(e)}var Zd=[{path:"/setup",id:1,title:"Brand & location info",description:"Enter a few basic details about your brand so we can generate relevant queries people might use in AI models like ChatGPT. This helps us analyze how visible your brand is in their responses."},{path:"/setup/:brandId/queries",id:2,title:"Queries",description:"Review the queries we've generated from your brand info. These are phrases people might type into AI models that could trigger your brand to appear."},{path:"/setup/:brandId/analysis",id:3,title:"Analysis",description:"We're checking how your brand shows up in AI. Your queries will now be tested in ChatGPT. This process should take around 5 minutes."}],JR=function(t){return Zd.find(function(n){return!!Ds(n.path,t)})||Zd[0]};function ZR(){var e=Ut(),t=JR(e.pathname);return y.jsxs(A.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(Ix,{title:y.jsx(Nx,{currentStep:t,steps:Zd}),description:t.description}),y.jsx(A.Paper.Content,{children:y.jsx(Is,{})})]})}var Nx=function(t){var n=t.title,r=t.currentStep,i=t.steps;return y.jsxs("span",{className:"yst-inline-flex yst-flex-row yst-gap-4",children:[y.jsxs("span",{className:"yst-tracking-[.2em] yst-text-slate-400",children:[y.jsx("span",{className:"yst-text-slate-900",children:dc(r)==="object"?r.id:r}),"/",Array.isArray(i)?i.length:i]}),y.jsx("span",{children:dc(r)==="object"?r.title:n||"Step ".concat(r)})]})};const eN=Object.freeze(Object.defineProperty({__proto__:null,SetupPaperTitle:Nx,default:ZR},Symbol.toStringTag,{value:"Module"}));var Fx=function(t){var n=t.onBack,r=t.variant,i=r===void 0?"ai":r,s=t.buttonText,o=t.onButtonClick,a=t.isButtonDisabled,l=a===void 0?!1:a,c=t.isLoading,u=c===void 0?!1:c;return y.jsx(xf,{nestedInPaperContent:!0,children:y.jsxs("div",{className:_e({"yst-flex yst-flex-1 yst-flex-col yst-items-start yst-justify-between yst-gap-4 md:yst-flex-row md:yst-items-center md:yst-justify-between":n}),children:[n&&y.jsx(A.Button,{variant:"tertiary",onClick:n,className:"yst-no-underline",children:"← Back"}),y.jsx("div",{className:_e("yst-flex yst-flex-col yst-items-stretch yst-gap-4 md:yst-flex-row md:yst-items-center md:yst-justify-end"),children:y.jsxs(A.Button,{onClick:o,variant:i==="ai"?"primary":i,className:"yst-gap-1.5",style:i==="ai"?{background:"linear-gradient(102deg, #A61E69 0%, #6366F1 100%)",color:"#fff"}:{},disabled:l,type:"submit",isLoading:u,children:[i==="ai"&&y.jsx(KO,{}),s]})})]})})},tN=[{value:"US",label:"United States"},{value:"GB",label:"United Kingdom"},{value:"CA",label:"Canada"},{value:"AU",label:"Australia"},{value:"DE",label:"Germany"},{value:"FR",label:"France"},{value:"NL",label:"Netherlands"}],nN=[{value:"AR",label:"Argentina"},{value:"BE",label:"Belgium"},{value:"BR",label:"Brazil"},{value:"CN",label:"China"},{value:"EG",label:"Egypt"},{value:"ID",label:"Indonesia"},{value:"IE",label:"Ireland"},{value:"IL",label:"Israel"},{value:"IN",label:"India"},{value:"IT",label:"Italy"},{value:"JP",label:"Japan"},{value:"KR",label:"South Korea"},{value:"MX",label:"Mexico"},{value:"NG",label:"Nigeria"},{value:"PL",label:"Poland"},{value:"RU",label:"Russia"},{value:"SA",label:"Saudi Arabia"},{value:"SE",label:"Sweden"},{value:"ES",label:"Spain"},{value:"TH",label:"Thailand"},{value:"TR",label:"Turkey"},{value:"TW",label:"Taiwan"},{value:"ZA",label:"South Africa"}],Ip=[].concat(tN,nN,[{value:"OTHER",label:"Other"}]),rN=[{value:"en",label:"English"},{value:"es",label:"Spanish"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"zh",label:"Chinese (Mandarin)"},{value:"ja",label:"Japanese"}],iN=[{value:"ar",label:"Arabic"},{value:"da",label:"Danish"},{value:"nl",label:"Dutch"},{value:"fi",label:"Finnish"},{value:"hi",label:"Hindi"},{value:"it",label:"Italian"},{value:"ko",label:"Korean"},{value:"no",label:"Norwegian"},{value:"pl",label:"Polish"},{value:"pt",label:"Portuguese"},{value:"ru",label:"Russian"},{value:"sv",label:"Swedish"},{value:"th",label:"Thai"},{value:"tr",label:"Turkish"}],sN=[].concat(rN,iN);function Ur(e){"@babel/helpers - typeof";return Ur=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},Ur(e)}function Lp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Lp(Object(n),!0).forEach(function(r){Bx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bx(e,t,n){return(t=oN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oN(e){var t=aN(e,"string");return Ur(t)=="symbol"?t:t+""}function aN(e,t){if(Ur(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ur(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function So(e,t){return dN(e)||uN(e,t)||cN(e,t)||lN()}function lN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1290
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VR(e,t){if(e){if(typeof e=="string")return jp(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)?jp(e,t):void 0}}function jp(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 GR(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,c=!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(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function QR(e){if(Array.isArray(e))return e}function lh(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Mp=Ra(Ap||(Ap=lh(["xl:yst-w-1/3"]))),$p=Ra(Pp||(Pp=lh(["xl:yst-w-2/3"]))),Dp=Ra(Tp||(Tp=lh(["yst-flex yst-flex-col yst-gap-8 xl:yst-flex-row"]))),YR=function(){var t,n,r,i,s=q.useState(!1),o=qu(s,2),a=o[0],l=o[1],c=q.useState(!1),u=qu(c,2),d=u[0],f=u[1],h=q.useState(null),g=qu(h,2),m=g[0],p=g[1],v=Ac({query:{select:function(C){var _=C.data;return _}}}),b=v.data,w=Fi({query:{select:function(C){var _=C.data;return _==null?void 0:_.brands}}}),S=w.data,x=S==null?void 0:S.find(function(O){return O.id===m});return y.jsxs("form",{children:[y.jsxs(A.Card,{children:[y.jsx(e1,{title:"Settings",description:"Manage your brand settings and data. You can update analysis preferences or delete brands from your account."}),y.jsxs(A.Card.Content,{children:[y.jsxs(Dp,{children:[y.jsxs(Mp,{className:"yst-space-y-2",children:[y.jsx(A.Title,{size:"4",children:"Brands"}),y.jsxs("p",{children:["You have"," ",y.jsxs("b",{children:[(t=b==null?void 0:b.activeSubscriptions)!==null&&t!==void 0?t:"—"," active subscriptions"]}),". This gives you up to"," ",y.jsxs("b",{children:[(n=b==null?void 0:b.activeSubscriptions)!==null&&n!==void 0?n:"—"," active brands"]}),", for which we’ll automatically run a weekly analysis."]}),y.jsx("p",{children:"You can activate or deactivate brands anytime, or permanently delete a brand and all its data."})]}),y.jsxs($p,{children:[S&&y.jsxs("p",{className:"yst-flex yst-w-full yst-max-w-2xl yst-flex-1 yst-flex-row yst-items-center yst-justify-start yst-gap-2 yst-border-b-[1px] yst-border-b-slate-200 yst-py-4 yst-font-medium yst-text-slate-800",children:["Active brands: ",(r=b==null?void 0:b.numberOfActiveBrands)!==null&&r!==void 0?r:"—"," of"," ",(i=b==null?void 0:b.maxNumberOfActiveBrands)!==null&&i!==void 0?i:"—"]}),S&&S.length===0&&y.jsxs("p",{className:"yst-mt-4 yst-text-slate-500",children:["No brands found. Please"," ",y.jsx(A.Link,{as:Yr,to:"/setup",children:"add a brand"})," ","to start analyzing."]}),(S!=null?S:[{id:"loading",name:"Loading..."}]).map(function(O,C,_){return y.jsx(KR,{brand:O,isLast:C===_.length-1,onDelete:function(k){p(k),l(!0)}},O.id)})]})]}),y.jsx(Na,{}),y.jsxs(Dp,{children:[y.jsxs(Mp,{className:"yst-space-y-2",children:[y.jsx(A.Title,{size:"4",children:"Delete all data"}),y.jsx("p",{children:"Permanently delete all brands, analysis results, and query history from your account."})]}),y.jsxs($p,{className:"yst-space-y-4",children:[y.jsxs(A.Button,{variant:"error",onClick:function(){f(!0)},disabled:(S==null?void 0:S.length)===0,children:[y.jsx(bf,{})," Delete all data"]}),y.jsx("p",{children:y.jsxs("i",{children:[y.jsx("b",{children:"Note:"})," This will erase everything and cannot be reversed."]})})]})]})]})]}),y.jsx(LR,{isOpen:a,onClose:function(){l(!1),p(null)},brandId:m||"",brandName:x==null?void 0:x.name}),y.jsx(TR,{isOpen:d,onClose:function(){f(!1)}})]})};const XR=Object.freeze(Object.defineProperty({__proto__:null,default:YR},Symbol.toStringTag,{value:"Module"}));function dc(e){"@babel/helpers - typeof";return dc=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},dc(e)}var Zd=[{path:"/setup",id:1,title:"Brand & location info",description:"Enter a few basic details about your brand so we can generate relevant queries people might use in AI models like ChatGPT. This helps us analyze how visible your brand is in their responses."},{path:"/setup/:brandId/queries",id:2,title:"Queries",description:"Review the queries we've generated from your brand info. These are phrases people might type into AI models that could trigger your brand to appear."},{path:"/setup/:brandId/analysis",id:3,title:"Analysis",description:"We're checking how your brand shows up in AI. Your queries will now be tested in ChatGPT. This process should take around 5 minutes."}],JR=function(t){return Zd.find(function(n){return!!Ds(n.path,t)})||Zd[0]};function ZR(){var e=Ut(),t=JR(e.pathname);return y.jsxs(A.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(Ix,{title:y.jsx(Nx,{currentStep:t,steps:Zd}),description:t.description}),y.jsx(A.Paper.Content,{children:y.jsx(Is,{})})]})}var Nx=function(t){var n=t.title,r=t.currentStep,i=t.steps;return y.jsxs("span",{className:"yst-inline-flex yst-flex-row yst-gap-4",children:[y.jsxs("span",{className:"yst-tracking-[.2em] yst-text-slate-400",children:[y.jsx("span",{className:"yst-text-slate-900",children:dc(r)==="object"?r.id:r}),"/",Array.isArray(i)?i.length:i]}),y.jsx("span",{children:dc(r)==="object"?r.title:n||"Step ".concat(r)})]})};const eN=Object.freeze(Object.defineProperty({__proto__:null,SetupPaperTitle:Nx,default:ZR},Symbol.toStringTag,{value:"Module"}));var Fx=function(t){var n=t.onBack,r=t.variant,i=r===void 0?"ai":r,s=t.buttonText,o=t.onButtonClick,a=t.isButtonDisabled,l=a===void 0?!1:a,c=t.isLoading,u=c===void 0?!1:c;return y.jsx(xf,{nestedInPaperContent:!0,children:y.jsxs("div",{className:_e({"yst-flex yst-flex-1 yst-flex-col yst-items-start yst-justify-between yst-gap-4 md:yst-flex-row md:yst-items-center md:yst-justify-between":n}),children:[n&&y.jsx(A.Button,{variant:"tertiary",onClick:n,className:"yst-no-underline",children:"← Back"}),y.jsx("div",{className:_e("yst-flex yst-flex-col yst-items-stretch yst-gap-4 md:yst-flex-row md:yst-items-center md:yst-justify-end"),children:y.jsxs(A.Button,{onClick:o,variant:i==="ai"?"primary":i,className:"yst-gap-1.5",style:i==="ai"?{background:"linear-gradient(102deg, #A61E69 0%, #6366F1 100%)",color:"#fff"}:{},disabled:l,type:"submit",isLoading:u,children:[i==="ai"&&y.jsx(KO,{}),s]})})]})})},tN=[{value:"US",label:"United States"},{value:"GB",label:"United Kingdom"},{value:"CA",label:"Canada"},{value:"AU",label:"Australia"},{value:"DE",label:"Germany"},{value:"FR",label:"France"},{value:"NL",label:"Netherlands"}],nN=[{value:"AR",label:"Argentina"},{value:"BE",label:"Belgium"},{value:"BR",label:"Brazil"},{value:"CN",label:"China"},{value:"EG",label:"Egypt"},{value:"ID",label:"Indonesia"},{value:"IE",label:"Ireland"},{value:"IL",label:"Israel"},{value:"IN",label:"India"},{value:"IT",label:"Italy"},{value:"JP",label:"Japan"},{value:"KR",label:"South Korea"},{value:"MX",label:"Mexico"},{value:"NG",label:"Nigeria"},{value:"PL",label:"Poland"},{value:"RU",label:"Russia"},{value:"SA",label:"Saudi Arabia"},{value:"SE",label:"Sweden"},{value:"ES",label:"Spain"},{value:"TH",label:"Thailand"},{value:"TR",label:"Turkey"},{value:"TW",label:"Taiwan"},{value:"ZA",label:"South Africa"}],Ip=[].concat(tN,nN,[{value:"OTHER",label:"Other"}]),rN=[{value:"en",label:"English"},{value:"es",label:"Spanish"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"zh",label:"Chinese (Mandarin)"},{value:"ja",label:"Japanese"}],iN=[{value:"ar",label:"Arabic"},{value:"da",label:"Danish"},{value:"nl",label:"Dutch"},{value:"fi",label:"Finnish"},{value:"hi",label:"Hindi"},{value:"it",label:"Italian"},{value:"ko",label:"Korean"},{value:"no",label:"Norwegian"},{value:"pl",label:"Polish"},{value:"pt",label:"Portuguese"},{value:"ru",label:"Russian"},{value:"sv",label:"Swedish"},{value:"th",label:"Thai"},{value:"tr",label:"Turkish"}],sN=[].concat(rN,iN);function Ur(e){"@babel/helpers - typeof";return Ur=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},Ur(e)}function Lp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Lp(Object(n),!0).forEach(function(r){Bx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bx(e,t,n){return(t=oN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oN(e){var t=aN(e,"string");return Ur(t)=="symbol"?t:t+""}function aN(e,t){if(Ur(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ur(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function So(e,t){return dN(e)||uN(e,t)||cN(e,t)||lN()}function lN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1291
1291
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cN(e,t){if(e){if(typeof e=="string")return Np(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)?Np(e,t):void 0}}function Np(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 uN(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,c=!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(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function dN(e){if(Array.isArray(e))return e}var fN=function(){var t,n=xn(),r=Pc(),i=Kt(),s=q.useState(),o=So(s,2),a=o[0],l=o[1],c=q.useState(!1),u=So(c,2),d=u[0],f=u[1],h=q.useState({name:"",url:"",description:"",language:"en",isLocal:!1,country:"",region:""}),g=So(h,2),m=g[0],p=g[1],v=q.useState(null),b=So(v,2),w=b[0],S=b[1],x=Bk({mutation:{onSuccess:function(I){var L=I.data.id;i.invalidateQueries({queryKey:[vf(),sr()]}),L&&r.setBrandId(L),I!=null&&I.status&&I.status>=200&&I.status<300&&L&&(r.setBrandId(L),l(L))},onError:function(){f(!1)}}}),O=x.mutate,C=x.isPending,_=x.error,k=Fi({query:{enabled:!!a,select:function(I){var L=I.data;return L==null?void 0:L.brands},refetchInterval:function(I){var L;return((I==null||(L=I.state)===null||L===void 0||(L=L.data)===null||L===void 0||(L=L.data)===null||L===void 0?void 0:L.brands)||[]).find(function(J){return J.id===a})?!1:2*1e3}}}),E=k.data;q.useEffect(function(){a&&E!==null&&E!==void 0&&E.find(function(M){return M.id===a})&&n("/setup/".concat(a,"/queries"),{replace:!0})},[a,E,n]);var j=function(I,L){p(function(J){return Rp(Rp({},J),{},Bx({},I,L))})},D=function(I){if(I.preventDefault(),S(null),m.description.length>250){S("Your brand description is too long. Please keep it within the 250-character limit."),f(!1);return}f(!0);var L=m.url;L&&!/^https?:\/\//i.test(L)&&(L="https://".concat(L)),O({data:{name:m.name,url:L,description:m.description,focusLanguage:m.language,country:m.country,regionOrCity:m.region}})};function z(M){return Ur(M)==="object"&&M!==null&&"response"in M&&Ur(M.response)==="object"&&M.response!==void 0&&"data"in M.response}var N=z(_)?_.response.data.errors:void 0;return y.jsxs("form",{onSubmit:D,children:[y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(A.Title,{size:"2",children:"Brand info"}),!!_&&y.jsx(A.Alert,{variant:"error",title:"Error",isVisible:!!_,children:y.jsx("ul",{children:N&&Ur(N)==="object"?Object.entries(N).flatMap(function(M){var I=So(M,2),L=I[0],J=I[1];return Array.isArray(J)?J.map(function(ce,F){return y.jsx("li",{children:ce},"".concat(L,"-").concat(F))}):null}):"There was an error creating the brand."})}),w&&y.jsx(A.Alert,{variant:"error",title:"Error",isVisible:!!w,children:y.jsx("ul",{children:y.jsx("li",{children:"Your brand description is too long. Please keep it within the 250-character limit."})})}),y.jsx(A.TextField,{id:"name",label:"Brand name",value:m.name,onChange:function(M){return j("name",M.target.value)}}),y.jsx(A.TextField,{id:"url",label:"Website URL (optional)",placeholder:"Example: https://yourwebsite.com",value:m.url,onChange:function(M){return j("url",M.target.value)}}),y.jsxs("div",{id:"brand-description-textarea",children:[y.jsx(A.TextareaField,{id:"brand-description",label:"Brand description",value:m.description,onChange:function(M){var I=M.target.value;j("description",I)},...m.description.length>250?{validation:{variant:"error",message:"Your brand description is too long. Please keep it within the 250-character limit."}}:{},placeholder:"e.g. We design eco-friendly yoga mats for busy professionals who want sustainable gear that’s durable, stylish and kind to the planet."}),y.jsxs("div",{className:"yst-flex yst-mt-1",children:[y.jsxs("div",{className:"yst-flex-grow yst-flex-col",children:[m.description.length>250&&y.jsx("div",{className:"yst-text-red-500 yst-mb-2",children:"Your brand description is too long. Please keep it within the 250-character limit."}),"Tell us about your brand: what you do, who it’s for and what makes it special."]}),y.jsxs("div",{className:_e("yst-text-xs yst-mt-[-4px] yst-ml-6",{"yst-text-slate-500":m.description.length<=250,"yst-text-red-500":m.description.length>250}),children:[m.description.length,"/250"]})]})]}),y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(A.Select,{className:"yst-max-w-sm",id:"language-select",label:"Target language",value:m.language,onChange:function(M){return j("language",M)},options:sN.map(function(M){return{label:M.label,value:M.value}})}),y.jsx("p",{children:"The main language your brand uses to communicate or create content."})]})]}),y.jsx(Na,{}),y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(A.Title,{size:"2",children:"Location info"}),y.jsx("p",{children:"Specify a location to enhance the accuracy of the analysis."}),y.jsx(A.Autocomplete,{className:"yst-max-w-sm",id:"country-select",label:"Target country (optional)",value:m.country,nullable:!0,placeholder:"Select...",onChange:function(M){return j("country",M)},onQueryChange:function(){},selectedLabel:((t=Ip.find(function(M){return M.value===m.country}))===null||t===void 0?void 0:t.label)||"",children:Ip.map(function(M){return y.jsx(A.Autocomplete.Option,{value:M.value,children:M.label},M.value)})}),m.country&&y.jsx(A.TextField,{id:"region",label:"Target city, state, or region (optional)",value:m.region,onChange:function(M){return j("region",M.target.value)},description:`Enter a city, state, or region to narrow down the analysis. For
1292
1292
  example: California, Bavaria, or Paris.`})]}),y.jsx(Fx,{onBack:function(){return n(-1)},buttonText:"Generate queries",isButtonDisabled:C||!!a||d,isLoading:C||!!a})]})};const hN=Object.freeze(Object.defineProperty({__proto__:null,default:fN},Symbol.toStringTag,{value:"Module"})),gN=e=>$.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},$.createElement("path",{d:"M3.33284 2V4.66667M1.99951 3.33333H4.66618M3.99951 11.3333V14M2.66618 12.6667H5.33284M8.66618 2L10.19 6.57143L13.9995 8L10.19 9.42857L8.66618 14L7.14237 9.42857L3.33284 8L7.14237 6.57143L8.66618 2Z",stroke:"url(#paint0_linear_3891_2757)",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),$.createElement("defs",null,$.createElement("linearGradient",{id:"paint0_linear_3891_2757",x1:1.99951,y1:2,x2:15.3308,y2:3.72773,gradientUnits:"userSpaceOnUse"},$.createElement("stop",{stopColor:"#A61E69"}),$.createElement("stop",{offset:1,stopColor:"#6366F1"}))));function ma(e){"@babel/helpers - typeof";return ma=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},ma(e)}function yN(e){return vN(e)||pN(e)||qx(e)||mN()}function mN(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1293
1293
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pN(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vN(e){if(Array.isArray(e))return ef(e)}function Fp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fp(Object(n),!0).forEach(function(r){bN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bN(e,t,n){return(t=xN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xN(e){var t=wN(e,"string");return ma(t)=="symbol"?t:t+""}function wN(e,t){if(ma(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ma(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qi(e,t){return _N(e)||CN(e,t)||qx(e,t)||SN()}function SN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.