UNPKG

@elastic-suite/gally-admin-shared

Version:
35 lines 266 kB
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var k="api",v=process.env.NODE_ENV==="test"?"http://localhost/":process.env.NEXT_PUBLIC_API_URL?process.env.NEXT_PUBLIC_API_URL:process.env.REACT_APP_API_URL?process.env.REACT_APP_API_URL:`${typeof window<"u"?window.location.origin:""}/${process.env.NEXT_PUBLIC_API_ROUTE_PREFIX?process.env.NEXT_PUBLIC_API_ROUTE_PREFIX:k}`;v&&String(v).endsWith("/")&&(v=v.slice(0,-1));var L=v,dt= exports.gqlUrl =`${v}/graphql`,lr= exports.searchableAttributeUrl ="?isSearchable=true",E= exports.authHeader ="Authorization",D= exports.languageHeader ="Gally-Language",f= exports.contentTypeHeader ="Content-Type",ht= exports.contentDispositionHeader ="Content-Disposition",C= exports.authErrorCodes =[401,403],j= exports.currentPage ="currentPage",it= exports.pageSize ="pageSize",N= exports.usePagination ="pagination",S= exports.searchParameter ="search",A= exports.defaultPageSize =50;var ct="category";var dr="cms_page";var Bt=(w=>(w.CATEGORY="category",w.CHECKBOX="checkbox",w.SLIDER="slider",w.BOOLEAN="boolean",w.HISTOGRAM="histogram",w.HISTOGRAM_DATE="date_histogram",w))(Bt||{});var Xt=(r=>(r.ASC="asc",r.DESC="desc",r))(Xt||{});var Vt=(a=>(a.SCOPE_LOCALIZED_CATALOG="localized_catalog",a.SCOPE_REQUEST_TYPE="request_type",a.SCOPE_LOCALE="locale",a.SCOPE_LANGUAGE="language",a.SCOPE_GENERAL="general",a))(Vt||{});var Jt=(o=>(o.ALL="massiveselection.all",o.ALL_ON_CURRENT_PAGE="massiveselection.allOnCurrentPage",o.NONE="massiveselection.none",o))(Jt||{}),M= exports.DataContentType =(p=>(p.BOOLEAN="boolean",p.IMAGE="image",p.LABEL="label",p.NUMBER="number",p.PRICE="price",p.RANGE="range",p.SCORE="score",p.SELECT="select",p.STOCK="stock",p.STRING="string",p.PASSWORD="password",p.EMAIL="email",p.TAG="tag",p.BUTTON="button",p.OPTGROUP="optgroup",p.RANGEDATE="rangeDate",p.REQUESTTYPE="requestType",p.RULEENGINE="ruleEngine",p.SLIDER="slider",p.MULTIPLEINPUT="multipleInput",p.SYNONYM="synonym",p.EXPANSION="expansion",p.PRODUCTINFO="productInfo",p.BOOSTPREVIEW="boostPreview",p.POSITIONEFFECT="positionEffect",p.PROPARTIONALTOATTRIBUTE="proportionalToAttribute",p.DATE="date",p.LOGS="logs",p.JOBFILE="jobFile",p.FILE="file",p.STATUS="status",p))(M||{}),ut= exports.ImageIcon =(e=>(e.PIN="push-pin",e))(ut||{});var gt=(a=>(a.VIRTUAL_CATEGORY="GallyVirtualCategoryBundle",a.BOOST="GallyBoostBundle",a.THESAURUS="GallyThesaurusBundle",a.VECTOR_SEARCH="GallyVectorSearchBundle",a.SEARCH_USAGE="GallySearchUsageBundle",a))(gt||{});var H=(s=>(s[s.FAILED=0]="FAILED",s[s.IDLE=1]="IDLE",s[s.LOADING=2]="LOADING",s[s.SUCCEEDED=3]="SUCCEEDED",s))(H||{});var $t=(a=>(a.ARRAY="array",a.BOOLEAN="boolean",a.INTEGER="integer",a.OBJECT="object",a.STRING="string",a))($t||{});var Wt=(w=>(w.OK="200",w.CREATED="201",w.NO_CONTENT="204",w.BAD_REQUEST="400",w.NOT_FOUND="404",w.UNPROCESSABLE_ENTITY="422",w))(Wt||{}),yt= exports.Method =(a=>(a.DELETE="DELETE",a.GET="GET",a.PATCH="PATCH",a.POST="POST",a.PUT="PUT",a))(yt||{});var Qt=(s=>(s.CATALOG="product_catalog",s.SEARCH="product_search",s.COVERAGE_RATE="product_coverage_rate",s.AUTOCOMPLETE="product_autocomplete",s))(Qt||{});var B=(r=>(r.ATTRIBUTE="attribute",r.COMBINATION="combination",r))(B||{}),X= exports.RuleAttributeType =(l=>(l.BOOLEAN="boolean",l.CATEGORY="category",l.FLOAT="float",l.INT="int",l.REFERENCE="reference",l.SELECT="select",l.TEXT="text",l.DATE="date",l.DATETIME="datetime",l))(X||{}),V= exports.RuleValueType =(l=>(l.BOOLEAN="Boolean",l.FLOAT="Float",l.INT="Int",l.STRING="String",l.BOOLEAN_MULTIPLE="[Boolean]",l.FLOAT_MULTIPLE="[Float]",l.INT_MULTIPLE="[Int]",l.STRING_MULTIPLE="[String]",l.STRING_REQUIRED="String!",l))(V||{}),mt= exports.RuleCombinationOperator =(r=>(r.ALL="all",r.ANY="any",r))(mt||{});var ft=(r=>(r.SEARCH="search",r.CATEGORY="category",r))(ft||{});var Kt=(r=>(r.ADMIN="ROLE_ADMIN",r.CONTRIBUTOR="ROLE_CONTRIBUTOR",r))(Kt||{});var So=48,Io= exports.selectionColumnWidth =40,Fo= exports.stickyColumnWidth =134,Po= exports.stickyColumnMaxWidth =134,Eo= exports.stickyColumnPadding ="14px 16px",jo= exports.columnMaxWidth =220,Oo= exports.productTableheader =[{id:"sku",input:"string",name:"sku",label:"Code",type:"string"},{id:"image",input:"image",name:"image",label:"Image",type:"image"},{id:"name",input:"string",name:"name",label:"Name",type:"string"},{id:"score",input:"score",name:"score",label:"Score",type:"score"},{id:"stock",input:"stock",name:"stock",label:"Stock",type:"stock"},{id:"price",input:"price",name:"price",label:"Price",type:"price"}],To= exports.defaultRowsPerPageOptions =[10,25,50],Ro= exports.imageIconLabels ={["push-pin"]:"Pinned"};var _jsontographqlquery = require('json-to-graphql-query');var Mo=`query preview($localizedCatalog: String!, $search: String) { previewBoost( localizedCatalog: $localizedCatalog requestType: product_search search: $search ) { id, resultsBefore, resultsAfter } }`;function qo(){return _jsontographqlquery.jsonToGraphQLQuery.call(void 0, {query:{__name:"getPreview",__variables:{localizedCatalog:"String!",requestType:"ProductRequestTypeEnum!",currentBoost:"String!",search:"String",category:"String",currentPage:"Int",pageSize:"Int"},previewBoost:{__args:{localizedCatalog:new (0, _jsontographqlquery.VariableType)("localizedCatalog"),requestType:new (0, _jsontographqlquery.VariableType)("requestType"),currentBoost:new (0, _jsontographqlquery.VariableType)("currentBoost"),search:new (0, _jsontographqlquery.VariableType)("search"),currentCategoryId:new (0, _jsontographqlquery.VariableType)("category"),currentPage:new (0, _jsontographqlquery.VariableType)("currentPage"),pageSize:new (0, _jsontographqlquery.VariableType)("pageSize")},id:!0,resultsBefore:!0,resultsAfter:!0,lastPage:!0,itemsPerPage:!0,totalItems:!0}}})}function _o(t=null,e=!1){let r=q(t,e);return _jsontographqlquery.jsonToGraphQLQuery.call(void 0, {query:{__name:"getProducts",__variables:{...r.variables},products:{__aliasFor:"products",__args:{...r.args},...r.fields}}})}function Go(t=null,e=!1){let r=q(t,e);return _jsontographqlquery.jsonToGraphQLQuery.call(void 0, {query:{__name:"getPreviewProducts",__variables:{...r.variables,currentCategoryConfiguration:"String"},products:{__aliasFor:"previewProducts",__args:{...r.args,currentCategoryConfiguration:new (0, _jsontographqlquery.VariableType)("currentCategoryConfiguration")},...r.fields}}})}function q(t=null,e=!1,r="Product",o={},s={}){return{variables:{requestType:"ProductRequestTypeEnum!",localizedCatalog:"String!",currentPage:"Int",currentCategoryId:"String",pageSize:"Int",search:"String",sort:"ProductSortInput"},args:{requestType:new (0, _jsontographqlquery.VariableType)("requestType"),localizedCatalog:new (0, _jsontographqlquery.VariableType)("localizedCatalog"),currentPage:new (0, _jsontographqlquery.VariableType)("currentPage"),currentCategoryId:new (0, _jsontographqlquery.VariableType)("currentCategoryId"),pageSize:new (0, _jsontographqlquery.VariableType)("pageSize"),search:new (0, _jsontographqlquery.VariableType)("search"),sort:new (0, _jsontographqlquery.VariableType)("sort"),filter:t},fields:{collection:{__on:{__typeName:r,id:!0,sku:!0,name:!0,description:!0,score:!0,image:!0,stock:{status:!0},price:{price:!0},...o}},paginationInfo:{lastPage:!0,itemsPerPage:!0,totalCount:!0},sortInfo:{current:{field:!0,direction:!0}},...e&&{aggregations:{field:!0,label:!0,type:!0,date_format:!0,date_range_interval:!0,options:{count:!0,label:!0,value:!0},hasMore:!0}},...s}}}function Yt(t=null,e=!1){return J(t,e,ct)}function zo(t,e=null,r=!1){let o=J(e,r,t);return _jsontographqlquery.jsonToGraphQLQuery.call(void 0, {query:{__name:"getDocuments",__variables:{...o.variables},documents:{__aliasFor:"documents",__args:{...o.args},...o.fields}}})}function Uo(t,e=null,r=!1){let o=J(e,r,t,"VectorDocument");return _jsontographqlquery.jsonToGraphQLQuery.call(void 0, {query:{__name:"getVectorSearchDocuments",__variables:{...o.variables},vectorSearchDocuments:{__aliasFor:"vectorSearchDocuments",__args:{...o.args},...o.fields}}})}function J(t=null,e=!1,r="document",o="Document"){return{variables:{[`${r}EntityType`]:"String!",[`${r}LocalizedCatalog`]:"String!",[`${r}CurrentPage`]:"Int",[`${r}PageSize`]:"Int",[`${r}Search`]:"String",[`${r}Sort`]:"SortInput"},args:{entityType:new (0, _jsontographqlquery.VariableType)(`${r}EntityType`),localizedCatalog:new (0, _jsontographqlquery.VariableType)(`${r}LocalizedCatalog`),currentPage:new (0, _jsontographqlquery.VariableType)(`${r}CurrentPage`),pageSize:new (0, _jsontographqlquery.VariableType)(`${r}PageSize`),search:new (0, _jsontographqlquery.VariableType)(`${r}Search`),sort:new (0, _jsontographqlquery.VariableType)(`${r}Sort`),filter:t},fields:{collection:{__on:{__typeName:o,id:!0,score:!0,source:!0}},paginationInfo:{lastPage:!0,itemsPerPage:!0,totalCount:!0},sortInfo:{current:{field:!0,direction:!0}},...e&&{aggregations:{field:!0,label:!0,type:!0,date_format:!0,date_range_interval:!0,options:{count:!0,label:!0,value:!0},hasMore:!0}}}}}function ko(t=null,e=null,r=!1){let o=q(t,r),s=Yt(e,r);return _jsontographqlquery.jsonToGraphQLQuery.call(void 0, {query:{__name:"getAutoCompleteDocuments",__variables:{...o.variables,...s.variables},products:{__aliasFor:"products",__args:{...o.args},...o.fields},categories:{__aliasFor:"documents",__args:{...s.args},...s.fields}}})}function No(t=null){return _jsontographqlquery.jsonToGraphQLQuery.call(void 0, {query:{__name:"viewMoreFacetOptions",__variables:{entityType:"String!",localizedCatalog:"String!",aggregation:"String!",search:"String",optionSearch:"String"},viewMoreFacetOptions:{__args:{entityType:new (0, _jsontographqlquery.VariableType)("entityType"),localizedCatalog:new (0, _jsontographqlquery.VariableType)("localizedCatalog"),aggregation:new (0, _jsontographqlquery.VariableType)("aggregation"),search:new (0, _jsontographqlquery.VariableType)("search"),optionSearch:new (0, _jsontographqlquery.VariableType)("optionSearch"),filter:t},id:!0,value:!0,label:!0,count:!0}}})}function Ho(t=null){return _jsontographqlquery.jsonToGraphQLQuery.call(void 0, {query:{__name:"viewMoreProductFacetOptions",__variables:{localizedCatalog:"String!",aggregation:"String!",currentCategoryId:"String",search:"String",optionSearch:"String"},viewMoreProductFacetOptions:{__args:{localizedCatalog:new (0, _jsontographqlquery.VariableType)("localizedCatalog"),aggregation:new (0, _jsontographqlquery.VariableType)("aggregation"),currentCategoryId:new (0, _jsontographqlquery.VariableType)("currentCategoryId"),search:new (0, _jsontographqlquery.VariableType)("search"),optionSearch:new (0, _jsontographqlquery.VariableType)("optionSearch"),filter:t},id:!0,value:!0,label:!0,count:!0}}})}var Bo=`query getPosition( $categoryId: String!, $localizedCatalogId : Int! ) { getPositionsCategoryProductMerchandising(categoryId: $categoryId, localizedCatalogId : $localizedCatalogId ) { result } } `,Xo= exports.savePositions =`mutation savePositionsCategoryProductMerchandising( $categoryId: String!, $savePositionsCategory : String! ){ savePositionsCategoryProductMerchandising ( input: { categoryId: $categoryId positions: $savePositionsCategory } ) {categoryProductMerchandising {result}} } `;function Vo(t=null,e=!1){let r=q(t,e,"ExplainProduct",{explanation:!0,sort:!0,boosts:!0,matches:!0,highlights:!0,legends:!0,fieldHighlights:!0},{explainData:{elasticSearchQuery:{index:!0,query:!0},isSpellchecked:!0,extraData:!0}});return _jsontographqlquery.jsonToGraphQLQuery.call(void 0, {query:{__name:"getExplainProducts",__variables:{...r.variables},explain:{__aliasFor:"explain",__args:{...r.args},...r.fields}}})}var bt=/^is([A-Z][a-zA-Z]+)/,xt= exports.headerRegexp =/<(.+)>; rel="http:\/\/www.w3.org\/ns\/hydra\/core#apiDocumentation"/;var Wo="product";var vt={type:"combination",operator:"all",value:!0,children:[]},ta= exports.emptyAttributeRule ={type:"attribute",field:"",operator:"",attribute_type:"text",value:""},$= exports.ruleValueNumberTypes =["Int","Float"],ea= exports.ruleValueNumberMultipleTypes =["[Int]","[Float]"],ra= exports.ruleArrayValueSeparator =">|<";var _styles = require('@mui/material/styles');var _react = require('@emotion/react');var ee=_react.keyframes` 0% { transform: scale(0); opacity: 0.3; } 100% { transform: scale(1); opacity: 0.6; } `,wa= exports.theme =_styles.createTheme.call(void 0, {palette:{background:{page:"#FAFBFE"},primary:{light:"#FBC0B9",main:"#ED7465",dark:"#A02213"},secondary:{light:"#BABDFC",main:"#2C19CD",dark:"#1812A0"},neutral:{light:"#F4F7FF",main:"#B5B9D9",dark:"#2F3674",contrastText:"#FFFFFF"},error:{light:"#FFE7E4",main:"#A02213"},warning:{light:"#FEF9D0",main:"#60590D"},success:{light:"#E7F4EC",main:"#18753C"},menu:{text500:"#424880",text600:"#212250",hover:"#E7E8FF",active:"#2C19CD"},colors:{white:"#FFF",black:"#000",primary:{main:"#ED7465",100:"#FFE7E4",200:"#FBC0B9",300:"#F3978C",400:"#ED7465",500:"#E64733",600:"#CC2D19",700:"#A02213",800:"#73170C",900:"#460C05"},secondary:{main:"#2C19CD",100:"#E7E8FF",200:"#BABDFC",300:"#8D8DF3",400:"#6460ED",500:"#3F32E6",600:"#2C19CD",700:"#1812A0",800:"#0D1274",900:"#070F47"},neutral:{100:"#FAFBFE",200:"#F4F7FF",300:"#E2E6F3",400:"#B5B9D9",500:"#8187B9",600:"#424880",700:"#2F3674",800:"#212250",900:"#151A47"},gradient:{default:"linear-gradient(46.78deg, #E64733 1.79%, #ED7465 98.88%)",darken:"linear-gradient(46.78deg, #CC2D19 1.79%, #E64733 98.88%)"},shadow:{neutral:{sm:"4px 4px 14px rgba(226, 230, 243, 0.5)",md:"0px -8px 8px rgba(226, 230, 243, 0.2), 0px 5px 8px rgba(107, 113, 166, 0.1), 4px 4px 14px rgba(226, 230, 243, 0.5)",lg:"0px -8px 8px rgba(226, 230, 243, 0.2), 0px 8px 8px rgba(107, 113, 166, 0.2), 4px 4px 14px rgba(226, 230, 243, 0.5)"},primaryButton:{sm:"0px -8px 8px rgba(255, 231, 228, 0.2), 0px 8px 8px rgba(243, 151, 140, 0.2), 4px 4px 14px rgba(255, 231, 228, 0.5)",md:"0px -8px 8px rgba(255, 231, 228, 0.2), 0px 16px 16px rgba(243, 151, 140, 0.2), 4px 4px 14px rgba(255, 231, 228, 0.5)",lg:"0px -8px 8px rgba(255, 231, 228, 0.2), 0px 16px 36px rgba(243, 151, 140, 0.2), 4px 4px 14px rgba(255, 231, 228, 0.5)"},secondaryButton:{sm:"0px -8px 8px rgba(231, 232, 255, 0.2), 0px 8px 8px rgba(186, 189, 252, 0.05), 4px 4px 14px rgba(231, 232, 255, 0.5)",md:"0px -8px 8px rgba(231, 232, 255, 0.2), 0px 16px 16px rgba(186, 189, 252, 0.2), 4px 4px 14px rgba(231, 232, 255, 0.5)",lg:"0px -8px 8px rgba(231, 232, 255, 0.2), 0px 16px 36px rgba(186, 189, 252, 0.4), 4px 4px 14px rgba(231, 232, 255, 0.5)"}}},mode:"light"},shape:{borderRadius:8},typography:{h1:{fontSize:36,lineHeight:"44px",fontWeight:600},h2:{fontSize:28,lineHeight:"38px",fontWeight:600},h3:{fontSize:24,lineHeight:"32px",fontWeight:600},h4:{fontSize:20,lineHeight:"30px",fontWeight:600},h5:{fontSize:18,lineHeight:"28px",fontWeight:600},h6:{fontSize:16,lineHeight:"24px",fontWeight:600},body1:{fontSize:14,lineHeight:"20px",fontWeight:500},body2:{fontSize:14,lineHeight:"20px",fontWeight:400},caption:{fontSize:12,lineHeight:"18px",fontWeight:400}},components:{MuiCollapse:{styleOverrides:{wrapper:{width:"100%"},wrapperInner:{width:"100%"}}},MuiButtonBase:{defaultProps:{disableRipple:!1}},MuiButton:{styleOverrides:{root:{minWidth:32}}},MuiCheckbox:{styleOverrides:{root:{transform:"scale(0.9)",color:"#B5B9D9",transition:"all 0.3s linear","&:hover":{backgroundColor:"rgba(21, 26, 71, 0.08)"},"&:focus":{backgroundColor:"rgba(21, 26, 71, 0.12)"},".MuiTouchRipple-child":{backgroundColor:"rgba(21, 26, 71)"},"&.Mui-checked, &.MuiCheckbox-indeterminate":{"&:hover":{backgroundColor:"rgba(237, 116, 101, 0.08)"},"&:focus":{backgroundColor:"rgba(237, 116, 101, 0.12)"},".MuiTouchRipple-child":{backgroundColor:"rgba(237, 116, 101)"}},"&.Mui-disabled":{color:"#E2E6F3"}}}},MuiRadio:{styleOverrides:{root:{transform:"scale(0.9)",color:"#B5B9D9",transition:"all 0.3s linear","&:hover":{backgroundColor:"rgba(21, 26, 71, 0.08)"},"&:focus":{backgroundColor:"rgba(21, 26, 71, 0.12)"},".MuiTouchRipple-child":{backgroundColor:"rgba(21, 26, 71)"},"&.Mui-checked":{"&:hover":{backgroundColor:"rgba(237, 116, 101, 0.08)"},"&:focus":{backgroundColor:"rgba(237, 116, 101, 0.12)"},".MuiTouchRipple-child":{backgroundColor:"rgba(237, 116, 101)"}},"&.Mui-disabled":{color:"#E2E6F3"}}}},MuiSwitch:{styleOverrides:{thumb:{background:"#FFF",border:"1px solid #B5B9D9",boxSizing:"border-box",boxShadow:"0px 6px 10px rgba(0, 0, 0, 0.05)",borderRadius:"22px",width:"19px",height:"19px"},track:{backgroundColor:"#B5B9D9",borderRadius:"22px",opacity:"1",height:"13px"},switchBase:{transition:"all 0.3s linear","&:hover":{backgroundColor:"rgba(21, 26, 71, 0.08)"},"&:focus":{backgroundColor:"rgba(21, 26, 71, 0.12)"},".MuiTouchRipple-child":{backgroundColor:"rgba(21, 26, 71)"},"&.Mui-checked":{"&:hover":{backgroundColor:"rgba(237, 116, 101, 0.08)"},"&:focus":{backgroundColor:"rgba(237, 116, 101, 0.12)"},".MuiTouchRipple-child":{backgroundColor:"rgba(237, 116, 101)"},"& .MuiSwitch-thumb":{border:"0",background:"linear-gradient(46.78deg, #E64733 1.79%, #ED7465 98.88%)",boxShadow:"0px 6px 10px rgba(237, 116, 101, 0.1)"},"& + .MuiSwitch-track":{backgroundColor:"#E64733",opacity:"0.2"}},"&.Mui-disabled":{"+ .MuiSwitch-track":{opacity:1,backgroundColor:"rgba(181, 185, 217, 0.3)"},"& .MuiSwitch-thumb":{border:"1px solid rgba(181, 185, 217, 0.3)"},"&.Mui-checked":{"+ .MuiSwitch-track":{opacity:.2,backgroundColor:"rgba(230, 71, 51, 0.3)"},"& .MuiSwitch-thumb":{boxShadow:"none",opacity:.3}}}}}},MuiFab:{styleOverrides:{root:{color:"#FFF",fontSize:"26px",background:"linear-gradient(46.78deg, #E64733 1.79%, #ED7465 98.88%)",boxShadow:"0px -8px 8px rgba(255, 231, 228, 0.2), 0px 16px 16px rgba(243, 151, 140, 0.2), 4px 4px 14px rgba(255, 231, 228, 0.5)",width:"56px",height:"56px",zIndex:1,"&::before":{position:"absolute",content:'""',top:0,right:0,bottom:0,left:0,borderRadius:"50%",background:"linear-gradient(46.78deg, #CC2D19 1.79%, #E64733 98.88%)",boxShadow:"0px -8px 8px rgba(255, 231, 228, 0.2), 0px 16px 36px rgba(243, 151, 140, 0.2), 4px 4px 14px rgba(255, 231, 228, 0.5)",zIndex:-1,transition:"opacity 0.3s linear",opacity:0},"&:hover::before":{opacity:1},"&:hover":{background:"linear-gradient(46.78deg, #E64733 1.79%, #ED7465 98.88%)",boxShadow:"0px -8px 8px rgba(255, 231, 228, 0.2), 0px 16px 16px rgba(243, 151, 140, 0.2), 4px 4px 14px rgba(255, 231, 228, 0.5)"},"&& .MuiTouchRipple-child":{backgroundColor:"#CC2D19",opacity:1},"&& .MuiTouchRipple-rippleVisible":{animationName:`${ee}`},"&.Mui-disabled":{color:"#8187B9",background:"#E2E6F3"}}}},MuiFormControlLabel:{styleOverrides:{root:{color:"#151A47",fontSize:"14px",lineHeight:"20px",fontWeight:400},label:{"&.Mui-disabled":{color:"#8187B9"}}}},MuiInputLabel:{styleOverrides:{root:{WebkitTransform:"none",transform:"none",fontWeight:500,lineHeight:"20px",color:"#151A47",fontFamily:"var(--gally-font)","&.Mui-focused":{color:"#151A47"}},shrink:{fontSize:14,color:"#151A47"},asterisk:{color:"#CC2D19"}}},MuiFormHelperText:{styleOverrides:{root:{display:"flex",color:"#424880",fontWeight:400,fontSize:"12px",lineHeight:"18px",margin:"8px 0 0 0",".MuiInputBase-colorSuccess + &":{color:"#18753C"},".MuiInputBase-colorError + &, .textarea--error + &":{color:"#A02213"}}}},MuiInputBase:{styleOverrides:{root:{fontFamily:"var(--gally-font)"}}},MuiFormControl:{styleOverrides:{root:{textarea:{borderColor:"#E2E6F3",borderStyle:"solid",borderWidth:"1px",borderRadius:8,background:"#FFF",color:"#151A47",fontWeight:400,fontSize:14,lineHeight:"20px",padding:16,transition:"border-color 0.3s linear","&:hover":{borderColor:"#B5B9D9"},"&.textarea--filled":{borderColor:"#B5B9D9"},"&:focus":{borderColor:"#424880"},"&.textarea--error":{borderColor:"#A02213"},"&:disabled":{pointerEvents:"none",color:"#424880",background:"#E2E6F3",borderColor:"#E2E6F3"},"&:focus-visible":{outline:"none"},"&::placeholder":{color:"#424880",opacity:1},"&::-webkit-resizer":{background:"no-repeat 100% 100%/150% url(/images/corner-expand.svg)"}},"label + textarea":{marginTop:24}}}},MuiDialog:{styleOverrides:{paper:{borderRadius:8,padding:32,width:"600px"}}},MuiBackdrop:{styleOverrides:{root:{background:"rgba(21, 26, 71, 0.6)"}}},MuiDialogActions:{styleOverrides:{root:{"> :not(:first-of-type)":{marginLeft:0}}}},MuiTab:{styleOverrides:{root:{textTransform:"none",fontSize:"16px",lineHeight:"24px",fontWeight:"500",color:"#424880","&.Mui-selected":{color:"#2C19CD"}}}},MuiTabs:{styleOverrides:{indicator:{backgroundColor:"#2C19CD"}}},MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:"#FFF",color:"#151A47",fontSize:"12px",fontWeight:"400",lineHeight:"18px",padding:"16px",borderRadius:"8px",boxShadow:"rgba(100, 100, 111, 0.2) 0px 7px 29px 0px"},arrow:{color:"#FFF"}}},MuiTablePagination:{styleOverrides:{selectLabel:{display:"flex"},displayedRows:{display:"flex"},select:{paddingTop:"5px"}}}}});var W="-",na= exports.premiumHomePageUrl ="/admin/analyze/search_usage",pa= exports.standardHomePageUrl ="/admin/settings/scope/catalogs";var g="gallyToken";var _react3 = require('react');var Fa=_react3.createContext.call(void 0, null);function Ct(t=""){if(process.env.NEXT_PUBLIC_LOCAL)try{let e=new URL(t);e.origin===L&&(e.pathname==="/"&&(e.pathname="/index"),e.pathname&&!e.pathname.endsWith(".json")&&!e.pathname.endsWith(".jsonld")&&(e.pathname=`${e.pathname}.json`),e.pathname.endsWith(".jsonld")&&(e.pathname=`${e.pathname.slice(0,-7)}.json`),e.pathname.startsWith("/mocks")||(e.pathname=`/mocks${e.pathname}`),t=e.href)}catch (e2){}return t}async function b(t,e={}){(!e.method||e.method==="GET")&&(t=Ct(t.toString()));let r=await fetch(t,e);return{json:(r==null?void 0:r.status)!==204?await r.json():{},response:r}}async function St(t,e={}){(!e.method||e.method==="GET")&&(t=Ct(t.toString()));let r=await fetch(t,e);return{content:(r==null?void 0:r.status)!==204?await r.text():"",response:r}}var _datefns = require('date-fns');var _=class extends Error{constructor(r){super(r["hydra:description"]);this.error=r}};function It(t){return"@type"in t}function Ft(t){return t["@type"]==="hydra:Error"}function Da(t,e){return t.find(r=>r.title===e||r.label===e)}function Q(t){return t.endsWith("[]")?t.slice(0,-2):t.endsWith("[between]")?t.slice(0,-9):t}function G(t,e){return e=Q(e),t.supportedProperty.find(r=>{var o;return r.title===e||((o=r==null?void 0:r.gally)==null?void 0:o.alias)===e})}function O(t){var e,r;switch((r=(e=t.property)==null?void 0:e.range)==null?void 0:r["@id"]){case"http://www.w3.org/2001/XMLSchema#array":return"array";case"http://www.w3.org/2001/XMLSchema#integer":return"integer";case"http://www.w3.org/2001/XMLSchema#decimal":case"http://www.w3.org/2001/XMLSchema#float":return"float";case"http://www.w3.org/2001/XMLSchema#boolean":return"boolean";case"http://www.w3.org/2001/XMLSchema#date":return"date";case"http://www.w3.org/2001/XMLSchema#dateTime":return"dateTime";default:return"text"}}function Pt(t){return t.property["@type"]==="http://www.w3.org/ns/hydra/core#Link"}function Aa(t,e){return t.find(r=>r["@id"]===e.property.range["@id"])}function Ma(t){return t["hydra:member"].map(e=>({id:e.id,label:e["@id"],value:e.id}))}function qa(t){return t["hydra:member"].map(e=>({id:e.id,label:e.label,value:e.id}))}function _a(t,e=-1){return t["hydra:member"].map(r=>{var s;let o=r.defaultLabel;return e!==-1&&(o=_nullishCoalesce(((s=r.labels.find(a=>a.localizedCatalog.id===e))==null?void 0:s.label), () => (o))),{id:r.code,label:o,value:r.code}})}function Ga(t){return t["hydra:member"].map(e=>({id:e.sourceFieldOption.code,label:e.label,value:e.sourceFieldOption.code}))}function ae(t){return t.flatMap(({label:e,options:r})=>r.map(o=>({id:e,value:o.value,label:o.label})))}function za(t){let e=t["hydra:member"].map(({label:r,value:o,code:s,options:a})=>({label:r,value:_nullishCoalesce(o, () => (s)),options:a}));return e.some(({options:r})=>r)?ae(e):e}function Et(t,e){if(e instanceof Array)return e.map(r=>Et(t,r));if(Pt(t))return Number(e);switch(O(t)){case"integer":return e&&Number(e);case"boolean":return e!=="true"&&e!=="false"?null:e==="true";default:return e}}function jt(t,e){if(e instanceof Array)return e.every(r=>jt(t,r));if(Pt(t))return typeof e=="number"&&!isNaN(e);switch(O(t)){case"integer":return typeof e=="number"&&!isNaN(e)||e==="";case"boolean":return typeof e=="boolean";case"date":case"dateTime":return e===""||_datefns.isValid.call(void 0, e);default:return typeof e=="string"}}function Ua(t,e){return Object.fromEntries(Object.entries(e).reduce((r,[o,s])=>{let a=G(t,o);if(a){let w=Et(a,s);jt(a,w)&&r.push([o,w])}return r},[]))}function se(t,e){return e!==void 0?e:t}function we(t){switch(t){case"requestType":case"searchLimitations":case"categoryLimitations":case"optgroup":case"synonym":case"expansion":return[];case"ruleEngine":return'{"type":"combination","operator":"all","value":"true","children":[]}';case"rangeDate":return{fromDate:null,toDate:null};case"proportionalToAttribute":return{source_field_code:void 0,boost_impact:void 0,scale_factor:1};default:return""}}function le(t,e){switch(t){case"boolean":return!1;case"array":case"select":return[];case"number":case"integer":case"float":case"slider":return 0;case"date":case"dateTime":return null;default:return e?we(e):""}}function ka(t){return Object.fromEntries(t.supportedProperty.filter(e=>{var r;return(r=e==null?void 0:e.gally)==null?void 0:r.visible}).map(e=>{var r,o;return[e.title,se(le(O(e),(r=e==null?void 0:e.gally)==null?void 0:r.input),(o=e.gally)==null?void 0:o.defaultValue)]}))}var m=class extends Error{};function K(t){return"error"in t||"violations"in t}function T(t){if(typeof window<"u")return localStorage.getItem(t)}function Ba(t,e){typeof window<"u"&&localStorage.setItem(t,e)}function I(t){typeof window<"u"&&localStorage.removeItem(t)}function ne(t){let e=t.toLocaleDateString("en-GB").replace(/-/g,"/"),r=t.toLocaleTimeString("en-GB",{hour12:!1});return`${e} ${r}`}function pe(t){return t.split(W).map(e=>{let r=/^(\d{2})\/(\d{2})\/(\d{4})\s(\d{2}):(\d{2}):(\d{2})$/,o=e.match(r);if(o){let[,s,a,w,n,h,l]=o;return new Date(Number(w),Number(a)-1,Number(s),Number(n),Number(h),Number(l))}return e})}function de(t){return Array.isArray(t)?t.map(e=>e instanceof Date?ne(e):String(_nullishCoalesce(e, () => ("")))).join(W):String(t)}function he(t){return t.some(e=>e!==""&&e!==null)}function Y(t,e={}){let r=t instanceof URL?t:new URL(t);return Object.entries(e).forEach(([o,s])=>{o.endsWith("[between]")?(s=s,he(s)&&r.searchParams.append(o,de(s))):s instanceof Array?s.forEach(a=>r.searchParams.append(o,String(a))):r.searchParams.append(o,String(s))}),r}function Ot(t){return[...t.searchParams.entries()].forEach(([e])=>t.searchParams.delete(e)),t}function ie(t=0,e={},r="",o){let s=o?`${o}_${j}`:j,a=o?`${o}_${S}`:S,w=o&&e?Object.fromEntries(Object.entries(e).map(([n,h])=>[`${o}_${n}`,h])):e;return typeof t=="number"?R({...w,[s]:t===0?"":t,[a]:r}):R({...e,[a]:r})}function Z(t=0,e=A,r={},o=""){return typeof t=="number"?R({...r,[j]:t+1,[N]:!0,[it]:e,[S]:o}):R({...r,[N]:!1,[S]:o})}function Tt(t){return new URL(`${window.location.origin}${t}`)}function $a(t){let e=Tt(t);return Ot(e).pathname}function Wa(t,e=0,r,o,s){let a=ie(e,r,o,s),w=Tt(t);return Y(Ot(w),a)}function Qa(t,e){return Object.fromEntries([...t.searchParams.entries()].reduce((r,[o,s])=>{var a;if(e){let w=`${e}_`;if(!o.startsWith(w))return r;o=o.substring(w.length)}if(o.endsWith("[between]"))r.push([o,pe(s)]);else if(o.endsWith("[]")){let w=(a=r.find(([n])=>n===o))==null?void 0:a[1];w?w.push(s):r.push([o,[s]])}else r.push([o,s]);return r},[]))}function Ka(t,e){let r=Object.entries(t).find(([o])=>o.replace(`${e}_`,"")===j);return Number(_nullishCoalesce((r==null?void 0:r[1]), () => (0)))}function Ya(t,e){let r=Object.entries(t).find(([o])=>o.replace(`${e}_`,"")===S);return String(_nullishCoalesce((r==null?void 0:r[1]), () => ("")))}var _inflection = require('inflection'); var _inflection2 = _interopRequireDefault(_inflection);function ue(t){return t[0].toUpperCase()+t.slice(1)}function ge(t){return t[0].toLowerCase()+t.slice(1)}function rs(t){return ge(t.substring(7))}function ye(t){return _inflection2.default.transform(t,["underscore","humanize"])}function os(t){return`${t} - Gally`}function tt(...t){return t.map(e=>e?e.slice(Number(e.at(0)==="/"),e.at(-1)==="/"?-1:void 0):"").join("/")}function as(t){return Object.keys(t).length===0}function ss(t,e){return Object.entries(t).reduce((r,[o,s])=>({...r,[e+ue(o)]:s}),{})}function ws(t){return t.join(` `)}function z(t,e){let{sourceWithoutDigits:r,sourceSuffix:o}=me(t),s=ye(o.replace(/\./g," "));return e?[`resources.${e}.fields.${r}`,s]:[`fields.${r}`,s]}function me(t){let e=t.replace(/\.\d+\./g,"."),r=t.split("."),o;r.forEach((a,w)=>{fe(a)&&(o=w)});let s=o!==null&&typeof o<"u"?r.slice(o+1).join("."):t;return{sourceWithoutDigits:e,sourceSuffix:s}}function fe(t){for(let e=t.length-1;e>=0;e--){let r=t.charCodeAt(e);if(r<48||r>57)return!1}return!0}function ls(t,e,r){return new Intl.NumberFormat(r,{style:"currency",currency:`${e}`}).format(t)}function ns(t,e){return e?e.charAt(0)===t?e.substring(1):e:null}function et(t){return t.split("/").pop()}function ps(t,e){return`/${process.env.NEXT_PUBLIC_API_ROUTE_PREFIX?process.env.NEXT_PUBLIC_API_ROUTE_PREFIX:k}/${t}/${e}`.replace(/\/+/g,"/")}function ds(t,e,r=!1){let o=Math.round((t+Number.EPSILON)*10**e)/10**e;return r?o.toFixed(e):o}function rt(t){let e=new Date(0);return e.setUTCFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e.setUTCHours(0,0,0,0),e}function hs(t){let e=(t||"").replace(/,/g,".").replace(/[^\d.]/g,""),r="",o=!1;for(let s of e){if(s==="."){if(o)continue;o=!0}r+=s}return r}function is(t){return t.replace(/\D/g,"")}var ot=class extends Error{};function be(t){return"code"in t&&"message"in t}function F(t=""){return t.startsWith("http")||(t.length&&!t.startsWith("/")&&(t=`/${t}`),t=`${L}${t}`),t}function Ts(t,e,r={},o={},s=!0){let a=F(typeof e=="string"?e:e.url),w=o.headers||{},n=!(f in w&&!w[f]),h=Object.fromEntries(Object.entries(w).filter(([i,y])=>Boolean(y))),l={[D]:t,...n&&{[f]:"application/ld+json"},...h},c=T(g);return s&&c&&(l[E]=`Bearer ${c}`),b(Y(a,r).href,{...o,headers:l}).then(({json:i,response:y})=>{if(be(i))throw C.includes(i.code)?(I(g),new m(i.message)):new ot(i.message);if(It(i)&&Ft(i))throw new _(i);if(C.includes(y.status))throw I(g),new m("Unauthorized/Forbidden");return i})}function xe(t){if(!t)return null;let e=t.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);return e!=null&&e[1]?e[1].replace(/['"]/g,""):null}function Rs(t,e=!0){let r=T(g),o={};e&&r&&(o[E]=`Bearer ${r}`);let s=F(typeof t=="string"?t:t.url);return St(s,{headers:o}).then(({content:a,response:w})=>{if(C.includes(w.status))throw I(g),new m("Unauthorized/Forbidden");return{content:a,contentType:w.headers.get(f),filename:_nullishCoalesce(xe(w.headers.get(ht)), () => ("")),status:w.status!==200?0:3}})}function R(t={}){return Object.fromEntries(Object.entries(t).filter(([e,r])=>(_nullishCoalesce(r, () => ("")))!==""))}function at(t){return t instanceof Date?t.toISOString():t}function ve(t,e){let r=Q(t);return[e[0]instanceof Date?`${r}[after]`:`${r}[gte]`,e[1]instanceof Date?`${r}[before]`:`${r}[lte]`]}function Ce(t){let e=rt(t);return e.setUTCHours(0,0,0,0),e}function Se(t){let e=rt(t);return e.setUTCHours(23,59,59,999),e}function Ie(t,e){let r=ve(t,e),o=[];if(e[0]!==""){let s=e[0]instanceof Date?Ce(e[0]):e[0];o.push([r[0],at(s)])}if(e[1]!==""){let s=e[1]instanceof Date?Se(e[1]):e[1];o.push([r[1],at(s)])}return o}function Ls(t={}){return Object.fromEntries(Object.entries(t).reduce((e,[r,o])=>(r.endsWith("[between]")?e.push(...Ie(r,o)):e.push([r,at(o)]),e),[]))}function Ds(t,e){if(!t&&!e||!t&&e)return!1;if(t&&!e)return!0;let r={...t};return Object.keys(r).forEach(o=>{o in e&&delete r[o]}),Object.keys(r).length>0}async function As(t,e,r,o,s=A){let a=0,w=Z(a,s,r),n=await t(e,w,o);if(K(n))return{error:n.error,status:0};let h=n["hydra:totalItems"],l=[];for(;h>(a+1)*s;a++)w=Z(a+1,s,r),l.push(t(e,w,o));let c=await Promise.all(l),i=[],y=c.flatMap(x=>K(x)?(i.push(x),[]):x["hydra:member"]);return i.length>0?{error:i[0].error,status:0}:(n["hydra:member"].push(...y),{data:n,status:3})}function qs(t){if(typeof t=="string")return[t];let e=[t[0]];for(let r=0;r<t.length-1;r++)e.push(`${e[r]}_${t[r+1]}`);return e}function Fe(t,e,r,o=0){if(typeof r=="object"){for(let s in r)if(r[s].code===e[o])return t===o?r[s].label:Fe(t,e,r[s].children,o+1)}return null}function zs(t){return t.includes("GallyVirtualCategoryBundle")}function Us(t){return t.includes("GallySearchUsageBundle")}function Pe(t){let e=t?t.filter(r=>r.localizedCatalogs.find(o=>o.isDefault))[0]:null;return e?{...e,localizedCatalogs:e.localizedCatalogs.filter(r=>r.isDefault)}:null}function Ee(t){var r;let e=Pe(t);return(r=e==null?void 0:e.localizedCatalogs)==null?void 0:r[0]}function Ns(t,e,r){if(e){if(e&&!r)return t.filter(o=>o.id===e.id).map(o=>o.localizedCatalogs[0]).flat()[0]}else return Ee(t);return r}function Hs(t,e){let r;return t.some(o=>(r=new Map(o==null?void 0:o.localizedCatalogs.map(a=>[String(a.id),a])).get(String(e)),r)),r}function je(t,e){t.forEach(r=>{e.push(r),r.children&&je(r.children,e)})}function Rt(t,e,r=" / "){var s;let o="";if(t.length>0){let a=e.find(w=>w.id===t[0]);if(!a)return console.error(`Wrong path ${t.join("/")}`),`/${t.join("/")}`;if(a.level===1){let[w,...n]=t;return Rt(n,_nullishCoalesce((a==null?void 0:a.children), () => ([])),r)}t.shift(),o=(a==null?void 0:a.name)+(((s=a==null?void 0:a.children)==null?void 0:s.length)>0&&t.length>0?r:"")+Rt(t,_nullishCoalesce((a==null?void 0:a.children), () => ([])),r)}return o}function $s(t,e){var o;let r=Boolean(t==null?void 0:t.localizedCatalog)&&Boolean(t==null?void 0:t.requestType);return e==="category"?r=r&&Boolean(t==null?void 0:t.category):e==="search"&&(r=r&&Boolean((o=t==null?void 0:t.search)==null?void 0:o.trim())),r}function Ws(t,e){let r={...t};return e==="category"?delete r.search:e==="search"&&delete r.category,r}var Oe=(r=>(r.GRID="grid",r.FORM="form",r))(Oe||{});function Te(t){return t==null?void 0:t.replaceAll("/","_").replace("_admin_","")}function Ks(t,e,r){var a,w,n;let o=t;e=Te(e);let s=(a=t.gally)==null?void 0:a[r];if(s&&(o={...o,gally:{...t.gally,...s}}),(w=t.gally)!=null&&w.context){let h=Object.entries((n=t.gally)==null?void 0:n.context).find(([l,c])=>l===e);h&&(o={...o,gally:{...t.gally,...h[1]}})}return o}function Ys(t){var e;return Boolean((e=t.gally)==null?void 0:e.options)}function Zs(t){return"values"in t&&t.values.length>0}function Lt(t,e){if(!Array.isArray(e))return t[e.field]===e.value;let r=!1,o=0;for(;!r&&o<e.length;){let s=e[o];if(Array.isArray(s))r=s.every(({field:a,value:w})=>t[a]===w);else{let{field:a,value:w}=s;r=t[a]===w}o++}return r}function Re(t,e,r={}){if(!t)return{};if(!(e!=null&&e.conditions))return r;let{conditions:o,type:s}=e,a={};switch(s){case"visible":a.visible=Lt(t,o);break;case"enabled":a.disabled=!Lt(t,o)}return{...a,...r}}function tw(t,e,r={}){let{visible:o,...s}=Re(t,e,r);return s}function ew(t){return"children"in t}function ow(t){for(let e in t)if(t[e])return e}function Le(t,e,r){if(!t||!e)return[];let o=[];return t.requestTypes.filter(s=>!s.applyToAll).forEach(s=>{var h;let a=(h=e.find(l=>l.value===s.requestType))==null?void 0:h.limitationType,w=t[`${a}Limitations`],n=w==null?void 0:w.find(l=>(l==null?void 0:l.queryText)===null);switch(a){case"category":(w==null?void 0:w.length)===0&&o.push(r("empty.categoryLimitations"));return;case"search":(w==null?void 0:w.length)===0?o.push(r("empty.searchLimitations")):n&&o.push(r("empty.searchLimitations.queryText"))}}),o}function aw(t,e,r){var o;return((o=Le(t,e,r))==null?void 0:o.length)===0}function De(t){let e=[];return t.forEach(r=>{if(r.terms.length===0)e.push("synonym.error_message.terms.size.invalid");else{r.terms.length<2?e.push("synonym.error_message.terms.size.invalid"):r.terms.forEach(s=>{(s.term===void 0||s.term==="")&&e.push("synonym.error_message.terms.size.invalid")});let o=r.terms.map(s=>s.term);o.length!==[...new Set(o)].length&&e.push("synonym.error_message.terms.duplicate")}}),[...new Set(e)]}function sw(t){return De(t).length===0}function Ae(t){let e=[],r=[];return t.forEach(o=>{if(o.referenceTerm===void 0||o.referenceTerm===""?e.push("expansion.error_message.reference_term.empty"):r.push(o.referenceTerm),o.terms.length===0)e.push("expansion.error_message.expansion_terms.empty");else{o.terms.forEach(a=>{(a.term===void 0||a.term==="")&&e.push("expansion.error_message.expansion_terms.empty")});let s=o.terms.map(a=>a.term);s.length!==[...new Set(s)].length&&e.push("expansion.error_message.expansion_terms.duplicate")}}),r.length!==[...new Set(r)].length&&e.push("expansion.error_message.reference_terms.duplicate"),[...new Set(e)]}function ww(t){return Ae(t).length===0}var st=class extends Error{constructor(r){super(r[0].message);this.errors=r}};function Me(t){return"errors"in t}function iw(t,e,r,o={},s=!0){let a={[D]:t,[f]:"application/json",...o.headers},w=T(g);return s&&w&&(a[E]=`Bearer ${w}`),b(dt,{body:JSON.stringify({query:e,variables:r}),method:"POST",...o,headers:a}).then(({json:n,response:h})=>{if(Me(n))throw new st(n.errors);if(C.includes(h.status))throw I(g),new m("Unauthorized/Forbidden");return n.data})}function uw(t){return t.displayName||t.name||"Component"}function yw(t){let e=t.localizedCatalogs.map(r=>r.localName);return[...new Set(e)]}function fw(t,e){(process.env.NODE_ENV==="development"||typeof window<"u"&&window.showErrors===!0)&&console.error(t),e&&e(typeof t=="string"?t:t.message)}function xw(t,e){return Object.entries(t).map(([r,o])=>({value:o,label:e(r)}))}var _jsonld = require('jsonld'); var _jsonld2 = _interopRequireDefault(_jsonld);function qe(t,e){if(process.env.NEXT_PUBLIC_LOCAL)return`${e}/docs.jsonld`;let r=t.get("Link");if(r)return xt.exec(r)[1]}async function _e(t){let{json:e,response:r}=await b(t,{headers:{"Content-Type":"application/ld+json"}}),o=qe(r.headers,t),{json:s}=await b(o,{headers:{"Content-Type":"application/ld+json"}}),[a,w]=await Promise.all([_jsonld2.default.expand(s,{base:o}),_jsonld2.default.expand(e,{base:t})]);return{docs:a[0],docsUrl:o,entrypoint:w[0],entrypointUrl:t}}function Ge(t){return new Map(t["http://www.w3.org/ns/hydra/core#supportedClass"].map(e=>[e["@id"],e]))}function ze(t){return"http://www.w3.org/2002/07/owl#equivalentClass"in t}function Ue(t,e){if(e["http://www.w3.org/2000/01/rdf-schema#range"]instanceof Array){for(let r of e["http://www.w3.org/2000/01/rdf-schema#range"])if(ze(r)){let o=r["http://www.w3.org/2002/07/owl#equivalentClass"][0]["http://www.w3.org/2002/07/owl#onProperty"][0]["@id"],s=r["http://www.w3.org/2002/07/owl#equivalentClass"][0]["http://www.w3.org/2002/07/owl#allValuesFrom"][0]["@id"];if(s&&o==="http://www.w3.org/ns/hydra/core#member")return t.get(s)}}for(let r of e["http://www.w3.org/ns/hydra/core#supportedOperation"]||[]){if(!r["http://www.w3.org/ns/hydra/core#returns"])continue;let o=r["http://www.w3.org/ns/hydra/core#returns"][0]["@id"];if(typeof o=="string"&&o.indexOf("http://www.w3.org/ns/hydra/core")!==0)return t.get(o)}}function U(t){return"@value"in t?t["@value"]:Object.fromEntries(Object.entries(t).map(([e,r])=>{let o=e.substring(e.lastIndexOf("#")+1);return r instanceof Array?r.length===1?r[0]instanceof Object?[o,U(r[0])]:[o,r[0]]:r[0]instanceof Object?[o,r.map(U)]:[o,r]:r instanceof Object?[o,U(r)]:[o,r]}))}async function At(t){let{docs:e,entrypoint:r}=await _e(t),o=Ge(e),s=o.get(r["@type"][0]),a=[];return s&&(a=s["http://www.w3.org/ns/hydra/core#supportedProperty"].reduce((w,n)=>{if(n["http://www.w3.org/ns/hydra/core#property"][0]){let[h]=n["http://www.w3.org/ns/hydra/core#property"],l=Ue(o,h);if(l&&r[h["@id"]]){let c=U({...l,"http://www.w3.org/ns/hydra/core#supportedOperation":[...h["http://www.w3.org/ns/hydra/core#supportedOperation"],...l["http://www.w3.org/ns/hydra/core#supportedOperation"]]}),[i]=r[h["@id"]];w.push({...c,url:typeof i=="string"?i:i["@id"]})}}return w},[])),a}function jw(t,e){let r=[...t],o=Object.fromEntries(e.map(({position:s,productId:a})=>[a,s]));return r.sort((s,a)=>o[et(s.id)]-o[et(a.id)])}function Ow(t,e){var r;return(r=e.find(o=>t===o.id))==null?void 0:r.limitationType}function Tw(t){return t?"stock.inStock":"stock.outOfStock"}function wt(t){return t.type==="combination"}function qt(t){return t.type==="attribute"}function Ne(t,e){var r;return(r=e[t.attribute_type])==null?void 0:r[t.operator]}function He(t){return(t==null?void 0:t.startsWith("["))&&(t==null?void 0:t.endsWith("]"))}function _t(t){return wt(t)?{...t,value:t.value==="true",children:t.children.map(e=>_t(e))}:t}function Nw(t){let e;try{e=_t(JSON.parse(t.virtualRule))}catch (e3){e=vt}return{...t,virtualRule:e}}function Gt(t,e){if(wt(t))return{...t,value:String(t.value),children:t.children.map(r=>Gt(r,e))};if(qt(t)){let r=t.value,o=Ne(t,e.operatorsValueType);return He(o)&&t.value instanceof Array?$.includes(o.slice(1,-1))?r=t.value.map(Number):r=t.value.map(String):$.includes(o)?r=Number(t.value):("date"||"datetime")&&r instanceof Date?_datefns.isValid.call(void 0, r)&&(r=t.attribute_type==="date"?r.toISOString().split("T")[0]:r.toISOString()):o==="String"&&(r=String(t.value)),{...t,value:r}}return t}function Hw(t,e){return t.virtualRule?{...t,virtualRule:JSON.stringify(Gt(t.virtualRule,e))}:t}function Bw(t){let e={...t};return t.id||(delete e["@id"],delete e.id),e}function Be(t){return _datefns.isValid.call(void 0, t instanceof Date?t:_datefns.parseISO.call(void 0, t))}function Xe(t){if(t){if(wt(t))return t.children.every(Xe);if(qt(t)){let e=t.attribute_type==="date"?Be(t.value):t.value!=="";return t.field!==""&&t.operator!==""&&e}}else return!0;return!0}function Vw(t){return{"&::-webkit-scrollbar":{position:"sticky",bottom:"150px",height:"4px",width:"4px"},"&::-webkit-scrollbar-track":{backgroundColor:`${t.palette.colors.white}`,top:"15px"},"&::-webkit-scrollbar-thumb":{backgroundColor:`${t.palette.neutral.main}`,borderRadius:"15px",top:"15px"}}}function Ve(t){let e=O(t);return e==="boolean"?"boolean":e==="integer"||e==="float"||e==="percentage"?"number":"string"}var Je=Object.values(M);function $e(t){return Je.includes(t)}function zt(t,e){var r;return((r=t.gally)==null?void 0:r.input)&&$e(t.gally.input)?t.gally.input:e}var P={prompt:{attribute:"pattern",value:"^(?:(?!%)[\\s\\S])*%s(?:(?!%)[\\s\\S])*$",error:{name:"patternMismatch",message:"prompt"}},email:{attribute:"type",value:"email",error:{name:"typeMismatch",message:"typeMismatchEmail"}}};function Ut(t){var s,a,w;let e={},r={},o=!1;return Object.entries(((s=t.gally)==null?void 0:s.validation)||{}).forEach(([n,h])=>{P[n]&&h?(e[P[n].attribute]=P[n].value,r[P[n].error.name]=P[n].error.message,o=!0):!P[n]&&typeof h!="boolean"&&(e[n]=h)}),{depends:(a=t.gally)==null?void 0:a.depends,field:t,suffix:((w=t.gally)==null?void 0:w.input)==="percentage"?"%":"",validation:e,showError:o,replacementErrorsMessages:r}}function sl(t,e){var w,n,h,l,c,i,y,x,lt,nt,pt;let r=Ut(t),o=Ve(t),s=t.title,a=zt(t,o);return{...r,editable:((w=t.gally)==null?void 0:w.editable)&&t.writeable,fieldset:(n=t.gally)==null?void 0:n.fieldset,gridHeaderInfoTooltip:(h=t.gally)==null?void 0:h.gridHeaderInfoTooltip,id:s,input:a,infoTooltip:(l=t.gally)==null?void 0:l.infoTooltip,label:_nullishCoalesce(t.property.label, () => (e(...z(t.title)))),name:s,required:_nullishCoalesce(((c=t.gally)==null?void 0:c.required), () => (t.required)),type:o,multipleValueFormat:(i=t.gally)==null?void 0:i.multipleValueFormat,requestTypeConfigurations:(y=t.gally)==null?void 0:y.requestTypeConfigurations,multipleInputConfiguration:(x=t.gally)==null?void 0:x.multipleInputConfiguration,placeholder:(lt=t.gally)==null?void 0:lt.placeholder,defaultValue:(nt=t.gally)==null?void 0:nt.defaultValue,sticky:(pt=t.gally)==null?void 0:pt.sticky}}function We(t){return t.multiple?"select":bt.test(t.property)?"boolean":"string"}function wl(t,e){let r=Ut(t.field),o=We(t),s=t.variable,a=zt(t.field,o);return{...r,editable:!0,id:s,input:a!=="date"&&t.variable.endsWith("[between]")?"range":a,label:t.field?_nullishCoalesce(t.field.property.label, () => (e(...z(t.field.title)))):e(...z(t.property)),multiple:t.multiple,name:s,required:!1,type:o}}function kt(t){return t.variable.endsWith("[before]")||t.variable.endsWith("[strictly_before]")||t.variable.endsWith("[after]")||t.variable.endsWith("[strictly_after]")}function Qe(t){return t.variable.endsWith("[lt]")||t.variable.endsWith("[gt]")||t.variable.endsWith("[lte]")||t.variable.endsWith("[gte]")}function Ke(t,e){return t?Object.values(t.reduce((r,o)=>{let a=`${o.variable.replace(/\[(before|strictly_before|after|strictly_after)\]$/,"")}[between]`;return kt(o)&&!r[a]&&(r[a]={...o,variable:a,field:G(e,o.property),multiple:o.variable.endsWith("[]")}),r},{})):[]}function ll(t,e){let r=Ke(t==null?void 0:t["hydra:search"]["hydra:mapping"],e),o=t==null?void 0:t["hydra:search"]["hydra:mapping"].filter(a=>!Qe(a)&&!kt(a)).map(a=>({...a,field:G(e,a.property),multiple:a.variable.endsWith("[]")})).filter(a=>a.field).concat(r),s=o.filter(a=>a.multiple).map(a=>a.property);return o==null?void 0:o.filter(a=>{var w;return(w=a.field.gally)==null?void 0:w.visible}).filter(a=>!s.includes(a.property)||a.multiple).sort((a,w)=>{var n,h;return((n=a.field.gally)==null?void 0:n.position)-((h=w.field.gally)==null?void 0:h.position)})}function Ye(t){return typeof t=="object"&&"path"in t?t.path:t}function Ze(t){return typeof t=="object"&&"path"in t&&"icons"in t}function nl(t,e){let r=e;return typeof r!="string"&&Ze(e)?r={...r,path:tt(t,r.path)}:r=tt(t,Ye(r)),r}var _jwtdecode = require('jwt-decode'); var _jwtdecode2 = _interopRequireDefault(_jwtdecode);function hl(t){return Boolean(t&&Date.now()/1e3<t.exp)}function il(t,e){return Boolean(e)&&e.roles.includes(t)}function cl(t){return _jwtdecode2.default.call(void 0, t)}function Vl(){let[t,e]=_react3.useState.call(void 0, {status:1});return _react3.useEffect.call(void 0, ()=>{t.status===1&&(e({status:2}),At(F()).then(r=>e({status:3,data:r})).catch(r=>e({error:r,status:0})))},[t.status]),t}var Ql={"@type":"http://www.w3.org/ns/hydra/core#SupportedProperty",gally:{input:"select",options:{values:[{value:"test1",label:"option_test1"},{value:"test2",label:"option_test2"}]},editable:!1,position:10,visible:!0},property:{"@id":"https://localhost/docs.jsonld#SourceField/code","@type":"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",domain:{"@id":"https://localhost/docs.jsonld#SourceField"},range:{"@id":"http://www.w3.org/2001/XMLSchema#string"},label:"Attribute code"},readable:!0,required:!0,title:"code",writeable:!0},Kl= exports.fieldDropdownWithContext ={"@type":"http://www.w3.org/ns/hydra/core#SupportedProperty",gally:{input:"select",options:{values:[{value:"test1",label:"option_test1"},{value:"test2",label:"option_test2"}]},editable:!1,position:10,visible:!0,context:{search_configuration_attributes:{visible:!1,position:30}}},property:{"@id":"https://localhost/docs.jsonld#SourceField/code","@type":"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",domain:{"@id":"https://localhost/docs.jsonld#SourceField"},range:{"@id":"http://www.w3.org/2001/XMLSchema#string"},label:"Attribute code"},readable:!0,required:!0,title:"code",writeable:!0},Yl= exports.fieldWithContextAndMainContext ={"@type":"http://www.w3.org/ns/hydra/core#SupportedProperty",gally:{context:{search_configuration_attributes:{visible:!0}},editable:!0,position:60,visible:!0,form:{visible:!1}},property:{"@id":"http://localhost:6006//docs.jsonld#SourceField/isSortable","@type":"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",domain:{"@id":"http://localhost:6006//docs.jsonld#SourceField"},range:{"@id":"http://www.w3.org/2001/XMLSchema#boolean"},label:"Sortable"},readable:!0,required:!1,title:"isSortable",writeable:!0},Zl= exports.fieldDropdownWithApiOptions ={"@type":"http://www.w3.org/ns/hydra/core#SupportedProperty",gally:{input:"select",options:{api_rest:"/product_sorting_options"},editable:!1,position:10,visible:!0},property:{"@id":"https://localhost/docs.jsonld#SourceField/code","@type":"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",domain:{"@id":"https://localhost/docs.jsonld#SourceField"},range:{"@id":"http://www.w3.org/2001/XMLSchema#string"},label:"Attribute code"},readable:!0,required:!0,title:"code",writeable:!0},Nt= exports.resources =[{"@id":"https://localhost/docs.jsonld#Index","@type":"http://www.w3.org/ns/hydra/core#Class",supportedOperation:[{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/FindAction"],method:"GET",title:"Retrieves the collection of Index resources.",label:"Retrieves the collection of Index resources.",returns:{"@id":"http://www.w3.org/ns/hydra/core#Collection"}},{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/CreateAction"],expects:{"@id":"https://localhost/docs.jsonld#Index"},method:"POST",title:"Creates a Index resource.",label:"Creates a Index resource.",returns:{"@id":"https://localhost/docs.jsonld#Index"}},{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/FindAction"],method:"GET",title:"Retrieves Index resource.",label:"Retrieves Index resource.",returns:{"@id":"https://localhost/docs.jsonld#Index"}},{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/DeleteAction"],method:"DELETE",title:"Deletes the Index resource.",label:"Deletes the Index resource.",returns:{"@id":"http://www.w3.org/2002/07/owl#Nothing"}},{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/ReplaceAction"],expects:{"@id":"https://localhost/docs.jsonld#Index"},method:"PUT",title:"Replaces the Index resource.",label:"Replaces the Index resource.",returns:{"@id":"https://localhost/docs.jsonld#Index"}},{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/ReplaceAction"],expects:{"@id":"https://localhost/docs.jsonld#Index"},method:"PUT",title:"Replaces the Index resource.",label:"Replaces the Index resour