UNPKG

create-appncy

Version:

Create projects as goncy would

1 lines 6.78 kB
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,94446,e=>{"use strict";e.i(44002);var t=e.i(93930);let n={};function r(e,r){let l=t.useRef(n);return l.current===n&&(l.current=e(r)),l}let l=t[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],o=l&&l!==t.useLayoutEffect?l:e=>e();function u(){let e={next:void 0,callback:a,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function a(){}let i="u">typeof document?t.useLayoutEffect:()=>{};function c(e,t){return e&&!t?e:!e&&t?t:e||t?{...e,...t}:void 0}let f={};function s(e,t,n,r,l){if(!n&&!r&&!l&&!e)return d(t);let o=d(e);return t&&(o=p(o,t)),n&&(o=p(o,n)),r&&(o=p(o,r)),l&&(o=p(o,l)),o}function d(e){return b(e)?{...v(e,f)}:function(e){let t={...e};for(let e in t){let n=t[e];y(e,n)&&(t[e]=m(n))}return t}(e)}function p(e,t){return b(t)?v(t,e):function(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case"style":e[n]=c(e.style,r);break;case"className":e[n]=h(e.className,r);break;default:y(n,r)?e[n]=function(e,t){return t?e?(...n)=>{let r=n[0];if(k(r)){g(r);let l=t(...n);return r.baseUIHandlerPrevented||e?.(...n),l}let l=t(...n);return e?.(...n),l}:m(t):e}(e[n],r):e[n]=r}}return e}(e,t)}function y(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),l=e.charCodeAt(2);return 111===n&&110===r&&l>=65&&l<=90&&("function"==typeof t||void 0===t)}function b(e){return"function"==typeof e}function v(e,t){return b(e)?e(t):e??f}function m(e){return e?(...t)=>{let n=t[0];return k(n)&&g(n),e(...t)}:e}function g(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function h(e,t){return t?e?t+" "+e:t:e}function k(e){return null!=e&&"object"==typeof e&&"nativeEvent"in e}let w=function(e,...t){let n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(e=>n.searchParams.append("args[]",e)),`Base UI error #${e}; visit ${n} for the full message.`},E=t.createContext(void 0);function C(e){return function(e){var t;return!!("u">typeof window)&&(e instanceof HTMLElement||e instanceof((null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window).HTMLElement)}(e)&&"BUTTON"===e.tagName}function D(e,t,n,l){var o,u,a,i,c;let f=r(T).current;return o=f,u=e,a=t,i=n,c=l,(o.refs[0]!==u||o.refs[1]!==a||o.refs[2]!==i||o.refs[3]!==c)&&U(f,[e,t,n,l]),f.callback}function T(){return{callback:null,cleanup:null,refs:[]}}function U(e,t){if(e.refs=t,t.every(e=>null==e)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),null!=n){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let l=t[e];if(null!=l)switch(typeof l){case"function":{let t=l(n);"function"==typeof t&&(r[e]=t);break}case"object":l.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(null!=n)switch(typeof n){case"function":{let t=r[e];"function"==typeof t?t():n(null);break}case"object":n.current=null}}}}}}let A=parseInt(t.version,10);function I(e){if(!t.isValidElement(e))return null;let n=e.props;return(A>=19?n?.ref:e.ref)??null}Object.freeze([]);let P=Object.freeze({}),x=Symbol.for("react.lazy"),B=t.forwardRef(function(e,n){let{render:l,className:a,disabled:y=!1,focusableWhenDisabled:b=!1,nativeButton:v=!0,style:m,...k}=e,{getButtonProps:A,buttonRef:B}=function(e={}){var n;let l,{disabled:a=!1,focusableWhenDisabled:c,tabIndex:f=0,native:d=!0,composite:p}=e,y=t.useRef(null),b=function(e=!1){let n=t.useContext(E);if(void 0===n&&!e)throw Error(w(16));return n}(!0),v=p??void 0!==b,{props:m}=function(e){let{focusableWhenDisabled:n,disabled:r,composite:l=!1,tabIndex:o=0,isNativeButton:u}=e,a=l&&!1!==n,i=l&&!1===n;return{props:t.useMemo(()=>{let e={onKeyDown(e){r&&n&&"Tab"!==e.key&&e.preventDefault()}};return l||(e.tabIndex=o,!u&&r&&(e.tabIndex=n?o:-1)),(u&&(n||a)||!u&&r)&&(e["aria-disabled"]=r),u&&(!n||i)&&(e.disabled=r),e},[l,r,n,a,i,u,o])}}({focusableWhenDisabled:c,disabled:a,composite:v,tabIndex:f,isNativeButton:d}),h=t.useCallback(()=>{let e=y.current;C(e)&&v&&a&&void 0===m.disabled&&e.disabled&&(e.disabled=!1)},[a,m.disabled,v]);return i(h,[h]),{getButtonProps:t.useCallback((e={})=>{let{onClick:t,onMouseDown:n,onKeyUp:r,onKeyDown:l,onPointerDown:o,...u}=e;return s({type:d?"button":void 0,onClick(e){a?e.preventDefault():t?.(e)},onMouseDown(e){a||n?.(e)},onKeyDown(e){var n;if(a||(g(e),l?.(e),e.baseUIHandlerPrevented))return;let r=e.target===e.currentTarget,o=e.currentTarget,u=C(o),i=!d&&(n=o,!!(n?.tagName==="A"&&n?.href)),c=r&&(d?u:!i),f="Enter"===e.key,s=" "===e.key,p=o.getAttribute("role"),y=p?.startsWith("menuitem")||"option"===p||"gridcell"===p;if(r&&v&&s){if(e.defaultPrevented&&y)return;e.preventDefault(),i||d&&u?(o.click(),e.preventBaseUIHandler()):c&&(t?.(e),e.preventBaseUIHandler());return}c&&(!d&&(s||f)&&e.preventDefault(),!d&&f&&t?.(e))},onKeyUp(e){a||((g(e),r?.(e),e.target===e.currentTarget&&d&&v&&C(e.currentTarget)&&" "===e.key)?e.preventDefault():!e.baseUIHandlerPrevented&&(e.target!==e.currentTarget||d||v||" "!==e.key||t?.(e)))},onPointerDown(e){a?e.preventDefault():o?.(e)}},d?void 0:{role:"button"},m,u)},[a,m,v,d]),buttonRef:(n=e=>{y.current=e,h()},(l=r(u).current).next=n,o(l.effect),l.trampoline)}}({disabled:y,focusableWhenDisabled:b,native:v});return function(e,n,l={}){let o=n.render,u=function(e,t={}){var n,l,o;let{className:u,style:a,render:i}=e,{state:y=P,ref:b,props:v,stateAttributesMapping:m,enabled:g=!0}=t,k=g?"function"==typeof u?u(y):u:void 0,w=g?"function"==typeof a?a(y):a:void 0,E=g?function(e,t){let n={};for(let r in e){let l=e[r];if(t?.hasOwnProperty(r)){let e=t[r](l);null!=e&&Object.assign(n,e);continue}!0===l?n[`data-${r.toLowerCase()}`]="":l&&(n[`data-${r.toLowerCase()}`]=l.toString())}return n}(y,m):P,C=g&&v?function(e){if(Array.isArray(e)){if(0===e.length)return f;if(1===e.length)return d(e[0]);let t=d(e[0]);for(let n=1;n<e.length;n+=1)t=p(t,e[n]);return t}return s(void 0,e)}(v):void 0,A=g?c(E,C)??{}:P;if("u">typeof document)if(g)if(Array.isArray(b)){let e;n=[A.ref,I(i),...b],l=e=r(T).current,o=n,(l.refs.length!==o.length||l.refs.some((e,t)=>e!==o[t]))&&U(e,n),A.ref=e.callback}else A.ref=D(A.ref,I(i),b);else D(null,null);return g?(void 0!==k&&(A.className=h(A.className,k)),void 0!==w&&(A.style=c(A.style,w)),A):P}(n,l);return!1===l.enabled?null:function(e,n,r,l){if(n){if("function"==typeof n)return n(r,l);let e=s(r,n.props);e.ref=r.ref;let o=n;return o?.$$typeof===x&&(o=t.Children.toArray(n)[0]),t.cloneElement(o,e)}if(e&&"string"==typeof e){var o,u;return o=e,u=r,"button"===o?(0,t.createElement)("button",{type:"button",...u,key:u.key}):"img"===o?(0,t.createElement)("img",{alt:"",...u,key:u.key}):t.createElement(o,u)}throw Error(w(8))}(e,o,u,l.state??P)}("button",e,{state:{disabled:y},ref:[n,B],props:[k,A]})});e.s(["Button",0,B],94446)}]);