PageSourceSearch

https://portal.keravanenergia.fi/_next/static/chunks/pages/_sites/[site]/admin/feedback-8b409bceb18e1486.js

js keravanenergia.fi collected 2026-09-25 05:05:39 UTC 14,157 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4167],{9214:(e,s,l)=>{"use strict";l.d(s,{v:()=>g});var i=l(37876),a=l(36385),n=l(19848);l(14232);var r=l(46249),d=l(1609),t=l(99545),c=l(88791),o=l(5412),h=l(87242),x=l(80385),u=l(35860);let[b,m]=(0,l(67003).e)();function j(e){let{value:s,defaultValue:l,onChange:a,multiple:r,children:d}=(0,t.Y)("ChipGroup",null,e),[c,o]=(0,n.Z)({value:s,defaultValue:l,finalValue:r?[]:null,onChange:a});return(0,i.jsx)(b,{value:{isChipSelected:e=>Array.isArray(c)?c.includes(e):e===c,onChange:e=>{let s=e.currentTarget.value;Array.isArray(c)?o(c.includes(s)?c.filter(e=>e!==s):[...c,s]):o(s)},multiple:r},children:d})}j.displayName="@mantine/core/ChipGroup";var p={root:"m_f59ffda3",label:"m_be049a53","label--outline":"m_3904c1af","label--filled":"m_fa109255","label--light":"m_f7e165c3",iconWrapper:"m_9ac86df9",checkIcon:"m_d6d72580",input:"m_bde07329"};let v={type:"checkbox"},f=(0,d.V)((e,{size:s,radius:l,variant:i,color:a,autoContrast:n})=>{let d=e.variantColorResolver({color:a||e.primaryColor,theme:e,variant:i||"filled",autoContrast:n});return{root:{"--chip-fz":(0,r.ny)(s),"--chip-size":(0,r.YC)(s,"chip-size"),"--chip-radius":void 0===l?void 0:(0,r.nJ)(l),"--chip-checked-padding":(0,r.YC)(s,"chip-checked-padding"),"--chip-padding":(0,r.YC)(s,"chip-padding"),"--chip-icon-size":(0,r.YC)(s,"chip-icon-size"),"--chip-bg":a||i?d.background:void 0,"--chip-hover":a||i?d.hover:void 0,"--chip-color":a||i?d.color:void 0,"--chip-bd":a||i?d.border:void 0,"--chip-spacing":(0,r.YC)(s,"chip-spacing")}}}),g=(0,x.P9)((e,s)=>{let l=(0,t.Y)("Chip",v,e),{classNames:r,className:d,style:x,styles:b,unstyled:j,vars:g,id:k,checked:C,defaultChecked:_,onChange:w,value:F,wrapperProps:y,type:E,disabled:A,children:z,size:I,variant:B,icon:S,rootRef:L,autoContrast:N,mod:T,attributes:Y,...P}=l,V=(0,c.I)({name:"Chip",classes:p,props:l,className:d,style:x,classNames:r,styles:b,unstyled:j,attributes:Y,vars:g,varsResolver:f}),R=m(),Z=(0,a.B)(k),{styleProps:G,rest:J}=(0,o.j)(P),[W,$]=(0,n.Z)({value:C,defaultValue:_,finalValue:!1,onChange:w}),D=R?{checked:R.isChipSelected(F),onChange:e=>{R.onChange(e),w?.(e.currentTarget.checked)},type:R.multiple?"checkbox":"radio"}:{},H=D.checked||W;return(0,i.jsxs)(h.a,{size:I,variant:B,ref:L,mod:T,...V("root"),...G,...y,children:[(0,i.jsx)("input",{type:E,...V("input"),checked:H,onChange:e=>$(e.currentTarget.checked),id:Z,disabled:A,ref:s,value:F,...D,...J}),(0,i.jsxs)("label",{htmlFor:Z,"data-checked":H||void 0,"data-disabled":A||void 0,...V("label",{variant:B||"filled"}),children:[H&&null!==S&&!1!==S&&(0,i.jsx)("span",{...V("iconWrapper"),children:void 0===S?(0,i.jsx)(u.S,{...V("checkIcon")}):S}),(0,i.jsx)("span",{children:z})]})]})});g.classes=p,g.displayName="@mantine/core/Chip",g.Group=j},18987:(e,s,l)=>{"use strict";l.d(s,{A:()=>o});var i=l(37876),a=l(87242),n=l(30455),r=l(79021),d=l(61226),t=l(45050),c=l(29369);function o(e){let{children:s,feature:l,faded:o=!1,fadedMessage:h}=e,{hasFeature:x}=(0,c.Z)();return x(l)?s:o?(0,i.jsxs)(a.a,{pos:"relative",children:[s,(0,i.jsx)(n.h,{component:r.B,blur:2,color:"#f0f0f0",backgroundOpacity:.05,radius:"md",zIndex:10,align:"center",pt:150,children:h&&(0,i.jsx)(d.Z,{shadow:"lg",padding:"lg",radius:"lg",withBorder:!0,bg:"secondary",maw:600,children:(0,i.jsx)(t.E,{size:"lg",c:"fadedText",children:h})})})]}):null}},70994:(e,s,l)=>{"use strict";l.r(s),l.d(s,{__N_SSP:()=>T,default:()=>Y});var i=l(37876),a=l(11045),n=l(96851),r=l(18987),d=l(14232),t=l(88556),c=l(79021),o=l(69110),h=l(74188),x=l(87082),u=l(62899),b=l(83888),m=l(45050),j=l(61342),p=l(11871),v=l(91932),f=l(83331),g=l(92724),k=l(6381),C=l(11259),_=l(71033),w=l(35211);let F=()=>{let e=(0,n.c)("feedback");return(0,i.jsx)(t.L,{variant:"filled",legend:e("preview"),children:(0,i.jsxs)(c.B,{children:[(0,i.jsx)(o.z,{label:e("select-rating"),styles:{label:{marginBottom:12}},withAsterisk:!0,children:(0,i.jsxs)(h.Y,{children:[(0,i.jsx)(x.s,{value:"1",label:e("rating-label-1")}),(0,i.jsx)(x.s,{value:"2",label:e("rating-label-2")}),(0,i.jsx)(x.s,{value:"3",label:e("rating-label-3")}),(0,i.jsx)(x.s,{value:"4",label:e("rating-label-4")}),(0,i.jsx)(x.s,{value:"5",label:e("rating-label-5")})]})}),(0,i.jsx)(u.T,{label:e("open-text-label"),styles:{label:{marginBottom:12}},rows:6})]})})};function y(e){var s,l;let{site:r}=e,o=(0,n.c)("pages.admin.feedback.forms"),h=(0,d.useRef)(null),{data:x,isLoading:u}=(0,C.WB)({siteId:r.id}),[y,{isLoading:E}]=(0,C.Ru)(),[A,{isLoading:z,isSuccess:I}]=(0,C.df)(),[B,{isLoading:S,isSuccess:L}]=(0,C.Mo)(),N=k.z.object({feedbackForms:k.z.array(k.z.object({id:k.z.string(),active:k.z.boolean(),renew:k.z.boolean(),clear:k.z.boolean()}))}),T=(0,v.m)({validate:(0,g.u)(N),initialValues:{feedbackForms:[]}});(0,d.useEffect)(()=>{T.setValues({feedbackForms:(null==x?void 0:x.length)?x.map(e=>({id:e.id,active:e.active,renew:!1,clear:!1})):[]})},[x]);let Y=async e=>{0===e.feedbackForms.length?y({siteId:r.id}
1):e.feedbackForms.forEach(e=>{A({siteId:r.id,formId:e.id,active:e.active,renew:e.renew}),e.clear&&B({siteId:r.id,formId:e.id})})},P=(e,s)=>{let l=!T.values.feedbackForms[e][s];T.setFieldValue("feedbackForms.".concat(e,".").concat(s),l)},V=()=>{var e;return!!(null==(e=T.values.feedbackForms)?void 0:e.find(e=>e.renew))},R=()=>{var e,s;return!!(null==(s=T.values)||null==(e=s.feedbackForms)?void 0:e.find(e=>e.clear))};return(0,i.jsx)(w.A,{title:o("title"),description:o("description"),buttonLabel:(null==x?void 0:x.length)?o("buttons.save"):o("buttons.add"),buttonColor:V()||R()?"red":void 0,withFooter:!0,onButtonClick:()=>{var e;null==(e=h.current)||e.dispatchEvent(new Event("submit",{bubbles:!0}))},isButtonLoading:u||E||z||S,isLoading:u,skeletonHeight:40,children:(0,i.jsxs)(c.B,{children:[I&&(0,i.jsx)(b.F,{variant:"filled",icon:(0,i.jsx)(f.A,{}),color:"green",children:o("alerts.changes-submitted")}),L&&(0,i.jsx)(b.F,{variant:"outline",icon:(0,i.jsx)(f.A,{}),color:"red",children:o("alerts.delete-submitted")}),(0,i.jsxs)("form",{ref:h,onSubmit:T.onSubmit(Y),children:[!(null==(s=T.values.feedbackForms)?void 0:s.length)&&(0,i.jsx)(b.F,{children:o("alerts.no-feedback-forms")}),!!(null==(l=T.values.feedbackForms)?void 0:l.length)&&T.values.feedbackForms.map((e,s)=>{var l,n,r;return(0,i.jsx)(t.L,{children:(0,i.jsxs)(c.B,{children:[(0,i.jsx)(F,{}),(0,i.jsxs)(a.x,{children:[(0,i.jsx)(a.x.Col,{span:{base:12,sm:4},children:(0,i.jsx)(m.E,{fw:700,children:o("labels.submissions")})}),(0,i.jsx)(a.x.Col,{span:{base:12,sm:8},children:(0,i.jsx)(m.E,{fw:700,children:(null==x||null==(l=x[s])?void 0:l.submissions)||0})})]}),(0,i.jsx)(j.c,{}),(0,i.jsxs)(a.x,{children:[(0,i.jsx)(a.x.Col,{span:{base:12,sm:4},children:(0,i.jsx)(m.E,{fw:700,children:o("labels.average-rating")})}),(0,i.jsx)(a.x.Col,{span:{base:12,sm:8},children:(0,i.jsx)(m.E,{fw:700,children:(null==x||null==(n=x[s])?void 0:n.averageRating)?Number(x[s].averageRating).toFixed(2):"0"})})]}),(0,i.jsx)(j.c,{}),(0,i.jsxs)(a.x,{children:[(0,i.jsx)(a.x.Col,{span:{base:12,sm:4},children:(0,i.jsx)(m.E,{children:o("labels.renewed-at")})}),(0,i.jsx)(a.x.Col,{span:{base:12,sm:8},children:(null==x||null==(r=x[s])?void 0:r.refreshedAt)?_.A.formatDateTimeToString(x[s].refreshedAt)||"":"-"})]}),(0,i.jsx)(j.c,{}),(0,i.jsxs)(a.x,{children:[(0,i.jsx)(a.x.Col,{span:{base:12,sm:4},children:(0,i.jsx)(m.E,{children:o("labels.active")})}),(0,i.jsx)(a.x.Col,{span:{base:12,sm:8},children:(0,i.jsx)(p.S,{size:"md",value:!0,...T.getInputProps("feedbackForms.".concat(s,".active"),{type:"checkbox"}),onChange:e=>{P(s,"active")}})})]}),(0,i.jsx)(j.c,{}),(0,i.jsxs)(a.x,{children:[(0,i.jsx)(a.x.Col,{span:{sm:12,md:4},children:(0,i.jsx)(m.E,{children:o("labels.renew")})}),(0,i.jsx)(a.x.Col,{span:{base:12,sm:8},children:(0,i.jsx)(p.S,{size:"md",color:"red",value:!0,...T.getInputProps("feedbackForms.".concat(s,".renew"),{type:"checkbox"}),onChange:e=>{P(s,"renew")}})})]}),(0,i.jsx)(j.c,{}),(0,i.jsxs)(a.x,{children:[(0,i.jsx)(a.x.Col,{span:{sm:12,md:4},children:(0,i.jsx)(m.E,{children:o("labels.clear")})}),(0,i.jsx)(a.x.Col,{span:{base:12,sm:8},children:(0,i.jsx)(p.S,{size:"md",color:"red",value:!0,...T.getInputProps("feedbackForms.".concat(s,".clear"),{type:"checkbox"}),onChange:e=>{P(s,"clear")}})})]})]})},e.id)})]}),V()&&(0,i.jsx)(b.F,{variant:"filled",icon:(0,i.jsx)(f.A,{}),color:"red",children:o("alerts.will-renew")}),R()&&(0,i.jsx)(b.F,{variant:"filled",icon:(0,i.jsx)(f.A,{}),color:"red",children:o("alerts.will-clear")})]})})}var E=l(44193),A=l(9214),z=l(65984);let I=e=>{let{submission:s}=e,l=(0,n.c)("pages.admin.feedback.list.submission");return(0,i.jsx)(t.L,{children:(0,i.jsxs)(c.B,{children:[(0,i.jsxs)(a.x,{children:[(0,i.jsx)(a.x.Col,{span:{base:12,sm:4},children:(0,i.jsx)(m.E,{children:l("user-name")})}),(0,i.jsx)(a.x.Col,{span:{base:12,sm:8},children:(0,i.jsx)(m.E,{children:s.userName})})]}),(0,i.jsx)(j.c,{}),(0,i.jsxs)(a.x,{children:[(0,i.jsx)(a.x.Col,{span:{base:12,sm:4},children:(0,i.jsx)(m.E,{children:l("created-at")})}),(0,i.jsx)(a.x.Col,{span:{base:12,sm:8},children:(0,i.jsx)(m.E,{children:_.A.formatDateTimeToString(s.createdAt)})})]}),(0,i.jsx)(j.c,{}),(0,i.jsxs)(a.x,{children:[(0,i.jsx)(a.x.Col,{span:{base:12,sm:4},children:(0,i.jsx)(m.E,{children:l("rating")})}),(0,i.jsx)(a.x.Col,{span:{base:12,sm:8},children:(0,i.jsx)(m.E,{children:s.rating})})]}),(0,i.jsx)(j.c,{}),(0,i.jsxs)(a.x,{children:[(0,i.jsx)(a.x.Col,{span:{base:12,sm:4},children:(0,i.jsx)(m.E,{children:l("open-text")})}),(0,i.jsx)(a.x.Col,{span:{base:12,sm:8},children:(0,i.jsx)(m.E,{style:{whiteSpace:"pre-line"},children:s.openText||"-"})})]})]})})},B=e=>{let{form:s,submissions:l}=e,a=(0,n.c)("pages.admin.feedback.list.submissions"),[r,t]=(0,d.useState)(10);(0,d.useEffect)(()=>{t(10)},[s]);let c=l.slice(0,r);return(0,i.jsxs)(i.Fragment,{children:[c.map(e=>(0,i.jsx)(I,{submission:e},e.id)),l.length>r&&(0,i.jsx)(E.$,{variant:"subtle",size:"xs",onClick:()=>{t(r+10)},children:a("buttons.show-more",{countRemaining:l.length-r})})]})};function S(e){let{site:s}=e,l=(0,n.c)("pages.admin.feedback.list"),[a,r]=(0,z.ZA)("form"),{data:t,isLoading:c}=(0,C.WB)({siteId:s.id}),{data:o,isLoading:x}=(0,C.oH)({siteId:s.id,formId:a||""},{skip:!a});return(0,d.useEffect)(()=>{!a&&(null==t?void 0:t.length)&&r(t[0].id)},[t,a,r]),(0,i.jsx)(w.A,{title:l("title"),description:l("description"),isLoading:c||x,skeletonHeight:400,headerRight:a&&(null==o?void 0:o.length)?(0,i.jsx)(E.$,{variant:"outline",onClick:()=>{window.open("/api/admin/site/".concat(s.id,"/feedback/").concat(a,"/csv"),"_blank")},children:l("buttons.export-feedback")}):null,children:(0,i.jsxs)(A.v.Group,{value:a,onChange:e=>r(e),children:[(0,i.jsx)(h.Y,{children:null==t?void 0:t.map(e=>(0,i.jsx)(A.v,{value:e.id,variant:a===e.id?"filled":"outline",children:"".concat(e.id)},e.id))}),!(null==o?void 0:o.length)&&(0,i.jsx)(b.F,{children:l("alerts.no-feedback-submissions")}),(0,i.jsx)(B,{form:a||"",submissions:o||[]})]})})}var L=l(75326),N=l(92859),T=!0;function Y(e){let{site:s}=e,l=(0,n.c)("pages.admin.feedback");return(0,i.jsx)(N.A,{site:s,title:l("title"),children:(0,i.jsx)(r.A,{feature:L.lo.FEEDBACK,faded:!0,fadedMessage:l("disabled-message"),children:(0,i.jsxs)(a.x,{children:[(0,i.jsx)(a.x.Col,{span:12,children:(0,i.jsx)(y,{site:s})}),(0,i.jsx)(a.x.Col,{span:12,children:(0,i.jsx)(S,{site:s})})]})})})}},81831:(e,s,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_sites/[site]/admin/feedback",function(){return l(70994)}])},83888:(e,s,l)=>{"use strict";l.d(s,{F:()=>b});var i=l(37876),a=l(36385);l(14232);var n=l(46249),r=l(1609),d=l(99545),t=l(88791),c=l(87242),o=l(80385),h=l(17457),x={root:"m_66836ed3",wrapper:"m_a5d60502",body:"m_667c2793",title:"m_6a03f287",label:"m_698f4f23",icon:"m_667f2a6a",message:"m_7fa78076",closeButton:"m_87f54839"};let u=(0,r.V)((e,{radius:s,color:l,variant:i,autoContrast:a})=>{let r=e.variantColorResolver({color:l||e.primaryColor,theme:e,variant:i||"light",autoContrast:a});return{root:{"--alert-radius":void 0===s?void 0:(0,n.nJ)(s),"--alert-bg":l||i?r.background:void 0,"--alert-color":r.color,"--alert-bd":l||i?r.border:void 0}}}),b=(0,o.P9)((e,s)=>{let l=(0,d.Y)("Alert",null,e),{classNames:n,className:r,style:o,styles:b,unstyled:m,vars:j,radius:p,color:v,title:f,children:g,id:k,icon:C,withCloseButton:_,onClose:w,closeButtonLabel:F,variant:y,autoContrast:E,attributes:A,...z}=l,I=(0,t.I)({name:"Alert",classes:x,props:l,className:r,style:o,classNames:n,styles:b,unstyled:m,attributes:A,vars:j,varsResolver:u}),B=(0,a.B)(k),S=f&&`${B}-title`||void 0,L=`${B}-body`;return(0,i.jsx)(c.a,{id:B,...I("root",{variant:y}),variant:y,ref:s,...z,role:"alert","aria-describedby":g?L:void 0,"aria-labelledby":f?S:void 0,children:(0,i.jsxs)("div",{...I("wrapper"),children:[C&&
1(0,i.jsx)("div",{...I("icon"),children:C}),(0,i.jsxs)("div",{...I("body"),children:[f&&(0,i.jsx)("div",{...I("title"),"data-with-close-button":_||void 0,children:(0,i.jsx)("span",{id:S,...I("label"),children:f})}),g&&(0,i.jsx)("div",{id:L,...I("message"),"data-variant":y,children:g})]}),_&&(0,i.jsx)(h.J,{...I("closeButton"),onClick:w,variant:"transparent",size:16,iconSize:16,"aria-label":F,unstyled:m})]})})});b.classes=x,b.displayName="@mantine/core/Alert"},88556:(e,s,l)=>{"use strict";l.d(s,{L:()=>u});var i=l(37876);l(14232);var a=l(46249),n=l(1609),r=l(99545),d=l(88791),t=l(87242),c=l(80385),o={root:"m_e9408a47","root--default":"m_84c9523a","root--filled":"m_ef274e49","root--unstyled":"m_eda993d3",legend:"m_90794832","legend--unstyled":"m_74ca27fe"};let h={variant:"default"},x=(0,n.V)((e,{radius:s})=>({root:{"--fieldset-radius":void 0===s?void 0:(0,a.nJ)(s)}})),u=(0,c.P9)((e,s)=>{let l=(0,r.Y)("Fieldset",h,e),{classNames:a,className:n,style:c,styles:u,unstyled:b,vars:m,legend:j,variant:p,children:v,attributes:f,...g}=l,k=(0,d.I)({name:"Fieldset",classes:o,props:l,className:n,style:c,classNames:a,styles:u,unstyled:b,attributes:f,vars:m,varsResolver:x});return(0,i.jsxs)(t.a,{component:"fieldset",ref:s,variant:p,...k("root",{variant:p}),...g,children:[j&&(0,i.jsx)("legend",{...k("legend",{variant:p}),children:j}),v]})});u.classes=o,u.displayName="@mantine/core/Fieldset"}},e=>{e.O(0,[5492,5043,9128,941,9080,6446,1049,636,6593,8792],()=>e(e.s=81831)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.