poll-test-widgets 0.0.1

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.
@@ -0,0 +1,30 @@
1
+ (function(re,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react"),require("@xyflow/react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@xyflow/react","react-dom"],f):(re=typeof globalThis<"u"?globalThis:re||self,f(re.PollTestWidgets={},re.React,re.ReactFlow,re.ReactDOM))})(this,function(re,f,oe,ct){"use strict";var Ie={exports:{}},be={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Fe;function pt(){if(Fe)return be;Fe=1;var n=f,r=Symbol.for("react.element"),o=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function u(s,c,x){var m,v={},b=null,d=null;x!==void 0&&(b=""+x),c.key!==void 0&&(b=""+c.key),c.ref!==void 0&&(d=c.ref);for(m in c)l.call(c,m)&&!a.hasOwnProperty(m)&&(v[m]=c[m]);if(s&&s.defaultProps)for(m in c=s.defaultProps,c)v[m]===void 0&&(v[m]=c[m]);return{$$typeof:r,type:s,key:b,ref:d,props:v,_owner:i.current}}return be.Fragment=o,be.jsx=u,be.jsxs=u,be}var we={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var He;function ut(){return He||(He=1,process.env.NODE_ENV!=="production"&&function(){var n=f,r=Symbol.for("react.element"),o=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),d=Symbol.for("react.offscreen"),R=Symbol.iterator,w="@@iterator";function y(t){if(t===null||typeof t!="object")return null;var h=R&&t[R]||t[w];return typeof h=="function"?h:null}var g=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function k(t){{for(var h=arguments.length,j=new Array(h>1?h-1:0),E=1;E<h;E++)j[E-1]=arguments[E];_("error",t,j)}}function _(t,h,j){{var E=g.ReactDebugCurrentFrame,H=E.getStackAddendum();H!==""&&(h+="%s",j=j.concat([H]));var Y=j.map(function(L){return String(L)});Y.unshift("Warning: "+h),Function.prototype.apply.call(console[t],console,Y)}}var I=!1,A=!1,C=!1,z=!1,B=!1,U;U=Symbol.for("react.module.reference");function O(t){return!!(typeof t=="string"||typeof t=="function"||t===l||t===a||B||t===i||t===x||t===m||z||t===d||I||A||C||typeof t=="object"&&t!==null&&(t.$$typeof===b||t.$$typeof===v||t.$$typeof===u||t.$$typeof===s||t.$$typeof===c||t.$$typeof===U||t.getModuleId!==void 0))}function S(t,h,j){var E=t.displayName;if(E)return E;var H=h.displayName||h.name||"";return H!==""?j+"("+H+")":j}function W(t){return t.displayName||"Context"}function F(t){if(t==null)return null;if(typeof t.tag=="number"&&k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case l:return"Fragment";case o:return"Portal";case a:return"Profiler";case i:return"StrictMode";case x:return"Suspense";case m:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case s:var h=t;return W(h)+".Consumer";case u:var j=t;return W(j._context)+".Provider";case c:return S(t,t.render,"ForwardRef");case v:var E=t.displayName||null;return E!==null?E:F(t.type)||"Memo";case b:{var H=t,Y=H._payload,L=H._init;try{return F(L(Y))}catch{return null}}}return null}var J=Object.assign,G=0,K,P,X,se,ne,$,de;function ue(){}ue.__reactDisabledLog=!0;function xe(){{if(G===0){K=console.log,P=console.info,X=console.warn,se=console.error,ne=console.group,$=console.groupCollapsed,de=console.groupEnd;var t={configurable:!0,enumerable:!0,value:ue,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}G++}}function ye(){{if(G--,G===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:J({},t,{value:K}),info:J({},t,{value:P}),warn:J({},t,{value:X}),error:J({},t,{value:se}),group:J({},t,{value:ne}),groupCollapsed:J({},t,{value:$}),groupEnd:J({},t,{value:de})})}G<0&&k("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ce=g.ReactCurrentDispatcher,pe;function ae(t,h,j){{if(pe===void 0)try{throw Error()}catch(H){var E=H.stack.trim().match(/\n( *(at )?)/);pe=E&&E[1]||""}return`
18
+ `+pe+t}}var T=!1,p;{var M=typeof WeakMap=="function"?WeakMap:Map;p=new M}function V(t,h){if(!t||T)return"";{var j=p.get(t);if(j!==void 0)return j}var E;T=!0;var H=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Y;Y=ce.current,ce.current=null,xe();try{if(h){var L=function(){throw Error()};if(Object.defineProperty(L.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(L,[])}catch(te){E=te}Reflect.construct(t,[],L)}else{try{L.call()}catch(te){E=te}t.call(L.prototype)}}else{try{throw Error()}catch(te){E=te}t()}}catch(te){if(te&&E&&typeof te.stack=="string"){for(var N=te.stack.split(`
19
+ `),ee=E.stack.split(`
20
+ `),D=N.length-1,Q=ee.length-1;D>=1&&Q>=0&&N[D]!==ee[Q];)Q--;for(;D>=1&&Q>=0;D--,Q--)if(N[D]!==ee[Q]){if(D!==1||Q!==1)do if(D--,Q--,Q<0||N[D]!==ee[Q]){var ie=`
21
+ `+N[D].replace(" at new "," at ");return t.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",t.displayName)),typeof t=="function"&&p.set(t,ie),ie}while(D>=1&&Q>=0);break}}}finally{T=!1,ce.current=Y,ye(),Error.prepareStackTrace=H}var ve=t?t.displayName||t.name:"",he=ve?ae(ve):"";return typeof t=="function"&&p.set(t,he),he}function We(t,h,j){return V(t,!1)}function At(t){var h=t.prototype;return!!(h&&h.isReactComponent)}function ze(t,h,j){if(t==null)return"";if(typeof t=="function")return V(t,At(t));if(typeof t=="string")return ae(t);switch(t){case x:return ae("Suspense");case m:return ae("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case c:return We(t.render);case v:return ze(t.type,h,j);case b:{var E=t,H=E._payload,Y=E._init;try{return ze(Y(H),h,j)}catch{}}}return""}var je=Object.prototype.hasOwnProperty,Ze={},Qe=g.ReactDebugCurrentFrame;function Ee(t){if(t){var h=t._owner,j=ze(t.type,t._source,h?h.type:null);Qe.setExtraStackFrame(j)}else Qe.setExtraStackFrame(null)}function Bt(t,h,j,E,H){{var Y=Function.call.bind(je);for(var L in t)if(Y(t,L)){var N=void 0;try{if(typeof t[L]!="function"){var ee=Error((E||"React class")+": "+j+" type `"+L+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[L]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ee.name="Invariant Violation",ee}N=t[L](h,L,E,j,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(D){N=D}N&&!(N instanceof Error)&&(Ee(H),k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",E||"React class",j,L,typeof N),Ee(null)),N instanceof Error&&!(N.message in Ze)&&(Ze[N.message]=!0,Ee(H),k("Failed %s type: %s",j,N.message),Ee(null))}}}var Mt=Array.isArray;function Ae(t){return Mt(t)}function Nt(t){{var h=typeof Symbol=="function"&&Symbol.toStringTag,j=h&&t[Symbol.toStringTag]||t.constructor.name||"Object";return j}}function Lt(t){try{return qe(t),!1}catch{return!0}}function qe(t){return""+t}function $e(t){if(Lt(t))return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Nt(t)),qe(t)}var et=g.ReactCurrentOwner,Ft={key:!0,ref:!0,__self:!0,__source:!0},tt,ot;function Ht(t){if(je.call(t,"ref")){var h=Object.getOwnPropertyDescriptor(t,"ref").get;if(h&&h.isReactWarning)return!1}return t.ref!==void 0}function Yt(t){if(je.call(t,"key")){var h=Object.getOwnPropertyDescriptor(t,"key").get;if(h&&h.isReactWarning)return!1}return t.key!==void 0}function Ut(t,h){typeof t.ref=="string"&&et.current}function Gt(t,h){{var j=function(){tt||(tt=!0,k("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",h))};j.isReactWarning=!0,Object.defineProperty(t,"key",{get:j,configurable:!0})}}function Xt(t,h){{var j=function(){ot||(ot=!0,k("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",h))};j.isReactWarning=!0,Object.defineProperty(t,"ref",{get:j,configurable:!0})}}var Vt=function(t,h,j,E,H,Y,L){var N={$$typeof:r,type:t,key:h,ref:j,props:L,_owner:Y};return N._store={},Object.defineProperty(N._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(N,"_self",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.defineProperty(N,"_source",{configurable:!1,enumerable:!1,writable:!1,value:H}),Object.freeze&&(Object.freeze(N.props),Object.freeze(N)),N};function Jt(t,h,j,E,H){{var Y,L={},N=null,ee=null;j!==void 0&&($e(j),N=""+j),Yt(h)&&($e(h.key),N=""+h.key),Ht(h)&&(ee=h.ref,Ut(h,H));for(Y in h)je.call(h,Y)&&!Ft.hasOwnProperty(Y)&&(L[Y]=h[Y]);if(t&&t.defaultProps){var D=t.defaultProps;for(Y in D)L[Y]===void 0&&(L[Y]=D[Y])}if(N||ee){var Q=typeof t=="function"?t.displayName||t.name||"Unknown":t;N&&Gt(L,Q),ee&&Xt(L,Q)}return Vt(t,N,ee,H,E,et.current,L)}}var Be=g.ReactCurrentOwner,nt=g.ReactDebugCurrentFrame;function me(t){if(t){var h=t._owner,j=ze(t.type,t._source,h?h.type:null);nt.setExtraStackFrame(j)}else nt.setExtraStackFrame(null)}var Me;Me=!1;function Ne(t){return typeof t=="object"&&t!==null&&t.$$typeof===r}function it(){{if(Be.current){var t=F(Be.current.type);if(t)return`
22
+
23
+ Check the render method of \``+t+"`."}return""}}function Kt(t){return""}var st={};function Dt(t){{var h=it();if(!h){var j=typeof t=="string"?t:t.displayName||t.name;j&&(h=`
24
+
25
+ Check the top-level render call using <`+j+">.")}return h}}function rt(t,h){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var j=Dt(h);if(st[j])return;st[j]=!0;var E="";t&&t._owner&&t._owner!==Be.current&&(E=" It was passed a child from "+F(t._owner.type)+"."),me(t),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',j,E),me(null)}}function lt(t,h){{if(typeof t!="object")return;if(Ae(t))for(var j=0;j<t.length;j++){var E=t[j];Ne(E)&&rt(E,h)}else if(Ne(t))t._store&&(t._store.validated=!0);else if(t){var H=y(t);if(typeof H=="function"&&H!==t.entries)for(var Y=H.call(t),L;!(L=Y.next()).done;)Ne(L.value)&&rt(L.value,h)}}}function Zt(t){{var h=t.type;if(h==null||typeof h=="string")return;var j;if(typeof h=="function")j=h.propTypes;else if(typeof h=="object"&&(h.$$typeof===c||h.$$typeof===v))j=h.propTypes;else return;if(j){var E=F(h);Bt(j,t.props,"prop",E,t)}else if(h.PropTypes!==void 0&&!Me){Me=!0;var H=F(h);k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",H||"Unknown")}typeof h.getDefaultProps=="function"&&!h.getDefaultProps.isReactClassApproved&&k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Qt(t){{for(var h=Object.keys(t.props),j=0;j<h.length;j++){var E=h[j];if(E!=="children"&&E!=="key"){me(t),k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",E),me(null);break}}t.ref!==null&&(me(t),k("Invalid attribute `ref` supplied to `React.Fragment`."),me(null))}}var at={};function dt(t,h,j,E,H,Y){{var L=O(t);if(!L){var N="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(N+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ee=Kt();ee?N+=ee:N+=it();var D;t===null?D="null":Ae(t)?D="array":t!==void 0&&t.$$typeof===r?(D="<"+(F(t.type)||"Unknown")+" />",N=" Did you accidentally export a JSX literal instead of a component?"):D=typeof t,k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",D,N)}var Q=Jt(t,h,j,H,Y);if(Q==null)return Q;if(L){var ie=h.children;if(ie!==void 0)if(E)if(Ae(ie)){for(var ve=0;ve<ie.length;ve++)lt(ie[ve],t);Object.freeze&&Object.freeze(ie)}else k("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else lt(ie,t)}if(je.call(h,"key")){var he=F(t),te=Object.keys(h).filter(function(no){return no!=="key"}),Le=te.length>0?"{key: someKey, "+te.join(": ..., ")+": ...}":"{key: someKey}";if(!at[he+Le]){var oo=te.length>0?"{"+te.join(": ..., ")+": ...}":"{}";k(`A props object containing a "key" prop is being spread into JSX:
26
+ let props = %s;
27
+ <%s {...props} />
28
+ React keys must be passed directly to JSX without using spread:
29
+ let props = %s;
30
+ <%s key={someKey} {...props} />`,Le,he,oo,he),at[he+Le]=!0}}return t===l?Qt(Q):Zt(Q),Q}}function qt(t,h,j){return dt(t,h,j,!0)}function $t(t,h,j){return dt(t,h,j,!1)}var eo=$t,to=qt;we.Fragment=l,we.jsx=eo,we.jsxs=to}()),we}process.env.NODE_ENV==="production"?Ie.exports=pt():Ie.exports=ut();var e=Ie.exports,Z=function(){return Z=Object.assign||function(n){for(var r,o=1,l=arguments.length;o<l;o++){r=arguments[o];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])}return n},Z.apply(this,arguments)},Ye={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},Ue={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Re={width:"20px",height:"20px",position:"absolute",zIndex:1},ht={top:Z(Z({},Ye),{top:"-5px"}),right:Z(Z({},Ue),{left:void 0,right:"-5px"}),bottom:Z(Z({},Ye),{top:void 0,bottom:"-5px"}),left:Z(Z({},Ue),{left:"-5px"}),topRight:Z(Z({},Re),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:Z(Z({},Re),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:Z(Z({},Re),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:Z(Z({},Re),{left:"-10px",top:"-10px",cursor:"nw-resize"})},ft=f.memo(function(n){var r=n.onResizeStart,o=n.direction,l=n.children,i=n.replaceStyles,a=n.className,u=f.useCallback(function(x){r(x,o)},[r,o]),s=f.useCallback(function(x){r(x,o)},[r,o]),c=f.useMemo(function(){return Z(Z({position:"absolute",userSelect:"none"},ht[o]),i??{})},[i,o]);return e.jsx("div",{className:a||void 0,style:c,onMouseDown:u,onTouchStart:s,children:l})}),gt=function(){var n=function(r,o){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,i){l.__proto__=i}||function(l,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(l[a]=i[a])},n(r,o)};return function(r,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");n(r,o);function l(){this.constructor=r}r.prototype=o===null?Object.create(o):(l.prototype=o.prototype,new l)}}(),le=function(){return le=Object.assign||function(n){for(var r,o=1,l=arguments.length;o<l;o++){r=arguments[o];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])}return n},le.apply(this,arguments)},xt={width:"auto",height:"auto"},Ce=function(n,r,o){return Math.max(Math.min(n,o),r)},Ge=function(n,r,o){var l=Math.round(n/r);return l*r+o*(l-1)},fe=function(n,r){return new RegExp(n,"i").test(r)},ke=function(n){return!!(n.touches&&n.touches.length)},yt=function(n){return!!((n.clientX||n.clientX===0)&&(n.clientY||n.clientY===0))},Xe=function(n,r,o){o===void 0&&(o=0);var l=r.reduce(function(a,u,s){return Math.abs(u-n)<Math.abs(r[a]-n)?s:a},0),i=Math.abs(r[l]-n);return o===0||i<o?r[l]:n},Pe=function(n){return n=n.toString(),n==="auto"||n.endsWith("px")||n.endsWith("%")||n.endsWith("vh")||n.endsWith("vw")||n.endsWith("vmax")||n.endsWith("vmin")?n:"".concat(n,"px")},Te=function(n,r,o,l){if(n&&typeof n=="string"){if(n.endsWith("px"))return Number(n.replace("px",""));if(n.endsWith("%")){var i=Number(n.replace("%",""))/100;return r*i}if(n.endsWith("vw")){var i=Number(n.replace("vw",""))/100;return o*i}if(n.endsWith("vh")){var i=Number(n.replace("vh",""))/100;return l*i}}return n},mt=function(n,r,o,l,i,a,u){return l=Te(l,n.width,r,o),i=Te(i,n.height,r,o),a=Te(a,n.width,r,o),u=Te(u,n.height,r,o),{maxWidth:typeof l>"u"?void 0:Number(l),maxHeight:typeof i>"u"?void 0:Number(i),minWidth:typeof a>"u"?void 0:Number(a),minHeight:typeof u>"u"?void 0:Number(u)}},vt=function(n){return Array.isArray(n)?n:[n,n]},bt=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],Ve="__resizable_base__",Je=function(n){gt(r,n);function r(o){var l,i,a,u,s=n.call(this,o)||this;return s.ratio=1,s.resizable=null,s.parentLeft=0,s.parentTop=0,s.resizableLeft=0,s.resizableRight=0,s.resizableTop=0,s.resizableBottom=0,s.targetLeft=0,s.targetTop=0,s.delta={width:0,height:0},s.appendBase=function(){if(!s.resizable||!s.window)return null;var c=s.parentNode;if(!c)return null;var x=s.window.document.createElement("div");return x.style.width="100%",x.style.height="100%",x.style.position="absolute",x.style.transform="scale(0, 0)",x.style.left="0",x.style.flex="0 0 100%",x.classList?x.classList.add(Ve):x.className+=Ve,c.appendChild(x),x},s.removeBase=function(c){var x=s.parentNode;x&&x.removeChild(c)},s.state={isResizing:!1,width:(i=(l=s.propsSize)===null||l===void 0?void 0:l.width)!==null&&i!==void 0?i:"auto",height:(u=(a=s.propsSize)===null||a===void 0?void 0:a.height)!==null&&u!==void 0?u:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},s.onResizeStart=s.onResizeStart.bind(s),s.onMouseMove=s.onMouseMove.bind(s),s.onMouseUp=s.onMouseUp.bind(s),s}return Object.defineProperty(r.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||xt},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"size",{get:function(){var o=0,l=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,a=this.resizable.offsetHeight,u=this.resizable.style.position;u!=="relative"&&(this.resizable.style.position="relative"),o=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:i,l=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:a,this.resizable.style.position=u}return{width:o,height:l}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"sizeStyle",{get:function(){var o=this,l=this.props.size,i=function(s){var c;if(typeof o.state[s]>"u"||o.state[s]==="auto")return"auto";if(o.propsSize&&o.propsSize[s]&&(!((c=o.propsSize[s])===null||c===void 0)&&c.toString().endsWith("%"))){if(o.state[s].toString().endsWith("%"))return o.state[s].toString();var x=o.getParentSize(),m=Number(o.state[s].toString().replace("px","")),v=m/x[s]*100;return"".concat(v,"%")}return Pe(o.state[s])},a=l&&typeof l.width<"u"&&!this.state.isResizing?Pe(l.width):i("width"),u=l&&typeof l.height<"u"&&!this.state.isResizing?Pe(l.height):i("height");return{width:a,height:u}},enumerable:!1,configurable:!0}),r.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var o=this.appendBase();if(!o)return{width:0,height:0};var l=!1,i=this.parentNode.style.flexWrap;i!=="wrap"&&(l=!0,this.parentNode.style.flexWrap="wrap"),o.style.position="relative",o.style.minWidth="100%",o.style.minHeight="100%";var a={width:o.offsetWidth,height:o.offsetHeight};return l&&(this.parentNode.style.flexWrap=i),this.removeBase(o),a},r.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},r.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},r.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var o=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:o.flexBasis!=="auto"?o.flexBasis:void 0})}},r.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},r.prototype.createSizeForCssProperty=function(o,l){var i=this.propsSize&&this.propsSize[l];return this.state[l]==="auto"&&this.state.original[l]===o&&(typeof i>"u"||i==="auto")?"auto":o},r.prototype.calculateNewMaxFromBoundary=function(o,l){var i=this.props.boundsByDirection,a=this.state.direction,u=i&&fe("left",a),s=i&&fe("top",a),c,x;if(this.props.bounds==="parent"){var m=this.parentNode;m&&(c=u?this.resizableRight-this.parentLeft:m.offsetWidth+(this.parentLeft-this.resizableLeft),x=s?this.resizableBottom-this.parentTop:m.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(c=u?this.resizableRight:this.window.innerWidth-this.resizableLeft,x=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(c=u?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),x=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return c&&Number.isFinite(c)&&(o=o&&o<c?o:c),x&&Number.isFinite(x)&&(l=l&&l<x?l:x),{maxWidth:o,maxHeight:l}},r.prototype.calculateNewSizeFromDirection=function(o,l){var i=this.props.scale||1,a=vt(this.props.resizeRatio||1),u=a[0],s=a[1],c=this.state,x=c.direction,m=c.original,v=this.props,b=v.lockAspectRatio,d=v.lockAspectRatioExtraHeight,R=v.lockAspectRatioExtraWidth,w=m.width,y=m.height,g=d||0,k=R||0;return fe("right",x)&&(w=m.width+(o-m.x)*u/i,b&&(y=(w-k)/this.ratio+g)),fe("left",x)&&(w=m.width-(o-m.x)*u/i,b&&(y=(w-k)/this.ratio+g)),fe("bottom",x)&&(y=m.height+(l-m.y)*s/i,b&&(w=(y-g)*this.ratio+k)),fe("top",x)&&(y=m.height-(l-m.y)*s/i,b&&(w=(y-g)*this.ratio+k)),{newWidth:w,newHeight:y}},r.prototype.calculateNewSizeFromAspectRatio=function(o,l,i,a){var u=this.props,s=u.lockAspectRatio,c=u.lockAspectRatioExtraHeight,x=u.lockAspectRatioExtraWidth,m=typeof a.width>"u"?10:a.width,v=typeof i.width>"u"||i.width<0?o:i.width,b=typeof a.height>"u"?10:a.height,d=typeof i.height>"u"||i.height<0?l:i.height,R=c||0,w=x||0;if(s){var y=(b-R)*this.ratio+w,g=(d-R)*this.ratio+w,k=(m-w)/this.ratio+R,_=(v-w)/this.ratio+R,I=Math.max(m,y),A=Math.min(v,g),C=Math.max(b,k),z=Math.min(d,_);o=Ce(o,I,A),l=Ce(l,C,z)}else o=Ce(o,m,v),l=Ce(l,b,d);return{newWidth:o,newHeight:l}},r.prototype.setBoundingClientRect=function(){var o=1/(this.props.scale||1);if(this.props.bounds==="parent"){var l=this.parentNode;if(l){var i=l.getBoundingClientRect();this.parentLeft=i.left*o,this.parentTop=i.top*o}}if(this.props.bounds&&typeof this.props.bounds!="string"){var a=this.props.bounds.getBoundingClientRect();this.targetLeft=a.left*o,this.targetTop=a.top*o}if(this.resizable){var u=this.resizable.getBoundingClientRect(),s=u.left,c=u.top,x=u.right,m=u.bottom;this.resizableLeft=s*o,this.resizableRight=x*o,this.resizableTop=c*o,this.resizableBottom=m*o}},r.prototype.onResizeStart=function(o,l){if(!(!this.resizable||!this.window)){var i=0,a=0;if(o.nativeEvent&&yt(o.nativeEvent)?(i=o.nativeEvent.clientX,a=o.nativeEvent.clientY):o.nativeEvent&&ke(o.nativeEvent)&&(i=o.nativeEvent.touches[0].clientX,a=o.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var u=this.props.onResizeStart(o,l,this.resizable);if(u===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var s,c=this.window.getComputedStyle(this.resizable);if(c.flexBasis!=="auto"){var x=this.parentNode;if(x){var m=this.window.getComputedStyle(x).flexDirection;this.flexDir=m.startsWith("row")?"row":"column",s=c.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var v={original:{x:i,y:a,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:le(le({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(o.target).cursor||"auto"}),direction:l,flexBasis:s};this.setState(v)}},r.prototype.onMouseMove=function(o){var l=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&ke(o))try{o.preventDefault(),o.stopPropagation()}catch{}var i=this.props,a=i.maxWidth,u=i.maxHeight,s=i.minWidth,c=i.minHeight,x=ke(o)?o.touches[0].clientX:o.clientX,m=ke(o)?o.touches[0].clientY:o.clientY,v=this.state,b=v.direction,d=v.original,R=v.width,w=v.height,y=this.getParentSize(),g=mt(y,this.window.innerWidth,this.window.innerHeight,a,u,s,c);a=g.maxWidth,u=g.maxHeight,s=g.minWidth,c=g.minHeight;var k=this.calculateNewSizeFromDirection(x,m),_=k.newHeight,I=k.newWidth,A=this.calculateNewMaxFromBoundary(a,u);this.props.snap&&this.props.snap.x&&(I=Xe(I,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(_=Xe(_,this.props.snap.y,this.props.snapGap));var C=this.calculateNewSizeFromAspectRatio(I,_,{width:A.maxWidth,height:A.maxHeight},{width:s,height:c});if(I=C.newWidth,_=C.newHeight,this.props.grid){var z=Ge(I,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),B=Ge(_,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),U=this.props.snapGap||0,O=U===0||Math.abs(z-I)<=U?z:I,S=U===0||Math.abs(B-_)<=U?B:_;I=O,_=S}var W={width:I-d.width,height:_-d.height};if(this.delta=W,R&&typeof R=="string"){if(R.endsWith("%")){var F=I/y.width*100;I="".concat(F,"%")}else if(R.endsWith("vw")){var J=I/this.window.innerWidth*100;I="".concat(J,"vw")}else if(R.endsWith("vh")){var G=I/this.window.innerHeight*100;I="".concat(G,"vh")}}if(w&&typeof w=="string"){if(w.endsWith("%")){var F=_/y.height*100;_="".concat(F,"%")}else if(w.endsWith("vw")){var J=_/this.window.innerWidth*100;_="".concat(J,"vw")}else if(w.endsWith("vh")){var G=_/this.window.innerHeight*100;_="".concat(G,"vh")}}var K={width:this.createSizeForCssProperty(I,"width"),height:this.createSizeForCssProperty(_,"height")};this.flexDir==="row"?K.flexBasis=K.width:this.flexDir==="column"&&(K.flexBasis=K.height);var P=this.state.width!==K.width,X=this.state.height!==K.height,se=this.state.flexBasis!==K.flexBasis,ne=P||X||se;ne&&ct.flushSync(function(){l.setState(K)}),this.props.onResize&&ne&&this.props.onResize(o,b,this.resizable,W)}},r.prototype.onMouseUp=function(o){var l,i,a=this.state,u=a.isResizing,s=a.direction;a.original,!(!u||!this.resizable)&&(this.props.onResizeStop&&this.props.onResizeStop(o,s,this.resizable,this.delta),this.props.size&&this.setState({width:(l=this.props.size.width)!==null&&l!==void 0?l:"auto",height:(i=this.props.size.height)!==null&&i!==void 0?i:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:le(le({},this.state.backgroundStyle),{cursor:"auto"})}))},r.prototype.updateSize=function(o){var l,i;this.setState({width:(l=o.width)!==null&&l!==void 0?l:"auto",height:(i=o.height)!==null&&i!==void 0?i:"auto"})},r.prototype.renderResizer=function(){var o=this,l=this.props,i=l.enable,a=l.handleStyles,u=l.handleClasses,s=l.handleWrapperStyle,c=l.handleWrapperClass,x=l.handleComponent;if(!i)return null;var m=Object.keys(i).map(function(v){return i[v]!==!1?e.jsx(ft,{direction:v,onResizeStart:o.onResizeStart,replaceStyles:a&&a[v],className:u&&u[v],children:x&&x[v]?x[v]:null},v):null});return e.jsx("div",{className:c,style:s,children:m})},r.prototype.render=function(){var o=this,l=Object.keys(this.props).reduce(function(u,s){return bt.indexOf(s)!==-1||(u[s]=o.props[s]),u},{}),i=le(le(le({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(i.flexBasis=this.state.flexBasis);var a=this.props.as||"div";return e.jsxs(a,le({style:i,className:this.props.className},l,{ref:function(u){u&&(o.resizable=u)},children:[this.state.isResizing&&e.jsx("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},r.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},r}(f.PureComponent);const Ke=n=>{n||(n="https://polls-tests-widgets-backend-1357.loca.lt");const[r,o]=f.useState(!1),[l,i]=f.useState(null),a=w=>`${n?n.replace(/\/$/,""):""}/api/polls${w}`,u=()=>{const w="csrftoken=",y=document.cookie?document.cookie.split(";"):[];for(let g of y)if(g=g.trim(),g.startsWith(w))return decodeURIComponent(g.substring(w.length));return null},s=async()=>{await fetch(a("/csrf/"),{credentials:"include"})},c=async(w,y={})=>{const g={credentials:"include",method:"GET",mode:"cors",headers:{"Content-Type":"application/json","bypass-tunnel-reminder":"true"}},k={...g,...y,headers:{...g.headers,...y.headers||{}}},_=await fetch(w,k),I=await _.text();let A=null;try{A=I?JSON.parse(I):null}catch{A=I}if(!_.ok){const C=new Error(A&&(A.detail||A.message)||_.statusText);throw C.status=_.status,C}return A},x=f.useCallback(async(w,y)=>{o(!0),i(null);try{await s();const g=u();return await c(a(`/${w}/`),{method:"DELETE",mode:"cors",headers:{"X-CSRFToken":g,"X-User-ID":y}})}catch(g){throw i(g.message),g}finally{o(!1)}},[]),m=f.useCallback(async()=>{try{return await c(a("/list/"),{method:"GET"})}catch(w){throw console.error("Ошибка получения списка опросов:",w),w}},[c]),v=f.useCallback(async w=>{o(!0),i(null);try{return await c(a(`/${w}/`),{method:"GET",mode:"cors"})}catch(y){return i(y.message),null}finally{o(!1)}},[]),b=f.useCallback(async(w,y)=>{o(!0),i(null),await s();const g=u();if(!g)throw new Error("CSRF token missing!");const k=(w.options||[]).filter(A=>A.trim()!=="").map(A=>({choice_text:A}));let _=null;y.endDate&&(_=new Date(`${y.endDate}T${y.endTime||"23:59:59"}`).toISOString());const I={owner:w.ownerID,title:w.title,choices:k,is_anonymous:y.isAnonymous,multiple_answers:y.multipleAnswers,end_date:_};try{return await c(a("/create/"),{method:"POST",mode:"cors",headers:{"X-CSRFToken":g},body:JSON.stringify(I)})}catch(A){throw i(A.message),A}finally{o(!1)}},[]);f.useCallback(async w=>{o(!0),i(null);try{return await c(a(`/${w}/`),{method:"GET"})}catch(y){return i(y.message),null}finally{o(!1)}},[]);const d=f.useCallback(async(w,y)=>{o(!0),i(null),await s();const g=u();if(!g)throw new Error("CSRF token missing!");try{return await c(a(`/${w}/vote/`),{method:"POST",headers:{"X-CSRFToken":g},body:JSON.stringify({choice_id:y.choiceId,user:y.userId})})}catch(k){throw i(k.message),k}finally{o(!1)}},[]),R=f.useCallback(async(w,y)=>{o(!0),i(null),await s();const g=u();try{return await c(a(`/${w}/unvote/}`),{method:"POST",headers:{"X-CSRFToken":g},body:JSON.stringify({user:y})})}catch(k){throw i(k.message),k}finally{o(!1)}},[]);return{createPoll:b,loading:r,error:l,setError:i,fetchAllPolls:m,fetchPoll:v,createPoll:b,votePoll:d,unvotePoll:R,deletePoll:x}},Se=({placeholder:n,value:r,onChange:o,style:l,autoFocus:i,type:a="text"})=>e.jsx("input",{type:a,placeholder:n,value:r,onChange:o,autoFocus:i,className:"nodrag",style:{width:"100%",boxSizing:"border-box",padding:"12px 16px",marginBottom:"12px",backgroundColor:"#e0e0e0",border:"none",borderRadius:"0px",fontSize:"16px",color:"#333",outline:"none",fontFamily:"Arial, sans-serif",...l}}),q=({onClick:n,children:r,style:o,disabled:l})=>e.jsx("button",{onClick:l?void 0:n,disabled:l,className:"nodrag",style:{padding:"10px 30px",backgroundColor:l?"#f0f0f0":"#d9d9d9",border:"none",borderRadius:"0px",fontSize:"18px",color:l?"#999":"#000",cursor:l?"not-allowed":"pointer",fontWeight:"400",transition:"background-color 0.2s",whiteSpace:"nowrap",opacity:l?.7:1,...o},onMouseOver:i=>{l||(i.target.style.backgroundColor="#c0c0c0")},onMouseOut:i=>{l||(i.target.style.backgroundColor=(o==null?void 0:o.backgroundColor)||"#d9d9d9")},children:r}),ge=({checked:n,onChange:r})=>e.jsxs("label",{style:{display:"inline-flex",alignItems:"center",cursor:"pointer",userSelect:"none",position:"relative"},children:[e.jsx("input",{type:"checkbox",checked:n,onChange:r,style:{opacity:0,width:0,height:0,position:"absolute"}}),e.jsx("span",{style:{display:"inline-block",width:"24px",height:"24px",border:`2px solid ${n?"#000":"#6c757d"}`,borderRadius:"4px",backgroundColor:n?"#000":"#fff",transition:"background-color 0.2s, border-color 0.2s",position:"relative",flexShrink:0},children:n&&e.jsx("span",{style:{content:'""',position:"absolute",left:"8px",top:"3px",width:"6px",height:"14px",border:"solid white",borderWidth:"0 3px 3px 0",transform:"rotate(45deg)",transition:"opacity 0.2s",opacity:n?1:0}})})]}),wt=({onClick:n})=>e.jsx("div",{onClick:n,className:"nodrag",style:{display:"flex",gap:"6px",cursor:"pointer",flexShrink:0,padding:"5px"},children:[1,2,3].map(r=>e.jsx("div",{style:{width:"14px",height:"14px",borderRadius:"50%",backgroundColor:"#757575"}},r))}),_e=({id:n,name:r,value:o,checked:l,onChange:i,children:a})=>e.jsxs("label",{htmlFor:n,style:{display:"inline-flex",alignItems:"center",cursor:"pointer",userSelect:"none"},children:[e.jsx("input",{id:n,type:"radio",name:r,value:o,checked:l,onChange:i,style:{opacity:0,width:0,height:0,position:"absolute"}}),e.jsx("span",{style:{display:"inline-block",width:"20px",height:"20px",borderRadius:"50%",border:`2px solid ${l?"#000":"#6c757d"}`,backgroundColor:"#fff",position:"relative",flexShrink:0,transition:"border-color 0.2s"},children:l&&e.jsx("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"#000",transition:"opacity 0.2s",opacity:1}})}),a]}),Oe=({title:n,children:r,style:o,toggleSettings:l,showMenuDots:i=!0})=>e.jsxs("div",{style:{width:"100%",height:"100%",backgroundColor:"#fff",padding:"20px 24px",display:"flex",flexDirection:"column",boxSizing:"border-box",boxShadow:"0 2px 10px rgba(0,0,0,0.05)",position:"relative",overflow:"hidden",...o},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"20px",flexShrink:0},children:[e.jsx("span",{style:{fontSize:"20px",fontWeight:"400",color:"#000",lineHeight:"1.2",wordBreak:"break-word",marginRight:"10px"},children:n}),i&&e.jsx(wt,{onClick:l})]}),e.jsx("div",{style:{flexGrow:1,display:"flex",flexDirection:"column",overflow:"hidden",minHeight:0},children:r})]}),St=({onSave:n,onDataChange:r,initialData:o})=>{var m;const l=o!=null&&o.options&&o.options.length>0&&o.options.some(v=>v.trim()==="")?o.options:[...((m=o==null?void 0:o.options)==null?void 0:m.filter(v=>v.trim()!==""))||[],""],[i,a]=f.useState((o==null?void 0:o.title)||""),[u,s]=f.useState(l),c=f.useRef(null);f.useEffect(()=>{r({title:i,options:u.filter(v=>v.trim()!=="")})},[i,u,r]);const x=(v,b)=>{let d=[...u];d[v]=b,v===d.length-1&&b.trim()!==""&&d.push(""),d=d.filter((R,w)=>R.trim()!==""||w===d.length-1),s(d)};return f.useEffect(()=>{c.current&&u.length>1&&u[u.length-1].trim()===""&&c.current.scrollIntoView({behavior:"smooth"})},[u.length]),e.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",width:"100%",overflow:"hidden"},children:[e.jsx("div",{style:{flexShrink:0,width:"100%"},children:e.jsx(Se,{placeholder:"Название опроса",value:i,onChange:v=>a(v.target.value),style:{fontSize:"20px",padding:"14px 16px",marginBottom:"20px",color:"#333",fontWeight:"bold",borderRadius:"15px"}})}),e.jsxs("div",{className:"scroll-container nowheel",onWheel:v=>v.stopPropagation(),style:{flexGrow:1,overflowY:"auto",overflowX:"hidden",paddingRight:"5px",marginBottom:"10px",width:"100%"},children:[u.map((v,b)=>e.jsx("div",{style:{display:"flex",alignItems:"center"},children:e.jsx(Se,{placeholder:`Вариант ${b+1}`,value:v,onChange:d=>x(b,d.target.value),style:{flexGrow:1,marginBottom:"10px",borderRadius:"15px"}})},b)),e.jsx("div",{ref:c})]}),e.jsx("div",{style:{flexShrink:0,marginTop:"20px"},children:e.jsx(q,{onClick:()=>n(),style:{width:"100%",borderRadius:"15px"},children:"Сохранить опрос"})})]})},jt=({onDataChange:n,initialData:r,toggleSettings:o,onDelete:l})=>{const[i,a]=f.useState((r==null?void 0:r.isAnonymous)||!1),[u,s]=f.useState((r==null?void 0:r.multipleAnswers)||!1),[c,x]=f.useState((r==null?void 0:r.endDate)||""),[m,v]=f.useState((r==null?void 0:r.endTime)||"");f.useEffect(()=>{n({isAnonymous:i,multipleAnswers:u,endDate:c,endTime:m})},[i,u,c,m,n]);const b={boxSizing:"border-box",padding:"12px 16px",backgroundColor:"#e0e0e0",border:"none",borderRadius:"15px",fontSize:"16px",color:"#333",outline:"none",fontFamily:"Arial, sans-serif",flex:1};return e.jsxs("div",{className:"nodrag",style:{display:"flex",flexDirection:"column",height:"100%",width:"100%",paddingRight:"5px",overflowY:"auto",overflowX:"hidden",boxSizing:"border-box"},children:[e.jsx("h3",{style:{fontSize:"20px",fontWeight:"bold",color:"#000",marginBottom:"25px",flexShrink:0},children:"Параметры опроса"}),e.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center",marginBottom:"25px"},children:[e.jsx(ge,{checked:i,onChange:()=>a(!i)}),e.jsx("span",{style:{fontSize:"18px",color:"#333"},children:"Анонимность"})]}),e.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center",marginBottom:"25px"},children:[e.jsx(ge,{checked:u,onChange:()=>s(!u)}),e.jsx("span",{style:{fontSize:"18px",color:"#333"},children:"Несколько ответов"})]}),e.jsxs("div",{style:{flexShrink:0},children:[e.jsx("span",{style:{fontSize:"18px",color:"#333",marginBottom:"10px",display:"block"},children:"Дата и время окончания"}),e.jsxs("div",{style:{display:"flex",gap:"10px"},children:[e.jsx("input",{type:"date",className:"nodrag",value:c,onChange:d=>x(d.target.value),style:b}),e.jsx("input",{type:"time",className:"nodrag",value:m,onChange:d=>v(d.target.value),style:b})]})]}),e.jsx("div",{style:{flexShrink:0,display:"flex",justifyContent:"flex-end",marginTop:"auto",paddingTop:"20px"},children:e.jsx(q,{onClick:o,style:{width:"100%",borderRadius:"15px"},children:"Назад к опросу"})})]})},Rt=({pollData:n,setPollData:r})=>{var T;const{id:o,title:l,choices:i,all_votes:a=[],voted_users:u=[],is_anonymous:s,multiple_answers:c,end_date:x,total_votes:m}=n,b=(()=>{if(!x)return!1;const p=new Date(x);return new Date>p})(),{votePoll:d,loading:R,error:w,setError:y,fetchPoll:g,unvotePoll:k}=Ke(),_=localStorage.getItem("userId")||"Anonymous",I=s?"Анонимно":"Неанонимно",A=x?`До ${x.split("T")[0]}`:"Нет даты",C=p=>!u||u.length===0?"0%":`${Math.round(p/u.length*100)}%`,[z,B]=f.useState(a.some(p=>p.user===String(_))),[U,O]=f.useState(),[S,W]=f.useState([]),[F,J]=f.useState(a.find(p=>p.user===String(_))),[G,K]=f.useState(!1),[P,X]=f.useState(0),[se,ne]=f.useState(z||R||b||!c&&!U||c&&S.length===0);f.useEffect(()=>{ne(z||R||b||!c&&!U||c&&S.length===0)},[z,R,c,U,S,b]);const $=p=>{O(p)},de=p=>{W(M=>M.includes(p)?M.filter(V=>V!==p):[...M,p])},ue=p=>{s||(K(!0),X(p))},xe=()=>{K(!1)},ye=async()=>{if(b){alert("Время прохождения теста истекло.");return}if(!(!c&&!U||c&&S.length===0))try{let p=!0;if(c){const M=S.map(V=>d(o,{choiceId:V,userId:_}));try{await Promise.all(M),p=!0}catch(V){console.error("Один из голосов не прошел",V),p=!1}}else p=await d(o,{choiceId:U,userId:_});p&&(B(!0),g&&g(o).then(M=>r(M)))}catch(p){console.error("Ошибка при голосовании:",p),y("Не удалось сохранить голос")}},ce=async()=>{try{const p=await k(o,_);if(p)r(p);else if(g){const M=await g(o);r(M)}B(!1),J(null),O(null),W([])}catch(p){console.error("Ошибка при отмене голоса:",p),y("Не удалось отменить голос")}},pe=new Intl.PluralRules("ru-RU");function ae(p){const M=pe.select(p),V={one:"голос",few:"голоса",many:"голосов",other:"голосов"};return V[M]||V.many}return e.jsxs("div",{className:"nodrag nowheel",onWheel:p=>p.stopPropagation(),style:{display:"flex",color:"#000",flexDirection:"column",height:"100%",width:"100%",overflow:"hidden",paddingRight:"5px"},children:[e.jsx("div",{style:{flexShrink:0,width:"100%"},children:e.jsx("h3",{style:{fontSize:"22px",fontWeight:"bold",backgroundColor:"#e0e0e0",padding:"12px 16px",borderRadius:"10px"},children:l})}),e.jsxs("div",{style:{fontSize:"14px",color:"#666",marginBottom:"10px"},children:[I," | ",A," | Голосов: ",u.length||0]}),b&&e.jsx("div",{style:{padding:"10px",backgroundColor:"#ffdddd",color:"red",borderRadius:"10px",textAlign:"center",fontWeight:"bold",marginBottom:"10px"},children:"Срок прохождения теста истек"}),w&&e.jsx("p",{style:{color:"red"},children:w}),G&&e.jsxs("div",{style:{display:"flex",color:"#000",flexDirection:"column",height:"100%",width:"100%",overflowY:"auto",gap:"10px"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"12px",position:"relative",overflow:"hidden"},children:[e.jsx("div",{style:{position:"absolute",bottom:0,left:0,height:"5px",width:"100%",backgroundColor:"#ccc"}}),e.jsx("div",{style:{position:"absolute",bottom:0,left:0,height:"5px",width:C(P==null?void 0:P.votes_count),backgroundColor:"#000",transition:"width 0.5s"}}),e.jsx("span",{style:{zIndex:1},children:P==null?void 0:P.choice_text}),e.jsx("span",{style:{fontWeight:"bold",zIndex:1},children:`${C(P==null?void 0:P.votes_count)}`})]}),e.jsxs("span",{style:{marginLeft:"12px",color:"#666"},children:[P==null?void 0:P.votes_count," ",ae(P==null?void 0:P.votes_count)]}),e.jsx("div",{style:{overflowY:"auto",margin:"12px 16px",display:"flex",flexDirection:"column",gap:"15px"},children:(T=a==null?void 0:a.filter(p=>p.choice_id===(P==null?void 0:P.id)))==null?void 0:T.map((p,M)=>e.jsx("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:e.jsx("span",{style:{},children:p.user})},M))}),e.jsx(q,{style:{marginTop:"auto"},onClick:xe,children:"Назад"})]}),!G&&e.jsxs("div",{style:{display:"flex",color:"#000",flexDirection:"column",height:"100%",width:"100%",overflowY:"auto"},children:[z?e.jsx("div",{className:"scroll-container nowheel",style:{flexGrow:1,overflowY:"auto",minHeight:0,paddingRight:"5px"},children:i==null?void 0:i.map(p=>{const M=C(p.votes_count);return e.jsxs("div",{onClick:()=>{ue(p)},style:{display:"flex",flexDirection:"column",marginBottom:"15px",cursor:"pointer",gap:"10px"},children:[e.jsxs("div",{style:{flexGrow:1,display:"flex",justifyContent:"space-between",padding:"12px",position:"relative",overflow:"hidden"},children:[e.jsx("div",{style:{position:"absolute",bottom:0,left:0,height:"5px",width:"100%",backgroundColor:"#ccc"}}),e.jsx("div",{style:{position:"absolute",bottom:0,left:0,height:"5px",width:M,backgroundColor:"#000",transition:"width 0.5s"}}),e.jsx("span",{style:{zIndex:1},children:p.choice_text}),e.jsx("span",{style:{zIndex:1,marginLeft:"auto",marginRight:"10px"},children:(F==null?void 0:F.choice_id)===p.id?"✔":""}),e.jsx("span",{style:{fontWeight:"bold",zIndex:1},children:`${M}`})]}),e.jsxs("span",{style:{marginLeft:"12px",color:"#666"},children:[p.votes_count," ",ae(p.votes_count)]})]},p.id)})}):e.jsx("div",{className:"scroll-container nowheel",style:{flexGrow:1,overflowY:"auto",minHeight:0,paddingRight:"5px"},children:i==null?void 0:i.map(p=>{const M=p.id,V=c?S.includes(M):U===M;return e.jsxs("div",{onClick:()=>c?de(M):$(M),style:{display:"flex",alignItems:"center",marginBottom:"15px",cursor:"pointer",gap:"10px"},children:[c&&e.jsx(ge,{checked:V,onChange:()=>de(M)}),!c&&e.jsx(_e,{name:`poll-${o}`,checked:V,onChange:()=>$(M)}),e.jsxs("div",{style:{flexGrow:1,display:"flex",justifyContent:"space-between",backgroundColor:V?"#d0d0d0":"#e0e0e0",padding:"12px 16px",borderRadius:"10px",position:"relative",overflow:"hidden"},children:[e.jsx("span",{style:{zIndex:1},children:p.choice_text}),e.jsx("span",{style:{fontWeight:"bold",zIndex:1},children:""})]})]},p.id)})}),e.jsxs("div",{style:{marginTop:"auto",paddingTop:"20px",display:"flex",flexDirection:"column",gap:"10px"},children:[!z&&e.jsx(q,{onClick:ye,disabled:se,style:{width:"100%",backgroundColor:"#d9d9d9",borderRadius:"10px"},children:R?"Отправка...":"Сохранить"}),z&&e.jsxs("div",{style:{textAlign:"center",width:"100%"},children:[e.jsx("div",{style:{marginBottom:"10px",fontWeight:"bold",color:"#4caf50"},children:"Голос принят!"}),e.jsx(q,{onClick:ce,disabled:R,style:{width:"100%",borderRadius:"10px"},children:R?"Отмена...":"Отменить мой голос"})]})]})]})]})},Ct=({initialTitle:n,pollId:r,nodeId:o,nodeProps:l,onSaved:i})=>{const[a,u]=f.useState({ownerID:"",title:n||"",options:[""]}),[s,c]=f.useState({isAnonymous:!1,multipleAnswers:!1,endDate:"",endTime:""}),x=async()=>{const O=m==null?void 0:m.id;if(localStorage.getItem("userId"),!O){alert("Ошибка: ID опроса не определен.");return}if(window.confirm("Вы уверены, что хотите полностью удалить этот опрос?"))try{await k(O,_),alert("Опрос успешно удален из базы"),setTimeout(()=>{window.location.reload()},100)}catch(S){console.error("Детали ошибки:",S),S.status===403?alert("У вас нет прав на удаление этого опроса. Удалять может только автор."):alert("Произошла ошибка при удалении: "+S.message),console.warn("Побочная ошибка (вероятно расширение браузера):",S)}},[m,v]=f.useState(null),[b,d]=f.useState("creator"),{createPoll:R,loading:w,error:y,fetchPoll:g,deletePoll:k}=Ke(),[_,I]=f.useState();f.useEffect(()=>{let O=localStorage.getItem("userId");O||(O=getCookie("user_id")),O||(O="anon_"+Math.random().toString(36).substring(2,11),localStorage.setItem("userId",O)),O&&(I(O),console.log("ID пользователя загружен:",O))},[]),f.useCallback(O=>{if(!O)return;console.log("Poll Widget initialized with:",O);const{widgetId:S,userId:W,role:F,config:J,board:G}=O;S&&(async()=>{try{const P=await g(S);if(!P)return;v(P);const X=(P.choices||[]).map($=>$.choice_text);u({title:P.title,options:[...X.filter($=>$.trim()!==""),(X.length>0,"")]});let se="",ne="";if(P.end_date){const $=P.end_date.split("T");se=$[0],ne=$[1]?$[1].substring(0,5):""}c({isAnonymous:P.is_anonymous,multipleAnswers:P.multiple_answers,endDate:se,endTime:ne}),d("display")}catch(P){console.error("Ошибка загрузки опроса:",P)}})();const K=["admin","editor","owner"].includes(F);d(K?P=>S?"display":"creator":"display")},[g]),f.useEffect(()=>{if(!r)return;let O=!0;return(async()=>{try{const S=await g(r);if(!O||!S)return;v(S);const W=(S.choices||[]).map(G=>G.choice_text);u({title:S.title,options:[...W.filter(G=>G.trim()!==""),(W.length>0,"")]});let F="",J="";if(S.end_date){const G=S.end_date.split("T");F=G[0],J=G[1]?G[1].substring(0,5):""}c({isAnonymous:S.is_anonymous,multipleAnswers:S.multiple_answers,endDate:F,endTime:J}),d("display")}catch(S){console.error("Ошибка загрузки опроса:",S)}})(),()=>{O=!1}},[r,g]);const A=async()=>{const O=a.options.filter(S=>S.trim()!=="");if(!a.title.trim()||O.length<1){alert("Заполните название и хотя бы один вариант ответа");return}try{const S={...a,options:O,ownerID:_},W=await R(S,s);v(W),typeof i=="function"&&(W!=null&&W.id)&&i(W.id),d("display")}catch(S){console.error("Ошибка сохранения опроса:",S),alert("Ошибка при сохранении опроса: "+(S.message||S))}},C=f.useCallback(()=>d(O=>O==="creator"?"settings":"creator"),[]),z=f.useCallback(()=>d("creator"),[]),B=f.useCallback(()=>d("creator"),[]),U=()=>"Опрос";return e.jsxs(Oe,{style:{position:"relative"},title:U(),onSettingsClick:b==="display"?B:void 0,toggleSettings:b!=="settings"?C:void 0,showMenuDots:b==="creator",onTitleClick:b==="display"?B:void 0,children:[e.jsx("p",{style:{color:"red",textAlign:"center"},children:w?"Сохранение...":y}),e.jsx("div",{style:{position:"relative"},children:e.jsxs("div",{style:{fontSize:"10px",color:"#999",textAlign:"right",padding:"0 15px"},children:["User ID: ",_]})}),b==="creator"&&e.jsx(St,{onSave:A,onDataChange:u,initialData:a}),b==="settings"&&e.jsx(jt,{onDataChange:c,initialData:s,toggleSettings:z}),b==="display"&&m&&e.jsxs(e.Fragment,{children:[(m==null?void 0:m.id)&&String(m.owner)===String(_)&&e.jsx("div",{onClick:x,style:{position:"absolute",top:"15px",right:"15px",width:"24px",height:"24px",backgroundColor:"#ff4d4d",color:"white",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:"18px",fontWeight:"bold",zIndex:100,boxShadow:"0 2px 5px rgba(0,0,0,0.2)",lineHeight:"1"},title:"Удалить опрос",children:"×"}),e.jsx(Rt,{pollData:m,setPollData:v})]})]})},kt=({onSave:n,onDataChange:r,initialData:o})=>{const[l,i]=f.useState((o==null?void 0:o.title)||""),[a,u]=f.useState((o==null?void 0:o.tasks)||[]),[s,c]=f.useState((o==null?void 0:o.activeTaskIndex)||null);f.useEffect(()=>{r({title:l,tasks:a,activeTaskIndex:s})},[l,a,s,r]);const[x,m]=f.useState(!0),v=()=>{const C={id:Date.now(),question:"",type:"text",score:1,correctText:"",options:[""],correctRadioOption:"",correctBoxOptions:[]},z=[...a,C];u(z),c(z.length-1)},b=(C,z)=>{if(s===null)return;const B=[...a];B[s]={...B[s],[C]:z},u(B)},d=(C,z)=>{z.stopPropagation();const B=a.filter((U,O)=>O!==C);u(B),s>=B.length?c(B.length>0?B.length-1:null):C<s&&c(s-1)},R=()=>{s>0&&c(s-1)},w=()=>{s<a.length-1&&c(s+1)},y=(C,z)=>{let B=[...a[s].options];B[C]=z;const O=[...B.filter(S=>S.trim()!==""),""];b("options",O)},g=C=>{b("correctRadioOption",C)},k=(C,z)=>{let B=[];z.includes(C)?B=z.filter(U=>U!==C):B=[...z,C],b("correctBoxOptions",B)},_={display:"flex",gap:"10px",alignItems:"center",whiteSpace:"nowrap"},I={boxSizing:"border-box",padding:"10px",backgroundColor:"#e0e0e0",border:"none",fontSize:"14px",outline:"none",color:"#333",width:"100%",borderRadius:"10px"},A=C=>({padding:"8px",cursor:"pointer",backgroundColor:C?"#00a2ffff":"#e0e0e0",color:C?"#ffffffff":"#333",borderRadius:"10px 10px 0 0",fontSize:"14px",fontWeight:"bold",display:"flex",alignItems:"center",gap:"5px",whiteSpace:"nowrap"});return e.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",width:"100%",overflow:"hidden"},className:"nodrag nowheel",children:[e.jsx("div",{style:{flexShrink:0},children:e.jsx(Se,{placeholder:"Название теста",value:l,onChange:C=>i(C.target.value),style:{fontSize:"20px",fontWeight:"bold",borderRadius:"10px"}})}),e.jsxs("div",{style:{display:"flex",borderBottom:"2px solid #333",flexShrink:0},children:[e.jsx(q,{onClick:R,style:{borderRadius:"10px"},children:"←"}),e.jsx("div",{style:{display:"flex",overflowX:"auto"},children:a.map((C,z)=>e.jsxs("div",{style:A(z===s),onClick:()=>c(z),children:["Задание ",z+1,e.jsx("span",{onClick:B=>d(z,B),style:{fontSize:"10px",fontWeight:"bold"},children:"✕"})]},C.id))}),e.jsx(q,{onClick:w,style:{borderRadius:"10px",marginLeft:"auto"},children:"→"})]}),e.jsx("div",{className:"nowheel",onWheel:C=>C.stopPropagation(),style:{padding:"10px",flexGrow:1,minHeight:0,overflowY:"auto",marginBottom:"10px",color:"#333"},children:s!==null&&a[s]?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[e.jsxs("div",{style:{display:"flex",flex:1,flexDirection:"column",gap:"10px"},children:[e.jsx("label",{style:{fontSize:"18px",fontWeight:"bold"},children:"Вопрос:"}),e.jsx("textarea",{value:a[s].question,onChange:C=>b("question",C.target.value),style:{width:"100%",minHeight:"150px",fontSize:"18px",resize:"vertical",color:"#333",backgroundColor:"#ebebebff"},placeholder:"Введите текст вопроса..."})]}),e.jsxs("div",{onClick:()=>m(!x),style:{cursor:"pointer",fontWeight:"bold",marginBottom:"10px",display:"flex",gap:"5px"},children:[e.jsx("span",{children:"Параметры задания"}),e.jsx("span",{children:x?"▲":"▼"})]}),x&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px",width:"50%"},children:[e.jsxs("div",{style:_,children:[e.jsx("span",{children:"Тип:"}),e.jsxs("select",{value:a[s].type,onChange:C=>b("type",C.target.value),style:I,children:[e.jsx("option",{value:"text",children:"Текст"}),e.jsx("option",{value:"single",children:"Один выбор"}),e.jsx("option",{value:"multiple",children:"Множ. выбор"})]})]}),e.jsxs("div",{style:_,children:[e.jsxs("span",{children:["Баллы: ",a[s].score]}),e.jsx("input",{type:"range",min:"1",max:"50",value:a[s].score,onChange:C=>b("score",C.target.value),style:I})]})]}),a[s].type==="text"&&e.jsx("textarea",{value:a[s].correctText,onChange:C=>b("correctText",C.target.value),style:{width:"100%",minHeight:"80px",fontSize:"18px",resize:"vertical",color:"#333",backgroundColor:"#ebebebff"},placeholder:"Введите правильные варианты с разделением через ENTER"}),a[s].type==="single"&&e.jsx("div",{children:a[s].options.map((C,z)=>e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:"10px",marginBottom:"5px"},children:[C!==""&&e.jsx(_e,{checked:a[s].correctRadioOption===C,onChange:()=>g(C),name:a[s].id}),e.jsx(Se,{placeholder:`Вариант ${z+1}`,value:C,onChange:B=>y(z,B.target.value),style:{borderRadius:"15px",marginBottom:"0px"}})]},z))}),a[s].type==="multiple"&&e.jsx("div",{children:a[s].options.map((C,z)=>e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:"10px",marginBottom:"5px"},children:[C!==""&&e.jsx(ge,{checked:a[s].correctBoxOptions.includes(C),onChange:()=>k(C,a[s].correctBoxOptions)}),e.jsx(Se,{placeholder:`Вариант ${z+1}`,value:C,onChange:B=>y(z,B.target.value),style:{borderRadius:"15px",marginBottom:"0px"}})]},z))})]}):e.jsx("div",{style:{color:"#888",textAlign:"center",padding:"20px"},children:'Нет активных заданий. Нажмите "Добавить задание".'})}),e.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",flexShrink:0,paddingTop:"10px",borderTop:"1px solid #eee"},children:[e.jsx(q,{onClick:v,style:{borderRadius:"10px"},children:"+ Добавить задание"}),e.jsx(q,{onClick:()=>n(),style:{borderRadius:"10px"},children:"Сохранить тест"})]})]})},Tt=({onDataChange:n,initialData:r,toggleSettings:o})=>{const[l,i]=f.useState((r==null?void 0:r.completionTime)||""),[a,u]=f.useState((r==null?void 0:r.endDate)||""),[s,c]=f.useState((r==null?void 0:r.endTime)||""),[x,m]=f.useState((r==null?void 0:r.attemptNumber)||"");f.useEffect(()=>{n({completionTime:l,attemptNumber:x,endDate:a,endTime:s})},[l,x,a,s,n]);const v={boxSizing:"border-box",padding:"12px 16px",backgroundColor:"#e0e0e0",border:"none",fontSize:"16px",color:"#333",outline:"none",fontFamily:"Arial, sans-serif",flex:1,borderRadius:"10px"},b={display:"flex",gap:"10px",alignItems:"center",color:"#333"};return e.jsxs("div",{className:"nodrag",style:{display:"flex",flexDirection:"column",height:"100%",width:"100%",paddingRight:"5px",overflowY:"auto",overflowX:"hidden",boxSizing:"border-box"},children:[e.jsx("h3",{style:{fontSize:"20px",fontWeight:"bold",color:"#000",marginBottom:"25px",flexShrink:0},children:"Параметры теста"}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[e.jsxs("div",{style:b,children:[e.jsx("span",{children:"Время (мин):"}),e.jsx("input",{type:"number",value:l,onChange:d=>i(d.target.value),placeholder:"Неограниченно",style:v})]}),e.jsxs("div",{style:b,children:[e.jsx("span",{style:{},children:"Пройти до"}),e.jsx("input",{type:"date",value:a,onChange:d=>u(d.target.value),style:v}),e.jsx("input",{type:"time",value:s,onChange:d=>c(d.target.value),style:v})]}),e.jsxs("div",{style:b,children:[e.jsx("span",{style:{},children:"Кол-во попыток:"}),e.jsx("input",{type:"number",value:x,onChange:d=>m(d.target.value),style:v,placeholder:"Неограниченно"})]})]}),e.jsx("div",{style:{flexShrink:0,display:"flex",justifyContent:"flex-end",marginTop:"auto",paddingTop:"20px"},children:e.jsx(q,{onClick:o,style:{width:"100%",borderRadius:"5px"},children:"Назад к тесту"})})]})},De=n=>{n||(n="https://polls-tests-widgets-backend-1357.loca.lt");const[r,o]=f.useState(!1),[l,i]=f.useState(null),a=b=>`${n?n.replace(/\/$/,""):""}/api/polls/tests${b}`,u=()=>{const b="csrftoken=",d=document.cookie?document.cookie.split(";"):[];for(let R of d)if(R=R.trim(),R.startsWith(b))return decodeURIComponent(R.substring(b.length));return null},s=async(b,d={})=>{const R=await fetch(b,{credentials:"include",...d,headers:{"Content-Type":"application/json","bypass-tunnel-reminder":"true",...d.headers}}),w=await R.json().catch(()=>null);if(!R.ok){const y=new Error((w==null?void 0:w.detail)||R.statusText||"Ошибка сервера");throw y.status=R.status,y.data=w,y}return w},c=f.useCallback(async b=>{o(!0),i(null);try{return await s(a(`/${b}/`))}catch(d){throw i(d.message),d}finally{o(!1)}},[]),x=f.useCallback(async(b,d)=>{o(!0),i(null);try{const R=u();return await s(a(`/${b}/`),{method:"DELETE",headers:{"X-CSRFToken":R},body:JSON.stringify({owner:d})})}catch(R){throw i(R.message),R}finally{o(!1)}},[]),m=f.useCallback(async(b,d)=>{o(!0),i(null);try{let R=null;d.endDate&&(R=new Date(`${d.endDate}T${d.endTime||"23:59:59"}`).toISOString());const w={title:b.title,owner:localStorage.getItem("userId")||"Anonymous",tasks:b.tasks.map(y=>({question:y.question,task_type:y.type,score:y.score,correct_text:y.correctText,options:y.options.filter(g=>g.trim()!=="").map(g=>({text:g,is_correct:y.type==="single"?g===y.correctRadioOption:y.correctBoxOptions.includes(g)}))})),completion_time:d.completionTime===""?null:parseInt(d.completionTime),attempt_number:d.attemptNumber===""?null:parseInt(d.attemptNumber),end_date:R||null};return await s(a("/"),{method:"POST",body:JSON.stringify(w)})}catch(R){throw i(R.message),R}finally{o(!1)}},[]),v=f.useCallback(async b=>{o(!0),i(null);try{return await s(a("/submit/"),{method:"POST",body:JSON.stringify(b)})}catch(d){throw i(d.message),d}finally{o(!1)}},[]);return{loading:r,error:l,createTest:m,fetchTest:c,submitAttempt:v,deleteTest:x}},_t=({testData:n,setTestData:r})=>{var $,de,ue,xe,ye,ce,pe,ae;const o=n==null?void 0:n.id,l=(n==null?void 0:n.title)||"",i=(n==null?void 0:n.tasks)||[];n!=null&&n.settings;const{submitAttempt:a,loading:u,fetchTest:s}=De(),c=localStorage.getItem("userId")||"Anonymous",[x,m]=f.useState(!0),[v,b]=f.useState(!1),[d,R]=f.useState(0),[w,y]=f.useState(null),[g,k]=f.useState([]),_=n==null?void 0:n.all_attempts.filter(T=>T.user===String(c)),I=n.attempt_number-_.length,[A,C]=f.useState(!1),[z,B]=f.useState(null),U=f.useRef(!1),O=()=>{if(!n.end_date)return!1;const T=new Date(n.end_date);return new Date>T},S=O();f.useEffect(()=>{},[]);const W=()=>{if(i&&Array.isArray(i)&&i.length>0){console.log("Инициализация задач в Display:",i);const T=i.map(p=>({id:p.id,question:p.question,type:p.task_type,score:p.score,options:Array.isArray(p.options)?p.options:[],completedText:"",completedRadioOptionId:"",completedBoxOptionIds:[]}));k(T),R(0)}},F=(T,p)=>{k(M=>{const V=[...M];return V[d]&&(V[d]={...V[d],[T]:p}),V})};f.useEffect(()=>{if(x||v||z===null)return;if(z<=0){X();return}const T=setInterval(()=>{B(p=>p-1)},1e3);return()=>clearInterval(T)},[z,x,v]);const J=T=>{const p=Math.floor(T/60),M=T%60;return`${p.toString().padStart(2,"0")}:${M.toString().padStart(2,"0")}`},G=()=>{d>0&&R(d-1)},K=()=>{d<i.length-1&&R(d+1)},P=T=>{const p=g[d];if(!p)return;const M=p.completedBoxOptionIds||[],V=M.includes(T)?M.filter(We=>We!==T):[...M,T];F("completedBoxOptionIds",V)},X=async()=>{if(U.current)return;U.current=!0;const T={test:o,user:c,answers:g.map(p=>{let M=[];if(p.type==="single"){const V=p.completedRadioOptionId;V&&(M=[V])}else p.type==="multiple"&&(M=p.completedBoxOptionIds);return{task:p.id,answer_text:p.completedText,selected_options:M}})};try{const p=await a(T);p&&(y(p),b(!0),m(!1),s&&r(await s(o)))}catch(p){console.error("Ошибка:",p)}finally{U.current=!1}},se=()=>{if(O()){alert("Время прохождения теста истекло.");return}W(),n.completion_time&&n.completion_time>0?B(n.completion_time*60):B(null),m(!1)},ne=()=>{b(!1),m(!0)};return w&&v?e.jsxs("div",{style:{textAlign:"center",padding:"20px",color:"#000"},children:[e.jsx("h3",{style:{color:"#28a745"},children:"Тест завершен!"}),e.jsxs("p",{style:{fontSize:"18px"},children:["Результат: ",e.jsx("b",{children:w.score_obtained})," / ",w.total_score]}),e.jsx(q,{onClick:ne,children:"ОК"})]}):!x&&g.length===0?e.jsx("div",{style:{color:"#000",padding:"20px"},children:"Загрузка..."}):e.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",color:"#000"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"15px"},children:[e.jsx("h3",{style:{color:"#000",margin:0},children:l}),!x&&!v&&z!==null&&e.jsxs("div",{style:{fontWeight:"bold",fontSize:"18px",color:z<60?"red":"#00a2ff",border:"1px solid #ccc",padding:"5px 10px",borderRadius:"5px"},children:["⏱ ",J(z)]})]}),(n==null?void 0:n.owner)===c&&e.jsxs("div",{children:[e.jsxs("div",{style:{marginBottom:"15px"},children:[e.jsxs("p",{children:["Заданий: ",i.length]}),n.completion_time&&e.jsxs("p",{children:["Время: ",n.completion_time," мин."]}),n.end_date&&e.jsxs("p",{children:["Доступно до: ",new Date(n.end_date).toLocaleDateString()," ",new Date(n.end_date).toLocaleTimeString()]}),e.jsxs("p",{children:["Попыток: ",n.attempt_number]})]}),e.jsxs("div",{onClick:()=>C(T=>!T),style:{cursor:"pointer",fontWeight:"bold",marginBottom:"10px",display:"flex",gap:"5px"},children:[e.jsx("span",{children:"Посмотреть задания"}),e.jsx("span",{children:A?"▲":"▼"})]}),A&&e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",borderBottom:"2px solid #333"},children:[e.jsx(q,{onClick:G,style:{borderRadius:"10px"},children:"←"}),e.jsx("div",{style:{display:"flex",overflowX:"auto"},children:i.map((T,p)=>e.jsx("div",{onClick:()=>R(p),style:{padding:"8px 12px",cursor:"pointer",backgroundColor:p===d?"#00a2ff":"#eee",color:p===d?"#fff":"#000",marginRight:"2px",borderRadius:"5px 5px 0 0",minWidth:"25px",textAlign:"center"},children:p+1},p))}),e.jsx(q,{onClick:K,style:{borderRadius:"10px",marginLeft:"auto"},children:"→"})]}),e.jsxs("div",{style:{color:"#000"},children:[e.jsx("p",{style:{fontWeight:"bold"},children:($=i[d])==null?void 0:$.question}),((de=i[d])==null?void 0:de.task_type)==="text"&&e.jsxs("span",{children:["Ответ: ",i[d].correct_text]}),((ue=i[d])==null?void 0:ue.task_type)==="single"&&i[d].options.map((T,p)=>e.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:"15px",cursor:"pointer",gap:"10px"},children:[e.jsx(_e,{checked:T.is_correct,onChange:()=>{}}),e.jsx("div",{style:{flexGrow:1,display:"flex",justifyContent:"space-between",backgroundColor:T.is_correct?"#d0d0d0":"#e0e0e0",padding:"12px 16px",borderRadius:"10px",position:"relative",overflow:"hidden"},children:e.jsx("span",{children:T.text})})]},p)),((xe=i[d])==null?void 0:xe.task_type)==="multiple"&&i[d].options.map((T,p)=>e.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:"15px",cursor:"pointer",gap:"10px"},children:[e.jsx(ge,{checked:T.is_correct,onChange:()=>{}}),e.jsx("div",{style:{flexGrow:1,display:"flex",justifyContent:"space-between",backgroundColor:T.is_correct?"#d0d0d0":"#e0e0e0",padding:"12px 16px",borderRadius:"10px",position:"relative",overflow:"hidden"},children:e.jsx("span",{children:T.text})})]},p))]})]}),n!=null&&n.all_attempts&&(n==null?void 0:n.all_attempts.length)>0?e.jsxs("div",{style:{marginBottom:"20px",textAlign:"left"},children:[e.jsx("h4",{style:{marginBottom:"10px"},children:"Все результаты:"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",backgroundColor:"#f5f5f5",borderRadius:"10px",padding:"10px",maxHeight:"200px",overflowY:"auto",border:"1px solid #ddd"},children:n==null?void 0:n.all_attempts.map((T,p)=>e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"10px 5px",borderBottom:p!==(n==null?void 0:n.all_attempts.length)-1?"1px solid #ddd":"none"},children:[e.jsx("span",{style:{fontWeight:"bold",fontSize:"14px"},children:T.user}),e.jsx("span",{style:{fontSize:"14px"},children:new Date(T.completed_at).toLocaleDateString()}),e.jsxs("span",{style:{fontWeight:"bold",fontSize:"14px"},children:[T.score_obtained," / ",T.total_score," баллов"]})]},p))})]}):e.jsx("div",{style:{color:"#888",textAlign:"center",padding:"20px"},children:"Нет результатов"})]}),(n==null?void 0:n.owner)!==c&&e.jsx("div",{children:x?e.jsxs("div",{style:{color:"#000"},children:[e.jsxs("div",{style:{marginBottom:"15px"},children:[e.jsxs("p",{children:["Автор: ",n.owner]}),e.jsxs("p",{children:["Заданий: ",i.length]}),n.completion_time&&e.jsxs("p",{children:["Время: ",n.completion_time," мин."]}),n.end_date&&e.jsxs("p",{children:["Доступно до: ",new Date(n.end_date).toLocaleDateString()," ",new Date(n.end_date).toLocaleTimeString()]}),e.jsxs("p",{children:["Попыток: ",I,"/",n.attempt_number]})]}),S?e.jsx("div",{style:{padding:"10px",backgroundColor:"#ffdddd",color:"red",borderRadius:"10px",textAlign:"center",fontWeight:"bold"},children:"Срок прохождения теста истек"}):e.jsx(q,{onClick:se,style:{borderRadius:"10px"},disabled:I<=0,children:"Начать тест"}),_&&_.length>0?e.jsxs("div",{style:{marginBottom:"20px",textAlign:"left"},children:[e.jsx("h4",{style:{marginBottom:"10px"},children:"Ваши предыдущие результаты:"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",backgroundColor:"#f5f5f5",borderRadius:"10px",padding:"10px",maxHeight:"200px",overflowY:"auto",border:"1px solid #ddd"},children:_.map((T,p)=>e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"10px 5px",borderBottom:p!==_.length-1?"1px solid #ddd":"none"},children:[e.jsx("span",{style:{fontSize:"14px"},children:new Date(T.completed_at).toLocaleDateString()}),e.jsxs("span",{style:{fontWeight:"bold",fontSize:"14px"},children:[T.score_obtained," / ",T.total_score," баллов"]})]},p))})]}):e.jsx("div",{style:{color:"#888",textAlign:"center",padding:"20px"},children:"Нет результатов"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",borderBottom:"2px solid #333"},children:[e.jsx(q,{onClick:G,style:{borderRadius:"10px"},children:"←"}),e.jsx("div",{style:{display:"flex",overflowX:"auto"},children:g.map((T,p)=>e.jsx("div",{onClick:()=>R(p),style:{padding:"8px 12px",cursor:"pointer",backgroundColor:p===d?"#00a2ff":"#eee",color:p===d?"#fff":"#000",marginRight:"2px",borderRadius:"5px 5px 0 0",minWidth:"25px",textAlign:"center"},children:p+1},p))}),e.jsx(q,{onClick:K,style:{borderRadius:"10px",marginLeft:"auto"},children:"→"})]}),e.jsxs("div",{style:{color:"#000"},children:[e.jsx("p",{style:{fontWeight:"bold"},children:(ye=g[d])==null?void 0:ye.question}),((ce=g[d])==null?void 0:ce.type)==="text"&&e.jsx("textarea",{value:g[d].completedText,onChange:T=>F("completedText",T.target.value),style:{width:"100%",height:"80px",padding:"5px"}}),((pe=g[d])==null?void 0:pe.type)==="single"&&g[d].options.map((T,p)=>e.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:"15px",cursor:"pointer",gap:"10px"},children:[e.jsx(_e,{checked:g[d].completedRadioOptionId===T.id,onChange:()=>F("completedRadioOptionId",T.id)}),e.jsx("div",{onClick:()=>F("completedRadioOptionId",T.id),style:{flexGrow:1,display:"flex",justifyContent:"space-between",backgroundColor:g[d].completedRadioOptionId===T.id?"#d0d0d0":"#e0e0e0",padding:"12px 16px",borderRadius:"10px",position:"relative",overflow:"hidden"},children:e.jsx("span",{children:T.text})})]},p)),((ae=g[d])==null?void 0:ae.type)==="multiple"&&g[d].options.map((T,p)=>e.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:"15px",cursor:"pointer",gap:"10px"},children:[e.jsx(ge,{checked:g[d].completedBoxOptionIds.includes(T.id),onChange:()=>P(T.id)}),e.jsx("div",{onClick:()=>P(T.id),style:{flexGrow:1,display:"flex",justifyContent:"space-between",backgroundColor:g[d].completedBoxOptionIds.includes(T.id)?"#d0d0d0":"#e0e0e0",padding:"12px 16px",borderRadius:"10px",position:"relative",overflow:"hidden"},children:e.jsx("span",{children:T.text})})]},p))]}),e.jsx("div",{style:{marginTop:"20px",display:"flex",justifyContent:"flex-end"},children:d!==g.length-1&&e.jsx(q,{onClick:K,children:"Дальше"})}),e.jsx("div",{style:{marginTop:"20px",display:"flex",justifyContent:"flex-end"},children:d===g.length-1&&e.jsx(q,{onClick:X,disabled:u,children:u?"Сохранение...":"Завершить"})})]})})]})},zt=n=>{const o=`; ${document.cookie}`.split(`; ${n}=`);return o.length===2?o.pop().split(";").shift():null},Et=({initialTitle:n,pollId:r,nodeId:o,nodeProps:l,onSaved:i})=>{const{createTest:a,loading:u,error:s,fetchTest:c,deleteTest:x}=De(),[m,v]=f.useState(r?"display":"creator"),[b,d]=f.useState(!1),[R,w]=f.useState(null),[y,g]=f.useState({id:null,owner:"",title:n||"",tasks:[]}),[k,_]=f.useState({completionTime:null,attemptNumber:1,endDate:null,endTime:null}),[I,A]=f.useState(null);f.useEffect(()=>{let S=localStorage.getItem("userId");S||(S=zt("user_id")),S||(S="anon_"+Math.random().toString(36).substring(2,11),localStorage.setItem("userId",S)),w(S)},[]),f.useCallback(S=>{if(!S)return;console.log("Test Widget initialized with:",S);const{widgetId:W,userId:F,role:J,config:G,board:K}=S;W&&(async()=>{try{const X=await c(W);if(!X)return;A(X),g({id:X.id,title:X.title,tasks:X.tasks||[],all_attempts:X.all_attempts,owner:X.owner}),X.settings&&_(X.settings),d(!0)}catch(X){console.error("Ошибка загрузки теста:",X)}})();const P=["admin","editor","owner"].includes(J);v(P?X=>W?"display":"creator":"display")},[c]),f.useEffect(()=>{if(!r)return;let S=!0;return(async()=>{try{const W=await c(r);if(!S||!W)return;A(W),g({id:W.id,title:W.title,tasks:W.tasks||[],all_attempts:W.all_attempts,owner:W.owner}),W.settings&&_(W.settings),d(!0)}catch(W){console.error("Ошибка загрузки теста:",W)}})(),()=>{S=!1}},[r,c]);const C=f.useCallback(()=>v("creator"),[]),z=f.useCallback(()=>{v(S=>S==="settings"?"creator":"settings")},[]),B=async()=>{const S=(y==null?void 0:y.id)||pollId,W=localStorage.getItem("userId")||"Anonymous";if(!S){alert("Ошибка: ID теста не найден");return}if(window.confirm("Вы уверены, что хотите полностью удалить этот тест?"))try{await x(S,W),alert("Тест успешно удален"),setTimeout(()=>{window.location.reload()},100)}catch(F){console.error("Ошибка удаления:",F),F.status===403?alert("У вас нет прав на удаление (вы не автор)."):alert("Не удалось удалить тест: "+F.message)}},U=f.useCallback(async()=>{try{const S=await a(y,k);S&&S.id&&(A(S),d(!0),v("display"),typeof i=="function"&&i(S.id))}catch(S){console.error("Ошибка при сохранении:",S)}},[a,y,k]),O=()=>m==="settings"?"Настройки":y.title||"Тест";return r&&!b?e.jsx(Oe,{title:"Загрузка...",children:e.jsx("div",{style:{padding:"20px",textAlign:"center"},children:"Загрузка данных теста..."})}):e.jsxs(Oe,{title:O(),toggleSettings:m!=="display"?z:void 0,showMenuDots:m==="creator",children:[u&&e.jsx("p",{style:{color:"blue",textAlign:"center",margin:"5px 0"},children:"Синхронизация..."}),e.jsx("div",{style:{position:"relative"},children:e.jsxs("div",{style:{fontSize:"10px",color:"#999",textAlign:"right",padding:"0 15px"},children:["User ID: ",R]})}),m==="creator"&&e.jsx(kt,{onDataChange:g,initialData:y,onSave:U}),m==="settings"&&e.jsx(Tt,{onDataChange:_,initialData:k,toggleSettings:C}),m==="display"&&b&&e.jsxs("div",{style:{position:"relative",height:"100%",display:"flex",flexDirection:"column"},children:[(y==null?void 0:y.id)&&String(y.owner)===String(R)&&e.jsx("div",{onClick:B,style:{position:"absolute",top:"15px",right:"15px",width:"24px",height:"24px",backgroundColor:"#ff4d4d",color:"white",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:"18px",fontWeight:"bold",zIndex:1e3,boxShadow:"0 2px 5px rgba(0,0,0,0.2)",lineHeight:"1"},title:"Удалить тест",children:"×"}),e.jsx(_t,{testData:I,setTestData:A})]}),s&&e.jsx("div",{style:{color:"red",fontSize:"12px",padding:"10px",textAlign:"center"},children:s})]})},It={display:"flex",flexDirection:"column",background:"transparent",pointerEvents:"all",position:"relative"},Pt=n=>{const{id:r,data:o,selected:l,xPos:i,yPos:a,dragging:u}=n,[s,c]=f.useState({width:280,height:450}),x=oe.useUpdateNodeInternals(),{setNodes:m}=oe.useReactFlow(),v=f.useCallback((w,y,g,k)=>{const _=g.offsetWidth,I=g.offsetHeight;c({width:_,height:I}),x(r)},[]),b=f.useCallback(()=>{},[]),d={bottom:"nodrag",right:"nodrag",bottomRight:"nodrag"},R={bottom:{height:10,bottom:-5,cursor:"ns-resize",zIndex:999},right:{width:10,right:-5,cursor:"ew-resize",zIndex:999},bottomRight:{width:20,height:20,right:-5,bottom:-5,cursor:"nwse-resize",zIndex:1e3}};return e.jsxs(Je,{size:s,minWidth:800,minHeight:750,style:It,onResize:b,handleClasses:d,handleStyles:R,onResizeStop:v,enable:{top:!1,right:!0,bottom:!0,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},onPointerDown:w=>w.stopPropagation(),children:[e.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden",outline:l?"2px solid #007bff":"none",borderRadius:"2px",boxShadow:"0 4px 15px rgba(0, 0, 0, 0.1)"},children:e.jsx(Ct,{initialTitle:o.label,pollId:o==null?void 0:o.pollId,nodeId:r,onSaved:w=>{m(y=>y.map(g=>g.id===r?{...g,data:{...g.data,pollId:w}}:g))}})}),e.jsx(oe.Handle,{type:"source",position:oe.Position.Left}),e.jsx(oe.Handle,{type:"target",position:oe.Position.Top})]})},Ot={display:"flex",flexDirection:"column",background:"transparent",pointerEvents:"all",position:"relative"},Wt=n=>{const{id:r,data:o,selected:l,xPos:i,yPos:a,dragging:u}=n,[s,c]=f.useState({width:280,height:450}),x=oe.useUpdateNodeInternals(),{setNodes:m}=oe.useReactFlow(),v=y=>{m(g=>g.map(k=>k.id===r?{...k,data:{...k.data,pollId:y}}:k))},b=f.useCallback((y,g,k,_)=>{const I=k.offsetWidth,A=k.offsetHeight;c({width:I,height:A}),x(r)},[]),d=f.useCallback(()=>{},[]),R={bottom:"nodrag",right:"nodrag",bottomRight:"nodrag"},w={bottom:{height:10,bottom:-5,cursor:"ns-resize",zIndex:999},right:{width:10,right:-5,cursor:"ew-resize",zIndex:999},bottomRight:{width:20,height:20,right:-5,bottom:-5,cursor:"nwse-resize",zIndex:1e3}};return e.jsxs(Je,{size:s,minWidth:800,minHeight:750,style:Ot,onResize:d,handleClasses:R,handleStyles:w,onResizeStop:b,enable:{top:!1,right:!0,bottom:!0,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},onPointerDown:y=>y.stopPropagation(),children:[e.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden",outline:l?"2px solid #007bff":"none",borderRadius:"2px",boxShadow:"0 4px 15px rgba(0, 0, 0, 0.1)"},children:e.jsx(Et,{nodeId:r,initialTitle:o.label,pollId:o.pollId,nodeProps:n,onSaved:v})}),e.jsx(oe.Handle,{type:"source",position:oe.Position.Left}),e.jsx(oe.Handle,{type:"target",position:oe.Position.Top})]})};re.PollResizable=Pt,re.TestResizable=Wt,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});
package/dist/vite.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "poll-test-widgets",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "files": ["dist"],
6
+ "main": "./dist/poll-test-widgets.umd.js",
7
+ "module": "./dist/poll-test-widgets.es.js",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/poll-test-widgets.es.js",
11
+ "require": "./dist/poll-test-widgets.umd.js"
12
+ }
13
+ },
14
+ "peerDependencies": {
15
+ "react": "^18.0.0",
16
+ "react-dom": "^18.0.0",
17
+
18
+ "@xyflow/react": "^12.0.0"
19
+ },
20
+ "scripts": {
21
+ "dev": "vite",
22
+ "build": "vite build",
23
+ "lint": "eslint .",
24
+ "preview": "vite preview"
25
+ },
26
+ "dependencies": {
27
+ "axios": "^1.13.2",
28
+ "re-resizable": "^6.11.2"
29
+ },
30
+ "devDependencies": {
31
+ "@types/react": "^18.3.0",
32
+ "@types/react-dom": "^18.3.0",
33
+ "@vitejs/plugin-react": "^4.3.0",
34
+ "autoprefixer": "^10.4.0",
35
+ "eslint": "^9.0.0",
36
+ "postcss": "^8.4.0",
37
+ "tailwindcss": "^3.4.0",
38
+ "vite": "^5.4.0",
39
+ "@xyflow/react": "^12.9.3"
40
+ }
41
+ }