text: /**
   * Copyright (c) 2014, 2017, Oracle and/or its affiliates.
   * The Universal Permissive License (UPL), Version 1.0
   */
  "use strict";
  define(["ojs/ojcore","jquery","knockout","ojs/ojcomponentcore","ojs/ojcomposite"],function(a,g,c){a.vh.register("oj-file-picker",{view:{inline:"\x3cinput type\x3d'file' style\x3d'display:none'       data-bind\x3d\"attr:{multiple: $props.selectionMode \x3d\x3d 'multiple',                         accept: acceptStr}\"\x3e\x3c/input\x3e\x3cdiv class\x3d'oj-filepicker-clickable'\x3e  \x3coj-slot name\x3d'trigger'\x3e    \x3cdiv tabindex\x3d'0'         class\x3d'oj-filepicker-dropzone'\x3e      \x3cp class\x3d'oj-filepicker-text' data-bind\x3d'text: dropzoneText'\x3e\x3c/p\x3e    \x3c/div\x3e  \x3c/oj-slot\x3e\x3c/div\x3e"},
  viewModel:{inline:function(b){function d(a){var b=w[0],c=g(u).find(".oj-filepicker-clickable")[0];b&&(b.removeEventListener("dragenter",t,!1),b.removeEventListener("dragover",s,!1),b.removeEventListener("dragleave",n,!1),b.removeEventListener("dragend",n,!1),b.removeEventListener("drop",r,!1));c&&(c.removeEventListener("click",e,!1),c.removeEventListener("keypress",e,!1));switch(a){case "click":k(c);break;case "drop":l(b);c&&c.addEventListener("keypress",e,!1);break;default:k(c),l(b)}}function e(){x=
  !0;y.click();return!0}function f(a){a.preventDefault();a.stopPropagation();var b=a.target.files;0<b.length&&q(b,a);x=!1}function h(b){var c=v.accept;if(!c||0==c.length||!b)return!0;for(var d,e=0;e<c.length;e++){d=a.Ua.trim(c[e]);if(!d)return!0;if(d.Dp(".",0)){if(!b.name||b.name&&b.name.xXa(d))return!0}else if(!b.type)break;else if("image/*"==d){if(b.type.Dp("image/",0))return!0}else if("video/*"==d){if(b.type.Dp("video/",0))return!0}else if("audio/*"==d){if(b.type.Dp("audio/",0))return!0}else if(b.type==
  d)return!0}return!1}function k(a){a&&(a.addEventListener("click",e,!1),a.addEventListener("keypress",e,!1))}function l(a){a&&(a.addEventListener("dragenter",t,!1),a.addEventListener("dragover",s,!1),a.addEventListener("dragleave",n,!1),a.addEventListener("dragend",n,!1),a.addEventListener("drop",r,!1))}function m(a){var b="single"!=u.selectionMode||1==a.length;if(b)a:{if(a)for(b=0;b<a.length;b++)if(!h(a[b])){a=!1;break a}a=!0}else a=b;return a}function p(a){return a instanceof DragEvent?a:a.originalEvent}
  function t(a){a.preventDefault();a.stopPropagation()}function s(a){a.preventDefault();a.stopPropagation();a=p(a);var b=m(a.dataTransfer.items);b?(a.dataTransfer.dropEffect="copy",w.addClass("oj-valid-drop")):a.dataTransfer.dropEffect="none";return b}function n(a){a.preventDefault();a.stopPropagation();w.removeClass("oj-valid-drop")}function r(b){var c=p(b).dataTransfer.files;if(m(c))q(p(b).dataTransfer.files,b);else{var d="";if(c)for(var e=0;e<c.length;e++)d+=c[e].name+" ";a.C.warn("oj-file-picker: Files "+
  d+" are not acceptable.")}n(b)}function q(a,b){var c=new CustomEvent("select",{detail:{files:a,originalEvent:b}});u.dispatchEvent(c)}var u=b.element,v,w,y,x=!1;b.props.then(function(a){v=a});this.acceptStr=c.pureComputed(function(){var a=v.accept;return a&&a.length?a.join(","):null},this);u.addEventListener("selectOnChanged",function(a){d(a.detail.value)});this.dropzoneText=a.ya.R("oj-ojFilePicker.dropzoneText");this.bindingsApplied=function(){var b=g(u);b.addClass("oj-filepicker");w=b.find(".oj-filepicker-dropzone");
  d(v.selectOn);b=b.find("input");b.length&&(y=b[0],y.addEventListener("change",f,!1));w.length&&(w[0].addEventListener("focus",function(){x||(a.Q.Mqa()?w.removeClass("oj-focus-highlight"):w.addClass("oj-focus-highlight"))}),w[0].addEventListener("focusout",function(){x||w.removeClass("oj-focus-highlight")}))}}},metadata:{inline:{properties:{accept:{type:"Array"},selectOn:{type:"string",enumValues:["auto","click","drop","clickAndDrop"],value:"auto"},selectionMode:{type:"string",enumValues:["multiple",
  "single"],value:"multiple"}},events:{select:{}}}}})});