@aiquants/drag-drop-panels 0.9.0 → 0.9.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.
package/dist/index.umd.js CHANGED
@@ -1,6 +1,6 @@
1
- (function(A,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],r):(A=typeof globalThis<"u"?globalThis:A||self,r(A.AiquantsDragDropPanels={},A.React))})(this,(function(A,r){"use strict";var Me={exports:{}},Ce={};var lt;function un(){if(lt)return Ce;lt=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function e(s,o,l){var c=null;if(l!==void 0&&(c=""+l),o.key!==void 0&&(c=""+o.key),"key"in o){l={};for(var d in o)d!=="key"&&(l[d]=o[d])}else l=o;return o=l.ref,{$$typeof:t,type:s,key:c,ref:o!==void 0?o:null,props:l}}return Ce.Fragment=n,Ce.jsx=e,Ce.jsxs=e,Ce}var Pe={};var ct;function dn(){return ct||(ct=1,process.env.NODE_ENV!=="production"&&(function(){function t(m){if(m==null)return null;if(typeof m=="function")return m.$$typeof===L?null:m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case D:return"Fragment";case N:return"Profiler";case M:return"StrictMode";case T:return"Suspense";case U:return"SuspenseList";case v:return"Activity"}if(typeof m=="object")switch(typeof m.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),m.$$typeof){case C:return"Portal";case f:return m.displayName||"Context";case I:return(m._context.displayName||"Context")+".Consumer";case R:var b=m.render;return m=m.displayName,m||(m=b.displayName||b.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case J:return b=m.displayName||null,b!==null?b:t(m.type)||"Memo";case x:b=m._payload,m=m._init;try{return t(m(b))}catch{}}return null}function n(m){return""+m}function e(m){try{n(m);var b=!1}catch{b=!0}if(b){b=console;var O=b.error,B=typeof Symbol=="function"&&Symbol.toStringTag&&m[Symbol.toStringTag]||m.constructor.name||"Object";return O.call(b,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",B),n(m)}}function s(m){if(m===D)return"<>";if(typeof m=="object"&&m!==null&&m.$$typeof===x)return"<...>";try{var b=t(m);return b?"<"+b+">":"<...>"}catch{return"<...>"}}function o(){var m=E.A;return m===null?null:m.getOwner()}function l(){return Error("react-stack-top-frame")}function c(m){if(h.call(m,"key")){var b=Object.getOwnPropertyDescriptor(m,"key").get;if(b&&b.isReactWarning)return!1}return m.key!==void 0}function d(m,b){function O(){z||(z=!0,console.error("%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://react.dev/link/special-props)",b))}O.isReactWarning=!0,Object.defineProperty(m,"key",{get:O,configurable:!0})}function p(){var m=t(this.type);return F[m]||(F[m]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),m=this.props.ref,m!==void 0?m:null}function y(m,b,O,B,K,re){var V=O.ref;return m={$$typeof:u,type:m,key:b,props:O,_owner:B},(V!==void 0?V:null)!==null?Object.defineProperty(m,"ref",{enumerable:!1,get:p}):Object.defineProperty(m,"ref",{enumerable:!1,value:null}),m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(m,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(m,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.defineProperty(m,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m}function w(m,b,O,B,K,re){var V=b.children;if(V!==void 0)if(B)if(g(V)){for(B=0;B<V.length;B++)_(V[B]);Object.freeze&&Object.freeze(V)}else console.error("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 _(V);if(h.call(b,"key")){V=t(m);var Y=Object.keys(b).filter(function(ce){return ce!=="key"});B=0<Y.length?"{key: someKey, "+Y.join(": ..., ")+": ...}":"{key: someKey}",oe[V+B]||(Y=0<Y.length?"{"+Y.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(A,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],r):(A=typeof globalThis<"u"?globalThis:A||self,r(A.AiquantsDragDropPanels={},A.React))})(this,(function(A,r){"use strict";var Re={exports:{}},Ee={};var lt;function dn(){if(lt)return Ee;lt=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function e(s,o,l){var i=null;if(l!==void 0&&(i=""+l),o.key!==void 0&&(i=""+o.key),"key"in o){l={};for(var f in o)f!=="key"&&(l[f]=o[f])}else l=o;return o=l.ref,{$$typeof:t,type:s,key:i,ref:o!==void 0?o:null,props:l}}return Ee.Fragment=n,Ee.jsx=e,Ee.jsxs=e,Ee}var je={};var ct;function fn(){return ct||(ct=1,process.env.NODE_ENV!=="production"&&(function(){function t(d){if(d==null)return null;if(typeof d=="function")return d.$$typeof===_?null:d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case T:return"Fragment";case E:return"Profiler";case h:return"StrictMode";case z:return"Suspense";case X:return"SuspenseList";case b:return"Activity"}if(typeof d=="object")switch(typeof d.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),d.$$typeof){case D:return"Portal";case c:return d.displayName||"Context";case N:return(d._context.displayName||"Context")+".Consumer";case I:var p=d.render;return d=d.displayName,d||(d=p.displayName||p.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case q:return p=d.displayName||null,p!==null?p:t(d.type)||"Memo";case g:p=d._payload,d=d._init;try{return t(d(p))}catch{}}return null}function n(d){return""+d}function e(d){try{n(d);var p=!1}catch{p=!0}if(p){p=console;var O=p.error,G=typeof Symbol=="function"&&Symbol.toStringTag&&d[Symbol.toStringTag]||d.constructor.name||"Object";return O.call(p,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",G),n(d)}}function s(d){if(d===T)return"<>";if(typeof d=="object"&&d!==null&&d.$$typeof===g)return"<...>";try{var p=t(d);return p?"<"+p+">":"<...>"}catch{return"<...>"}}function o(){var d=F.A;return d===null?null:d.getOwner()}function l(){return Error("react-stack-top-frame")}function i(d){if(v.call(d,"key")){var p=Object.getOwnPropertyDescriptor(d,"key").get;if(p&&p.isReactWarning)return!1}return d.key!==void 0}function f(d,p){function O(){k||(k=!0,console.error("%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://react.dev/link/special-props)",p))}O.isReactWarning=!0,Object.defineProperty(d,"key",{get:O,configurable:!0})}function m(){var d=t(this.type);return L[d]||(L[d]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),d=this.props.ref,d!==void 0?d:null}function C(d,p,O,G,Q,re){var J=O.ref;return d={$$typeof:j,type:d,key:p,props:O,_owner:G},(J!==void 0?J:null)!==null?Object.defineProperty(d,"ref",{enumerable:!1,get:m}):Object.defineProperty(d,"ref",{enumerable:!1,value:null}),d._store={},Object.defineProperty(d._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(d,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(d,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.defineProperty(d,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.freeze&&(Object.freeze(d.props),Object.freeze(d)),d}function y(d,p,O,G,Q,re){var J=p.children;if(J!==void 0)if(G)if(w(J)){for(G=0;G<J.length;G++)M(J[G]);Object.freeze&&Object.freeze(J)}else console.error("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 M(J);if(v.call(p,"key")){J=t(d);var Y=Object.keys(p).filter(function(ce){return ce!=="key"});G=0<Y.length?"{key: someKey, "+Y.join(": ..., ")+": ...}":"{key: someKey}",V[J+G]||(Y=0<Y.length?"{"+Y.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,B,V,Y,V),oe[V+B]=!0)}if(V=null,O!==void 0&&(e(O),V=""+O),c(b)&&(e(b.key),V=""+b.key),"key"in b){O={};for(var ge in b)ge!=="key"&&(O[ge]=b[ge])}else O=b;return V&&d(O,typeof m=="function"?m.displayName||m.name||"Unknown":m),y(m,V,O,o(),K,re)}function _(m){W(m)?m._store&&(m._store.validated=1):typeof m=="object"&&m!==null&&m.$$typeof===x&&(m._payload.status==="fulfilled"?W(m._payload.value)&&m._payload.value._store&&(m._payload.value._store.validated=1):m._store&&(m._store.validated=1))}function W(m){return typeof m=="object"&&m!==null&&m.$$typeof===u}var P=r,u=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),f=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),L=Symbol.for("react.client.reference"),E=P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,h=Object.prototype.hasOwnProperty,g=Array.isArray,j=console.createTask?console.createTask:function(){return null};P={react_stack_bottom_frame:function(m){return m()}};var z,F={},ne=P.react_stack_bottom_frame.bind(P,l)(),Z=j(s(l)),oe={};Pe.Fragment=D,Pe.jsx=function(m,b,O){var B=1e4>E.recentlyCreatedOwnerStacks++;return w(m,b,O,!1,B?Error("react-stack-top-frame"):ne,B?j(s(m)):Z)},Pe.jsxs=function(m,b,O){var B=1e4>E.recentlyCreatedOwnerStacks++;return w(m,b,O,!0,B?Error("react-stack-top-frame"):ne,B?j(s(m)):Z)}})()),Pe}var it;function fn(){return it||(it=1,process.env.NODE_ENV==="production"?Me.exports=un():Me.exports=dn()),Me.exports}var a=fn();const mn=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),hn=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,e,s)=>s?s.toUpperCase():e.toLowerCase()),ut=t=>{const n=hn(t);return n.charAt(0).toUpperCase()+n.slice(1)},dt=(...t)=>t.filter((n,e,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===e).join(" ").trim(),pn=t=>{for(const n in t)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};var gn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const xn=r.forwardRef(({color:t="currentColor",size:n=24,strokeWidth:e=2,absoluteStrokeWidth:s,className:o="",children:l,iconNode:c,...d},p)=>r.createElement("svg",{ref:p,...gn,width:n,height:n,stroke:t,strokeWidth:s?Number(e)*24/Number(n):e,className:dt("lucide",o),...!l&&!pn(d)&&{"aria-hidden":"true"},...d},[...c.map(([y,w])=>r.createElement(y,w)),...Array.isArray(l)?l:[l]]));const se=(t,n)=>{const e=r.forwardRef(({className:s,...o},l)=>r.createElement(xn,{ref:l,iconNode:n,className:dt(`lucide-${mn(ut(t))}`,`lucide-${t}`,s),...o}));return e.displayName=ut(t),e};const bn=se("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);const vn=se("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const yn=se("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const wn=se("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);const En=se("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const ft=se("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const jn=se("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]);const Cn=se("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);const Pn=se("mouse-pointer",[["path",{d:"M12.586 12.586 19 19",key:"ea5xo7"}],["path",{d:"M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z",key:"277e5u"}]]);const kn=se("mouse-pointer-click",[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]);const mt=se("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),fe=class fe{constructor(n=2,e="[drag-drop-panels]",s=console){this.level=n,this.prefix=e,this.impl=s}static setLevel(n){fe.instance.setLevel(n)}setLevel(n){this.level=n}static setImplementation(n){fe.instance.setImplementation(n)}setImplementation(n){this.impl=n}static setPrefix(n){fe.instance.setPrefix(n)}setPrefix(n){this.prefix=n}formatMessage(n){return typeof n=="string"?[`${this.prefix} ${n}`]:[this.prefix,n]}static debug(n,...e){fe.instance.debug(n,...e)}debug(n,...e){this.level<=0&&this.impl.debug(...this.formatMessage(n),...e)}static info(n,...e){fe.instance.info(n,...e)}info(n,...e){this.level<=1&&this.impl.info(...this.formatMessage(n),...e)}static warn(n,...e){fe.instance.warn(n,...e)}warn(n,...e){this.level<=2&&this.impl.warn(...this.formatMessage(n),...e)}static error(n,...e){fe.instance.error(n,...e)}error(n,...e){this.level<=3&&this.impl.error(...this.formatMessage(n),...e)}};fe.instance=new fe(2,"[drag-drop-panels]");let We=fe;const ht=({config:t,panelId:n,sizeInfo:e,onSizeInfoClick:s})=>t.showPanelSizes&&e?a.jsxs("div",{className:"absolute top-1 right-24 z-10 cursor-default rounded-md bg-red-500/90 px-2 py-1 font-mono text-white text-xs leading-tight shadow-lg",onClick:s,onMouseDown:s,onTouchStart:o=>o instanceof TouchEvent&&s(o),onDragStart:s,children:[a.jsxs("div",{className:"text-[10px] opacity-80",children:["ID:",n]}),a.jsxs("div",{children:[e.width,"×",e.height]}),a.jsxs("div",{children:["X:",e.x," Y:",e.y]}),a.jsxs("div",{className:"text-[10px] opacity-80",children:["min:",e.minHeight," max:",e.maxHeight]})]}):null,k=(t,n,...e)=>{(t.logLevel??0)>=n&&We.info(...e)},He=(t,n,e)=>t.columnIndex===n&&(t.panelIndex===e||t.panelIndex+1===e),Fe=(t,n,e,s)=>{const o=Object.keys(t).find(d=>t[d].includes(n));if(o===void 0||t[e]===void 0)return null;const l={...t};if(o===e){const d=[...t[o]],p=d.indexOf(n);return d.splice(p,1),d.splice(p<s?s-1:s,0,n),l[e]=d,l}l[o]=t[o].filter(d=>d!==n);const c=[...t[e]];return c.splice(s,0,n),l[e]=c,l},ve=Object.freeze(["previous-column","next-column","up","down"]),Dn=(t,n)=>t.columnPanels[n]??[],Ye=t=>t.columnKeys.map(n=>Dn(t,n).filter(e=>t.panelVisibility[e]===!0)),ye=(t,n)=>{for(const[e,s]of Ye(t).entries()){const o=s.indexOf(n);if(o>=0)return{column:e,index:o}}return null},pt=(t,n,e)=>{switch(e){case"previous-column":case"next-column":{const s=n.column+(e==="previous-column"?-1:1),o=t[s];return o===void 0?null:{column:s,index:Math.min(n.index,o.length)}}case"up":return n.index>0?{column:n.column,index:n.index-1}:null;case"down":return n.index<t[n.column].length-1?{column:n.column,index:n.index+1}:null;default:{const s=e;throw new RangeError(`[@aiquants/drag-drop-panels] unknown panel move ${JSON.stringify(s)}; expected one of ${ve.join(", ")}`)}}},Nn=(t,n,e,s)=>{const o=t.filter(n),l=p=>[...t.slice(0,p),e,...t.slice(p)],c=o[s];if(c!==void 0)return l(t.indexOf(c));const d=o[s-1];return l(d!==void 0?t.indexOf(d)+1:t.length)},gt=(t,n)=>{const e=ye(t,n);if(e===null)return[];const s=Ye(t);return ve.filter(o=>pt(s,e,o)!==null)},xt=(t,n,e)=>{if(!ve.includes(e))throw new RangeError(`[@aiquants/drag-drop-panels] unknown panel move ${JSON.stringify(e)}; expected one of ${ve.join(", ")}`);const s=ye(t,n);if(s===null)return null;const o=pt(Ye(t),s,e);if(o===null)return null;const l=p=>t.panelVisibility[p]===!0,c=Object.fromEntries(Object.entries(t.columnPanels).map(([p,y])=>[p,y.filter(w=>w!==n)])),d=t.columnKeys[o.column];return c[d]=Nn(c[d]??[],l,n,o.index),{columnPanels:c,from:s,place:o}},Sn=(t,n,e)=>{const s=(o,l)=>(o[l]??[]).filter(c=>c!==e);for(const o of new Set([...Object.keys(t),...Object.keys(n)])){const l=s(t,o),c=s(n,o);if(l.length!==c.length||l.some((d,p)=>d!==c[p]))return!1}return!0},Ue=Object.freeze({"previous-column":Object.freeze({key:"ArrowLeft",aria:"Alt+Shift+ArrowLeft",text:"Alt+Shift+←"}),"next-column":Object.freeze({key:"ArrowRight",aria:"Alt+Shift+ArrowRight",text:"Alt+Shift+→"}),up:Object.freeze({key:"ArrowUp",aria:"Alt+Shift+ArrowUp",text:"Alt+Shift+↑"}),down:Object.freeze({key:"ArrowDown",aria:"Alt+Shift+ArrowDown",text:"Alt+Shift+↓"})}),bt=t=>{if(!(t.altKey&&t.shiftKey)||t.ctrlKey||t.metaKey)return null;const n=ve.find(e=>Ue[e].key===t.key);return n===void 0?null:n},Be=r.memo(({index:t,columnIndex:n,isDragging:e,dragOverPosition:s,originalPosition:o,onDragEnter:l,onDragLeave:c,config:d,customDrag:p,label:y})=>{const w=o!==null&&He(o,n,t),_=!w&&s?.columnIndex===n&&s?.insertIndex===t,W=r.useRef(null),[P,u]=r.useState(null),C=e||(p?.isActive??!1),D=w||!C?"hidden":_?"target":"shown";return r.useEffect(()=>{if(W.current){const M=W.current.getBoundingClientRect(),N={width:Math.round(M.width),height:Math.round(M.height),x:Math.round(M.left),y:Math.round(M.top)};u(N),_&&k(d,1,`🎯 アクティブプレースホルダー ${t}-${n}:`,{size:`${N.width}×${N.height}`,position:`(${N.x}, ${N.y})`,bottomRight:`(${N.x+N.width}, ${N.y+N.height})`,center:`(${N.x+N.width/2}, ${N.y+N.height/2})`})}},[_,t,n,d]),k(d,2,`プレースホルダー${t}-${n}: 表示中`,{isHighlighted:_,isDragging:e,dragOverPosition:s,shouldShow:C}),a.jsxs("div",{ref:W,"data-placeholder-index":t,"data-placeholder-column":n,"data-aqdd-drop-placeholder":D,onDragEnter:()=>l(n,t),onDragLeave:M=>c(M,n,t),className:`relative flex w-full items-center justify-center ${D==="hidden"?"pointer-events-none h-0 overflow-hidden opacity-0":D==="target"?"my-2 scale-[1.02] rounded-xl border-4 border-dashed px-4 py-6 shadow-lg":"my-2 rounded-xl border-2 border-dashed px-2 py-4"}`,children:[!w&&C&&d.showPlaceholderInfo&&P&&a.jsxs("div",{className:"absolute top-1 right-1 z-10 rounded-md bg-blue-500/90 px-2 py-1 font-mono text-white text-xs leading-tight shadow-lg",children:[a.jsxs("div",{children:[P.width,"×",P.height]}),a.jsxs("div",{children:["X:",P.x," Y:",P.y]}),a.jsx("div",{className:"text-[10px] opacity-80",children:"min:200px max:500px"}),a.jsxs("div",{className:"mt-0.5 text-[10px] opacity-80",children:["PH-",n,"-",t," ",_?"ACTIVE":"IDLE"]})]}),!w&&C&&a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("svg",{className:"h-6 w-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),a.jsx("span",{lang:y.lang,className:"font-medium text-sm",children:y.text})]})]})});Be.displayName="InsertPlaceholder";const Xe=({columnIndex:t,isDragging:n,dragOverPosition:e,children:s,config:o})=>{const l=r.useRef(null),[c,d]=r.useState(null);return r.useEffect(()=>{if(l.current&&n){const p=l.current.getBoundingClientRect(),y=e?.columnIndex===t,w={width:Math.round(p.width),height:Math.round(p.height),x:Math.round(p.left),y:Math.round(p.top),isActive:y};d(w),y&&k(o,1,`🎯 アクティブドロップゾーン ${t}:`,{size:`${w.width}×${w.height}`,position:`(${w.x}, ${w.y})`,bottomRight:`(${w.x+w.width}, ${w.y+w.height})`,center:`(${w.x+w.width/2}, ${w.y+w.height/2})`})}},[n,e,t,o]),a.jsxs("div",{ref:l,className:"relative",children:[s,n&&c&&o.showDropZoneOutlines&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:`pointer-events-none absolute inset-0 rounded-lg border-2 border-dashed transition-all duration-200 ${c.isActive?"border-red-500 bg-red-100/20 shadow-lg":"border-gray-400 bg-gray-100/10"}`}),a.jsxs("div",{className:`absolute top-2 left-2 z-20 rounded-md px-2 py-1 font-mono text-xs leading-tight shadow-lg transition-all duration-200 ${c.isActive?"bg-red-500/90 text-white":"bg-gray-500/90 text-white"}`,children:[a.jsxs("div",{className:"font-bold",children:["DropZone-",t]}),a.jsxs("div",{children:[c.width,"×",c.height]}),a.jsxs("div",{children:["X:",c.x," Y:",c.y]}),a.jsx("div",{className:"mt-0.5 text-[10px] opacity-80",children:c.isActive?"ACTIVE":"IDLE"})]}),a.jsx("div",{className:`pointer-events-none absolute transition-all duration-200 ${c.isActive?"opacity-100":"opacity-50"}`,style:{left:`${c.width/2-6}px`,top:`${c.height/2-6}px`},children:a.jsx("div",{className:`h-3 w-3 rounded-full border-2 ${c.isActive?"border-red-700 bg-red-500":"border-gray-700 bg-gray-500"}`})}),c.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"pointer-events-none absolute top-0 left-0 h-2 w-2 rounded-full bg-red-500"}),a.jsx("div",{className:"pointer-events-none absolute top-0 right-0 h-2 w-2 rounded-full bg-red-500"}),a.jsx("div",{className:"pointer-events-none absolute bottom-0 left-0 h-2 w-2 rounded-full bg-red-500"}),a.jsx("div",{className:"pointer-events-none absolute right-0 bottom-0 h-2 w-2 rounded-full bg-red-500"})]})]})]})};Xe.displayName="DropZoneDebugOverlay";const Ge="[data-aqdd-scroll-root]",we="data-aqdd-panel-action",On=.25,Mn=typeof window<"u"?r.useLayoutEffect:r.useEffect,An=(t,n=On)=>{const e=r.useRef(null),[s,o]=r.useState(1);return Mn(()=>{const l=e.current;if(!l||t<=0){o(1);return}const c=()=>{const p=l.clientWidth;if(p<=0)return;const y=p>=t?1:Math.max(p/t,n);o(w=>Math.abs(w-y)<.005?w:y)};c();const d=new ResizeObserver(c);return d.observe(l),()=>d.disconnect()},[t,n]),{containerRef:e,scale:s}},_n=Object.freeze(["--aqdd-panel-surface","--aqdd-panel-border","--aqdd-panel-title-color","--aqdd-header-button-color","--aqdd-header-button-hover-color","--aqdd-header-button-hover-surface","--aqdd-custom-badge-color","--aqdd-custom-badge-surface","--aqdd-default-panel-surface","--aqdd-default-panel-border","--aqdd-default-panel-title-color","--aqdd-default-header-button-color","--aqdd-default-header-button-hover-color","--aqdd-default-header-button-hover-surface","--aqdd-default-header-close-hover-color","--aqdd-default-custom-badge-color","--aqdd-default-custom-badge-surface"]),vt=(t,n)=>{const e=window.getComputedStyle(t);for(const s of _n){const o=e.getPropertyValue(s).trim();o!==""&&n.style.setProperty(s,o)}},yt=(t,n,e)=>{const s=t.getBoundingClientRect(),o=t.cloneNode(!0);return o.removeAttribute("data-panel-id"),vt(t,o),o.style.position="fixed",o.style.top="0px",o.style.left="0px",o.style.width=`${t.offsetWidth}px`,o.style.height=`${t.offsetHeight}px`,o.style.pointerEvents="none",o.style.zIndex="1000",o.style.opacity="0.5",o.style.margin="0",o.style.transition="none",o.style.boxShadow="0 8px 32px rgba(0,0,0,0.3)",o.style.transformOrigin="top left",o.style.transform=`translate(${s.left}px, ${s.top}px) scale(${e})`,o.id=`drag-image-${n}`,document.body.appendChild(o),o},wt=(t,n,e,s,o)=>{t.style.transform=`translate(${n-s.x}px, ${e-s.y}px) scale(${o*1.05})`},Rn=(t,n)=>{let e=n.closest("[data-drop-zone]");for(;e!==null&&e.closest("[data-aqdd-layout]")!==t;){const s=e.parentElement;e=s===null?null:s.closest("[data-drop-zone]")}return e},Tn=(t,n,e)=>{const s=document.elementFromPoint(n,e),o=s===null?null:Rn(t,s);if(o===null)return null;let l=null;for(const c of o.querySelectorAll("[data-placeholder-index]")){if(c.closest("[data-drop-zone]")!==o)continue;const{top:d,bottom:p}=c.getBoundingClientRect(),y=e<d?d-e:e>p?e-p:0;(l===null||y<l.distance)&&(l={insertIndex:Number(c.getAttribute("data-placeholder-index")),distance:y})}return l===null?null:{columnIndex:Number(o.getAttribute("data-column-index")),insertIndex:l.insertIndex}},Ee={triggerDistance:80,scrollSpeed:5,maxScrollSpeed:20},Ve=()=>new DOMRect(0,0,window.innerWidth,window.innerHeight),Ln=t=>{const n=t.getBoundingClientRect(),e=Ve(),s=Math.max(n.left,e.left),o=Math.max(n.top,e.top),l=Math.min(n.right,e.right),c=Math.min(n.bottom,e.bottom);return l>s&&c>o?new DOMRect(s,o,l-s,c-o):null},Ze=(t,n,e=Ee,s)=>{const{triggerDistance:o,scrollSpeed:l,maxScrollSpeed:c}=e,d=s===void 0?Ve():Ln(s);if(d===null)return{x:0,y:0};const{left:p,top:y,right:w,bottom:_}=d;let W=0,P=0;if(t>=p&&t<=w&&n>=y&&n<=_){if(t<p+o){const u=Math.max(0,(p+o-t)/o);W=-Math.min(c,l+u*(c-l))}else if(t>w-o){const u=Math.max(0,(t-(w-o))/o);W=Math.min(c,l+u*(c-l))}if(n<y+o){const u=Math.max(0,(y+o-n)/o);P=-Math.min(c,l+u*(c-l))}else if(n>_-o){const u=Math.max(0,(n-(_-o))/o);P=Math.min(c,l+u*(c-l))}}return{x:W,y:P}},zn=(t,n)=>{if(t===document.documentElement)return!1;if(t===document.body){const o=window.getComputedStyle(document.documentElement);if(o.overflowX==="visible"&&o.overflowY==="visible")return!1}const e=window.getComputedStyle(t),s=n==="x"?e.overflowX:e.overflowY;return s==="auto"||s==="scroll"},In=(t,n,e,s)=>e==="x"?s>0?t.right-n.right:n.left-t.left:s>0?t.bottom-n.bottom:n.top-t.top,Et=(t,n,e)=>{const s=n==="x"?t.scrollLeft:t.scrollTop;return t.scrollBy(n==="x"?{left:e,behavior:"instant"}:{top:e,behavior:"instant"}),(n==="x"?t.scrollLeft:t.scrollTop)!==s},jt=(t,n,e,s,o)=>{const l=In(e,n,s,o);return l>0&&Et(t,s,Math.sign(o)*Math.min(Math.abs(o),l))},Ct=(t,n,e)=>{if(Et(t,n,e))return;const s=t.getBoundingClientRect();for(let l=t.parentElement;l!==null;l=l.parentElement)if(zn(l,n)&&jt(l,l.getBoundingClientRect(),s,n,e))return;const o=document.scrollingElement;o instanceof Element&&o!==t&&jt(o,Ve(),s,n,e)},Pt=(t,n)=>{if(n===void 0){(t.x!==0||t.y!==0)&&window.scrollBy(t.x,t.y);return}t.x!==0&&Ct(n,"x",t.x),t.y!==0&&Ct(n,"y",t.y)};class Ae{constructor(n=Ee,e){this.intervalId=null,this.isActive=!1,this.pointX=0,this.pointY=0,this.config=n,this.scrollElement=e}setScrollElement(n){this.scrollElement=n}start(n,e){this.pointX=n,this.pointY=e,!this.isActive&&(this.isActive=!0,this.intervalId=window.setInterval(()=>{const s=Ze(this.pointX,this.pointY,this.config,this.scrollElement);Pt(s,this.scrollElement)},16))}update(n,e){this.pointX=n,this.pointY=e;const s=Ze(n,e,this.config,this.scrollElement);(s.x!==0||s.y!==0)&&!this.isActive?this.start(n,e):s.x===0&&s.y===0&&this.isActive&&this.stop()}stop(){this.intervalId!==null&&(clearInterval(this.intervalId),this.intervalId=null),this.isActive=!1}isScrolling(){return this.isActive}updateConfig(n){this.config=n}}const kt="custom-dragging",Wn=(t,n)=>t===null?n===null:n!==null&&t.columnIndex===n.columnIndex&&t.insertIndex===n.insertIndex,Dt=(t,n,e)=>{const{left:s,top:o,right:l,bottom:c}=t.getBoundingClientRect();return n<s||n>l||e<o||e>c},Hn=(t,n)=>{let e=null;const s=f=>{const R=t(),T=R.layoutRef.current;if(T===null||Dt(T,f.x,f.y))return null;const U=Tn(T,f.x,f.y),J=R.originOf(f.panelId);return U===null||J===null||He(J,U.columnIndex,U.insertIndex)?null:U},o=()=>{if(e===null||e.phase!=="dragging")return;const f=s(e);n(R=>R===null||Wn(R.over,f)?R:{panelId:R.panelId,over:f})},l=f=>{if(e===null||f.pointerId!==e.pointerId)return;if(e.x=f.clientX,e.y=f.clientY,e.phase==="pressing"){Math.hypot(e.x-e.startX,e.y-e.startY)>t().config.slop&&P();return}const R=t(),T=R.layoutRef.current;if(T===null||Dt(T,e.x,e.y)){u();return}wt(e.image,e.x,e.y,e.offset,R.scale),e.edgeScroll.update(e.x,e.y),o()},c=f=>{if(e===null||f.pointerId!==e.pointerId)return;if(e.phase==="pressing"){P();return}e.x=f.clientX,e.y=f.clientY;const R=s(e),T=P();if(T===null)return;const U=t();R===null?U.onCancel(T.panelId):U.onDrop(T.panelId,R)},d=f=>{e!==null&&f.pointerId===e.pointerId&&u()},p=f=>{e!==null&&e.phase==="pressing"&&f.pointerId!==e.pointerId&&P()},y=f=>{e!==null&&e.phase==="dragging"&&f.pointerId===e.pointerId&&f.target===e.header&&u()},w=f=>{e===null||e.phase!=="dragging"||f.key!=="Escape"||f.defaultPrevented||f.isComposing||(f.preventDefault(),u())},_=()=>{document.addEventListener("pointermove",l,!0),document.addEventListener("pointerup",c,!0),document.addEventListener("pointercancel",d,!0),document.addEventListener("pointerdown",p,!0),document.addEventListener("lostpointercapture",y,!0),document.addEventListener("keydown",w,!0)},W=()=>{document.removeEventListener("pointermove",l,!0),document.removeEventListener("pointerup",c,!0),document.removeEventListener("pointercancel",d,!0),document.removeEventListener("pointerdown",p,!0),document.removeEventListener("lostpointercapture",y,!0),document.removeEventListener("keydown",w,!0)},P=()=>{const f=e;return f===null?null:(e=null,W(),f.phase==="pressing"?(window.clearTimeout(f.timer),f):(document.removeEventListener("scroll",o,!0),f.edgeScroll.stop(),f.image.remove(),document.body.classList.remove(kt),f.header.hasPointerCapture(f.pointerId)&&f.header.releasePointerCapture(f.pointerId),n(null),f))},u=()=>{const f=P();f!==null&&f.phase==="dragging"&&t().onCancel(f.panelId)},C=()=>{if(e===null||e.phase!=="pressing")return;const f=e,R=t(),T=R.panelElementOf(f.panelId),U=R.scrollRootRef.current;if(!R.canStart||T===null||U===null||!f.header.isConnected){P();return}try{f.header.setPointerCapture(f.pointerId)}catch(v){if(v instanceof DOMException){P();return}throw v}const{left:J,top:x}=T.getBoundingClientRect();e={phase:"dragging",pointerId:f.pointerId,panelId:f.panelId,header:f.header,image:yt(T,f.panelId,R.scale),offset:{x:f.x-J,y:f.y-x},edgeScroll:new Ae(Ee,U),x:f.x,y:f.y},document.addEventListener("scroll",o,{capture:!0,passive:!0}),document.body.classList.add(kt),n({panelId:f.panelId,over:null}),R.onLift(f.panelId)};return{pressHeader:(f,R)=>{if(e!==null||!f.isPrimary||f.button!==0||f.pointerType!=="touch"&&f.pointerType!=="pen")return;const T=t();T.canStart&&(f.target instanceof Element&&f.target.closest(`[${we}]`)!==null||(e={phase:"pressing",pointerId:f.pointerId,panelId:R,header:f.currentTarget,startX:f.clientX,startY:f.clientY,timer:window.setTimeout(C,T.config.longPressDelay),x:f.clientX,y:f.clientY},_()))},holdContextMenu:f=>{e!==null&&e.header===f.currentTarget&&f.preventDefault()},bindHeader:f=>{if(f===null)return;const R=T=>{e!==null&&e.phase==="dragging"&&e.header===f&&T.cancelable&&T.preventDefault()};return f.addEventListener("touchmove",R,{passive:!1}),()=>f.removeEventListener("touchmove",R)},cancel:u,dispose:()=>{P()}}},Fn=t=>{const n=r.useRef(t);r.useLayoutEffect(()=>{n.current=t});const[e,s]=r.useState(null),[o]=r.useState(()=>Hn(()=>n.current,s));return r.useEffect(()=>o.dispose,[o]),{touchDrag:e,pressHeader:o.pressHeader,holdContextMenu:o.holdContextMenu,bindHeader:o.bindHeader,cancel:o.cancel}},_e=Object.freeze({switchToCustomDragMode:{text:"カスタムドラッグモードに切り替え",lang:"ja"},switchToNormalDragMode:{text:"通常ドラッグモードに戻す",lang:"ja"},hidePanel:{text:"パネルを非表示",lang:"ja"},maximizePanel:{text:"パネルを最大化",lang:"ja"},restorePanel:{text:"元のサイズに戻す",lang:"ja"},closePanel:{text:"パネルを閉じる",lang:"ja"},movePanelToPreviousColumn:{text:"前の列へ移動",lang:"ja"},movePanelToNextColumn:{text:"次の列へ移動",lang:"ja"},movePanelUp:{text:"上へ移動",lang:"ja"},movePanelDown:{text:"下へ移動",lang:"ja"},customDragModeBadge:{text:"Custom",lang:"en"},panelMoved:{text:"{title} を {column} 列目の {position} 番目へ移動しました",lang:"ja"},panelMoveUnavailable:{text:"{title} は{move}できません",lang:"ja"},panelDragStarted:{text:"{title} を持ち上げました",lang:"ja"},panelDragCancelled:{text:"{title} の移動を取り消しました",lang:"ja"},hiddenPanels:{text:"非表示のパネル:",lang:"ja"},hiddenPanelBadge:{text:"非表示",lang:"ja"},hiddenPanelNotice:{text:"このパネルは非表示です",lang:"ja"},emptyColumn:{text:"このエリアは空です",lang:"ja"},dropZone:{text:"Drop zone for column {column}",lang:"en"},dropHere:{text:"パネルをここにドロップ",lang:"ja"},resizeColumn:{text:"{column} 列目のカラム幅を調整",lang:"ja"}}),Nt=new Set(Object.keys(_e)),St=Object.freeze({panelMoved:Object.freeze(["title","column","position"]),panelMoveUnavailable:Object.freeze(["title","move"]),panelDragStarted:Object.freeze(["title"]),panelDragCancelled:Object.freeze(["title"]),dropZone:Object.freeze(["column"]),resizeColumn:Object.freeze(["column"])}),Ot=/\{(\w+)\}/g,Yn=Object.freeze(Object.fromEntries(Object.entries(_e).map(([t,n])=>[t,n.text]))),Un=t=>{if(t!==void 0){const e=t;if(e===null||typeof e!="object")throw new TypeError(`[@aiquants/drag-drop-panels] labels must be an object; got ${e===null?"null":typeof e}`);for(const s of Object.keys(e))if(!Nt.has(s))throw new RangeError(`[@aiquants/drag-drop-panels] labels has the unknown key "${s}"; the labels are ${[...Nt].join(", ")}`)}const n={};for(const e of Object.keys(_e)){const s=t?.[e];if(s===void 0){n[e]=_e[e];continue}if(typeof s!="string")throw new TypeError(`[@aiquants/drag-drop-panels] label "${e}" must be a string; got ${s===null?"null":typeof s}`);const o=St[e];if(o!==void 0){for(const[,l]of s.matchAll(Ot))if(!o.includes(l))throw new RangeError(`[@aiquants/drag-drop-panels] label "${e}" uses the unknown placeholder {${l}}; it accepts ${o.map(c=>`{${c}}`).join(", ")}`)}n[e]={text:s,lang:void 0}}return Object.freeze(n)},Re=(t,n)=>{const e=[],s=(o,l)=>{if(o==="")return;const c=e[e.length-1];if(c!==void 0&&c.lang===l){e[e.length-1]={text:`${c.text}${o}`,lang:l};return}e.push({text:o,lang:l})};for(const[o,l]of t.text.split(Ot).entries()){if(o%2===0){s(l,t.lang);continue}const c=n[l];if(c===void 0)throw new RangeError(`[@aiquants/drag-drop-panels] no value for the placeholder {${l}} of "${t.text}"`);typeof c=="number"?s(String(c),t.lang):s(c.text,c.lang)}return e},Mt=(t,n)=>({text:Re(t,n).map(e=>e.text).join(""),lang:t.lang}),Bn=229,Xn=new Set(["","auto","hint"]),Gn=t=>{for(const n of t.querySelectorAll("[popover]")){const e=n.getAttribute("popover");if(e!==null&&Xn.has(e.toLowerCase())&&n.matches(":popover-open"))return!0}return!1},Vn=t=>t.key!=="Escape"||t.defaultPrevented||t.isComposing||t.keyCode===Bn||t.target instanceof Element&&t.target.closest("dialog[open]")!==null?!1:!("popover"in HTMLElement.prototype&&Gn(document)),Ke=({columnId:t,onResizeStart:n,onResize:e,onResizeEnd:s,isResizing:o=!1,position:l="right",className:c="",debug:d={},label:p})=>{const y=r.useRef(!1),w=r.useRef(null);r.useEffect(()=>{!o&&y.current&&(k(d,1,"外部からのリサイズ解除を検出、ドラッグ状態を強制解除:",t),y.current=!1,document.body.style.cursor="",document.body.style.userSelect="",document.body.classList.remove("resizing-column"))},[o,t,d]);const _=r.useCallback(u=>{u.preventDefault(),u.stopPropagation(),k(d,2,"リサイズハンドル マウスダウン:",t),y.current=!0,n(t,u.clientX),document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.body.classList.add("resizing-column")},[t,n,d]);r.useEffect(()=>{const u=D=>{y.current&&(D.preventDefault(),e(D.clientX))},C=()=>{y.current&&(k(d,2,"リサイズハンドル マウスアップ:",t),y.current=!1,s(),document.body.style.cursor="",document.body.style.userSelect="",document.body.classList.remove("resizing-column"))};return document.addEventListener("mousemove",u),document.addEventListener("mouseup",C),()=>{document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",C)}},[t,e,s,d]);const W=r.useCallback(u=>{u.preventDefault(),u.stopPropagation();const C=u.touches[0];k(d,2,"リサイズハンドル タッチスタート:",t),y.current=!0,n(t,C.clientX),document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.body.classList.add("resizing-column")},[t,n,d]);r.useEffect(()=>{const u=D=>{if(!y.current)return;D.preventDefault();const M=D.touches[0];e(M.clientX)},C=()=>{y.current&&(k(d,2,"リサイズハンドル タッチエンド:",t),y.current=!1,s(),document.body.style.cursor="",document.body.style.userSelect="",document.body.classList.remove("resizing-column"))};return document.addEventListener("touchmove",u,{passive:!1}),document.addEventListener("touchend",C),()=>{document.removeEventListener("touchmove",u),document.removeEventListener("touchend",C)}},[t,e,s,d]),r.useEffect(()=>()=>{y.current&&(k(d,1,"リサイズハンドルアンマウント時のクリーンアップ:",t),document.body.style.cursor="",document.body.style.userSelect="",document.body.classList.remove("resizing-column"))},[t,d]);const P=["resize-handle",l,o?"resizing":"",c].filter(Boolean).join(" ");return a.jsxs("div",{ref:w,className:P,onMouseDown:_,onTouchStart:W,"data-column-id":t,"data-position":l,"aria-label":p.text,lang:p.lang,role:"separator","aria-orientation":"vertical",children:[a.jsx("div",{className:"resize-handle-bar"}),d.showPanelSizes&&a.jsxs("div",{className:"resize-handle-debug-info",children:[t,o&&" (resizing)"]})]})},Zn=({columnId:t,width:n,minWidth:e=100,maxWidth:s=800,onResizeStart:o,onResize:l,onResizeEnd:c,isResizing:d=!1,resizable:p=!0,className:y="",debug:w={},resizeHandleLabel:_,children:W})=>{const P=["resizable-column",d?"resizing":"",y].filter(Boolean).join(" ");return r.useEffect(()=>{const u=document.querySelector(`[data-column-id="${t}"]`);u&&(u.style.setProperty("--column-width",`${n}px`),u.style.setProperty("--column-min-width",`${e}px`),u.style.setProperty("--column-max-width",`${s}px`))},[t,n,e,s]),a.jsxs("div",{className:P,"data-column-id":t,"data-width":n,"data-min-width":e,"data-max-width":s,children:[W,p&&a.jsx(Ke,{columnId:t,onResizeStart:o,onResize:l,onResizeEnd:c,isResizing:d,position:"right",debug:w,label:_}),w.showPanelSizes&&a.jsxs("div",{className:"column-debug-size",children:[n,"px",d&&" ↔"]})]})},At=Object.freeze({longPressDelay:500,slop:10}),Je=Object.freeze(["longPressDelay","slop"]),Kn=t=>{const n=t;if(n===null||typeof n!="object")throw new TypeError(`[@aiquants/drag-drop-panels] touchDragConfig must be an object; got ${n===null?"null":typeof n}`);for(const e of Object.keys(n))if(!Je.includes(e))throw new RangeError(`[@aiquants/drag-drop-panels] touchDragConfig has the unknown key "${e}"; the keys are ${Je.join(", ")}`);for(const e of Je){const s=t[e];if(typeof s!="number")throw new TypeError(`[@aiquants/drag-drop-panels] touchDragConfig.${e} must be a number; got ${s===null?"null":typeof s}`);if(!Number.isFinite(s)||s<0)throw new RangeError(`[@aiquants/drag-drop-panels] touchDragConfig.${e} must be a finite number of 0 or more; got ${s}`)}},_t=Object.freeze({"previous-column":"movePanelToPreviousColumn","next-column":"movePanelToNextColumn",up:"movePanelUp",down:"movePanelDown"}),Jn=Object.freeze({"previous-column":vn,"next-column":yn,up:wn,down:bn}),Qn='input, textarea, select, [contenteditable]:not([contenteditable="false"])',Qe=(t,n)=>({segments:n,serial:t===null?1:t.serial+1}),qn="​",$n="(prefers-reduced-motion: reduce)",eo=()=>typeof window.matchMedia=="function"&&window.matchMedia($n).matches,to=t=>{t.key==="Enter"&&t.repeat&&t.preventDefault()},ke=({action:t,label:n,tooltip:e,unavailable:s,keyShortcuts:o,onActivate:l,children:c})=>a.jsx("button",{type:"button",[we]:t,"aria-label":n.text,"aria-disabled":s?!0:void 0,"aria-keyshortcuts":o,title:e,lang:n.lang,className:"rounded p-1 motion-safe:transition-colors",onClick:d=>{d.stopPropagation(),l()},children:c}),qe=r.memo(({index:t,columnIndex:n,isDragging:e,dragOverPosition:s,originalPosition:o,onDragEnter:l,onDragLeave:c,debugConfig:d,customDrag:p,label:y})=>a.jsx(Be,{index:t,columnIndex:n,isDragging:e,dragOverPosition:s,originalPosition:o,onDragEnter:l,onDragLeave:c,config:d,customDrag:p,label:y}));qe.displayName="LocalInsertPlaceholder";const no=({columns:t,panels:n,columnPanels:e,onColumnPanelsChange:s,panelVisibility:o,onPanelVisibilityChange:l,dragState:c,dragOverPosition:d,originalPanelPosition:p,dragModes:y,onDragStart:w,onDragEnd:_,onPlaceholderDragEnter:W,onPlaceholderDragLeave:P,onDragOverWithInsert:u,onDropWithInsert:C,onColumnDragLeave:D,onPanelClick:M,onPanelMouseDown:N,debugConfig:I,panelSizes:f,setPanelRef:R,enableResize:T=!1,columnWidths:U,onResizeStart:J,onResize:x,onResizeEnd:v,isResizing:L=!1,resizingColumn:E,onPanelSizeInfoClick:h,onToggleDragMode:g,onPanelClose:j,onPanelMaximizeChange:z,customDrag:F,dragHandle:ne="panel",maximizedPanel:Z=null,panelClassName:oe="",scale:m,autoScale:b,onScaleChange:O,scrollRootElement:B="div",labels:K,touchDragConfig:re=At})=>{if(B!=="div"&&B!=="main")throw new RangeError(`[@aiquants/drag-drop-panels] scrollRootElement must be "div" or "main"; got ${JSON.stringify(B)}`);const V=B,Y=r.useMemo(()=>Un(K),[K]);Kn(re);const ge=r.useId(),ce=r.useMemo(()=>{const i={};return n.forEach(S=>{i[S.id]=S}),i},[n]),me=r.useMemo(()=>({columnKeys:t.map(i=>i.key),columnPanels:e,panelVisibility:Object.fromEntries(Object.keys(o).map(i=>[i,o[i]===!0&&ce[i]!==void 0]))}),[t,e,o,ce]),Ft=Z===null?null:ye(me,Z),ie=Ft!==null,xe=r.useRef(I);r.useEffect(()=>{xe.current=I},[I]);const{containerRef:yo,scale:wo}=An(b?.requiredWidth??0,b?.minScale),tt=ie?1:m??(b?wo:1),he=Number.isFinite(tt)&&tt>0?tt:1,Yt=r.useRef(he);Yt.current=he,r.useEffect(()=>{O&&O(he)},[he,O]);const Eo=he<1?{width:`${100/he}%`,height:`${100/he}%`,transform:`scale(${he})`,transformOrigin:"top left"}:void 0,de=r.useRef({}),nt=r.useRef(new Map);r.useEffect(()=>{k(xe.current,1,"🎨 DragDropLayout - dragModes props changed:",{dragModes:y,timestamp:new Date().toISOString(),keys:Object.keys(y),values:Object.values(y)})},[y]);const[ot,st]=r.useState(null),Te=r.useRef(null),Ut=r.useRef({arrangement:me,labels:Y,panelComponentMap:ce});r.useLayoutEffect(()=>{Ut.current={arrangement:me,labels:Y,panelComponentMap:ce}});const Bt=r.useRef(null),Xt=r.useRef(null),jo=r.useCallback(i=>{Xt.current=i},[]),Gt=r.useRef(null),rt=(i,S)=>{const H=ce[S];if(H===void 0)return;const Q=Re(i,{title:{text:H.title,lang:void 0}});st(q=>Qe(q,Q))},Vt=(i,S,H,Q)=>{const q=de.current[i],ee=document.activeElement,te=q instanceof HTMLElement&&ee!==null&&q.contains(ee)?ee.closest(`[${we}]`)?.getAttribute(we)??Q:null;Te.current={panelId:i,from:S,columnPanels:me.columnPanels,focusAction:te},s(H)},Zt=i=>{for(const[S,H]of t.entries()){const Q=(e[H.key]??[]).indexOf(i);if(Q>=0)return{columnIndex:S,panelIndex:Q}}return null},Co=(i,S)=>{const H=ye(me,i),Q=t[S.columnIndex],q=H===null||Q===void 0?null:Fe(e,i,Q.key,S.insertIndex);if(H===null||q===null){rt(Y.panelDragCancelled,i);return}Vt(i,H,q,null)},Kt=!(c.isDragging||F?.isActive===!0||ie),Se=Fn({config:re,layoutRef:Bt,scrollRootRef:Xt,scale:he,canStart:Kt,panelElementOf:i=>de.current[i]??null,originOf:Zt,onLift:i=>rt(Y.panelDragStarted,i),onDrop:Co,onCancel:i=>rt(Y.panelDragCancelled,i)}),{touchDrag:be}=Se,Jt=be!==null&&(!Kt||ye(me,be.panelId)===null),Qt=Se.cancel;r.useEffect(()=>{Jt&&Qt()},[Jt,Qt]);const Le=c.isDragging||F?.isActive===!0||be!==null;r.useLayoutEffect(()=>{Le&&(Te.current=null)},[Le]),r.useLayoutEffect(()=>{const i=Te.current;if(i===null||(Te.current=null,!Sn(i.columnPanels,e,i.panelId)))return;const S=Ut.current,H=ye({...S.arrangement,columnPanels:e},i.panelId);if(H===null||H.column===i.from.column&&H.index===i.from.index)return;const Q=Re(S.labels.panelMoved,{title:{text:S.panelComponentMap[i.panelId].title,lang:void 0},column:H.column+1,position:H.index+1});st($=>Qe($,Q));const q=de.current[i.panelId];if(i.focusAction===null||q===null||q===void 0)return;const{activeElement:ee,body:te}=document;if(ee===null||ee===te){const $=q.querySelector(`[${we}="${i.focusAction}"]`);$ instanceof HTMLElement&&$.focus({preventScroll:!0})}const X=document.activeElement;X instanceof HTMLElement&&q.contains(X)&&X.scrollIntoView({block:"nearest",inline:"nearest"})},[e]),r.useEffect(()=>{if(!(ie&&z))return;const i=S=>{Vn(S)&&(S.preventDefault(),z(null))};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[ie,z]),r.useLayoutEffect(()=>{const i=new Map;Object.keys(de.current).forEach(te=>{const X=de.current[te];if(X){const $=X.getBoundingClientRect();i.set(te,{rect:$,height:X.offsetHeight,width:X.offsetWidth})}});const S=nt.current,H=300,Q=new Set;Object.values(e).forEach(te=>{te.forEach(X=>{Q.add(X)})}),new Set(S.keys()).forEach(te=>{Q.has(te)||(k(xe.current,1,"パネル削除検出 - クリーンアップ:",te),S.delete(te),de.current[te]&&delete de.current[te])});const ee=!eo();i.forEach((te,X)=>{if(!ee)return;const $=S.get(X);if($){const ae=$.rect.left-te.rect.left,pe=$.rect.top-te.rect.top;if(ae!==0||pe!==0){k(xe.current,2,"パネル移動検出 - アニメーション開始:",X,{dx:ae,dy:pe});const le=de.current[X];if(le){const ze=Yt.current||1;le.style.transform=`translate(${ae/ze}px, ${pe/ze}px)`,le.style.transition="none",le.classList.add("is-moving"),requestAnimationFrame(()=>{le.style.transition=`transform ${H}ms cubic-bezier(0.2, 0, 0.2, 1)`,le.style.transform="translate(0, 0)",setTimeout(()=>{le.style.transition="",le.style.transform="",le.classList.remove("is-moving")},H)})}}}else{k(xe.current,1,"新規パネル検出 - フェードインアニメーション:",X);const ae=de.current[X];ae&&(ae.style.opacity="0",ae.style.transition="none",requestAnimationFrame(()=>{ae.style.transition=`opacity ${H}ms ease-out`,ae.style.opacity="1",setTimeout(()=>{ae.style.transition="",ae.style.opacity=""},H)}))}}),nt.current=i},[e]),r.useLayoutEffect(()=>{const i=new Map;Object.keys(de.current).forEach(S=>{const H=de.current[S];H&&i.set(S,{rect:H.getBoundingClientRect(),height:H.offsetHeight,width:H.offsetWidth})}),nt.current=i},[he]);const qt=(i,S,H)=>{if(Le)return;const Q=xt(me,i,S);if(Q===null){if(H){const q=Re(Y.panelMoveUnavailable,{title:{text:ce[i].title,lang:void 0},move:Y[_t[S]]});st(ee=>Qe(ee,q))}return}Vt(i,Q.from,Q.columnPanels,`move-${S}`)},Po=(i,S)=>{if(i.defaultPrevented||ie||!(i.target instanceof Node&&i.currentTarget.contains(i.target)))return;const H=bt(i);H!==null&&(i.target instanceof Element&&i.target.closest(Qn)!==null||(i.preventDefault(),!i.repeat&&qt(S,H,!0)))},$t=(i,S)=>{const H=Gt.current;if(H==="touch"||H==="pen"){i.preventDefault();return}w(i,S)},at=be===null?d:be.over,en=be===null?p:Zt(be.panelId),ko=i=>{if(!o[i])return null;const S=ce[i];if(!S)return k(xe.current,1,`Panel config not found for panelId: ${i}`),null;const H=S.component,Q=S.title,q=c.draggedPanel===i||be?.panelId===i,ee=y[i]||"normal";k(xe.current,2,`🎨 renderPanel - ${i}:`,{panelId:i,dragMode:ee,timestamp:new Date().toISOString()});const te=G=>{de.current[i]=G,R&&R(i,G),G&&I.showPanelSizes&&requestAnimationFrame(()=>{const je=G.getBoundingClientRect(),Oe=window.getComputedStyle(G);k(xe.current,1,`Panel ${i} mounted with size:`,{width:je.width,height:je.height,x:je.left,y:je.top,minHeight:Oe.minHeight,maxHeight:Oe.maxHeight})})},X=f[i],$=Z===i,ae=!!z,pe=()=>z?.($?null:i),le=$?null:new Set(gt(me,i)),ze=$?{position:"fixed",top:"var(--aqdd-maximize-top, 0px)",right:"var(--aqdd-maximize-right, 0px)",bottom:"var(--aqdd-maximize-bottom, 0px)",left:"var(--aqdd-maximize-left, 0px)",zIndex:50,minHeight:0,maxHeight:"none"}:{minHeight:S.minHeight??"200px",maxHeight:S.maxHeight??"500px"},Ie=ne==="header",nn=ee==="normal"&&!Ie&&!$,on=ee==="normal"&&Ie&&!$,sn=q?"cursor-grabbing":"cursor-grab",rn=`panel-draggable relative flex flex-col overflow-hidden border text-left shadow-lg backdrop-blur-lg ${ee==="custom"?"select-none":""}`,No=$?`${rn} rounded-none p-4 ${oe}`:`${rn} rounded-2xl p-4 motion-safe:transition-all motion-safe:duration-300 motion-safe:hover:-translate-y-1 hover:shadow-xl ${Ie?"":sn} ${oe}`,an=ee==="custom"?Y.switchToNormalDragMode:Y.switchToCustomDragMode,ln=$?Y.restorePanel:Y.maximizePanel;return a.jsxs("div",{ref:te,"data-panel-id":i,"data-aqdd-panel":!0,"data-aqdd-drag-mode":ee,"data-dragging":q,"data-maximized":$||void 0,role:"presentation",draggable:nn,onDragStart:G=>nn&&$t(G,i),onDragEnd:_,onClick:G=>M?.(G,i),onMouseDown:G=>N?.(G,i),onKeyDown:G=>Po(G,i),style:ze,className:No,children:[a.jsxs("div",{ref:Se.bindHeader,"data-aqdd-panel-header":!0,className:`relative mb-3 ${Ie&&!$?sn:""}`,draggable:on,onDragStart:G=>on&&$t(G,i),onPointerDown:G=>Se.pressHeader(G,i),onContextMenu:Se.holdContextMenu,onKeyDown:to,onDoubleClick:ae?G=>{G.stopPropagation(),!(G.target instanceof Element&&G.target.closest(`[${we}]`)!==null)&&pe()}:void 0,children:[a.jsx("h3",{"data-aqdd-panel-title":!0,className:"font-semibold text-lg",children:Q}),a.jsxs("div",{"data-aqdd-panel-controls":!0,children:[ee==="custom"&&a.jsx("span",{"data-aqdd-custom-badge":!0,lang:Y.customDragModeBadge.lang,className:"rounded-md px-2 py-1 font-medium text-xs",children:Y.customDragModeBadge.text}),a.jsxs("div",{"data-aqdd-panel-buttons":!0,children:[le!==null&&ve.map(G=>{const je=Jn[G],Oe=Y[_t[G]],cn=Ue[G];return a.jsx(ke,{action:`move-${G}`,label:Oe,tooltip:`${Oe.text} (${cn.text})`,unavailable:!le.has(G),keyShortcuts:cn.aria,onActivate:()=>qt(i,G,!1),children:a.jsx(je,{className:"h-4 w-4","aria-hidden":"true"})},G)}),a.jsx(ke,{action:"drag-mode",label:an,tooltip:an.text,unavailable:!1,keyShortcuts:void 0,onActivate:()=>g?.(i),children:ee==="custom"?a.jsx(kn,{className:"h-4 w-4","aria-hidden":"true"}):a.jsx(Pn,{className:"h-4 w-4","aria-hidden":"true"})}),!$&&a.jsx(ke,{action:"hide",label:Y.hidePanel,tooltip:Y.hidePanel.text,unavailable:!1,keyShortcuts:void 0,onActivate:()=>l({...o,[i]:!1}),children:a.jsx(ft,{className:"h-4 w-4","aria-hidden":"true"})}),ae&&a.jsx(ke,{action:$?"restore":"maximize",label:ln,tooltip:ln.text,unavailable:!1,keyShortcuts:void 0,onActivate:pe,children:$?a.jsx(Cn,{className:"h-4 w-4","aria-hidden":"true"}):a.jsx(jn,{className:"h-4 w-4","aria-hidden":"true"})}),j&&a.jsx(ke,{action:"close",label:Y.closePanel,tooltip:Y.closePanel.text,unavailable:!1,keyShortcuts:void 0,onActivate:()=>j(i),children:a.jsx(mt,{className:"h-4 w-4","aria-hidden":"true"})})]})]})]}),a.jsx("div",{"data-aqdd-scroll-area":!0,className:"panel-scroll-area min-h-0 flex-1 overflow-y-auto",children:a.jsx(H,{...S.props||{}})}),a.jsx(ht,{config:I,panelId:i,sizeInfo:X,onSizeInfoClick:G=>h?.(G,i)})]},i)},Do=(i,S)=>{const H=e[i]||[];let Q=!1;for(const X of H)if(o[X]){Q=!0;break}const q=Le,ee=Mt(Y.dropZone,{column:S+1}),te=`${ge}-drop-zone-${S}`;return a.jsx(Xe,{columnIndex:S,isDragging:q,dragOverPosition:at,config:I,children:a.jsxs("section",{"data-drop-zone":"true","data-column-key":i,"data-column-index":S,"aria-labelledby":te,onDragOver:X=>u(X,S),onDrop:X=>C(X,i),onDragLeave:D,className:"relative flex h-full flex-col motion-safe:transition-all motion-safe:duration-200",children:[a.jsx("span",{id:te,hidden:!0,lang:ee.lang,children:ee.text}),a.jsx("div",{className:"placeholder-container",inert:ie,children:a.jsx(qe,{index:0,columnIndex:S,isDragging:q,dragOverPosition:at,originalPosition:en,onDragEnter:W,onDragLeave:P,debugConfig:I,customDrag:F,label:Y.dropHere})}),H.map((X,$)=>{const ae=o[X],pe=!(ae||q),le=ie&&X===Z;return a.jsxs("div",{className:`panel-with-placeholder ${pe?"m-0 h-0 overflow-hidden p-0":""}`,"data-panel-hidden":pe?"true":void 0,"aria-hidden":pe?"true":void 0,inert:ie&&!le,children:[ae?ko(X):q?a.jsxs("div",{"data-aqdd-hidden-panel-stand-in":!0,className:"hidden-panel-placeholder relative h-[120px] rounded-2xl border-2 border-dashed p-3 text-left shadow-lg backdrop-blur-lg",children:[a.jsxs("div",{className:"mb-2 flex items-center space-x-2",children:[a.jsx("h3",{className:"font-semibold text-base",children:ce[X]?.title||X}),a.jsx("span",{"data-aqdd-hidden-panel-badge":!0,lang:Y.hiddenPanelBadge.lang,className:"rounded-md px-2 py-1 font-medium text-xs",children:Y.hiddenPanelBadge.text})]}),a.jsx("div",{className:"flex-1 overflow-hidden",children:a.jsx("div",{className:"flex h-full items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx(ft,{className:"mx-auto h-6 w-6 opacity-50","aria-hidden":"true"}),a.jsx("p",{lang:Y.hiddenPanelNotice.lang,className:"mt-1 text-xs",children:Y.hiddenPanelNotice.text})]})})})]}):null,le?null:a.jsx(qe,{index:$+1,columnIndex:S,isDragging:q,dragOverPosition:at,originalPosition:en,onDragEnter:W,onDragLeave:P,debugConfig:I,customDrag:F,label:Y.dropHere})]},`panel-${X}`)}),!(Q||q)&&a.jsx("div",{"data-aqdd-empty-column":!0,className:"flex-shrink-0 rounded-xl border-2 border-dashed p-8 text-center motion-safe:transition-all motion-safe:duration-200",inert:ie,children:a.jsx("div",{lang:Y.emptyColumn.lang,className:"text-sm",children:Y.emptyColumn.text})})]})})},tn=Object.keys(o).filter(i=>!o[i]);return a.jsxs("div",{ref:Bt,"data-aqdd-layout":!0,className:"flex h-full flex-col",onPointerDownCapture:i=>{Gt.current=i.pointerType},children:[a.jsxs("div",{"data-aqdd-announcer":!0,role:"status","aria-live":"polite","aria-atomic":"true",inert:ie,children:[ot?.segments.map((i,S)=>i.lang===void 0?i.text:a.jsx("span",{lang:i.lang,children:i.text},S)),ot!==null&&ot.serial%2===0?qn:null]}),tn.length>0&&a.jsx("div",{"data-aqdd-hidden-panels":!0,className:"border-b px-4 py-2 backdrop-blur-lg",inert:ie,children:a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx("span",{lang:Y.hiddenPanels.lang,className:"mr-2 text-sm",children:Y.hiddenPanels.text}),tn.map(i=>{const H=ce[i]?.title||i;return a.jsxs("button",{type:"button","data-aqdd-restore-panel":i,onClick:()=>l({...o,[i]:!0}),className:"flex items-center space-x-1 rounded-lg px-3 py-1 text-sm shadow-md hover:shadow-lg motion-safe:transition-all motion-safe:duration-200",children:[a.jsx(En,{className:"h-3 w-3","aria-hidden":"true"}),a.jsx("span",{children:H})]},i)})]})}),a.jsx("div",{ref:yo,className:"relative min-h-0 flex-1 overflow-hidden",children:a.jsx("div",{className:"h-full w-full",style:Eo,children:a.jsx(V,{ref:jo,"data-aqdd-scroll-root":!0,className:"no-scrollbar h-full max-w-full flex-1 overflow-auto",children:a.jsx("div",{"data-aqdd-columns":!0,className:"relative flex h-full items-start",children:t.map((i,S)=>{const H=U?.[i.id]||i.initialWidth||350,Q=T&&(i.resizable??!0);return a.jsx(r.Fragment,{children:a.jsxs("div",{className:`column relative ${i.className||""} ${T?"resize-enabled-column":"auto-width-column"} ${L&&E===i.id?"column-resizing-active":""}`,"data-column":S,"data-column-id":i.id,"data-min-width":i.minWidth||350,"data-max-width":i.maxWidth,"data-column-width":T?H:void 0,inert:ie&&S!==Ft.column,...T&&{style:{"--column-width":`${H}px`}},children:[Do(i.key,S),Q&&!ie&&J&&x&&v&&a.jsx(Ke,{columnId:i.id,onResizeStart:J,onResize:x,onResizeEnd:v,isResizing:L&&E===i.id,position:"right",debug:I,label:Mt(Y.resizeColumn,{column:S+1})})]})},i.id)})})})})})]})};const oo=se("grid-3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);const so=se("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const $e=se("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const ro=se("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),ao=({columnCount:t,onColumnCountChange:n,onAutoBalance:e,onResetWidths:s,minColumns:o=2,maxColumns:l=6,isResizing:c=!1,isResponsiveMode:d=!1,responsiveColumnCount:p})=>{const y=t>o&&!d,w=t<l&&!d;return a.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-slate-200 bg-white/80 px-4 py-2 shadow-sm backdrop-blur-lg",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-medium text-slate-700 text-sm",children:"カラム数:"}),a.jsx("button",{type:"button",onClick:()=>y&&n(t-1),disabled:!y||c,className:`rounded p-1 text-xs transition-colors ${y&&!c?"border border-slate-300 text-slate-600 hover:border-red-300 hover:bg-red-50 hover:text-red-600":"cursor-not-allowed border border-slate-200 bg-slate-50 text-slate-300"}`,title:d?"レスポンシブモード中:カラム数は自動調整されます":`カラムを削除 (最小: ${o}列)`,children:a.jsx(so,{className:"h-3 w-3"})}),a.jsxs("div",{className:`min-w-[2rem] rounded border px-3 py-1 text-center font-mono text-sm ${d?"border-blue-300 bg-blue-50 text-blue-700":"border-slate-300 bg-slate-100 text-slate-700"}`,children:[d?p??t:t,d&&a.jsx("span",{className:"ml-1 text-xs",children:"自動"})]}),a.jsx("button",{type:"button",onClick:()=>w&&n(t+1),disabled:!w||c,className:`rounded p-1 text-xs transition-colors ${w&&!c?"border border-slate-300 text-slate-600 hover:border-blue-300 hover:bg-blue-50 hover:text-blue-600":"cursor-not-allowed border border-slate-200 bg-slate-50 text-slate-300"}`,title:d?"レスポンシブモード中:カラム数は自動調整されます":`カラムを追加 (最大: ${l}列)`,children:a.jsx($e,{className:"h-3 w-3"})})]}),a.jsx("div",{className:"h-6 w-px bg-slate-300"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{type:"button",onClick:e,disabled:c,className:`flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors ${c?"cursor-not-allowed border border-slate-200 bg-slate-50 text-slate-300":"border border-slate-300 text-slate-600 hover:border-green-300 hover:bg-green-50 hover:text-green-600"}`,title:"パネルを全カラムに均等分散",children:[a.jsx(oo,{className:"h-3 w-3"}),a.jsx("span",{children:"バランス"})]}),a.jsxs("button",{type:"button",onClick:s,disabled:c,className:`flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors ${c?"cursor-not-allowed border border-slate-200 bg-slate-50 text-slate-300":"border border-slate-300 text-slate-600 hover:border-orange-300 hover:bg-orange-50 hover:text-orange-600"}`,title:"カラム幅を初期値にリセット",children:[a.jsx(ro,{className:"h-3 w-3"}),a.jsx("span",{children:"幅リセット"})]})]}),c&&a.jsxs("div",{className:"flex items-center gap-1 text-blue-600 text-xs",children:[a.jsx("div",{className:"h-2 w-2 animate-pulse rounded-full bg-blue-500"}),a.jsx("span",{children:"リサイズ中..."})]})]})},lo=({columnCount:t,onInsertColumn:n,onDeleteColumn:e,minColumns:s=1,maxColumns:o=6,isResizing:l=!1,disabled:c=!1})=>{const d=t<o&&!c,p=t>s&&!c;return a.jsxs("div",{className:`flex items-center justify-center gap-1 rounded-lg border border-slate-200 px-4 py-2 shadow-sm backdrop-blur-lg ${c?"bg-slate-100/80 opacity-60":"bg-white/80"}`,children:[c&&a.jsx("div",{className:"flex items-center gap-2 text-slate-500 text-xs",children:a.jsx("span",{children:"レスポンシブモード有効中:カラム数は自動調整されます"})}),!c&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",onClick:()=>d&&n(0),disabled:!d||l,className:`flex h-8 w-8 items-center justify-center rounded border-2 border-dashed text-xs transition-colors ${d&&!l?"border-blue-300 text-blue-600 hover:border-blue-500 hover:bg-blue-50":"cursor-not-allowed border-slate-200 text-slate-300"}`,title:"この位置に新しいカラムを挿入",children:a.jsx($e,{className:"h-4 w-4"})}),Array.from({length:t},(y,w)=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsxs("div",{className:"relative flex h-8 w-12 items-center justify-center rounded border border-slate-300 bg-slate-100",children:[a.jsx("span",{className:"font-medium font-mono text-slate-700 text-xs",children:w+1}),p&&!l&&a.jsx("button",{type:"button",onClick:()=>e(w),className:"absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full border border-red-300 bg-red-100 text-red-600 hover:bg-red-200",title:`カラム ${w+1} を削除`,children:a.jsx(mt,{className:"h-2.5 w-2.5"})})]}),a.jsx("button",{type:"button",onClick:()=>d&&n(w+1),disabled:!d||l,className:`flex h-8 w-8 items-center justify-center rounded border-2 border-dashed text-xs transition-colors ${d&&!l?"border-blue-300 text-blue-600 hover:border-blue-500 hover:bg-blue-50":"cursor-not-allowed border-slate-200 text-slate-300"}`,title:"この位置に新しいカラムを挿入",children:a.jsx($e,{className:"h-4 w-4"})})]},`column-${w}`))]})]})},co=({config:t,onConfigChange:n,isVisible:e,onToggleVisibility:s})=>e?a.jsxs("div",{className:"fixed right-4 bottom-4 z-50 max-w-sm rounded-lg border border-gray-300 bg-white p-4 shadow-xl",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsx("h3",{className:"font-bold text-gray-800 text-sm",children:"🛠️ デバッグ設定"}),a.jsx("button",{type:"button",onClick:s,className:"text-gray-500 text-lg hover:text-gray-700",title:"閉じる",children:"✕"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[a.jsx("input",{type:"checkbox",checked:t.showDebugPanel??!1,onChange:o=>n({...t,showDebugPanel:o.target.checked}),className:"rounded"}),a.jsx("span",{children:"デバッグパネル表示"})]}),a.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[a.jsx("input",{type:"checkbox",checked:t.showMousePosition??!1,onChange:o=>n({...t,showMousePosition:o.target.checked}),className:"rounded"}),a.jsx("span",{children:"マウス位置表示"})]}),a.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[a.jsx("input",{type:"checkbox",checked:t.showPanelSizes??!1,onChange:o=>n({...t,showPanelSizes:o.target.checked}),className:"rounded"}),a.jsx("span",{children:"パネルサイズ情報"})]}),a.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[a.jsx("input",{type:"checkbox",checked:t.showPlaceholderInfo??!1,onChange:o=>n({...t,showPlaceholderInfo:o.target.checked}),className:"rounded"}),a.jsx("span",{children:"プレースホルダー詳細"})]}),a.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[a.jsx("input",{type:"checkbox",checked:t.showDropZoneOutlines??!1,onChange:o=>n({...t,showDropZoneOutlines:o.target.checked}),className:"rounded"}),a.jsx("span",{children:"ドロップゾーン境界"})]}),a.jsxs("div",{className:"border-gray-200 border-t pt-2",children:[a.jsxs("label",{htmlFor:"log-level-slider",className:"mb-1 block text-sm",children:["ログレベル: ",t.logLevel??0]}),a.jsx("input",{id:"log-level-slider",type:"range",min:"0",max:"2",value:t.logLevel??0,onChange:o=>n({...t,logLevel:parseInt(o.target.value,10)}),className:"w-full","aria-label":"ログレベル設定"}),a.jsxs("div",{className:"mt-1 flex justify-between text-gray-500 text-xs",children:[a.jsx("span",{children:"無効"}),a.jsx("span",{children:"基本"}),a.jsx("span",{children:"詳細"})]})]}),a.jsxs("div",{className:"space-y-2 pt-2",children:[a.jsx("button",{type:"button",onClick:()=>n({showDebugPanel:!0,showMousePosition:!0,showPanelSizes:!0,showPlaceholderInfo:!0,showDropZoneOutlines:!0,logLevel:2}),className:"w-full rounded bg-blue-100 px-2 py-1 text-blue-700 text-sm transition-colors hover:bg-blue-200",children:"すべて有効"}),a.jsx("button",{type:"button",onClick:()=>n({showDebugPanel:!1,showMousePosition:!1,showPanelSizes:!1,showPlaceholderInfo:!1,showDropZoneOutlines:!1,logLevel:0}),className:"w-full rounded bg-gray-100 px-2 py-1 text-gray-700 text-sm transition-colors hover:bg-gray-200",children:"すべて無効"})]})]})]}):a.jsx("button",{type:"button",onClick:s,className:"fixed right-4 bottom-4 z-50 rounded-lg bg-gray-800 p-2 text-white shadow-lg transition-colors hover:bg-gray-700",title:"デバッグ設定を開く",children:"🛠️"}),ue={prefix:"column",startIndex:1,separator:"_"},De=(t,n=ue)=>{const{prefix:e,startIndex:s,separator:o}=n,l=t+s;return`${e}${o}${l}`},et=(t,n=ue)=>Array.from({length:t},(e,s)=>De(s,n)),Ne=(t,n=ue)=>{const{prefix:e,startIndex:s,separator:o}=n,l=`${e}${o}`;if(!t.startsWith(l))return null;const c=t.slice(l.length),d=parseInt(c,10);return Number.isNaN(d)||d<s?null:d-s},io=(t,n=ue)=>Ne(t,n)!==null,uo=(t,n=ue)=>{const e=t.map(s=>Ne(s,n)).filter(s=>s!==null).sort((s,o)=>s-o);for(let s=0;s<e.length;s++)if(e[s]!==s)return De(s,n);return De(e.length,n)},Rt=(t,n=ue)=>t.sort((e,s)=>{const o=Ne(e,n)??-1,l=Ne(s,n)??-1;return o-l}),fo=(t,n=ue)=>{const e={};return t.forEach((s,o)=>{const l=De(o,n);e[s]=l}),e},Tt=(t,n,e=ue)=>{const s=[];Object.values(t).forEach(c=>{s.push(...c)});const o={},l=et(n,e);return l.forEach(c=>{o[c]=[]}),s.forEach((c,d)=>{const p=d%n,y=l[p];o[y].push(c)}),o},mo=({initialColumns:t,initialPanels:n,debug:e={},onLayoutChange:s})=>{const[o,l]=r.useState(()=>{const x={};for(const v of t)x[v.id]=v.initialWidth||400;return{columns:t,columnWidths:x,isResizing:!1,resizingColumn:null,columnPanels:n,showInsertPlaceholders:!1}}),c=r.useRef(0),d=r.useRef(0);r.useEffect(()=>{s?.(o)},[o,s]);const p=r.useCallback((x,v)=>{k(e,1,"カラム追加:",x.id,"at position:",v),l(L=>{const E=[...L.columns],h=v??E.length;E.splice(h,0,x);const g={...L.columnWidths,[x.id]:x.initialWidth||400},j={...L.columnPanels,[x.id]:[]};return{...L,columns:E,columnWidths:g,columnPanels:j}})},[e]),y=r.useCallback(x=>{k(e,1,"カラム削除:",x),l(v=>{const L=v.columnPanels[x]||[],E=v.columns.filter(z=>z.id!==x);if(E.length===0)return k(e,1,"警告: 最後のカラムを削除しようとしています"),v;const h=E[0].id,g={...v.columnPanels};L.length>0&&(g[h]=[...g[h],...L]),delete g[x];const j={...v.columnWidths};return delete j[x],{...v,columns:E,columnWidths:j,columnPanels:g}})},[e]),w=r.useCallback((x,v)=>{k(e,1,"カラム移動:",x,"->",v),l(L=>{const E=[...L.columns],[h]=E.splice(x,1);return E.splice(v,0,h),{...L,columns:E}})},[e]),_=r.useCallback((x,v)=>{k(e,2,"リサイズ開始:",x,"at X:",v),c.current=v,d.current=o.columnWidths[x]||300,l(L=>({...L,isResizing:!0,resizingColumn:x}))},[e,o.columnWidths]),W=r.useCallback(x=>{const{resizingColumn:v,isResizing:L}=o;if(!(L&&v))return;const E=x-c.current,h=Math.max(100,Math.min(800,d.current+E));k(e,2,"リサイズ中:",v,"new width:",h),l(g=>({...g,columnWidths:{...g.columnWidths,[v]:h}}))},[e,o]),P=r.useCallback(()=>{k(e,2,"リサイズ終了"),l(x=>({...x,isResizing:!1,resizingColumn:null}))},[e]),u=r.useCallback((x,v)=>{k(e,2,"カラム幅設定:",x,v),l(L=>({...L,columnWidths:{...L.columnWidths,[x]:Math.max(100,Math.min(800,v))}}))},[e]),C=r.useCallback(()=>{k(e,1,"カラム幅リセット"),l(x=>{const v={};for(const L of x.columns)v[L.id]=L.initialWidth||400;return{...x,columnWidths:v}})},[e]),D=r.useCallback((x,v,L,E)=>{k(e,1,"パネル移動:",x,"from",v,"to",L,"at",E),l(h=>{const g={...h.columnPanels};if(v in g&&(g[v]=g[v].filter(j=>j!==x)),L in g){const j=[...g[L]];j.splice(E,0,x),g[L]=j}return{...h,columnPanels:g}})},[e]),M=r.useCallback((x,v,L)=>{k(e,1,"パネル追加:",x,"to column:",v),l(E=>{const h={...E.columnPanels};v in h||(h[v]=[]);const g=[...h[v]],j=L??g.length;return g.splice(j,0,x),h[v]=g,{...E,columnPanels:h}})},[e]),N=r.useCallback(x=>{k(e,1,"パネル削除:",x),l(v=>{const L={};for(const[E,h]of Object.entries(v.columnPanels))L[E]=h.filter(g=>g!==x);return{...v,columnPanels:L}})},[e]),I=r.useCallback(x=>{k(e,1,"カラム数更新:",x),l(v=>{const L=v.columns.length;if(x===L)return v;const E=Tt(v.columnPanels,x,ue),h=et(x,ue),g=v.isResizing&&v.resizingColumn&&!h.includes(v.resizingColumn);g&&k(e,1,"リサイズ中のカラムが削除されるためリサイズを強制終了:",v.resizingColumn);const j=h.map((Z,oe)=>({id:Z,title:`カラム ${oe+1}`,minWidth:350,maxWidth:800,initialWidth:400,resizable:!(oe===1&&x===3)})),z={};if(Object.entries(v.columnWidths).some(([,Z])=>Z!==400))h.forEach(Z=>{const oe=v.columnWidths[Z];oe&&oe!==400?z[Z]=oe:z[Z]=400});else{const Z=L>x?Object.values(v.columnWidths).reduce((m,b)=>m+b,0):x*400,oe=Math.max(Z/x,350);h.forEach(m=>{z[m]=oe})}return{...v,columns:j,columnPanels:E,columnWidths:z,isResizing:g?!1:v.isResizing,resizingColumn:g?null:v.resizingColumn}})},[e]),f=r.useCallback(()=>{k(e,1,"カラム自動バランス調整"),l(x=>{const v=[];for(const h of Object.keys(x.columnPanels))for(const g of x.columnPanels[h])v.push(g);const L={};for(const h of x.columns)L[h.id]=[];let E=0;for(const h of v){const g=x.columns[E%x.columns.length].id;L[g].push(h),E+=1}return{...x,columnPanels:L}})},[e]),R=r.useCallback(x=>o.columns.find(v=>v.id===x),[o.columns]),T=r.useCallback(()=>{let x=0;for(const v of Object.values(o.columnWidths))x+=v;return x},[o.columnWidths]),U=r.useCallback(x=>document.querySelector(`[data-column-id="${x}"]`),[]),J=r.useCallback(x=>{l(v=>({...v,showInsertPlaceholders:x}))},[]);return{layoutState:o,addColumn:p,removeColumn:y,moveColumn:w,startResize:_,handleResize:W,endResize:P,setColumnWidth:u,resetColumnWidths:C,movePanel:D,addPanel:M,removePanel:N,updateColumnCount:I,autoBalanceColumns:f,getColumnById:R,getTotalWidth:T,getColumnElement:U,setShowInsertPlaceholders:J}},Lt=({debugConfig:t,dragState:n,customDrag:e,clickState:s,dragModes:o,isMouseDown:l,dragOverPosition:c,setCustomDrag:d,setDragState:p,setDragOverPosition:y,setOriginalPanelPosition:w,setClickState:_,setIsMouseDown:W,findPanelPosition:P,performPanelMove:u,showMousePosition:C,updateMousePosition:D,recordMouseDown:M,recordClickPosition:N,isVirtualClick:I,calculateMoveDistance:f,clearMouseTracking:R,resetDragState:T,resetClickState:U,createDragImage:J,updateDragImagePosition:x,removeDragImage:v,handlePlaceholderDragEnter:L,handlePlaceholderDragLeave:E})=>{const h=r.useRef(t);h.current=t;const g=r.useRef(null),j=r.useRef(null),z=r.useRef(0),F=r.useRef(new Ae(Ee));r.useEffect(()=>{const b=document.querySelector(Ge);b&&F.current.setScrollElement(b)},[]);const ne=r.useRef(c);r.useEffect(()=>{ne.current=c,k(h.current,2,"dragOverPositionRef更新:",c)},[c]);const Z=r.useCallback(b=>{if(e.isActive||s.isClicked){b.preventDefault();const O=window.getSelection();O&&O.rangeCount>0&&O.removeAllRanges()}if(e.isActive){D(b.clientX,b.clientY),x(b.clientX,b.clientY),F.current.update(b.clientX,b.clientY);const O=document.elementFromPoint(b.clientX,b.clientY),B=O?.closest("[data-drop-zone]");if(B){document.body.classList.add("droppable");const K=B.getAttribute("data-column-index"),re=K?parseInt(K,10):null;re!==null&&re!==n.dragOverColumn&&p(Y=>({...Y,dragOverColumn:re}));const V=O?.closest("[data-placeholder-index]");if(V){const Y=V.getAttribute("data-placeholder-index"),ge=V.getAttribute("data-placeholder-column");if(Y&&ge){const ce=parseInt(Y,10),me=parseInt(ge,10);L(me,ce)}}else E()}else document.body.classList.remove("droppable"),y(null),p(K=>({...K,dragOverColumn:null}))}else if(l&&s.isClicked&&s.panelId){if(o[s.panelId]!=="custom"||f(b.clientX,b.clientY)<10)return;k(h.current,1,"🚀 カスタムドラッグ開始 -",s.panelId);const B=document.querySelector(`[data-panel-id="${s.panelId}"]`);if(B&&j.current){const K=B.getBoundingClientRect(),re=j.current.x-K.left,V=j.current.y-K.top;J(s.panelId,re,V),document.body.classList.add("custom-dragging"),d({isActive:!0,panelId:s.panelId,startX:re,startY:V})}p({isDragging:!0,draggedPanel:s.panelId,dragOverColumn:null}),w(P(s.panelId)),C(b.clientX,b.clientY),_({isClicked:!1,panelId:null}),W(!1),R(),j.current=null,g.current&&(clearTimeout(g.current),g.current=null)}},[e.isActive,s,n.dragOverColumn,o,l,D,p,y,f,P,d,w,C,_,W,R,J,x,L,E]),oe=r.useCallback(b=>{if(k(h.current,1,"🐭 カスタムドラッグハンドラー - グローバルマウスアップ",{isActive:e.isActive,panelId:e.panelId,dragMode:e.panelId?o[e.panelId]:"unknown"}),e.isActive){F.current.stop();const O=ne.current;if(O){const K=document.elementFromPoint(b.clientX,b.clientY)?.closest("[data-drop-zone]");if(K){const re=K.getAttribute("data-column-key");re&&o[e.panelId]==="custom"?(k(h.current,1,"🔄 カスタムドラッグパネル移動実行:",e.panelId,"→",re),u(e.panelId,re,O.insertIndex)):k(h.current,1,"🚫 カスタムドラッグパネル移動スキップ:",e.panelId,"モード:",o[e.panelId])}}v(),document.body.classList.remove("custom-dragging","droppable"),T(),z.current=0}else if(I(b.clientX,b.clientY)){const B=document.elementFromPoint(b.clientX,b.clientY)?.closest("[data-panel-id]"),K=B?.getAttribute("data-panel-id")??null;if(!(B&&K)||o[K]!=="custom"){g.current&&(clearTimeout(g.current),g.current=null),U(),j.current=null,z.current=0;return}z.current+=1,s.isClicked===!1&&z.current===1?(k(h.current,1,"🖱️ 仮想クリック検出 - ドラッグ待機状態へ:",K),_({isClicked:!0,panelId:K}),g.current=window.setTimeout(()=>{k(h.current,1,"⏳ クリック待機状態を自動解除:",K),U(),j.current=null,z.current=0},2e3)):(k(h.current,1,"🚫 クリック待機状態を解除 - 仮想クリック検出停止:",K),g.current&&(clearTimeout(g.current),g.current=null),U(),j.current=null,z.current=0,g.current=window.setTimeout(()=>{k(h.current,1,"⏳ 仮想クリック検出再開:",K)},2e3))}else s.isClicked&&(U(),j.current=null,z.current=0);l&&W(!1)},[e.isActive,e.panelId,s,o,l,u,T,U,I,_,W,v]),m=r.useCallback((b,O)=>{if(o[O]!=="custom"){k(h.current,1,"🚫 カスタムドラッグモードではない - スキップ:",O);return}M(b.clientX,b.clientY),s.isClicked&&s.panelId===O&&(W(!0),g.current!==null&&(clearTimeout(g.current),g.current=null),N(b.clientX,b.clientY),j.current={x:b.clientX,y:b.clientY})},[s,o,M,W,N]);return r.useEffect(()=>()=>{g.current!==null&&clearTimeout(g.current),F.current.stop()},[]),{handleGlobalMouseMove:Z,handleGlobalMouseUp:oe,handleMouseDown:m}},zt=()=>{const[t,n]=r.useState({isDragging:!1,draggedPanel:null,dragOverColumn:null}),[e,s]=r.useState(null),[o,l]=r.useState(null),[c,d]=r.useState({isActive:!1,panelId:"",startX:0,startY:0}),[p,y]=r.useState({isClicked:!1,panelId:null}),[w,_]=r.useState(!1),W=r.useCallback(()=>{d({isActive:!1,panelId:"",startX:0,startY:0}),n({isDragging:!1,draggedPanel:null,dragOverColumn:null}),s(null),l(null)},[]),P=r.useCallback(()=>{y({isClicked:!1,panelId:null}),_(!1)},[]),u=r.useCallback(f=>{n(f)},[]),C=r.useCallback(f=>{s(f)},[]),D=r.useCallback(f=>{l(f)},[]),M=r.useCallback(f=>{d(f)},[]),N=r.useCallback(f=>{y(f)},[]),I=r.useCallback(f=>{_(f)},[]);return{dragState:t,dragOverPosition:e,originalPanelPosition:o,customDrag:c,clickState:p,isMouseDown:w,setDragState:u,setDragOverPosition:C,setOriginalPanelPosition:D,setCustomDrag:M,setClickState:N,setIsMouseDown:I,resetDragState:W,resetClickState:P}},It=()=>{const[t,n]=r.useState({x:0,y:0,isVisible:!1}),e=r.useRef(null),s=r.useRef(0),o=r.useRef(null),l=r.useCallback((P,u)=>{n({x:P,y:u,isVisible:!0})},[]),c=r.useCallback(()=>{n(P=>({...P,isVisible:!1}))},[]),d=r.useCallback((P,u)=>{n(C=>C.x===P&&C.y===u?C:{x:P,y:u,isVisible:C.isVisible})},[]),p=r.useCallback((P,u)=>{s.current=Date.now(),o.current={x:P,y:u}},[]),y=r.useCallback((P,u)=>{e.current={x:P,y:u}},[]),w=r.useCallback((P,u,C=500,D=5)=>Date.now()-(s.current||0)>=C||!o.current?!1:Math.sqrt((P-o.current.x)**2+(u-o.current.y)**2)<D,[]),_=r.useCallback((P,u)=>{if(!e.current)return 0;const C=Math.abs(P-e.current.x),D=Math.abs(u-e.current.y);return Math.sqrt(C*C+D*D)},[]),W=r.useCallback(()=>{e.current=null,s.current=0,o.current=null},[]);return{mousePosition:t,lastClickPosition:e.current,mouseDownTime:s.current,mouseDownPosition:o.current,showMousePosition:l,hideMousePosition:c,updateMousePosition:d,recordMouseDown:p,recordClickPosition:y,isVirtualClick:w,calculateMoveDistance:_,clearMouseTracking:W}},Wt=({debugConfig:t,dragState:n,customDrag:e,dragModes:s,columnPanels:o,dragOverPosition:l,originalPanelPosition:c,setDragState:d,setDragOverPosition:p,setOriginalPanelPosition:y,performPanelMove:w,showMousePosition:_,updateMousePosition:W,resetDragState:P,handlePlaceholderDragEnter:u,handlePlaceholderDragLeave:C,scale:D=1})=>{const M=r.useRef(t);M.current=t;const N=r.useRef(o);N.current=o;const I=r.useRef(n);I.current=n;const f=r.useRef(l);f.current=l;const R=r.useRef(c);R.current=c;const T=r.useRef(D);T.current=D;const U=r.useRef(new Ae(Ee));r.useEffect(()=>{const h=document.querySelector(Ge);h&&U.current.setScrollElement(h)},[]);const J=r.useCallback((h,g)=>{if(e.isActive){k(M.current,2,"カスタムドラッグアクティブ中 - 通常ドラッグを無効化:",g),h.preventDefault();return}if(s[g]==="custom"){k(M.current,2,"カスタムドラッグモード - 通常ドラッグを無効化:",g),h.preventDefault();return}k(M.current,1,"ドラッグ開始:",g);const j=Object.keys(N.current);let z=null;for(let F=0;F<j.length;F++){const ne=j[F],Z=N.current[ne].indexOf(g);if(Z!==-1){z={columnIndex:F,panelIndex:Z};break}}if(y(z),h.dataTransfer){h.dataTransfer.setData("text/plain",g),h.dataTransfer.effectAllowed="move";const F=T.current;if(F<1){const ne=h.currentTarget.closest("[data-panel-id]")??h.currentTarget,Z=ne.getBoundingClientRect(),oe=ne.offsetWidth,m=ne.offsetHeight,b=ne.cloneNode(!0);b.removeAttribute("data-panel-id"),b.removeAttribute("id"),vt(ne,b),b.style.margin="0",b.style.width=`${oe}px`,b.style.height=`${m}px`,b.style.transform=`scale(${F})`,b.style.transformOrigin="top left";const O=document.createElement("div");O.style.position="fixed",O.style.top="0",O.style.left="-10000px",O.style.width=`${oe*F}px`,O.style.height=`${m*F}px`,O.style.overflow="hidden",O.style.opacity="0.8",O.style.pointerEvents="none",O.appendChild(b),document.body.appendChild(O),h.dataTransfer.setDragImage(O,h.clientX-Z.left,h.clientY-Z.top),requestAnimationFrame(()=>O.remove())}}_(h.clientX,h.clientY),requestAnimationFrame(()=>{d({isDragging:!0,draggedPanel:g,dragOverColumn:null})})},[s,e.isActive,y,_,d]),x=r.useCallback(()=>{k(M.current,1,"ドラッグ終了"),U.current.stop(),P()},[P]),v=r.useCallback((h,g)=>{if(h.preventDefault(),h.dataTransfer.dropEffect="move",!I.current.isDragging)return;W(h.clientX,h.clientY),g!==I.current.dragOverColumn&&d(F=>({...F,dragOverColumn:g}));const j=document.elementFromPoint(h.clientX,h.clientY),z=j?.closest("[data-placeholder-index]");if(z){const F=z.getAttribute("data-placeholder-index"),ne=z.getAttribute("data-placeholder-column");if(F&&ne){const Z=parseInt(F,10),oe=parseInt(ne,10);u(oe,Z)}}else j?.closest("[data-drop-zone]")||C()},[W,d,u,C]),L=r.useCallback((h,g)=>{h.preventDefault();const j=h.dataTransfer.getData("text/plain"),z=f.current;j&&z&&(k(M.current,1,"🎯 ドロップ完了:",{draggedPanel:j,targetColumn:g,insertPosition:`カラム${z.columnIndex} - 位置${z.insertIndex}`}),w(j,g,z.insertIndex),p(null),x())},[w,p,x]),E=r.useCallback(h=>{const g=h.currentTarget,j=h.relatedTarget;j&&g.contains(j)||(p(null),d(z=>({...z,dragOverColumn:null})))},[p,d]);return r.useEffect(()=>{const h=g=>{I.current.isDragging&&(W(g.clientX,g.clientY),U.current.update(g.clientX,g.clientY))};if(n.isDragging)return document.addEventListener("dragover",h),()=>{document.removeEventListener("dragover",h),U.current.stop()}},[n.isDragging,W]),r.useEffect(()=>()=>{U.current.stop()},[]),{handleDragStart:J,handleDragEnd:x,handleDragOverWithInsert:v,handleDropWithInsert:L,handleColumnDragLeave:E}},Ht=(t,n=1)=>{const[e,s]=r.useState(t),[o,l]=r.useState({}),c=r.useRef({}),d=r.useRef(null),p=r.useRef({x:0,y:0}),y=r.useRef(n);y.current=n;const w=r.useCallback(N=>document.querySelector(`[data-panel-id="${N}"]`),[]),_=r.useCallback((N,I)=>{const f=I.getBoundingClientRect(),R=window.getComputedStyle(I),T={width:Math.round(f.width),height:Math.round(f.height),x:Math.round(f.left),y:Math.round(f.top),minHeight:R.minHeight||"auto",maxHeight:R.maxHeight||"none"},U=c.current[N];(!U||Object.keys(T).some(J=>U[J]!==T[J]))&&(c.current[N]=T,l(J=>({...J,[N]:T})))},[]),W=r.useCallback(N=>{const I=w(N);I&&_(N,I)},[w,_]),P=r.useCallback((N,I)=>{I&&requestAnimationFrame(()=>_(N,I))},[_]),u=r.useCallback((N,I,f)=>{const R=w(N);!R||d.current||(d.current=yt(R,N,y.current),p.current={x:I,y:f})},[w]),C=r.useCallback((N,I)=>{d.current&&wt(d.current,N,I,p.current,y.current)},[]),D=r.useCallback(()=>{d.current&&(d.current.remove(),d.current=null)},[]),M=r.useCallback(N=>{s(I=>({...I,[N]:!I[N]}))},[]);return{panelVisibility:e,panelSizes:o,setPanelVisibility:s,setPanelSizes:l,setPanelRef:P,updatePanelSize:W,togglePanelVisibility:M,getPanelElement:w,createDragImage:u,updateDragImagePosition:C,removeDragImage:D}},ho=({initialColumnPanels:t,initialPanelVisibility:n,initialDragModes:e={},debugConfig:s,onPanelMove:o,onDragModeChange:l,onColumnPanelsChange:c,scale:d=1})=>{const p=r.useRef(s);p.current=s;const[y,w]=r.useState(t),[_,W]=r.useState(e),P=r.useRef(y);P.current=y;const u=zt(),C=It(),D=Ht(n,d),M=r.useRef({mousemove:null,mouseup:null}),N=r.useCallback(E=>{const h=Object.keys(P.current),g=Rt(h,ue);for(let j=0;j<g.length;j++){const z=g[j],F=P.current[z]?.indexOf(E)??-1;if(F!==-1)return{columnIndex:j,panelIndex:F}}return null},[]),I=r.useCallback((E,h,g)=>{k(p.current,1,"🔄 パネル移動実行:",E,"→",h,"@",g),w(j=>{if(!Object.values(j).some(F=>F.includes(E)))return console.error("Source column not found for panel:",E),j;if(!j[h])return console.error("Target column not found:",h),j;const z=Fe(j,E,h,g);if(z===null)return j;if(k(p.current,1,"✅ パネル移動完了:",E,"→",h),c&&requestAnimationFrame(()=>{c(z)}),o){const F=Object.keys(j).find(ne=>j[ne].includes(E));F&&requestAnimationFrame(()=>{o(E,F,h,g)})}return z})},[c,o]),f=r.useCallback((E,h)=>{if(!(u.dragState.isDragging||u.customDrag.isActive))return;const g=u.originalPanelPosition;if(g!==null&&He(g,E,h)){k(p.current,1,`元の位置への挿入をスキップ: カラム${E}, 位置${h}`);return}const j=u.dragOverPosition;(!j||j.columnIndex!==E||j.insertIndex!==h)&&(k(p.current,1,`プレースホルダーエンター: カラム${E}, 位置${h}`),u.setDragOverPosition({columnIndex:E,insertIndex:h}),u.setDragState(z=>({...z,dragOverColumn:E})))},[u]),R=r.useCallback((E,h,g)=>{if(u.dragState.isDragging||u.customDrag.isActive){if(u.customDrag.isActive)k(p.current,1,"🚫 カスタムドラッグ - プレースホルダーリーブ: ハイライトを解除します。"),u.setDragOverPosition(null);else if(u.dragState.isDragging&&E&&h!==void 0&&g!==void 0){const j=u.dragOverPosition;if(j&&j.columnIndex===h&&j.insertIndex===g){const z=E.currentTarget,F=E.relatedTarget;F&&z.contains(F)||(k(p.current,1,`ノーマルドラッグ - プレースホルダーリーブ: カラム${h}, 位置${g}。ハイライトを解除します。`),u.setDragOverPosition(null))}}}},[u]),T=Lt({debugConfig:p.current,dragState:u.dragState,customDrag:u.customDrag,clickState:u.clickState,dragModes:_,isMouseDown:u.isMouseDown,originalPanelPosition:u.originalPanelPosition,dragOverPosition:u.dragOverPosition,setCustomDrag:u.setCustomDrag,setDragState:u.setDragState,setDragOverPosition:u.setDragOverPosition,setOriginalPanelPosition:u.setOriginalPanelPosition,setClickState:u.setClickState,setIsMouseDown:u.setIsMouseDown,findPanelPosition:N,performPanelMove:I,showMousePosition:C.showMousePosition,updateMousePosition:C.updateMousePosition,recordMouseDown:C.recordMouseDown,recordClickPosition:C.recordClickPosition,isVirtualClick:C.isVirtualClick,calculateMoveDistance:C.calculateMoveDistance,clearMouseTracking:C.clearMouseTracking,resetDragState:u.resetDragState,resetClickState:u.resetClickState,createDragImage:D.createDragImage,updateDragImagePosition:D.updateDragImagePosition,removeDragImage:D.removeDragImage,handlePlaceholderDragEnter:f,handlePlaceholderDragLeave:R}),U=Wt({debugConfig:p.current,dragState:u.dragState,customDrag:u.customDrag,dragModes:_,columnPanels:y,dragOverPosition:u.dragOverPosition,originalPanelPosition:u.originalPanelPosition,setDragState:u.setDragState,setDragOverPosition:u.setDragOverPosition,setOriginalPanelPosition:u.setOriginalPanelPosition,performPanelMove:I,showMousePosition:C.showMousePosition,updateMousePosition:C.updateMousePosition,resetDragState:u.resetDragState,handlePlaceholderDragEnter:f,handlePlaceholderDragLeave:R,scale:d}),J=r.useCallback(E=>{M.current.mousemove&&M.current.mousemove(E)},[]),x=r.useCallback(E=>{M.current.mouseup&&M.current.mouseup(E)},[]);r.useEffect(()=>(k(p.current,1,"🔧 グローバルイベントリスナー初期化 - refベース管理開始"),document.addEventListener("mousemove",J),document.addEventListener("mouseup",x),()=>{k(p.current,1,"🔴 グローバルイベントリスナー終了 - refベース管理終了"),document.removeEventListener("mousemove",J),document.removeEventListener("mouseup",x)}),[J,x]),r.useEffect(()=>{const E=!u.clickState.isClicked&&Object.entries(_).some(([,g])=>g==="custom"),h=u.clickState.isClicked&&u.clickState.panelId;if(E||h){const g=E?"パターン1(仮想クリック検出)":"パターン2,3(ドラッグ準備)";k(p.current,1,`🔧 イベントハンドラー設定開始: ${g}`),M.current.mousemove=T.handleGlobalMouseMove,M.current.mouseup=T.handleGlobalMouseUp}else u.customDrag.isActive||u.dragState.isDragging||(M.current.mousemove=null,M.current.mouseup=null)},[u.clickState.isClicked,u.clickState.panelId,_,u.customDrag.isActive,u.dragState.isDragging,T.handleGlobalMouseMove,T.handleGlobalMouseUp]);const v=r.useCallback(E=>{k(p.current,1,"🔄 toggleDragMode called:",{panelId:E}),W(h=>{const j=(h[E]||"normal")==="normal"?"custom":"normal",z={...h,[E]:j};if(l)try{l(E,j)}catch(F){console.error("🔄 Error in onDragModeChange:",F)}return z})},[l]),L=r.useCallback((E,h)=>{E.stopPropagation(),k(p.current,2,"パネルサイズ情報クリック:",h)},[]);return{columnPanels:y,panelVisibility:D.panelVisibility,dragModes:_,dragState:u.dragState,dragOverPosition:u.dragOverPosition,originalPanelPosition:u.originalPanelPosition,customDrag:u.customDrag,clickState:u.clickState,mousePosition:C.mousePosition,panelSizes:D.panelSizes,setColumnPanels:w,setPanelVisibility:D.setPanelVisibility,setDragModes:W,setPanelRef:D.setPanelRef,handleDragStart:U.handleDragStart,handleDragEnd:U.handleDragEnd,handleMouseDown:T.handleMouseDown,handlePlaceholderDragEnter:f,handlePlaceholderDragLeave:R,handleDragOverWithInsert:U.handleDragOverWithInsert,handleDropWithInsert:U.handleDropWithInsert,handleColumnDragLeave:U.handleColumnDragLeave,handlePanelSizeInfoClick:L,toggleDragMode:v,findPanelPosition:N}},po=({minColumnWidth:t=350,defaultColumns:n=3,maxColumns:e=6,minColumns:s=1,currentColumnWidths:o={}}={})=>{const[l,c]=r.useState(0),d=r.useRef(0),p=r.useRef(null),[y,w]=r.useState(!1),_=r.useRef(n);r.useEffect(()=>{if(typeof window>"u")return;const u=()=>{const D=window.visualViewport?.width??0,M=document?.documentElement?.clientWidth??0,N=document?.body?.clientWidth??0,I=window.innerWidth??0;return M>0?Math.floor(M):D>0?Math.floor(D):N>0?Math.floor(N):Math.floor(I)},C=()=>{p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{const D=u();p.current=null,D!==0&&(Math.abs(d.current-D)<2||(d.current=D,c(D)))})};return C(),window.addEventListener("resize",C),window.addEventListener("orientationchange",C),window.visualViewport?.addEventListener("resize",C),()=>{p.current!==null&&cancelAnimationFrame(p.current),window.removeEventListener("resize",C),window.removeEventListener("orientationchange",C),window.visualViewport?.removeEventListener("resize",C)}},[]);const W=r.useMemo(()=>{if(!y||l===0)return _.current=n,n;const u=Math.max(l-64,0),C=24,D=Object.values(o);let M;if(D.length>0){const N=D.reduce((R,T)=>R+T,0)/D.length,I=Math.max(t,N);M=Math.floor((u+C)/(I+C)),D.reduce((R,T)=>R+T,0)+(D.length-1)*C>u&&D.length>s&&(M=Math.min(M,D.length-1))}else M=Math.floor((u+C)/(t+C));return M=Math.max(s,Math.min(e,M)),_.current===M?_.current:(_.current=M,M)},[y,l,n,t,e,s,o]),P=r.useCallback(()=>{w(u=>!u)},[]);return{responsiveColumnCount:W,isResponsiveMode:y,screenWidth:l,toggleResponsiveMode:P}};const go=se("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);const xo=se("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),bo=({isResponsiveMode:t,responsiveColumnCount:n,currentColumnCount:e,screenWidth:s,onToggleResponsive:o})=>a.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-slate-300 bg-white/90 px-3 py-1",children:[a.jsxs("button",{type:"button",onClick:o,className:`flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors ${t?"border border-blue-300 bg-blue-100 text-blue-700":"border border-slate-300 text-slate-600 hover:bg-blue-50 hover:text-blue-600"}`,title:t?"レスポンシブモードを無効化":"レスポンシブモードを有効化",children:[t?a.jsx(xo,{className:"h-3 w-3"}):a.jsx(go,{className:"h-3 w-3"}),a.jsx("span",{children:t?"レスポンシブ":"固定"})]}),t&&a.jsxs("div",{className:"flex items-center gap-1 text-slate-600 text-xs",children:[a.jsxs("span",{className:"font-mono",children:[s,"px"]}),a.jsx("span",{children:"→"}),a.jsxs("span",{className:"font-semibold text-blue-600",children:[n,"列"]}),n!==e&&a.jsx("span",{className:"text-orange-600",children:"(変更予定)"})]})]}),vo={showDebugPanel:!1,showMousePosition:!1,showPanelSizes:!1,showPlaceholderInfo:!1,showDropZoneOutlines:!1,logLevel:0};A.ColumnControlPanel=ao,A.ColumnInsertPanel=lo,A.DEFAULT_COLUMN_ID_CONFIG=ue,A.DEFAULT_DEBUG_CONFIG=vo,A.DEFAULT_DRAG_DROP_LAYOUT_LABELS=Yn,A.DEFAULT_EDGE_SCROLL_CONFIG=Ee,A.DEFAULT_TOUCH_DRAG_CONFIG=At,A.DebugControlPanel=co,A.DragDropLayout=no,A.DropZoneDebugOverlay=Xe,A.EdgeScrollManager=Ae,A.InsertPlaceholder=Be,A.PANEL_ACTION_ATTRIBUTE=we,A.PANEL_MOVES=ve,A.PANEL_MOVE_SHORTCUTS=Ue,A.PanelSizeDisplay=ht,A.ResizableColumn=Zn,A.ResizeHandle=Ke,A.ResponsiveControl=bo,A.SCROLL_ROOT_SELECTOR=Ge,A.TEMPLATE_PLACEHOLDERS=St,A.availablePanelMoves=gt,A.calculateScrollVector=Ze,A.createColumnIdMapping=fo,A.debugLog=k,A.generateColumnId=De,A.generateColumnIds=et,A.getNextColumnId=uo,A.insertPanelAt=Fe,A.isValidColumnId=io,A.movePanelInColumns=xt,A.normalizeColumnPanels=Tt,A.panelMoveOfKey=bt,A.parseColumnId=Ne,A.performScroll=Pt,A.shownPanelPlace=ye,A.sortColumnIds=Rt,A.useColumnLayout=mo,A.useCustomDragHandlers=Lt,A.useDragDropColumns=ho,A.useDragDropState=zt,A.useMouseTracking=It,A.useNormalDragHandlers=Wt,A.usePanelManagement=Ht,A.useResponsiveColumns=po,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})}));
6
+ <%s key={someKey} {...props} />`,G,J,Y,J),V[J+G]=!0)}if(J=null,O!==void 0&&(e(O),J=""+O),i(p)&&(e(p.key),J=""+p.key),"key"in p){O={};for(var ge in p)ge!=="key"&&(O[ge]=p[ge])}else O=p;return J&&f(O,typeof d=="function"?d.displayName||d.name||"Unknown":d),C(d,J,O,o(),Q,re)}function M(d){H(d)?d._store&&(d._store.validated=1):typeof d=="object"&&d!==null&&d.$$typeof===g&&(d._payload.status==="fulfilled"?H(d._payload.value)&&d._payload.value._store&&(d._payload.value._store.validated=1):d._store&&(d._store.validated=1))}function H(d){return typeof d=="object"&&d!==null&&d.$$typeof===j}var P=r,j=Symbol.for("react.transitional.element"),D=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),c=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),_=Symbol.for("react.client.reference"),F=P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,v=Object.prototype.hasOwnProperty,w=Array.isArray,x=console.createTask?console.createTask:function(){return null};P={react_stack_bottom_frame:function(d){return d()}};var k,L={},U=P.react_stack_bottom_frame.bind(P,l)(),B=x(s(l)),V={};je.Fragment=T,je.jsx=function(d,p,O){var G=1e4>F.recentlyCreatedOwnerStacks++;return y(d,p,O,!1,G?Error("react-stack-top-frame"):U,G?x(s(d)):B)},je.jsxs=function(d,p,O){var G=1e4>F.recentlyCreatedOwnerStacks++;return y(d,p,O,!0,G?Error("react-stack-top-frame"):U,G?x(s(d)):B)}})()),je}var it;function hn(){return it||(it=1,process.env.NODE_ENV==="production"?Re.exports=dn():Re.exports=fn()),Re.exports}var a=hn();const mn=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),pn=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,e,s)=>s?s.toUpperCase():e.toLowerCase()),ut=t=>{const n=pn(t);return n.charAt(0).toUpperCase()+n.slice(1)},dt=(...t)=>t.filter((n,e,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===e).join(" ").trim(),gn=t=>{for(const n in t)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};var xn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const bn=r.forwardRef(({color:t="currentColor",size:n=24,strokeWidth:e=2,absoluteStrokeWidth:s,className:o="",children:l,iconNode:i,...f},m)=>r.createElement("svg",{ref:m,...xn,width:n,height:n,stroke:t,strokeWidth:s?Number(e)*24/Number(n):e,className:dt("lucide",o),...!l&&!gn(f)&&{"aria-hidden":"true"},...f},[...i.map(([C,y])=>r.createElement(C,y)),...Array.isArray(l)?l:[l]]));const se=(t,n)=>{const e=r.forwardRef(({className:s,...o},l)=>r.createElement(bn,{ref:l,iconNode:n,className:dt(`lucide-${mn(ut(t))}`,`lucide-${t}`,s),...o}));return e.displayName=ut(t),e};const vn=se("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);const yn=se("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const wn=se("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const Cn=se("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);const Pn=se("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const ft=se("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const En=se("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]);const jn=se("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);const kn=se("mouse-pointer",[["path",{d:"M12.586 12.586 19 19",key:"ea5xo7"}],["path",{d:"M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z",key:"277e5u"}]]);const Dn=se("mouse-pointer-click",[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]);const ht=se("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),fe=class fe{constructor(n=2,e="[drag-drop-panels]",s=console){this.level=n,this.prefix=e,this.impl=s}static setLevel(n){fe.instance.setLevel(n)}setLevel(n){this.level=n}static setImplementation(n){fe.instance.setImplementation(n)}setImplementation(n){this.impl=n}static setPrefix(n){fe.instance.setPrefix(n)}setPrefix(n){this.prefix=n}formatMessage(n){return typeof n=="string"?[`${this.prefix} ${n}`]:[this.prefix,n]}static debug(n,...e){fe.instance.debug(n,...e)}debug(n,...e){this.level<=0&&this.impl.debug(...this.formatMessage(n),...e)}static info(n,...e){fe.instance.info(n,...e)}info(n,...e){this.level<=1&&this.impl.info(...this.formatMessage(n),...e)}static warn(n,...e){fe.instance.warn(n,...e)}warn(n,...e){this.level<=2&&this.impl.warn(...this.formatMessage(n),...e)}static error(n,...e){fe.instance.error(n,...e)}error(n,...e){this.level<=3&&this.impl.error(...this.formatMessage(n),...e)}};fe.instance=new fe(2,"[drag-drop-panels]");let We=fe;const mt=({config:t,panelId:n,sizeInfo:e,onSizeInfoClick:s})=>t.showPanelSizes&&e?a.jsxs("div",{className:"absolute top-1 right-24 z-10 cursor-default rounded-md bg-red-500/90 px-2 py-1 font-mono text-white text-xs leading-tight shadow-lg",onClick:s,onMouseDown:s,onTouchStart:o=>o instanceof TouchEvent&&s(o),onDragStart:s,children:[a.jsxs("div",{className:"text-[10px] opacity-80",children:["ID:",n]}),a.jsxs("div",{children:[e.width,"×",e.height]}),a.jsxs("div",{children:["X:",e.x," Y:",e.y]}),a.jsxs("div",{className:"text-[10px] opacity-80",children:["min:",e.minHeight," max:",e.maxHeight]})]}):null,R=(t,n,...e)=>{(t.logLevel??0)>=n&&We.info(...e)},He=(t,n,e)=>t.columnIndex===n&&(t.panelIndex===e||t.panelIndex+1===e),Fe=(t,n,e,s)=>{const o=Object.keys(t).find(f=>t[f].includes(n));if(o===void 0||t[e]===void 0)return null;const l={...t};if(o===e){const f=[...t[o]],m=f.indexOf(n);return f.splice(m,1),f.splice(m<s?s-1:s,0,n),l[e]=f,l}l[o]=t[o].filter(f=>f!==n);const i=[...t[e]];return i.splice(s,0,n),l[e]=i,l},ve=Object.freeze(["previous-column","next-column","up","down"]),Nn=(t,n)=>t.columnPanels[n]??[],Ye=t=>t.columnKeys.map(n=>Nn(t,n).filter(e=>t.panelVisibility[e]===!0)),ye=(t,n)=>{for(const[e,s]of Ye(t).entries()){const o=s.indexOf(n);if(o>=0)return{column:e,index:o}}return null},pt=(t,n,e)=>{switch(e){case"previous-column":case"next-column":{const s=n.column+(e==="previous-column"?-1:1),o=t[s];return o===void 0?null:{column:s,index:Math.min(n.index,o.length)}}case"up":return n.index>0?{column:n.column,index:n.index-1}:null;case"down":return n.index<t[n.column].length-1?{column:n.column,index:n.index+1}:null;default:{const s=e;throw new RangeError(`[@aiquants/drag-drop-panels] unknown panel move ${JSON.stringify(s)}; expected one of ${ve.join(", ")}`)}}},Sn=(t,n,e,s)=>{const o=t.filter(n),l=m=>[...t.slice(0,m),e,...t.slice(m)],i=o[s];if(i!==void 0)return l(t.indexOf(i));const f=o[s-1];return l(f!==void 0?t.indexOf(f)+1:t.length)},gt=(t,n)=>{const e=ye(t,n);if(e===null)return[];const s=Ye(t);return ve.filter(o=>pt(s,e,o)!==null)},xt=(t,n,e)=>{if(!ve.includes(e))throw new RangeError(`[@aiquants/drag-drop-panels] unknown panel move ${JSON.stringify(e)}; expected one of ${ve.join(", ")}`);const s=ye(t,n);if(s===null)return null;const o=pt(Ye(t),s,e);if(o===null)return null;const l=m=>t.panelVisibility[m]===!0,i=Object.fromEntries(Object.entries(t.columnPanels).map(([m,C])=>[m,C.filter(y=>y!==n)])),f=t.columnKeys[o.column];return i[f]=Sn(i[f]??[],l,n,o.index),{columnPanels:i,from:s,place:o}},On=(t,n,e)=>{const s=(o,l)=>(o[l]??[]).filter(i=>i!==e);for(const o of new Set([...Object.keys(t),...Object.keys(n)])){const l=s(t,o),i=s(n,o);if(l.length!==i.length||l.some((f,m)=>f!==i[m]))return!1}return!0},Ue=Object.freeze({"previous-column":Object.freeze({key:"ArrowLeft",aria:"Alt+Shift+ArrowLeft",text:"Alt+Shift+←"}),"next-column":Object.freeze({key:"ArrowRight",aria:"Alt+Shift+ArrowRight",text:"Alt+Shift+→"}),up:Object.freeze({key:"ArrowUp",aria:"Alt+Shift+ArrowUp",text:"Alt+Shift+↑"}),down:Object.freeze({key:"ArrowDown",aria:"Alt+Shift+ArrowDown",text:"Alt+Shift+↓"})}),bt=t=>{if(!(t.altKey&&t.shiftKey)||t.ctrlKey||t.metaKey)return null;const n=ve.find(e=>Ue[e].key===t.key);return n===void 0?null:n},Be=r.memo(({index:t,columnIndex:n,isDragging:e,dragOverPosition:s,originalPosition:o,onDragEnter:l,onDragLeave:i,config:f,customDrag:m,label:C})=>{const y=o!==null&&He(o,n,t),M=!y&&s?.columnIndex===n&&s?.insertIndex===t,H=r.useRef(null),[P,j]=r.useState(null),D=e||(m?.isActive??!1),T=y||!D?"hidden":M?"target":"shown";return r.useEffect(()=>{if(H.current){const h=H.current.getBoundingClientRect(),E={width:Math.round(h.width),height:Math.round(h.height),x:Math.round(h.left),y:Math.round(h.top)};j(E),M&&R(f,1,`🎯 アクティブプレースホルダー ${t}-${n}:`,{size:`${E.width}×${E.height}`,position:`(${E.x}, ${E.y})`,bottomRight:`(${E.x+E.width}, ${E.y+E.height})`,center:`(${E.x+E.width/2}, ${E.y+E.height/2})`})}},[M,t,n,f]),R(f,2,`プレースホルダー${t}-${n}: 表示中`,{isHighlighted:M,isDragging:e,dragOverPosition:s,shouldShow:D}),a.jsxs("div",{ref:H,"data-placeholder-index":t,"data-placeholder-column":n,"data-aqdd-drop-placeholder":T,onDragEnter:()=>l(n,t),onDragLeave:h=>i(h,n,t),className:`relative flex w-full items-center justify-center ${T==="hidden"?"pointer-events-none h-0 overflow-hidden opacity-0":T==="target"?"my-2 scale-[1.02] rounded-xl border-4 border-dashed px-4 py-6 shadow-lg":"my-2 rounded-xl border-2 border-dashed px-2 py-4"}`,children:[!y&&D&&f.showPlaceholderInfo&&P&&a.jsxs("div",{className:"absolute top-1 right-1 z-10 rounded-md bg-blue-500/90 px-2 py-1 font-mono text-white text-xs leading-tight shadow-lg",children:[a.jsxs("div",{children:[P.width,"×",P.height]}),a.jsxs("div",{children:["X:",P.x," Y:",P.y]}),a.jsx("div",{className:"text-[10px] opacity-80",children:"min:200px max:500px"}),a.jsxs("div",{className:"mt-0.5 text-[10px] opacity-80",children:["PH-",n,"-",t," ",M?"ACTIVE":"IDLE"]})]}),!y&&D&&a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("svg",{className:"h-6 w-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),a.jsx("span",{lang:C.lang,className:"font-medium text-sm",children:C.text})]})]})});Be.displayName="InsertPlaceholder";const Xe=({columnIndex:t,isDragging:n,dragOverPosition:e,children:s,config:o})=>{const l=r.useRef(null),[i,f]=r.useState(null);return r.useEffect(()=>{if(l.current&&n){const m=l.current.getBoundingClientRect(),C=e?.columnIndex===t,y={width:Math.round(m.width),height:Math.round(m.height),x:Math.round(m.left),y:Math.round(m.top),isActive:C};f(y),C&&R(o,1,`🎯 アクティブドロップゾーン ${t}:`,{size:`${y.width}×${y.height}`,position:`(${y.x}, ${y.y})`,bottomRight:`(${y.x+y.width}, ${y.y+y.height})`,center:`(${y.x+y.width/2}, ${y.y+y.height/2})`})}},[n,e,t,o]),a.jsxs("div",{ref:l,className:"relative",children:[s,n&&i&&o.showDropZoneOutlines&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:`pointer-events-none absolute inset-0 rounded-lg border-2 border-dashed transition-all duration-200 ${i.isActive?"border-red-500 bg-red-100/20 shadow-lg":"border-gray-400 bg-gray-100/10"}`}),a.jsxs("div",{className:`absolute top-2 left-2 z-20 rounded-md px-2 py-1 font-mono text-xs leading-tight shadow-lg transition-all duration-200 ${i.isActive?"bg-red-500/90 text-white":"bg-gray-500/90 text-white"}`,children:[a.jsxs("div",{className:"font-bold",children:["DropZone-",t]}),a.jsxs("div",{children:[i.width,"×",i.height]}),a.jsxs("div",{children:["X:",i.x," Y:",i.y]}),a.jsx("div",{className:"mt-0.5 text-[10px] opacity-80",children:i.isActive?"ACTIVE":"IDLE"})]}),a.jsx("div",{className:`pointer-events-none absolute transition-all duration-200 ${i.isActive?"opacity-100":"opacity-50"}`,style:{left:`${i.width/2-6}px`,top:`${i.height/2-6}px`},children:a.jsx("div",{className:`h-3 w-3 rounded-full border-2 ${i.isActive?"border-red-700 bg-red-500":"border-gray-700 bg-gray-500"}`})}),i.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"pointer-events-none absolute top-0 left-0 h-2 w-2 rounded-full bg-red-500"}),a.jsx("div",{className:"pointer-events-none absolute top-0 right-0 h-2 w-2 rounded-full bg-red-500"}),a.jsx("div",{className:"pointer-events-none absolute bottom-0 left-0 h-2 w-2 rounded-full bg-red-500"}),a.jsx("div",{className:"pointer-events-none absolute right-0 bottom-0 h-2 w-2 rounded-full bg-red-500"})]})]})]})};Xe.displayName="DropZoneDebugOverlay";const Ge="[data-aqdd-scroll-root]",we="data-aqdd-panel-action",Rn=.25,Mn=typeof window<"u"?r.useLayoutEffect:r.useEffect,An=(t,n=Rn)=>{const e=r.useRef(null),[s,o]=r.useState(1);return Mn(()=>{const l=e.current;if(!l||t<=0){o(1);return}const i=()=>{const m=l.clientWidth;if(m<=0)return;const C=m>=t?1:Math.max(m/t,n);o(y=>Math.abs(y-C)<.005?y:C)};i();const f=new ResizeObserver(i);return f.observe(l),()=>f.disconnect()},[t,n]),{containerRef:e,scale:s}},_n=Object.freeze(["--aqdd-panel-surface","--aqdd-panel-border","--aqdd-panel-title-color","--aqdd-header-button-color","--aqdd-header-button-hover-color","--aqdd-header-button-hover-surface","--aqdd-custom-badge-color","--aqdd-custom-badge-surface","--aqdd-default-panel-surface","--aqdd-default-panel-border","--aqdd-default-panel-title-color","--aqdd-default-header-button-color","--aqdd-default-header-button-hover-color","--aqdd-default-header-button-hover-surface","--aqdd-default-header-close-hover-color","--aqdd-default-custom-badge-color","--aqdd-default-custom-badge-surface"]),vt=(t,n)=>{const e=window.getComputedStyle(t);for(const s of _n){const o=e.getPropertyValue(s).trim();o!==""&&n.style.setProperty(s,o)}},yt=(t,n,e)=>{const s=t.getBoundingClientRect(),o=t.cloneNode(!0);return o.removeAttribute("data-panel-id"),vt(t,o),o.style.position="fixed",o.style.top="0px",o.style.left="0px",o.style.width=`${t.offsetWidth}px`,o.style.height=`${t.offsetHeight}px`,o.style.pointerEvents="none",o.style.zIndex="1000",o.style.opacity="0.5",o.style.margin="0",o.style.transition="none",o.style.boxShadow="0 8px 32px rgba(0,0,0,0.3)",o.style.transformOrigin="top left",o.style.transform=`translate(${s.left}px, ${s.top}px) scale(${e})`,o.id=`drag-image-${n}`,document.body.appendChild(o),o},wt=(t,n,e,s,o)=>{t.style.transform=`translate(${n-s.x}px, ${e-s.y}px) scale(${o*1.05})`},Tn=(t,n)=>{let e=n.closest("[data-drop-zone]");for(;e!==null&&e.closest("[data-aqdd-layout]")!==t;){const s=e.parentElement;e=s===null?null:s.closest("[data-drop-zone]")}return e},Ln=(t,n,e)=>{const s=document.elementFromPoint(n,e),o=s===null?null:Tn(t,s);if(o===null)return null;let l=null;for(const i of o.querySelectorAll("[data-placeholder-index]")){if(i.closest("[data-drop-zone]")!==o)continue;const{top:f,bottom:m}=i.getBoundingClientRect(),C=e<f?f-e:e>m?e-m:0;(l===null||C<l.distance)&&(l={insertIndex:Number(i.getAttribute("data-placeholder-index")),distance:C})}return l===null?null:{columnIndex:Number(o.getAttribute("data-column-index")),insertIndex:l.insertIndex}},Ce={triggerDistance:80,scrollSpeed:5,maxScrollSpeed:20},Ve=()=>{const t=window.visualViewport;return t?new DOMRect(t.offsetLeft,t.offsetTop,t.width,t.height):new DOMRect(0,0,window.innerWidth,window.innerHeight)},In=t=>{const n=t.getBoundingClientRect(),e=Ve(),s=Math.max(n.left,e.left),o=Math.max(n.top,e.top),l=Math.min(n.right,e.right),i=Math.min(n.bottom,e.bottom);return l>s&&i>o?new DOMRect(s,o,l-s,i-o):null},Ze=(t,n,e=Ce,s)=>{const{triggerDistance:o,scrollSpeed:l,maxScrollSpeed:i}=e,f=s===void 0?Ve():In(s);if(f===null)return{x:0,y:0};const{left:m,top:C,right:y,bottom:M}=f;let H=0,P=0;if(t>=m&&t<=y&&n>=C&&n<=M){if(t<m+o){const j=Math.max(0,(m+o-t)/o);H=-Math.min(i,l+j*(i-l))}else if(t>y-o){const j=Math.max(0,(t-(y-o))/o);H=Math.min(i,l+j*(i-l))}if(n<C+o){const j=Math.max(0,(C+o-n)/o);P=-Math.min(i,l+j*(i-l))}else if(n>M-o){const j=Math.max(0,(n-(M-o))/o);P=Math.min(i,l+j*(i-l))}}return{x:H,y:P}},zn=(t,n)=>{if(t===document.documentElement)return!1;if(t===document.body){const o=window.getComputedStyle(document.documentElement);if(o.overflowX==="visible"&&o.overflowY==="visible")return!1}const e=window.getComputedStyle(t),s=n==="x"?e.overflowX:e.overflowY;return s==="auto"||s==="scroll"},Wn=(t,n,e,s)=>e==="x"?s>0?t.right-n.right:n.left-t.left:s>0?t.bottom-n.bottom:n.top-t.top,Ct=(t,n,e)=>{const s=n==="x"?t.scrollLeft:t.scrollTop;return t.scrollBy(n==="x"?{left:e,behavior:"instant"}:{top:e,behavior:"instant"}),(n==="x"?t.scrollLeft:t.scrollTop)!==s},Pt=(t,n,e,s,o)=>{const l=Wn(e,n,s,o);return l>0&&Ct(t,s,Math.sign(o)*Math.min(Math.abs(o),l))},Et=(t,n,e)=>{if(Ct(t,n,e))return;const s=t.getBoundingClientRect();for(let l=t.parentElement;l!==null;l=l.parentElement)if(zn(l,n)&&Pt(l,l.getBoundingClientRect(),s,n,e))return;const o=document.scrollingElement;o instanceof Element&&o!==t&&Pt(o,Ve(),s,n,e)},jt=(t,n)=>{if(n===void 0){(t.x!==0||t.y!==0)&&window.scrollBy(t.x,t.y);return}t.x!==0&&Et(n,"x",t.x),t.y!==0&&Et(n,"y",t.y)};class Me{constructor(n=Ce,e){this.intervalId=null,this.isActive=!1,this.pointX=0,this.pointY=0,this.config=n,this.scrollElement=e}setScrollElement(n){this.scrollElement=n}start(n,e){this.pointX=n,this.pointY=e,!this.isActive&&(this.isActive=!0,this.intervalId=window.setInterval(()=>{const s=Ze(this.pointX,this.pointY,this.config,this.scrollElement);jt(s,this.scrollElement)},16))}update(n,e){this.pointX=n,this.pointY=e;const s=Ze(n,e,this.config,this.scrollElement);(s.x!==0||s.y!==0)&&!this.isActive?this.start(n,e):s.x===0&&s.y===0&&this.isActive&&this.stop()}stop(){this.intervalId!==null&&(clearInterval(this.intervalId),this.intervalId=null),this.isActive=!1}isScrolling(){return this.isActive}updateConfig(n){this.config=n}}const kt="custom-dragging",Hn=(t,n)=>t===null?n===null:n!==null&&t.columnIndex===n.columnIndex&&t.insertIndex===n.insertIndex,Dt=(t,n,e)=>{const{left:s,top:o,right:l,bottom:i}=t.getBoundingClientRect();return n<s||n>l||e<o||e>i},Fn=(t,n)=>{let e=null;const s=c=>{const I=t(),z=I.layoutRef.current;if(z===null||Dt(z,c.x,c.y))return null;const X=Ln(z,c.x,c.y),q=I.originOf(c.panelId);return X===null||q===null||He(q,X.columnIndex,X.insertIndex)?null:X},o=()=>{if(e===null||e.phase!=="dragging")return;const c=s(e);n(I=>I===null||Hn(I.over,c)?I:{panelId:I.panelId,over:c})},l=c=>{if(e===null||c.pointerId!==e.pointerId)return;if(e.x=c.clientX,e.y=c.clientY,e.phase==="pressing"){Math.hypot(e.x-e.startX,e.y-e.startY)>t().config.slop&&P();return}const I=t(),z=I.layoutRef.current;if(z===null||Dt(z,e.x,e.y)){j();return}wt(e.image,e.x,e.y,e.offset,I.scale),e.edgeScroll.update(e.x,e.y),o()},i=c=>{if(e===null||c.pointerId!==e.pointerId)return;if(e.phase==="pressing"){P();return}e.x=c.clientX,e.y=c.clientY;const I=s(e),z=P();if(z===null)return;const X=t();I===null?X.onCancel(z.panelId):X.onDrop(z.panelId,I)},f=c=>{e!==null&&c.pointerId===e.pointerId&&j()},m=c=>{e!==null&&e.phase==="pressing"&&c.pointerId!==e.pointerId&&P()},C=c=>{e!==null&&e.phase==="dragging"&&c.pointerId===e.pointerId&&c.target===e.header&&j()},y=c=>{e===null||e.phase!=="dragging"||c.key!=="Escape"||c.defaultPrevented||c.isComposing||(c.preventDefault(),j())},M=()=>{document.addEventListener("pointermove",l,!0),document.addEventListener("pointerup",i,!0),document.addEventListener("pointercancel",f,!0),document.addEventListener("pointerdown",m,!0),document.addEventListener("lostpointercapture",C,!0),document.addEventListener("keydown",y,!0)},H=()=>{document.removeEventListener("pointermove",l,!0),document.removeEventListener("pointerup",i,!0),document.removeEventListener("pointercancel",f,!0),document.removeEventListener("pointerdown",m,!0),document.removeEventListener("lostpointercapture",C,!0),document.removeEventListener("keydown",y,!0)},P=()=>{const c=e;return c===null?null:(e=null,H(),c.phase==="pressing"?(window.clearTimeout(c.timer),c):(document.removeEventListener("scroll",o,!0),c.edgeScroll.stop(),c.image.remove(),document.body.classList.remove(kt),c.header.hasPointerCapture(c.pointerId)&&c.header.releasePointerCapture(c.pointerId),n(null),c))},j=()=>{const c=P();c!==null&&c.phase==="dragging"&&t().onCancel(c.panelId)},D=()=>{if(e===null||e.phase!=="pressing")return;const c=e,I=t(),z=I.panelElementOf(c.panelId),X=I.scrollRootRef.current;if(!I.canStart||z===null||X===null||!c.header.isConnected){P();return}try{c.header.setPointerCapture(c.pointerId)}catch(b){if(b instanceof DOMException){P();return}throw b}const{left:q,top:g}=z.getBoundingClientRect();e={phase:"dragging",pointerId:c.pointerId,panelId:c.panelId,header:c.header,image:yt(z,c.panelId,I.scale),offset:{x:c.x-q,y:c.y-g},edgeScroll:new Me(Ce,X),x:c.x,y:c.y},document.addEventListener("scroll",o,{capture:!0,passive:!0}),document.body.classList.add(kt),n({panelId:c.panelId,over:null}),I.onLift(c.panelId)};return{pressHeader:(c,I)=>{if(e!==null||!c.isPrimary||c.button!==0||c.pointerType!=="touch"&&c.pointerType!=="pen")return;const z=t();z.canStart&&(c.target instanceof Element&&c.target.closest(`[${we}]`)!==null||(e={phase:"pressing",pointerId:c.pointerId,panelId:I,header:c.currentTarget,startX:c.clientX,startY:c.clientY,timer:window.setTimeout(D,z.config.longPressDelay),x:c.clientX,y:c.clientY},M()))},holdContextMenu:c=>{e!==null&&e.header===c.currentTarget&&c.preventDefault()},bindHeader:c=>{if(c===null)return;const I=z=>{e!==null&&e.phase==="dragging"&&e.header===c&&z.cancelable&&z.preventDefault()};return c.addEventListener("touchmove",I,{passive:!1}),()=>c.removeEventListener("touchmove",I)},cancel:j,dispose:()=>{P()}}},Yn=t=>{const n=r.useRef(t);r.useLayoutEffect(()=>{n.current=t});const[e,s]=r.useState(null),[o]=r.useState(()=>Fn(()=>n.current,s));return r.useEffect(()=>o.dispose,[o]),{touchDrag:e,pressHeader:o.pressHeader,holdContextMenu:o.holdContextMenu,bindHeader:o.bindHeader,cancel:o.cancel}},Ae=Object.freeze({switchToCustomDragMode:{text:"カスタムドラッグモードに切り替え",lang:"ja"},switchToNormalDragMode:{text:"通常ドラッグモードに戻す",lang:"ja"},hidePanel:{text:"パネルを非表示",lang:"ja"},maximizePanel:{text:"パネルを最大化",lang:"ja"},restorePanel:{text:"元のサイズに戻す",lang:"ja"},closePanel:{text:"パネルを閉じる",lang:"ja"},movePanelToPreviousColumn:{text:"前の列へ移動",lang:"ja"},movePanelToNextColumn:{text:"次の列へ移動",lang:"ja"},movePanelUp:{text:"上へ移動",lang:"ja"},movePanelDown:{text:"下へ移動",lang:"ja"},customDragModeBadge:{text:"Custom",lang:"en"},panelMoved:{text:"{title} を {column} 列目の {position} 番目へ移動しました",lang:"ja"},panelMoveUnavailable:{text:"{title} は{move}できません",lang:"ja"},panelDragStarted:{text:"{title} を持ち上げました",lang:"ja"},panelDragCancelled:{text:"{title} の移動を取り消しました",lang:"ja"},hiddenPanels:{text:"非表示のパネル:",lang:"ja"},hiddenPanelBadge:{text:"非表示",lang:"ja"},hiddenPanelNotice:{text:"このパネルは非表示です",lang:"ja"},emptyColumn:{text:"このエリアは空です",lang:"ja"},dropZone:{text:"Drop zone for column {column}",lang:"en"},dropHere:{text:"パネルをここにドロップ",lang:"ja"},resizeColumn:{text:"{column} 列目のカラム幅を調整",lang:"ja"}}),Nt=new Set(Object.keys(Ae)),St=Object.freeze({panelMoved:Object.freeze(["title","column","position"]),panelMoveUnavailable:Object.freeze(["title","move"]),panelDragStarted:Object.freeze(["title"]),panelDragCancelled:Object.freeze(["title"]),dropZone:Object.freeze(["column"]),resizeColumn:Object.freeze(["column"])}),Ot=/\{(\w+)\}/g,Un=Object.freeze(Object.fromEntries(Object.entries(Ae).map(([t,n])=>[t,n.text]))),Bn=t=>{if(t!==void 0){const e=t;if(e===null||typeof e!="object")throw new TypeError(`[@aiquants/drag-drop-panels] labels must be an object; got ${e===null?"null":typeof e}`);for(const s of Object.keys(e))if(!Nt.has(s))throw new RangeError(`[@aiquants/drag-drop-panels] labels has the unknown key "${s}"; the labels are ${[...Nt].join(", ")}`)}const n={};for(const e of Object.keys(Ae)){const s=t?.[e];if(s===void 0){n[e]=Ae[e];continue}if(typeof s!="string")throw new TypeError(`[@aiquants/drag-drop-panels] label "${e}" must be a string; got ${s===null?"null":typeof s}`);const o=St[e];if(o!==void 0){for(const[,l]of s.matchAll(Ot))if(!o.includes(l))throw new RangeError(`[@aiquants/drag-drop-panels] label "${e}" uses the unknown placeholder {${l}}; it accepts ${o.map(i=>`{${i}}`).join(", ")}`)}n[e]={text:s,lang:void 0}}return Object.freeze(n)},_e=(t,n)=>{const e=[],s=(o,l)=>{if(o==="")return;const i=e[e.length-1];if(i!==void 0&&i.lang===l){e[e.length-1]={text:`${i.text}${o}`,lang:l};return}e.push({text:o,lang:l})};for(const[o,l]of t.text.split(Ot).entries()){if(o%2===0){s(l,t.lang);continue}const i=n[l];if(i===void 0)throw new RangeError(`[@aiquants/drag-drop-panels] no value for the placeholder {${l}} of "${t.text}"`);typeof i=="number"?s(String(i),t.lang):s(i.text,i.lang)}return e},Rt=(t,n)=>({text:_e(t,n).map(e=>e.text).join(""),lang:t.lang}),Xn=229,Gn=new Set(["","auto","hint"]),Vn=t=>{for(const n of t.querySelectorAll("[popover]")){const e=n.getAttribute("popover");if(e!==null&&Gn.has(e.toLowerCase())&&n.matches(":popover-open"))return!0}return!1},Zn=t=>t.key!=="Escape"||t.defaultPrevented||t.isComposing||t.keyCode===Xn||t.target instanceof Element&&t.target.closest("dialog[open]")!==null?!1:!("popover"in HTMLElement.prototype&&Vn(document)),Kn="resizing-column",Mt=t=>{document.body.style.cursor=t?"col-resize":"",document.body.style.userSelect=t?"none":"",document.body.classList.toggle(Kn,t)},Ke=({columnId:t,onResizeStart:n,onResize:e,onResizeEnd:s,isResizing:o=!1,position:l="right",className:i="",debug:f={},label:m})=>{const C=r.useRef({columnId:t,onResize:e,onResizeEnd:s,debug:f});r.useLayoutEffect(()=>{C.current={columnId:t,onResize:e,onResizeEnd:s,debug:f}});const y=r.useRef(null);r.useEffect(()=>{o||y.current?.()},[o]),r.useEffect(()=>()=>y.current?.(),[]);const M=P=>{if(y.current!==null||!P.isPrimary||P.button!==0)return;const j=P.currentTarget,{pointerId:D}=P;try{j.setPointerCapture(D)}catch(c){if(c instanceof DOMException)return;throw c}P.preventDefault(),P.stopPropagation(),R(f,2,"リサイズハンドル ポインタダウン:",t,P.pointerType);const T=c=>{c.pointerId===D&&C.current.onResize(c.clientX)},h=c=>{c.pointerId===D&&N(!0)},E=c=>{c.pointerId===D&&N(!0)},N=c=>{y.current=null,document.removeEventListener("pointermove",T,!0),document.removeEventListener("pointerup",h,!0),document.removeEventListener("pointercancel",h,!0),j.removeEventListener("lostpointercapture",E),j.hasPointerCapture(D)&&j.releasePointerCapture(D),Mt(!1),R(C.current.debug,c?2:1,c?"リサイズハンドル 終了:":"リサイズハンドル 中断:",C.current.columnId),c&&C.current.onResizeEnd()};y.current=()=>N(!1),document.addEventListener("pointermove",T,!0),document.addEventListener("pointerup",h,!0),document.addEventListener("pointercancel",h,!0),j.addEventListener("lostpointercapture",E),Mt(!0),n(t,P.clientX)},H=["resize-handle",l,o?"resizing":"",i].filter(Boolean).join(" ");return a.jsxs("div",{className:H,onPointerDown:M,"data-column-id":t,"data-position":l,"aria-label":m.text,lang:m.lang,role:"separator","aria-orientation":"vertical",children:[a.jsx("div",{className:"resize-handle-bar"}),f.showPanelSizes&&a.jsxs("div",{className:"resize-handle-debug-info",children:[t,o&&" (resizing)"]})]})},Jn=({columnId:t,width:n,minWidth:e=100,maxWidth:s=800,onResizeStart:o,onResize:l,onResizeEnd:i,isResizing:f=!1,resizable:m=!0,className:C="",debug:y={},resizeHandleLabel:M,children:H})=>{const P=["resizable-column",f?"resizing":"",C].filter(Boolean).join(" ");return r.useEffect(()=>{const j=document.querySelector(`[data-column-id="${t}"]`);j&&(j.style.setProperty("--column-width",`${n}px`),j.style.setProperty("--column-min-width",`${e}px`),j.style.setProperty("--column-max-width",`${s}px`))},[t,n,e,s]),a.jsxs("div",{className:P,"data-column-id":t,"data-width":n,"data-min-width":e,"data-max-width":s,children:[H,m&&a.jsx(Ke,{columnId:t,onResizeStart:o,onResize:l,onResizeEnd:i,isResizing:f,position:"right",debug:y,label:M}),y.showPanelSizes&&a.jsxs("div",{className:"column-debug-size",children:[n,"px",f&&" ↔"]})]})},At=Object.freeze({longPressDelay:500,slop:10}),Je=Object.freeze(["longPressDelay","slop"]),Qn=t=>{const n=t;if(n===null||typeof n!="object")throw new TypeError(`[@aiquants/drag-drop-panels] touchDragConfig must be an object; got ${n===null?"null":typeof n}`);for(const e of Object.keys(n))if(!Je.includes(e))throw new RangeError(`[@aiquants/drag-drop-panels] touchDragConfig has the unknown key "${e}"; the keys are ${Je.join(", ")}`);for(const e of Je){const s=t[e];if(typeof s!="number")throw new TypeError(`[@aiquants/drag-drop-panels] touchDragConfig.${e} must be a number; got ${s===null?"null":typeof s}`);if(!Number.isFinite(s)||s<0)throw new RangeError(`[@aiquants/drag-drop-panels] touchDragConfig.${e} must be a finite number of 0 or more; got ${s}`)}},_t=Object.freeze({"previous-column":"movePanelToPreviousColumn","next-column":"movePanelToNextColumn",up:"movePanelUp",down:"movePanelDown"}),qn=Object.freeze({"previous-column":yn,"next-column":wn,up:Cn,down:vn}),$n='input, textarea, select, [contenteditable]:not([contenteditable="false"])',Qe=(t,n)=>({segments:n,serial:t===null?1:t.serial+1}),eo="​",to="(prefers-reduced-motion: reduce)",no=()=>typeof window.matchMedia=="function"&&window.matchMedia(to).matches,oo=t=>{t.key==="Enter"&&t.repeat&&t.preventDefault()},ke=({action:t,label:n,tooltip:e,unavailable:s,keyShortcuts:o,onActivate:l,children:i})=>a.jsx("button",{type:"button",[we]:t,"aria-label":n.text,"aria-disabled":s?!0:void 0,"aria-keyshortcuts":o,title:e,lang:n.lang,className:"rounded p-1 motion-safe:transition-colors",onClick:f=>{f.stopPropagation(),l()},children:i}),qe=r.memo(({index:t,columnIndex:n,isDragging:e,dragOverPosition:s,originalPosition:o,onDragEnter:l,onDragLeave:i,debugConfig:f,customDrag:m,label:C})=>a.jsx(Be,{index:t,columnIndex:n,isDragging:e,dragOverPosition:s,originalPosition:o,onDragEnter:l,onDragLeave:i,config:f,customDrag:m,label:C}));qe.displayName="LocalInsertPlaceholder";const so=({columns:t,panels:n,columnPanels:e,onColumnPanelsChange:s,panelVisibility:o,onPanelVisibilityChange:l,dragState:i,dragOverPosition:f,originalPanelPosition:m,dragModes:C,onDragStart:y,onDragEnd:M,onPlaceholderDragEnter:H,onPlaceholderDragLeave:P,onDragOverWithInsert:j,onDropWithInsert:D,onColumnDragLeave:T,onPanelClick:h,onPanelMouseDown:E,debugConfig:N,panelSizes:c,setPanelRef:I,enableResize:z=!1,columnWidths:X,onResizeStart:q,onResize:g,onResizeEnd:b,isResizing:_=!1,resizingColumn:F,onPanelSizeInfoClick:v,onToggleDragMode:w,onPanelClose:x,onPanelMaximizeChange:k,customDrag:L,dragHandle:U="panel",maximizedPanel:B=null,panelClassName:V="",scale:d,autoScale:p,onScaleChange:O,scrollRootElement:G="div",labels:Q,touchDragConfig:re=At})=>{if(G!=="div"&&G!=="main")throw new RangeError(`[@aiquants/drag-drop-panels] scrollRootElement must be "div" or "main"; got ${JSON.stringify(G)}`);const J=G,Y=r.useMemo(()=>Bn(Q),[Q]);Qn(re);const ge=r.useId(),ce=r.useMemo(()=>{const u={};return n.forEach(S=>{u[S.id]=S}),u},[n]),he=r.useMemo(()=>({columnKeys:t.map(u=>u.key),columnPanels:e,panelVisibility:Object.fromEntries(Object.keys(o).map(u=>[u,o[u]===!0&&ce[u]!==void 0]))}),[t,e,o,ce]),Yt=B===null?null:ye(he,B),ie=Yt!==null,xe=r.useRef(N);r.useEffect(()=>{xe.current=N},[N]);const{containerRef:Co,scale:Po}=An(p?.requiredWidth??0,p?.minScale),tt=ie?1:d??(p?Po:1),me=Number.isFinite(tt)&&tt>0?tt:1,Ut=r.useRef(me);Ut.current=me,r.useEffect(()=>{O&&O(me)},[me,O]);const Eo=me<1?{width:`${100/me}%`,height:`${100/me}%`,transform:`scale(${me})`,transformOrigin:"top left"}:void 0,de=r.useRef({}),nt=r.useRef(new Map);r.useEffect(()=>{R(xe.current,1,"🎨 DragDropLayout - dragModes props changed:",{dragModes:C,timestamp:new Date().toISOString(),keys:Object.keys(C),values:Object.values(C)})},[C]);const[ot,st]=r.useState(null),Te=r.useRef(null),Bt=r.useRef({arrangement:he,labels:Y,panelComponentMap:ce});r.useLayoutEffect(()=>{Bt.current={arrangement:he,labels:Y,panelComponentMap:ce}});const Xt=r.useRef(null),Gt=r.useRef(null),jo=r.useCallback(u=>{Gt.current=u},[]),Vt=r.useRef(null),rt=(u,S)=>{const W=ce[S];if(W===void 0)return;const $=_e(u,{title:{text:W.title,lang:void 0}});st(ee=>Qe(ee,$))},Zt=(u,S,W,$)=>{const ee=de.current[u],ne=document.activeElement,oe=ee instanceof HTMLElement&&ne!==null&&ee.contains(ne)?ne.closest(`[${we}]`)?.getAttribute(we)??$:null;Te.current={panelId:u,from:S,columnPanels:he.columnPanels,focusAction:oe},s(W)},Kt=u=>{for(const[S,W]of t.entries()){const $=(e[W.key]??[]).indexOf(u);if($>=0)return{columnIndex:S,panelIndex:$}}return null},ko=(u,S)=>{const W=ye(he,u),$=t[S.columnIndex],ee=W===null||$===void 0?null:Fe(e,u,$.key,S.insertIndex);if(W===null||ee===null){rt(Y.panelDragCancelled,u);return}Zt(u,W,ee,null)},Jt=!(i.isDragging||L?.isActive===!0||ie),Se=Yn({config:re,layoutRef:Xt,scrollRootRef:Gt,scale:me,canStart:Jt,panelElementOf:u=>de.current[u]??null,originOf:Kt,onLift:u=>rt(Y.panelDragStarted,u),onDrop:ko,onCancel:u=>rt(Y.panelDragCancelled,u)}),{touchDrag:be}=Se,Qt=be!==null&&(!Jt||ye(he,be.panelId)===null),qt=Se.cancel;r.useEffect(()=>{Qt&&qt()},[Qt,qt]);const Le=i.isDragging||L?.isActive===!0||be!==null;r.useLayoutEffect(()=>{Le&&(Te.current=null)},[Le]),r.useLayoutEffect(()=>{const u=Te.current;if(u===null||(Te.current=null,!On(u.columnPanels,e,u.panelId)))return;const S=Bt.current,W=ye({...S.arrangement,columnPanels:e},u.panelId);if(W===null||W.column===u.from.column&&W.index===u.from.index)return;const $=_e(S.labels.panelMoved,{title:{text:S.panelComponentMap[u.panelId].title,lang:void 0},column:W.column+1,position:W.index+1});st(te=>Qe(te,$));const ee=de.current[u.panelId];if(u.focusAction===null||ee===null||ee===void 0)return;const{activeElement:ne,body:oe}=document;if(ne===null||ne===oe){const te=ee.querySelector(`[${we}="${u.focusAction}"]`);te instanceof HTMLElement&&te.focus({preventScroll:!0})}const Z=document.activeElement;Z instanceof HTMLElement&&ee.contains(Z)&&Z.scrollIntoView({block:"nearest",inline:"nearest"})},[e]),r.useEffect(()=>{if(!(ie&&k))return;const u=S=>{Zn(S)&&(S.preventDefault(),k(null))};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[ie,k]),r.useLayoutEffect(()=>{const u=new Map;Object.keys(de.current).forEach(oe=>{const Z=de.current[oe];if(Z){const te=Z.getBoundingClientRect();u.set(oe,{rect:te,height:Z.offsetHeight,width:Z.offsetWidth})}});const S=nt.current,W=300,$=new Set;Object.values(e).forEach(oe=>{oe.forEach(Z=>{$.add(Z)})}),new Set(S.keys()).forEach(oe=>{$.has(oe)||(R(xe.current,1,"パネル削除検出 - クリーンアップ:",oe),S.delete(oe),de.current[oe]&&delete de.current[oe])});const ne=!no();u.forEach((oe,Z)=>{if(!ne)return;const te=S.get(Z);if(te){const ae=te.rect.left-oe.rect.left,pe=te.rect.top-oe.rect.top;if(ae!==0||pe!==0){R(xe.current,2,"パネル移動検出 - アニメーション開始:",Z,{dx:ae,dy:pe});const le=de.current[Z];if(le){const Ie=Ut.current||1;le.style.transform=`translate(${ae/Ie}px, ${pe/Ie}px)`,le.style.transition="none",le.classList.add("is-moving"),requestAnimationFrame(()=>{le.style.transition=`transform ${W}ms cubic-bezier(0.2, 0, 0.2, 1)`,le.style.transform="translate(0, 0)",setTimeout(()=>{le.style.transition="",le.style.transform="",le.classList.remove("is-moving")},W)})}}}else{R(xe.current,1,"新規パネル検出 - フェードインアニメーション:",Z);const ae=de.current[Z];ae&&(ae.style.opacity="0",ae.style.transition="none",requestAnimationFrame(()=>{ae.style.transition=`opacity ${W}ms ease-out`,ae.style.opacity="1",setTimeout(()=>{ae.style.transition="",ae.style.opacity=""},W)}))}}),nt.current=u},[e]),r.useLayoutEffect(()=>{const u=new Map;Object.keys(de.current).forEach(S=>{const W=de.current[S];W&&u.set(S,{rect:W.getBoundingClientRect(),height:W.offsetHeight,width:W.offsetWidth})}),nt.current=u},[me]);const $t=(u,S,W)=>{if(Le)return;const $=xt(he,u,S);if($===null){if(W){const ee=_e(Y.panelMoveUnavailable,{title:{text:ce[u].title,lang:void 0},move:Y[_t[S]]});st(ne=>Qe(ne,ee))}return}Zt(u,$.from,$.columnPanels,`move-${S}`)},Do=(u,S)=>{if(u.defaultPrevented||ie||!(u.target instanceof Node&&u.currentTarget.contains(u.target)))return;const W=bt(u);W!==null&&(u.target instanceof Element&&u.target.closest($n)!==null||(u.preventDefault(),!u.repeat&&$t(S,W,!0)))},en=(u,S)=>{const W=Vt.current;if(W==="touch"||W==="pen"){u.preventDefault();return}y(u,S)},at=be===null?f:be.over,tn=be===null?m:Kt(be.panelId),No=u=>{if(!o[u])return null;const S=ce[u];if(!S)return R(xe.current,1,`Panel config not found for panelId: ${u}`),null;const W=S.component,$=S.title,ee=i.draggedPanel===u||be?.panelId===u,ne=C[u]||"normal";R(xe.current,2,`🎨 renderPanel - ${u}:`,{panelId:u,dragMode:ne,timestamp:new Date().toISOString()});const oe=K=>{de.current[u]=K,I&&I(u,K),K&&N.showPanelSizes&&requestAnimationFrame(()=>{const Pe=K.getBoundingClientRect(),Oe=window.getComputedStyle(K);R(xe.current,1,`Panel ${u} mounted with size:`,{width:Pe.width,height:Pe.height,x:Pe.left,y:Pe.top,minHeight:Oe.minHeight,maxHeight:Oe.maxHeight})})},Z=c[u],te=B===u,ae=!!k,pe=()=>k?.(te?null:u),le=te?null:new Set(gt(he,u)),Ie=te?{position:"fixed",top:"var(--aqdd-maximize-top, 0px)",right:"var(--aqdd-maximize-right, 0px)",bottom:"var(--aqdd-maximize-bottom, 0px)",left:"var(--aqdd-maximize-left, 0px)",zIndex:50,minHeight:0,maxHeight:"none"}:{minHeight:S.minHeight??"200px",maxHeight:S.maxHeight??"500px"},ze=U==="header",on=ne==="normal"&&!ze&&!te,sn=ne==="normal"&&ze&&!te,rn=ee?"cursor-grabbing":"cursor-grab",an=`panel-draggable relative flex flex-col overflow-hidden border text-left shadow-lg backdrop-blur-lg ${ne==="custom"?"select-none":""}`,Oo=te?`${an} rounded-none p-4 ${V}`:`${an} rounded-2xl p-4 motion-safe:transition-all motion-safe:duration-300 motion-safe:hover:-translate-y-1 hover:shadow-xl ${ze?"":rn} ${V}`,ln=ne==="custom"?Y.switchToNormalDragMode:Y.switchToCustomDragMode,cn=te?Y.restorePanel:Y.maximizePanel;return a.jsxs("div",{ref:oe,"data-panel-id":u,"data-aqdd-panel":!0,"data-aqdd-drag-mode":ne,"data-dragging":ee,"data-maximized":te||void 0,role:"presentation",draggable:on,onDragStart:K=>on&&en(K,u),onDragEnd:M,onClick:K=>h?.(K,u),onMouseDown:K=>E?.(K,u),onKeyDown:K=>Do(K,u),style:Ie,className:Oo,children:[a.jsxs("div",{ref:Se.bindHeader,"data-aqdd-panel-header":!0,className:`relative mb-3 ${ze&&!te?rn:""}`,draggable:sn,onDragStart:K=>sn&&en(K,u),onPointerDown:K=>Se.pressHeader(K,u),onContextMenu:Se.holdContextMenu,onKeyDown:oo,onDoubleClick:ae?K=>{K.stopPropagation(),!(K.target instanceof Element&&K.target.closest(`[${we}]`)!==null)&&pe()}:void 0,children:[a.jsx("h3",{"data-aqdd-panel-title":!0,className:"font-semibold text-lg",children:$}),a.jsxs("div",{"data-aqdd-panel-controls":!0,children:[ne==="custom"&&a.jsx("span",{"data-aqdd-custom-badge":!0,lang:Y.customDragModeBadge.lang,className:"rounded-md px-2 py-1 font-medium text-xs",children:Y.customDragModeBadge.text}),a.jsxs("div",{"data-aqdd-panel-buttons":!0,children:[le!==null&&ve.map(K=>{const Pe=qn[K],Oe=Y[_t[K]],un=Ue[K];return a.jsx(ke,{action:`move-${K}`,label:Oe,tooltip:`${Oe.text} (${un.text})`,unavailable:!le.has(K),keyShortcuts:un.aria,onActivate:()=>$t(u,K,!1),children:a.jsx(Pe,{className:"h-4 w-4","aria-hidden":"true"})},K)}),a.jsx(ke,{action:"drag-mode",label:ln,tooltip:ln.text,unavailable:!1,keyShortcuts:void 0,onActivate:()=>w?.(u),children:ne==="custom"?a.jsx(Dn,{className:"h-4 w-4","aria-hidden":"true"}):a.jsx(kn,{className:"h-4 w-4","aria-hidden":"true"})}),!te&&a.jsx(ke,{action:"hide",label:Y.hidePanel,tooltip:Y.hidePanel.text,unavailable:!1,keyShortcuts:void 0,onActivate:()=>l({...o,[u]:!1}),children:a.jsx(ft,{className:"h-4 w-4","aria-hidden":"true"})}),ae&&a.jsx(ke,{action:te?"restore":"maximize",label:cn,tooltip:cn.text,unavailable:!1,keyShortcuts:void 0,onActivate:pe,children:te?a.jsx(jn,{className:"h-4 w-4","aria-hidden":"true"}):a.jsx(En,{className:"h-4 w-4","aria-hidden":"true"})}),x&&a.jsx(ke,{action:"close",label:Y.closePanel,tooltip:Y.closePanel.text,unavailable:!1,keyShortcuts:void 0,onActivate:()=>x(u),children:a.jsx(ht,{className:"h-4 w-4","aria-hidden":"true"})})]})]})]}),a.jsx("div",{"data-aqdd-scroll-area":!0,className:"panel-scroll-area min-h-0 flex-1 overflow-y-auto",children:a.jsx(W,{...S.props||{}})}),a.jsx(mt,{config:N,panelId:u,sizeInfo:Z,onSizeInfoClick:K=>v?.(K,u)})]},u)},So=(u,S)=>{const W=e[u]||[];let $=!1;for(const Z of W)if(o[Z]){$=!0;break}const ee=Le,ne=Rt(Y.dropZone,{column:S+1}),oe=`${ge}-drop-zone-${S}`;return a.jsx(Xe,{columnIndex:S,isDragging:ee,dragOverPosition:at,config:N,children:a.jsxs("section",{"data-drop-zone":"true","data-column-key":u,"data-column-index":S,"aria-labelledby":oe,onDragOver:Z=>j(Z,S),onDrop:Z=>D(Z,u),onDragLeave:T,className:"relative flex h-full flex-col motion-safe:transition-all motion-safe:duration-200",children:[a.jsx("span",{id:oe,hidden:!0,lang:ne.lang,children:ne.text}),a.jsx("div",{className:"placeholder-container",inert:ie,children:a.jsx(qe,{index:0,columnIndex:S,isDragging:ee,dragOverPosition:at,originalPosition:tn,onDragEnter:H,onDragLeave:P,debugConfig:N,customDrag:L,label:Y.dropHere})}),W.map((Z,te)=>{const ae=o[Z],pe=!(ae||ee),le=ie&&Z===B;return a.jsxs("div",{className:`panel-with-placeholder ${pe?"m-0 h-0 overflow-hidden p-0":""}`,"data-panel-hidden":pe?"true":void 0,"aria-hidden":pe?"true":void 0,inert:ie&&!le,children:[ae?No(Z):ee?a.jsxs("div",{"data-aqdd-hidden-panel-stand-in":!0,className:"hidden-panel-placeholder relative h-[120px] rounded-2xl border-2 border-dashed p-3 text-left shadow-lg backdrop-blur-lg",children:[a.jsxs("div",{className:"mb-2 flex items-center space-x-2",children:[a.jsx("h3",{className:"font-semibold text-base",children:ce[Z]?.title||Z}),a.jsx("span",{"data-aqdd-hidden-panel-badge":!0,lang:Y.hiddenPanelBadge.lang,className:"rounded-md px-2 py-1 font-medium text-xs",children:Y.hiddenPanelBadge.text})]}),a.jsx("div",{className:"flex-1 overflow-hidden",children:a.jsx("div",{className:"flex h-full items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx(ft,{className:"mx-auto h-6 w-6 opacity-50","aria-hidden":"true"}),a.jsx("p",{lang:Y.hiddenPanelNotice.lang,className:"mt-1 text-xs",children:Y.hiddenPanelNotice.text})]})})})]}):null,le?null:a.jsx(qe,{index:te+1,columnIndex:S,isDragging:ee,dragOverPosition:at,originalPosition:tn,onDragEnter:H,onDragLeave:P,debugConfig:N,customDrag:L,label:Y.dropHere})]},`panel-${Z}`)}),!($||ee)&&a.jsx("div",{"data-aqdd-empty-column":!0,className:"flex-shrink-0 rounded-xl border-2 border-dashed p-8 text-center motion-safe:transition-all motion-safe:duration-200",inert:ie,children:a.jsx("div",{lang:Y.emptyColumn.lang,className:"text-sm",children:Y.emptyColumn.text})})]})})},nn=Object.keys(o).filter(u=>!o[u]);return a.jsxs("div",{ref:Xt,"data-aqdd-layout":!0,className:"flex h-full flex-col",onPointerDownCapture:u=>{Vt.current=u.pointerType},children:[a.jsxs("div",{"data-aqdd-announcer":!0,role:"status","aria-live":"polite","aria-atomic":"true",inert:ie,children:[ot?.segments.map((u,S)=>u.lang===void 0?u.text:a.jsx("span",{lang:u.lang,children:u.text},S)),ot!==null&&ot.serial%2===0?eo:null]}),nn.length>0&&a.jsx("div",{"data-aqdd-hidden-panels":!0,className:"border-b px-4 py-2 backdrop-blur-lg",inert:ie,children:a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx("span",{lang:Y.hiddenPanels.lang,className:"mr-2 text-sm",children:Y.hiddenPanels.text}),nn.map(u=>{const W=ce[u]?.title||u;return a.jsxs("button",{type:"button","data-aqdd-restore-panel":u,onClick:()=>l({...o,[u]:!0}),className:"flex items-center space-x-1 rounded-lg px-3 py-1 text-sm shadow-md hover:shadow-lg motion-safe:transition-all motion-safe:duration-200",children:[a.jsx(Pn,{className:"h-3 w-3","aria-hidden":"true"}),a.jsx("span",{children:W})]},u)})]})}),a.jsx("div",{ref:Co,className:"relative min-h-0 flex-1 overflow-hidden",children:a.jsx("div",{className:"h-full w-full",style:Eo,children:a.jsx(J,{ref:jo,"data-aqdd-scroll-root":!0,className:"no-scrollbar h-full max-w-full flex-1 overflow-auto",children:a.jsx("div",{"data-aqdd-columns":!0,className:"relative flex h-full items-start",children:t.map((u,S)=>{const W=X?.[u.id]||u.initialWidth||350,$=z&&(u.resizable??!0);return a.jsx(r.Fragment,{children:a.jsxs("div",{className:`column relative ${u.className||""} ${z?"resize-enabled-column":"auto-width-column"} ${_&&F===u.id?"column-resizing-active":""}`,"data-column":S,"data-column-id":u.id,"data-min-width":u.minWidth||350,"data-max-width":u.maxWidth,"data-column-width":z?W:void 0,inert:ie&&S!==Yt.column,...z&&{style:{"--column-width":`${W}px`}},children:[So(u.key,S),$&&!ie&&q&&g&&b&&a.jsx(Ke,{columnId:u.id,onResizeStart:q,onResize:g,onResizeEnd:b,isResizing:_&&F===u.id,position:"right",debug:N,label:Rt(Y.resizeColumn,{column:S+1})})]})},u.id)})})})})})]})};const ro=se("grid-3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);const ao=se("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const $e=se("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const lo=se("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),co=({columnCount:t,onColumnCountChange:n,onAutoBalance:e,onResetWidths:s,minColumns:o=2,maxColumns:l=6,isResizing:i=!1,isResponsiveMode:f=!1,responsiveColumnCount:m})=>{const C=t>o&&!f,y=t<l&&!f;return a.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-slate-200 bg-white/80 px-4 py-2 shadow-sm backdrop-blur-lg",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-medium text-slate-700 text-sm",children:"カラム数:"}),a.jsx("button",{type:"button",onClick:()=>C&&n(t-1),disabled:!C||i,className:`rounded p-1 text-xs transition-colors ${C&&!i?"border border-slate-300 text-slate-600 hover:border-red-300 hover:bg-red-50 hover:text-red-600":"cursor-not-allowed border border-slate-200 bg-slate-50 text-slate-300"}`,title:f?"レスポンシブモード中:カラム数は自動調整されます":`カラムを削除 (最小: ${o}列)`,children:a.jsx(ao,{className:"h-3 w-3"})}),a.jsxs("div",{className:`min-w-[2rem] rounded border px-3 py-1 text-center font-mono text-sm ${f?"border-blue-300 bg-blue-50 text-blue-700":"border-slate-300 bg-slate-100 text-slate-700"}`,children:[f?m??t:t,f&&a.jsx("span",{className:"ml-1 text-xs",children:"自動"})]}),a.jsx("button",{type:"button",onClick:()=>y&&n(t+1),disabled:!y||i,className:`rounded p-1 text-xs transition-colors ${y&&!i?"border border-slate-300 text-slate-600 hover:border-blue-300 hover:bg-blue-50 hover:text-blue-600":"cursor-not-allowed border border-slate-200 bg-slate-50 text-slate-300"}`,title:f?"レスポンシブモード中:カラム数は自動調整されます":`カラムを追加 (最大: ${l}列)`,children:a.jsx($e,{className:"h-3 w-3"})})]}),a.jsx("div",{className:"h-6 w-px bg-slate-300"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{type:"button",onClick:e,disabled:i,className:`flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors ${i?"cursor-not-allowed border border-slate-200 bg-slate-50 text-slate-300":"border border-slate-300 text-slate-600 hover:border-green-300 hover:bg-green-50 hover:text-green-600"}`,title:"パネルを全カラムに均等分散",children:[a.jsx(ro,{className:"h-3 w-3"}),a.jsx("span",{children:"バランス"})]}),a.jsxs("button",{type:"button",onClick:s,disabled:i,className:`flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors ${i?"cursor-not-allowed border border-slate-200 bg-slate-50 text-slate-300":"border border-slate-300 text-slate-600 hover:border-orange-300 hover:bg-orange-50 hover:text-orange-600"}`,title:"カラム幅を初期値にリセット",children:[a.jsx(lo,{className:"h-3 w-3"}),a.jsx("span",{children:"幅リセット"})]})]}),i&&a.jsxs("div",{className:"flex items-center gap-1 text-blue-600 text-xs",children:[a.jsx("div",{className:"h-2 w-2 animate-pulse rounded-full bg-blue-500"}),a.jsx("span",{children:"リサイズ中..."})]})]})},io=({columnCount:t,onInsertColumn:n,onDeleteColumn:e,minColumns:s=1,maxColumns:o=6,isResizing:l=!1,disabled:i=!1})=>{const f=t<o&&!i,m=t>s&&!i;return a.jsxs("div",{className:`flex items-center justify-center gap-1 rounded-lg border border-slate-200 px-4 py-2 shadow-sm backdrop-blur-lg ${i?"bg-slate-100/80 opacity-60":"bg-white/80"}`,children:[i&&a.jsx("div",{className:"flex items-center gap-2 text-slate-500 text-xs",children:a.jsx("span",{children:"レスポンシブモード有効中:カラム数は自動調整されます"})}),!i&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",onClick:()=>f&&n(0),disabled:!f||l,className:`flex h-8 w-8 items-center justify-center rounded border-2 border-dashed text-xs transition-colors ${f&&!l?"border-blue-300 text-blue-600 hover:border-blue-500 hover:bg-blue-50":"cursor-not-allowed border-slate-200 text-slate-300"}`,title:"この位置に新しいカラムを挿入",children:a.jsx($e,{className:"h-4 w-4"})}),Array.from({length:t},(C,y)=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsxs("div",{className:"relative flex h-8 w-12 items-center justify-center rounded border border-slate-300 bg-slate-100",children:[a.jsx("span",{className:"font-medium font-mono text-slate-700 text-xs",children:y+1}),m&&!l&&a.jsx("button",{type:"button",onClick:()=>e(y),className:"absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full border border-red-300 bg-red-100 text-red-600 hover:bg-red-200",title:`カラム ${y+1} を削除`,children:a.jsx(ht,{className:"h-2.5 w-2.5"})})]}),a.jsx("button",{type:"button",onClick:()=>f&&n(y+1),disabled:!f||l,className:`flex h-8 w-8 items-center justify-center rounded border-2 border-dashed text-xs transition-colors ${f&&!l?"border-blue-300 text-blue-600 hover:border-blue-500 hover:bg-blue-50":"cursor-not-allowed border-slate-200 text-slate-300"}`,title:"この位置に新しいカラムを挿入",children:a.jsx($e,{className:"h-4 w-4"})})]},`column-${y}`))]})]})},uo=({config:t,onConfigChange:n,isVisible:e,onToggleVisibility:s})=>e?a.jsxs("div",{className:"fixed right-4 bottom-4 z-50 max-w-sm rounded-lg border border-gray-300 bg-white p-4 shadow-xl",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsx("h3",{className:"font-bold text-gray-800 text-sm",children:"🛠️ デバッグ設定"}),a.jsx("button",{type:"button",onClick:s,className:"text-gray-500 text-lg hover:text-gray-700",title:"閉じる",children:"✕"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[a.jsx("input",{type:"checkbox",checked:t.showDebugPanel??!1,onChange:o=>n({...t,showDebugPanel:o.target.checked}),className:"rounded"}),a.jsx("span",{children:"デバッグパネル表示"})]}),a.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[a.jsx("input",{type:"checkbox",checked:t.showMousePosition??!1,onChange:o=>n({...t,showMousePosition:o.target.checked}),className:"rounded"}),a.jsx("span",{children:"マウス位置表示"})]}),a.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[a.jsx("input",{type:"checkbox",checked:t.showPanelSizes??!1,onChange:o=>n({...t,showPanelSizes:o.target.checked}),className:"rounded"}),a.jsx("span",{children:"パネルサイズ情報"})]}),a.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[a.jsx("input",{type:"checkbox",checked:t.showPlaceholderInfo??!1,onChange:o=>n({...t,showPlaceholderInfo:o.target.checked}),className:"rounded"}),a.jsx("span",{children:"プレースホルダー詳細"})]}),a.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[a.jsx("input",{type:"checkbox",checked:t.showDropZoneOutlines??!1,onChange:o=>n({...t,showDropZoneOutlines:o.target.checked}),className:"rounded"}),a.jsx("span",{children:"ドロップゾーン境界"})]}),a.jsxs("div",{className:"border-gray-200 border-t pt-2",children:[a.jsxs("label",{htmlFor:"log-level-slider",className:"mb-1 block text-sm",children:["ログレベル: ",t.logLevel??0]}),a.jsx("input",{id:"log-level-slider",type:"range",min:"0",max:"2",value:t.logLevel??0,onChange:o=>n({...t,logLevel:parseInt(o.target.value,10)}),className:"w-full","aria-label":"ログレベル設定"}),a.jsxs("div",{className:"mt-1 flex justify-between text-gray-500 text-xs",children:[a.jsx("span",{children:"無効"}),a.jsx("span",{children:"基本"}),a.jsx("span",{children:"詳細"})]})]}),a.jsxs("div",{className:"space-y-2 pt-2",children:[a.jsx("button",{type:"button",onClick:()=>n({showDebugPanel:!0,showMousePosition:!0,showPanelSizes:!0,showPlaceholderInfo:!0,showDropZoneOutlines:!0,logLevel:2}),className:"w-full rounded bg-blue-100 px-2 py-1 text-blue-700 text-sm transition-colors hover:bg-blue-200",children:"すべて有効"}),a.jsx("button",{type:"button",onClick:()=>n({showDebugPanel:!1,showMousePosition:!1,showPanelSizes:!1,showPlaceholderInfo:!1,showDropZoneOutlines:!1,logLevel:0}),className:"w-full rounded bg-gray-100 px-2 py-1 text-gray-700 text-sm transition-colors hover:bg-gray-200",children:"すべて無効"})]})]})]}):a.jsx("button",{type:"button",onClick:s,className:"fixed right-4 bottom-4 z-50 rounded-lg bg-gray-800 p-2 text-white shadow-lg transition-colors hover:bg-gray-700",title:"デバッグ設定を開く",children:"🛠️"}),ue={prefix:"column",startIndex:1,separator:"_"},De=(t,n=ue)=>{const{prefix:e,startIndex:s,separator:o}=n,l=t+s;return`${e}${o}${l}`},et=(t,n=ue)=>Array.from({length:t},(e,s)=>De(s,n)),Ne=(t,n=ue)=>{const{prefix:e,startIndex:s,separator:o}=n,l=`${e}${o}`;if(!t.startsWith(l))return null;const i=t.slice(l.length),f=parseInt(i,10);return Number.isNaN(f)||f<s?null:f-s},fo=(t,n=ue)=>Ne(t,n)!==null,ho=(t,n=ue)=>{const e=t.map(s=>Ne(s,n)).filter(s=>s!==null).sort((s,o)=>s-o);for(let s=0;s<e.length;s++)if(e[s]!==s)return De(s,n);return De(e.length,n)},Tt=(t,n=ue)=>t.sort((e,s)=>{const o=Ne(e,n)??-1,l=Ne(s,n)??-1;return o-l}),mo=(t,n=ue)=>{const e={};return t.forEach((s,o)=>{const l=De(o,n);e[s]=l}),e},Lt=(t,n,e=ue)=>{const s=[];Object.values(t).forEach(i=>{s.push(...i)});const o={},l=et(n,e);return l.forEach(i=>{o[i]=[]}),s.forEach((i,f)=>{const m=f%n,C=l[m];o[C].push(i)}),o},po=({initialColumns:t,initialPanels:n,debug:e={},onLayoutChange:s})=>{const[o,l]=r.useState(()=>{const g={};for(const b of t)g[b.id]=b.initialWidth||400;return{columns:t,columnWidths:g,isResizing:!1,resizingColumn:null,columnPanels:n,showInsertPlaceholders:!1}}),i=r.useRef(0),f=r.useRef(0);r.useEffect(()=>{s?.(o)},[o,s]);const m=r.useCallback((g,b)=>{R(e,1,"カラム追加:",g.id,"at position:",b),l(_=>{const F=[..._.columns],v=b??F.length;F.splice(v,0,g);const w={..._.columnWidths,[g.id]:g.initialWidth||400},x={..._.columnPanels,[g.id]:[]};return{..._,columns:F,columnWidths:w,columnPanels:x}})},[e]),C=r.useCallback(g=>{R(e,1,"カラム削除:",g),l(b=>{const _=b.columnPanels[g]||[],F=b.columns.filter(k=>k.id!==g);if(F.length===0)return R(e,1,"警告: 最後のカラムを削除しようとしています"),b;const v=F[0].id,w={...b.columnPanels};_.length>0&&(w[v]=[...w[v],..._]),delete w[g];const x={...b.columnWidths};return delete x[g],{...b,columns:F,columnWidths:x,columnPanels:w}})},[e]),y=r.useCallback((g,b)=>{R(e,1,"カラム移動:",g,"->",b),l(_=>{const F=[..._.columns],[v]=F.splice(g,1);return F.splice(b,0,v),{..._,columns:F}})},[e]),M=r.useCallback((g,b)=>{R(e,2,"リサイズ開始:",g,"at X:",b),i.current=b,f.current=o.columnWidths[g]||300,l(_=>({..._,isResizing:!0,resizingColumn:g}))},[e,o.columnWidths]),H=r.useCallback(g=>{const{resizingColumn:b,isResizing:_}=o;if(!(_&&b))return;const F=g-i.current,v=Math.max(100,Math.min(800,f.current+F));R(e,2,"リサイズ中:",b,"new width:",v),l(w=>({...w,columnWidths:{...w.columnWidths,[b]:v}}))},[e,o]),P=r.useCallback(()=>{R(e,2,"リサイズ終了"),l(g=>({...g,isResizing:!1,resizingColumn:null}))},[e]),j=r.useCallback((g,b)=>{R(e,2,"カラム幅設定:",g,b),l(_=>({..._,columnWidths:{..._.columnWidths,[g]:Math.max(100,Math.min(800,b))}}))},[e]),D=r.useCallback(()=>{R(e,1,"カラム幅リセット"),l(g=>{const b={};for(const _ of g.columns)b[_.id]=_.initialWidth||400;return{...g,columnWidths:b}})},[e]),T=r.useCallback((g,b,_,F)=>{R(e,1,"パネル移動:",g,"from",b,"to",_,"at",F),l(v=>{const w={...v.columnPanels};if(b in w&&(w[b]=w[b].filter(x=>x!==g)),_ in w){const x=[...w[_]];x.splice(F,0,g),w[_]=x}return{...v,columnPanels:w}})},[e]),h=r.useCallback((g,b,_)=>{R(e,1,"パネル追加:",g,"to column:",b),l(F=>{const v={...F.columnPanels};b in v||(v[b]=[]);const w=[...v[b]],x=_??w.length;return w.splice(x,0,g),v[b]=w,{...F,columnPanels:v}})},[e]),E=r.useCallback(g=>{R(e,1,"パネル削除:",g),l(b=>{const _={};for(const[F,v]of Object.entries(b.columnPanels))_[F]=v.filter(w=>w!==g);return{...b,columnPanels:_}})},[e]),N=r.useCallback(g=>{R(e,1,"カラム数更新:",g),l(b=>{const _=b.columns.length;if(g===_)return b;const F=Lt(b.columnPanels,g,ue),v=et(g,ue),w=b.isResizing&&b.resizingColumn&&!v.includes(b.resizingColumn);w&&R(e,1,"リサイズ中のカラムが削除されるためリサイズを強制終了:",b.resizingColumn);const x=v.map((B,V)=>({id:B,title:`カラム ${V+1}`,minWidth:350,maxWidth:800,initialWidth:400,resizable:!(V===1&&g===3)})),k={};if(Object.entries(b.columnWidths).some(([,B])=>B!==400))v.forEach(B=>{const V=b.columnWidths[B];V&&V!==400?k[B]=V:k[B]=400});else{const B=_>g?Object.values(b.columnWidths).reduce((d,p)=>d+p,0):g*400,V=Math.max(B/g,350);v.forEach(d=>{k[d]=V})}return{...b,columns:x,columnPanels:F,columnWidths:k,isResizing:w?!1:b.isResizing,resizingColumn:w?null:b.resizingColumn}})},[e]),c=r.useCallback(()=>{R(e,1,"カラム自動バランス調整"),l(g=>{const b=[];for(const v of Object.keys(g.columnPanels))for(const w of g.columnPanels[v])b.push(w);const _={};for(const v of g.columns)_[v.id]=[];let F=0;for(const v of b){const w=g.columns[F%g.columns.length].id;_[w].push(v),F+=1}return{...g,columnPanels:_}})},[e]),I=r.useCallback(g=>o.columns.find(b=>b.id===g),[o.columns]),z=r.useCallback(()=>{let g=0;for(const b of Object.values(o.columnWidths))g+=b;return g},[o.columnWidths]),X=r.useCallback(g=>document.querySelector(`[data-column-id="${g}"]`),[]),q=r.useCallback(g=>{l(b=>({...b,showInsertPlaceholders:g}))},[]);return{layoutState:o,addColumn:m,removeColumn:C,moveColumn:y,startResize:M,handleResize:H,endResize:P,setColumnWidth:j,resetColumnWidths:D,movePanel:T,addPanel:h,removePanel:E,updateColumnCount:N,autoBalanceColumns:c,getColumnById:I,getTotalWidth:z,getColumnElement:X,setShowInsertPlaceholders:q}},It=({debugConfig:t,dragState:n,customDrag:e,clickState:s,dragModes:o,isMouseDown:l,dragOverPosition:i,setCustomDrag:f,setDragState:m,setDragOverPosition:C,setOriginalPanelPosition:y,setClickState:M,setIsMouseDown:H,findPanelPosition:P,performPanelMove:j,showMousePosition:D,updateMousePosition:T,recordMouseDown:h,recordClickPosition:E,isVirtualClick:N,calculateMoveDistance:c,clearMouseTracking:I,resetDragState:z,resetClickState:X,createDragImage:q,updateDragImagePosition:g,removeDragImage:b,handlePlaceholderDragEnter:_,handlePlaceholderDragLeave:F})=>{const v=r.useRef(t);v.current=t;const w=r.useRef(null),x=r.useRef(null),k=r.useRef(0),L=r.useRef(new Me(Ce));r.useEffect(()=>{const p=document.querySelector(Ge);p&&L.current.setScrollElement(p)},[]);const U=r.useRef(i);r.useEffect(()=>{U.current=i,R(v.current,2,"dragOverPositionRef更新:",i)},[i]);const B=r.useCallback(p=>{if(e.isActive||s.isClicked){p.preventDefault();const O=window.getSelection();O&&O.rangeCount>0&&O.removeAllRanges()}if(e.isActive){T(p.clientX,p.clientY),g(p.clientX,p.clientY),L.current.update(p.clientX,p.clientY);const O=document.elementFromPoint(p.clientX,p.clientY),G=O?.closest("[data-drop-zone]");if(G){document.body.classList.add("droppable");const Q=G.getAttribute("data-column-index"),re=Q?parseInt(Q,10):null;re!==null&&re!==n.dragOverColumn&&m(Y=>({...Y,dragOverColumn:re}));const J=O?.closest("[data-placeholder-index]");if(J){const Y=J.getAttribute("data-placeholder-index"),ge=J.getAttribute("data-placeholder-column");if(Y&&ge){const ce=parseInt(Y,10),he=parseInt(ge,10);_(he,ce)}}else F()}else document.body.classList.remove("droppable"),C(null),m(Q=>({...Q,dragOverColumn:null}))}else if(l&&s.isClicked&&s.panelId){if(o[s.panelId]!=="custom"||c(p.clientX,p.clientY)<10)return;R(v.current,1,"🚀 カスタムドラッグ開始 -",s.panelId);const G=document.querySelector(`[data-panel-id="${s.panelId}"]`);if(G&&x.current){const Q=G.getBoundingClientRect(),re=x.current.x-Q.left,J=x.current.y-Q.top;q(s.panelId,re,J),document.body.classList.add("custom-dragging"),f({isActive:!0,panelId:s.panelId,startX:re,startY:J})}m({isDragging:!0,draggedPanel:s.panelId,dragOverColumn:null}),y(P(s.panelId)),D(p.clientX,p.clientY),M({isClicked:!1,panelId:null}),H(!1),I(),x.current=null,w.current&&(clearTimeout(w.current),w.current=null)}},[e.isActive,s,n.dragOverColumn,o,l,T,m,C,c,P,f,y,D,M,H,I,q,g,_,F]),V=r.useCallback(p=>{if(R(v.current,1,"🐭 カスタムドラッグハンドラー - グローバルマウスアップ",{isActive:e.isActive,panelId:e.panelId,dragMode:e.panelId?o[e.panelId]:"unknown"}),e.isActive){L.current.stop();const O=U.current;if(O){const Q=document.elementFromPoint(p.clientX,p.clientY)?.closest("[data-drop-zone]");if(Q){const re=Q.getAttribute("data-column-key");re&&o[e.panelId]==="custom"?(R(v.current,1,"🔄 カスタムドラッグパネル移動実行:",e.panelId,"→",re),j(e.panelId,re,O.insertIndex)):R(v.current,1,"🚫 カスタムドラッグパネル移動スキップ:",e.panelId,"モード:",o[e.panelId])}}b(),document.body.classList.remove("custom-dragging","droppable"),z(),k.current=0}else if(N(p.clientX,p.clientY)){const G=document.elementFromPoint(p.clientX,p.clientY)?.closest("[data-panel-id]"),Q=G?.getAttribute("data-panel-id")??null;if(!(G&&Q)||o[Q]!=="custom"){w.current&&(clearTimeout(w.current),w.current=null),X(),x.current=null,k.current=0;return}k.current+=1,s.isClicked===!1&&k.current===1?(R(v.current,1,"🖱️ 仮想クリック検出 - ドラッグ待機状態へ:",Q),M({isClicked:!0,panelId:Q}),w.current=window.setTimeout(()=>{R(v.current,1,"⏳ クリック待機状態を自動解除:",Q),X(),x.current=null,k.current=0},2e3)):(R(v.current,1,"🚫 クリック待機状態を解除 - 仮想クリック検出停止:",Q),w.current&&(clearTimeout(w.current),w.current=null),X(),x.current=null,k.current=0,w.current=window.setTimeout(()=>{R(v.current,1,"⏳ 仮想クリック検出再開:",Q)},2e3))}else s.isClicked&&(X(),x.current=null,k.current=0);l&&H(!1)},[e.isActive,e.panelId,s,o,l,j,z,X,N,M,H,b]),d=r.useCallback((p,O)=>{if(o[O]!=="custom"){R(v.current,1,"🚫 カスタムドラッグモードではない - スキップ:",O);return}h(p.clientX,p.clientY),s.isClicked&&s.panelId===O&&(H(!0),w.current!==null&&(clearTimeout(w.current),w.current=null),E(p.clientX,p.clientY),x.current={x:p.clientX,y:p.clientY})},[s,o,h,H,E]);return r.useEffect(()=>()=>{w.current!==null&&clearTimeout(w.current),L.current.stop()},[]),{handleGlobalMouseMove:B,handleGlobalMouseUp:V,handleMouseDown:d}},zt=()=>{const[t,n]=r.useState({isDragging:!1,draggedPanel:null,dragOverColumn:null}),[e,s]=r.useState(null),[o,l]=r.useState(null),[i,f]=r.useState({isActive:!1,panelId:"",startX:0,startY:0}),[m,C]=r.useState({isClicked:!1,panelId:null}),[y,M]=r.useState(!1),H=r.useCallback(()=>{f({isActive:!1,panelId:"",startX:0,startY:0}),n({isDragging:!1,draggedPanel:null,dragOverColumn:null}),s(null),l(null)},[]),P=r.useCallback(()=>{C({isClicked:!1,panelId:null}),M(!1)},[]),j=r.useCallback(c=>{n(c)},[]),D=r.useCallback(c=>{s(c)},[]),T=r.useCallback(c=>{l(c)},[]),h=r.useCallback(c=>{f(c)},[]),E=r.useCallback(c=>{C(c)},[]),N=r.useCallback(c=>{M(c)},[]);return{dragState:t,dragOverPosition:e,originalPanelPosition:o,customDrag:i,clickState:m,isMouseDown:y,setDragState:j,setDragOverPosition:D,setOriginalPanelPosition:T,setCustomDrag:h,setClickState:E,setIsMouseDown:N,resetDragState:H,resetClickState:P}},Wt=()=>{const[t,n]=r.useState({x:0,y:0,isVisible:!1}),e=r.useRef(null),s=r.useRef(0),o=r.useRef(null),l=r.useCallback((P,j)=>{n({x:P,y:j,isVisible:!0})},[]),i=r.useCallback(()=>{n(P=>({...P,isVisible:!1}))},[]),f=r.useCallback((P,j)=>{n(D=>D.x===P&&D.y===j?D:{x:P,y:j,isVisible:D.isVisible})},[]),m=r.useCallback((P,j)=>{s.current=Date.now(),o.current={x:P,y:j}},[]),C=r.useCallback((P,j)=>{e.current={x:P,y:j}},[]),y=r.useCallback((P,j,D=500,T=5)=>Date.now()-(s.current||0)>=D||!o.current?!1:Math.sqrt((P-o.current.x)**2+(j-o.current.y)**2)<T,[]),M=r.useCallback((P,j)=>{if(!e.current)return 0;const D=Math.abs(P-e.current.x),T=Math.abs(j-e.current.y);return Math.sqrt(D*D+T*T)},[]),H=r.useCallback(()=>{e.current=null,s.current=0,o.current=null},[]);return{mousePosition:t,lastClickPosition:e.current,mouseDownTime:s.current,mouseDownPosition:o.current,showMousePosition:l,hideMousePosition:i,updateMousePosition:f,recordMouseDown:m,recordClickPosition:C,isVirtualClick:y,calculateMoveDistance:M,clearMouseTracking:H}},Ht=({debugConfig:t,dragState:n,customDrag:e,dragModes:s,columnPanels:o,dragOverPosition:l,originalPanelPosition:i,setDragState:f,setDragOverPosition:m,setOriginalPanelPosition:C,performPanelMove:y,showMousePosition:M,updateMousePosition:H,resetDragState:P,handlePlaceholderDragEnter:j,handlePlaceholderDragLeave:D,scale:T=1})=>{const h=r.useRef(t);h.current=t;const E=r.useRef(o);E.current=o;const N=r.useRef(n);N.current=n;const c=r.useRef(l);c.current=l;const I=r.useRef(i);I.current=i;const z=r.useRef(T);z.current=T;const X=r.useRef(new Me(Ce));r.useEffect(()=>{const v=document.querySelector(Ge);v&&X.current.setScrollElement(v)},[]);const q=r.useCallback((v,w)=>{if(e.isActive){R(h.current,2,"カスタムドラッグアクティブ中 - 通常ドラッグを無効化:",w),v.preventDefault();return}if(s[w]==="custom"){R(h.current,2,"カスタムドラッグモード - 通常ドラッグを無効化:",w),v.preventDefault();return}R(h.current,1,"ドラッグ開始:",w);const x=Object.keys(E.current);let k=null;for(let L=0;L<x.length;L++){const U=x[L],B=E.current[U].indexOf(w);if(B!==-1){k={columnIndex:L,panelIndex:B};break}}if(C(k),v.dataTransfer){v.dataTransfer.setData("text/plain",w),v.dataTransfer.effectAllowed="move";const L=z.current;if(L<1){const U=v.currentTarget.closest("[data-panel-id]")??v.currentTarget,B=U.getBoundingClientRect(),V=U.offsetWidth,d=U.offsetHeight,p=U.cloneNode(!0);p.removeAttribute("data-panel-id"),p.removeAttribute("id"),vt(U,p),p.style.margin="0",p.style.width=`${V}px`,p.style.height=`${d}px`,p.style.transform=`scale(${L})`,p.style.transformOrigin="top left";const O=document.createElement("div");O.style.position="fixed",O.style.top="0",O.style.left="-10000px",O.style.width=`${V*L}px`,O.style.height=`${d*L}px`,O.style.overflow="hidden",O.style.opacity="0.8",O.style.pointerEvents="none",O.appendChild(p),document.body.appendChild(O),v.dataTransfer.setDragImage(O,v.clientX-B.left,v.clientY-B.top),requestAnimationFrame(()=>O.remove())}}M(v.clientX,v.clientY),requestAnimationFrame(()=>{f({isDragging:!0,draggedPanel:w,dragOverColumn:null})})},[s,e.isActive,C,M,f]),g=r.useCallback(()=>{R(h.current,1,"ドラッグ終了"),X.current.stop(),P()},[P]),b=r.useCallback((v,w)=>{if(v.preventDefault(),v.dataTransfer.dropEffect="move",!N.current.isDragging)return;H(v.clientX,v.clientY),w!==N.current.dragOverColumn&&f(L=>({...L,dragOverColumn:w}));const x=document.elementFromPoint(v.clientX,v.clientY),k=x?.closest("[data-placeholder-index]");if(k){const L=k.getAttribute("data-placeholder-index"),U=k.getAttribute("data-placeholder-column");if(L&&U){const B=parseInt(L,10),V=parseInt(U,10);j(V,B)}}else x?.closest("[data-drop-zone]")||D()},[H,f,j,D]),_=r.useCallback((v,w)=>{v.preventDefault();const x=v.dataTransfer.getData("text/plain"),k=c.current;x&&k&&(R(h.current,1,"🎯 ドロップ完了:",{draggedPanel:x,targetColumn:w,insertPosition:`カラム${k.columnIndex} - 位置${k.insertIndex}`}),y(x,w,k.insertIndex),m(null),g())},[y,m,g]),F=r.useCallback(v=>{const w=v.currentTarget,x=v.relatedTarget;x&&w.contains(x)||(m(null),f(k=>({...k,dragOverColumn:null})))},[m,f]);return r.useEffect(()=>{const v=w=>{N.current.isDragging&&(H(w.clientX,w.clientY),X.current.update(w.clientX,w.clientY))};if(n.isDragging)return document.addEventListener("dragover",v),()=>{document.removeEventListener("dragover",v),X.current.stop()}},[n.isDragging,H]),r.useEffect(()=>()=>{X.current.stop()},[]),{handleDragStart:q,handleDragEnd:g,handleDragOverWithInsert:b,handleDropWithInsert:_,handleColumnDragLeave:F}},Ft=(t,n=1)=>{const[e,s]=r.useState(t),[o,l]=r.useState({}),i=r.useRef({}),f=r.useRef(null),m=r.useRef({x:0,y:0}),C=r.useRef(n);C.current=n;const y=r.useCallback(E=>document.querySelector(`[data-panel-id="${E}"]`),[]),M=r.useCallback((E,N)=>{const c=N.getBoundingClientRect(),I=window.getComputedStyle(N),z={width:Math.round(c.width),height:Math.round(c.height),x:Math.round(c.left),y:Math.round(c.top),minHeight:I.minHeight||"auto",maxHeight:I.maxHeight||"none"},X=i.current[E];(!X||Object.keys(z).some(q=>X[q]!==z[q]))&&(i.current[E]=z,l(q=>({...q,[E]:z})))},[]),H=r.useCallback(E=>{const N=y(E);N&&M(E,N)},[y,M]),P=r.useCallback((E,N)=>{N&&requestAnimationFrame(()=>M(E,N))},[M]),j=r.useCallback((E,N,c)=>{const I=y(E);!I||f.current||(f.current=yt(I,E,C.current),m.current={x:N,y:c})},[y]),D=r.useCallback((E,N)=>{f.current&&wt(f.current,E,N,m.current,C.current)},[]),T=r.useCallback(()=>{f.current&&(f.current.remove(),f.current=null)},[]),h=r.useCallback(E=>{s(N=>({...N,[E]:!N[E]}))},[]);return{panelVisibility:e,panelSizes:o,setPanelVisibility:s,setPanelSizes:l,setPanelRef:P,updatePanelSize:H,togglePanelVisibility:h,getPanelElement:y,createDragImage:j,updateDragImagePosition:D,removeDragImage:T}},go=({initialColumnPanels:t,initialPanelVisibility:n,initialDragModes:e={},debugConfig:s,onPanelMove:o,onDragModeChange:l,onColumnPanelsChange:i,scale:f=1})=>{const m=r.useRef(s);m.current=s;const[C,y]=r.useState(t),[M,H]=r.useState(e),P=r.useRef(C),j=r.useRef(M),D=r.useCallback(x=>{if(typeof x=="function")throw new TypeError("setColumnPanels takes the next arrangement itself, not an updater function");P.current=x,y(x)},[]),T=r.useCallback(x=>{if(typeof x=="function")throw new TypeError("setDragModes takes the next drag modes themselves, not an updater function");j.current=x,H(x)},[]),h=zt(),E=Wt(),N=Ft(n,f),c=r.useRef({mousemove:null,mouseup:null}),I=r.useCallback(x=>{const k=Object.keys(P.current),L=Tt(k,ue);for(let U=0;U<L.length;U++){const B=L[U],V=P.current[B]?.indexOf(x)??-1;if(V!==-1)return{columnIndex:U,panelIndex:V}}return null},[]),z=r.useCallback((x,k,L)=>{R(m.current,1,"🔄 パネル移動実行:",x,"→",k,"@",L);const U=P.current,B=Object.keys(U).find(d=>U[d].includes(x));if(B===void 0){console.error("Source column not found for panel:",x);return}if(!U[k]){console.error("Target column not found:",k);return}const V=Fe(U,x,k,L);V!==null&&(D(V),R(m.current,1,"✅ パネル移動完了:",x,"→",k),!(i===void 0&&o===void 0)&&requestAnimationFrame(()=>{const d=[];try{i?.(V)}catch(p){d.push(p)}try{o?.(x,B,k,L)}catch(p){d.push(p)}if(d.length===1)throw d[0];if(d.length===2)throw new AggregateError(d,"onColumnPanelsChange and onPanelMove both threw")}))},[i,o,D]),X=r.useCallback((x,k)=>{if(!(h.dragState.isDragging||h.customDrag.isActive))return;const L=h.originalPanelPosition;if(L!==null&&He(L,x,k)){R(m.current,1,`元の位置への挿入をスキップ: カラム${x}, 位置${k}`);return}const U=h.dragOverPosition;(!U||U.columnIndex!==x||U.insertIndex!==k)&&(R(m.current,1,`プレースホルダーエンター: カラム${x}, 位置${k}`),h.setDragOverPosition({columnIndex:x,insertIndex:k}),h.setDragState(B=>({...B,dragOverColumn:x})))},[h]),q=r.useCallback((x,k,L)=>{if(h.dragState.isDragging||h.customDrag.isActive){if(h.customDrag.isActive)R(m.current,1,"🚫 カスタムドラッグ - プレースホルダーリーブ: ハイライトを解除します。"),h.setDragOverPosition(null);else if(h.dragState.isDragging&&x&&k!==void 0&&L!==void 0){const U=h.dragOverPosition;if(U&&U.columnIndex===k&&U.insertIndex===L){const B=x.currentTarget,V=x.relatedTarget;V&&B.contains(V)||(R(m.current,1,`ノーマルドラッグ - プレースホルダーリーブ: カラム${k}, 位置${L}。ハイライトを解除します。`),h.setDragOverPosition(null))}}}},[h]),g=It({debugConfig:m.current,dragState:h.dragState,customDrag:h.customDrag,clickState:h.clickState,dragModes:M,isMouseDown:h.isMouseDown,originalPanelPosition:h.originalPanelPosition,dragOverPosition:h.dragOverPosition,setCustomDrag:h.setCustomDrag,setDragState:h.setDragState,setDragOverPosition:h.setDragOverPosition,setOriginalPanelPosition:h.setOriginalPanelPosition,setClickState:h.setClickState,setIsMouseDown:h.setIsMouseDown,findPanelPosition:I,performPanelMove:z,showMousePosition:E.showMousePosition,updateMousePosition:E.updateMousePosition,recordMouseDown:E.recordMouseDown,recordClickPosition:E.recordClickPosition,isVirtualClick:E.isVirtualClick,calculateMoveDistance:E.calculateMoveDistance,clearMouseTracking:E.clearMouseTracking,resetDragState:h.resetDragState,resetClickState:h.resetClickState,createDragImage:N.createDragImage,updateDragImagePosition:N.updateDragImagePosition,removeDragImage:N.removeDragImage,handlePlaceholderDragEnter:X,handlePlaceholderDragLeave:q}),b=Ht({debugConfig:m.current,dragState:h.dragState,customDrag:h.customDrag,dragModes:M,columnPanels:C,dragOverPosition:h.dragOverPosition,originalPanelPosition:h.originalPanelPosition,setDragState:h.setDragState,setDragOverPosition:h.setDragOverPosition,setOriginalPanelPosition:h.setOriginalPanelPosition,performPanelMove:z,showMousePosition:E.showMousePosition,updateMousePosition:E.updateMousePosition,resetDragState:h.resetDragState,handlePlaceholderDragEnter:X,handlePlaceholderDragLeave:q,scale:f}),_=r.useCallback(x=>{c.current.mousemove&&c.current.mousemove(x)},[]),F=r.useCallback(x=>{c.current.mouseup&&c.current.mouseup(x)},[]);r.useEffect(()=>(R(m.current,1,"🔧 グローバルイベントリスナー初期化 - refベース管理開始"),document.addEventListener("mousemove",_),document.addEventListener("mouseup",F),()=>{R(m.current,1,"🔴 グローバルイベントリスナー終了 - refベース管理終了"),document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",F)}),[_,F]),r.useEffect(()=>{const x=!h.clickState.isClicked&&Object.entries(M).some(([,L])=>L==="custom"),k=h.clickState.isClicked&&h.clickState.panelId;if(x||k){const L=x?"パターン1(仮想クリック検出)":"パターン2,3(ドラッグ準備)";R(m.current,1,`🔧 イベントハンドラー設定開始: ${L}`),c.current.mousemove=g.handleGlobalMouseMove,c.current.mouseup=g.handleGlobalMouseUp}else h.customDrag.isActive||h.dragState.isDragging||(c.current.mousemove=null,c.current.mouseup=null)},[h.clickState.isClicked,h.clickState.panelId,M,h.customDrag.isActive,h.dragState.isDragging,g.handleGlobalMouseMove,g.handleGlobalMouseUp]);const v=r.useCallback(x=>{R(m.current,1,"🔄 toggleDragMode called:",{panelId:x});const k=j.current,L=(k[x]??"normal")==="normal"?"custom":"normal";if(T({...k,[x]:L}),l!==void 0)try{l(x,L)}catch(U){console.error("🔄 Error in onDragModeChange:",U)}},[l,T]),w=r.useCallback((x,k)=>{x.stopPropagation(),R(m.current,2,"パネルサイズ情報クリック:",k)},[]);return{columnPanels:C,panelVisibility:N.panelVisibility,dragModes:M,dragState:h.dragState,dragOverPosition:h.dragOverPosition,originalPanelPosition:h.originalPanelPosition,customDrag:h.customDrag,clickState:h.clickState,mousePosition:E.mousePosition,panelSizes:N.panelSizes,setColumnPanels:D,setPanelVisibility:N.setPanelVisibility,setDragModes:T,setPanelRef:N.setPanelRef,handleDragStart:b.handleDragStart,handleDragEnd:b.handleDragEnd,handleMouseDown:g.handleMouseDown,handlePlaceholderDragEnter:X,handlePlaceholderDragLeave:q,handleDragOverWithInsert:b.handleDragOverWithInsert,handleDropWithInsert:b.handleDropWithInsert,handleColumnDragLeave:b.handleColumnDragLeave,handlePanelSizeInfoClick:w,toggleDragMode:v,findPanelPosition:I}},xo=({minColumnWidth:t=350,defaultColumns:n=3,maxColumns:e=6,minColumns:s=1,currentColumnWidths:o={}}={})=>{const[l,i]=r.useState(0),f=r.useRef(0),m=r.useRef(null),[C,y]=r.useState(!1),M=r.useRef(n);r.useEffect(()=>{if(typeof window>"u")return;const j=()=>{const T=window.visualViewport?.width??0,h=document?.documentElement?.clientWidth??0,E=document?.body?.clientWidth??0,N=window.innerWidth??0;return h>0?Math.floor(h):T>0?Math.floor(T):E>0?Math.floor(E):Math.floor(N)},D=()=>{m.current!==null&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(()=>{const T=j();m.current=null,T!==0&&(Math.abs(f.current-T)<2||(f.current=T,i(T)))})};return D(),window.addEventListener("resize",D),window.addEventListener("orientationchange",D),window.visualViewport?.addEventListener("resize",D),()=>{m.current!==null&&cancelAnimationFrame(m.current),window.removeEventListener("resize",D),window.removeEventListener("orientationchange",D),window.visualViewport?.removeEventListener("resize",D)}},[]);const H=r.useMemo(()=>{if(!C||l===0)return M.current=n,n;const j=Math.max(l-64,0),D=24,T=Object.values(o);let h;if(T.length>0){const E=T.reduce((I,z)=>I+z,0)/T.length,N=Math.max(t,E);h=Math.floor((j+D)/(N+D)),T.reduce((I,z)=>I+z,0)+(T.length-1)*D>j&&T.length>s&&(h=Math.min(h,T.length-1))}else h=Math.floor((j+D)/(t+D));return h=Math.max(s,Math.min(e,h)),M.current===h?M.current:(M.current=h,h)},[C,l,n,t,e,s,o]),P=r.useCallback(()=>{y(j=>!j)},[]);return{responsiveColumnCount:H,isResponsiveMode:C,screenWidth:l,toggleResponsiveMode:P}};const bo=se("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);const vo=se("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),yo=({isResponsiveMode:t,responsiveColumnCount:n,currentColumnCount:e,screenWidth:s,onToggleResponsive:o})=>a.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-slate-300 bg-white/90 px-3 py-1",children:[a.jsxs("button",{type:"button",onClick:o,className:`flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors ${t?"border border-blue-300 bg-blue-100 text-blue-700":"border border-slate-300 text-slate-600 hover:bg-blue-50 hover:text-blue-600"}`,title:t?"レスポンシブモードを無効化":"レスポンシブモードを有効化",children:[t?a.jsx(vo,{className:"h-3 w-3"}):a.jsx(bo,{className:"h-3 w-3"}),a.jsx("span",{children:t?"レスポンシブ":"固定"})]}),t&&a.jsxs("div",{className:"flex items-center gap-1 text-slate-600 text-xs",children:[a.jsxs("span",{className:"font-mono",children:[s,"px"]}),a.jsx("span",{children:"→"}),a.jsxs("span",{className:"font-semibold text-blue-600",children:[n,"列"]}),n!==e&&a.jsx("span",{className:"text-orange-600",children:"(変更予定)"})]})]}),wo={showDebugPanel:!1,showMousePosition:!1,showPanelSizes:!1,showPlaceholderInfo:!1,showDropZoneOutlines:!1,logLevel:0};A.ColumnControlPanel=co,A.ColumnInsertPanel=io,A.DEFAULT_COLUMN_ID_CONFIG=ue,A.DEFAULT_DEBUG_CONFIG=wo,A.DEFAULT_DRAG_DROP_LAYOUT_LABELS=Un,A.DEFAULT_EDGE_SCROLL_CONFIG=Ce,A.DEFAULT_TOUCH_DRAG_CONFIG=At,A.DebugControlPanel=uo,A.DragDropLayout=so,A.DropZoneDebugOverlay=Xe,A.EdgeScrollManager=Me,A.InsertPlaceholder=Be,A.PANEL_ACTION_ATTRIBUTE=we,A.PANEL_MOVES=ve,A.PANEL_MOVE_SHORTCUTS=Ue,A.PanelSizeDisplay=mt,A.ResizableColumn=Jn,A.ResizeHandle=Ke,A.ResponsiveControl=yo,A.SCROLL_ROOT_SELECTOR=Ge,A.TEMPLATE_PLACEHOLDERS=St,A.availablePanelMoves=gt,A.calculateScrollVector=Ze,A.createColumnIdMapping=mo,A.debugLog=R,A.generateColumnId=De,A.generateColumnIds=et,A.getNextColumnId=ho,A.insertPanelAt=Fe,A.isValidColumnId=fo,A.movePanelInColumns=xt,A.normalizeColumnPanels=Lt,A.panelMoveOfKey=bt,A.parseColumnId=Ne,A.performScroll=jt,A.shownPanelPlace=ye,A.sortColumnIds=Tt,A.useColumnLayout=po,A.useCustomDragHandlers=It,A.useDragDropColumns=go,A.useDragDropState=zt,A.useMouseTracking=Wt,A.useNormalDragHandlers=Ht,A.usePanelManagement=Ft,A.useResponsiveColumns=xo,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})}));