1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[951],{19026:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/templates/[[...templateId]]",function(){return n(87192)}])},65446:function(t,e,n){"use strict";n.d(e,{Z:function(){return p}});var a=n(85893);n(67294);var o=n(25617),i=n(88220),r=n(48882),l=n(30165),s=n(57290),c=n(12327),d=n(44044);function p(t){let{children:e}=t,n=(0,o.v9)(d.ST);return(0,a.jsx)(r.Z,{children:(0,a.jsxs)(i.Z,{sx:{display:"grid",gridTemplateColumns:"100%",gridTemplateRows:"".concat(n?"min-content":""," minmax(0px, 1fr)"),gridTemplateAreas:"".concat(n?'"navBar"':"",' "mainContent"')},children:[n&&(0,a.jsx)(c.Z,{}),e,(0,a.jsx)(l.Z,{}),(0,a.jsx)(s.Z,{})]})})}},94024:function(t,e,n){"use strict";n.d(e,{Z:function(){return s}});var a=n(85893),o=n(67294),i=n(84879),r=n(28907),l=n(49634);function s(t){let{navItems:e,value:n,onChange:s,sx:c,...d}=t,[p,u]=(0,o.useState)(n);return(0,o.useEffect)(()=>{u(n)},[n]),(0,a.jsx)(i.Z,{value:p,onChange:(t,e)=>{u(e),null==s||s(t,e)},sx:[{".MuiTabs-flexContainer":{gap:"32px"},minHeight:"44px"},...Array.isArray(c)?c:[c]],...d,children:e.map((t,e)=>(0,a.jsx)(r.Z,{"data-qa":"".concat(t.key,"-").concat(t.type),tabIndex:0,role:"link",disableRipple:!0,label:"string"==typeof t?t:t.label,sx:t=>({padding:"8px 0px 8px 0px",textTransform:"none",fontWeight:t.typography.fontWeightRegular,minWidth:0,...p===e&&{fontWeight:t.typography.fontWeightEmphasis},minHeight:"40px","&:focus":{color:t.palette.primary.main}}),...(null==t?void 0:t.redirect)&&{LinkComponent:l.Z,href:t.redirect}},"string"==typeof t?t:t.label))})}},87192:function(t,e,n){"use strict";n.r(e),n.d(e,{__N_SSP:function(){return z},default:function(){return A}});var a=n(85893),o=n(67294),i=n(25617),r=n(12918),l=n.n(r),s=n(64142),c=n(9008),d=n.n(c),p=n(11306),u=n(88220),m=n(21485),x=n(65446),h=n(77387),g=n(93441),f=n(32550),v=n(11163),b=n(94024),j=n(56912),y=n(39881),k=n(99077),Z=n(22507),I=n(58646),w=n(92238),C=n(6191),_=n(43684),E=n(58356),S=n(92152);function D(t){let{mode:e="templates",callback:n,items:r}=t,{t:l}=(0,s.Z)(["integrations","common","library"]),c=(0,i.I0)(),[d,p]=(0,o.useState)(""),x=o.useRef({}),{useDeletePrintUIDraft:h}=(0,S.Z)();return(0,a.jsx)(u.Z,{sx:{display:r.length?"grid":"flex",gridTemplateColumns:"repeat(auto-fill, minmax(max(336px, calc((100% - calc(".concat(5," * 16px)) / ").concat(6,")), 1fr))"),gap:"16px"},children:null==r?void 0:r.map(t=>(0,a.jsx)(u.Z,{role:"img","aria-label":t.name,sx:e=>({position:"relative",backgroundImage:"url(".concat(t.img,")"),backgroundSize:"cover",backgroundPosition:"50%",height:"224px",display:"flex",alignItems:"end","&:before":{content:'""',position:"absolute",background:"linear-gradient(180deg, transparent 0%, ".concat(e.palette.dark.main," 100%)"),top:"50%",width:"100%",height:"50%"}}),children:(0,a.jsxs)(u.Z,{sx:{display:"flex",p:"16px",flexGrow:1,alignItems:"center",justifyContent:"space-between",zIndex:1,gap:"8px",width:"100%"},children:[(0,a.jsxs)(u.Z,{sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,a.jsx)(m.Z,{variant:"bodyRegular",sx:t=>({color:t.palette.primary.contrastText,fontWeight:t.typography.fontWeightEmphasis,...t.mixins.textOverflow}),children:t.name}),t.description&&(0,a.jsx)(m.Z,{variant:"bodySmallRegular",sx:t=>({color:t.palette.primary.contrastText}),children:t.description})]}),(0,a.jsxs)(u.Z,{sx:{display:"flex",gap:"8px",flexShrink:0},children:[(0,a.jsx)(y.Z,{label:"templates"===e?l("integrations:templates:create-project"):l("common:edit"),variant:"outlined",color:"secondary",sx:{":not(:hover)":{color:"white"}},size:"small",onClick:()=>{null==n||n(t)}}),"drafts"===e&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y.Z,{label:l("library:more-actions"),"data-qa":"rp-more-options",mode:"icon",variant:"transparent",color:"dark",active:d===t.jobId,onClick:e=>{var n;e.stopPropagation(),p(t.jobId),null==x||null===(n=x.current[t.jobId])||void 0===n||n.setAnchorEl(e.currentTarget)},startIcon:(0,a.jsx)(Z.Z,{filled:!0}),size:"small",sx:{":not(:hover)":{backgroundColor:"transparent"}}}),(0,a.jsx)(I.Z,{onClose:()=>p(""),ref:e=>{x.current[t.jobId]=e},color:"dark",transformOrigin:{vertical:"top",horizontal:"left"},children:(0,a.jsxs)(u.Z,{sx:{display:"flex",gap:"4px",flexDirection:"column",minWidth:"160px"},children:[(0,a.jsx)(w.Z,{mode:"other",sx:t=>({"&:hover":{backgroundColor:t.palette.dark.dark}}),control:(0,a.jsx)(y.Z,{label:l("integrations:templates:preview"),variant:"contained","aria-haspopup":"dialog","aria-controls":"".concat(l("integrations:templates:preview"),"-").concat(l("common:dialog")),color:"dark",size:"small",startIcon:(0,a.jsx)(C.Z,{}),sx:{minHeight:0,backgroundColor:"transparent !important"},onClick:()=>{var e;null==x||null===(e=x.current[t.jobId])||void 0===e||e.setAnchorEl(null),c((0,k.G3)({id:k.xQ.printUIPreviewDraftDialog,config:{jobId:t.jobId}}))}})}),(0,a.jsx)(w.Z,{mode:"other",sx:t=>({"&:hover":{backgroundColor:t.palette.dark.dark}}),control:(0,a.jsx)(y.Z,{label:l("integrations:templates:rename"),variant:"contained","aria-haspopup":"dialog","aria-controls":"".concat(l("integrations:templates:rename-project")," ").concat(l("common:dialog")),color:"dark",size:"small",startIcon:(0,a.jsx)(_.Z,{}),sx:{minHeight:0,backgroundColor:"transparent !important"},onClick:()=>{var e;null==x||null===(e=x.current[t.jobId])||void 0===e||e.setAnchorEl(null),c((0,k.G3)({id:k.xQ.printUICreateEditDraftDialog,config:{mode:"edit",currentDraft:t}}))}})}),(0,a.jsx)(j.Z,{sx:t=>({borderColor:t.palette.secondary.dark,my:"8px"})}),(0,a.jsx)(w.Z,{mode:"other",sx:t=>({"&:hover":{backgroundColor:t.palette.dark.dark}}),control:(0,a.jsx)(y.Z,{"aria-haspopup":"dialog","aria-controls":"".concat(l("common:confirmation")," ").concat(l("common:dialog")),label:l("integrations:templates:delete-project"),variant:"transparent",color:"errordark",size:"small",startIcon:(0,a.jsx)(E.Z,{}),sx:{minHeight:0,backgroundColor:"transparent !important"},onClick:()=>{var e;null==x||null===(e=x.current[t.jobId])||void 0===e||e.setAnchorEl(null),c((0,k.G3)({id:k.xQ.genericConfirmation,config:{title:l("integrations:templates:delete-project"),body:l("integrations:templates:delete-project-warning"),includeVerification:!0,confirmationCallback:e=>{let{onSuccess:n,onError:a,onClick:o}=e;o(),h.mutate({id:t.id||""},{onSuccess:n,onError:a})}}}))}})})]})})]})]})]})},"".concat(t.jobId,"-").concat(t.size||t.name)))})}var T=n(64739),z=!0;function A(t){var e,n,r,l,c,x;let{location:j}=t,{t:Z}=(0,s.Z)(["integrations","common"]),I=(0,v.useRouter)(),w=(0,i.I0)(),C=(0,p.hg)(),[_,E]=(0,o.useState)(0),{isPending:S,selectors:z}=(0,g.aF)(),{data:A}=(0,h.Y$)(z.hasSession()),{data:P}=(0,h.aM)(z.hasSession()),{data:R}=(0,h.BI)(z.hasSession()),N=null==P?void 0:null===(e=P.data)||void 0===e?void 0:e.flatMap(t=>t.attributes.sizes.map(e=>
1({...e,id:t.id,name:t.attributes.name,description:e.n}))),L=Array.isArray(null==R?void 0:R.data)?null==R?void 0:R.data:(null==R?void 0:R.data)?[null==R?void 0:R.data]:[],U=(Array.isArray(null===(n=I.query)||void 0===n?void 0:n.templateId)?null===(l=I.query)||void 0===l?void 0:null===(r=l.templateId)||void 0===r?void 0:r[0]:null===(c=I.query)||void 0===c?void 0:c.templateId)||"",W=[{label:Z("integrations:templates:templates"),type:"tab",key:"templates",component:(0,a.jsx)(D,{items:(null==N?void 0:N.map(t=>({name:t.name,img:t.thumbnail,jobId:t.id,size:t.n,description:t.description})))||[],callback:t=>{G(t)}})},{label:Z("integrations:templates:projects"),type:"tab",key:"drafts",component:(null==L?void 0:L.length)?(0,a.jsx)(D,{mode:"drafts",items:(null==L?void 0:L.map(t=>({name:t.attributes.name,description:t.attributes.description,img:t.attributes.url,jobId:t.attributes.job_id,id:t.id})))||[],callback:t=>{I.push("".concat(C,"/templates/").concat(encodeURI(t.jobId)),void 0,{shallow:!0})}}):(0,a.jsx)(u.Z,{sx:{height:"80vh",width:"100%"},children:(0,a.jsx)(T.ZP,{icon:(0,a.jsx)(T.Ph,{filled:!1,background:!1,sx:{mb:"-40px"}}),title:Z("integrations:templates:no-drafts-title"),subtitle:(0,a.jsxs)(m.Z,{component:"span",sx:{display:"flex",justifyContent:"center",alignItems:"center",gap:"4px"},children:[Z("integrations:templates:no-drafts-subtitle"),(0,a.jsx)(y.Z,{mode:"text",sx:t=>({textDecoration:"underline",color:t.palette.primary.main}),label:Z("integrations:templates:template"),onClick:()=>{E(0)}})]})})})}],G=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"create";w((0,k.G3)({id:k.xQ.printUICreateEditDraftDialog,config:{mode:e,onSuccess:t=>{I.push("".concat(C,"/templates/").concat(encodeURI(t)),void 0,{shallow:!0})},currentDraft:t}}))};return(0,o.useEffect)(()=>{{let t=t=>{"printui_finished"==t.data?w((0,k.G3)({id:k.xQ.printUIPreviewDraftDialog,config:{jobId:U},onClose:()=>{I.push("".concat(C,"/templates"),void 0,{shallow:!0})}})):"printui_cancel"==t.data&&I.push("".concat(C,"/templates"),void 0,{shallow:!0})};return window.addEventListener("message",t),()=>{window.removeEventListener("message",t)}}},[U]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d(),{children:(0,a.jsx)("title",{children:null==j?void 0:j.title})}),(0,a.jsx)(u.Z,{sx:{p:U?"0":"24px"},children:S?(0,a.jsx)(a.Fragment,{children:" "}):z.hasSession()?U?(0,a.jsx)("iframe",{style:{border:"none"},title:"printui-editor",width:"100%",height:"100%",src:"https://cdn.printui.com/editor/current/index.html?".concat(new URLSearchParams({...(null==A?void 0:null===(x=A.data)||void 0===x?void 0:x.attributes)||{},jobID:U,finishedButtonLabel:"Next",cancelLabel:"Cancel",cancelAlert:"You have unsaved changes. To save your work select âNoâ below and then âNextâ in the toolbar."}))}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b.Z,{navItems:W,value:_,onChange:(t,e)=>{E(e)},sx:t=>({borderBottom:"1px solid ".concat(t.palette.secondary.main)})}),W.map((t,e)=>(0,a.jsx)(u.Z,{role:"tabpanel",hidden:_!==e,sx:{overflow:"auto",p:"24px 0px",maxHeight:"calc(100vh - 140px)"},children:t.component},t.label))]}):(0,a.jsx)(f.Z,{onLogin:()=>{I.push("".concat(C,"/templates"))}})})]})}A.getLayout=(t,e)=>{let{errorCode:n,...o}=e;return 200!=n?(0,a.jsx)(l(),{statusCode:n,title:"Unauthorized"}):(0,a.jsx)(x.Z,{...o,children:t})}},12918:function(t,e,n){t.exports=n(2111)}},function(t){t.O(0,[279,751,760,945,979,706,882,774,888,179],function(){return t(t.s=19026)}),_N_E=t.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.