PageSourceSearch

https://www.dorothyperkins.com/build/_shared/chunk-WDXJVMOY.js

js dorothyperkins.com collected 2026-09-26 02:56:52 UTC 5,129 bytes, 1 lines download raw bytes

1import{a as W}from"/build/_shared/chunk-JVDEVG2I.js";import{c as K}from"/build/_shared/chunk-Q6UAPYBM.js";import{a as H}from"/build/_shared/chunk-42ITEOR7.js";import{a as x}from"/build/_shared/chunk-5KTLGSZR.js";import{c as E}from"/build/_shared/chunk-PE2RAMGK.js";import{a as N}from"/build/_shared/chunk-I4DDJGKJ.js";import{a as q,b as D}from"/build/_shared/chunk-RZLDKGLN.js";import{c as I}from"/build/_shared/chunk-CBDM7QYU.js";import{a as v}from"/build/_shared/chunk-ZZB7OGT7.js";import{a as A}from"/build/_shared/chunk-RKA7QBAZ.js";import{b as w}from"/build/_shared/chunk-V53WT573.js";import{a as G}from"/build/_shared/chunk-YUUKFOQM.js";import{a as O}from"/build/_shared/chunk-DEVQKMWM.js";import{c as y,d as B}from"/build/_shared/chunk-L4FEFM7G.js";import{a as $}from"/build/_shared/chunk-5OBEDPFR.js";import{a as ae}from"/build/_shared/chunk-H6S7FWVP.js";import{d as k}from"/build/_shared/chunk-T36URGAI.js";var t=k(ae());var o=k($()),we=({isOpen:s,onClose:T,onSignIn:X,enabledSignInLinks:j,type:n="wishlist",showSubscriptionModal:z=!1})=>{var R;let J=B(),[p,Q]=(0,t.useState)(""),[c,V]=(0,t.useState)(null),[Y,L]=(0,t.useState)(null),[S,U]=(0,t.useState)(null),[Z,h]=(0,t.useState)(!1),e=x(),P=y(),b=(0,t.useContext)(H),ee=(0,t.useContext)(q),_=(0,t.useContext)(O),{trackUserInteraction:d}=E(),{sendLogin:te}=W(),C=(0,t.useRef)(!1),u=P.pathname,f=new URLSearchParams(P.search),{translate:a}=G(),i=(0,t.useRef)(!1),l=x(),{getInternalUrl:oe}=A();n==="unlimited"&&(f.set("addToBagOnLoadAndRegistered","true"),f.set("addPremier","true"),z&&f.set("premierSubscription","true"));let g=n==="wishlist"?"wishlist_login_modal":n==="virtualTryOn"?"vto_login_modal":"login_modal";(0,t.useEffect)(()=>{s&&n==="virtualTryOn"&&d({section:g,action:"open"})},[s]);let F=()=>{d({section:g,action:"close"}),T()};u=u+"?"+f.toString(),(0,t.useEffect)(()=>{c&&(i.current=!1,l.load("/login"))},[c]),(0,t.useEffect)(()=>{s&&(h(!1),C.current=!1,e.load("/login"))},[s]),(0,t.useEffect)(()=>{e.data&&e.data.csrf&&(L(e.data.csrf),U(e.data.csrfTimeStamp),i.current=!1)},[e.data]),(0,t.useEffect)(()=>{var r;(r=l.data)!=null&&r.csrf&&(L(l.data.csrf),U(l.data.csrfTimeStamp),i.current=!1)},[l.data]);let M=()=>{if(i.current||!S)return;Date.now()-S>6e4&&(i.current=!0,l.load("/login"))};if((0,t.useEffect)(()=>{var r;if(e.data&&"cart"in e.data&&((r=b.setCart)==null||r.call(b,e.data.cart)),e.data&&"user"in e.data){let m=e.data;D(m.user,_,ee),!C.current&&m.method&&(te(m.user,m.method,"returning"),C.current=!0),X(),h(!1),T()}e.data&&"error"in e.data&&(V(e.data.error),i.current||(i.current=!0,e.load("/login")))},[e.data]),!s)return null;let ne=n==="wishlist"?a("signIn.wishlistLoginMessage"):n==="pricePromise"?a("signIn.pricePromiseLoginMessage"):n==="virtualTryOn"?a("signIn.virtualTryOnLoginMessage"):a("signIn.unlimitedLoginMessage",{premierName:((R=_.unlimitedOverrides)==null?void 0:R.name)||"Unlimited"});return(0,o.jsx)(K,{show:s,onClose:F,className:"flex h-fit items-center justify-center w-screen p-5 m-auto",containerClassName:"max-w-[500px] grow bg-site-background w-auto h-auto min-h-[375px] overflow-none relative rounded-md",backgroundClick:()=>F(),title:a("signIn.subtitle"),testId:"login-modal",children:(0,o.jsxs)("div",{className:"p-4 pt-0 m-1 mt-0",children:[c?(0,o.jsx)(I,{type:"error",message:c}):(0,o.jsx)(I,{type:"infoNew",message:ne}),(0,o.jsx)(e.Form,{action:oe("/login"),method:"post",className:"mx-auto max-w-screen-2xl pt-4","data-test-id":"login-modal-form",children:(0,o.jsxs)("fieldset",{disabled:e.state==="submitting",children:[(0,o.jsx)("input",{type:"hidden",name:"csrf",value:Y||""}),(0,o.jsx)(N,{className:"mb-5",labelClassName:"font-normal text-base",containerClassName:"gap-2",required:!0,name:"username",label:a("signIn.labelEmailAddress"),type:"email",value:p,onChange:r=>{Q(r.target.value)},onFocus:M}),(0,o.jsx)(N,{className:"mb-3",labelClassName:"font-normal text-base",containerClassName:"gap-2",required:!0,name:"password",label:a("signIn.labelPassword"),type:"password",onFocus:M}),(0,o.jsx)("div",{className:"flex flex-row pb-2",children:(0,o.jsx)(v,{className:"underline hover:no-underline text-sm",to:`/reset-password?email=${encodeURIComponent(p)}`,onClick:()=>{d({section:g,action:"click",label:"forgot_password"})}
1,children:a("signIn.linkForgottenPassword")})}),j&&(0,o.jsx)("div",{className:"flex flex-row pb-2",children:(0,o.jsx)(v,{className:"underline hover:no-underline text-sm",to:`/sign-in-link?email=${encodeURIComponent(p)}&source=${n}${n==="unlimited"?`&redirect=${encodeURIComponent(u)}`:""}`,onClick:()=>{d({section:g,action:"click",label:"email_me_a_sign_in_link"})},children:a("signIn.emailSignInLink")})}),(0,o.jsx)(w,{"data-test-id":"login-button-modal",variant:"primary",className:"mt-2 mx-auto block w-full h-[50px]",loading:e.state!=="idle"&&Z===!0,type:"submit",onClick:()=>{h(!0)},children:a("signIn.subtitle")})]})}),n!=="pricePromise"&&(0,o.jsx)(w,{onClick:()=>{J(`/sign-up?redirect=${encodeURIComponent(u)}&registrationPath=${n}`)},className:"w-full h-[50px] mt-4",variant:"secondary",dataTestId:"create-account-button",children:a("signUp.title")})]})})};export{we as a};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.