1/*! For license information please see user.65767c1c2d.js.LICENSE.txt */ 2"use strict";(globalThis.webpackChunklawinsidercontracts||=[]).push([[6806],{3490(e,t,n){n.d(t,{A:()=>s});var i=n(6942),a=n.n(i),r=n(6536),o=n(9698);function s({autoComplete:e,autoFocus:t=!0,className:n,disabled:i,error:s,label:l,loading:c,name:d,onFieldChange:u,placeholder:h,type:m,...p}){const f=d||m;return(0,o.FD)("div",{className:a()({"auth-field":!0,[n]:n}),children:[(0,o.Y)(r.A,{autoComplete:e,autoFocus:t,className:a()({"full-width":!0,"fullwidth-with-label":l}),disabled:i||c,invalid:!!s,label:l,name:f,placeholder:h,type:m,onChange:u,...p}),s&&(0,o.Y)("p",{className:"invalid-feedback",children:s})]})}},6710(e,t,n){n.d(t,{G:()=>m,A:()=>f});var i=n(6942),a=n.n(i),r=n(4843),o=n(9869),s=n(2109),l=n(1818),c=n(8028),d=n(5549),u=n(4681),h=n(9698);const m={ADVANCED_SEARCH:"Advanced Search",CLAUSE_FINDER:"ClauseFinder⢠AI Search",COPY_AND_DOWNLOAD:"Copy & Download",ENHANCED_ROLE_BASED_ACCESS:"Enhance Role Based Access Controls",INTEGRATION_GPT:"Chat with Law Insider GPT",LISTS:"Save Clauses to Lists",MULTIPLE_ENVIRONMENTS:"Multiple Environments",NEWSLETTER:"Premium Resources & Newsletter",PRIVATE_CONTRACT_LIBRARIES:"Private Contract Libraries",SHARED_PRIVATE_LIBRARIES:"Shared Private Libraries",SSO_OKTA_INTEGRATION:"SSO/Okta Integration (Coming Soon)",SUPPORT:"24/7 Support",TEAM:"Add Your Team",TEAM_ANNUAL_FREE_MEMBER:"First Additional Team Member Free",UNLIMITED_ADMIN_USERS:"Unlimited Admin Users",UNLIMITED_BROWSING:"Unlimited Browsing",UNLIMITED_CLAUSE_LISTS:"Unlimited Clause Lists",UNLIMITED_SEARCH:"Unlimited Search & Browse",UNLIMITED_SECURE_LIBRARIES:"Unlimited Secure Libraries",USAGE_HISTORY:"Audit Log/Usage History"},p=(e,t)=>{const n=Math.round(e.length/t);return Array.from({length:t},(t,i)=>e.slice(i*n,(i+1)*n))};function f({caption:e=null,className:t,columns:n=2,features:i=[m.UNLIMITED_BROWSING,m.ADVANCED_SEARCH,m.COPY_AND_DOWNLOAD,m.LISTS,m.TEAM,m.NEWSLETTER],featuresToOverwrite:f,isEnterprisePlan:g,isProPlan:b,itemTitleTag:v="span",showTryPremiumLabel:A=!0}){let C=i;const[E]=(0,r.fp)(u.p9),{minTrialValues:T}=(0,o.useContext)(c.A),{formattedMinPrice:y,isTrialAvailable:S,minTrialPeriod:N}=T(),_=v;return b&&(C=s.tW["tier-4"]),g&&(C=s.tW["tier-5"]),b||g||(C=s.tW["tier-0"]),s.qx?(0,h.FD)(h.FK,{children:[e,(0,h.Y)("div",{className:a()(t,"features-list"),children:p(f||C,n).map(e=>(0,h.Y)("ul",{className:"list-unstyled",children:e.map(e=>{const t=Array.isArray(e)?e[0]:e,n=Array.isArray(e)&&!e[1];return(0,h.FD)("li",{title:t,children:[(0,h.Y)("i",{className:n?"close-red":"check green"})," ",n?(0,h.FD)(h.FK,{children:[(0,h.Y)(_,{children:(0,h.Y)("s",{children:t})})," ","(Annual Only)"]}):(0,h.Y)(_,{children:t})]},t)})},e[0]))}),A&&(0,h.Y)("p",{className:"green",children:(0,h.FD)("b",{children:[(0,l.uZ)(E?.trialUsed)||!S?`Plans starting at ${y} per month.`:`Try Premium - Starting at ${y} for ${N} days.`," ","Cancel anytime."]})})]}):(0,h.Y)("div",{className:"kAkHhoOjrL row-flex flex-justify-center flex-align-center",children:(0,h.Y)(d.A,{})})}},9100(e,t,n){n.d(t,{A:()=>c});var i=n(4579),a=n.n(i),r=n(9511),o=n.n(r),s=n(9869),l=n(9698);let c=function(e){function t(...t){var n;return(n=e.call.apply(e,[this].concat(t))||this).emitChange=e=>{const{name:t,onChange:i}=n.props,a=e;if(!n.htmlEl)return;const r=n.htmlEl.innerHTML;i&&r!==n.lastHtml&&(a.innerText=n.htmlEl.innerText,a.target.name=t,a.target.value=r,i(a)),n.lastHtml=r},n}o()(t,e);var n=t.prototype;return n.componentDidMount=function(){const e=window.MutationObserver||window.WebKitMutationObserver;this.observer=new e(e=>{for(const t of e)this.emitChange(t)}),this.observer.observe(this.htmlEl,{characterData:!0,childList:!0,subtree:!0});const{autoFocus:t}=this.props;t&&this.htmlEl.focus()},n.shouldComponentUpdate=function(e){const{className:t,disabled:n,html:i}=this.props;return!this.htmlEl||e.html!==this.htmlEl.innerHTML&&e.html!==i||n!==e.disabled||t!==e.className},n.componentDidUpdate=function(){const{html:e}=this.props;this.htmlEl&&e!==this.htmlEl.innerHTML&&(this.htmlEl.innerHTML=e)},n.componentWillUnmount=function(){this.observer.disconnect()},n.render=function(){const{autoFocus:e,disabled:t,html:n,onBlur:i,placeholder:a,tagName:r,...o}=this.props,c={...o,contentEditable:!t,dangerouslySetInnerHTML:{__html:n.trim()},disabled:t,onBlur:i||this.emitChange,ref:e=>this.htmlEl=e};t||void 0===a||(c.placeholder=a);const d=(0,s.createElement)(r||"div",c);return(0,l.Y)("div",{className:"contenteditable",children:d})},a()(t)}(s.Component)},859(e,t,n){n.d(t,{A:()=>h});
2var i=n(6942),a=n.n(i),r=n(9869),o=n(7071),s=n(1907),l=n(2946),c=n(7224),d=n(9698);function u({children:e,className:t,...n}){return(0,d.Y)(c.A,{className:a()("btn-full-width new-list-btn",t),tag:"button",...n,children:e})}function h({ButtonComponent:e=u,className:t,icon:n="icon-add-blue",onClick:i,snippet:c,updateLists:h}){const[m,p]=(0,r.useState)(!1);return(0,d.FD)(d.FK,{children:[(0,d.FD)(e,{className:t,"data-trigger-paywall-id":l.Aq,onClick:()=>{i?.(),p(!0)},children:[(0,d.Y)("i",{className:a()("icon",n)}),"New List"]}),(0,d.Y)(s.A,{open:m,snippet:c,updateLists:h,onClose:()=>p(!1),onSave:e=>{(0,o.xE)((0,d.FD)("span",{children:["Created new ",e.name," list"]}),{action:"see list",callback:()=>(0,o.oG)(e.link)})}})]})}},1739(e,t,n){n.d(t,{A:()=>g});var i=n(6942),a=n.n(i),r=n(4843),o=n(9869),s=n(2109),l=n(7071),c=n(4929),d=n(4918),u=n(8028),h=n(1539),m=n(5391),p=n(6536),f=n(9698);function g({loading:e,onApplyCoupon:t,tier:n}){const{applyDiscount:i,currency:g,subscriptionState:{paymentMethodType:b}}=(0,o.useContext)(u.A),[v,A]=(0,o.useState)(!1),[C,E]=(0,o.useState)(""),[T,y]=(0,r.fp)(h.eF),S=(0,o.useCallback)(e=>{E(""),i({amount:null,percent:null}),t(""),y(null),(0,l.xE)(e)},[i,t,y]),N=async(e=C)=>{A(!0);const a=await fetch(`/api/payments/coupon/${e}`,{credentials:"same-origin",method:"GET"});if(a.ok){const r=await a.json(),{applicable_plans:o}=r;if(o?.length&&n&&!o.includes(n))return S("This promo code is not valid for this plan."),void A(!1);i(r),t(e),y(r),(0,l.xE)("Your promo code has been applied!")}else S(`No such promo code: ${e}`);A(!1)};(0,o.useEffect)(()=>{const{coupon:e}=(0,c.vA)(),t=e||T?.id;t&&(E(t),N(t))},[]);const _=e||v;return(0,f.FD)(f.FK,{children:[(0,f.FD)("div",{className:a()("apply-discount flex-align-center text-left",{"checkout-item":!T}),children:[(0,f.Y)(p.A,{className:"input-height-xs full-width",disabled:_,label:"Add promo code",trailingIcon:T&&(0,f.Y)("i",{className:"icon icon-check-green"}),type:"text",value:C,onChange:e=>E(e.target.value),onKeyDown:e=>{"Enter"===e.key&&N()}}),T?(0,f.Y)(m.A,{disabled:_,onClick:()=>S("Promo code has been removed!"),children:"Remove"}):(0,f.Y)(m.A,{disabled:_||!C,onClick:()=>N(),children:"Apply"})]}),b!==s.uq.INVOICE&&T&&(0,f.Y)("div",{className:"checkout-item text-left",style:{paddingTop:0},children:(0,f.Y)("span",{className:"green text-left",children:(0,d.id)(T,g)})})]})}},2466(e,t,n){n.d(t,{A:()=>d});var i=n(9869),a=n(5809),r=n(6410),o=n(8028),s=n(7399),l=n(6660),c=n(9698);function d({showLabel:e}){const{geo:{country:t}}=(0,i.useContext)(a.A),{currency:n,subscriptionState:d,updateCurrency:u}=(0,i.useContext)(o.A),h=s.A.SHOW_CURRENCY.get(),m=!!d?.currency,p=s.A.CURRENCY.get({ignoreDefault:!0})||r.xh[t.toLowerCase()];(0,i.useEffect)(()=>{h&&p&&!m&&s.A.CURRENCY.set(p)},[p,m,h]);const f=r.M3[n]?n:"usd";return h?(0,c.FD)("label",{"aria-label":m?"Please contact support if you want to change your currency":null,className:"tooltip-top-right",htmlFor:"currency",role:m?"tooltip":null,children:[e&&(0,c.FD)(c.FK,{children:[(0,c.Y)("b",{children:"Currency:"}),"Â "]}),(0,c.Y)("select",{className:"currency-selector",disabled:m,id:"currency",value:f,onChange:({target:{value:e}})=>{u(e),(0,l.s)("currency_change",{value:e})},children:Object.keys(r.M3).map(e=>(0,c.Y)("option",{value:e,children:e.toUpperCase()},e))})]}):null}},3446(e,t,n){n.d(t,{A:()=>f});var i=n(9869),a=n(2109),r=n(7071),o=n(4918),s=n(7547),l=n(8847),c=n(8028),d=n(6660),u=n(4681),h=n(9698);const m=(0,i.lazy)(()=>n.e(9970).then(n.bind(n,5177)));function p({isTeamDialog:e,isUpdateBillingDialog:t,loading:n,newPlanType:a,nextInvoiceTimestamp:r,onPlanChange:l,onSubmit:d,priceEstimate:u,shouldUpdateCard:p,taxEstimate:f,teamAmount:g,teamQty:b}){const{currency:v,subscriptionState:A}=(0,i.useContext)(c.A),{planType:C}=A;let E=null,T=null,y=null,S=0;a!==C?(null!==u&&(S=r>Date.now()?0:u,T=u<0?`(${(0,o.vv)(S,v)})`:(0,o.vv)(S,v),E=`Change Plan for ${T} Today`),null!==f&&(y=(0,o.vv)(f,v))):p&&(E="Update Payment Method");const N=a||C;return(0,h.Y)(s.A,{children:(0,h.Y)(m,{defaultButtonText:E,formattedPrice:T,formattedTax:y,isTeamDialog:e,isUpdateBillingDialog:t,loading:n,planType:N,teamAmount:g,teamQty:b,onPlanChange:l,onSubmit:d})})}function f({initialPlanType:e,isTeamDialog:t,isUpdateBillingDialog:n,onClose:o,teamAmount:s,teamQty:m}){const{isRecurringPlanType:f,isSubscriptionStateRetrieved:g,products:b,shouldUpdateCard:v,subscriptionState:{group:A,planType:C},trialPeriods:E,updateSubscriptionState:T}=(0,i.useContext)(c.A),[y,S]=(0,i.useState)(!1),[N,_]=(0,i.useState)(C),[Y,I]=(0,i.useState)(null),[D,w]=(0,i.useState)(null),[O,R]=(0,i.useState)(null),[x,P]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{y||async function(){if(N!==C&&b[N]&&g){P(!0);const{affectedAt:e,tax:t,total:n}=await(0,l.i3)(b[N].plan,{group:b[N]?.group});w(1e3*e),I(n),R(t),P(!1)}else I(null),R(null)}()},[C,g,y,N,b,E]),(0,i.useEffect)(()=>{C&&_(C)},[C]),(0,i.useEffect)(()=>{"free"!==C&&e&&_(e)},[e,C]),(0,h.Y)(p,{isTeamDialog:t,isUpdateBillingDialog:n,loading:y||x,newPlanType:N,nextInvoiceTimestamp:D,priceEstimate:Y,shouldUpdateCard:v,taxEstimate:O,teamAmount:s,teamQty:m,onPlanChange:_,onSubmit:async({createPaymentMethod:e})=>{S(!0);let t=null;try{!0===v&&(t=await e(Math.max(Y,0)||0));const n=f(N),i=await fetch((0,l.Lp)("subscriptions",{group:A}),{body:JSON.stringify({plan:b[N].plan,token:t?.id||null,trial_period:E[N]||null,...!1===n?{recurring:n}:{}}),credentials:"same-origin",method:"PATCH"});if(i.ok){const{amount:e,currency:n,group:a,interval:s,tier:c}=b[N];
2(0,d.s)("dialog",{action:"submit",name:"team"===a?"manage_team":"manage_individual"});const h=(0,l.CL)(await i.json());return null!==t&&(await t.confirmPayment(h.subscription.paymentIntent),h.subscription.paymentIntent=null),(0,r.xE)("Your subscription information has been updated."),T(h),_(C),(0,u.TK)({plan:b[N].plan,subscription:{amount:e,currency:n,group:a,interval:s,tier:c}}),S(!1),void o()}let a;try{const{error:e}=await i.json();a=new Error(e)}catch{a=new Error("There was an error updating your plan.")}throw a}catch(e){t?.failPayment(),(0,r.xE)(e.message,a.XG),S(!1)}}})}},1751(e,t,n){n.d(t,{A:()=>R,a:()=>Y});var i=n(9170),a=n(6942),r=n.n(a),o=n(4843),s=n(9869),l=n(2386),c=n(2109),d=n(1818),u=n(4918),h=n(7071),m=n(7563),p=n(8847),f=n(9698);function g({discount:e}){const{end:t,name:n}=e;return(0,f.FD)(f.FK,{children:[n,null!==t&&(0,f.FD)("span",{children:[" ","(discount ends in ",(0,f.Y)(l.A,{date:1e3*t}),")"]})]})}var b=n(8028),v=n(3843),A=n(1539),C=n(5391),E=n(7693),T=n(6660),y=n(4681);const S={[c.x1]:"two years"};function N(){const e=(0,y.wz)(),[,t]=(0,o.fp)(A._O),{currency:n,discountRawPrices:i,products:a,subscriptionState:r}=(0,s.useContext)(b.A),{planType:l}=r,c=(0,d.Dk)(a,"year",e?.subscription?.tier,e?.subscription?.group);if(!c)return null;const h=i[c]-12*i[l];return(0,f.FD)(f.FK,{children:[" ","You can save ",(0,u.vv)(h,n)," /year with annual billing."," ",(0,f.Y)(C.A,{className:"btn-link","event-name":"ad_click","event-value":`internal-ad-upgrade-to-yearly-profile-page__plan__${c}`,onClick:()=>{t("year"),(0,m.Dh)({action:v.Jw.UPGRADE,details:{initialPlanType:c},showView:!0,source:v.YH.ACCOUNT,view:v.al.UPGRADE_PACKAGE})},children:"Switch to annual."})]})}function _({group:e,interval:t}){const[n]=(0,o.fp)(y.el),[i]=(0,o.fp)(y.aQ),[a]=(0,o.fp)(y.UX);let r="";return n&&(r="Premium"),i&&(r="Pro"),a&&(r="Enterprise"),(0,f.FD)(f.FK,{children:[r," ",(0,u.Zr)(e)," ",(0,u.Zr)(c.pW[t])]})}const Y=()=>{const{subscriptionState:{subscription:e},updateSubscriptionState:t}=(0,s.useContext)(b.A),[n,i]=(0,s.useState)(!1);return{loading:n,resumeSubscription:async()=>{i(!0);const n=await(0,p.NT)(!1);(0,T.s)("resume_subscription"),(0,h.xE)("Your subscription has been updated",{dialog:!0}),n.subscription={...e,...n.subscription},t(n),i(!1)}}};function I(){const{loading:e,resumeSubscription:t}=Y();return(0,f.Y)(E.zh,{className:"btn-link",disabled:e,onClick:async()=>{await t()},children:"Reactivate membership."})}function D({paymentIntent:e}){return(0,f.FD)("div",{className:"subscription-cart-detail",children:[(0,f.Y)("b",{children:"Payment status:"})," ",(0,f.FD)("span",{style:{color:i.D5},children:[(0,f.Y)("i",{className:"icon icon-warning-red"}),e.error]})]})}function w({status:e}){return(0,f.FD)(f.FK,{children:[(0,f.Y)("b",{children:"Status:"})," ",(0,f.Y)("span",{className:r()({"color-green":"past_due"!==e,"color-red":"past_due"===e}),children:(0,u.Zr)(e?.replace("_"," "))})]})}function O(){const{preparedTrialPrice:e,subscriptionState:t}=(0,s.useContext)(b.A),{group:n,hasTeam:i,interval:a,isTrialing:r,planType:o,subscription:{cancelAtPeriodEnd:h,currentPeriodEnd:m,discount:v,method:A,paymentIntent:C,status:E,trialEnd:T},team:y}=t,Y=S[o]||a,I=function(e,t){const[n,i]=(0,s.useState)("loading..."),{products:a,renderPrice:r,renderedPrices:o}=(0,s.useContext)(b.A),l=a[e],{group:c,plan:u}=l||{},h=(0,d.ZP)(l),m=(0,s.useMemo)(()=>o[e],[o,e]);return(0,s.useEffect)(()=>{!async function(){let e;if(h)i(r(0));else{if(t&&"team"===c){const{discount:n,subtotal:i,total:a}=await(0,p.nh)({plan:u,...t});e=r(n>0?i:a,!0,!0,n>0?a:void 0)}else e=m;i(e)}}()},[r,u,t,m,c,h]),n}(o,y);return(0,f.FD)("div",{className:"mdc-card__content",children:[(0,f.FD)("div",{className:"subscription-cart-detail",children:[(0,f.Y)("b",{children:"Billing:"})," ",(0,f.Y)(_,{group:n,interval:a})," ",i?(0,f.FD)(f.FK,{children:[I," ",y.size>1&&`for ${(0,p.ks)({hasTeam:i,size:y.size})}`]}):(0,f.FD)("span",{children:["(",I," /",Y,")"]}),"month"===a&&(0,f.Y)("b",{className:"green",children:(0,f.Y)(N,{})})]}),(0,f.FD)("div",{className:"subscription-cart-detail",children:[(0,f.Y)(w,{status:E})," ",r&&(0,f.FD)("span",{children:["(your ",e(o)||""," trial will end in"," ",(0,f.Y)(l.A,{date:1e3*T}),")"]}),m&&!0===h&&(0,f.FD)("span",{children:["- Pending Cancellation on"," ",(0,u.Ey)(m,{hour:"numeric",minute:"numeric"})]})]}),v&&(0,f.FD)("div",{className:"subscription-cart-detail",children:[(0,f.Y)("b",{children:"Active promo code:"})," ",(0,f.Y)(g,{discount:v})]}),o!==c.x1&&(0,f.FD)("div",{className:"subscription-cart-detail",children:[(0,f.FD)("b",{children:["Next"," ",A===c.uq.INVOICE?"invoice":"automatic payment",":"," "]}),!0===h?"n/a":(0,f.FD)(f.FK,{children:[(0,f.Y)(l.A,{date:1e3*m})," ",(0,f.FD)("span",{children:["(",(0,u.Ey)(m),")"]})]})]}),C?.error&&(0,f.Y)(D,{paymentIntent:C})]})}function R({compact:e=!1}){const{subscriptionState:t}=(0,s.useContext)(b.A),{interval:n,isFree:i,isTeamMember:a,isTrialing:r,subscription:{cancelAtPeriodEnd:o,currentPeriodEnd:l,paymentIntent:c,status:d,trialEnd:h}}=t;if(i||a)return null;const m=!(i||a),p=l&&o;return e?(0,f.FD)("div",{className:"mdc-card__content",children:[(0,f.Y)("div",{className:"subscription-cart-detail",children:(0,f.Y)(w,{status:d})}),"month"===n&&(0,f.Y)("div",{className:"subscription-cart-detail",children:(0,f.Y)(N,{})}),r&&!p&&(0,f.FD)("div",{className:"subscription-cart-detail",children:["Your trial will automatically convert to a full membership on"," ",(0,u.Ey)(h,{day:"numeric",month:"long",year:"numeric"}),"."]}),p&&(0,f.FD)("div",{className:"subscription-cart-detail",children:["Pending cancellation on"," ",(0,u.Ey)(l,{hour:"numeric",minute:"numeric"}),". ",m&&(0,f.Y)(I,{})]}),c?.error&&(0,f.Y)(D,{paymentIntent:c})]}):(0,f.Y)(O,{})}},139(e,t,n){n.d(t,{A:()=>f});var i=n(6942),a=n.n(i),r=n(9869),o=n(4929),s=n(7563),l=n(8847),c=n(8028),d=n(3843),u=n(5391),h=n(6660),m=n(4681),p=n(9698);function f({className:e,initialPlanType:t,isLink:n,onClick:i,source:f=d.YH.UPGRADE_BUTTON,title:g,...b}){const{subscriptionState:v}=(0,r.useContext)(c.A),[A,C]=(0,r.useState)(!1),E=(0,r.useCallback)(async e=>{C(!0),(0,s.Dh)({action:d.Jw.UPGRADE,details:{initialPlanType:t},showView:!0,source:f,view:e})},[t,f]);return(0,r.useEffect)(()=>{const e=function(){const e=(0,m.wz)(),{checkoutDialog:t,coupon:n,teamData:i,upgrade:a}=(0,o.vA)();return n&&void 0===i&&void 0===t?e?d.al.SELECT_PLAN:d.al.SIGN_UP:void 0!==a?d.al.UPGRADE_PACKAGE:null}();e&&E(e)},[E]),(0,l.TK)(A,v),(0,p.Y)(u.A,{className:a()(e,{"btn-link":n}),"data-action":d.pM.RECLICK,onClick:(0,r.useCallback)(e=>{i(e,()=>{t&&(0,h.s)("dialog",{action:"submit",name:`get_started_${t}`}),(0,s.$7)("submit",d.Tt.PREMIUM.toLowerCase()),E(d.al.UPGRADE_PACKAGE)})},[t,i,E]),...b,children:g})}}
2,6367(e,t,n){n.d(t,{i:()=>B,A:()=>q});var i=n(9170),a=n(6942),r=n.n(a),o=n(4843),s=n(9869),l=n(2109),c=n(4918),d=n(1818),u=n(7071),h=n(3544),m=n(7563),p=n(9698);function f({showLabel:e}){return(0,p.FD)("div",{className:r()("YlOXBdw8Lt","row-flex flex-align-center gap-10"),children:[e&&(0,p.FD)("div",{className:"FteTBlevME",children:[(0,p.Y)("span",{"aria-label":"SSL Encrypted Payments",className:"tooltip-bottom-left",role:"tooltip",children:(0,p.Y)("i",{className:r()("icon icon-lock-black","GGEk8JGBQp")})}),"Secure Payments"]}),(0,p.Y)("div",{className:"MbMv4aEbIF",children:["amex","visa","mastercard","discover","jcb","diners-club","union-pay"].map(e=>(0,p.Y)("img",{alt:e,height:18,loading:"lazy",src:`/images/payment/${e}.svg`,width:28},e))})]})}var g=n(2466),b=n(8028),v=n(139),A=n(7752);function C({className:e,currency:t,price:n,visible:i=!0}){return i&&(0,p.FD)("span",{className:r()("_BfrxT1CiH",e),children:["Save ",(0,c.vv)(n,t)," per user."]})}var E=n(6710),T="_Udp9FKjLB",y="qwpF5R_wZL",S="G5jYvLithJ",N=n(3843),_=n(1539),Y=n(5391),I=n(4681);function D({children:e,price:t}){return(0,p.FD)(p.FK,{children:[e&&(0,p.Y)("div",{className:"title-sm",children:e}),(0,p.Y)("div",{className:"margin-b-1 price-wrapper",children:(0,p.Y)("div",{className:"format-amount",children:t})})]})}function w({bottomSection:e,button:t,description:n,isEnterprisePlan:i,isPremiumPlan:a,isProPlan:s,isSelectPlanDialog:c,planType:d,price:u,tier:f,title:g,topLabel:b}){const[v]=(0,o.fp)(I.N6),[C]=(0,o.fp)(I.p9),[w]=(0,o.fp)(I.zq),O=v&&!("team"===C?.subscription?.group)&&!w,R=!i&&O&&!c&&"tier-4"===f,x=R?(0,p.Y)(Y.A,{raised:!0,className:"margin-top-1 btn-lg",onClick:()=>{a&&(window.location.href=l.A.CHAT),s&&(0,m.Dh)({action:N.Jw.TRY_SUBSCRIPTION,details:{initialPlanType:d},showView:!0,source:N.YH.AUTH,view:N.al.UPGRADE_PACKAGE})},children:(0,p.Y)("b",{children:"Try for Free"})}):t,P=R?(0,p.Y)(A.A,{className:"sKQW2mY3Tf",source:"pricing-plan",url:(0,h.zf)(l.A.CALENDLY_LAWINSIDER_SIMPLEAI_DEMO_LINK,{utm_content:"pricing-plan"}),children:"Book a Demo"}):null,F=Boolean(P)||i||!O,k="tier-4"===f?"/images/common/simple-ai-logo.svg":null;return(0,p.FD)("div",{className:"plan-column plan-column-v2",children:[(0,p.FD)("div",{className:"plan-info",children:[(0,p.Y)("b",{className:"plan-title-experimental",children:k?(0,p.Y)("img",{alt:g,className:r()("YEIUCQAc_o",{[T]:"tier-0"===f}),src:k}):g}),(0,p.Y)("p",{className:"plan-description",children:n}),b]}),(0,p.Y)(D,{price:u}),(0,p.Y)("div",{className:r()("full-width",i&&"margin-b-3"),children:x}),F&&(0,p.Y)("div",{className:r()("kX16dDsg_0",{[S]:i||!O,[y]:!O&&!i}),children:P}),(0,p.Y)(E.A,{caption:i?(0,p.Y)("b",{children:"Everything in SimpleAI, plus:"}):null,columns:1,featuresToOverwrite:_.WK[f],isEnterprisePlan:i,isProPlan:!a,showTryPremiumLabel:!1}),e]})}function O({button:e,description:t,isSelectPlanDialog:n,planType:i,price:a,title:r,topLabel:o}){const{products:l}=(0,s.useContext)(b.A),{tier:c}=l[i],d="tier-0"===c,u="tier-4"===c;return(0,p.Y)(w,{button:e,description:t,isPremiumPlan:d,isProPlan:u,isSelectPlanDialog:n,planType:i,price:a,tier:c,title:r,topLabel:o})}var R="BSfZlU9g1k",x=n(6660);const P={month:"MONTHLY",year:"ANNUAL"};function F({annualSavings:e,className:t}){const[n,i]=(0,o.fp)(_._O);return(0,s.useEffect)(()=>{i("month")},[i]),(0,p.Y)("div",{className:r()("P6CKjhiR1F",t),children:["year","month"].map(t=>(0,p.FD)(Y.A,{className:r()("Vyqgh7FPY0",{[R]:t===n}),onClick:()=>{(0,x.s)("switch_plan_period",{value:P[t]}),i(t)},children:[P[t],"year"===t&&e>0&&(0,p.FD)("span",{className:"regular-text",children:["(SAVE UP TO ",e,"%)"]})]},t))})}var k=n(7399),L=n(2199),M=n(7065),U=n(9028);const B={[l.xT]:Number.parseInt(4900,10),[l.HL]:Number.parseInt(5900,10),[l.uP]:Number.parseInt(29900,10),[l.cz]:Number.parseInt(49900,10)},K="WELCOME10",H={applicable_plans:[],duration_in_months:12,percent:10};function j({className:e,isLink:t,isRecurring:n,isSelectPlanDialog:i,planType:a,raised:r,size:l="lg",source:c,titleProp:d}){const[u]=(0,o.fp)(I.el),[h]=(0,o.fp)(I.aQ),{products:m,shouldShowIntroductoryPrice:f}=(0,s.useContext)(b.A),{tier:g}=m[a]||{},A="tier-0"===g&&h,C="tier-4"===g&&u;let E;return E=n?f(a)&&!A?"Start Trial":A?"Switch to Premium":C?"Upgrade to Pro":"Buy Now":"Buy Now",(0,p.Y)(z,{Component:v.A,action:N.Jw.TRY_SUBSCRIPTION,className:e,initialPlanType:a,isLink:t,isSelectPlanDialog:i,outlined:!r&&!t,raised:r,size:t?void 0:l,source:c,title:d||E})}function z({Component:e,action:t,disabled:n,isSelectPlanDialog:i,...a}){const{initialPlanType:r}=a,{currency:d,rawPrices:u}=(0,s.useContext)(b.A),[,h]=(0,o.fp)(m.vT);return(0,p.Y)(e,{"data-action":N.pM.RECLICK,onClick:(0,s.useCallback)((e,n)=>{(0,x.s)("add_to_cart",{currency:d,items:[{item_id:r}],value:(0,c.b2)(u[r])}),(0,I.h2)()!==l.rZ.NON_REGISTERED||i?(h(N.Tt.PREMIUM),n()):(0,m.Dh)({action:t,details:{initialPlanType:r},e,showView:!0,source:N.YH.PRICING_PAGE,view:N.al.CONTINUE_WITH_EMAIL})},[t,r,i,h,d,u]),...a})}function W({planType:e,subtitle:t}){const{currency:n,discountRawPrices:i,products:a,regularPriceForPlanType:r,renderedPrices:o,shouldShowIntroductoryPrice:u,trialPeriods:h,trialPrices:m}=(0,s.useContext)(b.A),{interval:f}=a[e];if(u(e)){const t=0===m[e]?(0,p.Y)("span",{className:"price-container highlight-price",children:"FREE"}):(0,c.vv)(m[e],n,!0),i="month"===f?_.Nt:_.sg;return(0,p.FD)(p.FK,{children:[t," ",(0,p.FD)("div",{className:"row-price",children:[(0,p.FD)("div",{className:"row-price__trial",children:[h[e]," Day Trial"]}
2),(0,p.FD)("div",{className:"row-price__discount",children:["Then ",o[e]," ",i]})]})]})}return(0,p.FD)(p.FK,{children:[(0,c.vv)((0,d.ZC)(i[e],f,!0),n,!0,2),(0,p.FD)("div",{className:"row-price",children:[(0,p.FD)("div",{className:"row-price__trial",children:[_.E4[e]?.planHeading," ",(0,p.Y)(C,{className:"discount-badge-sm",currency:n,price:r(e)-i[e],visible:[l.Ih,l.C7].includes(e)})]}),(0,p.Y)("div",{className:"row-price__discount",children:u(e)?t:_.E4[e]?.planSubHeading})]})]})}function G({description:e,descriptivePeriodSubtitle:t,isSelectPlanDialog:n,perPeriodSubtitle:i,planType:a,raised:r,source:u,tierLimits:h,topLabel:m}){const[f]=(0,o.fp)(I.N6),{currency:g,products:v,rawPrices:A,recurringPlans:C,shouldShowIntroductoryPrice:E}=(0,s.useContext)(b.A),[T]=(0,o.fp)(I.p9),[y]=(0,o.fp)(I.zq),S="team"===T?.subscription?.group;(0,s.useEffect)(()=>{f&&(0,x.s)("view_item",{currency:g,items:[{item_id:a}],value:(0,c.b2)(A[a])})},[g,a,f,A]);const N=!1!==C[a],{tier:Y}=v[a]||{},D=T?.subscription?.tier,w=T?.subscription?.group?(0,d.wZ)(T.subscription):void 0,R=!n&&!f&&!S&&"tier-0"===D&&"tier-4"===Y;return(0,p.Y)(O,{button:(0,p.FD)(p.FK,{children:[f&&!S&&!y&&(0,p.Y)(j,{className:"margin-top-1",isRecurring:N,isSelectPlanDialog:n,planType:a,raised:r,source:u}),R&&(0,p.Y)(L.A,{raised:!0,className:"margin-top-1",href:`${l.A.ACCOUNT}?${l.uB.upgradeToPro}=1`,size:"lg",children:"Upgrade"}),!f&&n&&(0,p.Y)("div",{className:"margin-top-1",children:w===a?(0,p.Y)("b",{className:"margin-top-1 selected-plan-label",children:"This is your plan"}):(0,p.Y)(j,{raised:!0,className:"margin-top-1",isRecurring:N,isSelectPlanDialog:n,planType:a,source:u})})]}),description:e,hasTeam:S,isFree:f,isRecurring:N,isSelectPlanDialog:n,planType:a,price:(0,p.Y)(W,{showSaving:!0,planType:a,subtitle:E(a)?i:t}),tierLimits:h,title:_.UD[Y],topLabel:m})}function $(){const{applyDiscount:e,currency:t,discount:{id:n},shouldShowIntroductoryPrice:a}=(0,s.useContext)(b.A),[r,h]=(0,s.useState)(!1),[m]=(0,o.fp)(I.p9),f=Boolean(n),[g,v]=(0,o.fp)(_.eF),[A]=(0,o.fp)(I.N6),C=A&&(0,d.uZ)(m?.trialUsed)&&!a(l.xw),E=(0,s.useCallback)(async t=>{const{target:n}=t,{checked:i}=n;if(h(!0),i){const t=await fetch(`/api/payments/coupon/${K}`,{credentials:"same-origin",method:"GET"});if(t.ok){const n=await t.json();e(n),v(n),(0,u.xE)("Your promo code has been applied!")}else e({amount:null,id:null,percent:null}),(0,u.xE)(`No such promo code: ${K}`)}else e({amount:null,id:null,percent:null}),v(null);h(!1)},[e,v]);return C||n?(0,p.Y)("div",{className:"coupon-checkbox-container",style:r?{color:i.LW}:null,children:(0,p.FD)(M.A,{checked:f,disabled:r,onChange:E,children:[(0,p.FD)("b",{children:["Use promo code: ",null!=n?n:K]})," ",(0,p.Y)("span",{children:`(Apply this promo code and ${(0,c.id)(null!=g?g:H,t)})`})]})}):null}function V(){return(0,p.Y)("div",{style:{fontSize:14,fontWeight:"bold",minHeight:"42px"},children:"Contact sales for pricing"})}function q({group:e="individual",isSelectPlanDialog:t,isSignUpFlow:n,showBg:i=!1,showTitle:a=!1}){const[c,v]=(0,s.useState)(!0),{discountRawPrices:C,products:E}=(0,s.useContext)(b.A),[T]=(0,o.fp)(_._O),[y]=(0,o.fp)(I.N6),S=(0,k._)(k.A.PRICING_PRODUCTS_SHOW_PREMIUM_PRODUCT),D=Object.keys(_.E4).filter(t=>{const n=E[t];if(!n)return!1;const{group:i,interval:a,tier:r}=n;return!(!(0,d.a4)()&&"tier-4"===r||!S&&"tier-0"===r||i!==e||"month"!==a&&"year"!==a)}),O=D.filter(e=>E[e].interval===T).map(e=>_.E4[e]),R=function(e,t,n){const i={};for(const a of e){const{interval:e,tier:r}=n[a],o=t[a];i[r]||(i[r]={annualCost:0,monthlyCost:0}),"month"===e?i[r].monthlyCost=12*o:"year"===e&&(i[r].annualCost=o)}let a=0;for(const{annualCost:e,monthlyCost:t}of Object.values(i))if(t>0){const n=(t-e)/t*100;n>a&&(a=n)}return Math.floor(a)}(D,C,E);(0,s.useEffect)(()=>(0,u.DS)(()=>{v(!1)}),[]);const x=t&&!y;return O[0]?(0,p.Y)("div",{className:r()({"pricing text-center":!t,"top-header-bg":i,"top-header-bg--padding":a}),children:(0,p.FD)("div",{className:"container-fluid",children:[a&&(0,p.FD)(p.FK,{children:[(0,p.Y)("h1",{className:"section-title",children:(0,p.Y)(U.A,{children:"AI-Powered Contracts"})}),(0,p.Y)("img",{alt:"Powered by simple docs",className:"powered-by-logo",src:"/images/common/powered-by-simple-docs-grey.svg"})]}),(0,p.FD)("div",{className:r()({"loading-pricing-state":c}),children:[(0,p.FD)("section",{className:"dark-blue-gradient-card margin-b-1",children:[!x&&(0,p.Y)("h2",{className:"title-vertical-line light-title grey-bordered-card__title color-white",children:(0,p.Y)("span",{className:"title-vertical-line__inner",children:"Trusted by 10,000+ Customers Worldwide"})}),(0,p.Y)(F,{annualSavings:R}),(0,p.Y)($,{}),(0,p.FD)("div",{className:r()("pricing-plan pricing-plan-v2",{"pricing-plan-v2--select-plan":t}),children:[O.map(e=>(0,p.Y)(G,{raised:!0,description:e.planDescription,isSelectPlanDialog:t,...e},e.planType)),!t&&(0,p.Y)(w,{isEnterprisePlan:!0,button:(0,p.Y)(A.A,{raised:!0,className:"margin-top-1 btn-lg",dialogTitle:"Schedule Your Enterprise Demo",url:(0,h.zf)(l.A.CALENDLY_LAWINSI
2DER_SIMPLEAI_DEMO_LINK,{utm_content:"enterprise"}),children:"Contact Sales"}),description:_.ie["tier-5"],price:(0,p.Y)(V,{}),tier:"tier-5",title:"Enterprise"})]})]}),!t&&(0,p.FD)("div",{className:"row-flex flex-align-center flex-justify-center gap-10",children:[(0,p.Y)(f,{})," ",(0,p.Y)(g.A,{showLabel:!0})]}),n&&(0,p.FD)("b",{className:"select-plan__free-account",children:["Not ready to start a trial?"," ",(0,p.Y)(Y.A,{outlined:!0,onClick:()=>{(0,m.$7)("submit",N.Tt.FREE.toLowerCase()),(0,m.Dh)({forced:!0,view:N.al.PROFILE_INFO_DIALOG})},children:"Continue with free account"})]})]})]})}):null}q.selector="plans-table"},1825(e,t,n){n.d(t,{A:()=>o});var i=n(6942),a=n.n(i),r=n(9698);function o({children:e,className:t,onScroll:n}){return(0,r.Y)("ul",{className:a()("vPihdzQXzA",t,"visible-scroll"),onScroll:n,children:e})}},2878(e,t,n){n.d(t,{G:()=>v,A:()=>A});var i=n(3269),a=n.n(i),r=n(1132),o=n.n(r),s=n(9869),l=n(7071),c=n(4579),d=n.n(c),u=n(9511),h=n.n(u),m=n(6536),p=n(5391),f=n(9698);let g=function(e){function t(...t){var n;return(n=e.call.apply(e,[this].concat(t))||this).textField=null,n.copyLink=()=>{n.textField.select(),document.execCommand("copy"),(0,l.xE)("Copied!")},n}return h()(t,e),t.prototype.render=function(){const{joinLink:e}=this.props;return e?(0,f.FD)("div",{className:"copy-link",children:[(0,f.Y)(m.A,{ref:e=>this.textField=e,readOnly:!0,textarea:!0,className:"full-width copy-link__textarea",label:"Share this private URL and your team members can self register",value:e,onClick:this.copyLink}),(0,f.Y)("div",{className:"copy-link__tooltip",children:(0,f.Y)("span",{"aria-label":"Copy",role:"tooltip",children:(0,f.Y)("span",{className:"mdc-icon-toggle",children:(0,f.Y)(p.A,{className:"btn-icon",size:"lg",onClick:this.copyLink,children:(0,f.Y)("i",{className:"icon icon-copy"})})})})})]}):null},d()(t)}(s.Component);var b=n(4681);function v(e,t){return!(e&&!new RegExp(`[@.]${e}$`).test(t))}function A({hasTeam:e,isAdmin:t,onInvite:n,resetJoinLink:i,showJoinLink:r,teamData:c}){const[d,u]=(0,s.useState)(""),[h,A]=(0,s.useState)(""),[C,E]=(0,s.useState)(!1),[T,y]=(0,s.useState)(!1);return(0,f.FD)("div",{className:"invite-member margin-b-1",children:[r&&(0,f.FD)(f.FK,{children:[(0,f.Y)(g,{joinLink:c.joinLink}),e&&(0,f.Y)("p",{className:"reset-link",children:(0,f.Y)(p.A,{onClick:()=>(0,l.lJ)("Are you sure you want to reset the join link?",{callback:async()=>{await i()}}),children:"Reset link"})})]}),(0,f.FD)("form",{children:[(0,f.Y)("b",{className:"invite-label text-left",children:"Invite Members"}),(0,f.Y)("p",{className:"tab-info",children:"Each member will receive an email invitation to join as soon as the payment is complete (in the next step)"}),(0,f.FD)("div",{className:"invited-form",children:[(0,f.Y)("div",{className:"invited-form__input",children:(0,f.Y)(m.A,{className:"full-width team-input",invalid:!!h,label:"Enter team member email",value:d,onChange:e=>{u(e.target.value.toLowerCase()),A(""),y(!1)}})}),(0,f.Y)(p.A,{raised:!0,disabled:C||h||!(0,l.xd)(d),type:"submit",onClick:async e=>{e.preventDefault();const{domain:t,invites:i,members:r}=c;if([].concat(a()(o(),i),a()(o(),r)).some(e=>[e.user,e.email].includes(d)))return void A("This email is already registered");const s=(0,b.wz)();d!==s.email?v(t,d)?(E(!0),await n({email:d}),u(""),E(!1)):y(!0):A("You can't invite yourself")},children:"Invite"})]}),h&&(0,f.Y)("p",{className:"invalid-feedback",children:h})]}),T&&(0,f.FD)("p",{className:"text-left",children:["You can only invite users with domain ",(0,f.Y)("b",{children:c.domain})," ",t?(0,f.Y)(f.FK,{children:"per your team settings"}):(0,f.Y)(f.FK,{children:"as set by your team administrator"})]})]})}},9164(e,t,n){n.d(t,{A:()=>u});var i=n(3269),a=n.n(i),r=n(1132),o=n.n(r),s=n(9869),l=n(3490),c=n(5391),d=n(9698);function u({autoFocus:e,setInvites:t,teamDomain:n}){const[i,r]=(0,s.useState)(4),[u,h]=(0,s.useState)({});return(0,s.useEffect)(()=>{t(a()(o(),new Set(Object.values(u).filter(Boolean))))},[t,u]),(0,d.FD)(d.FK,{children:[(0,d.Y)("h2",{className:"title-xs",children:"Invite others to join this team!"}),(0,d.Y)("div",{className:"invite-members",children:Array.from({length:i},(e,t)=>t).map(t=>{const i=`invite-${t}`;return(0,d.FD)("div",{className:"invite-field",children:[(0,d.Y)(l.A,{autoComplete:"off",autoFocus:e,className:"invite-field__inner",label:"Email Address",name:i,type:"text",value:u[i]||"",onFieldChange:e=>{h(t=>({...t,[i]:e.target.value}))}}),(0,d.FD)("div",{className:"invite-field__domain",children:["@",n]})]},i)})}),(0,d.Y)("div",{className:"invite-btn-field text-center",children:(0,d.Y)(c.A,{outlined:!0,onClick:()=>{r(e=>e+1)},children:"+ Add Another"})})]})}},6331(e,t,n){n.d(t,{A:()=>C});var i=n(6942),a=n.n(i),r=n(4843),o=n(9869),s=n(2109),l=n(7563),c=n(8847),d=n(8028),u=n(7848),h=n(3843),m=n(1539),p=n(5159),f=n(7693),g=n(6660),b=n(4681),v=n(9698);function A({children:e,className:t,disabled:n,onClick:i,outlined:a,raised:r}){return(0,v.Y)(f.zh,{className:t,"data-action":h.pM.RECLICK,disabled:n,outlined:a,raised:r,onClick:i,children:e})}function C({ButtonComponent:e=A,className:t,disabled:n=!1,icon:i,isPayForTeam:f=!1,onClick:C,outlined:E,raised:T,showJoinLink:y=!0,tag:S,title:N}){const[_]=(0,r.fp)(b.N6),{subscriptionState:Y}=(0,o.useContext)(d.A),{isFree:I,isTeamMember:D}=Y,[w]=(0,r.fp)(b.h1),{closeDialogFromUrl:O,openDialogFromUrl:R,openFromUrl:x}=(0,p.A)(s.uB.teamData),[,P]=(0,r.fp)(m.zq);(0,c.TK)(x,Y);const{handleTeam:F,title:k}=w?{handleTeam:R,title:I?"Pay for Team":"Team Settings"}:_&&!D?{handleTeam:()=>{P(!0),(0,l.Dh)({action:h.Jw.TRY_SUBSCRIPTION,showView:!0,source:h.YH.HOME_PAGE,view:h.al.SELECT_PLAN})},title:"Invite Team"}:{handleTeam:R,title:"Invite Team"};return(0,v.FD)(v.FK,{children:[(0,v.FD)(e,{className:t,disabled:n,outlined:E,raised:!(!T&&!f)||void 0,tag:S,onClick:(0,o.useCallback)(e=>{C(e,()=>
2{(0,g.s)("dialog",{action:"show",name:w?"manage_team":"create_team"}),F()})},[w,C,F]),children:[i&&(0,v.Y)("i",{className:a()("mdc-button__icon icon",i)}),N||k]}),(0,v.Y)(u.A,{open:x,showJoinLink:y,subscriptionState:Y,onClose:O})]})}},7848(e,t,n){n.d(t,{A:()=>we});var i=n(3269),a=n.n(i),r=n(1132),o=n.n(r),s=n(4579),l=n.n(s),c=n(9511),d=n.n(c),u=n(9869),h=n(6794),m=n(7071),p=n(1751),f=n(5391),g=n(9698);function b(){const{loading:e,resumeSubscription:t}=(0,p.a)();return(0,g.FD)("div",{className:"VXZTlVc5jn",children:[(0,g.Y)("p",{children:"Your membership is pending cancelation, reactivate to add users"}),(0,g.Y)(f.A,{isDefaultAction:!0,outlined:!0,disabled:e,onClick:async()=>{await t()},children:"Reactivate Membership"})]})}var v=n(4929);const A=({invites:e,members:t})=>[].concat(a()(o(),e),a()(o(),t)).length>1;var C=n(1642),E=n(2878),T=n(6822),y=n(8994),S=n(4893);function N({hasTeam:e,invites:t,isAdmin:n,resendInvitation:i,revokeInvitation:a}){const[r,o]=(0,u.useState)(!1),s=(0,u.useCallback)(async(e,t)=>{o(!0),await e(t),o(!1)},[]);return 0===t.length?null:(0,g.FD)("div",{className:"margin-b-1",children:[(0,g.Y)("b",{className:"invite-label text-left",children:"Pending Invitations"}),(0,g.Y)(T.A,{children:t.map(t=>(0,g.FD)(y.A,{children:[(0,g.Y)("span",{children:t.user}),(0,g.FD)(S.A,{children:[n&&e&&(0,g.Y)(f.A,{disabled:r,onClick:()=>s(i,t),children:"Resend"}),n&&(0,g.Y)(f.A,{disabled:r,onClick:()=>
2(0,m.lJ)(`Are you sure you want to delete pending invitation for ${t.user}?`,{callback:async()=>{await s(a,t)}}),children:"Delete"})]})]},t.user))})]})}var _=n(4843),Y=n(3059),I=n(4681);function D({isAdmin:e,members:t,removePermission:n}){const[i]=(0,_.fp)(I.p9);return t?(0,g.FD)(g.FK,{children:[(0,g.Y)("b",{className:"invite-label text-left",children:"Active Members"}),(0,g.Y)(T.A,{children:t.map(t=>(0,g.FD)(y.A,{children:[(0,g.FD)(Y.A,{children:[t.email,t.email===i.email&&(0,g.Y)("span",{className:"item-label",children:"(Your account)"})]}),e&&t.email!==i.email&&(0,g.Y)(S.A,{children:(0,g.Y)(f.A,{onClick:()=>(0,m.lJ)(`Are you sure you want to delete ${t.email}?`,{callback:async()=>{await n(t)}}),children:"Delete"})})]},t.email))})]}):(0,g.Y)("p",{children:"The user list is empty. You can add new users."})}function w({acceptRequest:e,isAdmin:t,rejectRequest:n,requests:i}){const[a,r]=(0,u.useState)(!1);return 0===i.length?null:(0,g.FD)("div",{className:"margin-b-1",children:[(0,g.Y)("b",{className:"invite-label text-left",children:"Pending Requests"}),(0,g.Y)(T.A,{children:i.map(i=>(0,g.FD)(y.A,{children:[(0,g.Y)("span",{children:i.user}),t&&(0,g.FD)(S.A,{children:[(0,g.Y)(f.A,{disabled:a,onClick:async()=>{r(!0),await e(i),r(!1)},children:"Accept"}),(0,g.Y)(f.A,{disabled:a,onClick:()=>{(0,m.lJ)(`Are you sure you want to reject pending request for ${i.user}?`,{callback:async()=>{r(!0),await n(i),r(!1)}})},children:"Reject"})]})]},i.token))})]})}var O=n(6660);const R="[USER_EMAIL]";function x({hasTeam:e,isAdmin:t,showJoinLink:n,teamData:i,updateTeamData:r}){const{invites:s,members:l,pendingRequests:c,size:d,teamId:h}=i,p=(0,u.useCallback)(async(e,t,n)=>{const{[t]:a}=i;if(h){const t=await fetch(`/api/team/${h}/tokens/${e.token}`,{credentials:"same-origin",method:"DELETE"});if(!t.ok)return void(0,m.xE)(`Couldn't save changes: ${t.statusText}`)}r({size:"invites"===t?d-1:d,[t]:a.filter(t=>t.token!==e.token)}),(0,m.xE)(n.replace(R,e.user))},[d,i,h,r]);return(0,g.FD)(g.FK,{children:[(0,g.Y)(w,{acceptRequest:async e=>{const t=await fetch(`/api/team/${h}/requests/${e.token}`,{credentials:"same-origin",method:"PATCH"});t.ok||(0,m.xE)(`Couldn't save changes: ${t.statusText}`);const{invites:n,members:i,requests:a}=await t.json();r({invites:n,members:i,pendingRequests:a}),(0,O.s)("team_accept_request"),(0,m.xE)(`${e.user} request accepted`)},isAdmin:t,rejectRequest:async e=>{await p(e,"pendingRequests",`${R} request rejected`)},requests:c}),(0,g.Y)(E.A,{hasTeam:e,isAdmin:t,resetJoinLink:async()=>{const{join_link:e}=await(0,m.RD)(`/api/team/${h}/join_token`,{method:"PATCH"});r({joinLink:e}),(0,m.xE)("Join link updated")},showJoinLink:n,teamData:i,onInvite:async({email:t})=>{const n=e=>{r({invites:[e].concat(a()(o(),s)),size:d+1})};if(e){const e=await fetch(`/api/team/${h}/invitations`,{body:JSON.stringify({email:t}),credentials:"same-origin",method:"POST"});if(!e.ok)return void(0,m.xE)(`Couldn't share with ${t}`);const{email:i,is_pending:s,token:l}=await e.json();s?r({pendingRequests:[].concat(a()(o(),c),[{token:l,user:i}])}):n({token:l,user:i}),(0,O.s)("team_send_invite"),(0,m.xE)(`Shared with ${t}`)}else n({token:t,user:t})}}),(0,g.Y)(N,{hasTeam:e,invites:s,isAdmin:t,resendInvitation:async e=>{const{user:t}=e,n=await fetch(`/api/team/${h}/invitations/resend`,{body:JSON.stringify({email:t}),credentials:"same-origin",method:"POST"});n.ok?(0,m.xE)(`Invitation was resent to user ${t}`):(0,m.xE)(`Couldn't resend invitation: ${n.statusText}`)},revokeInvitation:async e=>{await p(e,"invites",`${R} will no longer have access`)}}),(0,g.Y)(D,{isAdmin:t,members:l,removePermission:async({email:e})=>{const t=await fetch(`/api/team/${h}/permissions/${e}`,{credentials:"same-origin",method:"DELETE"});t.ok?(r({members:l.filter(t=>t.email!==e)}),(0,O.s)("team_remove_member"),(0,m.xE)(`${e} removed from members`)):(0,m.xE)(`Couldn't save changes: ${t.statusText}`)}})]})}var P=n(6536);const F=n(1879).xA;var k=n(335),L=n(2970),M=n(7693);const U=function(e){function t(...t){var n;return(n=e.call.apply(e,[this].concat(t))||this).state={disableSubmit:!0,domain:void 0,processing:!1,skipAdmin:!1,useConfirmation:!0},n.onChange=(e,t)=>
2{const{hasTeam:i,onSettingsSubmit:a,teamData:r}=n.props,o={[e]:t};n.setState({[e]:t},async()=>{if(i){const e={...n.state},t=function(e,t){for(const n of["domain","skipAdmin","useConfirmation"])if(e[n]!==t[n])return!1;return!0}(r,e);n.setState({disableSubmit:t})}else await a(o)})},n.onSubmit=async e=>{e.preventDefault();const{domain:t,processing:i,...a}=n.state,{onSettingsSubmit:r}=n.props;if(n.setState({disableSubmit:!0,processing:!0}),t&&!(0,m.Nq)(t))return(0,m.xE)("Please enter a valid domain name"),void n.setState({processing:!1});await r({domain:t,...a}),n.setState({processing:!1})},n}d()(t,e),t.getDerivedStateFromProps=function(e,t){const{teamData:n}=e;if(void 0===t.domain&&n){const{domain:e,name:t,skipAdmin:i,useConfirmation:a}=n;return{domain:e||"",name:t,skipAdmin:i,useConfirmation:a}}return null};var n=t.prototype;return n.componentDidMount=function(){const e=function(){let e=(0,v.vA)()?.teamData;if(void 0!==e)try{e=JSON.parse(e),"object"!=typeof e&&(e={})}catch{e={}}return e}();void 0!==e&&this.setState(e)},n.render=function(){const{hasTeam:e,teamData:t}=this.props,{disableSubmit:n,domain:i="",processing:a,skipAdmin:r,useConfirmation:o}=this.state;return(0,g.FD)("form",{method:"POST",children:[(0,g.Y)("h4",{className:"margin-top-1 regular-text text-left",children:"Settings"}),(0,g.Y)("b",{className:"invite-label text-left",children:"Team Domain"}),(0,g.Y)("p",{className:"tab-info",children:"Only users with an email address @ this team domain will be able to join your team"}),(0,g.Y)(P.A,{className:"full-width team-settings__input team-input",label:"Enter your team domain (e.g. wikipedia.org)",value:i,onChange:e=>this.onChange("domain",e.target.value)}),(0,g.FD)(F,{className:"team-settings__container grid-no-padding",children:[(0,g.Y)(k.A,{className:"text-left",span:12,children:(0,g.FD)(L.A,{checked:i&&o,className:"team-settings__switch",disabled:!i,onChange:()=>this.onChange("useConfirmation",!o),children:[(0,g.Y)("b",{className:"invite-label",children:"Require permission to join"}),"Users will require your permission to join. If turned off, users with an email address from your domain name can add themselves to your team without approval. (Team domain name is required to enable this setting.)"]})}),(0,g.Y)(k.A,{className:"text-left",span:12,children:(0,g.FD)(L.A,{checked:r,className:"team-settings__switch",onChange:()=>{A(t)||(0,m.xE)("You must invite at least one team member before enabling this option.",{callback:()=>this.onChange("skipAdmin",!1),dialog:!0}),this.onChange("skipAdmin",!r)},children:[(0,g.Y)("b",{className:"invite-label",children:"I'm a billing contact only"}),"(not counted as a subscriber)"]})}),e&&(0,g.Y)(k.A,{className:"text-left",span:12,children:(0,g.Y)(M.zh,{raised:!0,disabled:a||n,type:"submit",onClick:this.onSubmit,children:"Update settings"})})]})]})},l()(t)}(u.Component);var B,K=n(1519),H=n(9144),j=n(1897),z=n(6540),W=n(9376),G=n(1635),$=n(1468),V={ANIMATING:"mdc-tab-scroller--animating",SCROLL_AREA_SCROLL:"mdc-tab-scroller__scroll-area--scroll",SCROLL_TEST:"mdc-tab-scroller__test"},q={AREA_SELECTOR:".mdc-tab-scroller__scroll-area",CONTENT_SELECTOR:".mdc-tab-scroller__scroll-content"},J=function(e){this.adapter=e},X=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,G.C6)(t,e),t.prototype.getScrollPositionRTL=function(){var e=this.adapter.getScrollAreaScrollLeft(),t=this.calculateScrollEdges().right;return Math.round(t-e)},t.prototype.scrollToRTL=function(e){var t=this.calculateScrollEdges(),n=this.adapter.getScrollAreaScrollLeft(),i=this.clampScrollValue(t.right-e);return{finalScrollPosition:i,scrollDelta:i-n}},t.prototype.incrementScrollRTL=function(e){var t=this.adapter.getScrollAreaScrollLeft(),n=this.clampScrollValue(t-e);return{finalScrollPosition:n,scrollDelta:n-t}},t.prototype.getAnimatingScrollPosition=function(e){return e},t.prototype.calculateScrollEdges=function(){return{left:0,right:this.adapter.getScrollContentOffsetWidth()-this.adapter.getScrollAreaOffsetWidth()}},t.prototype.clampScrollValue=function(e){var t=this.calculateScrollEdges();return Math.min(Math.max(t.left,e),t.right)},t}(J),Q=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,G.C6)(t,e),t.prototype.getScrollPositionRTL=function(e){var t=this.adapter.getScrollAreaScrollLeft();return Math.round(e-t)},t.prototype.scrollToRTL=function(e){var t=this.adapter.getScrollAreaScrollLeft(),n=this.clampScrollValue(-e);return{finalScrollPosition:n,scrollDelta:n-t}},t.prototype.incrementScrollRTL=function(e){var t=this.adapter.getScrollAreaScrollLeft(),n=this.clampScrollValue(t-e);return{finalScrollPosition:n,scrollDelta:n-t}},t.prototype.getAnimatingScrollPosition=function(e,t){return e-t},t.prototype.calculateScrollEdges=function(){var e=this.adapter.getScrollC
2ontentOffsetWidth();return{left:this.adapter.getScrollAreaOffsetWidth()-e,right:0}},t.prototype.clampScrollValue=function(e){var t=this.calculateScrollEdges();return Math.max(Math.min(t.right,e),t.left)},t}(J),Z=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,G.C6)(t,e),t.prototype.getScrollPositionRTL=function(e){var t=this.adapter.getScrollAreaScrollLeft();return Math.round(t-e)},t.prototype.scrollToRTL=function(e){var t=this.adapter.getScrollAreaScrollLeft(),n=this.clampScrollValue(e);return{finalScrollPosition:n,scrollDelta:t-n}},t.prototype.incrementScrollRTL=function(e){var t=this.adapter.getScrollAreaScrollLeft(),n=this.clampScrollValue(t+e);return{finalScrollPosition:n,scrollDelta:t-n}},t.prototype.getAnimatingScrollPosition=function(e,t){return e+t},t.prototype.calculateScrollEdges=function(){return{left:this.adapter.getScrollContentOffsetWidth()-this.adapter.getScrollAreaOffsetWidth(),right:0}},t.prototype.clampScrollValue=function(e){var t=this.calculateScrollEdges();return Math.min(Math.max(t.right,e),t.left)},t}(J),ee=function(e){function t(n){var i=e.call(this,(0,G.Cl)((0,G.Cl)({},t.defaultAdapter),n))||this;return i.isAnimating=!1,i}return(0,G.C6)(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return V},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return q},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{eventTargetMatchesSelector:function(){return!1},addClass:function(){},removeClass:function(){},addScrollAreaClass:function(){},setScrollAreaStyleProperty:function(){},setScrollContentStyleProperty:function(){},getScrollContentStyleValue:function(){return""},setScrollAreaScrollLeft:function(){},getScrollAreaScrollLeft:function(){return 0},getScrollContentOffsetWidth:function(){return 0},getScrollAreaOffsetWidth:function(){return 0},computeScrollAreaClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},computeScrollContentClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},computeHorizontalScrollbarHeight:function(){return 0}}},enumerable:!1,configurable:!0}),t.prototype.init=function(){var e=this.adapter.computeHorizontalScrollbarHeight();this.adapter.setScrollAreaStyleProperty("margin-bottom",-e+"px"),this.adapter.addScrollAreaClass(t.cssClasses.SCROLL_AREA_SCROLL)},t.prototype.getScrollPosition=function(){if(this.isRTL())return this.computeCurrentScrollPositionRTL();var e=this.calculateCurrentTranslateX();return this.adapter.getScrollAreaScrollLeft()-e},t.prototype.handleInteraction=function(){this.isAnimating&&this.stopScrollAnimation()},t.prototype.handleTransitionEnd=function(e){var n=e.target;this.isAnimating&&this.adapter.eventTargetMatchesSelector(n,t.strings.CONTENT_SELECTOR)&&(this.isAnimating=!1,this.adapter.removeClass(t.cssClasses.ANIMATING))},t.prototype.incrementScroll=function(e){0!==e&&this.animate(this.getIncrementScrollOperation(e))},t.prototype.incrementScrollImmediate=function(e){if(0!==e){var t=this.getIncrementScrollOperation(e);0!==t.scrollDelta&&(this.stopScrollAnimation(),this.adapter.setScrollAreaScrollLeft(t.finalScrollPosition))}},t.prototype.scrollTo=function(e){this.isRTL()?this.scrollToImplRTL(e):this.scrollToImpl(e)},t.prototype.getRTLScroller=function(){return this.rtlScrollerInstance||(this.rtlScrollerInstance=this.rtlScrollerFactory()),this.rtlScrollerInstance},t.prototype.calculateCurrentTranslateX=function(){var e=this.adapter.getScrollContentStyleValue("transform");if("none"===e)return 0;var t=/\((.+?)\)/.exec(e);if(!t)return 0;var n=t[1],i=(0,G.zs)(n.split(","),6),a=(i[0],i[1],i[2],i[3],i[4]);return i[5],parseFloat(a)},t.prototype.clampScrollValue=function(e){var t=this.calculateScrollEdges();return Math.min(Math.max(t.left,e),t.right)},t.prototype.computeCurrentScrollPositionRTL=function(){var e=this.calculateCurrentTranslateX();return this.getRTLScroller().getScrollPositionRTL(e)},t.prototype.calculateScrollEdges=function(){return{left:0,right:this.adapter.getScrollContentOffsetWidth()-this.adapter.getScrollAreaOffsetWidth()}},t.prototype.scrollToImpl=function(e){var t=this.getScrollPosition(),n=this.clampScrollValue(e),i=n-t;this.animate({finalScrollPosition:n,scrollDelta:i})},t.prototype.scrollToImplRTL=function(e){var t=this.getRTLScroller().scrollToRTL(e);this.animate(t)}
2,t.prototype.getIncrementScrollOperation=function(e){if(this.isRTL())return this.getRTLScroller().incrementScrollRTL(e);var t=this.getScrollPosition(),n=e+t,i=this.clampScrollValue(n);return{finalScrollPosition:i,scrollDelta:i-t}},t.prototype.animate=function(e){var n=this;0!==e.scrollDelta&&(this.stopScrollAnimation(),this.adapter.setScrollAreaScrollLeft(e.finalScrollPosition),this.adapter.setScrollContentStyleProperty("transform","translateX("+e.scrollDelta+"px)"),this.adapter.computeScrollAreaClientRect(),requestAnimationFrame(function(){n.adapter.addClass(t.cssClasses.ANIMATING),n.adapter.setScrollContentStyleProperty("transform","none")}),this.isAnimating=!0)},t.prototype.stopScrollAnimation=function(){this.isAnimating=!1;var e=this.getAnimatingScrollPosition();this.adapter.removeClass(t.cssClasses.ANIMATING),this.adapter.setScrollContentStyleProperty("transform","translateX(0px)"),this.adapter.setScrollAreaScrollLeft(e)},t.prototype.getAnimatingScrollPosition=function(){var e=this.calculateCurrentTranslateX(),t=this.adapter.getScrollAreaScrollLeft();return this.isRTL()?this.getRTLScroller().getAnimatingScrollPosition(t,e):t-e},t.prototype.rtlScrollerFactory=function(){var e=this.adapter.getScrollAreaScrollLeft();this.adapter.setScrollAreaScrollLeft(e-1);var t=this.adapter.getScrollAreaScrollLeft();if(t<0)return this.adapter.setScrollAreaScrollLeft(e),new Q(this.adapter);var n=this.adapter.computeScrollAreaClientRect(),i=this.adapter.computeScrollContentClientRect(),a=Math.round(i.right-n.right);return this.adapter.setScrollAreaScrollLeft(e),a===t?new Z(this.adapter):new X(this.adapter)},t.prototype.isRTL=function(){return"rtl"===this.adapter.getScrollContentStyleValue("direction")},t}($.I),te={ARROW_LEFT_KEY:"ArrowLeft",ARROW_RIGHT_KEY:"ArrowRight",END_KEY:"End",ENTER_KEY:"Enter",HOME_KEY:"Home",SPACE_KEY:"Space",TAB_ACTIVATED_EVENT:"MDCTabBar:activated",TAB_SCROLLER_SELECTOR:".mdc-tab-scroller",TAB_SELECTOR:".mdc-tab"},ne={ARROW_LEFT_KEYCODE:37,ARROW_RIGHT_KEYCODE:39,END_KEYCODE:35,ENTER_KEYCODE:13,EXTRA_SCROLL_AMOUNT:20,HOME_KEYCODE:36,SPACE_KEYCODE:32},ie=new Set;ie.add(te.ARROW_LEFT_KEY),ie.add(te.ARROW_RIGHT_KEY),ie.add(te.END_KEY),ie.add(te.HOME_KEY),ie.add(te.ENTER_KEY),ie.add(te.SPACE_KEY);var ae=new Map;ae.set(ne.ARROW_LEFT_KEYCODE,te.ARROW_LEFT_KEY),ae.set(ne.ARROW_RIGHT_KEYCODE,te.ARROW_RIGHT_KEY),ae.set(ne.END_KEYCODE,te.END_KEY),ae.set(ne.HOME_KEYCODE,te.HOME_KEY),ae.set(ne.ENTER_KEYCODE,te.ENTER_KEY),ae.set(ne.SPACE_KEYCODE,te.SPACE_KEY);var re=function(e){function t(n){var i=e.call(this,(0,G.Cl)((0,G.Cl)({},t.defaultAdapter),n))||this;return i.useAutomaticActivation=!1,i}return(0,G.C6)(t,e),Object.defineProperty(t,"strings",{get:function(){return te},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return ne},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{scrollTo:function(){},incrementScroll:function(){},getScrollPosition:function(){return 0},getScrollContentWidth:function(){return 0},getOffsetWidth:function(){return 0},isRTL:function(){return!1},setActiveTab:function(){},activateTabAtIndex:function(){},deactivateTabAtIndex:function(){},focusTabAtIndex:function(){},getTabIndicatorClientRectAtIndex:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},getTabDimensionsAtIndex:function(){return{rootLeft:0,rootRight:0,contentLeft:0,contentRight:0}},getPreviousActiveTabIndex:function(){return-1},getFocusedTabIndex:function(){return-1},getIndexOfTabById:function(){return-1},getTabListLength:function(){return 0},notifyTabActivated:function(){}}},enumerable:!1,configurable:!0}),t.prototype.setUseAutomaticActivation=function(e){this.useAutomaticActivation=e},t.prototype.activateTab=function(e){var t,n=this.adapter.getPreviousActiveTabIndex();this.indexIsInRange(e)&&e!==n&&(-1!==n&&(this.adapter.deactivateTabAtIndex(n),t=this.adapter.getTabIndicatorClientRectAtIndex(n)),this.adapter.activateTabAtIndex(e,t),this.scrollIntoView(e),this.adapter.notifyTabActivated(e))},t.prototype.handleKeyDown=function(e){var t=this.getKeyFromEvent(e);
2if(void 0!==t)if(this.isActivationKey(t)||e.preventDefault(),this.useAutomaticActivation){if(this.isActivationKey(t))return;var n=this.determineTargetFromKey(this.adapter.getPreviousActiveTabIndex(),t);this.adapter.setActiveTab(n),this.scrollIntoView(n)}else{var i=this.adapter.getFocusedTabIndex();this.isActivationKey(t)?this.adapter.setActiveTab(i):(n=this.determineTargetFromKey(i,t),this.adapter.focusTabAtIndex(n),this.scrollIntoView(n))}},t.prototype.handleTabInteraction=function(e){this.adapter.setActiveTab(this.adapter.getIndexOfTabById(e.detail.tabId))},t.prototype.scrollIntoView=function(e){this.indexIsInRange(e)&&(0!==e?e!==this.adapter.getTabListLength()-1?this.isRTL()?this.scrollIntoViewImplRTL(e):this.scrollIntoViewImpl(e):this.adapter.scrollTo(this.adapter.getScrollContentWidth()):this.adapter.scrollTo(0))},t.prototype.determineTargetFromKey=function(e,t){var n=this.isRTL(),i=this.adapter.getTabListLength()-1,a=e;return t===te.END_KEY?a=i:t===te.ARROW_LEFT_KEY&&!n||t===te.ARROW_RIGHT_KEY&&n?a-=1:t===te.ARROW_RIGHT_KEY&&!n||t===te.ARROW_LEFT_KEY&&n?a+=1:a=0,a<0?a=i:a>i&&(a=0),a},t.prototype.calculateScrollIncrement=function(e,t,n,i){var a=this.adapter.getTabDimensionsAtIndex(t),r=a.contentLeft-n-i,o=a.contentRight-n-ne.EXTRA_SCROLL_AMOUNT,s=r+ne.EXTRA_SCROLL_AMOUNT;return t<e?Math.min(o,0):Math.max(s,0)},t.prototype.calculateScrollIncrementRTL=function(e,t,n,i,a){var r=this.adapter.getTabDimensionsAtIndex(t),o=a-r.contentLeft-n,s=a-r.contentRight-n-i+ne.EXTRA_SCROLL_AMOUNT,l=o-ne.EXTRA_SCROLL_AMOUNT;return t>e?Math.max(s,0):Math.min(l,0)},t.prototype.findAdjacentTabIndexClosestToEdge=function(e,t,n,i){var a=t.rootLeft-n,r=t.rootRight-n-i,o=a+r;return a<0||o<0?e-1:r>0||o>0?e+1:-1},t.prototype.findAdjacentTabIndexClosestToEdgeRTL=function(e,t,n,i,a){var r=a-t.rootLeft-i-n,o=a-t.rootRight-n,s=r+o;return r>0||s>0?e+1:o<0||s<0?e-1:-1},t.prototype.getKeyFromEvent=function(e){return ie.has(e.key)?e.key:ae.get(e.keyCode)},t.prototype.isActivationKey=function(e){return e===te.SPACE_KEY||e===te.ENTER_KEY},t.prototype.indexIsInRange=function(e){return e>=0&&e<this.adapter.getTabListLength()},t.prototype.isRTL=function(){return this.adapter.isRTL()},t.prototype.scrollIntoViewImpl=function(e){var t=this.adapter.getScrollPosition(),n=this.adapter.getOffsetWidth(),i=this.adapter.getTabDimensionsAtIndex(e),a=this.findAdjacentTabIndexClosestToEdge(e,i,t,n);if(this.indexIsInRange(a)){var r=this.calculateScrollIncrement(e,a,t,n);this.adapter.incrementScroll(r)}},t.prototype.scrollIntoViewImplRTL=function(e){var t=this.adapter.getScrollPosition(),n=this.adapter.getOffsetWidth(),i=this.adapter.getTabDimensionsAtIndex(e),a=this.adapter.getScrollContentWidth(),r=this.findAdjacentTabIndexClosestToEdgeRTL(e,i,t,n,a);if(this.indexIsInRange(r)){var o=this.calculateScrollIncrementRTL(e,r,t,n,a);this.adapter.incrementScroll(o)}},t}($.I),oe=n(570),se={ACTIVE:"mdc-tab-indicator--active",FADE:"mdc-tab-indicator--fade",NO_TRANSITION:"mdc-tab-indicator--no-transition"},le={CONTENT_SELECTOR:".mdc-tab-indicator__content"},ce=function(e){function t(n){return e.call(this,(0,G.Cl)((0,G.Cl)({},t.defaultAdapter),n))||this}return(0,G.C6)(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return se},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return le},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},computeContentClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},setContentStyleProperty:function(){}}},enumerable:!1,configurable:!0}),t.prototype.computeContentClientRect=function(){return this.adapter.computeContentClientRect()},t}($.I),de=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,G.C6)(t,e),t.prototype.activate=function(){this.adapter.addClass(ce.cssClasses.ACTIVE)},t.prototype.deactivate=function(){this.adapter.removeClass(ce.cssClasses.ACTIVE)},t}(ce),ue=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,G.C6)(t,e),t.prototype.activate=function(e){if(e){var t=this.computeContentClientRect(),n=e.width/t.width,i=e.left-t.left;
2this.adapter.addClass(ce.cssClasses.NO_TRANSITION),this.adapter.setContentStyleProperty("transform","translateX("+i+"px) scaleX("+n+")"),this.computeContentClientRect(),this.adapter.removeClass(ce.cssClasses.NO_TRANSITION),this.adapter.addClass(ce.cssClasses.ACTIVE),this.adapter.setContentStyleProperty("transform","")}else this.adapter.addClass(ce.cssClasses.ACTIVE)},t.prototype.deactivate=function(){this.adapter.removeClass(ce.cssClasses.ACTIVE)},t}(ce),he=n(3189),me={ACTIVE:"mdc-tab--active"},pe={ARIA_SELECTED:"aria-selected",CONTENT_SELECTOR:".mdc-tab__content",INTERACTED_EVENT:"MDCTab:interacted",RIPPLE_SELECTOR:".mdc-tab__ripple",TABINDEX:"tabIndex",TAB_INDICATOR_SELECTOR:".mdc-tab-indicator"},fe=function(e){function t(n){var i=e.call(this,(0,G.Cl)((0,G.Cl)({},t.defaultAdapter),n))||this;return i.focusOnActivate=!0,i}return(0,G.C6)(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return me},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return pe},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setAttr:function(){},activateIndicator:function(){},deactivateIndicator:function(){},notifyInteracted:function(){},getOffsetLeft:function(){return 0},getOffsetWidth:function(){return 0},getContentOffsetLeft:function(){return 0},getContentOffsetWidth:function(){return 0},focus:function(){}}},enumerable:!1,configurable:!0}),t.prototype.handleClick=function(){this.adapter.notifyInteracted()},t.prototype.isActive=function(){return this.adapter.hasClass(me.ACTIVE)},t.prototype.setFocusOnActivate=function(e){this.focusOnActivate=e},t.prototype.activate=function(e){this.adapter.addClass(me.ACTIVE),this.adapter.setAttr(pe.ARIA_SELECTED,"true"),this.adapter.setAttr(pe.TABINDEX,"0"),this.adapter.activateIndicator(e),this.focusOnActivate&&this.adapter.focus()},t.prototype.deactivate=function(){this.isActive()&&(this.adapter.removeClass(me.ACTIVE),this.adapter.setAttr(pe.ARIA_SELECTED,"false"),this.adapter.setAttr(pe.TABINDEX,"-1"),this.adapter.deactivateIndicator())},t.prototype.computeDimensions=function(){var e=this.adapter.getOffsetWidth(),t=this.adapter.getOffsetLeft(),n=this.adapter.getContentOffsetWidth(),i=this.adapter.getContentOffsetLeft();return{contentLeft:t+i,contentRight:t+i+n,rootLeft:t,rootRight:t+e}},t}($.I);const ge=z.createContext({onTabInteraction:e=>{},registerTab:e=>{},unregisterTab:e=>{},indicatorTransition:"slide"});function be(e){const{children:t,apiRef:n,...i}=e,{rootEl:a,areaEl:r,contentEl:o}=(e=>{const{foundation:t,...n}=(0,W.P5)({props:e,api:({foundation:e,contentEl:t})=>{const n=e;return{scrollTo:e=>n.scrollTo(e),incrementScroll:e=>n.incrementScroll(e),getScrollPosition:()=>n.getScrollPosition(),getScrollContentWidth:()=>{var e;return(null==(e=t.ref)?void 0:e.offsetWidth)||0}}},elements:{rootEl:!0,areaEl:!0,contentEl:!0},foundation:({rootEl:e,areaEl:t,contentEl:n})=>new ee({eventTargetMatchesSelector:(e,t)=>(0,W.cK)(e,t),addClass:t=>e.addClass(t),removeClass:t=>e.removeClass(t),addScrollAreaClass:e=>t.addClass(e),setScrollAreaStyleProperty:(e,n)=>
2t.setStyle(e,n),setScrollContentStyleProperty:(e,t)=>n.setStyle(e,t),getScrollContentStyleValue:e=>n.ref&&window.getComputedStyle(n.ref).getPropertyValue(e)||"none",setScrollAreaScrollLeft:e=>t.ref&&(t.ref.scrollLeft=e),getScrollAreaScrollLeft:()=>t.ref?t.ref.scrollLeft:0,getScrollContentOffsetWidth:()=>n.ref?n.ref.offsetWidth:0,getScrollAreaOffsetWidth:()=>t.ref?t.ref.offsetWidth:0,computeScrollAreaClientRect:()=>t.ref?t.ref.getBoundingClientRect():W.dp,computeScrollContentClientRect:()=>n.ref?n.ref.getBoundingClientRect():W.dp,computeHorizontalScrollbarHeight:()=>function(e,t){if(void 0===t&&(t=!0),t&&void 0!==B)return B;var n=e.createElement("div");n.classList.add(V.SCROLL_TEST),e.body.appendChild(n);var i=n.offsetHeight-n.clientHeight;return e.body.removeChild(n),t&&(B=i),i}(document)})}),{areaEl:i,contentEl:a}=n,r=()=>{t.handleInteraction()};return i.setProp("onWheel",r,!0),i.setProp("onTouchStart",r,!0),i.setProp("onPointerDown",r,!0),i.setProp("onMouseDown",r,!0),i.setProp("onKeyDown",r,!0),a.setProp("onTransitionEnd",e=>{t.handleTransitionEnd(e)},!0),{...n}})(e);return(0,g.Y)(W.vw,{...i,ref:null,element:a,className:"mdc-tab-scroller",children:(0,g.Y)(W.vw,{element:r,className:"mdc-tab-scroller__scroll-area",children:(0,g.Y)(W.vw,{element:o,className:"mdc-tab-scroller__scroll-content",children:t})})})}const ve=(0,W.a0)(function(e,t){const{children:n,activeTabIndex:i,onActivate:a,foundationRef:r,...o}=e,{rootEl:s,handleTabInteraction:l,setTabScrollerApi:c,registerTab:d,unregisterTab:h}=(e=>{const[t,n]=(0,u.useState)(e.activeTabIndex||0),i=(0,u.useRef)(),a=(0,u.useRef)([]),{foundation:r,...o}=(0,W.P5)({props:e,elements:{rootEl:!0},foundation:({rootEl:t,emit:o,getProps:s})=>new re({scrollTo:e=>{i.current&&i.current.scrollTo(e)},incrementScroll:e=>{var t;null==(t=i.current)||t.incrementScroll(e)},getScrollPosition:()=>{var e;return(null==(e=i.current)?void 0:e.getScrollPosition())||0},getScrollContentWidth:()=>{var e;return(null==(e=i.current)?void 0:e.getScrollContentWidth())||0},getOffsetWidth:()=>t.ref?t.ref.offsetWidth:0,isRTL:()=>!!t.ref&&"rtl"===window.getComputedStyle(t.ref).getPropertyValue("direction"),setActiveTab:t=>{e.activeTabIndex===t||void 0===e.activeTabIndex?n(t):r.adapter.notifyTabActivated(t)},activateTabAtIndex:(e,t)=>{a.current[e]&&a.current[e].activate(t)},deactivateTabAtIndex:e=>a.current[e]&&a.current[e].deactivate(),focusTabAtIndex:e=>a.current[e].focus(),getTabIndicatorClientRectAtIndex:e=>a.current[e]&&a.current[e].computeIndicatorClientRect(),getTabDimensionsAtIndex:e=>a.current[e]&&a.current[e].computeDimensions(),getPreviousActiveTabIndex:()=>{for(let e=0;e<a.current.length;e++)if(a.current[e].getActive())return e;return-1},getFocusedTabIndex:()=>{var e;const n=[].slice.call(null==(e=t.ref)?void 0:e.querySelectorAll(re.strings.TAB_SELECTOR)),i=document.activeElement;return n?n.indexOf(i):-1},getIndexOfTabById:e=>{for(let t=0;t<a.current.length;t++)if(a.current[t].id===e)return t;return-1},getTabListLength:()=>a.current.length,notifyTabActivated:e=>o("onActivate",{index:e},!0)})}),{rootEl:s}=o,l=(0,u.useCallback)(e=>{r.handleTabInteraction(e)},[r]);return s.setProp("onKeyDown",t=>{var n;null==(n=e.onKeyDown)||n.call(e,t),r.handleKeyDown(t)},!0),(0,u.useEffect)(()=>{void 0!==e.activeTabIndex&&n(e.activeTabIndex)},[e.activeTabIndex]),(0,u.useEffect)(()=>{const e=t,n=r.adapter,i=n.getPreviousActiveTabIndex();if(r.indexIsInRange(e)&&e!==i)return n.notifyTabActivated(e),window.requestAnimationFrame(()=>{n.activateTabAtIndex(e,n.getTabIndicatorClientRectAtIndex(i)),r.scrollIntoView(e)}),()=>{window.requestAnimationFrame(()=>{n.deactivateTabAtIndex(e)})}},[t,r]),(0,u.useEffect)(()=>{const e=window.document.activeElement,[t,n]=[window.scrollX,window.scrollY];window.requestAnimationFrame(()=>{e&&e.focus(),window.scrollTo(t,n)})},[]),{...o,setTabScrollerApi:e=>i.current=e,handleTabInteraction:l,registerTab:e=>{a.current.push(e),a.current.sort((e,t)=>e.getIndex()-t.getIndex())},unregisterTab:e=>{a.current.splice(a.current.indexOf(e),1),a.current.sort((e,t)=>e.getIndex()-t.getIndex())}}})(e),m=(0,u.useRef)({onTabInteraction:e=>l(e),registerTab:d,unregisterTab:h,indicatorTransition:e.indicatorTransition||"slide"}),p=(0,W.UP)(e,["mdc-tab-bar"]);return(0,g.Y)(ge.Provider,{value:m.current,children:(0,g.Y)(W.vw,{tag:"div",role:"tablist",element:s,...o,className:p,ref:t,children:(0,g.Y)(be,{apiRef:c,children:n})})})});function Ae(e){const{rootEl:t,contentEl:n}=(e=>{const{foundation:t,...n}=(0,W.P5)({props:e,elements:{rootEl:!0,contentEl:!0},foundation:({rootEl:t,contentEl:n})=>{const i={addClass:e=>{t.addClass(e)},removeClass:e=>{t.removeClass(e)},computeContentClientRect:()=>n.ref?n.ref.getBoundingClientRect():W.dp,setContentStyleProperty:(e,t)=>{n.setStyle(e,t)}};return"fade"===e.transition?new de(i):new ue(i)},api:({foundation:e})=>({activate:t=>{e.activate(t)},deactivate:()=>{e.deactivate()},computeContentClientRect:()=>e.computeContentClientRect()})});return{...n}})(e),{icon:i,transition:a}=e;return(0,g.Y)(W.vw,{tag:"span",element:t,className:(0,W.xW)("mdc-tab-indicator",{"mdc-tab-indicator--fade":"fade"===a}),children:(0,g.Y)(W.vw,{tag:i?oe.I:"span","aria-hidden":"true",icon:i,element:n,className:"mdc-tab-indicator__content mdc-tab-indicator__content--"+(i?"icon":"underline")})})}const Ce=(0,he.zu)({surface:!1})((0,W.a0)(function(e,t){const{stacked:n,minWidth:i,...a}=e,r=(0,W.UP)(e,["mdc-tab",{"mdc-tab--stacked":n,"mdc-tab--min-width":i}]);return(0,g.Y)(W.vw,{tag:"button",role:"tab",...a,className:r,ref:t})})),Ee=z.memo(function(e){return(0,g.Y)(oe.I,{...e,className:"mdc-tab__icon"})}),Te=(0,W.a0)(function(e,t){const{children:n,label:i,icon:a,stacked:r,restrictIndicator:o,onInteraction:s,iconIndicator:l,foundationRef:c,focusOnActivate:d,...h}=e,{rootEl:m,contentEl:p,setTabIndicatorApi:f}=(e=>{const t=(0,u.useRef)(),n=(0,u.useContext)(ge),i=(0,W.Bi)("tab",e),{foundation:a,...r}=(0,W.P5)({props:e,elements:{rootEl:!0,contentEl:!0},foundation:({rootEl:e,contentEl:a,emit:r,getProps:o})=>new fe({setAttr:(t,n)=>e.setProp(t,n),addClass:t=>e.addClass(t),removeClass:t=>e.removeClass(t),hasClass:t=>e.hasClass(t),activateIndicator:e=>{var n;return null==(n=t.current)?void 0:n.activate(e)},deactivateIndicator:()=>{var e;return null==(e=t.current)?void 0:e.deactivate()},notifyInteracted:()=>{const e=r("onInteraction",{tabId:i},!0);n.onTabInteraction(e)},getOffsetLeft:()=>{var t;return(null==(t=e.ref)?void 0:t.offsetLeft)||0},getOffsetWidth:()=>{var t;return(null==(t=e.ref)?void 0:t.offsetWidth)||0},getContentOffsetLeft:()=>{var e;return(null==(e=a.ref)?void 0:e.offsetLeft)||0},getContentOffsetWidth:()=>{var e;return(null==(e=a.ref)?void 0:e.offsetWidth)||0},focus:()=>e.ref&&e.ref.focus&&e.ref.focus()})}),{rootEl:o}=r;o.setProp("onClick",t=>{var n;null==(n=e.onClick)||n.call(e,t),a.handleClick()},!0);const s=(0,u.useMemo)(()=>({getActive:()=>a.isActive(),activate:e=>a.activate(e),deactivate:()=>a.deactivate(),computeIndicatorClientRect:()=>{var e;return(null==(e=t.current)?void 0:e.computeContentClientRect())||W.dp},computeDimensions:()=>a.computeDimensions(),focus:()=>o.ref&&o.ref.focus(),id:i,getIndex:()=>{var e;return null!=(e=o.ref)&&e.parentElement?Array.from(o.ref.parentElement.children).indexOf(o.ref):-1}}),[a,o.ref,i]);return(0,u.useEffect)(()=>(n.registerTab(s),()=>{n.unregisterTab(s)}),[n,s]),(0,u.useEffect)(()=>{void 0!==e.focusOnActivate&&a.setFocusOnActivate(e.focusOnActivate)},[a,e.focusOnActivate]),{...r,setTabIndicatorApi:e=>t.current=e}})(e),b=z.useContext(ge),v=(0,g.Y)(Ae,{apiRef:f,transition:b.indicatorTransition,icon:l});return(0,g.FD)(Ce,{element:m,stacked:r,...h,ref:t,children:[(0,g.FD)("div",{className:"mdc-tab__content",ref:p.reactRef,children:[!!a&&(0,g.Y)(Ee,{icon:a}),(void 0!==n||void 0!==i)&&(0,g.FD)("span",{className:"mdc-tab__text-label",children:[i,n]}),!!o&&v]}),!o&&v,(0,g.Y)(he.A6,{className:"mdc-tab__ripple"}),(0,g.Y)("div",{className:"mdc-tab__focus-ring"})]})}),ye=ve,Se=Te;var Ne=n(6402),_e=n(4358),Ye=n(847),Ie=n(8083);const De="Couldn't update settings";let we=function(e){function t(...t){var n;return(n=e.call.apply(e,[this].concat(t))||this).dialog=(0,u.createRef)(),n.state={activeMethod:0,height:"auto",loadingTeamData:!1,minHeight:0,teamData:{invites:[],members:[],pendingRequests:[],skipAdmin:!1,useConfirmation:!0}},n.loadTeamData=async()=>{const{subscriptionState:e}=n.props,{hasTeam:t,team:i}=e;if(t){const{teamId:e}=i,{teamData:{members:t}}=n.state;if(t.length>0)n.setState(({teamData:e})=>({loadingTeamData:!0,teamData:{...e,...i}}));else{const{requests:t,...a}=await(0,m.RD)(`/api/team/${e}/data`);n.setState({loadingTeamData:!0,teamData:{...i,pendingRequests:t,...a}})}}else{const{email:e,id:t,name:i}=(0,I.wz)();n.setState({loadingTeamData:!0,teamData:{invites:[],members:[{email:e,id:t,name:i,permissions:[{role:"write"}],picture_url:null}],pendingRequests:[],skipAdmin:!1,useConfirmation:!0}})}},n.onSettingsSubmit=async e=>{const{subscriptionState:{hasTeam:t,team:i}}=n.props;if(t){const{teamId:t}=i;try{await async function(e,t){const n=await fetch(`/api/team/${e}`,{body:JSON.stringify((0,h.I)(t)),credentials:"same-origin",method:"POST"}),i=await n.json().catch(()=>({}));if(!n.ok||!i.success)throw new Error(i.error||De)}(t,e),n.updateTeamData(e),(0,m.xE)("Settings updated")}catch(e){(0,m.xE)(e.message||De)}}else n.updateTeamData(e)},n.updateContentHeight=()=>{const{minHeight:e}=n.state,t=n.dialog.current.offsetHeight,i=Math.max(t,e),a=Math.max(window.innerHeight,i);n.setState({height:Math.min(i,a),minHeight:i})},n.updateTeamData=e=>{n.setState(({teamData:t})=>{const n={...t,...e};return A(n)||(n.skipAdmin=!1),{teamData:n}})},n}d()(t,e);var n=t.prototype;return n.componentDidMount=async function(){const{loadTeamDataOnOpen:e,open:t,subscriptionState:n}=this.props,{teamData:{members:i}}=this.state,{hasTeam:a,isFree:r,isTeamMember:o}=n;!0===e&&!0===t&&0===i.length&&await this.loadTeamData(),r&&a&&!o&&this.setState({activeMethod:1})},n.componentDidUpdate=async function(e,t){const{open:n}=this.props,{teamData:{invites:i,members:a,pendingRequests:r}}=this.state,o=t.teamData.invites,s=t.teamData.members,l=t.teamData.pendingRequests;!0===n&&0===a.length&&await this.loadTeamData(),!0===n&&o&&s&&l&&(i.length!==o.length||a.length!==s.length||r.length!==l.length)&&this.updateContentHeight()},n.render=function(){const{activeMethod:e,height:t,loadingTeamData:n,teamData:i}=this.state,{onClose:r,open:s,showJoinLink:l,subscriptionState:c}=this.props,{hasTeam:d,isTeamMember:h,isTeamPlan:p,subscription:f}=c,{cancelAtPeriodEnd:v,currentPeriodEnd:A}=f||{},E=A&&v,T=c.isAdmin||!d,y=[{content:(0,g.FD)(g.FK,{children:[(0,g.Y)(x,{hasTeam:d,isAdmin:T,showJoinLink:l,teamData:i,updateTeamData:this.updateTeamData}),T?(0,g.Y)(U,{hasTeam:d,teamData:i,onSettingsSubmit:this.onSettingsSubmit}):null]}),title:"Team & Settings"}].concat(a()(o(),T?[{content:E?(0,g.Y)(b,{}):(0,g.Y)(C.A,{hasTeam:d,teamData:i,updateTeamData:this.updateTeamData,onClose:r}),title:"Payment"}]:[])),S=0===e;return(0,g.Y)(K.A,{className:"team-dialog",open:s,onClose:r,children:(0,g.FD)("div",{ref:this.dialog,style:{display:"flex",flexDirection:"column",justifyContent:"space-between",minHeight:t},children:[(0,g.Y)(H.A,{className:"team-dialog__content",children:(0,g.FD)("div",{className:"view view--xxl",children:[(0,g.Y)(j.A,{children:"Team Settings"}),n?(0,g.FD)(g.FK,{children:[(0,g.Y)(ye,{activeTabIndex:e,className:"team-dialog__tabs",onActivate:({detail:{index:e}})=>{this.updateContentHeight(),this.setState({activeMethod:e})},children:y.map(({title:e})=>(0,g.Y)(u.Fragment,{children:(0,g.Y)(Se,{children:e},e)},e))}),y.map(({content:t,title:n},i)=>(0,g.Y)(u.Fragment,{children:e===i?t:null},n))]}):(0,g.Y)("div",{className:"progress-container",children:(0,g.Y)(Ne.A,{})})]})}),!p&&!h&&(0,g.Y)(_e.A,{style:{justifyContent:!S&&"space-between"},children:S?(0,g.Y)(Ye.A,{raised:!0,className:"btn-lg",onClick:()=>{!i.domain||(0,m.Nq)(i.domain)?this.setState(e=>({activeMethod:e.activeMethod+1})):(0,m.xE)("Please enter a valid domain name")},children:"Continue"}):(0,g.Y)(Ye.A,{isDefaultAction:!0,onClick:()=>this.setState(e=>({activeMethod:e.activeMethod-1})),children:"Back"})}),(0,g.Y)(Ie.A,{onClose:r})]})})},l()(t)}(u.Component)},1642(e,t,n){n.d(t,{A:()=>D,g:()=>I});var i=n(3269),a=n.n(i),r=n(1132),o=n.n(r),s=n(4843),l=n(9869),c=n(2109),d=n(70
271),u=n(6794),h=n(4918),m=n(1818),p=n(7563),f=n(7547),g=n(8847),b=n(1739),v=n(3446),A=n(8028),C=n(3843),E=n(1539),T=n(7065),y=n(335),S=n(6660),N=n(4681),_=n(9698);const Y=(0,l.lazy)(()=>n.e(9970).then(n.bind(n,5177)));async function I(e){try{const{id:t,...n}=await(0,d.RD)("/api/team",{data:(0,u.I)(e),method:"POST"}),i={teamId:t,...(0,u.b)(n)};return(0,S.s)("create_team"),{success:!0,team:i}}catch(e){const{error:t}=await e.json();return(0,d.xE)(`Couldn't create team: ${t}`),{error:t,success:!1}}}function D({hasTeam:e,onClose:t,teamData:n,updateTeamData:i}){const[r,u]=(0,l.useState)(!1),[D,w]=(0,l.useState)(null),[O,R]=(0,l.useState)(null),[x,P]=(0,l.useState)(0),[F,k]=(0,l.useState)(""),[L,M]=(0,l.useState)(!1),[U,B]=(0,l.useState)(!1),[K,H]=(0,l.useState)(!1),[j,z]=(0,l.useState)(""),W=(0,N.wz)(),{createSubscription:G,currency:$,isRecurringPlanType:V,isSubscriptionStateRetrieved:q,priceWithDiscount:J,products:X,shouldUpdateCard:Q,subscriptionState:Z,trialPeriods:ee,trialPrices:te,updateSubscriptionState:ne}=(0,l.useContext)(A.A),{isFree:ie,isTeamPlan:ae,paymentMethodType:re,source:oe}=Z,[se]=(0,s.fp)(E._O),[le,ce]=Object.entries(X).find(([,{group:e,interval:t,tier:n}])=>"team"===e&&t===se&&n===(W?.subscription?.tier||"tier-0"))||[],de=ce?.plan;(0,l.useEffect)(()=>{(0,S.s)("dialog",{action:"show",name:ae?"manage_team":"upgrade_team"})},[ae]),(0,l.useEffect)(()=>{K||async function(){const{invites:t,members:i,size:r,skipAdmin:s}=n;let l=e?r:[].concat(a()(o(),t),a()(o(),i)).length;if(s&&(l-=1),ce&&de&&!(0,m.ZP)(ce)&&q){B(!0);const{success:e,tax:t,total:n,trialPrice:i}=await(0,g.i3)(de,{coupon:F||void 0,group:ce.group,quantity:l,trialPeriodDays:ee[le],trialPrice:te[le]});if(e){R(t),w(n);const e=null!=i?i:n;z(null===i&&n<0?`(${(0,h.vv)(e,$)})`:(0,h.vv)(e,$))}else M(!0);B(!1)}P(l)}()},[e,F,q,K,de,n,$,ee,le,te,ce]);const ue=(0,l.useCallback)(async({createPaymentMethod:e})=>{if(!ce||!de)return;let a;H(!0);try{!0===Q?a=await e(J(D)):oe&&(a={id:oe.id,type:oe.type})}catch({message:e}){return H(!1),void(0,d.xE)(e)}const r=!n.teamId;let o=!1;if(r){const{success:e,team:t}=await I(n);e&&(i(t),ne({team:{...n,...t}}),o=!0)}if(!r||o)try{if(ie)G({coupon:F,onSuccess:async e=>{(0,S.s)("dialog",{action:"submit",name:"upgrade_team"}),t(),(0,p.Dh)({action:C.Jw.TEAM_SUBSCRIPTION,showView:!0,source:C.YH.TEAM_SUBSCRIPTION,view:C.al.REGISTRATION_COMPLETE}),ne({...e})},paymentMethod:a,plan:de,trialPeriod:ee[le]});else{const e=V(le),n=await fetch((0,g.Lp)("subscriptions",{group:ce.group}),{body:JSON.stringify({coupon:F,plan:de,token:a?.id||null,trial_period:ee[le]||null,...!1===e?{recurring:e}:{}}),credentials:"same-origin",method:"PATCH"});if(n.ok){const{amount:e,currency:i,group:a,interval:r,tier:o}=ce,s=(0,g.CL)(await n.json());(0,S.s)("dialog",{action:"submit",name:"upgrade_team"}),(0,N.TK)({plan:de,subscription:{amount:e,currency:i,group:a,interval:r,tier:o}}),ne(s),t(),(0,p.Dh)({action:C.Jw.TEAM_SUBSCRIPTION,showView:!0,source:C.YH.TEAM_SUBSCRIPTION,view:C.al.REGISTRATION_COMPLETE})}}}catch({alertParams:e,message:t}){H(!1),(0,d.xE)(t,e)}else H(!1)},[n,Q,oe,J,D,i,ne,ie,G,F,de,ce,t,V,ee,le]);if(ae)return(0,_.Y)(v.A,{isTeamDialog:!0,teamQty:x,onClose:t});if(!ce||!de)return null;const he=re===c.uq.INVOICE?null:(0,_.Y)("div",{className:"text-left",children:(0,_.FD)(T.A,{checked:!0===r,onChange:()=>u(!r),children:["I have read and agree to the"," ",(0,_.Y)("a",{href:c.A.TERMS_OF_SERVICE,...c.Js,children:"terms of service"}),"."]})}),{tier:me}=ce;return(0,_.FD)(_.FK,{children:[!e&&(0,_.FD)(y.A,{className:"tab-info tab-info--margin",span:12,children:[(0,_.Y)("b",{children:"Step 2:"})," Add your payment information and accept our terms of service. Youâll be able to manage your account and add additional users once youâve completed payment."]}),(0,_.Y)("p",{className:"subscription-description",children:L&&(0,_.FD)("span",{className:"error-help-text",children:["Failed to estimate price for ",x," ",(0,h.td)(x,"member"),". Please try again later."]})}),(0,_.Y)(f.A,{children:(0,_.Y)(Y,{isTeamDialog:!0,consentInputs:he,couponForm:(0,_.Y)(b.A,{loading:K,tier:me,onApplyCoupon:k}),defaultButtonText:Q||!ae?"Pay":null,disabled:K||U||re!==c.uq.INVOICE&&!r,formattedPrice:j,formattedTax:(0,h.vv)(O,$),loading:K||U,planType:le,teamQty:x,onSubmit:ue})})]})}},5711(e,t,n){var i=n(9869),a=n(2109),r=n(7071),o=n(1873),s=n(7693),l=n(6660),c=n(4681),d=n(9698);n.d(t,["A",0,function(){const[e,t]=(0,i.useState)(!1);return(0,d.Y)(s.zh,{className:"change-password",disabled:e,onClick:async()=>{const{email:e}=(0,c.wz)(),n=await(0,o.Aw)(e);if(n.success)(0,l.s)("update_password"),(0,r.xE)(`Please check your email ${e} to update your password`);else{const e="sso_required"===n.error?a.Xj:"Failed to send password recovery instructions.";(0,r.xE)(e)}t(!0)},children:"Change Password"})}])},2492(e,t,n){n.d(t,{A:()=>u});var i=n(9869),a=n(2109),r=n(7547),o=n(2946),s=n(5159),l=n(5391),c=n(9698);const d=(0,i.lazy)(()=>n.e(3710).then(n.bind(n,113)));function u({buttonOutlined:e,buttonRaised:t,buttonTitle:n="Manage Access",entityData:i=null,entityId:u,entityName:h,entityType:m="library",onChangeAccess:p,onChangeInvites:f,onChangeMembers:g}){const b="library"===m?o._c:void 0,{closeDialogFromUrl:v,openDialogFromUrl:A,openFromUrl:C}=(0,s.A)(a.uB.managePermissions,{feature:b}),[E]=(0,o.XX)(b,A);return(0,c.FD)(c.FK,{children:[(0,c.Y)(l.A,{outlined:e,raised:t,onClick:E,children:n}
2),C&&(0,c.Y)(r.A,{children:(0,c.Y)(d,{entityData:i,entityId:u,entityName:h,entityType:m,onChangeAccess:p,onChangeInvites:f,onChangeMembers:g,onClose:v})})]})}},3339(e,t,n){n.d(t,{A:()=>f});var i=n(6942),a=n.n(i),r=n(9869),o=n(2109),s=n(4729),l=n(2946),c=n(5159),d=n(5391),u=n(4681),h=n(9698);const m=(0,r.lazy)(()=>n.e(4383).then(n.bind(n,8337)));function p({children:e,className:t,disabled:n,onClick:i,outlined:a,raised:r}){return(0,h.Y)(d.A,{className:t,disabled:n,outlined:a,raised:r,onClick:i,children:e})}function f({ButtonComponent:e=p,className:t,icon:n="icon-add-white",outlined:i,raised:r,tag:d,title:f="New Library",withProIcon:g=!1}){const b=(0,u.wz)(),{closeDialogFromUrl:v,openDialogFromUrl:A,openFromUrl:C}=(0,c.A)(o.uB.createLibraryDialog,{feature:l.n7}),[E,T]=(0,l.XX)(l.n7,()=>{b?A():window.location.href=`${o.A.REPOSITORIES}?${o.uB.createLibraryDialog}`});return(0,h.FD)(h.FK,{children:[(0,h.FD)(e,{className:t,disabled:T,outlined:i,raised:r,tag:d,onClick:E,children:[n&&(0,h.Y)("i",{className:a()("mdc-button__icon icon",n)}),f,g&&(0,h.Y)(s.A,{})]}),C&&(0,h.Y)(m,{open:C,onClose:v})]})}},7003(e,t,n){n.d(t,{A:()=>l});var i=n(9869),a=n(7071),r=n(1917),o=n(5391),s=n(9698);function l({className:e,onSuccess:t=null,repositoryId:n,title:l="Join Library"}){const[c,d]=(0,i.useState)(!1);return(0,s.Y)(o.A,{raised:!0,className:e,disabled:c,onClick:async()=>{d(!0);const e=await fetch(`/user/libraries/${n}/join`,{credentials:"same-origin",method:"POST"});d(!1),e.ok?"function"==typeof t?t(n):(0,a.l4)((0,s.FD)("p",{children:[(0,r.Eo)(n)," contract library"," ",(0,s.FD)("b",{className:"text-nowrap",children:['"',n,'"']})," has been added to your libraries"]}),`/${n}`):(0,a.xE)(`Something went wrong! Couldn't join "${n}" library.`)},children:l})}},2818(e,t,n){n.d(t,{A:()=>u});var i=n(9869),a=n(2109),r=n(7071),o=n(1917),s=n(5391),l=n(4681),c=n(9698);function d({children:e,...t}){return(0,c.Y)(s.A,{outlined:!0,...t,children:e})}function u({ButtonComponent:e=d,className:t=null,onSuccess:n=null,repositoryId:s,title:u="Leave Library"}){const[h,m]=(0,i.useState)(!1);return(0,c.Y)(e,{className:t,disabled:h,onClick:async()=>{m(!0);const{id:e}=(0,l.wz)(),t=await fetch(`/api/libraries/${s}/permissions/${e}`,{credentials:"same-origin",method:"DELETE"});m(!1),t.ok?"function"==typeof n?n(s):(0,r.l4)((0,c.FD)("p",{children:["You've left ",(0,o.Eo)(s,!1)," contract library",(0,c.Y)("br",{}),(0,c.FD)("b",{className:"text-nowrap",children:['"',s,'"']})]}),a.A.REPOSITORIES):(0,r.xE)("Couldn't leave library")},children:u})}},7424(e,t,n){n.d(t,{Xh:()=>u,wh:()=>d});var i=n(6942),a=n.n(i),r=n(1917),o=n(9698);const s="read",l="write",c={[s]:"Viewer",[l]:"Owner"};function d({className:e="icon--xs",namespace:t,style:n}){return(0,r.Gi)(t)?(0,o.Y)("i",{className:a()(e,"icon icon-folder-lock-black icon--left"),style:n}):(0,r.GQ)(t)?(0,o.Y)("i",{className:a()(e,"icon icon-folder-black icon--left"),style:n}):null}function u({role:e}){return(0,o.Y)("span",{className:"item-label",children:c[e]||e})}n.d(t,["gg",0,c])},6560(e,t,n){n.d(t,{A:()=>r});var i=n(8958),a=n(9698);function r({error:e,label:t,name:n,onChange:r,options:o,required:s,value:l}){return(0,a.FD)("div",{className:"radio-field",children:[(0,a.FD)("p",{style:{marginBottom:"5px"},children:[(0,a.Y)("b",{children:t}),s&&(0,a.Y)("sup",{className:"color-red",children:"*"})]}),(0,a.Y)("ul",{className:"list-unstyled no-margin",children:o.map(e=>(0,a.Y)("li",{children:(0,a.Y)(i.A,{checked:e.value===l,label:e.label||e.value,name:n||t,value:e.value,onChange:r})},e.value))}),e&&(0,a.Y)("p",{className:"invalid-feedback",children:e})]})}},5159(e,t,n){n.d(t,{A:()=>r});var i=n(9869),a=n(2946);function r(e,{feature:t}={}){const[n,r]=(0,i.useState)(!1),[o]=(0,a.XX)(t,(0,i.useCallback)(()=>r(!0),[]));return(0,i.useEffect)(()=>{if(new URLSearchParams(window.location.search).has(e)){o(!0);const t=new URL(window.location);t.searchParams.has(e)&&(t.searchParams.delete(e),window.history.replaceState({},"",t))}},[e,o]),{closeDialogFromUrl:()=>{r(!1)},openDialogFromUrl:()=>r(!0),openFromUrl:n}}},7065(e,t,n){n.d(t,{A:()=>A});var i=n(9698),a=n(9869),r=n(6540),o=n(1635),s=n(1468),l={ANIM_CHECKED_INDETERMINATE:"mdc-checkbox--anim-checked-indeterminate",ANIM_CHECKED_UNCHECKED:"mdc-checkbox--anim-checked-unchecked",AN
2IM_INDETERMINATE_CHECKED:"mdc-checkbox--anim-indeterminate-checked",ANIM_INDETERMINATE_UNCHECKED:"mdc-checkbox--anim-indeterminate-unchecked",ANIM_UNCHECKED_CHECKED:"mdc-checkbox--anim-unchecked-checked",ANIM_UNCHECKED_INDETERMINATE:"mdc-checkbox--anim-unchecked-indeterminate",BACKGROUND:"mdc-checkbox__background",CHECKED:"mdc-checkbox--checked",CHECKMARK:"mdc-checkbox__checkmark",CHECKMARK_PATH:"mdc-checkbox__checkmark-path",DISABLED:"mdc-checkbox--disabled",INDETERMINATE:"mdc-checkbox--indeterminate",MIXEDMARK:"mdc-checkbox__mixedmark",NATIVE_CONTROL:"mdc-checkbox__native-control",ROOT:"mdc-checkbox",SELECTED:"mdc-checkbox--selected",UPGRADED:"mdc-checkbox--upgraded"},c={ARIA_CHECKED_ATTR:"aria-checked",ARIA_CHECKED_INDETERMINATE_VALUE:"mixed",DATA_INDETERMINATE_ATTR:"data-indeterminate",NATIVE_CONTROL_SELECTOR:".mdc-checkbox__native-control",TRANSITION_STATE_CHECKED:"checked",TRANSITION_STATE_INDETERMINATE:"indeterminate",TRANSITION_STATE_INIT:"init",TRANSITION_STATE_UNCHECKED:"unchecked"},d={ANIM_END_LATCH_MS:250},u=function(e){function t(n){var i=e.call(this,(0,o.Cl)((0,o.Cl)({},t.defaultAdapter),n))||this;return i.currentCheckState=c.TRANSITION_STATE_INIT,i.currentAnimationClass="",i.animEndLatchTimer=0,i.enableAnimationEndHandler=!1,i}return(0,o.C6)(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return l},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return c},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return d},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},forceLayout:function(){},hasNativeControl:function(){return!1},isAttachedToDOM:function(){return!1},isChecked:function(){return!1},isIndeterminate:function(){return!1},removeClass:function(){},removeNativeControlAttr:function(){},setNativeControlAttr:function(){},setNativeControlDisabled:function(){}}},enumerable:!1,configurable:!0}),t.prototype.init=function(){this.currentCheckState=this.determineCheckState(),this.updateAriaChecked(),this.adapter.addClass(l.UPGRADED)},t.prototype.destroy=function(){clearTimeout(this.animEndLatchTimer)},t.prototype.setDisabled=function(e){this.adapter.setNativeControlDisabled(e),e?this.adapter.addClass(l.DISABLED):this.adapter.removeClass(l.DISABLED)},t.prototype.handleAnimationEnd=function(){var e=this;this.enableAnimationEndHandler&&(clearTimeout(this.animEndLatchTimer),this.animEndLatchTimer=setTimeout(function(){e.adapter.removeClass(e.currentAnimationClass),e.enableAnimationEndHandler=!1},d.ANIM_END_LATCH_MS))},t.prototype.handleChange=function(){this.transitionCheckState()},t.prototype.transitionCheckState=function(){if(this.adapter.hasNativeControl()){var e=this.currentCheckState,t=this.determineCheckState();if(e!==t){this.updateAriaChecked();var n=l.SELECTED;t===c.TRANSITION_STATE_UNCHECKED?this.adapter.removeClass(n):this.adapter.addClass(n),this.currentAnimationClass.length>0&&(clearTimeout(this.animEndLatchTimer),this.adapter.forceLayout(),this.adapter.removeClass(this.currentAnimationClass)),this.currentAnimationClass=this.getTransitionAnimationClass(e,t),this.currentCheckState=t,this.adapter.isAttachedToDOM()&&this.currentAnimationClass.length>0&&(this.adapter.addClass(this.currentAnimationClass),this.enableAnimationEndHandler=!0)}}},t.prototype.determineCheckState=function(){var e=c.TRANSITION_STATE_INDETERMINATE,t=c.TRANSITION_STATE_CHECKED,n=c.TRANSITION_STATE_UNCHECKED;return this.adapter.isIndeterminate()?e:this.adapter.isChecked()?t:n},t.prototype.getTransitionAnimationClass=function(e,n){var i=c.TRANSITION_STATE_INIT,a=c.TRANSITION_STATE_CHECKED,r=c.TRANSITION_STATE_UNCHECKED,o=t.cssClasses,s=o.ANIM_UNCHECKED_CHECKED,l=o.ANIM_UNCHECKED_INDETERMINATE,d=o.ANIM_CHECKED_UNCHECKED,u=o.ANIM_CHECKED_INDETERMINATE,h=o.ANIM_INDETERMINATE_CHECKED,m=o.ANIM_INDETERMINATE_UNCHECKED;switch(e){case i:return n===r?"":n===a?h:m;case r:return n===a?s:l;case a:return n===r?d:u;default:return n===a?h:m}},t.prototype.updateAriaChecked=function(){this.adapter.isIndeterminate()?this.adapter.setNativeControlAttr(c.ARIA_CHECKED_ATTR,c.ARIA_CHECKED_INDETERMINATE_VALUE):this.adapter.removeNativeControlAttr(c.ARIA_CHECKED_ATTR)},t}(s.I),h=n(9376),m=n(3189),p=n(3725);u.prototype.installPropertyChangeHooks_=()=>{};const f=(0,h.a0)(function(e,t){const{renderToggle:n,id:r,toggleRootProps:o,rootEl:s,checkboxEl:l}=(e=>{const t=(0,h.Bi)("checkbox",e),{renderToggle:n,toggleRootProps:i,id:r}=(0,p.T)({...e,id:t}),{foundation:o,...s}=(0,h.P5)({props:e,elements:{rootEl:!0,checkboxEl:!0},foundation:({rootEl:e,checkboxEl:t,getProps:n})=>new u({addClass:t=>e.addClass(t),removeClass:t=>e.removeClass(t),setNativeControlAttr:(e,n)=>t.setProp(e,n),removeNativeControlAttr:e=>t.removeProp(e),isIndeterminate:()=>!!n().indeterminate,isChecked:()=>{var e;return void 0!==n().checked?!!n().checked:!(null==(e=t.ref)||!e.checked)},hasNativeControl:()=>!!t.ref,setNativeControlDisabled:e=>t.setProp("disabled",e),forceLayout:()=>{var t;return null==(t=e.ref)?void 0:t.offsetWidth},isAttachedToDOM:()=>!0})}),{rootEl:l,checkboxEl:c}=s,d=(0,a.useCallback)(()=>{c.ref&&(c.ref.indeterminate=!!e.indeterminate),window.requestAnimationFrame(()=>{o.handleChange()})},[e.indeterminate,o,c.ref]);return(0,a.useEffect)(()=>{d()},[d]),l.setProp("onAnimationEnd",t=>{var n;null==(n=e.onAnimationEnd)||n.call(e,t),o.handleAnimationEnd()},!0),c.setProp("onChange",t=>{var n;null==(n=e.onChange)||n.call(e,t),d()},!0),{foundation:o,renderToggle:n,toggleRootProps:i,id:r,...s}})(e),{children:c,className:d,label:m,style:f,indeterminate:A,inputRef:C,foundationRef:E,...T}=e;return n((0,i.FD)(g,{...s.props({checked:T.checked,indeterminate:A,...o}),ref:(0,h.Px)(s.reactRef,t),children:[(0,i.Y)("input",{...l.props({...T,className:"mdc-checkbox__native-control"}),type:"checkbox",ref:(0,h.Px)(l.reactRef,C,t),id:r}),(0,i.Y)(v,{}),(0,i.Y)(b,{})]}))}),g=(0,m.zu)({surface:!1,unbounded:!0})(r.forwardRef(function(e,t){const n=(0,a.useContext)(h.YO),r=(0,a.useContext)(h.ag),{disabled:o,checked:s,indeterminate:l,...c}=e,d=(0,h.UP)(e,["mdc-checkbox",{"mdc-data-table__row-checkbox":n&&!r,"mdc-data-table__header-row-checkbox":r,"mdc-checkbox--disabled":o,"mdc-checkbox--selected":s||l}]);return(0,i.Y)(h.vw,{...c,className:d,ref:t})})),b=r.memo(function(){return(0,i.Y)("div",{className:"mdc-checkbox__ripple"})}),v=r.memo(()=>(0,i.FD)("div",{className:"mdc-checkbox__background",children:[(0,i.Y)("svg",{className:"mdc-checkbox__checkmark",viewBox:"0 0 24 24",children:(0,i.Y)("path",{className:"mdc-checkbox__checkmark-path",fill:"none",stroke:"white",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})}),(0,i.Y)("div",{className:"mdc-checkbox__mixedmark"})]})),A=f},1713(e,t,n){n.d(t,{A:()=>
2o});var i=n(6942),a=n.n(i),r=n(9698);function o({icon:e,label:t,onClick:n,title:i,...o}){const s=n?"button":"span",l={...o};return n&&Object.assign(l,{onClick:n,type:"submit"}),(0,r.FD)(s,{className:"ei4gMpmAcz",title:i,...l,children:[e&&(0,r.Y)("i",{className:a()("DJbTo_QBDg",e)}),(0,r.Y)("span",{className:"s4A29lgtIn",children:t})]})}},5301(e,t,n){n.d(t,{A:()=>a});var i=n(9698);function a({children:e}){return(0,i.Y)("div",{className:"O7pr6zAjlt",children:e})}},335(e,t,n){const i=n(1879).LX;n.d(t,["A",0,i])},8363(e,t,n){const i=n(1953).B8;n.d(t,["A",0,i])},4893(e,t,n){const i=n(1953).DS;n.d(t,["A",0,i])},3059(e,t,n){const i=n(1953).Zq;n.d(t,["A",0,i])},7224(e,t,n){var i=n(25),a=n(9869),r=n(9698);function o({disabled:e=!1,...t},n){return(0,r.Y)(i.Dr,{...t,ref:n,disabled:e||void 0})}const s=(0,a.forwardRef)(o);n.d(t,["A",0,s])},2857(e,t,n){var i=n(25);const a=(0,n(0).A)(i.XN);n.d(t,["A",0,a])},8958(e,t,n){n.d(t,{A:()=>b});var i=n(9698),a=n(6540),r=n(9376),o=n(3189),s=n(3725),l=n(1635),c=n(1468),d={NATIVE_CONTROL_SELECTOR:".mdc-radio__native-control"},u={DISABLED:"mdc-radio--disabled",ROOT:"mdc-radio"},h=function(e){function t(n){return e.call(this,(0,l.Cl)((0,l.Cl)({},t.defaultAdapter),n))||this}return(0,l.C6)(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return u},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return d},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNativeControlDisabled:function(){}}},enumerable:!1,configurable:!0}),t.prototype.setDisabled=function(e){var n=t.cssClasses.DISABLED;this.adapter.setNativeControlDisabled(e),e?this.adapter.addClass(n):this.adapter.removeClass(n)},t}(c.I);const m=(0,r.a0)(function(e,t){const{renderToggle:n,id:a,toggleRootProps:o,rootEl:l}=(e=>{const{renderToggle:t,toggleRootProps:n,id:i}=(0,s.T)(e),{foundation:a,...o}=(0,r.P5)({props:e,elements:{rootEl:!0},foundation:({rootEl:e})=>new h({addClass:t=>e.addClass(t),removeClass:t=>e.removeClass(t)})});return{foundation:a,renderToggle:t,toggleRootProps:n,id:i,...o}})(e),{children:c,className:d,label:u,style:m,inputRef:b,foundationRef:v,...A}=e;return n((0,i.FD)(f,{...l.props(o),ref:(0,r.Px)(l.reactRef,t),children:[(0,i.Y)("input",{...A,className:"mdc-radio__native-control",type:"radio",id:a,ref:(0,r.Px)(t,b)}),(0,i.Y)(g,{}),(0,i.Y)(p,{})]}))}),p=a.memo(function(){return(0,i.Y)("div",{className:"mdc-radio__ripple"})}),f=(0,o.zu)({surface:!1,unbounded:!0})(a.forwardRef(function(e,t){const{disabled:n,...a}=e,o=(0,r.UP)(e,["mdc-radio",{"mdc-radio--disabled":n}]);return(0,i.Y)(r.vw,{...a,className:o,ref:t})})),g=a.memo(function(){return(0,i.FD)("div",{className:"mdc-radio__background",children:[(0,i.Y)("div",{className:"mdc-radio__outer-circle"}),(0,i.Y)("div",{className:"mdc-radio__inner-circle"})]})}),b=m},6822(e,t,n){n.d(t,{A:()=>s});var i=n(1953),a=n(6942),r=n.n(a),o=n(9698);function s({children:e,className:t,title:n}){return(0,o.FD)(o.FK,{children:[n&&(0,o.Y)("h5",{className:"TFEJY4OcDC",children:n}),(0,o.Y)(i.B8,{className:r()("RcTIQkOyzO",t),children:e})]})}},2970(e,t,n){n.d(t,{A:()=>E});var i,a,r=n(9698),o=n(6540),s=n(9869),l=n(9376),c=n(3725),d=n(1635),u=n(1468),h=new WeakMap,m=function(e){function t(t){var n=e.call(this,t)||this;return n.unobserves=new Set,n}return(0,d.C6)(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this),this.unobserve()},t.prototype.observe=function(e,t){var n,i,a=this,r=[];try{for(var o=(0,d.Ju)(Object.keys(t)),s=o.next();!s.done;s=o.next()){var l=s.value,c=t[l].bind(this);r.push(this.observeProperty(e,l,c))}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}var u=function(){var e,t;try{for(var n=(0,d.Ju)(r),i=n.next();!i.done;i=n.next())(0,i.value)()}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}a.unobserves.delete(u)};return this.unobserves.add(u),u},t.prototype.observeProperty=function(e,t,n){return function(e,t,n){var i=function(e,t){var n=new Map;h.has(e)||h.set(e,{isEnabled:!0,getObservers:function(e){var t=n.get(e)||[];return n.has(e)||n.set(e,t),t},installedProperties:new Set});var i=h.get(e);if(i.installedProperties.has(t))return i;var a=function(e,t){for(var n,i=e;i&&!(n=Object.getOwnPropertyDescriptor(i,t));)i=Object.getPrototypeOf(i);return n}(e,t)||{configurable:!0,enumerable:!0,value:e[t],writable:!0},r=(0,d.Cl)({},a),o=a.get,s=a.set;if("value"in a){delete r.value,delete r.writable;var l=a.value;o=function(){return l},a.writable&&(s=function(e){l=e})}return o&&(r.get=function(){return o.call(this)}),s&&(r.set=function(e){var n,a,r=o?o.call(this):e;if(s.call(this,e),i.isEnabled&&(!o||e!==r))try{for(var l=(0,d.Ju)(i.getObservers(t)),c=l.next();!c.done;c=l.next())(0,c.value)(e,r)}catch(e){n={error:e}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(n)throw n.error}}}),i.installedProperties.add(t),Object.defineProperty(e,t,r),i}(e,t),a=i.getObservers(t);return a.push(n),function(){a.splice(a.indexOf(n),1)}}
2(e,t,n)},t.prototype.setObserversEnabled=function(e,t){!function(e,t){var n=h.get(e);n&&(n.isEnabled=t)}(e,t)},t.prototype.unobserve=function(){var e,t;try{for(var n=(0,d.Ju)((0,d.fX)([],(0,d.zs)(this.unobserves))),i=n.next();!i.done;i=n.next())(0,i.value)()}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},t}(u.I);!function(e){e.PROCESSING="mdc-switch--processing",e.SELECTED="mdc-switch--selected",e.UNSELECTED="mdc-switch--unselected"}(i||(i={})),function(e){e.RIPPLE=".mdc-switch__ripple"}(a||(a={}));var p=function(e){function t(t){var n=e.call(this,t)||this;return n.handleClick=n.handleClick.bind(n),n}return(0,d.C6)(t,e),t.prototype.init=function(){this.observe(this.adapter.state,{disabled:this.stopProcessingIfDisabled,processing:this.stopProcessingIfDisabled})},t.prototype.handleClick=function(){this.adapter.state.disabled||(this.adapter.state.selected=!this.adapter.state.selected)},t.prototype.stopProcessingIfDisabled=function(){this.adapter.state.disabled&&(this.adapter.state.processing=!1)},t}(m);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}(0,d.C6)(t,e),t.prototype.init=function(){e.prototype.init.call(this),this.observe(this.adapter.state,{disabled:this.onDisabledChange,processing:this.onProcessingChange,selected:this.onSelectedChange})},t.prototype.initFromDOM=function(){this.setObserversEnabled(this.adapter.state,!1),this.adapter.state.selected=this.adapter.hasClass(i.SELECTED),this.onSelectedChange(),this.adapter.state.disabled=this.adapter.isDisabled(),this.adapter.state.processing=this.adapter.hasClass(i.PROCESSING),this.setObserversEnabled(this.adapter.state,!0),this.stopProcessingIfDisabled()},t.prototype.onDisabledChange=function(){this.adapter.setDisabled(this.adapter.state.disabled)},t.prototype.onProcessingChange=function(){this.toggleClass(this.adapter.state.processing,i.PROCESSING)},t.prototype.onSelectedChange=function(){this.adapter.setAriaChecked(String(this.adapter.state.selected)),this.toggleClass(this.adapter.state.selected,i.SELECTED),this.toggleClass(!this.adapter.state.selected,i.UNSELECTED)},t.prototype.toggleClass=function(e,t){e?this.adapter.addClass(t):this.adapter.removeClass(t)}}(p);const f=(0,l.a0)(function(e,t){const{renderToggle:n,id:i,toggleRootProps:a,rootEl:d,selected:u}=(e=>{const{renderToggle:t,toggleRootProps:n,id:i}=(0,c.T)(e),[a,r]=o.useState(!1),[d,u]=o.useState(!1),[h,m]=o.useState(!1),{foundation:f,...g}=(0,l.P5)({props:e,elements:{rootEl:!0},foundation:({rootEl:t})=>new p({addClass:e=>t.addClass(e),hasClass:e=>t.hasClass(e),isDisabled:()=>e.disabled,removeClass:e=>t.removeClass(e),setAriaChecked:e=>{var n;return null==(n=t.ref)?void 0:n.setAttribute("aria-checked",e)},setDisabled:e=>{t.setProp("disabled",e)},state:{disabled:a,processing:d,selected:h}})}),{rootEl:b}=g;return(0,s.useEffect)(()=>{void 0!==e.checked&&m(e.checked)},[e.checked]),(0,s.useEffect)(()=>{void 0!==e.defaultChecked&&m(e.defaultChecked)},[e.defaultChecked]),(0,s.useEffect)(()=>{void 0!==e.disabled&&r(e.disabled)},[e.disabled]),(0,s.useEffect)(()=>{void 0!==e.processing&&u(e.processing)},[e.processing]),b.setProp("onClick",t=>{var n;m(e=>!e),null==(n=e.onClick)||n.call(e,t),b.setProp("checked",h),f.handleClick()},!0),{foundation:f,renderToggle:t,toggleRootProps:n,id:i,disabled:a,selected:h,processing:d,...g}})(e),{children:h,className:m,disabled:f,label:C,...E}=e,T=(0,l.UP)(a,["mdc-switch",{"mdc-switch--unselected":!u,"mdc-switch--selected":u}]);return n((0,r.FD)(l.vw,{...d.props({...a,className:T}),ref:(0,l.Px)(d.reactRef,t),disabled:f,tag:"button",type:"button",role:"switch","aria-checked":u??E["aria-checked"],"aria-label":C,id:i,element:d,...E,children:[(0,r.Y)(g,{}),(0,r.FD)(b,{children:[(0,r.Y)("div",{className:"mdc-switch__shadow",children:(0,r.Y)("div",{className:"mdc-elevation-overlay"})}),(0,r.Y)(A,{}),(0,r.Y)(v,{})]}),(0,r.Y)("span",{className:"mdc-switch__focus-ring-wrapper",children:(0,r.Y)("div",{className:"mdc-switch__focus-ring"})})]}))}),g=o.memo(function(){return(0,r.Y)("div",{className:"mdc-switch__track"})}),b=o.memo(function({children:e}){return(0,r.Y)("div",{className:"mdc-switch__handle-track",children:(0,r.Y)("div",{className:"mdc-switch__handle",children:e})})}),v=o.memo(function(){return(0,r.FD)("div",{className:"mdc-switch__icons",children:[(0,r.Y)("svg",{className:"mdc-switch__icon mdc-switch__icon--on",viewBox:"0 0 24 24",children:(0,r.Y)("path",{d:"M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"})}),(0,r.Y)("svg",{className:"mdc-switch__icon mdc-switch__icon--off",viewBox:"0 0 24 24",children:(0,r.Y)("path",{d:"M20 13H4v-2h16v2z"})})]})}),A=o.memo(function(){return(0,r.Y)("div",{className:"mdc-switch__ripple"})});
2function C({onChange:e,onClick:t,...n},i){return(0,r.Y)(f,{...n,ref:i,onClick:n=>{if(t?.(n),e){const{target:t}=n;t.checked="true"!==n.currentTarget.getAttribute("aria-checked"),e(n)}}})}const E=(0,s.forwardRef)(C)},0(e,t,n){n.d(t,{A:()=>o});var i=n(9869),a=n(9698);const r=(0,i.forwardRef)(({style:e,surfaceTag:t="div",...n},i)=>(0,a.Y)(t,{...n,ref:i,style:{...e,maxHeight:`min(${e?.maxHeight||"100vh"}, var(--menu-max-height, 100vh))`}}));function o(e){return(0,i.forwardRef)(({open:t,style:n,tag:i,...o},s)=>{const{maxHeight:l,...c}=n||{},d="number"==typeof l?`${l}px`:l;return(0,a.Y)(e,{...o,ref:s,"data-menu-open":t||void 0,open:t,style:{...c,"--menu-max-height":"none"===d?void 0:d},surfaceTag:i,tag:r})})}},9712(e,t,n){n.r(t),n.d(t,{default:()=>_n});var i=n(1258),a=n(4843),r=n(2109),o=n(6367),s=n(4681),l=n(9698);function c(){const[e]=(0,a.fp)(s.EQ),[t]=(0,a.fp)(s.zq),[n]=(0,a.fp)(s.h1);return e!==r.rZ.FREE||t?null:(0,l.FD)("div",{className:"P2g8F53ukm",children:[(0,l.Y)("h3",{className:"margin-top-05 no-margin-b mdc-card__title",children:"Select Your Plan"}),(0,l.Y)(o.A,{group:n?"team":"individual"})]})}var d=n(9869),u=n(1818),h=n(7071),m=n(7563),p=n(4918),f=n(8847),g=n(8028),b=n(3002),v=n(1897),A=n(6402),C=n(7693);function E({loading:e,onClose:t,open:n,records:i,renderReport:a,title:r}){return(0,l.FD)(b.A,{open:n,size:"md",onClose:t,children:[(0,l.Y)(v.A,{children:r}),!0===e?(0,l.Y)(A.A,{}):a(i)]})}function T({onClose:e,onOpen:t,recordsType:n,renderReport:i,title:a}){const{subscriptionState:{group:r}}=(0,d.useContext)(g.A),[o,s]=(0,d.useState)(!0),[c,u]=(0,d.useState)(!1),[m,p]=(0,d.useState)([]);return(0,l.FD)(l.FK,{children:[(0,l.Y)(C.zh,{onClick:async()=>{const e=(0,f.Lp)(n,{group:r});t(),u(!0);const i=await fetch(e,{credentials:"same-origin",method:"GET"});i.ok?p(await i.json()):(0,h.xE)("Something went wrong! Please try again later",{callback:()=>{u(!1)},dialog:!0}),s(!1)},children:a}),(0,l.Y)(E,{loading:o,open:c,records:m,renderReport:i,title:a,onClose:()=>{e(),u(!1)}})]})}var y=n(1751),S=n(5301),N=n(1713),_=n(5391),Y=n(6660);function I(){return(0,l.Y)(T,{recordsType:"invoices",renderReport:e=>{const t=e.map(e=>{let t="Open";return!0===e.paid&&(t="Paid"),(0,l.FD)("tr",{children:[(0,l.FD)("td",{children:[e.total<0&&"(",(0,p.vv)(e.total,e.currency),e.total<0&&")"]}),(0,l.Y)("td",{className:"mdl-data-table__cell--non-numeric",children:(0,l.Y)(S.A,{children:(0,l.Y)(N.A,{label:t})})}),(0,l.Y)("td",{children:e.number}),(0,l.Y)("td",{children:(0,p.Ey)(e.created)}),(0,l.Y)("td",{className:"mdl-data-table__cell--non-numeric",children:null!==e.hosted_invoice_url&&(0,l.Y)(_.A,{onClick:()=>window.open(e.hosted_invoice_url,"_blank"),children:"Download"})})]},e.number)});return(0,l.FD)(l.FK,{children:[(0,l.Y)("div",{className:"grey-bordered-card",style:{marginBottom:"0.5em",padding:"0.5rem 0",textAlign:"left"},children:(0,l.Y)(y.A,{})}),(0,l.FD)("table",{className:"mdl-data-table",style:{width:"100%"},children:[(0,l.Y)("thead",{children:(0,l.FD)("tr",{children:[(0,l.Y)("th",{children:"Amount"}),(0,l.Y)("th",{"aria-label":"Status",className:"mdl-data-table__cell--non-numeric"}),(0,l.Y)("th",{children:"Invoice Number"}),(0,l.Y)("th",{children:"Created"}),(0,l.Y)("th",{"aria-label":"Actions"})]})}),(0,l.Y)("tbody",{children:t})]})]})},title:"Invoices",onClose:()=>(0,Y.s)("dialog",{action:"close",name:"invoices"}),onOpen:()=>(0,Y.s)("dialog",{action:"show",name:"invoices"})})}function D(){return(0,l.Y)(T,{recordsType:"txs",renderReport:e=>{const t=e.map(({amount:e,amount_refunded:t,created:n,currency:i,payment_method:{last4:a,name:r,tx:o,wallet:s},status:c})=>{let d=c;return e===t?d="refunded":t>0&&(d=(0,l.Y)("span",{"aria-label":(0,p.vv)(t,i),role:"tooltip",children:"partial refund"})),(0,l.FD)("tr",{children:[(0,l.Y)("td",{children:(0,p.vv)(e,i)}),(0,l.Y)("td",{className:"mdl-data-table__cell--non-numeric",children:(0,l.Y)(S.A,{children:(0,l.Y)(N.A,{label:d,style:{textTransform:"capitalize"}})})}),(0,l.Y)("td",{className:"mdl-data-table__cell--non-numeric",children:(0,l.FD)("span",{children:[s&&`${s} | `,r,a&&` â¢â¢â¢â¢ ${a}`,o&&` (${o})`]})}),(0,l.Y)("td",{children:(0,p.Ey)(n)})]},n)});return(0,l.FD)("table",{className:"mdl-data-table",style:{width:"100%"},children:[(0,l.Y)("thead",{children:(0,l.FD)("tr",{children:[(0,l.Y)("th",{children:"Amount"}),(0,l.Y)("th",{"aria-label":"Status",className:"mdl-data-table__cell--non-numeric"}),(0,l.Y)("th",{className:"mdl-data-table__cell--non-numeric",children:"Payment Method"}),(0,l.Y)("th",{children:"Created"})]})}),(0,l.Y)("tbody",{children:t})]})},title:"Transactions",onClose:()=>
2(0,Y.s)("dialog",{action:"close",name:"transactions"}),onOpen:()=>(0,Y.s)("dialog",{action:"show",name:"transactions"})})}var w=n(3446),O=n(5159);function R({onClose:e,open:t}){const{loadSubscriptionState:n,subscriptionState:{plan:i}}=(0,d.useContext)(g.A);return(0,d.useEffect)(()=>{t&&"free"===i&&n()},[n,t,i]),(0,l.FD)(b.A,{closable:!0,open:t,size:"md",onClose:e,children:[(0,l.Y)(v.A,{className:"text-center",children:"Update Billing"}),(0,l.Y)("div",{className:"action-align-center",children:(0,l.Y)(w.A,{isUpdateBillingDialog:!0,onClose:e})})]})}function x(){const{closeDialogFromUrl:e,openDialogFromUrl:t,openFromUrl:n}=(0,O.A)(r.uB.updateBilling),i=(0,d.useCallback)(()=>{(0,Y.s)("dialog",{action:"close",name:"update_billing"}),e()},[e]);return(0,l.FD)(l.FK,{children:[(0,l.Y)(_.A,{onClick:()=>{(0,Y.s)("dialog",{action:"show",name:"update_billing"}),t()},children:"Update Billing"}),(0,l.Y)(R,{open:n,onClose:i})]})}var P=n(9164),F=n(847);function k(){const{subscriptionState:{team:e}}=(0,d.useContext)(g.A),[t,n]=(0,d.useState)([]),[i,a]=(0,d.useState)(!1),[r,o]=(0,d.useState)(!1),{domain:s}=e;if(!s)return null;const c=t.map(e=>`${e}@${s}`);return(0,l.FD)(l.FK,{children:[(0,l.Y)(C.zh,{type:"submit",onClick:()=>o(!0),children:"Invite to Join Team"}),(0,l.FD)(b.A,{closable:!0,open:r,size:"lg",onClose:()=>o(!1),children:[(0,l.Y)(v.A,{children:"Invite to Join Team"}),(0,l.Y)(P.A,{setInvites:e=>{JSON.stringify(t)!==JSON.stringify(e)&&n(e)},teamDomain:s}),(0,l.Y)(F.A,{isDefaultAction:!0,raised:!0,className:"btn-lg",disabled:0===t.length||i,type:"button",onClick:async()=>{a(!0);const n=await fetch(`/api/team/${e.teamId}/invite_by_member`,{body:JSON.stringify({invites:t}),credentials:"same-origin",method:"POST"});a(!1),n.ok?((0,Y.s)("dialog",{action:"submit",name:"invite_user_to_join_team"}),(0,h.xE)(`Shared with ${c.join(", ")}`),o(!1)):(0,h.xE)(`Couldn't share with ${c.join(", ")}`)},children:"Invite"})]})]})}var L=n(6331),M=n(3843),U=n(1539),B=n(7399),K=n(9144),H=n(4358),j=n(9002),z=n(2857),W=n(2199);function G({raised:e}){const{subscriptionState:t}=(0,d.useContext)(g.A),[n]=(0,a.fp)(s.zq),{isFree:i}=t;return i&&!n&&(0,l.Y)(_.A,{raised:e,onClick:()=>{(0,m.Dh)({action:M.Jw.TRY_SUBSCRIPTION,showView:!0,source:M.YH.ACCOUNT,view:M.al.SELECT_PLAN,...(0,m.ao)()})}
2,children:(0,u.uZ)((0,s.wz)()?.trialUsed)?"Reactivate Membership":"Start a Trial"})}function $({adminEmail:e,isPaid:t,isPending:n}){const i=(0,l.Y)("a",{href:`mailto:${e}`,children:e}),a=t?"Status: Your team account is active.":(0,l.FD)(l.FK,{children:["Your team membership has not been paid. Please contact your team administrator ",i]});return(0,l.Y)("div",{className:"mdc-card__content pay-info",children:n?(0,l.FD)("p",{children:["You are awaiting Team administrator confirmation. You may contact the Team administrator directly via email: ",i," "]}):a})}function V(){const{subscriptionState:{interval:e}}=(0,d.useContext)(g.A),[,t]=(0,a.fp)(U._O);return(0,l.Y)(_.A,{onClick:()=>{t("day"===e?"year":e),(0,m.Dh)({action:M.Jw.TRY_SUBSCRIPTION,showView:!0,source:M.YH.ACCOUNT,view:M.al.SELECT_PLAN})},children:"Manage Subscription"})}function q(e){const{location:t}=window;e?t.href=e:t.reload()}function J({open:e}){return(0,l.FD)(b.A,{open:e,size:"md",onClose:()=>q(),children:[(0,l.Y)(v.A,{children:"Leave Team"}),(0,l.FD)(K.A,{children:[(0,l.Y)("p",{children:"You have left the team. Your account was downgraded to an individual free account."}),(0,l.Y)("p",{children:(0,l.Y)("b",{children:"If you'd like to continue using Law Insider premium features, you can sign up for a membership using promo code below."})}),(0,l.Y)("p",{children:(0,l.FD)("b",{children:['Select a plan and enter code "',(0,l.Y)("span",{className:"green",children:"WELCOME10"}),'" at checkout for 10% OFF any plan for up to 12 months.']})})]}),(0,l.FD)(H.A,{className:"dialog-actions",children:[(0,l.Y)(_.A,{raised:!0,onClick:()=>q(`${r.A.ACCOUNT}?${r.uB.upgradeDialog}`),children:"Select Plan"}),(0,l.Y)(_.A,{outlined:!0,onClick:()=>q(),children:"Close"})]})]})}function X({onClose:e,onOpenFinishDialog:t}){const{subscriptionState:{isPending:n,team:i}}=(0,d.useContext)(g.A),[a,r]=(0,d.useState)(!1);return(0,l.Y)(_.A,{outlined:!0,disabled:a,onClick:async()=>{r(!0),await fetch(`/api/team/${i.teamId}/${n?"pending":"leave"}`,{method:"DELETE"}),r(!1),t(),e()},children:"Continue"})}function Q({onClose:e,onOpenFinishDialog:t,open:n}){return(0,l.FD)(b.A,{open:n,size:"md",onClose:e,children:[(0,l.Y)(v.A,{children:"Leave Team"}),(0,l.FD)(K.A,{className:"text-left",children:[(0,l.Y)("p",{children:"By clicking Continue, you will lose access to all features included in your team plan, such as premium and collaboration features, as well as shared content. Your account will be downgraded to a limited free access plan."}),(0,l.Y)("p",{children:"Are you sure you want to leave this team?"})]}),(0,l.FD)(H.A,{className:"dialog-actions",children:[(0,l.Y)(_.A,{raised:!0,onClick:e,children:"Cancel"}),(0,l.Y)(X,{onClose:e,onOpenFinishDialog:t})]})]})}function Z(){const[e,t]=(0,d.useState)(!1),[n,i]=(0,d.useState)(!1);return(0,l.FD)(l.FK,{children:[(0,l.Y)(C.zh,{onClick:()=>{t(!0)},children:"Leave Team"}),(0,l.Y)(Q,{open:e,onClose:()=>t(!1),onOpenFinishDialog:()=>i(!0)}),(0,l.Y)(J,{open:n})]})}function ee(){return(0,l.Y)(C.zh,{onClick:async()=>
2{(0,m.Dh)({source:M.YH.ACCOUNT,view:M.al.DELETE_TEAM})},children:"Delete Team"})}function te({planType:e}){return(0,l.Y)(_.A,{onClick:()=>{(0,m.Dh)({action:M.Jw.DOWNGRADE,details:{immediateCancellation:e===r.x1},view:M.al.DOWNGRADE})},children:"Cancel Subscription"})}function ne(){const{subscriptionState:{hasPaymentInfo:e,hasTeam:t,isTeamPlan:n,plan:i}}=(0,d.useContext)(g.A),[r]=(0,a.fp)(s.zq),[o,c]=(0,d.useState)(!1),h=[{content:(0,l.Y)(V,{},"manage_subscription"),visible:"free"!==i&&!r},{content:(0,l.Y)(k,{},"invite_team"),visible:"free"!==i&&r},{content:(0,l.Y)(Z,{},"leave_team"),visible:r},{content:(0,l.Y)(I,{},"invoices"),visible:"free"!==i&&!r&&e},{content:(0,l.Y)(D,{},"transactions"),visible:"free"!==i&&!r&&e},{content:(0,l.Y)(x,{},"update_billing"),visible:"free"!==i&&!r&&((0,u.a4)()||!(n||t))},{content:(0,l.Y)(ee,{},"delete_team"),visible:t&&!r}].filter(e=>e.visible);return 0===h.length?null:(0,l.FD)(j.A,{children:[(0,l.FD)(_.A,{onClick:()=>c(!0),children:["Manage ",(0,l.Y)("i",{className:"icon icon--xs icon-chevron-down-blue"})]}),(0,l.Y)(z.A,{anchorCorner:"bottomLeft",className:"user-subscription__menu",open:o,onClose:()=>c(!1),children:h.map(e=>e.content)})]})}function ie(){const{loadSubscriptionState:e,subscriptionState:t}=(0,d.useContext)(g.A),[n]=(0,a.fp)(s.aQ);(0,d.useEffect)(()=>{e()},[e]);const{subscription:i}=t;if((0,d.useEffect)(()=>{i instanceof Error&&(0,h.lJ)(i.message,r.XG)},[i]),void 0===i)return(0,l.Y)(A.A,{});if(i instanceof Error)return null;const{adminData:o,hasTeam:c,isFree:p,isPending:f,isTeamMember:b,isTeamPlan:v,plan:E,planType:T,subscription:{cancelAtPeriodEnd:S,paymentIntent:N},tier:Y}=t,I=p&&c;return(0,l.FD)(C.Ay,{className:"subscription-details",children:[(0,l.FD)("h2",{className:"mdc-card__title",children:["Your ",U.UD[Y]," Membership"]}),(0,l.Y)(y.A,{compact:!0}
2),b&&(0,l.Y)($,{adminEmail:o.email,isPaid:!N?.error&&v,isPending:f}),!f&&(0,l.FD)(C.w,{children:[(0,l.Y)(ne,{}),(0,l.FD)(C.aJ,{className:"account__buttons",children:[((0,u.a4)()||!(v||c))&&(0,l.Y)(G,{raised:!I}),B.A.SHOW_REQUEST_PRO_TRIAL.get()&&!n&&b&&(0,l.Y)(_.A,{outlined:!0,onClick:()=>(0,m.Dh)({action:M.Jw.UPGRADE_TO_PRO,showView:!0,source:M.YH.HEADER,view:M.al.UPGRADE_TO_PRO}),children:"Request Pro Access"}),B.A.REQUEST_TEAM_DEMO.get()&&!c&&(0,l.Y)(W.A,{href:r.A.REQUEST_TEAM_DEMO,...r.Js,children:"Upgrade to Team"}),(c||!B.A.REQUEST_TEAM_DEMO.get())&&(0,l.Y)(L.A,{outlined:!0,isPayForTeam:I,showJoinLink:!1,onClick:(e,t)=>t(e)}),"free"!==E&&!b&&!S&&(0,l.Y)(te,{planType:T})]})]})]})}var ae=n(7309),re=n(1873),oe=n(1825),se="bTtT0rH5Ah",le="YaFNadvesg";function ce({namespaces:e,onClose:t,open:n}){return(0,l.FD)(b.A,{open:n,size:"md",onClose:t,children:[(0,l.Y)(v.A,{children:"Private Contract Libraries to Be Deleted"}),(0,l.Y)(oe.A,{children:Object.entries(e).map(([e,{isSoleOwner:t,label:n}])=>(0,l.Y)("li",{className:"row-flex flex-space-between",children:(0,l.FD)("span",{children:[(0,l.Y)("i",{className:`icon ${t?se:le}`}),n]})},e))}),(0,l.FD)("p",{className:"text-left",style:{paddingLeft:"1rem"},children:[(0,l.FD)("span",{className:"text-nowrap",style:{marginRight:"1rem"},children:[(0,l.Y)("i",{className:`icon ${se}`,style:{marginRight:0}})," = will be deleted"]}),(0,l.FD)("span",{className:"text-nowrap",children:[(0,l.Y)("i",{className:`icon ${le}`,style:{marginRight:0}})," = can not be deleted, has multiple owners"," ",(0,l.Y)("span",{"aria-label":"Libraries which have multiple owners can not be deleted with account removal.",className:"tooltip-flat-md tooltip-top-right",role:"tooltip",style:{cursor:"default",paddingLeft:"0.25em",verticalAlign:"middle"},children:"â"})]})]}),(0,l.Y)(_.A,{outlined:!0,onClick:t,children:"Close"})]})}function de(){const[e,t]=(0,d.useState)(!1),[n,i]=(0,d.useState)({});return(0,d.useEffect)(()=>{!async function(){const e=await fetch("/api/namespaces_with_owner_permission",{credentials:"same-origin",method:"GET"}),t=await e.json();i(t.private||{})}()},[]),0===Object.keys(n).length?null:(0,l.FD)("div",{children:[(0,l.Y)(_.A,{className:"btn-link",onClick:()=>t(!0),children:"See which private contract libraries will be deleted"}),e&&(0,l.Y)(ce,{namespaces:n,open:e,onClose:()=>t(!1)})]})}var ue=n(7065),he=n(5549);function me({onClose:e,open:t}){const[n,i]=(0,d.useState)(!1),[a,o]=(0,d.useState)(!1);return(0,l.FD)(b.A,{closable:!0,open:t,size:"lg",onClose:()=>{e()},children:[(0,l.Y)(v.A,{children:"Remove Account"}),(0,l.FD)("p",{children:["Weâd like to help you get the most out of Law Insider. If there is anything we can do in regards to your subscription, please"," ",(0,l.Y)("a",{href:r.A.CONTACT_SUPPORT,onClick:()=>e(),...r.Js,children:"contact support"})," ","before you cancel."]}),(0,l.Y)("hr",{}),(0,l.Y)("p",{children:(0,l.Y)("b",{children:"By removing your account now, all content associated with this account will be permanently deleted, including user data, and private contract libraries."})}),(0,l.Y)("p",{className:"color-red margin-b-10",children:(0,l.Y)("b",{children:"This action cannot be undone."})}),(0,l.Y)(de,{}),(0,l.Y)("div",{className:"margin-b-10",children:(0,l.Y)(ue.A,{checked:a,onChange:()=>o(e=>!e),children:(0,l.Y)("b",{children:"I understand and want to continue."})})}),(0,l.Y)(F.A,{isDefaultAction:!0,outlined:!0,disabled:n||!a,onClick:async()=>{i(!0),await(0,re.FO)(),i(!1)},children:n?(0,l.Y)(he.A,{}):"Remove Account"})]})}function pe(){const[e,t]=(0,d.useState)(!1);return(0,l.FD)(l.FK,{children:[(0,l.Y)(C.zh,{size:"sm",onClick:()=>t(!0),children:"Remove This Account"}),e&&(0,l.Y)(me,{open:e,onClose:()=>t(!1)})]})}function fe({onClose:e,open:t}){const{subscriptionState:n}=(0,d.useContext)(g.A),[i,a]=(0,d.useState)(!1),[o,s]=(0,d.useState)(!1),c=(0,p.Ey)(n.subscription.currentPeriodEnd);return(0,l.FD)(b.A,{open:t,size:"lg",onClose:e,children:[(0,l.Y)(v.A,{children:"Remove Account"}),(0,l.FD)("p",{children:["We'd like to help you get the most out of Law Insider. If there is anything we can do in regard to your account, please"," ",(0,l.Y)("a",{href:r.A.CONTACT_SUPPORT,...r.Js,children:"contact support"})]}),(0,l.Y)("hr",{}),(0,l.Y)("p",{children:(0,l.FD)("b",{children:["Your subscription is paid for until ",c," (pending c
2ancellation)."]})}),(0,l.Y)("p",{children:(0,l.Y)("b",{children:"By removing your account now you will lose access to this subscription, all content associated with this account will be permanently deleted, including user data, lists, and private libraries."})}),(0,l.Y)("p",{className:"color-red margin-b-10",children:(0,l.Y)("b",{children:"This action cannot be undone."})}),(0,l.Y)(de,{}),(0,l.Y)("div",{className:"margin-b-10",children:(0,l.Y)(ue.A,{checked:o,onChange:()=>s(e=>!e),children:(0,l.Y)("b",{children:"I understand and want to continue."})})}),(0,l.Y)(_.A,{outlined:!0,disabled:i||!o,onClick:async()=>{a(!0),await(0,re.FO)(),a(!1)},children:"Remove now"})]})}function ge(){const[e,t]=(0,d.useState)(!1);return(0,l.FD)(l.FK,{children:[(0,l.Y)(C.zh,{shadowed:!0,onClick:()=>t(!0),children:"Remove This Account"}),e&&(0,l.Y)(fe,{open:e,onClose:()=>t(!1)})]})}const be=function(){const{isSubscriptionStateRetrieved:e,subscriptionState:t}=(0,d.useContext)(g.A);return e?"free"!==t.plan?(0,l.FD)(C.Ay,{children:[(0,l.Y)("h2",{className:"mdc-card__title",children:"Need Help With Your Account?"}),(0,l.FD)("div",{className:"mdc-card__content",children:[(0,l.FD)("div",{className:"margin-b-1",children:["Contact ",(0,l.Y)(ae.A,{}),"."," "]}),t.subscription.cancelAtPeriodEnd&&(0,l.Y)(ge,{})]})]}):(0,l.Y)(C.Ay,{className:"card-without-title",children:(0,l.Y)(C.w,{children:(0,l.Y)(pe,{})})}):null};var ve=n(9214),Ae=n(4579),Ce=n.n(Ae),Ee=n(9511),Te=n.n(Ee),ye=n(6942),Se=n.n(ye),Ne=n(6536);function _e(){const[e,t]=(0,d.useState)(""),[n,i]=(0,d.useState)(!0);return(0,l.Y)("form",{className:"new-email",method:"POST",children:(0,l.Y)("dl",{className:"form-group",children:(0,l.FD)("dd",{className:"new-email__row",children:[(0,l.Y)("div",{className:"new-email__input",children:(0,l.Y)(Ne.A,{required:!0,className:"full-width",label:"Add Email Address",name:"email",type:"email",value:e,onChange:e=>{t(e.target.value),i(!(0,h.xd)(e.target.value))}})}),(0,l.Y)(_.A,{raised:!0,disabled:n,type:"submit",onClick:async n=>{n.preventDefault(),i(!0);const a=await fetch("/api/email",{body:JSON.stringify({email:e}),credentials:"same-origin",method:"POST"});if(!a.ok)return void(0,h.xE)(`Couldn't add this email: ${e}`);const{auth_ids:o,error:l,success:c}=await a.json();c?((0,s.TK)({authMethods:o}),t(""),i(!1),(0,h.xE)("Added new sign-in method"),(0,Y.s)("user_add_auth_id",{method:"email"})):(0,h.xE)("sso_required"===l?r.Xj:"This email is already associated with another account.")},children:"Add Email"})]})})})}var Ye=n(6822),Ie=n(8994),De=n(4893);const we={facebook:{icon:"icon-facebook-square",label:"Facebook"},google:{icon:"icon-google-plus-square",label:"Google"},linkedin:{icon:"icon-linkedin-square",label:"LinkedIn"},simpledocs:{icon:"icon-simpledocs",label:"SimpleDocs"}};let Oe=function(e){function t(...t){var n;return(n=e.call.apply(e,[this].concat(t))||this).state={processing:!1},n.confirmEmail=async()=>{n.setState({processing:!0}),await(0,re.gE)(void 0,"Confirmation email has been sent to your email address."),n.setState({processing:!1})},n.removeAuthId=async({id:e,type:t})=>{n.setState({processing:!0});const i=await fetch(`/api/auth/${t}/${e}`,{credentials:"same-origin",method:"DELETE"});if(!i.ok)return(0,h.xE)(`Couldn't remove item: ${i.statusText}`),void n.setState({processing:!1});const{auth_ids:a,success:r}=await i.json();r?((0,s.TK)({authMethods:a}),(0,h.xE)("Removed sign-in method")):(0,h.xE)("Couldn't remove sign-in method"),n.setState({processing:!1})},n.setPrimaryEmail=async e=>{n.setState({processing:!0});const t=await fetch("/api/email/primary",{body:JSON.stringify({email:e}),credentials:"same-origin",method:"PUT"});if(n.setState({processing:!1}),!t.ok)return void(0,h.xE)(`Couldn't set primary email: ${t.statusText}`);const{auth_ids:i,error:a,reload:o,success:l}=await t.json();if(l){if(o){const{location:e}=window;return void e.reload()}(0,s.TK)({authMethods:i,confirmed:!1,email:e})}else(0,h.xE)("sso_required"===a?r.Xj:`Couldn't set primary email: ${t.statusText}`)},n}return Te()(t,e),t.prototype.render=function(){const{onClose:e,open:t,preparedMethods:n}=this.props,{processing:i}=this.state,a=(0,s.wz)(),{email:r}=a,{email:o,social:c}=n.reduce((e,t)=>
2(e["email"===t.type?"email":"social"].push(t),e),{email:[],social:[]});return(0,l.FD)(b.A,{open:t,size:"md",onClose:e,children:[(0,l.Y)(v.A,{children:"Manage Sign-in Methods"}),(0,l.Y)("p",{className:"view__subtitle-sm",children:"You can add multiple email addresses to use for signing in."}),(0,l.Y)(_e,{}),(0,l.FD)(Ye.A,{className:"margin-b-10",children:[o.map(e=>{const{confirmed:t,id:n}=e,a=r===n;return(0,l.FD)(Ie.A,{"data-email":n,children:[(0,l.Y)("span",{className:"s44_fUubZd",children:n}),(0,l.FD)(De.A,{children:[a?(0,l.FD)("span",{className:"mdc-button btn-static color-black",children:[(0,l.Y)("i",{className:"mdc-button__icon icon icon--xs icon-check-black"}),"Primary"]}):(0,l.Y)(_.A,{disabled:i,onClick:()=>this.setPrimaryEmail(n),children:"Make Primary"}),!t&&a?(0,l.Y)(_.A,{disabled:i,onClick:()=>this.confirmEmail(n),children:"Confirm Email"}):null,a?null:(0,l.Y)(_.A,{disabled:i||a,onClick:()=>this.removeAuthId(e),children:"Remove"})]})]},n)}),c.map(e=>{const{id:t,type:n}=e,{icon:a,label:r=n}=we[n]||{};return(0,l.FD)(Ie.A,{"data-type":n,children:[(0,l.FD)("span",{className:"Jj5eFSwqho",children:[a&&(0,l.Y)("i",{className:Se()("icon icon--left",a)}),r]}),(0,l.Y)(De.A,{children:(0,l.Y)(_.A,{disabled:i,onClick:()=>this.removeAuthId(e),children:"Remove"})})]},[t,n].join("-"))})]}),(0,l.Y)(H.A,{children:(0,l.Y)(F.A,{outlined:!0,onClick:e,children:"Done"})})]})},Ce()(t)}(d.Component);function Re({preparedMethods:e}){const{closeDialogFromUrl:t,openDialogFromUrl:n,openFromUrl:i}=(0,O.A)(r.uB.auth);return(0,l.FD)(l.FK,{children:[(0,l.Y)(C.zh,{onClick:n,children:"Manage"}),(0,l.Y)(Oe,{open:i,preparedMethods:e,onClose:t})]})}var xe=n(5711);function Pe(e,t){const[n,...i]=e.split(":"),a={id:i.join(":"),type:n};return"email"===n&&(a.confirmed=t),a}function Fe(){window.location.href="/signout"}function ke({id:e,type:t}){return(0,l.Y)(N.A,{label:`${t} ${e}`})}const Le={email:function({confirmed:e,id:t}){const{email:n}=(0,s.wz)(),i=n===t;return(0,l.Y)(N.A,{icon:"icon-envelope-o",label:`${t} ${i&&!e?" (unconfirmed)":""}`,onClick:()=>(new ve.Clipboard).copy(n)})},facebook:function({id:e}){return(0,l.Y)(N.A,{icon:"icon-facebook-square",label:"Facebook",title:e})},google:function({id:e}){return(0,l.Y)(N.A,{icon:"icon-google-plus-square",label:"Google",title:e})},linkedin:function({id:e}){return(0,l.Y)(N.A,{icon:"icon-linkedin-square",label:"LinkedIn",title:e})},simpledocs:function(){return(0,l.Y)(N.A,{icon:"icon-simpledocs",label:"SimpleDocs"})}};function Me({preparedMethods:e}){return(0,l.Y)("div",{className:"email-container",children:(0,l.Y)(S.A,{children:e.map(e=>{const{id:t,type:n}=e;let{[n]:i}=Le;return i||(i=ke),(0,l.Y)(i,{...e},[t,n].join("-"))})})})}function Ue(){const[e]=(0,a.fp)(s.p9),{authMethods:t,confirmed:n}=e,i=t?.map(e=>Pe(e,n))||[];return(0,l.FD)(C.Ay,{children:[(0,l.Y)("h2",{className:"mdc-card__title",children:"Sign-in Methods"}),(0,l.Y)(Me,{preparedMethods:i}),(0,l.FD)(C.w,{children:[(0,l.Y)(Re,{preparedMethods:i}),(0,l.Y)(xe.A,{}),(0,l.Y)(C.zh,{onClick:Fe,children:"Sign Out"})]})]})}var Be="KkyJ9MnLc8";function Ke({children:e,description:t,isSubscribed:n,onChange:i,type:a}){const r=(0,d.useId)();return(0,l.FD)("div",{children:[(0,l.Y)(ue.A,{"aria-describedby":t?r:void 0,checked:!0===n,disabled:null===n,onChange:(0,d.useCallback)(({target:{checked:e}})=>{i(a,e)},[i,a]),children:e}),t&&(0,l.Y)("div",{className:Be,id:r,children:t})]})}function He({showAll:e=!1}){const t=(0,d.useId)(),[n,i]=(0,h.aI)({beta_features:null,lists:null,onboarding:null,product_updates:null,promo:null,usage_reset:null});(0,d.useEffect)(()=>{(async()=>{const e=await fetch("/api/user/subscriptions",{credentials:"same-origin",method:"GET"}),t=await e.json();i(t)})()},[i]);const a=(0,d.useCallback)(async(e,t)=>{const n=await fetch("/api/user/subscriptions",{body:JSON.stringify({state:t,type:e}),credentials:"same-origin",method:"PATCH"});await n.json(),(0,Y.s)("update_newsletter_settings",{type:e,value:t}),i({[e]:t}),(0,h.xE)("Preferences saved")},[i]),r=[["lists","Receive weekly emails with your lists update summary"]];return e&&(r.unshift(["onboarding","Receive onboarding emails"]),r.push(["promo","Offers & promotions","Discounts, special offers and limited-time promotions from Law Insider."],["usage_reset","Usage reset reminders","Reminders when your usage allowance resets."],["product_updates","Product updates","News about new features and improvements to Law Insider."],["beta_features","Access to beta features","I'd like to try new features before they're widely available. Access is subject to availability."])),(0,l.FD)("div",{className:e?"Ixw3uMh1VE":void 0,children:[r.map(([e,t,i])=>(0,l.Y)(Ke,{description:i,isSubscribed:n[e],type:e,onChange:a,children:t},e)),e&&(0,l.FD)("div",{className:"KwdvLkfokm",children:[(0,l.Y)(ue.A,{checked:!0,disabled:!0,"aria-describedby":t,children:"Service updates"}),(0,l.FD)("div",{className:Be,id:t,children:["Essential account, security, billing and access notices.",(0,l.Y)("br",{}
2),"These are required while your Law Insider account is open."]})]})]})}function je(){const[e]=(0,a.fp)(s.EQ);return e?(0,l.FD)("div",{className:"account",children:[(0,l.Y)(Ue,{}),(0,l.Y)(c,{}),(0,l.Y)(ie,{}),(0,l.Y)(be,{}),(0,l.FD)(C.Ay,{children:[(0,l.Y)("h2",{className:"mdc-card__title",children:"Email Preferences"}),(0,l.Y)("div",{className:"mdc-card__content",children:(0,l.Y)(He,{showAll:!0})})]})]}):null}je.selector=r.yD.ACCOUNT;var ze=n(2970);const We={AI_ASSISTANT_AUTO_ENABLE_TOOLS:"Automatically enable AI Assistant tools",ENABLE_QUICK_PREVIEW:"Show tooltips with definition preview",SEC_ONLY_FILTER_ENABLED:'Enable "SEC.gov only" filter on the search results page',SHOW_SCROLL_TO_TOP:'Show "back to top" button',SHOW_SEARCH_CURL_BUTTON:"Show API option on search results page (quick access to cURL code for search query)"},Ge=["AI_ASSISTANT_AUTO_ENABLE_TOOLS","ENABLE_QUICK_PREVIEW","SEC_ONLY_FILTER_ENABLED","SHOW_SEARCH_CURL_BUTTON"];function $e({flag:e}){const t=(0,B._)(B.A[e]);return(0,l.Y)(ze.A,{checked:t,className:"row-flex margin-b-1",onChange:async()=>{await B.A[e].set(!t,!0),(0,Y.s)("flag_change",{name:e,value:!t}),(0,h.xE)("Setting saved.")},children:We[e]},e)}function Ve(){const[e]=(0,a.fp)(s.N6),t=e?Ge:["SHOW_SCROLL_TO_TOP"].concat(Ge);return(0,l.Y)("div",{className:"account",children:(0,l.FD)(C.Ay,{children:[(0,l.Y)("h2",{className:"mdc-card__title",children:"Interface Settings"}),(0,l.Y)("div",{className:"mdc-card__content",children:t.map(e=>(0,l.Y)($e,{flag:e},e))})]})})}Ve.selector=r.yD.USER_SETTINGS;var qe=n(1917);const Je=()=>{window.location.href=r.A.ACCOUNT};function Xe({url:e}){const[t,n]=(0,d.useState)(!1);return(0,l.Y)(b.A,{open:!0,size:"sm",onClose:Je,children:(0,l.FD)(K.A,{children:[(0,l.FD)(v.A,{children:["Join ",(0,qe.Eo)()," Contract Library"]}),(0,l.FD)(ue.A,{checked:!!t,className:"mdc-form-field--alignment-leading",onChange:()=>n(!t),children:["I have read and agree to the"," ",(0,l.Y)("a",{href:"/additional-terms-of-service",target:"_blank",children:"Additional Terms of Service"}),"."]}),(0,l.Y)("form",{action:e,method:"POST",children:(0,l.Y)(_.A,{raised:!0,disabled:!t,size:"lg",type:"submit",onClick:()=>{Je()},children:"Join"})})]})})}Xe.selector=r.yD.USER_JOIN_REPOSITORY;var Qe=n(6058),Ze=n(7424),et=n(3339),tt=n(7547);const nt=(0,d.lazy)(()=>n.e(4383).then(n.bind(n,4210)));function it({repositories:e}){const[t,n]=(0,d.useState)(!1);return B.A.SHOW_PUBLIC_REPOSITORIES.get()?(0,l.FD)(l.FK,{children:[(0,l.FD)(_.A,{outlined:!0,onClick:()=>n(!0),children:[(0,l.Y)("i",{className:"icon icon-folder-black icon--left"}),"Public Libraries"]}),t&&(0,l.Y)(tt.A,{children:(0,l.Y)(nt,{open:t,userRepositories:e,onClose:()=>n(!1)})})]}):null}var at=n(2946);const rt=(0,d.lazy)(()=>n.e(4383).then(n.bind(n,8337))),ot="create";function st({onClose:e,open:t,repositories:n}){const[i,a]=(0,d.useState)(ot),[o,s]=(0,d.useState)(!1),[c]=(0,at.XX)(at.n7,()=>s(!0));return(0,l.FD)(l.FK,{children:[(0,l.FD)(b.A,{open:t,size:"md",onClose:e,children:[(0,l.Y)(v.A,{children:"Upload Contracts"}),(0,l.Y)("h6",{className:"text-left",children:"Select Library:"}),(0,l.Y)("div",{className:"select-dropdown select-dropdown-right margin-b-1",children:(0,l.FD)("select",{className:"outlined-select styled-select-arrow",value:i,onChange:({target:{value:e}})=>a(e),children:[(0,l.Y)("option",{value:"create",children:"Create new library"}),n.map(({id:e,name:t,role:n})=>"write"===n&&(0,l.Y)("option",{value:e,children:t},e))]})}),(0,l.Y)(_.A,{raised:!0,onClick:()=>{i===ot?(c(),e()):window.location.href=`/${i}?${r.uB.uploadDialog}`},children:"Continue"})]}),o&&i===ot&&(0,l.Y)(rt,{open:o,onClose:()=>s(!1)})]})}function lt({repositories:e}){const{closeDialogFromUrl:t,openDialogFromUrl:n,openFromUrl:i}=(0,O.A)(r.uB.uploadContracts);return(0,l.FD)(l.FK,{children:[(0,l.FD)(_.A,{outlined:!0,onClick:n,children:[(0,l.Y)("i",{className:"mdc-button__icon icon icon-upload-blue"}),"Upload Contracts"]}),(0,l.Y)(st,{open:i,repositories:e,onClose:t})]})}var ct="xdpgJDUf30";const dt=(0,d.lazy)(()=>n.e(1854).then(n.bind(n,8153))),ut=[{title:"Libraries"},{className:"hidden-xs",title:"Contracts"},{className:"hidden-xs",title:"Documents"},{className:"hidden-xs",title:"Created"},{title:"Permissions"},{title:"Actions"}];function ht({id:e,label:t,userRole:n}){const[i,a]=(0,d.useState)(!1);return(0,l.FD)(j.A,{children:[(0,l.Y)(_.A,{"aria-label":t,onClick:()=>a(!i),children:(0,l.Y)("i",{className:Se()("icon","AC2ph4Katg",i?"E31GkGQdm9":"hFs39djTdf")})}),(0,l.Y)(Qe.A,{MenuComponent:dt,hide:()=>a(!1),id:e,open:i,userRole:n})]})}function mt({repositories:e}){return(0,l.FD)(l.FK,{children:[(0,l.FD)("div",{className:"stack flex-align-center margin-b-1",children:[(0,l.FD)("div",{className:"stack__item stack__item--fill row-buttons",children:[(0,l.Y)(et.A,{raised:!0}),(0,l.Y)(lt,{repositories:e}),(0,l.Y)(it,{repositories:e})]}),(0,l.FD)("a",{className:"stack__item",href:r.A.PRIVATE_HOMEPAGE,...r.Js,children:["About Contract Libraries ",(0,l.Y)("i",{className:"icon icon-launch icon--xs"})]})]}),(0,l.Y)("hr",{}),e.length>0?(0,l.FD)("table",{className:"tOj5ZzKMKs",children:[(0,l.Y)("thead",{children:(0,l.Y)("tr",{className:ct,children:ut.map(({className:e,title:t})=>(0,l.Y)("th",{className:e,children:t},t))})}),(0,l.Y)("tbody",{children:e.toReversed().map(({count:{contractsTagged:e,notContracts:t},created:n,id:i,name:a,role:r})=>(0,l.FD)("tr",{className:ct,children:[(0,l.Y)("td",{children:(0,l.FD)("b",{children:[(0,l.Y)(Ze.wh,{className:"icon--sm",namespace:i}),(0,l.Y)("a",{href:`/${i}`,children:a})]})}),(0,l.Y)("td",{className:"hidden-xs",children:e}),(0,l.Y)("td",{className:"hidden-xs",children:t}),(0,l.Y)("td",{className:"hidden-xs",children:(0,p.Ey)(n)}),(0,l.Y)("td",{className:"no-wrap",children:(0,l.Y)(N.A,{label:Ze.gg[r]})}),(0,l.Y)("td",{children:(0,l.Y)(ht,{id:i,label:"Actions",userRole:r})})]},i))})]}):(0,l.Y)("div",{className:"gvY3yTQQUw",children:(0,l.Y)("h3",{className:"HzsO3xoFwd",children:"You do not have any libraries yet."})})]})}mt.selector=r.yD.USER_REPOSITORIES;var pt=n(8030),ft=n(2492);const gt=(0,d.lazy)(()=>n.e(49).then(n.bind(n,7637)));function bt({repositoryName:e}){const{closeDialogFromUrl:t,openDialogFromUrl:n,openFromUrl:i}=(0,O.A)(r.uB.uploadDialog,{feature:at.WQ}),[a]=(0,at.XX)(at.WQ,n);return(0,l.FD)(l.FK,{children:[(0,l.FD)(_.A,{outlined:!0,onClick:a,children:[(0,l.Y)("i",{className:"mdc-button__icon icon icon-upload-blue"}),"Upload Contracts"]}),i&&(0,l.Y)(tt.A,{children:(0,l.Y)(gt,{repositoryName:e,onClose:t})})]})}const vt=(0,d.lazy)(()=>n.e(7124).then(n.bind(n,1505)));function At({isRepoEmpty:e}){const[t,n]=(0,d.useState)(!1);return e||!B.A.SHOW_LIBRARY_EXPORT.get()?null:(0,l.FD)(l.FK,{children:[(0,l.Y)(_.A,{onClick:()=>{n(!0)},children:"Export to CSV"}),(0,l.Y)(tt.A,{children:(0,l.Y)(vt,{open:t,onClose:()=>n(!1)})})]})}var Ct=n(7003),Et=n(2818);const Tt=(0,d.lazy)(()=>n.e(4383).then(n.bind(n,1943)));function yt({created:e}){const{closeDialogFromUrl:t,openDialogFromUrl:n,openFromUrl:i}=(0,O.A)(r.uB.repositoryInfo);return(0,l.FD)(l.FK,{children:[(0,l.Y)(_.A,{onClick:n,children:"Library Info"}),i&&(0,l.Y)(tt.A,{children:(0,l.Y)(Tt,{created:e,open:i,onClose:t})})]})}var St=n(2386);function Nt({jobsList:e,publishUploadsPaused:t}){return e?.length&&B.A.SHOW_UPLOAD_STATUS.get()?(0,l.FD)(l.FK,{children:[t&&(0,l.Y)("div",{className:"color-red margin-b-1",style:{border:"1px solid",borderRadius:"4px",padding:"15px"},children:"Your files have been uploaded successfully. However, the document processing system is currently undergoing maintenance. You will receive an email notification once your documents have been analyzed."}),e.map(({created:e,email:t,filesCount:n})=>{const i=new Date(e),{documentText:a,verbText:r}=n>1?{documentText:"documents",verbText:"were"}:{documentText:"document",verbText:"was"};return(0,l.FD)("div",{className:"row-flex row-flex--nowrap flex-align-center bordered-column bordered-column--blue margin-b-1 padding-1",children:[(0,l.Y)("div",{style:{marginRight:"1em"},children:(0,l.Y)(he.A,{})}),(0,l.FD)("span",{children:["We are currently processing ",n," ",a," that"," ",r," uploaded"," ",(0,l.Y)(St.A,{date:i,formatter:(e,t,n,i,a)=>"second"===t?"just now":a(e,t,n,i),minPeriod:60,title:(0,p.Ey)(i,{hour:"2-digit",hour12:!1,minute:"2-digit"})})," ","by ",t,". You will receive an email notification once the process is complete."]})]},e)})]}):null}var _t=n(9170);function Yt({onClose:e,open:t}){const[n,i]=(0,d.useState)(!1),[a,o]=(0,d.useState)(!1);return(0,l.FD)(b.A,{open:t,size:"md",onClose:e,children:[(0,l.FD)(v.A,{children:["Delete ",(0,qe.Eo)()," Contract Library"]}),(0,l.FD)("p",{children:['Are you sure you want to delete library "',B.A.NAMESPACE_LABEL.get(),'"'," ",(0,l.FD)("span",{className:"text-nowrap",children:["(ID: ",B.A.NAMESPACE.get(),")"]}),"?"]}),(0,l.FD)("p",{children:[(0,l.Y)("b",{className:"color-red",children:"Warning:"}
2)," this action will permanently delete all contents of this library, including contract data, user access and private URL."]}),(0,l.Y)("p",{children:(0,l.Y)("strong",{className:"color-red",children:"This action cannot be undone."})}),(0,l.Y)("div",{children:(0,l.Y)(ue.A,{checked:a,onChange:()=>o(e=>!e),children:"I understand and want to continue."})}),(0,l.Y)(_.A,{outlined:!0,disabled:n||!a,onClick:async()=>{i(!0),(await fetch(`/api/libraries/${B.A.NAMESPACE.get()}`,{credentials:"same-origin",method:"DELETE"})).ok?(0,h.l4)(`Your library "${B.A.NAMESPACE_LABEL.get()}" has been deleted.`,r.A.REPOSITORIES):(0,h.xE)("Something went wrong!"),i(!1)},children:"Continue"})]})}function It(){const[e,t]=(0,d.useState)(!1);return B.A.ENABLE_REPOSITORIES_DELETION.get()?(0,l.FD)(l.FK,{children:[(0,l.Y)(_.A,{style:{color:_t.gz},onClick:()=>t(!0),children:"Delete all data"}),e&&(0,l.Y)(Yt,{open:e,onClose:()=>t(!1)})]}):null}function Dt({onClose:e,open:t}){const n=B.A.NAMESPACE_LABEL.get(),[i,a]=(0,d.useState)(!1),[r,o]=(0,d.useState)(n);return(0,l.FD)(b.A,{open:t,size:"md",onClose:e,children:[(0,l.Y)(v.A,{children:"Settings"}),(0,l.FD)("form",{children:[(0,l.Y)("div",{children:(0,l.Y)(Ne.A,{className:"full-width",label:"Library name",value:r,onChange:e=>o(e.target.value)})}),(0,l.Y)(_.A,{raised:!0,disabled:i||!r||r===n,type:"submit",onClick:async()=>{a(!0),(await fetch(`/api/libraries/${B.A.NAMESPACE.get()}`,{body:JSON.stringify({name:r}),credentials:"same-origin",method:"PATCH"})).ok?window.location.reload():(0,h.xE)("Something went wrong!"),a(!1)},children:"Save"})]}),(0,l.Y)("div",{className:"text-right",children:(0,l.Y)(It,{})})]})}function wt(){const[e,t]=(0,d.useState)(!1);return(0,l.FD)(l.FK,{children:[(0,l.Y)(_.A,{onClick:()=>t(!0),children:"Settings"}),e&&(0,l.Y)(Dt,{open:e,onClose:()=>t(!1)})]})}function Ot({created:e,isRepoEmpty:t,jobsList:n,publishUploadsPaused:i,repositoryId:a,repositoryName:r}){const o=(0,qe.GQ)(a);return(0,l.FD)(l.FK,{children:[(0,l.Y)("div",{className:"margin-b-1",children:(0,l.FD)("div",{className:"row-flex flex-align-center margin-b-2 account__buttons",children:["write"===B.A.NAMESPACE_ROLE.get()&&(0,l.FD)(l.FK,{children:[(0,l.Y)(bt,{repositoryName:r}),o?(0,l.Y)(pt.A,{}):null,(0,l.Y)(ft.A,{entityName:r}),(0,l.Y)(wt,{}),(0,l.Y)(yt,{created:e}),(0,l.Y)(At,{isRepoEmpty:t})]}),"read"===B.A.NAMESPACE_ROLE.get()&&(0,l.FD)(l.FK,{children:[(0,l.Y)(Et.A,{repositoryId:a}),o?(0,l.Y)(pt.A,{}):null,(0,l.Y)(yt,{created:e})]}),null===B.A.NAMESPACE_ROLE.get()&&(0,l.FD)(l.FK,{children:[(0,l.Y)(Ct.A,{repositoryId:a}),o?(0,l.Y)(pt.A,{}):null]})]})}),(0,l.Y)(Nt,{jobsList:n,publishUploadsPaused:i})]})}Ot.selector=r.yD.USER_REPOSITORY;var Rt=n(6794);const xt={ab:"Abkhazian",aa:"Afar",af:"Afrikaans",ak:"Akan",sq:"Albanian",am:"Amharic",ar:"Arabic",an:"Aragonese",hy:"Armenian",as:"Assamese",av:"Avaric",ae:"Avestan",ay:"Aymara",az:"Azerbaijani",bm:"Bambara",ba:"Bashkir",eu:"Basque",be:"Belarusian",bn:"Bengali",bh:"Bihari",bi:"Bislama",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan, Valencian",km:"Central Khmer",ch:"Chamorro",ce:"Chechen",ny:"Chichewa, Chewa, Nyanja",zh:"Chinese",cu:"Church Slavonic, Old Bulgarian, Old Church Slavonic",cv:"Chuvash",kw:"Cornish",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",dv:"Divehi, Dhivehi, Maldivian",nl:"Dutch, Flemish",dz:"Dzongkha",en:"English",eo:"Esperanto",et:"Estonian",ee:"Ewe",fo:"Faroese",fj:"Fijian",fi:"Finnish",fr:"French",ff:"Fulah",gd:"Gaelic, Scottish Gaelic",gl:"Galician",lg:"Ganda",ka:"Georgian",de:"German",ki:"Gikuyu, Kikuyu",el:"Greek",kl:"Greenlandic, Kalaallisut",gn:"Guarani",gu:"Gujarati",ht:"Haitian, Haitian Creole",ha:"Hausa",he:"Hebrew",hz:"Herero",hi:"Hindi",ho:"Hiri Motu",hu:"Hungarian",is:"Icelandic",io:"Ido",ig:"Igbo",id:"Indonesian",ia:"Interlingua",ie:"Interlingue",iu:"Inuktitut",ik:"Inupiaq",ga:"Irish",it:"Italian",ja:"Japanese",jv:"Javanese",kn:"Kannada",kr:"Kanuri",ks:"Kashmiri",kk:"Kazakh",rw:"Kinyarwanda",kv:"Komi",kg:"Kongo",ko:"Korean",kj:"Kwanyama, Kuanyama",ku:"Kurdish",ky:"Kyrgyz",lo:"Lao",la:"Latin",lv:"Latvian",lb:"Letzeburgesch, Luxembourgish",li:"Limburgish, Limburgan, Limburger",ln:"Lingala",lt:"Lithuanian",lu:"Luba-Katanga",mk:"Macedonian",mg:"Malagasy",ms:"Malay",ml:"Malayalam",mt:"Maltese",gv:"Manx",mi:"Maori",mr:"Marathi",mh:"Marshallese",ro:"Moldovan, Moldavian, Romanian",mn:"Mongolian",na:"Nauru",nv:"Navajo, Navaho",nd:"Northern Ndebele",ng:"Nd
2onga",ne:"Nepali",se:"Northern Sami",no:"Norwegian",nb:"Norwegian BokmÃ¥l",nn:"Norwegian Nynorsk",ii:"Nuosu, Sichuan Yi",oc:"Occitan (post 1500)",oj:"Ojibwa",or:"Oriya",om:"Oromo",os:"Ossetian, Ossetic",pi:"Pali",pa:"Panjabi, Punjabi",ps:"Pashto, Pushto",fa:"Persian",pl:"Polish",pt:"Portuguese",qu:"Quechua",rm:"Romansh",rn:"Rundi",ru:"Russian",sm:"Samoan",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sr:"Serbian",sn:"Shona",sd:"Sindhi",si:"Sinhala, Sinhalese",sk:"Slovak",sl:"Slovenian",so:"Somali",st:"Sotho, Southern",nr:"South Ndebele",es:"Spanish, Castilian",su:"Sundanese",sw:"Swahili",ss:"Swati",sv:"Swedish",tl:"Tagalog",ty:"Tahitian",tg:"Tajik",ta:"Tamil",tt:"Tatar",te:"Telugu",th:"Thai",bo:"Tibetan",ti:"Tigrinya",to:"Tonga (Tonga Islands)",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",tw:"Twi",ug:"Uighur, Uyghur",uk:"Ukrainian",ur:"Urdu",uz:"Uzbek",ve:"Venda",vi:"Vietnamese",vo:"Volapük",wa:"Walloon",cy:"Welsh",fy:"Western Frisian",wo:"Wolof",xh:"Xhosa",yi:"Yiddish",yo:"Yoruba",za:"Zhuang, Chuang",zu:"Zulu"},Pt=function({label:e,name:t,onBlur:n,onChange:i,value:a}){const[r,o]=(0,d.useState)();return(0,d.useEffect)(()=>{a&&o(a)},[a]),(0,l.FD)("div",{style:{position:"relative"},children:[(0,l.Y)(Ne.A,{readOnly:!0,icon:(0,l.Y)("i",{className:"icon icon-arrow-grey"}),label:e,name:t,title:`Edit ${e}`,value:xt[r]||""}),(0,l.FD)("select",{className:"select-dropdown__inner",value:r,onChange:async({target:{value:e}})=>{o(e),await i(e),n()},children:[(0,l.Y)("option",{value:"",children:"-- None --"}),Object.entries(xt).map(([e,t])=>(0,l.Y)("option",{value:e,children:t},e))]})]})};var Ft=n(5809);const kt=(0,d.lazy)(async()=>(await n.e(8455).then(n.bind(n,2237)),await n.e(8455).then(n.bind(n,8724)),{default:(await n.e(8455).then(n.bind(n,1011))).PhoneInput}));function Lt({disabled:e,error:t,name:n,onBlur:i,onChange:a,required:r,value:o}){const{geo:s}=(0,d.useContext)(Ft.A);let c=s.country.toLowerCase();return"zz"===c&&(c=void 0),(0,l.FD)("div",{className:"auth-field",children:[(0,l.FD)("div",{className:Se()({"input-field--invalid":t,"phone-number-field full-width":!0}),children:[(0,l.Y)(d.Suspense,{fallback:(0,l.Y)(A.A,{}),children:(0,l.Y)(kt,{defaultCountry:c,disabled:e,inputProps:{id:n,name:n},prefix:"+",value:o,onBlur:i,onChange:e=>a(e.slice(1))})}),(0,l.Y)("label",{className:Se()("input-label floating-label",{"input-label--invalid":t,"required required--red":r}),htmlFor:n,children:"Phone Number"})]}),t&&(0,l.Y)("p",{className:"invalid-feedback",children:t})]})}var Mt=n(6560);function Ut({className:e,label:t,length:n,name:i,onUpdate:a=re.bu,options:r,textarea:o,type:s,value:c}){const[u,m]=(0,d.useState)(!1),[f,g]=(0,d.useState)(""),b=(0,d.useRef)(null),v=(0,d.useCallback)(()=>m(!0),[]),A=(0,d.useCallback)((e,t=!1)=>{const{target:{value:n}}=e;g(n),t&&m(!0)},[]);(0,d.useEffect)(()=>{b.current=c,g(c)},[c]),(0,d.useEffect)(()=>{u&&((async()=>{if(f!==b.current){try{await a({[(0,p.aj)(i)]:f})}catch(e){return void(0,h.xE)(`Couldn't save changes: ${e.statusText}`)}b.current=f,(0,h.xE)("All changes saved")}})(),m(!1))},[i,u,f,a]);const C={maxLength:n||null},E={language:(0,l.Y)(Pt,{label:t,name:i,value:f,onBlur:v,onChange:e=>g(e)}),phone:(0,l.Y)(Lt,{name:i,value:f,onBlur:v,onChange:e=>g(e)})},T={radio:(0,l.Y)(Mt.A,{label:t,options:r||[],value:f,onChange:e=>A(e,!0)})};return(0,l.Y)("div",{className:Se()({[e]:e,"user-field":!0,"user-field--phone margin-b-2":"phone"===i,"user-field--radio":"radio"===s,"user-field--textarea":o}),children:E[i]||T[s]||(0,l.Y)(Ne.A,{className:"full-width fullwidth-with-label",label:t,name:i,textarea:o,title:`Edit ${t}`,type:s,value:f||"",onBlur:v,onChange:A,...C})})}const Bt={bio:{className:"flex-basis-full",label:"Bio",length:350,textarea:!0},expertise:{label:"Expertise",length:60},jobTitle:{label:"Title (e.g. Partner)",length:60},location:{label:"Location",length:60},website:{label:"More Info Link (e.g. https://www.site.com)"}};function Kt({user:e}){return(0,l.FD)(l.FK,{children:[(0,l.Y)("h3",{className:"title-sm",children:"Public Profile"}),(0,l.Y)("form",{className:"user-info",children:["bio","jobTitle","location","expertise","website"].map(e=>({...Bt[e],fieldName:e})).map(({fieldName:t,...n})=>(0,l.Y)(Ut,{name:t,type:"text",value:e[t]||"",onUpdate:e=>(0,h.RD)("/api/user/contributor",{data:e,method:"PATCH"}),...n},t))})]})}function Ht(){return(0,l.FD)("div",{className:"contributor-status",children:[(0,l.Y)("i",{className:"icon icon-star-yellow"}),"Verified"]})}function jt({contributor:e}){return(0,l.FD)(l.FK,{children:[(0,l.FD)("div",{className:"row-flex row-flex--nowrap flex-align-center margin-b-40",children:[(0,l.Y)(Ht,{}),(0,l.Y)("span",{children:"Your account is verified."})]}),(0,l.Y)(Kt,{user:e})]})}function zt({contributor:e}){const{isContributor:t,isTosAccepted:n,isVerified:i}=e,[a,o]=(0,d.useState)(!1),[s,c]=(0,d.useState)(n);return t?(0,l.FD)("div",{children:[(0,l.Y)("hr",{}),(0,l.Y)("h2",{className:"mdc-card__title",children:"Contributor"}),(0,l.Y)("div",{className:"mdc-card__content",children:i?(0,l.Y)(jt,{contributor:e}):(0,l.Y)("div",{children:s?(0,l.FD)(l.FK,{children:[(0,l.FD)("p",{className:"margin-b-40",children:[(0,l.Y)("b",{children:"Almost there!"})," Your profile is awaiting review and approval by community manager, you will be notified once you profile is approved. Meanwhile you can update your public profile information below."]}),(0,l.Y)(Kt,{user:e})]}):(0,l.FD)(l.FK,{children:[(0,l.Y)("div",{className:"margin-b-20",children:(0,l.Y)("p",{children:"Your account was marked as âContributorâ to Law Insider Resources."})}),(0,l.Y)("p",{children:(0,l.FD)("b",{children:["To continue, please review and agree to"," ",(0,l.Y)("a",{href:r.A.TERMS_OF_SERVICE,...r.Js,children:"Law Insider Terms of Service"})," ","and"," ",(0,l.Y)("a",{href:"/code-of-conduct",...r.Js,children:"Code of Conduct"})]})}),(0,l.Y)(ue.A,{checked:a,className:"checkbox-no-left-padding",onCh
2ange:()=>o(e=>!e),children:"I certify that I have read and agree to Law Insider Terms of Service and Code of Conduct"}),(0,l.Y)("br",{}),(0,l.Y)(_.A,{outlined:!0,disabled:!a,onClick:async()=>{const e=await fetch("/api/user/contributor",{body:JSON.stringify({is_tos_accepted:a}),credentials:"same-origin",method:"PATCH"});await e.json(),c(a),(0,h.xE)("You successfully accepted Law Insider Terms of Service for Contributors")},children:"Update"})]})})})]}):null}const Wt=["firstName","lastName","twitter","linkedin","company","companyRole","website","linkedinCompany","phone","language","location"];function Gt({profileFields:e}){return(0,l.Y)("div",{className:"profile__information",children:(0,l.Y)("form",{className:"user-info",children:Wt.map(t=>{const{label:n,type:i,...a}=r.ce[t];return(0,l.Y)(Ut,{label:n,name:t,type:i,value:e[t]||"",...a},t)})})})}function $t({user:e}){return e.pictureUrl?(0,l.Y)("img",{alt:e.name||"user",className:"img-circle",src:e.pictureUrl}):(0,l.Y)("span",{className:"profile-img",children:(0,l.Y)("i",{className:"icon icon-user"})})}const Vt=[["clauses","Clauses"],["contractTeardown","Contract Teardown"],["contracts","Contracts"],["draftingAndNegotiating","Drafting & Negotiating"],["featuredArticles","Featured Articles"],["legalDefinitionsDictionary","Legal Definitions Dictionary"],["webinars","Webinars"]];function qt({user:e}){const t=(0,d.createRef)();return(0,l.FD)("div",{className:"profile__picture row-flex flex-align-center flex-space-between",children:[(0,l.Y)(Qt,{user:e}),(0,l.FD)("div",{className:"profile__picture__container",children:[e.pictureUrl?(0,l.Y)("div",{className:"profile__picture__label",children:(0,l.Y)(_.A,{className:"btn-link",onClick:async()=>{await fetch("/profile/picture",{credentials:"same-origin",method:"DELETE"}),(0,s.TK)({pictureUrl:null})},children:"Remove profile picture"})}):(0,l.Y)("label",{className:"profile__picture__label",htmlFor:"picture",children:"Add profile picture"}),(0,l.Y)($t,{user:e})]}),(0,l.Y)("form",{ref:t,action:"/profile/picture",encType:"multipart/form-data",id:"form-picture",method:"POST",style:{display:"none"},children:(0,l.Y)("input",{id:"picture",name:"picture",type:"file",onChange:()=>{t.current.submit()}})})]})}function Jt({label:e,name:t,value:n}){const[i,a]=(0,d.useState)(n);return(0,l.Y)(ue.A,{checked:i,className:"checkbox-no-left-padding",onChange:async()=>{try{await(0,re.bu)({interests:{[(0,p.aj)(t)]:!i}}),a(e=>!e)}catch(e){(0,h.xE)(`Couldn't save changes: ${e.statusText}`)}},children:e},t)}function Xt({interests:e}){return(0,l.FD)(l.FK,{children:[(0,l.Y)("h2",{children:"Interests"}),Vt.map(([t,n])=>(0,l.Y)(Jt,{label:n,name:t,value:e?.[t]||!1},t))]})}function Qt({user:e}){const{authMethods:t,confirmed:n}=e,[i,a]=(0,d.useState)(t),[r,o]=(0,d.useState)(!1),s=i?.map(e=>Pe(e,n));return(0,l.FD)(l.FK,{children:[(0,l.Y)(S.A,{children:(0,l.Y)(N.A,{icon:"icon-envelope-o",label:e.email,onClick:()=>o(!0)})}),(0,l.Y)(Oe,{open:r,preparedMethods:s,updateMethods:({methods:e})=>a(e),onClose:()=>o(!1)})]})}function Zt({user:e}){const[t,n]=(0,d.useState)(null);return(0,d.useEffect)(()=>{!async function(){const t=await fetch("/api/user/info",{credentials:"same-origin",method:"GET"});n({...e,...(0,Rt.b)(await t.json())})}()},[e]),t?(0,l.FD)(l.FK,{children:[(0,l.Y)(Gt,{profileFields:t}),(0,l.Y)(Xt,{interests:t.interests})]}):(0,l.Y)(A.A,{})}function en({contributor:e}){const[t]=(0,a.fp)(s.p9);return(0,l.FD)(C.Ay,{className:"profile",children:[(0,l.FD)("div",{className:"mdc-card__content",children:[(0,l.Y)(qt,{user:t}),(0,l.Y)(Zt,{user:t})]}),(0,l.Y)(zt,{contributor:e})]})}function tn({contributor:e}){const[t]=(0,a.fp)(s.EQ);return t?(0,l.Y)("div",{className:"account",children:(0,l.Y)(en,{contributor:e})}):null}tn.selector=r.yD.PROFILE;var nn="s_yKr_M3Sc";const an=[{className:"hidden-xs",title:"User Agent"},{className:"hidden-xs",title:"Location"},{title:"Sign-in Date/Time"},{title:""}],rn="-";function on({location:e}){if(!e)return null;const{city:t,country:n,region:i}=e;return(0,l.FD)("span",{style:{display:"block"},children:["City: ",t?(0,p.Zr)(t):rn," | Region:"," ",null!=i?i:rn," | Country: ",null!=n?n:rn]})}function sn({userInfo:e}){const{activeSessions:t}=e,[n,i]=(0,d.useState)(t);return(0,l.FD)("table",{className:"b0EAsoxmNV",children:[(0,l.Y)("thead",{children:(0,l.Y)("tr",{className:nn,children:an.map(({className:e,title:t})=>(0,l.Y)("th",{className:e,children:t},t))})}),(0,l.Y)("tbody",{children:n.length>0?n.map(({location:e,token:t,updated:n,userAgent:a})=>(0,l.FD)("tr",{className:nn,children:[(0,l.Y)("td",{className:"hidden-xs",children:a||rn}),(0,l.Y)("td",{className:"hidden-xs",children:(0,l.Y)(on,{location:e})||rn}),(0,l.Y)("td",{children:(0,p.Ey)(new Date(n),{hour:"2-digit",hour12:!0,minute:"2-digit",timeZoneName:"short"})}),(0,l.Y)("td",{children:(0,l.Y)(_.A,{className:"btn-link",onClick:()=>(async e=>{const{id:t}=(0,s.wz)(),n=await fetch(`/user/${t}/sessions/${e}`,{credentials:"same-origin",method:"DELETE"}),{is_current_session:a,message:o,success:l}=await n.json();l?(i(t=>t.filter(t=>t.token!==e)),a&&(window.location.href=r.A.HOME)):(0,h.xE)(`Couldn't remove user session: ${o}`)})(t),children:"Sign Out"})})]},t)):null})]})}sn.selector=r.yD.USER_SESSIONS;var ln=n(9100),cn=n(5413);let dn=function(e){function t(...t){var n;return(n=e.call.apply(e,[this].concat(t))||this).lastSaved=null,n.state={html:"",text:""},n.handleChange=e=>{e.innerText.trim()?n.setState({html:e.target.value,text:e.innerText}):n.setState({html:"",text:""})},n.handleBlur=async()=>{const{text:e}=n.state,{id:t}=n.props;if(e===n.lastSaved)return;const i=await(0,cn.l)(t,{action:"update",description:e});i.ok?(n.lastSaved=e,(0,Y.s)("list_update_description"),(0,h.xE)("All changes saved")):(0,h.xE)(`Couldn't save changes: ${i.statusText}`)},n}Te()(t,e);var n=t.prototype;return n.componentDidMount=function(){const{text:e}=this.props;this.lastSaved=e,this.setState({html:e,text:e})},n.render=function(){const{canEdit:e,text:t}=this.props,{html:n}=this.state;return(0,l.Y)("div",{className:"user-list-description",children:(0,l.Y)(ln.A,{className:"contenteditable__field outlined-field",disabled:!e,html:n||t,placeholder:"Add description...",title:"Edit",onBlur:this.handleBlur,onChange:this.handleChange})})},Ce()(t)}(d.Component),un=function(e){function t(...t){var n;return(n=e.call.apply(e,[this].concat(t))||this).state={html:"",removed:!1,text:"",updated:null},n.lastSaved=null,n.handleChange=e=>{e.innerText.trim()?n.setState({html:e.target.value,text:e.innerText}):n.setState({html:"",text:""})},n.handleBlur=async()=>{const{text:e}=n.state,{id:t,listId:i,title:a}=n.props;if(e===n.lastSaved)return;const r=await(0,cn.l)(i,{action:cn.XL,id:t,snippet:{body:e,title:a}});if(!r.ok)return void(0,h.xE)(`Couldn't save changes: ${r.statusText}`);const o=(0,s.wz)();n.setState({updated:{at:Date.now()/1e3,id:o.id,name:o.name}}),n.lastSaved=e,(0,Y.s)("list_update_snippet"),(0,h.xE)("All changes saved")},n.remove=async()=>{const{id:e,listId:t}=n.props,i=await(0,cn.l)(t,{action:cn.E9,id:e});i.ok?(n.setState({removed:!0}),(0,Y.s)("list_remove_snippet"),(0,h.xE)("All changes saved")):(0,h.xE)(`Couldn't remove item: ${i.statusText}`)},n}Te()(t,e),t.userURI=function(e){return`/users/${e.id}/${(0,p.Yv)(e.name)}`};var n=t.prototype;return n.componentDidMount=function(){const{body:e,updated:t}=this.props;this.lastSaved=e,this.setState({html:e,text:e,updated:t})},n.render=function(){const{html:e,removed:n,updated:i}=this.state,{body:a,canEdit:r,created:o,title:s,type:c,uri:d}=this.props;if(n)return null;const u=i||o,h=(0,l.FD)("span",{className:"last-edit",children:[u===i?"last edit made by":"added by","Â ",(0,l.Y)("a",{href:t.userURI(u),children:u.name}),"Â ",(0,l.Y)(St.A,{date:1e3*u.at,formatter:(e,t,n,i,a)=>"second"===t?"just now":a(e,t,n,i),minPeriod:60})]}),m="clause"===c;return(0,l.Y)(C.Ay,{className:"user-list-item",children:(0,l.FD)("div",{className:"mdc-card__section",children:[r&&(0,l.FD)("div",{className:"row-flex flex-between user-list-item__inner",children:[h,(0,l.FD)("div",{className:"flex-between-xs user-list-item__buttons",children:[(0,l.Y)(_.A,{"aria-label":"Edit",title:"Edit",onClick:()=>
2this.editable.htmlEl.focus(),children:(0,l.Y)("i",{className:"icon icon--sm icon-edit-grey"})}),(0,l.Y)(_.A,{"aria-label":"Remove",title:"Remove",onClick:this.remove,children:(0,l.Y)("i",{className:"icon icon--sm icon-close-grey"})})]})]}),(0,l.FD)("div",{className:"row-flex row-flex--nowrap user-list-item__source",children:[(0,l.Y)("i",{className:Se()("icon",m?"icon-th-list-black":"icon-file-text-black")})," ",(0,l.Y)("a",{className:"item-title",href:d,children:s})]}),(0,l.Y)(ln.A,{ref:e=>this.editable=e,className:"contenteditable__field",disabled:!r,html:e||a,placeholder:"Add snippet...",title:"Edit",onBlur:this.handleBlur,onChange:this.handleChange})]})})},Ce()(t)}(d.Component),hn=function(e){function t(...t){var n;return(n=e.call.apply(e,[this].concat(t))||this).state={html:"",text:""},n.lastSaved=null,n.handleChange=e=>{e.innerText.trim()?n.setState({html:e.target.value,text:e.innerText}):n.setState({html:"",text:""})},n.handleBlur=async()=>{const{text:e}=n.state,{id:t}=n.props;if(e===n.lastSaved)return;const i=await(0,cn.l)(t,{action:"update",name:e});i.ok?(n.lastSaved=e,(0,Y.s)("list_update_name"),(0,h.xE)("All changes saved")):(0,h.xE)(`Couldn't save changes: ${i.statusText}`)},n}Te()(t,e);var n=t.prototype;return n.componentDidMount=function(){const{text:e}=this.props;this.lastSaved=e,this.setState({html:e,text:e})},n.render=function(){const{canEdit:e,text:t}=this.props,{html:n}=this.state;return(0,l.Y)(ln.A,{className:"contenteditable__field",disabled:!e,html:n||t,placeholder:"Click to type list title...",title:"Edit",onBlur:this.handleBlur,onChange:this.handleChange})},Ce()(t)}(d.Component),mn=function(e){function t(...t){var n;return(n=e.call.apply(e,[this].concat(t))||this).handleClick=async()=>{const{id:e}=n.props;(0,h.lJ)("Are you sure that you want to remove this list?",{action:"Remove List",callback:async()=>{const t=await(0,cn.l)(e,0,"DELETE");t.ok?((0,Y.s)("list_remove"),window.location.href=r.A.LISTS):(0,h.xE)(`Couldn't remove this list: ${t.statusText}`)}})},n}return Te()(t,e),t.prototype.render=function(){return(0,l.FD)(_.A,{onClick:this.handleClick,children:[(0,l.Y)("span",{className:"mdc-button__icon icon icon-trash-blue"}),"Remove"]})},Ce()(t)}(d.Component);function pn({list:e}){const{canEdit:t,collaborators:n,description:i,id:a,isBuiltIn:r,items:o,name:s}=(0,Rt.b)(e),[c,u]=(0,d.useState)(n);return(0,l.FD)(l.FK,{children:[(0,l.Y)(C.Ay,{children:(0,l.FD)("div",{className:"mdc-card__content",children:[(0,l.FD)("div",{className:"row-flex flex-between flex-align-center",children:[(0,l.Y)("h2",{className:"light-title",children:(0,l.Y)("b",{children:(0,l.Y)(hn,{canEdit:t&&!r,id:a,text:s})})}),t&&(0,l.FD)("span",{className:"action-buttons",children:[(0,l.Y)(ft.A,{buttonRaised:!0,buttonTitle:(0,l.FD)(l.FK,{children:[(0,l.Y)("span",{className:"mdc-button__icon icon icon-share-white"}),"Share"]}),entityData:{collaborators:c},entityId:a,entityName:s,entityType:"list",onChangeMembers:(e,t=!1)=>{u(t?Object.entries(Object.fromEntries(Object.keys(e).map(t=>[t,e[t].role]))):Object.entries({...Object.fromEntries(c),...Object.fromEntries(Object.keys(e).map(t=>[t,e[t].role]))}))}}),(0,l.Y)(mn,{id:a})]})]}),(0,l.Y)(dn,{canEdit:t,id:a,text:i||""})]})}),o.map(e=>(0,l.Y)(un,{canEdit:t,listId:a,...e},e.id))]})}pn.selector=r.yD.USER_LIST;var fn=n(3269),gn=n.n(fn),bn=n(1132),vn=n.n(bn),An=n(859),Cn=n(8363);function En({children:e,...t}){return(0,l.Y)(_.A,{raised:!0,...t,children:e})}function Tn({lists:e}){return(0,l.Y)(Cn.A,{children:e.map(({id:e,link:t,name:n,size:i})=>(0,l.FD)("div",{className:"row-flex row-flex--nowrap color-blue",children:[(0,l.FD)(Ie.A,{href:t,style:{flexGrow:1},tag:"a",children:[n,"(",i,")"]}),(0,l.Y)(W.A,{"aria-label":"share list",href:`${t}?${r.uB.managePermissions}`,children:(0,l.Y)("i",{className:"icon icon-share-alt icon--sm"})})]},e))})}function yn({writableLists:e}){const[t,n]=(0,d.useState)((0,Rt.b)(e));return(0,l.FD)(l.FK,{children:[(0,l.Y)("div",{style:{margin:"0 16px"},children:(0,l.Y)(An.A,{ButtonComponent:En,icon:"icon-add-white mdc-button__icon",updateLists:e=>{n([].concat(gn()(vn(),t),[e]))}})}),e.length>0?(0,l.Y)(Tn,{lists:t}):(0,l.Y)("p",{style:{margin:"16px"},children:(0,l.Y)("img",{alt:"lists-flow",className:"lists-flow",src:"/images/profile/new-lists-demo.gif"})})]})}function Sn(){return(0,l.Y)("div",{style:{margin:"0 0.5rem 1rem"},children:(0,l.Y)(He,{})})}function Nn(){return(0,l.FD)(l.FK,{children:[(0,l.Y)(i.x,{Component:pn}),(0,l.Y)(i.x,{Component:yn}),(0,l.Y)(i.x,{Component:Sn})]})}function _n(){return(0,l.FD)(l.FK,{children:[(0,l.Y)(i.x,{Component:je}),(0,l.Y)(i.x,{Component:tn}),(0,l.Y)(i.x,{Component:Ve}),(0,l.Y)(i.x,{Component:sn}
2),(0,l.Y)(i.x,{Component:mt}),(0,l.Y)(i.x,{Component:Ot}),(0,l.Y)(i.x,{Component:Xe}),(0,l.Y)(Nn,{})]})}yn.selector=r.yD.USER_LISTS,Sn.selector=r.yD.USER_LISTS_SUBSCRIPTIONS},2386(e,t,n){n.d(t,{A:()=>b});var i=n(9869),a=n(3269),r=n.n(a),o=n(1132),s=n.n(o);function l(e){const t=new Date(e);if(!Number.isNaN(t.valueOf()))return t;const n=String(e).match(/\d+/g);if(null==n||n.length<=2)return t;{const[e,t,...i]=n.map(e=>parseInt(e)),a=[e,t-1].concat(r()(s(),i));return new Date(Date.UTC.apply(Date,r()(s(),a)))}}const c=(e,t,n)=>e+" "+(1!==e?t+"s":t)+" "+n;function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},d.apply(null,arguments)}const u=3600,h=86400,m=7*h,p=30*h,f=365*h,g=()=>Date.now();function b({date:e,formatter:t,component:n="time",live:a=!0,minPeriod:r=0,maxPeriod:o=m,title:s,now:b=g,...v}){const[A,C]=(0,i.useState)(b());(0,i.useEffect)(()=>{if(!a)return;const t=(()=>{const t=l(e).valueOf();if(!t)return 0;const n=Math.round(Math.abs(A-t)/1e3),i=n<60?1e3:n<u?6e4:n<h?36e5:6048e5,a=Math.min(Math.max(i,1e3*r),1e3*o);return a?setTimeout(()=>{C(b())},a):0})();return()=>{t&&clearTimeout(t)}},[e,a,o,r,b,A]),(0,i.useEffect)(()=>{C(b())},[e]);const E=n,T=l(e).valueOf();if(!T)return null;const y=Math.round(Math.abs(A-T)/1e3),S=T<A?"ago":"from now",[N,_]=y<60?[Math.round(y),"second"]:y<u?[Math.round(y/60),"minute"]:y<h?[Math.round(y/u),"hour"]:y<m?[Math.round(y/h),"day"]:y<p?[Math.round(y/m),"week"]:y<f?[Math.round(y/p),"month"]:[Math.round(y/f),"year"],Y=void 0===s?"string"==typeof e?e:l(e).toISOString().substring(0,16).replace("T"," "):s,I="time"===E?{...v,dateTime:l(e).toISOString()}:v,D=(e=e,t=t,n=n,i=T,a=c,r=r)=>c(e,t,n),w=t||c;let O;try{O=w(N,_,S,T,D,b),O||(O=c(N,_,S))}catch(e){O=c(N,_,S)}return i.createElement(E,d({},I,{title:Y}),O)}},1879(e,t,n){var i=n(9698),a=n(9376);const r=(0,a.a0)(function(e,t){const{children:n,fixedColumnWidth:r,align:o,...l}=e,c="GridRow"!==(0,a.Mn)(n),d=(0,a.UP)(e,["mdc-layout-grid",{[`mdc-layout-grid--align-${o||""}`]:void 0!==e.align,"mdc-layout-grid--fixed-column-width":r}]);return(0,i.Y)(a.vw,{...l,className:d,ref:t,children:c?(0,i.Y)(s,{children:n}):n})}),o=(0,a.a0)(function(e,t){const{span:n,phone:r,tablet:o,desktop:s,order:l,align:c,...d}=e,u=(0,a.UP)(e,["mdc-layout-grid__cell",{[`mdc-layout-grid__cell--order-${l||""}`]:void 0!==l,[`mdc-layout-grid__cell--align-${c||""}`]:void 0!==c,[`mdc-layout-grid__cell--span-${n||""}`]:void 0!==n,[`mdc-layout-grid__cell--span-${r||""}-phone`]:void 0!==r,[`mdc-layout-grid__cell--span-${o||""}-tablet`]:void 0!==o,[`mdc-layout-grid__cell--span-${s||""}-desktop`]:void 0!==e.desktop}]);return(0,i.Y)(a.vw,{...d,ref:t,className:u})}),s=(0,a.a0)(function(e,t){const n=(0,a.UP)(e,["mdc-layout-grid__inner"]);return(0,i.Y)(a.vw,{...e,ref:t,className:n})});s.displayName="GridRow",n.d(t,["LX",0,o,"TW",0,s,"xA",0,r])},25(e,t,n){n.d(t,{W1:()=>D,Dr:()=>Y,XN:()=>S,bi:()=>O});var i,a,r=n(9698),o=n(9869),s=n(6540),l=n(1953),c=n(9376),d=n(1635),u=n(1468),h={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surface--animating-closed",ANIMATING_OPEN:"mdc-menu-surface--animating-open",FIXED:"mdc-menu-surface--fixed",IS_OPEN_BELOW:"mdc-menu-surface--is-open-below",OPEN:"mdc-menu-surface--open",ROOT:"mdc-menu-surface"},m={CLOSED_EVENT:"MDCMenuSurface:closed",CLOSING_EVENT:"MDCMenuSurface:closing",OPENED_EVENT:"MDCMenuSurface:opened",OPENING_EVENT:"MDCMenuSurface:opening",FOCUSABLE_ELEMENTS:["button:not(:disabled)",'[href]:not([aria-disabled="true"])',"input:not(:disabled)","select:not(:disabled)","textarea:not(:disabled)",'[tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'].join(", ")},p={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67,TOUCH_EVENT_WAIT_MS:30};!function(e){e[e.BOTTOM=1]="BOTTOM",e[e.CENTER=2]="CENTER",e[e.RIGHT=4]="RIGHT",e[e.FLIP_RTL=8]="FLIP_RTL"}(i||(i={})),function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=4]="TOP_RIGHT",e[e.BOTTOM_LEFT=1]="BOTTOM_LEFT",e[e.BOTTOM_RIGHT=5]="BOTTOM_RIGHT",e[e.TOP_START=8]="TOP_START",e[e.TOP_END=12]="TOP_END",e[e.BOTTOM_START=9]="BOTTOM_START",e[e.BOTTOM_END=13]="BOTTOM_END"}(a||(a={}));var f,g=function(e){function t(n){var i=e.call(this,(0,d.Cl)((0,d.Cl)({},t.defaultAdapter),n))||this;return i.isSurfaceOpen=!1,i.isQuickOpen=!1,i.isHoistedElement=!1,i.isFixedPosition=!1,i.isHorizontallyCenteredOnViewport=!1,i.maxHeight=0,i.openBottomBias=0,i.openAnimationEndTimerId=0,i.closeAnimationEndTimerId=0,i.animationRequestId=0,i.anchorCorner=a.TOP_START,i.originCorner=a.TOP_START,i.anchorMargin={top:0,right:0,bottom:0,left:0},i.position={x:0,y:0},i}
vendor: 4,501 bytes, line 2
2return(0,d.C6)(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return h},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return m},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return p},enumerable:!1,configurable:!0}),Object.defineProperty(t,"Corner",{get:function(){return a},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},hasAnchor:function(){return!1},isElementInContainer:function(){return!1},isFocused:function(){return!1},isRtl:function(){return!1},getInnerDimensions:function(){return{height:0,width:0}},getAnchorDimensions:function(){return null},getWindowDimensions:function(){return{height:0,width:0}},getBodyDimensions:function(){return{height:0,width:0}},getWindowScroll:function(){return{x:0,y:0}},setPosition:function(){},setMaxHeight:function(){},setTransformOrigin:function(){},saveFocus:function(){},restoreFocus:function(){},notifyClose:function(){},notifyClosing:function(){},notifyOpen:function(){},notifyOpening:function(){}}},enumerable:!1,configurable:!0}),t.prototype.init=function(){var e=t.cssClasses,n=e.ROOT,i=e.OPEN;if(!this.adapter.hasClass(n))throw new Error(n+" class required in root element.");this.adapter.hasClass(i)&&(this.isSurfaceOpen=!0)},t.prototype.destroy=function(){clearTimeout(this.openAnimationEndTimerId),clearTimeout(this.closeAnimationEndTimerId),cancelAnimationFrame(this.animationRequestId)},t.prototype.setAnchorCorner=function(e){this.anchorCorner=e},t.prototype.flipCornerHorizontally=function(){this.originCorner=this.originCorner^i.RIGHT},t.prototype.setAnchorMargin=function(e){this.anchorMargin.top=e.top||0,this.anchorMargin.right=e.right||0,this.anchorMargin.bottom=e.bottom||0,this.anchorMargin.left=e.left||0},t.prototype.setIsHoisted=function(e){this.isHoistedElement=e},t.prototype.setFixedPosition=function(e){this.isFixedPosition=e},t.prototype.isFixed=function(){return this.isFixedPosition},t.prototype.setAbsolutePosition=function(e,t){this.position.x=this.isFinite(e)?e:0,this.position.y=this.isFinite(t)?t:0},t.prototype.setIsHorizontallyCenteredOnViewport=function(e){this.isHorizontallyCenteredOnViewport=e},t.prototype.setQuickOpen=function(e){this.isQuickOpen=e},t.prototype.setMaxHeight=function(e){this.maxHeight=e},t.prototype.setOpenBottomBias=function(e){this.openBottomBias=e},t.prototype.isOpen=function(){return this.isSurfaceOpen},t.prototype.open=function(){var e=this;this.isSurfaceOpen||(this.adapter.notifyOpening(),this.adapter.saveFocus(),this.isQuickOpen?(this.isSurfaceOpen=!0,this.adapter.addClass(t.cssClasses.OPEN),this.dimensions=this.adapter.getInnerDimensions(),this.autoposition(),this.adapter.notifyOpen()):(this.adapter.addClass(t.cssClasses.ANIMATING_OPEN),this.animationRequestId=requestAnimationFrame(function(){e.dimensions=e.adapter.getInnerDimensions(),e.autoposition(),e.adapter.addClass(t.cssClasses.OPEN),e.openAnimationEndTimerId=setTimeout(function(){e.openAnimationEndTimerId=0,e.adapter.removeClass(t.cssClasses.ANIMATING_OPEN),e.adapter.notifyOpen()},p.TRANSITION_OPEN_DURATION)}),this.isSurfaceOpen=!0))},t.prototype.close=function(e){var n=this;if(void 0===e&&(e=!1),this.isSurfaceOpen){if(this.adapter.notifyClosing(),this.isQuickOpen)return this.isSurfaceOpen=!1,e||this.maybeRestoreFocus(),this.adapter.removeClass(t.cssClasses.OPEN),this.adapter.removeClass(t.cssClasses.IS_OPEN_BELOW),void this.adapter.notifyClose();this.adapter.addClass(t.cssClasses.ANIMATING_CLOSED),requestAnimationFrame(function(){n.adapter.removeClass(t.cssClasses.OPEN),n.adapter.removeClass(t.cssClasses.IS_OPEN_BELOW),n.closeAnimationEndTimerId=setTimeout(function(){n.closeAnimationEndTimerId=0,n.adapter.removeClass(t.cssClasses.ANIMATING_CLOSED),n.adapter.notifyClose()},p.TRANSITION_CLOSE_DURATION)}),this.isSurfaceOpen=!1,e||this.maybeRestoreFocus()}},t.prototype.handleBodyClick=function(e){var t=e.target;this.adapter.isElementInContainer(t)||this.close()},t.prototype.handleKeydown=function(e){var t=e.keyCode;("Escape"===e.key||27===t)&&this.close()},t.prototype.autoposition=function(){var e;this.measurements=this.getAutoLayoutmeasurements();var n=this.getoriginCorner(),a=this.getMenuSurfaceMaxHeight(n),r=this.hasBit(n,i.BOTTOM)?"bottom":"top",o=this.hasBit(n,i.RIGHT)?"right":"left",s=this.getHorizontalOriginOffset(n),l=this.getVerticalOriginOffset(n),c=this.measurements,d=c.anch
2orSize,u=c.surfaceSize,h=((e={})[o]=s,e[r]=l,e);d.width/u.width>p.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(o="center"),(this.isHoistedElement||this.isFixedPosition)&&this.adjustPositionForHoistedElement(h),this.adapter.setTransformOrigin(o+" "+r),this.adapter.setPosition(h),this.adapter.setMaxHeight(a?a+"px":""),this.hasBit(n,i.BOTTOM)||this.adapter.addClass(t.cssClasses.IS_OPEN_BELOW)},t.prototype.getAutoLayoutmeasurements=function(){var e=this.adapter.getAnchorDimensions(),t=this.adapter.getBodyDimensions(),n=this.adapter.getWindowDimensions(),i=this.adapter.getWindowScroll();return e||(e={top:this.position.y,right:this.position.x,bottom:this.position.y,left:this.position.x,width:0,height:0}),{anchorSize:e,bodySize:t,surfaceSize:this.dimensions,viewportDistance:{top:e.top,right:n.width-e.right,bottom:n.height-e.bottom,left:e.left},viewportSize:n,windowScroll:i}},t.prototype.getoriginCorner=function(){var e,n,a=this.originCorner,r=this.measurements,o=r.viewportDistance,s=r.anchorSize,l=r.surfaceSize,c=t.numbers.MARGIN_TO_EDGE;this.hasBit(this.anchorCorner,i.BOTTOM)?(e=o.top-c+this.anchorMargin.bottom,n=o.bottom-c-this.anchorMargin.bottom):(e=o.top-c+this.anchorMargin.top,n=o.bottom-c+s.height-this.anchorMargin.top),!(n-l.height>0)&&e>n+this.openBottomBias&&(a=this.setBit(a,i.BOTTOM));var d,u,h,m=this.adapter.isRtl(),p=this.hasBit(this.anchorCorner,i.FLIP_RTL),f=this.hasBit(this.anchorCorner,i.RIGHT)||this.hasBit(a,i.RIGHT);(h=m&&p?!f:f)?(d=o.left+s.width+this.anchorMargin.right,u=o.right-this.anchorMargin.right):(d=o.left+this.anchorMargin.left,u=o.right+s.width-this.anchorMargin.left);var g=d-l.width>0,b=u-l.width>0,v=this.hasBit(a,i.FLIP_RTL)&&this.hasBit(a,i.RIGHT);return b&&v&&m||!g&&v?a=this.unsetBit(a,i.RIGHT):(g&&h&&m||g&&!h&&f||!b&&d>=u)&&(a=this.setBit(a,i.RIGHT)),a},t.prototype.getMenuSurfaceMaxHeight=function(e){if(this.maxHeight>0)return this.maxHeight;var n=this.measurements.viewportDistance,a=0,r=this.hasBit(e,i.BOTTOM),o=this.hasBit(this.anchorCorner,i.BOTTOM),s=t.numbers.MARGIN_TO_EDGE;return r?(a=n.top+this.anchorMargin.top-s,o||(a+=this.measurements.anchorSize.height)):(a=n.bottom-this.anchorMargin.bottom+this.measurements.anchorSize.height-s,o&&(a-=this.measurements.anchorSize.height)),a},t.prototype.getHorizontalOriginOffset=function(e){var t=this.measurements.anchorSize,n=this.hasBit(e,i.RIGHT),a=this.hasBit(this.anchorCorner,i.RIGHT);if(n){var r=a?t.width-this.anchorMargin.left:this.anchorMargin.right;return this.isHoistedElement||this.isFixedPosition?r-(this.measurements.viewportSize.width-this.measurements.bodySize.width):r}return a?t.width-this.anchorMargin.right:this.anchorMargin.left},t.prototype.getVerticalOriginOffset=function(e){var t=this.measurements.anchorSize,n=this.hasBit(e,i.BOTTOM),a=this.hasBit(this.anchorCorner,i.BOTTOM);return n?a?t.height-this.anchorMargin.top:-this.anchorMargin.bottom:a?t.height+this.anchorMargin.bottom:this.anchorMargin.top},t.prototype.adjustPositionForHoistedElement=function(e){var t,n,i=this.measurements,a=i.windowScroll,r=i.viewportDistance,o=i.surfaceSize,s=i.viewportSize,l=Object.keys(e);try{for(var c=(0,d.Ju)(l),u=c.next();!u.done;u=c.next()){var h=u.value,m=e[h]||0;!this.isHorizontallyCenteredOnViewport||"left"!==h&&"right"!==h?(m+=r[h],this.isFixedPosition||("top"===h?m+=a.y:"bottom"===h?m-=a.y:"left"===h?m+=a.x:m-=a.x),e[h]=m):e[h]=(s.width-o.width)/2}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}},t.prototype.maybeRestoreFocus=function(){var e=this,t=this.adapter.isFocused(),n=this.adapter.getOwnerDocument?this.adapter.getOwnerDocument():document,i=n.activeElement&&this.adapter.isElementInContainer(n.activeElement);(t||i)&&setTimeout(function(){e.adapter.restoreFocus()},p.TOUCH_EVENT_WAIT_MS)},t.prototype.hasBit=function(e,t){return Boolean(e&t)},t.prototype.setBit=function(e,t){return e|t},t.prototype.unsetBit=function(e,t){return e^t},t.prototype.isFinite=function(e){return"number"==typeof e&&isFinite(e)},t}(u.I),b=n(1072),v=n(7921),A={MENU_SELECTED_LIST_ITEM:"mdc-menu-item--selected",MENU_SELECTION_GROUP:"mdc-menu__selection-group",ROOT:"mdc-menu"},C={ARIA_CHECKED_ATTR:"aria-checked",ARIA_DISABLED_ATTR:"aria-disabled",CHECKBOX_SELECTOR:'input[type="checkbox"]',LIST_SELECTOR:".mdc-list,.mdc-deprecated-list",SELECTED_EVENT:"MDCMenu:selected",SKIP_RESTORE_FOCUS:"data-menu-item-skip-restore-focus"},E={FOCUS_ROOT_INDEX:-1};!function(e){e[e.NONE=0]="NONE",e[e.LIST_ROOT=1]="LIST_ROOT",e[e.FIRST_ITEM=2]="FIRST_ITEM",e[e.LAST_ITEM=3]="LAST_ITEM"}(f||(f={}));var T=function(e){function t(n){var i=e.call(this,(0,d.Cl)((0,d.Cl)({},t.defaultAdapter),n))||this;return i.closeAnimationEndTimerId=0,i.defaultFocusState=f.LIST_ROOT,i.selectedIndex=-1,i}
2return(0,d.C6)(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return A},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return C},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return E},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClassToElementAtIndex:function(){},removeClassFromElementAtIndex:function(){},addAttributeToElementAtIndex:function(){},removeAttributeFromElementAtIndex:function(){},getAttributeFromElementAtIndex:function(){return null},elementContainsClass:function(){return!1},closeSurface:function(){},getElementIndex:function(){return-1},notifySelected:function(){},getMenuItemCount:function(){return 0},focusItemAtIndex:function(){},focusListRoot:function(){},getSelectedSiblingOfItemAtIndex:function(){return-1},isSelectableItemAtIndex:function(){return!1}}},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){this.closeAnimationEndTimerId&&clearTimeout(this.closeAnimationEndTimerId),this.adapter.closeSurface()},t.prototype.handleKeydown=function(e){var t=e.key,n=e.keyCode;("Tab"===t||9===n)&&this.adapter.closeSurface(!0)},t.prototype.handleItemAction=function(e){var t=this,n=this.adapter.getElementIndex(e);if(!(n<0)){this.adapter.notifySelected({index:n});var i="true"===this.adapter.getAttributeFromElementAtIndex(n,C.SKIP_RESTORE_FOCUS);this.adapter.closeSurface(i),this.closeAnimationEndTimerId=setTimeout(function(){var n=t.adapter.getElementIndex(e);n>=0&&t.adapter.isSelectableItemAtIndex(n)&&t.setSelectedIndex(n)},g.numbers.TRANSITION_CLOSE_DURATION)}},t.prototype.handleMenuSurfaceOpened=function(){switch(this.defaultFocusState){case f.FIRST_ITEM:this.adapter.focusItemAtIndex(0);break;case f.LAST_ITEM:this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount()-1);break;case f.NONE:break;default:this.adapter.focusListRoot()}},t.prototype.setDefaultFocusState=function(e){this.defaultFocusState=e},t.prototype.getSelectedIndex=function(){return this.selectedIndex},t.prototype.setSelectedIndex=function(e){if(this.validatedIndex(e),!this.adapter.isSelectableItemAtIndex(e))throw new Error("MDCMenuFoundation: No selection group at specified index.");var t=this.adapter.getSelectedSiblingOfItemAtIndex(e);t>=0&&(this.adapter.removeAttributeFromElementAtIndex(t,C.ARIA_CHECKED_ATTR),this.adapter.removeClassFromElementAtIndex(t,A.MENU_SELECTED_LIST_ITEM)),this.adapter.addClassToElementAtIndex(e,A.MENU_SELECTED_LIST_ITEM),this.adapter.addAttributeToElementAtIndex(e,C.ARIA_CHECKED_ATTR,"true"),this.selectedIndex=e},t.prototype.setEnabled=function(e,t){this.validatedIndex(e),t?(this.adapter.removeClassFromElementAtIndex(e,v.Y7.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(e,C.ARIA_DISABLED_ATTR,"false")):(this.adapter.addClassToElementAtIndex(e,v.Y7.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(e,C.ARIA_DISABLED_ATTR,"true"))},t.prototype.validatedIndex=function(e){var t=this.adapter.getMenuItemCount();if(!(e>=0&&e<t))throw new Error("MDCMenuFoundation: No list item at specified index.")},t}(u.I);const y={bottomEnd:"BOTTOM_END",bottomLeft:"BOTTOM_LEFT",bottomRight:"BOTTOM_RIGHT",bottomStart:"BOTTOM_START",topEnd:"TOP_END",topLeft:"TOP_LEFT",topRight:"TOP_RIGHT",topStart:"TOP_START"},S=(0,c.a0)(function(e,t){const{children:n,open:i,anchorCorner:a,onOpen:l,onClose:d,renderToPortal:u,fixed:h,apiRef:m,foundationRef:p,...f}=e,v=s.useRef(null),{rootEl:A}=((e,t)=>{const[n,i]=(0,o.useState)(e.open),a=(0,o.useRef)(null),r=(0,o.useRef)(null),s=(0,o.useRef)(null),l=(0,o.useRef)(null),{foundation:d,...u}=(0,c.P5)({props:e,elements:{rootEl:!0},api:({foundation:e,rootEl:t})=>({setAnchorCorner:t=>e.setAnchorCorner(t),setAnchorElement:e=>s.current=e,setOpen:e=>i(e),getSurfaceElement:()=>t.ref}),foundation:({rootEl:e,getProps:t,emit:n})=>{const a=e=>{d.handleBodyClick(e)},o=()=>{document.body.removeEventListener("click",a),document.body.removeEventListener("touchstart",a)},u=new g({addClass:t=>{e.addClass(t)},removeClass:t=>{e.removeClass(t)},hasClass:t=>"mdc-menu-surface"===t||e.hasClass(t),hasAnchor:()=>
2!!s.current,notifyClose:()=>{o(),i(!1)},notifyClosing:()=>n(g.strings.CLOSING_EVENT,{}),notifyOpen:()=>{n("onOpen",{}),setTimeout(()=>{document.body.addEventListener("click",a),document.body.addEventListener("touchstart",a)},150)},notifyOpening:()=>n(g.strings.OPENING_EVENT,{}),isElementInContainer:t=>e.ref===t||!!e.ref&&e.ref.contains(t),isRtl:()=>!!e.ref&&"rtl"===getComputedStyle(e.ref).getPropertyValue("direction"),setTransformOrigin:t=>{const n=`${(0,b.d)(window,"transform")}-origin`;e.setStyle(n,t)},isFocused:()=>document.activeElement===e.ref,saveFocus:()=>{r.current=document.activeElement},restoreFocus:()=>{e.ref&&e.ref.contains(document.activeElement)&&r.current&&r.current.focus&&r.current.focus()},getInnerDimensions:()=>({width:e.ref?e.ref.offsetWidth:0,height:e.ref?e.ref.offsetHeight:0}),getAnchorDimensions:()=>{var e;return(null==(e=s.current)?void 0:e.getBoundingClientRect())||c.dp},getWindowDimensions:()=>({width:window.innerWidth,height:window.innerHeight}),getBodyDimensions:()=>({width:document.body.clientWidth,height:document.body.clientHeight}),getWindowScroll:()=>({x:window.pageXOffset,y:window.pageYOffset}),setPosition:t=>{e.setStyle("left",void 0!==t.left?t.left:null),e.setStyle("right",void 0!==t.right?t.right:null),e.setStyle("top",void 0!==t.top?t.top:null),e.setStyle("bottom",void 0!==t.bottom?t.bottom:null)},setMaxHeight:t=>{e.setStyle("maxHeight",t)}}),h=u.close.bind(u);u.close=(e=!1)=>{n("onClose",{}),l.current=window.setTimeout(()=>{t().open||h(e)})};const m=u.destroy.bind(u);return u.destroy=()=>{o(),m()},u}}),{rootEl:h}=u,{onKeyDown:m}=e,p=(0,o.useCallback)(e=>{null==m||m(e),d.handleKeydown(e)},[m,d]);return h.setProp("onKeyDown",p,!0),(0,o.useEffect)(()=>{d.setFixedPosition(!!e.fixed)},[e.fixed,d]),(0,o.useEffect)(()=>{const e=(null==t?void 0:t.current)||h.ref;if(e){const t=(0,c.kp)(e,`.${g.cssClasses.ANCHOR}`);t&&(s.current=t)}},[t,h.ref]),(0,o.useEffect)(()=>{e.renderToPortal?d.setIsHoisted(!0):d.setIsHoisted(!1);const t=e.renderToPortal?()=>{try{d.autoposition()}catch{}}:()=>{};return(0,c.er)(()=>{d.isOpen()}),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[e.renderToPortal,d]),(0,o.useEffect)(()=>{const t=e.anchorCorner&&(e=>g.Corner[y[e]])(e.anchorCorner);if(void 0!==t){d.setAnchorCorner(t),d.dimensions=d.adapter.getInnerDimensions();try{d.autoposition()}catch{}}},[e.anchorCorner,d]),(0,o.useEffect)(()=>{if(n){const e=h.ref?h.ref.querySelectorAll(g.strings.FOCUSABLE_ELEMENTS):[];a.current=e.length>0?e[0]:null,d.open()}else d.isOpen()&&d.close()},[n,d,h.ref]),(0,o.useEffect)(()=>{i(!!e.open)},[e.open]),(0,o.useEffect)(()=>()=>{l.current&&window.clearTimeout(l.current)},[]),{...u}})(e,v),C=(0,c.UP)(e,["mdc-menu-surface",{"mdc-menu-surface--fixed":h}]);return(0,r.Y)(r.FK,{children:(0,r.Y)(c.zy,{renderTo:u,menuSurfaceDomPositionRef:v,children:(0,r.Y)(c.vw,{...f,element:A,className:C,ref:t,children:n})})})}),N=(0,c.a0)(function(e,t){const n=(0,c.UP)(e,["mdc-menu-surface--anchor"]);return(0,r.Y)(c.vw,{...e,className:n,ref:t})}),_=(0,c.a0)(function(e,t){const n=(0,c.UP)(e,["mdc-list mdc-menu__items"]);return(0,r.Y)(l.B8,{role:"menu",...e,className:n,ref:t})});_.displayName="MenuItems";const Y=(0,c.a0)(function(e,t){return(0,r.Y)(l.ck,{role:"menuitem",tabIndex:0,...e,ref:t})}),I=e=>"MenuItems"===(0,c.Mn)(e),D=(0,c.a0)(function(e,t){const{children:n,focusOnOpen:i,onSelect:a,foundationRef:l,...d}=e,{rootEl:u,setListApi:h,setMenuSurfaceApi:m}=(e=>{const t=(0,o.useRef)(),n=(0,o.useRef)(),i=(0,o.useCallback)(()=>{var e;return(null==(e=n.current)?void 0:e.listElements())||[]},[]),{foundation:a,...r}=(0,c.P5)({props:{...e,apiRef:void 0},elements:{rootEl:!0},foundation:({emit:e})=>new T({addClassToElementAtIndex:(...e)=>{var t;return null==(t=n.current)?void 0:t.addClassToElementIndex(...e)},removeClassFromElementAtIndex:(...e)=>{var t;return null==(t=n.current)?void 0:t.removeClassFromElementAtIndex(...e)},addAttributeToElementAtIndex:(...e)=>{var t;return null==(t=n.current)?void 0:t.setAttributeForElementIndex(...e)},removeAttributeFromElementAtIndex:(e,t)=>{i()[e].removeAttribute(t)},elementContainsClass:(e,t)=>e.classList.contains(t),closeSurface:()=>{var e;null==(e=t.current)||e.setOpen(!1)},getElementIndex:e=>i().indexOf(e),notifySelected:t=>e("onSelect",{index:t.index,item:i()[t.index]}),getMenuItemCount:()=>{var e;return(null==(e=n.current)?void 0:e.getListItemCount())||0},focusItemAtIndex:(...e)=>{var t;return null==(t=n.current)?void 0:t.focusItemAtIndex(...e)}
2,focusListRoot:()=>{var e;return null==(e=n.current)?void 0:e.focusRoot()}})}),{rootEl:s}=r,{onClick:l}=e,d=(0,o.useCallback)(e=>{null==l||l(e);const t=(0,c.kp)(e.target,".mdc-deprecated-list-item");t&&a.handleItemAction(t)},[a,l]),{onKeyDown:u}=e,h=(0,o.useCallback)(e=>{null==u||u(e),a.handleKeydown(e),13===e.which&&e.target instanceof Element&&n.current&&e.target.classList.contains(n.current.getClasses())&&a.handleItemAction(e.target)},[a,u]),{onOpen:m,focusOnOpen:p}=e,f=(0,o.useCallback)(e=>{const t=i();(p||void 0===p)&&t.length>0&&!t.some(e=>e===document.activeElement)&&t[0].focus(),null==m||m(e)},[m,p,i]);s.setProp("onKeyDown",h,!0),s.setProp("onClick",d,!0),s.setProp("onOpen",f,!0);const g=n.current&&t.current&&e.apiRef;return(0,o.useEffect)(()=>{n.current&&t.current&&e.apiRef&&e.apiRef({...n.current,...t.current,items:i})},[g,i]),{setListApi:e=>{n.current=e},setMenuSurfaceApi:e=>{t.current=e},...r}})(e),p=(s.Children.map(n,I)||[]).every(e=>!1===e),f={apiRef:h};return(0,r.Y)(S,{...u.props(d),className:(0,c.xW)("mdc-menu",d.className),apiRef:m,ref:t,children:p?(0,r.Y)(_,{...f,children:n}):s.Children.map(n,e=>I(e)?s.cloneElement(e,{...s.isValidElement(e)?e.props:{},...f}):e)})}),w=e=>function(t){const[n,i]=(0,o.useState)(!!t.open);(0,o.useEffect)(()=>{void 0!==t.open&&t.open!==n&&i(!!t.open)},[t.open,n]);const{handle:a,onClose:l,children:c,rootProps:d={},open:u,foundationRef:h,...m}=t,p=s.cloneElement(a,{...a.props,onClick:e=>{i(!n),a.props.onClick&&a.props.onClick(e)}});return(0,r.FD)(N,{...d,children:[(0,r.Y)(e,{...m,onClose:e=>{i(!!u||!1),null==l||l(e)},open:n,children:c}),p]})},O=(w(D),w(S))},3725(e,t,n){n.d(t,{T:()=>u});var i=n(9698),a=n(9376),r=n(1635),o=n(1468),s={ROOT:"mdc-form-field"},l={LABEL_SELECTOR:".mdc-form-field > label"},c=function(e){function t(n){var i=e.call(this,(0,r.Cl)((0,r.Cl)({},t.defaultAdapter),n))||this;return i.click=function(){i.handleClick()},i}return(0,r.C6)(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return s},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return l},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{activateInputRipple:function(){},deactivateInputRipple:function(){},deregisterInteractionHandler:function(){},registerInteractionHandler:function(){}}},enumerable:!1,configurable:!0}),t.prototype.init=function(){this.adapter.registerInteractionHandler("click",this.click)},t.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("click",this.click)},t.prototype.handleClick=function(){var e=this;this.adapter.activateInputRipple(),requestAnimationFrame(function(){e.adapter.deactivateInputRipple()})},t}(o.I);const d=(0,a.a0)(function(e,t){var n;n=e,(0,a.P5)({props:n,elements:{},foundation:()=>new c({registerInteractionHandler:(e,t)=>{},deregisterInteractionHandler:(e,t)=>{},activateInputRipple:()=>{},deactivateInputRipple:()=>{}})});const{alignEnd:r,foundationRef:o,noWrap:s,spaceBetween:l,...d}=e,u=(0,a.UP)(e,["mdc-form-field",{"mdc-form-field--align-end":r,"mdc-form-field--nowrap":s,"mdc-form-field--space-between":l}]);return(0,i.Y)(a.vw,{...d,ref:t,className:u})});function u(e){const{className:t,style:n,rootProps:r,label:o,children:s,disabled:l}=e,c=e.label||e.children,u=(0,a.Bi)("toggle-",e),h=c?{disabled:l}:{className:t,style:n,disabled:l,...r};return{id:u,renderToggle:e=>c?(0,i.FD)(d,{...r,className:t,style:n,children:[e,(0,i.FD)("label",{id:u+"label",htmlFor:u,children:[o,s]})]}):e,toggleRootProps:h}}}}]); 3//# sourceMappingURL=user.65767c1c2d.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.