PageSourceSearch

https://app.paa.ge/static/js/5937.e7653a73.chunk.js

js paa.ge collected 2026-09-24 17:11:19 UTC 14,051 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunklamaco=self.webpackChunklamaco||[]).push([[5937],{52038:(e,t,l)=>{l.d(t,{A:()=>j});var n=l(89379),i=l(74117),a=l(43801),d=l(16569),o=l(88991),s=l(78392),r=l(65668),c=l(26399),u=l(98734),p=l(89352),m=l(65043),x=l(4686),v=l(26449),h=l(94171),g=l(95406),y=l(70579);const j=e=>{var t;let{open:l,onCancel:j,productForm:A,productDetail:f,productTemplate:_}=e;const{t:C}=(0,i.Bd)("store/products/create/general"),{isSignup:w}=(0,g.IT)(),[T]=a.A.useForm(),k=(0,c.al)(),[D,b]=(0,m.useState)(!1),[I,S]=(0,m.useState)(!1),{mutateAsync:N,isLoading:F}=(0,r.xy)(),{mutateAsync:P,isLoading:L}=(0,r.X8)(),{productDetailTemplates:E}=(0,r.VS)(!w);(0,m.useEffect)(()=>{f&&T.setFieldsValue({title:f.title,description:f.description,save_template:f.createTemplate})},[f]),(0,m.useEffect)(()=>{_&&T.setFieldsValue({title:_.title,description:_.description})},[_]);const V=(0,m.useMemo)(()=>{var e,t,l,n;return null!==f&&void 0!==f&&f.template_id?null===E||void 0===E||null===(e=E.find(e=>e.id===(_?null===f||void 0===f?void 0:f.id:null===f||void 0===f?void 0:f.template_id)))||void 0===e||null===(t=e.product_details)||void 0===t||null===(l=t.filter(e=>!(null!==A&&void 0!==A&&A.productDetails.find(t=>t.id===e.id))))||void 0===l?void 0:l.length:_?null===_||void 0===_||null===(n=_.product_details)||void 0===n?void 0:n.length:0},[E,f,null===A||void 0===A?void 0:A.productDetails,_]);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(h.A,{open:D,onCancel:()=>b(!1),onConfirm:async()=>{try{var e,t;if(f){if(f.template_id)await N(f.template_id),null===A||void 0===A||null===(e=A.setProductDetails)||void 0===e||e.call(A,null===(t=A.productDetails)||void 0===t?void 0:t.map(e=>e.template_id===f.template_id?(0,n.A)((0,n.A)({},e),{},{template_id:null}):e)),b(!1)}else _&&(await N(_.id||""),b(!1))}catch(l){console.log(l),d.Ay.error(C("product_details.template.delete.error"))}},loading:F,cancelText:C("cancel"),title:C("delete_template"),bodyText:C("delete_template_body"),confirmText:C("delete"),danger:!0}),(0,y.jsx)(h.A,{open:I,onCancel:()=>S(!1),onConfirm:()=>{var e,t;f&&(null===A||void 0===A||null===(e=A.setProductDetails)||void 0===e||e.call(A,null===(t=A.productDetails)||void 0===t?void 0:t.map(e=>e.id===f.id?(0,n.A)((0,n.A)({},e),{},{template_id:null}):e)),S(!1))},cancelText:C("cancel"),title:C("unlink_template"),bodyText:C("unlink_template_body"),confirmText:C("unlink"),danger:!0}),(0,y.jsx)(o.oZ,{open:l,onCancel:j,title:C("edit_additional_detail",{title:'"'.concat(null===(t=f||_)||void 0===t?void 0:t.title,'"')}),removePadding:!0,footer:null!==f&&void 0!==f&&f.template_id||null!==_&&void 0!==_&&_.id?(0,y.jsxs)(u.A,{className:"w-100",alignItems:"center",gap:"sm",flexDirection:k?"column-reverse":"row",justifyContent:"between",children:[(0,y.jsx)(x.Ay,{type:"destructive",onClick:async()=>{b(!0)},icon:v.Delete02Icon,loading:F,children:C("product_details.template.delete")}),(0,y.jsxs)(u.A,{alignItems:"center",gap:"sm",className:k?"w-100":"",flexDirection:k?"column-reverse":"row",children:[!k&&(0,y.jsx)(x.Ay,{type:"secondary",onClick:j,children:C("cancel")}),(0,y.jsx)(x.Ay,{onClick:()=>T.submit(),loading:L,children:C("apply_instances",{count:V})})]})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(x.Ay,{type:"secondary",onClick:j,children:C("cancel")}),(0,y.jsx)(x.Ay,{onClick:()=>T.submit(),children:C("save")})]}),children:(0,y.jsxs)(u.A,{flexDirection:"column",children:[(null===f||void 0===f?void 0:f.template_id)&&(0,y.jsx)("div",{className:"pt-3 pr-3 pl-3",children:(0,y.jsx)(p.A,{type:"warning",content:C("template_warning.description",{count:V}),action:(0,y.jsx)(x.Ay,{icon:v.Unlink04Icon,type:"secondary",onClick:()=>S(!0),children:C("unlink")})})}),(0,y.jsx)(s.A,{form:T,handleSave:async e=>{let{title:t,description:l,save_template:i}=e;var a,o;if(f)if(null!==f&&void 0!==f&&f.template_id)try{var s,r;await P({id:f.template_id,title:t,description:l}),null===A||void 0===A||null===(s=A.setProductDetails)||void 0===s||s.call(A,null===A||void 0===A||null===(r=A.productDetails)||void 0===r?void 0:r.map(e=>e.template_id===f.template_id?(0,n.A)((0,n.A)({},e),{},{title:t,description:l}):e)),j()}catch(c){console.log(c),d.Ay.error(C("product_details.template.update.error"))}else null===A||void 0===A||null===(a=A.setProductDetails)||void 0===a||a.call(A,null===(o=A.productDetails)||void 0===o?void 0:o.map(e=>e.id===f.id?(0,n.A)((0,n.A)({},e),{},{title:t,description:l,createTemplate:i}):e)),j();else if(_)try{await P({id:_.id,title:t,description:l}),j()}catch(c){console.log(c),d.Ay.error(C("product_details.template.update.error"))}},hideTemplateField:!(null===f||void 0===f||!f.template_id)||!(null===_||void 0===_||!_.id)})]})})]})}},55319:(e,t,l)=>{l.d(t,{A:()=>d});var n,i=l(57528),a=l(63935);const d=l(2826).Ay.div(n||(n=(0,i.A)(["\n  border-radius: ","px;\n  border: 1px solid ",";\n"])),e=>{let{radius:t}=e;return t||10},a.cQ)},65668:(e,t,l)=>{l.d(t,{VS:()=>u,X8:()=>m,gV:()=>p,xy:()=>x});var n=l(89379),i=l(80045),a=l(203),d=l(59781),o=l(12836),s=l(96444);const r=["data"],c=["id"];function u(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=(0,a.I)({queryKey:["product-detail-templates"],queryFn:async()=>(0,s.default)("/admin/product-detail-templates",{method:"GET"}),enabled:e}),{data:l}=t,d=(0,i.A)(t,r);return(0,n.A)((0,n.A)({},l),d)}const p=()=>{const e=(0,d.jE)();return(0,o.n)({mutationKey:["post-product-detail-template"],mutationFn:async e=>(0,s.default)("/admin/product-detail-templates",{method:"POST",data:e}),onSuccess:()=>
1{e.invalidateQueries(["product-detail-templates"])}})},m=()=>{const e=(0,d.jE)();return(0,o.n)({mutationKey:["post-product-detail-template"],mutationFn:async e=>{let{id:t}=e,l=(0,i.A)(e,c);return(0,s.default)("/admin/product-detail-templates/".concat(t),{method:"POST",data:l})},onSuccess:()=>{e.invalidateQueries(["product-detail-templates"])}})},x=()=>{const e=(0,d.jE)();return(0,o.n)({mutationKey:["delete-product-detail-template"],mutationFn:async e=>(0,s.default)("/admin/product-detail-templates/".concat(e),{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries(["product-detail-templates"])}})}},78392:(e,t,l)=>{l.d(t,{A:()=>p});var n=l(43801),i=l(98734),a=l(62704),d=l(86169),o=l(87790),s=l(76910),r=l(74117),c=l(26399),u=l(70579);const p=e=>{let{form:t,handleSave:l,hideTemplateField:p}=e;const{t:m}=(0,r.Bd)("store/products/create/general"),x=(0,c.al)(),v=n.A.useWatch("description",t),h=n.A.useWatch("save_template",t);return(0,u.jsxs)(n.A,{form:t,layout:"vertical",requiredMark:!1,className:"w-100 p-3 d-flex flex-column",style:{gap:x?24:16},onFinish:l,children:[(0,u.jsx)(a.A,{name:"title",label:m("details.form.title"),required:!0,rules:[{required:!0,message:m("details.form.title.validation.required")}],children:(0,u.jsx)(o.A,{placeholder:m("details.form.title.placeholder"),maxLength:40})}),(0,u.jsx)(a.A,{name:"description",label:m("details.form.description"),required:!0,rules:[{required:!0,message:m("details.form.description.validation.required")},{validator:(e,t)=>{if(t&&"<p><br></p>"===t)return Promise.reject(m("details.form.description.validation.required"));return(t&&(new DOMParser).parseFromString(t,"text/html").body.textContent||"").length>2e3?Promise.reject(m("details.form.description.validation.length")):Promise.resolve()}}],children:(0,u.jsx)(d.A,{onChange:e=>t.setFieldValue("description",e),value:v,placeholder:m("details.form.description.placeholder")})}),!p&&(0,u.jsx)(a.A,{name:"save_template",valuePropName:"checked",children:(0,u.jsxs)(i.A,{gap:"sm",alignItems:"center",children:[(0,u.jsx)(s.A,{checked:h,onChange:e=>t.setFieldValue("save_template",e)}),m("details.form.save_template")]})})]})}},85937:(e,t,l)=>{l.r(t),l.d(t,{default:()=>k});var n=l(96810),i=l(74117),a=l(98734),d=l(72053),o=l(4686),s=l(55319),r=l(26449),c=l(67298),u=l(63935),p=l(40006),m=l(65043),x=l(94171),v=l(16569),h=l(65668),g=l(52038),y=l(70579);const j=e=>{let{handleNew:t,productDetailTemplates:l,isLoading:n,search:j}=e;const{t:A}=(0,i.Bd)("store/settings/templates"),[f,_]=(0,m.useState)(null),[C,w]=(0,m.useState)(null),{mutateAsync:T,isLoading:k}=(0,h.xy)(),D=(0,m.useMemo)(()=>null===l||void 0===l?void 0:l.filter(e=>e.title.toLowerCase().includes(j.toLowerCase())),[l,j]);return(0,y.jsxs)("div",{children:[(0,y.jsx)(x.A,{open:!!C,onCancel:()=>w(null),onConfirm:async()=>{try{await T((null===C||void 0===C?void 0:C.id)||""),w(null)}catch(e){console.log(e),v.Ay.error(A("product_details.template.delete.error"))}},cancelText:A("cancel"),title:A("delete_template"),bodyText:A("delete_template_body"),confirmText:A("delete"),loading:k,danger:!0}),f&&(0,y.jsx)(g.A,{open:!!f,onCancel:()=>_(null),productTemplate:f}),null!==l&&void 0!==l&&l.length?(0,y.jsxs)(a.A,{flexDirection:"column",gap:"xs",children:[null===D||void 0===D?void 0:D.map(e=>{var t,l,n,i;return(0,y.jsx)(s.A,{children:(0,y.jsx)(p.A,{actions:[{icon:r.Edit02Icon,onClick:()=>(e=>{_(e)})(e)},{icon:r.Delete02Icon,onClick:()=>(e=>{w(e)})(e)}],subtitle:"".concat(null!==e&&void 0!==e&&null!==(t=e.product_details)&&void 0!==t&&t.length&&(null===e||void 0===e||null===(l=e.product_details)||void 0===l?void 0:l.length)>1?A("linked.products",{count:null===e||void 0===e||null===(n=e.product_details)||void 0===n?void 0:n.length}):A("linked.product",{count:null===e||void 0===e||null===(i=e.product_details)||void 0===i?void 0:i.length})),id:e.id||"",title:e.title||""})},e.id)}),0===(null===D||void 0===D?void 0:D.length)&&(0,y.jsx)(s.A,{className:"w-100 p-3 text-center",style:{color:u.f},children:A("no_templates_found")})]}):(0,y.jsx)(s.A,{children:(0,y.jsx)(a.A,{className:"w-100",gap:"md",style:{padding:"32px 0px"},alignItems:"center",justifyContent:"center",flexDirection:"column",children:n?(0,y.jsx)(d.A,{}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(a.A,{flexDirection:"column",gap:"xs",alignItems:"center",justifyContent:"center",className:"text-center w-100",style:{color:u.PV},children:[(0,y.jsx)(c.n,{icon:r.FolderLibraryIcon,size:16}),(0,y.jsxs)(a.A,{flexDirection:"column",gap:"xxs",alignItems:"center",justifyContent:"center",className:"text-center w-100",children:[(0,y.jsx)("div",{className:"text-sm-medium",children:A("details.empty")}),(0,y.jsx)("div",{className:"text-sm",children:A("details.empty.description")})]})]}),(0,y.jsx)(o.Ay,{icon:r.PlusSignIcon,onClick:t,children:A("new")})]})})})]})};var A=l(67263),f=l(43801),_=l(88991),C=l(26399),w=l(78392);const T=e=>{let{open:t,onCancel:l}=e;const{t:n}=(0,i.Bd)("store/products/create/general"),{mutateAsync:a,isLoading:d}=(0,h.gV)();(0,m.useEffect)(()=>{t||r.resetFields()},[t]);const s=(0,C.al)(),[r]=f.A.useForm();return(0,y.jsx)(_.oZ,{open:t,onCancel:l,title:n("extras.create_new"),removePadding:!0,footer:(0,y.jsxs)(y.Fragment,{children:[!s&&(0,y.jsx)(o.Ay,{type:"secondary",onClick:l,children:n("cancel")}),(0,y.jsx)(o.Ay,{onClick:()=>r.submit(),loading:d,size:s?"large":void 0,children:n("add")})]}),children:(0,y.jsx)(w.A,{form:r,handleSave:async e=>
1{try{await a({title:e.title,description:e.description}),l()}catch(t){console.log(t),v.Ay.error(n("error.create_product_detail_template"))}},hideTemplateField:!0})})},k=()=>{const{t:e}=(0,i.Bd)("store/settings/header"),t=(0,C.al)(),[l,d]=(0,m.useState)(""),[s,c]=(0,m.useState)(!1),{productDetailTemplates:u,isLoading:p}=(0,h.VS)(),x=()=>{c(!0)};return(0,y.jsxs)(n.oC,{children:[s&&(0,y.jsx)(T,{open:s,onCancel:()=>c(!1)}),(0,y.jsxs)(a.A,{alignItems:"center",justifyContent:"between",className:"w-100",children:[(0,y.jsx)("div",{className:"text-2xl",children:e("additional_details")}),!(null===u||void 0===u||!u.length)&&(0,y.jsx)(o.Ay,{icon:r.PlusSignIcon,onClick:x,children:e("new")})]}),!(null===u||void 0===u||!u.length)&&(0,y.jsx)(a.A,{className:"w-100",alignItems:"center",gap:"xs",justifyContent:"end",children:(0,y.jsx)(A.A,{className:t?"w-100":"",style:{maxWidth:t?"":220},placeholder:e("search"),value:l,onChange:e=>d(e.target.value)})}),(0,y.jsx)(j,{handleNew:x,productDetailTemplates:u,isLoading:p,search:l})]})}},89352:(e,t,l)=>{l.d(t,{A:()=>p});var n,i=l(57528),a=l(67298),d=l(98734),o=l(63935),s=l(2826),r=l(26449),c=l(70579);const u=s.Ay.div(n||(n=(0,i.A)(["\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  gap: 8px;\n  background-color: ",";\n  border-radius: 8px;\n  color: ",";\n  padding: ",";\n"])),e=>{let{type:t}=e;return"info"===t?o.H6:"warning"===t?o.Vm:"error"===t?o.Ir:o.mP},e=>{let{type:t}=e;return"info"===t?o.hL:"warning"===t?o.hK:"error"===t?o.a4:o.LE},e=>{let{hasTitle:t}=e;return t?"16px":"12px"}),p=e=>{let{type:t="default",content:l,title:n,hideInfoIcon:i,icon:o,action:s,textStyle:p}=e;return(0,c.jsxs)(u,{type:t,hasTitle:!!n,children:[(0,c.jsxs)(d.A,{flexDirection:"column",gap:"xs",children:[n&&(0,c.jsx)("div",{className:"text-sm-medium",children:n}),(0,c.jsxs)(d.A,{alignItems:"start",gap:"sm",className:"text-xs",children:[!n&&!i&&(0,c.jsx)(d.A,{style:{minWidth:16},alignItems:"center",children:(0,c.jsx)(a.n,{icon:o||r.InformationCircleIcon,size:16})}),(0,c.jsx)("div",{className:"text-xs",style:p,children:l})]})]}),s&&s]})}},94171:(e,t,l)=>{l.d(t,{A:()=>c});var n=l(65043),i=l(98734),a=l(4686),d=l(87790),o=l(88991),s=l(63935),r=l(70579);const c=e=>{let{open:t,onCancel:l,onConfirm:c,confirmText:u,cancelText:p,title:m,bodyText:x,danger:v,loading:h,confirmPhrase:g}=e;const[y,j]=(0,n.useState)("");(0,n.useEffect)(()=>{t||j("")},[t]);const A=!!c&&!!u&&(!g||y===g);return(0,r.jsx)(o.oZ,{open:t,onCancel:l,title:m,removeDivider:!0,size:"small",destroyOnClose:!0,fullScreenOnMobile:!0,zIndex:3e3,footer:(0,r.jsxs)(i.A,{justifyContent:"end",alignItems:"center",gap:"sm",className:"w-100",children:[(0,r.jsx)(a.Ay,{type:"secondary",className:"text-sm",onClick:l,children:p}),!!c&&!!u&&(0,r.jsx)(a.Ay,{type:v?"destructive":"default",onClick:()=>{A&&!h&&(null===c||void 0===c||c())},loading:h,disabled:!A,children:u})]}),children:(0,r.jsxs)(i.A,{flexDirection:"column",gap:"md",children:[(0,r.jsx)("div",{className:"text-sm",style:{color:s.f,whiteSpace:"pre-line"},children:x}),g&&(0,r.jsx)(d.A,{value:y,onChange:e=>j(e.target.value),placeholder:g})]})})}}}]);

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.