PageSourceSearch

https://transparencia.portsdebalears.com/_next/static/chunks/pages…/[moduleId]/order-3b2a27792072e6c1.js

js portsdebalears.com collected 2026-09-24 18:38:15 UTC 7,406 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8248],{42498:function(e,t,a){"use strict";a.d(t,{Z:function(){return i}});var n=a(91696);let i=(0,n.Z)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},82122:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/categories/[moduleId]/order",function(){return a(60801)}])},63534:function(e,t,a){"use strict";var n=a(52676),i=a(75271),r=a(1629),s=a(78619),l=a(31985),d=a.n(l),o=a(82187),c=a.n(o),u=a(52073),h=a(75018),p=a(90394);t.Z=e=>{var t,a;let{navClass:l="",inactiveClass:o="",activeClass:m="text-ogovOrange font-bold text-xs",routes:x,isPublicView:f,portalInfo:v,skipSegments:g=[]}=e,b=(0,r.useRouter)(),{t:j,i18n:y}=(0,s.$G)(),N=null==v?void 0:null===(a=v.customization)||void 0===a?void 0:null===(t=a.config)||void 0===t?void 0:t.primary_color,w=N?(0,p.k8)(N):void 0,[_,Z]=(0,i.useState)(null);return(0,i.useEffect)(()=>{if(b){let e=b.asPath.split("/");e.shift();let t=[];e.forEach((e,a)=>{isNaN(parseInt(e))?t.push(e):t[a-1]="".concat(t[a-1],"/").concat(e)});let a=t.filter(e=>"dashboard"!==e),n=a.map((e,a)=>({breadcrumb:"dashboard"===e.split("/")[0]?t[a]:e.split("/")[0],href:"/"+t.slice(0,a+2).join("/"),hidden:g.includes(e.split("/")[0])})),i=n.reduceRight((e,t,a)=>-1!==e||t.hidden?e:a,-1);Z(n.map((e,t)=>({...e,active:t===i})))}},[b]),(0,n.jsxs)("nav",{"aria-label":"breadcrumbs",className:c()("flex flex-col sm:flex-row align-middle font-ptSans text-gray-600 text-xs",l),children:[!f&&(0,n.jsx)(d(),{href:"/dashboard",children:j("common.home")}),x&&x.length>0?(0,n.jsx)(n.Fragment,{children:null==x?void 0:x.map((e,t)=>(0,n.jsxs)("div",{className:"flex items-center",children:[(!f||t>0)&&(0,n.jsx)("span",{className:"inline-flex items-center px-1","aria-hidden":"true",children:(0,n.jsx)(u.Z,{className:"w-3.5 h-3.5 text-gray-400"})}),(0,n.jsx)(d(),{href:e.href,className:c()(t===x.length-1?m:c()(o,"hover:text-gray-900 hover:underline transition-colors")),style:{color:t===x.length-1?w:void 0},children:(0,h.QN)(e.title)})]},t))}):null==_?void 0:_.filter(e=>!e.hidden).map(e=>{var t,a;let i=null===(t=_[0])||void 0===t?void 0:t.breadcrumb.split("?")[0],r=null==e?void 0:e.breadcrumb.split("?")[0],s="".concat(i,".").concat(r,".pageTitle"),l=_.indexOf(e);if(l>=1){let e=null===(a=_[l-1])||void 0===a?void 0:a.breadcrumb.split("?")[0],t="".concat(i,".").concat(e,".").concat(r,".pageTitle");y.exists(t)&&(s=t)}return(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)("span",{className:"inline-flex items-center px-1","aria-hidden":"true",children:(0,n.jsx)(u.Z,{className:"w-3.5 h-3.5 text-gray-400"})}),(0,n.jsx)(d(),{href:null==e?void 0:e.href,className:c()(e.active?m:c()(o,"hover:text-gray-900 hover:underline transition-colors"),"capitalize"),style:{color:e.active?w:void 0},children:j(s)})]},l)})]})}},50924:function(e,t,a){"use strict";var n=a(52676),i=a(75271);let r=(0,i.forwardRef)(function(e,t){let{type:a="submit",className:i,...r}=e;return(0,n.jsx)("button",{ref:t,type:a,className:"\n        ".concat(i,"\n      inline-flex \n      items-center\n      px-3\n      py-3\n      border \n      border-transparent \n      rounded-md \n      font-semibold \n      text-xs\n      text-white\n      uppercase\n      tracking-widest\n      focus:outline-none\n      focus:ring\n      disabled:opacity-25\n      transition  \n      ease-in-out\n      duration-150"),...r})});t.Z=r},79123:function(e,t,a){"use strict";var n=a(52676),i=a(75271),r=a(43374),s=a(75018);let l=(0,i.forwardRef)((e,t)=>(0,n.jsx)(r.JO,{...e,ref:t,disableInteraction:e.item.disableInteraction,disableSorting:e.item.disableInteraction,canHaveChildren:e.item.canHaveChildren,children:(0,n.jsxs)("div",{className:"ms-2",children:[(0,n.jsx)("div",{children:(0,s.QN)(e.item.name)}),(0,n.jsx)("p",{className:"text-xs",children:e.item.url})]})}));l.displayName="TreeItem",t.Z=l},77549:function(e,t,a){"use strict";a.d(t,{Z:function(){return useFetchAllCategories}});var n=a(2054),i=a(75271);function useFetchAllCategories(){let[e,t]=(0,i.useState)([]),[a,r]=(0,i.useState)(),[s,l]=(0,i.useState)(!0);return{data:e,error:a,fetchAllCategories:e=>{n.G.all(e).then(e=>t(e.data.data)).catch(e=>r(e)).finally(()=>l(!1))},isFetching:s}}},60801:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSP:function(){return y}});var n=a(52676),i=a(42474),r=a(78619),s=a(57394),l=a.n(s),d=a(63534),o=a(41501),c=a(34090),u=a(75271),h=a(31785),p=a(1629),m=a(50924),x=a(91750),f=a(77549),v=a(90394),g=a(2054),b=a(43374),j=a(79123);let Order=()=>{(0,i.a)({middleware:["auth"]});let e=(0,p.useRouter)(),{t}=(0,r.$G)(),{alert:a,isOpen:s,showAlert:c}=(0,o.ZP)(),[y,N]=(0,u.useState)(!0),{newNotification:w}=(0,u.useContext)(h.u),{data:_,isFetching:Z,fetchAllCategories:k}=(0,f.Z)(),[C,S]=(0,u.useState)([]),{moduleId:T}=e.query;return(0,u.useEffect)(()=>{!Z&&_.length>0&&(S(_),N(!1))},[_]),(0,u.useEffect)(()=>{k({order:"asc",module_id:T})},[]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l(),{children:(0,n.jsx)("title",{children:t("categories.order.pageTitle")})}),(0,n.jsx)("div",{className:"max-w-screen-2xl mx-auto",children:(0,n.jsxs)("div",{className:"bg-white shadow-sm rounded-lg",children:[(0,n.jsxs)("div",{className:"flex flex-col pt-6 pl-6",children:[(0,n.jsx)("div",{className:"bg-white font-bold text-xl sm:text-2xl text-black",children:t("categories.order.pageTitle")}),(0,n.jsx)("div",{children:(0,n.jsx)(d.Z,{})})]}),(0,n.jsxs)("div",{className:"p-6",children:[s&&a(),Z&&y?(0,n.jsx)(x.g,{}):(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(b.$t,{items:C,onItemsChanged:(e,t)=>{var a,n,i,r,s;((null===(a=t.draggedItem)||void 0===a?void 0:a.type)!=="Link"||(null===(n=t.droppedToParent)||void 0===n?void 0:n.type)!=="Subcategory")&&((null===(i=t.draggedItem)||void 0===i?void 0:i.type)!=="Subcategory"||(null===(r=t.droppedToParent)||void 0===r?void 0:r.type)!=="Category")&&((null===(s=t.draggedItem)||void 0===s?void 0:s.type)!=="Category"||t.droppedToParent)||S(e)},TreeItemComponent:j.Z})}),(0,n.jsx)("div",{className:"mt-4 flex justify-end",children:(0,n.jsx)(m.Z,{onClick:()=>{N(!0),g.G.order({categories:C}).then(()=>{w("success",t("common.successOperation")),e.push("/dashboard/categories/".concat(T))}).catch(e=>{var t;N(!1),(0,v.xg)((null===(t=e.response)||void 0===t?void 0:t.data)||e,null,c)})},className:"bg-ogovOrange",type:"submit",disabled:y,children:y?(0,n.jsx)(x.g,{width:5,height:5}):t("common.save")})})]})]})})]})};Order.getLayout=function(e){return(0,n.jsx)(c.Z,{isTenant:!0,children:e})};var y=!0;t.default=Order},2054:function(e,t,a){"use strict";a.d(t,{G:function(){return i}});var n=a(129);let i={list:(e,t,a)=>n.default.get("/api/v1/categories",{params:{page:e,per_page:t,...a}}),all:e=>n.default.get("/api/v1/categories/index-all",{params:{...e}}),allActive:e=>n.default.get("/api/v1/categories/index-all-active",{params:{...e}}),create:e=>n.default.post("/api/v1/categories",e),update:(e,t)=>
1n.default.put("/api/v1/categories/".concat(t),e),destroy:e=>n.default.delete("/api/v1/categories/".concat(e)),restore:e=>n.default.put("/api/v1/categories/".concat(e,"/restore")),show:e=>n.default.get("/api/v1/categories/".concat(e)),order:e=>n.default.post("/api/v1/categories/updateOrder",e)}}},function(e){e.O(0,[3043,3374,4090,9774,2888,179],function(){return e(e.s=82122)}),_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.