PageSourceSearch

https://ediez.online/_nuxt/CuY7RsVZ.js

js ediez.online collected 2026-09-24 09:52:54 UTC 5,249 bytes, 1 lines download raw bytes

1import{f as U,a as H,ay as K,aF as $,ax as G,aB as Q,aL as W,au as X,r,ap as Y,y as Z,c as a,U as _,a3 as s,a1 as ee,av as R,A as F,l as t,j as D,ac as oe,o as v}from"./CRcF7uU4.js";import{_ as ae}from"./cIsbAL9W.js";import{_ as te}from"./VSgIB3FK.js";import{u as re}from"./DPkUNsL6.js";import"./W6ELcSSt.js";import"./h5aNTaDO.js";import"./BHCx8Mok.js";import"./BjRPZzs_.js";import"./Dc64QQe9.js";const ie={class:"min-h-dvh bg-gray-50 dark:bg-gray-950 flex flex-col",style:{"--detail-search-top":"4rem"}},le={class:"sticky top-0 z-20 bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-800 px-4 py-3"},se={class:"flex items-center justify-between gap-3"},ne={class:"flex flex-col gap-0.5 min-w-0"},ce={class:"text-base font-semibold text-gray-900 dark:text-white truncate"},de=["title"],ue={class:"flex items-center gap-1 shrink-0"},fe={class:"flex-1 px-4 py-4 max-w-6xl xl:max-w-7xl 2xl:max-w-400 mx-auto w-full"},ve={key:0,class:"flex items-center justify-center py-12"},me=["aria-label"],Ce=U({__name:"edit-transformation",setup(pe){const{t:e}=H(),m=K(),i=$(),n=G(),p=Q(),{isKiosk:M}=W(),{createEditorSaveHandler:N,fetchNewInvoiceJson:P}=re(),y=a(()=>m.query.eventId||""),h=a(()=>m.query.ediFormatCode||""),c=a(()=>m.query.retailerCode||void 0),q=a(()=>m.query.mode||""),l=a(()=>q.value==="new"),k=r(!1),g=r(!1),x=r(""),E=r(void 0),u=a(()=>l.value?x.value:h.value),B=a(()=>l.value?"":y.value),w=a(()=>l.value?!!c.value&&k.value:!!y.value&&!!h.value),L=a(()=>l.value&&!k.value&&(g.value||!!c.value)),b=r(void 0),j=a(()=>l.value?e("backoffice.jsonEditor.modal.createInvoiceTitle"):u.value.includes("DESADV")?e("backoffice.jsonEditor.modal.editDespatchTitle"):u.value.includes("IFTMAN")?e("backoffice.jsonEditor.modal.editArrivalNoticeTitle"):u.value.includes("ORDRSP")?e("backoffice.jsonEditor.modal.editOrderResponseTitle"):u.value.includes("creditNote")?e("backoffice.jsonEditor.modal.editCreditNoteTitle"):e("backoffice.jsonEditor.modal.editTitle"));X({title:()=>j.value});const f=r(null),d=r(!0);function O(){d.value=!d.value,f.value?.toggleAllSections?.(d.value)}const V={get value(){return f.value?{updateOriginalDocumentId:o=>f.value?.updateOriginalDocumentId?.(o),updateDocumentFilename:o=>{b.value=o},resetSaving:()=>f.value?.resetSaving?.()}:null}},C=r(!0),S=N({refreshList:()=>Promise.resolve(),jsonEditorModalRef:V,showEditorModal:C});Y(C,o=>{o||T("saved")});function A(){T("cancelled")}function T(o){if(M.value){i.push({path:n("/backoffice/done"),query:{status:o}});return}typeof window<"u"&&window.history.state?.back?i.back():i.replace(n("/backoffice/transformations"))}return Z(async()=>{if(l.value){if(!c.value){p.add({title:e("backoffice.error"),description:e("backoffice.jsonEditor.errors.missingParams"),color:"error",icon:"i-lucide-alert-circle",duration:5e3}),i.replace(n("/backoffice"));return}g.value=!0;try{const o=await P(c.value);if(!o){p.add({title:e("backoffice.jsonEditor.errors.noTemplateFound"),description:e("backoffice.jsonEditor.errors.retailerCannotCreateInvoices",{retailer:c.value}),color:"warning",icon:"i-lucide-alert-triangle",duration:5e3}),i.replace(n("/backoffice"));return}x.value=o.ediFormatCode,E.value=o.json,k.value=!0}catch(o){p.add({title:e("backoffice.error"),description:o instanceof Error?o.message:e("backoffice.jsonEditor.errors.failedToLoadTemplate"),color:"error",icon:"i-lucide-x-circle",duration:5e3}),i.replace(n("/backoffice"))}finally{g.value=!1}return}w.value||(p.add({title:e("backoffice.error"),description:e("backoffice.jsonEditor.errors.missingParams"),color:"error",icon:"i-lucide-alert-circle",duration:5e3}),i.replace(n("/backoffice")))}),(o,be)=>{const I=oe,z=ae,J=te;return v(),_("div",ie,[s("header",le,[s("div",se,[s("div",ne,[s("h1",ce,R(j.value),1),b.value?(v(),_("span",{key:0,class:"text-xs text-gray-500 dark:text-gray-400 font-mono truncate",title:b.value},R(b.value),9,de)):ee("",!0)]),s("div",ue,[F(I,{icon:d.value?"i-lucide-chevrons-down-up":"i-lucide-chevrons-up-down",variant:"ghost",color:"neutral",size:"sm","aria-label":d.value?t(e)("backoffice.jsonEditor.collapseAll"):t(e)("backoffice.jsonEditor.expandAll"),title:d.value?t(e)("backoffice.jsonEditor.collapseAll"):t(e)("backoffice.jsonEditor.expandAll"),onClick:O}
1,null,8,["icon","aria-label","title"]),F(I,{icon:"i-lucide-x",variant:"ghost",color:"neutral",size:"sm","aria-label":t(e)("backoffice.cancel"),onClick:A},null,8,["aria-label"])])])]),s("main",fe,[L.value?(v(),_("div",ve,[s("span",{class:"inline-block h-6 w-6 animate-spin rounded-full border-2 border-gray-300 border-t-gray-700 dark:border-gray-700 dark:border-t-gray-200",role:"status","aria-label":t(e)("backoffice.jsonEditor.loading")},null,8,me)])):w.value?(v(),D(J,{key:2,ref_key:"jsonEditorRef",ref:f,"edi-format-code":u.value,"retailer-code":c.value,"event-id":B.value||void 0,"custom-data":E.value,"submission-mode-toggle":l.value,"show-cancel":"",onCancel:A,onSave:t(S),onSubmit:t(S)},null,8,["edi-format-code","retailer-code","event-id","custom-data","submission-mode-toggle","onSave","onSubmit"])):(v(),D(z,{key:1,color:"error",icon:"i-lucide-alert-circle",title:t(e)("backoffice.error"),description:t(e)("backoffice.jsonEditor.errors.missingParams")},null,8,["title","description"]))])])}}});export{Ce as default};

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.