tocco-admin 3.17.6 → 3.17.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +6 -0
- package/dist/chunk-26335.74f8d237b4e65213f5f5.js +1 -0
- package/dist/chunk-27595.2acd7e12e52842bd54c4.js +1 -0
- package/dist/chunk-31188.b684fb2061591dc5dbce.js +1 -0
- package/dist/chunk-31259.efac6f344cccf290377f.js +99 -0
- package/dist/chunk-34622.0d11b44c9ac000011429.js +1 -0
- package/dist/chunk-35637.7f445d04a34333d5c7ed.js +1 -0
- package/dist/chunk-37148.d4a12deb7e350d282064.js +1 -0
- package/dist/chunk-62618.8ad5b4f0b069b5a5733f.js +1 -0
- package/dist/chunk-68028.4fb803d21d0076b01410.js +1 -0
- package/dist/chunk-69069.3bac5c5f63a943fb901a.js +1 -0
- package/dist/chunk-75085.79f8b8b3350cc5e9b7cb.js +1 -0
- package/dist/chunk-77447.88b894127bab62e30caa.js +1 -0
- package/dist/chunk-83985.b7e7b94a16e3a47ef9b3.js +1 -0
- package/dist/chunk-89666.f89f48a3d59441b88447.js +1 -0
- package/dist/chunk-89778.c2e6511f52a6ac2c1b40.js +1 -0
- package/dist/chunk-95229.b3486f836a149a796699.js +1 -0
- package/dist/chunk-99372.7ba43726331194b5c670.js +1 -0
- package/dist/chunk-actions.a5e367ffa6eca07a3e99.js +1 -0
- package/dist/chunk-admin-login-form.99b544336cd4935409c0.js +1 -0
- package/dist/chunk-code-editor.b5585797aec4e2d47cba.js +1 -0
- package/dist/chunk-docs-actions.cb9ef87c231f53a66378.js +1 -0
- package/dist/chunk-html-editor.83c57fe15f0274704578.js +6 -0
- package/dist/chunk-phone-formatter.2d4c7d1ca2b655399883.js +1 -0
- package/dist/chunk-vendor-icons.c66ae5d269d60434aa4b.js +1 -0
- package/dist/index.js +17 -15
- package/jest.config.js +2 -2
- package/package.json +2 -1
- package/dist/chunk-15006.39f94a50697be97c9831.js +0 -1
- package/dist/chunk-19592.992b24f067a5c0f12a8e.js +0 -1
- package/dist/chunk-26528.ef4788bc998faa3f54ca.js +0 -1
- package/dist/chunk-27136.2c36f3c77a56b86f416d.js +0 -1
- package/dist/chunk-33050.a411588c6eae538a9624.js +0 -1
- package/dist/chunk-46187.ac38acbd848b23a2beb2.js +0 -1
- package/dist/chunk-55348.7559537443f168d57582.js +0 -1
- package/dist/chunk-57554.2b7e1fc15d398c56a795.js +0 -1
- package/dist/chunk-591.b32029fe00edd0338042.js +0 -1
- package/dist/chunk-59899.45b9bffbb769ce64c70d.js +0 -1
- package/dist/chunk-68389.572b4458a27418cb9092.js +0 -1
- package/dist/chunk-71306.cd0060a637da70f30042.js +0 -1
- package/dist/chunk-86275.74b17f85b8fd49a09ee7.js +0 -1
- package/dist/chunk-92789.292337248336d8d32a47.js +0 -1
- package/dist/chunk-9738.25ce05ae72129f1f8d16.js +0 -99
- package/dist/chunk-97536.c9cab9653c7754ea895a.js +0 -1
- package/dist/chunk-97931.1467f85890a99ae60464.js +0 -1
- package/dist/chunk-actions.f060ea4f204fdb761090.js +0 -1
- package/dist/chunk-admin-login-form.2b47d5a86bc59422e97d.js +0 -1
- package/dist/chunk-code-editor.c7d8953d16ef17824643.js +0 -1
- package/dist/chunk-docs-actions.ca197551496ae64f6a46.js +0 -1
- package/dist/chunk-html-editor.e6715086020fe165b5f3.js +0 -6
- package/dist/chunk-phone-formatter.50199e325bcd29d91e58.js +0 -1
- package/dist/chunk-vendor-icons.6e198da15aa72bd8f4c8.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunktocco_admin=this.webpackChunktocco_admin||[]).push([[27595],{6440(e,n,t){t.d(n,{AS:()=>l,D4:()=>s,DG:()=>k,Fv:()=>f,GY:()=>A,Hw:()=>a,J9:()=>i,Kg:()=>g,LY:()=>y,V7:()=>u,W4:()=>d,W_:()=>b,Wc:()=>v,bV:()=>p,dD:()=>o,hT:()=>m,p6:()=>c,rk:()=>h,vB:()=>x,w4:()=>r});var r="entityTemplate/UNLOAD_VIEW",o="entityTemplate/FETCH_ENTITY_TEMPLATES",i="entityTemplate/SET_ENTITY_TEMPLATES",a="entityTemplate/SET_ACTIVE_ENTITY_TEMPLATE",c="entityTemplate/FETCH_TEMPLATE_VALUES",l="entityTemplate/SET_ACTIVE_TEMPLATE_DEFAULT_VALUES",s="entityTemplate/SET_ENTITY",d="entityTemplate/CREATE_ENTITY_TEMPLATE",u="entityTemplate/DELETE_ENTITY_TEMPLATE",p="entityTemplate/UPDATE_ENTITY_TEMPLATE",y=function(){return{type:r}},f=function(e){return{type:o,payload:{entityName:e}}},h=function(e,n){return{type:i,payload:{entityName:e,entityTemplates:n}}},A=function(e){return{type:a,payload:{activeEntityTemplate:e}}},m=function(e,n){return{type:c,payload:{entityName:e,templateId:n}}},g=function(e){return{type:l,payload:{activeTemplateDefaultValues:e}}},b=function(e){return{type:s,payload:{entity:e}}},v=function(e,n,t,r,o){return{type:d,payload:{entityName:e,label:n,entity:t,onSuccess:r,onError:o}}},k=function(e,n,t){return{type:u,payload:{templateKey:e,entityName:n,navigationStrategy:t}}},x=function(e,n,t,r){return{type:p,payload:{activeEntityTemplate:e,entity:n,onSuccess:t,onError:r}}}},59345(e,n,t){t.d(n,{AM:()=>J,BQ:()=>$,L1:()=>U,Lv:()=>Z,MD:()=>X,Mu:()=>F,PQ:()=>Q,Sj:()=>W,Xn:()=>z,a:()=>V,lt:()=>Y,xj:()=>q});var r,o,i,a,c,l,s,d,u,p,y,f,h,A,m,g,b,v,k,x,w,E,T=t(57528),S=t(39589),N=t(51510),C=t(24076),j=t(37474),O=t(57541),L=t(15627),P="24px",I="11px",D="10px",M="18px",_=O.A.space(1),B=function(e){return"dark"===e.theme.name?L.A.color("backgroundPill")(e):L.A.color("backgroundBody")(e)},H=function(e){return"dark"===e.theme.name?L.A.color("backgroundPillHover")(e):L.A.color("backgroundBody")(e)},R=L.A.color("signal.info"),K=function(e){return(0,S.jh)(.09,R(e),B(e))},F=N.Ay.div.withConfig({displayName:"StyledTree"})(r||(r=(0,T.A)(["\n ","\n display: flex;\n flex-direction: column;\n width: 100%;\n gap: ",";\n"])),(0,j.A)(),D),Y=N.Ay.div.withConfig({displayName:"StyledTreeDivider"})(o||(o=(0,T.A)(["\n flex-shrink: 0;\n height: 0;\n border-top: 2px solid ",";\n width: calc(100% - "," - ",");\n margin-left: ",";\n margin-right: ",";\n box-sizing: border-box;\n"])),H,_,_,_,_),U=N.Ay.div.withConfig({displayName:"StyledTreeNodeWrapper"})(i||(i=(0,T.A)(["\n display: flex;\n align-items: stretch;\n position: relative;\n min-height: 36px;\n scroll-margin: "," 0;\n"])),O.A.space(2.5)),V=N.Ay.div.withConfig({displayName:"StyledTreeIndent"})(a||(a=(0,T.A)(["\n display: flex;\n align-items: stretch;\n flex-shrink: 0;\n"]))),z=N.Ay.span.withConfig({displayName:"StyledTreeConnector"})(c||(c=(0,T.A)(["\n display: flex;\n width: ",";\n position: relative;\n flex-shrink: 0;\n z-index: 0;\n\n ","\n"])),P,(function(e){var n=e.showVertical,t=e.isCurrentLevel,r=e.isLast,o=e.isFirst;if(t){var i=o?"calc(-".concat(D," - ").concat(M,")"):"calc(-".concat(D,")"),a=o?"".concat(D," + ").concat(M):D;return(0,N.AH)(l||(l=(0,T.A)(["\n &:before {\n content: '';\n position: absolute;\n left: ",";\n top: ",";\n height: ",";\n width: 2px;\n background-color: ",";\n }\n\n &:after {\n content: '';\n position: absolute;\n left: ",";\n top: 50%;\n transform: translateY(-50%);\n width: calc("," - ",");\n height: 2px;\n background-color: ",";\n }\n "])),I,i,r?"calc(50% + ".concat(a,")"):"calc(100% + ".concat(a,")"),H,I,P,I,H)}return n?(0,N.AH)(s||(s=(0,T.A)(["\n &:before {\n content: '';\n position: absolute;\n left: ",";\n top: calc(-",");\n height: calc(100% + ",");\n width: 2px;\n background-color: ",";\n }\n "])),I,D,D,H):""})),W=N.Ay.div.withConfig({displayName:"StyledTreeNode"})(d||(d=(0,T.A)(["\n display: flex;\n align-items: center;\n padding: "," ",";\n cursor: pointer;\n border-radius: ",";\n background-color: ",";\n border: none;\n transition: all 0.12s ease;\n user-select: none;\n flex: 1;\n min-width: 0;\n position: relative;\n z-index: 1;\n\n &:focus {\n outline: none;\n box-shadow: none;\n }\n\n &:active:not(:has([data-no-bounce]:active)) {\n transform: scale(0.98);\n }\n\n ","\n\n ","\n\n ","\n\n ","\n\n ","\n\n ","\n"])),O.A.space(-1),O.A.space(-.5),L.A.radii("medium"),B,(function(e){var n=e.isSelected,t=e.isActive,r=e.isHighlighted;return!n&&!t&&!r&&(0,N.AH)(u||(u=(0,T.A)(["\n &:hover {\n background-color: ",";\n color: ",";\n\n && * {\n color: inherit;\n }\n }\n "])),L.A.color("secondaryLight"),L.A.color("paper"))}),(function(e){return e.isSelected&&(0,N.AH)(p||(p=(0,T.A)(["\n background-color: ",";\n color: ",";\n\n * {\n color: inherit !important; /* override Typography.Span etc. */\n }\n "])),L.A.color("secondary"),L.A.color("paper"))}),(function(e){return e.isContext&&(0,N.AH)(y||(y=(0,T.A)(["\n background-color: ",";\n "])),L.A.color("backgroundItemLastOpened"))}),(function(e){var n=e.isRoot,t=e.isSelected;return n&&!t&&(0,N.AH)(f||(f=(0,T.A)(["\n font-weight: ",";\n "])),L.A.fontWeight("bold"))}),(function(e){return e.isHighlighted&&(0,N.AH)(h||(h=(0,T.A)(["\n && {\n background-color: ",";\n box-shadow: inset 0 0 0 2px ",";\n }\n "])),K,R)}),(function(e){return e.isActive&&(0,N.AH)(A||(A=(0,T.A)(["\n && {\n background-color: ",";\n color: ",";\n box-shadow: inset 0 0 0 2px ",";\n\n * {\n color: inherit !important; /* override Typography.Span, chevron icon etc. */\n }\n }\n "])),L.A.color("secondaryLight"),L.A.color("paper"),R)})),Q=N.Ay.div.withConfig({displayName:"StyledTreeNodeContent"})(m||(m=(0,T.A)(["\n display: flex;\n align-items: center;\n width: 100%;\n gap: ",";\n min-width: 0;\n color: inherit;\n"])),O.A.space(-1.5)),G=(0,N.AH)(g||(g=(0,T.A)(["\n font-size: ",";\n flex-shrink: 0;\n color: inherit;\n background-color: transparent;\n\n &:hover {\n background-color: ",";\n color: "," !important; /* override Typography.Span etc. */\n }\n\n ","\n"])),O.A.font(0),L.A.color("secondary"),L.A.color("text"),(function(e){return e.isSelected&&(0,N.AH)(b||(b=(0,T.A)(["\n color: inherit;\n\n &:hover {\n color: "," !important; /* override Typography.Span etc. */\n background-color: "," !important; /* override Ball */\n }\n "])),L.A.color("text"),L.A.color("paper"))})),q=(0,N.Ay)(C.A).withConfig({displayName:"StyledExpandIcon"})(v||(v=(0,T.A)(["\n ","\n"])),G),X=N.Ay.span.withConfig({displayName:"StyledTreeNodeLabel"})(k||(k=(0,T.A)(["\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: ",";\n line-height: 1.4;\n color: inherit;\n"])),O.A.font(-.5)),J=N.Ay.span.withConfig({displayName:"StyledNodeElement"})(x||(x=(0,T.A)(["\n display: flex;\n align-items: center;\n gap: ",";\n min-width: 0;\n margin-left: auto;\n"])),O.A.space(-1.5)),Z=(0,N.Ay)(C.A).withConfig({displayName:"StyledAddButton"})(w||(w=(0,T.A)(["\n ","\n margin-left: auto;\n opacity: 0;\n transition: opacity 0.12s ease;\n\n @media (hover: none), (width <= 768px) {\n opacity: ",";\n }\n\n ",":hover & {\n opacity: 1;\n }\n"])),G,(function(e){return e.isSelected?1:.6}),W),$=N.Ay.div.withConfig({displayName:"StyledSkeletonNode"})(E||(E=(0,T.A)(["\n display: flex;\n align-items: center;\n padding: "," ",";\n border-radius: ",";\n background: linear-gradient(\n 90deg,\n "," 0%,\n "," 50%,\n "," 100%\n );\n background-size: 200% 100%;\n animation: shimmer 1.5s infinite;\n border: 1px dashed ",";\n flex: 1;\n min-width: 0;\n opacity: 0.7;\n position: relative;\n z-index: 1;\n\n @keyframes shimmer {\n 0% {\n background-position: 200% 0;\n }\n\n 100% {\n background-position: -200% 0;\n }\n }\n\n "," {\n color: ",";\n font-style: italic;\n }\n"])),O.A.space(-1),O.A.space(-.5),L.A.radii("medium"),L.A.color("backgroundBody"),L.A.color("border"),L.A.color("backgroundBody"),L.A.color("border"),X,L.A.color("textLight"))},55406(e,n,t){var r=t(60436),o=t(64467),i=t(5544),a=t(4883),c=t(87046),l=t(59345),s=t(14369),d=t(74848);function u(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function p(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?u(Object(t),!0).forEach((function(n){(0,o.A)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):u(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}const y=function(e){var n=e.data,t=e.selectedKey,o=e.contextKey,u=e.onNodeClick,y=e.onAddClick,f=e.renderLabel,h=e.defaultExpandedKeys,A=e.expandAll,m=void 0===A||A,g=e.skeletonNode,b=e.expandedKeys,v=e.onExpandedKeysChange,k=e.NodeElement,x=e.activeKey,w=e.highlightedKeys,E=(0,c.tz)(),T=function(e){return E.formatMessage({id:e})},S=(0,a.useState)((function(){return m&&n?new Set((0,s.B)(n)):new Set(h||[])})),N=(0,i.A)(S,2),C=N[0],j=N[1],O=(0,a.useRef)(null),L=(0,a.useMemo)((function(){return new Set(w||[])}),[w]),P=void 0!==b,I=(0,a.useMemo)((function(){return P?new Set(b):C}),[P,b,C]),D=(0,a.useCallback)((function(e){v?v(Array.from(e)):j(e)}),[v]);(0,a.useEffect)((function(){if(t&&O.current){var e=Array.from(O.current.querySelectorAll("[data-tree-node-key]")).find((function(e){return e.getAttribute("data-tree-node-key")===t})),n=setTimeout((function(){null==e||e.scrollIntoView({block:"nearest",behavior:"smooth"})}),150);return function(){return clearTimeout(n)}}}),[t]);var M=(0,a.useCallback)((function(e){var n=new Set(I);n.has(e)?n.delete(e):n.add(e),D(n)}),[I,D]),_=(0,a.useCallback)((function(e,n){e.pk&&(null==u||u(e.pk,e,n))}),[u]),B=(0,a.useCallback)((function(e){return function(){M(e.key)}}),[M]),H=(0,a.useCallback)((function(e,n){var t;if("Enter"===n.key||" "===n.key)n.preventDefault(),_(e,n);else if("ArrowRight"===n.key&&null!==(t=e.children)&&void 0!==t&&t.length){n.preventDefault();var r=new Set(I);r.add(e.key),D(r)}else if("ArrowLeft"===n.key){n.preventDefault();var o=new Set(I);o.delete(e.key),D(o)}}),[_,I,D]),R=(0,a.useMemo)((function(){var e=[],t=function(n){var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4?arguments[4]:void 0;n.forEach((function(l,s){var d,u,y=c?"".concat(c.key,"-").concat(l.key):l.key,f=Boolean(g&&g.parentKey===l.key),h=I.has(y),A=Boolean(null===(d=l.children)||void 0===d?void 0:d.length),m=((null===(u=l.children)||void 0===u?void 0:u.length)||0)+(f?1:0),b=o&&0===s,v=s===n.length-1,k=p(p({},l),{},{key:y,pk:l.key,level:i,isLast:v,isFirst:b,isRoot:0===i,ancestorIsLast:(0,r.A)(a),isExpanded:h,hasChildren:A});if(e.push(k),f&&g){var x=1===m;e.push({key:"skeleton-".concat(y),label:g.label||"",level:i+1,isLast:x,isFirst:!0,isRoot:!1,ancestorIsLast:[].concat((0,r.A)(a),[v]),isExpanded:!1,hasChildren:!1,isSkeleton:!0})}l.children&&h&&t(l.children,!f,i+1,[].concat((0,r.A)(a),[v]),k)}))},o=[];return Array.isArray(n)?o=n:n&&(o=[n]),t(o,!0),e}),[n,I,g]),K=(0,a.useCallback)((function(e){return function(){e.pk&&(null==y||y(e.pk,e))}}),[y]),F=(0,a.useCallback)((function(e){return e.level>0?(0,d.jsx)(l.a,{children:Array.from({length:e.level}).map((function(n,t){var r=t===e.level-1,o=!1===(r?e.isLast:e.ancestorIsLast[t+1]);return(0,d.jsx)(l.Xn,{isLast:e.isLast&&r,isFirst:e.isFirst&&r,isCurrentLevel:r,showVertical:o&&!r},t)}))}):null}),[]);return(0,d.jsx)(l.Mu,{ref:O,role:"tree","aria-label":T("client.admin.tree.treeNavigation"),"data-cy":"tree",children:R.map((function(e){var n=t===e.pk,r=!n&&o===e.pk,i=Boolean(e.pk)&&x===e.pk,a=!i&&Boolean(e.pk)&&L.has(e.pk);return e.isSkeleton?(0,d.jsxs)(l.L1,{children:[F(e),(0,d.jsx)(l.BQ,{children:(0,d.jsx)(l.MD,{children:e.label||""})})]},e.key):(0,d.jsxs)(l.L1,{"data-cy":"tree-node","data-tree-node-key":e.pk,"data-tree-node-level":e.level,children:[F(e),(0,d.jsx)(l.Sj,{role:"treeitem","aria-selected":n,"aria-expanded":e.hasChildren?e.isExpanded:void 0,"data-active":i||void 0,tabIndex:0,onClick:function(n){return _(e,n)},onKeyDown:function(n){return H(e,n)},isSelected:n,isContext:r,isRoot:e.isRoot,isActive:i,isHighlighted:a,children:(0,d.jsxs)(l.PQ,{children:[e.hasChildren&&(0,d.jsx)("span",{"data-no-bounce":!0,onClick:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()},children:(0,d.jsx)(l.xj,{"data-cy":"tree-node-toggle",icon:e.isExpanded?"chevron-down":"chevron-right",onClick:B(e),title:e.isExpanded?T("client.admin.tree.collapse"):T("client.admin.tree.expand"),isSelected:n})}),(0,d.jsx)(l.MD,{"data-cy":"tree-node-label",children:f?f(e):e.label||e.display||e.key}),y&&(0,d.jsx)("span",{"data-no-bounce":!0,onClick:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()},children:(0,d.jsx)(l.Lv,{"data-cy":"tree-node-add",icon:"plus",onClick:K(e),title:T("client.admin.tree.addChild"),isSelected:n})}),k&&(0,d.jsx)(l.AM,{"data-no-bounce":!0,onClick:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()},children:(0,d.jsx)(k,{nodePk:e.pk||""})})]})})]},e.key)}))})};t.d(n,["A",0,y])},14369(e,n,t){t.d(n,{B:()=>o,u:()=>r});var r=function(e,n){if(null==n||!n.length)return!1;var t=e.split("/").filter(Boolean);if(t.length<6)return!1;var r=t[t.length-3];return n.includes(r)},o=function(e){var n=[],t=function(e,r){var o;if(null!==(o=e.children)&&void 0!==o&&o.length){var i=r?"".concat(r,"-").concat(e.key):e.key;n.push(i),e.children.forEach((function(e){return t(e,i)}))}};e&&(Array.isArray(e)?e:[e]).forEach((function(e){return t(e)}));return n}},76297(e,n,t){t.d(n,{A:()=>x});var r=t(60436),o=t(5544),i=t(54756),a=t(69917),c=t(76792),l=t(28449),s=t(58695),d=t(90785),u=i.mark(m),p=i.mark(g),y=i.mark(b),f=i.mark(v),h=i.mark(k),A=function(e){if(!c.A.isInAdminEmbedded())throw new Error("Only admin paths are supported");var n=l.A.extractParamsFromPath("/e/:entity{/:key}?{/:relation}*/:view(list|detail|edit|create|relations|action){/:actionId}?",e),t=l.A.extractParamsFromPath("/e/action/:actionId",e);return n||t};function m(e,n){var t,r,o,c;return i.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(t=e.model.paths[n]){i.next=1;break}return r={type:"list",error:{relationName:n,entityName:e.model.name}},i.abrupt("return",[r,!0]);case 1:return o=t.targetEntity,i.next=2,(0,a.T1)(s.A.fetchModel,o);case 2:return c=i.sent,i.abrupt("return",[{type:"list",model:c,relationName:n,parent:e},!1]);case 3:case"end":return i.stop()}}),u)}function g(e,n){var t,r,c,l,d,u,y,f,h,A,g,b;return i.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:t=e.relation||[],r=[],c=0;case 1:if(!(c<t.length)){i.next=9;break}if(l=t[c],d=r.length>0?r[r.length-1]:n,c%2!=0){i.next=4;break}return i.next=2,(0,a.T1)(m,d,l);case 2:if(u=i.sent,y=(0,o.A)(u,2),f=y[0],h=y[1],r.push(f),!h){i.next=3;break}return i.abrupt("return",r);case 3:i.next=8;break;case 4:return A=l,g=d.model,i.next=5,(0,a.T1)(s.A.entityExists,g.name,A);case 5:if(!i.sent){i.next=7;break}return i.next=6,(0,a.T1)(s.A.fetchDisplay,g.name,A);case 6:b=i.sent,r.push({type:"detail",model:g,key:A,display:b,relationName:d.relationName,parent:d.parent}),i.next=8;break;case 7:return r.push({type:"detail",error:{entityName:g.name,key:A}}),i.abrupt("return",[r,!0]);case 8:c++,i.next=1;break;case 9:return i.abrupt("return",[r,!1]);case 10:case"end":return i.stop()}}),p)}function b(e){return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=1,(0,a.T1)(s.A.fetchModel,e.entity);case 1:return n.abrupt("return",n.sent);case 2:return n.prev=2,n.catch(0),n.abrupt("return",void 0);case 3:case"end":return n.stop()}}),y,null,[[0,2]])}function v(e,n){var t;return i.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=1,(0,a.T1)(s.A.fetchDisplay,e.name,n);case 1:return t=r.sent,r.abrupt("return",{type:"detail",key:n,model:e,display:t});case 2:case"end":return r.stop()}}),f)}function k(e,n){var t,c,l,u,p,y,f,A,k,x,w,E,T,S,N,C,j,O,L,P,I,D,M;return i.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=1,(0,a.T1)(b,e);case 1:if(t=i.sent){i.next=2;break}return i.abrupt("return",[{type:"list",error:{entityName:e.entity}}]);case 2:if(c=[{type:"list",model:t}],!e.key){i.next=7;break}return i.next=3,(0,a.T1)(s.A.entityExists,t.name,e.key);case 3:if(i.sent){i.next=4;break}return c.push({type:"detail",error:{entityName:t.label,key:e.key}}),i.abrupt("return",c);case 4:return i.next=5,(0,a.T1)(v,t,e.key);case 5:if(l=i.sent,c.push(l),!e.relation){i.next=7;break}return i.next=6,(0,a.T1)(g,e,l);case 6:if(u=i.sent,p=(0,o.A)(u,2),y=p[0],f=p[1],c.push.apply(c,(0,r.A)(y)),!f){i.next=7;break}return i.abrupt("return",c);case 7:if("create"!==e.view){i.next=8;break}A=c[c.length-1],k=c[c.length-2],c.push({type:"create",model:A.model,parent:k,relationName:A.relationName}),i.next=13;break;case 8:if(!e.actionId){i.next=13;break}if(!n){i.next=12;break}if(x=n.selection,E=(w=void 0===x?{}:x).type,T=w.count,S=w.entityName,N=w.ids,C=n.parent,j=c[c.length-1],E!==d.A.selectionTypes.ID||1!==T||"list"!==j.type&&j.model.name===S){i.next=12;break}if(!C||"list"===j.type){i.next=10;break}return i.next=9,(0,a.T1)(m,j,C.relationName);case 9:if(O=i.sent,L=(0,o.A)(O,2),P=L[0],I=L[1],c.push(P),!I){i.next=10;break}return i.abrupt("return",c);case 10:return D=N[0],i.next=11,(0,a.T1)(v,{name:S},D);case 11:M=i.sent,c.push(M);case 12:c.push({type:"action",actionId:e.actionId});case 13:return i.abrupt("return",c);case 14:case"end":return i.stop()}}),h)}const x={getPathInfo:A,loadRouteInfo:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i.mark((function t(){var r;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,(0,a.T1)(A,e);case 1:if(null!==(r=t.sent)){t.next=2;break}return t.abrupt("return",[]);case 2:if(!r.entity){t.next=4;break}return t.next=3,(0,a.T1)(k,r,n);case 3:return t.abrupt("return",t.sent);case 4:if(!r.actionId){t.next=5;break}return t.abrupt("return",[{type:"action",actionId:r.actionId}]);case 5:return t.abrupt("return",[]);case 6:case"end":return t.stop()}}),t)}))()}}},90785(e,n,t){t.d(n,{A:()=>y});var r=t(5556);const o={ID:"ID",QUERY:"QUERY"},i=r.shape({entityName:r.string,ids:function(e,n,t){if(e.selection&&e.selection.type===o.ID&&!e.selection[n])return new Error("Selection.ids prop not defined. Component: ".concat(t,"'."))},query:function(e,n,t){if(e.selection&&e.selection.type===o.QUERY&&!e.selection[n])return new Error("Selection.query prop not defined. Component: ".concat(t,"'."))},type:r.oneOf(Object.keys(o)),count:r.number});var a=t(64467),c=t(54756),l=t(69917),s=c.mark(p);function d(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function u(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?d(Object(t),!0).forEach((function(n){(0,a.A)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function p(e,n){var t,r;return c.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(t=e.entityName,e.type!==o.QUERY){i.next=2;break}return i.next=1,(0,l.T1)(n,e.entityName,u({},e.query));case 1:return r=i.sent,i.abrupt("return",{entityName:t,keys:r.map((function(e){return e.key}))});case 2:return i.abrupt("return",{entityName:t,keys:e.ids});case 3:case"end":return i.stop()}}),s)}const y={getEntities:p,getSingleKey:function(e,n){if(e.entityName!==n)throw new Error("Only selection of ".concat(n," supported"));if("ID"!==e.type)throw new Error("Only ID selection type supported");if(!e.ids||1!==e.ids.length)throw new Error("Exactly one ".concat(n," must be selected"));return e.ids[0]},propType:i,selectionTypes:o}},72581(e,n,t){var r=t(52662),o=t(22866),i=t(66788),a=t(74848);const c=function(e){var n=e.condition,t=void 0===n?o.A.condition.BASE:n,c=e.title,l=e.children,s=e.meta;return(0,a.jsxs)(i.A,{condition:t,children:[c&&(0,a.jsx)(r.Ay.H5,{children:c}),l,s&&(0,a.jsx)(r.Ay.Small,{children:s})]})};t.d(n,["A",0,c])},66788(e,n,t){t.d(n,{A:()=>y});var r,o=t(57528),i=t(64467),a=t(51510),c=t(77231),l=t(26513),s=t(22866),d=t(57541),u=[s.A.condition.BASE,s.A.condition.INFO,s.A.condition.DANGER,s.A.condition.SUCCESS,s.A.condition.WARNING],p=(0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)({},s.A.condition.BASE,l.t7.color("signal.neutral")),s.A.condition.DANGER,l.t7.color("signal.dangerLight")),s.A.condition.SUCCESS,l.t7.color("signal.successLight")),s.A.condition.WARNING,l.t7.color("signal.warningLight")),s.A.condition.INFO,l.t7.color("signal.infoLight")),y=a.Ay.div.withConfig({displayName:"StyledSignalBox"})(r||(r=(0,o.A)(["\n && {\n background-color: ",";\n padding: "," ",";\n border-radius: ",";\n\n &:not(:last-child) {\n margin-bottom: ",";\n }\n\n * {\n color: #000; /* black in all themes */\n }\n\n "," {\n margin-right: ",";\n }\n }\n"])),(function(e){var n=e.condition;return p[u.includes(n)?n:s.A.condition.INFO]}),d.A.space(-1),d.A.space(-.3),l.t7.radii("statusLabel"),d.A.space(-1),c.i,d.A.space(-1));y.propTypes={condition:s.A.oneOfPropTypeAndCompletelyMapped(u,p)}},2067(e,n,t){t.d(n,{l:()=>c});var r=t(5544),o=t(4883),i=function(){return Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)},a=function(){return Math.max(document.documentElement.clientWidth||0,window.innerWidth||0)},c=function(){var e=(0,o.useState)({width:a(),height:i()}),n=(0,r.A)(e,2),t=n[0],c=n[1];return(0,o.useEffect)((function(){var e=function(){c({width:a(),height:i()})};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]),t}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(this.webpackChunktocco_admin=this.webpackChunktocco_admin||[]).push([[31188],{25212(r,t,e){"use strict";e.d(t,{A:()=>n});const n={removeFromQuery:function(r){var t=new URL(location.href);t.searchParams.delete(r),window.history.replaceState(null,"",t)}}},27185(r,t,e){var n=e(38859),o=e(15325),c=e(29905),i=e(34932),a=e(27301),u=e(19219),s=Math.min;r.exports=function(r,t,e){for(var p=e?c:o,f=r[0].length,l=r.length,h=l,v=Array(l),O=1/0,b=[];h--;){var y=r[h];h&&t&&(y=i(y,a(t))),O=s(y.length,O),v[h]=!e&&(t||f>=120&&y.length>=120)?new n(h&&y):void 0}y=r[0];var g=-1,d=v[0];r:for(;++g<f&&b.length<O;){var j=y[g],w=t?t(j):j;if(j=e||0!==j?j:0,!(d?u(d,w):p(b,w,e))){for(h=l;--h;){var m=v[h];if(!(m?u(m,w):p(r[h],w,e)))continue r}d&&d.push(w),b.push(j)}}return b}},80741(r,t,e){var n=e(83693);r.exports=function(r){return n(r)?r:[]}},5287(r,t,e){var n=e(34932),o=e(27185),c=e(69302),i=e(80741),a=c((function(r){var t=n(r,i);return t.length&&t[0]===r[0]?o(t):[]}));r.exports=a},20135(r,t,e){"use strict";e.r(t);var n=e(64467),o=e(77447),c=e(53480),i=e(91450),a=e(74848);function u(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.push.apply(e,n)}return e}function s(r){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?u(Object(e),!0).forEach((function(t){(0,n.A)(r,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):u(Object(e)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}))}return r}const p=function(r){return(0,a.jsx)(o.A,s(s({},r),{},{listApp:c.Ay,docsApp:i.default}))};e.d(t,["default",0,p])}}]);
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
(this.webpackChunktocco_admin=this.webpackChunktocco_admin||[]).push([[31259],{73916(e,t,n){var r=n(43360),i=n(30641),o=n(15389);e.exports=function(e,t){var n={};return t=o(t,3),i(e,(function(e,i,o){r(n,i,t(e,i,o))})),n}},71764(e,t,n){"use strict";n.d(t,{A:()=>O});var r=n(4883),i=n.n(r),o=n(5556),a=n.n(o),s="undefined"!=typeof window?window:null,l=null===s,c=l?void 0:s.document,u="addEventListener",d="removeEventListener",h="getBoundingClientRect",f="_a",m="_b",p="_c",g="horizontal",v=function(){return!1},y=l?"calc":["","-webkit-","-moz-","-o-"].filter((function(e){var t=c.createElement("div");return t.style.cssText="width:"+e+"calc(9px)",!!t.style.length})).shift()+"calc",_=function(e){return"string"==typeof e||e instanceof String},S=function(e){if(_(e)){var t=c.querySelector(e);if(!t)throw new Error("Selector "+e+" did not match a DOM element");return t}return e},w=function(e,t,n){var r=e[t];return void 0!==r?r:n},b=function(e,t,n,r){if(t){if("end"===r)return 0;if("center"===r)return e/2}else if(n){if("start"===r)return 0;if("center"===r)return e/2}return e},z=function(e,t){var n=c.createElement("div");return n.className="gutter gutter-"+t,n},R=function(e,t,n){var r={};return _(t)?r[e]=t:r[e]=y+"("+t+"% - "+n+"px)",r},E=function(e,t){var n;return(n={})[e]=t+"px",n};const T=function(e,t){if(void 0===t&&(t={}),l)return{};var n,r,i,o,a,y,_=e;Array.from&&(_=Array.from(_));var T=S(_[0]).parentNode,x=getComputedStyle?getComputedStyle(T):null,C=x?x.flexDirection:null,O=w(t,"sizes")||_.map((function(){return 100/_.length})),L=w(t,"minSize",100),k=Array.isArray(L)?L:_.map((function(){return L})),A=w(t,"maxSize",1/0),M=Array.isArray(A)?A:_.map((function(){return A})),D=w(t,"expandToMin",!1),I=w(t,"gutterSize",10),P=w(t,"gutterAlign","center"),F=w(t,"snapOffset",30),N=Array.isArray(F)?F:_.map((function(){return F})),W=w(t,"dragInterval",1),U=w(t,"direction",g),H=w(t,"cursor",U===g?"col-resize":"row-resize"),$=w(t,"gutter",z),j=w(t,"elementStyle",R),V=w(t,"gutterStyle",E);function B(e,t,r,i){var o=j(n,t,r,i);Object.keys(o).forEach((function(t){e.style[t]=o[t]}))}function q(){return y.map((function(e){return e.size}))}function Y(e){return"touches"in e?e.touches[0][r]:e[r]}function K(e){var t=y[this.a],n=y[this.b],r=t.size+n.size;t.size=e/this.size*r,n.size=r-e/this.size*r,B(t.element,t.size,this[m],t.i),B(n.element,n.size,this[p],n.i)}function G(e){var n,r=y[this.a],i=y[this.b];this.dragging&&(n=Y(e)-this.start+(this[m]-this.dragOffset),W>1&&(n=Math.round(n/W)*W),n<=r.minSize+r.snapOffset+this[m]?n=r.minSize+this[m]:n>=this.size-(i.minSize+i.snapOffset+this[p])&&(n=this.size-(i.minSize+this[p])),n>=r.maxSize-r.snapOffset+this[m]?n=r.maxSize+this[m]:n<=this.size-(i.maxSize-i.snapOffset+this[p])&&(n=this.size-(i.maxSize+this[p])),K.call(this,n),w(t,"onDrag",v)(q()))}function Z(){var e=y[this.a].element,t=y[this.b].element,r=e[h](),a=t[h]();this.size=r[n]+a[n]+this[m]+this[p],this.start=r[i],this.end=r[o]}function J(e){var t=function(e){if(!getComputedStyle)return null;var t=getComputedStyle(e);if(!t)return null;var n=e[a];return 0===n?null:n-=U===g?parseFloat(t.paddingLeft)+parseFloat(t.paddingRight):parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)}(T);if(null===t)return e;if(k.reduce((function(e,t){return e+t}),0)>t)return e;var n=0,r=[],i=e.map((function(i,o){var a=t*i/100,s=b(I,0===o,o===e.length-1,P),l=k[o]+s;return a<l?(n+=l-a,r.push(0),l):(r.push(a-l),a)}));return 0===n?e:i.map((function(e,i){var o=e;if(n>0&&r[i]-n>0){var a=Math.min(n,r[i]-n);n-=a,o=e-a}return o/t*100}))}function X(){var e=this,n=y[e.a].element,r=y[e.b].element;e.dragging&&w(t,"onDragEnd",v)(q()),e.dragging=!1,s[d]("mouseup",e.stop),s[d]("touchend",e.stop),s[d]("touchcancel",e.stop),s[d]("mousemove",e.move),s[d]("touchmove",e.move),e.stop=null,e.move=null,n[d]("selectstart",v),n[d]("dragstart",v),r[d]("selectstart",v),r[d]("dragstart",v),n.style.userSelect="",n.style.webkitUserSelect="",n.style.MozUserSelect="",n.style.pointerEvents="",r.style.userSelect="",r.style.webkitUserSelect="",r.style.MozUserSelect="",r.style.pointerEvents="",e.gutter.style.cursor="",e.parent.style.cursor="",c.body.style.cursor=""}function Q(e){if(!("button"in e)||0===e.button){var n=this,r=y[n.a].element,i=y[n.b].element;n.dragging||w(t,"onDragStart",v)(q()),e.preventDefault(),n.dragging=!0,n.move=G.bind(n),n.stop=X.bind(n),s[u]("mouseup",n.stop),s[u]("touchend",n.stop),s[u]("touchcancel",n.stop),s[u]("mousemove",n.move),s[u]("touchmove",n.move),r[u]("selectstart",v),r[u]("dragstart",v),i[u]("selectstart",v),i[u]("dragstart",v),r.style.userSelect="none",r.style.webkitUserSelect="none",r.style.MozUserSelect="none",r.style.pointerEvents="none",i.style.userSelect="none",i.style.webkitUserSelect="none",i.style.MozUserSelect="none",i.style.pointerEvents="none",n.gutter.style.cursor=H,n.parent.style.cursor=H,c.body.style.cursor=H,Z.call(n),n.dragOffset=Y(e)-n.end}}U===g?(n="width",r="clientX",i="left",o="right",a="clientWidth"):"vertical"===U&&(n="height",r="clientY",i="top",o="bottom",a="clientHeight"),O=J(O);var ee=[];function te(e){var t=e.i===ee.length,n=t?ee[e.i-1]:ee[e.i];Z.call(n);var r=t?n.size-e.minSize-n[p]:e.minSize+n[m];K.call(n,r)}return(y=_.map((function(e,t){var r,i={element:S(e),size:O[t],minSize:k[t],maxSize:M[t],snapOffset:N[t],i:t};if(t>0&&((r={a:t-1,b:t,dragging:!1,direction:U,parent:T})[m]=b(I,t-1==0,!1,P),r[p]=b(I,!1,t===_.length-1,P),"row-reverse"===C||"column-reverse"===C)){var o=r.a;r.a=r.b,r.b=o}if(t>0){var a=$(t,U,i.element);!function(e,t,r){var i=V(n,t,r);Object.keys(i).forEach((function(t){e.style[t]=i[t]}))}(a,I,t),r[f]=Q.bind(r),a[u]("mousedown",r[f]),a[u]("touchstart",r[f]),T.insertBefore(a,i.element),r.gutter=a}return B(i.element,i.size,b(I,0===t,t===_.length-1,P),t),t>0&&ee.push(r),i}))).forEach((function(e){var t=e.element[h]()[n];t<e.minSize&&(D?te(e):e.minSize=t)})),{setSizes:function(e){var t=J(e);t.forEach((function(e,n){if(n>0){var r=ee[n-1],i=y[r.a],o=y[r.b];i.size=t[n-1],o.size=e,B(i.element,i.size,r[m],i.i),B(o.element,o.size,r[p],o.i)}}))},getSizes:q,collapse:function(e){te(y[e])},destroy:function(e,t){ee.forEach((function(r){if(!0!==t?r.parent.removeChild(r.gutter):(r.gutter[d]("mousedown",r[f]),r.gutter[d]("touchstart",r[f])),!0!==e){var i=j(n,r.a.size,r[m]);Object.keys(i).forEach((function(e){y[r.a].element.style[e]="",y[r.b].element.style[e]=""}))}}))},parent:T,pairs:ee}};function x(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&-1===t.indexOf(r)&&(n[r]=e[r]);return n}var C=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.componentDidMount=function(){var e=this.props;e.children;var t=e.gutter,n=x(e,["children","gutter"]);n.gutter=function(e,n){var r;return t?r=t(e,n):(r=document.createElement("div")).className="gutter gutter-"+n,r.__isSplitGutter=!0,r},this.split=T(this.parent.children,n)},t.prototype.componentDidUpdate=function(e){var t=this,n=this.props;n.children;var r=n.minSize,i=n.sizes,o=n.collapsed,a=x(n,["children","minSize","sizes","collapsed"]),s=e.minSize,l=e.sizes,c=e.collapsed,u=["maxSize","expandToMin","gutterSize","gutterAlign","snapOffset","dragInterval","direction","cursor"].map((function(n){return t.props[n]!==e[n]})).reduce((function(e,t){return e||t}),!1);if(Array.isArray(r)&&Array.isArray(s)){var d=!1;r.forEach((function(e,t){d=d||e!==s[t]})),u=u||d}else u=!(!Array.isArray(r)&&!Array.isArray(s))||(u||r!==s);if(u)a.minSize=r,a.sizes=i||this.split.getSizes(),this.split.destroy(!0,!0),a.gutter=function(e,t,n){return n.previousSibling},this.split=T(Array.from(this.parent.children).filter((function(e){return!e.__isSplitGutter})),a);else if(i){var h=!1;i.forEach((function(e,t){h=h||e!==l[t]})),h&&this.split.setSizes(this.props.sizes)}Number.isInteger(o)&&(o!==c||u)&&this.split.collapse(o)},t.prototype.componentWillUnmount=function(){this.split.destroy(),delete this.split},t.prototype.render=function(){var e=this,t=this.props;t.sizes,t.minSize,t.maxSize,t.expandToMin,t.gutterSize,t.gutterAlign,t.snapOffset,t.dragInterval,t.direction,t.cursor,t.gutter,t.elementStyle,t.gutterStyle,t.onDrag,t.onDragStart,t.onDragEnd,t.collapsed;var n=t.children,r=x(t,["sizes","minSize","maxSize","expandToMin","gutterSize","gutterAlign","snapOffset","dragInterval","direction","cursor","gutter","elementStyle","gutterStyle","onDrag","onDragStart","onDragEnd","collapsed","children"]);return i().createElement("div",Object.assign({},{ref:function(t){e.parent=t}},r),n)},t}(i().Component);C.propTypes={sizes:a().arrayOf(a().number),minSize:a().oneOfType([a().number,a().arrayOf(a().number)]),maxSize:a().oneOfType([a().number,a().arrayOf(a().number)]),expandToMin:a().bool,gutterSize:a().number,gutterAlign:a().string,snapOffset:a().oneOfType([a().number,a().arrayOf(a().number)]),dragInterval:a().number,direction:a().string,cursor:a().string,gutter:a().func,elementStyle:a().func,gutterStyle:a().func,onDrag:a().func,onDragStart:a().func,onDragEnd:a().func,collapsed:a().number,children:a().arrayOf(a().element)},C.defaultProps={sizes:void 0,minSize:void 0,maxSize:void 0,expandToMin:void 0,gutterSize:void 0,gutterAlign:void 0,snapOffset:void 0,dragInterval:void 0,direction:void 0,cursor:void 0,gutter:void 0,elementStyle:void 0,gutterStyle:void 0,onDrag:void 0,onDragStart:void 0,onDragEnd:void 0,collapsed:void 0,children:void 0};const O=C},70713(e,t,n){"use strict";n.d(t,{Ay:()=>h});var r=n(4883);let i;i="undefined"!=typeof window?window:"undefined"!=typeof self?self:n.g;let o=null,a=null;const s=i.clearTimeout,l=i.setTimeout,c=i.cancelAnimationFrame||i.mozCancelAnimationFrame||i.webkitCancelAnimationFrame,u=i.requestAnimationFrame||i.mozRequestAnimationFrame||i.webkitRequestAnimationFrame;function d(e){let t,n,r,s,l,c,u;const d="undefined"!=typeof document&&document.attachEvent;if(!d){c=function(e){const t=e.__resizeTriggers__,n=t.firstElementChild,r=t.lastElementChild,i=n.firstElementChild;r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight,i.style.width=n.offsetWidth+1+"px",i.style.height=n.offsetHeight+1+"px",n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight},l=function(e){return e.offsetWidth!==e.__resizeLast__.width||e.offsetHeight!==e.__resizeLast__.height},u=function(e){if(e.target.className&&"function"==typeof e.target.className.indexOf&&e.target.className.indexOf("contract-trigger")<0&&e.target.className.indexOf("expand-trigger")<0)return;const t=this;c(this),this.__resizeRAF__&&o(this.__resizeRAF__),this.__resizeRAF__=a((function(){l(t)&&(t.__resizeLast__.width=t.offsetWidth,t.__resizeLast__.height=t.offsetHeight,t.__resizeListeners__.forEach((function(n){n.call(t,e)})))}))};let e=!1,i="";r="animationstart";const d="Webkit Moz O ms".split(" ");let h="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),f="";{const t=document.createElement("fakeelement");if(void 0!==t.style.animationName&&(e=!0),!1===e)for(let n=0;n<d.length;n++)if(void 0!==t.style[d[n]+"AnimationName"]){f=d[n],i="-"+f.toLowerCase()+"-",r=h[n],e=!0;break}}n="resizeanim",t="@"+i+"keyframes "+n+" { from { opacity: 0; } to { opacity: 0; } } ",s=i+"animation: 1ms "+n+"; "}return{addResizeListener:function(o,a){if(d)o.attachEvent("onresize",a);else{if(!o.__resizeTriggers__){const a=o.ownerDocument,l=i.getComputedStyle(o);l&&"static"===l.position&&(o.style.position="relative"),function(n){if(!n.getElementById("detectElementResize")){const r=(t||"")+".resize-triggers { "+(s||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',i=n.head||n.getElementsByTagName("head")[0],o=n.createElement("style");o.id="detectElementResize",o.type="text/css",null!=e&&o.setAttribute("nonce",e),o.styleSheet?o.styleSheet.cssText=r:o.appendChild(n.createTextNode(r)),i.appendChild(o)}}(a),o.__resizeLast__={},o.__resizeListeners__=[],(o.__resizeTriggers__=a.createElement("div")).className="resize-triggers";const d=a.createElement("div");d.className="expand-trigger",d.appendChild(a.createElement("div"));const h=a.createElement("div");h.className="contract-trigger",o.__resizeTriggers__.appendChild(d),o.__resizeTriggers__.appendChild(h),o.appendChild(o.__resizeTriggers__),c(o),o.addEventListener("scroll",u,!0),r&&(o.__resizeTriggers__.__animationListener__=function(e){e.animationName===n&&c(o)},o.__resizeTriggers__.addEventListener(r,o.__resizeTriggers__.__animationListener__))}o.__resizeListeners__.push(a)}},removeResizeListener:function(e,t){if(d)e.detachEvent("onresize",t);else if(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),!e.__resizeListeners__.length){e.removeEventListener("scroll",u,!0),e.__resizeTriggers__.__animationListener__&&(e.__resizeTriggers__.removeEventListener(r,e.__resizeTriggers__.__animationListener__),e.__resizeTriggers__.__animationListener__=null);try{e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)}catch(e){}}}}}null==c||null==u?(o=s,a=function(e){return l(e,20)}):(o=function([e,t]){c(e),s(t)},a=function(e){const t=u((function(){s(n),e()})),n=l((function(){c(t),e()}),20);return[t,n]});class h extends r.Component{constructor(...e){super(...e),this.state={height:this.props.defaultHeight||0,width:this.props.defaultWidth||0},this._autoSizer=null,this._detectElementResize=null,this._didLogDeprecationWarning=!1,this._parentNode=null,this._resizeObserver=null,this._timeoutId=null,this._onResize=()=>{this._timeoutId=null;const{disableHeight:e,disableWidth:t,onResize:n}=this.props;if(this._parentNode){const r=window.getComputedStyle(this._parentNode)||{},i=parseFloat(r.paddingLeft||"0"),o=parseFloat(r.paddingRight||"0"),a=parseFloat(r.paddingTop||"0"),s=parseFloat(r.paddingBottom||"0"),l=this._parentNode.getBoundingClientRect(),c=l.height-a-s,u=l.width-i-o;if(!e&&this.state.height!==c||!t&&this.state.width!==u){this.setState({height:c,width:u});const e=()=>{this._didLogDeprecationWarning||(this._didLogDeprecationWarning=!0,console.warn("scaledWidth and scaledHeight parameters have been deprecated; use width and height instead"))};"function"==typeof n&&n({height:c,width:u,get scaledHeight(){return e(),c},get scaledWidth(){return e(),u}})}}},this._setRef=e=>{this._autoSizer=e}}componentDidMount(){const{nonce:e}=this.props,t=this._autoSizer?this._autoSizer.parentNode:null;if(null!=t&&t.ownerDocument&&t.ownerDocument.defaultView&&t instanceof t.ownerDocument.defaultView.HTMLElement){this._parentNode=t;const n=t.ownerDocument.defaultView.ResizeObserver;null!=n?(this._resizeObserver=new n((()=>{this._timeoutId=setTimeout(this._onResize,0)})),this._resizeObserver.observe(t)):(this._detectElementResize=d(e),this._detectElementResize.addResizeListener(t,this._onResize)),this._onResize()}}componentWillUnmount(){this._parentNode&&(this._detectElementResize&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize),null!==this._timeoutId&&clearTimeout(this._timeoutId),this._resizeObserver&&this._resizeObserver.disconnect())}render(){const{children:e,defaultHeight:t,defaultWidth:n,disableHeight:i=!1,disableWidth:o=!1,doNotBailOutOnEmptyChildren:a=!1,nonce:s,onResize:l,style:c={},tagName:u="div",...d}=this.props,{height:h,width:f}=this.state,m={overflow:"visible"},p={};let g=!1;return i||(0===h&&(g=!0),m.height=0,p.height=h,p.scaledHeight=h),o||(0===f&&(g=!0),m.width=0,p.width=f,p.scaledWidth=f),a&&(g=!1),(0,r.createElement)(u,{ref:this._setRef,style:{...m,...c},...d},!g&&e(p))}}},91793(e,t,n){"use strict";n.d(t,{Y1:()=>S});var r=n(58168),i=n(9417),o=n(77387),a=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function s(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(r=e[n],i=t[n],!(r===i||a(r)&&a(i)))return!1;var r,i;return!0}const l=function(e,t){var n;void 0===t&&(t=s);var r,i=[],o=!1;return function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return o&&n===this&&t(a,i)||(r=e.apply(this,a),o=!0,n=this,i=a),r}};var c=n(4883),u="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function d(e){cancelAnimationFrame(e.id)}function h(e,t){var n=u();var r={id:requestAnimationFrame((function i(){u()-n>=t?e.call(null):r.id=requestAnimationFrame(i)}))};return r}var f=-1;function m(e){if(void 0===e&&(e=!1),-1===f||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),f=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return f}var p=null;function g(e){if(void 0===e&&(e=!1),null===p||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?p="positive-descending":(t.scrollLeft=1,p=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),p}return p}var v=function(e,t){return e};function y(e){var t,n=e.getItemOffset,a=e.getEstimatedTotalSize,s=e.getItemSize,u=e.getOffsetForIndexAndAlignment,f=e.getStartIndexForOffset,p=e.getStopIndexForStartIndex,y=e.initInstanceProps,S=e.shouldResetStyleCacheOnItemSizeChange,w=e.validateProps;return t=function(e){function t(t){var r;return(r=e.call(this,t)||this)._instanceProps=y(r.props,(0,i.A)(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:(0,i.A)(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=l((function(e,t,n,i){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:i})})),r._callOnScroll=void 0,r._callOnScroll=l((function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})})),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,i=r.props,o=i.direction,a=i.itemSize,l=i.layout,c=r._getItemStyleCache(S&&a,S&&l,S&&o);if(c.hasOwnProperty(e))t=c[e];else{var u=n(r.props,e,r._instanceProps),d=s(r.props,e,r._instanceProps),h="horizontal"===o||"horizontal"===l,f="rtl"===o,m=h?u:0;c[e]=t={position:"absolute",left:f?void 0:m,right:f?m:void 0,top:h?0:u,height:h?"100%":d,width:h?d:"100%"}}return t},r._getItemStyleCache=void 0,r._getItemStyleCache=l((function(e,t,n){return{}})),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,i=t.scrollLeft,o=t.scrollWidth;r.setState((function(e){if(e.scrollOffset===i)return null;var t=r.props.direction,a=i;if("rtl"===t)switch(g()){case"negative":a=-i;break;case"positive-descending":a=o-n-i}return a=Math.max(0,Math.min(a,o-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,i=t.scrollHeight,o=t.scrollTop;r.setState((function(e){if(e.scrollOffset===o)return null;var t=Math.max(0,Math.min(o,i-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){null!==r._resetIsScrollingTimeoutId&&d(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=h(r._resetIsScrolling,150)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},(function(){r._getItemStyleCache(-1,null)}))},r}(0,o.A)(t,e),t.getDerivedStateFromProps=function(e,t){return _(e,t),w(e),null};var b=t.prototype;return b.scrollTo=function(e){e=Math.max(0,e),this.setState((function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}}),this._resetIsScrollingDebounced)},b.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,i=n.layout,o=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var a=0;if(this._outerRef){var s=this._outerRef;a="vertical"===i?s.scrollWidth>s.clientWidth?m():0:s.scrollHeight>s.clientHeight?m():0}this.scrollTo(u(this.props,e,t,o,this._instanceProps,a))},b.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var i=this._outerRef;"horizontal"===t||"horizontal"===r?i.scrollLeft=n:i.scrollTop=n}this._callPropsCallbacks()},b.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,i=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch(g()){case"negative":o.scrollLeft=-i;break;case"positive-ascending":o.scrollLeft=i;break;default:var a=o.clientWidth,s=o.scrollWidth;o.scrollLeft=s-a-i}else o.scrollLeft=i;else o.scrollTop=i}this._callPropsCallbacks()},b.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&d(this._resetIsScrollingTimeoutId)},b.render=function(){var e=this.props,t=e.children,n=e.className,i=e.direction,o=e.height,s=e.innerRef,l=e.innerElementType,u=e.innerTagName,d=e.itemCount,h=e.itemData,f=e.itemKey,m=void 0===f?v:f,p=e.layout,g=e.outerElementType,y=e.outerTagName,_=e.style,S=e.useIsScrolling,w=e.width,b=this.state.isScrolling,z="horizontal"===i||"horizontal"===p,R=z?this._onScrollHorizontal:this._onScrollVertical,E=this._getRangeToRender(),T=E[0],x=E[1],C=[];if(d>0)for(var O=T;O<=x;O++)C.push((0,c.createElement)(t,{data:h,key:m(O,h),index:O,isScrolling:S?b:void 0,style:this._getItemStyle(O)}));var L=a(this.props,this._instanceProps);return(0,c.createElement)(g||y||"div",{className:n,onScroll:R,ref:this._outerRefSetter,style:(0,r.A)({position:"relative",height:o,width:w,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:i},_)},(0,c.createElement)(l||u||"div",{children:C,ref:s,style:{height:z?"100%":L,pointerEvents:b?"none":void 0,width:z?L:"100%"}}))},b._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if("function"==typeof this.props.onScroll){var o=this.state,a=o.scrollDirection,s=o.scrollOffset,l=o.scrollUpdateWasRequested;this._callOnScroll(a,s,l)}},b._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,o=r.scrollDirection,a=r.scrollOffset;if(0===t)return[0,0,0,0];var s=f(this.props,a,this._instanceProps),l=p(this.props,s,a,this._instanceProps),c=i&&"backward"!==o?1:Math.max(1,n),u=i&&"forward"!==o?1:Math.max(1,n);return[Math.max(0,s-c),Math.max(0,Math.min(t-1,l+u)),s,l]},t}(c.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var _=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},S=y({getItemOffset:function(e,t){return t*e.itemSize},getItemSize:function(e,t){return e.itemSize},getEstimatedTotalSize:function(e){var t=e.itemCount;return e.itemSize*t},getOffsetForIndexAndAlignment:function(e,t,n,r,i,o){var a=e.direction,s=e.height,l=e.itemCount,c=e.itemSize,u=e.layout,d=e.width,h="horizontal"===a||"horizontal"===u?d:s,f=Math.max(0,l*c-h),m=Math.min(f,t*c),p=Math.max(0,t*c-h+c+o);switch("smart"===n&&(n=r>=p-h&&r<=m+h?"auto":"center"),n){case"start":return m;case"end":return p;case"center":var g=Math.round(p+(m-p)/2);return g<Math.ceil(h/2)?0:g>f+Math.floor(h/2)?f:g;default:return r>=p&&r<=m?r:r<p?p:m}},getStartIndexForOffset:function(e,t){var n=e.itemCount,r=e.itemSize;return Math.max(0,Math.min(n-1,Math.floor(t/r)))},getStopIndexForStartIndex:function(e,t,n){var r=e.direction,i=e.height,o=e.itemCount,a=e.itemSize,s=e.layout,l=e.width,c=t*a,u="horizontal"===r||"horizontal"===s?l:i,d=Math.ceil((u+n-c)/a);return Math.max(0,Math.min(o-1,t+d-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}})},29756(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(48648);var i=n(4069);const o=(a=i.A,function(e,t){var n=(0,r.A)(a)(e,t);return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return!n.apply(void 0,[e].concat(r))}});var a},57574(e,t,n){"use strict";n.d(t,{C5:()=>y,qh:()=>_,Ix:()=>S,pg:()=>p,BV:()=>w,bg:()=>f,jC:()=>h});var r=n(30470),i=n(13907),o=n(72582),a=n(12612),s=n(19189),l=n(44581);
|
|
2
|
+
/**
|
|
3
|
+
* react-router v8.4.0
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Remix Software Inc.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
9
|
+
*
|
|
10
|
+
* @license MIT
|
|
11
|
+
*/
|
|
12
|
+
const c={};function u(e,t){e||c[t]||(c[t]=!0,console.warn(t))}var d=n(4883);
|
|
13
|
+
/**
|
|
14
|
+
* react-router v8.4.0
|
|
15
|
+
*
|
|
16
|
+
* Copyright (c) Remix Software Inc.
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the MIT license found in the
|
|
19
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
20
|
+
*
|
|
21
|
+
* @license MIT
|
|
22
|
+
*/
|
|
23
|
+
const h=["HydrateFallback","hydrateFallbackElement"];function f(e,t){return(0,a.aE)({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:(0,r.sC)({initialEntries:t?.initialEntries,initialIndex:t?.initialIndex}),hydrationData:t?.hydrationData,routes:e,mapRouteProperties:i.MT,hydrationRouteProperties:h,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,instrumentations:t?.instrumentations}).initialize()}var m=class{status="pending";promise;resolve;reject;constructor(){this.promise=new Promise(((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}}))}};function p({router:e,flushSync:t,onError:n,useTransitions:r}){r=(0,s.OA)()||r;let[o,a]=d.useState(e.state),[l,c]=(0,d.useOptimistic)(o),[h,f]=d.useState(),[p,y]=d.useState({isTransitioning:!1}),[_,w]=d.useState(),[b,z]=d.useState(),[R,E]=d.useState(),T=d.useRef(new Map),x=d.useCallback(((o,{deletedFetchers:s,newErrors:l,flushSync:h,viewTransitionOpts:m})=>{l&&n&&Object.values(l).forEach((e=>n(e,{location:o.location,params:o.matches[0]?.params??{},pattern:(0,i.gU)(o.matches)}))),o.fetchers.forEach(((e,t)=>{void 0!==e.data&&T.current.set(t,e.data)})),s.forEach((e=>T.current.delete(e))),u(!1===h||null!=t,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let p=null!=e.window&&null!=e.window.document&&"function"==typeof e.window.document.startViewTransition;if(u(null==m||p,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),m&&p){if(t&&h){t((()=>{b&&(_?.resolve(),b.skipTransition()),y({isTransitioning:!0,flushSync:!0,currentLocation:m.currentLocation,nextLocation:m.nextLocation})}));let n=e.window.document.startViewTransition((()=>{t((()=>a(o)))}));return n.finished.finally((()=>{t((()=>{w(void 0),z(void 0),f(void 0),y({isTransitioning:!1})}))})),void t((()=>z(n)))}b?(_?.resolve(),b.skipTransition(),E({state:o,currentLocation:m.currentLocation,nextLocation:m.nextLocation})):(f(o),y({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}))}else t&&h?t((()=>a(o))):!1===r?a(o):d.startTransition((()=>{!0===r&&c((e=>g(e,o))),a(o)}))}),[e.window,t,b,_,r,c,n]);d.useLayoutEffect((()=>e.subscribe(x)),[e,x]),d.useEffect((()=>{p.isTransitioning&&!p.flushSync&&w(new m)}),[p]),d.useEffect((()=>{if(_&&h&&e.window){let t=h,n=_.promise,i=e.window.document.startViewTransition((async()=>{!1===r?a(t):d.startTransition((()=>{!0===r&&c((e=>g(e,t))),a(t)})),await n}));i.finished.finally((()=>{w(void 0),z(void 0),f(void 0),y({isTransitioning:!1})})),z(i)}}),[h,_,e.window,r,c]),d.useEffect((()=>{_&&h&&l.location.key===h.location.key&&_.resolve()}),[_,b,l.location,h]),d.useEffect((()=>{!p.isTransitioning&&R&&(f(R.state),y({isTransitioning:!0,flushSync:!1,currentLocation:R.currentLocation,nextLocation:R.nextLocation}),E(void 0))}),[p.isTransitioning,R]);let C=d.useMemo((()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})})),[e]),O=e.basename||"/",L=d.useMemo((()=>({router:e,navigator:C,static:!1,basename:O,onError:n})),[e,C,O,n]),k=d.useMemo((()=>({historyAction:l.historyAction,location:l.location,matches:l.matches,initialized:l.initialized,renderFallback:l.renderFallback,restoreScrollPosition:l.restoreScrollPosition,preventScrollReset:l.preventScrollReset,blockers:l.blockers})),[l.historyAction,l.location,l.matches,l.initialized,l.renderFallback,l.restoreScrollPosition,l.preventScrollReset,l.blockers]),A=d.useMemo((()=>({navigation:l.navigation,revalidation:l.revalidation})),[l.navigation,l.revalidation]),M=d.useMemo((()=>({loaderData:l.loaderData,actionData:l.actionData,errors:l.errors})),[l.loaderData,l.actionData,l.errors]),D=d.useMemo((()=>({fetchers:l.fetchers,fetcherData:T.current})),[l.fetchers]);return d.createElement(d.Fragment,null,d.createElement(s.hf.Provider,{value:L},d.createElement(s.ay.Provider,{value:k},d.createElement(s.Fw.Provider,{value:A},d.createElement(s.nW.Provider,{value:M},d.createElement(s.QH.Provider,{value:D},d.createElement(s.KZ.Provider,{value:p},d.createElement(S,{basename:O,location:l.location,navigationType:l.historyAction,navigator:C,useTransitions:r},d.createElement(v,{routes:e.routes,manifest:e.manifest,state:l,isStatic:!1,onError:n})))))))),null)}function g(e,t){return{...e,navigation:"idle"!==t.navigation.state?t.navigation:e.navigation,revalidation:"idle"!==t.revalidation?t.revalidation:e.revalidation,actionData:"submitting"!==t.navigation.state?t.actionData:e.actionData,fetchers:t.fetchers}}const v=d.memo((function({routes:e,manifest:t,state:n,isStatic:i,onError:o}){let a=d.useContext(s.hf);return(0,r.V1)(a,"You must render this element inside a <DataRouterContext.Provider> element"),(0,l.uG)(e,void 0,{router:a.router,manifest:t,state:n,isStatic:i,onError:o})}));function y({to:e,replace:t,state:n,relative:a}){(0,r.V1)((0,l.Ri)(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c,navigator:u}=d.useContext(s._3);(0,r.$e)(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:h}=d.useContext(s.Pl),{pathname:f}=(0,l.zy)(),m=(0,l.Zp)(),p=(0,i.Gh)(e,(0,i.PD)(h),f,"path"===a);(0,o.c)("string"==typeof e?e:(0,r.AO)(e),u.createHref(p),(0,o.Y)(u),"reject");let g=JSON.stringify(p);return d.useEffect((()=>{m(JSON.parse(g),{replace:t,state:n,relative:a})}),[m,g,a,t,n]),null}function _(e){(0,r.V1)(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function S({basename:e="/",children:t=null,location:n,navigationType:o="POP",navigator:a,static:c=!1,useTransitions:u}){(0,r.V1)(!(0,l.Ri)(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=e.replace(/^\/*/,"/"),f=d.useMemo((()=>({basename:h,navigator:a,static:c,useTransitions:u,future:{}})),[h,a,c,u]);"string"==typeof n&&(n=(0,r.Rr)(n));let{pathname:m="/",search:p="",hash:g="",state:v=null,key:y="default",mask:_}=n,S=d.useMemo((()=>{let e=(0,i.pb)(m,h);return null==e?null:{location:{pathname:e,search:p,hash:g,state:v,key:y,mask:_},navigationType:o}}),[h,m,p,g,v,y,o,_]);return(0,r.$e)(null!=S,`<Router basename="${h}"> is not able to match the URL "${m}${p}${g}" because it does not start with the basename, so the <Router> won't render anything.`),null==S?null:d.createElement(s._3.Provider,{value:f},d.createElement(s.di.Provider,{children:t,value:S}))}function w({children:e,location:t}){return(0,l.Ye)(b(e),t)}d.Component;function b(e,t=[]){let n=[];return d.Children.forEach(e,((e,i)=>{if(!d.isValidElement(e))return;let o=[...t,i];if(e.type===d.Fragment)return void n.push.apply(n,b(e.props.children,o));(0,r.V1)(e.type===_,`[${"string"==typeof e.type?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`);let a=e.props;(0,r.V1)(!a.index||!a.children,"An index route cannot have child routes.");let s={id:a.id||o.join("-"),caseSensitive:a.caseSensitive,element:a.element,Component:a.Component,index:a.index,path:a.path,middleware:a.middleware,loader:a.loader,action:a.action,hydrateFallbackElement:a.hydrateFallbackElement,HydrateFallback:a.HydrateFallback,errorElement:a.errorElement,ErrorBoundary:a.ErrorBoundary,shouldRevalidate:a.shouldRevalidate,handle:a.handle,lazy:a.lazy};a.children&&(s.children=b(a.children,o)),n.push(s)})),n}},42422(e,t,n){"use strict";n.d(t,{p:()=>a});var r=n(4883),i=n(81845),o=n(57574);
|
|
24
|
+
/**
|
|
25
|
+
* react-router v8.4.0
|
|
26
|
+
*
|
|
27
|
+
* Copyright (c) Remix Software Inc.
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the MIT license found in the
|
|
30
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
31
|
+
*
|
|
32
|
+
* @license MIT
|
|
33
|
+
*/
|
|
34
|
+
function a(e){return r.createElement(o.pg,{flushSync:i.flushSync,...e})}},71581(e,t,n){"use strict";n.d(t,{N_:()=>F,Ys:()=>M,Ge:()=>D,ok:()=>W});var r=n(43411),i=n(30470),o=n(13907),a=n(12612),s=n(19189),l=n(44581),c=n(57574);
|
|
35
|
+
/**
|
|
36
|
+
* react-router v8.4.0
|
|
37
|
+
*
|
|
38
|
+
* Copyright (c) Remix Software Inc.
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the MIT license found in the
|
|
41
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
42
|
+
*
|
|
43
|
+
* @license MIT
|
|
44
|
+
*/
|
|
45
|
+
const u="application/x-www-form-urlencoded";function d(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}function h(e=""){return new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map((e=>[n,e])):[[n,r]])}),[]))}let f=null;const m=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function p(e){return null==e||m.has(e)?e:((0,i.$e)(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${u}"`),null)}function g(e,t){let n,r,i,a,s;if(d(l=e)&&"form"===l.tagName.toLowerCase()){let s=e.getAttribute("action");r=s?(0,o.pb)(s,t):null,n=e.getAttribute("method")||"get",i=p(e.getAttribute("enctype"))||u,a=new FormData(e)}else if(function(e){return d(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return d(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let s=e.form;if(null==s)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||s.getAttribute("action");if(r=l?(0,o.pb)(l,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||"get",i=p(e.getAttribute("formenctype"))||p(s.getAttribute("enctype"))||u,a=new FormData(s,e),!function(){if(null===f)try{new FormData(document.createElement("form"),0),f=!1}catch{f=!0}return f}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?`${t}.`:"";a.append(`${e}x`,"0"),a.append(`${e}y`,"0")}else t&&a.append(t,r)}}else{if(d(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n="get",r=null,i=u,s=e}var l;return a&&"text/plain"===i&&(s=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:s}}function v(e){return null!=e&&"string"==typeof e.page}function y(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}async function _(e,t,n){return b((await Promise.all(e.map((async e=>{let r=t.routes[e.route.id];if(r){let e=
|
|
46
|
+
/**
|
|
47
|
+
* react-router v8.4.0
|
|
48
|
+
*
|
|
49
|
+
* Copyright (c) Remix Software Inc.
|
|
50
|
+
*
|
|
51
|
+
* This source code is licensed under the MIT license found in the
|
|
52
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
53
|
+
*
|
|
54
|
+
* @license MIT
|
|
55
|
+
*/await async function(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise((()=>{}))}}(r,n);return e.links?e.links():[]}return[]})))).flat(1).filter(y).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}function S(e,t,n,r,i,o){let a=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith("*")&&n[t].params["*"]!==e.params["*"];return"assets"===o?t.filter(((e,t)=>a(e,t)||s(e,t))):"data"===o?t.filter(((t,o)=>{let l=r.routes[t.route.id];if(!l||!l.hasLoader)return!1;if(a(t,o)||s(t,o))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof r)return r}return!0})):[]}function w(e,t,{includeHydrateFallback:n}={}){return r=e.map((e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i})).flat(1),[...new Set(r)];var r}function b(e,t){let n=new Set,r=new Set(t);return e.reduce(((e,i)=>{if(t&&!v(i)&&"script"===i.as&&i.href&&r.has(i.href))return e;let o=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(i));return n.has(o)||(n.add(o),e.push({key:o,link:i})),e}),[])}var z=n(4883);
|
|
56
|
+
/**
|
|
57
|
+
* react-router v8.4.0
|
|
58
|
+
*
|
|
59
|
+
* Copyright (c) Remix Software Inc.
|
|
60
|
+
*
|
|
61
|
+
* This source code is licensed under the MIT license found in the
|
|
62
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
63
|
+
*
|
|
64
|
+
* @license MIT
|
|
65
|
+
*/
|
|
66
|
+
Symbol("SingleFetchRedirect");new Set([100,101,204,205]);function R(e,t){let n="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return n.pathname.endsWith("/")?n.pathname=`${n.pathname}_.${t}`:n.pathname=`${n.pathname}.${t}`,n}
|
|
67
|
+
/**
|
|
68
|
+
* react-router v8.4.0
|
|
69
|
+
*
|
|
70
|
+
* Copyright (c) Remix Software Inc.
|
|
71
|
+
*
|
|
72
|
+
* This source code is licensed under the MIT license found in the
|
|
73
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
74
|
+
*
|
|
75
|
+
* @license MIT
|
|
76
|
+
*/
|
|
77
|
+
const E=z.createContext(void 0);function T(){let e=z.useContext(E);
|
|
78
|
+
/**
|
|
79
|
+
* react-router v8.4.0
|
|
80
|
+
*
|
|
81
|
+
* Copyright (c) Remix Software Inc.
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the MIT license found in the
|
|
84
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
85
|
+
*
|
|
86
|
+
* @license MIT
|
|
87
|
+
*/
|
|
88
|
+
return function(e,t){if(!1===e||null==e)throw new Error(t)}(e,"You must render this element inside a <HydratedRouter> element"),e}function x(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}E.displayName="FrameworkContext";function C({page:e,...t}){let n=(0,s.OA)(),{nonce:r}=T(),{router:i}=(0,l.ek)("PrefetchPageLinks"),o=z.useMemo((()=>i.match(e)),[i,i.routes,e]);return o?(null==t.nonce&&r&&(t={...t,nonce:r}),n?z.createElement(O,{page:e,matches:o,...t}):z.createElement(L,{page:e,matches:o,...t})):null}function O({page:e,matches:t,...n}){let r=(0,l.zy)(),i=z.useMemo((()=>{if(e===r.pathname+r.search+r.hash)return[];let n=R(e,"rsc"),i=!1,o=[];for(let e of t)"function"==typeof e.route.shouldRevalidate?i=!0:o.push(e.route.id);return i&&o.length>0&&n.searchParams.set("_routes",o.join(",")),[n.pathname+n.search]}),[e,r,t]);return z.createElement(z.Fragment,null,i.map((e=>z.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...n}))))}function L({page:e,matches:t,...n}){let r=(0,l.zy)(),{manifest:i,routeModules:o}=T(),{matches:a}=(0,l.CB)("PrefetchPageLinks"),{loaderData:s}=(0,l.hg)("PrefetchPageLinks"),c=z.useMemo((()=>S(e,t,a,i,r,"data")),[e,t,a,i,r]),u=z.useMemo((()=>S(e,t,a,i,r,"assets")),[e,t,a,i,r]),d=z.useMemo((()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,a=!1;if(t.forEach((e=>{let t=i.routes[e.route.id];t&&t.hasLoader&&(!c.some((t=>t.route.id===e.route.id))&&e.route.id in s&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?a=!0:n.add(e.route.id))})),0===n.size)return[];let l=R(e,"data");return a&&n.size>0&&l.searchParams.set("_routes",t.filter((e=>n.has(e.route.id))).map((e=>e.route.id)).join(",")),[l.pathname+l.search]}),[s,r,i,c,t,e,o]),h=z.useMemo((()=>w(u,i)),[u,i]),f=function(e){let{manifest:t,routeModules:n}=T(),[r,i]=z.useState([]);return z.useEffect((()=>{let r=!1;return _(e,t,n).then((e=>{r||i(e)})),()=>{r=!0}}),[e,t,n]),r}(u);return z.createElement(z.Fragment,null,d.map((e=>z.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...n}))),h.map((e=>z.createElement("link",{key:e,rel:"modulepreload",href:e,...n}))),f.map((({key:e,link:t})=>z.createElement("link",{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin}))))}function k(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}
|
|
89
|
+
/**
|
|
90
|
+
* react-router v8.4.0
|
|
91
|
+
*
|
|
92
|
+
* Copyright (c) Remix Software Inc.
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the MIT license found in the
|
|
95
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
96
|
+
*
|
|
97
|
+
* @license MIT
|
|
98
|
+
*/
|
|
99
|
+
const A="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{A&&(window.__reactRouterVersion="8")}catch{}function M(e,t){return(0,a.aE)({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:(0,i.zR)({window:t?.window}),hydrationData:t?.hydrationData||I(),routes:e,mapRouteProperties:o.MT,hydrationRouteProperties:c.jC,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function D(e,t){return(0,a.aE)({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:(0,i.TM)({window:t?.window}),hydrationData:t?.hydrationData||I(),routes:e,mapRouteProperties:o.MT,hydrationRouteProperties:c.jC,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function I(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:P(e.errors)}),e}function P(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&"RouteErrorResponse"===r.__type)n[e]=new o.cj(r.status,r.statusText,r.data,!0===r.internal);else if(r&&"Error"===r.__type){if("string"==typeof r.__subType&&o.WF.includes(r.__subType)){let t=window[r.__subType];if("function"==typeof t)try{let i=new t(r.message);i.stack="",n[e]=i}catch{}}if(null==n[e]){let t=new Error(r.message);t.stack="",n[e]=t}}else n[e]=r;return n}const F=z.forwardRef((function({onClick:e,discover:t="render",prefetch:n="none",relative:a,reloadDocument:c,replace:u,mask:d,state:h,target:f,to:m,preventScrollReset:p,viewTransition:g,defaultShouldRevalidate:v,...y},_){let{basename:S,navigator:w,useTransitions:b}=z.useContext(s._3),R="string"==typeof m&&r.E6.test(m),T=(0,o.X9)(m,S);m=T.to;let O=(0,l.$P)(m,{relative:a}),L=(0,l.zy)(),A=null;if(d){let e=(0,o.Gh)(d,[],L.mask?L.mask.pathname:"/",!0);"/"!==S&&(e.pathname="/"===e.pathname?S:(0,o.HS)([S,e.pathname])),A=w.createHref(e)}let[M,D,I]=function(e,t){let n=z.useContext(E),[r,i]=z.useState(!1),[o,a]=z.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:c,onMouseLeave:u,onTouchStart:d}=t,h=z.useRef(null);z.useEffect((()=>{if("render"===e&&a(!0),"viewport"===e){let e=new IntersectionObserver((e=>{e.forEach((e=>{a(e.isIntersecting)}))}),{threshold:.5});return h.current&&e.observe(h.current),()=>{e.disconnect()}}}),[e]),z.useEffect((()=>{if(r){let e=setTimeout((()=>{a(!0)}),100);return()=>{clearTimeout(e)}}}),[r]);let f=()=>{i(!0)},m=()=>{i(!1),a(!1)};return n?"intent"!==e?[o,h,{}]:[o,h,{onFocus:x(s,f),onBlur:x(l,m),onMouseEnter:x(c,f),onMouseLeave:x(u,m),onTouchStart:x(d,f)}]:[!1,h,{}]}(n,y),P=function(e,{target:t,replace:n,mask:r,state:o,preventScrollReset:a,relative:s,viewTransition:c,defaultShouldRevalidate:u,useTransitions:d}={}){let h=(0,l.Zp)(),f=(0,l.zy)(),m=(0,l.x$)(e,{relative:s});return z.useCallback((l=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(l,t)){l.preventDefault();let t=void 0!==n?n:(0,i.AO)(f)===(0,i.AO)(m),p=()=>h(e,{replace:t,mask:r,state:o,preventScrollReset:a,relative:s,viewTransition:c,defaultShouldRevalidate:u});d?z.startTransition((()=>p())):p()}}),[f,h,m,n,r,o,t,e,a,s,c,u,d])}(m,{replace:u,mask:d,state:h,target:f,preventScrollReset:p,relative:a,viewTransition:g,defaultShouldRevalidate:v,useTransitions:b});let F=!(T.isExternal||c),N=z.createElement("a",{...y,...I,href:(F?A:void 0)||T.absoluteURL||O,onClick:F?function(t){e&&e(t),t.defaultPrevented||P(t)}:e,ref:k(_,D),target:f,"data-discover":R||"render"!==t?void 0:"true"});return M&&!R?z.createElement(z.Fragment,null,N,z.createElement(C,{page:O})):N}));F.displayName="Link";z.forwardRef((function({"aria-current":e="page",caseSensitive:t=!1,className:n="",end:r=!1,style:a,to:c,viewTransition:u,children:d,...h},f){let m=(0,l.x$)(c,{relative:h.relative}),p=(0,l.zy)(),g=z.useContext(s.Fw),{navigator:v,basename:y}=z.useContext(s._3),_=null!=g&&function(e,{relative:t}={}){let n=z.useContext(s.KZ);(0,i.V1)(null!=n,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=(0,l.ek)("useViewTransitionState"),a=(0,l.x$)(e,{relative:t});if(!n.isTransitioning)return!1;let c=(0,o.pb)(n.currentLocation.pathname,r)||n.currentLocation.pathname,u=(0,o.pb)(n.nextLocation.pathname,r)||n.nextLocation.pathname;return null!=(0,o.B6)(a.pathname,u)||null!=(0,o.B6)(a.pathname,c)}(m)&&!0===u,S=v.encodeLocation?v.encodeLocation(m).pathname:m.pathname,w=p.pathname,b=g?.navigation.location?g.navigation.location.pathname:null;t||(w=w.toLowerCase(),b=b?b.toLowerCase():null,S=S.toLowerCase()),b&&y&&(b=(0,o.pb)(b,y)||b);const R="/"!==S&&S.endsWith("/")?S.length-1:S.length;let E,T=w===S||!r&&w.startsWith(S)&&"/"===w.charAt(R),x=null!=b&&(b===S||!r&&b.startsWith(S)&&"/"===b.charAt(R)),C={isActive:T,isPending:x,isTransitioning:_},O=T?e:void 0;E="function"==typeof n?n(C):[n,T?"active":null,x?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let L="function"==typeof a?a(C):a;return z.createElement(F,{...h,"aria-current":O,className:E,ref:f,style:L,to:c,viewTransition:u},"function"==typeof d?d(C):d)})).displayName="NavLink";const N=z.forwardRef((({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:c,state:u,method:d="get",action:h,onSubmit:f,relative:m,preventScrollReset:p,viewTransition:g,defaultShouldRevalidate:v,...y},_)=>{let{useTransitions:S}=z.useContext(s._3),w=H(),b=function(e,{relative:t}={}){let{basename:n}=z.useContext(s._3),r=z.useContext(s.Pl);(0,i.V1)(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),c={...(0,l.x$)(e||".",{relative:t})},u=(0,l.zy)();if(null==e){c.search=u.search;let e=new URLSearchParams(c.search),t=e.getAll("index");if(t.some((e=>""===e))){e.delete("index"),t.filter((e=>e)).forEach((t=>e.append("index",t)));let n=e.toString();c.search=n?`?${n}`:""}}e&&"."!==e||!a.route.index||(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index");"/"!==n&&(c.pathname="/"===c.pathname?n:(0,o.HS)([n,c.pathname]));return(0,i.AO)(c)}(h,{relative:m}),R="get"===d.toLowerCase()?"get":"post",E="string"==typeof h&&r.E6.test(h);return z.createElement("form",{ref:_,method:R,action:b,onSubmit:a?f:e=>{if(f&&f(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,i=r?.getAttribute("formmethod")||d,o=()=>w(r||e.currentTarget,{fetcherKey:t,method:i,navigate:n,replace:c,state:u,relative:m,preventScrollReset:p,viewTransition:g,defaultShouldRevalidate:v});S&&!1!==n?z.startTransition((()=>o())):o()},...y,"data-discover":E||"render"!==e?void 0:"true"})}));function W(e){(0,i.$e)("undefined"!=typeof URLSearchParams,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=z.useRef(h(e)),n=z.useRef(!1),r=(0,l.zy)(),o=z.useMemo((()=>function(e,t){let n=h(e);return t&&t.forEach(((e,r)=>{n.has(r)||t.getAll(r).forEach((e=>{n.append(r,e)}))})),n}(r.search,n.current?null:t.current)),[r.search]),a=(0,l.Zp)();return[o,z.useCallback(((e,t)=>{const r=h("function"==typeof e?e(new URLSearchParams(o)):e);n.current=!0,a("?"+r,t)}),[a,o])]}N.displayName="Form";let U=0;function H(){let{router:e}=(0,l.ek)("useSubmit"),{basename:t}=z.useContext(s._3),n=(0,l.nq)("useSubmit"),r=e.fetch,i=e.navigate;return z.useCallback((async(e,o={})=>{let{action:a,method:s,encType:l,formData:c,body:u}=g(e,t);!1===o.navigate?await r(o.fetcherKey||`__${String(++U)}__`,n,o.action||a,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,relative:o.relative,formData:c,body:u,formMethod:o.method||s,formEncType:o.encType||l,flushSync:o.flushSync}):await i(o.action||a,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,relative:o.relative,formData:c,body:u,formMethod:o.method||s,formEncType:o.encType||l,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})}),[r,i,t,n])}}}]);
|