PageSourceSearch

https://tapin.gg/_next/static/chunks/pages/admin/product-modes-dd9baa0bb8476ee4.js

js tapin.gg collected 2026-09-29 20:35:15 UTC 8,212 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6703],{893:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/product-modes",function(){return n(15931)}])},11879:function(e,t,n){"use strict";n.d(t,{u:function(){return d}});var r=n(11527),i=n(46083);function d(e){let{title:t,description:n,action:d,tone:o="muted",role:u}=e,a="destructive"===o;return(0,r.jsxs)("div",{role:null!=u?u:a?"alert":void 0,className:(0,i.cn)("text-center text-sm",a?"rounded-admin-lg border border-admin-destructive/40 bg-admin-destructive/10 px-4 py-6 text-admin-destructive":"px-4 py-10 text-admin-muted-foreground"),children:[(0,r.jsx)("p",{className:"font-semibold",children:t}),null!=n?(0,r.jsx)("p",{className:"mt-1",children:n}):null,d?(0,r.jsx)("div",{className:"mt-4 flex flex-wrap justify-center gap-2",children:d}):null]})}},65481:function(e,t,n){"use strict";function r(e){var t;return null!==(t=JSON.stringify(function e(t){if(Array.isArray(t))return t.map(e);if(!function(e){if(null===e||"object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}(t))return t;let n={};for(let r of Object.keys(t).sort())n[r]=e(t[r]);return n}(e)))&&void 0!==t?t:"undefined"}function i(e,t){return e===t||r(e)===r(t)}n.d(t,{s:function(){return i}})},11013:function(e,t,n){"use strict";n.d(t,{Jk:function(){return c},Wx:function(){return m},ol:function(){return l}});var r=n(29051),i=n(84896),d=n(47553),o=n(94517);let u=(0,r.t)("product-modes");function a(e){return(0,i.zr)((0,i.XZ)("admin/product-modes"),e)}function s(e,t){return(0,i.Nn)("post",(0,i.XZ)("admin/product-modes"),e,t)}function l(){return(0,o.o)(e=>u.scope(e,"list"),a,{staleTime:3e4})}function c(){return(0,d.V9)(s,{refresh:()=>[u.root]})}function m(){return(0,d.V9)((e,t)=>{let{id:n,input:r}=e;return(0,i.Nn)("patch",(0,i.XZ)("admin/product-modes/".concat(n)),r,t)},{refresh:()=>[u.root]})}},92941:function(e,t,n){"use strict";n.d(t,{C:function(){return a}});var r=n(91394),i=n(85402),d=n(80080),o=n(46083);let u=(0,d.j)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-admin-md border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-admin-ring focus-visible:ring-[3px] focus-visible:ring-admin-ring/30 has-[[data-icon=inline-end]]:pr-1.5 has-[[data-icon=inline-start]]:pl-1.5 aria-[invalid=true]:border-admin-destructive aria-[invalid=true]:ring-admin-destructive/20 [&>svg]:pointer-events-none [&>svg]:!size-3",{variants:{variant:{default:"bg-admin-primary text-admin-primary-foreground [&:is(a)]:hover:bg-admin-primary/80",secondary:"bg-admin-secondary text-admin-secondary-foreground [&:is(a)]:hover:bg-admin-muted",destructive:"bg-admin-destructive/10 text-admin-destructive focus-visible:ring-admin-destructive/20 [&:is(a)]:hover:bg-admin-destructive/20",success:"bg-admin-success/10 text-admin-success focus-visible:ring-admin-success/20 [&:is(a)]:hover:bg-admin-success/20",outline:"border-admin-border bg-admin-card text-admin-muted-foreground [&:is(a)]:hover:bg-admin-muted [&:is(a)]:hover:text-admin-foreground",ghost:"hover:bg-admin-muted hover:text-admin-muted-foreground",link:"text-admin-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function a(e){let{className:t,variant:n="default",render:d,...a}=e;return(0,i.L)({defaultTagName:"span",props:(0,r.dG)({className:(0,o.cn)(u({variant:n}),t)},a),render:d,state:{slot:"badge",variant:n}})}},4725:function(e,t,n){"use strict";n.d(t,{O:function(){return d}});var r=n(11527),i=n(46083);function d(e){let{className:t,...n}=e;return(0,r.jsx)("div",{"data-slot":"skeleton",className:(0,i.cn)("animate-pulse rounded-admin-lg bg-admin-muted",t),...n})}},15931:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return S},default:function(){return L}});var r=n(11527),i=n(10935),d=n(50959),o=n(11879),u=n(25603),a=n(44668),s=n(92941),l=n(4725),c=n(11251),m=n(87794),f=n(62693),p=n(56337),v=n(65502),g=n(80513),x=n(79558),h=n(51808),y=n(67226),b=n(60401);let k={toDraft:e=>{var t,n;return{key:null!==(t=null==e?void 0:e.key)&&void 0!==t?t:"",title:null!==(n=null==e?void 0:e.title)&&void 0!==n?n:""}}
1,validate:e=>e.key.trim()?e.title.trim()?null:"Title is required":"Key is required"};var j=n(11013);function N(e){let{productMode:t,onClose:n}=e,i=null===t,{draft:d,dirty:o,problem:u,update:a,reset:s}=(0,g.T)(t,k);(0,x.Lc)(o);let l=(0,j.Jk)(),N=(0,j.Wx)(),w=l.isLoading||N.isLoading;return(0,r.jsx)(v.e,{title:i?"Create product mode":"Edit product mode",onClose:n,dirty:o,panelAttr:"data-product-mode-edit-panel",footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.z,{type:"button",variant:"outline",onClick:n,children:"Cancel"}),(0,r.jsxs)(h.z,{type:"button",onClick:function(){if(u){f.Am.error(u);return}let e={onSuccess:()=>{f.Am.success("Product mode saved"),s(),i&&n()},onError:e=>f.Am.error((0,p.Qi)(e,"Product mode save failed"))};null===t?l.mutate({key:d.key.trim(),title:d.title.trim()},e):N.mutate({id:t.id,input:{title:d.title.trim()}},e)},disabled:w,children:[i?(0,r.jsx)(c.Z,{className:"size-4"}):(0,r.jsx)(m.Z,{className:"size-4"}),"Save"]})]}),children:(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-3 p-4 md:grid-cols-2",children:[(0,r.jsx)(y.g,{label:"Key",htmlFor:"product-mode-key",children:(0,r.jsx)(b.I,{id:"product-mode-key",value:d.key,maxLength:128,disabled:!i,onChange:e=>a({key:e.target.value})})}),(0,r.jsx)(y.g,{label:"Title",htmlFor:"product-mode-title",children:(0,r.jsx)(b.I,{id:"product-mode-title",value:d.title,maxLength:128,onChange:e=>a({title:e.target.value})})})]})})}let w={key:a.k.key(),new:a.k.flag()};function C(e,t){let n=t.toLowerCase();return[e.key,e.title].some(e=>e.toLowerCase().includes(n))}function _(){var e,t,n,i;let s=(0,j.ol)(),{values:c,set:m}=(0,a.x)(w),[f,p]=(0,d.useState)(""),v=null!==(e=s.data)&&void 0!==e?e:[],g=c.new?null:c.key,x=null===g?null:null!==(t=v.find(e=>e.key===g))&&void 0!==t?t:null;return s.isLoading?(0,r.jsx)(l.O,{className:"h-96 w-full rounded-admin-xl"}):s.isError?(0,r.jsx)(o.u,{tone:"destructive",title:"Couldn't load product modes."}):(0,r.jsx)(u.d,{title:"Product Modes",items:v,itemId:e=>e.key,selectedId:null!==(n=null==x?void 0:x.key)&&void 0!==n?n:null,search:{value:f,onChange:p,placeholder:"Search product modes...",match:C},onSelect:e=>void m({key:e.key,new:!1}),onCreate:()=>void m({key:null,new:!0}),renderCard:e=>(0,r.jsx)(Z,{productMode:e}),editorSelector:"[data-product-mode-edit-panel]",emptyPicker:(0,r.jsx)(o.u,{title:"No product modes found."}),emptyWorkspace:(0,r.jsx)("div",{className:"rounded-admin-lg border border-admin-border bg-admin-card p-6 text-sm text-admin-muted-foreground",children:"Select a product mode to edit."}),children:c.new||x?(0,r.jsx)(N,{productMode:x,onClose:()=>void m({key:null,new:!1})},null!==(i=null==x?void 0:x.key)&&void 0!==i?i:"new"):null})}function Z(e){let{productMode:t}=e;return(0,r.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"truncate text-sm font-semibold text-admin-foreground",children:t.title}),(0,r.jsx)("p",{className:"truncate text-xs text-admin-muted-foreground",children:t.key})]}),(0,r.jsx)(s.C,{variant:"outline",children:"mode"})]})}var S=!0,L=()=>(0,r.jsx)(i.Z,{pageTitle:"Product Modes",children:(0,r.jsx)(_,{})})},11251:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(11701).Z)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},56386:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(11701).Z)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},87794:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(11701).Z)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]])}},function(e){e.O(0,[6183,8826,4358,2591,8851,935,7928,2888,9774,179],function(){return e(e.s=893)}),_N_E=e.O()}]);

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.