Files
proxy_web_site/static/js/4127-53f1b1a85165ca52.js

1 line
16 KiB
JavaScript
Raw Permalink Normal View History

2025-07-12 15:34:14 +08:00
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4127],{3017:()=>{},4436:()=>{},4788:(e,t,r)=>{"use strict";r.d(t,{K:()=>o,SpaceLayoutContextProvider:()=>n});var i=r(54568),l=r(7620);let s=l.createContext({basePath:""});function n(e){let{basePath:t,children:r}=e,n=l.useMemo(()=>({basePath:t}),[t]);return(0,i.jsx)(s.Provider,{value:n,children:r})}function o(){let e=l.useContext(s);if(!e)throw Error("SpaceLayoutContext not found");return e.basePath}},10083:(e,t,r)=>{"use strict";r.r(t),r.d(t,{PageFeedbackForm:()=>u});var i=r(54568),l=r(5772),s=r(7620),n=r(88118),o=r(96021),a=r(98743),c=r(24578),d=r(54217);function u(e){let{className:t}=e,r=(0,n.ok)(),u=(0,c.jt)(),m=s.useRef(null),[g,p]=s.useState(),[f,v]=s.useState(""),[x,b]=s.useState(!1),w=e=>{p(e),u({type:"page_post_feedback",feedback:{rating:e}})},C=(e,t)=>{b(!0),u({type:"page_post_feedback_comment",feedback:{rating:e,comment:t}})};return s.useEffect(()=>{if(g){var e;null==(e=m.current)||e.focus()}},[g]),(0,i.jsxs)("div",{className:(0,a.P)("flex flex-col gap-3 text-sm",t),children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,i.jsx)("p",{children:(0,o.t)(r,"was_this_helpful")}),(0,i.jsx)("div",{className:"rounded-full border border-tint-subtle bg-tint-base contrast-more:border-tint-12",children:(0,i.jsxs)("div",{className:"flex",children:[(0,i.jsx)(h,{rating:l.op.Good,label:(0,o.s)(r,"was_this_helpful_positive"),onClick:()=>w(l.op.Good),active:g===l.op.Good,disabled:void 0!==g}),(0,i.jsx)(h,{rating:l.op.Ok,label:(0,o.s)(r,"was_this_helpful_neutral"),onClick:()=>w(l.op.Ok),active:g===l.op.Ok,disabled:void 0!==g}),(0,i.jsx)(h,{rating:l.op.Bad,label:(0,o.s)(r,"was_this_helpful_negative"),onClick:()=>w(l.op.Bad),active:g===l.op.Bad,disabled:void 0!==g})]})})]}),g?(0,i.jsx)("div",{className:"flex flex-col gap-2",children:x?(0,i.jsx)("p",{children:(0,o.t)(r,"was_this_helpful_thank_you")}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("textarea",{ref:m,name:"comment",className:"max-h-40 min-h-16 grow rounded straight-corners:rounded-none bg-tint-base p-2 ring-1 ring-tint ring-inset placeholder:text-sm placeholder:text-tint contrast-more:ring-tint-12 contrast-more:placeholder:text-tint-strong",placeholder:(0,o.s)(r,"was_this_helpful_comment"),"aria-label":(0,o.s)(r,"was_this_helpful_comment"),onChange:e=>v(e.target.value),value:f,rows:3,maxLength:512}),(0,i.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,i.jsx)(d.$n,{size:"small",onClick:()=>C(g,f),label:(0,o.s)(r,"submit")}),f.length>409.6?(0,i.jsxs)("span",{className:512===f.length?"text-red-500":"",children:[f.length," / ",512]}):null]})]})}):null]})}function h(e){var t;let{rating:r,label:l,onClick:s,active:n,...o}=e,c=null!=(t=({bad:(0,i.jsx)(m,{}),ok:(0,i.jsx)(g,{}),good:(0,i.jsx)(p,{})})[r])?t:null;return(0,i.jsx)("button",{className:(0,a.P)("p-2 first:rounded-l-full first:pl-2.5 last:rounded-r-full last:pr-2.5 hover:bg-primary-hover hover:text-primary-strong","disabled:cursor-not-allowed disabled:hover:bg-inherit disabled:hover:text-inherit disabled:dark:hover:text-inherit","ring-tint contrast-more:hover:ring-1",n?"bg-primary-active text-primary-strong disabled:hover:bg-primary-active disabled:hover:text-primary-strong contrast-more:ring-2 contrast-more:hover:ring-2":"disabled:opacity-7 disabled:contrast-more:ring-0"),type:"button",...o,"aria-label":l,title:l,onClick:s,children:c})}let m=()=>(0,i.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("circle",{cx:"9",cy:"9",r:"9",fill:"currentColor",fillOpacity:"0.2"}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 8.25C4.58579 8.25 4.25 7.91421 4.25 7.5V6C4.25 5.58579 4.58579 5.25 5 5.25C5.41421 5.25 5.75 5.58579 5.75 6V7.5C5.75 7.91421 5.41421 8.25 5 8.25ZM4.66782 13.3737C4.87421 13.5572 5.19025 13.5386 5.3737 13.3322C7.30371 11.1609 10.6963 11.1609 12.6263 13.3322C12.8098 13.5386 13.1258 13.5572 13.3322 13.3737C13.5386 13.1902 13.5572 12.8742 13.3737 12.6678C11.0459 10.049 6.9541 10.049 4.6263 12.6678C4.44284 12.874