PageSourceSearch

https://app.withvayu.com/assets/UpdatePlanPage-71fad666.js

js withvayu.com collected 2026-09-25 14:19:19 UTC 5,170 bytes, 1 lines download raw bytes

1import{j as t,r as f}from"./vendor-react-0b52e17d.js";import{u as E,aM as j,g as y,aQ as N,H as I}from"./vendor-misc-60f9a457.js";import{u as T,V as R,ac as U,$ as _,w as h,ad as F,ae as A,af as w,ag as c,k as D,a9 as v,ah as L,ai as B,aj as M}from"./app-core-d11f9ebf.js";import{P as O,u as V,C as W,a as $,b as G,c as H,d as k,e as q}from"./plan-input-form-0e711062.js";import{P as Q}from"./is-add-product-d5de001a.js";import{cD as Y,cE as z,cF as J,cG as g,a5 as K,d as X}from"./vendor-vy-3b44047f.js";import{u as Z}from"./index-51d9f282.js";import{u as x}from"./use-validated-params-6dabfd0f.js";import{T as tt}from"./vendor-mui-238acd1e.js";import{w as et}from"./withPrefetch-fe90ea99.js";import{p as rt}from"./use-meters-44d1580c.js";import{u as at}from"./breadcrumbs-context-d114e5ee.js";import{u as ot}from"./use-plan-by-id-e0366858.js";import{P as st}from"./breadcrumb-routes-3b4ebb59.js";import"./vendor-vy-ds-885d80cb.js";import"./use-preview-currency-4052b1ee.js";import"./VyTooltip-6bcb524b.js";import"./Price-1f7c2338.js";import"./VyTextareaField-fc08cf8e.js";import"./use-country-options-b4d34c7b.js";import"./VySwitchField-fe849c62.js";import"./VyBooleanCheckboxField-5aa5d605.js";import"./use-catalog-products-list-5f86cccb.js";import"./use-anrok-enabled-1433a0ef.js";import"./use-debounce-c674a381.js";import"./use-net-suite-products-b58d8bcf.js";import"./use-net-suite-classes-76255a9e.js";import"./use-integration-entities-d3c1a2c2.js";import"./UpsertCatalogProductsDialog-1690daaa.js";import"./NetSuiteProductsDropdown-ce46a9d2.js";import"./build-erp-entity-from-external-integration-03c34b8c.js";import"./use-subsidiary-name-map-b6683d64.js";import"./use-subsidiaries-9438a3e5.js";import"./reference-data-query-options-consts-5095626a.js";import"./use-formatted-xero-products-b9819930.js";import"./use-paddle-products-c939e580.js";import"./use-stripe-tax-enabled-ae951464.js";import"./use-integration-settings-1461d694.js";import"./use-account-7dbbc7a8.js";import"./VyNumberFieldField-8608cbd2.js";import"./VySelectField-5d1c450d.js";import"./ArrowIcon-0a7a632e.js";import"./use-toggle-b8bd28b6.js";import"./use-billing-engine-estimation-4177f73c.js";import"./ContractPhasesTimelineContainer-e72323f9.js";import"./use-conditional-integration-prefetch-45d052b3.js";import"./AddIcon-b108927a.js";import"./add-item-button-consts-47e5b6b0.js";import"./VyPaper-00f3d28d.js";import"./UpsertCreditTypeDialog-fd2bfe78.js";import"./VyDateField-e8ded6f2.js";import"./VyDatePicker-ffe76d24.js";import"./picker-value-utils-370a432f.js";import"./use-menu-b2c157ac.js";import"./NetSuiteClassesDropdown-9f9a51fb.js";import"./VyTextFieldField-b4524273.js";import"./CloseButton-31e3dea9.js";import"./Divider-3514b461.js";import"./VyDescriptionTitle-f7aadd5a.js";import"./sizes-b8509740.js";import"./CustomerAutoComplete-58988c19.js";import"./use-customers-names-10c2875a.js";import"./VyAutocompleteSelect-a9c11eb2.js";import"./get-plan-duration-values-ee4d381f.js";import"./VyRadioGroup-ba51f15f.js";import"./proration-options-58b30ead.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"2cd2d3d210c4"};var a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="fd5c0d98-d6a1-4768-b760-652c681f52c8",e._sentryDebugIdIdentifier="sentry-dbid-fd5c0d98-d6a1-4768-b760-652c681f52c8")}catch{}})();const it=({isDialogOpen:e,handleClose:a})=>{const{planId:r}=x("planId"),s=T(),{getValues:p}=E(),o=Z(),i=async()=>{const l=p(),n=U(l,{errorContext:"Update plan validation",withCreditsAsProducts:!0});if(!n.success)return;const d=n.data;await _(o,{planId:r,updatePlanRequest:d},{pending:"Updating plan...",success:"Plan updated successfully",error:"Failed to update plan"}),s(`/plans/${r}`)};return t.jsx(R,{label:"Update plan",ctaText:"Update",cancelButtonText:"Cancel",onSubmit:Y(i),open:e,onClose:a,children:t.jsx(tt,{children:"This action will update the plan."})})},nt=({children:e})=>{var i;const{planId:a}=x("planId"),{data:{plan:r},isSuccess:s}=ot(a),p=f.useMemo(()=>[st,{label:r.name,to:`/plans/${a}`},{label:"Update plan"}],[r.name,a]);at(p);const o=j({resolver:y(O),defaultValues:r});return V(o),f.useEffect(()=>{if(!s)return;const{products:l,...n}=r,d=F(l),u=z(d),P=u.filter(J),S=P.filter(m=>!g(m)),b=P.filter(m=>g(m)),C=u.filter(K);o.reset({...n,proRataSetting:A(r),fixedProducts:S,usageProducts:C,promotionProducts:b})},[s,r,o]),t.jsxs(N,{...o,children:[t.jsx("form",{className:"flex h-full flex-col",children:e}),X(o.formState.errors.root)&&t.jsx(w,{errorMessage:((i=o.formState.errors.root)==null?void 0:i.message)??""})]})},pt=h(nt),lt={[c.pricingAndProducts]:t.jsx(W,{}),[c.settings]:t.jsx($,{})},dt=()=>{const e=v();return t.jsxs(t.Fragment,{children:[t.jsx(I,{children:t.jsx("title",{children:"Plans"})}),t.jsx(L,{planCreationReason:B.NewPlan,defaultPlanCreationStep:c.settings,onFinalStep:e.handleOpen,children:t.jsx(pt,{children:t.jsxs(M,{children:[t.jsx(G,{}),t.jsx(H,{stepsContent:lt}),t.jsx(k,{}),t.jsx(q,{stepsLabels:Q,formClearable:!0}),t.jsx(it,{...e})]})})})]})},je=h(D(et(dt,rt)));export{je as UpdatePlanPage};

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.