mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-10 18:02:55 +00:00
7 lines
8.8 KiB
JavaScript
Vendored
7 lines
8.8 KiB
JavaScript
Vendored
import{c as M}from"./@traptitech.b6e72224.js";var P={exports:{}};/*!
|
|
* clipboard.js v2.0.11
|
|
* https://clipboardjs.com/
|
|
*
|
|
* Licensed MIT © Zeno Rocha
|
|
*/(function(C,N){(function(b,O){C.exports=O()})(M,function(){return O={686:function(l,n,t){t.d(n,{default:function(){return R}});var n=t(279),c=t.n(n),n=t(370),y=t.n(n),n=t(817),s=t.n(n);function p(o){try{return document.execCommand(o)}catch{return}}var g=function(o){return o=s()(o),p("cut"),o};function h(f,i){var r,a,f=(r=f,a=document.documentElement.getAttribute("dir")==="rtl",(f=document.createElement("textarea")).style.fontSize="12pt",f.style.border="0",f.style.padding="0",f.style.margin="0",f.style.position="absolute",f.style[a?"right":"left"]="-9999px",a=window.pageYOffset||document.documentElement.scrollTop,f.style.top="".concat(a,"px"),f.setAttribute("readonly",""),f.value=r,f);return i.container.appendChild(f),i=s()(f),p("copy"),f.remove(),i}var m=function(o){var i=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{container:document.body},r="";return typeof o=="string"?r=h(o,i):o instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(o==null?void 0:o.type)?r=h(o.value,i):(r=s()(o),p("copy")),r};function w(o){return(w=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i})(o)}var x=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},r=a.action,o=r===void 0?"copy":r,i=a.container,r=a.target,a=a.text;if(o!=="copy"&&o!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(r!==void 0){if(!r||w(r)!=="object"||r.nodeType!==1)throw new Error('Invalid "target" value, use a valid Element');if(o==="copy"&&r.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(o==="cut"&&(r.hasAttribute("readonly")||r.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}return a?m(a,{container:i}):r?o==="cut"?g(r):m(r,{container:i}):void 0};function E(o){return(E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i})(o)}function S(o,i){for(var r=0;r<i.length;r++){var a=i[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,a.key,a)}}function T(o,i){return(T=Object.setPrototypeOf||function(r,a){return r.__proto__=a,r})(o,i)}function _(o){var i=function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var r,a=k(o);return r=i?(r=k(this).constructor,Reflect.construct(a,arguments,r)):a.apply(this,arguments),a=this,!(r=r)||E(r)!=="object"&&typeof r!="function"?function(f){if(f!==void 0)return f;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(a):r}}function k(o){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)})(o)}function L(o,i){if(o="data-clipboard-".concat(o),i.hasAttribute(o))return i.getAttribute(o)}var R=function(){(function(u,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(d&&d.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),d&&T(u,d)})(f,c());var o,i,r,a=_(f);function f(u,d){var v;return function(A){if(!(A instanceof f))throw new TypeError("Cannot call a class as a function")}(this),(v=a.call(this)).resolveOptions(d),v.listenClick(u),v}return o=f,r=[{key:"copy",value:function(u){var d=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{container:document.body};return m(u,d)}},{key:"cut",value:function(u){return g(u)}},{key:"isSupported",value:function(){var u=0<arguments.length&&arguments[0]!==void 0?arguments[0]:["copy","cut"],u=typeof u=="string"?[u]:u,d=!!document.queryCommandSupported;return u.forEach(function(v){d=d&&!!document.queryCommandSupported(v)}),d}}],(i=[{key:"resolveOptions",value:function(){var u=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof u.action=="function"?u.action:this.defaultAction,this.target=typeof u.target=="function"?u.target:this.defaultTarget,this.text=typeof u.text=="function"?u.text:this.defaultText,this.container=E(u.container)==="object"?u.container:document.body}},{key:"listenClick",value:function(u){var d=this;this.listener=y()(u,"click",function(v){return d.onClick(v)})}},{key:"onClick",value:function(A){var d=A.delegateTarget||A.currentTarget,v=this.action(d)||"copy",A=x({action:v,container:this.container,target:this.target(d),text:this.text(d)});this.emit(A?"success":"error",{action:v,text:A,trigger:d,clearSelection:function(){d&&d.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(u){return L("action",u)}},{key:"defaultTarget",value:function(u){if(u=L("target",u),u)return document.querySelector(u)}},{key:"defaultText",value:function(u){return L("text",u)}},{key:"destroy",value:function(){this.listener.destroy()}}])&&S(o.prototype,i),r&&S(o,r),f}()},828:function(l){var e;typeof Element=="undefined"||Element.prototype.matches||((e=Element.prototype).matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector),l.exports=function(t,c){for(;t&&t.nodeType!==9;){if(typeof t.matches=="function"&&t.matches(c))return t;t=t.parentNode}}},438:function(l,e,t){var c=t(828);function y(n,s,p,g,h){var m=function(w,x,E,S){return function(T){T.delegateTarget=c(T.target,x),T.delegateTarget&&S.call(w,T)}}.apply(this,arguments);return n.addEventListener(p,m,h),{destroy:function(){n.removeEventListener(p,m,h)}}}l.exports=function(n,s,p,g,h){return typeof n.addEventListener=="function"?y.apply(null,arguments):typeof p=="function"?y.bind(null,document).apply(null,arguments):(typeof n=="string"&&(n=document.querySelectorAll(n)),Array.prototype.map.call(n,function(m){return y(m,s,p,g,h)}))}},879:function(l,e){e.node=function(t){return t!==void 0&&t instanceof HTMLElement&&t.nodeType===1},e.nodeList=function(t){var c=Object.prototype.toString.call(t);return t!==void 0&&(c==="[object NodeList]"||c==="[object HTMLCollection]")&&"length"in t&&(t.length===0||e.node(t[0]))},e.string=function(t){return typeof t=="string"||t instanceof String},e.fn=function(t){return Object.prototype.toString.call(t)==="[object Function]"}},370:function(l,e,t){var c=t(879),y=t(438);l.exports=function(n,s,p){if(!n&&!s&&!p)throw new Error("Missing required arguments");if(!c.string(s))throw new TypeError("Second argument must be a String");if(!c.fn(p))throw new TypeError("Third argument must be a Function");if(c.node(n))return x=s,E=p,(w=n).addEventListener(x,E),{destroy:function(){w.removeEventListener(x,E)}};if(c.nodeList(n))return g=n,h=s,m=p,Array.prototype.forEach.call(g,function(S){S.addEventListener(h,m)}),{destroy:function(){Array.prototype.forEach.call(g,function(S){S.removeEventListener(h,m)})}};if(c.string(n))return n=n,s=s,p=p,y(document.body,n,s,p);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var g,h,m,w,x,E}},817:function(l){l.exports=function(e){var t,c=e.nodeName==="SELECT"?(e.focus(),e.value):e.nodeName==="INPUT"||e.nodeName==="TEXTAREA"?((t=e.hasAttribute("readonly"))||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),t||e.removeAttribute("readonly"),e.value):(e.hasAttribute("contenteditable")&&e.focus(),c=window.getSelection(),(t=document.createRange()).selectNodeContents(e),c.removeAllRanges(),c.addRange(t),c.toString());return c}},279:function(l){function e(){}e.prototype={on:function(t,c,y){var n=this.e||(this.e={});return(n[t]||(n[t]=[])).push({fn:c,ctx:y}),this},once:function(t,c,y){var n=this;function s(){n.off(t,s),c.apply(y,arguments)}return s._=c,this.on(t,s,y)},emit:function(t){for(var c=[].slice.call(arguments,1),y=((this.e||(this.e={}))[t]||[]).slice(),n=0,s=y.length;n<s;n++)y[n].fn.apply(y[n].ctx,c);return this},off:function(t,c){var y=this.e||(this.e={}),n=y[t],s=[];if(n&&c)for(var p=0,g=n.length;p<g;p++)n[p].fn!==c&&n[p].fn._!==c&&s.push(n[p]);return s.length?y[t]=s:delete y[t],this}},l.exports=e,l.exports.TinyEmitter=e}},j={},b.n=function(l){var e=l&&l.__esModule?function(){return l.default}:function(){return l};return b.d(e,{a:e}),e},b.d=function(l,e){for(var t in e)b.o(e,t)&&!b.o(l,t)&&Object.defineProperty(l,t,{enumerable:!0,get:e[t]})},b.o=function(l,e){return Object.prototype.hasOwnProperty.call(l,e)},b(686).default;function b(l){if(j[l])return j[l].exports;var e=j[l]={exports:{}};return O[l](e,e.exports,b),e.exports}var O,j})})(P);export{P as c};
|